From: Alan Mackenzie Date: Wed, 17 Aug 2022 20:34:43 +0000 (+0000) Subject: * lisp/progmodes/cc-defs.el (c-safe-scan-lists): Evaluate LIMIT just once X-Git-Tag: emacs-29.0.90~1447^2~91 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f0c5de78394cb3155cf51f5946f25610e2ab5d0b;p=emacs.git * lisp/progmodes/cc-defs.el (c-safe-scan-lists): Evaluate LIMIT just once --- diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 04f519dd0a5..48ae4368a7c 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -794,15 +794,16 @@ right side of it." `(c-safe (scan-lists ,from ,count ,depth))))) (if limit `(save-restriction - (when ,limit - ,(if (numberp count) - (if (< count 0) - `(narrow-to-region ,limit (point-max)) - `(narrow-to-region (point-min) ,limit)) - `(if (< ,count 0) - (narrow-to-region ,limit (point-max)) - (narrow-to-region (point-min) ,limit)))) - ,res) + (let ((-limit- ,limit)) + (when -limit- + ,(if (numberp count) + (if (< count 0) + `(narrow-to-region -limit- (point-max)) + `(narrow-to-region (point-min) -limit-)) + `(if (< ,count 0) + (narrow-to-region -limit- (point-max)) + (narrow-to-region (point-min) -limit-)))) + ,res)) res)))