aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1993-12-23 03:49:15 +0000
committerRichard M. Stallman1993-12-23 03:49:15 +0000
commit6f93191964eb7b953acdab12407852582af3286a (patch)
treecb50a2e51024d84071bb6ec3c872bba1c122c47f /lisp
parentaea2e14ce538c98ccdbba633d428a8ca4af6e240 (diff)
downloademacs-6f93191964eb7b953acdab12407852582af3286a.tar.gz
emacs-6f93191964eb7b953acdab12407852582af3286a.zip
(hack-local-variables-prop-line): If we can't switch-to-buffer
in selected window, try another window, then a new frame. (set-visited-file-name): Don't rename-buffer if buffer already has the desired name. (insert-file): Add * to interactive spec.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el16
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el
index f5a86a981a9..55cc671e8f1 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -947,7 +947,16 @@ If `enable-local-variables' is nil, this function does not check for a
947 (or (eq enable-local-variables t) 947 (or (eq enable-local-variables t)
948 (and enable-local-variables 948 (and enable-local-variables
949 (save-window-excursion 949 (save-window-excursion
950 (switch-to-buffer (current-buffer)) 950 (condition-case nil
951 (switch-to-buffer (current-buffer))
952 (error
953 ;; If we fail to switch in the selected window,
954 ;; it is probably a minibuffer.
955 ;; So try another window.
956 (condition-case nil
957 (switch-to-buffer-other-window (current-buffer))
958 (error
959 (switch-to-buffer-other-frame (current-buffer))))))
951 (y-or-n-p (format "Set local variables as specified in -*- line of %s? " 960 (y-or-n-p (format "Set local variables as specified in -*- line of %s? "
952 (file-name-nondirectory buffer-file-name))))))) 961 (file-name-nondirectory buffer-file-name)))))))
953 (while result 962 (while result
@@ -1091,7 +1100,8 @@ if you wish to pass an empty string as the argument."
1091 (if (eq system-type 'vax-vms) 1100 (if (eq system-type 'vax-vms)
1092 (setq new-name (downcase new-name))) 1101 (setq new-name (downcase new-name)))
1093 (setq default-directory (file-name-directory buffer-file-name)) 1102 (setq default-directory (file-name-directory buffer-file-name))
1094 (rename-buffer new-name t))) 1103 (or (string= new-name (buffer-name))
1104 (rename-buffer new-name t))))
1095 (setq buffer-backed-up nil) 1105 (setq buffer-backed-up nil)
1096 (clear-visited-file-modtime) 1106 (clear-visited-file-modtime)
1097 (if filename 1107 (if filename
@@ -1578,7 +1588,7 @@ Set mark after the inserted text.
1578This function is meant for the user to run interactively. 1588This function is meant for the user to run interactively.
1579Don't call it from programs! Use `insert-file-contents' instead. 1589Don't call it from programs! Use `insert-file-contents' instead.
1580\(Its calling sequence is different; see its documentation)." 1590\(Its calling sequence is different; see its documentation)."
1581 (interactive "fInsert file: ") 1591 (interactive "*fInsert file: ")
1582 (if (file-directory-p filename) 1592 (if (file-directory-p filename)
1583 (signal 'file-error (list "Opening input file" "file is a directory" 1593 (signal 'file-error (list "Opening input file" "file is a directory"
1584 filename))) 1594 filename)))