aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2013-11-30 00:42:28 -0800
committerGlenn Morris2013-11-30 00:42:28 -0800
commit3e2fb4db3f517dd051cd35c742355c492e085333 (patch)
treede82aeb80b27e6fa59ee52edb9dcff10e2159054
parent44ad1cf76039dc5a2a94e82a6b6eb13124c3cc92 (diff)
downloademacs-3e2fb4db3f517dd051cd35c742355c492e085333.tar.gz
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.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/comint.el2
-rw-r--r--lisp/emacs-lisp/bytecomp.el20
-rw-r--r--lisp/files.el5
-rw-r--r--lisp/replace.el4
-rw-r--r--lisp/simple.el15
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 @@
12013-11-30 Glenn Morris <rgm@gnu.org> 12013-11-30 Glenn Morris <rgm@gnu.org>
2 2
3 * emacs-lisp/bytecomp.el (byte-compile-form):
4 Make the `interactive-only' warning like the `obsolete' one.
5 * comint.el (comint-run):
6 * files.el (insert-file-literally, insert-file):
7 * replace.el (replace-string, replace-regexp):
8 * simple.el (beginning-of-buffer, end-of-buffer, delete-backward-char)
9 (goto-line, insert-buffer, next-line, previous-line):
10 Tweak `interactive-only' spec.
11
3 Stop keeping (most) generated cedet grammar files in the repository. 12 Stop keeping (most) generated cedet grammar files in the repository.
4 * Makefile.in (semantic): New. 13 * Makefile.in (semantic): New.
5 (compile-main): Depend on semantic. 14 (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'."
752 (let ((name (file-name-nondirectory program))) 752 (let ((name (file-name-nondirectory program)))
753 (switch-to-buffer (make-comint name program)) 753 (switch-to-buffer (make-comint name program))
754 (run-hooks (intern-soft (concat "comint-" name "-hook"))))) 754 (run-hooks (intern-soft (concat "comint-" name "-hook")))))
755(put 'comint-run 'interactive-only "Use `make-comint' instead") 755(put 'comint-run 'interactive-only 'make-comint)
756 756
757(defun comint-exec (buffer name command startfile switches) 757(defun comint-exec (buffer name command startfile switches)
758 "Start up a process named NAME in buffer BUFFER for Comint modes. 758 "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."
2930 ((symbolp (car form)) 2930 ((symbolp (car form))
2931 (let* ((fn (car form)) 2931 (let* ((fn (car form))
2932 (handler (get fn 'byte-compile)) 2932 (handler (get fn 'byte-compile))
2933 (interactive-only (or (get fn 'interactive-only) 2933 (interactive-only
2934 (memq fn byte-compile-interactive-only-functions)))) 2934 (or (get fn 'interactive-only)
2935 (memq fn byte-compile-interactive-only-functions))))
2935 (when (macroexp--const-symbol-p fn) 2936 (when (macroexp--const-symbol-p fn)
2936 (byte-compile-warn "`%s' called as a function" fn)) 2937 (byte-compile-warn "`%s' called as a function" fn))
2937 (when (and (byte-compile-warning-enabled-p 'interactive-only) 2938 (when (and (byte-compile-warning-enabled-p 'interactive-only)
2938 interactive-only) 2939 interactive-only)
2939 (byte-compile-warn "`%s' used from Lisp code\n\ 2940 (byte-compile-warn "`%s' is for interactive use only%s"
2940That command is designed for interactive use only.\n%s" 2941 fn
2941 fn 2942 (cond ((stringp interactive-only)
2942 (if (stringp interactive-only) 2943 (format "; %s" interactive-only))
2943 interactive-only 2944 ((and (symbolp 'interactive-only)
2944 "Consult the documentation for an alternative"))) 2945 (not (eq interactive-only t)))
2946 (format "; use `%s' instead."
2947 interactive-only))
2948 (t "."))))
2945 (if (and (fboundp (car form)) 2949 (if (and (fboundp (car form))
2946 (eq (car-safe (symbol-function (car form))) 'macro)) 2950 (eq (car-safe (symbol-function (car form))) 'macro))
2947 (byte-compile-log-warning 2951 (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.
2085\(Its calling sequence is different; see its documentation)." 2085\(Its calling sequence is different; see its documentation)."
2086 (interactive "*fInsert file literally: ") 2086 (interactive "*fInsert file literally: ")
2087 (insert-file-1 filename #'insert-file-contents-literally)) 2087 (insert-file-1 filename #'insert-file-contents-literally))
2088(put 'insert-file-literally 'interactive-only 2088(put 'insert-file-literally 'interactive-only 'insert-file-contents-literally)
2089 "Use `insert-file-contents-literally' instead")
2090 2089
2091(defvar find-file-literally nil 2090(defvar find-file-literally nil
2092 "Non-nil if this buffer was made by `find-file-literally' or equivalent. 2091 "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.
5009\(Its calling sequence is different; see its documentation)." 5008\(Its calling sequence is different; see its documentation)."
5010 (interactive "*fInsert file: ") 5009 (interactive "*fInsert file: ")
5011 (insert-file-1 filename #'insert-file-contents)) 5010 (insert-file-1 filename #'insert-file-contents))
5012(put 'insert-file 'interactive-only "Use `insert-file-contents' instead.") 5011(put 'insert-file 'interactive-only 'insert-file-contents)
5013 5012
5014(defun append-to-file (start end filename) 5013(defun append-to-file (start end filename)
5015 "Append the contents of the region to the end of file FILENAME. 5014 "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.)"
524 (region-end))))) 524 (region-end)))))
525 (perform-replace from-string to-string nil nil delimited nil nil start end)) 525 (perform-replace from-string to-string nil nil delimited nil nil start end))
526(put 'replace-string 'interactive-only 526(put 'replace-string 'interactive-only
527 "Use `search-forward' and `replace-match' instead.") 527 "use `search-forward' and `replace-match' instead.")
528 528
529(defun replace-regexp (regexp to-string &optional delimited start end) 529(defun replace-regexp (regexp to-string &optional delimited start end)
530 "Replace things after point matching REGEXP with TO-STRING. 530 "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."
593 (region-end))))) 593 (region-end)))))
594 (perform-replace regexp to-string nil t delimited nil nil start end)) 594 (perform-replace regexp to-string nil t delimited nil nil start end))
595(put 'replace-regexp 'interactive-only 595(put 'replace-regexp 'interactive-only
596 "Use `re-search-forward' and `replace-match' instead.") 596 "use `re-search-forward' and `replace-match' instead.")
597 597
598 598
599(defvar regexp-history nil 599(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!
888 (/ (+ 10 (* size (prefix-numeric-value arg))) 10))) 888 (/ (+ 10 (* size (prefix-numeric-value arg))) 10)))
889 (point-min)))) 889 (point-min))))
890 (if (and arg (not (consp arg))) (forward-line 1))) 890 (if (and arg (not (consp arg))) (forward-line 1)))
891(put 'beginning-of-buffer 'interactive-only "Use (goto-char (point-min)) instead") 891(put 'beginning-of-buffer 'interactive-only
892 "use `(goto-char (point-min))' instead.")
892 893
893(defun end-of-buffer (&optional arg) 894(defun end-of-buffer (&optional arg)
894 "Move point to the end of the buffer. 895 "Move point to the end of the buffer.
@@ -921,7 +922,7 @@ Don't use this command in Lisp programs!
921 ;; then scroll specially to put it near, but not at, the bottom. 922 ;; then scroll specially to put it near, but not at, the bottom.
922 (overlay-recenter (point)) 923 (overlay-recenter (point))
923 (recenter -3)))) 924 (recenter -3))))
924(put 'end-of-buffer 'interactive-only "Use (goto-char (point-max)) instead") 925(put 'end-of-buffer 'interactive-only "use `(goto-char (point-max))' instead.")
925 926
926(defcustom delete-active-region t 927(defcustom delete-active-region t
927 "Whether single-char deletion commands delete an active region. 928 "Whether single-char deletion commands delete an active region.
@@ -984,7 +985,7 @@ the end of the line."
984 (insert-char ?\s (- ocol (current-column)) nil)))) 985 (insert-char ?\s (- ocol (current-column)) nil))))
985 ;; Otherwise, do simple deletion. 986 ;; Otherwise, do simple deletion.
986 (t (delete-char (- n) killflag)))) 987 (t (delete-char (- n) killflag))))
987(put 'delete-backward-char 'interactive-only "Use `delete-char' instead") 988(put 'delete-backward-char 'interactive-only 'delete-char)
988 989
989(defun delete-forward-char (n &optional killflag) 990(defun delete-forward-char (n &optional killflag)
990 "Delete the following N characters (previous if N is negative). 991 "Delete the following N characters (previous if N is negative).
@@ -1082,7 +1083,7 @@ rather than line counts."
1082 (if (eq selective-display t) 1083 (if (eq selective-display t)
1083 (re-search-forward "[\n\C-m]" nil 'end (1- line)) 1084 (re-search-forward "[\n\C-m]" nil 'end (1- line))
1084 (forward-line (1- line))))) 1085 (forward-line (1- line)))))
1085(put 'goto-line 'interactive-only "Use `forward-line' instead") 1086(put 'goto-line 'interactive-only 'forward-line)
1086 1087
1087(defun count-words-region (start end &optional arg) 1088(defun count-words-region (start end &optional arg)
1088 "Count the number of words in the region. 1089 "Count the number of words in the region.
@@ -4169,7 +4170,7 @@ Don't call it from programs: use `insert-buffer-substring' instead!"
4169 (insert-buffer-substring (get-buffer buffer)) 4170 (insert-buffer-substring (get-buffer buffer))
4170 (point))) 4171 (point)))
4171 nil) 4172 nil)
4172(put 'insert-buffer 'interactive-only "Use `insert-buffer-substring' instead") 4173(put 'insert-buffer 'interactive-only 'insert-buffer-substring)
4173 4174
4174(defun append-to-buffer (buffer start end) 4175(defun append-to-buffer (buffer start end)
4175 "Append to specified buffer the text of the region. 4176 "Append to specified buffer the text of the region.
@@ -4768,7 +4769,7 @@ and more reliable (no dependence on goal column, etc.)."
4768 (signal (car err) (cdr err)))) 4769 (signal (car err) (cdr err))))
4769 (line-move arg nil nil try-vscroll))) 4770 (line-move arg nil nil try-vscroll)))
4770 nil) 4771 nil)
4771(put 'next-line 'interactive-only "Use `forward-line' instead") 4772(put 'next-line 'interactive-only 'forward-line)
4772 4773
4773(defun previous-line (&optional arg try-vscroll) 4774(defun previous-line (&optional arg try-vscroll)
4774 "Move cursor vertically up ARG lines. 4775 "Move cursor vertically up ARG lines.
@@ -4809,7 +4810,7 @@ to use and more reliable (no dependence on goal column, etc.)."
4809 (line-move (- arg) nil nil try-vscroll)) 4810 (line-move (- arg) nil nil try-vscroll))
4810 nil) 4811 nil)
4811(put 'previous-line 'interactive-only 4812(put 'previous-line 'interactive-only
4812 "Use `forward-line' with negative argument instead") 4813 "use `forward-line' with negative argument instead.")
4813 4814
4814(defcustom track-eol nil 4815(defcustom track-eol nil
4815 "Non-nil means vertical motion starting at end of line keeps to ends of lines. 4816 "Non-nil means vertical motion starting at end of line keeps to ends of lines.