Subject: [PATCH] ; * lisp/subr.el (internal--with-narrowing): Simplify

From: Philip Kaludercic <[email-masked]>
Date: Fri, 16 Dec 2022 23:12:58 +0000

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'

>From 1d2e59dfc56e10b4576f7ae7524abceb5e5b74c6 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <[email-masked]>
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