3

Some context:

I'm doing some linux kernel development on a Debian VM so naturally I'm using tramp. I want to use semantic-symref, but the trouble is that:

  1. Semantic will eventually call cedet-gnu-global-call
  2. Which will use the value of cedet-global-command
  3. Which will crap out because it uses 'call-process.

So from what I understand, I need it to be using tramp-call-process.

My question is, can I monkey patch a function, namely cedet-gnu-global-call? I have seen stuff like defadvice, is this a use case for my problem?

By monkey patching, I mean that I want to replace cedet-gnu-global-call with mine, but at runtime.

Or is there some way to get cedet-global to be smart when used over tramp?

1
  • Actually, rather than tramp-call-process, it should probably call process-file (which does delegate to Tramp, depending on default-directory).
    – Stefan
    Commented Nov 7, 2014 at 22:05

1 Answer 1

3

In Emacs ≥24.4, you could try something like

(defun my-call-process-hack (orig program &rest args)
  (apply (if (equal program cedet-global-command) #'process-file orig)
         program args))
(advice-add 'call-process :around #'my-call-process-hack)
3
  • Amazing! This worked. Now I just have a problem of semantic-symref giving me an empty buffer for results, even for kmalloc.., but at least this problem is solved.
    – c-o-d
    Commented Nov 8, 2014 at 1:52
  • Alternative to semantic-symref, you could use ggtags-find-references from ggtags. I wrote a guide for using it here. If you want semantic-symref to be functional, you have to setup include paths with EDE.
    – Tu Do
    Commented Nov 12, 2014 at 5:20
  • 1
    @TuDo I will check out ggtags-find-references. I basically avoid EDE and got semantic working on mostly everything by manually setting up the semantic-dependency-* functions. Also, your posts are absolutely incredible! Thank you so much for them. EDIT: ggtags-find-references works! Excellent!
    – c-o-d
    Commented Nov 12, 2014 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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