From: "Drew Adams" <drew.adams@oracle.com>
To: "'Chong Yidong'" <cyd@gnu.org>, "'Dani Moncayo'" <dmoncayo@gmail.com>
Cc: 12915@debbugs.gnu.org
Subject: bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the history ofvisited files
Date: Sat, 12 Jan 2013 09:59:37 -0800 [thread overview]
Message-ID: <0D133CE87DCE4BA396A4720CB7CE4A98@us.oracle.com> (raw)
In-Reply-To: <87obgug641.fsf@gnu.org>
> >> The history of visited files should contain every visited
> >> file, regardless of the way it was visited (command line
> >> argument, drag-n-drop, menu item, C-x C-f...)
> >
> > ... and when the file is visited via bookmarks (e.g.
> > `C-x r b foo <RET>'). (I've just missed this feature).
>
> This feature is relatively easy to implement.
>
> I think it is best done by adding an optional argument
> `add-history' to `find-file' (and similar functions like
> `find-file-other-frame'), so that Lisp callers can specify to
> update `file-name-history' even if the file name was not read
> interactively. Any objections?
Yes, FWIW, I completely disagree with this - the aim.
History variables are about _user input_. For file names, that means
interactive use of a file-finding command. They are not just about accessing a
file, or using a command, or mentioning a variable, or .... They are INPUT
histories.
In the past there have been suggestions to add commands associated with menu
items that a user accesses interactively to `extended-command-history'. That
suggestion was rejected (why?), even with the proviso that it be governed by a
user option.
This proposed change goes against the intention/meaning of Emacs input
histories.
The proper solution is for commands that read file names to DTRT wrt
`file-name-history' - TRT for that command.
If for instance, a bookmark jump command visits a file (it need not) then it
could, itself, explicitly add that file's name to `file-name-history'. The
command knows what TRT is. And the user knows more than does the command, and
should ultimately decide.
Normally, changing `file-name-history' would not (_should_ not) be done by a
bookmark jump command, unless the file name was provided as user input. That's
what these histories are for: _user input_. Past input provides candidates for
future input.
A bookmarking command that reads a bookmark name puts that bookmark name on
`bookmark-history'. A priori, it should not also put the visited file name on
`file-name-history'. Not without some user agreement (e.g. via an option
specific for this wrt bookmarks).
This proposed change is misguided, IMHO. I'm surprised that both Emacs
maintainers apparently immediately signed on to it.
It is so easy for any command (or any function - but this should be done in the
context of a command and its user interaction) to add a name to any history,
according to what it deems is TRT.
There is no need to do this in some low-level, automatic way. No need - and
it's generally the wrong thing to do.
Is it hard to solve the specific problem raised by the enhancement request (it
is not a bug report): have drag-and-drop add the name of the file to
`file-history', without going in the direction you are suggesting? Why is that
difficult to address specifically?
And since users should be able to control this, how would they do it? The
enhancement request also mentions menu-item access and bookmark access.
Different users will feel differently about whether those should all be lumped
together in this respect.
I mentioned the case of menus and commands because it is similar: accessing a
command via a menu is a different user action than typing its name into the
minibuffer for `M-x'. A priori, it is only actual, historical command-name
input that we want to later provide for command-name reading.
But a user might later want to repeat that menu-accessed command by name, using
the minibuffer. That's why this feature was proposed. (This has been an
Icicles user option for years. Some people use it, some do not. It is turned
on by default.)
But it's also why this kind of thing should be controlled by specific user
options (one for menu items, one for file bookmarks, etc.).
A user should opt into having other commands, which do not _read_ a name (e.g.
file), also add a name to the history.
This is no less important for file dragging-&-dropping, or file access by menu,
than it is for accessing commands by menu.
The important point is that we should not generalize the addition of names (of
files or whatever) to histories beyond _user interaction_ or in some automatic
way beyond user control.
And for any user interaction besides _reading_ the name, users should be able to
control (e.g. via an option) whether the name gets added to the input name
history.
For commands like bookmark jumping, a user should be able to decide whether
`file-name-history' should be augmented, in addition to `bookmark-history'.
I hope you will think a little more about this.
next prev parent reply other threads:[~2013-01-12 17:59 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-17 13:07 bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the history of visited files Dani Moncayo
2012-11-17 19:07 ` Glenn Morris
2012-11-17 21:37 ` Dani Moncayo
2013-01-02 9:16 ` Dani Moncayo
2013-01-12 8:25 ` Chong Yidong
2013-01-12 13:18 ` Stefan Monnier
2013-01-12 14:30 ` martin rudalics
2013-01-12 16:54 ` Stefan Monnier
2013-01-12 18:01 ` martin rudalics
2013-01-12 18:02 ` bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the historyof " Drew Adams
2013-01-12 18:01 ` bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the history ofvisited files Drew Adams
2013-01-12 18:32 ` Eli Zaretskii
2013-01-12 22:43 ` Drew Adams
2013-01-13 17:31 ` Eli Zaretskii
2013-01-13 18:55 ` Drew Adams
2013-01-12 17:59 ` Drew Adams [this message]
2013-01-13 9:21 ` bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the history of visited files Andreas Röhler
2013-01-13 16:28 ` Eli Zaretskii
2013-01-13 9:56 ` Juri Linkov
2013-01-13 10:15 ` Dani Moncayo
2013-01-13 14:25 ` Stefan Monnier
2013-01-13 17:13 ` bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the history ofvisited files Drew Adams
2013-01-13 20:24 ` Dani Moncayo
2013-01-13 22:45 ` Stefan Monnier
2013-01-13 19:52 ` bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the history of visited files Dani Moncayo
2013-01-13 22:34 ` Stefan Monnier
2013-01-13 17:13 ` bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the history ofvisited files Drew Adams
2013-01-14 7:52 ` bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the history of visited files Juri Linkov
2013-01-14 8:18 ` Dani Moncayo
2013-01-14 15:18 ` Stefan Monnier
2013-01-14 15:50 ` bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the history ofvisited files Drew Adams
2013-01-14 15:45 ` Drew Adams
2013-01-15 9:57 ` Juri Linkov
2013-01-15 15:07 ` Drew Adams
2013-01-13 16:35 ` bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the history of visited files Eli Zaretskii
2013-01-13 17:14 ` bug#12915: 24.2.50; Visiting a file via drag-and-drop should add it to the historyof " Drew Adams
2021-07-18 19:21 ` bug#3909: 23.1.50; Drag drop events in command history? Lars Ingebrigtsen
2021-07-18 21:08 ` bug#12915: [External] : bug#12915: " Drew Adams
2021-07-18 22:32 ` bug#3909: " Juri Linkov
2021-07-18 22:50 ` Lars Ingebrigtsen
2021-07-19 15:24 ` Juri Linkov
2021-07-19 15:51 ` bug#3909: " Lars Ingebrigtsen
2021-07-19 21:57 ` Juri Linkov
2021-07-20 11:48 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0D133CE87DCE4BA396A4720CB7CE4A98@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=12915@debbugs.gnu.org \
--cc=cyd@gnu.org \
--cc=dmoncayo@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.