[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/valign c70c64e 125/198: * valign.el (valign--clean-text
From: |
Stefan Monnier |
Subject: |
[elpa] externals/valign c70c64e 125/198: * valign.el (valign--clean-text-property): Remove code using 'text-property-search-forward'. |
Date: |
Tue, 1 Dec 2020 18:19:31 -0500 (EST) |
branch: externals/valign
commit c70c64e967b31ef0e82a48b8ab7f9dd5bc7d1a1b
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
* valign.el (valign--clean-text-property): Remove code using
'text-property-search-forward'.
---
valign.el | 43 ++++++++++++++-----------------------------
1 file changed, 14 insertions(+), 29 deletions(-)
diff --git a/valign.el b/valign.el
index a61d5d5..3d5522f 100644
--- a/valign.el
+++ b/valign.el
@@ -339,35 +339,20 @@ before event, ACTION is either 'entered or 'left."
(when (overlay-get ov 'valign)
(delete-overlay ov))))
;; TODO ‘text-property-search-forward’ is Emacs 27 feature.
- (if (boundp 'text-property-search-forward)
- (save-excursion
- (let (match)
- (goto-char beg)
- (while (and (setq match
- (text-property-search-forward
- 'display nil (lambda (_ p)
- (and (consp p)
- (eq (car p) 'space)))))
- (< (point) end))
- (with-silent-modifications
- (put-text-property (prop-match-beginning match)
- (prop-match-end match)
- 'display nil)))))
- ;; Before Emacs 27.
- (let (display tab-end (p beg) last-p)
- (while (not (eq p last-p))
- (setq last-p p
- p (next-single-char-property-change p 'display nil end))
- (when (and (setq display
- (plist-get (text-properties-at p) 'display))
- (consp display)
- (eq (car display) 'space))
- ;; We are at the beginning of a tab, now find the end.
- (setq tab-end (next-single-char-property-change
- p'display nil end))
- ;; Remove text property.
- (with-silent-modifications
- (put-text-property p tab-end 'display nil)))))))
+ (let (display tab-end (p beg) last-p)
+ (while (not (eq p last-p))
+ (setq last-p p
+ p (next-single-char-property-change p 'display nil end))
+ (when (and (setq display
+ (plist-get (text-properties-at p) 'display))
+ (consp display)
+ (eq (car display) 'space))
+ ;; We are at the beginning of a tab, now find the end.
+ (setq tab-end (next-single-char-property-change
+ p'display nil end))
+ ;; Remove text property.
+ (with-silent-modifications
+ (put-text-property p tab-end 'display nil))))))
(cl-defmethod valign--align-separator-row
(type (style (eql single-column)) column-width-list)
- [elpa] externals/valign 21a397a 092/198: Update README, (continued)
- [elpa] externals/valign 21a397a 092/198: Update README, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 4ecc990 093/198: * valign.el (valign--table-face): Fix markdown-mode., Stefan Monnier, 2020/12/01
- [elpa] externals/valign c4ddfb3 095/198: Fix org-flag-region advice, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 7529ddd 111/198: Revert "* valign.el (valign-table): Tuck in some long lines.", Stefan Monnier, 2020/12/01
- [elpa] externals/valign 97beef8 127/198: Remove valign-table-quiet, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 1412fef 133/198: * valign.el (valign-table): Suppress search errors., Stefan Monnier, 2020/12/01
- [elpa] externals/valign fc591d8 129/198: * valign.el (valign-table-1): Clear overlay before measuring table., Stefan Monnier, 2020/12/01
- [elpa] externals/valign c5eb220 108/198: Remove valign--face-attribute, Stefan Monnier, 2020/12/01
- [elpa] externals/valign ed8dd50 118/198: Remove obsolete functions, Stefan Monnier, 2020/12/01
- [elpa] externals/valign ced2f6a 132/198: * valign.el (valign-table-1): Fix search term., Stefan Monnier, 2020/12/01
- [elpa] externals/valign c70c64e 125/198: * valign.el (valign--clean-text-property): Remove code using 'text-property-search-forward'.,
Stefan Monnier <=
- [elpa] externals/valign 645260f 076/198: * valign.el (valign-table): Allow edebug., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 82566b3 080/198: Fix tab calculation, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 6578fe4 081/198: * valign.el (valign-table): Don’t message errors., Stefan Monnier, 2020/12/01
- [elpa] externals/valign e2a2a85 085/198: Rework hooks, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 44651e9 086/198: * valign.el (valign-mode): Change text-scale hooks., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 8b6ce8c 084/198: * valign.el (valign--cell-width): Minor change., Stefan Monnier, 2020/12/01
- [elpa] externals/valign dcf6bd8 088/198: Add force align, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 53be5d7 089/198: Add fancy bar, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 98eae8d 090/198: * valign.el (valign-table): Remove setter for custom option., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 159ae0f 102/198: Fix typo, Stefan Monnier, 2020/12/01