summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-09-01 17:15:36 -0500
committerCase Duckworth2021-09-01 17:15:36 -0500
commit8d87b946fcf9af3bb4d0d6979cc3826c1f8115ed (patch)
treeefb6ea84fe45e08ab47daf2771b55b9ae647f531 /lisp
parentAdd elfeed (diff)
downloademacs-8d87b946fcf9af3bb4d0d6979cc3826c1f8115ed.tar.gz
emacs-8d87b946fcf9af3bb4d0d6979cc3826c1f8115ed.zip
Fix acdw/org-next-heading-widen
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-org.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index 50a0488..d7137b7 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el
@@ -370,14 +370,16 @@ instead of the true count."
370;;; Next and previous heading, with widening 370;;; Next and previous heading, with widening
371(defun acdw/org-next-heading-widen (arg) 371(defun acdw/org-next-heading-widen (arg)
372 (interactive "p") 372 (interactive "p")
373 (let ((point-target (if (> arg 0) 373 (let ((current-point (point))
374 (point-max) 374 (point-target (if (> arg 0) (point-max) (point-min))))
375 (point-min)))) 375 (org-next-visible-heading arg)
376 (unless (or (org-next-visible-heading arg) ; XXX: this doesn't work!!! ARGH 376 (when (and (buffer-narrowed-p)
377 (/= (point) point-target)) 377 (= (point) point-target)
378 (when (buffer-narrowed-p) 378 (or (and (> arg 0))
379 (widen) 379 (and (< arg 0)
380 (org-next-visible-heading arg))))) 380 (= (point) current-point))))
381 (widen)
382 (org-next-visible-heading arg))))
381 383
382(defun acdw/org-previous-heading-widen (arg) 384(defun acdw/org-previous-heading-widen (arg)
383 (interactive "p") 385 (interactive "p")