[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e0f50ca 121/433: Wrote File Variables submode class for th
From: |
Dmitry Gutov |
Subject: |
[elpa] master e0f50ca 121/433: Wrote File Variables submode class for the new syntax. |
Date: |
Thu, 15 Mar 2018 19:43:48 -0400 (EDT) |
branch: master
commit e0f50ca555b3b98a137b73a31bef84bfc115e02d
Author: mas <mas>
Commit: mas <mas>
Wrote File Variables submode class for the new syntax.
---
mmm-sample.el | 69 ++++++++++++++++++++++++++++++++---------------------------
1 file changed, 38 insertions(+), 31 deletions(-)
diff --git a/mmm-sample.el b/mmm-sample.el
index c1b09be..337fc1f 100644
--- a/mmm-sample.el
+++ b/mmm-sample.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2000 by Michael Abraham Shulman
;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-sample.el,v 1.6 2000/07/21 00:54:35 mas Exp $
+;; Version: $Id: mmm-sample.el,v 1.7 2000/07/23 05:33:24 mas Exp $
;;{{{ GPL
@@ -94,7 +94,7 @@ otherwise `c++-mode'. Some people prefer `c++-mode'
regardless.")
(signal 'mmm-no-matching-submode nil))))
(mmm-add-classes
- `((here-doc
+ '((here-doc
:front "<<\\([a-zA-Z0-9_-]+\\).*\n"
:back "^~1$"
:save-matches 1
@@ -136,37 +136,44 @@ Usually either `perl-mode' or `cperl-mode'. The default is
)))
;;}}}
+;;{{{ File Variables
+
+;; This submode class puts file local variable values, specified with
+;; a `Local Variables:' line as in (emacs)File Variables, into Emacs
+;; Lisp Mode. It is a good candidate to put in `mmm-global-classes'.
+
+(defun mmm-file-variables-verify ()
+ (let ((bounds
+ (save-excursion
+ (save-match-data
+ (goto-char (point-max))
+ (backward-page)
+ (search-forward "Local Variables:")
+ (cons (point)
+ (progn (search-forward "End:")
+ (beginning-of-line)
+ (point)))))))
+ (and (> (match-beginning 0) (car bounds))
+ (< (match-end 0) (cdr bounds)))))
+
+(defun mmm-file-variables-find-back (bound)
+ (forward-sexp)
+ (if (> (point) bound)
+ nil
+ (looking-at "")
+ t))
+
+(mmm-add-classes
+ '((file-variables
+ :front "^[a-zA-Z-*]+: "
+ :front-verify mmm-file-variables-verify
+ :back mmm-file-variables-find-back
+ :submode emacs-lisp-mode
+ )))
-;; NOT YET UPDATED
-;;{{{ ELisp in File Variables;-COM-
-;-COM-
-;-COM-;; This example is more complicated. It uses a function rather than a
-;-COM-;; regexp to find the regions. The idea is that the sexp after an
-;-COM-;; 'eval:' file variable should be in Emacs Lisp Mode, since it's
-;-COM-;; getting executed as Emacs Lisp.
-;-COM-
-;-COM-(defun* mmm-elisp-in-file-vars (start end)
-;-COM- (save-match-data
-;-COM- (goto-char (point-max))
-;-COM- (backward-page)
-;-COM- ;; Fool the compiler so it doesn't think this is a local
-;-COM- ;; variables list.
-;-COM- (when (search-forward "Local\ Variables:" end t)
-;-COM- (goto-char (max (point) start))
-;-COM- (mmm-find-evals (min (or (save-excursion (search-forward "End:"
nil t))
-;-COM- (return-from mmm-elisp-in-file-vars))
-;-COM- end)))))
-;-COM-
-;-COM-(defun mmm-find-evals (bound)
-;-COM- (if (search-forward "eval: " bound t)
-;-COM- (cons (cons (prog1 (point) (forward-sexp)) (point))
-;-COM- (mmm-find-evals bound))
-;-COM- nil))
-;-COM-
-;-COM-(add-to-list 'mmm-classes-alist
-;-COM- '(eval-elisp (:function emacs-lisp-mode mmm-elisp-in-file-vars)))
-;-COM-
;;}}}
+
+;; NOT YET UPDATED
;;{{{ HTML in PL/SQL;-COM-
;-COM-
;-COM-;; This one is the most complex example. In PL/SQL, HTML is generally
- [elpa] master b73a727 018/433: Added to CVS (formerly not under RCS)., (continued)
- [elpa] master b73a727 018/433: Added to CVS (formerly not under RCS)., Dmitry Gutov, 2018/03/15
- [elpa] master 28e978c 118/433: (mmm-ify-by-class): Added completion on all defined classes., Dmitry Gutov, 2018/03/15
- [elpa] master 34fbbd5 120/433: # Updated docstring., Dmitry Gutov, 2018/03/15
- [elpa] master d856bc2 106/433: Wrote about global classes, highlight, mode line, and hooks., Dmitry Gutov, 2018/03/15
- [elpa] master 3cd5dcb 123/433: Changed output name from `mmm' to `mmm-mode'., Dmitry Gutov, 2018/03/15
- [elpa] master a8a9d33 122/433: Updated file-variables class to handle prefixes., Dmitry Gutov, 2018/03/15
- [elpa] master 8fd343b 119/433: # Updated folding marks., Dmitry Gutov, 2018/03/15
- [elpa] master 239284f 124/433: # Updated, Dmitry Gutov, 2018/03/15
- [elpa] master c74eeb5 125/433: # Updated email address, Dmitry Gutov, 2018/03/15
- [elpa] master ee185fa 127/433: # Removed a duplicate entry, Dmitry Gutov, 2018/03/15
- [elpa] master e0f50ca 121/433: Wrote File Variables submode class for the new syntax.,
Dmitry Gutov <=
- [elpa] master dbf0649 126/433: # Updated for SourceForge, Dmitry Gutov, 2018/03/15
- [elpa] master 644b5be 131/433: (here-doc): Updated to use new front-offset values., Dmitry Gutov, 2018/03/15
- [elpa] master 20ae2f5 139/433: # Updated docstring., Dmitry Gutov, 2018/03/15
- [elpa] master 3f20d0f 142/433: # Added CVS snapshot step., Dmitry Gutov, 2018/03/15
- [elpa] master 60d9e35 129/433: (mmm-make-region): Made sure overlays get the delimiter and sticky, Dmitry Gutov, 2018/03/15
- [elpa] master 447eb61 110/433: Wrote about changing key bindings and local variables., Dmitry Gutov, 2018/03/15
- [elpa] master d504cd7 134/433: (mmm-ify-by-class): Added completion on autoloaded classes. Excluded, Dmitry Gutov, 2018/03/15
- [elpa] master bb60f11 001/433: Initial revision, Dmitry Gutov, 2018/03/15
- [elpa] master da57a75 151/433: # Updated., Dmitry Gutov, 2018/03/15
- [elpa] master b59c78e 086/433: (mmm-update-mode-info): Used `mmm-make-temp-buffer'. Put font-lock, Dmitry Gutov, 2018/03/15