emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Displaying macros differently


From: William Denton
Subject: Re: Displaying macros differently
Date: Sun, 4 Dec 2022 22:43:41 -0500 (EST)
User-agent: Alpine 2.22 (DEB 394 2020-01-19)

On 4 December 2022, Vikas Rawal wrote:

I frequently use orgmode macros -- like {{{M(Year 1998--99)}}} -- in tables
designed for latex export. I find that the macro syntax occupies many
character spaces. At the very least, 9 spaces are taken up even if my macro
shortcut is just one character long. This is very difficult with wide
tables as often the tables go off the screen just because of this.

I was wondering if there is a simple way of making org display the macros
differently. That is, use some kind of overlay, and display the above macro
may be like M:Year 1998--99. Or some special character could be used to
denote that there is a macro underlying what is visible here.

Is this close enough?

(setq org-hide-macro-markers t)

That hides the {{{macro}}} curly brackets (if there's no leading space).

I also have this to toggle macro visibility in the document so I can see them when I want to:

#+begin_src emacs-lisp
(defun wtd/toggle-org-macro-markers ()
  "Toggle visibility of {{{macro}}} markers"
  (interactive)
  (setq org-hide-macro-markers (not org-hide-macro-markers))
  (font-lock-mode)
  (font-lock-mode))
#+end_src

I think there's been some discussion about evaluating the macros and showing the result, but I don't think that's possible.

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada



reply via email to

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