From: Glenn Morris Date: Wed, 3 Nov 2010 08:03:42 +0000 (-0700) Subject: reftex-toc trivia. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~392 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=728618ba3d8c8e452b283b2f7490a8a97abfb9ee;p=emacs.git reftex-toc trivia. * lisp/textmodes/reftex-toc.el (reftex-toc-do-promote): Remove unused local `mpos'. (reftex-toc-restore-region): Make `mpos' local to this function. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 044ff60a4a6..3068b97cd79 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -7,6 +7,8 @@ set-process-query-on-exit-flag. * textmodes/reftex-toc.el (name1, dummy, dummy2): Remove unused decs. + (reftex-toc-do-promote): Remove unused local `mpos'. + (reftex-toc-restore-region): Make `mpos' local to this function. * net/dbus.el (dbus-name-owner-changed-handler): Doc fix. diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index 0c32b0cc7e4..496f9b4ddf3 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el @@ -546,7 +546,6 @@ Useful for large TOC's." ;; Promotion/Demotion stuff (defvar delta) -(defvar mpos) (defvar pro-or-de) (defvar start-pos) (defvar start-line) @@ -575,7 +574,7 @@ point." (if (bolp) 1 0))))) (start-pos (point)) (pro-or-de (if (> delta 0) "de" "pro")) - beg end entries data sections nsec mpos msg) + beg end entries data sections nsec msg) (setq msg (catch 'exit (if (reftex-region-active-p) @@ -629,20 +628,20 @@ point." (defun reftex-toc-restore-region (point-line &optional mark-line) - (when mark-line - (goto-char (point-min)) - (forward-line (1- mark-line)) - (setq mpos (point))) - (when point-line - (goto-char (point-min)) - (forward-line (1- point-line))) - (if mark-line - (progn - (set-mark mpos) - (if (featurep 'xemacs) - (zmacs-activate-region) - (setq mark-active t - deactivate-mark nil))))) + (let (mpos) + (when mark-line + (goto-char (point-min)) + (forward-line (1- mark-line)) + (setq mpos (point))) + (when point-line + (goto-char (point-min)) + (forward-line (1- point-line))) + (when mark-line + (set-mark mpos) + (if (featurep 'xemacs) + (zmacs-activate-region) + (setq mark-active t + deactivate-mark nil))))) (defun reftex-toc-promote-prepare (x) "Look at a toc entry and see if we could pro/demote it.