[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master bd17fe1: Fix point placement after ispell-complete-word
From: |
Lars Ingebrigtsen |
Subject: |
master bd17fe1: Fix point placement after ispell-complete-word |
Date: |
Mon, 30 Aug 2021 22:31:08 -0400 (EDT) |
branch: master
commit bd17fe1d9e82ababab84b11cd689dcb0315742dd
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Fix point placement after ispell-complete-word
* lisp/textmodes/ispell.el (ispell-complete-word): Leave point at
the end of the inserted word instead of a less than useful amount
of distance from the start of the word (bug#37552).
---
lisp/textmodes/ispell.el | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 632b001..c2f6b35 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3636,8 +3636,7 @@ sequence inside of a word.
Standard ispell choices are then available."
;; FIXME: completion-at-point-function.
(interactive "P")
- (let ((cursor-location (point))
- (case-fold-search-val case-fold-search)
+ (let ((case-fold-search-val case-fold-search)
(word (ispell-get-word nil "\\*")) ; force "previous-word" processing.
start end possibilities replacement)
(setq start (car (cdr word))
@@ -3674,18 +3673,12 @@ Standard ispell choices are then available."
(ispell-add-per-file-word-list word))
(replacement ; REPLACEMENT WORD
(delete-region start end)
- (setq word (if (atom replacement) replacement (car replacement))
- cursor-location (+ (- (length word) (- end start))
- cursor-location))
- (insert word)
- (if (not (atom replacement)) ; recheck spelling of replacement.
- (progn
- (goto-char cursor-location)
- (ispell-word nil t)))))
+ (insert (if (atom replacement) replacement (car replacement)))
+ (unless (atom replacement) ; recheck spelling of replacement.
+ (ispell-word nil t))))
(if (get-buffer ispell-choices-buffer)
(kill-buffer ispell-choices-buffer))))
- (ispell-pdict-save ispell-silently-savep)
- (goto-char cursor-location)))
+ (ispell-pdict-save ispell-silently-savep)))
;;;###autoload
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master bd17fe1: Fix point placement after ispell-complete-word,
Lars Ingebrigtsen <=