emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] some tex-related packages


From: Arash Esbati
Subject: Re: [ELPA] some tex-related packages
Date: Mon, 27 May 2024 18:13:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

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



reply via email to

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