From: Matt Price <moptop99@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: mark parent element?
Date: Fri, 14 Mar 2014 11:42:06 -0400 [thread overview]
Message-ID: <CAN_Dec9jfG_i7mjuUHirvhfAJNuxateiQ2MrthC6t2QYcq5W8g@mail.gmail.com> (raw)
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)
)))
)
)
next reply other threads:[~2014-03-14 15:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 15:42 Matt Price [this message]
2014-03-14 17:11 ` mark parent element? Thorsten Jolitz
2014-03-14 17:57 ` Oleh
2014-03-14 18:11 ` Nicolas Goaziou
2014-03-15 2:06 ` Matt Price
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAN_Dec9jfG_i7mjuUHirvhfAJNuxateiQ2MrthC6t2QYcq5W8g@mail.gmail.com \
--to=moptop99@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).