branch: externals/compat commit b1d8a7f77d3f47b34fc8c0f43c3470d611a473b3 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Minor simplification, remove advice remnants --- compat-macs.el | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/compat-macs.el b/compat-macs.el index 8c81b4dfc2..f18bb1f3b2 100644 --- a/compat-macs.el +++ b/compat-macs.el @@ -17,8 +17,7 @@ ;;; Commentary: -;; These macros are used to define compatibility functions, macros and -;; advice. +;; These macros are used to define compatibility functions and macros. ;;; Code: @@ -27,8 +26,6 @@ (defmacro compat-declare-version (version) "Set the Emacs version that is currently being handled to VERSION." - ;; FIXME: Avoid setting the version for any definition that might - ;; follow, but try to restrict it to the current file/buffer. (setq compat--current-version version) nil) @@ -153,34 +150,30 @@ attributes (see `compat-generate-common')." name (lambda (realname version) `(,(cond - ((memq type '(func advice)) 'defun) + ((eq type 'function) 'defun) ((eq type 'macro) 'defmacro) ((error "Unknown type"))) ,realname ,arglist ;; Prepend compatibility notice to the actual ;; documentation string. - ,(let ((type (cond - ((eq type 'func) "function") - ((eq type 'macro) "macro") - ((error "Unknown type"))))) - (with-temp-buffer - (insert docstring) - (newline 2) - (insert - "[Compatibility " - (if version - (format - "%s for `%S', defined in Emacs %s. \ + ,(with-temp-buffer + (insert docstring) + (newline 2) + (insert + "[Compatibility " + (if version + (format + "%s for `%S', defined in Emacs %s. \ If this is not documented on your system, you can check \ `(compat) Emacs %s' for more details." - type oldname version version) - (format - "code %s for `%S'" - type oldname)) - "]") - (let ((fill-column 80)) - (fill-region (point-min) (point-max))) - (buffer-string))) + type oldname version version) + (format + "code %s for `%S'" + type oldname)) + "]") + (let ((fill-column 80)) + (fill-region (point-min) (point-max))) + (buffer-string)) ,@body)) (lambda (realname _version) ;; Functions and macros are installed by aliasing the name of the @@ -205,7 +198,7 @@ attribute, is greater than the current Emacs version." [&rest keywordp sexp] def-body)) (doc-string 3) (indent 2)) - (compat--define-function 'func name arglist docstring rest)) + (compat--define-function 'function name arglist docstring rest)) (defmacro compat-defmacro (name arglist docstring &rest rest) "Define NAME with arguments ARGLIST as a compatibility macro.