GNU bug report logs - #60561
[PATCH] ; * lisp/simple.el: (and (>= ..) (<= ..)) refactor to (<= .. ..)

Previous Next

Package: emacs;

Reported by: Xi Lu <lx <at> shellcodes.org>

Date: Wed, 4 Jan 2023 21:28:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60561 in the body.
You can then email your comments to 60561 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#60561; Package emacs. (Wed, 04 Jan 2023 21:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Xi Lu <lx <at> shellcodes.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 04 Jan 2023 21:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Xi Lu <lx <at> shellcodes.org>
To: bug-gnu-emacs <at> gnu.org
Cc: Xi Lu <lx <at> shellcodes.org>
Subject: [PATCH] ;
 * lisp/simple.el: (and (>= ..) (<= ..)) refactor to (<= .. ..)
Date: Thu,  5 Jan 2023 05:27:03 +0800
---
 lisp/simple.el | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 63479e9ce0a..121ee8db87d 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3795,16 +3795,14 @@ undo-elt-in-region
 because markers can be arbitrarily relocated.  Instead, pass the
 marker adjustment's corresponding (TEXT . POS) element."
   (cond ((integerp undo-elt)
-	 (and (>= undo-elt start)
-	      (<= undo-elt end)))
+         (<= start undo-elt end))
 	((eq undo-elt nil)
 	 t)
 	((atom undo-elt)
 	 nil)
 	((stringp (car undo-elt))
 	 ;; (TEXT . POSITION)
-	 (and (>= (abs (cdr undo-elt)) start)
-	      (<= (abs (cdr undo-elt)) end)))
+	 (<= start (abs (cdr undo-elt)) end))
 	((and (consp undo-elt) (markerp (car undo-elt)))
 	 ;; (MARKER . ADJUSTMENT)
          (<= start (car undo-elt) end))
@@ -6419,7 +6417,7 @@ char-uppercase-p
 then gives correct answers only for ASCII characters."
   (cond ((unicode-property-table-internal 'lowercase)
          (characterp (get-char-code-property char 'lowercase)))
-        ((and (>= char ?A) (<= char ?Z)))))
+        ((<= ?A char ?Z))))
 
 (defun zap-to-char (arg char &optional interactive)
   "Kill up to and including ARGth occurrence of CHAR.
@@ -10039,8 +10037,7 @@ event-apply-modifier
 	    ((eq symbol 'shift)
              ;; FIXME: Should we also apply this "upcase" behavior of shift
              ;; to non-ascii letters?
-	     (if (and (<= (downcase event) ?z)
-		      (>= (downcase event) ?a))
+	     (if (<= ?a (downcase event) ?z)
 		 (upcase event)
 	       (logior (ash 1 lshiftby) event)))
 	    (t
-- 
2.39.0





Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 07 Jan 2023 09:11:02 GMT) Full text and rfc822 format available.

Notification sent to Xi Lu <lx <at> shellcodes.org>:
bug acknowledged by developer. (Sat, 07 Jan 2023 09:11:02 GMT) Full text and rfc822 format available.

Message #10 received at 60561-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Xi Lu <lx <at> shellcodes.org>
Cc: 60561-done <at> debbugs.gnu.org
Subject: Re: bug#60561: [PATCH] ;
 * lisp/simple.el: (and (>= ..) (<= ..)) refactor to (<= .. ..)
Date: Sat, 07 Jan 2023 11:10:50 +0200
> Cc: Xi Lu <lx <at> shellcodes.org>
> From: Xi Lu <lx <at> shellcodes.org>
> Date: Thu,  5 Jan 2023 05:27:03 +0800
> 
> ---
>  lisp/simple.el | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)

Thanks, installed on master, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 04 Feb 2023 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.