emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] mark parent element?


From: Matt Price
Subject: [O] mark parent element?
Date: Fri, 14 Mar 2014 11:42:06 -0400

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)
            )))
    )
)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]