emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tip] Org speed commands improved


From: Juan Manuel Macías
Subject: [tip] Org speed commands improved
Date: Tue, 26 Apr 2022 14:00:31 +0000

Hi all,

Org speed commands are a major productivity boost and I love them.
Lately it has occurred to me to make some modifications with the
following configuration, which I share here in case someone wants to try
it. The idea is that Org speed commands are activated anywhere in the
header (not just at the beginning of the line) *or* when point is at the
very beginning of the buffer. This, in my opinion, improves the
navigation speed:

#+begin_src emacs-lisp
  (setq org-use-speed-commands
        (lambda () (or (eq (point) 1)
                       (org-in-regexp "^\\*+\s+.+"))))
#+end_src

This also serves as a kind of write protection for the header titles. To
be able to edit them, we can use this function:

#+begin_src emacs-lisp
  (defun my-org-toggle-speed-commands ()
    (interactive)
    (if org-use-speed-commands
        (progn (setq org-use-speed-commands nil)
               (message "speed-commands off"))
      (setq org-use-speed-commands
            (lambda () (or (eq (point) 1)
                           (org-in-regexp "^\\*+\s+.+"))))
      (message "speed-commands on")))

  (with-eval-after-load 'org
    (define-key org-mode-map (kbd "M-i") 'my-org-toggle-speed-commands))
#+end_src

Best regards,

Juan Manuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]