From: Lennart Borgman <lennart.borgman@gmail.com>
To: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: narrowedp?
Date: Thu, 1 Oct 2009 13:06:37 +0200 [thread overview]
Message-ID: <e01d8a50910010406v176570f0vbae74fd36aa00f95@mail.gmail.com> (raw)
In-Reply-To: <877hvfflft.fsf@lola.goethe.zz>
On Thu, Oct 1, 2009 at 12:38 PM, David Kastrup <dak@gnu.org> wrote:
>
> Checking both can be done with
> (= (- (point-max) (point-min)) (buffer-size))
I use this function
(defun buffer-narrowed-p ()
"Return non-nil if the current buffer is narrowed."
(/= (buffer-size)
(- (point-max)
(point-min))))
Maybe it would be good if this was included in Emacs. However please
observe also that `save-restriction' and `widen' are fast operations.
prev parent reply other threads:[~2009-10-01 11:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-01 10:17 narrowedp? Alan Mackenzie
2009-10-01 10:38 ` narrowedp? David Kastrup
2009-10-01 11:06 ` Lennart Borgman [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e01d8a50910010406v176570f0vbae74fd36aa00f95@mail.gmail.com \
--to=lennart.borgman@gmail.com \
--cc=dak@gnu.org \
--cc=emacs-devel@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 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.