Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.emacs.help > #60748 > unrolled thread
| Started by | Matto Fransen <mattof@sdf.org> |
|---|---|
| First post | 2023-04-20 22:17 +0200 |
| Last post | 2023-04-25 14:52 +0200 |
| Articles | 5 — 4 participants |
Back to article view | Back to gnu.emacs.help
Build up of many eww buffers Matto Fransen <mattof@sdf.org> - 2023-04-20 22:17 +0200
Re: Build up of many eww buffers Ralf Fassel <ralfixx@gmx.de> - 2023-04-21 10:33 +0200
Re: Build up of many eww buffers Matto Fransen <matto@tradesystem.nl> - 2023-04-25 14:46 +0200
Re: Build up of many eww buffers Manuel Giraud <manuel@ledu-giraud.fr> - 2023-04-21 13:26 +0200
Re: Build up of many eww buffers Matto Fransen <matto@tradesystem.nl> - 2023-04-25 14:52 +0200
| From | Matto Fransen <mattof@sdf.org> |
|---|---|
| Date | 2023-04-20 22:17 +0200 |
| Subject | Build up of many eww buffers |
| Message-ID | <86a5z2wboe.fsf@x201.tradesystem.nl> |
Hi, To keep up with my RSS feeds, I use Gnus together with the brilliant service of gwene.org. I use eww as my standard browser. Links from the gwene messages are opened in eww. When I am done with such a page, I use 'q' in eww to quit the webpage and revert to the message-list. After such a session I end up with a lot of eww buffers, labeled *eww*<2>, *eww*<3>, and so on. - Is there a way to prevent the build-up of those buffers? - Is there a way to quickly close all of the eww-buffers? - Should I change my workflow? Best regards, Matto
[toc] | [next] | [standalone]
| From | Ralf Fassel <ralfixx@gmx.de> |
|---|---|
| Date | 2023-04-21 10:33 +0200 |
| Message-ID | <ygaedod8wjj.fsf@akutech.de> |
| In reply to | #60748 |
* Matto Fransen <mattof@sdf.org>
| After such a session I end up with a lot of eww buffers,
| labeled *eww*<2>, *eww*<3>, and so on.
>
| - Is there a way to prevent the build-up of those buffers?
| - Is there a way to quickly close all of the eww-buffers?
Here is what I use to get rid of unchanged buffers.
It should be easily adapted to kill only *eww* buffers:
;; Kill any unchanged buffers
(defconst kill-unchanged-buffers-dont-kill
(list (regexp-quote "*scratch*")
(regexp-quote "*info*")
(regexp-quote "*Async Shell Command*")
)
"List of buffer names regexps which should NOT be killed by `kill-unchanged-buffers'.
The regexps are anchored against beginning of buffer name.")
;; modified from a suggestion by Ralph Finch
(defun kill-unchanged-buffers ()
"Kill all unchanged buffers."
(interactive)
(let ((list (buffer-list)) (count 0))
(while list
(let* ((buffer (car list))
(name (buffer-name buffer)))
(and (not (string-equal name ""))
(not (delq nil (mapcar (lambda (elt) (string-match (concat "\\`" elt) name))
kill-unchanged-buffers-dont-kill)))
(/= (aref name 0) ? )
(if (buffer-modified-p buffer)
nil (kill-buffer buffer) (setq count (1+ count)))))
(setq list (cdr list)))
(message "Killed %d %s." count (if (/= count 1) "buffers" "buffer"))))
I have bound it on C-x C-k.
(global-set-key "\C-x\C-k" 'kill-unchanged-buffers)
HTH
R'
[toc] | [prev] | [next] | [standalone]
| From | Matto Fransen <matto@tradesystem.nl> |
|---|---|
| Date | 2023-04-25 14:46 +0200 |
| Message-ID | <87ttx4ceot.fsf@x201.tradesystem.nl> |
| In reply to | #60749 |
Hi Ralf, sorry, was a few days off-line On 21 April 2023 10:33 Ralf Fassel, wrote: > * Matto Fransen <mattof@sdf.org> > | After such a session I end up with a lot of eww buffers, > | labeled *eww*<2>, *eww*<3>, and so on. >> > | - Is there a way to prevent the build-up of those buffers? > | - Is there a way to quickly close all of the eww-buffers? > > Here is what I use to get rid of unchanged buffers. > It should be easily adapted to kill only *eww* buffers: > > ;; Kill any unchanged buffers > (defconst kill-unchanged-buffers-dont-kill [ ... ] This looks to be will be very helpful ! I will try it and let you know :) Thanks a lot, Matto
[toc] | [prev] | [next] | [standalone]
| From | Manuel Giraud <manuel@ledu-giraud.fr> |
|---|---|
| Date | 2023-04-21 13:26 +0200 |
| Message-ID | <87ildppjcf.fsf@ledu-giraud.fr> |
| In reply to | #60748 |
Matto Fransen <mattof@sdf.org> writes: [...] Hi Matto, > - Is there a way to prevent the build-up of those buffers? You'd have to look for how eww is called here because by default "M-x eww" is re-using *eww* > - Is there a way to quickly close all of the eww-buffers? There is "M-x eww-list-buffers" where you could "C-k" those buffers. > - Should I change my workflow? … or modify Emacs: nobody has definitive answer to this question yet ;-) -- Manuel Giraud
[toc] | [prev] | [next] | [standalone]
| From | Matto Fransen <matto@tradesystem.nl> |
|---|---|
| Date | 2023-04-25 14:52 +0200 |
| Message-ID | <87o7nccee3.fsf@x201.tradesystem.nl> |
| In reply to | #60750 |
Hi Manuel,
sorry, was a few days offline
On 21 April 2023 13:26 Manuel Giraud, wrote:
>
>> - Is there a way to prevent the build-up of those buffers?
>
> You'd have to look for how eww is called here because by default "M-x
> eww" is re-using *eww*
this is a part from the code:
(pop-to-buffer (generate-new-buffer "*eww*"))
(eww-mode)
(eww url-to-open)
>> - Is there a way to quickly close all of the eww-buffers?
>
> There is "M-x eww-list-buffers" where you could "C-k" those buffers.
Cool :)
Will try this out!
>> - Should I change my workflow?
>
> … or modify Emacs: nobody has definitive answer to this question yet ;-)
He he :)
Thanks a lot,
Matto
[toc] | [prev] | [standalone]
Back to top | Article view | gnu.emacs.help
csiph-web