yatex
diff yatexlib.el @ 393:318841b09570
Workaround to avoid cursor warp.
When emacs runs with splitting minibuffer window in one frame
and having two or more frames displaying same buffer,
calling functions for minibuffer-input leads current buffer's point to
other position same as point in the same buffer in another frame.
To avoid this, wrap functions for minibuffer input with 'save-excursion.
This is minimal trial of handling this problem.
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Fri, 16 Jan 2015 08:58:20 +0900 |
parents | c44910b36b95 |
children | 5aa8208fbef0 |
line diff
1.1 --- a/yatexlib.el Thu Jan 15 23:21:24 2015 +0900 1.2 +++ b/yatexlib.el Fri Jan 16 08:58:20 2015 +0900 1.3 @@ -1,7 +1,7 @@ 1.4 ;;; yatexlib.el --- YaTeX and yahtml common libraries 1.5 ;;; 1.6 ;;; (c)1994-2013 by HIROSE Yuuji.[yuuji@yatex.org] 1.7 -;;; Last modified Thu Jan 15 11:22:54 2015 on firestorm 1.8 +;;; Last modified Fri Jan 16 08:40:45 2015 on firestorm 1.9 ;;; $Id$ 1.10 1.11 ;;; Code: 1.12 @@ -732,7 +732,8 @@ 1.13 (if (fboundp 'completing-read-with-history-in) 1.14 (completing-read-with-history-in 1.15 minibuffer-history-symbol prompt table predicate must-match initial) 1.16 - (completing-read prompt table predicate must-match initial)) 1.17 + (save-excursion ;work around to avoid cursor warp 1.18 + (completing-read prompt table predicate must-match initial))) 1.19 (if (and YaTeX-emacs-19 hsym) (set hsym minibuffer-history))))) 1.20 1.21 ;;;###autoload 1.22 @@ -740,7 +741,8 @@ 1.23 "Read from minibuffer with general history: gmhist, Emacs-19." 1.24 (cond 1.25 (YaTeX-emacs-19 1.26 - (read-from-minibuffer prompt init map read hsym)) 1.27 + (save-excursion ;work around to avoid cursor warp 1.28 + (read-from-minibuffer prompt init map read hsym))) 1.29 (t 1.30 (let ((minibuffer-history-symbol hsym)) 1.31 (read-from-minibuffer prompt init map read))))) 1.32 @@ -750,7 +752,8 @@ 1.33 "Read string with history: gmhist(Emacs-18) and Emacs-19." 1.34 (cond 1.35 (YaTeX-emacs-19 1.36 - (read-from-minibuffer prompt init minibuffer-local-map nil hsym)) 1.37 + (save-excursion ;work around to avoid cursor warp 1.38 + (read-from-minibuffer prompt init minibuffer-local-map nil hsym))) 1.39 ((featurep 'gmhist-mh) 1.40 (read-with-history-in hsym prompt init)) 1.41 (t (read-string prompt init)))) 1.42 @@ -761,14 +764,16 @@ 1.43 (if (equal (if (boundp 'last-input-event) last-input-event last-input-char) 1.44 YaTeX-skip-next-reader-char) 1.45 "" 1.46 - (apply 'read-string args))) 1.47 + (save-excursion ;work around to avoid cursor warp 1.48 + (apply 'read-string args)))) 1.49 1.50 (defun YaTeX-completing-read-or-skip (&rest args) 1.51 "Do completing-read, or skip if last input char is \C-j." 1.52 (if (equal (if (boundp 'last-input-event) last-input-event last-input-char) 1.53 YaTeX-skip-next-reader-char) 1.54 "" 1.55 - (apply 'completing-read args))) 1.56 + (save-excursion ;work around to avoid cursor warp 1.57 + (apply 'completing-read args)))) 1.58 1.59 ;;;###autoload 1.60 (fset 'YaTeX-rassoc