help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What variable says that the buffer is in narrowed state?


From: Sven Joachim
Subject: Re: What variable says that the buffer is in narrowed state?
Date: Sat, 13 Oct 2007 15:45:43 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

Bastien <bzg@altern.org> writes:

> I expected to find some `buffer-narrowed-p' variable.  Is there
> something like this?  The mode-line is able to display this bit 
> of information, so I guess it might somehow be accessible.

If there were such a thing, it should probably be a function rather
than a variable.  Doesn't seem there is one, so I wrote it for you:

(defun buffer-narrowed-p ()
  "Return t if buffer is narrowed, nil otherwise."
  (or (> (point-min) 1)
      (< (point-max) (buffer-size))))

The mode-line display is coded in src/xdisp.c, look for "Narrow"
there.

Cheers,
       Sven


reply via email to

[Prev in Thread] Current Thread [Next in Thread]