[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a8a9d33 122/433: Updated file-variables class to handle pr
From: |
Dmitry Gutov |
Subject: |
[elpa] master a8a9d33 122/433: Updated file-variables class to handle prefixes. |
Date: |
Thu, 15 Mar 2018 19:43:48 -0400 (EDT) |
branch: master
commit a8a9d33f3a4a198acb0495d78cd276e23cda1e0c
Author: mas <mas>
Commit: mas <mas>
Updated file-variables class to handle prefixes.
---
mmm-sample.el | 35 ++++++++++++++++++++++++-----------
1 file changed, 24 insertions(+), 11 deletions(-)
diff --git a/mmm-sample.el b/mmm-sample.el
index 337fc1f..21a3ded 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.7 2000/07/23 05:33:24 mas Exp $
+;; Version: $Id: mmm-sample.el,v 1.8 2000/07/24 19:00:22 mas Exp $
;;{{{ GPL
@@ -143,29 +143,38 @@ Usually either `perl-mode' or `cperl-mode'. The default is
;; Lisp Mode. It is a good candidate to put in `mmm-global-classes'.
(defun mmm-file-variables-verify ()
+ ;; It would be nice to cache this somehow, which could be done in a
+ ;; buffer-local variable with markers for positions, but the trick
+ ;; is knowing when to expire the cache.
(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)))))
+ (and (re-search-forward "^\\(.*\\)Local Variables:" nil t)
+ (list (match-string 1)
+ (progn (end-of-line) (point))
+ (and (search-forward
+ (format "%sEnd:" (match-string 1))
+ nil t)
+ (progn (beginning-of-line)
+ (point)))))))))
+ (and bounds (caddr bounds)
+ (save-match-data
+ (string-match (format "^%s" (regexp-quote (car bounds)))
+ (match-string 0)))
+ (> (match-beginning 0) (cadr bounds))
+ (< (match-end 0) (caddr bounds)))))
(defun mmm-file-variables-find-back (bound)
(forward-sexp)
(if (> (point) bound)
nil
- (looking-at "")
- t))
+ (looking-at "")))
(mmm-add-classes
'((file-variables
- :front "^[a-zA-Z-*]+: "
+ :front ".+:"
:front-verify mmm-file-variables-verify
:back mmm-file-variables-find-back
:submode emacs-lisp-mode
@@ -218,4 +227,8 @@ Usually either `perl-mode' or `cperl-mode'. The default is
(provide 'mmm-sample)
+
+;;; Local Variables:
+;;; End:
+
;;; mmm-sample.el ends here
\ No newline at end of file
- [elpa] master 88d1d46 115/433: (mmm-univ-get-mode): Signaled error on non-fboundp modes., (continued)
- [elpa] master 88d1d46 115/433: (mmm-univ-get-mode): Signaled error on non-fboundp modes., Dmitry Gutov, 2018/03/15
- [elpa] master 752288f 113/433: Added `mmm-no-matching-submode' error signal., Dmitry Gutov, 2018/03/15
- [elpa] master 3ee92f7 091/433: Moved commentary code to README.Mason., Dmitry Gutov, 2018/03/15
- [elpa] master efe3dbf 092/433: Wrote more about Mason., Dmitry Gutov, 2018/03/15
- [elpa] master e632aec 105/433: Limited matches to letter/dash strings that are fboundp., Dmitry Gutov, 2018/03/15
- [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 <=
- [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, 2018/03/15
- [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