emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 8a5ecda: quail.el: Use delete-and-extract-region


From: Stefan Monnier
Subject: [Emacs-diffs] master 8a5ecda: quail.el: Use delete-and-extract-region
Date: Tue, 9 Apr 2019 15:11:42 -0400 (EDT)

branch: master
commit 8a5ecdaa2faa550b4f3553beeda91c3c99c9bc05
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    quail.el: Use delete-and-extract-region
    
    * lisp/international/quail.el (quail-overlay-region-events):
    Use delete-and-extract-region.
    (quail-activate): Use setq-local.
---
 lisp/international/quail.el | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/lisp/international/quail.el b/lisp/international/quail.el
index bd05fce..3266b93 100644
--- a/lisp/international/quail.el
+++ b/lisp/international/quail.el
@@ -568,7 +568,7 @@ While this input method is active, the variable
            (quail-delete-overlays)
            (setq describe-current-input-method-function nil)
            (quail-hide-guidance)
-           (remove-hook 'post-command-hook 'quail-show-guidance t)
+           (remove-hook 'post-command-hook #'quail-show-guidance t)
            (run-hooks 'quail-deactivate-hook))
        (kill-local-variable 'input-method-function))
     ;; Let's activate Quail input method.
@@ -579,19 +579,18 @@ While this input method is active, the variable
              (setq name (car (car quail-package-alist)))
            (error "No Quail package loaded"))
          (quail-select-package name)))
-    (setq deactivate-current-input-method-function 'quail-deactivate)
-    (setq describe-current-input-method-function 'quail-help)
+    (setq deactivate-current-input-method-function #'quail-deactivate)
+    (setq describe-current-input-method-function #'quail-help)
     (quail-delete-overlays)
     (setq quail-guidance-str "")
     (quail-show-guidance)
     ;; If we are in minibuffer, turn off the current input method
     ;; before exiting.
     (when (eq (selected-window) (minibuffer-window))
-      (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer)
-      (add-hook 'post-command-hook 'quail-show-guidance nil t))
+      (add-hook 'minibuffer-exit-hook #'quail-exit-from-minibuffer)
+      (add-hook 'post-command-hook #'quail-show-guidance nil t))
     (run-hooks 'quail-activate-hook)
-    (make-local-variable 'input-method-function)
-    (setq input-method-function 'quail-input-method)))
+    (setq-local input-method-function #'quail-input-method)))
 
 (define-obsolete-variable-alias
   'quail-inactivate-hook
@@ -1367,9 +1366,7 @@ If STR has `advice' text property, append the following 
special event:
   (let ((start (overlay-start overlay))
        (end (overlay-end overlay)))
     (if (< start end)
-       (prog1
-           (string-to-list (buffer-substring start end))
-         (delete-region start end)))))
+       (string-to-list (delete-and-extract-region start end)))))
 
 (defsubst quail-delete-region ()
   "Delete the text in the current translation region of Quail."



reply via email to

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