yatex
changeset 393:318841b09570 dev
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 | 67fa6d791bc9 |
files | yatex.el yatexlib.el |
diffstat | 2 files changed, 12 insertions(+), 7 deletions(-) [+] |
line diff
1.1 --- a/yatex.el Thu Jan 15 23:21:24 2015 +0900 1.2 +++ b/yatex.el Fri Jan 16 08:58:20 2015 +0900 1.3 @@ -1,6 +1,6 @@ 1.4 ;;; yatex.el --- Yet Another tex-mode for emacs //–ì’¹// -*- coding: sjis -*- 1.5 ;;; (c)1991-2015 by HIROSE Yuuji.[yuuji@yatex.org] 1.6 -;;; Last modified Thu Jan 15 23:15:51 2015 on firestorm 1.7 +;;; Last modified Fri Jan 16 08:38:34 2015 on firestorm 1.8 ;;; $Id$ 1.9 ;;; The latest version of this software is always available at; 1.10 ;;; http://www.yatex.org/
2.1 --- a/yatexlib.el Thu Jan 15 23:21:24 2015 +0900 2.2 +++ b/yatexlib.el Fri Jan 16 08:58:20 2015 +0900 2.3 @@ -1,7 +1,7 @@ 2.4 ;;; yatexlib.el --- YaTeX and yahtml common libraries 2.5 ;;; 2.6 ;;; (c)1994-2013 by HIROSE Yuuji.[yuuji@yatex.org] 2.7 -;;; Last modified Thu Jan 15 11:22:54 2015 on firestorm 2.8 +;;; Last modified Fri Jan 16 08:40:45 2015 on firestorm 2.9 ;;; $Id$ 2.10 2.11 ;;; Code: 2.12 @@ -732,7 +732,8 @@ 2.13 (if (fboundp 'completing-read-with-history-in) 2.14 (completing-read-with-history-in 2.15 minibuffer-history-symbol prompt table predicate must-match initial) 2.16 - (completing-read prompt table predicate must-match initial)) 2.17 + (save-excursion ;work around to avoid cursor warp 2.18 + (completing-read prompt table predicate must-match initial))) 2.19 (if (and YaTeX-emacs-19 hsym) (set hsym minibuffer-history))))) 2.20 2.21 ;;;###autoload 2.22 @@ -740,7 +741,8 @@ 2.23 "Read from minibuffer with general history: gmhist, Emacs-19." 2.24 (cond 2.25 (YaTeX-emacs-19 2.26 - (read-from-minibuffer prompt init map read hsym)) 2.27 + (save-excursion ;work around to avoid cursor warp 2.28 + (read-from-minibuffer prompt init map read hsym))) 2.29 (t 2.30 (let ((minibuffer-history-symbol hsym)) 2.31 (read-from-minibuffer prompt init map read))))) 2.32 @@ -750,7 +752,8 @@ 2.33 "Read string with history: gmhist(Emacs-18) and Emacs-19." 2.34 (cond 2.35 (YaTeX-emacs-19 2.36 - (read-from-minibuffer prompt init minibuffer-local-map nil hsym)) 2.37 + (save-excursion ;work around to avoid cursor warp 2.38 + (read-from-minibuffer prompt init minibuffer-local-map nil hsym))) 2.39 ((featurep 'gmhist-mh) 2.40 (read-with-history-in hsym prompt init)) 2.41 (t (read-string prompt init)))) 2.42 @@ -761,14 +764,16 @@ 2.43 (if (equal (if (boundp 'last-input-event) last-input-event last-input-char) 2.44 YaTeX-skip-next-reader-char) 2.45 "" 2.46 - (apply 'read-string args))) 2.47 + (save-excursion ;work around to avoid cursor warp 2.48 + (apply 'read-string args)))) 2.49 2.50 (defun YaTeX-completing-read-or-skip (&rest args) 2.51 "Do completing-read, or skip if last input char is \C-j." 2.52 (if (equal (if (boundp 'last-input-event) last-input-event last-input-char) 2.53 YaTeX-skip-next-reader-char) 2.54 "" 2.55 - (apply 'completing-read args))) 2.56 + (save-excursion ;work around to avoid cursor warp 2.57 + (apply 'completing-read args)))) 2.58 2.59 ;;;###autoload 2.60 (fset 'YaTeX-rassoc