Alex Rivera | Logout

Display path of file in status bar

Asked 2010-05-25T09:30:43.997
38

GNU Emacs 23.1.1

I am wondering is there a way to display the path of the file in the status bar, instead of just the filename.

I have to open many files in many directories, and sometimes I forget what directory they are in. Just easier to display the some of the path in the status bar if that is possible.

Sometimes my directory paths are very long.

for example

/projects/clientserver/trunk/src/client/client.c

like this in the status bar, just display the last two directories.

/src/client/client.c

Many thanks for any suggestions,

Edit
Report

1 Answer

8

This one works well for me for setting the full path in the frame:

(setq frame-title-format
  '(:eval
    (if buffer-file-name
        (replace-regexp-in-string
         "\\\\" "/"
         (replace-regexp-in-string
          (regexp-quote (getenv "HOME")) "~"
          (convert-standard-filename buffer-file-name)))
      (buffer-name))))
answered 2010-05-25T14:18:29.063

Your Answer