Need help with errors

11 views
Skip to first unread message

Perry Smith

unread,
Jan 2, 2017, 8:54:22 AM1/2/17
to emacs-helm
I have a mode for cscope: https://github.com/pedz/cscope.el

It eventually calls find-tag-tag which is in etags.el.  When helm minor mode is on for the buffer and one of the cscope function is called such as cscope-find-references, I get an error:

Aborting an helm session running in background
custom-initialize-reset: In ‘cscope-find-references’ source: ‘#[0 \306\300\301\304\305$\307 \303\242\310=\204O \311\230\204O\312 "\204O\312\313 ! "\204O \235\204O \227 \235\204O \226 \235\204O\314\315\316\311 #C "\262 \310 \317\302 "\207 [#[771 r\300q\210\212\302 \303 \210)\304 \305 $*\207 [gen_compiler.c enable-recursive-minibuffers t visit-tags-table-buffer complete-with-action tags-completion-table] 8

(fn STRING PRED ACTION)] nil prepare_outfile (nil) nil nil helm-comp-read-get-candidates nil t  assoc intern append replace-regexp-in-string \s\ helm-cr-default helm-cr-unknown-pattern-flag helm-pattern] 6]’
 (user-error "No recursive edit is in progress")

find-tag-tag calls completing-read which ends up calling helm--completing-read-default (Note... all this is my best guess)

The truth is, I've never really liked find-tag-tag 100% because the patterns it uses are too sloopy for what I want.  I want the default to be the C identifier under the current point if the point is within a C identifier and find-tag-tag matches too much.  e.g. it matches all of foo->bar when point is at the beginning or within bar due to the syntax tables.

So, I think I want to do two things.  First is to remove the dependency on find-tag-tag and implement what I want directly.  And then I'd like to leverage helm if it is present.

The reason for the post is a few things. 

1) I thought there may be some interest by the helm developers in this use case.  Perhaps they believe it should work and are surprised that it does not.
2) I can (and have been) cruising the source but was wondering if there are any source material for developers that want to tie in to helm.  Good examples, etc.
3) I have no ambition to recreate the wheel so if there already exists something close to what I describe, can you please point me to it.  Currently I am thinking I am going to leverage thing-at-point and define c-identifier so that (thing-at-point 'c-identifier) will work.  I may spin this off into a separate package.  I'm a little surprised that nothing like that exists but so far I've not been able to find it.
4) The basic use case is the user is on an identifier and then hits a key sequence to get cscope to bring up a list of hits for that same identifier.  Are there features of helm such as history that you believe I should leverage to get a better user interface?

I appreciate your time and want to thank everyone for developing helm.  It is still very "odd" to me.  I want to hit TAB sooooo bad.  But I'm getting use to it.  Some things in Helm I find extremely powerful.

Perry

Thierry Volpiatto

unread,
Jan 2, 2017, 3:18:01 PM1/2/17
to emacs...@googlegroups.com

Perry Smith <ped...@gmail.com> writes:

> I have a mode for cscope: https://github.com/pedz/cscope.el
>
> It eventually calls find-tag-tag which is in etags.el. When helm minor
> mode is on

I think you mean `helm-mode`, `helm--minor-mode` is a mode used
internally by helm and you should not use it outside of helm.

> for the buffer and one of the cscope function is called such as
> cscope-find-references, I get an error:
>
> Aborting an helm session running in background

That's mean a helm-session was running for some reason and for safety
when you try to run helm and a helm session is running in background,
helm abort it and raise an error.

> custom-initialize-reset: In ‘cscope-find-references’ source: ‘#[0
> \306\300\301\304\305$\307 [..]

Try to load the relevant source files (*.el) to avoid byte-code in
backtraces.

> find-tag-tag calls completing-read which ends up calling
> helm--completing-read-default (Note... all this is my best guess)

More or less yes.

> The truth is, I've never really liked find-tag-tag 100% because the
> patterns it uses are too sloopy for what I want.

Why not using `helm-etags-select` ? If the default is not what you want
just make a bugreport on github and I will do it.

> I want the default to be the C identifier under the current point if
> the point is within a C identifier and find-tag-tag matches too
> much. e.g. it matches all of foo->bar when point is at the beginning
> or within bar due to the syntax tables.

> So, I think I want to do two things. First is to remove the dependency
> on find-tag-tag

Use `helm-completing-read-handlers-alist`.

> and implement what I want directly. And then I'd like to leverage helm
> if it is present.
>
> The reason for the post is a few things.
>
> 1) I thought there may be some interest by the helm developers in this
> use case. Perhaps they believe it should work and are surprised that
> it does not.

> 2) I can (and have been) cruising the source but was wondering if
> there are any source material for developers that want to tie in to
> helm. Good examples, etc.

See https://github.com/emacs-helm/helm/wiki/Developing
It is not complete, but it is a good start, don't hesitate to ask if you
need more help.

> 3) I have no ambition to recreate the wheel so if there already exists
> something close to what I describe, can you please point me to
> it.

I think you only have to change :default in `helm-etags-select`.

> Currently I am thinking I am going to leverage thing-at-point and
> define c-identifier so that (thing-at-point 'c-identifier) will
> work.

Yes and pass this to :default when major-mode is C.

> I may spin this off into a separate package. I'm a little surprised
> that nothing like that exists but so far I've not been able to find
> it.

I have no or very little knowledge in C, so I never worked on such things.

> 4) The basic use case is the user is on an identifier and then hits a
> key sequence to get cscope to bring up a list of hits for that same
> identifier. Are there features of helm such as history that you
> believe I should leverage to get a better user interface?

For now I don't really know what you want to do so it is hard to give
you some hints.

> I appreciate your time and want to thank everyone for developing
> helm. It is still very "odd" to me. I want to hit TAB sooooo bad. But
> I'm getting use to it. Some things in Helm I find extremely powerful.

Glad you like helm.

--
Thierry
Reply all
Reply to author
Forward
0 new messages