diff options
| author | Stefan Monnier | 2019-04-09 15:11:38 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-04-09 15:11:38 -0400 |
| commit | 8a5ecdaa2faa550b4f3553beeda91c3c99c9bc05 (patch) | |
| tree | 60dfb6602a62af49b96feac8c5f82fffa87efd66 | |
| parent | 4b39b741f1949ebad1dfccc5032dfce521bedc2a (diff) | |
| download | emacs-8a5ecdaa2faa550b4f3553beeda91c3c99c9bc05.tar.gz emacs-8a5ecdaa2faa550b4f3553beeda91c3c99c9bc05.zip | |
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.
| -rw-r--r-- | lisp/international/quail.el | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lisp/international/quail.el b/lisp/international/quail.el index bd05fcec698..3266b93b446 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el | |||
| @@ -568,7 +568,7 @@ While this input method is active, the variable | |||
| 568 | (quail-delete-overlays) | 568 | (quail-delete-overlays) |
| 569 | (setq describe-current-input-method-function nil) | 569 | (setq describe-current-input-method-function nil) |
| 570 | (quail-hide-guidance) | 570 | (quail-hide-guidance) |
| 571 | (remove-hook 'post-command-hook 'quail-show-guidance t) | 571 | (remove-hook 'post-command-hook #'quail-show-guidance t) |
| 572 | (run-hooks 'quail-deactivate-hook)) | 572 | (run-hooks 'quail-deactivate-hook)) |
| 573 | (kill-local-variable 'input-method-function)) | 573 | (kill-local-variable 'input-method-function)) |
| 574 | ;; Let's activate Quail input method. | 574 | ;; Let's activate Quail input method. |
| @@ -579,19 +579,18 @@ While this input method is active, the variable | |||
| 579 | (setq name (car (car quail-package-alist))) | 579 | (setq name (car (car quail-package-alist))) |
| 580 | (error "No Quail package loaded")) | 580 | (error "No Quail package loaded")) |
| 581 | (quail-select-package name))) | 581 | (quail-select-package name))) |
| 582 | (setq deactivate-current-input-method-function 'quail-deactivate) | 582 | (setq deactivate-current-input-method-function #'quail-deactivate) |
| 583 | (setq describe-current-input-method-function 'quail-help) | 583 | (setq describe-current-input-method-function #'quail-help) |
| 584 | (quail-delete-overlays) | 584 | (quail-delete-overlays) |
| 585 | (setq quail-guidance-str "") | 585 | (setq quail-guidance-str "") |
| 586 | (quail-show-guidance) | 586 | (quail-show-guidance) |
| 587 | ;; If we are in minibuffer, turn off the current input method | 587 | ;; If we are in minibuffer, turn off the current input method |
| 588 | ;; before exiting. | 588 | ;; before exiting. |
| 589 | (when (eq (selected-window) (minibuffer-window)) | 589 | (when (eq (selected-window) (minibuffer-window)) |
| 590 | (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer) | 590 | (add-hook 'minibuffer-exit-hook #'quail-exit-from-minibuffer) |
| 591 | (add-hook 'post-command-hook 'quail-show-guidance nil t)) | 591 | (add-hook 'post-command-hook #'quail-show-guidance nil t)) |
| 592 | (run-hooks 'quail-activate-hook) | 592 | (run-hooks 'quail-activate-hook) |
| 593 | (make-local-variable 'input-method-function) | 593 | (setq-local input-method-function #'quail-input-method))) |
| 594 | (setq input-method-function 'quail-input-method))) | ||
| 595 | 594 | ||
| 596 | (define-obsolete-variable-alias | 595 | (define-obsolete-variable-alias |
| 597 | 'quail-inactivate-hook | 596 | 'quail-inactivate-hook |
| @@ -1367,9 +1366,7 @@ If STR has `advice' text property, append the following special event: | |||
| 1367 | (let ((start (overlay-start overlay)) | 1366 | (let ((start (overlay-start overlay)) |
| 1368 | (end (overlay-end overlay))) | 1367 | (end (overlay-end overlay))) |
| 1369 | (if (< start end) | 1368 | (if (< start end) |
| 1370 | (prog1 | 1369 | (string-to-list (delete-and-extract-region start end))))) |
| 1371 | (string-to-list (buffer-substring start end)) | ||
| 1372 | (delete-region start end))))) | ||
| 1373 | 1370 | ||
| 1374 | (defsubst quail-delete-region () | 1371 | (defsubst quail-delete-region () |
| 1375 | "Delete the text in the current translation region of Quail." | 1372 | "Delete the text in the current translation region of Quail." |