diff options
author | Richard M. Stallman <[email protected]> | 1993-12-23 03:49:15 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1993-12-23 03:49:15 +0000 |
commit | 6f93191964eb7b953acdab12407852582af3286a (patch) | |
tree | cb50a2e51024d84071bb6ec3c872bba1c122c47f /lisp/files.el | |
parent | aea2e14ce538c98ccdbba633d428a8ca4af6e240 (diff) |
(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/files.el')
-rw-r--r-- | lisp/files.el | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el index f5a86a981a..55cc671e8f 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 (or (eq enable-local-variables t) (and enable-local-variables (save-window-excursion - (switch-to-buffer (current-buffer)) + (condition-case nil + (switch-to-buffer (current-buffer)) + (error + ;; If we fail to switch in the selected window, + ;; it is probably a minibuffer. + ;; So try another window. + (condition-case nil + (switch-to-buffer-other-window (current-buffer)) + (error + (switch-to-buffer-other-frame (current-buffer)))))) (y-or-n-p (format "Set local variables as specified in -*- line of %s? " (file-name-nondirectory buffer-file-name))))))) (while result @@ -1091,7 +1100,8 @@ if you wish to pass an empty string as the argument." (if (eq system-type 'vax-vms) (setq new-name (downcase new-name))) (setq default-directory (file-name-directory buffer-file-name)) - (rename-buffer new-name t))) + (or (string= new-name (buffer-name)) + (rename-buffer new-name t)))) (setq buffer-backed-up nil) (clear-visited-file-modtime) (if filename @@ -1578,7 +1588,7 @@ Set mark after the inserted text. This function is meant for the user to run interactively. Don't call it from programs! Use `insert-file-contents' instead. \(Its calling sequence is different; see its documentation)." - (interactive "fInsert file: ") + (interactive "*fInsert file: ") (if (file-directory-p filename) (signal 'file-error (list "Opening input file" "file is a directory" filename))) |