unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Bastien <bzg@altern.org>
Cc: 16542@debbugs.gnu.org
Subject: bug#16542: 24.3.50; When finding a file via a bookmark, that file is not part of file-name-history
Date: Mon, 27 Jan 2014 09:31:29 -0800 (PST)	[thread overview]
Message-ID: <d45e48b4-53ea-4f32-92d0-d34c1cb36afc@default> (raw)
In-Reply-To: <877g9l1m4c.fsf@bzg.ath.cx>

> I suggest we build a list of Emacs Elisp commands that are
> candidates for adding a file name to file-name-history:
> - bookmark-jump
> - bookmark-jump-other-window
> - dired-find-file
> - dired-find-file-other-window
> come to my mind.  Thanks for adding others.

I suggest taking this to emacs-devel.

> Then a new option find-file-history can contain 'bookmark 'dired
> and the likes to control whether the related features should add
> the file name to `file-name-history'.

I'd sooner see this:

1. A user option such as what you describe, but with nil meaning
   "go for it generally: let the command decide", a non-nil list as
   you mention meaning "do not let these commands decide", and any
   other non-nil value meaning "do not let any command decide".
   IOW, something like this:

(defcustom add-to-file-history-only-if-input ()
  "Which commands to disallow adding non-input file names to the history.
When a file name is read in the minibuffer, the name you enter is
typically added to `file-name-history'.  Some commands may optionally
add additional file names to this minibuffer history.

If the option value is not a list then do not let any commands add a
file name to the history unless you enter that name as minibuffer
input.

Otherwise, the value is a list of commands to disallow adding a name
you did not enter.  (If the value is nil, no commands are disallowed;
they can all add file names that you do not enter.)"
  :type
  '(choice
    (const  :tag "Let no command add a file name I do not enter" t)
    (repeat :tag "Commands that cannot add file names I do not enter"
     (restricted-sexp
      :tag "Command that cannot add unentered file names to history"
      ;; Use `symbolp' instead of `commandp', in case the
      ;; library defining the command is not yet loaded.
      :match-alternatives (symbolp) :value ignore)))
  :group 'files :group 'minibuffer)

2. If a given command is not excluded by the option (see #1) then it
   can, if it wants, add another file name (e.g. a visited file) to
   `file-name-history'.

   If a command wants to offer the possibility of such inclusion, it
   first tests the option value to see if the user allows that.

(There is also the question of whether to do something similar for
other minibuffer histories, besides `file-name-history'.  But we 
can probably forget about that, for now.)






  reply	other threads:[~2014-01-27 17:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-24 21:45 bug#16542: 24.3.50; When finding a file via a bookmark, that file is not part of file-name-history Bastien Guerry
2014-01-25  8:19 ` Dani Moncayo
2014-01-25  8:42   ` Drew Adams
2014-01-27 11:29     ` Bastien
2014-01-27 15:11       ` Drew Adams
2014-01-27 15:26         ` Bastien
2014-01-27 17:31           ` Drew Adams [this message]
2014-01-28  7:28             ` Juri Linkov
2014-01-28 13:28               ` Stefan Monnier
2014-01-29  9:10                 ` Juri Linkov
2014-01-29 10:43                 ` Bastien
2014-01-29 13:58                   ` Stefan Monnier
2014-01-28 16:20               ` Drew Adams
2020-08-25 10:57 ` 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d45e48b4-53ea-4f32-92d0-d34c1cb36afc@default \
    --to=drew.adams@oracle.com \
    --cc=16542@debbugs.gnu.org \
    --cc=bzg@altern.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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