diff options
author | Bozhidar Batsov <bozhidar@batsov.com> | 2013-11-25 19:16:32 +0200 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@batsov.com> | 2013-11-25 19:16:32 +0200 |
commit | 2bb3a748b362f9635bd406b151b89d7981a0bdaa (patch) | |
tree | d391eb3677d9b65e22dfb5b0ce0f9c8e3e0f316d /lisp/emacs-lisp/bytecomp.el | |
parent | 001394351677736fafd9597a527bd900345fc7e7 (diff) | |
download | emacs-2bb3a748b362f9635bd406b151b89d7981a0bdaa.tar.gz |
* lisp/emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
Mark as obsolete and replace it with a symbol property.
(byte-compile-form): Use new 'interactive-only property.
* lisp/comint.el, lisp/files.el, lisp/replace.el, lisp/simple.el:
Apply new 'interactive-only properly.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index e0d474bbb9f..faa72e73959 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -353,11 +353,11 @@ else the global value will be modified." (t (append byte-compile-warnings (list warning))))))) -(defvar byte-compile-interactive-only-functions - '(beginning-of-buffer end-of-buffer replace-string replace-regexp - insert-file insert-buffer insert-file-literally previous-line next-line - goto-line comint-run delete-backward-char) +(defvar byte-compile-interactive-only-functions nil "List of commands that are not meant to be called from Lisp.") +(make-obsolete-variable 'byte-compile-interactive-only-functions + "use the `interactive-only' symbol property instead" + "24.4") (defvar byte-compile-not-obsolete-vars nil "List of variables that shouldn't be reported as obsolete.") @@ -2929,13 +2929,19 @@ for symbols generated by the byte compiler itself." (byte-compile-variable-ref form)))) ((symbolp (car form)) (let* ((fn (car form)) - (handler (get fn 'byte-compile))) + (handler (get fn 'byte-compile)) + (interactive-onaly (or (get fn 'interactive-only) + (memq fn byte-compile-interactive-only-functions)))) (when (macroexp--const-symbol-p fn) (byte-compile-warn "`%s' called as a function" fn)) - (and (byte-compile-warning-enabled-p 'interactive-only) - (memq fn byte-compile-interactive-only-functions) - (byte-compile-warn "`%s' used from Lisp code\n\ -That command is designed for interactive use only" fn)) + (when (and (byte-compile-warning-enabled-p 'interactive-only) + interactive-only) + (byte-compile-warn "`%s' used from Lisp code\n\ +That command is designed for interactive use only.\n%s" + fn + (if (stringp interactive-only) + interactive-only + "Consult the documentation for an alternative"))) (if (and (fboundp (car form)) (eq (car-safe (symbol-function (car form))) 'macro)) (byte-compile-log-warning @@ -3598,7 +3604,7 @@ discarding." (byte-compile-constant (if (eq 'lambda (car-safe f)) (byte-compile-lambda f) f)))) - + (defun byte-compile-indent-to (form) (let ((len (length form))) (cond ((= len 2) |