From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#59350: 29.0.50; Eval region or buffer Date: Fri, 18 Nov 2022 09:44:39 +0200 Organization: LINKOV.NET Message-ID: <86y1s8btaw.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10260"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) To: 59350@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 18 08:47:15 2022 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 1ovw5i-0002WI-9G for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Nov 2022 08:47:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovw5Y-00077A-Ef; Fri, 18 Nov 2022 02:47:04 -0500 Original-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 1ovw5W-00076l-Je for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 02:47:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovw5W-0000UO-AZ for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 02:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovw5W-0004Mq-6e for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 02:47: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: Fri, 18 Nov 2022 07:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59350 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166875758816741 (code B ref -1); Fri, 18 Nov 2022 07:47:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Nov 2022 07:46:28 +0000 Original-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 Original-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 Original-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 Original-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 Original-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) 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-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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248177 Archived-At: '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. ```