Marco Wahl writes: > Precondition: > > - Have a dired with several subdirectories open. Also, M-x load-lib RET page-ext RET > Action: > > - C-x C-p C-n > > Expectation: > > - The dired buffer narrows to the next subdirectory. > > Observation: > > - The dired buffer narrows to the current subdirectory. > * lisp/textmodes/page-ext.el (next-page): Jump ahead page-delimiter if > at such before narrow. This fixes the command for dired. I think the problem is rather that next-page is going an extra page backwards even when COUNT was positive, so the fix should be more like this (inline version with whitespace changes ignored, full version attached): --- a/lisp/textmodes/page-ext.el +++ b/lisp/textmodes/page-ext.el @@ -304,6 +304,7 @@ next-page (or count (setq count 1)) (widen) ;; Cannot use forward-page because of problems at page boundaries. + (if (>= count 0) (while (and (> count 0) (not (eobp))) (if (re-search-forward page-delimiter nil t) nil @@ -316,7 +317,7 @@ next-page (if (re-search-backward page-delimiter nil t) (goto-char (match-beginning 0)) (goto-char (point-min))) - (setq count (1+ count))) + (setq count (1+ count)))) (narrow-to-page) (goto-char (point-min)) (recenter 0))