1 |
;;; sml-move.el |
;;; sml-move.el --- Buffer navigation functions for sml-mode |
2 |
|
|
3 |
(defconst rcsid-sml-move "@(#)$Name$:$Id$") |
;; Copyright (C) 1999-2000 Stefan Monnier <monnier@cs.yale.edu> |
|
|
|
|
;; Copyright (C) 1999-1999 Stefan Monnier <monnier@cs.yale.edu> |
|
4 |
;; |
;; |
5 |
;; This program is free software; you can redistribute it and/or modify |
;; This program is free software; you can redistribute it and/or modify |
6 |
;; it under the terms of the GNU General Public License as published by |
;; it under the terms of the GNU General Public License as published by |
16 |
;; along with this program; if not, write to the Free Software |
;; along with this program; if not, write to the Free Software |
17 |
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
18 |
|
|
19 |
(require 'cl) |
|
20 |
|
;;; Commentary: |
21 |
|
|
22 |
|
|
23 |
|
;;; Code: |
24 |
|
|
25 |
|
(eval-when-compile (require 'cl)) |
26 |
(require 'sml-util) |
(require 'sml-util) |
27 |
(require 'sml-defs) |
(require 'sml-defs) |
28 |
|
|
|
;; |
|
|
|
|
29 |
(defsyntax sml-internal-syntax-table |
(defsyntax sml-internal-syntax-table |
30 |
'((?_ . "w") |
'((?_ . "w") |
31 |
(?' . "w") |
(?' . "w") |
95 |
"Alist of pseudo-precedence of syntactic elements.") |
"Alist of pseudo-precedence of syntactic elements.") |
96 |
|
|
97 |
(defun sml-op-prec (op dir) |
(defun sml-op-prec (op dir) |
98 |
"return the precedence of OP or nil if it's not an infix. |
"Return the precedence of OP or nil if it's not an infix. |
99 |
DIR should be set to BACK if you want to precedence w.r.t the left side |
DIR should be set to BACK if you want to precedence w.r.t the left side |
100 |
and to FORW for the precedence w.r.t the right side. |
and to FORW for the precedence w.r.t the right side. |
101 |
This assumes that we are looking-at the OP." |
This assumes that we are `looking-at' the OP." |
102 |
(when op |
(when op |
103 |
(let ((sprec (cdr (assoc op sml-syntax-prec)))) |
(let ((sprec (cdr (assoc op sml-syntax-prec)))) |
104 |
(cond |
(cond |
124 |
(looking-at re))) |
(looking-at re))) |
125 |
|
|
126 |
(defun sml-find-match-forward (this match) |
(defun sml-find-match-forward (this match) |
127 |
"Only works for word matches" |
"Only works for word matches." |
128 |
(let ((level 1) |
(let ((level 1) |
129 |
(either (concat this "\\|" match))) |
(either (concat this "\\|" match))) |
130 |
(while (> level 0) |
(while (> level 0) |
314 |
(defun sml-backward-arg () (sml-backward-sexp 1000)) |
(defun sml-backward-arg () (sml-backward-sexp 1000)) |
315 |
(defun sml-forward-arg () (sml-forward-sexp 1000)) |
(defun sml-forward-arg () (sml-forward-sexp 1000)) |
316 |
|
|
317 |
;; |
|
318 |
(provide 'sml-move) |
(provide 'sml-move) |
319 |
|
|
320 |
|
;;; sml-move.el ends here |