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

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

[elpa] master 37f6dea 396/433: mmm-indent-line: Use primary mode if subm


From: Dmitry Gutov
Subject: [elpa] master 37f6dea 396/433: mmm-indent-line: Use primary mode if submode ends right here
Date: Thu, 15 Mar 2018 19:44:42 -0400 (EDT)

branch: master
commit 37f6dea57c6a4c5a75612aa52ec4580dceed6ed5
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    mmm-indent-line: Use primary mode if submode ends right here
---
 mmm-region.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mmm-region.el b/mmm-region.el
index 7fecc1f..61a5ddc 100644
--- a/mmm-region.el
+++ b/mmm-region.el
@@ -856,7 +856,7 @@ calls each respective submode's 
`syntax-propertize-function'."
 ;;{{{ Indentation
 
 (defvar mmm-indent-line-function 'mmm-indent-line
-  "The function to call to indent inside a primary mode region.
+  "The function to call to indent a line.
 This will be the value of `indent-line-function' for the whole
 buffer. It's supposed to delegate to the appropriate submode's
 indentation function. See `mmm-indent-line' as the starting point.")
@@ -867,8 +867,12 @@ indentation function. See `mmm-indent-line' as the 
starting point.")
     (save-excursion
       (back-to-indentation)
       (mmm-update-submode-region)
-      (get (or mmm-current-submode mmm-primary-mode)
-           'mmm-indent-line-function))))
+      (get
+       (if (and mmm-current-overlay
+                (> (overlay-end mmm-current-overlay) (point)))
+           mmm-current-submode
+         mmm-primary-mode)
+       'mmm-indent-line-function))))
 
 ;;}}}
 (provide 'mmm-region)



reply via email to

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