unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: Q on read-file-name and completion-ignored-extensions
Date: Fri, 20 Jan 2006 08:34:27 -0800	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICCEKMDBAA.drew.adams@oracle.com> (raw)
In-Reply-To: <200601200233.k0K2XjC26200@raven.dms.auburn.edu>

       I guess the reference to `file-name-all-completions' was mistaken,

    No, that reference is correct.  `file-name-all-completions' is the
    function used internally by the commands that display completion lists
    and it is _really_ unaffected by `completion-ignored-extensions'
    (otherwise, there would be a bug).  Note that
    `file-name-all-completions' is described in exactly the same Info node
    as `completion-ignored-extensions'.

       This does _not_ display the list (of all four files), even
       though TAB would normally display the list of possible
       completions in that case (since the
       common part is already in the minibuffer).

    The minibuffer commands do not ignore completion-ignored-extensions in
    deciding _whether_ to display lists of completions (as opposed to
    doing completion), it only ignores it _when_ it displays them.

       Is it perhaps true that the "displaying a list of
       completions" that shows ignored completions (even
       when there are non-ignored candidates) applies
       only to display by `?' and not to display by TAB?

    No, it affects TAB too, if TAB can not do completion, even ignoring
    all extensions in completion-ignored-extensions.  As I explained, TAB
    takes completion-ignored-extensions into account in deciding whether
    it can do completion (as opposed to having to display a list of
    completions), but _after_ it decides that it has to display a list, it
    ignores the variable.

Great. So, since none of that info is in the doc string or the manual, let's
add it:

 Completion ignores file names ending in any string in this list.
 It ignores directory names if they match any string in the list
 that ends in a slash (/).
 However:
  - If all possible completions have ignored extensions, then those
    completions are not ignored.
    Example: If .ico is an ignored extension, and the only possible
    completions are fun.ico and fudge.ico, then those file names
    are available for completion: `C-x C-f fud TAB' completes to
    fudge.ico.
  - Displayed and returned lists of possible completions include
    file names, even if they have ignored extensions. This includes
    the completions displayed in buffer *Completions*, as well as
    the lists of completions returned by functions such as
    `file-name-all-completions'. File names with ignored extensions
    are ignored in deciding whether buffer *Completions* is to be
    displayed, but if it is displayed then it includes any matching
    file names with ignored extensions.
    Example: files fun.ico and fun.el, `C-x C-f fun. TAB' completes
    to fun.el, because fun.ico is ignored for completion.
    `C-x C-f fun ?' displays fun.el and fun.ico in *Completions*,
    because ignored file names are included whenever *Completions*
    is displayed.

Reword as needed. The various points you've made should be addressed in a
clear way, preferably with examples. The examples might be reserved for the
Elisp manual, leaving the doc string simpler (if less clear):

 Completion ignores file names ending in any string in this list.
 It ignores directory names if they match any string in the list
 that ends in a slash (/).
 However:
  - If all possible completions have ignored extensions, then those
    completions are not ignored.
  - Displayed and returned lists of possible completions include
    file names, even if they have ignored extensions. This includes
    the completions displayed in buffer *Completions*, as well as
    the lists of completions returned by functions such as
    `file-name-all-completions'. File names with ignored extensions
    are ignored in deciding whether buffer *Completions* is to be
    displayed, but if it is displayed then it includes any matching
    file names with ignored extensions.

  reply	other threads:[~2006-01-20 16:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-18 17:44 Q on read-file-name and completion-ignored-extensions Drew Adams
2006-01-18 20:58 ` Stefan Monnier
2006-01-18 21:46   ` Drew Adams
2006-01-19  0:42     ` Kevin Rodgers
2006-01-19  1:52       ` Drew Adams
2006-01-19  1:13     ` Stefan Monnier
2006-01-19  1:45       ` Drew Adams
2006-01-19 18:59         ` Stefan Monnier
2006-01-19 19:29           ` Drew Adams
2006-01-19 21:32             ` Luc Teirlinck
2006-01-19 22:10               ` Drew Adams
2006-01-20  0:47                 ` Luc Teirlinck
2006-01-20  1:50                   ` Drew Adams
2006-01-20  2:11                     ` Luc Teirlinck
2006-01-20  2:20                     ` Luc Teirlinck
2006-01-20  2:33                     ` Luc Teirlinck
2006-01-20 16:34                       ` Drew Adams [this message]
2006-01-22  3:59                   ` Richard M. Stallman
2006-01-19 23:00           ` Lennart Borgman

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=DNEMKBNJBGPAOPIJOOICCEKMDBAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.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 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).