GNU bug report logs - #51176
eww switch buffer by title

Previous Next

Package: emacs;

Reported by: Yuchen Pei <hi <at> ypei.me>

Date: Wed, 13 Oct 2021 04:57:02 UTC

Severity: normal

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yuchen Pei <hi <at> ypei.me>
To: 51176 <at> debbugs.gnu.org
Subject: bug#51176: eww switch buffer by title
Date: Wed, 13 Oct 2021 15:56:07 +1100
[Message part 1 (text/plain, inline)]
Hello,

How about switching to an eww buffer by title?

I have a hacky way to do it (see below).  I'll be happy to prepare 
a patch if people think this is a sensible feature to add.

(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
	     (concat (plist-get eww-data :title)
		     (propertize (concat " " (buffer-name))
				 'invisible t))))))
     (completing-read "Eww buffer title: " com-table))))
 (string-match "^.* \\(.*\\)$" title-and-buffer)
 (switch-to-buffer (match-string 1 title-and-buffer)))


-- 
Best,
Yuchen

PGP Key: 47F9 D050 1E11 8879 9040  4941 2126 7E93 EF86 DFD0
          <https://ypei.me/assets/ypei-pubkey.txt>
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 309 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.