all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Soo many buffers
@ 2010-08-05 11:32 Andrea Crotti
  2010-08-05 15:55 ` suvayu ali
  2010-08-05 16:19 ` Tassilo Horn
  0 siblings, 2 replies; 13+ messages in thread
From: Andrea Crotti @ 2010-08-05 11:32 UTC (permalink / raw)
  To: help-gnu-emacs

I wrote a discussion like this some time ago and I was pretty happy of
the answer.
But now I changed my settings, and I'm using desktop-mode with one
desktop file for every project.

I also use bookmark+ to jump in the project and load all the buffers,
and everything is great.

The only concern now is about the org-agenda-files (around 200 maybe).

I would like to have them everywhere, so I should add to the "no-clear"
list.
But in this way I lose the advantage of desktop mode and I'm still full
of buffers.

One thing that would be nice I think would be one command to toggle the
visibility of the org buffers on and off.
They can stay always open but I can afford one more click to access them
if they don't stay in the way while I work.

Is there such a shadowing thing somewhere?
Thanks




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-05 11:32 Soo many buffers Andrea Crotti
@ 2010-08-05 15:55 ` suvayu ali
  2010-08-07 18:03   ` Dan Davison
  2010-08-05 16:19 ` Tassilo Horn
  1 sibling, 1 reply; 13+ messages in thread
From: suvayu ali @ 2010-08-05 15:55 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: help-gnu-emacs

On 5 August 2010 04:32, Andrea Crotti <andrea.crotti.0@gmail.com> wrote:
> One thing that would be nice I think would be one command to toggle the
> visibility of the org buffers on and off.
> They can stay always open but I can afford one more click to access them
> if they don't stay in the way while I work.
>
> Is there such a shadowing thing somewhere?
> Thanks
>

How about ibuffer and filtering? Some thing like `/ m org-mode' in an
active ibuffer should filter the org-mode buffers. Then you can invert
the filter with `/ !'. Hopefully this helps.

-- 
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-05 11:32 Soo many buffers Andrea Crotti
  2010-08-05 15:55 ` suvayu ali
@ 2010-08-05 16:19 ` Tassilo Horn
  2010-08-06 11:07   ` Andrea Crotti
  1 sibling, 1 reply; 13+ messages in thread
From: Tassilo Horn @ 2010-08-05 16:19 UTC (permalink / raw)
  To: help-gnu-emacs

Andrea Crotti <andrea.crotti.0@gmail.com> writes:

Hi Andrea,

> The only concern now is about the org-agenda-files (around 200 maybe).

WTF?!? How do you structure your projects, i.e. how do you decide to
create a new agenda file?  I only have 4...

> I would like to have them everywhere, so I should add to the
> "no-clear" list.  But in this way I lose the advantage of desktop mode
> and I'm still full of buffers.
>
> One thing that would be nice I think would be one command to toggle
> the visibility of the org buffers on and off.

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:

--8<---------------cut here---------------start------------->8---
(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))))))
--8<---------------cut here---------------end--------------->8---

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:

--8<---------------cut here---------------start------------->8---
(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)))))))
--8<---------------cut here---------------end--------------->8---

HTH,
Tassilo




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-05 16:19 ` Tassilo Horn
@ 2010-08-06 11:07   ` Andrea Crotti
  2010-08-06 11:14     ` Gary
  0 siblings, 1 reply; 13+ messages in thread
From: Andrea Crotti @ 2010-08-06 11:07 UTC (permalink / raw)
  To: help-gnu-emacs

Tassilo Horn <tassilo@member.fsf.org> 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...




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-06 11:07   ` Andrea Crotti
@ 2010-08-06 11:14     ` Gary
  2010-08-06 13:58       ` Andrea Crotti
  0 siblings, 1 reply; 13+ messages in thread
From: Gary @ 2010-08-06 11:14 UTC (permalink / raw)
  To: help-gnu-emacs

Andrea Crotti wrote:

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

Aren't you escaping your \ with the double \\? Then it inidicates that
the buffer name starts with a literal \ followed by some character
followed by the text "org". Mind you, regex isn't my strong suit,
either... :P

-- 
Gary
GNU Emacs 23.2.1
emacsclient 23.2
1.7.4(0.225/5/3) 2010-04-07 11:02 Cygwin




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-06 11:14     ` Gary
@ 2010-08-06 13:58       ` Andrea Crotti
  2010-08-06 15:12         ` Glauber Alex Dias Prado
  0 siblings, 1 reply; 13+ messages in thread
From: Andrea Crotti @ 2010-08-06 13:58 UTC (permalink / raw)
  To: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:
> Aren't you escaping your \ with the double \\? Then it inidicates that
> the buffer name starts with a literal \ followed by some character
> followed by the text "org". Mind you, regex isn't my strong suit,
> either... :P

Yes you're right, but for example this is correct
--8<---------------cut here---------------start------------->8---
  (add-to-list 'auto-mode-alist
               '("\\.yaml$" . yaml-mode))
--8<---------------cut here---------------end--------------->8---

if I understood you have to escape once in interactive commands while
twice in non-interctive ones.

Anyway I'm still not so happy, because I managed to filter out the
org-files, but I still want to access to them.

Maybe I could add another key combination that list me the org files and
allows to access to them, but I have then to get used to it also.

I have so many org-files because for example many assignments are also there..




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-06 13:58       ` Andrea Crotti
@ 2010-08-06 15:12         ` Glauber Alex Dias Prado
  0 siblings, 0 replies; 13+ messages in thread
From: Glauber Alex Dias Prado @ 2010-08-06 15:12 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: help-gnu-emacs

Andrea Crotti <andrea.crotti.0@gmail.com> writes:

> Gary <help-gnu-emacs@garydjones.name> writes:
>> Aren't you escaping your \ with the double \\? Then it inidicates that
>> the buffer name starts with a literal \ followed by some character
>> followed by the text "org". Mind you, regex isn't my strong suit,
>> either... :P
>
> Yes you're right, but for example this is correct
>   (add-to-list 'auto-mode-alist
>                '("\\.yaml$" . yaml-mode))
>
> if I understood you have to escape once in interactive commands while
> twice in non-interctive ones.
>
> Anyway I'm still not so happy, because I managed to filter out the
> org-files, but I still want to access to them.
>
> Maybe I could add another key combination that list me the org files and
> allows to access to them, but I have then to get used to it also.
>
> I have so many org-files because for example many assignments are also there..
Hi you could try anything, its much better than ido imho.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-05 15:55 ` suvayu ali
@ 2010-08-07 18:03   ` Dan Davison
  2010-08-09 16:47     ` Andrea Crotti
  0 siblings, 1 reply; 13+ messages in thread
From: Dan Davison @ 2010-08-07 18:03 UTC (permalink / raw)
  To: suvayu ali; +Cc: help-gnu-emacs, Andrea Crotti

Hi Andrea,

I've had this in my emacs.org for ages

#+begin_src emacs-lisp
  ;; ;; Things that I'm not really interested in seeing in emacs
  ;; ;; (you can still open them explicitly)
  (setq dan/ignored-extensions
        '(".html" ".csv" ".ps" ".bst" ".cls"
          ".fdf" ".spl" ".aux" ".ppt" ".doc" ".xls" ".mp3" ".org"))
  
  (mapc (lambda(extension)
          (add-to-list 'completion-ignored-extensions extension))
          dan/ignored-extensions)
  (ido-mode t) ;; (iswitchb-mode t)
  (setq ido-separator " ")
  
  ;; As regexps, these should really have terminal $
  (mapc (lambda(extension)
          (add-to-list 'ido-ignore-buffers (regexp-quote extension))
          (add-to-list 'ido-ignore-files (regexp-quote extension)))
        dan/ignored-extensions) 
  
  (add-to-list 'ido-ignore-buffers "\\*") ;; if you want *scratch* or *R* just type it
  ;; (add-to-list 'ido-ignore-files "^[^.]+$") ;; files must have a . in their name (experimental)
#+end_src

It prevents C-x b from showing me org files, amongst other things. Note
that org provides C-c b to switch to org buffers only.  The only thing I
don't like is that this prevents C-x C-f from offering org files. I've
wondered whether org should also provide a find-file command for org
files only. I'm sure that's possible to implement in many different ways
with the various completion engines.

Dan

suvayu ali <fatkasuvayu+linux@gmail.com> writes:

> On 5 August 2010 04:32, Andrea Crotti <andrea.crotti.0@gmail.com> wrote:
>> One thing that would be nice I think would be one command to toggle the
>> visibility of the org buffers on and off.
>> They can stay always open but I can afford one more click to access them
>> if they don't stay in the way while I work.
>>
>> Is there such a shadowing thing somewhere?
>> Thanks
>>
>
> How about ibuffer and filtering? Some thing like `/ m org-mode' in an
> active ibuffer should filter the org-mode buffers. Then you can invert
> the filter with `/ !'. Hopefully this helps.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-07 18:03   ` Dan Davison
@ 2010-08-09 16:47     ` Andrea Crotti
  2010-08-09 16:54       ` Richard Riley
  0 siblings, 1 reply; 13+ messages in thread
From: Andrea Crotti @ 2010-08-09 16:47 UTC (permalink / raw)
  To: help-gnu-emacs

Dan Davison <davison@stats.ox.ac.uk> writes:

> Hi Andrea,
>
> I've had this in my emacs.org for ages
>
> #+begin_src emacs-lisp
>   ;; ;; Things that I'm not really interested in seeing in emacs
>   ;; ;; (you can still open them explicitly)
>   (setq dan/ignored-extensions
>         '(".html" ".csv" ".ps" ".bst" ".cls"
>           ".fdf" ".spl" ".aux" ".ppt" ".doc" ".xls" ".mp3" ".org"))
>   
>   (mapc (lambda(extension)
>           (add-to-list 'completion-ignored-extensions extension))
>           dan/ignored-extensions)
>   (ido-mode t) ;; (iswitchb-mode t)
>   (setq ido-separator " ")
>   
>   ;; As regexps, these should really have terminal $
>   (mapc (lambda(extension)
>           (add-to-list 'ido-ignore-buffers (regexp-quote extension))
>           (add-to-list 'ido-ignore-files (regexp-quote extension)))
>         dan/ignored-extensions) 
>   
>   (add-to-list 'ido-ignore-buffers "\\*") ;; if you want *scratch* or *R* just type it
>   ;; (add-to-list 'ido-ignore-files "^[^.]+$") ;; files must have a . in their name (experimental)
> #+end_src
>
> It prevents C-x b from showing me org files, amongst other things. Note
> that org provides C-c b to switch to org buffers only.  The only thing I
> don't like is that this prevents C-x C-f from offering org files. I've
> wondered whether org should also provide a find-file command for org
> files only. I'm sure that's possible to implement in many different ways
> with the various completion engines.
>
> Dan
>


It took me some time to realize it but I think ido-mode is smarter than
what I thought.

My filter works, if I do C-x b and tab I don't see any org-file.
BUT if I start to type the name when it matches on one of the org-files
I see it anyway and I can switch to it.
For me it's perfect, even better than what I thought :)

And I don't find any C-c b in org-mode, sure it's not something you
defined yourself??
Thanks




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-09 16:47     ` Andrea Crotti
@ 2010-08-09 16:54       ` Richard Riley
  2010-08-10  8:34         ` Andrea Crotti
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Riley @ 2010-08-09 16:54 UTC (permalink / raw)
  To: help-gnu-emacs

Andrea Crotti <andrea.crotti.0@gmail.com> writes:

>
> And I don't find any C-c b in org-mode, sure it's not something you
> defined yourself??
> Thanks
>

Hi,


  (global-set-key (kbd "C-c b") 'org-switchb)

,----
| org-switchb is an interactive compiled Lisp function in `org.el'.
| 
| It is bound to C-c b.
| 
| (org-switchb &optional ARG)
| 
| Switch between Org buffers.
| With a prefix argument, restrict available to files.
| With two prefix arguments, restrict available buffers to agenda files.
| 
| Defaults to `iswitchb' for buffer name completion.
| Set `org-completion-use-ido' to make it use ido instead.
| 
`----




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-09 16:54       ` Richard Riley
@ 2010-08-10  8:34         ` Andrea Crotti
  2010-08-13  8:50           ` Andrea Crotti
  0 siblings, 1 reply; 13+ messages in thread
From: Andrea Crotti @ 2010-08-10  8:34 UTC (permalink / raw)
  To: help-gnu-emacs

Richard Riley <rileyrg@gmail.com> writes:

>
> Hi,
>
>
>   (global-set-key (kbd "C-c b") 'org-switchb)
>
> ,----
> | org-switchb is an interactive compiled Lisp function in `org.el'.
> | 
> | It is bound to C-c b.
> | 
> | (org-switchb &optional ARG)
> | 
> | Switch between Org buffers.
> | With a prefix argument, restrict available to files.
> | With two prefix arguments, restrict available buffers to agenda files.
> | 
> | Defaults to `iswitchb' for buffer name completion.
> | Set `org-completion-use-ido' to make it use ido instead.
> | 
> `----

Ah never seen it, and actually in version 7 there is no mention of a
binding (I have the same function but is not bound to C-c b).

Thanks




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-10  8:34         ` Andrea Crotti
@ 2010-08-13  8:50           ` Andrea Crotti
  2010-08-19 15:04             ` Chris Newton
  0 siblings, 1 reply; 13+ messages in thread
From: Andrea Crotti @ 2010-08-13  8:50 UTC (permalink / raw)
  To: help-gnu-emacs


Not yet quite satisfied unfortunately.
Using different desktops for different projects is a neat idea but
unfortunately not really realistic, I then open too many things and it I
can't filter with the damn desktop-clear

--8<---------------cut here---------------start------------->8---
  (setq desktop-clear-preserve-buffers
        (append '("\\.newsrc-dribble" "\\.org$" "eternal" "\\*shell\\*" "\\*group\\*" "\\*ielm\\*") desktop-clear-preserve-buffers))
--8<---------------cut here---------------end--------------->8---

But this looks correct, at least with that regexp the org files should
not be killed, but they are, and that takes forever...

I really think that the best way would be to use one desktop for each
Elscreen.
But I don't find much to play with in elscreen, and the project is
kindof dead apparently.

It would be then great to have
screen 1: project X
screen 2: project Y
screen 3: all the rest

Maybe having some rules in ido to hide or at least prioritize some
buffers.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Soo many buffers
  2010-08-13  8:50           ` Andrea Crotti
@ 2010-08-19 15:04             ` Chris Newton
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Newton @ 2010-08-19 15:04 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1660 bytes --]

Andrea,

I have a similar problem and came up with a (mostly) complete solution. I
used elscreen and added the ability to bind a set of buffers to a screen. It
tries its best to hide the buffers from the list depending on the screen
you're on. Its not quite complete and I haven't worked on it in a good while
and don't really consider it done, but I can get the code up somewhere in a
little while.

Some of the things I've done with it is bind all of gud and wanderlust to a
single elscreen. You can bind by path so all files in a subtree are on a
screen. I'm at the dentist now so I'll get to putting the code up later.
>
> Not yet quite satisfied unfortunately.
> Using different desktops for different projects is a neat idea but
> unfortunately not really realistic, I then open too many things and it I
> can't filter with the damn desktop-clear
>
> --8<---------------cut here---------------start------------->8---
> (setq desktop-clear-preserve-buffers
> (append '("\\.newsrc-dribble" "\\.org$" "eternal" "\\*shell\\*"
"\\*group\\*" "\\*ielm\\*") desktop-clear-preserve-buffers))
> --8<---------------cut here---------------end--------------->8---
>
> But this looks correct, at least with that regexp the org files should
> not be killed, but they are, and that takes forever...
>
> I really think that the best way would be to use one desktop for each
> Elscreen.
> But I don't find much to play with in elscreen, and the project is
> kindof dead apparently.
>
> It would be then great to have
> screen 1: project X
> screen 2: project Y
> screen 3: all the rest
>
> Maybe having some rules in ido to hide or at least prioritize some
> buffers.
>
>

[-- Attachment #2: Type: text/html, Size: 2024 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-08-19 15:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-05 11:32 Soo many buffers Andrea Crotti
2010-08-05 15:55 ` suvayu ali
2010-08-07 18:03   ` Dan Davison
2010-08-09 16:47     ` Andrea Crotti
2010-08-09 16:54       ` Richard Riley
2010-08-10  8:34         ` Andrea Crotti
2010-08-13  8:50           ` Andrea Crotti
2010-08-19 15:04             ` Chris Newton
2010-08-05 16:19 ` Tassilo Horn
2010-08-06 11:07   ` Andrea Crotti
2010-08-06 11:14     ` Gary
2010-08-06 13:58       ` Andrea Crotti
2010-08-06 15:12         ` Glauber Alex Dias Prado

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.