3

How can I disable the persistent message on an org capture buffer that says?

Capture buffer. Finish `C-c', Refile `C-w', abort `C-k'.

A similar message is displayed when entering a source block. That message can be disabled with org-edit-src-persistent-message. However I don't see such an option for capturing.

I've searched this online and used M-x apropos-documentation as well as apropos-variable with the terms capture and messageto no avail.

3

There is no variable to control that, but you can accomplish what you want with a hook.

Some background: when you start a capture, a capture buffer is created and although its major mode is org-mode, a minor mode is added: org-capture-mode. Like all modes, it has a hook (a list of functions that are called when the mode is entered) called org-capture-mode-hook. By default, it is nil, but we can add a function to it using the standard add-hook mechanism.

One convention that all modes share is the (buffer-local) variable header-line-format. If that is defined, then every buffer that has that mode enabled gets that header line. If you look in org-capture.el, you will see that the org-capture-mode definition defines header-line-format to be the string that you want to eliminate, so all we need to do is make it nil.

Putting the above together, you can accomplish what you want with the following code:

(defun org-capture-turn-off-header-line ()
  (setq-local header-line-format nil))

(add-hook 'org-capture-mode-hook #'org-capture-turn-off-header-line)

The only problem is to add it to the proper place. You need to add it to your initialization file somewhere, but it needs to be done after org-capture-mode-hook is defined. The standard method to do that is with eval-after-load:

(eval-after-load 'org-capture
   (progn
      (defun org-capture-turn-off-header-line ()
         (setq-local header-line-format nil))

      (add-hook 'org-capture-mode-hook #'org-capture-turn-off-header-line)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.