emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeremie Juste <jeremiejuste@gmail.com>
To: emacs-orgmode@gnu.org
Subject: How to obtain the headline level from org-element-at-point
Date: Sat, 8 Apr 2017 16:17:51 +0200 (CEST)	[thread overview]
Message-ID: <87fuhj2dbn.fsf@u-cergy.fr> (raw)


Hello,

Interleave-mode https://github.com/rudolfochrist/interleave, is a very convenient tool for writing notes in associated
with pdf. It uses org-mode for this purpose.

I recently noticed that in the case where I want to write notes for
multiple pdf in a singlie org file, I have to use the level 1 headline

* Notes for CS103
  :PROPERTIES:
  :INTERLEAVE_PDF: cs103.pdf
  :END:


I would like to have the possibility of using any headline level for
this purpose but my org-fu is weak.

I think it boils down to this function in interleave-mode mode where
(org-element-type headline) checks only for level 1 headline.


#+BEGIN_SRC elisp
(defun interleave--headline-pdf-path (buffer)
  "Return the INTERLEAVE_PDF property of the current headline in BUFFER." 
(with-current-buffer buffer 
  (save-excursion 
    (let ((headline (org-element-at-point))) 
      (when (and (equal (org-element-type headline) 'headline) 
		 (org-entry-get nil interleave--pdf-prop)) 
	(setq interleave-multi-pdf-notes-file t) 
	(org-entry-get nil interleave--pdf-prop))))))

#+END_SRC


Can anyone see a way around it ?

Best regards,

Jeremie

             reply	other threads:[~2017-04-08 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-08 14:17 Jeremie Juste [this message]
2017-04-08 14:31 ` How to obtain the headline level from org-element-at-point John Kitchin
2017-04-08 15:05   ` Jeremie Juste
2017-04-08 15:31     ` John Kitchin

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=87fuhj2dbn.fsf@u-cergy.fr \
    --to=jeremiejuste@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).