From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xue Fuqiao Newsgroups: gmane.emacs.help Subject: Re: Why does `(window-line-height)' return nil? Date: Sun, 4 Aug 2013 11:52:02 +0800 Message-ID: References: <83li4jxi4o.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1375588338 29409 80.91.229.3 (4 Aug 2013 03:52:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 Aug 2013 03:52:18 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 04 05:52:19 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V5pMf-0003vA-94 for geh-help-gnu-emacs@m.gmane.org; Sun, 04 Aug 2013 05:52:17 +0200 Original-Received: from localhost ([::1]:46132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5pMe-00046m-Uh for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Aug 2013 23:52:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5pMS-00046g-Mo for help-gnu-emacs@gnu.org; Sat, 03 Aug 2013 23:52:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5pMR-0005qX-Ga for help-gnu-emacs@gnu.org; Sat, 03 Aug 2013 23:52:04 -0400 Original-Received: from mail-oa0-x232.google.com ([2607:f8b0:4003:c02::232]:41821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5pMR-0005qN-BX for help-gnu-emacs@gnu.org; Sat, 03 Aug 2013 23:52:03 -0400 Original-Received: by mail-oa0-f50.google.com with SMTP id i4so3955536oah.23 for ; Sat, 03 Aug 2013 20:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=1vZVGIf+8mv9P1aRu0LFXsDcWi52J50wXjYOggO0ELg=; b=dZpztbaXqBGY3D/LSKQ1kR2NmvPPv7RrfjXxM0PCo+Myw0jYUQ3Ez17E1+g6XhSBfb Zes4SF43Zwyy2HQW4C4ibZExSDLjjZcahP/EMXcDnbfsrgC9HqiM7Wq2QP3lxHrVyXNw V0gKnhyzd6/AUNgGuJ828TQbD/8mFa6NAthJqDxrlUArvBaMIqZ8UBUbcY0Kx/xzHQwl +39u8B38sc1nUeXaaWNBs3/TJXvT/ztwJwUChMlm0aCVQAiXPzdPWFv9hr/rxpvESQfk yAmBlR1VbTLpmFadlAP+0KeGYL9Dee3wyqRK1VzQeESmeO6595+4KupW/9wSbiGtJHzC HZBg== X-Received: by 10.50.11.46 with SMTP id n14mr560831igb.15.1375588322480; Sat, 03 Aug 2013 20:52:02 -0700 (PDT) Original-Received: by 10.43.43.201 with HTTP; Sat, 3 Aug 2013 20:52:02 -0700 (PDT) In-Reply-To: <83li4jxi4o.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::232 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92697 Archived-At: On Sat, Aug 3, 2013 at 5:01 PM, Eli Zaretskii wrote: >> Date: Sat, 3 Aug 2013 16:26:50 +0800 >> From: Xue Fuqiao >> >> 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/