Changeset 9 for tf-mode/trunk
- Timestamp:
- Aug 17, 2010, 11:02:59 AM (13 years ago)
- Location:
- tf-mode/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tf-mode/trunk/tf-mode.el
r2 r9 119 119 120 120 (defvar *tf-block-beg-re* 121 "[\$]\\( IF\\|FOREACH\\|JOINEACH\\|FUNCTION\\)[ ]")121 "[\$]\\(\\(IF\\|FOREACH\\|JOINEACH\\|FUNCTION\\|ERROR\\|WORNING\\)[ ]\\|\\(ERROR\\|WORNING\\)[\$]\\)") 122 122 (defvar *tf-block-mid-re* 123 123 "\$ELSE[\$]") … … 240 240 241 241 ;; 対応を探すための正規表現 242 (defvar *tf-block-keyword* "[\$]\\(IF[ \t]\\|FOREACH[ \t]\\|JOINEACH[ \t]\\|FUNCTION[ \t]\\|END[\$]\\ )")242 (defvar *tf-block-keyword* "[\$]\\(IF[ \t]\\|FOREACH[ \t]\\|JOINEACH[ \t]\\|FUNCTION[ \t]\\|END[\$]\\|ERROR[ \$]\\|WORNING[ \$]\\)") 243 243 (defvar *tf-block-tag* 'tf-block) 244 244 -
tf-mode/trunk/tf-mode.l
r2 r9 75 75 (setq *tf-mode-map* (make-sparse-keymap)) 76 76 (define-key *tf-mode-map* #\TAB 'tf-indent-line) 77 (define-key *tf-mode-map* '(#\C-c #\I) 'tf-indent-region) 77 78 ) 78 79 79 80 (defvar *tf-mode-syntax-table* nil) 80 81 (unless *tf-mode-syntax-table* 81 (setq *tf-mode-syntax-table* (make-syntax-table))) 82 ;; (set-syntax-start-comment *tf-mode-syntax-table* #\$\t t) 83 ;; (set-syntax-end-comment *tf-mode-syntax-table* #\LFD nil t)) 82 (setq *tf-mode-syntax-table* (make-syntax-table)) 83 (do ((x #x21 (1+ x)))((>= x #x7f)) 84 (let ((c (code-char x))) 85 (unless (alphanumericp c) 86 (set-syntax-punctuation *tf-mode-syntax-table* c)))) 87 (set-syntax-option *tf-mode-syntax-table* 88 *syntax-option-c-preprocessor*) 89 (set-syntax-string *tf-mode-syntax-table* #\") 90 (set-syntax-string *tf-mode-syntax-table* #\') 91 (set-syntax-escape *tf-mode-syntax-table* #\\) 92 (set-syntax-symbol *tf-mode-syntax-table* #\_) 93 (set-syntax-symbol *tf-mode-syntax-table* #\#) 94 (set-syntax-match *tf-mode-syntax-table* #\( #\)) 95 (set-syntax-match *tf-mode-syntax-table* #\{ #\}) 96 (set-syntax-match *tf-mode-syntax-table* #\[ #\])) 84 97 85 98 … … 117 130 118 131 (defvar *tf-block-beg-re* 119 "[\$]\\( IF\\|FOREACH\\|JOINEACH\\|FUNCTION\\)[ ]")132 "[\$]\\(\\(IF\\|FOREACH\\|JOINEACH\\|FUNCTION\\|ERROR\\|WORNING\\)[ ]\\|\\(ERROR\\|WORNING\\)[\$]\\)") 120 133 (defvar *tf-block-mid-re* 121 134 "\$ELSE[\$]") … … 213 226 t) 214 227 228 (defun tf-indent-region (from to) 229 (interactive "*r") 230 (if (> from to) 231 (rotatef from to)) 232 (save-excursion 233 (save-restriction 234 (narrow-to-region (point-min) to) 235 (goto-char from) 236 (goto-eol) 237 ;; (delete-trailing-spaces) 238 (while (forward-line 1) 239 (goto-eol) 240 ;; (delete-trailing-spaces) 241 (unless (bolp) 242 (funcall mode-specific-indent-command))))) 243 t) 244 215 245 ;; ------------------------------------------------------------------------- 216 246 ;; … … 246 276 247 277 ;; ÎðT·½ß̳K\» 248 (defvar *tf-block-keyword* "[\$]\\(IF[ \t]\\|FOREACH[ \t]\\|JOINEACH[ \t]\\|FUNCTION[ \t]\\|END[\$]\\ )")278 (defvar *tf-block-keyword* "[\$]\\(IF[ \t]\\|FOREACH[ \t]\\|JOINEACH[ \t]\\|FUNCTION[ \t]\\|END[\$]\\|ERROR[ \$]\\|WORNING[ \$]\\)") 249 279 (defvar *tf-block-tag* 'tf-block) 250 280
Note:
See TracChangeset
for help on using the changeset viewer.