# HG changeset patch # User HIROSE Yuuji # Date 1421366300 -32400 # Node ID 318841b095704521d067fd8fef1bcfad39518f4a # Parent c44910b36b9504abeab379cda532fac85b8003b5 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. diff -r c44910b36b95 -r 318841b09570 yatex.el --- a/yatex.el Thu Jan 15 23:21:24 2015 +0900 +++ b/yatex.el Fri Jan 16 08:58:20 2015 +0900 @@ -1,6 +1,6 @@ ;;; yatex.el --- Yet Another tex-mode for emacs //–ì’¹// -*- coding: sjis -*- ;;; (c)1991-2015 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Jan 15 23:15:51 2015 on firestorm +;;; Last modified Fri Jan 16 08:38:34 2015 on firestorm ;;; $Id$ ;;; The latest version of this software is always available at; ;;; http://www.yatex.org/ diff -r c44910b36b95 -r 318841b09570 yatexlib.el --- a/yatexlib.el Thu Jan 15 23:21:24 2015 +0900 +++ b/yatexlib.el Fri Jan 16 08:58:20 2015 +0900 @@ -1,7 +1,7 @@ ;;; yatexlib.el --- YaTeX and yahtml common libraries ;;; ;;; (c)1994-2013 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Jan 15 11:22:54 2015 on firestorm +;;; Last modified Fri Jan 16 08:40:45 2015 on firestorm ;;; $Id$ ;;; Code: @@ -732,7 +732,8 @@ (if (fboundp 'completing-read-with-history-in) (completing-read-with-history-in minibuffer-history-symbol prompt table predicate must-match initial) - (completing-read prompt table predicate must-match initial)) + (save-excursion ;work around to avoid cursor warp + (completing-read prompt table predicate must-match initial))) (if (and YaTeX-emacs-19 hsym) (set hsym minibuffer-history))))) ;;;###autoload @@ -740,7 +741,8 @@ "Read from minibuffer with general history: gmhist, Emacs-19." (cond (YaTeX-emacs-19 - (read-from-minibuffer prompt init map read hsym)) + (save-excursion ;work around to avoid cursor warp + (read-from-minibuffer prompt init map read hsym))) (t (let ((minibuffer-history-symbol hsym)) (read-from-minibuffer prompt init map read))))) @@ -750,7 +752,8 @@ "Read string with history: gmhist(Emacs-18) and Emacs-19." (cond (YaTeX-emacs-19 - (read-from-minibuffer prompt init minibuffer-local-map nil hsym)) + (save-excursion ;work around to avoid cursor warp + (read-from-minibuffer prompt init minibuffer-local-map nil hsym))) ((featurep 'gmhist-mh) (read-with-history-in hsym prompt init)) (t (read-string prompt init)))) @@ -761,14 +764,16 @@ (if (equal (if (boundp 'last-input-event) last-input-event last-input-char) YaTeX-skip-next-reader-char) "" - (apply 'read-string args))) + (save-excursion ;work around to avoid cursor warp + (apply 'read-string args)))) (defun YaTeX-completing-read-or-skip (&rest args) "Do completing-read, or skip if last input char is \C-j." (if (equal (if (boundp 'last-input-event) last-input-event last-input-char) YaTeX-skip-next-reader-char) "" - (apply 'completing-read args))) + (save-excursion ;work around to avoid cursor warp + (apply 'completing-read args)))) ;;;###autoload (fset 'YaTeX-rassoc