unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [ELPA] some tex-related packages
@ 2024-05-19 17:06 Paul Nelson
  2024-05-20  6:33 ` Philip Kaludercic
  0 siblings, 1 reply; 25+ messages in thread
From: Paul Nelson @ 2024-05-19 17:06 UTC (permalink / raw)
  To: emacs-devel

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

I have a few tex-related packages that I'd like to submit to ELPA.  They
all rely on AUCTeX 14.0.5, which was just released today.  (I'd be happy to
make a separate post for each, if that'd be easier.)

https://github.com/ultronozm/tex-numbers.el
https://github.com/ultronozm/tex-continuous.el
https://github.com/ultronozm/preview-auto.el

tex-numbers provides an interface for retrieving label numbers from tex
documents and uses this to augment some features of AUCTeX (previews,
folds, ...) with correct numbering.

tex-continuous provides a minor mode in which a tex document is compiled
continuously using latexmk, the error log is parsed using AUCTeX, and
errors are reported via flymake.

preview-auto provides a minor mode in which AUCTeX previews generate
automatically in the visible part of the buffer.

I've shared these primarily via word-of-mouth to colleagues, and have
received positive feedback.  Any other feedback or suggestions would be
welcome.

Thanks, best,

Paul

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

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

* Re: [ELPA] some tex-related packages
  2024-05-19 17:06 [ELPA] some tex-related packages Paul Nelson
@ 2024-05-20  6:33 ` Philip Kaludercic
  2024-05-20  9:01   ` Paul Nelson
  0 siblings, 1 reply; 25+ messages in thread
From: Philip Kaludercic @ 2024-05-20  6:33 UTC (permalink / raw)
  To: Paul Nelson; +Cc: emacs-devel

Paul Nelson <ultrono@gmail.com> writes:

> I have a few tex-related packages that I'd like to submit to ELPA.  They
> all rely on AUCTeX 14.0.5, which was just released today.  (I'd be happy to
> make a separate post for each, if that'd be easier.)

That's not necessary.

> https://github.com/ultronozm/tex-numbers.el
> https://github.com/ultronozm/tex-continuous.el
> https://github.com/ultronozm/preview-auto.el
>
> tex-numbers provides an interface for retrieving label numbers from tex
> documents and uses this to augment some features of AUCTeX (previews,
> folds, ...) with correct numbering.

At first the name made me think the package dealt with built-in numbers
in TeX (e.g. to simplify arithmetic).  But a cursory look at the sources
makes it seems like it is LaTeX specific.  Perhaps it should be renamed
to something like "latex-numbering"?

> tex-continuous provides a minor mode in which a tex document is compiled
> continuously using latexmk, the error log is parsed using AUCTeX, and
> errors are reported via flymake.

That sounds interesting.  Here again, tex- implies one thing but latexmk
another.  Is the dependency on latexmk hard, or could you re-use
AUCTeX's facilities?

> preview-auto provides a minor mode in which AUCTeX previews generate
> automatically in the visible part of the buffer.

This makes me think, have you communicated any of these features to the
AUCTeX developers?  Perhaps it would make more sense to upstream these
as patches instead of having too many little packages?

> I've shared these primarily via word-of-mouth to colleagues, and have
> received positive feedback.  Any other feedback or suggestions would be
> welcome.
>
> Thanks, best,
>
> Paul

-- 
	Philip Kaludercic on peregrine



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

* Re: [ELPA] some tex-related packages
  2024-05-20  6:33 ` Philip Kaludercic
@ 2024-05-20  9:01   ` Paul Nelson
  2024-05-20  9:18     ` Philip Kaludercic
  0 siblings, 1 reply; 25+ messages in thread
From: Paul Nelson @ 2024-05-20  9:01 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: emacs-devel, Arash Esbati

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

Hi Philip (CC: Arash, in case you have further thoughts),


>   Perhaps it should be renamed to something like "latex-numbering"?
>

Thanks for this suggestion, agreed.


>
> > tex-continuous provides a minor mode in which a tex document is compiled
> > continuously using latexmk, the error log is parsed using AUCTeX, and
> > errors are reported via flymake.
>
> That sounds interesting.  Here again, tex- implies one thing but latexmk
> another.


How about "latexmk-continuous"?  (The names latex-flymake and
auctex-latexmk are both taken, and those packages do different things.  The
new feature is that the compilation takes place continuously rather than on
demand, with the errors reported in the buffer.)


> Is the dependency on latexmk hard, or could you re-use AUCTeX's facilities?
>

AUCTeX provides TeX-command-run-all, which does something similar to
latexmk (and also runs "View" at the end, displaying the PDF, which I
suppose could be disabled somehow).  I considered swapping latexmk for
TeX-command-run-all + after-save-hook, but this seemed troublesome for a
few reasons.  One was that the timer for preview-auto (my other package,
mentioned below) doesn't fire when AUCTeX's processes are active, so if we
use AUCTeX to regularly recompile the document, then there will be
stretches of time in which the previews don't update.  The use of a
separate (latexmk) process adds something like a secondary compilation
thread, keeping the primary thread free for preview-auto.

I don't view the dependency on latexmk as serious, since I believe it is
included nowadays in all tex distributions (and I have colleagues who have
been using my package on each of the major OS's, so it seems portable in
practice).  My package does re-use AUCTeX's error parsing facilities, which
in some sense provide the heavy lifting, and also respects some AUCTeX
configuration variables, such as TeX-output-dir.  I'd be happy to update
the package to use more of AUCTeX's facilities if someone spotted a way to
do so without the issues that I encountered.



>
> > preview-auto provides a minor mode in which AUCTeX previews generate
> > automatically in the visible part of the buffer.
>
> This makes me think, have you communicated any of these features to the
> AUCTeX developers?  Perhaps it would make more sense to upstream these
> as patches instead of having too many little packages?
>
>
They've been communicated, and the first two have been discussed:

https://lists.gnu.org/archive/html/auctex-devel/2024-04/msg00043.html
https://lists.gnu.org/archive/html/auctex-devel/2024-04/msg00066.html
https://lists.gnu.org/archive/html/auctex-devel/2024-04/msg00086.html

They rely on recent AUCTeX patches:

https://lists.gnu.org/archive/html/bug-auctex/2024-04/threads.html

The question of upstreaming one of them was raised:

https://lists.gnu.org/archive/html/auctex-devel/2024-04/msg00173.html

I'd be happy with whatever makes the most sense, but figured submitting to
ELPA would make them readily available without introducing additional
burden on the AUCTeX maintainers.

On the topic of "too many little packages", I'll confess that I have a few
more in the queue, e.g.:

https://github.com/ultronozm/tex-parens.el
https://github.com/ultronozm/tex-item.el
https://github.com/ultronozm/preview-auto.el

(plus a few more, listed at https://github.com/ultronozm/emacsd, that I'd
like to think about more before "formally" publishing)

I've been trying to split the functionality accumulated in my config into
the smallest coherent packages that I can, but would welcome feedback or
other suggestions, especially if there are trade-offs with having too many
little packages.

Thanks, best,

Paul

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

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

* Re: [ELPA] some tex-related packages
  2024-05-20  9:01   ` Paul Nelson
@ 2024-05-20  9:18     ` Philip Kaludercic
  2024-05-20 17:37       ` Arash Esbati
  0 siblings, 1 reply; 25+ messages in thread
From: Philip Kaludercic @ 2024-05-20  9:18 UTC (permalink / raw)
  To: Paul Nelson; +Cc: emacs-devel, Arash Esbati

Paul Nelson <ultrono@gmail.com> writes:

> Hi Philip (CC: Arash, in case you have further thoughts),
>
>
>>   Perhaps it should be renamed to something like "latex-numbering"?
>>
>
> Thanks for this suggestion, agreed.
>
>>
>> > tex-continuous provides a minor mode in which a tex document is compiled
>> > continuously using latexmk, the error log is parsed using AUCTeX, and
>> > errors are reported via flymake.
>>
>> That sounds interesting.  Here again, tex- implies one thing but latexmk
>> another.
>
>
> How about "latexmk-continuous"?  (The names latex-flymake and
> auctex-latexmk are both taken, and those packages do different things.  The
> new feature is that the compilation takes place continuously rather than on
> demand, with the errors reported in the buffer.)

Sounds good and descriptive!

>
>> Is the dependency on latexmk hard, or could you re-use AUCTeX's facilities?
>>
>
> AUCTeX provides TeX-command-run-all, which does something similar to
> latexmk (and also runs "View" at the end, displaying the PDF, which I
> suppose could be disabled somehow).  I considered swapping latexmk for
> TeX-command-run-all + after-save-hook, but this seemed troublesome for a
> few reasons.  One was that the timer for preview-auto (my other package,
> mentioned below) doesn't fire when AUCTeX's processes are active, so if we
> use AUCTeX to regularly recompile the document, then there will be
> stretches of time in which the previews don't update.  The use of a
> separate (latexmk) process adds something like a secondary compilation
> thread, keeping the primary thread free for preview-auto.
>
> I don't view the dependency on latexmk as serious, since I believe it is
> included nowadays in all tex distributions (and I have colleagues who have
> been using my package on each of the major OS's, so it seems portable in
> practice).  My package does re-use AUCTeX's error parsing facilities, which
> in some sense provide the heavy lifting, and also respects some AUCTeX
> configuration variables, such as TeX-output-dir.  I'd be happy to update
> the package to use more of AUCTeX's facilities if someone spotted a way to
> do so without the issues that I encountered.

As it is an external package, I don't think the dependency on the
external package is an issue either (especially if the name makes it
explicit to prevent an unpleasant surprise).

>>
>> > preview-auto provides a minor mode in which AUCTeX previews generate
>> > automatically in the visible part of the buffer.
>>
>> This makes me think, have you communicated any of these features to the
>> AUCTeX developers?  Perhaps it would make more sense to upstream these
>> as patches instead of having too many little packages?
>>
>>
> They've been communicated, and the first two have been discussed:
>
> https://lists.gnu.org/archive/html/auctex-devel/2024-04/msg00043.html
> https://lists.gnu.org/archive/html/auctex-devel/2024-04/msg00066.html
> https://lists.gnu.org/archive/html/auctex-devel/2024-04/msg00086.html
>
> They rely on recent AUCTeX patches:
>
> https://lists.gnu.org/archive/html/bug-auctex/2024-04/threads.html
>
> The question of upstreaming one of them was raised:
>
> https://lists.gnu.org/archive/html/auctex-devel/2024-04/msg00173.html
>
> I'd be happy with whatever makes the most sense, but figured submitting to
> ELPA would make them readily available without introducing additional
> burden on the AUCTeX maintainers.

I'll let the AUCTeX maintainers decide.  That being said, I am sure
they'd always appreciate a helping hand in general.

> On the topic of "too many little packages", I'll confess that I have a few
> more in the queue, e.g.:
>
> https://github.com/ultronozm/tex-parens.el
> https://github.com/ultronozm/tex-item.el
> https://github.com/ultronozm/preview-auto.el
>
> (plus a few more, listed at https://github.com/ultronozm/emacsd, that I'd
> like to think about more before "formally" publishing)
>
> I've been trying to split the functionality accumulated in my config into
> the smallest coherent packages that I can, but would welcome feedback or
> other suggestions, especially if there are trade-offs with having too many
> little packages.

It might just be my view, but having too many little packages makes it
difficult for newcomers to get an overview and understand what they want
or need.  Having code under the maintainance of a group of people
usually makes it more future-proof, both by reducing the bus-factor but
also by having more time to fine polish the code.

> Thanks, best,
>
> Paul

-- 
	Philip Kaludercic on peregrine



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

* Re: [ELPA] some tex-related packages
  2024-05-20  9:18     ` Philip Kaludercic
@ 2024-05-20 17:37       ` Arash Esbati
  2024-05-22 16:10         ` Paul Nelson
  0 siblings, 1 reply; 25+ messages in thread
From: Arash Esbati @ 2024-05-20 17:37 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Paul Nelson, emacs-devel

Philip Kaludercic <philipk@posteo.net> writes:

> Paul Nelson <ultrono@gmail.com> writes:
>
>> How about "latexmk-continuous"?  (The names latex-flymake and
>> auctex-latexmk are both taken, and those packages do different things.  The
>> new feature is that the compilation takes place continuously rather than on
>> demand, with the errors reported in the buffer.)
>
> Sounds good and descriptive!

My suggestion is: For everything that depends on AUCTeX, prefix it with
auctex-, and for others which work with built-in mode as well, take tex-
as prefix.  Rationale: it makes things easier to find once you do 'M-x
list-packages RET'.

>>> This makes me think, have you communicated any of these features to the
>>> AUCTeX developers?  Perhaps it would make more sense to upstream these
>>> as patches instead of having too many little packages?
>>>
>>>
>> They've been communicated, and the first two have been discussed:

I think the agreement was to patch AUCTeX in order to provide enough
compat code so Paul's package would run smoothly.

>> I'd be happy with whatever makes the most sense, but figured submitting to
>> ELPA would make them readily available without introducing additional
>> burden on the AUCTeX maintainers.
>
> I'll let the AUCTeX maintainers decide.  That being said, I am sure
> they'd always appreciate a helping hand in general.

Disussion about upstreaming parts of Paul's code would be the next step,
I think, based on user feedback and request.  Reg. helping hands: Always
welcome, but I really wish that people take over which actually use
LaTeX/AUCTeX/RefTeX on a regular basis.  I can tell for Tassilo and
myself that we don't use LaTeX anymore, and that for many years now.

> It might just be my view, but having too many little packages makes it
> difficult for newcomers to get an overview and understand what they want
> or need.

I think that having small packages which do the job right isn't that
bad.  I wish package writers would be more in contact with AUCTeX
developers (Paul did it right), and the developers would be more
responsive to package author's requests (I tried to help as far as I
could).

Best, Arash



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

* Re: [ELPA] some tex-related packages
  2024-05-20 17:37       ` Arash Esbati
@ 2024-05-22 16:10         ` Paul Nelson
  2024-05-27 16:13           ` Arash Esbati
  0 siblings, 1 reply; 25+ messages in thread
From: Paul Nelson @ 2024-05-22 16:10 UTC (permalink / raw)
  To: Arash Esbati; +Cc: Philip Kaludercic, emacs-devel

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

>
>
> My suggestion is: For everything that depends on AUCTeX, prefix it with
> auctex-, and for others which work with built-in mode as well, take tex-
> as prefix.  Rationale: it makes things easier to find once you do 'M-x
> list-packages RET'.
>

Copy.  So maybe "auctex-numbering" (or "auctex-latex-numbering"?) and
"auctex-latexmk-continuous"?  (unless these are considered suitable for
upstreaming, in which case the point is moot)


> >> I'd be happy with whatever makes the most sense, but figured submitting
> to
> >> ELPA would make them readily available without introducing additional
> >> burden on the AUCTeX maintainers.
> >
> > I'll let the AUCTeX maintainers decide.  That being said, I am sure
> > they'd always appreciate a helping hand in general.
>
> Disussion about upstreaming parts of Paul's code would be the next step,
> I think, based on user feedback and request.


Let me know what, if anything, I should do to help with this.


> Reg. helping hands: Always
> welcome, but I really wish that people take over which actually use
> LaTeX/AUCTeX/RefTeX on a regular basis.  I can tell for Tassilo and
> myself that we don't use LaTeX anymore, and that for many years now.
>

I qualify as a long-time daily user of latex/auctex (and until fairly
recently, reftex), but am ignorant of tex more broadly.  Happy to help how
I can.


> (I tried to help as far as I could).
>
>
(Thanks again!)

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

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

* Re: [ELPA] some tex-related packages
  2024-05-22 16:10         ` Paul Nelson
@ 2024-05-27 16:13           ` Arash Esbati
  2024-05-27 19:07             ` Paul Nelson
  0 siblings, 1 reply; 25+ messages in thread
From: Arash Esbati @ 2024-05-27 16:13 UTC (permalink / raw)
  To: Paul Nelson; +Cc: Philip Kaludercic, emacs-devel

Paul Nelson <ultrono@gmail.com> writes:

> Copy.  So maybe "auctex-numbering" (or "auctex-latex-numbering"?) and
> "auctex-latexmk-continuous"?

"auctex-label-numbers" or "auctex-cont-latexmk" come to my mind. 

> (unless these are considered suitable for upstreaming, in which case
> the point is moot)

I'd like to see the functionality of

• tex-item.el
• tex-parens.el and
• tex-numbers.el

in AUCTeX.  But I'd suggest you make all your packages available via
ELPA now in order to get some feedback.  You can
remove/obsolete/whatever them once the code is merged.  I think it will
take some time to review/polish the code, e.g.:

--8<---------------cut here---------------start------------->8---
(defun tex-parens--beginning-of-defun ()
  "Move to the beginning of the current defun.
Here `defun' means top-level environment."
  (interactive)
  (re-search-backward "^\\\\begin{[^}]+}" nil t))
--8<---------------cut here---------------end--------------->8---

Why do you use an internal name for a command, or:

--8<---------------cut here---------------start------------->8---
(defun tex-numbers-update-cache (aux-file)
  "Update the cache for AUX-FILE.
Return the updated cache, or nil if the aux file does not exist."
  (when (file-exists-p aux-file)
    (with-temp-buffer
      (insert-file-contents aux-file)
      (let ((cache (make-hash-table :test 'equal))
            (pattern "\\newlabel{\\([^}]+\\)}{{\\([^}]+\\)}"))
        (save-excursion
          (goto-char (point-min))
          (while (re-search-forward pattern nil t)
            (let ((label (match-string 1))
                  (number (match-string 2)))
              (puthash label number cache))))
        (puthash 'timestamp (current-time) cache)
        (puthash aux-file cache tex-numbers-cache)
        cache))))
--8<---------------cut here---------------end--------------->8---

I think pattern should be "\\\\newlabel{\\([^}]+\\)}{{\\([^}]+\\)}"
if you want to pass it to `re-search-forward'.

But I suggest we move the discussion about "which part to upstream" to
auctex-devel.

> I qualify as a long-time daily user of latex/auctex (and until fairly
> recently, reftex), but am ignorant of tex more broadly.  Happy to help
> how I can.

I think you qualify to start hacking on AUCTeX and push it in any
direction you (and other users) think it should go :-)

> (Thanks again!)

My pleasure.

Best, Arash



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

* Re: [ELPA] some tex-related packages
  2024-05-27 16:13           ` Arash Esbati
@ 2024-05-27 19:07             ` Paul Nelson
  2024-06-02 12:51               ` Arash Esbati
  0 siblings, 1 reply; 25+ messages in thread
From: Paul Nelson @ 2024-05-27 19:07 UTC (permalink / raw)
  To: Arash Esbati; +Cc: Philip Kaludercic, emacs-devel

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

OK, many thanks.  I renamed as suggested (the links should redirect), and
will wait for Philip's instructions on the next steps re. ELPA, so as to
get more feedback.  (I've thus far incorporated feedback from colleagues,
e.g., five people on my hallway, and a few elsewhere, who have been using
some of these packages over the past year or so.)

I'll respond to the specific issues you noted here, saving further
discussion re. AUCTeX for auctex-devel:

--8<---------------cut here---------------start------------->8---
> (defun tex-parens--beginning-of-defun ()
>   "Move to the beginning of the current defun.
> Here `defun' means top-level environment."
>   (interactive)
>   (re-search-backward "^\\\\begin{[^}]+}" nil t))
> --8<---------------cut here---------------end--------------->8---
>
> Why do you use an internal name for a command
>

The idea was that this function would be used only in the setup function,
like so: (setq-local beginning-of-defun-function
#'tex-parens--beginning-of-defun).  I guess I didn't need to make it
(interactive).  I've removed the (interactive) for now, but could just as
well keep it and give the command an external name.


>
> --8<---------------cut here---------------start------------->8---
> (defun tex-numbers-update-cache (aux-file)
>   "Update the cache for AUX-FILE.
> Return the updated cache, or nil if the aux file does not exist."
>   (when (file-exists-p aux-file)
>     (with-temp-buffer
>       (insert-file-contents aux-file)
>       (let ((cache (make-hash-table :test 'equal))
>             (pattern "\\newlabel{\\([^}]+\\)}{{\\([^}]+\\)}"))
>         (save-excursion
>           (goto-char (point-min))
>           (while (re-search-forward pattern nil t)
>             (let ((label (match-string 1))
>                   (number (match-string 2)))
>               (puthash label number cache))))
>         (puthash 'timestamp (current-time) cache)
>         (puthash aux-file cache tex-numbers-cache)
>         cache))))
> --8<---------------cut here---------------end--------------->8---
>
> I think pattern should be "\\\\newlabel{\\([^}]+\\)}{{\\([^}]+\\)}"
> if you want to pass it to `re-search-forward'.
>

Thanks.  (I had failed to notice this error because, by luck, it worked
anyway: the regexp "\\n" matches "n".)

Paul

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

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

* Re: [ELPA] some tex-related packages
  2024-05-27 19:07             ` Paul Nelson
@ 2024-06-02 12:51               ` Arash Esbati
  2024-06-02 18:44                 ` Philip Kaludercic
  0 siblings, 1 reply; 25+ messages in thread
From: Arash Esbati @ 2024-06-02 12:51 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Paul Nelson, emacs-devel

Paul Nelson <ultrono@gmail.com> writes:

> OK, many thanks.  I renamed as suggested (the links should redirect),
> and will wait for Philip's instructions on the next steps re. ELPA, so
> as to get more feedback.

Philip, can you please have a look at Paul's request and get the process
rolling?  TIA.

Best, Arash



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

* Re: [ELPA] some tex-related packages
  2024-06-02 12:51               ` Arash Esbati
@ 2024-06-02 18:44                 ` Philip Kaludercic
  2024-06-02 19:11                   ` Paul Nelson
  0 siblings, 1 reply; 25+ messages in thread
From: Philip Kaludercic @ 2024-06-02 18:44 UTC (permalink / raw)
  To: Arash Esbati; +Cc: Paul Nelson, emacs-devel

Arash Esbati <arash@gnu.org> writes:

> Paul Nelson <ultrono@gmail.com> writes:
>
>> OK, many thanks.  I renamed as suggested (the links should redirect),
>> and will wait for Philip's instructions on the next steps re. ELPA, so
>> as to get more feedback.
>
> Philip, can you please have a look at Paul's request and get the process
> rolling?  TIA.

My backlog has been increasing to an uncomfortable degree, and I am
afraid I don't have an overview of the packages that are currently being
discussed.  Could someone (I presume Paul) just provide me the URLs to
the Git repositories, so I can take a look and add them to elpa.git?
Sorry for the inconvenience and the slowdown.

> Best, Arash

-- 
	Philip Kaludercic on peregrine



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

* Re: [ELPA] some tex-related packages
  2024-06-02 18:44                 ` Philip Kaludercic
@ 2024-06-02 19:11                   ` Paul Nelson
  2024-06-02 19:53                     ` Philip Kaludercic
  0 siblings, 1 reply; 25+ messages in thread
From: Paul Nelson @ 2024-06-02 19:11 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Arash Esbati, emacs-devel

> > Philip, can you please have a look at Paul's request and get the process
> > rolling?  TIA.
>
> My backlog has been increasing to an uncomfortable degree, and I am
> afraid I don't have an overview of the packages that are currently being
> discussed.  Could someone (I presume Paul) just provide me the URLs to
> the Git repositories, so I can take a look and add them to elpa.git?
> Sorry for the inconvenience and the slowdown.

https://github.com/ultronozm/auctex-label-numbers.el
https://github.com/ultronozm/auctex-cont-latexmk.el
https://github.com/ultronozm/preview-auto.el
https://github.com/ultronozm/tex-parens.el
https://github.com/ultronozm/tex-item.el
https://github.com/ultronozm/preview-tailor.el

Please don't hesitate to let me know if there's anything I can do to help.

Thanks, best,

Paul



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

* Re: [ELPA] some tex-related packages
  2024-06-02 19:11                   ` Paul Nelson
@ 2024-06-02 19:53                     ` Philip Kaludercic
  2024-06-02 20:03                       ` Paul Nelson
  0 siblings, 1 reply; 25+ messages in thread
From: Philip Kaludercic @ 2024-06-02 19:53 UTC (permalink / raw)
  To: Paul Nelson; +Cc: Arash Esbati, emacs-devel

Paul Nelson <ultrono@gmail.com> writes:

>> > Philip, can you please have a look at Paul's request and get the process
>> > rolling?  TIA.
>>
>> My backlog has been increasing to an uncomfortable degree, and I am
>> afraid I don't have an overview of the packages that are currently being
>> discussed.  Could someone (I presume Paul) just provide me the URLs to
>> the Git repositories, so I can take a look and add them to elpa.git?
>> Sorry for the inconvenience and the slowdown.
>
> https://github.com/ultronozm/auctex-label-numbers.el
> https://github.com/ultronozm/auctex-cont-latexmk.el
> https://github.com/ultronozm/preview-auto.el
> https://github.com/ultronozm/tex-parens.el
> https://github.com/ultronozm/tex-item.el
> https://github.com/ultronozm/preview-tailor.el

Thanks.

> Please don't hesitate to let me know if there's anything I can do to help.

Can you just confirm that you are proposing for these packages to be
added to GNU ELPA?

> Thanks, best,
>
> Paul

-- 
	Philip Kaludercic on peregrine



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

* Re: [ELPA] some tex-related packages
  2024-06-02 19:53                     ` Philip Kaludercic
@ 2024-06-02 20:03                       ` Paul Nelson
  2024-06-16 16:20                         ` Paul Nelson
  0 siblings, 1 reply; 25+ messages in thread
From: Paul Nelson @ 2024-06-02 20:03 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Arash Esbati, emacs-devel

> Can you just confirm that you are proposing for these packages to be
> added to GNU ELPA?
>

Yes



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

* Re: [ELPA] some tex-related packages
  2024-06-02 20:03                       ` Paul Nelson
@ 2024-06-16 16:20                         ` Paul Nelson
  2024-06-17 10:45                           ` Philip Kaludercic
  0 siblings, 1 reply; 25+ messages in thread
From: Paul Nelson @ 2024-06-16 16:20 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Arash Esbati, emacs-devel

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

Hi Philip, just thought I’d check in on this and offer again to help
however I can. Thanks, best,  Paul

On Sun, 2 Jun 2024 at 13:03, Paul Nelson <ultrono@gmail.com> wrote:

> > Can you just confirm that you are proposing for these packages to be
> > added to GNU ELPA?
> >
>
> Yes
>

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

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

* Re: [ELPA] some tex-related packages
  2024-06-16 16:20                         ` Paul Nelson
@ 2024-06-17 10:45                           ` Philip Kaludercic
  2024-06-17 10:52                             ` Philip Kaludercic
  0 siblings, 1 reply; 25+ messages in thread
From: Philip Kaludercic @ 2024-06-17 10:45 UTC (permalink / raw)
  To: Paul Nelson; +Cc: Arash Esbati, emacs-devel

Paul Nelson <ultrono@gmail.com> writes:

> Hi Philip, just thought I’d check in on this and offer again to help
> however I can. Thanks, best,  Paul

Sorry, the message got buried in my inbox.  I'll all the packages now,
but it remains too much to review for me now.  I hope to return back to
that at some point.

> On Sun, 2 Jun 2024 at 13:03, Paul Nelson <ultrono@gmail.com> wrote:
>
>> > Can you just confirm that you are proposing for these packages to be
>> > added to GNU ELPA?
>> >
>>
>> Yes
>>

-- 
	Philip Kaludercic on peregrine



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

* Re: [ELPA] some tex-related packages
  2024-06-17 10:45                           ` Philip Kaludercic
@ 2024-06-17 10:52                             ` Philip Kaludercic
  2024-06-18  0:53                               ` Paul Nelson
  0 siblings, 1 reply; 25+ messages in thread
From: Philip Kaludercic @ 2024-06-17 10:52 UTC (permalink / raw)
  To: Paul Nelson; +Cc: Arash Esbati, emacs-devel

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

Philip Kaludercic <philipk@posteo.net> writes:

> Paul Nelson <ultrono@gmail.com> writes:
>
>> Hi Philip, just thought I’d check in on this and offer again to help
>> however I can. Thanks, best,  Paul
>
> Sorry, the message got buried in my inbox.  I'll all the packages now,
> but it remains too much to review for me now.  I hope to return back to
> that at some point.

Worse still, I have actually added the packages already by accident!  It
seems I was inattentive when updating cobol-mode[0], my apologies...
But the reason your packages haven't appeared on the archive yet is that
the copyright line doesn't list the "Free Software Foundation, Inc.",
which all packages on ELPA must do.  So just apply a patch like this to
your packages, and make sure to bump the version tag while you are at
it:


[-- Attachment #2: Type: text/plain, Size: 462 bytes --]

diff --git a/auctex-cont-latexmk.el b/auctex-cont-latexmk.el
index 37b4bcc475..58d0860aa0 100644
--- a/auctex-cont-latexmk.el
+++ b/auctex-cont-latexmk.el
@@ -1,6 +1,6 @@
 ;;; auctex-cont-latexmk.el --- run latexmk continuously, report errors via Flymake  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2023  Paul D. Nelson
+;; Copyright (C) 2023, 2024  Free Software Foundation, Inc.
 
 ;; Author: Paul D. Nelson <nelson.paul.david@gmail.com>
 ;; Version: 0.1

[-- Attachment #3: Type: text/plain, Size: 340 bytes --]


[0] https://git.savannah.gnu.org/cgit/emacs/elpa.git/commit/?id=8e73eaf44e0ae1ac6f5cded4033cb5e312b38604

>> On Sun, 2 Jun 2024 at 13:03, Paul Nelson <ultrono@gmail.com> wrote:
>>
>>> > Can you just confirm that you are proposing for these packages to be
>>> > added to GNU ELPA?
>>> >
>>>
>>> Yes
>>>

-- 
	Philip Kaludercic on peregrine

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

* Re: [ELPA] some tex-related packages
  2024-06-17 10:52                             ` Philip Kaludercic
@ 2024-06-18  0:53                               ` Paul Nelson
  2024-06-18  6:38                                 ` Philip Kaludercic
  0 siblings, 1 reply; 25+ messages in thread
From: Paul Nelson @ 2024-06-18  0:53 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Arash Esbati, emacs-devel

Hi Philip,

OK, thanks.  I adjusted the copyrights as suggested, and bumped the
version numbers -- I don't see the packages listed yet, but assume
this will happen automatically after some time.

Sorry to hear again about the backlog.  Whenever you get the chance,
I'd very much welcome any feedback, even on just one or two of the
packages, since I'm sure I'd learn something from it.

Thanks, best,

Paul



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

* Re: [ELPA] some tex-related packages
  2024-06-18  0:53                               ` Paul Nelson
@ 2024-06-18  6:38                                 ` Philip Kaludercic
  2024-06-26  5:59                                   ` Paul Nelson
  2024-10-12 15:30                                   ` Paul Nelson
  0 siblings, 2 replies; 25+ messages in thread
From: Philip Kaludercic @ 2024-06-18  6:38 UTC (permalink / raw)
  To: Paul Nelson; +Cc: Arash Esbati, emacs-devel

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

Paul Nelson <ultrono@gmail.com> writes:

> Hi Philip,
>
> OK, thanks.  I adjusted the copyrights as suggested, and bumped the
> version numbers -- I don't see the packages listed yet, but assume
> this will happen automatically after some time.

Right, a cron job synchronises the repositories on a regular basis, and
should pick up your commit soon enough.

> Sorry to hear again about the backlog.  Whenever you get the chance,
> I'd very much welcome any feedback, even on just one or two of the
> packages, since I'm sure I'd learn something from it.

I've taken a look at one package, and am adding the comments to this
message, and hope to do the same for the others, step by step:


[-- Attachment #2: Type: text/plain, Size: 9007 bytes --]

diff --git a/auctex-cont-latexmk.el b/auctex-cont-latexmk.el
index 442972475d..9bdcf465c7 100644
--- a/auctex-cont-latexmk.el
+++ b/auctex-cont-latexmk.el
@@ -63,10 +63,7 @@
   (let ((error-alist
          (append TeX-error-description-list
                  TeX-error-description-list-local)))
-    (catch 'found
-      (dolist (error error-alist)
-        (when (string-match (car error) message)
-          (throw 'found (cdr error)))))))
+    (alist-get message error-alist nil nil #'string-match-p)))
 
 (defun auctex-cont-latexmk-help-at-point ()
   "Display the AUCTeX help for the error at point."
@@ -81,48 +78,47 @@ The arguments are as in `TeX-error-list'.  Return either nil or a
 triple (ERROR-P DESCRIPTION (BEG . END)), where ERROR-P is non-nil if it
 is an error rather than a warning."
   (or
-   (and
-    (not ignore)
-    (stringp file)
-    (or (not bad-box) TeX-debug-bad-boxes)
-    (when-let
-        ((region
-          (save-restriction
-            (widen)
-            (cond
-             ((file-equal-p
-               file
-               (or buffer-file-name (buffer-file-name (buffer-base-buffer))))
-              (when line
-                (if (eq type 'error)
+   (and-let*
+       (((not ignore))
+        ((stringp file))
+        ((or (not bad-box) TeX-debug-bad-boxes))
+        (region
+         (save-restriction
+           (widen)
+           (cond
+            ((file-equal-p
+              file
+              (or buffer-file-name (buffer-file-name (buffer-base-buffer))))
+             (when line
+               (if (eq type 'error)
+                   (save-excursion
+                     (goto-char (point-min))
+                     (forward-line (+ line offset -1))
+                     (unless (string= search-string " ")
+                       (search-forward search-string nil t)
+                       (cons (point) (1+ (point)))))
+                 (flymake-diag-region (current-buffer) (+ line offset)))))
+            ((file-equal-p file (TeX-master-output-file "aux"))
+             (and auctex-cont-latexmk-report-multiple-labels
+                  (string-match-p "multiply defined" message)
+                  (not (eq type 'error))
+                  (let* ((label (progn
+                                  (string-match "`\\(.*\\)'" message)
+                                  (match-string 1 message)))
+                         (label-re
+                          (concat "\\\\label\\(?:\\[[^]]+\\]\\)?{"
+                                  (regexp-quote label) "}")))
                     (save-excursion
                       (goto-char (point-min))
-                      (forward-line (+ line offset -1))
-                      (unless (string= search-string " ")
-                        (search-forward search-string nil t)
-                        (cons (point) (1+ (point)))))
-                  (flymake-diag-region (current-buffer) (+ line offset)))))
-             ((file-equal-p file (TeX-master-output-file "aux"))
-              (and auctex-cont-latexmk-report-multiple-labels
-                   (string-match-p "multiply defined" message)
-                   (not (eq type 'error))
-                   (let* ((label (progn
-                                   (string-match "`\\(.*\\)'" message)
-                                   (match-string 1 message)))
-                          (label-re
-                           (concat "\\\\label\\(?:\\[[^]]+\\]\\)?{"
-                                   (regexp-quote label) "}")))
-                     (save-excursion
-                       (goto-char (point-min))
-                       (when (re-search-forward label-re nil t)
-                         ;; Return the full line so the diagnostic is
-                         ;; not covered by preview overlays when
-                         ;; \\label appears after \\begin{equation}.
-                         (cons (line-beginning-position)
-                               (line-end-position)))))))))))
-      (list (eq type 'error)
-            (replace-regexp-in-string "\n" "" message)
-            region)))
+                      (when (re-search-forward label-re nil t)
+                        ;; Return the full line so the diagnostic is
+                        ;; not covered by preview overlays when
+                        ;; \\label appears after \\begin{equation}.
+                        (cons (line-beginning-position)
+                              (line-end-position)))))))))))
+     (list (eq type 'error)
+           (replace-regexp-in-string "\n" "" message)
+           region))
    ;; Put errors without file or line at bottom of buffer.
    (when (eq type 'error)
      (list t
@@ -133,9 +129,11 @@ is an error rather than a warning."
   "Format the current log buffer by joining lines suitably.
 Adapted from `TeX-format-filter'."
   (goto-char (point-max))
-  (while (> (point) (point-min))
+  (while (not (bobp))
     (end-of-line 0)
-    (when (and (memq (- (point) (line-beginning-position)) '(79 80))
+    (when (and (<= 79 (current-column) 80)
+               ;; I was imagining if this could be replaced by a clever regular expression like
+               ;; (not (looking-back (rx "." point (syntax word)) (line-beginning-position)))
                (not (memq (char-after (1+ (point))) '(?\n ?\()))
                (not (and (eq (char-before) ?.)
                          (char-after (1+ (point)))
@@ -155,10 +153,11 @@ Adapted from `TeX-format-filter'."
   "Process log file for current LaTeX document.
 Return a list of triples as in the docstring of
 `auctex-cont-latexmk-process-item'."
-  (delq nil
-        (mapcar (lambda (item)
-                  (apply #'auctex-cont-latexmk-process-item item))
-                (auctex-cont-latexmk--error-list (TeX-master-output-file "log")))))
+  (mapcan
+   (lambda (item)
+     (and-let* ((item (apply #'auctex-cont-latexmk-process-item item)))
+       (list item)))
+   (auctex-cont-latexmk--error-list (TeX-master-output-file "log"))))
 
 (defvar-local auctex-cont-latexmk--report-fn nil
   "Function provided by Flymake for reporting diagnostics.")
@@ -204,7 +203,7 @@ Flymake report function to propagate to indirect buffers."
 ;;; Continuous Compilation
 
 (defcustom auctex-cont-latexmk-command
-  '("latexmk -pvc -shell-escape -pdf -view=none -e "
+  '("latexmk -pvc -shell-escape -pdf -view=none -e " ;is it safe to have "shell-escape" in by default?
     ("$pdflatex=q/pdflatex %O -synctex=1 -interaction=nonstopmode %S/"))
   "Command to compile LaTeX documents.
 This is a list consisting of strings or lists of strings.  It is
@@ -218,6 +217,10 @@ file."
 (defun auctex-cont-latexmk--compilation-command ()
   "Return the command used to compile the current LaTeX document."
   (let ((quote
+         ;; I am surprised to see that this is necessary, but I don't
+         ;; know the background.  does `shell-quote-argument' quote
+         ;; incorrectly?  A comment explaining what is going on would
+         ;; be nice.
          (if (memq system-type '(ms-dos windows-nt))
              "\""
            "'")))
@@ -267,11 +270,9 @@ either in a watching state or has not updated recently."
      (when-let ((buf auctex-cont-latexmk--compilation-buffer))
        (with-current-buffer buf
          (or
-          (progn
-            (goto-char (point-max))
-            (forward-line -1)
-            (equal (buffer-substring (point) (line-end-position))
-                   auctex-cont-latexmk--watching-str))
+          (search-forward-regexp
+           (rx (literal auctex-cont-latexmk--watching-str) (? ?\n) eos)
+           nil t)
           (and (or
                 auctex-cont-latexmk--last-update-time
                 (time-less-p (time-subtract (current-time)
@@ -314,7 +315,7 @@ empty, except when NOKILL is non-nil."
         (let ((process (get-buffer-process comp-buf)))
           (when (process-live-p process)
             (interrupt-process process)
-            (sit-for 0.1)
+            (sit-for 0.1)               ;isn't this racy?  or is that not a problem?
             (delete-process process))
           (unless nokill
             (kill-buffer comp-buf)))))))
@@ -390,7 +391,7 @@ Saved and restored by `auctex-cont-latexmk-toggle'.")
 (defcustom auctex-cont-latexmk-retained-flymake-backends
   '(eglot-flymake-backend)
   "Flymake backends to retain when enabling `auctex-cont-latexmk-mode'."
-  :type 'boolean)
+  :type 'boolean)                       ;I don't think the type is right
 
 (defun auctex-cont-latexmk-turn-on ()
   "Enable `auctex-cont-latexmk-mode' and set up Flymake."
@@ -425,7 +426,7 @@ Saved and restored by `auctex-cont-latexmk-toggle'.")
 (defun auctex-cont-latexmk-toggle ()
   "Toggle `auctex-cont-latexmk-mode' and its Flymake backend."
   (interactive)
-  (cond (auctex-cont-latexmk-mode
+  (cond (auctex-cont-latexmk-mode       ;isn't this more of a `if'-place?
          (auctex-cont-latexmk-turn-off))
         (t
          (auctex-cont-latexmk-turn-on))))

[-- Attachment #3: Type: text/plain, Size: 63 bytes --]


> Thanks, best,
>
> Paul

-- 
	Philip Kaludercic on peregrine

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

* Re: [ELPA] some tex-related packages
  2024-06-18  6:38                                 ` Philip Kaludercic
@ 2024-06-26  5:59                                   ` Paul Nelson
  2024-10-12 15:30                                   ` Paul Nelson
  1 sibling, 0 replies; 25+ messages in thread
From: Paul Nelson @ 2024-06-26  5:59 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Arash Esbati, emacs-devel

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

Hi Philip,

Many thanks for this feedback, which I've incorporated (except that
I've shied away from trying to optimize the function
auctex-cont-latexmk--format-log-buffer, whose code is taken from an
AUCTeX function that has proven reliable over the decades). The
updated code is available at
https://github.com/ultronozm/auctex-cont-latexmk.el.  I copy below the
patch that I've applied on top of your patch (attaching as well, just
in case gmail messes up the formatting).  Any further comments or
feedback on this or the other packages would of course be very
helpful.

Paul

diff --git a/auctex-cont-latexmk.el b/auctex-cont-latexmk.el
index 6019767..29be6b0 100644
--- a/auctex-cont-latexmk.el
+++ b/auctex-cont-latexmk.el
@@ -64,6 +64,7 @@
          (append TeX-error-description-list
                  TeX-error-description-list-local)))
     (alist-get message error-alist nil nil #'string-match-p)))
+
 (defun auctex-cont-latexmk-help-at-point ()
   "Display the AUCTeX help for the error at point."
   (interactive)
@@ -77,7 +78,7 @@ The arguments are as in `TeX-error-list'.  Return
either nil or a
 triple (ERROR-P DESCRIPTION (BEG . END)), where ERROR-P is non-nil if it
 is an error rather than a warning."
   (or
-   (and-let*
+   (when-let*
        (((not ignore))
         ((stringp file))
         ((or (not bad-box) TeX-debug-bad-boxes))
@@ -131,8 +132,6 @@ Adapted from `TeX-format-filter'."
   (while (not (bobp))
     (end-of-line 0)
     (when (and (<= 79 (current-column) 80)
-               ;; I was imagining if this could be replaced by a
clever regular expression like
-               ;; (not (looking-back (rx "." point (syntax word))
(line-beginning-position)))
                (not (memq (char-after (1+ (point))) '(?\n ?\()))
                (not (and (eq (char-before) ?.)
                          (char-after (1+ (point)))
@@ -153,12 +152,14 @@ Adapted from `TeX-format-filter'."
 Return a list of triples as in the docstring of
 `auctex-cont-latexmk-process-item'."
   (mapcan
-   (lambda (item)
-     (and-let* ((item (apply #'auctex-cont-latexmk-process-item item)))
+   (lambda (err)
+     (when-let ((item (apply #'auctex-cont-latexmk-process-item err)))
        (list item)))
    (auctex-cont-latexmk--error-list (TeX-master-output-file "log"))))
+
 (defvar-local auctex-cont-latexmk--report-fn nil
   "Function provided by Flymake for reporting diagnostics.")
+
 (defvar-local auctex-cont-latexmk-force-enable nil
   "Whether to enable the Flymake backend unconditionally.
 This is non-nil if we should enable the Flymake backend independent of
@@ -198,38 +199,37 @@ Flymake report function to propagate to indirect buffers."
   (setq auctex-cont-latexmk--report-fn nil))

 ;;; Continuous Compilation
+
 (defcustom auctex-cont-latexmk-command
-  '("latexmk -pvc -shell-escape -pdf -view=none -e " ;is it safe to
have "shell-escape" in by default?
+  '("latexmk -pvc -pdf -view=none -e "
     ("$pdflatex=q/pdflatex %O -synctex=1 -interaction=nonstopmode %S/"))
   "Command to compile LaTeX documents.
 This is a list consisting of strings or lists of strings.  It is
-compiled to a single string by concatenating the strings and quoting the
-lists, using system-specific quotes.  To produce the compilation
-command, it is combined with an additional option to output build files
-to a directory (if `TeX-output-dir' is set) and the name of the master
-file."
+compiled to a single string by
+
+ - concatenating the strings, and
+
+ - concatenating the contents of each list and quoting the result as a
+shell argument.
+
+To produce the compilation command, the result is combined with an
+additional option to output build files to a directory (if
+`TeX-output-dir' is set) and the name of the master file."
   :type '(repeat (choice string (repeat string))))

 (defun auctex-cont-latexmk--compilation-command ()
   "Return the command used to compile the current LaTeX document."
-  (let ((quote
-         ;; I am surprised to see that this is necessary, but I don't
-         ;; know the background.  does `shell-quote-argument' quote
-         ;; incorrectly?  A comment explaining what is going on would
-         ;; be nice.
-         (if (memq system-type '(ms-dos windows-nt))
-             "\""
-           "'")))
-    (concat
-     (mapconcat (lambda (item)
-                  (if (listp item)
-                      (concat quote (mapconcat #'identity item) quote)
-                    item))
-                auctex-cont-latexmk-command)
-     (when TeX-output-dir
-       (concat " -outdir=" (shell-quote-argument TeX-output-dir)))
-     " "
-     (shell-quote-argument (TeX-master-file "tex")))))
+  (concat
+   (mapconcat
+    (lambda (item)
+      (if (listp item)
+          (shell-quote-argument (mapconcat #'identity item))
+        item))
+    auctex-cont-latexmk-command)
+   (when TeX-output-dir
+     (concat " -outdir=" (shell-quote-argument TeX-output-dir)))
+   " "
+   (shell-quote-argument (TeX-master-file "tex"))))

 (defun auctex-cont-latexmk--compilation-buffer-name ()
   "Return the name of the buffer used for LaTeX compilation."
@@ -258,7 +258,13 @@ file."
 This is the case if the current buffer is not modified, the current
 buffer is a file, the current buffer has a log file, the log file is
 newer than the current buffer, and the current latexmk compilation is
-either in a watching state or has not updated recently."
+either in a watching state or has not updated recently.
+
+The reason we check if the latexmk has not been updated recently is
+because it seems that on Windows, the latexmk script doesn't always
+display the most recent message.  I haven't been able to debug why this
+is the case.  Checking that the compilation has not been updated
+recently serves as a workaround."
   (when-let* ((file
                (or buffer-file-name (buffer-file-name (buffer-base-buffer))))
               (log-file (TeX-master-output-file "log")))
@@ -266,9 +272,12 @@ either in a watching state or has not updated recently."
      (when-let ((buf auctex-cont-latexmk--compilation-buffer))
        (with-current-buffer buf
          (or
-          (search-forward-regexp
-           (rx (literal auctex-cont-latexmk--watching-str) (? ?\n) eos)
-           nil t)
+          (progn
+            (goto-char (point-max))
+            (forward-line -1)
+            (re-search-forward
+             (rx (literal auctex-cont-latexmk--watching-str) (? ?\n) eos)
+             nil t))
           (and (or
                 auctex-cont-latexmk--last-update-time
                 (time-less-p (time-subtract (current-time)
@@ -308,12 +317,8 @@ empty, except when NOKILL is non-nil."
         (when (null auctex-cont-latexmk--subscribed-buffers)
           (setq done t)))
       (when done
-        (let ((process (get-buffer-process comp-buf)))
-          (when (process-live-p process)
-            (interrupt-process process)
-            (sit-for 0.1)               ;isn't this racy?  or is that
not a problem?
-            (delete-process process))
-          (unless nokill
+        (unless nokill
+          (let ((kill-buffer-query-functions nil)) ; don't ask to kill process
             (kill-buffer comp-buf)))))))

 (defvar-local auctex-cont-latexmk--disable-function nil
@@ -387,8 +392,9 @@ Saved and restored by `auctex-cont-latexmk-toggle'.")
 (defcustom auctex-cont-latexmk-retained-flymake-backends
   '(eglot-flymake-backend)
   "Flymake backends to retain when enabling `auctex-cont-latexmk-mode'."
-  :type 'boolean)                       ;I don't think the type is right
- (defun auctex-cont-latexmk-turn-on ()
+  :type '(repeat symbol))
+
+(defun auctex-cont-latexmk-turn-on ()
   "Enable `auctex-cont-latexmk-mode' and set up Flymake."
   (interactive)
   (auctex-cont-latexmk-mode 1)
@@ -421,10 +427,9 @@ Saved and restored by `auctex-cont-latexmk-toggle'.")
 (defun auctex-cont-latexmk-toggle ()
   "Toggle `auctex-cont-latexmk-mode' and its Flymake backend."
   (interactive)
-  (cond (auctex-cont-latexmk-mode       ;isn't this more of a `if'-place?
-         (auctex-cont-latexmk-turn-off))
-        (t
-         (auctex-cont-latexmk-turn-on))))
+  (if auctex-cont-latexmk-mode
+      (auctex-cont-latexmk-turn-off)
+    (auctex-cont-latexmk-turn-on)))

 (provide 'auctex-cont-latexmk)
 ;;; auctex-cont-latexmk.el ends here

[-- Attachment #2: test.patch --]
[-- Type: application/octet-stream, Size: 7753 bytes --]

diff --git a/auctex-cont-latexmk.el b/auctex-cont-latexmk.el
index 6019767..29be6b0 100644
--- a/auctex-cont-latexmk.el
+++ b/auctex-cont-latexmk.el
@@ -64,6 +64,7 @@
          (append TeX-error-description-list
                  TeX-error-description-list-local)))
     (alist-get message error-alist nil nil #'string-match-p)))
+
 (defun auctex-cont-latexmk-help-at-point ()
   "Display the AUCTeX help for the error at point."
   (interactive)
@@ -77,7 +78,7 @@ The arguments are as in `TeX-error-list'.  Return either nil or a
 triple (ERROR-P DESCRIPTION (BEG . END)), where ERROR-P is non-nil if it
 is an error rather than a warning."
   (or
-   (and-let*
+   (when-let*
        (((not ignore))
         ((stringp file))
         ((or (not bad-box) TeX-debug-bad-boxes))
@@ -131,8 +132,6 @@ Adapted from `TeX-format-filter'."
   (while (not (bobp))
     (end-of-line 0)
     (when (and (<= 79 (current-column) 80)
-               ;; I was imagining if this could be replaced by a clever regular expression like
-               ;; (not (looking-back (rx "." point (syntax word)) (line-beginning-position)))
                (not (memq (char-after (1+ (point))) '(?\n ?\()))
                (not (and (eq (char-before) ?.)
                          (char-after (1+ (point)))
@@ -153,12 +152,14 @@ Adapted from `TeX-format-filter'."
 Return a list of triples as in the docstring of
 `auctex-cont-latexmk-process-item'."
   (mapcan
-   (lambda (item)
-     (and-let* ((item (apply #'auctex-cont-latexmk-process-item item)))
+   (lambda (err)
+     (when-let ((item (apply #'auctex-cont-latexmk-process-item err)))
        (list item)))
    (auctex-cont-latexmk--error-list (TeX-master-output-file "log"))))
+
 (defvar-local auctex-cont-latexmk--report-fn nil
   "Function provided by Flymake for reporting diagnostics.")
+
 (defvar-local auctex-cont-latexmk-force-enable nil
   "Whether to enable the Flymake backend unconditionally.
 This is non-nil if we should enable the Flymake backend independent of
@@ -198,38 +199,37 @@ Flymake report function to propagate to indirect buffers."
   (setq auctex-cont-latexmk--report-fn nil))
 
 ;;; Continuous Compilation
+
 (defcustom auctex-cont-latexmk-command
-  '("latexmk -pvc -shell-escape -pdf -view=none -e " ;is it safe to have "shell-escape" in by default?
+  '("latexmk -pvc -pdf -view=none -e "
     ("$pdflatex=q/pdflatex %O -synctex=1 -interaction=nonstopmode %S/"))
   "Command to compile LaTeX documents.
 This is a list consisting of strings or lists of strings.  It is
-compiled to a single string by concatenating the strings and quoting the
-lists, using system-specific quotes.  To produce the compilation
-command, it is combined with an additional option to output build files
-to a directory (if `TeX-output-dir' is set) and the name of the master
-file."
+compiled to a single string by
+
+ - concatenating the strings, and
+
+ - concatenating the contents of each list and quoting the result as a
+shell argument.
+
+To produce the compilation command, the result is combined with an
+additional option to output build files to a directory (if
+`TeX-output-dir' is set) and the name of the master file."
   :type '(repeat (choice string (repeat string))))
 
 (defun auctex-cont-latexmk--compilation-command ()
   "Return the command used to compile the current LaTeX document."
-  (let ((quote
-         ;; I am surprised to see that this is necessary, but I don't
-         ;; know the background.  does `shell-quote-argument' quote
-         ;; incorrectly?  A comment explaining what is going on would
-         ;; be nice.
-         (if (memq system-type '(ms-dos windows-nt))
-             "\""
-           "'")))
-    (concat
-     (mapconcat (lambda (item)
-                  (if (listp item)
-                      (concat quote (mapconcat #'identity item) quote)
-                    item))
-                auctex-cont-latexmk-command)
-     (when TeX-output-dir
-       (concat " -outdir=" (shell-quote-argument TeX-output-dir)))
-     " "
-     (shell-quote-argument (TeX-master-file "tex")))))
+  (concat
+   (mapconcat
+    (lambda (item)
+      (if (listp item)
+          (shell-quote-argument (mapconcat #'identity item))
+        item))
+    auctex-cont-latexmk-command)
+   (when TeX-output-dir
+     (concat " -outdir=" (shell-quote-argument TeX-output-dir)))
+   " "
+   (shell-quote-argument (TeX-master-file "tex"))))
 
 (defun auctex-cont-latexmk--compilation-buffer-name ()
   "Return the name of the buffer used for LaTeX compilation."
@@ -258,7 +258,13 @@ file."
 This is the case if the current buffer is not modified, the current
 buffer is a file, the current buffer has a log file, the log file is
 newer than the current buffer, and the current latexmk compilation is
-either in a watching state or has not updated recently."
+either in a watching state or has not updated recently.
+
+The reason we check if the latexmk has not been updated recently is
+because it seems that on Windows, the latexmk script doesn't always
+display the most recent message.  I haven't been able to debug why this
+is the case.  Checking that the compilation has not been updated
+recently serves as a workaround."
   (when-let* ((file
                (or buffer-file-name (buffer-file-name (buffer-base-buffer))))
               (log-file (TeX-master-output-file "log")))
@@ -266,9 +272,12 @@ either in a watching state or has not updated recently."
      (when-let ((buf auctex-cont-latexmk--compilation-buffer))
        (with-current-buffer buf
          (or
-          (search-forward-regexp
-           (rx (literal auctex-cont-latexmk--watching-str) (? ?\n) eos)
-           nil t)
+          (progn
+            (goto-char (point-max))
+            (forward-line -1)
+            (re-search-forward
+             (rx (literal auctex-cont-latexmk--watching-str) (? ?\n) eos)
+             nil t))
           (and (or
                 auctex-cont-latexmk--last-update-time
                 (time-less-p (time-subtract (current-time)
@@ -308,12 +317,8 @@ empty, except when NOKILL is non-nil."
         (when (null auctex-cont-latexmk--subscribed-buffers)
           (setq done t)))
       (when done
-        (let ((process (get-buffer-process comp-buf)))
-          (when (process-live-p process)
-            (interrupt-process process)
-            (sit-for 0.1)               ;isn't this racy?  or is that not a problem?
-            (delete-process process))
-          (unless nokill
+        (unless nokill
+          (let ((kill-buffer-query-functions nil)) ; don't ask to kill process
             (kill-buffer comp-buf)))))))
 
 (defvar-local auctex-cont-latexmk--disable-function nil
@@ -387,8 +392,9 @@ Saved and restored by `auctex-cont-latexmk-toggle'.")
 (defcustom auctex-cont-latexmk-retained-flymake-backends
   '(eglot-flymake-backend)
   "Flymake backends to retain when enabling `auctex-cont-latexmk-mode'."
-  :type 'boolean)                       ;I don't think the type is right
- (defun auctex-cont-latexmk-turn-on ()
+  :type '(repeat symbol))
+
+(defun auctex-cont-latexmk-turn-on ()
   "Enable `auctex-cont-latexmk-mode' and set up Flymake."
   (interactive)
   (auctex-cont-latexmk-mode 1)
@@ -421,10 +427,9 @@ Saved and restored by `auctex-cont-latexmk-toggle'.")
 (defun auctex-cont-latexmk-toggle ()
   "Toggle `auctex-cont-latexmk-mode' and its Flymake backend."
   (interactive)
-  (cond (auctex-cont-latexmk-mode       ;isn't this more of a `if'-place?
-         (auctex-cont-latexmk-turn-off))
-        (t
-         (auctex-cont-latexmk-turn-on))))
+  (if auctex-cont-latexmk-mode
+      (auctex-cont-latexmk-turn-off)
+    (auctex-cont-latexmk-turn-on)))
 
 (provide 'auctex-cont-latexmk)
 ;;; auctex-cont-latexmk.el ends here

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

* Re: [ELPA] some tex-related packages
  2024-06-18  6:38                                 ` Philip Kaludercic
  2024-06-26  5:59                                   ` Paul Nelson
@ 2024-10-12 15:30                                   ` Paul Nelson
  2024-10-18 11:00                                     ` Philip Kaludercic
  1 sibling, 1 reply; 25+ messages in thread
From: Paul Nelson @ 2024-10-12 15:30 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Arash Esbati, emacs-devel

Hi Philip,

> I've taken a look at one package, and am adding the comments to this
> message, and hope to do the same for the others, step by step:

I suspect your backlog remains much the same as a few months ago, but
figured I'd send a friendly nudge to see if you might have the chance
to review any further packages from the list, i.e., one of

https://github.com/ultronozm/tex-parens.el
https://github.com/ultronozm/auctex-label-numbers.el
https://github.com/ultronozm/preview-auto.el
https://github.com/ultronozm/tex-item.el
https://github.com/ultronozm/preview-tailor.el

(I recall tex-parens being raised as something that might be usefully
included in Emacs, so maybe that would be a natural next target?)

Thanks, best,

Paul



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

* Re: [ELPA] some tex-related packages
  2024-10-12 15:30                                   ` Paul Nelson
@ 2024-10-18 11:00                                     ` Philip Kaludercic
  2024-10-18 17:23                                       ` Paul Nelson
  0 siblings, 1 reply; 25+ messages in thread
From: Philip Kaludercic @ 2024-10-18 11:00 UTC (permalink / raw)
  To: Paul Nelson; +Cc: Arash Esbati, emacs-devel

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

Paul Nelson <ultrono@gmail.com> writes:

> Hi Philip,
>
>> I've taken a look at one package, and am adding the comments to this
>> message, and hope to do the same for the others, step by step:
>
> I suspect your backlog remains much the same as a few months ago, but
> figured I'd send a friendly nudge to see if you might have the chance
> to review any further packages from the list, i.e., one of
>
> https://github.com/ultronozm/tex-parens.el

Here are my comments/questions for this package:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tex-parens.el.diff --]
[-- Type: text/x-diff, Size: 8613 bytes --]

diff --git a/tex-parens.el b/tex-parens.el
index fb93734..a2b4c5d 100644
--- a/tex-parens.el
+++ b/tex-parens.el
@@ -40,8 +40,10 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'rx))
+
 (defgroup tex-parens ()
-  "Like lisp.el but for tex."
+  "Like lisp.el but for tex."		;I'd try to elaborate what this means
   :group 'tex)
 
 (defun tex-parens--beginning-of-defun ()
@@ -64,7 +66,7 @@ Here `defun' means top-level environment."
     ("\\lfloor" . "\\rfloor")
     ("\\lceil" . "\\rceil"))
   "Left/right pairs of delimiters."
-  :type '(repeat (cons string string)))
+  :type '(repeat (cons (string :tag "Left pair") (string :tag "Right pair"))))
 
 (defcustom tex-parens-solo-delimiters
   '("|" "\\|" "\\vert" "\\Vert")
@@ -98,11 +100,11 @@ Here `defun' means top-level environment."
   "Maximum length of a delimiter.
 This is comfortably larger than `\\biggl\\langle' and
 `\\begin{proposition}', for example."
-  :type 'integer)
+  :type 'natnum)
 
 (defun tex-parens--reduce-append (func list1 list2)
   "List consisting of FUNC applied to pairs from LIST1 and LIST2."
-  (seq-reduce #'append
+  (seq-reduce #'append			;couldn't you use `mapcan'?
               (mapcar (lambda (item1)
                         (mapcar (lambda (item2)
                                   (funcall func item1 item2))
@@ -166,19 +168,19 @@ form delimiters which are visibly `left'/`opening' or
   ;; If AUCTeX 14.0.5+ is installed, then we make some of the
   ;; navigation commands automatically open previews and folds.
   (when (boundp 'preview-auto-reveal-commands)
-    (dolist (func '(tex-parens-down-list
-                    tex-parens-backward-down-list))
+    (dolist (func (list #'tex-parens-down-list
+			#'tex-parens-backward-down-list))
       (add-to-list 'preview-auto-reveal-commands func)))
 
   (when (boundp 'TeX-fold-auto-reveal-commands)
-    (dolist (func '(tex-parens-down-list
-                    tex-parens-backward-down-list
-                    tex-parens-up-list
-                    tex-parens-backward-up-list
-                    tex-parens-forward-list
-                    tex-parens-backward-list
-                    tex-parens-forward-sexp
-                    tex-parens-backward-sexp))
+    (dolist (func (list #'tex-parens-down-list
+			#'tex-parens-backward-down-list
+			#'tex-parens-up-list
+			#'tex-parens-backward-up-list
+			#'tex-parens-forward-list
+			#'tex-parens-backward-list
+			#'tex-parens-forward-sexp
+			#'tex-parens-backward-sexp))
       (add-to-list 'TeX-fold-auto-reveal-commands func)))
 
   (setq-local tex-parens--saved-beginning-of-defun-function
@@ -190,8 +192,8 @@ form delimiters which are visibly `left'/`opening' or
   (setq tex-parens--pairs (tex-parens--generate-pairs))
   (setq tex-parens--pairs-swap
         (mapcar (lambda (x) (cons (cdr x) (car x))) tex-parens--pairs))
-  (setq tex-parens--delims (append (mapcar #'car tex-parens--pairs)
-                                   (mapcar #'cdr tex-parens--pairs)))
+  (setq tex-parens--delims (nconc (mapcar #'car tex-parens--pairs)
+                                  (mapcar #'cdr tex-parens--pairs)))
 
   (setq tex-parens--regexp
         (concat
@@ -244,23 +246,22 @@ Tex Parens mode is a minor mode in which lisp/sexp/defun-based commands
 are adapted to tex environments and math delimiters.  The affected
 commands include, for instance, `forward-sexp', `forward-list' and
 `beginning-of-defun'."
-  :lighter nil
-  :keymap (let ((map (make-sparse-keymap)))
+  :keymap (let ((map (make-sparse-keymap))) ;why not define it in a
+					    ;separate variable? it
+					    ;would also avoid overlong
+					    ;lines.
             (define-key map [remap forward-sexp] #'tex-parens-forward-sexp)
             (define-key map [remap backward-sexp] #'tex-parens-backward-sexp)
             (define-key map [remap forward-list] #'tex-parens-forward-list)
             (define-key map [remap backward-list] #'tex-parens-backward-list)
-            (define-key map [remap backward-up-list]
-                        #'tex-parens-backward-up-list)
+            (define-key map [remap backward-up-list] #'tex-parens-backward-up-list)
             (define-key map [remap up-list] #'tex-parens-up-list)
             (define-key map [remap down-list] #'tex-parens-down-list)
             (define-key map [remap delete-pair] #'tex-parens-delete-pair)
             (define-key map [remap mark-sexp] #'tex-parens-mark-sexp)
             (define-key map [remap kill-sexp] #'tex-parens-kill-sexp)
-            (define-key map [remap backward-kill-sexp]
-                        #'tex-parens-backward-kill-sexp)
-            (define-key map [remap transpose-sexps]
-                        #'tex-parens-transpose-sexps)
+            (define-key map [remap backward-kill-sexp] #'tex-parens-backward-kill-sexp)
+            (define-key map [remap transpose-sexps] #'tex-parens-transpose-sexps)
             (define-key map [remap raise-sexp] #'tex-parens-raise-sexp)
             map)
   (cond
@@ -401,7 +402,7 @@ delimiter.  Otherwise, return nil."
    (and
     (stringp delim)
     (or
-     (and (or
+     (and (or				;I'd use `rx' here
            (string-match "\\\\begin{\\([^}]+\\)}\\[[^]]+\\]" delim)
            (string-match "\\\\begin{\\([^}]+\\)}" delim))
           (let ((type (match-string 1 delim)))
@@ -506,6 +507,7 @@ Search up to BOUND."
       (when tex-parens--debug
         (message "Unmatched delimiters: %s" (car stack))))))
 
+;; doesn't this function share a lot of code with the previous function?
 (defun tex-parens--backward-list-1 (&optional bound)
   "Move backward across one balanced group.
 Search up to BOUND."
@@ -1096,38 +1098,43 @@ This regexp matches the start of various math environments, keeping a
 couple of characters before the primary match to leave space for Avy."
   :type 'regexp)
 
+(declare-function avy-jump "avy" (regex &rest _))
 (defun tex-parens-avy-jump-to-math ()
   "Jump inside a math expression using Avy.
 This function uses `tex-parens-avy-regexp' to identify potential math
 expressions, then jumps to the selected one and moves point inside the
 expression."
   (interactive)
-  (if (fboundp 'avy-jump)
-      (avy-jump tex-parens-avy-regexp
-                :action (lambda (pos)
-                          (goto-char pos)
-                          (forward-char 2)
-                          (tex-parens-down-list)
-                          ;; For preview-auto-reveal:
-                          (setq this-command #'tex-parens-down-list)))
-    (user-error "Avy is not available.  Please install and load it to use this function")))
+  (unless (and (fboundp 'avy-jump)
+	       (require 'avy nil t)
+	       (fboundp 'avy-jump))
+    (error "Avy is not available.  Please install it to use this function"))
+  (avy-jump tex-parens-avy-regexp
+            :action (lambda (pos)
+                      (goto-char pos)
+                      (forward-char 2)
+                      (tex-parens-down-list)
+                      ;; For preview-auto-reveal:
+                      (setq this-command #'tex-parens-down-list))))
 
 (defun tex-parens-avy-copy-math ()
   "Copy a math expression selected using Avy.
 This function uses `tex-parens-avy-regexp' to identify potential math
 expressions, then copies the selected one to the kill ring."
   (interactive)
-  (if (fboundp 'avy-jump)
-      (avy-jump tex-parens-avy-regexp
-                :action (lambda (pos)
-                          (let ((beg (+ pos 2))
-                                (end (save-excursion
-                                       (goto-char (+ pos 2))
-                                       (tex-parens-forward-list)
-                                       (point))))
-                            (copy-region-as-kill beg end)
-                            (message "Math expression copied"))))
-    (user-error "Avy is not available.  Please install and load it to use this function")))
+  (unless (and (fboundp 'avy-jump)
+	       (require 'avy nil t)
+	       (fboundp 'avy-jump))
+    (error "Avy is not available.  Please install it to use this function"))
+  (avy-jump tex-parens-avy-regexp
+            :action (lambda (pos)
+                      (let ((beg (+ pos 2))
+                            (end (save-excursion
+                                   (goto-char (+ pos 2))
+                                   (tex-parens-forward-list)
+                                   (point))))
+                        (copy-region-as-kill beg end)
+                        (message "Math expression copied")))))
 
 (provide 'tex-parens)
 ;;; tex-parens.el ends here

[-- Attachment #3: Type: text/plain, Size: 235 bytes --]


> https://github.com/ultronozm/auctex-label-numbers.el

No special comments here, perhaps check if things like user option types
could be made more specific.

> https://github.com/ultronozm/preview-auto.el

Just a few comments here:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: preview-auto.el.diff --]
[-- Type: text/x-diff, Size: 1583 bytes --]

diff --git a/preview-auto.el b/preview-auto.el
index 7614b4f..da184a2 100644
--- a/preview-auto.el
+++ b/preview-auto.el
@@ -39,6 +39,7 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl-lib))
 (require 'latex)
 (require 'preview)
 
@@ -90,7 +91,6 @@ Should work in AUCTeX `LaTeX-mode' buffers.  Implemented using
                  (memq math-face face))))
     (texmathp)))
 
-
 (defun preview-auto--generate-rules ()
   "Return list of rules for identifying math environments."
   (let* ((basic-rules
@@ -120,7 +120,6 @@ is valid.")
 (defvar-local preview-auto--begin-re nil
   "Regular expression for identifying the beginning of a math environment.")
 
-
 (defun preview-auto--check-default ()
   "Default predicate for checking whether to consider a delimiter.
 Returns non-nil if either
@@ -543,6 +542,7 @@ cancel the preview, so that the preview is not misplaced."
     (remove-hook 'after-change-functions #'preview-auto--after-change t)
     (remove-hook 'post-command-hook #'preview-auto--post-command t))))
 
+;;;###autoload
 (defun preview-auto-setup ()
   "Hook function for installing bind and menu item."
   (remove-hook 'LaTeX-mode-hook #'preview-auto-setup)
@@ -552,6 +552,9 @@ cancel the preview, so that the preview is not misplaced."
    ["automatically" preview-auto-mode]
    "(or toggle) at point"))
 
+;; Please don't modify hooks on the top-level!  Even if it removes
+;; itself, it is better to advise the user to call this or by hand or
+;; copy/adjust the code as they see fit.
 (add-hook 'LaTeX-mode-hook #'preview-auto-setup)
 
 (provide 'preview-auto)

[-- Attachment #5: Type: text/plain, Size: 448 bytes --]


> https://github.com/ultronozm/tex-item.el

Here nothing noteworthy to say from my side.

> https://github.com/ultronozm/preview-tailor.el

Again, nothing special to say.  I just think you should include cl-lib
and seq (or just one of the two).

> (I recall tex-parens being raised as something that might be usefully
> included in Emacs, so maybe that would be a natural next target?)
>
> Thanks, best,
>
> Paul

-- 
	Philip Kaludercic on siskin

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

* Re: [ELPA] some tex-related packages
  2024-10-18 11:00                                     ` Philip Kaludercic
@ 2024-10-18 17:23                                       ` Paul Nelson
  2024-10-18 17:46                                         ` Philip Kaludercic
  0 siblings, 1 reply; 25+ messages in thread
From: Paul Nelson @ 2024-10-18 17:23 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Arash Esbati, emacs-devel

Hi Philip, many thanks for your feedback.  I've implemented the
requested changes.

I had a couple quick questions:

1. Just for my own understanding, could you explain the following
idiom, which shows up in a couple places in your comments on
tex-parens?  Why do we have two fboundp's?

(and (fboundp 'avy-jump)
    (require 'avy nil t)
    (fboundp 'avy-jump))

2.

> Again, nothing special to say.  I just think you should include cl-lib
> and seq (or just one of the two).

Just to make sure I understand, this means to add (require 'seq)?

Thanks, best,

Paul



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

* Re: [ELPA] some tex-related packages
  2024-10-18 17:23                                       ` Paul Nelson
@ 2024-10-18 17:46                                         ` Philip Kaludercic
  2024-10-18 19:04                                           ` Paul Nelson
  0 siblings, 1 reply; 25+ messages in thread
From: Philip Kaludercic @ 2024-10-18 17:46 UTC (permalink / raw)
  To: Paul Nelson; +Cc: Arash Esbati, emacs-devel

Paul Nelson <ultrono@gmail.com> writes:

> Hi Philip, many thanks for your feedback.  I've implemented the
> requested changes.

(suggested, not required; the code is very good overall!)

> I had a couple quick questions:
>
> 1. Just for my own understanding, could you explain the following
> idiom, which shows up in a couple places in your comments on
> tex-parens?  Why do we have two fboundp's?
>
> (and (fboundp 'avy-jump)
>     (require 'avy nil t)
>     (fboundp 'avy-jump))

I should have explained that, my idea was to check if avy-jump was
actually made available by the `require' or not.  But I wouldn't
describe it as an idiom, or an elegant solution.  All I wanted to avoid
was that loading avy by hand is required after installing it as well.

> 2.
>
>> Again, nothing special to say.  I just think you should include cl-lib
>> and seq (or just one of the two).
>
> Just to make sure I understand, this means to add (require 'seq)?

You were using both cl- and seq- functions.  I was suggesting to make
that explicit by `require'ing them as well.  IIRC the code using seq-
and the code cl- functions could have also respectively been written in
the other style, so I thought it wouldn't be bad to stick to one of the
two inside a single package.

Other than that, we can add the packages to ELPA, right?

> Thanks, best,
>
> Paul

-- 
	Philip Kaludercic on siskin



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

* Re: [ELPA] some tex-related packages
  2024-10-18 17:46                                         ` Philip Kaludercic
@ 2024-10-18 19:04                                           ` Paul Nelson
  2024-10-19 14:54                                             ` Philip Kaludercic
  0 siblings, 1 reply; 25+ messages in thread
From: Paul Nelson @ 2024-10-18 19:04 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Arash Esbati, emacs-devel

Hi Philip,

> > (and (fboundp 'avy-jump)
> >     (require 'avy nil t)
> >     (fboundp 'avy-jump))
>
> I should have explained that, my idea was to check if avy-jump was
> actually made available by the `require' or not.  But I wouldn't
> describe it as an idiom, or an elegant solution.  All I wanted to avoid
> was that loading avy by hand is required after installing it as well.

I agree that we should not assume avy has been loaded by hand or
otherwise, but would have thought that the following would achieve the
same:

(and (require 'avy nil t)
     (fboundp 'avy-jump))

> You were using both cl- and seq- functions.  I was suggesting to make
> that explicit by `require'ing them as well.  IIRC the code using seq-
> and the code cl- functions could have also respectively been written in
> the other style, so I thought it wouldn't be bad to stick to one of the
> two inside a single package.

OK, gotcha (and indeed, I tweaked my code to just use seq).

> Other than that, we can add the packages to ELPA, right?

They're already on ELPA, which achieves my main goal of enabling
colleagues to set them up and use them with a simple config.

There was the question raised in
https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg00959.html
of whether tex-parens could be included in Emacs alongside tex-mode,
so as to be more available and simpler to document.  The answer is
certainly "yes", although I don't know who decides whether that should
be done.

There's also the question, discussed earlier in this thread, of
whether some would fit better in AUCTeX, but I imagine I'll sort that
out with Arash and co. on the AUCTeX list at some point.

Thanks again and best,

Paul



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

* Re: [ELPA] some tex-related packages
  2024-10-18 19:04                                           ` Paul Nelson
@ 2024-10-19 14:54                                             ` Philip Kaludercic
  0 siblings, 0 replies; 25+ messages in thread
From: Philip Kaludercic @ 2024-10-19 14:54 UTC (permalink / raw)
  To: Paul Nelson; +Cc: Arash Esbati, emacs-devel

Paul Nelson <ultrono@gmail.com> writes:

> Hi Philip,
>
>> > (and (fboundp 'avy-jump)
>> >     (require 'avy nil t)
>> >     (fboundp 'avy-jump))
>>
>> I should have explained that, my idea was to check if avy-jump was
>> actually made available by the `require' or not.  But I wouldn't
>> describe it as an idiom, or an elegant solution.  All I wanted to avoid
>> was that loading avy by hand is required after installing it as well.
>
> I agree that we should not assume avy has been loaded by hand or
> otherwise, but would have thought that the following would achieve the
> same:
>
> (and (require 'avy nil t)
>      (fboundp 'avy-jump))

Yeah, that should be good enough.

>> You were using both cl- and seq- functions.  I was suggesting to make
>> that explicit by `require'ing them as well.  IIRC the code using seq-
>> and the code cl- functions could have also respectively been written in
>> the other style, so I thought it wouldn't be bad to stick to one of the
>> two inside a single package.
>
> OK, gotcha (and indeed, I tweaked my code to just use seq).
>
>> Other than that, we can add the packages to ELPA, right?
>
> They're already on ELPA, which achieves my main goal of enabling
> colleagues to set them up and use them with a simple config.

Ah yes, I remember.  They were accidentally added in 8e73eaf44e0, which
is why I probably didn't recall adding them explicitly.

> There was the question raised in
> https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg00959.html
> of whether tex-parens could be included in Emacs alongside tex-mode,
> so as to be more available and simpler to document.  The answer is
> certainly "yes", although I don't know who decides whether that should
> be done.

Just like with any change proposed to core Emacs, it is mostly a matter
of preparing a patch for emacs.git.  Unless you insist on preserving the
revision history, it doesn't really matter that the new feature was
developed as a package.

> There's also the question, discussed earlier in this thread, of
> whether some would fit better in AUCTeX, but I imagine I'll sort that
> out with Arash and co. on the AUCTeX list at some point.

My feel is that it would be a better fit for AUCTeX, but this doesn't
have to be a permanent decision either.  We can move it from AUCTeX to
the core, if it seems like the right thing to do.

> Thanks again and best,
>
> Paul

-- 
	Philip Kaludercic on siskin



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

end of thread, other threads:[~2024-10-19 14:54 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-19 17:06 [ELPA] some tex-related packages Paul Nelson
2024-05-20  6:33 ` Philip Kaludercic
2024-05-20  9:01   ` Paul Nelson
2024-05-20  9:18     ` Philip Kaludercic
2024-05-20 17:37       ` Arash Esbati
2024-05-22 16:10         ` Paul Nelson
2024-05-27 16:13           ` Arash Esbati
2024-05-27 19:07             ` Paul Nelson
2024-06-02 12:51               ` Arash Esbati
2024-06-02 18:44                 ` Philip Kaludercic
2024-06-02 19:11                   ` Paul Nelson
2024-06-02 19:53                     ` Philip Kaludercic
2024-06-02 20:03                       ` Paul Nelson
2024-06-16 16:20                         ` Paul Nelson
2024-06-17 10:45                           ` Philip Kaludercic
2024-06-17 10:52                             ` Philip Kaludercic
2024-06-18  0:53                               ` Paul Nelson
2024-06-18  6:38                                 ` Philip Kaludercic
2024-06-26  5:59                                   ` Paul Nelson
2024-10-12 15:30                                   ` Paul Nelson
2024-10-18 11:00                                     ` Philip Kaludercic
2024-10-18 17:23                                       ` Paul Nelson
2024-10-18 17:46                                         ` Philip Kaludercic
2024-10-18 19:04                                           ` Paul Nelson
2024-10-19 14:54                                             ` Philip Kaludercic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).