]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/nxml/nxml-util.el (nxml-with-unmodifying-text-property-changes):
authorLeo Liu <sdl.web@gmail.com>
Sat, 23 Mar 2013 02:21:25 +0000 (10:21 +0800)
committerLeo Liu <sdl.web@gmail.com>
Sat, 23 Mar 2013 02:21:25 +0000 (10:21 +0800)
Remove.

* lisp/nxml/rng-valid.el (rng-validate-mode)
(rng-after-change-function, rng-do-some-validation):
* lisp/nxml/rng-maint.el (rng-validate-buffer):
* lisp/nxml/nxml-rap.el (nxml-tokenize-forward, nxml-ensure-scan-up-to-date):
* lisp/nxml/nxml-outln.el (nxml-show-all, nxml-set-outline-state):
* lisp/nxml/nxml-mode.el (nxml-mode, nxml-degrade, nxml-after-change)
(nxml-extend-after-change-region): Use with-silent-modifications.

lisp/ChangeLog
lisp/nxml/nxml-mode.el
lisp/nxml/nxml-outln.el
lisp/nxml/nxml-rap.el
lisp/nxml/nxml-util.el
lisp/nxml/rng-maint.el
lisp/nxml/rng-valid.el

index f79c533465e5dd5f55b40b022926e1b5f0d69086..9bada64f76879e8efcb9a422929ec692cbc2986b 100644 (file)
@@ -1,5 +1,16 @@
 2013-03-23  Leo Liu  <sdl.web@gmail.com>
 
+       * nxml/nxml-util.el (nxml-with-unmodifying-text-property-changes):
+       Remove.
+
+       * nxml/rng-valid.el (rng-validate-mode)
+       (rng-after-change-function, rng-do-some-validation):
+       * nxml/rng-maint.el (rng-validate-buffer):
+       * nxml/nxml-rap.el (nxml-tokenize-forward, nxml-ensure-scan-up-to-date):
+       * nxml/nxml-outln.el (nxml-show-all, nxml-set-outline-state):
+       * nxml/nxml-mode.el (nxml-mode, nxml-degrade, nxml-after-change)
+       (nxml-extend-after-change-region): Use with-silent-modifications.
+
        * nxml/rng-nxml.el (rng-set-state-after): Do not let-bind
        timer-idle-list.
 
index 2ee73235dd07482c990cd3f395d06321eacbc017..44271a689cf47bda50cff4454c2ca4abba092921 100644 (file)
@@ -540,7 +540,7 @@ Many aspects this mode can be customized using
       (widen)
       (nxml-clear-dependent-regions (point-min) (point-max))
       (setq nxml-scan-end (copy-marker (point-min) nil))
-      (nxml-with-unmodifying-text-property-changes
+      (with-silent-modifications
         (nxml-clear-inside (point-min) (point-max))
        (nxml-with-invisible-motion
          (nxml-scan-prolog)))))
@@ -601,7 +601,7 @@ Many aspects this mode can be customized using
   (save-excursion
     (save-restriction
       (widen)
-      (nxml-with-unmodifying-text-property-changes
+      (with-silent-modifications
        (nxml-clear-inside (point-min) (point-max))))))
 
 ;;; Change management
@@ -625,7 +625,7 @@ Many aspects this mode can be customized using
             (widen)
             (save-match-data
               (nxml-with-invisible-motion
-                (nxml-with-unmodifying-text-property-changes
+                (with-silent-modifications
                   (nxml-after-change1
                    start end pre-change-length)))))))))
 
@@ -910,7 +910,7 @@ Called with `font-lock-beg' and `font-lock-end' dynamically bound."
                       (widen)
                       (save-match-data
                         (nxml-with-invisible-motion
-                          (nxml-with-unmodifying-text-property-changes
+                          (with-silent-modifications
                             (nxml-extend-after-change-region1
                              start end pre-change-length)))))))))
       (if (consp region) region))))
index e30aee3de536f7e683e344afca3390bc508def2b..dab22f7559f85bb59883cac6f6ef73f08768d590 100644 (file)
@@ -149,7 +149,7 @@ See the variable `nxml-section-element-name-regexp' for more details."
 (defun nxml-show-all ()
   "Show all elements in the buffer normally."
   (interactive)
-  (nxml-with-unmodifying-text-property-changes
+  (with-silent-modifications
     (remove-text-properties (point-min)
                            (point-max)
                            '(nxml-outline-state nil)))
@@ -370,7 +370,7 @@ customize which elements are recognized as sections and headings."
   (get-text-property pos 'nxml-outline-state))
 
 (defun nxml-set-outline-state (pos state)
-  (nxml-with-unmodifying-text-property-changes
+  (with-silent-modifications
     (if state
        (put-text-property pos (1+ pos) 'nxml-outline-state state)
       (remove-text-properties pos (1+ pos) '(nxml-outline-state nil)))))
index bc87044cde6748d7d18e4d3b27ce2caa31c26c53..5bc4d74456bb4ac89355f36f1c3c51f0616a738a 100644 (file)
@@ -293,7 +293,7 @@ Sets variables like `nxml-token-after'."
       (cond ((memq xmltok-type '(comment
                                 cdata-section
                                 processing-instruction))
-            (nxml-with-unmodifying-text-property-changes
+            (with-silent-modifications
               (nxml-set-inside (1+ xmltok-start) (point) xmltok-type)))
            (xmltok-dependent-regions
             (nxml-mark-parse-dependent-regions)))
@@ -338,7 +338,7 @@ Leave point unmoved if it is not inside anything special."
                               '(comment
                                 processing-instruction
                                 cdata-section))
-                    (nxml-with-unmodifying-text-property-changes
+                    (with-silent-modifications
                       (nxml-set-inside (1+ xmltok-start)
                                        (point)
                                        xmltok-type)))
index b2d9cdde18342e4cdb4f34ba735728d4b6c637a1..6ba6d21f7ed0d5f96e58e4d6fc646492c96671be 100644 (file)
@@ -78,27 +78,6 @@ This is the inverse of `nxml-make-namespace'."
             (nxml-degrade ,context ,error-symbol))))
     `(progn ,@body)))
 
-(defmacro nxml-with-unmodifying-text-property-changes (&rest body)
-  "Evaluate BODY without any text property changes modifying the buffer.
-Any text properties changes happen as usual but the changes are not treated as
-modifications to the buffer."
-  (let ((modified (make-symbol "modified")))
-    `(let ((,modified (buffer-modified-p))
-          (inhibit-read-only t)
-          (inhibit-modification-hooks t)
-          (buffer-undo-list t)
-          (deactivate-mark nil)
-          ;; Apparently these avoid file locking problems.
-          (buffer-file-name nil)
-          (buffer-file-truename nil))
-       (unwind-protect
-          (progn ,@body)
-        (unless ,modified
-          (restore-buffer-modified-p nil))))))
-
-(put 'nxml-with-unmodifying-text-property-changes 'lisp-indent-function 0)
-(def-edebug-spec nxml-with-unmodifying-text-property-changes t)
-
 (defmacro nxml-with-invisible-motion (&rest body)
   "Evaluate body without calling any point motion hooks."
   `(let ((inhibit-point-motion-hooks t))
index 74192f213dca21a44e1a06bb174393a8c7dc142c..ff73e3718ec28f042b9e8f40ffcb26a1367b802a 100644 (file)
 (defun rng-validate-buffer ()
   (save-restriction
     (widen)
-    (nxml-with-unmodifying-text-property-changes
+    (with-silent-modifications
       (rng-clear-cached-state (point-min) (point-max)))
     ;; 1+ to clear empty overlays at (point-max)
     (rng-clear-overlays (point-min) (1+ (point-max))))
index 9ba2e9877184ccd06e52f2bbec808c1dc7159f6c..de18c58142152d99cb21858a6889bada1916d886 100644 (file)
@@ -244,7 +244,7 @@ to use for finding the schema."
          (> (prefix-numeric-value arg) 0)))
   (save-restriction
     (widen)
-    (nxml-with-unmodifying-text-property-changes
+    (with-silent-modifications
       (rng-clear-cached-state (point-min) (point-max)))
     ;; 1+ to clear empty overlays at (point-max)
     (rng-clear-overlays (point-min) (1+ (point-max)))
@@ -305,7 +305,7 @@ The schema is set like `rng-auto-set-schema'."
 
 (defun rng-after-change-function (start end pre-change-len)
   (setq rng-message-overlay-inhibit-point nil)
-  (nxml-with-unmodifying-text-property-changes
+  (with-silent-modifications
     (rng-clear-cached-state start end))
   ;; rng-validate-up-to-date-end holds the position before the change
   ;; Adjust it to reflect the change.
@@ -469,7 +469,7 @@ The schema is set like `rng-auto-set-schema'."
        (condition-case-unless-debug err
            (and (rng-validate-prepare)
                 (let ((rng-dt-namespace-context-getter '(nxml-ns-get-context)))
-                  (nxml-with-unmodifying-text-property-changes
+                  (with-silent-modifications
                     (rng-do-some-validation-1 continue-p-function))))
          ;; errors signaled from a function run by an idle timer
          ;; are ignored; if we don't catch them, validation