Karthik Chikmagalur <karthikchikmaga...@gmail.com> writes:

> I have a question about addressing byte-compile warnings, explained via
> example:
>
> 1. In the preview branch, org-create-formula-image has been moved to
> org-compat.el since it is obsolete.
> 2. This function uses org--get-display-dpi, which has also been made
> obsolete:
>
> (define-obsolete-function-alias
>   'org--get-display-dpi 'org-latex-preview--get-display-dpi "9.8")

(2) is unnecessary. We do not need to obsolete internal functions.

> 3. I get the following byte-compile error in org-create-formula-image:
>
> org-compat.el:1031:62: Warning: ‘org--get-display-dpi’ is an obsolete
> function (as of 9.7); use ‘org-latex-preview--get-display-dpi’ instead.
>
> To address this warning, should I replace org--get-display-dpi with
> org-latex-preview--get-display-dpi in org-create-formula-image?  After
> moving them to org-compat, I've left obsoleted functions untouched so
> far.

In this particular case, just move `org--get-display-dpi' to org-compat
alongside with the user.

If you need to obsolete two dependent functions, simply pacify the
compiler via `with-no-warnings'. Example:
https://git.sr.ht/~yantar92/org-mode/tree/feature/refactor-deps-v2/item/lisp/org-obsolete9.8.el#L679

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