0
votes

Every time I hit CTRL + Left click in Emacs I get a list of all opened buffers. How can I change the default output in order to pop up a menu customized by myself, I have something like this in mind:

Buffer Menu  
-----------
dot.C     >  ex1.c  
dot.java     ex2.c
dot.lisp     ex3.c
dot.?  
... 
-----------

For instance, every .c file would be stored inside dot.c entry as showed above.

1

1 Answers

1
votes

Are you saying that you'd have one menu for .c files, and another for .h files, even though they're both using the same major mode? The standard menu categorizes based on major mode, so I think you'd need custom menu code to achieve that.

A hacky approach which springs to mind would be to define minimal derived major modes in order to associate each with a different filename extension, and then you could use the existing menus to achieve your goal.

If you didn't mean that, and grouping by major mode is fine, then the current system should already provide a solution.

In either case, the following may prove useful: