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

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

[nongnu] elpa/iedit afca4e6bbf 213/301: Rename hook functions


From: ELPA Syncer
Subject: [nongnu] elpa/iedit afca4e6bbf 213/301: Rename hook functions
Date: Mon, 10 Jan 2022 22:59:03 -0500 (EST)

branch: elpa/iedit
commit afca4e6bbfb6f41e9c214ac453298d0c98a7125b
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>

    Rename hook functions
---
 iedit-lib.el | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/iedit-lib.el b/iedit-lib.el
index 60c43115cf..a95c03f247 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
 
 ;; Copyright (C) 2010, 2011, 2012 Victor Ren
 
-;; Time-stamp: <2016-06-14 10:16:52 Victor Ren>
+;; Time-stamp: <2016-06-14 13:36:50 Victor Ren>
 ;; Author: Victor Ren <victorhge@gmail.com>
 ;; Keywords: occurrence region simultaneous rectangle refactoring
 ;; Version: 0.9.9
@@ -109,7 +109,7 @@ that is going to be changed.")
 (defvar iedit-before-modification-undo-list nil
   "This is buffer local variable which is the buffer undo list before 
modification.")
 
-;; `iedit-occurrence-update-hook' gets called twice when change==0 and
+;; `iedit-update-occurrences' gets called twice when change==0 and
 ;; occurrence is zero-width (beg==end) -- for front and back insertion.
 (defvar iedit-skip-modification-once t
   "Variable used to skip first modification hook run when
@@ -123,7 +123,7 @@ insertion against a zero-width occurrence.")
 
 (defvar iedit-post-undo-hook-installed nil
   "This is buffer local variable which indicated if
-`iedit-post-undo-hook' is installed in `post-command-hook'.")
+`iedit-post-undo' is installed in `post-command-hook'.")
 
 (defvar iedit-buffering nil
   "This is buffer local variable which indicates iedit-mode is
@@ -304,9 +304,9 @@ occurrences if the user starts typing."
     (overlay-put occurrence iedit-occurrence-overlay-name t)
     (overlay-put occurrence 'face 'iedit-occurrence)
     (overlay-put occurrence 'keymap iedit-occurrence-keymap)
-    (overlay-put occurrence 'insert-in-front-hooks 
'(iedit-occurrence-update-hook))
-    (overlay-put occurrence 'insert-behind-hooks 
'(iedit-occurrence-update-hook))
-    (overlay-put occurrence 'modification-hooks 
'(iedit-occurrence-update-hook))
+    (overlay-put occurrence 'insert-in-front-hooks '(iedit-update-occurrences))
+    (overlay-put occurrence 'insert-behind-hooks '(iedit-update-occurrences))
+    (overlay-put occurrence 'modification-hooks '(iedit-update-occurrences))
     (overlay-put occurrence 'priority iedit-overlay-priority)
     occurrence))
 
@@ -325,7 +325,7 @@ occurrences if the user starts typing."
     ;;    (overlay-put unmatched-lines-overlay 'intangible t)
     unmatched-lines-overlay))
 
-(defun iedit-post-undo-hook ()
+(defun iedit-post-undo ()
   "Check if it is time to abort iedit after undo command is executed.
 
 This is added to `post-command-hook' when undo command is executed
@@ -333,7 +333,7 @@ in occurrences."
   (if (iedit-same-length)
       nil
     (run-hooks 'iedit-aborting-hook))
-  (remove-hook 'post-command-hook 'iedit-post-undo-hook t)
+  (remove-hook 'post-command-hook 'iedit-post-undo t)
   (setq iedit-post-undo-hook-installed nil))
 
 (defun iedit-reset-aborting ()
@@ -341,7 +341,7 @@ in occurrences."
 
 This is added to `post-command-hook' when aborting Iedit mode is
 decided.  `iedit-aborting-hook' is postponed after the current
-command is executed for avoiding `iedit-occurrence-update-hook'
+command is executed for avoiding `iedit-update-occurrences'
 is called for a removed overlay."
   (run-hooks 'iedit-aborting-hook)
   (remove-hook 'post-command-hook 'iedit-reset-aborting t)
@@ -350,7 +350,7 @@ is called for a removed overlay."
 ;; There are two ways to update all occurrences.  One is to redefine all key
 ;; stroke map for overlay, the other is to figure out three basic modification
 ;; in the modification hook.  This function chooses the latter.
-(defun iedit-occurrence-update-hook (occurrence after beg end &optional change)
+(defun iedit-update-occurrences (occurrence after beg end &optional change)
   "Update all occurrences.
 This modification hook is triggered when a user edits any
 occurrence and is responsible for updating all other
@@ -362,7 +362,7 @@ occurrence, it will abort Iedit mode."
       ;; If the "undo" change make occurrences different, it is going to mess 
up
       ;; occurrences.  So a check will be done after undo command is executed.
       (when (not iedit-post-undo-hook-installed)
-        (add-hook 'post-command-hook 'iedit-post-undo-hook nil t)
+        (add-hook 'post-command-hook 'iedit-post-undo nil t)
         (setq iedit-post-undo-hook-installed t))
     (when (not iedit-aborting)
     ;; before modification
@@ -388,9 +388,9 @@ occurrence, it will abort Iedit mode."
                     (eq beg end)  ;; deletion
                     (not (string= iedit-before-modification-string
                                   (buffer-substring-no-properties beg end))))
-            (iedit-update-occurrences  occurrence after beg end change))))))))
+            (iedit-update-occurrences-2  occurrence after beg end 
change))))))))
 
-(defun iedit-update-occurrences (occurrence after beg end &optional change)
+(defun iedit-update-occurrences-2 (occurrence after beg end &optional change)
   ""
   (let ((inhibit-modification-hooks t)
         (offset (- beg (overlay-start occurrence)))



reply via email to

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