Hello,

Juan Manuel Macías <maciasch...@posteo.net> writes:

> I wonder if this other approach can be viable or if it is something
> crazy: if the spaces in org-sort-remove-invisible are a
> problem only for the first emphasis of each item, how about this
> fix to org-sort-list? (not modifying org-sort-remove-invisible):

I think `org-sort-remove-invisible' is wrong, so it is the one that
needs to be fixed.

Could you try the following instead?

--8<---------------cut here---------------start------------->8---
(defun org-sort-remove-invisible (s)
  "Remove invisible part of links and emphasis markers from string S."
  (let ((remove-markers
         (lambda (m)
           (concat (match-string 1 m)
                   (match-string 4 m)
                   (match-string 5 m)))))
    (remove-text-properties 0 (length s) org-rm-props s)
    (replace-regexp-in-string
     org-verbatim-re remove-markers
     (replace-regexp-in-string org-emph-re remove-markers 
(org-link-display-format s) t tt)
     t t)))
--8<---------------cut here---------------end--------------->8---

Regards,
--
Nicolas Goaziou

Reply via email to