diff options
| author | Tino Calancha | 2016-12-07 20:37:01 +0900 |
|---|---|---|
| committer | Tino Calancha | 2016-12-07 20:37:01 +0900 |
| commit | 586867e6815d6e43bfaa4191bc62de60c00fbce3 (patch) | |
| tree | 749cc9406e62cebe76f88d262db07176b80175aa | |
| parent | 20f5a5b386db878e69a4b6be565dc06d06b46ffd (diff) | |
| download | emacs-586867e6815d6e43bfaa4191bc62de60c00fbce3.tar.gz emacs-586867e6815d6e43bfaa4191bc62de60c00fbce3.zip | |
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).
* test/lisp/ibuffer-tests.el (ibuffer-test-Bug25000):
Update test result as pass.
| -rw-r--r-- | lisp/ibuffer.el | 28 | ||||
| -rw-r--r-- | test/lisp/ibuffer-tests.el | 1 |
2 files changed, 14 insertions, 15 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 16fbf5799ff..8898afd4fbf 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -1240,7 +1240,7 @@ a new window in the current frame, splitting vertically." | |||
| 1240 | (let ((ibuffer-buffer-names-with-mark-result nil)) | 1240 | (let ((ibuffer-buffer-names-with-mark-result nil)) |
| 1241 | (ibuffer-map-lines-nomodify | 1241 | (ibuffer-map-lines-nomodify |
| 1242 | (lambda (buf mk) | 1242 | (lambda (buf mk) |
| 1243 | (when (char-equal mark mk) | 1243 | (when (eq mark mk) |
| 1244 | (push (buffer-name buf) | 1244 | (push (buffer-name buf) |
| 1245 | ibuffer-buffer-names-with-mark-result)))) | 1245 | ibuffer-buffer-names-with-mark-result)))) |
| 1246 | ibuffer-buffer-names-with-mark-result)) | 1246 | ibuffer-buffer-names-with-mark-result)) |
| @@ -1255,15 +1255,15 @@ a new window in the current frame, splitting vertically." | |||
| 1255 | (if all | 1255 | (if all |
| 1256 | (ibuffer-map-lines-nomodify | 1256 | (ibuffer-map-lines-nomodify |
| 1257 | (lambda (_buf mark) | 1257 | (lambda (_buf mark) |
| 1258 | (not (char-equal mark ?\s)))) | 1258 | (not (eq mark ?\s)))) |
| 1259 | (ibuffer-map-lines-nomodify | 1259 | (ibuffer-map-lines-nomodify |
| 1260 | (lambda (_buf mark) | 1260 | (lambda (_buf mark) |
| 1261 | (char-equal mark ibuffer-marked-char))))) | 1261 | (eq mark ibuffer-marked-char))))) |
| 1262 | 1262 | ||
| 1263 | (defsubst ibuffer-count-deletion-lines () | 1263 | (defsubst ibuffer-count-deletion-lines () |
| 1264 | (ibuffer-map-lines-nomodify | 1264 | (ibuffer-map-lines-nomodify |
| 1265 | (lambda (_buf mark) | 1265 | (lambda (_buf mark) |
| 1266 | (char-equal mark ibuffer-deletion-char)))) | 1266 | (eq mark ibuffer-deletion-char)))) |
| 1267 | 1267 | ||
| 1268 | (defsubst ibuffer-map-deletion-lines (func) | 1268 | (defsubst ibuffer-map-deletion-lines (func) |
| 1269 | (ibuffer-map-on-mark ibuffer-deletion-char func)) | 1269 | (ibuffer-map-on-mark ibuffer-deletion-char func)) |
| @@ -1342,26 +1342,26 @@ Otherwise, toggle read only status." | |||
| 1342 | (if (= (ibuffer-count-marked-lines t) 0) | 1342 | (if (= (ibuffer-count-marked-lines t) 0) |
| 1343 | (message "No buffers marked; use 'm' to mark a buffer") | 1343 | (message "No buffers marked; use 'm' to mark a buffer") |
| 1344 | (cond | 1344 | (cond |
| 1345 | ((char-equal mark ibuffer-marked-char) | 1345 | ((eq mark ibuffer-marked-char) |
| 1346 | (ibuffer-map-marked-lines | 1346 | (ibuffer-map-marked-lines |
| 1347 | (lambda (_buf _mark) | 1347 | (lambda (_buf _mark) |
| 1348 | (ibuffer-set-mark-1 ?\s) | 1348 | (ibuffer-set-mark-1 ?\s) |
| 1349 | t))) | 1349 | t))) |
| 1350 | ((char-equal mark ibuffer-deletion-char) | 1350 | ((eq mark ibuffer-deletion-char) |
| 1351 | (ibuffer-map-deletion-lines | 1351 | (ibuffer-map-deletion-lines |
| 1352 | (lambda (_buf _mark) | 1352 | (lambda (_buf _mark) |
| 1353 | (ibuffer-set-mark-1 ?\s) | 1353 | (ibuffer-set-mark-1 ?\s) |
| 1354 | t))) | 1354 | t))) |
| 1355 | ((not (char-equal mark ?\r)) | 1355 | ((not (eq mark ?\r)) |
| 1356 | (ibuffer-map-lines | 1356 | (ibuffer-map-lines |
| 1357 | (lambda (_buf cmark) | 1357 | (lambda (_buf cmark) |
| 1358 | (when (char-equal cmark mark) | 1358 | (when (eq cmark mark) |
| 1359 | (ibuffer-set-mark-1 ?\s)) | 1359 | (ibuffer-set-mark-1 ?\s)) |
| 1360 | t))) | 1360 | t))) |
| 1361 | (t | 1361 | (t |
| 1362 | (ibuffer-map-lines | 1362 | (ibuffer-map-lines |
| 1363 | (lambda (_buf mark) | 1363 | (lambda (_buf mark) |
| 1364 | (when (not (char-equal mark ?\s)) | 1364 | (when (not (eq mark ?\s)) |
| 1365 | (ibuffer-set-mark-1 ?\s)) | 1365 | (ibuffer-set-mark-1 ?\s)) |
| 1366 | t))))) | 1366 | t))))) |
| 1367 | (ibuffer-redisplay t)) | 1367 | (ibuffer-redisplay t)) |
| @@ -1912,9 +1912,9 @@ If point is on a group name, this function operates on that group." | |||
| 1912 | (_ (concat str left right))))) | 1912 | (_ (concat str left right))))) |
| 1913 | 1913 | ||
| 1914 | (defun ibuffer-buffer-name-face (buf mark) | 1914 | (defun ibuffer-buffer-name-face (buf mark) |
| 1915 | (cond ((char-equal mark ibuffer-marked-char) | 1915 | (cond ((eq mark ibuffer-marked-char) |
| 1916 | ibuffer-marked-face) | 1916 | ibuffer-marked-face) |
| 1917 | ((char-equal mark ibuffer-deletion-char) | 1917 | ((eq mark ibuffer-deletion-char) |
| 1918 | ibuffer-deletion-face) | 1918 | ibuffer-deletion-face) |
| 1919 | (t | 1919 | (t |
| 1920 | (let ((level -1) | 1920 | (let ((level -1) |
| @@ -1958,7 +1958,7 @@ If point is on a group name, this function operates on that group." | |||
| 1958 | (defun ibuffer-map-on-mark (mark func) | 1958 | (defun ibuffer-map-on-mark (mark func) |
| 1959 | (ibuffer-map-lines | 1959 | (ibuffer-map-lines |
| 1960 | (lambda (buf mk) | 1960 | (lambda (buf mk) |
| 1961 | (if (char-equal mark mk) | 1961 | (if (eq mark mk) |
| 1962 | (funcall func buf mark) | 1962 | (funcall func buf mark) |
| 1963 | nil)))) | 1963 | nil)))) |
| 1964 | 1964 | ||
| @@ -2185,8 +2185,8 @@ the value of point at the beginning of the line for that buffer." | |||
| 2185 | (buffer-substring (point) (line-end-position))))) | 2185 | (buffer-substring (point) (line-end-position))))) |
| 2186 | (apply #'insert (mapcar | 2186 | (apply #'insert (mapcar |
| 2187 | (lambda (c) | 2187 | (lambda (c) |
| 2188 | (if (not (or (char-equal c ?\s) | 2188 | (if (not (or (eq c ?\s) |
| 2189 | (char-equal c ?\n))) | 2189 | (eq c ?\n))) |
| 2190 | ?- | 2190 | ?- |
| 2191 | ?\s)) | 2191 | ?\s)) |
| 2192 | str))) | 2192 | str))) |
diff --git a/test/lisp/ibuffer-tests.el b/test/lisp/ibuffer-tests.el index 6d5187a2b77..da8c7024463 100644 --- a/test/lisp/ibuffer-tests.el +++ b/test/lisp/ibuffer-tests.el | |||
| @@ -50,7 +50,6 @@ | |||
| 50 | 50 | ||
| 51 | (ert-deftest ibuffer-test-Bug25000 () | 51 | (ert-deftest ibuffer-test-Bug25000 () |
| 52 | "Test for http://debbugs.gnu.org/25000 ." | 52 | "Test for http://debbugs.gnu.org/25000 ." |
| 53 | :expected-result :failed | ||
| 54 | (let ((case-fold-search t) | 53 | (let ((case-fold-search t) |
| 55 | (buf1 (generate-new-buffer "ibuffer-test-Bug25000-buf1")) | 54 | (buf1 (generate-new-buffer "ibuffer-test-Bug25000-buf1")) |
| 56 | (buf2 (generate-new-buffer "ibuffer-test-Bug25000-buf2"))) | 55 | (buf2 (generate-new-buffer "ibuffer-test-Bug25000-buf2"))) |