diff options
author | Glenn Morris <rgm@gnu.org> | 2014-03-22 15:12:52 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2014-03-22 15:12:52 -0700 |
commit | 5076d275135c9cbcf1f57182b6294e83b6fd4785 (patch) | |
tree | 25cda7578fc3ddf6e86121c5fac12995d8761b33 /lisp/emacs-lisp | |
parent | 299ccd03f94008a1580a0dbbfd56c32484dd20f8 (diff) | |
download | emacs-5076d275135c9cbcf1f57182b6294e83b6fd4785.tar.gz emacs-5076d275135c9cbcf1f57182b6294e83b6fd4785.tar.bz2 emacs-5076d275135c9cbcf1f57182b6294e83b6fd4785.zip |
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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/byte-run.el | 13 |
1 files changed, 11 insertions, 2 deletions
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) |