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
48d93beb
Commit
48d93beb
authored
Jan 12, 2008
by
Eli Zaretskii
Browse files
(view-file-other-window, view-file-other-frame): Don't kill the buffer if it
is modified. Doc fixes.
parent
26a30fea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
lisp/ChangeLog
lisp/ChangeLog
+3
-0
lisp/view.el
lisp/view.el
+19
-8
No files found.
lisp/ChangeLog
View file @
48d93beb
2008-01-12 Eli Zaretskii <eliz@gnu.org>
* view.el (view-file-other-window, view-file-other-frame): Don't
kill the buffer if it is modified. Doc fixes.
* progmodes/ebrowse.el (ebrowse-view-file-other-window): Delete
function.
(ebrowse-view/find-file-and-search-pattern): Call
lisp/view.el
View file @
48d93beb
...
...
@@ -263,7 +263,9 @@ This command runs the normal hook `view-mode-hook'."
;;;###autoload
(
defun
view-file-other-window
(
file
)
"View FILE in View mode in another window.
Return that window to its previous buffer when done.
When done, return that window to its previous buffer, and kill the
buffer visiting FILE if unmodified and if it wasn't visited before.
Emacs commands editing the buffer contents are not available; instead,
a special set of commands (mostly letters and punctuation)
are defined for moving around in the buffer.
...
...
@@ -273,14 +275,20 @@ For list of all View commands, type H or h while viewing.
This command runs the normal hook `view-mode-hook'."
(
interactive
"fIn other window view file: "
)
(
unless
(
file-exists-p
file
)
(
error
"%s does not exist"
file
))
(
let
((
had-a-buf
(
get-file-buffer
file
)))
(
view-buffer-other-window
(
find-file-noselect
file
)
nil
(
and
(
not
had-a-buf
)
'kill-buffer
))))
(
let
((
had-a-buf
(
get-file-buffer
file
))
(
buf-to-view
(
find-file-noselect
file
)))
(
view-buffer-other-window
buf-to-view
nil
(
and
(
not
had-a-buf
)
(
not
(
buffer-modified-p
buf-to-view
))
'kill-buffer
))))
;;;###autoload
(
defun
view-file-other-frame
(
file
)
"View FILE in View mode in another frame.
Maybe delete other frame and/or return to previous buffer when done.
When done, kill the buffer visiting FILE if unmodified and if it wasn't
visited before; also, maybe delete other frame and/or return to previous
buffer.
Emacs commands editing the buffer contents are not available; instead,
a special set of commands (mostly letters and punctuation)
are defined for moving around in the buffer.
...
...
@@ -290,9 +298,12 @@ For list of all View commands, type H or h while viewing.
This command runs the normal hook `view-mode-hook'."
(
interactive
"fIn other frame view file: "
)
(
unless
(
file-exists-p
file
)
(
error
"%s does not exist"
file
))
(
let
((
had-a-buf
(
get-file-buffer
file
)))
(
view-buffer-other-frame
(
find-file-noselect
file
)
nil
(
and
(
not
had-a-buf
)
'kill-buffer
))))
(
let
((
had-a-buf
(
get-file-buffer
file
))
(
buf-to-view
(
find-file-noselect
file
)))
(
view-buffer-other-frame
buf-to-view
nil
(
and
(
not
had-a-buf
)
(
not
(
buffer-modified-p
buf-to-view
))
'kill-buffer
))))
;;;###autoload
...
...
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