(list cl-generic--fcr-generalizer))))
(cl-call-next-method)))
-(cl--generic-prefill-dispatchers 0 advice)
+(cl--generic-prefill-dispatchers 0 fcr-object)
;;; Support for unloading.
'byte-code-function object)))))
(princ ")" stream))
-;; This belongs in nadvice.el, of course, but some load-ordering issues make it
-;; complicated: cl-generic uses macros from cl-macs and cl-macs uses advice-add
-;; from nadvice, so nadvice needs to be loaded before cl-generic and hence
-;; can't use cl-defmethod.
-(cl-defmethod cl-print-object ((object advice) stream)
- ;; FIXME: η-reduce!
- (advice--cl-print-object object stream))
-
+;; This belongs in fcr.el, of course, but some load-ordering issues make it
+;; complicated.
(cl-defmethod cl-print-object ((object accessor) stream)
;; FIXME: η-reduce!
(fcr--accessor-cl-print object stream))
(cadr (or iff ifm)))))
-;; This is the `advice' method of `interactive-form'.
-(defun advice--get-interactive-form (ad)
+(cl-defmethod interactive-form ((ad advice) &optional _)
(let ((car (advice--car ad))
(cdr (advice--cdr ad)))
(when (or (commandp car) (commandp cdr))
`(interactive ,(advice--make-interactive-form car cdr)))))
-(defun advice--cl-print-object (object stream)
+(cl-defmethod cl-print-object ((object advice) stream)
(cl-assert (advice--p object))
(princ "#f(advice " stream)
(cl-print-object (advice--car object) stream)
confusables ", ")
string))))
-(defun help-command-error-confusable-suggestions (data _context _signal)
+(defun help-command-error-confusable-suggestions (data context signal)
+ ;; Delegate most of the work to the original default value of
+ ;; `command-error-function' implemented in C.
+ (command-error-default-function data context signal)
(pcase data
(`(void-variable ,var)
(let ((suggestions (help-uni-confusable-suggestions
(princ (concat "\n " suggestions) t))))
(_ nil)))
-(add-function :after command-error-function
- #'help-command-error-confusable-suggestions)
+(when (eq command-error-function #'command-error-default-function)
+ ;; Override the default set in the C code.
+ (setq command-error-function
+ #'help-command-error-confusable-suggestions))
(define-obsolete-function-alias 'help-for-help-internal #'help-for-help "28.1")
(load "button") ;After loaddefs, because of define-minor-mode!
(load "emacs-lisp/cl-preloaded")
(load "emacs-lisp/fcr") ;Used by cl-generic and nadvice
-(load "emacs-lisp/nadvice")
(load "obarray") ;abbrev.el is implemented in terms of obarrays.
(load "abbrev") ;lisp-mode.el and simple.el use define-abbrev-table.
(load "help")
;; A particularly demanding file to load; 1600 does not seem to be enough.
(load "emacs-lisp/cl-generic"))
(load "simple")
+(load "emacs-lisp/nadvice")
(load "minibuffer") ;Needs cl-generic (and define-minor-mode).
(load "frame")
(load "startup")
spec)))
(_ (internal--interactive-form cmd))))
-(cl-defmethod interactive-form ((function advice) &optional _)
- ;; This should ideally be in `nadvice.el' but `nadvice.el' is loaded before
- ;; `cl-generic.el' so it can't use `cl-defmethod'.
- ;; FIXME: η-reduce!
- (advice--get-interactive-form function))
-
(defun command-execute (cmd &optional record-flag keys special)
;; BEWARE: Called directly from the C code.
"Execute CMD as an editor command.
(with-current-buffer (window-buffer win)
(run-hook-with-args 'pre-redisplay-functions win))))))
-(add-function :before pre-redisplay-function
- #'redisplay--pre-redisplay-functions)
-
+(when (eq pre-redisplay-function #'ignore)
+ ;; Override the default set in the C code.
+ (setq pre-redisplay-function #'redisplay--pre-redisplay-functions))
(defvar-local mark-ring nil
"The list of former marks of the current buffer, most recent first.")