From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#60130: [PATCH] ; * lisp/subr.el (internal--with-narrowing): Simplify Date: Fri, 16 Dec 2022 23:12:58 +0000 Message-ID: <87len70wp1.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32924"; mail-complaints-to="usenet@ciao.gmane.io" To: 60130@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 17 00:14:25 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 1p6JuK-0008Lf-Ne for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Dec 2022 00:14:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6Ju0-00073t-5t; Fri, 16 Dec 2022 18:14: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 1p6Jty-00073P-Tn for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 18:14: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 1p6Jty-0003SG-JC for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 18:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p6Jty-00083r-0c for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 18:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Dec 2022 23:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60130 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167123239130967 (code B ref -1); Fri, 16 Dec 2022 23:14:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Dec 2022 23:13:11 +0000 Original-Received: from localhost ([127.0.0.1]:52079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Jt8-00083P-Hy for submit@debbugs.gnu.org; Fri, 16 Dec 2022 18:13:10 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:35066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Jt4-00083J-Tu for submit@debbugs.gnu.org; Fri, 16 Dec 2022 18:13:09 -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 1p6Jt4-0006zG-Oy for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 18:13:06 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6Jt2-0003MC-65 for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 18:13:06 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E66D7240101 for ; Sat, 17 Dec 2022 00:12:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1671232380; bh=ZmdmA2VGtGY+kPx6tz541e4qL8piw9vL+2VFT+epmoo=; h=From:To:Subject:Date:From; b=KHVzZOpOhEd4B4AXykD0CZ6OknYBIwWP/fuf9uCex10wFEhlfLBZL7D9p/0DK5XWl LX5QFvaua07Td65oMwbNANA+KmUhoKDTlJVXCgRgX+wsSIQUaa1dDn2qVObWB6ZG15 7+YqDdIYVFsC9w1cPG7P8MwxTTb+A3SU/ZO0N2VtRhtldVmu/5IssGBpU4RW0VsOZC CKbfUGuWFMUMtr9RzQGxegviOIBTm1GsOid0tfex4dDFbk6/x42yPIXcFjYBY1PO8G XYkDjp3iWmrazyAM7xuHaPZRMNaGkSquJeeArlfsnDCKyCK6BYGF4xI8Pipv8sTSHx i8UEgM6xPuIkQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NYlJB0Mpdz6tmg for ; Sat, 17 Dec 2022 00:12:55 +0100 (CET) Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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:251244 Archived-At: --=-=-= Content-Type: text/plain Tags: patch I am not sure if I am missing something, but shouldn't the above patch be "simpler" and more idiomatic? In GNU Emacs 29.0.60 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.16.0) of 2022-12-14 built on quetzal Repository revision: 622838b957e240d700585050e9ddbd036e690513 Repository branch: emacs-29 System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure --with-pgtk --with-imagemagick' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-lisp-subr.el-internal-with-narrowing-Simplify.patch >From 1d2e59dfc56e10b4576f7ae7524abceb5e5b74c6 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sat, 17 Dec 2022 00:11:46 +0100 Subject: [PATCH] ; * lisp/subr.el (internal--with-narrowing): Simplify --- lisp/subr.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index e142eaa810..b21cce1669 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3956,10 +3956,9 @@ with-narrowing (defun internal--with-narrowing (start end body &optional tag) "Helper function for `with-narrowing', which see." (save-restriction - (progn - (narrow-to-region start end) - (if tag (narrowing-lock tag)) - (funcall body)))) + (narrow-to-region start end) + (when tag (narrowing-lock tag)) + (funcall body))) (defun find-tag-default-bounds () "Determine the boundaries of the default tag, based on text at point. -- 2.35.1 --=-=-=--