GNU bug report logs -
#31061
27.0.50; next-page of page-ext non-functional in dired
Previous Next
Reported by: Marco Wahl <marcowahlsoft <at> gmail.com>
Date: Wed, 4 Apr 2018 14:26:01 UTC
Severity: minor
Tags: fixed, patch
Found in version 27.0.50
Fixed in version 27.1
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #19 received at 31061 <at> debbugs.gnu.org (full text, mbox):
Noam Postavsky <npostavs <at> gmail.com> writes:
> Marco Wahl <marcowahlsoft <at> gmail.com> writes:
>
>> I found that with your suggestion next-page with negative argument goes
>> back one page too much in a dired buffer, though.
>>
>> I further think that the core of the irritation is that `narrow-to-page'
>> does not narrow to the following page when on the start of the '\n\n'
>> page-separator (unlike for the usual '^^L' separator).
>
> As far as I can tell, narrow-to-page still has the same problem with the
> default "\n\f" separator as the "\n\n" one. It's just that the problem
> is more visually obvious in the dired case. Using thingatpt seems to
> work better (but this doesn't handle the COUNT argument for
> narrow-to-page):
>
> (let ((bounds (bounds-of-thing-at-point 'page)))
> (narrow-to-region (car bounds) (cdr bounds)))
>
> Though I guess it might be arguable whether the page separator should
> count as part of the page or not. The above expression (and
> `mark-page') treat the separator as part of the preceding page,
> `narrow-to-page' seems to exclude the separator from the page.
I fully agree that one might like the separator to be part of the page.
This might help e.g. for killing and yanking.
Actually I tend towards excluding any separator when narrowing to a
page. I see a document as sequence like
<content><separator><content><separator>...<separator><content>
and the content is all I'd expect when narrowing to a page.
>> Starting with your fix I propose this modification of the else part:
>>
>> (while (and (< count 1) (not (bobp)))
>> (if (re-search-backward page-delimiter nil t)
>> (when (= count 0)
>> (goto-char (match-end 0)))
>> (goto-char (point-min)))
>> (setq count (1+ count)))
>>
>> This is: go to the end of the delimiter when the final page has been
>> reached.
>
> Yeah, that works.
Cool.
Best regards!
This bug report was last modified 7 years and 99 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.