diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2009-07-26 23:06:49 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2009-07-26 23:06:49 +0000 |
commit | 5704140c4d8810198b7fa0fb06dc9dc7770585b4 (patch) | |
tree | b30fea45809d0de669fbf5572bfb506384103744 /lisp/view.el | |
parent | e343066fb12414b7834ec95b9a7e048fd6004280 (diff) | |
download | emacs-5704140c4d8810198b7fa0fb06dc9dc7770585b4.tar.gz |
* view.el (view-mode-enable): Don't define Helper-return-blurb if
it's not needed.
Diffstat (limited to 'lisp/view.el')
-rw-r--r-- | lisp/view.el | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lisp/view.el b/lisp/view.el index a0c020ccf43..311d5e3123c 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -120,9 +120,6 @@ functions that enable or disable view mode.") (defvar view-old-Helper-return-blurb) (make-variable-buffer-local 'view-old-Helper-return-blurb) -;; Just to avoid warnings. -(defvar Helper-return-blurb) - (defvar view-page-size nil "Default number of lines to scroll by View page commands. If nil that means use the window size.") @@ -492,14 +489,15 @@ Entry to view-mode runs the normal hook `view-mode-hook'." view-page-size nil view-half-page-size nil view-old-buffer-read-only buffer-read-only - buffer-read-only t - view-old-Helper-return-blurb (and (boundp 'Helper-return-blurb) - Helper-return-blurb) - Helper-return-blurb - (format "continue viewing %s" - (if (buffer-file-name) - (file-name-nondirectory (buffer-file-name)) - (buffer-name)))) + buffer-read-only t) + (if (boundp 'Helper-return-blurb) + (setq view-old-Helper-return-blurb (and (boundp 'Helper-return-blurb) + Helper-return-blurb) + Helper-return-blurb + (format "continue viewing %s" + (if (buffer-file-name) + (file-name-nondirectory (buffer-file-name)) + (buffer-name))))) (force-mode-line-update) (run-hooks 'view-mode-hook)) @@ -516,8 +514,9 @@ Entry to view-mode runs the normal hook `view-mode-hook'." ;; so that View mode stays off if toggle-read-only is called. (if (local-variable-p 'view-read-only) (kill-local-variable 'view-read-only)) - (setq view-mode nil - Helper-return-blurb view-old-Helper-return-blurb) + (setq view-mode nil) + (if (boundp 'Helper-return-blurb) + (setq Helper-return-blurb view-old-Helper-return-blurb)) (if buffer-read-only (setq buffer-read-only view-old-buffer-read-only))) |