[Top][All Lists]

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

[O] How to obtain the headline level from org-element-at-point

From: Jeremie Juste
Subject: [O] How to obtain the headline level from org-element-at-point
Date: Sat, 8 Apr 2017 16:17:51 +0200 (CEST)
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)


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
  :INTERLEAVE_PDF: cs103.pdf

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


Can anyone see a way around it ?

Best regards,


reply via email to

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