unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 32462-done@debbugs.gnu.org
Subject: bug#32462: 26.1; Can `count-lines' be rewritten to use the newline cache?
Date: Sun, 19 Aug 2018 00:10:27 +1200	[thread overview]
Message-ID: <4940f256-d5fa-fcd3-f6b7-5be72399de11@orcon.net.nz> (raw)
In-Reply-To: <834lftgios.fsf@gnu.org>

On 18/08/18 02:40, Eli Zaretskii wrote:
>> From: Phil Sainty <psainty@orcon.net.nz>
>> `count-lines' uses a regexp search to find all the newlines (and/or
>> carriage returns
> 
> It uses regexp search only when selective-display is in effect, which
> means almost never.  Otherwise, it uses forward-line, which uses
> scan_newline_from_point, which already uses the newline cache (unless
> the cache is disabled).

Ah, thanks Eli; I see that now.  A look at the C code suggests that the
newline cache is also a more complicated arrangement than I'd imagined,
so I don't think my original thoughts about this were actually viable.

I'm closing this bug.






      reply	other threads:[~2018-08-18 12:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17  1:01 bug#32462: 26.1; Can `count-lines' be rewritten to use the newline cache? Phil Sainty
2018-08-17 14:40 ` Eli Zaretskii
2018-08-18 12:10   ` Phil Sainty [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=4940f256-d5fa-fcd3-f6b7-5be72399de11@orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=32462-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).