这看起来像是由org-mode
的org-activate-bracket-links
函数触发的错误。
该函数的外观如下:
(defun org-activate-bracket-links (limit)
"Run through the buffer and add overlays to bracketed links."
(if (and (re-search-forward org-bracket-link-regexp limit t)
(not (org-in-src-block-p)))
(let* ((hl (org-match-string-no-properties 1))
(help (concat "LINK: " (save-match-data (org-link-unescape hl))))
(ip (org-maybe-intangible
(list 'invisible 'org-link
'keymap org-mouse-map 'mouse-face 'highlight
'font-lock-multiline t 'help-echo help
'htmlize-link `(:uri ,hl))))
(Vp (list 'keymap org-mouse-map 'mouse-face 'highlight
'font-lock-multiline t 'help-echo help
'htmlize-link `(:uri ,hl))))
;; We need to remove the invisible property here. Table narrowing
;; may have made some of this invisible.
(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
(remove-text-properties (match-beginning 0) (match-end 0)
'(invisible nil))
(if (match-end 3)
(progn
(add-text-properties (match-beginning 0) (match-beginning 3) ip)
(org-rear-nonsticky-at (match-beginning 3))
(add-text-properties (match-beginning 3) (match-end 3) vp)
(org-rear-nonsticky-at (match-end 3))
(add-text-properties (match-end 3) (match-end 0) ip)
(org-rear-nonsticky-at (match-end 0)))
(add-text-properties (match-beginning 0) (match-beginning 1) ip)
(org-rear-nonsticky-at (match-beginning 1))
(add-text-properties (match-beginning 1) (match-end 1) vp)
(org-rear-nonsticky-at (match-end 1))
(add-text-properties (match-end 1) (match-end 0) ip)
(org-rear-nonsticky-at (match-end 0)))
t)))
它搜索的匹配一个括号链路(例如[[target][label]]
,隐藏了[[target][
通过添加部分ip
到文本属性,然后将linkifies label
通过添加vp
到文本属性,以及最后去除尾部]]
通过将ip
再次到文本属性。
这一切看起来都不错。 org-rear-nonsticky-at
应注意财产流血。
此行为由触发(add-text-properties (match-end 3) (match-end 0) ip)
,它隐藏了尾随]]
。只有该'invisible 'org-link
属性触发此行为,其他属性似乎是无辜的。
您可以覆盖org-activate-bracket-links
,从而ip
不再设置,'invisible
但'display ""
效果相同:
(defun org-activate-bracket-links (limit)
"Run through the buffer and add overlays to bracketed links."
(if (and (re-search-forward org-bracket-link-regexp limit t)
(not (org-in-src-block-p)))
(let* ((hl (org-match-string-no-properties 1))
(help (concat "LINK: " (save-match-data (org-link-unescape hl))))
(ip (org-maybe-intangible
(list 'display ""
'keymap org-mouse-map 'mouse-face 'highlight
'font-lock-multiline t 'help-echo help
'htmlize-link `(:uri ,hl))))
(Vp (list 'keymap org-mouse-map 'mouse-face 'highlight
'font-lock-multiline t 'help-echo help
'htmlize-link `(:uri ,hl))))
;; We need to remove the invisible property here. Table narrowing
;; may have made some of this invisible.
(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
(remove-text-properties (match-beginning 0) (match-end 0)
'(invisible nil))
(if (match-end 3)
(progn
(add-text-properties (match-beginning 0) (match-beginning 3) ip)
(org-rear-nonsticky-at (match-beginning 3))
(add-text-properties (match-beginning 3) (match-end 3) vp)
(org-rear-nonsticky-at (match-end 3))
(add-text-properties (match-end 3) (match-end 0) ip)
(org-rear-nonsticky-at (match-end 0)))
(add-text-properties (match-beginning 0) (match-beginning 1) ip)
(org-rear-nonsticky-at (match-beginning 1))
(add-text-properties (match-beginning 1) (match-end 1) vp)
(org-rear-nonsticky-at (match-end 1))
(add-text-properties (match-end 1) (match-end 0) ip)
(org-rear-nonsticky-at (match-end 0)))
t)))
显然,这是一个丑陋的hack。但这对我有用,也许对您有用。我仍然建议提交错误报告。