changeset 111338:f36bcc8c2a23

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.
author Glenn Morris <rgm@gnu.org>
date Wed, 03 Nov 2010 01:03:42 -0700
parents 4fc3989048ca
children a2ba77c845e9
files lisp/ChangeLog lisp/textmodes/reftex-toc.el
diffstat 2 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Nov 03 00:57:43 2010 -0700
+++ b/lisp/ChangeLog	Wed Nov 03 01:03:42 2010 -0700
@@ -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.
 
--- a/lisp/textmodes/reftex-toc.el	Wed Nov 03 00:57:43 2010 -0700
+++ b/lisp/textmodes/reftex-toc.el	Wed Nov 03 01:03:42 2010 -0700
@@ -546,7 +546,6 @@
 ;; Promotion/Demotion stuff
 
 (defvar delta)
-(defvar mpos)
 (defvar pro-or-de)
 (defvar start-pos)
 (defvar start-line)
@@ -575,7 +574,7 @@
 					    (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 @@
 
 
 (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.