ลักษณะเช่นนี้ข้อผิดพลาดที่เกิดจาก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คุณสมบัติข้อความแล้วเชื่อมโยง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)))
เห็นได้ชัดว่านี่เป็นแฮ็คที่น่าเกลียด แต่มันเหมาะกับฉันและอาจใช้ได้ผลกับคุณ ฉันยังคงแนะนำให้ยื่นรายงานข้อผิดพลาด