all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ffap: if file at point doesn't exist, but its directory does
@ 2003-11-15 18:30 Dan Jacobson
  2003-11-17 17:14 ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Jacobson @ 2003-11-15 18:30 UTC (permalink / raw)


Ffap gentlemen, assume your cursor is on
"/usr/X11R6/lib/X11/xdm/Xreset" but the file doesn't exist, but the
directory does.  Well, ffap should (optionally ask, and) take you to a
dired of that directory... better than the current nothing.

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

* Re: ffap: if file at point doesn't exist, but its directory does
       [not found] <mailman.133.1068938260.399.bug-gnu-emacs@gnu.org>
@ 2003-11-17 16:39 ` Kevin Rodgers
  2003-11-21  0:25   ` Dan Jacobson
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Rodgers @ 2003-11-17 16:39 UTC (permalink / raw)


Dan Jacobson wrote:

> Ffap gentlemen, assume your cursor is on
> "/usr/X11R6/lib/X11/xdm/Xreset" but the file doesn't exist, but the
> directory does.  Well, ffap should (optionally ask, and) take you to a
> dired of that directory... better than the current nothing.

Nah.  C-x d.


-- 
Kevin Rodgers

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

* Re: ffap: if file at point doesn't exist, but its directory does
  2003-11-15 18:30 Dan Jacobson
@ 2003-11-17 17:14 ` Juri Linkov
  0 siblings, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2003-11-17 17:14 UTC (permalink / raw)
  Cc: bug-gnu-emacs

Dan Jacobson <jidanni@jidanni.org> writes:
> Ffap gentlemen, assume your cursor is on
> "/usr/X11R6/lib/X11/xdm/Xreset" but the file doesn't exist, but the
> directory does.  Well, ffap should (optionally ask, and) take you to a
> dired of that directory... better than the current nothing.

I have another problem with ffap: it can't find a file if file name
contains spaces.  I fixed this problem by the new function:

(defun my-find-file-at-point-or-region (&optional arg)
  "Find filename at point or selected by region.
This function is useful, when filename contains spaces, and so can't
be fully matched by `find-file-at-point'.  In this case user should
manually select region around the full filename and invoke this command.
This function also maps UNIX filenames to Window$ filenames."
  (interactive "P")
  (let ((filename
         (if (and transient-mark-mode mark-active)
             (buffer-substring-no-properties (mark) (point))
           (ffap-string-at-point))))
    (and (eq system-type 'windows-nt)
         filename
         (string-match "^/dos/\\([A-Za-z]\\)\\(.*\\)" filename)
         (setq filename (concat (match-string 1 filename) ":"
                                (match-string 2 filename))))
    (or (and filename (file-exists-p filename))
        (setq filename (ffap-guesser)))
    (find-file-at-point (ffap-prompter filename))))

But I think it is not the right thing yet.  Ffap should be fixed
to pick up full file name with spaces without requiring the user
to select a region.

-- 
http://www.jurta.org/emacs/

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

* Re: ffap: if file at point doesn't exist, but its directory does
  2003-11-17 16:39 ` ffap: if file at point doesn't exist, but its directory does Kevin Rodgers
@ 2003-11-21  0:25   ` Dan Jacobson
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Jacobson @ 2003-11-21  0:25 UTC (permalink / raw)


>> Ffap gentlemen, assume your cursor is on
>> "/usr/X11R6/lib/X11/xdm/Xreset" but the file doesn't exist, but the
>> directory does.  Well, ffap should (optionally ask, and) take you to a
>> dired of that directory... better than the current nothing.

K> Nah.  C-x d.

Don't be silly.  The whole point is what to do when the file doesn't
exist.  If I knew that in the first place, I would have hit C-x d.

And, smartypants, just try hitting C-x d with the cursor placed on a
path where the file doesn't exist, but the directory does.  What does
your C-x d prompt with there?  Nothing, nada, nilch*, just the current
directory.

*coined new word. 10 points.

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

end of thread, other threads:[~2003-11-21  0:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.133.1068938260.399.bug-gnu-emacs@gnu.org>
2003-11-17 16:39 ` ffap: if file at point doesn't exist, but its directory does Kevin Rodgers
2003-11-21  0:25   ` Dan Jacobson
2003-11-15 18:30 Dan Jacobson
2003-11-17 17:14 ` Juri Linkov

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.