emacs-devel
[Top][All Lists]
Advanced

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

Re: find-file-literally-at-point


From: Juri Linkov
Subject: Re: find-file-literally-at-point
Date: Mon, 09 Nov 2009 02:44:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)

> When I added a few find-file related functions to ffap,
> I don't remember why I missed `find-file-literally'.
> Maybe because it has no keybinding (should we try to find one?).
> So we definitely need such a function.

Below is a patch that implements `ffap-literally' using
`ffap-file-finder' and `call-interactively' like other similar
functions do.  It also adds `ffap-alternate-file-other-window' -
the remaining missing find-file related function that has
no keybinding.

Index: lisp/ffap.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/ffap.el,v
retrieving revision 1.86
diff -c -r1.86 ffap.el
*** lisp/ffap.el        2 Oct 2009 03:48:40 -0000       1.86
--- lisp/ffap.el        9 Nov 2009 00:39:51 -0000
***************
*** 1435,1441 ****
           (string-match ffap-dired-wildcards filename)
           find-file-wildcards
           ;; Check if it's find-file that supports wildcards arg
!          (memq ffap-file-finder '(find-file find-alternate-file)))
        (funcall ffap-file-finder (expand-file-name filename) t))
       ((or (not ffap-newfile-prompt)
          (file-exists-p filename)
--- 1435,1443 ----
           (string-match ffap-dired-wildcards filename)
           find-file-wildcards
           ;; Check if it's find-file that supports wildcards arg
!          (memq ffap-file-finder '(find-file
!                                   find-alternate-file
!                                   find-alternate-file-other-window)))
        (funcall ffap-file-finder (expand-file-name filename) t))
       ((or (not ffap-newfile-prompt)
          (file-exists-p filename)
***************
*** 1708,1713 ****
--- 1710,1729 ----
    (let ((ffap-file-finder 'find-alternate-file))
      (call-interactively 'ffap)))
  
+ (defun ffap-alternate-file-other-window ()
+   "Like `ffap' and `find-alternate-file-other-window'.
+ Only intended for interactive use."
+   (interactive)
+   (let ((ffap-file-finder 'find-alternate-file-other-window))
+     (call-interactively 'ffap)))
+ 
+ (defun ffap-literally ()
+   "Like `ffap' and `find-file-literally'.
+ Only intended for interactive use."
+   (interactive)
+   (let ((ffap-file-finder 'find-file-literally))
+     (call-interactively 'ffap)))
+ 
  
  ;;; Bug Reporter:

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




reply via email to

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