all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Manipulating the modeline
@ 2006-10-19 11:06 Joakim Hove
  2006-10-19 14:48 ` Chris McMahan
  2006-10-19 15:55 ` Denis Bueno
  0 siblings, 2 replies; 4+ messages in thread
From: Joakim Hove @ 2006-10-19 11:06 UTC (permalink / raw)


Hello,

my modeline currently displays the name of the buffer I am
editing/viewing. Is it possibly to change this to include the full path
to the file (if the buffer is bound to a file)?

Regards

Joakim

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Manipulating the modeline
  2006-10-19 11:06 Manipulating the modeline Joakim Hove
@ 2006-10-19 14:48 ` Chris McMahan
  2006-10-19 16:37   ` Kevin Rodgers
  2006-10-19 15:55 ` Denis Bueno
  1 sibling, 1 reply; 4+ messages in thread
From: Chris McMahan @ 2006-10-19 14:48 UTC (permalink / raw)



As far as I know, the variable you change is
mode-line-buffer-identification

Here's how I set it for path and file name in the modeline
  (setq-default mode-line-buffer-identification
    '("%S:"(buffer-file-name "%f")))

This has the unwanted side effect of forcing a file name even for
modes that do not involve a specific file (like gnus). It might be a
good place to start looking, however.

- Chris



"Joakim Hove" <joakim.hove@gmail.com> writes:

> Hello,
>
> my modeline currently displays the name of the buffer I am
> editing/viewing. Is it possibly to change this to include the full path
> to the file (if the buffer is bound to a file)?
>
> Regards
>
> Joakim
>

-- 
     (.   .)
  =ooO=(_)=Ooo=====================================
  Chris McMahan | first_initiallastname@one.dot.net
  =================================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Manipulating the modeline
  2006-10-19 11:06 Manipulating the modeline Joakim Hove
  2006-10-19 14:48 ` Chris McMahan
@ 2006-10-19 15:55 ` Denis Bueno
  1 sibling, 0 replies; 4+ messages in thread
From: Denis Bueno @ 2006-10-19 15:55 UTC (permalink / raw)
  Cc: help-gnu-emacs

On 19 Oct 2006 04:06:52 -0700, Joakim Hove <joakim.hove@gmail.com> wrote:
> Hello,
>
> my modeline currently displays the name of the buffer I am
> editing/viewing. Is it possibly to change this to include the full path
> to the file (if the buffer is bound to a file)?

The following doesn't really answer your exact question, but it might
be relevant. Because the filename of an arbitrary file might be really
long (in which case putting the entire path to it in the mode-line
might have undesirable consequences), you might try one of two
"workarounds":

1.  Put the following in your custom-set-variables:

'(uniquify-buffer-name-style (quote forward) nil (uniquify))

This will cause buffers with the same filename but distinct locations
on the filesystem to have their names "uniquified" so that distinct
files have distinct names. If you open two Makefiles, one under proj1
and another under proj2, the displayed buffer names will be
"proj1/Makefile" and "proj2/Makefile" so you can till which is which.

2. If you need to know exactly where a file resides when you're
visiting its buffer, type M-x pwd. This will let you know.

Hope this info is useful.

-Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Manipulating the modeline
  2006-10-19 14:48 ` Chris McMahan
@ 2006-10-19 16:37   ` Kevin Rodgers
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2006-10-19 16:37 UTC (permalink / raw)


[Please don't top-post.]

Chris McMahan wrote:
> As far as I know, the variable you change is
> mode-line-buffer-identification
> 
> Here's how I set it for path and file name in the modeline
>   (setq-default mode-line-buffer-identification
>     '("%S:"(buffer-file-name "%f")))
> 
> This has the unwanted side effect of forcing a file name even for
> modes that do not involve a specific file (like gnus). It might be a
> good place to start looking, however.

What is "%S"?  My version only documents "%s", the buffer's process
status.  But I don't know why the (buffer-file-name "%f") entry displays
anything for buffers visiting a file.  What file name could it display?

> "Joakim Hove" <joakim.hove@gmail.com> writes:
> 
>> Hello,
>>
>> my modeline currently displays the name of the buffer I am
>> editing/viewing. Is it possibly to change this to include the full path
>> to the file (if the buffer is bound to a file)?

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

or

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

-- 
Kevin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-10-19 16:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-19 11:06 Manipulating the modeline Joakim Hove
2006-10-19 14:48 ` Chris McMahan
2006-10-19 16:37   ` Kevin Rodgers
2006-10-19 15:55 ` Denis Bueno

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.