diff options
author | Po Lu <luangruo@yahoo.com> | 2021-11-11 18:45:52 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2021-11-11 18:45:52 +0800 |
commit | 9a59d9017bf50f41dc1aa0778d0b350040866eb1 (patch) | |
tree | b66c0048c735c3c444c605258191d502f89b321a /lisp/xwidget.el | |
parent | f69a808ddcf7b2fd8cc2eacf99dd98248b9c455a (diff) | |
download | emacs-9a59d9017bf50f41dc1aa0778d0b350040866eb1.tar.gz emacs-9a59d9017bf50f41dc1aa0778d0b350040866eb1.tar.bz2 emacs-9a59d9017bf50f41dc1aa0778d0b350040866eb1.zip |
Add URI as a valid spec for xwidget-webkit-buffer-name-format
* lisp/xwidget.el (xwidget-webkit-buffer-name-format): Update
doc string.
(xwidget-webkit-callback): Add a format spec %U, which stands
for the current URI of the widget.
Diffstat (limited to 'lisp/xwidget.el')
-rw-r--r-- | lisp/xwidget.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 8078f1d01b0..9bb2f11f414 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -100,7 +100,8 @@ This returns the result of `make-xwidget'." "Template for naming `xwidget-webkit' buffers. It can use the following special constructs: - %T -- the title of the Web page loaded by the xwidget." + %T -- the title of the Web page loaded by the xwidget. + %U -- the URI of the Web page loaded by the xwidget." :type 'string :version "29.1") @@ -362,7 +363,8 @@ XWIDGET instance, XWIDGET-EVENT-TYPE depends on the originating xwidget." (xwidget-log "error: callback called for xwidget with dead buffer") (cond ((eq xwidget-event-type 'load-changed) - (let ((title (xwidget-webkit-title xwidget))) + (let ((title (xwidget-webkit-title xwidget)) + (uri (xwidget-webkit-uri 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. @@ -379,7 +381,8 @@ XWIDGET instance, XWIDGET-EVENT-TYPE depends on the originating xwidget." (rename-buffer (format-spec xwidget-webkit-buffer-name-format - `((?T . ,title))) + `((?T . ,title) + (?U . ,uri))) t))))) ((eq xwidget-event-type 'decide-policy) (let ((strarg (nth 3 last-input-event))) |