Show
Ignore:
Timestamp:
07/16/06 08:36:52 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/files.el

    r4098 r4111  
    489489 
    490490(defcustom enable-local-eval 'maybe 
    491   "*Control processing of the \"variable\" `eval' in a file's local variables. 
     491  "Control processing of the \"variable\" `eval' in a file's local variables. 
    492492The value can be t, nil or something else. 
    493493A value of t means obey `eval' variables; 
     
    692692          (dolist (file (file-name-all-completions 
    693693                         (file-name-nondirectory string) dir)) 
    694             (push (if string-dir (concat string-dir file) file) names
     694            (add-to-list 'names (if string-dir (concat string-dir file) file)
    695695            (when (string-match suffix file) 
    696696              (setq file (substring file 0 (match-beginning 0))) 
     
    11931193 
    11941194Interactively, or if WILDCARDS is non-nil in a call from Lisp, 
    1195 expand wildcards (if any) and replace the file with multiple files." 
     1195expand wildcards (if any) and replace the file with multiple files. 
     1196 
     1197If the current buffer is an indirect buffer, or the base buffer 
     1198for one or more indirect buffers, the other buffer(s) are not 
     1199killed." 
    11961200  (interactive 
    11971201   (let ((file buffer-file-name) 
     
    12761280removes automounter prefixes (see the variable `automount-dir-prefix')." 
    12771281  ;; Get rid of the prefixes added by the automounter. 
    1278   (if (and automount-dir-prefix 
    1279            (string-match automount-dir-prefix filename) 
    1280            (file-exists-p (file-name-directory 
    1281                            (substring filename (1- (match-end 0)))))) 
    1282       (setq filename (substring filename (1- (match-end 0))))) 
    1283   (let ((tail directory-abbrev-alist)) 
    1284     ;; If any elt of directory-abbrev-alist matches this name, 
    1285     ;; abbreviate accordingly. 
    1286     (while tail 
    1287       (if (string-match (car (car tail)) filename) 
     1282  (save-match-data 
     1283    (if (and automount-dir-prefix 
     1284             (string-match automount-dir-prefix filename) 
     1285             (file-exists-p (file-name-directory 
     1286                             (substring filename (1- (match-end 0)))))) 
     1287        (setq filename (substring filename (1- (match-end 0))))) 
     1288    (let ((tail directory-abbrev-alist)) 
     1289      ;; If any elt of directory-abbrev-alist matches this name, 
     1290      ;; abbreviate accordingly. 
     1291      (while tail 
     1292        (if (string-match (car (car tail)) filename) 
     1293            (setq filename 
     1294                  (concat (cdr (car tail)) (substring filename (match-end 0))))) 
     1295        (setq tail (cdr tail))) 
     1296      ;; Compute and save the abbreviated homedir name. 
     1297      ;; We defer computing this until the first time it's needed, to 
     1298      ;; give time for directory-abbrev-alist to be set properly. 
     1299      ;; We include a slash at the end, to avoid spurious matches 
     1300      ;; such as `/usr/foobar' when the home dir is `/usr/foo'. 
     1301      (or abbreviated-home-dir 
     1302          (setq abbreviated-home-dir 
     1303                (let ((abbreviated-home-dir "$foo")) 
     1304                  (concat "^" (abbreviate-file-name (expand-file-name "~")) 
     1305                          "\\(/\\|$\\)")))) 
     1306 
     1307      ;; If FILENAME starts with the abbreviated homedir, 
     1308      ;; make it start with `~' instead. 
     1309      (if (and (string-match abbreviated-home-dir filename) 
     1310               ;; If the home dir is just /, don't change it. 
     1311               (not (and (= (match-end 0) 1) 
     1312                         (= (aref filename 0) ?/))) 
     1313               ;; MS-DOS root directories can come with a drive letter; 
     1314               ;; Novell Netware allows drive letters beyond `Z:'. 
     1315               (not (and (or (eq system-type 'ms-dos) 
     1316                             (eq system-type 'cygwin) 
     1317                             (eq system-type 'windows-nt)) 
     1318                         (save-match-data 
     1319                           (string-match "^[a-zA-`]:/$" filename))))) 
    12881320          (setq filename 
    1289                 (concat (cdr (car tail)) (substring filename (match-end 0))))) 
    1290       (setq tail (cdr tail))) 
    1291     ;; Compute and save the abbreviated homedir name. 
    1292     ;; We defer computing this until the first time it's needed, to 
    1293     ;; give time for directory-abbrev-alist to be set properly. 
    1294     ;; We include a slash at the end, to avoid spurious matches 
    1295     ;; such as `/usr/foobar' when the home dir is `/usr/foo'. 
    1296     (or abbreviated-home-dir 
    1297         (setq abbreviated-home-dir 
    1298               (let ((abbreviated-home-dir "$foo")) 
    1299                 (concat "^" (abbreviate-file-name (expand-file-name "~")) 
    1300                         "\\(/\\|$\\)")))) 
    1301  
    1302     ;; If FILENAME starts with the abbreviated homedir, 
    1303     ;; make it start with `~' instead. 
    1304     (if (and (string-match abbreviated-home-dir filename) 
    1305              ;; If the home dir is just /, don't change it. 
    1306              (not (and (= (match-end 0) 1) 
    1307                        (= (aref filename 0) ?/))) 
    1308              ;; MS-DOS root directories can come with a drive letter; 
    1309              ;; Novell Netware allows drive letters beyond `Z:'. 
    1310              (not (and (or (eq system-type 'ms-dos) 
    1311                            (eq system-type 'cygwin) 
    1312                            (eq system-type 'windows-nt)) 
    1313                        (save-match-data 
    1314                          (string-match "^[a-zA-`]:/$" filename))))) 
    1315         (setq filename 
    1316               (concat "~" 
    1317                       (substring filename (match-beginning 1) (match-end 1)) 
    1318                       (substring filename (match-end 0))))) 
    1319     filename)) 
     1321                (concat "~" 
     1322                        (match-string 1 filename) 
     1323                        (substring filename (match-end 0))))) 
     1324      filename))) 
    13201325 
    13211326(defcustom find-file-not-true-dirname-list nil 
     
    16281633           (setq buffer-file-name buffer-file-truename)) 
    16291634      (if find-file-visit-truename 
    1630           (setq buffer-file-name 
    1631                 (setq filename 
    1632                       (expand-file-name buffer-file-truename)))) 
     1635          (setq buffer-file-name (expand-file-name buffer-file-truename))) 
    16331636      ;; Set buffer's default directory to that of the file. 
    16341637      (setq default-directory (file-name-directory buffer-file-name)) 
     
    24372440            (princ (car elt) buf) 
    24382441            (insert " : ") 
    2439             (if (stringp (cdr elt)) 
    2440                 ;; Make strings with embedded whitespace easier to read. 
    2441                 (let ((print-escape-newlines t)) 
    2442                   (prin1 (cdr elt) buf)) 
    2443               (princ (cdr elt) buf)) 
     2442            ;; Make strings with embedded whitespace easier to read. 
     2443            (let ((print-escape-newlines t)) 
     2444              (prin1 (cdr elt) buf)) 
    24442445            (insert "\n")) 
    24452446          (setq prompt 
     
    25122513               ;; but the manual didn't say so, 
    25132514               ;; and people want to set var names that aren't all lc. 
    2514                (let ((key (intern (buffer-substring 
    2515                                    (match-beginning 1) 
    2516                                    (match-end 1)))) 
     2515               (let ((key (intern (match-string 1))) 
    25172516                     (val (save-restriction 
    25182517                            (narrow-to-region (point) end) 
     
    27532752  "Set local variable VAR with value VAL." 
    27542753  (cond ((eq var 'mode) 
    2755          (funcall (intern (concat (downcase (symbol-name val)) 
    2756                                   "-mode")))) 
     2754         (funcall (intern (concat (downcase (symbol-name val)) "-mode")))) 
    27572755        ((eq var 'eval) 
    27582756         (save-excursion (eval val))) 
    2759         (t (make-local-variable var) 
    2760           ;; Make sure the string has no text properties. 
    2761           ;; Some text properties can get evaluated in various ways, 
    2762           ;; so it is risky to put them on with a local variable list. 
    2763           (if (stringp val) 
    2764               (set-text-properties 0 (length val) nil val)) 
    2765           (set var val)))) 
     2757        (t 
     2758         ;; Make sure the string has no text properties. 
     2759         ;; Some text properties can get evaluated in various ways, 
     2760         ;; so it is risky to put them on with a local variable list. 
     2761         (if (stringp val) 
     2762             (set-text-properties 0 (length val) nil val)) 
     2763         (set (make-local-variable var) val)))) 
    27662764 
    27672765  
     
    42214219                            (buffer-substring-no-properties 
    42224220                             (point) 
    4223                              (save-excursion 
    4224                                (end-of-line) 
    4225                                (point)))) 
     4221                             (line-end-position))) 
    42264222                      (setq thisfile 
    42274223                            (expand-file-name