diff options
| author | Bozhidar Batsov | 2013-11-25 19:16:32 +0200 |
|---|---|---|
| committer | Bozhidar Batsov | 2013-11-25 19:16:32 +0200 |
| commit | 2bb3a748b362f9635bd406b151b89d7981a0bdaa (patch) | |
| tree | d391eb3677d9b65e22dfb5b0ce0f9c8e3e0f316d | |
| parent | 001394351677736fafd9597a527bd900345fc7e7 (diff) | |
| download | emacs-2bb3a748b362f9635bd406b151b89d7981a0bdaa.tar.gz emacs-2bb3a748b362f9635bd406b151b89d7981a0bdaa.zip | |
* 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.
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/comint.el | 1 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 26 | ||||
| -rw-r--r-- | lisp/files.el | 3 | ||||
| -rw-r--r-- | lisp/replace.el | 4 | ||||
| -rw-r--r-- | lisp/simple.el | 8 |
7 files changed, 43 insertions, 10 deletions
| @@ -795,6 +795,9 @@ The few hooks that used with-wrapper-hook are replaced as follows: | |||
| 795 | *** `completion-in-region-function' obsoletes `completion-in-region-functions'. | 795 | *** `completion-in-region-function' obsoletes `completion-in-region-functions'. |
| 796 | *** `filter-buffer-substring-function' obsoletes `filter-buffer-substring-functions'. | 796 | *** `filter-buffer-substring-function' obsoletes `filter-buffer-substring-functions'. |
| 797 | 797 | ||
| 798 | ** `byte-compile-interactive-only-functions' is now obsolete. | ||
| 799 | It has been replaced by the symbol property 'interactive-only. | ||
| 800 | |||
| 798 | ** `split-string' now takes an optional argument TRIM. | 801 | ** `split-string' now takes an optional argument TRIM. |
| 799 | The value, if non-nil, is a regexp that specifies what to trim from | 802 | The value, if non-nil, is a regexp that specifies what to trim from |
| 800 | the start and end of each substring. | 803 | the start and end of each substring. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3955784c03b..3622b1563ba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2013-11-25 Sebastian Wiesner (lunaryorn@gmail.com) | ||
| 2 | |||
| 3 | * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions): | ||
| 4 | Mark as obsolete and replace it with a symbol property. | ||
| 5 | (byte-compile-form): Use new 'interactive-only property. | ||
| 6 | * comint.el, files.el, replace.el, simple.el: | ||
| 7 | Apply new 'interactive-only properly. | ||
| 8 | |||
| 1 | 2013-11-25 Martin Rudalics <rudalics@gmx.at> | 9 | 2013-11-25 Martin Rudalics <rudalics@gmx.at> |
| 2 | 10 | ||
| 3 | * window.el (display-buffer-at-bottom): Make sure that | 11 | * window.el (display-buffer-at-bottom): Make sure that |
diff --git a/lisp/comint.el b/lisp/comint.el index 8e1b2105de3..3aff3137d74 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -752,6 +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 | 756 | ||
| 756 | (defun comint-exec (buffer name command startfile switches) | 757 | (defun comint-exec (buffer name command startfile switches) |
| 757 | "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 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." | |||
| 353 | (t | 353 | (t |
| 354 | (append byte-compile-warnings (list warning))))))) | 354 | (append byte-compile-warnings (list warning))))))) |
| 355 | 355 | ||
| 356 | (defvar byte-compile-interactive-only-functions | 356 | (defvar byte-compile-interactive-only-functions nil |
| 357 | '(beginning-of-buffer end-of-buffer replace-string replace-regexp | ||
| 358 | insert-file insert-buffer insert-file-literally previous-line next-line | ||
| 359 | goto-line comint-run delete-backward-char) | ||
| 360 | "List of commands that are not meant to be called from Lisp.") | 357 | "List of commands that are not meant to be called from Lisp.") |
| 358 | (make-obsolete-variable 'byte-compile-interactive-only-functions | ||
| 359 | "use the `interactive-only' symbol property instead" | ||
| 360 | "24.4") | ||
| 361 | 361 | ||
| 362 | (defvar byte-compile-not-obsolete-vars nil | 362 | (defvar byte-compile-not-obsolete-vars nil |
| 363 | "List of variables that shouldn't be reported as obsolete.") | 363 | "List of variables that shouldn't be reported as obsolete.") |
| @@ -2929,13 +2929,19 @@ for symbols generated by the byte compiler itself." | |||
| 2929 | (byte-compile-variable-ref form)))) | 2929 | (byte-compile-variable-ref form)))) |
| 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-onaly (or (get fn 'interactive-only) | ||
| 2934 | (memq fn byte-compile-interactive-only-functions)))) | ||
| 2933 | (when (macroexp--const-symbol-p fn) | 2935 | (when (macroexp--const-symbol-p fn) |
| 2934 | (byte-compile-warn "`%s' called as a function" fn)) | 2936 | (byte-compile-warn "`%s' called as a function" fn)) |
| 2935 | (and (byte-compile-warning-enabled-p 'interactive-only) | 2937 | (when (and (byte-compile-warning-enabled-p 'interactive-only) |
| 2936 | (memq fn byte-compile-interactive-only-functions) | 2938 | interactive-only) |
| 2937 | (byte-compile-warn "`%s' used from Lisp code\n\ | 2939 | (byte-compile-warn "`%s' used from Lisp code\n\ |
| 2938 | That command is designed for interactive use only" fn)) | 2940 | That command is designed for interactive use only.\n%s" |
| 2941 | fn | ||
| 2942 | (if (stringp interactive-only) | ||
| 2943 | interactive-only | ||
| 2944 | "Consult the documentation for an alternative"))) | ||
| 2939 | (if (and (fboundp (car form)) | 2945 | (if (and (fboundp (car form)) |
| 2940 | (eq (car-safe (symbol-function (car form))) 'macro)) | 2946 | (eq (car-safe (symbol-function (car form))) 'macro)) |
| 2941 | (byte-compile-log-warning | 2947 | (byte-compile-log-warning |
| @@ -3598,7 +3604,7 @@ discarding." | |||
| 3598 | (byte-compile-constant (if (eq 'lambda (car-safe f)) | 3604 | (byte-compile-constant (if (eq 'lambda (car-safe f)) |
| 3599 | (byte-compile-lambda f) | 3605 | (byte-compile-lambda f) |
| 3600 | f)))) | 3606 | f)))) |
| 3601 | 3607 | ||
| 3602 | (defun byte-compile-indent-to (form) | 3608 | (defun byte-compile-indent-to (form) |
| 3603 | (let ((len (length form))) | 3609 | (let ((len (length form))) |
| 3604 | (cond ((= len 2) | 3610 | (cond ((= len 2) |
diff --git a/lisp/files.el b/lisp/files.el index d44401b4302..1fb253a893a 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2085,6 +2085,8 @@ 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 | ||
| 2089 | "Use `insert-file-contents-literally' instead") | ||
| 2088 | 2090 | ||
| 2089 | (defvar find-file-literally nil | 2091 | (defvar find-file-literally nil |
| 2090 | "Non-nil if this buffer was made by `find-file-literally' or equivalent. | 2092 | "Non-nil if this buffer was made by `find-file-literally' or equivalent. |
| @@ -5007,6 +5009,7 @@ Don't call it from programs! Use `insert-file-contents' instead. | |||
| 5007 | \(Its calling sequence is different; see its documentation)." | 5009 | \(Its calling sequence is different; see its documentation)." |
| 5008 | (interactive "*fInsert file: ") | 5010 | (interactive "*fInsert file: ") |
| 5009 | (insert-file-1 filename #'insert-file-contents)) | 5011 | (insert-file-1 filename #'insert-file-contents)) |
| 5012 | (put 'insert-file 'interactive-only "Use `insert-file-contents' instead.") | ||
| 5010 | 5013 | ||
| 5011 | (defun append-to-file (start end filename) | 5014 | (defun append-to-file (start end filename) |
| 5012 | "Append the contents of the region to the end of file FILENAME. | 5015 | "Append the contents of the region to the end of file FILENAME. |
diff --git a/lisp/replace.el b/lisp/replace.el index 9d7aba333c4..0490af71358 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -523,6 +523,8 @@ and TO-STRING is also null.)" | |||
| 523 | (if (and transient-mark-mode mark-active) | 523 | (if (and transient-mark-mode mark-active) |
| 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 | ||
| 527 | "Use `search-forward' and `replace-match' instead.") | ||
| 526 | 528 | ||
| 527 | (defun replace-regexp (regexp to-string &optional delimited start end) | 529 | (defun replace-regexp (regexp to-string &optional delimited start end) |
| 528 | "Replace things after point matching REGEXP with TO-STRING. | 530 | "Replace things after point matching REGEXP with TO-STRING. |
| @@ -590,6 +592,8 @@ which will run faster and will not set the mark or print anything." | |||
| 590 | (if (and transient-mark-mode mark-active) | 592 | (if (and transient-mark-mode mark-active) |
| 591 | (region-end))))) | 593 | (region-end))))) |
| 592 | (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 | ||
| 596 | "Use `re-search-forward' and `replace-match' instead.") | ||
| 593 | 597 | ||
| 594 | 598 | ||
| 595 | (defvar regexp-history nil | 599 | (defvar regexp-history nil |
diff --git a/lisp/simple.el b/lisp/simple.el index ca2088eeb24..21ef9d2577e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -888,6 +888,7 @@ 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 | 892 | ||
| 892 | (defun end-of-buffer (&optional arg) | 893 | (defun end-of-buffer (&optional arg) |
| 893 | "Move point to the end of the buffer. | 894 | "Move point to the end of the buffer. |
| @@ -920,6 +921,7 @@ Don't use this command in Lisp programs! | |||
| 920 | ;; then scroll specially to put it near, but not at, the bottom. | 921 | ;; then scroll specially to put it near, but not at, the bottom. |
| 921 | (overlay-recenter (point)) | 922 | (overlay-recenter (point)) |
| 922 | (recenter -3)))) | 923 | (recenter -3)))) |
| 924 | (put 'end-of-buffer 'interactive-only "Use (goto-char (point-max)) instead") | ||
| 923 | 925 | ||
| 924 | (defcustom delete-active-region t | 926 | (defcustom delete-active-region t |
| 925 | "Whether single-char deletion commands delete an active region. | 927 | "Whether single-char deletion commands delete an active region. |
| @@ -982,6 +984,7 @@ the end of the line." | |||
| 982 | (insert-char ?\s (- ocol (current-column)) nil)))) | 984 | (insert-char ?\s (- ocol (current-column)) nil)))) |
| 983 | ;; Otherwise, do simple deletion. | 985 | ;; Otherwise, do simple deletion. |
| 984 | (t (delete-char (- n) killflag)))) | 986 | (t (delete-char (- n) killflag)))) |
| 987 | (put 'delete-backward-char 'interactive-only "Use `delete-char' instead") | ||
| 985 | 988 | ||
| 986 | (defun delete-forward-char (n &optional killflag) | 989 | (defun delete-forward-char (n &optional killflag) |
| 987 | "Delete the following N characters (previous if N is negative). | 990 | "Delete the following N characters (previous if N is negative). |
| @@ -1079,6 +1082,7 @@ rather than line counts." | |||
| 1079 | (if (eq selective-display t) | 1082 | (if (eq selective-display t) |
| 1080 | (re-search-forward "[\n\C-m]" nil 'end (1- line)) | 1083 | (re-search-forward "[\n\C-m]" nil 'end (1- line)) |
| 1081 | (forward-line (1- line))))) | 1084 | (forward-line (1- line))))) |
| 1085 | (put 'goto-line 'interactive-only "Use `forward-line' instead") | ||
| 1082 | 1086 | ||
| 1083 | (defun count-words-region (start end &optional arg) | 1087 | (defun count-words-region (start end &optional arg) |
| 1084 | "Count the number of words in the region. | 1088 | "Count the number of words in the region. |
| @@ -4165,6 +4169,7 @@ Don't call it from programs: use `insert-buffer-substring' instead!" | |||
| 4165 | (insert-buffer-substring (get-buffer buffer)) | 4169 | (insert-buffer-substring (get-buffer buffer)) |
| 4166 | (point))) | 4170 | (point))) |
| 4167 | nil) | 4171 | nil) |
| 4172 | (put 'insert-buffer 'interactive-only "Use `insert-buffer-substring' instead") | ||
| 4168 | 4173 | ||
| 4169 | (defun append-to-buffer (buffer start end) | 4174 | (defun append-to-buffer (buffer start end) |
| 4170 | "Append to specified buffer the text of the region. | 4175 | "Append to specified buffer the text of the region. |
| @@ -4763,6 +4768,7 @@ and more reliable (no dependence on goal column, etc.)." | |||
| 4763 | (signal (car err) (cdr err)))) | 4768 | (signal (car err) (cdr err)))) |
| 4764 | (line-move arg nil nil try-vscroll))) | 4769 | (line-move arg nil nil try-vscroll))) |
| 4765 | nil) | 4770 | nil) |
| 4771 | (put 'next-line 'interactive-only "Use `forward-line' instead") | ||
| 4766 | 4772 | ||
| 4767 | (defun previous-line (&optional arg try-vscroll) | 4773 | (defun previous-line (&optional arg try-vscroll) |
| 4768 | "Move cursor vertically up ARG lines. | 4774 | "Move cursor vertically up ARG lines. |
| @@ -4802,6 +4808,8 @@ to use and more reliable (no dependence on goal column, etc.)." | |||
| 4802 | (signal (car err) (cdr err)))) | 4808 | (signal (car err) (cdr err)))) |
| 4803 | (line-move (- arg) nil nil try-vscroll)) | 4809 | (line-move (- arg) nil nil try-vscroll)) |
| 4804 | nil) | 4810 | nil) |
| 4811 | (put 'previous-line 'interactive-only | ||
| 4812 | "Use `forward-line' with negative argument instead") | ||
| 4805 | 4813 | ||
| 4806 | (defcustom track-eol nil | 4814 | (defcustom track-eol nil |
| 4807 | "Non-nil means vertical motion starting at end of line keeps to ends of lines. | 4815 | "Non-nil means vertical motion starting at end of line keeps to ends of lines. |