unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6518: 24.0.50; window-height returns wrong value
@ 2010-06-26 18:48 Sebastian Rose
  2010-06-27  0:25 ` Christoph
  2010-07-10 20:34 ` bug#6518: (no subject) Christoph
  0 siblings, 2 replies; 6+ messages in thread
From: Sebastian Rose @ 2010-06-26 18:48 UTC (permalink / raw)
  To: 6518



Fill the *scratch* buffer with text, such that the number of lines
exceeds the window's height.  Then press

   M-S-. (window-height)

The value returned is to high (by one actually).


It gets worse, if I start my emacs without the `-Q' option.  I have line
spacing set to `5'.
(window-height) return eight lines too much.

This is espacially bad in `follow-mode'.




In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1)
 of 2010-06-15 on beteigeuze
Windowing system distributor `The X.Org Foundation', version 11.0.10706000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: de_DE.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: CSS

Minor modes in effect:
  follow-mode: t
  diff-auto-refine-mode: t
  highlight-changes-visible-mode: t
  subword-mode: t
  yas/global-mode: t
  yas/minor-mode: t
  recentf-mode: t
  show-paren-mode: t
  global-hl-line-mode: t
  display-time-mode: t
  desktop-save-mode: t
  auto-image-file-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <down> <down> <down> <down> <down> ( w i 
n d o w - h e i g h t ) C-h f <return> q M-< C-s w 
i n d o w <down> <left> C-x C-e C-x C-e C-a C-k M-< 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> C-x 1 C-h f 
<up> <return> C-x 1 <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <down> M-: ( w i n d o w - h e 
i g h t ) <return> M-x e m c s <backspace> <backspace> 
a c s <tab> b u g <tab> <tab> <M-backspace> <M-backspace> 
- u <backspace> b u g <tab> <tab> <M-backspace> <backspace> 
r e m <backspace> p o <tab> r <tab> <return>

Recent messages:
Type "q" to restore this window.
Mark set
Mark saved where search started
40
40 (#o50, #x28, ?\()
Mark set
Type C-x 1 to delete the help window.
Auto-saving...done
40 (#o50, #x28)
Making completion list... [2 times]

Load-path shadows:
/home/sebastian/emacs/lisp/ext/org-mode/contrib/lisp/htmlize hides /home/sebastian/emacs/lisp/ext/htmlize
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-list hides /usr/local/share/emacs/24.0.50/lisp/org/org-list
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-habit hides /usr/local/share/emacs/24.0.50/lisp/org/org-habit
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-docview hides /usr/local/share/emacs/24.0.50/lisp/org/org-docview
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-plot hides /usr/local/share/emacs/24.0.50/lisp/org/org-plot
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-id hides /usr/local/share/emacs/24.0.50/lisp/org/org-id
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-ascii hides /usr/local/share/emacs/24.0.50/lisp/org/org-ascii
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-macs hides /usr/local/share/emacs/24.0.50/lisp/org/org-macs
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-protocol hides /usr/local/share/emacs/24.0.50/lisp/org/org-protocol
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-mac-message hides /usr/local/share/emacs/24.0.50/lisp/org/org-mac-message
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-compat hides /usr/local/share/emacs/24.0.50/lisp/org/org-compat
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-footnote hides /usr/local/share/emacs/24.0.50/lisp/org/org-footnote
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-mouse hides /usr/local/share/emacs/24.0.50/lisp/org/org-mouse
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-colview hides /usr/local/share/emacs/24.0.50/lisp/org/org-colview
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-wl hides /usr/local/share/emacs/24.0.50/lisp/org/org-wl
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-beamer hides /usr/local/share/emacs/24.0.50/lisp/org/org-beamer
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-table hides /usr/local/share/emacs/24.0.50/lisp/org/org-table
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-html hides /usr/local/share/emacs/24.0.50/lisp/org/org-html
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-mhe hides /usr/local/share/emacs/24.0.50/lisp/org/org-mhe
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-docbook hides /usr/local/share/emacs/24.0.50/lisp/org/org-docbook
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-install hides /usr/local/share/emacs/24.0.50/lisp/org/org-install
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-timer hides /usr/local/share/emacs/24.0.50/lisp/org/org-timer
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-entities hides /usr/local/share/emacs/24.0.50/lisp/org/org-entities
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org hides /usr/local/share/emacs/24.0.50/lisp/org/org
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-w3m hides /usr/local/share/emacs/24.0.50/lisp/org/org-w3m
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-clock hides /usr/local/share/emacs/24.0.50/lisp/org/org-clock
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-icalendar hides /usr/local/share/emacs/24.0.50/lisp/org/org-icalendar
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-inlinetask hides /usr/local/share/emacs/24.0.50/lisp/org/org-inlinetask
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-mew hides /usr/local/share/emacs/24.0.50/lisp/org/org-mew
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-info hides /usr/local/share/emacs/24.0.50/lisp/org/org-info
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-indent hides /usr/local/share/emacs/24.0.50/lisp/org/org-indent
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-xoxo hides /usr/local/share/emacs/24.0.50/lisp/org/org-xoxo
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-agenda hides /usr/local/share/emacs/24.0.50/lisp/org/org-agenda
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-latex hides /usr/local/share/emacs/24.0.50/lisp/org/org-latex
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-bbdb hides /usr/local/share/emacs/24.0.50/lisp/org/org-bbdb
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-jsinfo hides /usr/local/share/emacs/24.0.50/lisp/org/org-jsinfo
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-archive hides /usr/local/share/emacs/24.0.50/lisp/org/org-archive
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-publish hides /usr/local/share/emacs/24.0.50/lisp/org/org-publish
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-crypt hides /usr/local/share/emacs/24.0.50/lisp/org/org-crypt
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-datetree hides /usr/local/share/emacs/24.0.50/lisp/org/org-datetree
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-rmail hides /usr/local/share/emacs/24.0.50/lisp/org/org-rmail
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-exp-blocks hides /usr/local/share/emacs/24.0.50/lisp/org/org-exp-blocks
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-attach hides /usr/local/share/emacs/24.0.50/lisp/org/org-attach
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-vm hides /usr/local/share/emacs/24.0.50/lisp/org/org-vm
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-gnus hides /usr/local/share/emacs/24.0.50/lisp/org/org-gnus
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-exp hides /usr/local/share/emacs/24.0.50/lisp/org/org-exp
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-remember hides /usr/local/share/emacs/24.0.50/lisp/org/org-remember
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-irc hides /usr/local/share/emacs/24.0.50/lisp/org/org-irc
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-feed hides /usr/local/share/emacs/24.0.50/lisp/org/org-feed
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-mobile hides /usr/local/share/emacs/24.0.50/lisp/org/org-mobile
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-ctags hides /usr/local/share/emacs/24.0.50/lisp/org/org-ctags
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-freemind hides /usr/local/share/emacs/24.0.50/lisp/org/org-freemind
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-src hides /usr/local/share/emacs/24.0.50/lisp/org/org-src
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-bibtex hides /usr/local/share/emacs/24.0.50/lisp/org/org-bibtex
/home/sebastian/emacs/lisp/ext/org-mode/lisp/org-faces hides /usr/local/share/emacs/24.0.50/lisp/org/org-faces

Features:
(shadow emacsbug follow macros info crm thingatpt sebastian-dark-theme
diff-mode ob-emacs-lisp ob-keys ob-comint ob-tangle ob-ref ob-lob
ob-table ob-exp ob ffap cus-edit hilit-chg jka-compr bbdb-hooks
org-archive appt cal-iso solar cal-dst holidays hol-loaddefs mule-util
cal-move texinfo org-ascii sha1 hex-util org-colview calculator
conf-mode browse-url sgml-mode vc-hg newcomment sql css-mode
multi-isearch subword gnus-fun mailalias rect flyspell ispell debug
find-func bookmark pp help-mode view tabify org-table org-man org-mouse
org-w3m org-wl org-irc org-inlinetask org-jsinfo org-infojs org-html
org-info org-id org-gnus org-bibtex org-bbdb org-capture org-mks
flow-fill bbdb-gui qp vc-mcvs vc-cvs sort gnus-cite smiley ansi-color
gnus-async gnus-bcklg gnus-ml disp-table parse-time pop3 nnml nndraft
nnmh bbdb-gnus bbdb-snarf mail-extr bbdb-com auth-source netrc
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art
mm-uu mml2015 epg-config mm-view smime password-cache dig nntp
gnus-cache smtpmail imenu hideshow server sr-globals sr-copyright
filladapt bbdb-vcard-export bbdb-autoloads bbdb windmove javascript-mode
comint diary-lib diary-loaddefs rfcview get-rfc sr-org-index-complete
sr-org-mode org-latex org-export-latex org-beamer remember org-remember
org-datetree org-clock sr-org-projects org-publish org-exp
org-exp-blocks org-agenda org-protocol org byte-opt warnings bytecomp
byte-compile org-footnote org-src org-list org-faces org-compat
org-entities org-macs noutline outline cal-menu calendar cal-loaddefs
gnus-sum nnoo gnus-group time-date gnus-undo nnmail mail-source
format-spec gnus-start gnus-spec gnus-int gnus-range message sendmail
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus
gnus-ems nnheader gnus-util mail-utils org-install sr-monotone vc-git
uniquify yasnippet dropdown-list easy-mmode edmacro kmacro recentf
tree-widget wid-edit eldoc sr-holidays sr-doxymacs tempo url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-util
url-parse timezone url-vars mm-util mail-prsvr mailcap xml-parse
doxymacs browse-kill-ring php-mode derived etags ring cc-langs cc-mode
cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
htmlize sr-speedbar cl cl-19 advice help-fns advice-preload speedbar
sb-image ezimage dframe easymenu assoc footnote sebastian-theme
regexp-opt paren pc-select hl-line time desktop delsel image-file
cus-start cus-load tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind dynamic-setting
system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6518: 24.0.50; window-height returns wrong value
  2010-06-26 18:48 bug#6518: 24.0.50; window-height returns wrong value Sebastian Rose
@ 2010-06-27  0:25 ` Christoph
  2010-06-27  3:08   ` Eli Zaretskii
  2010-07-10 20:34 ` bug#6518: (no subject) Christoph
  1 sibling, 1 reply; 6+ messages in thread
From: Christoph @ 2010-06-27  0:25 UTC (permalink / raw)
  To: 6518

I verified this in GNU Emacs 23.2.1 (i386-mingw-nt6.1.7600) of 
2010-05-08 on G41R2F1, on Windows 7.

I decreased the window height so that only one line is visible in the 
buffer.

(window-height) function indeed returns 2.

But the documenation says:
The return value includes WINDOW's mode line and header line, if any.

Therefore, the window height of 2 is correct: 1 line in the buffer plus 
the mode line.

If I decrease the window size further that even the mode line 
disappears, (window-height) reports the correct value of 1.

The next test was setting lines-spacing to 5.

In decreased the window height so only 1 line was visible, plus the mode 
line. I checked that going to the next line indeed results in a complete 
screen scroll.

(window-height) now returns 3, which is not correct. Setting 
line-spacing back to 0 shows that 2 lines are visible, plus the mode 
line, result in a total of 3 lines.

The (window-height) function doesn't seem to take the value of 
line-spacing into account.

Christoph





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6518: 24.0.50; window-height returns wrong value
  2010-06-27  0:25 ` Christoph
@ 2010-06-27  3:08   ` Eli Zaretskii
  2010-06-27  4:10     ` Christoph
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2010-06-27  3:08 UTC (permalink / raw)
  To: Christoph; +Cc: 6518

> Date: Sat, 26 Jun 2010 18:25:56 -0600
> From: Christoph <cschol2112@googlemail.com>
> Cc: 
> 
> The (window-height) function doesn't seem to take the value of 
> line-spacing into account.

Yes.  I think this is by design, so maybe a doc fix is in order.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6518: 24.0.50; window-height returns wrong value
  2010-06-27  3:08   ` Eli Zaretskii
@ 2010-06-27  4:10     ` Christoph
  2010-07-23  0:01       ` Juanma Barranquero
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph @ 2010-06-27  4:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 6518

[-- Attachment #1: Type: text/plain, Size: 173 bytes --]

On 6/26/2010 9:08 PM, Eli Zaretskii wrote:

> Yes.  I think this is by design, so maybe a doc fix is in order.

Sounds good. I attached a doc fix patch proposal.

Christoph

[-- Attachment #2: bugfix_6518.txt --]
[-- Type: text/plain, Size: 564 bytes --]

=== modified file 'src/window.c'
--- src/window.c	2010-06-12 11:30:48 +0000
+++ src/window.c	2010-06-27 03:49:01 +0000
@@ -517,7 +517,11 @@
        doc: /* Return the number of lines in WINDOW.
 WINDOW defaults to the selected window.
 
-The return value includes WINDOW's mode line and header line, if any.  */)
+The return value includes WINDOW's mode line and header line, if any.  
+
+Note: The function does not take into account the value of `line-spacing'
+when calculating the number of lines in WINDOW.  
+*/)
      (window)
      Lisp_Object window;
 {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6518: (no subject)
  2010-06-26 18:48 bug#6518: 24.0.50; window-height returns wrong value Sebastian Rose
  2010-06-27  0:25 ` Christoph
@ 2010-07-10 20:34 ` Christoph
  1 sibling, 0 replies; 6+ messages in thread
From: Christoph @ 2010-07-10 20:34 UTC (permalink / raw)
  To: 6518

tags 6518 patch





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6518: 24.0.50; window-height returns wrong value
  2010-06-27  4:10     ` Christoph
@ 2010-07-23  0:01       ` Juanma Barranquero
  0 siblings, 0 replies; 6+ messages in thread
From: Juanma Barranquero @ 2010-07-23  0:01 UTC (permalink / raw)
  To: Christoph; +Cc: 6518-done

> Sounds good. I attached a doc fix patch proposal.

Committed, thanks.

    Juanma





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-23  0:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-26 18:48 bug#6518: 24.0.50; window-height returns wrong value Sebastian Rose
2010-06-27  0:25 ` Christoph
2010-06-27  3:08   ` Eli Zaretskii
2010-06-27  4:10     ` Christoph
2010-07-23  0:01       ` Juanma Barranquero
2010-07-10 20:34 ` bug#6518: (no subject) Christoph

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).