Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sorting by name the methods presented in the ECB-methods buffer

I'm using ECB (Emacs Code Browser) and my default layout is as follows:

;; +------+-------+--------------------------------------+
;; |              |                                      |
;; | Directories  |                                      |
;; |              |                                      |
;; +------+-------+                                      |
;; |   History    |              Edit                    |
;; +------+-------+                                      |
;; |   Methods    |                                      |
;; |              |                                      |
;; +-----------------------------------------------------+

By default, the methods are presented in the order they appear in the edited buffer, yet I'm searching for a way of having them sorted by name. I wanted to use something like ecb-methods-sort-method but it does not seem to exist. Any hint on how to set it up?

like image 932
Sebastien Varrette Avatar asked Jan 03 '12 13:01

Sebastien Varrette


1 Answers

I took quick look at the docs, Look slike you can customize 'ecb-methods-menu-sorter'.

C-h v ecb-methods-menu-sorter

From the docs:

*Function which re-sorts the menu-entries of the directories buffer.          
If a function then this function is called to re-arrange the menu-entries of  
the combined menu-entries of the user-menu-extensions of                      
`ecb-directories-menu-user-extension' and the built-in-menu                   
`ecb-directories-menu'. If nil then no special sorting will be done and the   
user-extensions are placed in front of the built-in-entries.                  

The function get one argument, a list of menu-entries. For the format of this 
argument see `ecb-directories-menu-user-extension'. The function must return a
new list in the same format. Of course this function can not only re-arrange  
the entries but also delete entries or add new entries.                       
like image 64
Raghu Avatar answered Oct 15 '22 10:10

Raghu