From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#45412: File ... is large (... MiB), really open? (y)es or (n)o or (l)iterally Date: Thu, 22 Apr 2021 13:04:28 +0300 Message-ID: <83fsziprdf.fsf@gnu.org> References: <87k0t72rhd.5.fsf@jidanni.org> <8735zuig9m.fsf@gnus.org> <87wnx62rpe.fsf@mail.linkov.net> <877dl80vwk.fsf@gnus.org> <87mttxqgnv.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21093"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45412@debbugs.gnu.org, larsi@gnus.org, jidanni@jidanni.org, juri@linkov.net To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 22 12:05:56 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZWDb-0005OH-IX for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Apr 2021 12:05:55 +0200 Original-Received: from localhost ([::1]:33212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZWDa-0005Rl-M1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Apr 2021 06:05:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZWCk-0005Cm-On for bug-gnu-emacs@gnu.org; Thu, 22 Apr 2021 06:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49494) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZWCk-0004yp-Gb for bug-gnu-emacs@gnu.org; Thu, 22 Apr 2021 06:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lZWCk-0005IZ-A7 for bug-gnu-emacs@gnu.org; Thu, 22 Apr 2021 06:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Apr 2021 10:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45412 X-GNU-PR-Package: emacs Original-Received: via spool by 45412-submit@debbugs.gnu.org id=B45412.161908588920345 (code B ref 45412); Thu, 22 Apr 2021 10:05:02 +0000 Original-Received: (at 45412) by debbugs.gnu.org; 22 Apr 2021 10:04:49 +0000 Original-Received: from localhost ([127.0.0.1]:32807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZWCX-0005I4-7s for submit@debbugs.gnu.org; Thu, 22 Apr 2021 06:04:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZWCU-0005Hr-Ox for 45412@debbugs.gnu.org; Thu, 22 Apr 2021 06:04:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46681) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZWCO-0004oF-NG; Thu, 22 Apr 2021 06:04:40 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2832 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lZWCO-0000fv-7T; Thu, 22 Apr 2021 06:04:40 -0400 In-Reply-To: (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:204677 Archived-At: > Date: Thu, 22 Apr 2021 00:12:54 +0200 > From: Daniel Martín via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > -(defun read-multiple-choice (prompt choices) > +(defun read-multiple-choice (prompt choices &optional help-string) > "Ask user a multiple choice question. > PROMPT should be a string that will be displayed as the prompt. > > @@ -35,15 +35,18 @@ read-multiple-choice > be displayed while prompting (if there's room, it might be > shortened). DESCRIPTION is an optional longer explanation that > will be displayed in a help buffer if the user requests more > -help. > +help. This help description has a fixed format in columns, but > +the user can control the text that is displayed and how it is > +formatted with optional argument HELP-STRING. This leaves it unsaid what HELP-STRING is (is it a string? a list? a function? something else?) and how it is used by the function. > +If the user enters `recenter', `scroll-up', or `scroll-down' > +responses, perform the requested window recentering or scrolling > +and ask again. If the user enters `edit', a recursive edit is > +started. The last sentence (ab)uses the passive tense, and thus reads awkwardly. Can you reword not to use passive tense? Also, how about saying what happens when the user exits the recursive-edit? > @@ -133,6 +136,10 @@ read-multiple-choice > (ignore-errors (scroll-other-window)) t) > ((eq answer 'scroll-other-window-down) > (ignore-errors (scroll-other-window-down)) t) > + ((eq answer 'edit) > + (save-excursion > + (save-window-excursion > + (recursive-edit)))) It is customary to display an echo-area message when entering recursive-edit, telling the user how to exit when done editing. > - (setq wrong-char (not (memq tchar '(?? ?\C-h))) > + (setq wrong-char (not (memq tchar '(?? help-char))) What about F1? > + (if help-string > + (with-help-window buf > + (with-current-buffer buf > + (insert help-string))) Should this verify that HELP-STRING is a string? > +--- > +** New help window when Emacs prompts before opening a large file. > ++Press '?' or 'help-char' (by default, 'C-h') to display this new help window. I think this should mention the situations where this happens. "Opening large files" is not detailed enough: I suggest to mention a couple of commands that trigger this, and perhaps also what is considered a "large file". > (defun files--ask-user-about-large-file (size op-type filename offer-raw) > (let ((prompt (format "File %s is large (%s), really %s?" > (file-name-nondirectory filename) > (funcall byte-count-to-string-function size) op-type))) > (if (not offer-raw) > (if (y-or-n-p prompt) nil 'abort) > - (let* ((use-dialog (and (display-popup-menus-p) > - last-input-event > - (listp last-nonmenu-event) > - use-dialog-box)) > + (let* ((prompt (format "File %s is large (%s), really %s?" > + (file-name-nondirectory filename) > + (funcall byte-count-to-string-function size) op-type)) > (choice > - (if use-dialog > - (x-popup-dialog t `(,prompt > - ("Yes" . ?y) > - ("No" . ?n) > - ("Open literally" . ?l))) Why are we losing the feature whereby we use GUI dialogs to ask the question? This sounds like a regression to me, at least for users who use the mouse and menu-bar in preference to the keyboard. And the doc string still says we do support the dialogs. Am I missing something? Thanks.