Mercurial > hgrepos > hgweb.cgi > 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 wrap: on
line diff
--- 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/
--- 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