emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 166812a: Bind inhibit-modification-hooks rather tha


From: Stefan Monnier
Subject: [Emacs-diffs] master 166812a: Bind inhibit-modification-hooks rather than a/b-c-f
Date: Sat, 12 Sep 2015 04:30:08 +0000

branch: master
commit 166812addb0a1b9b2258ef3ce76424cd7facfa8b
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    Bind inhibit-modification-hooks rather than a/b-c-f
    
    * lisp/wid-edit.el (widget-editable-list-insert-before)
    (widget-editable-list-delete-at):
    * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres)
    (cperl-font-lock-unfontify-region-function):
    * lisp/progmodes/antlr-mode.el (save-buffer-state-x):
    * lisp/obsolete/longlines.el (longlines-mode):
    * lisp/obsolete/fast-lock.el (save-buffer-state):
    * lisp/mouse.el (mouse-save-then-kill-delete-region):
    * lisp/gnus/message.el (message-hide-headers):
    * lisp/eshell/esh-mode.el (eshell-send-input, eshell-output-filter):
    * lisp/ibuffer.el (ibuffer-update-title-and-summary)
    (ibuffer-redisplay-engine): Bind inhibit-modification-hooks to t rather
    than after/before-change-functions to nil.
---
 lisp/eshell/esh-mode.el         |    7 ++++---
 lisp/gnus/message.el            |    2 +-
 lisp/ibuffer.el                 |    4 ++--
 lisp/international/isearch-x.el |    1 +
 lisp/mouse.el                   |    4 ++--
 lisp/obsolete/fast-lock.el      |    2 +-
 lisp/obsolete/longlines.el      |    4 ++--
 lisp/progmodes/antlr-mode.el    |    2 +-
 lisp/progmodes/cperl-mode.el    |    4 ++--
 lisp/wid-edit.el                |    9 +++------
 10 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 22ccf4e..3df820d 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -627,10 +627,11 @@ newline."
   (let ((proc-running-p (and (eshell-interactive-process)
                             (not queue-p)))
        (inhibit-point-motion-hooks t)
-       after-change-functions)
+       (inhibit-modification-hooks t))
     (unless (and proc-running-p
                 (not (eq (process-status
-                          (eshell-interactive-process)) 'run)))
+                          (eshell-interactive-process))
+                          'run)))
       (if (or proc-running-p
              (>= (point) eshell-last-output-end))
          (goto-char (point-max))
@@ -697,7 +698,7 @@ This is done after all necessary filtering has been done."
   (let ((oprocbuf (if process (process-buffer process)
                    (current-buffer)))
        (inhibit-point-motion-hooks t)
-       after-change-functions)
+       (inhibit-modification-hooks t))
     (let ((functions eshell-preoutput-filter-functions))
       (while (and functions string)
        (setq string (funcall (car functions) string))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 5ede15b..13ed8c0 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -8329,7 +8329,7 @@ From headers in the original article."
                     (list message-hidden-headers)
                   message-hidden-headers))
        (inhibit-point-motion-hooks t)
-       (after-change-functions nil)
+       (inhibit-modification-hooks t)
        (end-of-headers (point-min)))
     (when regexps
       (save-excursion
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 718471b..dc34a63 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -2037,7 +2037,7 @@ the value of point at the beginning of the line for that 
buffer."
 (defun ibuffer-update-title-and-summary (format)
   (ibuffer-assert-ibuffer-mode)
   ;; Don't do funky font-lock stuff here
-  (let ((after-change-functions nil))
+  (let ((inhibit-modification-hooks t))
     (if (get-text-property (point-min) 'ibuffer-title)
        (delete-region (point-min)
                       (next-single-property-change
@@ -2244,7 +2244,7 @@ If optional arg SILENT is non-nil, do not display 
progress messages."
         (orig (count-lines (point-min) (point)))
         ;; Inhibit font-lock caching tricks, since we're modifying the
         ;; entire buffer at once
-        (after-change-functions nil)
+        (inhibit-modification-hooks t)
         (ext-loaded (featurep 'ibuf-ext))
         (bgroups (if ext-loaded
                      (ibuffer-generate-filter-groups bmarklist)
diff --git a/lisp/international/isearch-x.el b/lisp/international/isearch-x.el
index 31f841d..92e5522 100644
--- a/lisp/international/isearch-x.el
+++ b/lisp/international/isearch-x.el
@@ -71,6 +71,7 @@
 
 (defun isearch-with-keyboard-coding ()
   (interactive)
+  ;; FIXME: What does this after-change-functions binding do here?
   (let ((after-change-functions '(isearch-exit-recursive-edit)))
     (recursive-edit))
   (exit-minibuffer))
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 6584733..d6ce31a 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1111,12 +1111,12 @@ This does not delete the region; it acts like 
\\[kill-ring-save]."
     ;; Delete, but make the undo-list entry share with the kill ring.
     ;; First, delete just one char, so in case buffer is being modified
     ;; for the first time, the undo list records that fact.
-    (let (before-change-functions after-change-functions)
+    (let ((inhibit-modification-hooks t))
       (delete-region beg
                     (+ beg (if (> end beg) 1 -1))))
     (let ((buffer-undo-list buffer-undo-list))
       ;; Undo that deletion--but don't change the undo list!
-      (let (before-change-functions after-change-functions)
+      (let ((inhibit-modification-hooks t))
        (primitive-undo 1 buffer-undo-list))
       ;; Now delete the rest of the specified region,
       ;; but don't record it.
diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el
index 7e3dd66..3985d51 100644
--- a/lisp/obsolete/fast-lock.el
+++ b/lisp/obsolete/fast-lock.el
@@ -200,7 +200,7 @@
    `(let* (,@(append varlist
                      '((modified (buffer-modified-p)) (buffer-undo-list t)
                        (inhibit-read-only t) (inhibit-point-motion-hooks t)
-                       before-change-functions after-change-functions
+                       (inhibit-modification-hooks t)
                        deactivate-mark buffer-file-name buffer-file-truename)))
      ,@body
      (when (and (not modified) (buffer-modified-p))
diff --git a/lisp/obsolete/longlines.el b/lisp/obsolete/longlines.el
index 01939da..7cb13ce 100644
--- a/lisp/obsolete/longlines.el
+++ b/lisp/obsolete/longlines.el
@@ -143,7 +143,7 @@ newlines are indicated with a symbol."
                     'longlines-window-change-function nil t))
         (let ((buffer-undo-list t)
               (inhibit-read-only t)
-             (after-change-functions nil)
+             (inhibit-modification-hooks t)
               (mod (buffer-modified-p))
              buffer-file-name buffer-file-truename)
           ;; Turning off undo is OK since (spaces + newlines) is
@@ -184,7 +184,7 @@ newlines are indicated with a symbol."
     (if longlines-showing
         (longlines-unshow-hard-newlines))
     (let ((buffer-undo-list t)
-         (after-change-functions nil)
+         (inhibit-modification-hooks t)
           (inhibit-read-only t)
          buffer-file-name buffer-file-truename)
       (if longlines-decoded
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index d59948e..2d9bd48 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -171,7 +171,7 @@
             (let ((buffer-undo-list t) (inhibit-read-only t)
                   ,@(unless (featurep 'xemacs)
                       '((inhibit-point-motion-hooks t) deactivate-mark))
-                  before-change-functions after-change-functions
+                  (inhibit-modification-hooks t)
                   buffer-file-name buffer-file-truename)
               ,@body)
           (and (not ,modified) (buffer-modified-p)
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index b8ba170..5da6508 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -3672,7 +3672,7 @@ the sections using `cperl-pod-head-face', 
`cperl-pod-face',
         is-REx is-x-REx REx-subgr-start REx-subgr-end was-subgr i2 hairy-RE
         (case-fold-search nil) (inhibit-read-only t) (buffer-undo-list t)
         (modified (buffer-modified-p)) overshoot is-o-REx name
-        (after-change-functions nil)
+        (inhibit-modification-hooks t)
         (cperl-font-locking t)
         (use-syntax-state (and cperl-syntax-state
                                (>= min (car cperl-syntax-state))))
@@ -8882,7 +8882,7 @@ Delay of auto-help controlled by `cperl-lazy-help-time'."
 (defun cperl-font-lock-unfontify-region-function (beg end)
   (let* ((modified (buffer-modified-p)) (buffer-undo-list t)
         (inhibit-read-only t) (inhibit-point-motion-hooks t)
-        before-change-functions after-change-functions
+        (inhibit-modification-hooks t)
         deactivate-mark buffer-file-name buffer-file-truename)
     (remove-text-properties beg end '(face nil))
     (if (and (not modified) (buffer-modified-p))
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index b64de47..0d9157a 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -2654,8 +2654,7 @@ Return an alist of (TYPE MATCH)."
   (save-excursion
     (let ((children (widget-get widget :children))
          (inhibit-read-only t)
-         before-change-functions
-         after-change-functions)
+         (inhibit-modification-hooks t))
       (cond (before
             (goto-char (widget-get before :entry-from)))
            (t
@@ -2679,8 +2678,7 @@ Return an alist of (TYPE MATCH)."
     (let ((buttons (copy-sequence (widget-get widget :buttons)))
          button
          (inhibit-read-only t)
-         before-change-functions
-         after-change-functions)
+         (inhibit-modification-hooks t))
       (while buttons
        (setq button (car buttons)
              buttons (cdr buttons))
@@ -2691,8 +2689,7 @@ Return an alist of (TYPE MATCH)."
     (let ((entry-from (widget-get child :entry-from))
          (entry-to (widget-get child :entry-to))
          (inhibit-read-only t)
-         before-change-functions
-         after-change-functions)
+         (inhibit-modification-hooks t))
       (widget-delete child)
       (delete-region entry-from entry-to)
       (set-marker entry-from nil)



reply via email to

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