3

Where it says #+TITLE: my title I want it to just say my title, same with author and date and then I want to hide the other attributes...

How would I do this?

Ben Watkins
  • 131
  • 1

1 Answers1

3

You can hide title, author, date and email using org-hidden-keywords. To hide additional keywords, try the following:

(defvar my-org-hidden-keywords
  '(title author date email tags options))

(defun org-hide-keywords ()
  (save-excursion
    (let (beg end ov)
      (goto-char (point-min))
      (while (re-search-forward
              (concat "\\(^[ \t]*#\\+\\)\\("
                      (mapconcat (lambda (kw)
                                   (format "%s:\s"(symbol-name kw)))
                                 my-org-hidden-keywords "\\|")
                      "\\)")
              nil t)
        (setq beg (match-beginning 1)
              end (match-end 2)
              ov  (make-overlay beg end))
    (overlay-put ov 'invisible t)))))

(add-hook 'org-mode-hook 'org-hide-keywords)

Alternatively, with ov.el installed, replace org-hide-keywords with:

(defun org-hide-keywords ()
  (ov-set (concat "\\(^[ \t]*#\\+\\)\\("
                  (mapconcat (lambda (kw)
                               (format "%s:\s"(symbol-name kw)))
                             my-org-hidden-keywords "\\|")
                  "\\)")
          'invisible t))
jagrg
  • 3,914
  • 5
  • 19