emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 4351361 191/433: Added alist to keep track of user-preferr


From: Dmitry Gutov
Subject: [elpa] master 4351361 191/433: Added alist to keep track of user-preferred major modes.
Date: Thu, 15 Mar 2018 19:44:00 -0400 (EDT)

branch: master
commit 435136199b4a661ffbaad6d3e5084d75e34026c4
Author: mas <mas>
Commit: mas <mas>

    Added alist to keep track of user-preferred major modes.
---
 mmm-region.el |  4 +++-
 mmm-vars.el   | 18 ++++++++++++++++--
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/mmm-region.el b/mmm-region.el
index 296a58c..172df20 100644
--- a/mmm-region.el
+++ b/mmm-region.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2000 by Michael Abraham Shulman
 
 ;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-region.el,v 1.28 2001/01/11 00:56:08 mas Exp $
+;; Version: $Id: mmm-region.el,v 1.29 2001/01/11 01:40:49 mas Exp $
 
 ;;{{{ GPL
 
@@ -246,6 +246,8 @@ un-keyword-ified."
   ;; allowed to sit inside others.
   (when (mmm-overlays-in beg end)
     (signal 'mmm-invalid-parent nil))
+  (unless (fboundp submode)
+    (setq submode (cdr (assq submode mmm-major-mode-preferences))))
   (when submode
     (mmm-update-mode-info submode))
   ;; Conditionally sticky overlays are by default sticky. Then the
diff --git a/mmm-vars.el b/mmm-vars.el
index 7584e0f..3af1f07 100644
--- a/mmm-vars.el
+++ b/mmm-vars.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2000 by Michael Abraham Shulman
 
 ;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-vars.el,v 1.34 2001/01/11 00:56:08 mas Exp $
+;; Version: $Id: mmm-vars.el,v 1.35 2001/01/11 01:40:50 mas Exp $
 
 ;;{{{ GPL
 
@@ -283,6 +283,20 @@ unnecessary. It probably won't go away, though."
   (add-to-list 'mmm-mode-ext-classes-alist (list mode ext class)))
 
 ;;}}}
+;;{{{ Preferred Major Modes
+
+(defcustom mmm-major-mode-preferences
+  `((perl .
+     ,(if (fboundp 'cperl-mode) 'cperl-mode 'perl-mode))
+    (javascript .
+     ,(if (fboundp 'javascript-mode) 'javascript-mode 'c++-mode))
+    (java . java-mode))
+  "User preferences about what major modes to use.
+Each element has the form \(LANGUAGE . MODE) where LANGUAGE is the
+name of a programming language such as `perl' as a symbol, and MODE is
+the major mode to use, such as `cperl-mode' or `perl-mode'.")
+
+;;}}}
 ;;{{{ Key Bindings
 
 (defcustom mmm-mode-prefix-key [(control ?c) ?%]
@@ -663,4 +677,4 @@ history, as well as `mmm-global-classes' if GLOBAL is 
non-nil."
 
 (provide 'mmm-vars)
 
-;;; mmm-vars.el ends here
\ No newline at end of file
+;;; mmm-vars.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]