GNU bug report logs - #25000
26.0.50; Ibuffer might compare marks case insensitively

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Wed, 23 Nov 2016 12:12:01 UTC

Severity: normal

Tags: patch

Found in version 26.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

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 25000 in the body.
You can then email your comments to 25000 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#25000; Package emacs. (Wed, 23 Nov 2016 12:12:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tino Calancha <tino.calancha <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 23 Nov 2016 12:12:02 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; Ibuffer might compare marks case insensitively
Date: Wed, 23 Nov 2016 21:11:21 +0900
In Ibuffer mark comparisons should be case _sensitive_.

emacs -Q:
;; eval following form:
(let ((case-fold-search t))
  (ibuffer)
  (ibuffer-mark-by-name-regexp "scratch")
  (ibuffer-change-marks ibuffer-marked-char ?L)
  (ibuffer-mark-by-name-regexp "Messages")
  (ibuffer-change-marks ibuffer-marked-char ?l)
  (null (cdr (ibuffer-buffer-names-with-mark ?l))))
=> nil
;; It doesn't distinguish between mark "L" and "l".


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From a6275e8e966c4f58e30f7aa3787557961385c6dc Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Wed, 23 Nov 2016 21:04:31 +0900
Subject: [PATCH] ibuffer: compare marks with EQ

* lisp/ibuffer (ibuffer-update-title-and-summary, ibuffer-redisplay-current)
(ibuffer-buffer-name-face, ibuffer-unmark-all)
(ibuffer-count-deletion-lines, ibuffer-buffer-names-with-mark):
Use 'eq' instead of 'char-equal' when comparing mark characters (Bug#25000).
---
 lisp/ibuffer.el | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 51d7cb9..4268be3 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1236,7 +1236,7 @@ ibuffer-buffer-names-with-mark
   (let ((ibuffer-buffer-names-with-mark-result nil))
     (ibuffer-map-lines-nomodify
      (lambda (buf mk)
-       (when (char-equal mark mk)
+       (when (eq mark mk)
 	 (push (buffer-name buf)
 	       ibuffer-buffer-names-with-mark-result))))
     ibuffer-buffer-names-with-mark-result))
@@ -1251,15 +1251,15 @@ ibuffer-count-marked-lines
   (if all
       (ibuffer-map-lines-nomodify
        (lambda (_buf mark)
-	 (not (char-equal mark ?\s))))
+	 (not (eq mark ?\s))))
     (ibuffer-map-lines-nomodify
      (lambda (_buf mark)
-       (char-equal mark ibuffer-marked-char)))))
+       (eq mark ibuffer-marked-char)))))
 
 (defsubst ibuffer-count-deletion-lines ()
   (ibuffer-map-lines-nomodify
    (lambda (_buf mark)
-     (char-equal mark ibuffer-deletion-char))))
+     (eq mark ibuffer-deletion-char))))
 
 (defsubst ibuffer-map-deletion-lines (func)
   (ibuffer-map-on-mark ibuffer-deletion-char func))
@@ -1338,26 +1338,26 @@ ibuffer-unmark-all
   (if (= (ibuffer-count-marked-lines t) 0)
       (message "No buffers marked; use 'm' to mark a buffer")
     (cond
-     ((char-equal mark ibuffer-marked-char)
+     ((eq mark ibuffer-marked-char)
       (ibuffer-map-marked-lines
        (lambda (_buf _mark)
 	 (ibuffer-set-mark-1 ?\s)
 	 t)))
-     ((char-equal mark ibuffer-deletion-char)
+     ((eq mark ibuffer-deletion-char)
       (ibuffer-map-deletion-lines
        (lambda (_buf _mark)
 	 (ibuffer-set-mark-1 ?\s)
 	 t)))
-     ((not (char-equal mark ?\r))
+     ((not (eq mark ?\r))
       (ibuffer-map-lines
        (lambda (_buf cmark)
-	 (when (char-equal cmark mark)
+	 (when (eq cmark mark)
 	   (ibuffer-set-mark-1 ?\s))
 	 t)))
      (t
       (ibuffer-map-lines
        (lambda (_buf mark)
-	 (when (not (char-equal mark ?\s))
+	 (when (not (eq mark ?\s))
 	   (ibuffer-set-mark-1 ?\s))
 	 t)))))
   (ibuffer-redisplay t))
@@ -1908,9 +1908,9 @@ ibuffer-format-column
       (_ (concat str left right)))))
 
 (defun ibuffer-buffer-name-face (buf mark)
-  (cond ((char-equal mark ibuffer-marked-char)
+  (cond ((eq mark ibuffer-marked-char)
 	 ibuffer-marked-face)
-	((char-equal mark ibuffer-deletion-char)
+	((eq mark ibuffer-deletion-char)
 	 ibuffer-deletion-face)
 	(t
 	 (let ((level -1)
@@ -1954,7 +1954,7 @@ ibuffer-redisplay-current
 (defun ibuffer-map-on-mark (mark func)
   (ibuffer-map-lines
    (lambda (buf mk)
-     (if (char-equal mark mk)
+     (if (eq mark mk)
 	 (funcall func buf mark)
        nil))))
 
@@ -2181,8 +2181,8 @@ ibuffer-update-title-and-summary
 		      (buffer-substring (point) (line-end-position)))))
 	   (apply #'insert (mapcar
 			    (lambda (c)
-			      (if (not (or (char-equal c ?\s)
-					   (char-equal c ?\n)))
+			      (if (not (or (eq c ?\s)
+					   (eq c ?\n)))
 				  ?-
 				?\s))
 			    str)))
-- 
2.10.2

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 26.0.50.7 (x86_64-pc-linux-gnu, GTK+ Version 3.22.3)
 of 2016-11-23 built on calancha-pc
Repository revision: c542fab20f53374dd0c71dce949ef370fc76fa48




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25000; Package emacs. (Wed, 23 Nov 2016 15:54:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 25000 <at> debbugs.gnu.org
Subject: Re: bug#25000: 26.0.50; Ibuffer might compare marks case insensitively
Date: Wed, 23 Nov 2016 17:53:11 +0200
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Wed, 23 Nov 2016 21:11:21 +0900
> 
> >From a6275e8e966c4f58e30f7aa3787557961385c6dc Mon Sep 17 00:00:00 2001
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Wed, 23 Nov 2016 21:04:31 +0900
> Subject: [PATCH] ibuffer: compare marks with EQ
> 
> * lisp/ibuffer (ibuffer-update-title-and-summary, ibuffer-redisplay-current)
> (ibuffer-buffer-name-face, ibuffer-unmark-all)
> (ibuffer-count-deletion-lines, ibuffer-buffer-names-with-mark):
> Use 'eq' instead of 'char-equal' when comparing mark characters (Bug#25000).
> ---
>  lisp/ibuffer.el | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)

Thanks, but please add a test for this.




Reply sent to Tino Calancha <tino.calancha <at> gmail.com>:
You have taken responsibility. (Wed, 07 Dec 2016 11:43:01 GMT) Full text and rfc822 format available.

Notification sent to Tino Calancha <tino.calancha <at> gmail.com>:
bug acknowledged by developer. (Wed, 07 Dec 2016 11:43:02 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 25000-done <at> debbugs.gnu.org
Subject: Re: bug#25000: 26.0.50; Ibuffer might compare marks case insensitively
Date: Wed, 07 Dec 2016 20:42:04 +0900
Eli Zaretskii <eliz <at> gnu.org> writes:

> Thanks, but please add a test for this.
Added test and pushed to master as commit 586867e




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

This bug report was last modified 7 years and 355 days ago.

Previous Next


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