help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tilde in dired default-directory but not elsewhere


From: Michael Heerdegen
Subject: Re: tilde in dired default-directory but not elsewhere
Date: Wed, 09 Jul 2014 23:14:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux)

Emanuel Berg <address@hidden> writes:

> (setq    column-number-mode  nil)
> (setq    line-number-mode    nil)
> (defvar  show-modified       t)
> (defvar  show-path           t)
> (defvar  show-modes          nil)
>
> (setq-default mode-line-format
>    `(" "
>      (show-modified mode-line-modified)
>      " "
>      (show-path (:eval (abbreviate-file-name (buffer-file-name)) ))
>      " "
>      (show-modes mode-line-modes)
>      (line-number-mode   "[%l] ")
>      (column-number-mode "{%c}")
>      ))

Looks like a reasonable approach.  Be careful with errors from :eval
expressions, e.g.

  (:eval (abbreviate-file-name (buffer-file-name)) )

will give you annoying error messages when redisplay is performed when
(buffer-file-name) yields nil.  Of course you can ensure that show-path
is always nil in this case ... but

    (:eval (and buffer-file-name (abbreviate-file-name buffer-file-name)))

is probably safer.


Michael.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]