From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 04 11:35:29 2018 Received: (at submit) by debbugs.gnu.org; 4 Mar 2018 16:35:29 +0000 Received: from localhost ([127.0.0.1]:44586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esWbh-00057y-GK for submit@debbugs.gnu.org; Sun, 04 Mar 2018 11:35:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esWbg-00057m-PC for submit@debbugs.gnu.org; Sun, 04 Mar 2018 11:35:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esWba-0003pk-Gg for submit@debbugs.gnu.org; Sun, 04 Mar 2018 11:35:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51264) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1esWba-0003pW-Di for submit@debbugs.gnu.org; Sun, 04 Mar 2018 11:35:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esWbZ-0003qq-3S for bug-gnu-emacs@gnu.org; Sun, 04 Mar 2018 11:35:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esWbV-0003ma-00 for bug-gnu-emacs@gnu.org; Sun, 04 Mar 2018 11:35:21 -0500 Received: from sinyavsky.aurox.ch ([37.35.109.145]:59062) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1esWbU-0003ko-KU for bug-gnu-emacs@gnu.org; Sun, 04 Mar 2018 11:35:16 -0500 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 5162E226AF for ; Sun, 4 Mar 2018 16:35:48 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= subject:subject:to:from:from:message-id:date:date; s=dkim; t= 1520181347; x=1521045348; bh=gYE1Ph6AP2QUay3tFteUNiMX3G8a5T2Zxbr VEzpY9c0=; b=sgsfjZ6cp0vr5NqogyMp587GoYa6tN9z7azsRGduxwK//GVZ8I9 rKfsZ7Yt7Q9SvOl2skJAd+2pwTL26DTBRtDd1ZMFbEAkGt8MsS6X8NSqkO7n4bFL IZ8GR8cSy3eMYbJX4A/mIaD5eT091TwbF35Fxbxz8iSWiE287JQ0Uu98= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id KBKT54m_9gTU for ; Sun, 4 Mar 2018 16:35:47 +0000 (UTC) Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 92B4622688 for ; Sun, 4 Mar 2018 16:35:47 +0000 (UTC) Date: Sun, 04 Mar 2018 17:46:18 +0100 Message-Id: From: charles@aurox.ch (Charles A. Roelli) To: bug-gnu-emacs@gnu.org Subject: make eval-expression only take `read'-able Lisp X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) Here is a change to make eval-expression issue a warning in the minibuffer when the user enters an unreadable expression. Currently, we just error out, so the user has to restart the command and go back in the history to get back what he typed. With the change applied, if you type M-: ( RET from emacs -q, you'll see, Eval: ( [End of file during parsing] which gives you a chance to fix the error right away. As another example, if you type an extra paren, as in M-: ( ) ) RET you'll see, Eval: ()) [Trailing garbage following expression] and point is left at the extra paren. I've also added documentation for read--expression. The change follows: diff --git a/lisp/simple.el b/lisp/simple.el index 60a0028..7387554 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1517,6 +1517,10 @@ eval-expression-minibuffer-setup-hook "Hook run by `eval-expression' when entering the minibuffer.") (defun read--expression (prompt &optional initial-contents) + "Read an Emacs Lisp expression from the minibuffer. + +PROMPT and optional argument INITIAL-CONTENTS do the same as in +function `read-from-minibuffer'." (let ((minibuffer-completing-symbol t)) (minibuffer-with-setup-hook (lambda () @@ -1526,11 +1530,52 @@ read--expression (eldoc-mode 1) (add-hook 'completion-at-point-functions #'elisp-completion-at-point nil t) + (local-set-key "\r" 'read--expression-try-read) + (local-set-key "\n" 'read--expression-try-read) (run-hooks 'eval-expression-minibuffer-setup-hook)) (read-from-minibuffer prompt initial-contents read-expression-map t 'read-expression-history)))) +(defun read--expression-try-read () + "Try to read an Emacs Lisp expression in the minibuffer. + +Exit the minibuffer if successful, else report the error to the +user and move point to the location of the error. If point is +not already at the location of the error, push a mark before +moving point." + (interactive) + (unless (> (minibuffer-depth) 0) + (error "Minibuffer must be active")) + (if (let* ((contents (minibuffer-contents)) + (error-point nil)) + (with-temp-buffer + (condition-case err + (progn + (insert contents) + (goto-char (point-min)) + ;; `read' will signal errors like "End of file during + ;; parsing" and "Invalid read syntax". + (read (current-buffer)) + ;; Since `read' does not signal the "Trailing garbage + ;; following expression" error, we check for trailing + ;; garbage ourselves. + (or (progn + ;; This check is similar to what `string_to_object' + ;; does in minibuf.c. + (skip-chars-forward " \t\n") + (= (point) (point-max))) + (error "Trailing garbage following expression"))) + (error + (setq error-point (+ (length (minibuffer-prompt)) (point))) + (with-current-buffer (window-buffer (minibuffer-window)) + (unless (= (point) error-point) + (push-mark)) + (goto-char error-point) + (minibuffer-message (error-message-string err))) + nil)))) + (exit-minibuffer))) + (defun eval-expression-get-print-arguments (prefix-argument) "Get arguments for commands that print an expression result. Returns a list (INSERT-VALUE NO-TRUNCATE CHAR-PRINT-LIMIT) From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 04 12:11:22 2018 Received: (at 30697) by debbugs.gnu.org; 4 Mar 2018 17:11:22 +0000 Received: from localhost ([127.0.0.1]:44648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esXAQ-0007xR-H5 for submit@debbugs.gnu.org; Sun, 04 Mar 2018 12:11:22 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esXAO-0007xF-VM for 30697@debbugs.gnu.org; Sun, 04 Mar 2018 12:11:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esXAE-0000Xb-W4 for 30697@debbugs.gnu.org; Sun, 04 Mar 2018 12:11:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esXAE-0000XX-SZ; Sun, 04 Mar 2018 12:11:10 -0500 Received: from [176.228.60.248] (port=3433 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1esXAE-0008I1-9n; Sun, 04 Mar 2018 12:11:10 -0500 Date: Sun, 04 Mar 2018 19:10:55 +0200 Message-Id: <83k1uru5pc.fsf@gnu.org> From: Eli Zaretskii To: charles@aurox.ch (Charles A. Roelli) In-reply-to: (charles@aurox.ch) Subject: Re: bug#30697: make eval-expression only take `read'-able Lisp References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30697 Cc: 30697@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sun, 04 Mar 2018 17:46:18 +0100 > From: charles@aurox.ch (Charles A. Roelli) > > Here is a change to make eval-expression issue a warning in the > minibuffer when the user enters an unreadable expression. Currently, > we just error out, so the user has to restart the command and go back > in the history to get back what he typed. > > With the change applied, if you type > > M-: ( RET > > from emacs -q, you'll see, > > Eval: ( [End of file during parsing] > > which gives you a chance to fix the error right away. > > As another example, if you type an extra paren, as in > > M-: ( ) ) RET > > you'll see, > > Eval: ()) [Trailing garbage following expression] > > and point is left at the extra paren. You are changing the behavior of read--expression, which has a few callers in Emacs. Did you verify that those callers won't break due to this change? This should also have a NEWS entry, and perhaps the manual needs some changes, please take a look. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 04 17:37:19 2018 Received: (at 30697) by debbugs.gnu.org; 4 Mar 2018 22:37:19 +0000 Received: from localhost ([127.0.0.1]:44802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1escFr-0000oz-Di for submit@debbugs.gnu.org; Sun, 04 Mar 2018 17:37:19 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:45728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1escFp-0000om-8y for 30697@debbugs.gnu.org; Sun, 04 Mar 2018 17:37:17 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w24Mb3pn091511; Sun, 4 Mar 2018 22:37:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=o17IGm3H/2RLGVwQr4N0U50RPTdOdQn5ESwEa8xFmbk=; b=nRYSO6+eFxtn8ZsjJbwOzyCvn8eQhcz4fFu3nsL4IzzP83Dry/gNxlwdNSdnoWJtODZj Ln/w78Rn092Vpg7e2jsHi7vW1lxIWfKOgpJ4vFTIJF5tHC/oCfJB5gJFuBnDHMHvhSNr d3T5WnHrLO07CO8/JDxhB+VxFDgh82eS4klGLfCezRDVHgX/kqTT+peCd6p49boxRoj/ yxiUHZQYcGfVGyVqWpXe5AAP6RLoJX2SsktW5yJkovdekiYnAGOKYUr8Ihefe7973t9p JhCaHo/2JHOo+cZgqDJ+FEbOXROJkp2jvV4bqIhS9CQBH5sQ3pvxqDxZjirD9sqxnmhR Nw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2ggrudr1t1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 04 Mar 2018 22:37:03 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w24Mb0g8016336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 4 Mar 2018 22:37:00 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w24MaxBv016626; Sun, 4 Mar 2018 22:36:59 GMT MIME-Version: 1.0 Message-ID: <182ce144-2313-4cf9-9978-f9d6d570b4dd@default> Date: Sun, 4 Mar 2018 14:36:57 -0800 (PST) From: Drew Adams To: "Charles A. Roelli" , 30697@debbugs.gnu.org Subject: RE: bug#30697: make eval-expression only take `read'-able Lisp References: <> In-Reply-To: <> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4654.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8822 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=914 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803040295 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30697 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > Here is a change to make eval-expression issue a warning in the > minibuffer when the user enters an unreadable expression. Currently, > we just error out, so the user has to restart the command and go back > in the history to get back what he typed. I don't see why this is better than what happens now. We currently have `eval-expression-debug-on-error', which helps you understand the read or eval error. And the function is not necessarily called interactively ("When called interactively..."). What problem is the proposed change trying to solve? From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 05 13:41:28 2018 Received: (at 30697) by debbugs.gnu.org; 5 Mar 2018 18:41:28 +0000 Received: from localhost ([127.0.0.1]:46187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esv39-0006Yy-S8 for submit@debbugs.gnu.org; Mon, 05 Mar 2018 13:41:28 -0500 Received: from sinyavsky.aurox.ch ([37.35.109.145]:53504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esv37-0006Yl-Uc for 30697@debbugs.gnu.org; Mon, 05 Mar 2018 13:41:26 -0500 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 46704226BD for <30697@debbugs.gnu.org>; Mon, 5 Mar 2018 18:41:54 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1520275312; x=1521139313; bh=e5Rc7RbZ8UpAV 6Yaq/1H4qDhTYso+4/HTtX64UR3ZR0=; b=C08Aob2VMo6YWwAeOpKYnKGvFrOFz Cr+0JvUjXZAhn/9iewadnROsvOSGtFYZ6S4dnggJWi3wyjC8zLbADmsh3oN6eQaK mTuGAfDsZw2eSNFpo+ZqG9K1Ici1WxsYxuCf0Dg7qA9Vp0HJrwj5v4aXicp+zU7Y WSpbUBUH/aQOsQ= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id D-L6Q_I8xxfH for <30697@debbugs.gnu.org>; Mon, 5 Mar 2018 18:41:52 +0000 (UTC) Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 3D0EE22688; Mon, 5 Mar 2018 18:41:51 +0000 (UTC) Date: Mon, 05 Mar 2018 19:52:14 +0100 Message-Id: From: charles@aurox.ch (Charles A. Roelli) To: Eli Zaretskii In-reply-to: <83k1uru5pc.fsf@gnu.org> (message from Eli Zaretskii on Sun, 04 Mar 2018 19:10:55 +0200) Subject: Re: bug#30697: make eval-expression only take `read'-able Lisp References: <83k1uru5pc.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 30697 Cc: 30697@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > Date: Sun, 04 Mar 2018 19:10:55 +0200 > From: Eli Zaretskii > CC: 30697@debbugs.gnu.org > > You are changing the behavior of read--expression, which has a few > callers in Emacs. Did you verify that those callers won't break due > to this change? I've now tested them, and they work fine. `eval-minibuffer' (which is used for (interactive "X")) turns out to be one of the callers of `read--expression', so I think the documentation of that interactive spec will have to be updated too. I also did small tests with ido-mode/icomplete-mode enabled, which also do not seem to be affected by this change. > This should also have a NEWS entry, and perhaps the manual needs some > changes, please take a look. Thanks, I will work on that. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 05 13:58:19 2018 Received: (at 30697) by debbugs.gnu.org; 5 Mar 2018 18:58:19 +0000 Received: from localhost ([127.0.0.1]:46196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esvJS-0006yR-Qt for submit@debbugs.gnu.org; Mon, 05 Mar 2018 13:58:19 -0500 Received: from sinyavsky.aurox.ch ([37.35.109.145]:53533) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esvJP-0006yC-62 for 30697@debbugs.gnu.org; Mon, 05 Mar 2018 13:58:16 -0500 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id E3DD7226BD for <30697@debbugs.gnu.org>; Mon, 5 Mar 2018 18:58:43 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1520276322; x=1521140323; bh=utD9floCT2Vot ujIuCmEa8cR37peN+Dc8qcw0Z08jn4=; b=kKHX7Ovb385JdAFYle0+NJOyeCoOF HoHG4WGFSv/FNOqbQc39p+xW4K+aaMmQ23BGjCPlCGHgxa5rfUDrhuawewsrU0bx jYexhC0UxSIMLofYMB3ZShFsJNfmyEdVmr8KGN7w1mdzTPWn1PK3qsNjUsoHMR/I 75IognqhdP3NJA= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WohT83v4Q44i for <30697@debbugs.gnu.org>; Mon, 5 Mar 2018 18:58:42 +0000 (UTC) Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 79F6B22688; Mon, 5 Mar 2018 18:58:42 +0000 (UTC) Date: Mon, 05 Mar 2018 20:09:19 +0100 Message-Id: From: charles@aurox.ch (Charles A. Roelli) To: Drew Adams In-reply-to: <182ce144-2313-4cf9-9978-f9d6d570b4dd@default> (message from Drew Adams on Sun, 4 Mar 2018 14:36:57 -0800 (PST)) Subject: Re: bug#30697: make eval-expression only take `read'-able Lisp References: <182ce144-2313-4cf9-9978-f9d6d570b4dd@default> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 30697 Cc: 30697@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > Date: Sun, 4 Mar 2018 14:36:57 -0800 (PST) > From: Drew Adams > Content-Type: text/plain; charset=us-ascii > > > Here is a change to make eval-expression issue a warning in the > > minibuffer when the user enters an unreadable expression. Currently, > > we just error out, so the user has to restart the command and go back > > in the history to get back what he typed. > > I don't see why this is better than what happens now. > > We currently have `eval-expression-debug-on-error', which helps > you understand the read or eval error. And the function is not > necessarily called interactively ("When called interactively..."). > > What problem is the proposed change trying to solve? It's too easy to evaluate a meaningless expression, which is never intended. Instead, we can point the user to the position of the error so that it can be easily fixed, unlike the current behavior, where the user is left guessing. (I don't think eval-expression-debug-on-error catches read errors -- if it did, it would show a *Backtrace* buffer when an unreadable expression is entered. But I didn't look very deeply, so correct that if it's wrong.) From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 24 14:58:32 2019 Received: (at 30697) by debbugs.gnu.org; 24 Jun 2019 18:58:33 +0000 Received: from localhost ([127.0.0.1]:57987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfUAi-0002rt-BH for submit@debbugs.gnu.org; Mon, 24 Jun 2019 14:58:32 -0400 Received: from quimby.gnus.org ([80.91.231.51]:35020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfUAd-0002rO-Qj for 30697@debbugs.gnu.org; Mon, 24 Jun 2019 14:58:28 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfUAZ-0006Zn-GT; Mon, 24 Jun 2019 20:58:25 +0200 From: Lars Ingebrigtsen To: charles@aurox.ch (Charles A. Roelli) Subject: Re: bug#30697: make eval-expression only take `read'-able Lisp, bug#30697: make eval-expression only take `read'-able Lisp References: <83k1uru5pc.fsf@gnu.org> Date: Mon, 24 Jun 2019 20:58:23 +0200 In-Reply-To: (Charles A. Roelli's message of "Sun, 04 Mar 2018 17:46:18 +0100, Mon, 05 Mar 2018 19:52:14 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: charles@aurox.ch (Charles A. Roelli) writes: > Here is a change to make eval-expression issue a warning in the > minibuffer when the user enters an unreadable expression. Currently, > we just error out, so the user has to restart the command and [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30697 Cc: 30697@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) charles@aurox.ch (Charles A. Roelli) writes: > Here is a change to make eval-expression issue a warning in the > minibuffer when the user enters an unreadable expression. Currently, > we just error out, so the user has to restart the command and go back > in the history to get back what he typed. I think this sounds like a good change -- I often type invalid stuff into M-: and then have to M-: M-p, so this is a usability win. >> You are changing the behavior of read--expression, which has a few >> callers in Emacs. Did you verify that those callers won't break due >> to this change? > > I've now tested them, and they work fine. `eval-minibuffer' (which is > used for (interactive "X")) turns out to be one of the callers of > `read--expression', so I think the documentation of that interactive > spec will have to be updated too. > > I also did small tests with ido-mode/icomplete-mode enabled, which > also do not seem to be affected by this change. > >> This should also have a NEWS entry, and perhaps the manual needs some >> changes, please take a look. > > Thanks, I will work on that. Did you finish up the change, Charles? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 10 09:18:05 2020 Received: (at 30697) by debbugs.gnu.org; 10 Aug 2020 13:18:05 +0000 Received: from localhost ([127.0.0.1]:34923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k57gi-0001K0-TK for submit@debbugs.gnu.org; Mon, 10 Aug 2020 09:18:05 -0400 Received: from quimby.gnus.org ([95.216.78.240]:47666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k57gh-0001JT-6q for 30697@debbugs.gnu.org; Mon, 10 Aug 2020 09:18:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=U53VyapVRjhOuEoTO0PBdHCz8/uqtMtQtbQKz6C28WY=; b=CTnIlA23WW8T+rh+6puaMNpn4v lKjQdaFzMF4CUwb8TuRq6lX9AGvGO3KyeR69firw9YRC0pxMqyiiJrlanWmctMMUKKEw3kLtmvNPm ORtWjyBzLLyX3E62Not0jXMDa9XHV/UYImhEo0rbnvtjUWg3pinWGw9tXN8T80xOzJ44=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k57gX-0004IF-Rh; Mon, 10 Aug 2020 15:17:56 +0200 From: Lars Ingebrigtsen To: charles@aurox.ch (Charles A. Roelli) Subject: Re: bug#30697: make eval-expression only take `read'-able Lisp, bug#30697: make eval-expression only take `read'-able Lisp References: <83k1uru5pc.fsf@gnu.org> Date: Mon, 10 Aug 2020 15:17:52 +0200 In-Reply-To: (Lars Ingebrigtsen's message of "Mon, 24 Jun 2019 20:58:23 +0200") Message-ID: <87k0y64p33.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: >>> This should also have a NEWS entry, and perhaps the manual needs some >>> changes, please take a look. >> >> Thanks, I will work on that. > > Did you finish up the change, Charles? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30697 Cc: 30697@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: >>> This should also have a NEWS entry, and perhaps the manual needs some >>> changes, please take a look. >> >> Thanks, I will work on that. > > Did you finish up the change, Charles? This was a year ago, so I did added the NEWS entry. I grepped through the manuals for eval-expression to see whether the previous behaviour was mentioned there (and would therefore need changing), but I couldn't find anything, so I didn't change anything. So this is now pushed to Emacs 28, and I think it's a really good and natural change. Thanks, Charles. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 10 09:18:11 2020 Received: (at control) by debbugs.gnu.org; 10 Aug 2020 13:18:11 +0000 Received: from localhost ([127.0.0.1]:34926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k57gp-0001KI-4h for submit@debbugs.gnu.org; Mon, 10 Aug 2020 09:18:11 -0400 Received: from quimby.gnus.org ([95.216.78.240]:47682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k57gn-0001Jy-Nk for control@debbugs.gnu.org; Mon, 10 Aug 2020 09:18:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Acu7VXCUT+fz3ODg3HG3L9pKmYcNSUMmphvrsKsMfPg=; b=VGKHtqrYEBLb1jOYwNsRIJjKZc 4RFHaXjikdDr6ZDLu/EJ4eJ/zt6ry1WPUWu+ytS8Bg3mRRr/o9slZ2/U38pt08gFu4+1VvGEJHf42 QWBCJHNn1RjbuyXP6TLVnn/iTTWYvWxKOcirlzjPKquOjS8cjiijghio6os7sVmteYJc=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k57gf-0004IO-UO for control@debbugs.gnu.org; Mon, 10 Aug 2020 15:18:04 +0200 Date: Mon, 10 Aug 2020 15:18:00 +0200 Message-Id: <87imdq4p2v.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #30697 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 30697 fixed close 30697 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 30697 fixed close 30697 28.1 quit From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 10 09:20:24 2020 Received: (at 30697) by debbugs.gnu.org; 10 Aug 2020 13:20:24 +0000 Received: from localhost ([127.0.0.1]:34943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k57ix-0001P2-V7 for submit@debbugs.gnu.org; Mon, 10 Aug 2020 09:20:24 -0400 Received: from quimby.gnus.org ([95.216.78.240]:47772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k57iw-0001Om-BA for 30697@debbugs.gnu.org; Mon, 10 Aug 2020 09:20:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LjyYvkFGqKW5JM7VNBiU3iaEECwbCDb48UGszjWF0lA=; b=JSiZOGWlPJv917Kw9xyUvolTG6 o7G7bSdg6IkohiW3B6Hn5RyAwLKM/Ah0vcSi98q315040Qawqvv5WqEr1+4UD7agJpixtwzRwt3zL mdjPwUn0Uv7A0crnHaihg+nTw+v3m8geRnjnyToDQNyweNL9QsLuzyCGLcRGt3LrvhME=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k57io-0004JQ-4f; Mon, 10 Aug 2020 15:20:16 +0200 From: Lars Ingebrigtsen To: charles@aurox.ch (Charles A. Roelli) Subject: Re: bug#30697: make eval-expression only take `read'-able Lisp, bug#30697: make eval-expression only take `read'-able Lisp References: <83k1uru5pc.fsf@gnu.org> <87k0y64p33.fsf@gnus.org> Date: Mon, 10 Aug 2020 15:20:12 +0200 In-Reply-To: <87k0y64p33.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 10 Aug 2020 15:17:52 +0200") Message-ID: <878sem4oz7.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > This was a year ago, so I did added the NEWS entry. I grepped through > the manuals for eval-expression to see whether the previous behaviour > was mentioned there (and would therefore need changing [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30697 Cc: 30697@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > This was a year ago, so I did added the NEWS entry. I grepped through > the manuals for eval-expression to see whether the previous behaviour > was mentioned there (and would therefore need changing), but I couldn't > find anything, so I didn't change anything. (I also ran a "make check", because there's a bunch of tests around this area, and it didn't introduce any regressions.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Mon Aug 18 14:23:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 08 Sep 2020 11:24:13 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator