about summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-08-26 23:30:43 -0500
committerCase Duckworth2021-08-26 23:30:43 -0500
commite627aec4ded8a98b724a6d0aef4a1e54124eeb20 (patch)
tree872c0581a389db117b3dcac9b34efe01550fb0fa /lisp
parentAdd experimental (commented) :after advice for do-auto-fill (diff)
downloademacs-e627aec4ded8a98b724a6d0aef4a1e54124eeb20.tar.gz
emacs-e627aec4ded8a98b724a6d0aef4a1e54124eeb20.zip
Add bindings to widen org-buffer on next/previous heading
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-org.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index 2f798d9..75c5f7a 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el
@@ -367,5 +367,22 @@ instead of the true count."
367 (call-interactively 'org-insert-link))))) 367 (call-interactively 'org-insert-link)))))
368 368
369 369
370;;; Next and previous heading, with widening
371(defun acdw/org-next-heading-widen (arg)
372 (interactive "p")
373 (let ((point-target (if (> arg 0)
374 (point-max)
375 (point-min))))
376 (unless (or (org-next-visible-heading arg)
377 (/= (point) point-target))
378 (when (buffer-narrowed-p)
379 (widen)
380 (org-next-visible-heading arg)))))
381
382(defun acdw/org-previous-heading-widen (arg)
383 (interactive "p")
384 (acdw/org-next-heading (- arg)))
385
386
370(provide 'acdw-org) 387(provide 'acdw-org)
371;; acdw-org.el ends here 388;; acdw-org.el ends here