summaryrefslogtreecommitdiff
path: root/lisp/textmodes/ispell.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2015-12-07 15:12:15 +0000
committerAlan Mackenzie <acm@muc.de>2015-12-07 15:12:15 +0000
commit3194f1ccd99cfd13ddaf621d6e7f1e1aa1645165 (patch)
tree3963195a29eea661a697516ad424567a05cfdfeb /lisp/textmodes/ispell.el
parentf5c403d269f4f5079dc47853f16a51e9542ea238 (diff)
downloademacs-3194f1ccd99cfd13ddaf621d6e7f1e1aa1645165.tar.gz
emacs-3194f1ccd99cfd13ddaf621d6e7f1e1aa1645165.tar.bz2
emacs-3194f1ccd99cfd13ddaf621d6e7f1e1aa1645165.zip
Further progress making Isearch, Ispell, Replace work with Follow Mode.
* lisp/follow.el: (follow-mode): Remove references to sit*-for-function, which no longer exists. Add follow-post-command-hook to three special purpose hooks at setup, and remove them at tear down. * lisp/isearch.el: (isearch-update): invoke isearch-update-post-hook before isearch-lazy-highlight-new-loop. (isearch-lazy-highlight-new-loop): Restore this function to what it previously was, merging the functionality of isearch-lazy-highlight-maybe-new-loop into it. (isearch-lazy-highlight-maybe-new-loop): function removed. * lisp/replace.el: (replace-update-post-hook): New hook variable. (perform-replace): Add second (nil) argument to looking-back. Invoke replace-update-post-hook before calling replace-highlight. * lisp/textmodes/ispell.el: (ispell-update-post-hook): New hook variable. (ispell-command-loop): invoke ispell-update-post-hook. Add GROUP argument to call of pos-visible-in-window-p. (ispell-display-buffer): Place *Choices* window at the top of the last window in a window group.
Diffstat (limited to 'lisp/textmodes/ispell.el')
-rw-r--r--lisp/textmodes/ispell.el20
1 files changed, 17 insertions, 3 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index fe27f0f158c..7d5bb6dbc59 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2248,6 +2248,11 @@ If so, ask if it needs to be saved."
(setq ispell-pdict-modified-p nil))
+(defvar ispell-update-post-hook nil
+ "A normal hook invoked from the ispell command loop.
+It is called once per iteration, before displaying a prompt to
+the user.")
+
(defun ispell-command-loop (miss guess word start end)
"Display possible corrections from list MISS.
GUESS lists possibly valid affix construction of WORD.
@@ -2315,8 +2320,10 @@ Global `ispell-quit' set to start location to continue spell session."
count (ispell-int-char (1+ count))))
(setq count (ispell-int-char (- count ?0 skipped))))
+ (run-hooks 'ispell-update-post-hook)
+
;; ensure word is visible
- (if (not (pos-visible-in-window-p end))
+ (if (not (pos-visible-in-window-p end nil nil t))
(sit-for 0))
;; Display choices for misspelled word.
@@ -2844,13 +2851,20 @@ Also position fit window to BUFFER and select it."
(prog1
(condition-case nil
(split-window
- nil (- ispell-choices-win-default-height) 'above)
+ ;; Chose the last of a window group, since
+ ;; otherwise, the lowering of another window's
+ ;; TL corner would cause the logical order of
+ ;; the windows to be changed.
+ (car (last (selected-window-group)))
+ (- ispell-choices-win-default-height) 'above)
(error nil))
(modify-frame-parameters frame '((unsplittable . t))))))
(and (not unsplittable)
(condition-case nil
(split-window
- nil (- ispell-choices-win-default-height) 'above)
+ ;; See comment above.
+ (car (last (selected-window-group)))
+ (- ispell-choices-win-default-height) 'above)
(error nil)))
(display-buffer buffer))))
(if (not window)