emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Diego Zamboni <diego@zzamboni.org>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: Vararg macros, and code block as macro?
Date: Thu, 26 Jul 2018 11:39:54 -0400	[thread overview]
Message-ID: <CAFyQvY1O=gJQeCiUjW3ZEP5+_MYWern-am53pXNZ7OBB=aNM=Q@mail.gmail.com> (raw)
In-Reply-To: <CAFyQvY1A3R=toya=Ecjn0iTVi=eYFEjT=SiwMEnJeKY0DeVfEw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 956 bytes --]

  reply	other threads:[~2018-07-26 15:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 14:33 Vararg macros, and code block as macro? Diego Zamboni
2018-07-26 15:21 ` Kaushal Modi
2018-07-26 15:39   ` Kaushal Modi [this message]
2018-07-26 19:01   ` Diego Zamboni

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='CAFyQvY1O=gJQeCiUjW3ZEP5+_MYWern-am53pXNZ7OBB=aNM=Q@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=diego@zzamboni.org \
    --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).