Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
60eaf370
Commit
60eaf370
authored
Oct 11, 1995
by
Richard M. Stallman
Browse files
(find-alternate-file-other-window): New function.
parent
03d50ea5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
lisp/files.el
lisp/files.el
+20
-0
No files found.
lisp/files.el
View file @
60eaf370
...
...
@@ -514,6 +514,26 @@ Use \\[toggle-read-only] to permit editing."
(
setq
buffer-read-only
t
)
(
current-buffer
))
(
defun
find-alternate-file-other-window
(
filename
)
"Find file FILENAME as a replacement for the file in the next window.
This command does not select that window."
(
interactive
(
save-selected-window
(
other-window
1
)
(
let
((
file
buffer-file-name
)
(
file-name
nil
)
(
file-dir
nil
))
(
and
file
(
setq
file-name
(
file-name-nondirectory
file
)
file-dir
(
file-name-directory
file
)))
(
list
(
read-file-name
"Find alternate file: "
file-dir
nil
nil
file-name
)))))
(
if
(
one-window-p
)
(
find-file-other-window
filename
)
(
save-selected-window
(
other-window
1
)
(
find-alternate-file
filename
))))
(
defun
find-alternate-file
(
filename
)
"Find file FILENAME, select its buffer, kill previous buffer.
If the current buffer now contains an empty file that you just visited
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment