all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marco Wahl <marcowahlsoft@gmail.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 31061@debbugs.gnu.org
Subject: bug#31061: 27.0.50; next-page of page-ext non-functional in dired
Date: Sun, 29 Apr 2018 22:23:13 +0200	[thread overview]
Message-ID: <84sh7dahji.fsf@gmail.com> (raw)
In-Reply-To: <87sh7eq37k.fsf@gmail.com> (Noam Postavsky's message of "Sat, 28 Apr 2018 20:13:51 -0400")

Noam Postavsky <npostavs@gmail.com> writes:

> Marco Wahl <marcowahlsoft@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!





  reply	other threads:[~2018-04-29 20:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-04 14:24 bug#31061: 27.0.50; next-page of page-ext non-functional in dired Marco Wahl
2018-04-25  1:51 ` Noam Postavsky
2018-04-27 11:50   ` Marco Wahl
2018-04-29  0:13     ` Noam Postavsky
2018-04-29 20:23       ` Marco Wahl [this message]
2018-05-03  0:36         ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84sh7dahji.fsf@gmail.com \
    --to=marcowahlsoft@gmail.com \
    --cc=31061@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.