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 | |
parent | 44ad1cf76039dc5a2a94e82a6b6eb13124c3cc92 (diff) | |
download | emacs-3e2fb4db3f517dd051cd35c742355c492e085333.tar.gz |
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')
-rw-r--r-- | lisp/ChangeLog | 9 | ||||
-rw-r--r-- | lisp/comint.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 20 | ||||
-rw-r--r-- | lisp/files.el | 5 | ||||
-rw-r--r-- | lisp/replace.el | 4 | ||||
-rw-r--r-- | lisp/simple.el | 15 |
6 files changed, 34 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2455b9a10b6..4495d72f14d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,14 @@ 2013-11-30 Glenn Morris <rgm@gnu.org> + * 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. + Stop keeping (most) generated cedet grammar files in the repository. * Makefile.in (semantic): New. (compile-main): Depend on semantic. diff --git a/lisp/comint.el b/lisp/comint.el index 3aff3137d74..afd93fc6ff0 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -752,7 +752,7 @@ See `make-comint' and `comint-exec'." (let ((name (file-name-nondirectory program))) (switch-to-buffer (make-comint name program)) (run-hooks (intern-soft (concat "comint-" name "-hook"))))) -(put 'comint-run 'interactive-only "Use `make-comint' instead") +(put 'comint-run 'interactive-only 'make-comint) (defun comint-exec (buffer name command startfile switches) "Start up a process named NAME in buffer BUFFER for Comint modes. 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 diff --git a/lisp/files.el b/lisp/files.el index 1fb253a893a..229770006c7 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2085,8 +2085,7 @@ Don't call it from programs! Use `insert-file-contents-literally' instead. \(Its calling sequence is different; see its documentation)." (interactive "*fInsert file literally: ") (insert-file-1 filename #'insert-file-contents-literally)) -(put 'insert-file-literally 'interactive-only - "Use `insert-file-contents-literally' instead") +(put 'insert-file-literally 'interactive-only 'insert-file-contents-literally) (defvar find-file-literally nil "Non-nil if this buffer was made by `find-file-literally' or equivalent. @@ -5009,7 +5008,7 @@ Don't call it from programs! Use `insert-file-contents' instead. \(Its calling sequence is different; see its documentation)." (interactive "*fInsert file: ") (insert-file-1 filename #'insert-file-contents)) -(put 'insert-file 'interactive-only "Use `insert-file-contents' instead.") +(put 'insert-file 'interactive-only 'insert-file-contents) (defun append-to-file (start end filename) "Append the contents of the region to the end of file FILENAME. diff --git a/lisp/replace.el b/lisp/replace.el index 0490af71358..061300c7829 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -524,7 +524,7 @@ and TO-STRING is also null.)" (region-end))))) (perform-replace from-string to-string nil nil delimited nil nil start end)) (put 'replace-string 'interactive-only - "Use `search-forward' and `replace-match' instead.") + "use `search-forward' and `replace-match' instead.") (defun replace-regexp (regexp to-string &optional delimited start end) "Replace things after point matching REGEXP with TO-STRING. @@ -593,7 +593,7 @@ which will run faster and will not set the mark or print anything." (region-end))))) (perform-replace regexp to-string nil t delimited nil nil start end)) (put 'replace-regexp 'interactive-only - "Use `re-search-forward' and `replace-match' instead.") + "use `re-search-forward' and `replace-match' instead.") (defvar regexp-history nil diff --git a/lisp/simple.el b/lisp/simple.el index 21ef9d2577e..16f03d2e5f9 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -888,7 +888,8 @@ Don't use this command in Lisp programs! (/ (+ 10 (* size (prefix-numeric-value arg))) 10))) (point-min)))) (if (and arg (not (consp arg))) (forward-line 1))) -(put 'beginning-of-buffer 'interactive-only "Use (goto-char (point-min)) instead") +(put 'beginning-of-buffer 'interactive-only + "use `(goto-char (point-min))' instead.") (defun end-of-buffer (&optional arg) "Move point to the end of the buffer. @@ -921,7 +922,7 @@ Don't use this command in Lisp programs! ;; then scroll specially to put it near, but not at, the bottom. (overlay-recenter (point)) (recenter -3)))) -(put 'end-of-buffer 'interactive-only "Use (goto-char (point-max)) instead") +(put 'end-of-buffer 'interactive-only "use `(goto-char (point-max))' instead.") (defcustom delete-active-region t "Whether single-char deletion commands delete an active region. @@ -984,7 +985,7 @@ the end of the line." (insert-char ?\s (- ocol (current-column)) nil)))) ;; Otherwise, do simple deletion. (t (delete-char (- n) killflag)))) -(put 'delete-backward-char 'interactive-only "Use `delete-char' instead") +(put 'delete-backward-char 'interactive-only 'delete-char) (defun delete-forward-char (n &optional killflag) "Delete the following N characters (previous if N is negative). @@ -1082,7 +1083,7 @@ rather than line counts." (if (eq selective-display t) (re-search-forward "[\n\C-m]" nil 'end (1- line)) (forward-line (1- line))))) -(put 'goto-line 'interactive-only "Use `forward-line' instead") +(put 'goto-line 'interactive-only 'forward-line) (defun count-words-region (start end &optional arg) "Count the number of words in the region. @@ -4169,7 +4170,7 @@ Don't call it from programs: use `insert-buffer-substring' instead!" (insert-buffer-substring (get-buffer buffer)) (point))) nil) -(put 'insert-buffer 'interactive-only "Use `insert-buffer-substring' instead") +(put 'insert-buffer 'interactive-only 'insert-buffer-substring) (defun append-to-buffer (buffer start end) "Append to specified buffer the text of the region. @@ -4768,7 +4769,7 @@ and more reliable (no dependence on goal column, etc.)." (signal (car err) (cdr err)))) (line-move arg nil nil try-vscroll))) nil) -(put 'next-line 'interactive-only "Use `forward-line' instead") +(put 'next-line 'interactive-only 'forward-line) (defun previous-line (&optional arg try-vscroll) "Move cursor vertically up ARG lines. @@ -4809,7 +4810,7 @@ to use and more reliable (no dependence on goal column, etc.)." (line-move (- arg) nil nil try-vscroll)) nil) (put 'previous-line 'interactive-only - "Use `forward-line' with negative argument instead") + "use `forward-line' with negative argument instead.") (defcustom track-eol nil "Non-nil means vertical motion starting at end of line keeps to ends of lines. |