]> git.eshelyaron.com Git - emacs.git/commitdiff
Kevin Ryde <user42 at zip.com.au>
authorGlenn Morris <rgm@gnu.org>
Mon, 11 Feb 2008 04:06:27 +0000 (04:06 +0000)
committerGlenn Morris <rgm@gnu.org>
Mon, 11 Feb 2008 04:06:27 +0000 (04:06 +0000)
(ffap-rfc-directories): New variable.
(ffap-rfc): Look in those dirs before offering ffap-rfc-path.

lisp/ffap.el

index c34478a30de005633217d7cb6c542d5ee2256522..9d3b2142f39c953ff36d7abb5b6eae69849256b7 100644 (file)
@@ -956,12 +956,19 @@ If t, `ffap-tex-init' will initialize this when needed.")
                      "/pub/gnu/emacs/elisp-archive/"))
     (substring name 2))))
 
+(defcustom ffap-rfc-directories nil
+  "A list of directories to look for RFC files.
+If a given RFC isn't in these then `ffap-rfc-path' is offered."
+  :type '(repeat directory)
+  :group 'ffap)
+
 (defvar ffap-rfc-path
   (concat (ffap-host-to-filename "ftp.rfc-editor.org") "/in-notes/rfc%s.txt"))
 
 (defun ffap-rfc (name)
-  (format ffap-rfc-path
-         (substring name (match-beginning 1) (match-end 1))))
+  (let ((num (match-string 1 name)))
+    (or (ffap-locate-file (format "rfc%s.txt" num) t ffap-rfc-directories)
+        (format ffap-rfc-path num))))
 
 \f
 ;;; At-Point Functions: