all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: tilde in dired default-directory but not elsewhere
Date: Wed, 09 Jul 2014 23:14:49 +0200	[thread overview]
Message-ID: <87y4w2xmie.fsf@web.de> (raw)
In-Reply-To: 87fviao1a1.fsf@debian.uxu

Emanuel Berg <embe8573@student.uu.se> 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	other threads:[~2014-07-09 21:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 21:38 tilde in dired default-directory but not elsewhere Emanuel Berg
2014-07-08 18:27 ` Michael Heerdegen
     [not found] ` <mailman.5106.1404870369.1147.help-gnu-emacs@gnu.org>
2014-07-09 16:47   ` Emanuel Berg
2014-07-09 17:43   ` Emanuel Berg
2014-07-09 17:56     ` Michael Heerdegen
     [not found]     ` <mailman.5128.1404928614.1147.help-gnu-emacs@gnu.org>
2014-07-09 18:05       ` Emanuel Berg
2014-07-09 21:14         ` Michael Heerdegen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y4w2xmie.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.