From aee6f9008aea57076288c709c8252ce5ea3c0fda Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 25 Jan 2012 13:52:20 +0100 Subject: [PATCH] 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. --- lisp/org-list.el | 12 ++++++++++++ lisp/org.el | 1 + 2 files changed, 13 insertions(+) diff --git a/lisp/org-list.el b/lisp/org-list.el index da8a81089..2d48e9482 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 e1a0714a2..4d2227289 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)