unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Bastien <bzg@altern.org>
Cc: "Lennart Borgman \(gmail\)" <lennart.borgman@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Emacs Devel <emacs-devel@gnu.org>
Subject: Re: nxml-mode does not remove its overlays
Date: Sun, 09 Mar 2008 11:18:54 +0100	[thread overview]
Message-ID: <85fxv0i4j5.fsf@lola.goethe.zz> (raw)
In-Reply-To: <874pbg7h7f.fsf@bzg.ath.cx> (Bastien's message of "Sun, 09 Mar 2008 02:40:36 +0000")

Bastien <bzg@altern.org> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> PS: To check if a buffer is widened, please use
>> (= (buffer-size) (- (point-max) (point-min)))
>
> This is something I've already been looking for several times.
>
> Maybe this could go in simple.el:
>
> (defun buffer-narrowed-p
>   "Return non-nil if the current buffer is narrowed."
>   (not (= (buffer-size)
> 	  (- (point-max) 
> 	     (point-min)))

Use /= rather than (not (= ... and a defsubst.  Of course, a defsubst
means that people are not free to change the buffer-size/point-min/max
semantics/invariants without having to recompile everything.

But I think I rather prefer if people have to work hard for a different
scenario...

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




      reply	other threads:[~2008-03-09 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-08 19:22 nxml-mode does not remove its overlays Lennart Borgman (gmail)
2008-03-08 21:02 ` Stefan Monnier
2008-03-09  2:40   ` Bastien
2008-03-09 10:18     ` David Kastrup [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=85fxv0i4j5.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=bzg@altern.org \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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).