diff options
author | Glenn Morris <rgm@gnu.org> | 2013-11-30 00:42:28 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2013-11-30 00:42:28 -0800 |
commit | 3e2fb4db3f517dd051cd35c742355c492e085333 (patch) | |
tree | de82aeb80b27e6fa59ee52edb9dcff10e2159054 /lisp/emacs-lisp | |
parent | 44ad1cf76039dc5a2a94e82a6b6eb13124c3cc92 (diff) | |
download | emacs-3e2fb4db3f517dd051cd35c742355c492e085333.tar.gz emacs-3e2fb4db3f517dd051cd35c742355c492e085333.tar.bz2 emacs-3e2fb4db3f517dd051cd35c742355c492e085333.zip |
Make the `interactive-only' bytecomp warning like the `obsolete' one
* emacs-lisp/bytecomp.el (byte-compile-form):
Make the `interactive-only' warning like the `obsolete' one.
* comint.el (comint-run):
* files.el (insert-file-literally, insert-file):
* replace.el (replace-string, replace-regexp):
* simple.el (beginning-of-buffer, end-of-buffer, delete-backward-char)
(goto-line, insert-buffer, next-line, previous-line):
Tweak `interactive-only' spec.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 116f356822e..4d91389a3e0 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2930,18 +2930,22 @@ for symbols generated by the byte compiler itself." ((symbolp (car form)) (let* ((fn (car form)) (handler (get fn 'byte-compile)) - (interactive-only (or (get fn 'interactive-only) - (memq fn byte-compile-interactive-only-functions)))) + (interactive-only + (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)) (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"))) + (byte-compile-warn "`%s' is for interactive use only%s" + fn + (cond ((stringp interactive-only) + (format "; %s" interactive-only)) + ((and (symbolp 'interactive-only) + (not (eq interactive-only t))) + (format "; use `%s' instead." + interactive-only)) + (t ".")))) (if (and (fboundp (car form)) (eq (car-safe (symbol-function (car form))) 'macro)) (byte-compile-log-warning |