[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e632aec 105/433: Limited matches to letter/dash strings th
From: |
Dmitry Gutov |
Subject: |
[elpa] master e632aec 105/433: Limited matches to letter/dash strings that are fboundp. |
Date: |
Thu, 15 Mar 2018 19:43:45 -0400 (EDT) |
branch: master
commit e632aecf696cfe4efc4d75a8d151d20fdbaf2723
Author: mas <mas>
Commit: mas <mas>
Limited matches to letter/dash strings that are fboundp.
---
mmm-univ.el | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/mmm-univ.el b/mmm-univ.el
index 3e9b28f..f5ddddf 100644
--- a/mmm-univ.el
+++ b/mmm-univ.el
@@ -34,22 +34,32 @@
(require 'mmm-auto)
+(defun mmm-univ-get-mode (string)
+ (string-match "[a-zA-Z-]+" string)
+ (let ((modestr (match-string 0 string)))
+ (and modestr
+ (intern (if (equal (substring modestr -5) "-mode")
+ modestr
+ (concat modestr "-mode"))))))
+
(mmm-add-classes
`((universal
- :front "{%\\([^]]+\\)%}"
+ :front "{%\\([a-zA-Z-]+\\)%}"
:back "{%/~1%}"
:insert ((?/ universal "Submode: " @ "{%" str "%}" @ "\n" _ "\n"
@ "{%/" str "%}" @))
- :match-submode ,#'(lambda (str)
- (string-match "[a-zA-Z-]+" str)
- (let ((modestr (match-string 0 str)))
- (unless modestr (error "Something is screwy."))
- (if (equal (substring modestr -5) "-mode")
- (intern modestr)
- (intern (concat modestr "-mode")))))
+ :front-verify ,#'(lambda ()
+ (fboundp
+ (mmm-univ-get-mode (match-string 0))))
+ :match-submode mmm-univ-get-mode
:save-matches 1
)))
(provide 'mmm-univ)
+
+;;; Local Variables:
+;;; mmm-global-classes: nil
+;;; End:
+
;;; mmm-univ.el ends here
\ No newline at end of file
- [elpa] master c76f5a3 099/433: Added to CVS., (continued)
- [elpa] master c76f5a3 099/433: Added to CVS., Dmitry Gutov, 2018/03/15
- [elpa] master 89daaab 103/433: # Added comment about universal mode., Dmitry Gutov, 2018/03/15
- [elpa] master a0e97ea 108/433: (mmm-save-local-variables): Changed `defcustom' to `defvar'., Dmitry Gutov, 2018/03/15
- [elpa] master 70a94da 109/433: (mmm-run-major-mode-hook): Added `ignore-errors' around each call., Dmitry Gutov, 2018/03/15
- [elpa] master 7a12efa 111/433: Added MASON_VERSION variable to keep track of that., Dmitry Gutov, 2018/03/15
- [elpa] master e7da5c1 117/433: # Updated., Dmitry Gutov, 2018/03/15
- [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 <=
- [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