tecosaur / org-latex-preview-todos

A tracker for the Org LaTeX Preview effort on https://git.tecosaur.net/tec/org-mode
4 stars 0 forks source link

Rename org-latex-preview-width? #18

Closed karthink closed 5 months ago

karthink commented 6 months ago

Rename org-latex-preview-width -> org-latex-preview-page-width maybe?

Got a report of a user who assumed this variable controlled the preview width, as in its size. To be fair they probably did not read the variable documentation.

karthink commented 6 months ago

Actually, do we even want this to be a separate option?

The plist org-preview-latex-options could contain all the user preferences for generating in-buffer previews.

There's also :matchers in there, but I think this is obsolete? We don't respect this any more.

What do you think? Anything else that could live in this plist instead of scattered about the customize menu?

tecosaur commented 6 months ago

:thinking: putting it in the options plist sounds reasonable to me.

karthink commented 6 months ago

How about adding:

Live preview options:

I'm not sold on any of this, just bringing it up for consideration. Having them all in one place is nice for configuration, the user just needs to tweak one plist, and the name org-latex-preview-options makes sense too.

But there are two concerns:


It's just a shame that we have both, a variable named org-latex-preview-options that doesn't contain all the relevant options, and a bunch of options spread over the org-latex-preview- namespace.

We could go in the other direction too: deprecate org-latex-preview-options and define org-latex-preview-zoom, org-latex-preview-scale etc. This would also make things more uniform.

tecosaur commented 6 months ago

I'm sold on :page-width but not the rest.

If we do move more options between the plist and variables, we can maintain backward compatibility by using forms like this:

(or (plist-get *-options :thing) *-thing)
(or *-thing (plist-get *-options :thing))
karthink commented 6 months ago

I'm trying to find a division of options that makes some kind of internal sense. Using the short names for brevity:

So putting the first set in org-latex-preview-options is internally consistent. We could maybe rename it to org-latex-preview-appearance-options to be more accurate, but this will require a make-obsolete-variable and some compat-grumbling-noises from users.

The next two can stay as they are, as individual options.

We could place the last set (auto- and live- behavior) into a single plist, perhaps org-latex-preview-auto-options.

Just musing, so far :page-width is the only change I'm sold on as well.

tecosaur commented 6 months ago

So putting the first set in org-latex-preview-options is internally consistent. We could maybe rename it to org-latex-preview-appearance-options to be more accurate, but this will require a make-obsolete-variable and some compat-grumbling-noises from users.

This is already required due to the prefix change :)

tecosaur commented 6 months ago

Hmm, there's one difference between :page-width and the other parameters that makes implementing the change a little more annoying: everything else can be applied on a per-fragment basis.

karthink commented 6 months ago

Do we ever change any of the other attributes per-fragment?

tecosaur commented 6 months ago

Yes, :foreground and :background.

tecosaur commented 6 months ago

With https://git.tecosaur.net/tec/org-mode/commit/0a4f58e46 I'm happy with how things are.