unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: 24034@debbugs.gnu.org
Subject: bug#24034: 25.0.95; shr-fill-line multiplies the number of images
Date: Wed, 20 Jul 2016 19:28:11 +0900	[thread overview]
Message-ID: <b4meg6o4n9g.fsf@jpl.org> (raw)

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

Hi,

If `gnus-inhibit-images' is t, shr shows the alt text of an image
in the article buffer.  If the alt text is long, `shr-fill-line'
devides it into two or more lines, and each line will get to
have a link to the image individually.  In that case, those
number of images will be displayed when a user invokes the WDW
command (gnus-article-show-images) even if there should be only
a single image.

The cause of this problem is that `shr-fill-line' divides not
only the alt text but also the `image-url' text property.  So,
I'd like to install the following change.  This is the right
fix, isn't it?

Regards,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 661 bytes --]

--- shr.el~	2016-03-21 22:00:40.983451400 +0000
+++ shr.el	2016-07-20 10:26:30.487350400 +0000
@@ -636,13 +636,12 @@
       ;; Success; continue.
       (when (= (preceding-char) ?\s)
 	(delete-char -1))
-      (let ((face (get-text-property (point) 'face))
+      (let ((props (text-properties-at (point)))
 	    (background-start (point)))
 	(insert "\n")
 	(shr-indent)
-	(when face
-	  (put-text-property background-start (point) 'face
-			     `,(shr-face-background face))))
+	(when props
+	  (add-text-properties background-start (point) props)))
       (setq start (point))
       (shr-vertical-motion shr-internal-width)
       (when (looking-at " $")

             reply	other threads:[~2016-07-20 10:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 10:28 Katsumi Yamaoka [this message]
2016-07-20 10:31 ` bug#24034: 25.0.95; shr-fill-line multiplies the number of images Lars Ingebrigtsen
2016-07-20 22:57   ` Katsumi Yamaoka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4meg6o4n9g.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=24034@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).