emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [tip] Org speed commands improved
@ 2022-04-26 14:00 Juan Manuel Macías
  2022-04-27  4:20 ` Ihor Radchenko
  2022-04-27 16:30 ` Daniel Fleischer
  0 siblings, 2 replies; 6+ messages in thread
From: Juan Manuel Macías @ 2022-04-26 14:00 UTC (permalink / raw)
  To: orgmode

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-04 22:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 14:00 [tip] Org speed commands improved Juan Manuel Macías
2022-04-27  4:20 ` Ihor Radchenko
2022-04-27  5:37   ` Tim Cross
2022-04-27  7:08   ` Juan Manuel Macías
2022-05-04 22:12     ` TRS-80
2022-04-27 16:30 ` Daniel Fleischer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).