summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-05-04 23:45:21 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2010-05-04 23:45:21 -0400
commit80ac5d4d34b34947df9b0088d81ec02aa10a93b5 (patch)
treead08364ee1613d99018bfd6cc42809ed3c1e08fa /lisp/emacs-lisp
parentf44379e7feb79dd734318706abe5a000cff34c9b (diff)
downloademacs-80ac5d4d34b34947df9b0088d81ec02aa10a93b5.tar.gz
emacs-80ac5d4d34b34947df9b0088d81ec02aa10a93b5.tar.bz2
emacs-80ac5d4d34b34947df9b0088d81ec02aa10a93b5.zip
Use define-minor-mode in more cases.
* term/tvi970.el (tvi970-set-keypad-mode): * simple.el (auto-fill-mode, overwrite-mode, binary-overwrite-mode) (normal-erase-is-backspace-mode): * scroll-bar.el (scroll-bar-mode): Use it and define-minor-mode. (set-scroll-bar-mode-1): (Re)move to its sole caller. (get-scroll-bar-mode): New function. * emacs-lisp/cl-macs.el (eq): Handle a non-variable first arg.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el2
-rw-r--r--lisp/emacs-lisp/cl-macs.el12
2 files changed, 12 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index bb5fd5037a1..e828325bd0e 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -282,7 +282,7 @@ Not documented
;;;;;; flet progv psetq do-all-symbols do-symbols dotimes dolist
;;;;;; do* do loop return-from return block etypecase typecase ecase
;;;;;; case load-time-value eval-when destructuring-bind function*
-;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "7fad7dd60f2f96ba90432f885015d61b")
+;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "0faa39d8f21ae59f2cc1baa835e28a5f")
;;; Generated autoloads from cl-macs.el
(autoload 'gensym "cl-macs" "\
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index e48835adeb1..57870b19066 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1826,7 +1826,17 @@ Example:
;; (setq a 7) or (setq a nil) depending on whether B is nil or not.
;; This is useful when you have control over the PLACE but not over
;; the VALUE, as is the case in define-minor-mode's :variable.
-(defsetf eq (a b) (v) `(setf ,a (if ,v ,b (not ,b))))
+(define-setf-method eq (place val)
+ (let ((method (get-setf-method place cl-macro-environment))
+ (val-temp (make-symbol "--eq-val--"))
+ (store-temp (make-symbol "--eq-store--")))
+ (list (append (nth 0 method) (list val-temp))
+ (append (nth 1 method) (list val))
+ (list store-temp)
+ `(let ((,(car (nth 2 method))
+ (if ,store-temp ,val-temp (not ,val-temp))))
+ ,(nth 3 method) ,store-temp)
+ `(eq ,(nth 4 method) ,val-temp))))
;;; More complex setf-methods.
;; These should take &environment arguments, but since full arglists aren't