Author Topic: custom proc_search not automatically run  (Read 2663 times)

RaffoPazzo

  • Community Member
  • Posts: 79
  • Hero Points: 3
custom proc_search not automatically run
« on: April 29, 2019, 11:42:23 AM »
I am trying to add basic support for Idris tags. I created a new language with mode name Idris (capital I) and extension idr. In my idris.e I have the following (I use message() to debug it):

Code: [Select]
int idr_proc_search(_str &proc_name, bool find_first)
{
  int status=0;
  if (find_first) {
    if (proc_name:=='')
      proc_name = _clex_identifier_re();
    status = search('^\c{'proc_name'}[ \t]*\:', '@rhi');
  } else
    status = repeat_search();
  if (status)
    return status;
  tag_init_tag_browse_info(auto cm, get_match_text(0), "", SE_TAG_TYPE_PROTO);
  proc_name = tag_compose_tag_browse_info(cm);
  message(proc_name);
  return 0;
}

When I run this function manually (called from a command) it produces what I believe is the right string but my Def view is always empty and nothing is displayed in the message bar, suggesting that it is not run automatically when I open an .idr file.

Even if I rename the function to Idris_proc_search or idris_proc_search it still does not work as I expect.

Am I misunderstanding how this thing is supposed to work?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 7131
  • Hero Points: 544
Re: custom proc_search not automatically run
« Reply #1 on: April 29, 2019, 02:01:29 PM »
Instead of guessing what the langid is, the attached macro will display the langid. Load it and run the command "display_langid". It will display the langid in the message line.

RaffoPazzo

  • Community Member
  • Posts: 79
  • Hero Points: 3
Re: custom proc_search not automatically run
« Reply #2 on: April 29, 2019, 02:34:11 PM »
Instead of guessing what the langid is, the attached macro will display the langid. Load it and run the command "display_langid". It will display the langid in the message line.

Thanks. This printed idris and I did try to rename my function to idris_proc_search. What could be a reason for it not being run automatically when I open an idris file?

RaffoPazzo

  • Community Member
  • Posts: 79
  • Hero Points: 3
Re: custom proc_search not automatically run
« Reply #3 on: April 29, 2019, 02:38:37 PM »
Sorry it worked now. I must have got lost track of what I did try and how.