Hi Jonathan, sorry for my late response,

indieterminacy writes:

> I recommend Hyperbole, though I must confess Ive been using Orgmode a 
> lot less since Ive been focusing on the format GemText.
>
> I should recommend the use of the function defil, for people who like 
> regexes and want to operate differing contexts (to launch via the ACTION 
> operator). Its mid-grade compared to the more simpler approach and the 
> more complex eLisp approach.

Thank you very much for all the very interesting information about hyperbole!

I am liking the idea of implicit buttons more and more, and I see a few
applications of this concept that I can find very practical. To play
around with the defil function, which you recommend in your email, I've
tried defining some 'contextual help' for LaTeX and Org. Specifically for
Org it has occurred to me to convert some keywords into implicit buttons
that point to the info pages. Something like this:

#+begin_src emacs-lisp
  (defil org-attr-latex
    "#+" ":" "attr_latex\\|caption"
    (let ((el (org-element-at-point)))
      (cond ((eq (org-element-type el) 'src-block)
             (lambda (x)
               (info "(org)Source blocks in LaTeX export")))
            ((eq (org-element-type el) 'table)
             (lambda (x)
               (info "(org)Tables in LaTeX export")))
            ((eq (org-element-type el) 'plain-list)
             (lambda (x)
               (info "(org)Plain lists in LaTeX export")))
            ((eq (org-element-type el) 'paragraph)
             (lambda (x)
               (info "(org)Images in LaTeX export")))
            ((eq (org-element-type el) 'verse-block)
             (lambda (x)
               (info "(org)Verse blocks in LaTeX export")))
            ((eq (org-element-type el) 'special-block)
             (lambda (x)
               (info "(org)Special blocks in LaTeX export")))
            ((eq (org-element-type el) 'example-block)
             (lambda (x)
               (info "(org)Example blocks in LaTeX export")))
            ((eq (org-element-type el) 'quote-block)
             (lambda (x)
               (info "(org)Quote blocks in LaTeX export"))))))

  (defil org-attr-html
    "#+" ":" "attr_html\\|caption"
    (let ((el (org-element-at-point)))
      (cond ((eq (org-element-type el) 'table)
             (lambda (x)
               (info "(org)Tables in HTML export")))
            ((eq (org-element-type el) 'paragraph)
             (lambda (x)
               (info "(org)Images in HTML export"))))))


  (defil org-options-kw "#+" ":" "options"
    (lambda (x)
      (info "(org)Export Settings")
      (occur "‘OPTIONS’")))
#+end_src

I've also discovered the defib function, which allows you to define
implicit buttons using predicates, instead of just using regular
expressions and delimiters.

Best regards,

Juan Manuel 

Reply via email to