all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#51702: 29.0.50; [PATCH] Fix xwidget buffer name being stuck on something nonsensical
       [not found] <87k0hhal3v.fsf.ref@yahoo.com>
@ 2021-11-09  6:39 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-09  6:46   ` Lars Ingebrigtsen
  2021-11-09 12:50   ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-09  6:39 UTC (permalink / raw)
  To: 51702

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

Thanks.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Always-set-xwidget-title-if-the-event-was-load-finis.patch --]
[-- Type: text/x-patch, Size: 1453 bytes --]

From a943d9b995d701d4ae7029f6f6f3ae91ceb3a29b Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@yahoo.com>
Date: Tue, 9 Nov 2021 14:37:47 +0800
Subject: [PATCH] Always set xwidget title if the event was "load-finished"

* lisp/xwidget.el (xwidget-webkit-callback): Always set title upon
load completion.  This prevents loading pages such as "about:blank"
from not setting the buffer name.
---
 lisp/xwidget.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index fc37798322..905327083b 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -360,9 +360,11 @@ xwidget-webkit-callback
     (cond ((eq xwidget-event-type 'load-changed)
            (let ((title (xwidget-webkit-title xwidget)))
              ;; This funciton will be called multi times, so only
-             ;; change buffer name when get a valid title. this can
-             ;; limit buffer-name flicker in mode-line.
-             (when (> (length title) 0)
+             ;; change buffer name when the load actually completes
+             ;; this can limit buffer-name flicker in mode-line.
+             (when (or (string-equal (nth 3 last-input-event)
+                                     "load-finished")
+                       (> (length title) 0))
                (with-current-buffer (xwidget-buffer xwidget)
                  (setq xwidget-webkit--title title)
                  (force-mode-line-update)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#51702: 29.0.50; [PATCH] Fix xwidget buffer name being stuck on something nonsensical
  2021-11-09  6:39 ` bug#51702: 29.0.50; [PATCH] Fix xwidget buffer name being stuck on something nonsensical Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-11-09  6:46   ` Lars Ingebrigtsen
  2021-11-09  6:54     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-09 12:50   ` Eli Zaretskii
  1 sibling, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-09  6:46 UTC (permalink / raw)
  To: Po Lu; +Cc: 51702

Po Lu <luangruo@yahoo.com> writes:

> Thanks.

Pushed.

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51702: 29.0.50; [PATCH] Fix xwidget buffer name being stuck on something nonsensical
  2021-11-09  6:46   ` Lars Ingebrigtsen
@ 2021-11-09  6:54     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 8+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-09  6:54 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 51702

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Pushed.

Thanks, and I really hope I'm not being annoying opening an issue for
each different patch.

Perhaps I should just open an existing "tracking" issue to post changes
to?  Or post them to emacs-devel instead?

Thanks.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51702: 29.0.50; [PATCH] Fix xwidget buffer name being stuck on something nonsensical
  2021-11-09  6:39 ` bug#51702: 29.0.50; [PATCH] Fix xwidget buffer name being stuck on something nonsensical Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-09  6:46   ` Lars Ingebrigtsen
@ 2021-11-09 12:50   ` Eli Zaretskii
  2021-11-09 12:58     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2021-11-09 12:50 UTC (permalink / raw)
  To: Po Lu; +Cc: 51702

> Date: Tue, 09 Nov 2021 14:39:32 +0800
> From:  Po Lu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> >From a943d9b995d701d4ae7029f6f6f3ae91ceb3a29b Mon Sep 17 00:00:00 2001
> From: Po Lu <luangruo@yahoo.com>
> Date: Tue, 9 Nov 2021 14:37:47 +0800
> Subject: [PATCH] Always set xwidget title if the event was "load-finished"
> 
> * lisp/xwidget.el (xwidget-webkit-callback): Always set title upon
> load completion.  This prevents loading pages such as "about:blank"
> from not setting the buffer name.
> ---
>  lisp/xwidget.el | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/lisp/xwidget.el b/lisp/xwidget.el
> index fc37798322..905327083b 100644
> --- a/lisp/xwidget.el
> +++ b/lisp/xwidget.el
> @@ -360,9 +360,11 @@ xwidget-webkit-callback
>      (cond ((eq xwidget-event-type 'load-changed)
>             (let ((title (xwidget-webkit-title xwidget)))
>               ;; This funciton will be called multi times, so only
> -             ;; change buffer name when get a valid title. this can
> -             ;; limit buffer-name flicker in mode-line.
> -             (when (> (length title) 0)
> +             ;; change buffer name when the load actually completes
> +             ;; this can limit buffer-name flicker in mode-line.
> +             (when (or (string-equal (nth 3 last-input-event)
> +                                     "load-finished")
> +                       (> (length title) 0))

You've lost the period in the comment there.  And the sentence after
that should be capitalized, of course.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51702: 29.0.50; [PATCH] Fix xwidget buffer name being stuck on something nonsensical
  2021-11-09 12:50   ` Eli Zaretskii
@ 2021-11-09 12:58     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-09 13:35       ` Eli Zaretskii
  2021-11-09 17:33       ` Benjamin Riefenstahl
  0 siblings, 2 replies; 8+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-09 12:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51702

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

Eli Zaretskii <eliz@gnu.org> writes:

> You've lost the period in the comment there.

Thanks for this catch.

>And the sentence after that should be capitalized, of course.

Thanks.  I was trying to keep the style of the original comment intact,
but now that you've brought it up I see no harm in changing it.

Please see the attached change.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-comment-capitalization-in-xwidget.el.patch --]
[-- Type: text/x-patch, Size: 1135 bytes --]

From c569e2419886f30940032745da76e99342d0a5d8 Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@yahoo.com>
Date: Tue, 9 Nov 2021 20:57:19 +0800
Subject: [PATCH] Fix comment capitalization in xwidget.el

* lisp/xwidget.el (xwidget-webkit-callback): Rectify comment.
---
 lisp/xwidget.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index 905327083b..28add0db0a 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -360,8 +360,8 @@ xwidget-webkit-callback
     (cond ((eq xwidget-event-type 'load-changed)
            (let ((title (xwidget-webkit-title xwidget)))
              ;; This funciton will be called multi times, so only
-             ;; change buffer name when the load actually completes
-             ;; this can limit buffer-name flicker in mode-line.
+             ;; change buffer name when the load actually completes.
+             ;; This can limit buffer-name flicker in mode-line.
              (when (or (string-equal (nth 3 last-input-event)
                                      "load-finished")
                        (> (length title) 0))
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#51702: 29.0.50; [PATCH] Fix xwidget buffer name being stuck on something nonsensical
  2021-11-09 12:58     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-11-09 13:35       ` Eli Zaretskii
  2021-11-09 13:51         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-09 17:33       ` Benjamin Riefenstahl
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2021-11-09 13:35 UTC (permalink / raw)
  To: Po Lu; +Cc: 51702

> From: Po Lu <luangruo@yahoo.com>
> Cc: 51702@debbugs.gnu.org
> Date: Tue, 09 Nov 2021 20:58:10 +0800
> 
> >And the sentence after that should be capitalized, of course.
> 
> Thanks.  I was trying to keep the style of the original comment intact,
> but now that you've brought it up I see no harm in changing it.

There's no reason to keep typos and bad style intact ;-)

> diff --git a/lisp/xwidget.el b/lisp/xwidget.el
> index 905327083b..28add0db0a 100644
> --- a/lisp/xwidget.el
> +++ b/lisp/xwidget.el
> @@ -360,8 +360,8 @@ xwidget-webkit-callback
>      (cond ((eq xwidget-event-type 'load-changed)
>             (let ((title (xwidget-webkit-title xwidget)))
>               ;; This funciton will be called multi times, so only
> -             ;; change buffer name when the load actually completes
> -             ;; this can limit buffer-name flicker in mode-line.
> +             ;; change buffer name when the load actually completes.
> +             ;; This can limit buffer-name flicker in mode-line.
>               (when (or (string-equal (nth 3 last-input-event)
>                                       "load-finished")
>                         (> (length title) 0))

I'm happy now.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51702: 29.0.50; [PATCH] Fix xwidget buffer name being stuck on something nonsensical
  2021-11-09 13:35       ` Eli Zaretskii
@ 2021-11-09 13:51         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 8+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-09 13:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51702

Eli Zaretskii <eliz@gnu.org> writes:

> There's no reason to keep typos and bad style intact ;-)

Thanks, point taken.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51702: 29.0.50; [PATCH] Fix xwidget buffer name being stuck on something nonsensical
  2021-11-09 12:58     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-09 13:35       ` Eli Zaretskii
@ 2021-11-09 17:33       ` Benjamin Riefenstahl
  1 sibling, 0 replies; 8+ messages in thread
From: Benjamin Riefenstahl @ 2021-11-09 17:33 UTC (permalink / raw)
  To: Po Lu, 51702

Po Lu writes:
> diff --git a/lisp/xwidget.el b/lisp/xwidget.el
> index 905327083b..28add0db0a 100644
> --- a/lisp/xwidget.el
> +++ b/lisp/xwidget.el
> @@ -360,8 +360,8 @@ xwidget-webkit-callback
>      (cond ((eq xwidget-event-type 'load-changed)
>             (let ((title (xwidget-webkit-title xwidget)))
>               ;; This funciton will be called multi times, so only

While you're at it, how about: "This function will be called multiple
times" or even "several times".  ;-)

> -             ;; change buffer name when the load actually completes


Regards, benny





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-09 17:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87k0hhal3v.fsf.ref@yahoo.com>
2021-11-09  6:39 ` bug#51702: 29.0.50; [PATCH] Fix xwidget buffer name being stuck on something nonsensical Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-09  6:46   ` Lars Ingebrigtsen
2021-11-09  6:54     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-09 12:50   ` Eli Zaretskii
2021-11-09 12:58     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-09 13:35       ` Eli Zaretskii
2021-11-09 13:51         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-09 17:33       ` Benjamin Riefenstahl

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.