(list 'function-put (list 'quote f)
''lisp-indent-function (list 'quote val))))
+(defalias 'byte-run--set-speed
+ #'(lambda (f _args val)
+ (list 'function-put (list 'quote f)
+ ''speed (list 'quote val))))
+
+ (defalias 'byte-run--set-completion
+ #'(lambda (f _args val)
+ (list 'function-put (list 'quote f)
+ ''completion-predicate val)))
+
+ (defalias 'byte-run--set-modes
+ #'(lambda (f _args &rest val)
+ (list 'function-put (list 'quote f)
+ ''completion-predicate
+ `(lambda (_ b)
+ (command-completion-with-modes-p ',val b)))))
+
;; Add any new entries to info node `(elisp)Declare Form'.
(defvar defun-declarations-alist
(list
(list 'compiler-macro #'byte-run--set-compiler-macro)
(list 'doc-string #'byte-run--set-doc-string)
(list 'indent #'byte-run--set-indent)
- (list 'speed #'byte-run--set-speed))
++ (list 'speed #'byte-run--set-speed)
+ (list 'completion #'byte-run--set-completion)
+ (list 'modes #'byte-run--set-modes))
"List associating function properties to their macro expansion.
Each element of the list takes the form (PROP FUN) where FUN is
a function. For each (PROP . VALUES) in a function's declaration,
reserved-csts)))
;; Build the actual byte-coded function.
(cl-assert (eq 'byte-code (car-safe compiled)))
- (apply #'make-byte-code
- (if lexical-binding
- (byte-compile-make-args-desc arglist)
- arglist)
- (append
- ;; byte-string, constants-vector, stack depth
- (cdr compiled)
- ;; optionally, the doc string.
- (cond ((and lexical-binding arglist)
- ;; byte-compile-make-args-desc lost the args's names,
- ;; so preserve them in the docstring.
- (list (help-add-fundoc-usage doc arglist)))
- ((or doc int)
- (list doc)))
- ;; optionally, the interactive spec (and the modes the
- ;; command applies to).
- (cond
- ;; We have some command modes, so use the vector form.
- (command-modes
- (list (vector (nth 1 int) command-modes)))
- ;; No command modes, use the simple form with just the
- ;; interactive spec.
- (int
- (list (nth 1 int)))))))))
+ (let ((out
- (apply #'make-byte-code
- (if lexical-binding
- (byte-compile-make-args-desc arglist)
- arglist)
- (append
- ;; byte-string, constants-vector, stack depth
- (cdr compiled)
- ;; optionally, the doc string.
- (cond ((and lexical-binding arglist)
- ;; byte-compile-make-args-desc lost the args's names,
- ;; so preserve them in the docstring.
- (list (help-add-fundoc-usage doc arglist)))
- ((or doc int)
- (list doc)))
- ;; optionally, the interactive spec.
- (if int
- (list (nth 1 int)))))))
- (when byte-native-compiling
++ (apply #'make-byte-code
++ (if lexical-binding
++ (byte-compile-make-args-desc arglist)
++ arglist)
++ (append
++ ;; byte-string, constants-vector, stack depth
++ (cdr compiled)
++ ;; optionally, the doc string.
++ (cond ((and lexical-binding arglist)
++ ;; byte-compile-make-args-desc lost the args's names,
++ ;; so preserve them in the docstring.
++ (list (help-add-fundoc-usage doc arglist)))
++ ((or doc int)
++ (list doc)))
++ ;; optionally, the interactive spec (and the modes the
++ ;; command applies to).
++ (cond
++ ;; We have some command modes, so use the vector form.
++ (command-modes
++ (list (vector (nth 1 int) command-modes)))
++ ;; No command modes, use the simple form with just the
++ ;; interactive spec.
++ (int
++ (list (nth 1 int))))))))
++ (when byte-native-compiling
+ (setf (byte-to-native-lambda-byte-func
+ (gethash (cadr compiled)
+ byte-to-native-lambdas-h))
+ out))
- out))))
++ out))))
(defvar byte-compile-reserved-constants 0)