diff options
| author | Glenn Morris | 2012-03-15 21:40:20 -0400 |
|---|---|---|
| committer | Glenn Morris | 2012-03-15 21:40:20 -0400 |
| commit | da986230818288ce7f24d6803a0acf78c06ad656 (patch) | |
| tree | ed0f931613ee1450a8da799cfc17caa3c43e6fa8 | |
| parent | 0835f01e98aa01800565e727ff63a29099b0a0c0 (diff) | |
| download | emacs-da986230818288ce7f24d6803a0acf78c06ad656.tar.gz emacs-da986230818288ce7f24d6803a0acf78c06ad656.zip | |
Doc fixes for view-mode and special major-modes
Ref: http://debbugs.gnu.org/10650
* doc/lispref/modes.texi (Major Mode Conventions):
Mention the strange (IMO) relationship between View mode and special modes.
* lisp/view.el (view-buffer, view-buffer-other-window)
(view-buffer-other-frame): Doc fixes re special mode-class.
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/view.el | 18 |
4 files changed, 27 insertions, 3 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 3584c89d5fe..576f543a9f0 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-03-16 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * modes.texi (Major Mode Conventions): Mention the strange | ||
| 4 | relationship between View mode and special modes. (Bug#10650) | ||
| 5 | |||
| 1 | 2012-03-11 Chong Yidong <cyd@gnu.org> | 6 | 2012-03-11 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * windows.texi (Window Configurations): save-window-excursion is | 8 | * windows.texi (Window Configurations): save-window-excursion is |
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index b0e9d4a3139..946dcb91317 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -525,6 +525,10 @@ mode when creating new buffers (@pxref{Auto Major Mode}), but with such | |||
| 525 | @code{special} modes, Fundamental mode is used instead. Modes such as | 525 | @code{special} modes, Fundamental mode is used instead. Modes such as |
| 526 | Dired, Rmail, and Buffer List use this feature. | 526 | Dired, Rmail, and Buffer List use this feature. |
| 527 | 527 | ||
| 528 | The function @code{view-buffer} does not enable View mode in buffers | ||
| 529 | whose mode-class is special, because such modes usually provide their | ||
| 530 | own View-like bindings. | ||
| 531 | |||
| 528 | The @code{define-derived-mode} macro automatically marks the derived | 532 | The @code{define-derived-mode} macro automatically marks the derived |
| 529 | mode as special if the parent mode is special. Special mode is a | 533 | mode as special if the parent mode is special. Special mode is a |
| 530 | convenient parent for such modes to inherit from; @xref{Basic Major | 534 | convenient parent for such modes to inherit from; @xref{Basic Major |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7d9ccc95758..35da6fc9e31 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2012-03-16 Glenn Morris <rgm@gnu.org> | 1 | 2012-03-16 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * view.el (view-buffer, view-buffer-other-window) | ||
| 4 | (view-buffer-other-frame): Doc fixes re special mode-class. | ||
| 5 | |||
| 3 | * subr.el (eval-after-load): If named feature is provided not from | 6 | * subr.el (eval-after-load): If named feature is provided not from |
| 4 | a file, run after-load forms. (Bug#10946) | 7 | a file, run after-load forms. (Bug#10946) |
| 5 | 8 | ||
diff --git a/lisp/view.el b/lisp/view.el index 4a219971097..41cb9752288 100644 --- a/lisp/view.el +++ b/lisp/view.el | |||
| @@ -309,7 +309,11 @@ this argument instead of explicitly setting `view-exit-action'. | |||
| 309 | Do not set EXIT-ACTION to `kill-buffer' when BUFFER visits a | 309 | Do not set EXIT-ACTION to `kill-buffer' when BUFFER visits a |
| 310 | file: Users may suspend viewing in order to modify the buffer. | 310 | 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 | |||
| 314 | This function does not enable View mode if the buffer's major-mode | ||
| 315 | has a `special' mode-class, because such modes usually have their | ||
| 316 | own View-like bindings." | ||
| 313 | (interactive "bView buffer: ") | 317 | (interactive "bView buffer: ") |
| 314 | (switch-to-buffer buffer) | 318 | (switch-to-buffer buffer) |
| 315 | (if (eq (get major-mode 'mode-class) 'special) | 319 | (if (eq (get major-mode 'mode-class) 'special) |
| @@ -331,7 +335,11 @@ Optional argument NOT-RETURN is ignored. | |||
| 331 | 335 | ||
| 332 | Optional argument EXIT-ACTION is either nil or a function with buffer as | 336 | Optional argument EXIT-ACTION is either nil or a function with buffer as |
| 333 | argument. This function is called when finished viewing buffer. Use | 337 | argument. This function is called when finished viewing buffer. Use |
| 334 | this argument instead of explicitly setting `view-exit-action'." | 338 | this argument instead of explicitly setting `view-exit-action'. |
| 339 | |||
| 340 | This function does not enable View mode if the buffer's major-mode | ||
| 341 | has a `special' mode-class, because such modes usually have their | ||
| 342 | own View-like bindings." | ||
| 335 | (interactive "bIn other window view buffer:\nP") | 343 | (interactive "bIn other window view buffer:\nP") |
| 336 | (let ((pop-up-windows t)) | 344 | (let ((pop-up-windows t)) |
| 337 | (pop-to-buffer buffer t)) | 345 | (pop-to-buffer buffer t)) |
| @@ -354,7 +362,11 @@ Optional argument NOT-RETURN is ignored. | |||
| 354 | 362 | ||
| 355 | Optional argument EXIT-ACTION is either nil or a function with buffer as | 363 | Optional argument EXIT-ACTION is either nil or a function with buffer as |
| 356 | argument. This function is called when finished viewing buffer. Use | 364 | argument. This function is called when finished viewing buffer. Use |
| 357 | this argument instead of explicitly setting `view-exit-action'." | 365 | this argument instead of explicitly setting `view-exit-action'. |
| 366 | |||
| 367 | This function does not enable View mode if the buffer's major-mode | ||
| 368 | has a `special' mode-class, because such modes usually have their | ||
| 369 | own View-like bindings." | ||
| 358 | (interactive "bView buffer in other frame: \nP") | 370 | (interactive "bView buffer in other frame: \nP") |
| 359 | (let ((pop-up-frames t)) | 371 | (let ((pop-up-frames t)) |
| 360 | (pop-to-buffer buffer t)) | 372 | (pop-to-buffer buffer t)) |