| 725 | | (let ((has-saved-cursor-color-in-emacs-mode |
|---|
| 726 | | (stringp (viper-get-saved-cursor-color-in-emacs-mode)))) |
|---|
| 727 | | (or has-saved-cursor-color-in-emacs-mode |
|---|
| 728 | | (string= (viper-get-cursor-color) viper-emacs-state-cursor-color) |
|---|
| 729 | | (viper-save-cursor-color 'before-emacs-mode)) |
|---|
| 730 | | (viper-change-cursor-color viper-emacs-state-cursor-color)) |
|---|
| | 727 | (if viper-emacs-state-cursor-color |
|---|
| | 728 | (let ((has-saved-cursor-color-in-emacs-mode |
|---|
| | 729 | (stringp (viper-get-saved-cursor-color-in-emacs-mode)))) |
|---|
| | 730 | (or has-saved-cursor-color-in-emacs-mode |
|---|
| | 731 | (string= (viper-get-cursor-color) viper-emacs-state-cursor-color) |
|---|
| | 732 | (viper-save-cursor-color 'before-emacs-mode)) |
|---|
| | 733 | (viper-change-cursor-color viper-emacs-state-cursor-color))) |
|---|
| 1033 | | ;; Emacs 22.50.8 introduced a bug, which makes even a single ESC into |
|---|
| 1034 | | ;; a fast keyseq. To guard against this, we added a check if there |
|---|
| 1035 | | ;; are other events as well |
|---|
| 1036 | | (if (and (viper-fast-keysequence-p) unread-command-events) |
|---|
| | 1041 | ;; Some versions of Emacs (eg., 22.50.8 have a bug, which makes even |
|---|
| | 1042 | ;; a single ESC into ;; a fast keyseq. To guard against this, we |
|---|
| | 1043 | ;; added a check if there are other events as well. Keep the next |
|---|
| | 1044 | ;; line for the next time the bug reappears, so that will remember to |
|---|
| | 1045 | ;; report it. |
|---|
| | 1046 | ;;(if (and (viper-fast-keysequence-p) unread-command-events) |
|---|
| | 1047 | (if (viper-fast-keysequence-p) ;; for Emacsen without the above bug |
|---|
| 1747 | | (setq undo-beg-posn beg |
|---|
| 1748 | | undo-end-posn (or end beg)) |
|---|
| 1749 | | ;; some other hooks may be changing various text properties in |
|---|
| 1750 | | ;; the buffer in response to 'undo'; so remove this hook to avoid |
|---|
| 1751 | | ;; its repeated invocation |
|---|
| 1752 | | (remove-hook 'viper-undo-functions 'viper-after-change-undo-hook 'local)) |
|---|
| | 1758 | (if (and (boundp 'undo-in-progress) undo-in-progress) |
|---|
| | 1759 | (setq undo-beg-posn beg |
|---|
| | 1760 | undo-end-posn (or end beg)) |
|---|
| | 1761 | ;; some other hooks may be changing various text properties in |
|---|
| | 1762 | ;; the buffer in response to 'undo'; so remove this hook to avoid |
|---|
| | 1763 | ;; its repeated invocation |
|---|
| | 1764 | (remove-hook 'viper-undo-functions 'viper-after-change-undo-hook 'local) |
|---|
| | 1765 | )) |
|---|
| 1767 | | (setq undo-beg-posn (or undo-beg-posn before-undo-pt) |
|---|
| 1768 | | undo-end-posn (or undo-end-posn undo-beg-posn)) |
|---|
| 1769 | | |
|---|
| 1770 | | (goto-char undo-beg-posn) |
|---|
| 1771 | | (sit-for 0) |
|---|
| 1772 | | (if (and viper-keep-point-on-undo |
|---|
| 1773 | | (pos-visible-in-window-p before-undo-pt)) |
|---|
| | 1780 | ;;(setq undo-beg-posn (or undo-beg-posn (point)) |
|---|
| | 1781 | ;; undo-end-posn (or undo-end-posn (point))) |
|---|
| | 1782 | ;;(setq undo-beg-posn (or undo-beg-posn before-undo-pt) |
|---|
| | 1783 | ;; undo-end-posn (or undo-end-posn undo-beg-posn)) |
|---|
| | 1784 | |
|---|
| | 1785 | (if (and undo-beg-posn undo-end-posn) |
|---|
| 1775 | | (push-mark (point-marker) t) |
|---|
| 1776 | | (viper-sit-for-short 300) |
|---|
| 1777 | | (goto-char undo-end-posn) |
|---|
| 1778 | | (viper-sit-for-short 300) |
|---|
| 1779 | | (if (and (> (viper-chars-in-region undo-beg-posn before-undo-pt) 1) |
|---|
| 1780 | | (> (viper-chars-in-region undo-end-posn before-undo-pt) 1)) |
|---|
| 1781 | | (goto-char before-undo-pt) |
|---|
| 1782 | | (goto-char undo-beg-posn))) |
|---|
| 1783 | | (push-mark before-undo-pt t)) |
|---|
| | 1787 | (goto-char undo-beg-posn) |
|---|
| | 1788 | (sit-for 0) |
|---|
| | 1789 | (if (and viper-keep-point-on-undo |
|---|
| | 1790 | (pos-visible-in-window-p before-undo-pt)) |
|---|
| | 1791 | (progn |
|---|
| | 1792 | (push-mark (point-marker) t) |
|---|
| | 1793 | (viper-sit-for-short 300) |
|---|
| | 1794 | (goto-char undo-end-posn) |
|---|
| | 1795 | (viper-sit-for-short 300) |
|---|
| | 1796 | (if (pos-visible-in-window-p undo-beg-posn) |
|---|
| | 1797 | (goto-char before-undo-pt) |
|---|
| | 1798 | (goto-char undo-beg-posn))) |
|---|
| | 1799 | (push-mark before-undo-pt t)) |
|---|
| | 1800 | )) |
|---|
| | 1801 | |
|---|