auctex-devel
[Top][All Lists]
Advanced

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

Re: In-buffer completion for macro/env arguments


From: Arash Esbati
Subject: Re: In-buffer completion for macro/env arguments
Date: Sun, 13 Aug 2023 14:43:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Keita,

Ikumi Keita <ikumi@ikumi.que.jp> writes:

> I noticed some of your recent commits broke compatibility with emacs 26
> and 27.
>
> On the current master branch, "gmake EMACS=emacs-26.1" (or 27.1) gives
> ----------------------------------------------------------------------
> In end of data:
> latex.el:9045:1:Warning: the following functions are not known to be defined:
>     string-trim, always
>
> ...
> In end of data:
> style/natbib.el:200:1:Warning: the function ‘string-empty-p’ is not known to
>     be defined.
>
> ----------------------------------------------------------------------
> (1) `string-trim' and `string-empty-p'
> In emacs 26 and 27, `string-trim' and `string-empty-p' are in subr-x.el,
> so it seems that we need `(require 'subr-x)'. (On the other hand, they
> are available in subr.el and simple.el in emacs 29. So maybe
> (unless (and (fboundp 'string-trim)
>              (fboundp 'string-empty-p))
>   (require 'subr-x))
> or something like it?)

Thanks for catching these.  I should have checked better :-(  I checked
the sources and what do you think about something like this in latex.el:

  (eval-when-compile
    (when (< emacs-major-version 29)
      (require 'subr-x)))

The `eval-when-compile'-thing is recommended by subr-x.el itself.

> (2) `always'
> According to NEWS.28, `always' was first introduced in emacs 28. So we
> have to replace it with lambda or compatibility function like
> (defun TeX-always (&rest _)
>   t)

Upps; I thought is was always there.  I'll add that to tex.el,  maybe
something like this:

  (if (> emacs-major-version 27)
      (defalias 'TeX-always #'always)
    (defun TeX-always (&rest _ignore)
      "Ignore ARGUMENTS, do nothing and return t.
  This is a compatibility function for Emacs versions prior to v.28"
      t))


> In addition,
>
>> +      (cl-letf (((symbol-function 'y-or-n-p) #'always))
>
> it seems to me that `cl-flet' suits better than `cl-letf' here.

Can you elaborate why?  I don't see why `cl-flet' suits better in this
case.

> (By the way, what is mystery to me is that "gmake EMACS=emacs-26.1"
> gives
> ----------------------------------------------------------------------
> In TeX-current-defun-name:
> tex.el:6770:56:Warning: reference to free variable ‘LaTeX-section-label’
> ----------------------------------------------------------------------
> while emacs 27 and later don't. It seems that emacs 27 and later load
> latex.el before they compile tex.el, but I don't see the reason why
> emacs 26 doesn't then...)

I can't tell either.  Will try to build Emacs 26 and maybe I can
reproduce this.

Best, Arash



reply via email to

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