Emacs Modes

    Emacs modes useful for editing files at the correlator.

    Current Major Mode Support

    VEX and v2d files are currently supported.

    Using the emacs major modes

    The emacs major modes here are designed to help in editing VEX and v2d files in the emacs editor by having emacs understand the basic structure of the files, enabling fontification to color-code information, and by gathering information for imenu so that shortcuts to major block areas can be set up.  For example,

    Indentation

    The major modes support standard emacs indentation commands to automatically line up entries within subblocks.

    Fontification

    The modes support identification of block names and parameter names within files, and font-lock-mode will use this information to set up font characteristics (usually color-coding) of this information, comments, and so on.  When the maximum fontification level is set, parameters are identified, and only when the parameter value syntax agrees exactly with the spacification for allowed values will the parameter name (and usually the values too) be fontified.  This can be a useful chack that no major errors have been made in entering information.  Checking that the actual values provided are correct is still up to you.  To set up the maximum fontification, in your .emacs file do

    (setq font-lock-maximum-decoration t)

    imenu Support

    Major and minor blocks are recognized by the major modes here, and information is provided to the imenu routines to support rapid jumping to specific areas of the files.  For example, suppose that you want to jump to the area where the Effelsberg antenna is defined.  imenu can help you do this by providing a list of all antenna definitions for you to chose from.  If you are not familiar with imenu, try inserting the following into your .emacs file:

    (add-hook 'c++-mode-hook 'imenu-add-menubar-index)
    (add-hook 'c-mode-hook 'imenu-add-menubar-index)
    (add-hook 'python-mode-hook 'imenu-add-menubar-index)
    (add-hook 'v2d-mode-hook 'imenu-add-menubar-index)
    (add-hook 'vex-mode-hook 'imenu-add-menubar-index)
    (defun try-to-add-imenu ()
      (condition-case nil (imenu-add-to-menubar "Function") (error nil)))
    (add-hook 'font-lock-mode-hook 'try-to-add-imenu)
    (defconst imenu-sort-function 'imenu--sort-by-name)

     

    One Parameter Per Line

    One of the limitations of the regular expression scanning currently used by these emacs major modes is that nearly all parameters need to be specified on separate lines.  Although the actual format specifications for the files allows the user to put multiple parameters on the same line, the emacs major modes will work best when each parameter is specified on a separate line.

     

     

    VEX Files

    The current lisp code for editing VEX files is version 2012 Sep 07, and can be found at vex.el.  This mode currently supports the VEX Rev 1.999 specification located at https://safe.nrao.edu/wiki/bin/view/VLBA/Vex2doc.

     To use this major mode for editing VEX files, put vex.el in your emacs load path (for example, in ~/.emacs.d/;required entry in .emacs is:(setq load-path (cons "~/.emacs.d" load-path)) ), and at some point in your .emacs file say:

    (require 'vex)

     

    See the Commentary section in the file to read more information about using vex.el.

    imenu support is set up to automatically scan for all scans, defs, and blocks.  Within the following major blocks, individual defs are also scanned separately: ANTENNA, BBC, BITSTREAM, CLOCK, DAS, FREQ, IF, MODE, SITE, SOURCE, STATION, THREAD, TRACKS.  Support for finding defs within these blocks is currently limited, and requires that specific parameter names are found immediately after the minor block start.  If you have problems with this functionality working, please contact the developer (see the e-mail address in the lisp files).

     

    v2d Files

    The current lisp code for editing v2d files is version 2012 Sep 07, and can be found at v2d.el.  This mode currently supports DiFX 2.0.1 syntax, plus extensions for spacecraft correlation.

    To use this major mode for editing v2d files, put v2d.el in your emacs load path (for example, in ~/.emacs.d/), and at some point in your .emacs file say:

    (require 'v2d)
     

    See the Commentary section in the file to read more information about using v2d.el.

    imenu support is set up to automatically scan for all ANTENNA, RULE, SETUP, and SOURCE blocks.  Parameter names in the global level are also scanned.

     

     

    Licensing Restrictions

    The fortran.el file upon which the vex.el and v2d.el modes are based has a GPL3 license.  The vex.el and v2d.el modes are therefore also covered under GPL3.  The GPL3 license can be found at http://www.gnu.org/licenses/gpl.html.  The original lisp code used to start development of the VEX and v2d modes is located at fortran.el.

    Tag page (Edit tags)
    • No tags
    Pages that link here
    Page statistics
    1603 view(s), 6 edit(s) and 5583 character(s)

    Comments

    You must login to post a comment.

    Attach file

    Attachments

    FileSizeDateAttached by 
     fortran.el
    fortran.el used for initial development of vex.el and v2d.el
    91.26 kB08:57, 8 Sep 2012andersonActions
     v2d.el
    v2d.el version 2012 Sep 07
    54.05 kB12:00, 7 Sep 2012andersonActions
     vex.el
    vex.el version 2012 Sep 07
    84.31 kB11:14, 7 Sep 2012andersonActions