Karthik Chikmagalur <[email protected]> writes:

> I'm working on org-latex-preview actively this week, so even incremental
> feedback will be helpful as I can get started on it.

And now comments on org-latex-preview.el itself (part 1)

> (defvar org-src-mode-hook nil)

This is not necessary.

> (defvar org-src--beg-marker nil)

Just (defvar org-src--beg-marker) - no need to create a new dynamic
variable. Even better - move this defvar into inside the function.

> (defcustom org-latex-preview-process-alist

:latex-precompiler option is not documented in the docstring.
In fact, it is also never used. Instead, `org-latex-precompile-command'
is used.

> (defcustom org-latex-preview-compiler-command-map

This reminds me of `org-latex-precompile-compiler-map' in ox-latex.
`org-latex-precompile-compiler-map' is unused in the code.

> (defconst org-latex-preview--precompile-log "*Org Preview Preamble 
> Precompilation*"
>   "Buffer name for Preview LaTeX output.")

This is unused.

> (defconst org-latex-preview--temp-cache-dir
>   (expand-file-name "org-latex-preview" temporary-file-directory)
>   "Folder used to cache temp-stored previews.")

Please use (temporary-file-directory) call, not variable.

> (defconst org-latex-preview-live--cache-dir
>   (expand-file-name "org-latex-preview-mode-display-live" 
> temporary-file-directory)
>   "Folder used to cache live previews.")

Is it ever used? From the code, this would correspond to
org-latex-preview-cache = 'live (undocumented).

> (defcustom org-latex-preview-preamble "\\documentclass{article}

The default value has been altered after the rename. This warrants
adding :package-version to the defcustom.

>   "The document header used for processing LaTeX fragments.
> It is imperative that this header make sure that no page number
> appears on the page.  The package defined in the variables
> `org-latex-default-packages-alist' and `org-latex-packages-alist'
> will either replace the placeholder \"[PACKAGES]\" in this
> header, or they will be appended."

This is not "or they will be appended", but more subtle. See the
docstring of org-latex-classes.

> (defcustom org-latex-preview-mode-track-inserts t

I am looking that this is enabled by default, and that it is mentioned
in the manual. But I am wondering why would everyone want to disable
this option while keeping org-latex-preview-mode. Maybe it is not worth
mentioning this option in the manual?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to