emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

another bug of find-file-noselect?


From: Kenichi Handa
Subject: another bug of find-file-noselect?
Date: Fri, 20 Oct 2000 13:37:41 +0900 (JST)

Even if there are files temp.1, temp.2, temp.3, 
(find-file-noselect "temp.*" t t t) returns the buffer for
temp.1 only against this docstring:

Read file FILENAME into a buffer and return the buffer.
If a buffer exists visiting FILENAME, return that one, but
verify that the file has not changed since visited or saved.
The buffer is not selected, just returned to the caller.
Optional first arg NOWARN non-nil means suppress any warning messages.
Optional second arg RAWFILE non-nil means the file is read literally.
Optional third arg WILDCARDS non-nil means do wildcard processing
and visit all the matching files.  When wildcards are actually
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
used and expanded, the value is a list of buffers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
that are visiting the various files.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It seems that we can fix this bug just by removing the last
`car' call in this code of find-file-noselect.

    (if (and wildcards
             find-file-wildcards
             (not (string-match "\\`/:" filename))
             (string-match "[[*?]" filename))
        (let ((files (condition-case nil
                         (file-expand-wildcards filename t)
                       (error (list filename))))
              (find-file-wildcards nil))
          (if (null files)
              (find-file-noselect filename)
            (car (mapcar #'find-file-noselect files))))

But, it seems that the existence of `car' call is
intentional.  In that case, docstring should be fixed.

Could someone tell which is wrong, the code or the
docstring?  I myselft want to fix the code because otherwise
we don't know which buffers are created by this function.

By the way, Emacs Lisp Reference Manual says nothing special
for the case that WILDCARDS is non-nil.   It just says:

     The `find-file-noselect' function returns the buffer that is
     visiting the file FILENAME.

---
Ken'ichi HANDA
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]