aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emulation
diff options
context:
space:
mode:
authorRichard M. Stallman2002-02-01 03:59:17 +0000
committerRichard M. Stallman2002-02-01 03:59:17 +0000
commit024ab5b50476c6bf0d3bd1ddf1cd9d0aef2cdda6 (patch)
tree66a8763fd2e85ec3691d747b5e9cf0f407f50e30 /lisp/emulation
parentf95c4fe5fafb503c73c6bad52e754e36159fe74b (diff)
downloademacs-024ab5b50476c6bf0d3bd1ddf1cd9d0aef2cdda6.tar.gz
emacs-024ab5b50476c6bf0d3bd1ddf1cd9d0aef2cdda6.zip
(pc-select-save-and-set-mode): Properly use MODE-VAR.
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/pc-select.el17
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/emulation/pc-select.el b/lisp/emulation/pc-select.el
index 90865f2bdee..aa5070647a3 100644
--- a/lisp/emulation/pc-select.el
+++ b/lisp/emulation/pc-select.el
@@ -785,8 +785,8 @@ cdr of that cell with VAL. Otherwise, make a new cons cell
785 "Set VAR to NEWVAL; save the old value. 785 "Set VAR to NEWVAL; save the old value.
786The old value is saved on the `pc-select-saved-settings-alist'." 786The old value is saved on the `pc-select-saved-settings-alist'."
787 `(when (boundp ',var) 787 `(when (boundp ',var)
788 (pc-select-add-to-alist pc-select-saved-settings-alist ,var ,var) 788 (pc-select-add-to-alist pc-select-saved-settings-alist ,var ,var)
789 (setq ,var ,newval))) 789 (setq ,var ,newval)))
790 790
791(defmacro pc-select-save-and-set-mode (mode &optional arg mode-var) 791(defmacro pc-select-save-and-set-mode (mode &optional arg mode-var)
792 "Call the function MODE; save the old value of the variable MODE. 792 "Call the function MODE; save the old value of the variable MODE.
@@ -796,12 +796,11 @@ Then, if ARG is specified, call MODE with ARG, otherwise call it with
796nil as an argument. If MODE-VAR is specified, save the value of the 796nil as an argument. If MODE-VAR is specified, save the value of the
797variable MODE-VAR (instead of the value of the variable MODE) on 797variable MODE-VAR (instead of the value of the variable MODE) on
798`pc-select-saved-settings-alist'." 798`pc-select-saved-settings-alist'."
799 `(when (fboundp ',mode) 799 (unless mode-var (setq mode-var mode))
800 (pc-select-add-to-alist pc-select-saved-settings-alist 800 `(when (fboundp ',mode)
801 ,mode 801 (pc-select-add-to-alist pc-select-saved-settings-alist
802 (or (and (boundp ',mode) ,mode) 802 ,mode-var ,mode-var)
803 ,mode-var)) 803 (,mode ,arg)))
804 (,mode ,arg)))
805 804
806(defmacro pc-select-restore-var (var) 805(defmacro pc-select-restore-var (var)
807 "Restore the previous value of the variable VAR. 806 "Restore the previous value of the variable VAR.
@@ -821,7 +820,7 @@ If the value is non-nil, call the function MODE with an argument of
821 `(when (fboundp ',mode) 820 `(when (fboundp ',mode)
822 (let ((,elt (assq ',mode pc-select-saved-settings-alist))) 821 (let ((,elt (assq ',mode pc-select-saved-settings-alist)))
823 (unless (null ,elt) 822 (unless (null ,elt)
824 (,mode (if (cdr ,elt) 1 -1))))))) 823 (,mode (if (cdr ,elt) 1 -1)))))))
825 824
826 825
827;;;###autoload 826;;;###autoload