aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2019-12-16 01:58:14 +0200
committerJuri Linkov2019-12-16 01:58:14 +0200
commit7254b6346229a7b71b69f71e2d8eee113f02585a (patch)
treecdf52783a50d34acd37a235ba7fae7644c7b1564
parent1d52883047f0dd9a52d41060e164237923864265 (diff)
downloademacs-7254b6346229a7b71b69f71e2d8eee113f02585a.tar.gz
emacs-7254b6346229a7b71b69f71e2d8eee113f02585a.zip
Revert aa89c84e00d8dc85100e6fedab7631c415e6364d (bug#38457)
* src/editfns.c (Fmessage): Don't use minibuffer-message. (Fmessage_in_echo_area): Remove function message-in-echo-area. (syms_of_editfns): Remove variable message-in-echo-area. * lisp/isearch.el (isearch--momentary-message): Remove message-in-echo-area. * lisp/minibuffer.el (minibuffer-message): Don't record message in the *Messages* buffer. (minibuffer-completion-help): Remove message-in-echo-area. * lisp/subr.el (do-after-load-evaluation): Remove discard-input (bug#38560)
-rw-r--r--doc/lispref/display.texi8
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/isearch.el4
-rw-r--r--lisp/minibuffer.el15
-rw-r--r--lisp/subr.el2
-rw-r--r--src/editfns.c56
6 files changed, 11 insertions, 78 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 06032729a50..42b049eafde 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -276,13 +276,11 @@ followed by a newline.
276When @code{inhibit-message} is non-@code{nil}, no message will be displayed 276When @code{inhibit-message} is non-@code{nil}, no message will be displayed
277in the echo area, it will only be logged to @samp{*Messages*}. 277in the echo area, it will only be logged to @samp{*Messages*}.
278 278
279If the minibuffer is active, it uses the @code{minibuffer-message}
280function to display the message temporarily at the end of the
281minibuffer (@pxref{Minibuffer Misc}).
282
283If @var{format-string} is @code{nil} or the empty string, 279If @var{format-string} is @code{nil} or the empty string,
284@code{message} clears the echo area; if the echo area has been 280@code{message} clears the echo area; if the echo area has been
285expanded automatically, this brings it back to its normal size. 281expanded automatically, this brings it back to its normal size. If
282the minibuffer is active, this brings the minibuffer contents back
283onto the screen immediately.
286 284
287@example 285@example
288@group 286@group
diff --git a/etc/NEWS b/etc/NEWS
index 18ed8de736e..cf4e705a52f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -781,10 +781,6 @@ the minibuffer. If non-nil, point will move to the end of the prompt
781at the end of the active minibuffer. 781at the end of the active minibuffer.
782 782
783+++ 783+++
784*** The function 'message' now displays the message at the end of the minibuffer
785when the minibuffer is active.
786
787+++
788*** 'y-or-n-p' now uses the minibuffer to read 'y' or 'n' answer. 784*** 'y-or-n-p' now uses the minibuffer to read 'y' or 'n' answer.
789 785
790*** Some commands that previously used read-char-choice now read 786*** Some commands that previously used read-char-choice now read
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 7c22e6ad971..4f3342782d3 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2011,7 +2011,7 @@ Turning on character-folding turns off regexp mode.")
2011(defun isearch--momentary-message (string) 2011(defun isearch--momentary-message (string)
2012 "Print STRING at the end of the isearch prompt for 1 second." 2012 "Print STRING at the end of the isearch prompt for 1 second."
2013 (let ((message-log-max nil)) 2013 (let ((message-log-max nil))
2014 (message-in-echo-area "%s%s%s" 2014 (message "%s%s%s"
2015 (isearch-message-prefix nil isearch-nonincremental) 2015 (isearch-message-prefix nil isearch-nonincremental)
2016 isearch-message 2016 isearch-message
2017 (apply #'propertize (format " [%s]" string) 2017 (apply #'propertize (format " [%s]" string)
@@ -3168,7 +3168,7 @@ If there is no completion possible, say so and continue searching."
3168 (isearch-message-prefix ellipsis isearch-nonincremental) 3168 (isearch-message-prefix ellipsis isearch-nonincremental)
3169 m 3169 m
3170 (isearch-message-suffix c-q-hack))) 3170 (isearch-message-suffix c-q-hack)))
3171 (if c-q-hack m (let ((message-log-max nil)) (message-in-echo-area "%s" m))))) 3171 (if c-q-hack m (let ((message-log-max nil)) (message "%s" m)))))
3172 3172
3173(defun isearch--describe-regexp-mode (regexp-function &optional space-before) 3173(defun isearch--describe-regexp-mode (regexp-function &optional space-before)
3174 "Make a string for describing REGEXP-FUNCTION. 3174 "Make a string for describing REGEXP-FUNCTION.
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index f8888111caf..76d8ca44757 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -712,16 +712,11 @@ If ARGS are provided, then pass MESSAGE through `format-message'."
712 (progn 712 (progn
713 (if args 713 (if args
714 (apply #'message message args) 714 (apply #'message message args)
715 (message-in-echo-area "%s" message)) 715 (message "%s" message))
716 (prog1 (sit-for (or minibuffer-message-timeout 1000000)) 716 (prog1 (sit-for (or minibuffer-message-timeout 1000000))
717 (message-in-echo-area nil))) 717 (message nil)))
718 ;; Record message in the *Messages* buffer
719 (let ((inhibit-message t))
720 (if args
721 (apply #'message message args)
722 (message-in-echo-area "%s" message)))
723 ;; Clear out any old echo-area message to make way for our new thing. 718 ;; Clear out any old echo-area message to make way for our new thing.
724 (message-in-echo-area nil) 719 (message nil)
725 (setq message (if (and (null args) 720 (setq message (if (and (null args)
726 (string-match-p "\\` *\\[.+\\]\\'" message)) 721 (string-match-p "\\` *\\[.+\\]\\'" message))
727 ;; Make sure we can put-text-property. 722 ;; Make sure we can put-text-property.
@@ -1840,7 +1835,7 @@ variables.")
1840(defun minibuffer-completion-help (&optional start end) 1835(defun minibuffer-completion-help (&optional start end)
1841 "Display a list of possible completions of the current minibuffer contents." 1836 "Display a list of possible completions of the current minibuffer contents."
1842 (interactive) 1837 (interactive)
1843 (message-in-echo-area "Making completion list...") 1838 (message "Making completion list...")
1844 (let* ((start (or start (minibuffer-prompt-end))) 1839 (let* ((start (or start (minibuffer-prompt-end)))
1845 (end (or end (point-max))) 1840 (end (or end (point-max)))
1846 (string (buffer-substring start end)) 1841 (string (buffer-substring start end))
@@ -1851,7 +1846,7 @@ variables.")
1851 minibuffer-completion-predicate 1846 minibuffer-completion-predicate
1852 (- (point) start) 1847 (- (point) start)
1853 md))) 1848 md)))
1854 (message-in-echo-area nil) 1849 (message nil)
1855 (if (or (null completions) 1850 (if (or (null completions)
1856 (and (not (consp (cdr completions))) 1851 (and (not (consp (cdr completions)))
1857 (equal (car completions) string))) 1852 (equal (car completions) string)))
diff --git a/lisp/subr.el b/lisp/subr.el
index 1b2a1d643fb..ed55853bb27 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4616,7 +4616,7 @@ This function is called directly from the C code."
4616 (string-match "\\.elc?\\>" file)) 4616 (string-match "\\.elc?\\>" file))
4617 obarray)) 4617 obarray))
4618 (msg (format "Package %s is deprecated" package)) 4618 (msg (format "Package %s is deprecated" package))
4619 (fun (lambda (msg) (discard-input) (message "%s" msg)))) 4619 (fun (lambda (msg) (message "%s" msg))))
4620 ;; Cribbed from cl--compiling-file. 4620 ;; Cribbed from cl--compiling-file.
4621 (when (or (not (fboundp 'byte-compile-warning-enabled-p)) 4621 (when (or (not (fboundp 'byte-compile-warning-enabled-p))
4622 (byte-compile-warning-enabled-p 'obsolete package)) 4622 (byte-compile-warning-enabled-p 'obsolete package))
diff --git a/src/editfns.c b/src/editfns.c
index 72a9cdba7af..8fc866d391f 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2875,59 +2875,9 @@ If the first argument is nil or the empty string, the function clears
2875any existing message; this lets the minibuffer contents show. See 2875any existing message; this lets the minibuffer contents show. See
2876also `current-message'. 2876also `current-message'.
2877 2877
2878When the variable `message-in-echo-area' is non-nil, use the function
2879`message-in-echo-area' to display the message in the echo area.
2880Otherwise, when the minibuffer is active, use `minibuffer-message'
2881to temporarily display the message at the end of the minibuffer.
2882
2883usage: (message FORMAT-STRING &rest ARGS) */) 2878usage: (message FORMAT-STRING &rest ARGS) */)
2884 (ptrdiff_t nargs, Lisp_Object *args) 2879 (ptrdiff_t nargs, Lisp_Object *args)
2885{ 2880{
2886 if (NILP (Vmessage_in_echo_area)
2887 && !inhibit_message
2888 && !(NILP (args[0]) || (STRINGP (args[0]) && SBYTES (args[0]) == 0))
2889 && WINDOW_LIVE_P (Factive_minibuffer_window ())
2890 && WINDOW_LIVE_P (Fold_selected_window ())
2891 && BUFFERP (Fwindow_buffer (Fold_selected_window ()))
2892 && !NILP (Fminibufferp (Fwindow_buffer (Fold_selected_window ()))))
2893 {
2894 ptrdiff_t count = SPECPDL_INDEX ();
2895
2896 /* Avoid possible recursion. */
2897 specbind (Qmessage_in_echo_area, Qt);
2898
2899 record_unwind_current_buffer ();
2900 Fset_buffer (Fwindow_buffer (Fold_selected_window ()));
2901
2902 return unbind_to (count, CALLN (Fapply, intern ("minibuffer-message"),
2903 Flist (nargs, args)));
2904 }
2905 else
2906 return Fmessage_in_echo_area (nargs, args);
2907}
2908
2909DEFUN ("message-in-echo-area", Fmessage_in_echo_area, Smessage_in_echo_area, 1, MANY, 0,
2910 doc: /* Display a message at the bottom of the screen.
2911The message also goes into the `*Messages*' buffer, if `message-log-max'
2912is non-nil. (In keyboard macros, that's all it does.)
2913Return the message.
2914
2915In batch mode, the message is printed to the standard error stream,
2916followed by a newline.
2917
2918The first argument is a format control string, and the rest are data
2919to be formatted under control of the string. Percent sign (%), grave
2920accent (\\=`) and apostrophe (\\=') are special in the format; see
2921`format-message' for details. To display STRING without special
2922treatment, use (message-in-echo-area "%s" STRING).
2923
2924If the first argument is nil or the empty string, the function clears
2925any existing message; this lets the minibuffer contents show. See
2926also `current-message'.
2927
2928usage: (message-in-echo-area FORMAT-STRING &rest ARGS) */)
2929 (ptrdiff_t nargs, Lisp_Object *args)
2930{
2931 if (NILP (args[0]) 2881 if (NILP (args[0])
2932 || (STRINGP (args[0]) 2882 || (STRINGP (args[0])
2933 && SBYTES (args[0]) == 0)) 2883 && SBYTES (args[0]) == 0))
@@ -4570,11 +4520,6 @@ This variable is experimental; email 32252@debbugs.gnu.org if you need
4570it to be non-nil. */); 4520it to be non-nil. */);
4571 binary_as_unsigned = false; 4521 binary_as_unsigned = false;
4572 4522
4573 DEFVAR_LISP ("message-in-echo-area", Vmessage_in_echo_area,
4574 doc: /* Non-nil means overwrite the minibuffer with a message in the echo area. */);
4575 Vmessage_in_echo_area = Qnil;
4576 DEFSYM (Qmessage_in_echo_area, "message-in-echo-area");
4577
4578 defsubr (&Spropertize); 4523 defsubr (&Spropertize);
4579 defsubr (&Schar_equal); 4524 defsubr (&Schar_equal);
4580 defsubr (&Sgoto_char); 4525 defsubr (&Sgoto_char);
@@ -4649,7 +4594,6 @@ it to be non-nil. */);
4649 defsubr (&Semacs_pid); 4594 defsubr (&Semacs_pid);
4650 defsubr (&Ssystem_name); 4595 defsubr (&Ssystem_name);
4651 defsubr (&Smessage); 4596 defsubr (&Smessage);
4652 defsubr (&Smessage_in_echo_area);
4653 defsubr (&Smessage_box); 4597 defsubr (&Smessage_box);
4654 defsubr (&Smessage_or_box); 4598 defsubr (&Smessage_or_box);
4655 defsubr (&Scurrent_message); 4599 defsubr (&Scurrent_message);