unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#27399: 26.0.50; Tooltips displayed on images in shr do not line wrap
@ 2017-06-16 16:05 Adam Sjøgren
  2017-06-16 16:30 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Adam Sjøgren @ 2017-06-16 16:05 UTC (permalink / raw)
  To: 27399


When displaying tooltips (the content of an HTML title attribute, for
instance) with long texts, the text is not line wrapped.

Here is a screenshot from an xkcd comic, showing the problem:

 · https://koldfront.dk/misc/gnu-emacs//gnus_shr_long_titles_wasnt_this_fixed.png

Tooltip texts should be line wrapped, because otherwise you can't read
the entire text. It used to be, as far as I remember, so this is
probably a regression.


In GNU Emacs 26.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.22.12)
 of 2017-06-12 built on tullinup
Repository revision: 6096f81151280b6db59c0432f86b63ae766b374a
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
System Description:	Debian GNU/Linux 9.0 (stretch)

Recent messages:
Opening nnml server...done

Configured using:
 'configure --without-pop'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Summary

Minor modes in effect:
  engine-mode: t
  diff-auto-refine-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  dumb-jump-mode: t
  shell-dirtrack-mode: t
  which-function-mode: t
  global-auto-complete-mode: t
  save-place-mode: t
  jabber-activity-mode: t
  winner-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-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
  buffer-read-only: t
  line-number-mode: t

Load-path shadows:
~/elisp/extra/let-alist hides /usr/src/emacs/lisp/emacs-lisp/let-alist

Features:
(shadow nnir emacsbug misearch multi-isearch tramp-cmds vc-git
bbdb-hooks bbdb-mhe mh-comp sendmail mh-scan mh-gnus mh-e mh-compat
mh-buffers mh-loaddefs bbdb-rmail rmailsum url-http url-gw url-auth
gnus-gravatar gravatar sort smiley gnus-cite mm-archive qp gnus-async
gnus-bcklg gnus-dup gnus-ml disp-table gnus-topic utf-7 imap pp epa-file
network-stream nsm nnml bbdb-gnus bbdb-snarf nnnil gnus-demon shr svg
gnus-delay gnus-draft gnus-agent gnus-srvr gnus-score score-mode
nnvirtual nntp gnus-cache nndraft nnmh mail-extr spam spam-stat bbdb-com
warnings gnus-uu yenc gnus-msg gnus-html url-queue help-fns radix-tree
browse-url url-cache mm-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf url-util bbdb-picture
gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum gnus-group
gnus-undo gnus-fun hashcash gnus-start gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win gnus
nnheader paren cus-start cus-load litable engine-mode magithub
magithub-ci magithub-issue magithub-cache magithub-core magit-obsolete
magit-blame magit-stash magit-bisect magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-branch magit-files
magit-refs magit-status magit package url-handlers url-parse url-vars
magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode
diff-mode magit-core magit-autorevert autorevert filenotify
magit-process magit-margin magit-mode magit-git crm magit-section
magit-popup git-commit magit-utils log-edit easy-mmode message puny
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
mailheader pcvs-util add-log with-editor tramp-sh dumb-jump f dash s
etags xref project tramp tramp-compat tramp-loaddefs trampver
ucs-normalize shell pcomplete parse-time expand-region
cperl-mode-expansions text-mode-expansions html-mode-expansions
er-basic-expansions thingatpt expand-region-core expand-region-custom
which-func imenu cperl-mode auto-complete-config auto-complete popup
cl-extra help-mode easymenu saveplace vc vc-dispatcher bbdb-autoloads
bbdb timezone boxquote rect jabber-otr json map jabber
jabber-notifications notifications jabber-libnotify dbus jabber-awesome
jabber-osd jabber-wmii jabber-xmessage jabber-festival jabber-sawfish
jabber-ratpoison jabber-tmux jabber-screen jabber-socks5
jabber-ft-server jabber-si-server jabber-ft-client jabber-ft-common
jabber-si-client jabber-si-common jabber-feature-neg jabber-truncate
jabber-time jabber-autoaway jabber-vcard-avatars jabber-chatstates
jabber-events jabber-vcard jabber-avatar mailcap jabber-activity
jabber-watch jabber-modeline advice jabber-ahc-presence jabber-ahc
jabber-version jabber-ourversion jabber-muc-nick-completion hippie-exp
comint ansi-color jabber-browse jabber-search jabber-register
jabber-roster format-spec jabber-presence jabber-muc jabber-bookmarks
jabber-private jabber-muc-nick-coloring hexrgb jabber-widget
jabber-disco wid-edit jabber-chat jabber-history jabber-mam
jabber-chatbuffer jabber-alert jabber-iq jabber-core jabber-console
sgml-mode seq dom ewoc jabber-keymap jabber-sasl sasl sasl-anonymous
sasl-login sasl-plain fsm jabber-logon jabber-conn srv dns starttls tls
jabber-xml xml jabber-menu jabber-util auth-source cl-seq eieio byte-opt
bytecomp byte-compile cconv eieio-core cl-macs eieio-loaddefs
password-cache cl gv winner ring gnutls find-file-from-selection subr-x
find-lisp dired dired-loaddefs cap-words superword subword edmacro
kmacro cl-loaddefs cl-lib server time-date mule-util 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 dbusbind inotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 687201 37906)
 (symbols 48 159387 1)
 (miscs 40 3485 639)
 (strings 32 236408 17606)
 (string-bytes 1 11514264)
 (vectors 16 71051)
 (vector-slots 8 1232959 24792)
 (floats 8 412 1004)
 (intervals 56 785 131)
 (buffers 976 37))

-- 
 "Hur långt man än har kommit                                 Adam Sjøgren
  är det alltid längre kvar"                             asjo@koldfront.dk





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

* bug#27399: 26.0.50; Tooltips displayed on images in shr do not line wrap
  2017-06-16 16:05 bug#27399: 26.0.50; Tooltips displayed on images in shr do not line wrap Adam Sjøgren
@ 2017-06-16 16:30 ` Eli Zaretskii
  2017-06-16 16:43   ` Stephen Berman
  2017-06-16 17:26   ` Adam Sjøgren
  0 siblings, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2017-06-16 16:30 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: 27399

> From: asjo@koldfront.dk (Adam Sjøgren)
> Date: Fri, 16 Jun 2017 18:05:27 +0200
> 
> 
> When displaying tooltips (the content of an HTML title attribute, for
> instance) with long texts, the text is not line wrapped.
> 
> Here is a screenshot from an xkcd comic, showing the problem:
> 
>  · https://koldfront.dk/misc/gnu-emacs//gnus_shr_long_titles_wasnt_this_fixed.png
> 
> Tooltip texts should be line wrapped, because otherwise you can't read
> the entire text. It used to be, as far as I remember, so this is
> probably a regression.

Are you sure you saw lines wrapping in tooltips?  AFAIR, text shown in
a tooltip should be preformatted to not require wrapping.





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

* bug#27399: 26.0.50; Tooltips displayed on images in shr do not line wrap
  2017-06-16 16:30 ` Eli Zaretskii
@ 2017-06-16 16:43   ` Stephen Berman
  2017-06-16 16:52     ` Stephen Berman
  2017-06-16 17:26   ` Adam Sjøgren
  1 sibling, 1 reply; 9+ messages in thread
From: Stephen Berman @ 2017-06-16 16:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Adam Sjøgren, 27399

On Fri, 16 Jun 2017 19:30:13 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: asjo@koldfront.dk (Adam Sjøgren)
>> Date: Fri, 16 Jun 2017 18:05:27 +0200
>> 
>> 
>> When displaying tooltips (the content of an HTML title attribute, for
>> instance) with long texts, the text is not line wrapped.
>> 
>> Here is a screenshot from an xkcd comic, showing the problem:
>> 
>>  · https://koldfront.dk/misc/gnu-emacs//gnus_shr_long_titles_wasnt_this_fixed.png
>> 
>> Tooltip texts should be line wrapped, because otherwise you can't read
>> the entire text. It used to be, as far as I remember, so this is
>> probably a regression.
>
> Are you sure you saw lines wrapping in tooltips?  AFAIR, text shown in
> a tooltip should be preformatted to not require wrapping.

From the screenshot this looks like it's using the GTK+ system tooltip,
and I can confirm the observation with x-gtk-use-system-tooltips set to
t (the default).  But when I set this variable to nil to use the builtin
Emacs tooltip, the tooltip does have wrapped lines.

Steve





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

* bug#27399: 26.0.50; Tooltips displayed on images in shr do not line wrap
  2017-06-16 16:43   ` Stephen Berman
@ 2017-06-16 16:52     ` Stephen Berman
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Berman @ 2017-06-16 16:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Adam Sjøgren, 27399

On Fri, 16 Jun 2017 18:43:24 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:

> On Fri, 16 Jun 2017 19:30:13 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
>
>>> From: asjo@koldfront.dk (Adam Sjøgren)
>>> Date: Fri, 16 Jun 2017 18:05:27 +0200
>>> 
>>> 
>>> When displaying tooltips (the content of an HTML title attribute, for
>>> instance) with long texts, the text is not line wrapped.
>>> 
>>> Here is a screenshot from an xkcd comic, showing the problem:
>>> 
>>>  · https://koldfront.dk/misc/gnu-emacs//gnus_shr_long_titles_wasnt_this_fixed.png
>>> 
>>> Tooltip texts should be line wrapped, because otherwise you can't read
>>> the entire text. It used to be, as far as I remember, so this is
>>> probably a regression.
>>
>> Are you sure you saw lines wrapping in tooltips?  AFAIR, text shown in
>> a tooltip should be preformatted to not require wrapping.
>
>> From the screenshot this looks like it's using the GTK+ system tooltip,
> and I can confirm the observation with x-gtk-use-system-tooltips set to
> t (the default).  But when I set this variable to nil to use the builtin
> Emacs tooltip, the tooltip does have wrapped lines.

To be more precise: with the built-in Emacs tooltips, the text of the
tooltip in the above screenshot is displayed in four lines, not with
word-wrapping but wrapping at the tooltip window's edge.

Steve Berman





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

* bug#27399: 26.0.50; Tooltips displayed on images in shr do not line wrap
  2017-06-16 16:30 ` Eli Zaretskii
  2017-06-16 16:43   ` Stephen Berman
@ 2017-06-16 17:26   ` Adam Sjøgren
  2017-06-22  1:16     ` Glenn Morris
  1 sibling, 1 reply; 9+ messages in thread
From: Adam Sjøgren @ 2017-06-16 17:26 UTC (permalink / raw)
  To: 27399

Eli writes:

>> When displaying tooltips (the content of an HTML title attribute, for
>> instance) with long texts, the text is not line wrapped.
>> 
>> Here is a screenshot from an xkcd comic, showing the problem:
>> 
>>  · https://koldfront.dk/misc/gnu-emacs//gnus_shr_long_titles_wasnt_this_fixed.png
>> 
>> Tooltip texts should be line wrapped, because otherwise you can't read
>> the entire text. It used to be, as far as I remember, so this is
>> probably a regression.

> Are you sure you saw lines wrapping in tooltips?  AFAIR, text shown in
> a tooltip should be preformatted to not require wrapping.

I'm pretty sure, I contributed a patch in 2014 implementing it in
shr.el:

 · http://article.gmane.org/gmane.emacs.devel/179964/

As a result a slightly way to fix the problem was committed by Lars:

 · http://article.gmane.org/gmane.emacs.devel/180011
 · http://git.savannah.gnu.org/cgit/emacs.git/commit/lisp/net/shr.el?id=76f9994d677e0440584216e4e47be37e2d3dc312

But it seems not to work any more.





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

* bug#27399: 26.0.50; Tooltips displayed on images in shr do not line wrap
  2017-06-16 17:26   ` Adam Sjøgren
@ 2017-06-22  1:16     ` Glenn Morris
  2017-06-22 14:45       ` Adam Sjøgren
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2017-06-22  1:16 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: 27399


I guess this broke in 656caef.

--- i/lisp/net/shr.el
+++ w/lisp/net/shr.el
@@ -512,6 +512,7 @@ shr-fill-text
                                        (* (frame-char-width) 2)
                                      0))))
 	(shr-insert text)
+	(shr-fill-lines (point-min) (point-max))
 	(buffer-string)))))
 
 (define-inline shr-char-breakable-p (char)





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

* bug#27399: 26.0.50; Tooltips displayed on images in shr do not line wrap
  2017-06-22  1:16     ` Glenn Morris
@ 2017-06-22 14:45       ` Adam Sjøgren
  2017-06-22 14:47         ` Adam Sjøgren
  0 siblings, 1 reply; 9+ messages in thread
From: Adam Sjøgren @ 2017-06-22 14:45 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 27399

Glenn writes:

> I guess this broke in 656caef.

Lars mentioned that it probably was broken during the proportional font
changes, so that sounds like you agree.

Your patch:

> --- i/lisp/net/shr.el
> +++ w/lisp/net/shr.el
> @@ -512,6 +512,7 @@ shr-fill-text
>                                         (* (frame-char-width) 2)
>                                       0))))
>  	(shr-insert text)
> +	(shr-fill-lines (point-min) (point-max))
>  	(buffer-string)))))

however, does not seem to work for me.

When I edebug-defun the function and step through it (point-min) and
(point-max) both return 1, which I don't know is the reason it doesn't
help, but it looked kind of suspicious to me.

I can send the messages when stepping through the function, if that is
of any use.


  Thanks for looking at this!

    Adam

-- 
 "I gotta go right now; someone is videotaping me in          Adam Sjøgren
  my spaceship"                                          asjo@koldfront.dk





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

* bug#27399: 26.0.50; Tooltips displayed on images in shr do not line wrap
  2017-06-22 14:45       ` Adam Sjøgren
@ 2017-06-22 14:47         ` Adam Sjøgren
  2017-06-22 18:13           ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Adam Sjøgren @ 2017-06-22 14:47 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 27399

Just as I sent the email, I realized I had messed up and applied your
patch wrong (I had it filling before inserting, d'oh). It works perfectly.

Thanks!

-- 
 "I do not find reading diffs in email to be a                Adam Sjøgren
  hardship, but I used to walk uphill both ways to       asjo@koldfront.dk
  school, so I dunno."





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

* bug#27399: 26.0.50; Tooltips displayed on images in shr do not line wrap
  2017-06-22 14:47         ` Adam Sjøgren
@ 2017-06-22 18:13           ` Glenn Morris
  0 siblings, 0 replies; 9+ messages in thread
From: Glenn Morris @ 2017-06-22 18:13 UTC (permalink / raw)
  To: 27399-done

Version: 26.1

Applied as 18896f7.





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

end of thread, other threads:[~2017-06-22 18:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-16 16:05 bug#27399: 26.0.50; Tooltips displayed on images in shr do not line wrap Adam Sjøgren
2017-06-16 16:30 ` Eli Zaretskii
2017-06-16 16:43   ` Stephen Berman
2017-06-16 16:52     ` Stephen Berman
2017-06-16 17:26   ` Adam Sjøgren
2017-06-22  1:16     ` Glenn Morris
2017-06-22 14:45       ` Adam Sjøgren
2017-06-22 14:47         ` Adam Sjøgren
2017-06-22 18:13           ` Glenn Morris

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