all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Modifying the Mode Line
Date: Fri, 11 Mar 2005 10:58:18 -0700	[thread overview]
Message-ID: <39e4i1F62rgt8U1@individual.net> (raw)
In-Reply-To: <87acpbkrcw.fsf@thalassa.informatimago.com>

Pascal Bourguignon wrote:
 > John Laiosa <jlaiosa@draper.com> writes:
 >>2.) I want to add the full path as it appears in the buffer list so I 
know
 >>what directory the file came from.
 >
 > See the variable: default-mode-line-format

Which leads you to mode-line-format, which leads you to
mode-line-buffer-identification:

,----
| mode-line-buffer-identification's value is shown below.
|
| Documentation:
| Mode-line control for identifying the buffer being displayed.
| Its default value is ("%12b").
| Major modes that edit things other than ordinary files may change this
| (e.g. Info, Dired,...)
|
| Defined in `bindings'.
|
| Value:
| (#("%12b" 0 4
|    (face
|     (:weight bold)
|     help-echo "mouse-1: previous buffer, mouse-3: next buffer" local-map
|     (keymap
|      (header-line keymap
|                   (mouse-3 . mode-line-bury-buffer)
|                   (down-mouse-3 . ignore)
|                   (mouse-1 . mode-line-unbury-buffer)
|                   (down-mouse-1 . ignore))
|      (mode-line keymap
|                 (mouse-3 . mode-line-bury-buffer)
|                 (mouse-1 . mode-line-unbury-buffer)
|                 (down-mouse-1 . ignore))))))
`----

If you do the obvious thing

(setq mode-line-buffer-identification
       '(buffer-file-name "%12f" "%12b"))

I suspect you'll lose all those useful text properties (not to mention
it's a buffer-local variable, but not documented as such).  But
bindings.el shows how to do it right:

(setq-default mode-line-buffer-identification
	      (list 'buffer-file-name
		    (propertized-buffer-identification "%12f")
		    (propertized-buffer-identification "%12b")))

Another alternative is to change the way buffers are named, to include
enough parts of the directory to keep them distinct:

(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)

-- 
Kevin Rodgers

  reply	other threads:[~2005-03-11 17:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3365.1110493647.32256.help-gnu-emacs@gnu.org>
2005-03-10 23:34 ` Modifying the Mode Line Pascal Bourguignon
2005-03-11 17:58   ` Kevin Rodgers [this message]
2005-03-10 22:09 John Laiosa
2005-03-10 22:49 ` Peter Dyballa

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=39e4i1F62rgt8U1@individual.net \
    --to=ihs_4664@yahoo.com \
    /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.