3

Using emacs in daemon mode is fine, because you only pay startup time once. But after a while the buffer and file list is getting filled. So is there a way to see only files which belong to the actual task (or project) I am working on?

Example:
I do some coding and I'm using Gnus to check mails. When switching from one source code file to another source code file, I do not want to see Gnus buffers when having the buffer list.

Another example:
I'm working on a big Tex document consisting of foo-1.tex to foo-5.tex stored in directory blah. A coworker gave me a copy of his documents foo-1.tex to foo-5.tex stored in directory moo, which I consult for ideas. When I switch through document of moo I do not want to get bothered with files from blah and vice versa.

A last example:
Three students gave me their homework, where they implemented their part of a source code cloze (fill-in-the-blank-source-code). I check and comprehend their coding (which is not easily done by diff) so I have three times the same filenames (with different content) from different directories. When switching in one students work from file to file, I do not want to get it mixed up with the work of any of the other students.
Edit: I have to visit lots of work from students coding, approx. 400 small projects each year. This comes in clusters, checking approx. 200 works in 4 weeks, something like this. I open those files just 1 to 3 times per file, give a mark, do some tests and compare to other works, afterwards this stuff goes to an archive. (It would be of no use to store permanent bookmarks or create projects on this.)

Question:
For this work in those examples, the daemon mode is more a pain than a help.
My solution now is to start for every task (or project) a standalone emacs process.
But I would like to use the emacs server.
Is there some sort of namespacing, where I can just see the buffers and files which belong together, and suppress the buffers (and files) not belonging to this?
If It works together with ido, the better.

It would be ok to tell emacs manually to which namespace a file belongs.
(A completely different solution would also be welcome.)

Edit:
As it seems it is not clear from my question: I want to reduce the choice of buffers. Ideally a different filter setting(namespace) per frame (having multiple emacs frames open at a time).
Thanks to basils comment I had a look at ibuffer and Gnus-style grouping from emacs-wiki. This helps getting the correct buffer, but its not quite what I'm searching.
After knowing ibuffer I would say in this question I used namespace in the meaning of filter.

  • While you're looking into new ways to manage buffers, files and projects, I recommend also taking a look at the built-in and very customisable/interactive ibuffer, as well as the third-party package projectile. The former presents a Dired-like interactive buffer list with custom filters, operations and foldable groups, and the latter supports project-specific file navigation, search, etc. – Basil Jun 9 '17 at 9:14
  • @Basil ibuffer with filters is very near to do what I want, maybe my question is not clear enough. (I will rephrase my question soon) – jue Jun 11 '17 at 0:35
2

Define "belong together". Only you know which files and buffers belong to a given context/project.

If you can define that set then you can label its elements.

In some contexts you can introduce your own naming convention for buffers or files. In other contexts you can't do that. Often you can place the files that belong together in the same directory or in related directories. In such cases you can take advantage of your naming convention or the directory locations when accessing or acting on files and buffers.

Another thing you can do, which can apply to both files and non-file buffers, is to tag them with whatever labels you want. You can do this easily using library Bookmark+. See Bookmark Tags and Tagging Files.

You can apply multiple tags to the same file or buffer. Tags give you an easy way to define and manipulate sets of Emacs objects (such as files and buffers).


Additional info about organizing stuff into projects:

  • the first sentence, is it meant as a question to me? (I know which files should belong together and I would tell emacs, so emacs can hide the other stuff.) Directories: I see, I have to use short directory names to be able to distinguish files. Thanks for the point, but the bufferlist is still somewhat messy/crowded. I will have a look at bookmark+ and tags. – jue Jun 8 '17 at 22:51
  • Yes; I meant that it is up to you to decide what belongs together and somehow organize it or tell Emacs about it. – Drew Jun 8 '17 at 23:07
  • Bookmark+ and Tagging adds just more information to buffers, but I would like to reduce the choice for buffers available. maybe my question is not clear enough. – jue Jun 13 '17 at 9:10
  • Sorry, but I don't understand. (1) Bookmark+ tagging does not add buffers or add information to buffers. (2) What do you mean by "the choice of buffers"? It sounds like you're looking for buffer filtering. There are lots of options for that (and that question might be a duplicate - you might want to look for it). – Drew Jun 13 '17 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.