procmail
[Top] [All Lists]

Re: Emacs mode for procmail rc file editing

2004-07-25 13:18:18
On Sun, 25 Jul 2004 10:24:12 -0600, Justin Gombos 
<mindfuq(_at_)zianet(_dot_)com> wrote:
* Google Kreme <gkreme(_at_)gmail(_dot_)com> [2004-07-25 09:16]:

Would a procmail.vim help you write your own .el?

I don't know what a vim is.  If it's a vi version of a syntax spec,
then it would depend on how readable it is, because I don't know the
first thing about vi.

It's a vim syntax file.  I think they are pretty readable, so I'm
pasting it below.  It might give you enough information to setup for
.el  Watch for line wraps, most of the long lines start with "syn".  I
marked the longest ones with a comment.

"" START
" Vim syntax file
" Language:     Procmail definition file
" Maintainer:   Melchior FRANZ <mfranz(_at_)aon(_dot_)at>
" Last Change:  2003 Aug 14
" Author:       Sonia Heimann

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

syn match   procmailComment      "#.*$" contains=procmailTodo
syn keyword   procmailTodo      contained Todo TBD

syn region  procmailString       start=+"+  skip=+\\"+  end=+"+
syn region  procmailString       start=+'+  skip=+\\'+  end=+'+

" One long line
syn region procmailVarDeclRegion start="^\s*[a-zA-Z0-9_]\+\s*="hs=e-1
skip=+\\$+ end=+$+ contains=procmailVar,procmailVarDecl,procmailString
syn match procmailVarDecl contained "^\s*[a-zA-Z0-9_]\+"
syn match procmailVar "$[a-zA-Z0-9_]\+"

syn match procmailCondition contained "^\s*\*.*"

syn match procmailActionFolder contained "^\s*[-_a-zA-Z0-9/]\+"
syn match procmailActionVariable contained "^\s*$[a-zA-Z_]\+"
syn region procmailActionForward start=+^\s*!+ skip=+\\$+ end=+$+
syn region procmailActionPipe start=+^\s*|+ skip=+\\$+ end=+$+
" One long line
syn region procmailActionNested start=+^\s*{+ end=+^\s*}+
contains=procmailRecipe,procmailComment,procmailVarDeclRegion

syn region procmailRecipe start=+^\s*:.*$+ end=+^\s*\($\|}\)+me=e-1
contains=procmailComment,procmailCondition,procmailActionFolder,
" One long line
procmailActionVariable,procmailActionForward,procmailActionPipe,procmailActionNested,procmailVarDeclRegion

" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_procmail_syntax_inits")
  if version < 508
    let did_procmail_syntax_inits = 1
    command -nargs=+ HiLink hi link <args>
  else
    command -nargs=+ HiLink hi def link <args>
  endif

  HiLink procmailComment Comment
  HiLink procmailTodo    Todo

  HiLink procmailRecipe   Statement
  "HiLink procmailCondition   Statement

  HiLink procmailActionFolder   procmailAction
  HiLink procmailActionVariable procmailAction
  HiLink procmailActionForward  procmailAction
  HiLink procmailActionPipe     procmailAction
  HiLink procmailAction         Function
  HiLink procmailVar            Identifier
  HiLink procmailVarDecl        Identifier

  HiLink procmailString String

  delcommand HiLink
endif

let b:current_syntax = "procmail"

# Set tabstops to 4 characters
" vim: ts=4

-- 
gkreme at gmail or kreme at kreme or syth at mac
 :: Don't get saucy with me, Bernaise ::

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>