universal-ctags / citre

A superior code reading & auto-completion tool with pluggable backends.
GNU General Public License v3.0
326 stars 26 forks source link

how to reload citre? #80

Closed masatake closed 3 years ago

masatake commented 3 years ago

Is there a simple way to reload citre?

My reading session is more than a week. During the session, citre may be improved. After doing git pull upstream, what I should do for enjoying the latest result of the development. I think M-x unload-feature may help me but I'm not sure.

How about introducing M-x citre-reload ?

AmaiKinono commented 3 years ago

I think this is a question for Emacs, not Citre.

I think you are right. unload-feature is the right thing to do. You can write a command that (forcely) unloads citre-* (the list of citre-* features can be generated by filtering the variable features), then eval your Citre configuration.

I don't think we need citre-reload, as 1. it's a very corner use case, and 2. it requires to eval the user's configuration on Citre, and we don't know where it is.

I'm more interested in your super long code-reading session. Do you use citre-peek or xref? Do you use clue?

masatake commented 3 years ago

Like this?

(defun unload-citre ()                                                                                                                                                                                                                                        
  (interactive)                                                                                                                                                                                                                                               
  (mapc                                                                                                                                                                                                                                                       
   'unload-feature                                                                                                                                                                                                                                            
   (delete nil (mapcar (lambda (x) (when (string-prefix-p "citre-" (symbol-name x)) x))                                                                                                                                                                       
                       features)))                                                                                                                                                                                                                            

I'm more interested in your super long code-reading session. Do you use citre-peek or xref? Do you use clue?

Using xref mainly now.

AmaiKinono commented 3 years ago

Like this?

Yes. I don't have a PC on my hand now so I can't test it. seq-filter or cl-remove-if-not should look more cleaner.

I know a lot of people have "modular Emacs configuration", for example, they may put Citre related things into a file and provide init-citre in it. If this is the case, you could then unload and reload init-citre, so you have a reload-citre command. If this is not the case, I think you could just load init.el again.

masatake commented 3 years ago

Oh, I see. Thank you.