0

I wanna to set my title bar like plugin.el@~/.emacs.d/plugin/ , the plugin.el file is in the plugin directory, I googled a lot, no result just is like what I need.

  1. the order of file name and directory name
  2. change /home/username to ~ if the file is in my home directory
  3. the string after @ is just directory name without the file name

Please help...

CodyChan
  • 1,776
  • 22
  • 35

1 Answers1

3

Set frame-title-format to something like (:eval (let ((b (buffer-file-name))) (format "%s@%s" (file-name-nondirectory b) (file-name-directory b)))).

Maybe what you are actually looking for is a different uniquification policy, though. This will affect the mode line, the actual buffer names, and (in many standard configurations) the frame title.

tripleee
  • 175,061
  • 34
  • 275
  • 318
  • Thank you, very close, but change the HOME to ~, please – CodyChan Jan 02 '14 at 20:11
  • 2
    The links I included are insufficient for figuring that out? Wrap the directory part in [`abbreviate-file-name`](http://www.gnu.org/software/emacs/manual/html_node/elisp/Directory-Names.html#Directory-Names). Maybe still not 100% there but then this is a programming help site, not a free coding service. – tripleee Jan 02 '14 at 20:45