[RFC] [emacs] ncl-doc.el and changes in ncl.el

From: yagnesh <yagnesh_at_nyahnyahspammersnyahnyah>
Date: Thu Dec 15 2011 - 21:02:18 MST

This mail only related to Emacs users, if you are not an emacs user you may
well move on.

Hello,
Greetings!!

I wrote a little addon package named ncl-doc.el[1] to help me lookup the
NCL documentation from ncl website. In order to write that I
needed to modify ncl.el, gen_emacs.ncl and gen_editor_utils.ncl.

In short:
To get an idea what this is about please see the attached
screen shot where I loaded the ncl-doc.el and called the function
"ncl-doc-query-at-point" and given "add" string.

In long:
Basic idea is to store all the keywords of ncl as separate lists in the
ncl.el and using those lists constructing the documentation URLs on
demand. This is I think a good change, Since we can now use these
lists to extend support for auto completion and other things.
please read on..

=================
ncl-doc.el
=================

ncl-doc.el has one main user function which does few things as it is written
in the commentary section of the file.
------------------------------------------------------
  M-x ncl-doc-query-at-point ( C-c C-s )
     This function does:
      1) It prompts for a string/keyword and collects a given string
      2) It tries to find a URL for the given string
          + If no URL is found, then goes on to search for the given
            string.
          + Displays all search matches in separate buffer category wise.
            In that buffer RET in any search match will call browser for
            take you to that page.
          + If no matches found for a given string it leaves you there

  M-x ncl-doc-query-open ( C-c C-o )
      Use this function which lets you choose from the all keywords ncl-doc
      has in its database and takes you to that page.
------------------------------------------------------

=================
changes in ncl.el
=================
To be able to use this ncl-doc.el you need to add modified version of
ncl.el [2].

ncl.el has now few variables defined starting with ncl-key-* for
different keyword categories. previous font-locking variable are deleted
and reconstructed with newly defined variables. Font-lock
support extended to variable for variables. that is only the main change

one more little feature added. imenu support which is extremely handy (at
least for me) for navigation within the buffer using keyboard or mouse.
by defaults no menu is displayed. call M-x ncl-add-imenu-menu in a large
buffer.

the code lives in git repository[3] on github. To download all my
changes and other things in the repository use the following

https://github.com/yyr/ncl.el/zipball/master

using git
git clone git://github.com/yyr/ncl.el.git

===
To test please load both modified ncl.el and ncl-doc.el (M-x load-file) and
call the function ncl-doc-query-at-point (M-x
ncl-doc-query-at-point) give any ncl keyword.

This is my first elisp attempt, there will be obvious bugs,
optimization issues.

I would be happy if someone can comment/test/review/dismiss.

@Mary if you think the changes in ncl.el are welcome changes I would be
happy to provide a patch.

Footnotes:
[1] https://raw.github.com/yyr/ncl.el/master/ncl-doc.el
[2] https://raw.github.com/yyr/ncl.el/master/ncl.el
[3] https://github.com/yyr/ncl.el

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

ncl-doc-in-action.png
Received on Thu Dec 15 20:52:02 2011

This archive was generated by hypermail 2.1.8 : Thu May 03 2012 - 09:27:53 MDT