summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-02-25 11:00:55 +0100
committerBastien Guerry <bzg@altern.org>2013-02-25 11:00:55 +0100
commit1ab872c51e5e3e39de4d3154d050db995bce5d8f (patch)
tree26fa08475255cd20019cb8ba2b6b13e59f87f050
parentb5460d5722e0c3cc86a90ce54366d266ee5afd7a (diff)
downloadorg-mode-1ab872c51e5e3e39de4d3154d050db995bce5d8f.tar.gz
Revert "org.el (org-sort-remove-invisible): Truly returns the visible part of the string"
This reverts commit 30d6dc8baa699230f8d770a52485d10e59f84033.
-rw-r--r--lisp/org.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 4c5aa24..af6499a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8319,13 +8319,14 @@ Optional argument WITH-CASE means sort case-sensitively."
(t
(org-call-with-arg 'org-sort-entries with-case))))
-(defsubst org-sort-remove-invisible (s)
- "Return the visible string from string S."
- (let (result)
- (dotimes (c (length s))
- (let ((st (substring s c (1+ c))))
- (unless (get-text-property 0 'invisible st) (push st result))))
- (mapconcat 'identity (reverse result) "")))
+(defun org-sort-remove-invisible (s)
+ "Remove invisible links from string S."
+ (remove-text-properties 0 (length s) org-rm-props s)
+ (while (string-match org-bracket-link-regexp s)
+ (setq s (replace-match (if (match-end 2)
+ (match-string 3 s)
+ (match-string 1 s)) t t s)))
+ s)
(defvar org-priority-regexp) ; defined later in the file