From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Getting beginning postiion of a description list Date: Thu, 15 Jan 2015 21:31:08 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBwgu-0005Wn-A9 for emacs-orgmode@gnu.org; Thu, 15 Jan 2015 21:31:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBwgq-0002Gj-A8 for emacs-orgmode@gnu.org; Thu, 15 Jan 2015 21:31:16 -0500 Received: from mail-qg0-x234.google.com ([2607:f8b0:400d:c04::234]:39514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBwgq-0002Gf-4b for emacs-orgmode@gnu.org; Thu, 15 Jan 2015 21:31:12 -0500 Received: by mail-qg0-f52.google.com with SMTP id i50so14580520qgf.11 for ; Thu, 15 Jan 2015 18:31:11 -0800 (PST) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Calvin Young Cc: emacs-orgmode@gnu.org This is very un-orgish but it seems to do it. (forward-word) goes to the end the next recognized word, (backward-word) to the beginning of the word you are now at the end of, and (backward-char) to get to a space. You just need org to get you on the list ;) It seems to work on these. - foo :: bar (goto-char (org-element-property :contents-begin (org-element-at-point))) - baz :: goo - 1 egg - 0.5 cups - :punc #+BEGIN_SRC emacs-lisp (defun gg () (interactive) (beginning-of-line) (forward-word) (backward-word) (while (not (looking-at " ")) (backward-char))) #+END_SRC Calvin Young writes: > Hi all, > > If my cursor is in a description list item, what's the recommended way of > getting the point at the beginning of the description list text (i.e., > after the bullet character)? To illustrate, given the following description > list item, I'd like to get the point represented by the pipe character "|": > > - |foo :: bar > > If I use something like `(org-element-property :contents-begin > (org-element-at-point))`, that gives me the point at the beginning of the > description, not the list item: > > - foo :: |bar > > How do I need to massage this to give me the beginning of the whole list > item? Is there a recommended solution that'd work for both description > lists *and* plain lists? > > Thanks everyone :) > > Calvin -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu