documentation mismatch for 'find-file-compare-truenames'

documentation mismatch for 'find-file-compare-truenames'

Post by Robert Bihlmey » Wed, 21 Aug 1996 04:00:00


this is XEmacs 19.14. (said to correspont to 19.13) states:

Quote:>    If the variable `find-file-compare-truenames' value is non-`nil',
> the `find-file' command will check the `buffer-file-truename' of all
> visited files when deciding whether a given file is already in a
> buffer, instead of just `buffer-file-name'.  If you attempt to visit
> another file which is a hard-link or symbolic-link to a file that is
> already in a buffer, the existing buffer will be found instead of a
> newly created one.

The bit about hard-links is incorrect, files with the same inode can
be visited twice. The variable description (C-h v) of
'find-file-compare-truenames' is right:

Quote:> [...] This works if any component of the pathname (including a non-
> terminal component) is a symbolic link as well, but doesn't work with hard
> links (nothing does).

One could check not only for equal buffer-file-truename but also for
equal buffer-file-number in get-file-buffer to grok hard-links.



1. find-file-compare-truenames and hard links

As you can tell by my frequency of posting about hard links, I'm
really concerned about getting XEmacs to handle them correctly.  I was
pointed toward the variable find-file-compare-truenames.  Someone who
uses FSF Emacs said that setting it true would solve my problems;
however, the documentation in XEmacs says it doesn't work with hard
links.  My question is why does FSF Emacs work with hard links, and
XEmacs doesn't?  I can see in files.el that part of the problem
appears to be the idea of a file's "truename".  With hard links, files
don't really have one "truename" the way symlinks do.  However,
couldn't you define a variable 'find-file-compare-inodes' and use that
in find-file-noselect in much the same way as

[time passes]

OK, after looking deeper it appears the really work would have to be
done in buffer.c for the DEFUN of get-file-buffer.  I looks like the
data structure for the buffers would need to have a member for inode.

Anyway, I'm just fishing for ideas here.  I can almost understand the
code in buffer.c.  When I get some more time (and some feedback from
the smart guys) I will try to make a patch to handle hard links.

 oo /  Unix Hacker
 |_/   "It's too late for paradise"

2. CFP: Async96

3. Missing 'Compare' submenu in 'Tools' menu

4. URG REQ HOTTY :Business System Analyst with PBM (PBM expert) / Tampa, FL

5. hidden files in the 'find-file'-dialog

6. How to Calculate Dates?

7. define size of 'find-file' window?

8. log on to server problem

9. `find-dired' function question (find file of type x?)

10. Gnus can't find 'hexl'?

11. minibuffer prompt for files makes '$' become '$$'

12. 'Print Buffer' option in 'File' menu always disabled?

13. How to enable 'Print Buffer' option in 'File' menu?