diff options
author | Dante Catalfamo | 2021-05-28 16:59:21 -0400 |
---|---|---|
committer | Dante Catalfamo | 2021-05-28 16:59:21 -0400 |
commit | 74c075b634c537bf9704f3e1e63bd7a4770f9f27 (patch) | |
tree | 1c2b075294baf33f7a425e018d639c83671c9ab0 | |
parent | 6828cb365ab63a00840cf5bd9d36039f8df9b6c0 (diff) | |
download | blog-74c075b634c537bf9704f3e1e63bd7a4770f9f27.tar.gz blog-74c075b634c537bf9704f3e1e63bd7a4770f9f27.tar.bz2 blog-74c075b634c537bf9704f3e1e63bd7a4770f9f27.zip |
Add emacs-frame-title
-rw-r--r-- | content/posts/eamacs-improved-frame-title/cover.png | bin | 0 -> 21363 bytes | |||
-rw-r--r-- | content/posts/eamacs-improved-frame-title/index.org | 40 |
2 files changed, 40 insertions, 0 deletions
diff --git a/content/posts/eamacs-improved-frame-title/cover.png b/content/posts/eamacs-improved-frame-title/cover.png Binary files differnew file mode 100644 index 0000000..7a42306 --- /dev/null +++ b/content/posts/eamacs-improved-frame-title/cover.png diff --git a/content/posts/eamacs-improved-frame-title/index.org b/content/posts/eamacs-improved-frame-title/index.org new file mode 100644 index 0000000..ff1bc15 --- /dev/null +++ b/content/posts/eamacs-improved-frame-title/index.org @@ -0,0 +1,40 @@ +#+TITLE: An Improved Emacs Frame Title Format +#+DATE: 2021-05-28T16:26:12-04:00 +#+DRAFT: true +#+DESCRIPTION: +#+TAGS[]: emacs +#+KEYWORDS[]: emacs +#+SLUG: +#+SUMMARY: + +#+ATTR_HTML: :title Old vs. New Frame Title +#+ATTR_HTML: :alt Old vs. New Frame Title +[[file:cover.png]] + +I've often found that the default Emacs frame title is a little +bizarre. =emacs@host= Seems a little useless at describing what's +going on in the actual window in my opinion, and I believe the space +could be put to much better use. Perhaps it's designed for +environments where X11 forwarding is common practice, or where GNU +Emacs shares a system with XEmacs. + +Taking inspiration from both Emacs and Firefox, I came up with a frame +title format that I think is much more useful. + +#+begin_src emacs-lisp +(setq frame-title-format '("%b@" (:eval (or (file-remote-p default-directory 'host) system-name)) " — Emacs")) +#+end_src + +Instead of =emacs@hostname=, I use =buffer-name@buffer-host — Emacs=. +Here =buffer-name= is the name of the currently focused buffer, and +=buffer-host= is the host on which the buffer's file resides. This +means that if you're connected over TRAMP to another host, the remote +host's name will be displayed in the frame title. I then added =— +Emacs= at the end, so that it's still obvious which program owns the +window. + +It's possible to customize the title a lot more, but this seems to be +a good middle ground for me. =frame-title-format= uses the same +formatting template as =mode-line-format=, so you can check that +variable with =describe-variable= too see all the formatting options +available. |