forked from mirrors/org-mode
org-string-width: Handle undefined behaviour in older Emacs
* lisp/org-macs.el (org-string-width): Force older Emacs treating invisible text with ellipsis as zero-width. Newer Emacs versions do exactly this.
This commit is contained in:
parent
3fba34900e
commit
2e3566e1e9
|
@ -926,7 +926,16 @@ Return width in pixels when PIXELS is non-nil."
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(setq-local display-line-numbers nil)
|
(setq-local display-line-numbers nil)
|
||||||
(setq-local buffer-invisibility-spec
|
(setq-local buffer-invisibility-spec
|
||||||
|
(if (listp current-invisibility-spec)
|
||||||
|
(mapcar (lambda (el)
|
||||||
|
;; Consider elipsis to have 0 width.
|
||||||
|
;; It is what Emacs 28+ does, but we have
|
||||||
|
;; to force it in earlier Emacs versions.
|
||||||
|
(if (and (consp el) (cdr el))
|
||||||
|
(list (car el))
|
||||||
|
el))
|
||||||
current-invisibility-spec)
|
current-invisibility-spec)
|
||||||
|
current-invisibility-spec))
|
||||||
(setq-local char-property-alias-alist
|
(setq-local char-property-alias-alist
|
||||||
current-char-property-alias-alist)
|
current-char-property-alias-alist)
|
||||||
(let (pixel-width symbol-width)
|
(let (pixel-width symbol-width)
|
||||||
|
|
Loading…
Reference in New Issue