Article View: gnu.emacs.bug
Article #98479Dired: filenames with spaces
From: macrakis
Date: Fri, 21 Jun 1991 16:05
Date: Fri, 21 Jun 1991 16:05
33 lines
1860 bytes
1860 bytes
Thanks for the bug note for my `fix' to dired (won't work with `->'
links).
I have fixed this by making special provision for `->' (see below).
Do you know of other cases which might cause problems?
Thanks again.
-s
(defun dired-get-filename (&optional localp no-error-if-not-filep)
"In dired, return name of file mentioned on this line.
Value returned normally includes the directory name.
A non-nil 1st argument means do not include it. A non-nil 2nd argument
says return nil if no filename on this line, otherwise an error occurs."
(save-excursion
(end-of-line)
(let ((eol (point)))
(beginning-of-line)
(if (re-search-forward
"\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)[ ]+[0-9]+"
eol t)
(progn (skip-chars-forward " ")
(skip-chars-forward "^ " eol)
(skip-chars-forward " " eol)
(let* ((beg (point)))
(if (search-forward " -> " eol t)
(setq eol (match-beginning 0)))
;; >> uses default-directory, could lose on cd, multiple.
(concat (if localp "" default-directory)
(buffer-substring beg eol))))
(if no-error-if-not-filep nil
(error "No file on this line"))))))
Technical Details
Message-ID:
<9106211605.AA02361@.next1.osf.org.>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbageReferences:
<199106210844.AA23816@kosciusko.ESD.3Com.COM>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,75d9b25f288347d8 X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1991-06-21 09:05:03 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbage From: macrakis@osf.org Newsgroups: gnu.emacs.bug Subject: Dired: filenames with spaces Message-ID: <9106211605.AA02361@.next1.osf.org.> Date: 21 Jun 91 16:05:03 GMT References: <199106210844.AA23816@kosciusko.ESD.3Com.COM> Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 33 Approved: bug-gnu-emacs@prep.ai.mit.edu