/[emacs]/emacs/lisp/emulation/pc-select.el
ViewVC logotype

Diff of /emacs/lisp/emulation/pc-select.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by rms, Sat Jan 26 22:47:39 2002 UTC revision 1.22 by rms, Fri Feb 1 03:59:17 2002 UTC
# Line 785  cdr of that cell with VAL.  Otherwise, m Line 785  cdr of that cell with VAL.  Otherwise, m
785    "Set VAR to NEWVAL; save the old value.    "Set VAR to NEWVAL; save the old value.
786  The old value is saved on the `pc-select-saved-settings-alist'."  The old value is saved on the `pc-select-saved-settings-alist'."
787    `(when (boundp ',var)    `(when (boundp ',var)
788         (pc-select-add-to-alist pc-select-saved-settings-alist ,var ,var)       (pc-select-add-to-alist pc-select-saved-settings-alist ,var ,var)
789         (setq ,var ,newval)))       (setq ,var ,newval)))
790    
791  (defmacro pc-select-save-and-set-mode (mode &optional arg mode-var)  (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.    "Call the function MODE; save the old value of the variable MODE.
# Line 796  Then, if ARG is specified, call MODE wit Line 796  Then, if ARG is specified, call MODE wit
796  nil as an argument.  If MODE-VAR is specified, save the value of the  nil as an argument.  If MODE-VAR is specified, save the value of the
797  variable MODE-VAR (instead of the value of the variable MODE) on  variable MODE-VAR (instead of the value of the variable MODE) on
798  `pc-select-saved-settings-alist'."  `pc-select-saved-settings-alist'."
799      `(when (fboundp ',mode)    (unless mode-var (setq mode-var mode))
800         (pc-select-add-to-alist pc-select-saved-settings-alist    `(when (fboundp ',mode)
801                                  ,mode       (pc-select-add-to-alist pc-select-saved-settings-alist
802                                  (or (and (boundp ',mode) ,mode)                               ,mode-var ,mode-var)
803                                      ,mode-var))       (,mode ,arg)))
        (,mode ,arg)))  
804    
805  (defmacro pc-select-restore-var (var)  (defmacro pc-select-restore-var (var)
806    "Restore the previous value of the variable VAR.    "Restore the previous value of the variable VAR.
# Line 821  If the value is non-nil, call the functi Line 820  If the value is non-nil, call the functi
820      `(when (fboundp ',mode)      `(when (fboundp ',mode)
821         (let ((,elt (assq ',mode pc-select-saved-settings-alist)))         (let ((,elt (assq ',mode pc-select-saved-settings-alist)))
822           (unless (null ,elt)           (unless (null ,elt)
823           (,mode (if (cdr ,elt) 1 -1)))))))             (,mode (if (cdr ,elt) 1 -1)))))))
824    
825    
826  ;;;###autoload  ;;;###autoload

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26