From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ingo Lohmar Newsgroups: gmane.emacs.bugs Subject: bug#37563: 27.0.50; fit-frame-to-buffer does not account for line-spacing Date: Mon, 30 Sep 2019 20:41:08 +0200 Message-ID: <87tv8tsk3f.fsf@kenko.localhost.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="138290"; mail-complaints-to="usenet@blaine.gmane.org" To: 37563@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 30 21:34:44 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iF1RU-000ZrD-3O for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2019 21:34:44 +0200 Original-Received: from localhost ([::1]:56394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iF1RS-0004g1-Qj for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2019 15:34:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39118) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iF1Qv-0004b6-8v for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 15:34:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iF1Qs-0000VQ-1m for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 15:34:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51700) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iF1Qo-0000Sb-BQ for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 15:34:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iF1Qo-0003ui-6p for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 15:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ingo Lohmar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Sep 2019 19:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37563 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156987198814967 (code B ref -1); Mon, 30 Sep 2019 19:34:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Sep 2019 19:33:08 +0000 Original-Received: from localhost ([127.0.0.1]:60521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iF1Pu-0003tK-UA for submit@debbugs.gnu.org; Mon, 30 Sep 2019 15:33:08 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iF0bm-0002ZC-Dq for submit@debbugs.gnu.org; Mon, 30 Sep 2019 14:41:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32867) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iF0bj-0004KU-Qj for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 14:41:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iF0bh-000351-Bp for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 14:41:15 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:56057) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iF0bg-000319-Hf for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 14:41:13 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id D58002400FB for ; Mon, 30 Sep 2019 20:41:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1569868869; bh=pcWhqbrGAStVQScc3U/Gp+pZ4XoD5R/9IqRzLl9ZAIg=; h=From:To:Subject:Date:From; b=aPGAmG/fqWmNWyY2mmt/pGhXQ79QYeJKreqOHEdAIzqPk72+4F4KgaaHjPUeO5qnL aglG/JmV3JOM4LN5imvCEbuEb6RB/jWUTRyRjav13W8ebzRVuN5uYAHCbWxgFgxN+F 0tA5jCC2eCALNyaJskC83LdgZOTQTcVpvIYEU0cFwCmQBLvvc1rmcxbHgkU0zCtqOt REo6pIWwCh9yo6U8QhJtXr+QCwBEnYnBMauL2jBVRVFJQGsS8rTmJYLBFU16pW36sn UZwvMZK8CVDs5ISBp9BBE7nP+Z70wQePh5wA92EkiV2pL/NKy3QhfrF9QmasflXuQ1 OeTcIn3yvZzlA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 46hrnw3qztz9rxG for ; Mon, 30 Sep 2019 20:41:08 +0200 (CEST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Mailman-Approved-At: Mon, 30 Sep 2019 15:33:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:167942 Archived-At: I noticed the behavior due to company-posframe, which uses the posframe package to show a completion popup frame. The frame size is set using window.el's `fit-frame-to-buffer'. Some time ago, the call was changed to provide the explicit frame max-height in terms of lines, which exposed the following behavior: If (default-value line-spacing) is the usual 0, the height of the popup frame is correct, ie, all lines are fully shown. If, however, (default-value line-spacing) is 1 or larger (as in my setup), the bottom of the popup frame cuts off parts of the lowest line. I do not understand all the details, but it here's what my debugging shows: 1) When max-height is provided, the actual frame height is calculated in ll 8736ff of window.el (as of commit 5746202c182a9c69c732beb29b8507a6e6364799), and that just multiplies by the char-height, which excludes the line-spacing. This is the buggy case. 2) When max-height is NOT provided, the above lines set max-height to the total (parent frame) height, and the popup frame size is calculated only when reaching l 8767. This yields a larger height, correctly accounting for the line-spacing. Hope this helps and can be easily fixed. Thanks! Ingo In GNU Emacs 27.0.50 (build 24, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2019-02-16 built on kenko Repository revision: aff0c585060b7cc92d52a32978c6aa64cf7e2a5e Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Debian GNU/Linux bullseye/sid Recent messages: 1 Evaluating... Showing all blocks ... done nil [3 times] Evaluating... Showing all blocks ... done nil [2 times] t Saving file /home/il/Documents/emacs/emacs.org... Wrote /home/il/Documents/emacs/emacs.org Configured using: 'configure --with-imagemagick --without-gsettings --without-gconf --with-x-toolkit=lucid --with-modules' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS PDUMPER GMP Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Org Minor modes in effect: semantic-minor-modes-format: ((:eval (if (or semantic-highlight-edits-mode semantic-show-unmatched-syntax-mode) S))) TeX-PDF-mode: t TeX-source-correlate-mode: t magit-todos-mode: t global-magit-file-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t server-mode: t buffer-face-mode: t org-indent-mode: t shell-dirtrack-mode: t diff-auto-refine-mode: t global-flycheck-mode: t dired-async-mode: t mimuma-global-mode: t global-hl-todo-mode: t pollen-global-mode: t counsel-mode: t ivy-mode: t amx-mode: t minibuffer-depth-indicate-mode: t savehist-mode: t enchive-mode: t xterm-mouse-mode: t ws-butler-global-mode: t ws-butler-mode: t global-auto-revert-mode: t my/window-number-mode: t desktop-save-mode: t company-posframe-mode: t company-statistics-mode: t global-company-mode: t company-mode: t show-paren-mode: t electric-pair-mode: t beginend-global-mode: t beginend-org-mode: t beginend-outline-mode: t global-undo-tree-mode: t undo-tree-mode: t delete-selection-mode: t guide-key-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t global-prettify-symbols-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t size-indication-mode: t column-number-mode: t line-number-mode: t auto-fill-function: org-auto-fill-function transient-mark-mode: t Load-path shadows: [... elided ...] Features: (shadow sort emacsbug sendmail mail-extr edebug timezone dired-x mule-diag ox-org ox-odt ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox my-grep cl-print ielm quail systemd preview prv-emacs reftex-dcr reftex-auc reftex-toc-patch reftex-toc reftex-config reftex reftex-loaddefs reftex-vars tex-buf font-latex latex-config my-fill latex-addons latex-mode-expansions latex latex-flymake tex-ispell tex-style tex-config tex tex-mode hippie-expand-config my-mode-groups hippie-expand-addons my-flex-search hippie-exp pkg-info epl network-stream cider cider-debug cider-inspector cider-browse-ns cider-repl-history two-column iso-transl org-attach ess-r-mode ess-r-flymake ess-r-xref ess-trns ess-r-package ess-r-completion ess-roxy ess-r-syntax ess-rd ess-s-lang ess-help ess-mode ess-inf ess-tracebug ess ess-utils ess-custom magit-bookmark bookmark org-capture cal-move cs-mode cc-langs sql-config sql-addons sql rng-xsd xsd-regexp rng-cmpct nxml-addons nxml-mode-expansions rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-enc xmltok solar cal-dst holidays hol-loaddefs cal-iso org-addons window-addons my-window-funs pulse misearch multi-isearch shell-addons my-completion magit-extras magit-addons magit-config magit-bundle magit-todos pcre2el rxt re-builder f wgrep-patch wgrep grep-config grep forge-config forge-list forge-commands forge-semi forge-bitbucket buck forge-gogs gogs forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy gsexp ghub let-alist gnutls forge-notify forge-revnote forge-pullreq forge-issue forge-topic bug-reference forge-post forge-repo forge forge-core forge-db closql emacsql-sqlite emacsql emacsql-compiler url-http url-auth url-gw nsm magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos-addons tablist tablist-filter semantic/wisent/comp semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet magit-repos magit-apply magit-wip magit-log which-func magit-diff smerge-config smerge-mode magit-core magit-autorevert magit-margin magit-transient magit-process magit-mode transient git-commit magit-git magit-section magit-utils log-edit pcvs-util add-log with-editor async-bytecomp hi-lock eieio-opt speedbar sb-image ezimage dframe em-unix em-term term ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias windmove tabify server time notmuch-config notmuch-addons notmuch-patch notmuch hl-line notmuch-hello notmuch-tree notmuch-show notmuch-print notmuch-crypto notmuch-mua notmuch-message notmuch-draft notmuch-maildir-fcc notmuch-address notmuch-company notmuch-parser notmuch-wash coolj notmuch-query icalendar diary-lib diary-loaddefs notmuch-tag crm notmuch-lib notmuch-version notmuch-compat cl message rmc rfc822 mml mailabbrev gmm-utils mailheader mm-view mml-smime mml-sec epa epg smime dig mm-decode mm-bodies mm-encode mail-parse rfc2231 wconf racket-mode racket-bug-report racket-collection racket-stepper racket-logger racket-profile racket-imenu racket-edit racket-complete racket-repl ido racket-common racket-parens racket-indent racket-font-lock racket-util racket-ppss racket-keywords-and-builtins racket-custom vimrc-mode ngo make-mode gitconfig-mode macrostep-c cmacexp my/publish-blog fish-mode mhtml-mode skewer-html sh-flymake-backends sh-script executable skewer-css company-skewer skewer-addons skewer-repl skewer-mode cache-table js2-mode-expansions js2-mode js-config js-patch js-mode-expansions js cc-mode-expansions cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs simple-httpd css-mode-expansions css-mode smie html-mode-expansions sgml-mode eww mm-url gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils cus-edit cus-start cus-load wid-edit url-queue shr text-property-search puny svg dom conf-mode markdown-mode edit-indirect pyvenv-config pyvenv esh-var esh-cmd esh-opt esh-io esh-ext esh-proc esh-arg esh-groups eshell-config eshell esh-module esh-mode esh-util python-config python-el-fgallina-expansions python tramp-sh geiser-config geiser-mode geiser-xref geiser-compile geiser-debug geiser-patch geiser-gambit geiser-chibi geiser-mit geiser-chez geiser-chicken geiser-racket geiser-guile info-look geiser-repl geiser-image geiser-company geiser-doc geiser-menu geiser-edit geiser-completion geiser-autodoc geiser-eval geiser-connection tq geiser-syntax geiser-log geiser-popup view scheme cider-mode cider-completion cider-profile cider-eval cider-repl cider-resolve cider-eldoc cider-test cider-stacktrace cider-doc cider-browse-spec cider-clojuredocs cider-popup cider-overlays cider-client cider-common cider-util cider-connection sesman-browser nrepl-client tramp tramp-loaddefs trampver tramp-compat ucs-normalize parse-time queue nrepl-dict cider-compat spinner parseedn parseclj-parser parseclj-lex a clojure-mode-expansions sesman clojure-mode lisp-mnt align org-duration slime-config slime-fancy slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree slime-scratch slime-presentations bridge slime-macrostep macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-addons slime-repl slime-parse slime arc-mode archive-mode hyperspec browse-url imenu go-config go-guru go-flymake-backends my-flymake-addons go-mode derived url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf mailcap find-file ffap face-remap org-indent image-file org-table disp-table vc-hg vc-src vc-svn my-misc-funs elisp-addons subword-patch subword-mode-expansions cap-words superword subword goto-addr idle-highlight-mode rainbow-delimiters hideshow outshine outshine-org-cmds outorg org-capture-config org-config my-org-contacts org-protocol org-irc org-info org-id org-docview doc-view jka-compr image-mode org-bibtex org-element avl-tree bibtex-config bibtex-clean-addons bibtex ob-scheme geiser-impl help-fns radix-tree geiser-custom geiser-base geiser ob-dot ob-js ob-sql ob-latex ob-python ob-shell shell-config shell org-clock org-agenda the-org-mode-expansions org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint ob-keys org-pcomplete pcomplete org-list org-faces org-entities time-date org-version ob-emacs-lisp ob-core ob-eval org-compat org-macs org-loaddefs format-spec calendar-config cal-menu calendar cal-loaddefs noutline outline vc-git diff-mode flycheck-config flycheck faces-config ui-config comint-config dired-guess dired-subtree dired-hacks-utils dired-async async dired-aux dired-config modeline-config dired-patch ls-lisp-config ls-lisp-patch ls-lisp mini-multi-major xref-addons my-eval-result-overlays my-solarized-colors hl-todo flymake-config help-at-pt eglot-config eglot-patch eglot jsonrpc array ert pp ewoc debug backtrace subr-x flymake-proc flymake warnings url-util pollen compile-config compile-addons locals-patch my-project vc vc-dispatcher counsel-addons counsel xdg dired dired-loaddefs compile comint ansi-color swiper-addons swiper ivy-config ivy-hydra ivy flx colir color ivy-overlay amx mb-depth savehist secrets dbus xml enchive-mode xt-mouse ws-butler autorevert filenotify my-file-funs desktop-config my-window-numbers display-actions desktop frameset company-posframe posframe company-statistics company-keywords company-dabbrev-code company-dabbrev etags-addons company-etags etags fileloop generator xref project company-gtags company-template company-capf company-elisp find-func company-config company sexp-addons pcase paren elec-pair occur-config my-aux-funs easy-mmode beginend ace-link avy multiple-cursors mc-hide-unmatched-lines-mode mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more mc-cycle-cursors mc-edit-lines multiple-cursors-core rect expand-region text-mode-expansions er-basic-expansions thingatpt expand-region-core expand-region-custom undo-tree-patch undo-tree diff delsel indent-config indent-addons mm-util mail-prsvr diminish guide-key advice s popwin dash my-loaddefs edmacro kmacro cl-extra help-mode hydra ring lv my-setup-funs mule-util info tex-site slime-autoloads rx package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify dynamic-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 5731969 544737) (symbols 48 74465 205) (strings 32 351286 127943) (string-bytes 1 10253755) (vectors 16 264560) (vector-slots 8 5833430 221798) (floats 8 1203 4037) (intervals 56 781876 5606) (buffers 992 301))