From 5076d275135c9cbcf1f57182b6294e83b6fd4785 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 22 Mar 2014 15:12:52 -0700 Subject: Allow `declare' to set the interactive-only property * lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Add interactive-only. Doc tweak. (macro-declarations-alist): Doc tweak. * lisp/subr.el (declare): Doc tweak (add xref to manual). * lisp/comint.el (comint-run): * lisp/files.el (insert-file-literally, insert-file): * lisp/replace.el (replace-string, replace-regexp): * lisp/simple.el (beginning-of-buffer, end-of-buffer, delete-backward-char) (delete-forward-char, goto-line, insert-buffer, next-line) (previous-line): Set interactive-only via declare. * doc/lispref/functions.texi (Declare Form): Add interactive-only. * doc/lispref/commands.texi (Defining Commands) Mention declare. * etc/NEWS: Mention this. --- lisp/emacs-lisp/byte-run.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp/byte-run.el') diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 4b9e6d8fd23..dc08b870569 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -69,6 +69,7 @@ The return value of this function is not used." ;; handle declarations in macro definitions and this is the first file ;; loaded by loadup.el that uses declarations in macros. +;; Add any new entries to info node `(elisp)Declare Form'. (defvar defun-declarations-alist (list ;; We can only use backquotes inside the lambdas and not for those @@ -81,6 +82,10 @@ The return value of this function is not used." #'(lambda (f _args new-name when) (list 'make-obsolete (list 'quote f) (list 'quote new-name) (list 'quote when)))) + (list 'interactive-only + #'(lambda (f _args instead) + (list 'put (list 'quote f) ''interactive-only + (list 'quote instead)))) (list 'compiler-macro #'(lambda (f args compiler-function) `(eval-and-compile @@ -101,7 +106,9 @@ Each element of the list takes the form (PROP FUN) where FUN is a function. For each (PROP . VALUES) in a function's declaration, the FUN corresponding to PROP is called with the function name, the function's arglist, and the VALUES and should return the code to use -to set this property.") +to set this property. + +This is used by `declare'.") (defvar macro-declarations-alist (cons @@ -115,7 +122,9 @@ to set this property.") Each element of the list takes the form (PROP FUN) where FUN is a function. For each (PROP . VALUES) in a macro's declaration, the FUN corresponding to PROP is called with the macro name, the macro's arglist, and the VALUES -and should return the code to use to set this property.") +and should return the code to use to set this property. + +This is used by `declare'.") (put 'defmacro 'doc-string-elt 3) (put 'defmacro 'lisp-indent-function 2) -- cgit v1.2.3