[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 78/117: Fix visual line support
From: |
Matthew Fidler |
Subject: |
[elpa] 78/117: Fix visual line support |
Date: |
Fri, 25 Jul 2014 13:24:24 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit 79d28b6d33413a3b04775690c6bd810020ce78a1
Author: Matthew L. Fidler <address@hidden>
Date: Mon Jul 21 15:34:19 2014 -0500
Fix visual line support
---
ergoemacs-functions.el | 48 ++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 40 insertions(+), 8 deletions(-)
diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index 559d35e..1e4c7b0 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -116,10 +116,44 @@ running interactively.
nil)))
t)))
+(defvar ergoemacs-mode)
+(defvar ergoemacs-smart-paste)
+(defvar ergoemacs-use-menus)
+(defvar ergoemacs-theme)
+(defvar ergoemacs-keyboard-layout)
+(defvar ergoemacs-theme-options)
+(defun ergoemacs-save-options-to-customized (&optional no-save)
+ (let (ergoemacs-mode)
+ (customize-save-variable 'ergoemacs-smart-paste ergoemacs-smart-paste)
+ (customize-save-variable 'ergoemacs-use-menus ergoemacs-use-menus)
+ (customize-save-variable 'ergoemacs-theme (or ergoemacs-theme "standard"))
+ (customize-save-variable 'ergoemacs-keyboard-layout
ergoemacs-keyboard-layout)
+ (customize-save-variable 'ergoemacs-ctl-c-or-ctl-x-delay
ergoemacs-ctl-c-or-ctl-x-delay)
+ (customize-save-variable 'ergoemacs-handle-ctl-c-or-ctl-x
ergoemacs-handle-ctl-c-or-ctl-x)
+ (customize-save-variable 'ergoemacs-use-menus ergoemacs-use-menus)
+ (customize-save-variable 'ergoemacs-theme-options ergoemacs-theme-options)
+ (unless no-save
+ (customize-save-customized))))
+
+(declare-function ergoemacs-mode "ergoemacs-mode.el")
+(declare-function ergoemacs-ini-mode "ergoemacs-mode.el")
(defun ergoemacs-exit-customize-save-customized ()
"Call `customize-save-customized' on exit emacs.
+Also:
+
+- Deactivates `ergoemacs-mode'
+- Activates `ergoemacs-ini-mode', to try to run `ergoemacs-mode'
+ when called for or at the last second.
+- Saves `ergoemacs-mode' options by calling
+ `ergoemacs-save-options-to-customized'
+
If an error occurs, display the error, and sit for 2 seconds before exiting"
+ (ergoemacs-mode -1)
+ (ergoemacs-ini-mode 1)
+ (customize-save-variable 'ergoemacs-mode nil)
+ (customize-save-variable 'ergoemacs-ini-mode t)
+ (ergoemacs-save-options-to-customized 'no-save)
(cond
(noninteractive)
((not (or custom-file user-init-file))
@@ -342,7 +376,6 @@ If `narrow-to-region' is in effect, then cut that region
only."
(point))
(save-excursion
(ergoemacs-shortcut-remap 'move-end-of-line)
- (call-interactively 'move-end-of-line)
(re-search-forward "\\=\n" nil t) ;; Include newline
(point)))))
(deactivate-mark))
@@ -697,7 +730,7 @@ the prefix arguments of `beginning-of-buffer',
;; (setq prefix-arg nil)
(setq current-prefix-arg nil)
(ergoemacs-shortcut-remap 'move-beginning-of-line)
- (setq this-command 'move-beginning-of-line)
+ ;; (setq this-command 'move-beginning-of-line)
(push (point) pts))
(when ergoemacs-back-to-indentation
(save-excursion
@@ -716,7 +749,7 @@ the prefix arguments of `beginning-of-buffer',
(push (point) pts))))))
(cond
((not pts)
- (call-interactively 'move-beginning-of-line))
+ (ergoemacs-shortcut-remap 'move-beginning-of-line))
(t
(setq pts (sort pts '<))
(dolist (x pts)
@@ -819,8 +852,7 @@ the prefix arguments of `end-of-buffer',
(let (pts tmp)
(setq current-prefix-arg nil)
(save-excursion
- (call-interactively 'move-end-of-line)
- (setq this-command 'move-end-of-line)
+ (ergoemacs-shortcut-remap 'move-end-of-line)
(push (point) pts))
(when ergoemacs-end-of-comment-line
(save-excursion
@@ -838,7 +870,7 @@ the prefix arguments of `end-of-buffer',
(setq pts (reverse tmp)))
(cond
((not pts)
- (call-interactively 'move-end-of-line)
+ (ergoemacs-shortcut-remap 'move-end-of-line)
(setq this-command 'move-end-of-line))
(t
(goto-char (nth 0 pts)))))))
@@ -1168,7 +1200,7 @@ the last misspelled word with
(setq p1 (car bds) p2 (cdr bds)))))
(if (not (and p1 p2))
(when ergoemacs-toggle-letter-case-and-spell
- (call-interactively 'flyspell-auto-correct-previous-word))
+ (ergoemacs-shortcut-remap 'flyspell-auto-correct-previous-word))
(when (not (eq last-command this-command))
(save-excursion
(goto-char p1)
@@ -1288,7 +1320,7 @@ Emacs buffers are those whose name starts with *."
(defun ergoemacs-delete-frame ()
"Deletes frame or closes emacs (with prompt)."
(interactive)
- (unless (ignore-errors (call-interactively 'delete-frame))
+ (unless (ignore-errors (ergoemacs-shortcut-remap 'delete-frame))
(when (yes-or-no-p "Do you wish to Close Emacs? ")
;; Bound to C-x C-c
(save-buffers-kill-terminal))))
- [elpa] 66/117: Allow keymaps to be copied before modifying them, (continued)
- [elpa] 66/117: Allow keymaps to be copied before modifying them, Matthew Fidler, 2014/07/25
- [elpa] 69/117: Fix Issue #279, Matthew Fidler, 2014/07/25
- [elpa] 70/117: Fix unbound keys test, Matthew Fidler, 2014/07/25
- [elpa] 72/117: Add back emacs 23, Matthew Fidler, 2014/07/25
- [elpa] 71/117: Use flat keymaps (start supporting emacs 23?), Matthew Fidler, 2014/07/25
- [elpa] 73/117: Try to make compatible with emacs 23, Matthew Fidler, 2014/07/25
- [elpa] 74/117: Remove debugging for iswitch-buffer, Matthew Fidler, 2014/07/25
- [elpa] 65/117: Allow hooks to be run before modifying keymaps, Matthew Fidler, 2014/07/25
- [elpa] 75/117: Declare some of the package functions to compile cleanly on Emacs 23, Matthew Fidler, 2014/07/25
- [elpa] 76/117: Add toggle component, Matthew Fidler, 2014/07/25
- [elpa] 78/117: Fix visual line support,
Matthew Fidler <=
- [elpa] 77/117: Take out the toggling of the themes, Matthew Fidler, 2014/07/25
- [elpa] 68/117: Use remaps more, Matthew Fidler, 2014/07/25
- [elpa] 81/117: Fix apps-toggle. Apparently the other method was mispecified, Matthew Fidler, 2014/07/25
- [elpa] 79/117: Allow repeated visual beginning/end of line, Matthew Fidler, 2014/07/25
- [elpa] 80/117: Dont flatten keymaps, Matthew Fidler, 2014/07/25
- [elpa] 82/117: Remove ergoemacs-mode from custom set vars, Matthew Fidler, 2014/07/25
- [elpa] 86/117: Clear local ergoemacs-mode read-key captures, Matthew Fidler, 2014/07/25
- [elpa] 85/117: Fix cut and copy issues, Matthew Fidler, 2014/07/25
- [elpa] 83/117: Handle menu-bar when flattening keymaps., Matthew Fidler, 2014/07/25
- [elpa] 88/117: Add non-defined functions to map, Matthew Fidler, 2014/07/25