all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Phil Sainty <psainty@orcon.net.nz>
Cc: 32462@debbugs.gnu.org
Subject: bug#32462: 26.1; Can `count-lines' be rewritten to use the newline cache?
Date: Fri, 17 Aug 2018 17:40:35 +0300	[thread overview]
Message-ID: <834lftgios.fsf@gnu.org> (raw)
In-Reply-To: <f4a1f761ed4bae3148c446f6a067c79a@webmail.orcon.net.nz> (message from Phil Sainty on Fri, 17 Aug 2018 13:01:38 +1200)

> Date: Fri, 17 Aug 2018 13:01:38 +1200
> 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).

(And based on my experience, the newline cache doesn't actually speed
up things all that much, except in buffers with unusually long lines.)





  reply	other threads:[~2018-08-17 14:40 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 [this message]
2018-08-18 12:10   ` Phil Sainty

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=834lftgios.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=32462@debbugs.gnu.org \
    --cc=psainty@orcon.net.nz \
    /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.