Sorting by name the methods presented in the ECB-methods buffer
Asked Answered
M

1

29

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?

Merkley answered 3/1, 2012 at 13:34 Comment(3)
potentially, this could be done, for example, by changing ECB code & introduce new customization parameter. Do you still need this?Spinning
yes, but that's not crucial obviously, simply I see it present on other editors (such as TextMate) and it definitively makes sense. Now I confess I'm not sufficiently good lisp programmer to go into ECB code...Merkley
Please, write to me via e-mail or file corresponding issue at github.com/alexott/ecb - I'll try to find time to implement thisSpinning
L
1

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.                       
Latarsha answered 6/12, 2012 at 14:19 Comment(1)
Let me know if you need help implementing the sort functionLatarsha

© 2022 - 2024 — McMap. All rights reserved.