From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T.V Raman" Newsgroups: gmane.emacs.devel Subject: Request: Please add a prompt to read-event Date: Fri, 17 Dec 2021 08:30:15 -0800 Message-ID: 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="22260"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 17 17:32:10 2021 Return-path: Envelope-to: ged-emacs-devel@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 1myG9R-0005X4-8p for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Dec 2021 17:32:09 +0100 Original-Received: from localhost ([::1]:35568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myG9Q-0004VE-D1 for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Dec 2021 11:32:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myG7i-00036o-P4 for emacs-devel@gnu.org; Fri, 17 Dec 2021 11:30:22 -0500 Original-Received: from [2607:f8b0:4864:20::1031] (port=38786 helo=mail-pj1-x1031.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1myG7g-0001An-Va for emacs-devel@gnu.org; Fri, 17 Dec 2021 11:30:22 -0500 Original-Received: by mail-pj1-x1031.google.com with SMTP id n15-20020a17090a394f00b001b0f6d6468eso6217140pjf.3 for ; Fri, 17 Dec 2021 08:30:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:from:to:subject:mime-version :content-transfer-encoding; bh=8XSKg13c+rK0asIXrNkLFiZ/EXVOyGxhBvO/3LhmPhw=; b=A2yERYth86DmQggf7Fif4Bvtr2Y3mMjHsfWDu4CgZ50GaodZLnZFk+5okA+zFD2g1G zptLdw3gu9GMr6poqTOJgw+vaV/u81P1l9oSLfyPG5OrtUQ4/d+yGdBE6W663mobo0Ja O0q8NOnScRwla94hZaftM5wquNJ+krEkriEo6SdXGpFeNMXZ/jIMLei50zN3VOxY9/lQ 4yNAjPYdTKtfhxRhFqj8C2RiZ4fuqbbTVlQggh3Bp663T8cPFtVOFagsV9YSpHPe0enP Bc/TtrPxQMEacHiIdGVgv8cbD7jbvEvb0kLrG7rp91dXns/J7Ag9VxHMIVVX4eE8FjxO CrWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:from:to:subject:mime-version :content-transfer-encoding; bh=8XSKg13c+rK0asIXrNkLFiZ/EXVOyGxhBvO/3LhmPhw=; b=6HNqV0YnUBDxYXbgaO7+Dac2a8+IAM/YxwGoyJP/iLsBYzkbt5p2zriq2sGD8COrSZ V0o1FlX2C12e5Jk1df+Hwy4k/wUoXNJd46WIqcFl6GCh48zBQVMV6gT5FzBe4gW8lL2D BiFzVGMRAUQQamBqmpvlFaKcDQTpXdpE7LtlTVB1/+d2fWYO49zXb5a9Hz3r0BD1vENF xJt+3EcAQk8jBgm7x+4R8NwCMeGIGvOFU8NctonGN9xyMBaZOYKdCTNYPRkyw4WQREVF zMszgvvrNnylBMfwDH2TEmdtck+eiF+q7EdIDhN8IATxeFX/8zMYtcTON8CP/xDYmMxf IwGw== X-Gm-Message-State: AOAM532QhkPCMBpgRv4EGj2v0pLyRldDSQzZp8jlNyWMQNaW3Nm9xzZ2 RIZ+BNmY+jJ2b0iBAhziseRPMzQ0efIO9g== X-Google-Smtp-Source: ABdhPJyHy37cqye046XHS28E+kryjuKaCxD83tJTZKCs0GAkh2wKViTxILop7Dr5ccJT6sncRAXkQA== X-Received: by 2002:a17:902:ecc6:b0:148:a65d:842d with SMTP id a6-20020a170902ecc600b00148a65d842dmr4113858plh.56.1639758618391; Fri, 17 Dec 2021 08:30:18 -0800 (PST) Original-Received: from raman-glaptop (c-24-4-174-65.hsd1.ca.comcast.net. [24.4.174.65]) by smtp.gmail.com with ESMTPSA id rm1sm12508235pjb.3.2021.12.17.08.30.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Dec 2021 08:30:17 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1031 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=raman@google.com; helo=mail-pj1-x1031.google.com X-Spam_score_int: -167 X-Spam_score: -16.8 X-Spam_bar: ---------------- X-Spam_report: (-16.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:282225 Archived-At: Emacspeak advices read-event and read-char to speak their prompt. There are a few places in Emacs where read-event and/or read-char are called without a prompt; e.g. disabled-command-function Could we perhaps fix this? (defun disabled-command-function (&optional cmd keys) (unless cmd (setq cmd this-command)) (unless keys (setq keys (this-command-keys))) (let (char) (save-window-excursion (with-output-to-temp-buffer "*Disabled Command*" ;; (help-buffer) (if (or (eq (aref keys 0) (if (stringp keys) (aref "\M-x" 0) ?\M-x)) (and (>= (length keys) 2) (eq (aref keys 0) meta-prefix-char) (eq (aref keys 1) ?x))) (princ (format "You have invoked the disabled command %s.\n" cmd)) (princ (format "You have typed %s, invoking disabled command %s.\n" (key-description keys) cmd))) ;; Print any special message saying why the command is disabled. (if (stringp (get cmd 'disabled)) (princ (get cmd 'disabled)) (princ "It is disabled because new users often find it confusing.\n") (princ (substitute-command-keys "Here's the first part of its description:\n\n")) ;; Keep only the first paragraph of the documentation. (with-current-buffer "*Disabled Command*" ;; standard-output (goto-char (point-max)) (let ((start (point))) (save-excursion (princ (or (condition-case () (documentation cmd) (error nil)) "<< not documented >>"))) (if (search-forward "\n\n" nil t) (delete-region (match-beginning 0) (point-max))) (goto-char (point-max)) (indent-rigidly start (point) 3)))) (princ "\n\nDo you want to use this command anyway?\n\n") (princ (substitute-command-keys "You can now type y to try it and enable it (no questions if you use it again). n to cancel--don't try the command, and it remains disabled. SPC to try the command just this once, but leave it disabled. ! to try it, and enable all disabled commands for this session only.")) ;; Redundant since with-output-to-temp-buffer will do it anyway. ;; (with-current-buffer standard-output ;; (help-mode)) ) (fit-window-to-buffer (get-buffer-window "*Disabled Command*")) (message "Type y, n, ! or SPC (the space bar): ") (let ((cursor-in-echo-area t)) (while (progn (setq char (read-event)) (or (not (numberp char)) (not (memq (downcase char) '(?! ?y ?n ?\s ?\C-g))))) (ding) (message "Please type y, n, ! or SPC (the space bar): ")))) (setq char (downcase char)) (pcase char (?\C-g (setq quit-flag t)) (?! (setq disabled-command-function nil)) (?y (if (and user-init-file (not (string= "" user-init-file)) (y-or-n-p "Enable command for future editing sessions also? ")) (enable-command cmd) (put cmd 'disabled nil)))) (or (char-equal char ?n) (call-interactively cmd)))) -- Thanks, --Raman(I Search, I Find, I Misplace, I Research) ♉ Id: kg:/m/0285kf1 🦮 -- Thanks, --Raman(I Search, I Find, I Misplace, I Research) ♉ Id: kg:/m/0285kf1 🦮