changeset 71555:d9b9f70ec91a

(find-file-noselect-1): Remove unused var assignment. (hack-local-variables-confirm): Print lists of strings as lists of strings rather than lists of symbols. (abbreviate-file-name, hack-local-variables-prop-line): Use match-string. (hack-one-local-variable): Move `make-local-variable' nearer its use. (recover-session-finish): Use line-end-position.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 02 Jul 2006 14:26:53 +0000
parents 0b31608be4a1
children 31835ba46d29
files lisp/files.el
diffstat 1 files changed, 16 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Sat Jul 01 23:29:04 2006 +0000
+++ b/lisp/files.el	Sun Jul 02 14:26:53 2006 +0000
@@ -488,7 +488,7 @@
 specified in a -*- line.")
 
 (defcustom enable-local-eval 'maybe
-  "*Control processing of the \"variable\" `eval' in a file's local variables.
+  "Control processing of the \"variable\" `eval' in a file's local variables.
 The value can be t, nil or something else.
 A value of t means obey `eval' variables;
 nil means ignore them; anything else means query."
@@ -1314,7 +1314,7 @@
 			 (string-match "^[a-zA-`]:/$" filename)))))
 	(setq filename
 	      (concat "~"
-		      (substring filename (match-beginning 1) (match-end 1))
+		      (match-string 1 filename)
 		      (substring filename (match-end 0)))))
     filename))
 
@@ -1627,9 +1627,7 @@
 	     (not (member logical find-file-not-true-dirname-list)))
 	   (setq buffer-file-name buffer-file-truename))
       (if find-file-visit-truename
-	  (setq buffer-file-name
-		(setq filename
-		      (expand-file-name buffer-file-truename))))
+	  (setq buffer-file-name (expand-file-name buffer-file-truename)))
       ;; Set buffer's default directory to that of the file.
       (setq default-directory (file-name-directory buffer-file-name))
       ;; Turn off backup files for certain file names.  Since
@@ -2436,11 +2434,9 @@
 		   (insert "    ")))
 	    (princ (car elt) buf)
 	    (insert " : ")
-            (if (stringp (cdr elt))
-                ;; Make strings with embedded whitespace easier to read.
-                (let ((print-escape-newlines t))
-                  (prin1 (cdr elt) buf))
-              (princ (cdr elt) buf))
+            ;; Make strings with embedded whitespace easier to read.
+            (let ((print-escape-newlines t))
+              (prin1 (cdr elt) buf))
 	    (insert "\n"))
 	  (setq prompt
 		(format "Please type %s%s: "
@@ -2511,9 +2507,7 @@
 	       ;; There used to be a downcase here,
 	       ;; but the manual didn't say so,
 	       ;; and people want to set var names that aren't all lc.
-	       (let ((key (intern (buffer-substring
-				   (match-beginning 1)
-				   (match-end 1))))
+	       (let ((key (intern (match-string 1)))
 		     (val (save-restriction
 			    (narrow-to-region (point) end)
 			    (read (current-buffer)))))
@@ -2752,17 +2746,16 @@
 (defun hack-one-local-variable (var val)
   "Set local variable VAR with value VAL."
   (cond ((eq var 'mode)
-	 (funcall (intern (concat (downcase (symbol-name val))
-				  "-mode"))))
+	 (funcall (intern (concat (downcase (symbol-name val)) "-mode"))))
 	((eq var 'eval)
 	 (save-excursion (eval val)))
-	(t (make-local-variable var)
-	   ;; Make sure the string has no text properties.
-	   ;; Some text properties can get evaluated in various ways,
-	   ;; so it is risky to put them on with a local variable list.
-	   (if (stringp val)
-	       (set-text-properties 0 (length val) nil val))
-	   (set var val))))
+	(t
+         ;; Make sure the string has no text properties.
+         ;; Some text properties can get evaluated in various ways,
+         ;; so it is risky to put them on with a local variable list.
+         (if (stringp val)
+             (set-text-properties 0 (length val) nil val))
+         (set (make-local-variable var) val))))
 
 
 (defcustom change-major-mode-with-file-name t
@@ -4220,9 +4213,7 @@
 		      (setq autofile
 			    (buffer-substring-no-properties
 			     (point)
-			     (save-excursion
-			       (end-of-line)
-			       (point))))
+			     (line-end-position)))
 		      (setq thisfile
 			    (expand-file-name
 			     (substring