all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Shmakov <ivan@siamics.net>
To: 19225@debbugs.gnu.org, control@debbugs.gnu.org
Subject: bug#19225: eww-render: runs eww-after-render-hook in the (temporary) data buffer
Date: Sun, 30 Nov 2014 10:45:46 +0000	[thread overview]
Message-ID: <87lhmtnezp.fsf@violet.siamics.net> (raw)
In-Reply-To: <87tx1hnh5d.fsf_-_@violet.siamics.net> (Ivan Shmakov's message of "Sun, 30 Nov 2014 09:59:10 +0000")

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

tags 19225 + patch
thanks

>>>>> Ivan Shmakov <ivan@siamics.net> writes:
>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>>>>> Ivan Shmakov <ivan@siamics.net> writes:

[…]

 >>> The plist-put calls down that progn are evaluated after
 >>> eww-display-*, and thus after either eww-setup-buffer or some other
 >>> set-buffer.  The eww-use-external-browser-for-content-type case I’m
 >>> unsure about, though.

 >> I've now removed the statement.

 > Following the change for eww-display-* /not/ to change the
 > current buffer ($ git log entry MIMEd), those forms are now also
 > evaluated in the data buffer.

	… As well as a couple of eww-update-header-line-format calls.

	Please consider the patch MIMEd.  This one doesn’t pass the data
	buffer to eww-after-render-hook, and I hope this still could be
	resolved a bit later.

	* eww.el (eww-render): Call eww-update-header-line-format
	unconditionally and in the browsing buffer (was: data buffer);
	change eww-data and eww-history-position for the browsing
	buffer, and run eww-after-render-hook there, too.
	(eww-display-html): Do not call eww-update-header-line-format or
	change eww-data, eww-history-position (now done in eww-render.)

   283	(defun eww-render (status url &optional point buffer encode)
…
   287	  (let* ((headers (eww-parse-headers))
…
   298		 (data-buffer (current-buffer)))
   299	    (unwind-protect
   300		(progn
   301		  (cond
…
   310		   ((string-match-p "\\`image/" (car content-type))
   311		    (eww-display-image buffer)
   312		    (eww-update-header-line-format))
   313		   (t
   314		    (eww-display-raw buffer encode)
   315		    (eww-update-header-line-format)))
   316		  (plist-put eww-data :url url)
   317		  (setq eww-history-position 0)
   318		  (run-hooks 'eww-after-render-hook))
   319	      (kill-buffer data-buffer))))

[…]

-- 
FSF associate member #7257  np. Surrender — Jami Sieber … 3013 B6A0 230E 334A

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

--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -308,14 +315,14 @@ defun eww-render (status url &optional point buffer encode)
 	   ((equal (car content-type) "application/pdf")
 	    (eww-display-pdf))
 	   ((string-match-p "\\`image/" (car content-type))
-	    (eww-display-image buffer)
-	    (eww-update-header-line-format))
+	    (eww-display-image buffer))
 	   (t
-	    (eww-display-raw buffer encode)
-	    (eww-update-header-line-format)))
-	  (plist-put eww-data :url url)
-	  (setq eww-history-position 0)
-	  (run-hooks 'eww-after-render-hook))
+	    (eww-display-raw buffer encode)))
+	  (with-current-buffer buffer
+	    (plist-put eww-data :url url)
+	    (eww-update-header-line-format)
+	    (setq eww-history-position 0)
+	    (run-hooks 'eww-after-render-hook)))
       (kill-buffer data-buffer))))
 
 (defun eww-parse-headers ()
@@ -403,10 +411,7 @@ defun eww-display-html (charset url &optional document point buffer encode)
 	  (while (and (not (eobp))
 		      (get-text-property (point) 'eww-form))
 	    (forward-line 1)))))
-      (plist-put eww-data :url url)
-      (setq eww-history-position 0)
-      (eww-size-text-inputs)
-      (eww-update-header-line-format))))
+      (eww-size-text-inputs))))
 
 (defun eww-handle-link (dom)
   (let* ((rel (dom-attr dom 'rel))

  reply	other threads:[~2014-11-30 10:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-21 11:24 bug#16211: eww should support multiple *eww* buffers Ivan Shmakov
2013-12-21 20:22 ` Ted Zlatanov
2013-12-21 21:51   ` Ivan Shmakov
2013-12-22 22:36     ` Ted Zlatanov
2014-07-06 19:05       ` Ivan Shmakov
2014-11-04 16:42         ` Ted Zlatanov
2013-12-23  3:21   ` Stefan Monnier
2013-12-23 13:11     ` Ted Zlatanov
2013-12-23 18:19       ` Ivan Shmakov
2013-12-23 19:01         ` Glenn Morris
2013-12-24  8:05       ` Lars Ingebrigtsen
2013-12-24  8:49         ` Ivan Shmakov
2014-11-10 21:18           ` Lars Magne Ingebrigtsen
2014-11-19  6:47             ` Ivan Shmakov
2014-11-19  8:36               ` Ivan Shmakov
2014-11-19 17:41                 ` Lars Magne Ingebrigtsen
2014-11-30  9:59                   ` bug#19225: eww-render: runs eww-after-render-hook in the (temporary) data buffer Ivan Shmakov
2014-11-30 10:45                     ` Ivan Shmakov [this message]
2014-12-01 17:56                       ` Lars Magne Ingebrigtsen
2014-11-19 17:38               ` bug#16211: eww should support multiple *eww* buffers Lars Magne Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=87lhmtnezp.fsf@violet.siamics.net \
    --to=ivan@siamics.net \
    --cc=19225@debbugs.gnu.org \
    --cc=control@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.