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
90bb2ff4
Commit
90bb2ff4
authored
Jul 09, 2003
by
Richard M. Stallman
Browse files
(view-file): If existing buffer's major mode is special,
don't go into view mode.
parent
e2cf2d72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
lisp/view.el
lisp/view.el
+9
-3
No files found.
lisp/view.el
View file @
90bb2ff4
...
@@ -243,9 +243,15 @@ For list of all View commands, type H or h while viewing.
...
@@ -243,9 +243,15 @@ For list of all View commands, type H or h while viewing.
This command runs the normal hook `view-mode-hook'."
This command runs the normal hook `view-mode-hook'."
(
interactive
"fView file: "
)
(
interactive
"fView file: "
)
(
unless
(
file-exists-p
file
)
(
error
"%s does not exist"
file
))
(
unless
(
file-exists-p
file
)
(
error
"%s does not exist"
file
))
(
let
((
had-a-buf
(
get-file-buffer
file
)))
(
let
((
had-a-buf
(
get-file-buffer
file
))
(
view-buffer
(
find-file-noselect
file
)
(
buffer
(
find-file-noselect
file
)))
(
and
(
not
had-a-buf
)
'kill-buffer
))))
(
if
(
eq
(
with-current-buffer
buffer
(
get
major-mode
'mode-class
))
'special
)
(
progn
(
switch-to-buffer
buffer
)
(
message
"Not using View mode because the major mode is special"
))
(
view-buffer
buffer
(
and
(
not
had-a-buf
)
'kill-buffer
)))))
;;;###autoload
;;;###autoload
(
defun
view-file-other-window
(
file
)
(
defun
view-file-other-window
(
file
)
...
...
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