changeset 43025:32f6fb5c961f

(pc-select-save-and-set-mode): Properly use MODE-VAR.
author Richard M. Stallman <rms@gnu.org>
date Fri, 01 Feb 2002 03:59:17 +0000
parents 7b45dfaa39cd
children 7c4834964c35
files lisp/emulation/pc-select.el
diffstat 1 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emulation/pc-select.el	Thu Jan 31 06:57:08 2002 +0000
+++ b/lisp/emulation/pc-select.el	Fri Feb 01 03:59:17 2002 +0000
@@ -785,8 +785,8 @@
   "Set VAR to NEWVAL; save the old value.
 The old value is saved on the `pc-select-saved-settings-alist'."
   `(when (boundp ',var)
-       (pc-select-add-to-alist pc-select-saved-settings-alist ,var ,var)
-       (setq ,var ,newval)))
+     (pc-select-add-to-alist pc-select-saved-settings-alist ,var ,var)
+     (setq ,var ,newval)))
 
 (defmacro pc-select-save-and-set-mode (mode &optional arg mode-var)
   "Call the function MODE; save the old value of the variable MODE.
@@ -796,12 +796,11 @@
 nil as an argument.  If MODE-VAR is specified, save the value of the
 variable MODE-VAR (instead of the value of the variable MODE) on
 `pc-select-saved-settings-alist'."
-    `(when (fboundp ',mode)
-       (pc-select-add-to-alist pc-select-saved-settings-alist
-				,mode
-				(or (and (boundp ',mode) ,mode)
-				    ,mode-var))
-       (,mode ,arg)))
+  (unless mode-var (setq mode-var mode))
+  `(when (fboundp ',mode)
+     (pc-select-add-to-alist pc-select-saved-settings-alist
+			     ,mode-var ,mode-var)
+     (,mode ,arg)))
 
 (defmacro pc-select-restore-var (var)
   "Restore the previous value of the variable VAR. 
@@ -821,7 +820,7 @@
     `(when (fboundp ',mode)
        (let ((,elt (assq ',mode pc-select-saved-settings-alist)))
 	 (unless (null ,elt)
-	 (,mode (if (cdr ,elt) 1 -1)))))))
+	   (,mode (if (cdr ,elt) 1 -1)))))))
 
 
 ;;;###autoload