about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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")