[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 63d6e1f 3/4: Avoid problems when one tag/file is a substring of a
From: |
Lars Ingebrigtsen |
Subject: |
master 63d6e1f 3/4: Avoid problems when one tag/file is a substring of another |
Date: |
Thu, 19 Aug 2021 09:03:30 -0400 (EDT) |
branch: master
commit 63d6e1ffa198d729245eaf51641bfec09ee5e2c4
Author: Peter Münster <pm@a16n.net>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Avoid problems when one tag/file is a substring of another
* lisp/image-dired.el (image-dired-remove-tag): End of filename is bound
by ";" and end of tag is bound by ";" or end of line.
---
lisp/image-dired.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 5427014..97fbd7b 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -1111,11 +1111,12 @@ FILE-TAGS is an alist in the following form:
(error "Files must be a string or a list of strings!")))
(dolist (file files)
(goto-char (point-min))
- (when (search-forward-regexp (format "^%s" file) nil t)
+ (when (search-forward-regexp (format "^%s;" file) nil t)
(end-of-line)
(setq end (point))
(beginning-of-line)
- (when (search-forward-regexp (format "\\(;%s\\)" tag) end t)
+ (when (search-forward-regexp
+ (format "\\(;%s\\)\\($\\|;\\)" tag) end t)
(delete-region (match-beginning 1) (match-end 1))
;; Check if file should still be in the database. If
;; it has no tags or comments, it will be removed.