Giter VIP home page Giter VIP logo

bro-mode's Introduction

Bro-Mode - Bro Scripting Language Major Mode for emacs

Bro Mode

An emacs major mode for the Bro Scripting Language.

Setup

(setq exec-path (append exec-path '("/Users/Mac/Documents/src/bro/build/src/")))
(setenv "PATH" (concat (getenv "PATH") ":/Users/Mac/Documents/src/bro/build/src/"))
(setenv "BROPATH" "/Users/Mac/Documents/src/bro/build/src:/Users/Mac/Documents/src/bro/scripts:/Users/Mac/Documents/src/bro/scripts/policy:/Users/Mac/Documents/src/bro/scripts/site")
(add-to-list 'load-path "~/emacs.d/site-lisp/bro-mode/")
(setq bro-event-bif "~/Documents/src/bro/build/src/base/event.bif.bro")
(setq bro-tracefiles "~/tracefiles")
(require 'bro-mode)

Features

  1. Indentation
  2. Keyword, builtin, and operator highlighting
  3. bro-event-lookup function Quick lookup of builtin functions. Place the point over a built in bro function (i.e. http_header ) and M-x bro-event-lookup will open a temporary buffer with the documentation with bro-mode highlighting for that function.
  4. bro-event-query function Quick keyword lookup of builtin functions. M-x bro-event-query and provide a query. A new buffer will be created with the results.
  5. bro-run Requires that PATH and BROPATH be set correctly. I run out of the build directory and use the following in my init file.
    (setq exec-path (append exec-path '("/Users/Mac/Documents/src/bro/build/src/")))
    (setenv "PATH" (concat (getenv "PATH") ":/Users/Mac/Documents/src/bro/build/src/"))
    (setenv "BROPATH" "/Users/Mac/Documents/src/bro/build/src:/Users/Mac/Documents/src/bro/scripts:/Users/Mac/Documents/src/bro/scripts/policy:/Users/Mac/Documents/src/bro/scripts/site")
        

    It also requires that bro-tracefiles be set to the directory with your tracefiles.

    (setq bro-tracefiles "~/tracefiles")      
        

    Once it’s properly set up, M-x bro-run will send the entire buffer as code to bro asking for the tracefile you want to use and the signature file you want use.

  6. bro-run-region Same as bro-run but with the region instead of the entire buffer.

Features to add and bugs to fix

bro-run and bro-run-region should use file lookups similiar to find-file instead of strings

bro-indent-line treats a brace followed by a semi-colon (i.e. “};”) a little wonky

bro-indent-line needs considerable clean up.

add bro-function-query

add bro-function-lookup

History

DateChange
[2012-07-14 Sat 12:51]Added bro-event-lookup
[2012-07-16 Mon 02:07]Removed a spare bro-event-bif definition
[2012-07-16 Mon 02:09]Added bro-event-query
[2012-07-16 Mon 16:07]Added bro-insert-event
[2012-07-16 Mon 16:59]Bug Fix to close event.bif.bro when bro-event-query is done with it.
[2012-07-16 Mon 17:04]Bug Fix to set the scope of the re-search-forward in bro-event-lookup to beginning of the buffer
[2012-08-04 Sat]Added bro-run and bro-run-region. Multiple indentation fixes.

bro-mode's People

Contributors

srunnels avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.