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

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

Re: find-file-visit-truename


From: Eli Zaretskii
Subject: Re: find-file-visit-truename
Date: Mon, 29 May 2023 16:04:51 +0300

> From: Samuel Wales <samologist@gmail.com>
> Date: Sun, 28 May 2023 21:15:09 -0700
> 
> i have had find-file-visit-truename set to t forever.  it used to
> work.  i still have it set to t.
> 
> however, in 27.1, it does not work as i expect.
> 
> here is what i expect:
> 
> - a is a symlink that points to real file b
> - i find-file a
> - real file b shows in mode line buffer identification
> - other stuff like echo area notifications and more
> 
> here is what occurs
> 
> - mode line buffer identification shows symlink a <-- bug

The doc string of find-file-visit-truename says:

  Non-nil means visiting a file uses its truename as the visited-file name.
  That is, the buffer visiting the file has the truename as the
  value of ‘buffer-file-name’.

And the Emacs manual says:

     If the variable ‘find-file-visit-truename’ is non-‘nil’, then the
  file name recorded for a buffer is the file’s “truename” (made by
  replacing all symbolic links with their target names), rather than the
  name you specify.

Note that both speak about the _file_ name recorded for a buffer.

By contrast, the default mode line shows the _buffer_ name, not the
_file_ name.  If you want to see the file name, you need to customize
mode-line-buffer-identification to show that; by default it uses %b,
which shows the buffer name.  I suspect that this is how it used to
work for you in previous versions of Emacs, since the code which shows
the buffer identification on the mode line hasn't changed in decades.



reply via email to

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