unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: tumashu <tumashu@163.com>
To: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: [PATCH] xwidget.el: call set-window-buffer after xwidget-webkit-mode.
Date: Tue, 9 Nov 2021 14:00:26 +0800 (CST)	[thread overview]
Message-ID: <324d3567.312b.17d03488e9d.Coremail.tumashu@163.com> (raw)


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



[-- Attachment #1.2: Type: text/html, Size: 111 bytes --]

[-- Attachment #2: 0001-xwidget.el-call-set-window-buffer-after-xwidget-webk.patch --]
[-- Type: application/octet-stream, Size: 1535 bytes --]

From 49a4c0c539dff6bf957705d3aa77e23d751a880c Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@163.com>
Date: Tue, 9 Nov 2021 13:53:33 +0800
Subject: [PATCH] xwidget.el: call set-window-buffer after xwidget-webkit-mode.

* lisp/xwidget.el (xwidget-webkit-new-session)
(xwidget-webkit-import-widget): Call set-window-buffer.
---
 lisp/xwidget.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index dc1ed2dc08..9e532cad4c 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -726,6 +726,9 @@ xwidget-webkit-new-session
                 nil current-session)))
     (xwidget-put xw 'callback callback)
     (xwidget-webkit-mode)
+    ;; Make sure some buffer variables in `xwidget-webkit-mode-hook'
+    ;; function take effect, for example: `left-fringe-width'.
+    (set-window-buffer (selected-window) (current-buffer))
     (xwidget-webkit-goto-uri (xwidget-webkit-last-session) url)))
 
 (defun xwidget-webkit-import-widget (xwidget)
@@ -751,7 +754,10 @@ xwidget-webkit-import-widget
                            'display (list 'xwidget :xwidget xwidget)))
       (xwidget-put xwidget 'callback callback)
       (set-xwidget-buffer xwidget buffer)
-      (xwidget-webkit-mode))
+      (xwidget-webkit-mode)
+      ;; Make sure some buffer variables in `xwidget-webkit-mode-hook'
+      ;; function take effect, for example: `left-fringe-width'.
+      (set-window-buffer (selected-window) buffer))
     buffer))
 
 (defun xwidget-webkit-display-event (event)
-- 
2.30.2


             reply	other threads:[~2021-11-09  6:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09  6:00 tumashu [this message]
2021-11-09  7:13 ` [PATCH] xwidget.el: call set-window-buffer after xwidget-webkit-mode Po Lu
2021-11-09  7:25   ` tumashu
2021-11-09  7:29     ` Po Lu
2021-11-09  7:44       ` tumashu
2021-11-09  7:48         ` Po Lu

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=324d3567.312b.17d03488e9d.Coremail.tumashu@163.com \
    --to=tumashu@163.com \
    --cc=emacs-devel@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).