Variable: eww-auto-rename-buffer

eww-auto-rename-buffer is a customizable variable defined in eww.el.gz.

Value

nil

Documentation

Automatically rename EWW buffers once the page is rendered.

When nil, do not rename the buffer. With a non-nil value determine the renaming scheme, as follows:

- title: Use the web page's title.
- url: Use the web page's URL.
- a function's symbol: Run a user-defined function that returns a
  string with which to rename the buffer. Sample of a
  user-defined function:

  (defun my-eww-rename-buffer ()
    (when (eq major-mode 'eww-mode)
      (when-let ((string (or (plist-get eww-data :title)
                             (plist-get eww-data :url))))
        (format "*%s*" string))))

The string of title and url is always truncated to the value of eww-buffer-name-length.

This variable was added, or its default value changed, in Emacs 29.1.

Probably introduced at or before Emacs version 29.1.

Source Code

;; Defined in /usr/src/emacs/lisp/net/eww.el.gz
(defcustom eww-auto-rename-buffer nil
  "Automatically rename EWW buffers once the page is rendered.

When nil, do not rename the buffer.  With a non-nil value
determine the renaming scheme, as follows:

- `title': Use the web page's title.
- `url': Use the web page's URL.
- a function's symbol: Run a user-defined function that returns a
  string with which to rename the buffer.  Sample of a
  user-defined function:

  (defun my-eww-rename-buffer ()
    (when (eq major-mode \\='eww-mode)
      (when-let ((string (or (plist-get eww-data :title)
                             (plist-get eww-data :url))))
        (format \"*%s*\" string))))

The string of `title' and `url' is always truncated to the value
of `eww-buffer-name-length'."
  :version "29.1"
  :type '(choice
          (const :tag "Do not rename buffers (default)" nil)
          (const :tag "Rename buffer to web page title" title)
          (const :tag "Rename buffer to web page URL" url)
          (function :tag "A user-defined function to rename the buffer"))
  :group 'eww)