From: Chong Yidong Date: Sun, 26 Jul 2009 23:06:49 +0000 (+0000) Subject: * view.el (view-mode-enable): Don't define Helper-return-blurb if X-Git-Tag: emacs-pretest-23.1.90~2017 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5704140c4d8810198b7fa0fb06dc9dc7770585b4;p=emacs.git * view.el (view-mode-enable): Don't define Helper-return-blurb if it's not needed. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index adb5a0af17b..a126b939a19 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-07-26 Chong Yidong + + * view.el (view-mode-enable): Don't define Helper-return-blurb if + it's not needed. + 2009-07-25 Eli Zaretskii Fix Bug#3888: 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)))