help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Comments (SAS) in generic mode?


From: fork
Subject: Comments (SAS) in generic mode?
Date: Thu, 26 May 2011 16:15:25 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hi there,

I am defining a generic mode, which seems to work fine, except that I can't get
the "*comment;" notation from sas to work ("*" starts a comment, ";" ends it)
(the c-style works fine).  If anyone can take a look and give me pointers that
would be awesome:

(define-generic-mode 'simple-sas-mode
  '( ("*" . ";") ("/*" . "*/")) 
  '("proc" "data" "run" "quit" "if" "end" "else" "begin")
  ()
  '("\\.sas\\'")
  (list (lambda () (progn 
     (local-set-key (kbd "<return>") 'newline-indent-relative)
     (local-set-key (kbd "C-<return>") 'newline)
     (local-set-key (kbd "<tab>") 'tab-to-tab-stop)  
     (local-set-key (kbd "C-<tab>") 'indent-relative-maybe)  
     (modify-syntax-entry ?_ "w"))))
  "Major mode for very simple SAS highlighting and indenting.")

Thanks!

PS -- this is where I want to figure out backspacing to the last tab stop, if
anyone has any ideas.

PPS -- I am aware of ESS, but to be honest I think their SAS editing mode leaves
a lot to be desired, and is WAY to long and complex for me to want to modify.
SAS is a lot like SQL, in that it isn't really obvious how to indent, so some
simple keys to go back and forth between indent levels is all I need/ want; in
the Algol and Lisp families of languages it seems much easier to
programmatically determine how to indent.

PPPS -- the syntax entries are used to make dynamic abbreviation work nicely
with underscores which are almost never word boundaries.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]