summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSomelauw <Somelauw>2017-08-26 21:09:25 +0200
committerSomelauw <Somelauw>2017-08-26 21:10:09 +0200
commit3a27d7641377e50986e6f56e64fed28d8c0ca8da (patch)
treeefa4c29822c2294b6d3c287f193c0696f8602445
parent9c8406b5f0814bb214bc3e53062adc4154fd69de (diff)
Make I and A respect `org-special-ctrl-a/e`
-rw-r--r--doc/changelog.org2
-rw-r--r--doc/keythemes.org6
-rw-r--r--evil-org.el22
3 files changed, 14 insertions, 16 deletions
diff --git a/doc/changelog.org b/doc/changelog.org
index c3bcd71..d7e37f9 100644
--- a/doc/changelog.org
+++ b/doc/changelog.org
@@ -1,5 +1,5 @@
* Version 0.9
- - Make I / A ignore leading stars, tags and ellipses on headings
+ - Make I / A optionally ignore leading stars, tags and ellipses on headings
* Version 0.8
- Make evil-org-a-greater-org-object (=ar=), evil-org-inner/a-subtree (=iR=, =aR=) text objects linewise. The other text objects remain characterwise.
- Improvements to =o/O=
diff --git a/doc/keythemes.org b/doc/keythemes.org
index 80cc8a9..8a68092 100644
--- a/doc/keythemes.org
+++ b/doc/keythemes.org
@@ -17,8 +17,8 @@
| =TAB= | org-cycle | change folding level of current heading |
| =0= | evil-org-beginning-of-line | like 0 but can be special* |
| =$= | evil-org-end-of-line | like $ but can be special* |
- | =I= | evil-org-insert-line | like I but ignore leading stars |
- | =A= | evil-org-append-line | like A but ignore tags and ellipses |
+ | =I= | evil-org-insert-line | like I but can be special* |
+ | =A= | evil-org-append-line | like A but can be special* |
| =o= | evil-org-open-below | like o but continue tables and items* |
| =O= | evil-org-open-above | like O but continue tables and items* |
| =x= | evil-org-delete-char | like x but keep tables and tags aligned |
@@ -30,12 +30,12 @@
|-------+-------------------------------+-----------------------------------------|
* Set =org-special-ctrl-a/e= to =t= to make =org-beginning-of-line= and =org-end-of-line= ignore leading stars or tags on headings. Repeat to toggle. By default it's set to ~nil~.
+ * =evil=org-insert-line= and =evil-org-append-line= also respect the setting of =org-special-ctrl-a/e=.
* The cases in which =o= and =O= should behave special can be controlled using =evil-org-special-o/O=. By default it's set to ~'(table-row item)~.
*** Operators
Operators for promoting/demoting headings and items
-
|-----+----------------------+-------------------------------------|
| key | function | explanation |
|-----+----------------------+-------------------------------------|
diff --git a/evil-org.el b/evil-org.el
index fc3a768..2e3c4d9 100644
--- a/evil-org.el
+++ b/evil-org.el
@@ -7,7 +7,7 @@
;; Git-Repository: git://github.com/Somelauw/evil-org-mode.git
;; Created: 2012-06-14
;; Forked-since: 2017-02-12
-;; Version: 0.9.0
+;; Version: 0.9.2
;; Package-Requires: ((emacs "24.4") (evil "1.0") (org "8.0.0"))
;; Keywords: evil vim-emulation org-mode key-bindings presets
@@ -214,27 +214,25 @@ Optional argument ARGUMENTS arguments to pass to FUN."
;;; insertion commands
(defun evil-org-insert-line (count)
- "Insert at beginning of line, but ignore heading and item markers.
+ "Insert at beginning of line, but if org-special-ctrl-a/e ignore heading and item markers.
The insertion will be repeated COUNT times."
(interactive "p")
(if (org-at-heading-or-item-p)
;; Manipulate org-beginning-of-line to become special
- (let ((org-special-ctrl-a/e t))
- (beginning-of-line)
- (org-beginning-of-line nil)
- (evil-insert count))
+ (progn (beginning-of-line)
+ (org-beginning-of-line nil)
+ (evil-insert count))
(evil-insert-line count)))
(defun evil-org-append-line (count)
- "Insert at beginning of line but ignore tags and ellipses at end of the line.
+ "Insert at beginning of line but if org-special-ctrl-a/e ignore tags and ellipses at end of the line.
The insertion will be repeated COUNT times."
(interactive "p")
(if (org-at-heading-p)
;; Manipulate org-end-of-line to become special
- (let ((org-special-ctrl-a/e t))
- (end-of-line)
- (org-end-of-line nil)
- (evil-insert count))
+ (progn (end-of-line)
+ (org-end-of-line nil)
+ (evil-insert count))
(evil-append-line count)))
(defun evil-org-open-below (count)
@@ -570,7 +568,7 @@ Includes tables, list items and subtrees."
(kbd "<") 'evil-org-promote-or-dedent
(kbd ">") 'evil-org-demote-or-indent
(kbd "<tab>") 'org-cycle
- (kbd "<S-tab>") 'org-shifttab))
+ (kbd "<S-tab>") 'org-shifttab)))
(defun evil-org--populate-textobjects-bindings ()
"Text objects."