[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/blist c2f4bc47d4 25/31: fix previous bugs caused by inv
From: |
ELPA Syncer |
Subject: |
[elpa] externals/blist c2f4bc47d4 25/31: fix previous bugs caused by invisibility |
Date: |
Tue, 28 Dec 2021 16:57:41 -0500 (EST) |
branch: externals/blist
commit c2f4bc47d4ebdb3710a01d81af57b3a43edda9d0
Author: JSDurand <mmemmew@gmail.com>
Commit: JSDurand <mmemmew@gmail.com>
fix previous bugs caused by invisibility
* blist.el (blist-list-bookmarks): No need of the trailing newline
now.
(blist-toggle-group, blist-all-bookmarks, blist-jump-to-line): Fix
previous bugs caused by invisibility.
---
blist.el | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/blist.el b/blist.el
index 1dcd922cab..6ee99caf5b 100644
--- a/blist.el
+++ b/blist.el
@@ -410,8 +410,6 @@ used as a `revert-buffer-function'."
blist-discard-empty-p
blist-sorter
t))
- (insert (string #xa))
- ;; (delete-trailing-whitespace)
(goto-char (point-min))
(cond
((and
@@ -1214,7 +1212,7 @@ get unique numeric suffixes \"<2>\", \"<3>\", etc."
(interactive)
(let* ((group-header (ilist-get-group))
(group-symbol (intern (format "[ %s ]" group-header)))
- (hidden-p (get-text-property (point) 'blist-hidden))
+ (hidden-p (ilist-get-property (point) 'blist-hidden))
(inhibit-read-only t))
(cond
((null group-header)
@@ -1222,8 +1220,11 @@ get unique numeric suffixes \"<2>\", \"<3>\", etc."
(user-error "Not at a group to toggle"))
(hidden-p
;; hidden group
+ (goto-char (ilist-point-at-eol))
(delete-region (line-beginning-position)
(min (1+ (line-end-position)) (point-max)))
+ ;; this character was inserted by hiding the group previously
+ (delete-char 1)
(save-excursion
(insert
(propertize
@@ -1231,7 +1232,8 @@ get unique numeric suffixes \"<2>\", \"<3>\", etc."
'ilist-group-header group-header)))
(remove-from-invisibility-spec group-symbol))
;; not hidden
- ((let* ((start (line-beginning-position))
+ ((goto-char (ilist-point-at-eol))
+ (let* ((start (line-beginning-position))
(end (min (1+ (line-end-position)) (point-max)))
(text (buffer-substring start end)))
(delete-region start end)
@@ -1240,6 +1242,11 @@ get unique numeric suffixes \"<2>\", \"<3>\", etc."
(format "[ %s ... ]\n" group-header)
'ilist-group-header group-header
'blist-hidden t))
+ ;; Emacs has a bug that if an invisible character right next
+ ;; to the visible part has a display property, then it will
+ ;; turn out to be visible. So we insert an invisible
+ ;; character to avoid this phenomenon.
+ (insert (propertize (string #x20) 'invisible t))
(goto-char start))
(add-to-invisibility-spec group-symbol)))))
@@ -1274,7 +1281,8 @@ get unique numeric suffixes \"<2>\", \"<3>\", etc."
(defun blist-all-bookmarks ()
"Return the list of all bookmark indices, even the hidden ones."
- (ilist-map-lines #'ilist-get-index #'ilist-get-index nil nil t))
+ (ilist-map-lines #'ilist-get-real-index #'ilist-get-real-index
+ nil nil t))
;;;; Jumping around
@@ -1298,19 +1306,20 @@ get unique numeric suffixes \"<2>\", \"<3>\", etc."
(while (and (not (ilist-boundary-buffer-p t))
(not res))
(cond
- ((ilist-get-index)
+ ((ilist-get-real-index)
(setq
res
(string=
(bookmark-name-from-full-record
- (nth (ilist-get-index) bookmark-alist))
+ (nth (ilist-get-real-index) bookmark-alist))
name))
(cond
(res
(setq pos (point))
;; per chance the line is hidden
(let ((invi (get-text-property pos 'invisible)))
- (cond ((memq invi buffer-invisibility-spec)
+ (cond ((ilist-invisible-property-p
+ invi buffer-invisibility-spec)
(blist-prev-group 1)
(blist-toggle-group))))))))
;; don't skip invisible lines here
- [elpa] externals/blist a4c0a7626f 07/31: fix defcustom problem, (continued)
- [elpa] externals/blist a4c0a7626f 07/31: fix defcustom problem, ELPA Syncer, 2021/12/28
- [elpa] externals/blist fa54e09b57 03/31: More features, ELPA Syncer, 2021/12/28
- [elpa] externals/blist a24f9d6d35 06/31: fix `blist-select', ELPA Syncer, 2021/12/28
- [elpa] externals/blist a0b9bc4eb5 18/31: * blist.el (blist-relocate): Fix a bug caused by a typo., ELPA Syncer, 2021/12/28
- [elpa] externals/blist 950a214456 28/31: New option: blist-use-header-p, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 4a5eb414f7 27/31: Fix errors and byte-compile, ELPA Syncer, 2021/12/28
- [elpa] externals/blist db67745821 13/31: Fix some README issues, ELPA Syncer, 2021/12/28
- [elpa] externals/blist c868a2d8b3 24/31: * blist.el (blist-all-bookmarks): refactor, ELPA Syncer, 2021/12/28
- [elpa] externals/blist eddd17ce4d 14/31: try to fix image, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 4a4d94c09d 20/31: blist.el: QoL refinements, ELPA Syncer, 2021/12/28
- [elpa] externals/blist c2f4bc47d4 25/31: fix previous bugs caused by invisibility,
ELPA Syncer <=
- [elpa] externals/blist f1b556af33 12/31: Add README, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 48510bdefa 05/31: preserve the original point in building the list, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 41735b2a03 08/31: Make `blist-list-bookmarks' interactive, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 1bac76696c 09/31: fix a wrong function call, ELPA Syncer, 2021/12/28
- [elpa] externals/blist c5145aea0e 02/31: Fix documentations., ELPA Syncer, 2021/12/28
- [elpa] externals/blist 0f0ceddf53 26/31: Refine the ChangeLog., ELPA Syncer, 2021/12/28
- [elpa] externals/blist 81d5a0fe71 19/31: blist: refine functions to display annotations, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 65ff602eee 30/31: blist: Add a variable to choose features, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 5fd8b00d72 22/31: implement hiding groups by buffer-invisibility-spec, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 6f484744e7 23/31: * ChangeLog: Now this repository has a ChangeLog file., ELPA Syncer, 2021/12/28