From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: mark parent element? Date: Fri, 14 Mar 2014 11:42:06 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOUFM-0006ar-FB for emacs-orgmode@gnu.org; Fri, 14 Mar 2014 11:42:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOUFL-0005J8-JT for emacs-orgmode@gnu.org; Fri, 14 Mar 2014 11:42:08 -0400 Received: from mail-qa0-x22f.google.com ([2607:f8b0:400d:c00::22f]:46884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOUFL-0005J3-F7 for emacs-orgmode@gnu.org; Fri, 14 Mar 2014 11:42:07 -0400 Received: by mail-qa0-f47.google.com with SMTP id w5so2643494qac.20 for ; Fri, 14 Mar 2014 08:42:06 -0700 (PDT) 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: Org Mode Hi, I'm trying to write a function that will mark the parent of the current element. I think I understand how to do it but for some reason I can get the mark to persist after the funciton is called. I think it's really an elisp problem, not an org problem, but am hoping someone can ehelp me. Here's what I have: (defun er/mark-org-parent-element () "Marks an org parent element" (interactive) (let ((parent (plist-get (car (cdr (org-element-at-point))) :parent))) (let ((parent-props (car (cdr parent)))) ;; (print parent-props) ;; (print (plist-get parent-props :begin)) ;; (print (plist-get parent-props :end)) (if (plist-get parent-props :begin) (progn (goto-char (plist-get parent-props :begin)) (set-mark (point)) (goto-char (plist-get parent-props :end)) (exchange-point-and-mark) ))) ) )