emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 251/287: Modify copy-line-or-region to work with `org-mode`


From: Matthew Fidler
Subject: [elpa] 251/287: Modify copy-line-or-region to work with `org-mode`
Date: Wed, 02 Jul 2014 14:46:25 +0000

mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.

commit 0adf87e8922282f51b82b2e628f7c3212965d903
Author: Matthew L. Fidler <address@hidden>
Date:   Fri Jun 27 10:04:21 2014 -0500

    Modify copy-line-or-region to work with `org-mode`
---
 ergoemacs-functions.el |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index e0c8c39..a3d6968 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -315,7 +315,17 @@ If `narrow-to-region' is in effect, then cut that region 
only."
    ((region-active-p)
     (kill-ring-save (region-beginning) (region-end)))
    (t
-    (kill-ring-save (line-beginning-position) (line-beginning-position 2))))
+    ;; Hack away to support `org-mode' folded reg
+    (kill-ring-save
+     (save-excursion
+       (ergoemacs-shortcut-remap 'move-beginning-of-line)
+       (when (not (bolp))
+         (beginning-of-line))
+       (point))
+     (save-excursion
+       (ergoemacs-shortcut-remap 'move-end-of-line)
+       (call-interactively 'move-end-of-line)
+       (point)))))
   (deactivate-mark))
 
 (declare-function cua-cut-region "cua-base.el")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]