emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Vararg macros, and code block as macro?


From: Kaushal Modi
Subject: Re: [O] Vararg macros, and code block as macro?
Date: Thu, 26 Jul 2018 11:39:54 -0400

Similary, how about this for your first question:

In your emacs config:

(defun my/org-macro-hsapi-code (link anchor desc)
  (let* ((link-1 (if (org-string-nw-p anchor)
                     (concat link "#" anchor)
                   link))
         (desc-1 (or (org-string-nw-p desc) link-1)))
    (concat "[[http://www.hammerspoon.org/docs/" link-1 "][" desc-1 "]]")))

In your Org file:

#+macro: hsapi (eval (my/org-macro-hsapi-code $1 $2 $3))
{{{hsapi(hs.notify)}}}
{{{hsapi(hs.notify,show)}}}
{{{hsapi(hs.notify,show,Foo)}}}
--

Kaushal Modi


reply via email to

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