bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51176: eww switch buffer by title


From: Lars Ingebrigtsen
Subject: bug#51176: eww switch buffer by title
Date: Wed, 13 Oct 2021 13:52:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Yuchen Pei <hi@ypei.me> writes:

> How about switching to an eww buffer by title?

So the use case is that you have a large number of eww buffers, but you
want to find a particular based on the title of the web page being
displayed in that buffer?

I'm not sure that's generally useful enough to include -- do people use
`C-u M-x eww' a lot?

Some code comments:

> (defun eww-switch-by-title (title-and-buffer)
>  "Switches to an eww buffer with selected title."
>  (interactive
>   (list
>    (let ((com-table))
>      (dolist (buffer (buffer-list))
>       (with-current-buffer buffer
>         (when (equal major-mode 'eww-mode)
>           (add-to-list
>            'com-table

Use `push'.

>            (concat (plist-get eww-data :title)
>                    (propertize (concat " " (buffer-name))
>                                'invisible t))))))
>      (completing-read "Eww buffer title: " com-table))))

Use an alist instead of propertising a string.

There may also be several buffers with the same title, I guess, in which
case this wouldn't allow you to choose either?

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]