- (let ((val nil))
- (while (and (symbolp f)
- (null (setq val (get f prop)))
- (fboundp f))
- (let ((fundef (symbol-function f)))
- (if (and (names--autoloadp fundef)
- (not (equal fundef (names--autoload-do-load fundef f))))
- nil ;Re-try `get' on the same `f'.
- (setq f fundef))))
- val))
- (defun names--autoload-do-load (def name)
- "Load autoloaded definition DEF from function named NAME."
- (unless (load (cadr def) 'noerror)
- (error "Macro `%s' is autoloaded, but its file (%s) couldn't be loaded"
- name (cadr def)))
- (symbol-function name)))
-
-(if (fboundp 'macrop)
- (defalias 'names--compat-macrop #'macrop)
- (defun names--compat-macrop (object)
- "Non-nil if and only if OBJECT is a macro."
- (let ((def (indirect-function object t)))
- (when (consp def)
- (or (eq 'macro (car def))
- (and (names--autoloadp def) (memq (nth 4 def) '(macro t))))))))
-
-(if (fboundp 'autoloadp)
- (defalias 'names--autoloadp #'autoloadp)
- (defsubst names--autoloadp (object)
- "Non-nil if OBJECT is an autoload."
- (eq 'autoload (car-safe object))))
+ (let ((val nil))
+ (while (and (symbolp f)
+ (null (setq val (get f prop)))
+ (fboundp f))
+ (let ((fundef (symbol-function f)))
+ (if (and (names--autoloadp fundef)
+ (not (equal fundef (names--autoload-do-load fundef f))))
+ nil ;Re-try `get' on the same `f'.
+ (setq f fundef))))
+ val))))
+
+(defalias 'names--compat-macrop
+ (if (fboundp 'macrop) #'macrop
+ (lambda (object)
+ "Non-nil if and only if OBJECT is a macro."
+ (let ((def (or (ignore-errors (indirect-function object t))
+ (ignore-errors (indirect-function object)))))
+ (when (consp def)
+ (or (eq 'macro (car def))
+ (and (names--autoloadp def) (memq (nth 4 def) '(macro t)))))))))
+
+(defalias 'names--autoloadp
+ (if (fboundp 'autoloadp) #'autoloadp
+ (lambda (object)
+ "Non-nil if OBJECT is an autoload."
+ (eq 'autoload (car-safe object)))))