Emacs mode for Slate
Nicolas et Ryoko
nicolas.pelletier3 at wanadoo.fr
Tue May 27 13:20:35 PDT 2003
Hello,
I committed the following crimes to get slate-mode.el to compile and
run on GNU Emacs 21.3. I am wondering which flavor of Emacs others
are using, because I do not seem to have eql and set-keymap-parents
(plural form).
--
Nicolas
-------------- next part --------------
Index: slate-mode.el
===================================================================
RCS file: /var/lib/cvs/slate/slate/etc/slate-mode.el,v
retrieving revision 1.23
diff -u -r1.23 slate-mode.el
--- slate-mode.el 25 May 2003 21:47:22 -0000 1.23
+++ slate-mode.el 27 May 2003 20:13:26 -0000
@@ -33,6 +33,8 @@
;;; Code:
+(require 'comint)
+
(defvar slate-mode-abbrev-table nil
"Abbrev table in use in slate-mode buffers.")
(define-abbrev-table 'slate-mode-abbrev-table ())
@@ -138,7 +140,7 @@
(defconst slate-inf-mode-map (copy-keymap comint-mode-map)
"The modemap used for interactive Slate sessions.")
-(set-keymap-parents slate-inf-mode-map (list slate-mode-map))
+(set-keymap-parent slate-inf-mode-map slate-mode-map)
(defun slate-inf-mode ()
"Major mode for interacting Slate subprocesses.
@@ -279,7 +281,7 @@
(slate-skip-comments-backward)
(comint-send-region inferior-slate-buffer-name start (point))
(if (and (>= (point) 2)
- (eql (preceding-char) ?.))
+ (equal (preceding-char) ?.))
(comint-send-string inferior-slate-buffer-name "\n")
(comint-send-string inferior-slate-buffer-name ".\n"))
(display-buffer inferior-slate-buffer-name t)))
@@ -556,11 +558,11 @@
slate-indent-amount))
;; we're top level
(setq indent-amount slate-indent-amount)))
- ((eql (nth 0 state) 0) ;at top-level
+ ((equal (nth 0 state) 0) ;at top-level
(beginning-of-line)
(slate-forward-whitespace)
(setq indent-amount (slate-current-column)))
- ((eql (preceding-char) ?.) ;at end of statement
+ ((equal (preceding-char) ?.) ;at end of statement
(slate-find-statement-begin)
(setq indent-amount (slate-current-column)))
((memq (preceding-char) '(?| ?\[))
@@ -569,7 +571,7 @@
(slate-backward-whitespace)
(setq indent-amount (+ (slate-current-column)
slate-indent-amount)))
- ((eql (preceding-char) ?:)
+ ((equal (preceding-char) ?:)
(beginning-of-line)
(slate-forward-whitespace)
(setq indent-amount (+ (slate-current-column)
@@ -615,7 +617,7 @@
(/= start (point-min)))
(goto-char start)
(slate-backward-whitespace) ;may be at ! "foo" !
- (when (eql (preceding-char) ?@)
+ (when (equal (preceding-char) ?@)
; (backward-char 1)
(beginning-of-line)
(slate-forward-whitespace)
@@ -636,13 +638,13 @@
or non-white space, non-comment character"
(while (looking-at (concat "[" slate-whitespace "\"]"))
(skip-chars-forward slate-whitespace)
- (when (eql (following-char) ?\")
+ (when (equal (following-char) ?\")
(forward-sexp 1))))
(defun slate-backward-whitespace ()
"Like forward whitespace only going towards the start of the buffer"
(while (progn (skip-chars-backward slate-whitespace)
- (eql (preceding-char) ?\"))
+ (equal (preceding-char) ?\"))
(backward-sexp 1)))
(defun slate-forward-sexp (n)
@@ -699,11 +701,11 @@
prematurely. Also, goes to start of method if we started in the method
selector."
(let (start ch)
- (when (eql (preceding-char) ?.) ;if we start at eos
+ (when (equal (preceding-char) ?.) ;if we start at eos
(backward-char 1)) ;we find the begin of THAT stmt
(while (and (null start) (not (bobp)))
(slate-backward-whitespace)
- (cond ((eql (setq ch (preceding-char)) ?.)
+ (cond ((equal (setq ch (preceding-char)) ?.)
(let (saved-point)
(setq saved-point (point))
(slate-forward-whitespace)
@@ -711,14 +713,14 @@
(setq start (point))
(goto-char saved-point)
(slate-backward-sexp 1))))
- ((eql ch ?^) ;HACK -- presuming that when we back
+ ((equal ch ?^) ;HACK -- presuming that when we back
;up into a return that we're at the
;start of a statement
(backward-char 1)
(setq start (point)))
- ((eql ch ?\[)
+ ((equal ch ?\[)
(setq start (point)))
- ((eql ch ?|)
+ ((equal ch ?|)
(backward-char 1)
(skip-chars-backward "^\[")
(slate-backward-whitespace)
@@ -853,7 +855,7 @@
;; or maybe an immediate expression...
(progn
(forward-sexp)
- (if (eql (following-char) ?:) ;keyword selector
+ (if (equal (following-char) ?:) ;keyword selector
(progn ;parse full keyword selector
(backward-sexp 1) ;setup for common code
(slate-forward-keyword-selector))
@@ -872,10 +874,10 @@
))))
;; this must be a binary selector, or a temporary
- (when (eql (following-char) ?|)
+ (when (equal (following-char) ?|)
(end-of-line) ;could be temporary
(slate-backward-whitespace)
- (when (eql (preceding-char) ?|)
+ (when (equal (preceding-char) ?|)
(setq handled t))
(beginning-of-line))
(unless handled
@@ -883,7 +885,7 @@
(slate-forward-whitespace)
(skip-chars-forward slate-name-chars))) ;skip over operand
(slate-forward-whitespace)
- (if (eql (following-char) ?|) ;scan for temporaries
+ (if (equal (following-char) ?|) ;scan for temporaries
(progn
(forward-char) ;skip over |
(slate-forward-whitespace)
@@ -891,7 +893,7 @@
(looking-at "[A-z]"))
(skip-chars-forward slate-name-chars)
(slate-forward-whitespace))
- (when (and (eql (following-char) ?|) ;if a matching | as a temp
+ (when (and (equal (following-char) ?|) ;if a matching | as a temp
(< (point) end)) ;and we're after the temps
(narrow-to-region (1+ (point)) end) ;we limit the buffer
))
@@ -906,7 +908,7 @@
(if (not (looking-at "[A-z_]"))
(setq done t)
(skip-chars-forward slate-name-chars)
- (if (eql (following-char) ?:)
+ (if (equal (following-char) ?:)
(progn
(forward-char)
(slate-forward-sexp 1)
@@ -927,7 +929,7 @@
(cond ((bolp)
(setq done t)
(setq is-white t))
- ((eql (char-after (1- (point))) ?\")
+ ((equal (char-after (1- (point))) ?\")
(backward-sexp)
(when (< (point) line-start-pos) ;comment is multi line
(setq done t)))
@@ -948,7 +950,7 @@
"Moves to the beginning of the containing comment, or
the end of the previous one if not in a comment."
(search-backward "\"") ;find its start
- (while (eql (preceding-char) ?\\) ;skip over escaped ones
+ (while (equal (preceding-char) ?\\) ;skip over escaped ones
(backward-char 1)
(search-backward "\"")))
@@ -964,7 +966,7 @@
(if (looking-at slate-name-regexp)
(progn ;maybe unary, maybe keyword
(skip-chars-forward slate-name-chars)
- (if (eql (following-char) ?:) ;keyword?
+ (if (equal (following-char) ?:) ;keyword?
(progn
(forward-char 1)
(setq selector (buffer-substring start (point)))
@@ -974,7 +976,7 @@
(setq ch (following-char))
(cond ((memq ch '(?@ ?\] ?\) ?.)) ;stop at end of expr
(setq done t))
- ((eql ch ?:) ;add the next keyword
+ ((equal ch ?:) ;add the next keyword
(forward-char 1)
(setq selector
(concat selector
@@ -999,7 +1001,7 @@
(if (looking-at slate-name-regexp)
(progn ;maybe unary, maybe keyword
(skip-chars-forward slate-name-chars)
- (if (eql (following-char) ?:) ;keyword?
+ (if (equal (following-char) ?:) ;keyword?
(progn
(forward-char 1)
(setq selector (buffer-substring start (point)))
@@ -1009,7 +1011,7 @@
(setq ch (following-char))
(cond ((memq ch '(?@ ?\] ?\) ?.))
(setq done t))
- ((eql ch ?:)
+ ((equal ch ?:)
(forward-char 1)
(setq selector
(concat selector
More information about the Slate
mailing list