changeset 91755:fac76be7aaf4

Kevin Ryde <user42 at zip.com.au> (ffap-rfc-directories): New variable. (ffap-rfc): Look in those dirs before offering ffap-rfc-path.
author Glenn Morris <rgm@gnu.org>
date Mon, 11 Feb 2008 04:06:27 +0000
parents 77727320dacc
children 962527987174
files lisp/ffap.el
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ffap.el	Mon Feb 11 04:03:25 2008 +0000
+++ b/lisp/ffap.el	Mon Feb 11 04:06:27 2008 +0000
@@ -956,12 +956,19 @@
 		      "/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))))
 
 
 ;;; At-Point Functions: