emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Displaying macros differently
@ 2022-12-04 16:00 Vikas Rawal
  2022-12-05  3:43 ` William Denton
  0 siblings, 1 reply; 3+ messages in thread
From: Vikas Rawal @ 2022-12-04 16:00 UTC (permalink / raw)
  To: org-mode mailing list

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

Hi everyone,

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.

I am aware of things like org-bullets which do something like this with
headlines. But I was wondering if anyone has done this with macros.

My apologies if I have not been able to express my problem clearly.

Best wishes,

Vikas

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Displaying macros differently
  2022-12-04 16:00 Displaying macros differently Vikas Rawal
@ 2022-12-05  3:43 ` William Denton
  2022-12-05 16:53   ` Vikas Rawal
  0 siblings, 1 reply; 3+ messages in thread
From: William Denton @ 2022-12-05  3:43 UTC (permalink / raw)
  To: Vikas Rawal; +Cc: org-mode mailing list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Displaying macros differently
  2022-12-05  3:43 ` William Denton
@ 2022-12-05 16:53   ` Vikas Rawal
  0 siblings, 0 replies; 3+ messages in thread
From: Vikas Rawal @ 2022-12-05 16:53 UTC (permalink / raw)
  To: William Denton; +Cc: org-mode mailing list

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

This is perfect, thank you!

On Mon, 5 Dec 2022 at 09:13, William Denton <wtd@pobox.com> wrote:

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-05 16:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-04 16:00 Displaying macros differently Vikas Rawal
2022-12-05  3:43 ` William Denton
2022-12-05 16:53   ` Vikas Rawal

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