summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-01-25 13:52:20 +0100
committerBastien Guerry <bzg@altern.org>2012-01-25 13:52:20 +0100
commitaee6f9008aea57076288c709c8252ce5ea3c0fda (patch)
tree7ce6baf714286cdfe63fc5c2df5c62b5473e74ee
parentc4fad02b060efb56d59ca9155f0a99d8716c22c0 (diff)
downloadorg-mode-aee6f9008aea57076288c709c8252ce5ea3c0fda.tar.gz
New function `org-mark-list' bound to `C-c C-@'.
* org-list.el (org-mark-list): New function. * org.el (org-mode-map): Add a keybinding for the new function.
-rw-r--r--lisp/org-list.el12
-rw-r--r--lisp/org.el1
2 files changed, 13 insertions, 0 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el
index da8a810..2d48e94 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -2177,6 +2177,18 @@ item is invisible."
(goto-char (match-end 0))
t)))))
+(defun org-mark-list ()
+ "Mark the current list.
+If this is a sublist, only mark the sublist."
+ (interactive)
+ (let* ((item (org-list-get-item-begin))
+ (struct (org-list-struct))
+ (prevs (org-list-prevs-alist struct))
+ (lbeg (org-list-get-list-begin item struct prevs))
+ (lend (org-list-get-list-end item struct prevs)))
+ (push-mark lend nil t)
+ (goto-char lbeg)))
+
(defun org-list-repair ()
"Fix indentation, bullets and checkboxes is the list at point."
(interactive)
diff --git a/lisp/org.el b/lisp/org.el
index e1a0714..4d22272 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17366,6 +17366,7 @@ BEG and END default to the buffer boundaries."
(org-defkey org-mode-map "\C-c\C-x\C-mg" 'org-mobile-pull)
(org-defkey org-mode-map "\C-c\C-x\C-mp" 'org-mobile-push)
(org-defkey org-mode-map "\C-c@" 'org-mark-subtree)
+(org-defkey org-mode-map "\C-c\C-@" 'org-mark-list)
(org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree)
;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree)