unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* find-file-visit-truename
@ 2023-05-29  4:15 Samuel Wales
  2023-05-29 13:04 ` find-file-visit-truename Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Wales @ 2023-05-29  4:15 UTC (permalink / raw)
  To: help-gnu-emacs

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
- i have not tried to check other stuff thoroughly
- (buffer-file-name) correctly shows real file b

i think that mode line buffer identification shoud show real file b.
i find it confusing that the dereferencing does not occur as it used
to.

thanks.

-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



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

* Re: find-file-visit-truename
  2023-05-29  4:15 find-file-visit-truename Samuel Wales
@ 2023-05-29 13:04 ` Eli Zaretskii
  2023-05-31  4:51   ` find-file-visit-truename Samuel Wales
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2023-05-29 13:04 UTC (permalink / raw)
  To: help-gnu-emacs

> 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.



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

* Re: find-file-visit-truename
  2023-05-29 13:04 ` find-file-visit-truename Eli Zaretskii
@ 2023-05-31  4:51   ` Samuel Wales
  2023-05-31  5:43     ` find-file-visit-truename Samuel Wales
  2023-05-31 12:03     ` find-file-visit-truename Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Samuel Wales @ 2023-05-31  4:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

more below.

On 5/29/23, Eli Zaretskii <eliz@gnu.org> wrote:
> 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

i tried f and it showd a full path name.  i'm not sure if a full path
name is always needed?  can a basename suffice?

i do seem to recall the truename showing there but who knows.

> 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.
>
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



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

* Re: find-file-visit-truename
  2023-05-31  4:51   ` find-file-visit-truename Samuel Wales
@ 2023-05-31  5:43     ` Samuel Wales
  2023-05-31 12:03     ` find-file-visit-truename Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Samuel Wales @ 2023-05-31  5:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

although what i want is across the board truenaming of buffer names
not just mode line if there is a difference.

i am pretty sure i want truename behavior when finding files.  even
with truename, by default, file-visiting buffer has a name derived
from how you got to it and not from the truenamed file.  there might
be a rationale i am missing.

i guess i use symlinks for convenience and working around non-emacs
expecting files.  i keep in mind the real location.  perhaps others
think of symlinks as a separate view of the same file that should be
kept separate.



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

* Re: find-file-visit-truename
  2023-05-31  4:51   ` find-file-visit-truename Samuel Wales
  2023-05-31  5:43     ` find-file-visit-truename Samuel Wales
@ 2023-05-31 12:03     ` Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2023-05-31 12:03 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Samuel Wales <samologist@gmail.com>
> Date: Tue, 30 May 2023 21:51:28 -0700
> Cc: help-gnu-emacs@gnu.org
> 
> On 5/29/23, Eli Zaretskii <eliz@gnu.org> wrote:
> > 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
> 
> i tried f and it showd a full path name.  i'm not sure if a full path
> name is always needed?  can a basename suffice?

I don't know, but if that is what you want, you can use :eval instead
of just %f.

> i do seem to recall the truename showing there but who knows.

Maybe some customization or something.



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

end of thread, other threads:[~2023-05-31 12:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-29  4:15 find-file-visit-truename Samuel Wales
2023-05-29 13:04 ` find-file-visit-truename Eli Zaretskii
2023-05-31  4:51   ` find-file-visit-truename Samuel Wales
2023-05-31  5:43     ` find-file-visit-truename Samuel Wales
2023-05-31 12:03     ` find-file-visit-truename Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).