GNU bug report logs -
#60097
29.0.60; emacsclient adds unabbreviated names to file-name-history
Previous Next
Reported by: Augusto Stoffel <arstoffel <at> gmail.com>
Date: Thu, 15 Dec 2022 18:16:01 UTC
Severity: normal
Found in version 29.0.60
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60097 in the body.
You can then email your comments to 60097 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60097
; Package
emacs
.
(Thu, 15 Dec 2022 18:16:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Augusto Stoffel <arstoffel <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 15 Dec 2022 18:16:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
1. Start emacs -Q
2. M-x server-start RET
3. In a terminal, type /home/user/somefile
Then "/home/user/somefile" is added to file-name-history. I would
instead expect the abbreviated name, "~/somefile", to be added to
history.
In GNU Emacs 29.0.60 (build 3, x86_64-pc-linux-gnu, GTK+ Version
3.24.35, cairo version 1.17.6) of 2022-12-12 built on ars3
Repository revision: 14ac927aa61200485b87d035ca5797d8e89ffb7e
Repository branch: emacs-29-grep-heading
System Description: Fedora Linux 37 (Workstation Edition)
Configured using:
'configure --with-pgtk'
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60097
; Package
emacs
.
(Sat, 17 Dec 2022 12:49:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 60097 <at> debbugs.gnu.org (full text, mbox):
> From: Augusto Stoffel <arstoffel <at> gmail.com>
> Date: Thu, 15 Dec 2022 19:14:45 +0100
>
>
> 1. Start emacs -Q
> 2. M-x server-start RET
> 3. In a terminal, type /home/user/somefile
I guess you meant to type "emacsclient /home/user/somefile"?
> Then "/home/user/somefile" is added to file-name-history. I would
> instead expect the abbreviated name, "~/somefile", to be added to
> history.
Does the patch below do what you want?
Btw, we don't do this consistently: "C-x C-f" doesn't record the
abbreviated file name, it records the original one.
diff --git a/lisp/server.el b/lisp/server.el
index fd740d1..d963ee5 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1495,7 +1495,7 @@ server-visit-files
minibuffer-auto-raise))
(filen (car file))
(obuf (get-file-buffer filen)))
- (add-to-history 'file-name-history filen)
+ (file-name-history--add filen)
(if (null obuf)
(progn
(run-hooks 'pre-command-hook)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60097
; Package
emacs
.
(Mon, 19 Dec 2022 10:21:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 60097 <at> debbugs.gnu.org (full text, mbox):
On Sat, 17 Dec 2022 at 14:48, Eli Zaretskii wrote:
> Does the patch below do what you want?
Yes, exactly.
> Btw, we don't do this consistently: "C-x C-f" doesn't record the
> abbreviated file name, it records the original one.
Indeed. But at least one is induced to type abbreviated file names, so
I don't have a strong opinion. The problem that need fixing IMO is,
say, when opening a file by clicking it in a file manager, in which case
the absolute file name is passed and the user has no control over this.
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Mon, 19 Dec 2022 13:35:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Augusto Stoffel <arstoffel <at> gmail.com>
:
bug acknowledged by developer.
(Mon, 19 Dec 2022 13:35:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 60097-done <at> debbugs.gnu.org (full text, mbox):
> From: Augusto Stoffel <arstoffel <at> gmail.com>
> Cc: 60097 <at> debbugs.gnu.org
> Date: Mon, 19 Dec 2022 11:20:47 +0100
>
> On Sat, 17 Dec 2022 at 14:48, Eli Zaretskii wrote:
>
> > Does the patch below do what you want?
>
> Yes, exactly.
Thanks, installed on the emacs-29 branch.
> > Btw, we don't do this consistently: "C-x C-f" doesn't record the
> > abbreviated file name, it records the original one.
>
> Indeed. But at least one is induced to type abbreviated file names, so
> I don't have a strong opinion. The problem that need fixing IMO is,
> say, when opening a file by clicking it in a file manager, in which case
> the absolute file name is passed and the user has no control over this.
OK, so now we are at least a bit more consistent.
Closing.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 17 Jan 2023 12:24:11 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 212 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.