emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/find-file.el,v


From: Thien-Thi Nguyen
Subject: [Emacs-diffs] Changes to emacs/lisp/find-file.el,v
Date: Sun, 16 Jul 2006 21:08:28 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Thien-Thi Nguyen <ttn>  06/07/16 21:08:28

Index: find-file.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/find-file.el,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- find-file.el        6 Feb 2006 14:33:33 -0000       1.32
+++ find-file.el        16 Jul 2006 21:08:28 -0000      1.33
@@ -189,12 +189,16 @@
     ;; C/C++ include, for NeXTSTEP too
     ("^\#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]" .
      (lambda ()
-       (setq fname (buffer-substring (match-beginning 2) (match-end 2)))))
+       (buffer-substring (match-beginning 2) (match-end 2))))
     )
-  "*A list of regular expressions for `ff-find-file'.
-Specifies how to recognize special constructs such as include files
-etc. and an associated method for extracting the filename from that
-construct.")
+  ;; We include `ff-treat-as-special' documentation here so that autoload
+  ;; can make it available to be read prior to loading this file.
+  "*List of special constructs for `ff-treat-as-special' to recognize.
+Each element, tried in order, has the form (REGEXP . EXTRACT).
+If REGEXP matches the current line (from the beginning of the line),
+`ff-treat-as-special' calls function EXTRACT with no args.
+If EXTRACT returns nil, keep trying.  Otherwise, return the
+filename that EXTRACT returned.")
 
 (defvaralias 'ff-related-file-alist 'ff-other-file-alist)
 (defcustom ff-other-file-alist 'cc-other-file-alist
@@ -405,9 +409,7 @@
               (ff-list-replace-env-vars (symbol-value ff-search-directories))
             (ff-list-replace-env-vars ff-search-directories)))
 
-    (save-excursion
-      (beginning-of-line 1)
-      (setq fname (ff-treat-as-special)))
+    (setq fname (ff-treat-as-special))
 
     (cond
      ((and (not ff-ignore-include) fname)
@@ -540,9 +542,7 @@
               (ff-list-replace-env-vars (symbol-value ff-search-directories))
             (ff-list-replace-env-vars ff-search-directories)))
 
-    (save-excursion
-      (beginning-of-line 1)
-      (setq fname (ff-treat-as-special)))
+    (setq fname (ff-treat-as-special))
 
     (cond
      ((and (not ff-ignore-include) fname)
@@ -771,7 +771,9 @@
 
 (defun ff-treat-as-special ()
   "Return the file to look for if the construct was special, else nil.
-The construct is defined in the variable `ff-special-constructs'."
+See variable `ff-special-constructs'."
+  (save-excursion
+    (beginning-of-line 1)
   (let* (fname
          (list ff-special-constructs)
          (elem (car list))
@@ -784,7 +786,7 @@
       (setq elem (car list))
       (setq regexp (car elem))
       (setq match (cdr elem)))
-    fname))
+      fname)))
 
 (defun ff-basename (string)
   "Return the basename of pathname STRING."




reply via email to

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