unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19300: 24.4.51; visual-line-mode messes up after-string rendering when it spans all window columns
@ 2014-12-07 23:50 Dmitry Gutov
  2014-12-08  3:46 ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Dmitry Gutov @ 2014-12-07 23:50 UTC (permalink / raw)
  To: 19300

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

...when a certain popular font is used. Visual line breaks are inserted,
and it can break the visuals quite badly. For some reason, it happens
not every time I try it in practice, but the test example below shows
this result quite reliably.

Enlarge Emacs so that its width is big enough for pop-to-buffer to
prefer horizontal splits, evaluate the code below and then `M-x test-1'
or `M-x test-2'. The propertizing with `face' below only serves to show
better how the string gets distorted.


;; https://github.com/mozilla/Fira/blob/master/ttf/FiraMono-Regular.ttf?raw=true
(set-face-attribute 'default nil :height 105 :family "Fira Mono")

(defun test-propertize-strings (strings)
  (concat "\n"
          (mapconcat (lambda (str) (propertize str 'face 'highlight))
                     strings
                     "\n")
          "\n"))

(defvar test-string-1 (test-propertize-strings
		       '(" ad-Advice-call-interactively     "
			 " ad-Advice-compilation-find-file  "
			 " ad-Advice-copy-region-as-kill    ")))

(defvar test-string-2 (test-propertize-strings
		       '(" ad-Advice-Info-read-node-name  "
			 " ad-Advice-add-to-history <f>   "
			 " ad-Advice-apropos <f>          "
			 " ad-Advice-beginning-of-buffer  "
			 " ad-Advice-delete-file <f>      "
			 " ad-Advice-delete-window <f>    ")))

(defun test-1 ()
  (interactive)
  (pop-to-buffer "test-1")
  (visual-line-mode 1)
  (enlarge-window-horizontally (- 34 (window-width)))
  (let ((ov (make-overlay (1+ (point)) (1+ (point)) nil t t)))
    (overlay-put ov 'invisible t)
    (overlay-put ov 'after-string test-string-1)
    (overlay-put ov 'window (selected-window))))

(defun test-2 ()
  (interactive)
  (pop-to-buffer "test-2")
  (visual-line-mode 1)
  (enlarge-window-horizontally (- 32 (window-width)))
  (let ((ov (make-overlay (1+ (point)) (1+ (point)) nil t t))
        (str test-string-2))
    (overlay-put ov 'invisible t)
    (overlay-put ov 'after-string str)
    (overlay-put ov 'window (selected-window))))


See attached screenshots for how the results look.

In GNU Emacs 24.4.51.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2014-11-28 on axl
Repository revision: 6b765b8facbdbb03f28028007885236601652515
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04.1 LTS

(Also reproducible in 25.0.50.1).

Inspired by https://github.com/company-mode/company-mode/issues/249.


[-- Attachment #2: test-1.png --]
[-- Type: image/png, Size: 13739 bytes --]

[-- Attachment #3: test-2.png --]
[-- Type: image/png, Size: 17405 bytes --]

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

end of thread, other threads:[~2014-12-11  3:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-07 23:50 bug#19300: 24.4.51; visual-line-mode messes up after-string rendering when it spans all window columns Dmitry Gutov
2014-12-08  3:46 ` Eli Zaretskii
2014-12-08 10:14   ` Dmitry Gutov
2014-12-08 16:04     ` Eli Zaretskii
2014-12-08 16:40       ` Dmitry Gutov
2014-12-08 17:03         ` Eli Zaretskii
2014-12-08 18:47           ` Dmitry Gutov
2014-12-08 20:39             ` Eli Zaretskii
2014-12-09  0:51               ` Dmitry Gutov
2014-12-09 16:11                 ` Eli Zaretskii
2014-12-09 17:30                   ` Dmitry Gutov
2014-12-09 17:51                     ` Eli Zaretskii
2014-12-09 18:38                       ` Dmitry Gutov
2014-12-09 18:50                         ` Eli Zaretskii
2014-12-10 17:58                         ` Eli Zaretskii
2014-12-10 22:50                           ` Dmitry Gutov
2014-12-11  3:42                             ` Eli Zaretskii

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