* bug#60097: 29.0.60; emacsclient adds unabbreviated names to file-name-history
@ 2022-12-15 18:14 Augusto Stoffel
2022-12-17 12:48 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Augusto Stoffel @ 2022-12-15 18:14 UTC (permalink / raw)
To: 60097
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'
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#60097: 29.0.60; emacsclient adds unabbreviated names to file-name-history
2022-12-15 18:14 bug#60097: 29.0.60; emacsclient adds unabbreviated names to file-name-history Augusto Stoffel
@ 2022-12-17 12:48 ` Eli Zaretskii
2022-12-19 10:20 ` Augusto Stoffel
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2022-12-17 12:48 UTC (permalink / raw)
To: Augusto Stoffel; +Cc: 60097
> From: Augusto Stoffel <arstoffel@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)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#60097: 29.0.60; emacsclient adds unabbreviated names to file-name-history
2022-12-17 12:48 ` Eli Zaretskii
@ 2022-12-19 10:20 ` Augusto Stoffel
2022-12-19 13:34 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Augusto Stoffel @ 2022-12-19 10:20 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 60097
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#60097: 29.0.60; emacsclient adds unabbreviated names to file-name-history
2022-12-19 10:20 ` Augusto Stoffel
@ 2022-12-19 13:34 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2022-12-19 13:34 UTC (permalink / raw)
To: Augusto Stoffel; +Cc: 60097-done
> From: Augusto Stoffel <arstoffel@gmail.com>
> Cc: 60097@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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-19 13:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-15 18:14 bug#60097: 29.0.60; emacsclient adds unabbreviated names to file-name-history Augusto Stoffel
2022-12-17 12:48 ` Eli Zaretskii
2022-12-19 10:20 ` Augusto Stoffel
2022-12-19 13:34 ` Eli Zaretskii
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.