Subject: bug#24034: closed (Re: bug#24034: 25.0.95; shr-fill-line multiplies the number of images)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 20 Jul 2016 22:58:02 +0000

Your bug report

#24034: 25.0.95; shr-fill-line multiplies the number of images

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
24034: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24034
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#24034: 25.0.95; shr-fill-line multiplies the number of images
From: Katsumi Yamaoka <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Thu, 21 Jul 2016 07:57:12 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

On Wed, 20 Jul 2016 12:31:56 +0200, Lars Ingebrigtsen wrote:
> Katsumi Yamaoka <[email-masked]> writes:

>> 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?

> Yes, I think so.

Done.  Thanks.

Subject: 25.0.95; shr-fill-line multiplies the number of images
From: Katsumi Yamaoka <[email-masked]>
To: [email-masked]
Date: Wed, 20 Jul 2016 19:28:11 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

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,

--- 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 " $")