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

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

Re: Soo many buffers


From: Andrea Crotti
Subject: Re: Soo many buffers
Date: Fri, 06 Aug 2010 13:07:21 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (darwin)

Tassilo Horn <address@hidden> writes:

>
> At least with `ibuffer' (an advanced alternative to the normal
> `list-buffers') you can group buffers, so that you get something looking
> like Gnus group buffers with topics.  I also put org-related buffers in
> one group.  Here's my definition:
>
> (setq ibuffer-saved-filter-groups
>       '(("default"
>          ("Chat" (or
>                   (mode . garak-mode)
>                   (name . "^\\*Garak\\*$")
>                   (mode . rcirc-mode)))
>          ("Organization" (or
>                           (mode . diary-mode)
>                           (mode . org-mode)
>                           (mode . org-agenda-mode)))
>          ("Gnus & News" (or
>                          (mode . message-mode)
>                          (mode . bbdb-mode)
>                          (mode . mail-mode)
>                          (mode . gnus-group-mode)
>                          (mode . gnus-summary-mode)
>                          (mode . gnus-article-mode)
>                          (name . "^\\(\\.bbdb\\|dot-bbdb\\)$")
>                          (name . "^\\.newsrc-dribble$")
>                          (mode . newsticker-mode)))
>          ("Files" (filename . ".*"))
>          ("File Management" (or
>                              (mode . dired-mode)
>                              (mode . shell-mode)))
>          ("Documentation" (or
>                            (mode . Info-mode)
>                            (mode . apropos-mode)
>                            (mode . woman-mode)
>                            (mode . help-mode)
>                            (mode . Man-mode))))))
>
> If you want to get git of org-mode buffers for all buffer completion
> (C-x b), you could rename all such buffers, so that they start with a
> space.  Those are ignored by completion (unless you type a space
> literally).
>
> Here's a (only very briefly tested) snippet:
>
> (defun th-hide-org-buffers (arg)
>   "Hide org-mode buffers from completion by prepending a space at the buffer 
> name.
> When called with prefix arg (`C-u'), then remove this space again."
>   (interactive "P")
>   (dolist (b (buffer-list))
>     (set-buffer b)
>     (when (eq major-mode 'org-mode)
>       (rename-buffer
>        (if arg 
>            (replace-regexp-in-string "^[[:space:]]+" "" (buffer-name))
>          (concat " " (buffer-name)))))))
>
> HTH,
> Tassilo

Thanks a lot they're both really useful it's what I was looking for.
But ido-mode (with flex matching) is too smart and it still finds them!

In theory I found 
--8<---------------cut here---------------start------------->8---
  (add-to-list 'ido-ignore-buffers "\\.org$")
--8<---------------cut here---------------end--------------->8---
this variable but that regexp doens't work as expected, I still never
get regexp to work at first attempt in emacs...




reply via email to

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