all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#7112: 24.0.50; [PATCH] `ls-lisp-insert-directory' should be no-op for empty FILE
@ 2010-09-27  0:21 Drew Adams
  2011-07-13 13:18 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2010-09-27  0:21 UTC (permalink / raw)
  To: 7112

You can call `dired' passing a cons arg that includes a list of file
names.  An empty file name causes this ugly error: 
 
(error "Args out of range: \"\", -1")
 
The reason is the following code near the end of
`ls-lisp-insert-directory':
 
;; If not full-directory-p, FILE *must not* end in /, as
;; file-attributes will not recognize a symlink to a directory,
;; so must make it a relative filename as ls does:
(if (file-name-absolute-p file) (setq file (expand-file-name file)))
(if (eq (aref file (1- (length file))) ?/)
    (setq file (substring file 0 -1)))
 
`ls-lisp-insert-directory' should in fact do nothing at all (no-op) if
FILE is "".  The entire body should be wrapped in this:
 
(when (> (length file) 0)
  ...)
 
 
In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2010-09-20 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4) --no-opt --cflags
-Ic:/imagesupport/include'
 






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-08-02 21:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-27  0:21 bug#7112: 24.0.50; [PATCH] `ls-lisp-insert-directory' should be no-op for empty FILE Drew Adams
2011-07-13 13:18 ` Lars Magne Ingebrigtsen
2011-07-13 15:13   ` Drew Adams
2011-08-02 20:06     ` Lars Magne Ingebrigtsen
2011-08-02 21:25       ` Drew Adams
2011-08-02 21:32         ` Lars Magne Ingebrigtsen

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.