[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] Let it byte compile even with GNU Emacs 29.3
From: |
Dr. Werner Fink |
Subject: |
Re: [PATCH 1/3] Let it byte compile even with GNU Emacs 29.3 |
Date: |
Wed, 8 May 2024 10:55:10 +0200 |
On 2024/05/08 09:48:30 +0200, Arash Esbati wrote:
> Werner Fink <werner@suse.de> writes:
>
> > Signed-off-by: Werner Fink <werner@suse.de>
> > ---
>
> Hi Werner,
Hi Arash,
>
> thanks for the change set. I have some question, see below.
>
> > latex.el | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/latex.el b/latex.el
> > index 5c6a8510..0f970949 100644
> > --- a/latex.el
> > +++ b/latex.el
> > @@ -2030,7 +2030,7 @@ TYPE is one of the symbols mac or env."
> > ;; over [>=] and a balanced {}
> > ((looking-at-p "[>=]")
> > (forward-char 1)
> > - (with-syntax-table syntax (forward-sexp)))
> > + (with-syntax-table syntax (ignore-errors (forward-sexp))))
>
> Can you please elaborate why `ignore-errors' is needed here? IIUC this
> is about byte compiling with Emacs 29.3? I have no problems compiling
> latex.el with Emacs 30 until now.
normally with every update of AUCTeX or TeXlive I do within a clean chroot
with full TeXLive tree a scan of all style files via TeX-auto-generate-global
...
```
%if %{with tex4auto}
pwd
echo "Run the command TeX-auto-generate-global in mini buffer"
emacs-gtk -batch -Q -L %{buildroot}%{_sitedir}/auctex
\
--eval '(setq TeX-lisp-directory "%{buildroot}%{_aucdir}")'
\
--eval '(setq TeX-auto-global "%{buildroot}%{_aucdir}/auto")'
\
-l %{buildroot}%{_sitedir}/tex-site.el -f TeX-auto-generate-global
exit 1
%else
```
and collect this in an addon tar ball, now auctex-13.3-auto-TL-2024.tar.xz .
Without this `ignore-errors' several scaned files causes errors. I had
added those `ignore-errors' step by step means broken scan by broken scan
to catch all of them :)
The addon tar ball will then installed without any scan at install time.
This saves time in our build system here as this step is done only once.
>
> > From 26c22d66eea3307106da436edb7ad7fc4e3abe8f Mon Sep 17 00:00:00 2001
> > From: Werner Fink <werner@suse.de>
> > Date: Tue, 7 May 2024 09:01:17 +0200
> > Subject: [PATCH 2/3] Enable initial reset for LaTeX classes
> >
> > Enable initial reset for LaTeX classes to load the class mode
> > at creation of the document. The declared variable is called
> > LaTeX-global-class-files and not TeX-global-class-files.
> >
> > Signed-off-by: Werner Fink <werner@suse.de>
> > ---
> > latex.el | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/latex.el b/latex.el
> > index 0f970949..957586c2 100644
> > --- a/latex.el
> > +++ b/latex.el
> > @@ -2714,7 +2714,7 @@ Initialized once at the first time you prompt for a
> > LaTeX class.
> > May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
> >
> > ;; Add the variable to `TeX-normal-mode-reset-list':
> > -(add-to-list 'TeX-normal-mode-reset-list 'TeX-global-class-files)
> > +(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-global-class-files)
> >
> > (defcustom TeX-arg-input-file-search t
> > "If `TeX-arg-input-file' should search for files.
> > --
> >
> > 2.43.0
>
> Argh, thanks, `TeX-global-class-files' is plain wrong.
Yep it broken the dinbrief calls handling, means the default environment
was not "letter" nor the code in dinbrief.el ask the user for intput.
> > From f9c892d072b6fd58b934c46ed334381e8e6f4786 Mon Sep 17 00:00:00 2001
> > From: Werner Fink <werner@suse.de>
> > Date: Tue, 7 May 2024 09:17:30 +0200
> > Subject: [PATCH 3/3] Update dinbrief class
> >
> > Nowadays UTF-8 is standard, also port the features of the letter class
> > to dinbrief class.
> >
> > Signed-off-by: Werner Fink <werner@suse.de>
> > ---
> > style/dinbrief.el | 45 ++++++++++++++++++++++++++++++++-------------
> > 1 file changed, 32 insertions(+), 13 deletions(-)
> >
> > diff --git a/style/dinbrief.el b/style/dinbrief.el
> > index c3108466..49e1071c 100644
> > --- a/style/dinbrief.el
> > +++ b/style/dinbrief.el
> > @@ -32,14 +32,26 @@
> > (require 'tex)
> > (require 'latex)
> >
> > +;; Silence the compiler:
> > +(declare-function font-latex-add-keywords
> > + "font-latex"
> > + (keywords class))
> > +
> > +(defvar LaTeX-dinbrief-class-options
> > + '("10pt" "11pt" "12pt" "norm" "a4paper" "a5paper" "b5paper"
> > + "letterpaper" "legalpaper" "executivepaper" "twoside"
> > + "addresshigh" "addressstd" "onecolumn" "twocolumn")
> > + "Package options for the letter class.")
> > +
> > (TeX-add-style-hook
> > "dinbrief"
> > (lambda ()
> > - (add-hook 'LaTeX-document-style-hook
> > - #'LaTeX-dinbrief-style)
> > (LaTeX-add-environments
> > '("letter" LaTeX-dinbrief-env-recipient)
> > "dinquote")
> > + (add-hook 'LaTeX-document-style-hook
> > + #'LaTeX-dinbrief-style)
>
> I suspect this change is just aesthetic?
>
> > (defmacro LaTeX-dinbrief-insert (&rest args)
> > @@ -77,17 +104,9 @@
> > (beginning-of-line 1))
> > (open-line 2)
> > (indent-relative-first-indent-point)
> > - (LaTeX-dinbrief-insert TeX-esc "usepackage"
> > - LaTeX-optop "latin1,utf8" LaTeX-optcl
> > - TeX-grop "inputenc" TeX-grcl)
> > - (newline-and-indent)
> > - (LaTeX-dinbrief-insert TeX-esc "usepackage"
> > - LaTeX-optop "T1" LaTeX-optcl
> > - TeX-grop "fontenc" TeX-grcl)
> > - (indent-relative-first-indent-point)
> > (LaTeX-dinbrief-insert TeX-esc "usepackage"
> > TeX-grop "ngerman" TeX-grcl))
> > - (TeX-run-style-hooks "inputenc" "fontenc" "ngerman"))
> > + (TeX-run-style-hooks "ngerman"))
>
> I agree with dropping inputenc, but fontenc is a different beast, and
> for German text, I think \usepackage[T1]{fontenc} is a good choice which
> we should keep. And what about switching from \usepackage{ngerman} to
> \usepackage[ngerman]{babel}?
OK your point ... here our setup T1 is the default but this is not common
indeed. Should I change the patch?
Werner
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
signature.asc
Description: PGP signature