all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xue Fuqiao <xfq.free@gmail.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Why does `(window-line-height)' return nil?
Date: Sun, 4 Aug 2013 11:52:02 +0800	[thread overview]
Message-ID: <CAAF+z6GVUoTt2XX3J4vjWaf-FJ5ksn4f+3i60QmRvS-35vKhVA@mail.gmail.com> (raw)
In-Reply-To: <83li4jxi4o.fsf@gnu.org>

On Sat, Aug 3, 2013 at 5:01 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Sat, 3 Aug 2013 16:26:50 +0800
>> From: Xue Fuqiao <xfq.free@gmail.com>
>>
>> In my *scratch* buffer, all of the following expressions return nil with
>> `eval-print-last-sexp' (also tried `eval-last-sexp'):
>>
>> --8<---------------cut here---------------start------------->8---
>> (window-line-height 'header-line)
>> (window-line-height 'mode-line)
>> (window-line-height)
>> (window-line-height 0)
>> (window-line-height -1)
>> --8<---------------cut here---------------end--------------->8---
>>
>> Why do they return nil?  After reading the doc string, I only found one
>> sentence that may be relavant: "Return nil if window display is not
>> up-to-date."  So, does that mean window display is not up-to-date when
>> evaluating the expression?
>
> Yes, that's what it means.  This function will almost always return
> nil if you evaluate an expression that calls it in the *scratch*
> buffer, because that evaluation forces a new redisplay cycle (to
> display the result).  It does return non-nil values when called from
> Lisp code that does not trigger redisplay, though.

Ah, I see.  Thank you.

-- 
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/



      reply	other threads:[~2013-08-04  3:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-03  8:26 Why does `(window-line-height)' return nil? Xue Fuqiao
2013-08-03  9:01 ` Eli Zaretskii
2013-08-04  3:52   ` Xue Fuqiao [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=CAAF+z6GVUoTt2XX3J4vjWaf-FJ5ksn4f+3i60QmRvS-35vKhVA@mail.gmail.com \
    --to=xfq.free@gmail.com \
    --cc=help-gnu-emacs@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.