From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 29 02:55:58 2014 Received: (at submit) by debbugs.gnu.org; 29 Dec 2014 07:55:58 +0000 Received: from localhost ([127.0.0.1]:60057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5VBF-0003HQ-I9 for submit@debbugs.gnu.org; Mon, 29 Dec 2014 02:55:58 -0500 Received: from fely.am-1.org ([78.47.74.50]:46752) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5VBA-0003HC-VM for submit@debbugs.gnu.org; Mon, 29 Dec 2014 02:55:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:Sender:References:Subject:To:From; bh=j5Ah89uGzXGjGM6lD+/JEKl/Jb1hMCSeHD+Gqrne5Sc=; b=ZzTZeEGAuWrQcrLxHNaiOzDaivhDLVQ6ri7fwjBfxWkW+TlRq8bmialOxHkoHr7m8DAtiTU1G6/j8Du7Ha3zKaskQwWVpwDtzFdGDwGkHXxkNnC1AUOz45f8onnNdlrcay6Ho61mLIMh2aLZ+df4eooM0ua+lXjCniNHlHpmToA=; Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Y5VB7-0005UG-Nm for submit@debbugs.gnu.org; Mon, 29 Dec 2014 07:55:50 +0000 Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Y5VB0-0001Ld-Bx for submit@debbugs.gnu.org; Mon, 29 Dec 2014 14:55:42 +0700 From: Ivan Shmakov To: submit@debbugs.gnu.org Subject: shr: use wrap-prefix when possible, instead of filling the text References: <87ioh4nf8k.fsf@ferrier.me.uk> <83y4pzptpx.fsf@gnu.org> <871tnr1gqo.fsf@ferrier.me.uk> <83bnmvowdb.fsf@gnu.org> <83ppbanqhe.fsf@gnu.org> <87vbl2xigp.fsf@ferrier.me.uk> <83ioh2nlow.fsf@gnu.org> <87sig6xech.fsf@ferrier.me.uk> <83fvc5ni0u.fsf@gnu.org> <87k31fwwyv.fsf@ferrier.me.uk> <87bnmq9ibf.fsf@ferrier.me.uk> <87lhlrx5fc.fsf@building.gnus.org> <878uhrcr5l.fsf@building.gnus.org> <83sifzjflk.fsf@gnu.org> Date: Mon, 29 Dec 2014 07:55:41 +0000 In-Reply-To: <83sifzjflk.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 29 Dec 2014 05:32:23 +0200") Message-ID: <87egric2ki.fsf_-_@violet.siamics.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Package: emacs Severity: wishlist X-Debbugs-Cc: emacs-devel@gnu.org >>>>> Eli Zaretskii writes: >>>>> From: Lars Ingebrigtsen Date: Mon, 29 Dec 2014 00:04:38 +0100 >> (Yes, Emacs can display proportional fonts and fonts of different >> sizes, but until you can fold (etc) proportional text (and text with >> a mixture of font sizes) in a pretty manner, that's more of a toy >> than anything else.) > What's non-pretty with how we do this now? What features are > missing? The only feature that I=E2=80=99m aware to be missing is the actual support for Emacs native text wrapping (as in: the word-wrap variable and wrap-prefix text property) in SHR. Please thus consider the patch MIMEd. * lisp/net/shr.el (shr-force-fill): New variable to disable this feature if needed. (shr-internal-width): Defer initialization until... (shr-insert-document): ... here; set to nil if neither shr-force-fill nor shr-width are non-nil. (shr-fold-text, shr-tag-table-1): Likewise. (shr-insert): Use insert-and-inherit; do not fill if shr-internal-width is nil. (shr-setup-wrap): New function. (shr-indent, shr-tag-blockquote, shr-tag-dd, shr-tag-li): Call shr-setup-wrap. (shr-tag-hr): Use a constant if shr-internal-width is nil. A test case is also MIMEd. The buffer it produces shows the text being dynamically filled as the window width changes (as in: C-x 3, for instance.) The table rendering is not changed in any way. --=20 FSF associate member #7257 http://boycottsystemd.org/ =E2=80=A6 3013 B6A0= 230E 334A --=-=-= Content-Type: text/diff; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 26bb292..e634a5a 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -128,13 +128,16 @@ (defvar shr-inhibit-images nil "If non-nil, inhibit loading images.") =20 +(defvar shr-force-fill nil + "If non-nil, fill text even in the cases Emacs can wrap it by itself.") + ;;; Internal variables. =20 (defvar shr-folding-mode nil) (defvar shr-state nil) (defvar shr-start nil) (defvar shr-indentation 0) -(defvar shr-internal-width (or shr-width (1- (window-width)))) +(defvar shr-internal-width nil) ; set in shr-insert-document (defvar shr-list-mode nil) (defvar shr-content-cache nil) (defvar shr-kinsoku-shorten nil) @@ -206,7 +209,8 @@ defun shr-insert-document (dom) (shr-base nil) (shr-depth 0) (shr-warning nil) - (shr-internal-width (or shr-width (1- (window-width))))) + (shr-internal-width + (or shr-width (and shr-force-fill (1- (window-width)))))) (shr-descend dom) (shr-remove-trailing-whitespace start (point)) (when shr-warning @@ -420,7 +424,8 @@ defun shr-fold-text (text) (let ((shr-indentation 0) (shr-state nil) (shr-start nil) - (shr-internal-width (window-width))) + (shr-internal-width (and shr-force-fill + (1- (window-width))))) (shr-insert text) (buffer-string))))) =20 @@ -454,12 +459,14 @@ defun shr-insert (text) (setq shr-state nil)) (cond ((eq shr-folding-mode 'none) - (insert text)) + (insert-and-inherit text)) (t + ;; We generally use insert-and-inherit below so to inherit the + ;; wrap-prefix property, if any. See shr-setup-wrap. (when (and (string-match "\\`[ \t\n=C2=A0]" text) (not (bolp)) (not (eq (char-after (1- (point))) ? ))) - (insert " ")) + (insert-and-inherit " ")) (dolist (elem (split-string text "[ \f\t\n\r\v=C2=A0]+" t)) (when (and (bolp) (> shr-indentation 0)) @@ -482,17 +489,18 @@ defun shr-insert (text) ;; starts. (unless shr-start (setq shr-start (point))) - (insert elem) + (insert-and-inherit elem) (setq shr-state nil) (let (found) - (while (and (> (current-column) shr-internal-width) + (while (and shr-internal-width ; Use Emacs native wrapping if nil. + (> (current-column) shr-internal-width) (> shr-internal-width 0) (progn (setq found (shr-find-fill-point)) (not (eolp)))) (when (eq (preceding-char) ? ) (delete-char -1)) - (insert "\n") + (insert-and-inherit "\n") (unless found ;; No space is needed at the beginning of a line. (when (eq (following-char) ? ) @@ -500,11 +508,12 @@ defun shr-insert (text) (when (> shr-indentation 0) (shr-indent)) (end-of-line)) - (if (<=3D (current-column) shr-internal-width) - (insert " ") + (if (or (not shr-internal-width) + (<=3D (current-column) shr-internal-width)) + (insert-and-inherit " ") ;; In case we couldn't get a valid break point (because of a ;; word that's longer than `shr-internal-width'), just break anyway. - (insert "\n") + (insert-and-inherit "\n") (when (> shr-indentation 0) (shr-indent))))) (unless (string-match "[ \t\r\n=C2=A0]\\'" text) @@ -663,7 +672,17 @@ =20 (defun shr-indent () (when (> shr-indentation 0) - (insert (make-string shr-indentation ? )))) + (insert (make-string shr-indentation ? )) + (shr-setup-wrap))) + +(defun shr-setup-wrap () + (when (> shr-indentation 0) + ;; The wrap-prefix property is sticky; abuse that here. We use + ;; this after at least shr-indent (or within it), so we may safely + ;; assume that there is at least one character before the point. + (put-text-property (+ -1 (point)) (point) + 'wrap-prefix + `(space :align-to ,shr-indentation)))) =20 (defun shr-fontize-dom (dom &rest types) (let (shr-start) @@ -1309,6 +1334,7 @@ defun shr-tag-blockquote (dom) (shr-ensure-paragraph) (shr-indent) (let ((shr-indentation (+ shr-indentation 4))) + (shr-setup-wrap) (shr-generic dom)) (shr-ensure-paragraph)) =20 @@ -1325,6 +1351,7 @@ (defun shr-tag-dd (dom) (shr-ensure-newline) (let ((shr-indentation (+ shr-indentation 4))) + (shr-setup-wrap) (shr-generic dom))) =20 (defun shr-tag-ul (dom) @@ -1350,6 +1377,7 @@ defun shr-tag-li (dom) shr-bullet)) (shr-indentation (+ shr-indentation (length bullet)))) (insert bullet) + (shr-setup-wrap) (shr-generic dom))) =20 (defun shr-tag-br (dom) @@ -1386,7 +1414,8 @@ =20 (defun shr-tag-hr (_dom) (shr-ensure-newline) - (insert (make-string shr-internal-width shr-hr-line) "\n")) + (insert (make-string (or shr-internal-width 31) ; FIXME: magic + shr-hr-line) "\n")) =20 (defun shr-tag-title (dom) (shr-heading dom 'bold 'underline)) @@ -1414,6 +1443,7 @@ (defun shr-tag-table-1 (dom) (setq dom (or (dom-child-by-tag dom 'tbody) dom)) (let* ((shr-inhibit-images t) + (shr-internal-width (or shr-internal-width (1- (window-width)))) (shr-table-depth (1+ shr-table-depth)) (shr-kinsoku-shorten t) ;; Find all suggested widths. --=-=-= Content-Type: text/emacs-lisp Content-Disposition: inline (with-current-buffer (generate-new-buffer "*shr*") (setq-local shr-width nil) (setq-local word-wrap t) (setq-local truncate-partial-width-windows nil) (shr-insert-document '(base ((href . "https://example.com/")) (html nil (head nil (title nil "Lorem ipsum")) (body nil (hr nil) (ol nil (li ((lang . "la")) "Lorem ipsum dolor sit amet, consectetur adipisicing" " elit, sed do eiusmod tempor incididunt ut labore et" " dolore magna aliqua. Ut enim ad minim veniam, quis" " nostrud exercitation ullamco laboris nisi ut" " aliquip ex ea commodo consequat. Duis aute irure" " dolor in reprehenderit in voluptate velit esse" " cillum dolore eu fugiat nulla pariatur. Excepteur" " sint occaecat cupidatat non proident, sunt in culpa" " qui officia deserunt mollit anim id est laborum.")))))) (pop-to-buffer (current-buffer))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 29 04:01:04 2014 Received: (at control) by debbugs.gnu.org; 29 Dec 2014 09:01:04 +0000 Received: from localhost ([127.0.0.1]:60183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5WCG-00050s-FI for submit@debbugs.gnu.org; Mon, 29 Dec 2014 04:01:04 -0500 Received: from fely.am-1.org ([78.47.74.50]:46761) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5WCD-00050J-N4 for control@debbugs.gnu.org; Mon, 29 Dec 2014 04:01:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Sender:Subject:To:From; bh=1siiA8qGfEwATDrcsznszeE9vWtzeRu014lFZeJpj0g=; b=GmLdqCa0w0aOvakXKbvs4MxSN0dDhn7hxIlqeS6ccdqmj+pOMa2DyVv52l8oD1hKIjF9iKJ9Y+yJIzRsjkushh3MZiTeOUs2y9XC9rWB1AwRX6jPo99KYsnAqq2lIuadXaTLItpr7F+muFU4INZUzlT8+kjb4nbgcXbsyFfjEIE=; Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Y5WCC-0005wY-9p for control@debbugs.gnu.org; Mon, 29 Dec 2014 09:01:00 +0000 Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Y5WC4-0001Tq-8x for control@debbugs.gnu.org; Mon, 29 Dec 2014 16:00:52 +0700 From: Ivan Shmakov To: control@debbugs.gnu.org Subject: tweaking bugs Mail-Followup-To: emacs-devel@gnu.org Date: Mon, 29 Dec 2014 09:00:51 +0000 Message-ID: <87a926bzjw.fsf@violet.siamics.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) tags 19462 + patch tags 19274 + patch tags 19140 + patch tags 16002 + patch fixed 19435 24.5 thanks The code suggested in #16002 already works; it=E2=80=99s only the matter of where to put it in. (Or not.) --=20 FSF associate member #7257 http://boycottsystemd.org/ =E2=80=A6 3013 B6A0= 230E 334A From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 29 04:55:30 2014 Received: (at 19462) by debbugs.gnu.org; 29 Dec 2014 09:55:30 +0000 Received: from localhost ([127.0.0.1]:60205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5X2v-0007kx-4w for submit@debbugs.gnu.org; Mon, 29 Dec 2014 04:55:30 -0500 Received: from fely.am-1.org ([78.47.74.50]:46768) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5X2s-0007kk-DL for 19462@debbugs.gnu.org; Mon, 29 Dec 2014 04:55:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:Sender:References:Subject:Cc:To:From; bh=zG9atMrNG0NoT/IzWuHEhh//1TwfmKM46bxZ4Vh07OM=; b=Auq1kN/8guut2t6XmEX88neDJO9eViyvYxvOQULPh1nilvYarG8M28rOzwuUKtRB5DU2jPdDWYenXBleH8+vb9WOCNLipmLqqAJkBtjR1sigilscBaMU1k42A4Lj5fEDK+c/q1eCKNX9qDe5blFJABpMsW4IA8jLAQTeVftbBJU=; Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Y5X2p-0006sr-4n; Mon, 29 Dec 2014 09:55:23 +0000 Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Y5X2h-0001Zm-Ro; Mon, 29 Dec 2014 16:55:15 +0700 From: Ivan Shmakov To: 19462@debbugs.gnu.org Subject: Re: bug#19462: shr: use wrap-prefix when possible, instead of filling the text References: <83y4pzptpx.fsf@gnu.org> <871tnr1gqo.fsf@ferrier.me.uk> <83bnmvowdb.fsf@gnu.org> <83ppbanqhe.fsf@gnu.org> <87vbl2xigp.fsf@ferrier.me.uk> <83ioh2nlow.fsf@gnu.org> <87sig6xech.fsf@ferrier.me.uk> <83fvc5ni0u.fsf@gnu.org> <87k31fwwyv.fsf@ferrier.me.uk> <87bnmq9ibf.fsf@ferrier.me.uk> <87lhlrx5fc.fsf@building.gnus.org> <878uhrcr5l.fsf@building.gnus.org> <83sifzjflk.fsf@gnu.org> <87egric2ki.fsf_-_@violet.siamics.net> Date: Mon, 29 Dec 2014 09:55:15 +0000 In-Reply-To: <87egric2ki.fsf_-_@violet.siamics.net> (Ivan Shmakov's message of "Mon, 29 Dec 2014 07:55:41 +0000") Message-ID: <8761cubx18.fsf@violet.siamics.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 19462 Cc: emacs-devel@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable As it seems, the initial version of the patch didn=E2=80=99t play well with other essential shr.el features (as in: hyperlinks.) Please thus consider the revised patch MIMEd. * lisp/net/shr.el (shr-force-fill): New variable to disable this feature if needed. (shr-internal-width): Defer initialization until... (shr-insert-document): ... here; set to nil if neither shr-force-fill nor shr-width are non-nil. (shr-fold-text, shr-tag-table-1): Likewise. (shr-insert): Do not fill if shr-internal-width is nil. (shr-setup-wrap-1, shr-setup-wrap): New function. (shr-tag-blockquote, shr-tag-dd, shr-tag-li): Call shr-setup-wrap. (shr-tag-hr): Use a constant if shr-internal-width is nil. The other so far unresolved issue with this approach is that the tables and
 elements may actually require truncate-lines.
	Unfortunately, I know of no way to allow for word-wrapped and
	truncated lines to exist in the same buffer; I guess we may need
	either a truncate-lines or word-wrap property (or both) to
	override the buffer-local variables in this case.

	Similarly to wrap-prefix, we may also use line-prefix in place
	of shr-indent.  But that may not be a good idea if quoting
	text/html messages in text/plain replies, for instance.

--=20
FSF associate member #7257  http://boycottsystemd.org/  =E2=80=A6 3013 B6A0=
 230E 334A

--=-=-=
Content-Type: text/diff
Content-Disposition: inline

--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -128,13 +128,16 @@
 (defvar shr-inhibit-images nil
   "If non-nil, inhibit loading images.")
 
+(defvar shr-force-fill nil
+  "If non-nil, fill text even in the cases Emacs can wrap it by itself.")
+
 ;;; Internal variables.
 
 (defvar shr-folding-mode nil)
 (defvar shr-state nil)
 (defvar shr-start nil)
 (defvar shr-indentation 0)
-(defvar shr-internal-width (or shr-width (1- (window-width))))
+(defvar shr-internal-width nil)		; set in shr-insert-document
 (defvar shr-list-mode nil)
 (defvar shr-content-cache nil)
 (defvar shr-kinsoku-shorten nil)
@@ -206,7 +209,8 @@ defun shr-insert-document (dom)
 	(shr-base nil)
 	(shr-depth 0)
 	(shr-warning nil)
-	(shr-internal-width (or shr-width (1- (window-width)))))
+	(shr-internal-width
+	 (or shr-width (and shr-force-fill (1- (window-width))))))
     (shr-descend dom)
     (shr-remove-trailing-whitespace start (point))
     (when shr-warning
@@ -420,7 +424,8 @@ defun shr-fold-text (text)
       (let ((shr-indentation 0)
 	    (shr-state nil)
 	    (shr-start nil)
-	    (shr-internal-width (window-width)))
+	    (shr-internal-width (and shr-force-fill
+				     (1- (window-width)))))
 	(shr-insert text)
 	(buffer-string)))))
 
@@ -485,7 +490,8 @@ defun shr-insert (text)
       (insert elem)
       (setq shr-state nil)
       (let (found)
-	(while (and (> (current-column) shr-internal-width)
+	(while (and shr-internal-width	; Use Emacs native wrapping if nil.
+		    (> (current-column) shr-internal-width)
 		    (> shr-internal-width 0)
 		    (progn
 		      (setq found (shr-find-fill-point))
@@ -500,7 +506,8 @@ defun shr-insert (text)
 	  (when (> shr-indentation 0)
 	    (shr-indent))
 	  (end-of-line))
-	(if (<= (current-column) shr-internal-width)
+	(if (or (not shr-internal-width)
+		(<= (current-column) shr-internal-width))
 	    (insert " ")
 	  ;; In case we couldn't get a valid break point (because of a
 	  ;; word that's longer than `shr-internal-width'), just break anyway.
@@ -665,6 +672,23 @@
   (when (> shr-indentation 0)
     (insert (make-string shr-indentation ? ))))
 
+(defun shr-setup-wrap-1 (from to pval)
+  (put-text-property from to 'wrap-prefix pval))
+
+(defun shr-setup-wrap (from to)
+  (let ((prev from)
+	(pos  (next-property-change from nil to))
+	(pval (and (> shr-indentation 0)
+		   `(space :align-to ,shr-indentation))))
+    (while (and pos (> pos prev))
+      (unless (get-text-property prev 'wrap-prefix)
+	(shr-setup-wrap-1 prev pos pval))
+      (setq prev pos
+	    pos  (next-property-change pos nil to)))
+    (unless (or (<= to prev)
+		(get-text-property prev 'wrap-prefix))
+	(shr-setup-wrap-1 prev to pval))))
+
 (defun shr-fontize-dom (dom &rest types)
   (let (shr-start)
     (shr-generic dom)
@@ -1308,8 +1338,10 @@
 (defun shr-tag-blockquote (dom)
   (shr-ensure-paragraph)
   (shr-indent)
-  (let ((shr-indentation (+ shr-indentation 4)))
-    (shr-generic dom))
+  (let ((from (point))
+	(shr-indentation (+ shr-indentation 4)))
+    (shr-generic dom)
+    (shr-setup-wrap from (point)))
   (shr-ensure-paragraph))
 
 (defun shr-tag-dl (dom)
@@ -1324,8 +1356,10 @@
 
 (defun shr-tag-dd (dom)
   (shr-ensure-newline)
-  (let ((shr-indentation (+ shr-indentation 4)))
-    (shr-generic dom)))
+  (let ((from (point))
+	(shr-indentation (+ shr-indentation 4)))
+    (shr-generic dom)
+    (shr-setup-wrap from (point))))
 
 (defun shr-tag-ul (dom)
   (shr-ensure-paragraph)
@@ -1348,9 +1382,11 @@ defun shr-tag-li (dom)
 		  (format "%d " shr-list-mode)
 		(setq shr-list-mode (1+ shr-list-mode)))
 	    shr-bullet))
+	 (from (point))
 	 (shr-indentation (+ shr-indentation (length bullet))))
     (insert bullet)
-    (shr-generic dom)))
+    (shr-generic dom)
+    (shr-setup-wrap from (point))))
 
 (defun shr-tag-br (dom)
   (when (and (not (bobp))
@@ -1386,7 +1422,8 @@
 
 (defun shr-tag-hr (_dom)
   (shr-ensure-newline)
-  (insert (make-string shr-internal-width shr-hr-line) "\n"))
+  (insert (make-string (or shr-internal-width 31) ; FIXME: magic
+		       shr-hr-line) "\n"))
 
 (defun shr-tag-title (dom)
   (shr-heading dom 'bold 'underline))
@@ -1414,6 +1451,7 @@
 (defun shr-tag-table-1 (dom)
   (setq dom (or (dom-child-by-tag dom 'tbody) dom))
   (let* ((shr-inhibit-images t)
+	 (shr-internal-width (or shr-internal-width (1- (window-width))))
 	 (shr-table-depth (1+ shr-table-depth))
 	 (shr-kinsoku-shorten t)
 	 ;; Find all suggested widths.

--=-=-=--




From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 25 12:35:11 2015
Received: (at 19462) by debbugs.gnu.org; 25 Dec 2015 17:35:11 +0000
Received: from localhost ([127.0.0.1]:35208 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from )
	id 1aCWGl-0001ob-48
	for submit@debbugs.gnu.org; Fri, 25 Dec 2015 12:35:11 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:34904)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from ) id 1aCWGk-0001oT-6N
 for 19462@debbugs.gnu.org; Fri, 25 Dec 2015 12:35:10 -0500
Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from )
 id 1aCWGN-0001qf-Gw; Fri, 25 Dec 2015 18:34:47 +0100
From: Lars Ingebrigtsen 
To: Ivan Shmakov 
Subject: Re: bug#19462: shr: use wrap-prefix when possible,
 instead of filling the text
References: 
 <83y4pzptpx.fsf@gnu.org> <871tnr1gqo.fsf@ferrier.me.uk>
 <83bnmvowdb.fsf@gnu.org> 
 <83ppbanqhe.fsf@gnu.org> <87vbl2xigp.fsf@ferrier.me.uk>
 <83ioh2nlow.fsf@gnu.org> <87sig6xech.fsf@ferrier.me.uk>
 <83fvc5ni0u.fsf@gnu.org> 
 <87k31fwwyv.fsf@ferrier.me.uk> 
 <87bnmq9ibf.fsf@ferrier.me.uk> 
 
 <87lhlrx5fc.fsf@building.gnus.org>
 
 <878uhrcr5l.fsf@building.gnus.org> <83sifzjflk.fsf@gnu.org>
 <87egric2ki.fsf_-_@violet.siamics.net>
Date: Fri, 25 Dec 2015 18:34:46 +0100
In-Reply-To: <87egric2ki.fsf_-_@violet.siamics.net> (Ivan Shmakov's message of
 "Mon, 29 Dec 2014 07:55:41 +0000")
Message-ID: <87bn9ezb2h.fsf@gnus.org>
User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-MailScanner-ID: 1aCWGN-0001qf-Gw
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@gnus.org
MailScanner-NULL-Check: 1451669688.05674@H7ceWIVYSIzieUWMVnfA2g
X-Spam-Status: No
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 19462
Cc: 19462@debbugs.gnu.org, emacs-devel@gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: -0.7 (/)

Ivan Shmakov  writes:

>  >> (Yes, Emacs can display proportional fonts and fonts of different
>  >> sizes, but until you can fold (etc) proportional text (and text with
>  >> a mixture of font sizes) in a pretty manner, that's more of a toy
>  >> than anything else.)
>
>  > What's non-pretty with how we do this now?  What features are
>  > missing?
>
> 	The only feature that I=92m aware to be missing is the actual
> 	support for Emacs native text wrapping (as in: the word-wrap
> 	variable and wrap-prefix text property) in SHR.
>
> 	Please thus consider the patch MIMEd.

I think this was superseded by the shr proportional font rewrite, so I'm
closing the bug.

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 25 12:35:34 2015
Received: (at control) by debbugs.gnu.org; 25 Dec 2015 17:35:34 +0000
Received: from localhost ([127.0.0.1]:35211 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from )
	id 1aCWH8-0001pC-Bh
	for submit@debbugs.gnu.org; Fri, 25 Dec 2015 12:35:34 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:34916)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from ) id 1aCWH6-0001p5-Q1
 for control@debbugs.gnu.org; Fri, 25 Dec 2015 12:35:33 -0500
Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from ) id 1aCWGl-0001rj-UK
 for control@debbugs.gnu.org; Fri, 25 Dec 2015 18:35:12 +0100
Date: Fri, 25 Dec 2015 18:35:11 +0100
Message-Id: <87a8oyzb1s.fsf@gnus.org>
To: control@debbugs.gnu.org
From: Lars Ingebrigtsen 
Subject: control message for bug #19462
X-MailScanner-ID: 1aCWGl-0001rj-UK
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@gnus.org
MailScanner-NULL-Check: 1451669712.15176@EUNktCbKuRLXE6IKbjjL3w
X-Spam-Status: No
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: -0.7 (/)

close 19462 




From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 25 17:51:24 2015
Received: (at 19462) by debbugs.gnu.org; 25 Dec 2015 22:51:24 +0000
Received: from localhost ([127.0.0.1]:35818 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from )
	id 1aCbCl-0004K2-VE
	for submit@debbugs.gnu.org; Fri, 25 Dec 2015 17:51:24 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:35392)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from ) id 1aCbCk-0004Jv-EP
 for 19462@debbugs.gnu.org; Fri, 25 Dec 2015 17:51:22 -0500
Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from )
 id 1aCbCR-0005x3-DS; Fri, 25 Dec 2015 23:51:03 +0100
From: Lars Ingebrigtsen 
To: =?iso-8859-1?Q?Cl=E9ment?= Pit--Claudel 
Subject: Re: bug#19462: shr: use wrap-prefix when possible,
 instead of filling the text
In-Reply-To: <567DC781.8040306@gmail.com> (=?iso-8859-1?Q?=22Cl=E9ment?=
 Pit--Claudel"'s message of "Fri, 25 Dec 2015 23:47:29 +0100")
References: 
 <83ppbanqhe.fsf@gnu.org> <87vbl2xigp.fsf@ferrier.me.uk>
 <83ioh2nlow.fsf@gnu.org> <87sig6xech.fsf@ferrier.me.uk>
 <83fvc5ni0u.fsf@gnu.org> 
 <87k31fwwyv.fsf@ferrier.me.uk> 
 <87bnmq9ibf.fsf@ferrier.me.uk> 
 
 <87lhlrx5fc.fsf@building.gnus.org>
 
 <878uhrcr5l.fsf@building.gnus.org> <83sifzjflk.fsf@gnu.org>
 <87egric2ki.fsf_-_@violet.siamics.net> <87bn9ezb2h.fsf@gnus.org>
 <567D8E43.8030408@gmail.com> <87y4ciwe6g.fsf@gnus.org>
 <567DC781.8040306@gmail.com>
User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux)
Date: Fri, 25 Dec 2015 23:51:02 +0100
Message-ID: <87lh8iuoq1.fsf@gnus.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MailScanner-ID: 1aCbCR-0005x3-DS
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@gnus.org
MailScanner-NULL-Check: 1451688663.59708@MOwv9REbd/uPCE5x+XAZ0w
X-Spam-Status: No
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 19462
Cc: 19462@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: -0.7 (/)

Cl=E9ment Pit--Claudel  writes:

> I do not know how to do this, but it sounds like a convenient
> solution! How does one tell shr to apply a particular font to its
> target (all that I know of is `shr-target-id', which seems to insert a
> '*')?

Look at `shr-tag-h1', for instance, and create whatever similar version
of that you want by overriding with `shr-external-rendering-functions'.

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 26 04:13:19 2015
Received: (at 19462) by debbugs.gnu.org; 26 Dec 2015 09:13:19 +0000
Received: from localhost ([127.0.0.1]:36745 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from )
	id 1aCkuZ-0001EC-LV
	for submit@debbugs.gnu.org; Sat, 26 Dec 2015 04:13:19 -0500
Received: from fely.am-1.org ([78.47.74.50]:60320)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from ) id 1aCkuU-0001E1-Ad
 for 19462@debbugs.gnu.org; Sat, 26 Dec 2015 04:13:14 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net;
 s=a2013295; 
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:Sender:References:Subject:To:From;
 bh=Ci2ozOXcHEIri0/jx6oVnJxKHCIss+iSUytZqUxkDUw=; 
 b=iCz8kxrgDbO+qi7CHCbZBUsTt//fNOsAvMoymewa7pwTpo/RQFtKi/S2v9adRMwtppbSfDOAa42dNjT6dA6L+kYHJghId7EwW/iN3HPJB9rMroQ1boWIfShFxQJ9LnRyaLnVJHSXdoBpgkvmlBYNW8rV5FAAmMjOn+lySs9c5Fc=;
Received: from violet.siamics.net ([2001:470:1f13:1eb::1:1d])
 by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128)
 (Exim 4.80) (envelope-from )
 id 1aCkuT-0000Wo-H0; Sat, 26 Dec 2015 09:13:09 +0000
Received: from localhost ([::1] helo=violet.siamics.net)
 by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.80) (envelope-from )
 id 1aCkuM-0000Yv-Nn; Sat, 26 Dec 2015 16:13:02 +0700
From: Ivan Shmakov 
To: 19462@debbugs.gnu.org, emacs-devel@gnu.org
Subject: Re: bug#19462: shr: use wrap-prefix when possible,
 instead of filling the text 
References: 
 <871tnr1gqo.fsf@ferrier.me.uk> <83bnmvowdb.fsf@gnu.org>
  <83ppbanqhe.fsf@gnu.org>
 <87vbl2xigp.fsf@ferrier.me.uk> <83ioh2nlow.fsf@gnu.org>
 <87sig6xech.fsf@ferrier.me.uk> <83fvc5ni0u.fsf@gnu.org>
  <87k31fwwyv.fsf@ferrier.me.uk>
  <87bnmq9ibf.fsf@ferrier.me.uk>
 
 
 <87lhlrx5fc.fsf@building.gnus.org>
 
 <878uhrcr5l.fsf@building.gnus.org> <83sifzjflk.fsf@gnu.org>
 <87egric2ki.fsf_-_@violet.siamics.net>
 <87bn9ezb2h.fsf__43673.6617972658$1451064984$gmane$org@gnus.org>
Date: Sat, 26 Dec 2015 09:13:02 +0000
In-Reply-To: <87bn9ezb2h.fsf__43673.6617972658$1451064984$gmane$org@gnus.org>
 (Lars Ingebrigtsen's message of "Fri, 25 Dec 2015 18:34:46 +0100")
Message-ID: <87io3lzi75.fsf@violet.siamics.net>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 19462
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: 0.7 (/)

>>>>> Lars Ingebrigtsen  writes:
>>>>> Ivan Shmakov  writes:

[=E2=80=A6]

 >> The only feature that I=E2=80=99m aware to be missing is the actual sup=
port
 >> for Emacs native text wrapping (as in: the word-wrap variable and
 >> wrap-prefix text property) in SHR.

 >> Please thus consider the patch MIMEd.

 > I think this was superseded by the shr proportional font rewrite, so
 > I'm closing the bug.

	I=E2=80=99ve stopped using the SHR version that comes with Emacs this
	May, so I don=E2=80=99t think I care much about that any longer.

	I have several items in my wishlist regarding rendering HTML in
	Emacs buffers, but I guess they will warrant writing the code
	anew, presumably to be released under a different name, so that
	it can be installed alongside SHR.

	(Not that I currently have much spare time to dedicate to that.)

--=20
FSF associate member #7257  http://am-1.org/~ivan/      =E2=80=A6 3013 B6A0=
 230E 334A




From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 26 13:30:55 2015
Received: (at 19462) by debbugs.gnu.org; 26 Dec 2015 18:30:55 +0000
Received: from localhost ([127.0.0.1]:42094 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from )
	id 1aCtcF-0000nI-Ac
	for submit@debbugs.gnu.org; Sat, 26 Dec 2015 13:30:55 -0500
Received: from mout.kundenserver.de ([212.227.17.13]:63053)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from ) id 1aCs6K-0000i3-GL
 for 19462@debbugs.gnu.org; Sat, 26 Dec 2015 11:53:52 -0500
Received: from [192.168.1.82] ([109.24.225.43]) by mrelayeu.kundenserver.de
 (mreue104) with ESMTPSA (Nemesis) id 0Mb9Rr-1ZsjkQ3vAJ-00Ki9A; Sat, 26 Dec
 2015 17:53:46 +0100
Subject: Re: bug#19462: shr: use wrap-prefix when possible, instead of filling
 the text
To: Lars Ingebrigtsen 
References: 
 <83ppbanqhe.fsf@gnu.org> <87vbl2xigp.fsf@ferrier.me.uk>
 <83ioh2nlow.fsf@gnu.org> <87sig6xech.fsf@ferrier.me.uk>
 <83fvc5ni0u.fsf@gnu.org> 
 <87k31fwwyv.fsf@ferrier.me.uk> 
 <87bnmq9ibf.fsf@ferrier.me.uk> 
  <87lhlrx5fc.fsf@building.gnus.org>
  <878uhrcr5l.fsf@building.gnus.org>
 <83sifzjflk.fsf@gnu.org> <87egric2ki.fsf_-_@violet.siamics.net>
 <87bn9ezb2h.fsf@gnus.org> <567D8E43.8030408@gmail.com>
 <87y4ciwe6g.fsf@gnus.org> <567DC781.8040306@gmail.com>
 <87lh8iuoq1.fsf@gnus.org>
From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= 
Message-ID: <567EC613.6050901@gmail.com>
Date: Sat, 26 Dec 2015 17:53:39 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.4.0
MIME-Version: 1.0
In-Reply-To: <87lh8iuoq1.fsf@gnus.org>
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="WL617Vvrluw4fWqtETSBG4kccSt841IiA"
X-Provags-ID: V03:K0:vOsZowSf7ijbHMaBBF+muq3BwuJOrJVYy0ih1EJbP7baHxZx924
 WodFuZ555ZDZWnTlNrl9qxBzZjej7o39+CN7ZIexnrpejsUyH1NRR9M+JcFfS3eqf3/BRYo
 daf0mvbUgfWQtUE11Kcz/JYZm6O3OMu0MeT1HFNv8XxF7LLKWmaaN0e+KdBdz4/x67RFwhm
 PB1ISDffvrH0kjRLAAvvg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:5feEq5PgHmc=:0lIP5ryeDMu0GpvVJdylEk
 5WrY46pT6DyFy5gEV/HfjwlpH0rj4Q92i1aNPAat44Y96ML+unujfhwEHhuuawhAn7dWrY2rc
 hH6xTFhHPX2Y2/1PYah/UrECXP0Hc2II6QGMWHnUtGlzTUe1Pn2gwKz2DkXzjbRpMY1Ln6NWN
 v3KTlJATjnK7R3i3wnOn+gnEUrbfdFx/DhzV6od7kR2Y8kiipWu6FDASlHLIx2cLWieVpyx+V
 4rKTADjJtsfZI4LFb604O/wi1twC9V+HUHMTZTrqHoZdbwVmYKjyL9Z/u9VOCmolvo90ilz7d
 IM/nSsCMxWN60vfcINNFqcOChMYVkKW/HDJCNc7uDPBfRF/hUdK/Tr1R6XRm43MI58hL/DT6l
 IxksIFGv+o+tPuWU9C0nLiVzFotCcjfv/vtcNQkhWIFpTynQ30/aOzKlL6UrtvVJZ7sUV+H0E
 rR2j1sM3a0Vw+nbsL+Ki3LheY7UyYjebuDPwDU1Lr3yWp+egNQBnTLHAHBvOsPWFgXoCeocSI
 8PzCvPjSFrpM3ijEW+52zbIL7Pgs8o8oPjY60JBGhy3OmvnCvl1wQPzXlmRwgMUVbnRP1JgXG
 fvwaBEMjsZDAF45xZZqIT5Lx+BRgwCnzRlmFU8HV+c5BhW5fKupwSdy//jt6zO5NV1LqPDNqw
 w/mHvYUkFlKUoevtN5w/N0ntgSAILc68AA/xBgNHrsF4SueAKx/wU2jV8DwqPLZgui4w=
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 19462
X-Mailman-Approved-At: Sat, 26 Dec 2015 13:30:53 -0500
Cc: 19462@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: 0.3 (/)

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--WL617Vvrluw4fWqtETSBG4kccSt841IiA
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 12/25/2015 11:51 PM, Lars Ingebrigtsen wrote:
> Cl=E9ment Pit--Claudel  writes:
>=20
>> I do not know how to do this, but it sounds like a convenient
>> solution! How does one tell shr to apply a particular font to its
>> target (all that I know of is `shr-target-id', which seems to insert a=

>> '*')?
>=20
> Look at `shr-tag-h1', for instance, and create whatever similar version=

> of that you want by overriding with `shr-external-rendering-functions'.=


That sounds like a great idea, actually. And I guess I can get the id of =
the current element to check it against the target id using (equal (dom-a=
ttr dom 'id) TARGET-ID).

I'll try that!


--WL617Vvrluw4fWqtETSBG4kccSt841IiA
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJWfsYYAAoJEPqg+cTm90wj+WcP/i+6W3hT1fpWav438z+Wt3f9
g0sR1VZ3+KsFBVD2GYXk7n5rzr+EmkwDE7d8J14rg+m5vn1oy9jZ/s+6UkWaAUc6
k0LnFrMtie6MWthSs5fYQj9gJL/ryAmXvPN1eIDIq3QDPY6JtxKc0mQIHkJsXLKj
5oYU65jD1Gcgh+nposKoZ0gv+Dhob52MUiXoIX1zB2+m3uQ+hCIrPAoRByhegpxu
bkD8x9ZgKl/m82Hfr9048p7tilgwQWTj11VJX4bc1f59zAK3mBvkEBR0bB8wMsas
ph5ZU15gM1Y58uQXQUI0CBIt07TiG2U0Fe5iLxZA5rMXRRjJaDuYE5B9I22tWSFe
5NZvDxzGfCntIOfTwg2r3N8cxinLTqy2Kl+fdF0JoA/7U0sY1RrQANTd/Rf8q1hZ
VlhC+O06N8VauUMTUV7QXdz1troog9euMV69SMCgKIT0YLdTBahbiYrKTO/DFUsY
GelvOyljd2s6D4goT+SwhUqdzZmQFVa9OjpLGMVpj65HGl4vze86F7e1rxApQdYc
Phlc/4NdFPsh7kDJD+st0yFrjqkmL0lAVscAAi3/SPSCjwPHYjNjT8RUqqkGj/lw
Mg2wgJ6VvPMLFsCjYOrmPaxjcmqdG8RrExINatbXB3CktAQmqQGvBnkpNFVlRvZv
DsTvgmr57NSSxkh/YehW
=JUOv
-----END PGP SIGNATURE-----

--WL617Vvrluw4fWqtETSBG4kccSt841IiA--




From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 26 22:36:49 2015
Received: (at 19462) by debbugs.gnu.org; 27 Dec 2015 03:36:49 +0000
Received: from localhost ([127.0.0.1]:42324 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from )
	id 1aD28X-0005eI-33
	for submit@debbugs.gnu.org; Sat, 26 Dec 2015 22:36:49 -0500
Received: from mout.kundenserver.de ([212.227.126.187]:49887)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from ) id 1aD28V-0005e4-Ae
 for 19462@debbugs.gnu.org; Sat, 26 Dec 2015 22:36:47 -0500
Received: from [192.168.1.82] ([109.24.225.43]) by mrelayeu.kundenserver.de
 (mreue003) with ESMTPSA (Nemesis) id 0LfFYi-1aWygr1KIK-00orw0; Sun, 27 Dec
 2015 04:36:41 +0100
Subject: Re: bug#19462: shr: use wrap-prefix when possible, instead of filling
 the text
To: Lars Ingebrigtsen 
References: 
 <83ppbanqhe.fsf@gnu.org> <87vbl2xigp.fsf@ferrier.me.uk>
 <83ioh2nlow.fsf@gnu.org> <87sig6xech.fsf@ferrier.me.uk>
 <83fvc5ni0u.fsf@gnu.org> 
 <87k31fwwyv.fsf@ferrier.me.uk> 
 <87bnmq9ibf.fsf@ferrier.me.uk> 
  <87lhlrx5fc.fsf@building.gnus.org>
  <878uhrcr5l.fsf@building.gnus.org>
 <83sifzjflk.fsf@gnu.org> <87egric2ki.fsf_-_@violet.siamics.net>
 <87bn9ezb2h.fsf@gnus.org> <567D8E43.8030408@gmail.com>
 <87y4ciwe6g.fsf@gnus.org> <567DC781.8040306@gmail.com>
 <87lh8iuoq1.fsf@gnus.org> <567EC613.6050901@gmail.com>
From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= 
Message-ID: <567F5CC8.5080505@gmail.com>
Date: Sun, 27 Dec 2015 04:36:40 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.4.0
MIME-Version: 1.0
In-Reply-To: <567EC613.6050901@gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="7MN5LL1X9puKPe73mXu31G0Hm1CA0qH4C"
X-Provags-ID: V03:K0:jT+62J99oco+QhijQSGi5gTwKLyOC+8Bjk1pww9tB794knCX68D
 JHgFSMdC3PjiWML231OVfdZMYTPTSKCq4ZItb0NnX0poYi5MCthF4GDjA+KG6a3Q4usO0Mz
 Lund6NN+uqUMuPqpVhmbP8h6kgntyPr36QWnDbxkY5hn8vVM4kqcopfgI0whsif+m/b7Yvr
 anPnnt07G8Iw5pOke5zbA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:SYEEYLlRuWM=:Q72zioUgh4aPjjyNfXnFl7
 enkdezxNsRRUD3FrnVXK+U08+R2Yhde62yq+xD5gH9r8GLgNr821VQySk9CXB9maCFT3h9h+8
 A20MzH7hgnvuxccWoQQdhSg1Uzx360L+XyJs6kJiFhzvRuDQ/l72HHRs2NaxOkbsedy68K2/t
 O5Ll8PeLqedlAvKNiZxwdH0XIg92wifQpbqg5KFamRZEw+bTYrzBzJ9UkLwXT70n11UsRoHqx
 JP7AzE44fjHXeNPZLLQW7tAPkDxq+qqJRuj69IcOiR7RYf293reyveP39mVQ2AXTB8XoKsB39
 0ZNICJF24BqE2GpVIedZeXTiWyi+EorIl3sJxfq19MkE9MhpIq2wBOG/nGsc9DXKw8nuVyQbI
 39o/s5PdW3owacHElXknHbUNU1BOUE5TATBWayoiva7w0DMomYtsRPxJL+onyqHMpjHxktQ9Y
 v3dUjs7iSHkrsa1pN9dorAkXhPvABkwzrEuHg87X9gl1FHbMFDyIsRgN1M5u4kEmLbUZpovDa
 leiGyNMyhhl+Zc9ydtcxNQL/5d/NvL1u927P8TGYRuhwqUZM6j1l3GnLEMLri21adHiCmfjXq
 a3tAB86oh+3+y5j0lE8Jmpzu/y1AeKPwvVvfNeQsTjDqvKwPUhZT0x/IBS7qEUbJzAK9HIuN5
 mi2m+dIKzJ4UdOjnxA2ac//icptXdpWVP8PcwmYCn08+RSbVzkWCM9FoKYQoztslXhDo=
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 19462
Cc: 19462@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: 1.0 (+)

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--7MN5LL1X9puKPe73mXu31G0Hm1CA0qH4C
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 12/26/2015 05:53 PM, Cl=E9ment Pit--Claudel wrote:
> On 12/25/2015 11:51 PM, Lars Ingebrigtsen wrote:
>> Cl=E9ment Pit--Claudel  writes:
>>
>>> I do not know how to do this, but it sounds like a convenient
>>> solution! How does one tell shr to apply a particular font to its
>>> target (all that I know of is `shr-target-id', which seems to insert =
a
>>> '*')?
>>
>> Look at `shr-tag-h1', for instance, and create whatever similar versio=
n
>> of that you want by overriding with `shr-external-rendering-functions'=
=2E
>=20
> That sounds like a great idea, actually. And I guess I can get the id o=
f the current element to check it against the target id using (equal (dom=
-attr dom 'id) TARGET-ID).
>=20
> I'll try that!

I just tried this (capturing the id that I was interested in in a closure=
 instead of putting it in shr-target-id), but shr-descend only works with=
 globally defined functions; is there a reason for that? It's due to the =
following bit:=20

	(if (fboundp function)
	    (funcall function dom)
	  (shr-generic dom))

Cl=E9ment.


--7MN5LL1X9puKPe73mXu31G0Hm1CA0qH4C
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJWf1zIAAoJEPqg+cTm90wjNvcQAJiTnm++a+9kjMn4MEjQb+nO
ABr7KOSF0vnkGLAxs8obrhWRzr2srsrO6pr89KeSGR4oXvzoBFcWpKhK9e5OoT8A
2ZD7tVR2gFykucGoccVBHArSZ/JfsdhNiHqfAl+X2ps9FtKMkeY2eAHbf6q1Jb1+
BlGWTWtrsMZ4nSEip+LJ4Uxr95Y7hcgLirvuPz7V1FvN3Mo622WIl38xgAaYEPD3
ucPOsjk87xAQEjFzBvmlG4PZNqOt/3WJ2dVM8LLkPUHTYYTFRjCsf6lMuwfx4iiB
sItuaZRqduMxYVkFyyMkoh0kNw+ZY3rohNnlJiHt4jHOkEYS6m0tf1PScmCeTwJw
g8OGpi6+72o873ubo7oQ2VijdeHq9S+YykrmjlpZD8ormt5P4Ka9UpM6ncoYZnrI
98pJDVqS1Kwo7e/Qt7bywWMIhkGSC1Emh0ORMlp1zQxuaYYRb+M0S0Q27eriqEiX
ixfRm1N33WWawgyRLWIGTBWUFlSIpZeZgMYxwvy+2MTlbZ5mPErOxiQC79Vxu9zE
RbVGdv03yDwFM3GVAwdcCeMqjUOzhCx/tlJPOlzbXnyFi4mqVGngAAcMkRA+qwk6
snTjFTxn1V1DwKTfIVoodMRfn1V4dl0GWQGJy+rAndk9IWRr0P78eDIAds3/GZ3B
GRMrcUSIodeVWtAp3t88
=PKDo
-----END PGP SIGNATURE-----

--7MN5LL1X9puKPe73mXu31G0Hm1CA0qH4C--




From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 26 23:19:43 2015
Received: (at 19462) by debbugs.gnu.org; 27 Dec 2015 04:19:43 +0000
Received: from localhost ([127.0.0.1]:42328 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from )
	id 1aD2o3-0006ce-Eo
	for submit@debbugs.gnu.org; Sat, 26 Dec 2015 23:19:43 -0500
Received: from mout.kundenserver.de ([212.227.126.133]:60244)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from ) id 1aD2o2-0006cR-5t
 for 19462@debbugs.gnu.org; Sat, 26 Dec 2015 23:19:42 -0500
Received: from [192.168.1.82] ([109.24.225.43]) by mrelayeu.kundenserver.de
 (mreue001) with ESMTPSA (Nemesis) id 0MDYsf-1ZwG5l1Ao1-00GoEj; Sun, 27 Dec
 2015 05:19:36 +0100
Subject: Re: bug#19462: shr: use wrap-prefix when possible, instead of filling
 the text
To: Lars Ingebrigtsen 
References: 
 <83ppbanqhe.fsf@gnu.org> <87vbl2xigp.fsf@ferrier.me.uk>
 <83ioh2nlow.fsf@gnu.org> <87sig6xech.fsf@ferrier.me.uk>
 <83fvc5ni0u.fsf@gnu.org> 
 <87k31fwwyv.fsf@ferrier.me.uk> 
 <87bnmq9ibf.fsf@ferrier.me.uk> 
  <87lhlrx5fc.fsf@building.gnus.org>
  <878uhrcr5l.fsf@building.gnus.org>
 <83sifzjflk.fsf@gnu.org> <87egric2ki.fsf_-_@violet.siamics.net>
 <87bn9ezb2h.fsf@gnus.org> <567D8E43.8030408@gmail.com>
 <87y4ciwe6g.fsf@gnus.org> <567DC781.8040306@gmail.com>
 <87lh8iuoq1.fsf@gnus.org> <567EC613.6050901@gmail.com>
 <567F5CC8.5080505@gmail.com>
From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= 
Message-ID: <567F66D7.1020708@gmail.com>
Date: Sun, 27 Dec 2015 05:19:35 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.4.0
MIME-Version: 1.0
In-Reply-To: <567F5CC8.5080505@gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="9W8h4ge7NJXnXAKl9EGKUu6oEFevNEHmu"
X-Provags-ID: V03:K0:1p0A7OO1VH6Fr2QcfBLXmbbFQlboX1l+Fz4plEqfCKOPkyYxUj7
 UmMYChq1zj7wxhgVC9KZrzWCN2tINxHQ+oaLlj6EG5OlnkhXn6ZOcUV7EsjN4D4xwTwfNaA
 OWIo5JdDWBBEYZQ1zNlKDnnAjm1Ut1MFBXLHsm/IGEkAfyCIs/ubsnLb3vWlg9JK6pyo2/6
 nmlZ4J29MuPwe9fFyJ7Eg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:/BABclpZLjo=:YYpjF7e/TcXNKyG8qvaoje
 Mzvy9Jw8Mtj+96asjU2SlbDXpe+9+LXTt8grIrPXk1Xi60t8/5XEAxYHrcDlNgBYgzLtVcl4o
 /h3GD1Rg1ktUxUgRatMXKti0Ur5ljdBnW+AK2TvcZLY2ShKh91VwElmEv8aInsyf1t9fKgCPf
 YwWLEahKJvQxo5pIgN39v66o9pHvzGwKCJyHqKE9WOkuGGDDTTqPSOlvnN0snvK1iZwsUW8eN
 QWGzVOfTpYhVoX9KE020rJGUYxaZqzEsNhycnCufADH7eJmhAoK738Ja0T42SLtOldK4VYO5e
 zrD3sBcaXn/0RKsQLXG/BJq9ZYU5ysFN07vaCzoVHb/yI2zxHaNDqMOTjMCZoufiToqXfjig/
 fqWioUg43KtR4/ZSSWXoqxmlsM4YtNjIdhArz6v1t2+8Kor85R54vxiVePAp/6pcgjdjWLKQv
 01Yvxj1Y5lNGRr93nOE/sBfpBsC85R3XEV6nKympxm6TU5R6VqouRjAzn2BhmkWpRZYgcY/sf
 6cl/68DbwSoVfX/+7eY8WHzBBvR4r9NwWKWzo2O+dcOZXnV42ULNTZ6s06fbCGrYBiqKPIVYY
 kn+QNjS6gYKRWaOpNZ9+AaDiS81B16nlFTjbhOoR1SkI3fbhn1gqCi/8OnL52m9ZjARE7wMZS
 nl3j7TD5zT6Hbz0BMhxUDz7DB++YHYcTjkNNzS6mz9qNvsuvyCQ5CTRoJeHPYEKGtftc=
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 19462
Cc: 19462@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: 1.0 (+)

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--9W8h4ge7NJXnXAKl9EGKUu6oEFevNEHmu
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 12/27/2015 04:36 AM, Cl=E9ment Pit--Claudel wrote:
> On 12/26/2015 05:53 PM, Cl=E9ment Pit--Claudel wrote:
>> On 12/25/2015 11:51 PM, Lars Ingebrigtsen wrote:
>>> Cl=E9ment Pit--Claudel  writes:
>>>
>>>> I do not know how to do this, but it sounds like a convenient
>>>> solution! How does one tell shr to apply a particular font to its
>>>> target (all that I know of is `shr-target-id', which seems to insert=
 a
>>>> '*')?
>>>
>>> Look at `shr-tag-h1', for instance, and create whatever similar versi=
on
>>> of that you want by overriding with `shr-external-rendering-functions=
'.
>>
>> That sounds like a great idea, actually. And I guess I can get the id =
of the current element to check it against the target id using (equal (do=
m-attr dom 'id) TARGET-ID).
>>
>> I'll try that!

I looked into this more, but I don't think it will work. I want to highli=
ght the context of the element that contains the target id, so if lines a=
re not broken up then highlighting the full line works well. If they are,=
 on the other hand, then I can't tell how much surrounding text to highli=
ght.

Cheers,
Cl=E9ment.


--9W8h4ge7NJXnXAKl9EGKUu6oEFevNEHmu
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJWf2bXAAoJEPqg+cTm90wjMDYP/i1uSfw4uhModxPW1d1tWK0G
hQcu/9Yu9Qba4/vQKqZbL2pLHlLRU6iERIYmC1VinJpXVonFpwjW+3SyU2bF8Vu7
ji+OiwG9EHZy05CJvCZ1tFCsvOmwIhxNQ922b4aNmpyp4u3tZtRk2N2RfkDqlUXq
1x3ObBm7bLF4G9lZdVqMt+TKHtd7WBcDPNb8g5VFabXQzq1dqzTehpa/EAlyYVH0
WItGqzv9/xuNmk7wQippKDk/ZdcL//92Km2yM9yyi//Bm7t1fnwQvUZGMqMlBkLz
cZU9S4HMkpSMkW1SRkVSaxMehABNcR/TFDciZaXnm+Edth+ycQ1LThCFU798TFH3
y38Z2HPTK3iQ0cyQ4nct8kXUTniRZMup57zsEIIHgvnSSrH3y828pK+MifocSRQ4
96+z/8FdGP+SppIopz25jQ3bDjI1o2JO73Sj2yQ16qAX9gcTsk2qFylqPF/LOh2i
IjwwIP6mrYyUrG3J6k31w9l5mZX0phfbMh++wdsIFlXVqiV2AYpRUqSe3VgWjQt3
Fv3qFs3/mpPCnAFaJfNHsXqnkcPxAApUujcr2oLcC7sDbGv0mCvvq5mrXUX65Zz8
T0DgwH/87FITBxQ2wWVG/oCqMZbGNYjKuxfLZnmi3e8t94HRfqOYRtx6LFA2erXs
RCq0kaIzD+vxQ96EAib3
=qSN2
-----END PGP SIGNATURE-----

--9W8h4ge7NJXnXAKl9EGKUu6oEFevNEHmu--




From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 27 01:19:48 2015
Received: (at 19462) by debbugs.gnu.org; 27 Dec 2015 06:19:48 +0000
Received: from localhost ([127.0.0.1]:42342 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from )
	id 1aD4gF-000113-Rs
	for submit@debbugs.gnu.org; Sun, 27 Dec 2015 01:19:48 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:41263)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from ) id 1aD4gE-00010w-Ck
 for 19462@debbugs.gnu.org; Sun, 27 Dec 2015 01:19:46 -0500
Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from )
 id 1aD4ft-0002bV-99; Sun, 27 Dec 2015 07:19:25 +0100
From: Lars Ingebrigtsen 
To: =?iso-8859-1?Q?Cl=E9ment?= Pit--Claudel 
Subject: Re: bug#19462: shr: use wrap-prefix when possible,
 instead of filling the text
References: 
 <87sig6xech.fsf@ferrier.me.uk> <83fvc5ni0u.fsf@gnu.org>
  <87k31fwwyv.fsf@ferrier.me.uk>
  <87bnmq9ibf.fsf@ferrier.me.uk>
 
 
 <87lhlrx5fc.fsf@building.gnus.org>
 
 <878uhrcr5l.fsf@building.gnus.org> <83sifzjflk.fsf@gnu.org>
 <87egric2ki.fsf_-_@violet.siamics.net> <87bn9ezb2h.fsf@gnus.org>
 <567D8E43.8030408@gmail.com> <87y4ciwe6g.fsf@gnus.org>
 <567DC781.8040306@gmail.com> <87lh8iuoq1.fsf@gnus.org>
 <567EC613.6050901@gmail.com> <567F5CC8.5080505@gmail.com>
Date: Sun, 27 Dec 2015 07:19:24 +0100
In-Reply-To: <567F5CC8.5080505@gmail.com> (=?iso-8859-1?Q?=22Cl=E9ment?=
 Pit--Claudel"'s message of "Sun, 27 Dec 2015 04:36:40 +0100")
Message-ID: <87io3kjtw3.fsf@gnus.org>
User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MailScanner-ID: 1aD4ft-0002bV-99
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@gnus.org
MailScanner-NULL-Check: 1451801965.65846@ywnxWx6NcBRNRUr53KvZyw
X-Spam-Status: No
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 19462
Cc: 19462@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: -0.7 (/)

Cl=E9ment Pit--Claudel  writes:

> I just tried this (capturing the id that I was interested in in a
> closure instead of putting it in shr-target-id), but shr-descend only
> works with globally defined functions; is there a reason for that?
> It's due to the following bit:
>
> 	(if (fboundp function)
> 	    (funcall function dom)
> 	  (shr-generic dom))

I've now fixed this in the Emacs trunk.

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 27 01:23:21 2015
Received: (at 19462) by debbugs.gnu.org; 27 Dec 2015 06:23:21 +0000
Received: from localhost ([127.0.0.1]:42346 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from )
	id 1aD4jh-00016k-BO
	for submit@debbugs.gnu.org; Sun, 27 Dec 2015 01:23:21 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:58977)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from ) id 1aD4je-00016b-Qw
 for 19462@debbugs.gnu.org; Sun, 27 Dec 2015 01:23:19 -0500
Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from )
 id 1aD4jJ-0002dW-4S; Sun, 27 Dec 2015 07:22:57 +0100
From: Lars Ingebrigtsen 
To: =?iso-8859-1?Q?Cl=E9ment?= Pit--Claudel 
Subject: Re: bug#19462: shr: use wrap-prefix when possible,
 instead of filling the text
References: 
 <83fvc5ni0u.fsf@gnu.org> 
 <87k31fwwyv.fsf@ferrier.me.uk> 
 <87bnmq9ibf.fsf@ferrier.me.uk> 
 
 <87lhlrx5fc.fsf@building.gnus.org>
 
 <878uhrcr5l.fsf@building.gnus.org> <83sifzjflk.fsf@gnu.org>
 <87egric2ki.fsf_-_@violet.siamics.net> <87bn9ezb2h.fsf@gnus.org>
 <567D8E43.8030408@gmail.com> <87y4ciwe6g.fsf@gnus.org>
 <567DC781.8040306@gmail.com> <87lh8iuoq1.fsf@gnus.org>
 <567EC613.6050901@gmail.com> <567F5CC8.5080505@gmail.com>
 <567F66D7.1020708@gmail.com>
Date: Sun, 27 Dec 2015 07:22:55 +0100
In-Reply-To: <567F66D7.1020708@gmail.com> (=?iso-8859-1?Q?=22Cl=E9ment?=
 Pit--Claudel"'s message of "Sun, 27 Dec 2015 05:19:35 +0100")
Message-ID: <87ege8jtq8.fsf@gnus.org>
User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MailScanner-ID: 1aD4jJ-0002dW-4S
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@gnus.org
MailScanner-NULL-Check: 1451802177.70511@8bX7FvGbGghQ0ajM9d8rvg
X-Spam-Status: No
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 19462
Cc: 19462@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: -0.7 (/)

Cl=E9ment Pit--Claudel  writes:

> I looked into this more, but I don't think it will work. I want to
> highlight the context of the element that contains the target id, so
> if lines are not broken up then highlighting the full line works
> well. If they are, on the other hand, then I can't tell how much
> surrounding text to highlight.

I'm not sure what you mean by "context".  But you can look "down" into
the DOM and see if your id is in an element there.  Or you can transform
the HTML, or transform the DOM, to wrap the elements you want to
highlight.

For instance, you can loop over all elements that have ids that match
with `dom-by-id', and you can alter the DOM to insert, say, h1 elements
around those that you want to have highlit.

Etc.

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 27 06:17:03 2015
Received: (at 19462) by debbugs.gnu.org; 27 Dec 2015 11:17:03 +0000
Received: from localhost ([127.0.0.1]:42438 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from )
	id 1aD9Jv-0004VP-Dv
	for submit@debbugs.gnu.org; Sun, 27 Dec 2015 06:17:03 -0500
Received: from mout.kundenserver.de ([217.72.192.73]:64808)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from ) id 1aD9Jt-0004Up-4M
 for 19462@debbugs.gnu.org; Sun, 27 Dec 2015 06:17:01 -0500
Received: from [192.168.1.82] ([109.24.225.43]) by mrelayeu.kundenserver.de
 (mreue101) with ESMTPSA (Nemesis) id 0MQ6Al-1a7weq0NNb-005L8q; Sun, 27 Dec
 2015 12:16:55 +0100
Subject: Re: bug#19462: shr: use wrap-prefix when possible, instead of filling
 the text
To: Lars Ingebrigtsen 
References: 
 <83fvc5ni0u.fsf@gnu.org> 
 <87k31fwwyv.fsf@ferrier.me.uk> 
 <87bnmq9ibf.fsf@ferrier.me.uk> 
  <87lhlrx5fc.fsf@building.gnus.org>
  <878uhrcr5l.fsf@building.gnus.org>
 <83sifzjflk.fsf@gnu.org> <87egric2ki.fsf_-_@violet.siamics.net>
 <87bn9ezb2h.fsf@gnus.org> <567D8E43.8030408@gmail.com>
 <87y4ciwe6g.fsf@gnus.org> <567DC781.8040306@gmail.com>
 <87lh8iuoq1.fsf@gnus.org> <567EC613.6050901@gmail.com>
 <567F5CC8.5080505@gmail.com> <567F66D7.1020708@gmail.com>
 <87ege8jtq8.fsf@gnus.org>
From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= 
Message-ID: <567FC8A0.6090100@gmail.com>
Date: Sun, 27 Dec 2015 12:16:48 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.4.0
MIME-Version: 1.0
In-Reply-To: <87ege8jtq8.fsf@gnus.org>
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="Iwxo4nRilXaBoeobuisIOHXXPQjR1canN"
X-Provags-ID: V03:K0:KUX5QLxJZcTp1bHVSoSJJfjISvCLh6LFZuGY3WVjJgIGk6xydhA
 ZGxr76BOR8kSLaIImTb4d2LPN8byWgdcQMIXxVP9mY0Yzw/tqsh6QjZfw/ZWOFResMLwsgh
 D0A6aoOvO0eNrpc02F0+QcCpXK4P8Tc3rvrcTdmjV077WBYMHp6nc5QA8MOZ4VfoEaC1lLz
 5D5qJ7jMZGMhvqLy/tZGw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:c/mKfx1R/j0=:0CvJB6ijCKT0qZHL+B7T3/
 ckx/L5sw8IJFOlRLsAOa1y3/UkW+scASanZ+3pqvgxTsDaNrlGE76ykFKtcGknahXF3115acb
 tHmxUh0QmPgnB6yhDb0TwHKGE4glJ8wF9qM5OEz8wxRLD9YVI2x6ezJiimXFRSfQth3/qVpYm
 uLjuTQ330sPWNo7Xen/J9uxGafUJvD3F2ukGSpFItvPcmDxi80kfQJLpMLyeqX6NdgzUHoZhc
 nMcdux4WXlRcvdg/DzNXv2wOAjFoKLh+I/KhRKIC0i68S8yxZmlYUVcswnCZe9LLA5lLvrbeN
 82NNUIw1WDlquJuwqBKstrj4gNE7EjOec0Y2bpPdE5WkyBG6ZMfl78Fb4lHh66fXMxAiEFN0X
 nbuutdJfcKGLZwCajKlkOKla/6AJ3Q+xfwhkhnu5hZVEWCrPvI7UTAMXhsfqRc9FuQ41vfbhL
 AVy3U5E4d7SVgESrFiT6zTz0IDoRW6LuctRQ/B3tUkF4ncd73RbYWyDL/b0DqHP2F94ybukVa
 io7KQYnSVSsPp/m27cka3URhjlGKBeOJHjkdMokwqoCRpg7i2mRFjjrVJU6BSiGS3FrDQyyMC
 7D61Qmxn9u5FmufAU+QrJAlmJBAsPpxGrEsfPtTcV5xAJl6V+a8DbzbeQz3r5TLESXVroiYct
 8GTjx5UJrkUjDVPmqMm5+9EGLCNOgNnp3eL54c1ZyRixq3cpjqp7/kjCS3vrdkBFbSSU=
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 19462
Cc: 19462@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: 0.3 (/)

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--Iwxo4nRilXaBoeobuisIOHXXPQjR1canN
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 12/27/2015 07:22 AM, Lars Ingebrigtsen wrote:
> Cl=E9ment Pit--Claudel  writes:
>=20
>> I looked into this more, but I don't think it will work. I want to
>> highlight the context of the element that contains the target id, so
>> if lines are not broken up then highlighting the full line works
>> well. If they are, on the other hand, then I can't tell how much
>> surrounding text to highlight.
>=20
> I'm not sure what you mean by "context".  But you can look "down" into
> the DOM and see if your id is in an element there.  Or you can transfor=
m
> the HTML, or transform the DOM, to wrap the elements you want to
> highlight.
>=20
> For instance, you can loop over all elements that have ids that match
> with `dom-by-id', and you can alter the DOM to insert, say, h1 elements=

> around those that you want to have highlit.

Thanks for the suggestions. It's not always obvious what element I want t=
o highlight, though, beyond "everything that ends up on the same line. It=
 may be that the thing I want to draw the attention of the user to is in =
a paragraph; in that case, I highlight the full paragrahp. Or it may be i=
n a title; in that case, I highlight the full title. Or it may be part of=
 a list; in that case I only highlight the item that contains it.

When the text that shr inserts isn't wrapped, I just need to highlight th=
e line that contains that text after rendering is complete. When it is wr=
apped, however, it becomes unclear what exactly to highlight.

Cl=E9ment.


--Iwxo4nRilXaBoeobuisIOHXXPQjR1canN
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJWf8imAAoJEPqg+cTm90wjtkAP/Aik+yY4fO+wx6nkiNzO52D4
6RGao2WX3MrYHZbmsuAD34KMqdIRw2P4uVZFuvMmsjvNJ2o3MNbcU+lH9O87cvsd
vQS7fL4H6/80th3bteSyA7CB3n7vY4qHameLhWDHeSxnsxbD2pZOhHO50zKDZF5l
gVjFQ7MZiPh5W4dPQ1Y11haGqSjFYdIOli7htnYnD0vuWuBkQmqanDq5ugyh87th
LKaA4DsZmsCsn8FpmXP+lxVbBMNJuNzomaRExfS+NF0uZ/t0EqAjyOgSN0BkFzOz
VfzykidpnfKa8dSq9EQjjdTEmHrJA2/BakFB8iDF588w9uR7y7UZjdFrIwL0+XKN
vDGaEpOeBVoD2MUkMEumq/SLbB5VYs64pE3FLj90g5J0nsfLeWAJTe37HSyp9o8f
QMW6DTru088Xc5CADI9j20vmWcmdkloefFJB5h6rclnOUA5nszmvlM3Cu36BU++v
W0x5qTgGT1Y6GTVG6fMQ5b7+hTmbMe3quToZLdl4nLXvfqzep1n2zOVnIxrXbROf
lF62kHfC+SY8qI+ec/0VVKJ9sXArbTiXrzKna3NveoObWEYbdAtj6Wh+XHcLB4zG
sZeIxsIB+Wo9iS/1/UuIlMtGDE5KxC4ybALlhthaNLlBPY3L9WVBwn5zSaLFEVpw
fK2/zQquEKznfPh6mhDi
=3RlV
-----END PGP SIGNATURE-----

--Iwxo4nRilXaBoeobuisIOHXXPQjR1canN--




From unknown Thu Aug 21 14:53:35 2025
Received: (at fakecontrol) by fakecontrolmessage;
To: internal_control@debbugs.gnu.org
From: Debbugs Internal Request 
Subject: Internal Control
Message-Id: bug archived.
Date: Sun, 24 Jan 2016 12:24:09 +0000
User-Agent: Fakemail v42.6.9

# This is a fake control message.
#
# The action:
# bug archived.
thanks
# This fakemail brought to you by your local debbugs
# administrator