- (let ((buffer (event-buffer event)))
- (and mouse-grabbed-buffer (setq buffer mouse-grabbed-buffer))
- (when buffer
- (let ((value (symbol-value-in-buffer hook buffer nil)))
- (if (and (listp value) (not (eq (car value) 'lambda)))
- ;; List of functions.
- (let (retval)
- (while (and value (null retval))
- ;; Found `t': should process default value. We could
- ;; splice it into the buffer-local value, but that
- ;; would cons, which is not a good thing for
- ;; mouse-track hooks.
- (if (eq (car value) t)
- (let ((global (default-value hook)))
- (if (and (listp global) (not (eq (car global) 'lambda)))
- ;; List of functions.
- (while (and global
- (null (setq retval
- (apply (car global) event args))))
- (pop global))
- ;; lambda
- (setq retval (apply (car global) event args))))
- (setq retval (apply (car value) event args)))
- (pop value))
- retval)
- ;; lambda
- (apply value event args))))))
+ (let ((overridden (plist-get override hook Mouse-track-gensym)))
+ (if (not (eq overridden Mouse-track-gensym))
+ (if (and (listp overridden) (not (eq (car overridden) 'lambda)))
+ (some #'(lambda (val) (apply val event args)) overridden)
+ (apply overridden event args))
+ (let ((buffer (event-buffer event)))
+ (and mouse-grabbed-buffer (setq buffer mouse-grabbed-buffer))
+ (when buffer
+ (let ((value (symbol-value-in-buffer hook buffer nil)))
+ (if (and (listp value) (not (eq (car value) 'lambda)))
+ ;; List of functions.
+ (let (retval)
+ (while (and value (null retval))
+ ;; Found `t': should process default value. We could
+ ;; splice it into the buffer-local value, but that
+ ;; would cons, which is not a good thing for
+ ;; mouse-track hooks.
+ (if (eq (car value) t)
+ (let ((global (default-value hook)))
+ (if (and (listp global) (not (eq (car global)
+ 'lambda)))
+ ;; List of functions.
+ (while (and global
+ (null (setq retval
+ (apply (car global)
+ event args))))
+ (pop global))
+ ;; lambda
+ (setq retval (apply (car global) event args))))
+ (setq retval (apply (car value) event args)))
+ (pop value))
+ retval)
+ ;; lambda
+ (apply value event args))))))))