[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e3ef1f8 267/433: Collapsed undo of insertion into one comm
From: |
Dmitry Gutov |
Subject: |
[elpa] master e3ef1f8 267/433: Collapsed undo of insertion into one command. |
Date: |
Thu, 15 Mar 2018 19:44:18 -0400 (EDT) |
branch: master
commit e3ef1f83064d25e7c64a897be9fd3791bb37b342
Author: viritrilbia <viritrilbia>
Commit: viritrilbia <viritrilbia>
Collapsed undo of insertion into one command.
---
mmm-cmds.el | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/mmm-cmds.el b/mmm-cmds.el
index cbe677c..893214a 100644
--- a/mmm-cmds.el
+++ b/mmm-cmds.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2000 by Michael Abraham Shulman
;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-cmds.el,v 1.17 2003/03/09 17:04:03 viritrilbia Exp $
+;; Version: $Id: mmm-cmds.el,v 1.18 2003/03/25 21:48:33 viritrilbia Exp $
;;{{{ GPL
@@ -267,7 +267,8 @@ or a symbol such as tab, return, etc. Note that if there
are no
MODIFIERS, the dotted list becomes simply BASIC-KEY."
(multiple-value-bind (class skel str) (mmm-get-insertion-spec key)
(when skel
- (let ((after-change-functions nil))
+ (let ((after-change-functions nil)
+ (old-undo buffer-undo-list) undo)
;; XEmacs' skeleton doesn't manage positions by itself, so we
;; have to do it.
(if mmm-xemacs (setq skeleton-positions nil))
@@ -325,7 +326,15 @@ MODIFIERS, the dotted list becomes simply BASIC-KEY."
;;; :end-sticky (plist-get class :end-sticky)
:beg-sticky t :end-sticky t
:creation-hook (plist-get class :creation-hook))
- (mmm-enable-font-lock submode)))))))
+ (mmm-enable-font-lock submode)))
+ ;; Now get rid of intermediate undo boundaries, so that the entire
+ ;; insertion can be undone as one action. This should really be
+ ;; skeleton's job, but it doesn't do it.
+ (setq undo buffer-undo-list)
+ (while (not (eq (cdr undo) old-undo))
+ (when (eq (cadr undo) nil)
+ (setcdr undo (cddr undo)))
+ (setq undo (cdr undo)))))))
(defun mmm-get-insertion-spec (key &optional classlist)
"Get the insertion info for KEY from all classes in CLASSLIST.
- [elpa] master e269a47 305/433: Require 'mmm-region from 'mmm-erb, avoiding compilation warnings about free variable references, (continued)
- [elpa] master e269a47 305/433: Require 'mmm-region from 'mmm-erb, avoiding compilation warnings about free variable references, Dmitry Gutov, 2018/03/15
- [elpa] master 961a127 263/433: Prevent bounds from going outside buffer (XEmacs complains), Dmitry Gutov, 2018/03/15
- [elpa] master 66b47cd 218/433: Released 0.4.7, Dmitry Gutov, 2018/03/15
- [elpa] master 07b35d4 250/433: Added mmm-noweb to autoload (Joe Kelsey), Dmitry Gutov, 2018/03/15
- [elpa] master b554efb 287/433: After fontifying the region, restore local vars, Dmitry Gutov, 2018/03/15
- [elpa] master 0922481 254/433: Added narrow to submode region (Joe Kelsey), Dmitry Gutov, 2018/03/15
- [elpa] master b72e44c 369/433: Released 0.5.1, Dmitry Gutov, 2018/03/15
- [elpa] master bcc5adf 351/433: Define mmm-indent-line-function and its default value, Dmitry Gutov, 2018/03/15
- [elpa] master 8ab7041 297/433: Adjust indentation in primary mode for ERB blocks, Dmitry Gutov, 2018/03/15
- [elpa] master 68b2135 282/433: Fix obsolete backquotes, Dmitry Gutov, 2018/03/15
- [elpa] master e3ef1f8 267/433: Collapsed undo of insertion into one command.,
Dmitry Gutov <=
- [elpa] master 6dcd817 337/433: * mmm-syntax-propertize-function: Use font-lock-syntactic-keywords, Dmitry Gutov, 2018/03/15
- [elpa] master ea8a1b8 342/433: Rebinding syntax-propertize-chunk-size is pointless, Dmitry Gutov, 2018/03/15
- [elpa] master 970b52a 298/433: Check for EJS "blocks", Dmitry Gutov, 2018/03/15
- [elpa] master 20e65af 372/433: Primary mode spf should see the whole buffer, Dmitry Gutov, 2018/03/15
- [elpa] master 2590b31 401/433: Update the checklist, Dmitry Gutov, 2018/03/15
- [elpa] master 5f80383 364/433: Fix typo: global-mmm-mode -> mmm-global-mode, Dmitry Gutov, 2018/03/15
- [elpa] master 7422b45 341/433: * mmm-regions-in: Keep overlay references in the return value, Dmitry Gutov, 2018/03/15
- [elpa] master 6156c7a 349/433: Add URL header, Dmitry Gutov, 2018/03/15
- [elpa] master 55bba22 343/433: Merge pull request #21 from dgutov/syntax-propertize, Dmitry Gutov, 2018/03/15
- [elpa] master f6dd37f 264/433: Added instructions for installing CVS version., Dmitry Gutov, 2018/03/15