Emacs Org-mode 可否有方法隐藏 :PROPERTIES: drawer(HELP WANTED!)

我明白原因了,你应该用了 org-indent-mode .

改一下,无论是否开启 org-indent-mode 都兼容的代码:

(defun org-hide-properties ()
  "Hide org headline's properties using overlay."
  (save-excursion
    (goto-char (point-min))
    (while (re-search-forward
            "^ *:PROPERTIES:\n\\( *:.+?:.*\n\\)+ *:END:\n" nil t)
      (overlay-put (make-overlay
                    (match-beginning 0) (match-end 0))
                   'display ""))))

(add-hook 'org-mode-hook #'org-hide-properties)
6 个赞