[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1c8d387 201/433: Allowed language names for preference loo
From: |
Dmitry Gutov |
Subject: |
[elpa] master 1c8d387 201/433: Allowed language names for preference lookup as "mode names". |
Date: |
Thu, 15 Mar 2018 19:44:01 -0400 (EDT) |
branch: master
commit 1c8d3872c59b9ac52fb80170f7cebbfef284b2db
Author: mas <mas>
Commit: mas <mas>
Allowed language names for preference lookup as "mode names".
---
mmm-sample.el | 10 +++++-----
mmm-univ.el | 5 ++---
mmm-utils.el | 13 +++++++++----
3 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/mmm-sample.el b/mmm-sample.el
index 2737d0f..dd426d8 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.14 2001/01/13 03:55:46 mas Exp $
+;; Version: $Id: mmm-sample.el,v 1.15 2001/01/15 00:52:36 mas Exp $
;;{{{ GPL
@@ -89,13 +89,13 @@ and MODE is a major mode function symbol.")
(defun mmm-here-doc-get-mode (string)
(string-match "[a-zA-Z_-]+" string)
(setq string (match-string 0 string))
- (or (mmm-ensure-fboundp
+ (or (mmm-ensure-modename
;; First try the user override variable.
(some #'(lambda (pair)
(if (string-match (car pair) string) (cdr pair) nil))
mmm-here-doc-mode-alist))
(let ((words (split-string (downcase string) "[_-]+")))
- (or (mmm-ensure-fboundp
+ (or (mmm-ensure-modename
;; Try the whole name, stopping at "mode" if present.
(intern
(mapconcat #'identity
@@ -104,12 +104,12 @@ and MODE is a major mode function symbol.")
"-")))
;; Try each word with -mode tacked on
(some #'(lambda (word)
- (mmm-ensure-fboundp
+ (mmm-ensure-modename
(intern (concat word "-mode"))))
words)
;; Try each pair of words with -mode tacked on
(loop for (one two) on words
- if (mmm-ensure-fboundp
+ if (mmm-ensure-modename
(intern (concat one two "-mode")))
return it)
;; I'm unaware of any modes whose names, minus `-mode',
diff --git a/mmm-univ.el b/mmm-univ.el
index 3ddb91b..5108a9f 100644
--- a/mmm-univ.el
+++ b/mmm-univ.el
@@ -40,9 +40,8 @@
(let ((modestr (intern (if (string-match "mode\\'" string)
string
(concat string "-mode")))))
- (if (fboundp modestr)
- modestr
- (signal 'mmm-no-matching-submode nil))))
+ (or (mmm-ensure-modename modestr)
+ (signal 'mmm-no-matching-submode nil))))
(mmm-add-classes
`((universal
diff --git a/mmm-utils.el b/mmm-utils.el
index c33bf98..98be6a5 100644
--- a/mmm-utils.el
+++ b/mmm-utils.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2000 by Michael Abraham Shulman
;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-utils.el,v 1.8 2001/01/14 01:26:09 mas Exp $
+;; Version: $Id: mmm-utils.el,v 1.9 2001/01/15 00:52:36 mas Exp $
;;{{{ GPL
@@ -139,9 +139,14 @@ string."
;;}}}
;;{{{ Ensure fboundp
-(defun mmm-ensure-fboundp (symbol)
- "Return SYMBOL if it is `fboundp', else nil."
- (if (fboundp symbol) symbol nil))
+(defun mmm-ensure-modename (symbol)
+ "Return SYMBOL if it is a valid submode name, else nil.
+Valid submode names are either `fboundp' or present as the `car' of an
+element in `mmm-major-mode-preferences'."
+ (if (or (fboundp symbol)
+ (assq symbol mmm-major-mode-preferences))
+ symbol
+ nil))
;;}}}
- [elpa] master a58c9bc 178/433: Added comment about adding files to the distribution., (continued)
- [elpa] master a58c9bc 178/433: Added comment about adding files to the distribution., Dmitry Gutov, 2018/03/15
- [elpa] master e31cf25 170/433: (mmm-update-mode-info): Tested against `mmm-set-file-name-for-modes'., Dmitry Gutov, 2018/03/15
- [elpa] master 2defd28 188/433: (mmm-save-local-variables): Added `parse-sexp-ignore-comments', which, Dmitry Gutov, 2018/03/15
- [elpa] master e4084f8 186/433: Added set-background example for XEmacs., Dmitry Gutov, 2018/03/15
- [elpa] master cbbb3cc 162/433: Added comments on RPM Spec, File Variables, and Here-documents., Dmitry Gutov, 2018/03/15
- [elpa] master 7374d58 193/433: Added ePerl submode class., Dmitry Gutov, 2018/03/15
- [elpa] master 2802d0b 182/433: # Updated., Dmitry Gutov, 2018/03/15
- [elpa] master 2d7d17f 195/433: (mmm-major-mode-preferences): Added check for `jde-mode' for Java code., Dmitry Gutov, 2018/03/15
- [elpa] master 33baef7 179/433: Added file, Dmitry Gutov, 2018/03/15
- [elpa] master ad6a934 199/433: # Updated docstring, Dmitry Gutov, 2018/03/15
- [elpa] master 1c8d387 201/433: Allowed language names for preference lookup as "mode names".,
Dmitry Gutov <=
- [elpa] master f0e34d0 185/433: (mmm-apply-class): Rearranged parameters so faces actually work., Dmitry Gutov, 2018/03/15
- [elpa] master 86803d6 200/433: (mmm-set-major-mode-preferences): Added function., Dmitry Gutov, 2018/03/15
- [elpa] master 4bdcb2f 224/433: Fixed inline JavaScript regexp ( \w ==> \\w )., Dmitry Gutov, 2018/03/15
- [elpa] master 62b7c8c 233/433: # Updated for recent changes in configuration., Dmitry Gutov, 2018/03/15
- [elpa] master 068f332 226/433: # Fixed a couple comments, Dmitry Gutov, 2018/03/15
- [elpa] master d94c8be 240/433: * FAQ: Added question about end delimiter., Dmitry Gutov, 2018/03/15
- [elpa] master 0faf52e 256/433: Updated., Dmitry Gutov, 2018/03/15
- [elpa] master d5a1a43 223/433: Empty regions no longer prevent parsing of later regions., Dmitry Gutov, 2018/03/15
- [elpa] master b2dac24 253/433: Used match-string-no-properties (Joe Kelsey), Dmitry Gutov, 2018/03/15
- [elpa] master 2524d7a 208/433: Added `require's and `defvar's to eliminate compliation warnings., Dmitry Gutov, 2018/03/15