[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master b5ba692 076/433: Reordered Inspection and Creation for byt
From: |
Dmitry Gutov |
Subject: |
[elpa] master b5ba692 076/433: Reordered Inspection and Creation for byte compiler. |
Date: |
Thu, 15 Mar 2018 19:43:37 -0400 (EDT) |
branch: master
commit b5ba692c8f3cb5017388d9f4cf599083a7a9280c
Author: mas <mas>
Commit: mas <mas>
Reordered Inspection and Creation for byte compiler.
---
mmm-region.el | 174 +++++++++++++++++++++++++++++-----------------------------
1 file changed, 87 insertions(+), 87 deletions(-)
diff --git a/mmm-region.el b/mmm-region.el
index d211143..fc8fd3f 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.16 2000/06/30 03:25:02 mas Exp $
+;; Version: $Id: mmm-region.el,v 1.17 2000/06/30 20:55:44 mas Exp $
;;{{{ GPL
@@ -40,92 +40,6 @@
(require 'mmm-auto)
(require 'mmm-vars)
-;; CREATION & DELETION
-;;{{{ Markers
-
-(defun mmm-make-marker (pos beg-p sticky-p)
- "Make a marker at POS that is or isn't sticky.
-BEG-P represents whether the marker delimits the beginning of a
-region \(or the end of it). STICKY-P is whether it should be sticky,
-i.e. whether text inserted at the marker should be inside the region."
- (let ((mkr (set-marker (make-marker) pos)))
- (set-marker-insertion-type mkr (if beg-p (not sticky-p) sticky-p))
- mkr))
-
-;;}}}
-;;{{{ Make Submode Regions
-
-(defun* mmm-make-region
- (submode beg end &rest rest &key (front "") (back "")
- (beg-sticky t) (end-sticky t) face creation-hook
- &allow-other-keys
- )
- "Make a submode region from BEG to END of SUBMODE in FACE.
-FACE defaults to `mmm-default-submode-face'. FRONT and BACK are
-regexps or functions to match the correct delimiters--see
-`mmm-match-front' and `mmm-match-back'. BEG-STICKY and END-STICKY
-determine whether the front and back of the region, respectively, are
-sticky with respect to new insertion. CREATION-HOOK should be a
-function to run after the region is created. All other keyword
-arguments are stored as properties of the overlay, un-keyword-ified."
- (mmm-mode-on)
- ;; For now, complain about overlapping regions. Most callers should
- ;; trap this and continue on. In future, submode regions will be
- ;; allowed to sit inside others.
- (when (mmm-overlays-in beg end)
- (signal 'mmm-invalid-parent nil))
- (when submode
- (mmm-update-mode-info submode))
- ;; Conditionally sticky overlays are by default sticky. Then the
- ;; insert-in-front and -behind functions fix them.
- (let ((ovl (make-overlay beg end nil (not beg-sticky) end-sticky)))
- ;; This loop covers front, back, beg-sticky, end-sticky, and
- ;; anything else the caller wants to put on the overlay. It also
- ;; does face, but we re-do that later because we want to
- ;; defaultify it.
- (loop for (var val) on rest by #'cddr
- do (overlay-put ovl (intern (substring (symbol-name var) 1)) val))
- (mapcar #'(lambda (pair) (overlay-put ovl (car pair) (cadr pair)))
- `((mmm t) ; Mark our overlays
- (mmm-mode ,submode)
- (mmm-local-variables
- ;; Have to be careful to make new list structure here
- ,(list* (list 'font-lock-cache-state nil)
- (list 'font-lock-cache-position (make-marker))
- (copy-tree (cdr (assq submode
mmm-region-saved-locals-defaults)))))
- ;; These have special meaning to Emacs
- (,mmm-evaporate-property t)
- (face ,(or face (if submode 'mmm-default-submode-face)))
- ))
- (save-excursion
- (goto-char (overlay-start ovl))
- (mmm-set-current-submode submode)
- (mmm-set-local-variables submode)
- (mmm-run-submode-hook submode)
- (when creation-hook
- (funcall creation-hook))
- (mmm-save-changed-local-variables ovl submode))
- (setq mmm-previous-submode submode
- mmm-previous-overlay ovl)
- (mmm-update-submode-region)
- ovl))
-
-;;}}}
-;;{{{ Clear Overlays
-
-;; See also `mmm-clear-current-region'.
-
-(defun mmm-clear-overlays (&optional start stop strict)
- "Clears all MMM overlays between START and STOP.
-If STRICT, only clear those strictly included, rather than partially."
- (mapcar #'delete-overlay
- (mmm-overlays-in (or start (point-min))
- (or stop (point-max))
- strict))
- (mmm-update-current-submode))
-
-;;}}}
-
;; INSPECTION
;;{{{ Current Overlays
@@ -296,6 +210,92 @@ If OVL is not back-bounded correctly, return its end
position."
;;}}}
+;; CREATION & DELETION
+;;{{{ Markers
+
+(defun mmm-make-marker (pos beg-p sticky-p)
+ "Make a marker at POS that is or isn't sticky.
+BEG-P represents whether the marker delimits the beginning of a
+region \(or the end of it). STICKY-P is whether it should be sticky,
+i.e. whether text inserted at the marker should be inside the region."
+ (let ((mkr (set-marker (make-marker) pos)))
+ (set-marker-insertion-type mkr (if beg-p (not sticky-p) sticky-p))
+ mkr))
+
+;;}}}
+;;{{{ Make Submode Regions
+
+(defun* mmm-make-region
+ (submode beg end &rest rest &key (front "") (back "")
+ (beg-sticky t) (end-sticky t) face creation-hook
+ &allow-other-keys
+ )
+ "Make a submode region from BEG to END of SUBMODE in FACE.
+FACE defaults to `mmm-default-submode-face'. FRONT and BACK are
+regexps or functions to match the correct delimiters--see
+`mmm-match-front' and `mmm-match-back'. BEG-STICKY and END-STICKY
+determine whether the front and back of the region, respectively, are
+sticky with respect to new insertion. CREATION-HOOK should be a
+function to run after the region is created. All other keyword
+arguments are stored as properties of the overlay, un-keyword-ified."
+ (mmm-mode-on)
+ ;; For now, complain about overlapping regions. Most callers should
+ ;; trap this and continue on. In future, submode regions will be
+ ;; allowed to sit inside others.
+ (when (mmm-overlays-in beg end)
+ (signal 'mmm-invalid-parent nil))
+ (when submode
+ (mmm-update-mode-info submode))
+ ;; Conditionally sticky overlays are by default sticky. Then the
+ ;; insert-in-front and -behind functions fix them.
+ (let ((ovl (make-overlay beg end nil (not beg-sticky) end-sticky)))
+ ;; This loop covers front, back, beg-sticky, end-sticky, and
+ ;; anything else the caller wants to put on the overlay. It also
+ ;; does face, but we re-do that later because we want to
+ ;; defaultify it.
+ (loop for (var val) on rest by #'cddr
+ do (overlay-put ovl (intern (substring (symbol-name var) 1)) val))
+ (mapcar #'(lambda (pair) (overlay-put ovl (car pair) (cadr pair)))
+ `((mmm t) ; Mark our overlays
+ (mmm-mode ,submode)
+ (mmm-local-variables
+ ;; Have to be careful to make new list structure here
+ ,(list* (list 'font-lock-cache-state nil)
+ (list 'font-lock-cache-position (make-marker))
+ (copy-tree (cdr (assq submode
mmm-region-saved-locals-defaults)))))
+ ;; These have special meaning to Emacs
+ (,mmm-evaporate-property t)
+ (face ,(or face (if submode 'mmm-default-submode-face)))
+ ))
+ (save-excursion
+ (goto-char (overlay-start ovl))
+ (mmm-set-current-submode submode)
+ (mmm-set-local-variables submode)
+ (mmm-run-submode-hook submode)
+ (when creation-hook
+ (funcall creation-hook))
+ (mmm-save-changed-local-variables ovl submode))
+ (setq mmm-previous-submode submode
+ mmm-previous-overlay ovl)
+ (mmm-update-submode-region)
+ ovl))
+
+;;}}}
+;;{{{ Clear Overlays
+
+;; See also `mmm-clear-current-region'.
+
+(defun mmm-clear-overlays (&optional start stop strict)
+ "Clears all MMM overlays between START and STOP.
+If STRICT, only clear those strictly included, rather than partially."
+ (mapcar #'delete-overlay
+ (mmm-overlays-in (or start (point-min))
+ (or stop (point-max))
+ strict))
+ (mmm-update-current-submode))
+
+;;}}}
+
;; BASIC UPDATING
;;{{{ Submode Info
- [elpa] master 174bfd8 085/433: (mmm-mode-off): Reset font-lock variables., (continued)
- [elpa] master 174bfd8 085/433: (mmm-mode-off): Reset font-lock variables., Dmitry Gutov, 2018/03/15
- [elpa] master 3858a4e 069/433: (mmm-mode-on-maybe): Conditioned font-lock updating on mmm-mode., Dmitry Gutov, 2018/03/15
- [elpa] master 24f432b 051/433: Released 0.4.0., Dmitry Gutov, 2018/03/15
- [elpa] master f3c157e 072/433: # Updated for 0.4.2., Dmitry Gutov, 2018/03/15
- [elpa] master 26aea58 055/433: (mmm-never-modes): Added `eshell-mode'., Dmitry Gutov, 2018/03/15
- [elpa] master bda9c32 056/433: (mmm-check-changed-buffers): Added check against minibuffers., Dmitry Gutov, 2018/03/15
- [elpa] master f290ed6 058/433: (mmm-check-changed-buffers): Checked for live buffer., Dmitry Gutov, 2018/03/15
- [elpa] master e41d6a5 067/433: Allowed dynamically specified submodes., Dmitry Gutov, 2018/03/15
- [elpa] master b47953f 078/433: (mmm-keywords-used): Added :classes., Dmitry Gutov, 2018/03/15
- [elpa] master 4d6f499 087/433: # Created file to aid developer(s)., Dmitry Gutov, 2018/03/15
- [elpa] master b5ba692 076/433: Reordered Inspection and Creation for byte compiler.,
Dmitry Gutov <=
- [elpa] master c0edb53 077/433: Released 0.4.2a., Dmitry Gutov, 2018/03/15
- [elpa] master 57ea76d 052/433: (mmm-overlays-in): Added DELIM parameter., Dmitry Gutov, 2018/03/15
- [elpa] master ef3eb61 070/433: # Did stuff, updated comments., Dmitry Gutov, 2018/03/15
- [elpa] master 877b10b 065/433: Added Embperl., Dmitry Gutov, 2018/03/15
- [elpa] master f1bfef8 048/433: Changed mmm-global-mode to use post-command-hook method rather than, Dmitry Gutov, 2018/03/15
- [elpa] master 6c74ab7 075/433: Moved mmm-mode variable to mmm-vars.el., Dmitry Gutov, 2018/03/15
- [elpa] master c608d3a 079/433: (mmm-insert-by-key): Made inserted regions beg- and end-sticky., Dmitry Gutov, 2018/03/15
- [elpa] master e8be7cb 081/433: # Removed (require 'font-lock)., Dmitry Gutov, 2018/03/15
- [elpa] master db933b6 084/433: (mmm-make-temp-buffer): Added as workaround for make-indirect-buffer., Dmitry Gutov, 2018/03/15
- [elpa] master 7971c49 080/433: (mmm-update-mode-info): Killed any lingering temporary buffers., Dmitry Gutov, 2018/03/15