From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#19064: 25.0.50; `message' overwrites `y-or-n-p' prompt, so user misses it Date: Thu, 07 Nov 2019 00:18:53 +0200 Message-ID: <87v9rw7inm.fsf@mail.linkov.net> References: <8ea0a3fa-5169-4493-bd54-3ebe47836a35@default> <87r3i9nped.fsf@gnus.org> <87wps1m7co.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="59833"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , 19064@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 06 23:32:21 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iSTqe-000FPG-Ps for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Nov 2019 23:32:21 +0100 Original-Received: from localhost ([::1]:35794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSTqc-0005RR-UN for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Nov 2019 17:32:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34417) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSTqO-0005Oz-96 for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2019 17:32:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSTqM-0001vN-SM for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2019 17:32:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60780) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSTqM-0001vC-N1 for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2019 17:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iSTqM-0000Ni-IN for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2019 17:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Nov 2019 22:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19064 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 19064-submit@debbugs.gnu.org id=B19064.15730794881389 (code B ref 19064); Wed, 06 Nov 2019 22:32:02 +0000 Original-Received: (at 19064) by debbugs.gnu.org; 6 Nov 2019 22:31:28 +0000 Original-Received: from localhost ([127.0.0.1]:41361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSTpl-0000MB-Ir for submit@debbugs.gnu.org; Wed, 06 Nov 2019 17:31:28 -0500 Original-Received: from dragonfly.birch.relay.mailchannels.net ([23.83.209.51]:12593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSTpi-0000M2-Mc for 19064@debbugs.gnu.org; Wed, 06 Nov 2019 17:31:23 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7CA742C334A; Wed, 6 Nov 2019 22:31:21 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a79.g.dreamhost.com (100-96-45-192.trex.outbound.svc.cluster.local [100.96.45.192]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id BC9AA2C32B4; Wed, 6 Nov 2019 22:31:20 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a79.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Wed, 06 Nov 2019 22:31:21 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Lonely-Harmony: 78de6eac0896f5f3_1573079481075_3172814400 X-MC-Loop-Signature: 1573079481075:1285350409 X-MC-Ingress-Time: 1573079481074 Original-Received: from pdx1-sub0-mail-a79.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a79.g.dreamhost.com (Postfix) with ESMTP id 05603A337E; Wed, 6 Nov 2019 14:31:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=5fbgNL+031vJVi3G5XuGNHvAz5M=; b= AEemTVYFq55WDb1egv3gohmfqO8/w31e/RZFEdbbvSFYN6W4coVC/szdfGEmqTIs okClwPzo7O3wLTJOZVykjs7RaS04iJnielDVVcPOVwFA7Qze4jsj8/VGErZQ6uGC VTApZbNN8TK7pe0w4Pq8ptcCCDB0qRIhmY6XSlZooIs= Original-Received: from mail.jurta.org (m91-129-102-1.cust.tele2.ee [91.129.102.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a79.g.dreamhost.com (Postfix) with ESMTPSA id 5EDCDA33B8; Wed, 6 Nov 2019 14:31:09 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a79 In-Reply-To: <87wps1m7co.fsf@web.de> (Michael Heerdegen's message of "Sat, 26 Dec 2015 18:45:43 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:171047 Archived-At: --=-=-= Content-Type: text/plain >> Seems like whenever `y-or-n-p' (or just `read-key') is waiting >> for a key, `message' should do nothing. Either it should echo >> its message after the key is read or (maybe better) it should >> do nothing at all. As it stands now, this seems like a basic >> UI problem, not just a minor annoyance. > > I tried this here with emacs 25: > > (progn > (man "X") > (y-or-n-p "-->")) Here is the patch that fixes this (required changes from bug#38076): --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=minibuffer-message-man.patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/man.el b/lisp/man.el index 9d21e953d1..27a134e004 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1389,7 +1389,7 @@ Man-bgproc-sentinel (let ((Man-buffer (if (stringp process) (get-buffer process) (process-buffer process))) (delete-buff nil) - (err-mess nil)) + message) =20 (if (null (buffer-name Man-buffer)) ;; deleted buffer (or (stringp process) @@ -1402,9 +1402,9 @@ Man-bgproc-sentinel (goto-char (point-min)) (cond ((or (looking-at "No \\(manual \\)*entry for") (looking-at "[^\n]*: nothing appropriate$")) - (setq err-mess (buffer-substring (point) - (progn - (end-of-line) (point))) + (setq message (buffer-substring (point) + (progn + (end-of-line) (point))) delete-buff t)) =20 ;; "-k foo", successful exit, but no output (from man-db) @@ -1415,7 +1415,7 @@ Man-bgproc-sentinel (eq (process-status process) 'exit) (=3D (process-exit-status process) 0) (=3D (point-min) (point-max))) - (setq err-mess (format "%s: no matches" Man-arguments) + (setq message (format "%s: no matches" Man-arguments) delete-buff t)) =20 ((or (stringp process) @@ -1423,7 +1423,7 @@ Man-bgproc-sentinel (=3D (process-exit-status process) 0)))) (or (zerop (length msg)) (progn - (setq err-mess + (setq message (concat (buffer-name Man-buffer) ": process " (let ((eos (1- (length msg)))) @@ -1432,11 +1432,7 @@ Man-bgproc-sentinel (goto-char (point-max)) (insert (format "\nprocess %s" msg)))) )) - (if delete-buff - (if (window-live-p (get-buffer-window Man-buffer t)) - (quit-restore-window - (get-buffer-window Man-buffer t) 'kill) - (kill-buffer Man-buffer)) + (unless delete-buff =20 (run-hooks 'Man-cooked-hook) =20 @@ -1447,10 +1443,8 @@ Man-bgproc-sentinel =20 (if (not Man-page-list) (let ((args Man-arguments)) - (if (window-live-p (get-buffer-window (current-buffer) t)) - (quit-restore-window - (get-buffer-window (current-buffer) t) 'kill) - (kill-buffer (current-buffer))) + (setq delete-buff t) + ;; Entries hyphenated due to the window's width ;; won't be found in the man database, so remove ;; the hyphenation -- assuming Groff hyphenates @@ -1460,22 +1454,29 @@ Man-bgproc-sentinel (if (string-match "[-=E2=80=90=C2=AD]" args) (let ((str (replace-match "" nil nil args))) (Man-getpage-in-background str)) - (message "Can't find the %s manpage" - (Man-page-from-arguments args)))) + (setq message (format "Can't find the %s manpage" + (Man-page-from-arguments arg= s))))) =20 (if Man-fontify-manpage-flag - (message "%s man page formatted" - (Man-page-from-arguments Man-arguments)) - (message "%s man page cleaned up" - (Man-page-from-arguments Man-arguments))) + (setq message (format "%s man page formatted" + (Man-page-from-arguments Man-arguments))) + (setq message (format "%s man page cleaned up" + (Man-page-from-arguments Man-arguments)))) (unless (and (processp process) (not (eq (process-status process) 'exit))) (setq mode-line-process nil)) - (set-buffer-modified-p nil))))) + (set-buffer-modified-p nil)))))) =20 - (if err-mess - (message "%s" err-mess)) - )))) + (when delete-buff + (if (window-live-p (get-buffer-window Man-buffer t)) + (quit-restore-window + (get-buffer-window Man-buffer t) 'kill) + (kill-buffer Man-buffer))) + + (when message + (if (minibufferp) + (minibuffer-message "%s" message) + (message "%s" message)))))) =20 (defun Man-page-from-arguments (args) ;; Skip arguments and only print the page name. --=-=-=--