From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 02:46:27 2022 Received: (at submit) by debbugs.gnu.org; 18 Nov 2022 07:46:28 +0000 Received: from localhost ([127.0.0.1]:35153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovw4x-0004Lx-Mw for submit@debbugs.gnu.org; Fri, 18 Nov 2022 02:46:27 -0500 Received: from lists.gnu.org ([209.51.188.17]:53652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovw4t-0004Lo-OB for submit@debbugs.gnu.org; Fri, 18 Nov 2022 02:46:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovw4p-0006xQ-Og for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 02:46:23 -0500 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovw4n-0000MJ-7d for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 02:46:19 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 330E81BF208 for ; Fri, 18 Nov 2022 07:46:11 +0000 (UTC) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: 29.0.50; Eval region or buffer Organization: LINKOV.NET Date: Fri, 18 Nov 2022 09:44:39 +0200 Message-ID: <86y1s8btaw.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:4b98:dc4:8::228; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) 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: -2.6 (--) 'elisp-eval-buffer' is a nice new command that evaluates the current buffer with a convenient keybinding 'C-c C-e'. It would be nicer also to react on the currently active region: ``` diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 6bdaa7a37a..9b8a66c243 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -2213,10 +2213,14 @@ elisp-flymake--batch-compile-for-flymake (pp collected))) (defun elisp-eval-buffer () - "Evaluate the forms in the current buffer." + "Evaluate the forms in the active region or the whole current buffer." (interactive) - (eval-buffer) - (message "Evaluated the %s buffer" (buffer-name))) + (if (use-region-p) + (eval-region (region-beginning) (region-end)) + (eval-buffer)) + (message "Evaluated the %s%s buffer" + (if (use-region-p) "region in the " "") + (buffer-name))) (defun elisp-byte-compile-file (&optional load) "Byte compile the file the current buffer is visiting. ``` From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 03:50:07 2022 Received: (at 59350) by debbugs.gnu.org; 18 Nov 2022 08:50:07 +0000 Received: from localhost ([127.0.0.1]:35234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovx4Z-00066l-4d for submit@debbugs.gnu.org; Fri, 18 Nov 2022 03:50:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovx4V-000668-0x for 59350@debbugs.gnu.org; Fri, 18 Nov 2022 03:50:05 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovx4P-0001Kv-KE; Fri, 18 Nov 2022 03:49:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=b0jDkTWATXUhQmzHg8wUEAhKyBf6gHpsjqVqIpttIuY=; b=mg2yMx1a9vFs O/KlBaasCLFzKSnPOPtB36n0vk0TC85rKb2FAfOUzkfVRkNQ/k9/ha+bNhKkl8zk59pWXlp68jP5a kSATfJa/5YiAdZ1HbXX23lMCPoufJ3uxp2SDc8/nkFXnmiMyn37uuALi4Te0L75SjxbxuoEvZNk4v TU6nj2+hmNrWXVMx5LizOu6w//9oV4tnmDJRBtYVip6cRMSXc8/mARUqBO1ufxKzZVAVYcO4ENmGu 9eZ9cRiej0K5/Ryhv2vW09gf4m2uA2rAf0/shPuLTFiEfLP0pQrlEZpzV0ktuVGO82EZUosc8jzKm xVQ/OddHU4F+wnSKR+NQ+A==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovx4D-0003LI-3O; Fri, 18 Nov 2022 03:49:56 -0500 Date: Fri, 18 Nov 2022 10:49:49 +0200 Message-Id: <83sfigbqaa.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <86y1s8btaw.fsf@mail.linkov.net> (message from Juri Linkov on Fri, 18 Nov 2022 09:44:39 +0200) Subject: Re: bug#59350: 29.0.50; Eval region or buffer References: <86y1s8btaw.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59350 Cc: 59350@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: -3.3 (---) > From: Juri Linkov > Date: Fri, 18 Nov 2022 09:44:39 +0200 > > 'elisp-eval-buffer' is a nice new command that evaluates the current buffer > with a convenient keybinding 'C-c C-e'. It would be nicer also to react on > the currently active region: That'd be confusing, IMO, given that the command says "buffer" in its name. We usually do this the other way around: eval-region should work on the entire accessible portion of the buffer if the mark is not set. But note that eval-region doesn't need the region to be active, so there be dragons. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 11:48:23 2022 Received: (at 59350) by debbugs.gnu.org; 18 Nov 2022 16:48:23 +0000 Received: from localhost ([127.0.0.1]:38097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow4XP-0001AQ-Id for submit@debbugs.gnu.org; Fri, 18 Nov 2022 11:48:23 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:46482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow4XK-0001A8-QL for 59350@debbugs.gnu.org; Fri, 18 Nov 2022 11:48:21 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AIGTH9g027053; Fri, 18 Nov 2022 16:48:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=mqSwHVLtCWGzvho3qcAP2uQ9dkP4JQL9jTxac7Lx+y8=; b=FAJjofs8Ib+P3Zk0ZeuUCLj2v83MDeK7Y7QJoUtM09Q3o7S1qPkVbrwgCCQEakJl87Ge aK5eUCPHeFBXa3R5UGNHkgZnZW+kU8R167IQ4ffvL3QbTKIrejifOMCIDusVuiNIM36Q Z4Tm2oEnfAb0Hl3JCCyS1Vyaalpy8G1vYdK+/gC8UorZoED+akd3jpr5K7bUXiI9DLNO gWPor1P3qIMSRnpCKzzFXmUqw/nqq48fKyQpzvK9M/kvg9+X3CJP+8lX1sIpV21DbJn9 eQSMwk9LXfcC3J/00K89I8cfT99bZll42nmgnpsMlI0pT9Gi1EsnIS7Fhwamr3IiGzuQ kA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kx7kjh6fr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Nov 2022 16:48:17 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2AIFDJn2001687; Fri, 18 Nov 2022 16:48:13 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2174.outbound.protection.outlook.com [104.47.57.174]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ku3kbp9vn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Nov 2022 16:48:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J/c5HlJ3v4PLsbWgx0weB11GOp6bQfhXVb42GakxDzo8Jqx2vhS1lIUchGOcNMlGNR/LP1H8UoZsaK7Oge5+HQCIJuwk1AyeSY/35L2LebHltQuLzGZ42dTHFwhkwZkHaKk+Fmvm8IVa1+46Rx9qjPKb1VkdoBVaCm3DKrRsAt5sKh/9VndxJV5MUtcTqzpu4/LS1kRaUnIR3rucv1F272jFLzr875+7MBfS11Gaycq13FTWtiKrQChARvwZTOY6RPKOPpIJpn10n7GAYZLBVAsFc91Qe3GgOfGcdz/BJ8R83F/aB3OAWNLg1uV+IIBZEGEa8vAVm58Yk+9Q5nsAkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mqSwHVLtCWGzvho3qcAP2uQ9dkP4JQL9jTxac7Lx+y8=; b=jviGJpWMucBzCay5Rj4DiXXMuOkx7PWKR3Uyaq5PqdQPdD6X3KX1lQgv1BHSeE0a8zQqFicR6naA2ZBL7iWGF+OfVJeZHkVy83xA76rkBFEGsbaeJ+5v1Yw8hQl2gcxYvDsaY2FiNX9FA3R2jtHC02rhBPP2YqYq1MkvWaVGkFwRDyAHC8EzHHt7oLypKE+AasngEwkn6PIETyeuPPjD6D/K16K7j2Ud4Geg8DD9pOBBjCFWDsxu/gRs1VC9Xh6ScPYwfwHzf2eHZK0F+S5Cc6wDbI8nEIy6DzM6Eb00wZ9tlPDi1xZbyPFOkvfKLU403C3wPJHQIcOS3FgI1hlEeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mqSwHVLtCWGzvho3qcAP2uQ9dkP4JQL9jTxac7Lx+y8=; b=PON3vYPqQSuBCOY3dU89A0y618T5rQw5QfOfYINBBlAacOdu4k2H98VjyGlZ07j81zcBxc8Qzpp1N9PfUbtmQGTgz9NE7CS+7Hjse1SRhCM2HkLRLr9eFEv9Dx+XJDc3/zRra6faK5QeICIxP6NtmzBJoLUA8U6zEtG/SlscvVk= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by CH0PR10MB5308.namprd10.prod.outlook.com (2603:10b6:610:c6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.20; Fri, 18 Nov 2022 16:48:11 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::6951:297b:f3d5:2588]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::6951:297b:f3d5:2588%9]) with mapi id 15.20.5834.009; Fri, 18 Nov 2022 16:48:11 +0000 From: Drew Adams To: Juri Linkov , "59350@debbugs.gnu.org" <59350@debbugs.gnu.org> Subject: RE: [External] : bug#59350: 29.0.50; Eval region or buffer Thread-Topic: [External] : bug#59350: 29.0.50; Eval region or buffer Thread-Index: AQHY+yH/CFc0Sq5Q2U+O9/a/PlEl765E4Y1Q Date: Fri, 18 Nov 2022 16:48:11 +0000 Message-ID: References: <86y1s8btaw.fsf@mail.linkov.net> In-Reply-To: <86y1s8btaw.fsf@mail.linkov.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|CH0PR10MB5308:EE_ x-ms-office365-filtering-correlation-id: c6fbc835-73e8-40a5-154a-08dac984adc2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oETPmHxb9zZKnzCnequCbsD4Q3NfkKuhcSd0ktfwpLnrw3nn4G6HQnrZ62yCOMCLLQSbaRHfMXzDH/mgag4GM5uGYuYp2BbOdQ9k1E71CORW/AT6toQK5iGO+cAsADdhFihPasHf1sdcSaTgLKwSLneqs5i5q7A6AAMjduhEliied/ABypmc8zMBeS6imGmSvmobRKbq/2QMUZZ1sqqe6aLGP4eXfQZNVoPGeW6ocE6V4eqlMsS+LV9s2CxUbVjfRFWmlmrhdU9Tbjf2dMMK/xhB3W/ap/kTsY/o/RIJWDKbXxUIzAcvJqSknGEnCEHVrmOdvV5V05eO9lw5vmquTclgqj/rwzmPA/ZAalNTdJBgyO2eL9euhaf5zjTwFbCERr9jTAub3KfgjNf4JlN9nitoH9f5saZdEf0ETKlhmDf/Fp6vV8apKdTHyOB5GJvCr262Ut4FF1wI6w67ykCau4/+x7AGvOd+lfwz51KEEiDfmmcWMXjphxij4AifQxrZBO2w2Oj6tgyGC4O0E6So9gRiALqIYLXHf0xPWssZPkThIW1UazSOndJQi2YOFwc5IgoN4rfW9u8PLC3ld1HIt5yrTxc+WoF+fE/bi+YXF80Vv8CX+ucUFnJctv3dMr273kp5bpLJeZcV7EoaK6g5Hm8NuXwKTL6y6InNeaAzacPBwYwx9jJfQFuR9Cy+scSicggnQEm1ddjK6bT1aEHmBQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199015)(478600001)(71200400001)(41300700001)(8936002)(52536014)(66946007)(66476007)(66556008)(8676002)(76116006)(9686003)(26005)(66446008)(5660300002)(186003)(44832011)(316002)(110136005)(6506007)(7696005)(33656002)(64756008)(83380400001)(2906002)(86362001)(55016003)(122000001)(38100700002)(38070700005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?JEx4rB6CBjThxRlJxus9F/VjRaij+86CmLE6oMIt1LBilKGOn2HtTTzf2sAw?= =?us-ascii?Q?tNHngqttCdi/roAupHSE8FJHLfjbqciohaWXfsj6tigVw4RhxJr8pOATJMeM?= =?us-ascii?Q?5v11k+J4+KbL2Mb+NyNi7GezKXOL8ebAMouEbqEbGwCiHnpNHI5S1gIMSWgV?= =?us-ascii?Q?zVzk6yvEYFPQQxGj8xxk0ZIclUlfuz1pP2h9v49es04BYXnKlJRgw/AHXuaU?= =?us-ascii?Q?9R/cs529eKa/DvnZ34KHwRAosUNaTXw8p/Z0WRMQmBskoCJM0x/RZxuOkRXE?= =?us-ascii?Q?J2ZP2dh3Q+9R7Ns152ShE00uC+xmgKJFittjHHnlAvo0oszJ43cQC8E2ph/j?= =?us-ascii?Q?PVOROmAyex7wh/JdJNF5w17lnbe6Ea41FrQhs7vrER4HRUE4jTU44Qlcl8wg?= =?us-ascii?Q?j1ZWp84waf1U8WO4B7pHN8X0LHQnYT4hJ/ha7eAm0v2raNlDVuG984JtdXJe?= =?us-ascii?Q?xBBnCDPKAkf3I0VR+doePljNM0V49FzsrrfkBoLj8VK/MZTICB368hf71CGj?= =?us-ascii?Q?gh1iZfzYP/85jnT8WZYvJHHJdMBMoal/x8gENe8gT2hXZQTDMPlTu72Uf/+7?= =?us-ascii?Q?fZnrcOL9AMuKvHI2lw8IhlACoslp/J8pnoFLx0XXxeqdSQcojdiZ9Vjoh6V3?= =?us-ascii?Q?RyNDDpcOOV5OD29XFa4puMhBH68SWLGtixcdBrmFGs13DnaY55ytNEhVKMEp?= =?us-ascii?Q?2YamY0ZEPNtb2UXSh7/PK178epuaPWGbSYVjRRf5lN0q0NXgLbhYB0gZDc+W?= =?us-ascii?Q?D/7mi2qJ5zKWuWX021jT/0FwxsEkGNpXLleUb3FEkBPDaMqJVegX7V0FBuJ8?= =?us-ascii?Q?Mx5WxC49JaXHDaYzQa74PpCO2HWXJBAuPeGlrj8vtDgFnZt+SjZY9Hxkregd?= =?us-ascii?Q?8HHmYZ5LpFug01FCmKPlXUJ/RiUcGzJDWJsK3lsEMP9uhYTACpr88rKkNNbI?= =?us-ascii?Q?NjT8t6Pg1lNW++naMNV+0YfuNMHAM6Y067f4ML5CV0TtzFfYdb6AHG5tb1Fh?= =?us-ascii?Q?ag0Dx1bz1h/QWHZy1gNzybVDiLr71OF1c6aYj6xI/akyWYe4wWQJPcvYLpwA?= =?us-ascii?Q?TMmCtyfkrn5hJ+RYG+GdAma1eLn3wNmc0jCCQGzzGyJVHc1jsPYkj7QHVx55?= =?us-ascii?Q?Y8orqwrQJ6vQ8meEurY9jZKwXQ3mAovVG8twibrhDe/LKfq/aekqFqszQURj?= =?us-ascii?Q?V301+L2ZBNEEnlD1LazwXpwQdO5qrCGVgTqRC+9zdrWtDXhrCY1pokZsEeeA?= =?us-ascii?Q?1YFOOpS3sL4OJP2K/NG92Oispx/eDrXhUIyjWv0AmZNrYj6Y4SeXWOECZslu?= =?us-ascii?Q?CQas5e22YZ/4IJri95ZKfgDGPmlln0qetxST1HyGPR487PZlCXAYS9ECJiY7?= =?us-ascii?Q?ybofP1PexdgTiVCOWTkTrdxomQaLtMMt/pH3Y+L5hf577F1GNaEfGyRT9cgi?= =?us-ascii?Q?QfRWqzJ1P+Z06gfAmwCxDEsn6tr5Io78V/JQlIzj62zAumyKvVwY3Mv23MrE?= =?us-ascii?Q?NV9hNmJADDALyc7geIecADvGEuG9v6LjEytClZvb7UG2R3mEDzPRX81hfHT7?= =?us-ascii?Q?ekfxuBC1MLKgQfXtizpjFe0Lkem7oatqdDPtlWvy?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: yTp6Wy/XL9CRDPC7peLiTcg9+PMtZkIOtCp21PxHXm1nRU5JpZgRH2NGXIiQX7ma1Gqa1QVO3h4qjfrW9WppPxVj6MTQWMwHvBNOs8XpKNUcbS9l54pXnSLJfeTqhe4yCCEy5u4FgCU6nYmdlJ0MxiOf4lP8OBGBUJciaJFZxU9qqdefWIla2pVf3Ku+5MK+QqBOaevHuNOgA7FkZ4HlEG6YpEAf2oDqXz0QpwqFJvEbM1T9eOdACn84FFpyOakJrJ6qD/QfyOGUEDrrpbc3qK/iwRq4GsEiBpNX8HZDhFXu6uk3nSRZZzn6o11uQlLn/NDD10+9rPIIyCBAGefwLfT+rczb2rLxDm/mf4J5/xVjGk3GBhKUrvzSzGztB9Gqgs5VByPUDITrHjhoASZjpx1u0rtCjP3Igj0UQCZpq8V3uFIiL2xUp09ODV71wMzPKBohS/iw2pJZ4oh9kWkXa0Xaw72SClbcIwJ6nanIJ2xRATXtL6J/ktMjsI8OMd+83nn7WjGl+fykgWe3hli/gd2iURvzr2gvBDn1rTZBScNKFTcRtFkIXRn6s97JqESCUt2xTrgcNIvRlWefXLYummiA3oKdm8i+g6um1Y/w/JHAxAT77FsRhoB7yQljIel0ibtjlWvvGL3xs/Bz7uvqQHzw3j5zE9Tlj/G8zuri8XhA75rMI2ZLOAMnj2lr0HrC5L/eFb91jfXkSozT4/K8REdsU/wrgiyzAXKKQXFPEKi4Zj2Wx3xzOFM+poHb5al82bbFU/aHI4F2XjYpAecJcqR4mCaYThrUkoLW8hsrPP8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6fbc835-73e8-40a5-154a-08dac984adc2 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Nov 2022 16:48:11.4077 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: L+OGK9X7ygmD5lsjXJ0jKojhBbHS4SgyJODAk0w7RYbQbk0orbMjhXby6/iDeya2D+zCtQdSN5KeFfCQyp26Fg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5308 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-18_04,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 phishscore=0 malwarescore=0 suspectscore=0 mlxlogscore=961 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211180098 X-Proofpoint-GUID: xd0D8ZF7n9t1Lg6W4ezm9xg8YNCeyBvT X-Proofpoint-ORIG-GUID: xd0D8ZF7n9t1Lg6W4ezm9xg8YNCeyBvT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 59350 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.7 (-) > 'elisp-eval-buffer' is a nice new command that evaluates the current > buffer with a convenient keybinding 'C-c C-e'. It would be nicer also to= react > on the currently active region: I think the more usual (conventional?) naming is to name the function "*-region", not "*-buffer", and to have the doc string say that if the region isn't active (or isn't active and nonempty, or whatever) then the limits used are `point-min' and `point-max' (IOW, the possibly-restricted buffer). The region case is more general (arbitrary limits), even if it's more particular if applied only when active (and maybe nonempty). Another usual (conventional?) naming, depending on the context, can be just `*', explaining in the doc string that the function applies to the region if active (or...), and otherwise to the buffer. Commands named `*-buffer' tend to act on the full buffer (possibly restricted by narrowing), whether or not the region is active. I don't claim this is a rule, but I think it's fairly common practice. It's also fairly common to have separate commands - or at least functions - for the region and the buffer. (I could be wrong.) From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 19 14:16:10 2022 Received: (at 59350) by debbugs.gnu.org; 19 Nov 2022 19:16:10 +0000 Received: from localhost ([127.0.0.1]:41445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owTJx-0006Pq-TY for submit@debbugs.gnu.org; Sat, 19 Nov 2022 14:16:10 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:54449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owTJe-0006LO-7Y for 59350@debbugs.gnu.org; Sat, 19 Nov 2022 14:15:50 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 9BC39FF802; Sat, 19 Nov 2022 19:15:42 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#59350: 29.0.50; Eval region or buffer In-Reply-To: <83sfigbqaa.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Nov 2022 10:49:49 +0200") Organization: LINKOV.NET References: <86y1s8btaw.fsf@mail.linkov.net> <83sfigbqaa.fsf@gnu.org> Date: Sat, 19 Nov 2022 20:59:19 +0200 Message-ID: <867czqahyw.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 59350 Cc: 59350@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.7 (-) >> 'elisp-eval-buffer' is a nice new command that evaluates the current buffer >> with a convenient keybinding 'C-c C-e'. It would be nicer also to react on >> the currently active region: > > That'd be confusing, IMO, given that the command says "buffer" in its > name. We usually do this the other way around: eval-region should > work on the entire accessible portion of the buffer if the mark is not > set. But note that eval-region doesn't need the region to be active, > so there be dragons. Maybe then better to rename it to 'elisp-eval-region-or-buffer', then explain in the docstring it's for Transient Mark only. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 19 14:43:11 2022 Received: (at 59350) by debbugs.gnu.org; 19 Nov 2022 19:43:11 +0000 Received: from localhost ([127.0.0.1]:41479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owTk6-00073P-S7 for submit@debbugs.gnu.org; Sat, 19 Nov 2022 14:43:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owTk5-00073D-Ha for 59350@debbugs.gnu.org; Sat, 19 Nov 2022 14:43:09 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owTk0-0002IK-8p; Sat, 19 Nov 2022 14:43:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=eIZ70Py63XdQfujD0nJVMt8G1a15WD+tJPm505TODBE=; b=ckpaHyD69dNh aCurx//LpzcpBMYtPIwfrszKSraMSOsksDGDtFz05euy4Y3pMk4FVhddgM63JhnCik0vdwvMpThAg Zyb2lvdR3KXciFqcX4mArz/Ts3rH9ZaLRI8TaB220QQwKaCxEcY2PNMo54BMgEbmS559lMwpeqdmr aIpsY+vx20mBnjdbNeHMHpXSg09Tp9+wAHkZGvuYMWcHl+FT32MVMUQHSubaM/PogmxM7q/mRzhBd V+rMcD21BVxmYS+Xx7sCOvGaqqKKqo/D5hMlWEFd0BH3mkPu9TnW0dDGjYLBvUw18EaUV+f2am1sM /XI4GNZO2lqE3T90h10SkQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owTjz-0007Tp-OD; Sat, 19 Nov 2022 14:43:04 -0500 Date: Sat, 19 Nov 2022 21:43:11 +0200 Message-Id: <83o7t27msw.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <867czqahyw.fsf@mail.linkov.net> (message from Juri Linkov on Sat, 19 Nov 2022 20:59:19 +0200) Subject: Re: bug#59350: 29.0.50; Eval region or buffer References: <86y1s8btaw.fsf@mail.linkov.net> <83sfigbqaa.fsf@gnu.org> <867czqahyw.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59350 Cc: 59350@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: -3.3 (---) > From: Juri Linkov > Cc: 59350@debbugs.gnu.org > Date: Sat, 19 Nov 2022 20:59:19 +0200 > > >> 'elisp-eval-buffer' is a nice new command that evaluates the current buffer > >> with a convenient keybinding 'C-c C-e'. It would be nicer also to react on > >> the currently active region: > > > > That'd be confusing, IMO, given that the command says "buffer" in its > > name. We usually do this the other way around: eval-region should > > work on the entire accessible portion of the buffer if the mark is not > > set. But note that eval-region doesn't need the region to be active, > > so there be dragons. > > Maybe then better to rename it to 'elisp-eval-region-or-buffer', > then explain in the docstring it's for Transient Mark only. Rename elisp-eval-buffer, you mean? That's a possibility, yes. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 20 03:29:10 2022 Received: (at 59350) by debbugs.gnu.org; 20 Nov 2022 08:29:10 +0000 Received: from localhost ([127.0.0.1]:42313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owfhO-00030e-BX for submit@debbugs.gnu.org; Sun, 20 Nov 2022 03:29:10 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:55853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owfhI-000303-AP for 59350@debbugs.gnu.org; Sun, 20 Nov 2022 03:29:09 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 2108340008; Sun, 20 Nov 2022 08:28:54 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#59350: 29.0.50; Eval region or buffer In-Reply-To: <83o7t27msw.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Nov 2022 21:43:11 +0200") Organization: LINKOV.NET References: <86y1s8btaw.fsf@mail.linkov.net> <83sfigbqaa.fsf@gnu.org> <867czqahyw.fsf@mail.linkov.net> <83o7t27msw.fsf@gnu.org> Date: Sun, 20 Nov 2022 10:17:20 +0200 Message-ID: <86a64mxcof.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 59350 Cc: 59350@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.7 (-) --=-=-= Content-Type: text/plain >> Maybe then better to rename it to 'elisp-eval-region-or-buffer', >> then explain in the docstring it's for Transient Mark only. > > Rename elisp-eval-buffer, you mean? That's a possibility, yes. This patch renames elisp-eval-buffer: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=elisp-eval-region-or-buffer.patch diff --git a/etc/NEWS b/etc/NEWS index 8a34afe8d2..9345cb06f5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1464,8 +1464,8 @@ This command visits the file on the current line with EWW. ** Elisp --- -*** New command 'elisp-eval-buffer' (bound to 'C-c C-e'). -This command evals the forms in the current buffer. +*** New command 'elisp-eval-region-or-buffer' (bound to 'C-c C-e'). +This command evals the forms in the active region or in the whole buffer. --- *** New commands 'elisp-byte-compile-file' and 'elisp-byte-compile-buffer'. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 44c8ca7cb9..7c470de195 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -52,7 +52,7 @@ emacs-lisp-mode-map :parent lisp-mode-shared-map "M-TAB" #'completion-at-point "C-M-x" #'eval-defun - "C-c C-e" #'elisp-eval-buffer + "C-c C-e" #'elisp-eval-region-or-buffer "C-c C-f" #'elisp-byte-compile-file "C-c C-b" #'elisp-byte-compile-buffer "C-M-q" #'indent-pp-sexp) @@ -1234,7 +1234,7 @@ lisp-interaction-mode-map :parent lisp-mode-shared-map "C-M-x" #'eval-defun "C-M-q" #'indent-pp-sexp - "C-c C-e" #'elisp-eval-buffer + "C-c C-e" #'elisp-eval-region-or-buffer "C-c C-b" #'elisp-byte-compile-buffer "M-TAB" #'completion-at-point "C-j" #'eval-print-last-sexp) @@ -2212,11 +2212,17 @@ elisp-flymake--batch-compile-for-flymake (terpri) (pp collected))) -(defun elisp-eval-buffer () - "Evaluate the forms in the current buffer." +(defun elisp-eval-region-or-buffer () + "Evaluate the forms in the active region or the whole current buffer. +In Transient Mark mode when the mark is active, call `eval-region'. +Otherwise, call `eval-buffer'." (interactive) - (eval-buffer) - (message "Evaluated the %s buffer" (buffer-name))) + (if (use-region-p) + (eval-region (region-beginning) (region-end)) + (eval-buffer)) + (message "Evaluated the %s%s buffer" + (if (use-region-p) "region in the " "") + (buffer-name))) (defun elisp-byte-compile-file (&optional load) "Byte compile the file the current buffer is visiting. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 20 13:11:40 2022 Received: (at 59350-done) by debbugs.gnu.org; 20 Nov 2022 18:11:40 +0000 Received: from localhost ([127.0.0.1]:44565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owon6-0005zj-2n for submit@debbugs.gnu.org; Sun, 20 Nov 2022 13:11:40 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:37207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owon3-0005zT-HR for 59350-done@debbugs.gnu.org; Sun, 20 Nov 2022 13:11:38 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id DB667240002; Sun, 20 Nov 2022 18:11:29 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#59350: 29.0.50; Eval region or buffer In-Reply-To: <86a64mxcof.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 20 Nov 2022 10:17:20 +0200") Organization: LINKOV.NET References: <86y1s8btaw.fsf@mail.linkov.net> <83sfigbqaa.fsf@gnu.org> <867czqahyw.fsf@mail.linkov.net> <83o7t27msw.fsf@gnu.org> <86a64mxcof.fsf@mail.linkov.net> Date: Sun, 20 Nov 2022 20:11:16 +0200 Message-ID: <86cz9hv6m3.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 59350-done Cc: 59350-done@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.7 (-) >>> Maybe then better to rename it to 'elisp-eval-region-or-buffer', >>> then explain in the docstring it's for Transient Mark only. >> >> Rename elisp-eval-buffer, you mean? That's a possibility, yes. > > This patch renames elisp-eval-buffer: The renamed command is pushed now, and closed. From unknown Fri Sep 05 18:47:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 19 Dec 2022 12:24:09 +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