diff options
| author | Chong Yidong | 2012-02-01 16:31:29 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-02-01 16:31:29 +0800 |
| commit | e2cef717da50fcb5c1e3a58b35b34dc13a5f3fb1 (patch) | |
| tree | 5329eebebe4271b7f2733f01ea03ea8882688f13 | |
| parent | 9f5626684300af96cca5c2f86c377d93173e4cab (diff) | |
| download | emacs-e2cef717da50fcb5c1e3a58b35b34dc13a5f3fb1.tar.gz emacs-e2cef717da50fcb5c1e3a58b35b34dc13a5f3fb1.zip | |
Fix view-buffer-other-window/frame handling of special modes.
* view.el (view-buffer-other-window, view-buffer-other-frame):
Handle special modes like view-buffer.
(view-buffer): Simplify.
Fixes: debbugs:10650
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/view.el | 18 |
2 files changed, 13 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 152acc03f14..7d05f85f247 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2012-02-01 Chong Yidong <cyd@gnu.org> | 1 | 2012-02-01 Chong Yidong <cyd@gnu.org> |
| 2 | 2 | ||
| 3 | * view.el (view-buffer-other-window, view-buffer-other-frame): | ||
| 4 | Handle special modes like view-buffer (Bug#10650). | ||
| 5 | (view-buffer): Simplify. | ||
| 6 | |||
| 3 | * frame.el (set-frame-font): Tweak meaning of third argument. | 7 | * frame.el (set-frame-font): Tweak meaning of third argument. |
| 4 | 8 | ||
| 5 | * dynamic-setting.el (font-setting-change-default-font): Use | 9 | * dynamic-setting.el (font-setting-change-default-font): Use |
diff --git a/lisp/view.el b/lisp/view.el index 035f8c61d9f..4a219971097 100644 --- a/lisp/view.el +++ b/lisp/view.el | |||
| @@ -311,13 +311,9 @@ file: Users may suspend viewing in order to modify the buffer. | |||
| 311 | Exiting View mode will then discard the user's edits. Setting | 311 | Exiting View mode will then discard the user's edits. Setting |
| 312 | EXIT-ACTION to `kill-buffer-if-not-modified' avoids this." | 312 | EXIT-ACTION to `kill-buffer-if-not-modified' avoids this." |
| 313 | (interactive "bView buffer: ") | 313 | (interactive "bView buffer: ") |
| 314 | (if (eq (with-current-buffer buffer | 314 | (switch-to-buffer buffer) |
| 315 | (get major-mode 'mode-class)) | 315 | (if (eq (get major-mode 'mode-class) 'special) |
| 316 | 'special) | 316 | (message "Not using View mode because the major mode is special") |
| 317 | (progn | ||
| 318 | (switch-to-buffer buffer) | ||
| 319 | (message "Not using View mode because the major mode is special")) | ||
| 320 | (switch-to-buffer buffer) | ||
| 321 | (view-mode-enter nil exit-action))) | 317 | (view-mode-enter nil exit-action))) |
| 322 | 318 | ||
| 323 | ;;;###autoload | 319 | ;;;###autoload |
| @@ -339,7 +335,9 @@ this argument instead of explicitly setting `view-exit-action'." | |||
| 339 | (interactive "bIn other window view buffer:\nP") | 335 | (interactive "bIn other window view buffer:\nP") |
| 340 | (let ((pop-up-windows t)) | 336 | (let ((pop-up-windows t)) |
| 341 | (pop-to-buffer buffer t)) | 337 | (pop-to-buffer buffer t)) |
| 342 | (view-mode-enter nil exit-action)) | 338 | (if (eq (get major-mode 'mode-class) 'special) |
| 339 | (message "Not using View mode because the major mode is special") | ||
| 340 | (view-mode-enter nil exit-action))) | ||
| 343 | 341 | ||
| 344 | ;;;###autoload | 342 | ;;;###autoload |
| 345 | (defun view-buffer-other-frame (buffer &optional not-return exit-action) | 343 | (defun view-buffer-other-frame (buffer &optional not-return exit-action) |
| @@ -360,7 +358,9 @@ this argument instead of explicitly setting `view-exit-action'." | |||
| 360 | (interactive "bView buffer in other frame: \nP") | 358 | (interactive "bView buffer in other frame: \nP") |
| 361 | (let ((pop-up-frames t)) | 359 | (let ((pop-up-frames t)) |
| 362 | (pop-to-buffer buffer t)) | 360 | (pop-to-buffer buffer t)) |
| 363 | (view-mode-enter nil exit-action)) | 361 | (if (eq (get major-mode 'mode-class) 'special) |
| 362 | (message "Not using View mode because the major mode is special") | ||
| 363 | (view-mode-enter nil exit-action))) | ||
| 364 | 364 | ||
| 365 | ;;;###autoload | 365 | ;;;###autoload |
| 366 | (define-minor-mode view-mode | 366 | (define-minor-mode view-mode |