Difficulty about replacing `find-tag' (Re: Drop tarball releases and go ELPA only)
Hi Tassilo, >>>>> Tassilo Horn writes: >> | In bib-find-next: >> | bib-cite.el:947:8: Warning: ‘find-tag’ is an obsolete function (as of >> 25.1); >> | use ‘xref-find-definitions’ instead. > If you use bib-cite.el, could you please test if replacing find-tag with > xref-find-definitions actually works? No, it wouldn't. It was once replaced and reverted. See the commit db2236e0987ae93cbed06051bff6199a560b2648 Author: Arash Esbati AuthorDate: Thu Jan 7 20:42:36 2021 +0100 Commit: Arash Esbati CommitDate: Thu Jan 7 20:42:36 2021 +0100 Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Emacs 31 (git@Head) and Auctex (installed via package.el)
Hi Raman, >>>>> "T.V Raman" writes: > according to the auctex manual, loading tex-site will cause things to > fail, see the documentation. I suppose you are referring to these statements[1]: , | Already in version 11.81 the way to activate AUCTeX changed substantially. This should now be done with (load "auctex.el" nil t t) instead of the former (require 'tex-site) ` They mean that the _users_ aren't expected to load _explicitly_ tex-site.el in their init file ~/.emacs.d/init.el and alikes. Actually, the system init file ~/.emacs.d/elpa/auctex-x.y.z/auctex-autoloads.el , generated at ELPA AUCTeX installation, is designed to have (require 'tex-site) because it's madatory for sane operation of AUCTeX. It's there on purpose of the developpers of AUCTeX. Therefore, it *must* exist in package-quickstart.el when you enable `package-quickstart'. You said that , |When Emacs starts: | |1. (featurep 'tex-site) ==t ` in your first report[2]. I suppose that this means that your emacs loads tex-site.el via package-quickstart.el as expected and something unexpected broke the setting prepared in that tex-site.el. The preparation is done through adding some entries to `major-mode-remap-alist', thus it's important to know its value and the value of the related variable `major-mode-remap-defaults'. [1] https://www.gnu.org/software/auctex/manual/auctex/Changes.html [2] https://lists.gnu.org/archive/html/auctex-devel/2024-07/msg00054.html Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Emacs 31 (git@Head) and Auctex (installed via package.el)
Hi Raman, >>>>> "T.V Raman" writes: > check if package-quickstart contains stuff from tex-site. It doesn't, but it includes (require 'tex-site) instead. Thus I'm pretty sure that my emacs loads tex-site.el when it loads package-quickstart.el(c). > Also eliminate the local variables section That didn't make difference, either. I still think that the first step to investigate the issue further is to know your values of `major-mode-remap-alist' and `major-mode-remap-defaults' (without your workaround). Are there any reasons that it's difficult to provide them to us? Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Emacs 31 (git@Head) and Auctex (installed via package.el)
Hi Raman, >>>>> "T.V Raman" writes: > try setting package-quickstart to t in early-init.el That didn't make difference, either. What I did: 1. Put (setq package-quickstart t) in ~/.emacs.d/early-init.el 2. Restart emacs and M-x package-quickstart-refresh RET 3. Restart emacs and open the following file -- \documentclass{article} \begin{document} test $a$ \end{document} %%% Local Variables: %%% mode: latex %%% End: -- Then the buffer is in AUCTeX LaTeX mode. I confirmed that `package-quickstart' is actually t in that session and I have ~/.emacs.d/package-quickstart.el with AUCTeX stuff. I guess either (1) you haven't updated ~/.emacs.d/package-quickstart.el via M-x package-quickstart-refresh or (2) some package(s) you introduced are interfering with AUCTeX. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Drop tarball releases and go ELPA only
>>>>> Arash Esbati writes: > Sorry for the late response. Yes, LGTM, please go ahead and install it. Thanks, done. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master bd74d3cf: Update documentation
branch: master commit bd74d3cf4050fc8ae95c25cf5a70ea75e1919198 Author: Ikumi Keita Commit: Ikumi Keita Update documentation * doc/install.texi (Loading the package): (Advice for package providers): Update the way to disable site-wide default so that it includes ELPA installation. * doc/install.texi (Installation): Remove a paragraph which became incorrect. --- doc/install.texi | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/install.texi b/doc/install.texi index 74f5566d..5a00f8c3 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -38,9 +38,6 @@ Once the installation is completed, you can skip the rest of this section and proceed to @ref{Quick Start}. @end ifclear -The remainder of this section is about installing @AUCTeX{} from a -release tarball or from a checkout of the @AUCTeX{} repository. - Installing @AUCTeX{} should be simple: merely @command{./configure}, @command{make}, and @code{make install} for a standard site-wide installation (most other installations can be done by specifying a @@ -381,13 +378,21 @@ redirection. But we recommend not to customize them directly because the customization code for @code{TeX-modes} takes care of some other compatibility issues. -If you want to remove a preinstalled @AUCTeX{} completely before any of -its modes have been used, +When there is a site-wide installation of @AUCTeX{} and you don't want to +use it, you can disable it by +@lisp +(push '(auctex nil) package-load-list) +@end lisp +@noindent +in your early init file (@pxref{Early Init File,,,emacs}) for +@acronym{ELPA} installation, or @lisp (unload-feature 'tex-site) @end lisp @noindent -in your init file should accomplish that. +in your (standard) init file for configure--make installation. (We +recommend those treatments over setting @code{TeX-modes} to @code{nil}, +because they don't leave unused autoloads persisted.) @node Advice for package providers @section Providing @AUCTeX{} as a package @@ -401,6 +406,7 @@ There are people that prefer the built-in Emacs modes for editing @TeX{} files, in particular plain @TeX{} users. There are various ways to tell @AUCTeX{} even after auto-activation that it should not get used, and they are described in +@c FIXME: It doesn't seem that these references discuss this topic. @ifset rawfile the @file{README} file. @end ifset @@ -412,6 +418,12 @@ So if you have users that don't want to use the preinstalled @AUCTeX{}, they can easily get rid of it. Activating @AUCTeX{} by default is therefore a good choice. +First of all, you can install @acronym{ELPA} @AUCTeX{} package under a +directory listed in @code{package-directory-list} to have site-wide +default. + +Next, we discuss configure--make installation. + If the installation procedure did not achieve this already by placing @file{auctex.el} and @file{preview-latex.el} into a possibly existing @file{site-start.d} directory, you can do this by placing
Re: Emacs 31 (git@Head) and Auctex (installed via package.el)
Hi Raman, >>>>> "T.V Raman" writes: > See the bit on this thread re package-quickstart Unfortunately, it didn't help. I did on HEAD emacs: (1) Customize `package-quickstart' to t. (2) Restart emacs and M-x package-quickstart-refresh RET (3) Restart emacs and open a LaTeX document file with mode:latex tag. Then the buffer was in AUCTeX LaTeX mode. > I suspect tex-site acts like a flip-flop -- and package-quickstart > loading tex-site breaks things; loading it again I suspect fixes > things. Maybe, but I can't tell yet. We need more information to figure out what's going on. I ask you again to provide the values of `major-mode-remap-alist' or `major-mode-remap-defaults'. > Suggestion based on minimal understanding, simplify the world in > auctex-15 by eliminating tex-site.el It's actually complicated because AUCTeX tries to keep compatibility with traditional installation scheme. Maybe AUCTeX determines to support only ELPA release and merge tex-site.el into auctex.el in future. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Emacs 31 (git@Head) and Auctex (installed via package.el)
Hi Raman, >>>>> "T.V Raman" writes: > so this is what I added to my init -- it runs at the very end of > startup: > (when (featurep 'auctex-autoloads) (load-library "tex-site")); workaround Sorry for being late. I tried the latest emacs HEAD and ELPA AUCTeX 14.0.6. They work for me without your workaround. I suspect that either `major-mode-remap-alist' or `major-mode-remap-defaults' doesn't have the expected value without your workaround. Could you provide us their value? For me, the values are , | major-mode-remap-alist is a variable defined in ‘/usr/home/keita/repo/emacs/emacs/lisp/files.el’. | | Its value is | ((doctex-mode . docTeX-mode) (latex-mode . LaTeX-mode) | (texinfo-mode . Texinfo-mode) (plain-tex-mode . plain-TeX-mode) | (tex-mode . TeX-tex-mode)) | Original value was nil ` and , | major-mode-remap-defaults is a variable defined in ‘/usr/home/keita/repo/emacs/emacs/lisp/files.el’. | | Its value is | ((LaTeX-mode . latex-mode) (plain-TeX-mode . plain-tex-mode) | (TeX-mode . tex-mode)) ` Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Drop tarball releases and go ELPA only
Hi Arash, >>>>> Arash Esbati writes: >> How about the attached patch? (Maybe I should decouple the commit from >> bug#71363. When I first got started with this issue, it was a subsidiary >> topic of bug#71363.) > This is what I also suggest: let's decouple them. The patch for > tex-site.el looks good, AFAICT, so let's install that and close the > report. OK, installed. > Then we can discuss the manual change. The patch for documentation becase like this: >From 59971bd13345d44632059170eff288c96ed658bc Mon Sep 17 00:00:00 2001 From: Ikumi Keita Date: Wed, 10 Jul 2024 19:22:30 +0900 Subject: [PATCH] Update documentation * doc/install.texi (Loading the package): (Advice for package providers): Update the way to disable site-wide default so that it includes ELPA installation. * doc/install.texi (Installation): Remove a paragraph which became incorrect. --- doc/install.texi | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/install.texi b/doc/install.texi index c2499e63..e240 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -38,9 +38,6 @@ Once the installation is completed, you can skip the rest of this section and proceed to @ref{Quick Start}. @end ifclear -The remainder of this section is about installing @AUCTeX{} from a -release tarball or from a checkout of the @AUCTeX{} repository. - Installing @AUCTeX{} should be simple: merely @command{./configure}, @command{make}, and @code{make install} for a standard site-wide installation (most other installations can be done by specifying a @@ -379,13 +376,21 @@ of @code{TeX-modes} as you like to arrange @AUCTeX{} redirections. In fact, @code{TeX-modes} option does nothing other than setting up @code{major-mode-remap-alist} according its value on those Emacsens. -If you want to remove a preinstalled @AUCTeX{} completely before any of -its modes have been used, +When there is a site-wide installation of @AUCTeX{} and you don't want to +use it, you can disable it by +@lisp +(push '(auctex nil) package-load-list) +@end lisp +@noindent +in your early init file (@pxref{Early Init File,,,emacs}) for +@acronym{ELPA} installation, or @lisp (unload-feature 'tex-site) @end lisp @noindent -in your init file should accomplish that. +in your (standard) init file for configure--make installation. (We +recommend those treatments over setting @code{TeX-modes} to @code{nil}, +because they don't leave unused autoloads persisted.) @node Advice for package providers @section Providing @AUCTeX{} as a package @@ -399,6 +404,7 @@ There are people that prefer the built-in Emacs modes for editing @TeX{} files, in particular plain @TeX{} users. There are various ways to tell @AUCTeX{} even after auto-activation that it should not get used, and they are described in +@c FIXME: It doesn't seem that these references discuss this topic. @ifset rawfile the @file{README} file. @end ifset @@ -410,6 +416,12 @@ So if you have users that don't want to use the preinstalled @AUCTeX{}, they can easily get rid of it. Activating @AUCTeX{} by default is therefore a good choice. +First of all, you can install @acronym{ELPA} @AUCTeX{} package under a +directory listed in @code{package-directory-list} to have site-wide +default. + +Next, we discuss configure--make installation. + If the installation procedure did not achieve this already by placing @file{auctex.el} and @file{preview-latex.el} into a possibly existing @file{site-start.d} directory, you can do this by placing -- 2.44.0 Comments welcome. :-) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master 10c8f782: Keep compatibility with Org mode src editing (bug#71363)
branch: master commit 10c8f782f8c0456443f09db0c54403e8753ee52b Author: Ikumi Keita Commit: Ikumi Keita Keep compatibility with Org mode src editing (bug#71363) * tex-site.el.in (TeX-modes-set): Add entries for AUCTeX LaTeX mode to `org-src-lang-modes'. Use `major-mode-remap-defaults' for Emacs 30 and later, instead of `major-mode-remap-alist', in order to avoid altering user customize option. * doc/install.texi (Loading the package): Update the recommendation accordingly. --- doc/install.texi | 16 +--- tex-site.el.in | 56 +++- 2 files changed, 48 insertions(+), 24 deletions(-) diff --git a/doc/install.texi b/doc/install.texi index c2499e63..74f5566d 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -371,13 +371,15 @@ list. Type to manipulate the contents of @code{TeX-modes}. @end defopt -Don't remove @code{tex-mode} from @code{TeX-modes} because it results in -inconsistent behavior. - -On Emacs 29 and later, you can alter @code{major-mode-remap-alist} instead -of @code{TeX-modes} as you like to arrange @AUCTeX{} redirections. In -fact, @code{TeX-modes} option does nothing other than setting up -@code{major-mode-remap-alist} according its value on those Emacsens. +Don't remove @code{tex-mode} from @code{TeX-modes} unless you set +@code{TeX-modes} empty to disable @AUCTeX{} completely, otherwise it +results in inconsistent behavior. + +On Emacs 29 and later, @AUCTeX{} uses either +@code{major-mode-remap-defaults} or @code{major-mode-remap-alist} for +redirection. But we recommend not to customize them directly because the +customization code for @code{TeX-modes} takes care of some other +compatibility issues. If you want to remove a preinstalled @AUCTeX{} completely before any of its modes have been used, diff --git a/tex-site.el.in b/tex-site.el.in index 911a2080..7dd16333 100644 --- a/tex-site.el.in +++ b/tex-site.el.in @@ -113,29 +113,51 @@ Arrange the redirection of the built-in TeX modes according to VALUE. - The built-in modes in VALUE are redirected to the corresponding AUCTeX major modes. - The built-in modes not in VALUE discard redirection, if any. -If `major-mode-remap-alist' is available, use it for redirection. -Otherwise, use advice facility." +If either `major-mode-remap-defaults' or `major-mode-remap-alist' is +available, use it for redirection in that order. Otherwise, use advice +facility." (custom-set-default var value) (let (elt dst) (dolist (entry TeX-mode-alist) (setq elt (car entry) dst (cdr entry)) (if (memq elt value) - (if (boundp 'major-mode-remap-alist) - (or (eq (cdr-safe (assq elt major-mode-remap-alist)) dst) - (push (cons elt dst) major-mode-remap-alist)) -;; COMPATIBILITY for Emacs<29 -(advice-add elt :override dst -;; COMPATIBILITY for Emacs 28.[12] -;; Give it higher precedence than the :around -;; advice given to `tex-mode' in tex-mode.el. -;; https://lists.gnu.org/r/auctex-devel/2022-09/msg00050.html> -'((depth . -10 -(if (boundp 'major-mode-remap-alist) -(setq major-mode-remap-alist - (delete entry major-mode-remap-alist)) - ;; COMPATIBILITY for Emacs<29 - (advice-remove elt dst)) + (progn +(cond ((boundp 'major-mode-remap-defaults) + ;; For Emacs 30 and later + (add-to-list 'major-mode-remap-defaults (cons elt dst))) + ((boundp 'major-mode-remap-alist) + ;; COMPATIBILITY for Emacs 29 + (add-to-list 'major-mode-remap-alist (cons elt dst))) + (t + ;; COMPATIBILITY for Emacs<29 + (advice-add elt :override dst + ;; COMPATIBILITY for Emacs 28 + ;; Give it higher precedence than the :around + ;; advice given to `tex-mode' in tex-mode.el. + ;; https://lists.gnu.org/r/auctex-devel/2022-09/msg00050.html> + '((depth . -10) +;; Keep compatibility. (bug#71363) +(if (eq elt 'latex-mode) +(with-eval-after-load 'org-src + (defvar org-src-lang-modes) ; Silence byte compiler. + ;; Check the actual presence in the entry in case that + ;; the user once choosed AUCTeX LaTeX mode and + ;; abandoned it afterwards in the same emacs session. + (when (memq 'latex-mode TeX-modes) +(push '("latex" . LaTeX) org-src-lang-modes) +(push '("beamer" . LaTeX) org-src-l
Re: Drop tarball releases and go ELPA only
Hi Arash, >>>>> Arash Esbati writes: > Ikumi Keita writes: >> OK, I'll do some tests and propose a change for the document. > How about the attached patch? (Maybe I should decouple the commit from bug#71363. When I first got started with this issue, it was a subsidiary topic of bug#71363.) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW >From 2db4d6091baac1b5c4a94eaeb8b96abeb35c6160 Mon Sep 17 00:00:00 2001 From: Ikumi Keita Date: Tue, 12 Mar 2024 14:55:11 +0900 Subject: [PATCH] Keep compatibility with Org mode src editing (bug#71363) * tex-site.el.in (TeX-modes-set): Add entries for AUCTeX LaTeX mode to `org-src-lang-modes'. Use `major-mode-remap-defaults' for Emacs 30 and later, instead of `major-mode-remap-alist', in order to avoid altering user customize option. * doc/install.texi (Loading the package): Update the recommendation accordingly. Update the way to disable AUCTeX for ELPA site-wide installation as well. --- doc/install.texi | 38 +--- tex-site.el.in | 56 +--- 2 files changed, 65 insertions(+), 29 deletions(-) diff --git a/doc/install.texi b/doc/install.texi index c2499e63..5a00f8c3 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -38,9 +38,6 @@ Once the installation is completed, you can skip the rest of this section and proceed to @ref{Quick Start}. @end ifclear -The remainder of this section is about installing @AUCTeX{} from a -release tarball or from a checkout of the @AUCTeX{} repository. - Installing @AUCTeX{} should be simple: merely @command{./configure}, @command{make}, and @code{make install} for a standard site-wide installation (most other installations can be done by specifying a @@ -371,21 +368,31 @@ list. Type to manipulate the contents of @code{TeX-modes}. @end defopt -Don't remove @code{tex-mode} from @code{TeX-modes} because it results in -inconsistent behavior. +Don't remove @code{tex-mode} from @code{TeX-modes} unless you set +@code{TeX-modes} empty to disable @AUCTeX{} completely, otherwise it +results in inconsistent behavior. -On Emacs 29 and later, you can alter @code{major-mode-remap-alist} instead -of @code{TeX-modes} as you like to arrange @AUCTeX{} redirections. In -fact, @code{TeX-modes} option does nothing other than setting up -@code{major-mode-remap-alist} according its value on those Emacsens. +On Emacs 29 and later, @AUCTeX{} uses either +@code{major-mode-remap-defaults} or @code{major-mode-remap-alist} for +redirection. But we recommend not to customize them directly because the +customization code for @code{TeX-modes} takes care of some other +compatibility issues. -If you want to remove a preinstalled @AUCTeX{} completely before any of -its modes have been used, +When there is a site-wide installation of @AUCTeX{} and you don't want to +use it, you can disable it by +@lisp +(push '(auctex nil) package-load-list) +@end lisp +@noindent +in your early init file (@pxref{Early Init File,,,emacs}) for +@acronym{ELPA} installation, or @lisp (unload-feature 'tex-site) @end lisp @noindent -in your init file should accomplish that. +in your (standard) init file for configure--make installation. (We +recommend those treatments over setting @code{TeX-modes} to @code{nil}, +because they don't leave unused autoloads persisted.) @node Advice for package providers @section Providing @AUCTeX{} as a package @@ -399,6 +406,7 @@ There are people that prefer the built-in Emacs modes for editing @TeX{} files, in particular plain @TeX{} users. There are various ways to tell @AUCTeX{} even after auto-activation that it should not get used, and they are described in +@c FIXME: It doesn't seem that these references discuss this topic. @ifset rawfile the @file{README} file. @end ifset @@ -410,6 +418,12 @@ So if you have users that don't want to use the preinstalled @AUCTeX{}, they can easily get rid of it. Activating @AUCTeX{} by default is therefore a good choice. +First of all, you can install @acronym{ELPA} @AUCTeX{} package under a +directory listed in @code{package-directory-list} to have site-wide +default. + +Next, we discuss configure--make installation. + If the installation procedure did not achieve this already by placing @file{auctex.el} and @file{preview-latex.el} into a possibly existing @file{site-start.d} directory, you can do this by placing diff --git a/tex-site.el.in b/tex-site.el.in index 911a2080..7dd16333 100644 --- a/tex-site.el.in +++ b/tex-site.el.in @@ -113,29 +113,51 @@ Arrange the redirection of the built-in TeX modes according to VALUE. - The built-in modes in VALUE are redirected to the corresponding AUCTeX major modes. - The built-in modes not in VALUE discard redirection, if any. -If `major-mode-remap-alist' is available, use it for redirection. -Otherwise, use advice facility." +If either `major-mode-remap-defaults' or `major-m
Re: Drop tarball releases and go ELPA only
Hi Arash, >>>>> Arash Esbati writes: > So the general possibilities to de-activate AUCTeX installed from ELPA > are: > 1) Set `package-load-list' > (setq package-load-list '((auctex nil))) >in early init file accordingly, or This kills the element `all' in the initial value of `package-load-list' and (probably) disables all ELPA packages according to the paragraph quoted below. I think a suitable code is (push '(auctex nil) package-load-list) instead. ,[ (emacs) Package Installation ] |For finer control over which packages are made available at startup, | you can use the variable ‘package-load-list’. Its value should be a | list. A list element of the form ‘(NAME VERSION)’ tells Emacs to make | available version VERSION of the package named NAME. Here, VERSION | should be a version string (corresponding to a specific version of the | package), or ‘t’ (which means to make available any installed version), | or ‘nil’ (which means no version; this disables the package, preventing | it from being made available). A list element can also be the symbol | ‘all’, which means to make available the latest installed version of any | package not named by the other list elements. The default value is just | ‘'(all)’. ` > 2) Set in init file > (unload-feature 'auctex-autoloads) > (unload-feature 'tex-site) > Optionally, one can customize `TeX-modes' which applies also to the > current installation method. If so, I'd say we can document that in the > manual and close the file. OK, I'll do some tests and propose a change for the document. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Drop tarball releases and go ELPA only
Hi Arash, >>>>> Arash Esbati writes: > Thanks for raising this issue. IIUC this is due this line of code in > tex-site.el.in: > ;;; Ensure that loading the autoloads file also loads this file. > ;;;###autoload (require 'tex-site) > So this effect isn't limited to a site-wide installation, but to every > ELPA installation? Yes. However, I don't think it is a serious issue for usual (personal) ELPA installation because users can easily uninstall AUCTeX in that case. >> Should we arrange the main branch so that (unload-feature 'tex-site) >> works for site-wide ELPA AUCTeX installation as documented? Or should we >> announce other way? (To cusomize `TeX-modes' to nil? To add '(auctex >> nil)' to `package-load-list'? Or something else? > Do you have any suggestion how to fix this? I think the cleanest solution is to add '(auctex nil)' to `package-load-list'. This doesn't register unused autloads for the first place. (I haven't tested yet, but I suppose that the code needs to be in early init file, right?) However, I don't have strong preference about it. >> Maybe to have both (unload-feature 'autex-autoloads') and >> (unload-feature 'tex-site) ?) > This seems to be easiest way; I suspect the > (unload-feature '-autoloads) > applies to every package installed from ELPA? It seems so: ,[ (elisp) Packaging Basics ] |Emacs then searches every Lisp file in the content directory for | autoload magic comments (*note Autoload::). These autoload definitions | are saved to a file named ‘NAME-autoloads.el’ in the content directory. | They are typically used to autoload the principal user commands defined | in the package, but they can also perform other tasks, such as adding an | element to ‘auto-mode-alist’ (*note Auto Major Mode::). ` Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: [master does not generate the correct AUCTeX version ]
>>>>> Uwe Brauer writes: >>>> "IK" == Ikumi Keita writes: >> Recommended usage of main branch is to do "make clean" only when it's >> necessary. :-) > Well the problem with this philosophy is the following > 1. When shell I run make and when make clean (as I learned painfully >in the past, make clean is most of the time preferable to be on >the save side) You are defying the raison d'être of "make" and makefiles. The current Makefile of master branch always re-compiles _all_ .el files. The new Makefile of the main branch (GNUmakefile) dispenses with excessive compilation time. As I wrote, you should run "make" regularly and do "make clean" _only when_ it's necessary, i.e. it's much likely that the failure is due to implicit dependency of other files on the file you are tweaking. > 2. Why can't there a quick compilation option to be added as found >in master. That's because it is in line with the original way of writing makefiles. Specify compilation rule for file extension (.el) and don't enumerate all files to compile. In other words, the current Makefile of the master branch is written in a way against the spirit of makefiles. (I don't know why; probably by historical reason.) I suppose it isn't impossible to have such "quick" compilation target in the Makefile (GNUmakefile) of the main branch, but that would be redundant. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: [master does not generate the correct AUCTeX version ]
Hi Uwe, >>>>> Uwe Brauer writes: > The problem with the main branch is that even with make -j8 it takes > 2:20 minutes to compile while 0:08 for the master branch (on my X1 > Thinkpad 2017) It does take some non-trivial time to compile first time after "make clean" in main branch, but it doesn't such much at subsequent "make"s because only updated *.el files are then byte-compiled. Recommended usage of main branch is to do "make clean" only when it's necessary. :-) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Drop tarball releases and go ELPA only
Hi Tassilo, >>>>> Tassilo Horn writes: > See (info "(emacs) Package Files"): >In addition to =E2=80=98package-user-dir=E2=80=99, Emacs looks for insta= > lled packages > in the directories listed in =E2=80=98package-directory-list=E2=80=99. The= > se > directories are meant for system administrators to make Emacs packages > available system-wide; Emacs itself never installs packages there. The > package subdirectories for =E2=80=98package-directory-list=E2=80=99 are lai= > d out in the > same way as in =E2=80=98package-user-dir=E2=80=99. I didn't know this feature and there arises a question. When there is a site-wide AUCTeX installation, a user who want to disable AUCTeX can achieve that by (unload-feature 'tex-site) under configure installation. But it seems that prescription doesn't work for site-wide ELPA AUCTeX installation; emacs refuses to unload `tex-site' saying: , | unload-feature: Loaded libraries ("c:/Program Files/Emacs/emacs-29.2/share/emacs/site-lisp/elpa/auctex-14.0.6/auctex-autoloads.el") depend on c:/Program Files/Emacs/emacs-29.2/share/emacs/site-lisp/elpa/auctex-14.0.6/tex-site.elc ` Should we arrange the main branch so that (unload-feature 'tex-site) works for site-wide ELPA AUCTeX installation as documented? Or should we announce other way? (To cusomize `TeX-modes' to nil? To add '(auctex nil)' to `package-load-list'? Or something else? Maybe to have both (unload-feature 'autex-autoloads') and (unload-feature 'tex-site) ?) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: [master does not generate the correct AUCTeX version ]
>>>>> Ikumi Keita writes: > Uwe, how about installing Git with your distro's package manager? You > don't have to use Git for yourself, just AUCTeX makefiles and scripts > do. You can continnue to use Mercurial via hg2git. Ah, sorry, I didn't remember that the repository created by hg2git doesn't have expeced contents in .git subdirectory. So it difficult to have correct version number without real git repository. I don't have a good solution. :-( Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: [master does not generate the correct AUCTeX version ]
Hi Arash and Uwe, >>>>> Arash Esbati writes: > So for your setup, you need an up-to-date ChangeLog.1, right? I > presume you can't update that yourself due to lack of Git? I don't think so. The current Changelog.1 begins with: , | 2024-01-17 Mosè Giordano | | * Version 13.3 released. | ` , thus Uwe's result is just as it should be on machine where Git isn't available. Uwe, how about installing Git with your distro's package manager? You don't have to use Git for yourself, just AUCTeX makefiles and scripts do. You can continnue to use Mercurial via hg2git. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master c57690f6: Make syntax prop. run even when font lock is disabled (bug#71164)
branch: master commit c57690f61dbdc6e98d29c914fd25e0763d8be32c Author: Ikumi Keita Commit: Ikumi Keita Make syntax prop. run even when font lock is disabled (bug#71164) * font-latex.el (font-latex--make-syntax-propertize-function): Add font lock variable initialization. --- font-latex.el | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/font-latex.el b/font-latex.el index 0307cd10..ec99d54c 100644 --- a/font-latex.el +++ b/font-latex.el @@ -1310,10 +1310,16 @@ triggers Font Lock to recognize the change." (defun font-latex--make-syntax-propertize-function () "Return a `syntax-propertize-function' for (La|Doc)TeX documents." - (let ((kws ;; (if (derived-mode-p 'docTeX-mode) - ;; font-latex-doctex-syntactic-keywords - font-latex-syntactic-keywords)) ;; ) -(syntax-propertize-via-font-lock kws))) + (let* ((kws ;; (if (derived-mode-p 'docTeX-mode) + ;; font-latex-doctex-syntactic-keywords + font-latex-syntactic-keywords) ;; ) + (func (syntax-propertize-via-font-lock kws))) +(lambda (start end) + ;; Initialize font lock variables even when font lock is disabled. + ;; This treatment is necessary because syntax propertize depends + ;; on font lock facility. (bug#71164) + (or font-lock-set-defaults (font-lock-set-defaults)) + (funcall func start end ;;;###autoload (defun font-latex-setup ()
Re: CTAN update
Hi Arash, >>>>> Arash Esbati writes: > Thanks, I installed that change. Do you think we have enough changes > for a 14.0.6 ELPA release? I would upload a preview tarball release to > CTAN as well. I'm fine to have a new ELPA release now. :-) Best, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: CTAN update
Hi Arash, >>>>> Arash Esbati writes: > Having a second GNUmakefile in latex/ is something that I'm trying to > avoid; I hope we manage to clean up the one top level and then be done > with it. I can think of something like this; I see. Then I'm fine with your idea. :-) Best, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: CTAN update
Hi Arash. >>>>> Arash Esbati writes: > Now one can do 'make preview-ctan' and gets a tarball. Ugly is the > suffix part in clean, but it works :-) WDYT? It seems that the new targets don't have expected dependencies. For example, type "make preview-mk.ins" and "make preview.drv" in succession. The second "make" re-runs cd latex && $(TEX) '\nonstopmode \input bootstrap.ins' , which is redundant. In order to write the dependency rules reliably and simply, I think we should have another GNUmakefile in latex subdirectory and put the relavant rules in it. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: CTAN update (Re: bug#71690: 14.0.5; preview-latex clips bold text with inline equations)
Hi Arash, >>>>> Arash Esbati writes: > But we still need some rules in order to create the preview.pdf file > which is required for a CTAN release, IIUC. I'll try to have a look, > but wouldn't mind if someone more fluent in make could also check ;-) That would be this stuff taken from latex/Makefile.in: preview.pdf: preview.drv preview.dtx preview.sty $(PDFLATEX) '\nonstopmode \input{preview.drv}' $(PDFLATEX) '\nonstopmode \input{preview.drv}' $(PDFLATEX) '\nonstopmode \input{preview.drv}' So I hope for our GNUmakefile, preview.pdf: latex/preview.drv latex/preview.dtx latex/preview.sty cd latex; \ $(PDFLATEX) '\nonstopmode \input{preview.drv}'; \ $(PDFLATEX) '\nonstopmode \input{preview.drv}'; \ $(PDFLATEX) '\nonstopmode \input{preview.drv}' would do the job. (I haven't tried actually, though. Maybe we also need PDFLATEX=pdflatex in GNUmakefile?) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
CTAN update (Re: bug#71690: 14.0.5; preview-latex clips bold text with inline equations)
[ Cc: changed ] >>>>> Arash Esbati writes: > Thanks Keita. Now we have one other issue to solve: We used to update > preview.(dtx|ins) on CTAN with the yearly tarball release. Since a > tarball release will not happen, maybe we should update the CTAN > package. Oh, I didn't think about the preview package on CTAN. > I presume most of preview users use preview bundled with TeXlive and > not with their ELPA release. WDYT? Probably, yes. ELPA AUCTeX stores preview package under ~/.emacs.d/elpa/auctex-x.y.z/latex and most users wouldn't add it to kpathsea search path. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Deleting some obsolete variables
>>>>> Arash Esbati writes: > Ikumi Keita writes: >> Ah, OK. I'll delete that, too. > Done. Bye, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
branch feature/fix-mode-names-overlap deleted (was f06778a7)
ikumi pushed a change to branch feature/fix-mode-names-overlap. was f06778a7 * doc/changes.texi: Update the last change. The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
master 008399b8: Delete obsolete variables
branch: master commit 008399b88a12d91b7e31dcd0743704fcbcdd57cb Author: Ikumi Keita Commit: Ikumi Keita Delete obsolete variables * tex.el (TeX-symbol-marker, TeX-symbol-marker-pos, TeX-dollar-sign): (TeX-dollar-string, TeX-dollar-regexp): Delete obsolete variables, used for old "$" key management. --- NEWS.org | 3 +++ doc/changes.texi | 6 ++ tex.el | 15 --- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/NEWS.org b/NEWS.org index 9e592263..2806126b 100644 --- a/NEWS.org +++ b/NEWS.org @@ -44,6 +44,9 @@ ** Removed - Delete function ~LaTeX-env-contents~. +- Delete obsolete variables ~TeX-symbol-marker~, + ~TeX-symbol-marker-pos~, ~TeX-dollar-sign~, ~TeX-dollar-string~ and + ~TeX-dollar-regexp~. * [14.0.5] - 2024-05-19 diff --git a/doc/changes.texi b/doc/changes.texi index a8de7322..75cdabe9 100644 --- a/doc/changes.texi +++ b/doc/changes.texi @@ -245,6 +245,12 @@ inline math (without active region), @kbd{$} inserts two dollars, not one dollar which just closes the math mode. @end itemize +@item +The following obsolete variables, used for old @key{$} key management, +were at last removed: @code{TeX-symbol-marker}, +@code{TeX-symbol-marker-pos}, @code{TeX-dollar-sign}, +@code{TeX-dollar-string} and @code{TeX-dollar-regexp}. + @item @AUCTeX{} now requires GNU Emacs 27.1 or higher. @end itemize diff --git a/tex.el b/tex.el index 0f6b753a..708ccfca 100644 --- a/tex.el +++ b/tex.el @@ -6123,21 +6123,6 @@ See also `TeX-font-replace' and `TeX-font-replace-function'." ;; Rewritten from scratch with use of `texmathp' by ;; Carsten Dominik -;; The following variables are no longer used, but kept in case some -;; foreign code uses any of them. -(defvar TeX-symbol-marker nil) -(defvar TeX-symbol-marker-pos 0) -(defvar TeX-dollar-sign ?$) -(defconst TeX-dollar-string (char-to-string TeX-dollar-sign)) -(defconst TeX-dollar-regexp - (concat "^" (regexp-quote TeX-dollar-string) "\\|[^" TeX-esc "]" - (regexp-quote TeX-dollar-string))) -(make-obsolete-variable 'TeX-symbol-marker nil "AUCTeX 9.9d++") -(make-obsolete-variable 'TeX-symbol-marker-pos nil "AUCTeX 9.9d++") -(make-obsolete-variable 'TeX-dollar-sign nil "AUCTeX 9.9d++") -(make-obsolete-variable 'TeX-dollar-string nil "AUCTeX 9.9d++") -(make-obsolete-variable 'TeX-dollar-regexp nil "AUCTeX 9.9d++") - (defcustom TeX-math-toggle-off-input-method t "If non-nil, auto turn off some input methods when entering math mode. See `TeX-math-input-method-off-regexp'."
master 889d0615: Improve suggestion in the manual
branch: master commit 889d0615441143f09e04c028e582cc9c859e1ac4 Author: Ikumi Keita Commit: Ikumi Keita Improve suggestion in the manual * doc/preview-latex.texi (Misplaced previews): Add \AtBeginDocument to the suggested solution. Refill the paragraph. --- doc/preview-latex.texi | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/preview-latex.texi b/doc/preview-latex.texi index 84d80be1..e9e03fd5 100644 --- a/doc/preview-latex.texi +++ b/doc/preview-latex.texi @@ -789,12 +789,12 @@ of those previews is goofed up, you will not be able to regenerate them by clicking on them. The default behaviour is thus somewhat undesirable. The solution (like with other preview problems) is to tell the @LaTeX{} -@samp{preview} package how to tackle this problem (@pxref{The LaTeX -style file}). Simply, you don't need @code{\emph} do anything at all -during previews! You only want the text math previewed, so the solution -is to use @code{\PreviewMacro*\emph} in the preamble of your document -which will make @LaTeX{} ignore @code{\emph} completely as long as it is -not part of a larger preview (in which case it gets typeset as +@samp{preview} package how to tackle this problem (@pxref{The LaTeX style +file}). Simply, you don't need @code{\emph} do anything at all during +previews! You only want the text math previewed, so the solution is to use +@code{\AtBeginDocument@{\PreviewMacro*\emph@}} in the preamble of your +document which will make @LaTeX{} ignore @code{\emph} completely as long +as it is not part of a larger preview (in which case it gets typeset as usual). Its argument thus becomes ordinary text and gets treated like ordinary text.
Re: Deleting `TeX-Omega-mode'
Hi Arash, >>>>> Arash Esbati writes: > in tex.el, we have: > (define-minor-mode TeX-Omega-mode > "Minor mode for using the Omega engine." > :init-value nil :lighter nil :keymap nil > :group 'TeX-command > (TeX-engine-set (if TeX-Omega-mode 'omega 'default))) > (defalias 'tex-omega-mode #'TeX-Omega-mode) > (make-obsolete 'TeX-Omega-mode #'TeX-engine-set "11.86") > (make-obsolete-variable 'TeX-Omega-mode 'TeX-engine "11.86") > Does anyone object if I remove this after 14 years of obsolescence? I don't mind it, but shouldn't we delete many other Omega related stuffs (for example, "omega" entry in `TeX-engine-alist-builtin') as well? Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master c571713a: Add some font commands to default prauctex.cfg (bug#71690)
branch: master commit c571713a1f0013f8fb10e1e458eeadf4b8fbc797 Author: Ikumi Keita Commit: Ikumi Keita Add some font commands to default prauctex.cfg (bug#71690) * latex/preview.dtx (subsection{The \texttt{auctex} option}): Add \textbf, \textnormal, \textulc, \textmd, \textup and \textsw to the commands ignored by preview-latex. (): Update checksum. --- latex/preview.dtx | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/latex/preview.dtx b/latex/preview.dtx index 23f5b2da..23624456 100644 --- a/latex/preview.dtx +++ b/latex/preview.dtx @@ -20,7 +20,7 @@ % Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, % Boston, MA 02110-1301 USA % \fi -% \CheckSum{1758} +% \CheckSum{1770} % \GetFileInfo{preview.sty} % \date{\filedate} % \author{David Kastrup\thanks{\texttt{bug-auc...@gnu.org}}} @@ -1427,11 +1427,17 @@ Please complain to your document class author}% %\PreviewMacro*[?[{@{[]}}{}][#1]\item %\PreviewMacro*\emph %\PreviewMacro*\textrm +%\PreviewMacro*\textbf %\PreviewMacro*\textit %\PreviewMacro*\textsc %\PreviewMacro*\textsf %\PreviewMacro*\textsl %\PreviewMacro*\texttt +%\PreviewMacro*\textulc +%\PreviewMacro*\textmd +%\PreviewMacro*\textnormal +%\PreviewMacro*\textup +%\PreviewMacro*\textsw %\PreviewMacro*\textcolor %\PreviewMacro*\mbox %\PreviewMacro*[][#1{}]\author
Re: Deleting some obsolete variables
Hi Arash, >>>>> Arash Esbati writes: >> Yes, I think we can. If I don't see objections, I'll delete the block in >> a few days. > Great, thanks. While we're at it: Do we still need the > 'feature/fix-mode-names-overlap' branch or can you delete that as well? Ah, OK. I'll delete that, too. Bye, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Deleting some obsolete variables
Hi Arash, >>>>> Arash Esbati writes: > Hi Keita, > with commit d7e6fa0d41, you added some comments about the variables > below: > ;; The following variables are no longer used, but kept in case some > ;; foreign code uses any of them. > (defvar TeX-symbol-marker nil) > (defvar TeX-symbol-marker-pos 0) > (defvar TeX-dollar-sign ?$) > (defconst TeX-dollar-string (char-to-string TeX-dollar-sign)) > (defconst TeX-dollar-regexp > (concat "^" (regexp-quote TeX-dollar-string) "\\|[^" TeX-esc "]" > (regexp-quote TeX-dollar-string))) > (make-obsolete-variable 'TeX-symbol-marker nil "AUCTeX 9.9d++") > (make-obsolete-variable 'TeX-symbol-marker-pos nil "AUCTeX 9.9d++") > (make-obsolete-variable 'TeX-dollar-sign nil "AUCTeX 9.9d++") > (make-obsolete-variable 'TeX-dollar-string nil "AUCTeX 9.9d++") > (make-obsolete-variable 'TeX-dollar-regexp nil "AUCTeX 9.9d++") > The commit isn't that old, but can we remove the block above entirely > from AUCTeX? 9.9d was long time ago. WDYT? Yes, I think we can. If I don't see objections, I'll delete the block in a few days. Best regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master 56debb63: Populate `semantic-symref-filepattern-alist' (bug#71245)
branch: master commit 56debb635d3d768500c86bce54cf4eaf42502e86 Author: David Fussner Commit: Ikumi Keita Populate `semantic-symref-filepattern-alist' (bug#71245) * context.el: * latex.el: * plain-tex.el: Make sure all modes have an entry in the alist, and also that the ".tex" extension is included where necessary. --- context.el | 7 +++ latex.el | 3 ++- plain-tex.el | 14 ++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/context.el b/context.el index 8b0c88ee..0caab223 100644 --- a/context.el +++ b/context.el @@ -1861,6 +1861,13 @@ that is, you do _not_ have to cater for this yourself by adding \\=' or $." (TeX-abbrev-mode-setup ConTeXt-mode context-mode-abbrev-table) +(defvar semantic-symref-filepattern-alist) ; Silence compiler +(with-eval-after-load 'semantic/symref/grep + ;; This entry is necessary for M-? to work. + ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg2.html> + ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg5.html> + (push '(ConTeXt-mode "*.[tT]e[xX]") semantic-symref-filepattern-alist)) + (defun ConTeXt-mode-common-initialization () "Initialization code that is common for all ConTeXt interfaces." (plain-TeX-common-initialization) diff --git a/latex.el b/latex.el index d0a9ee6f..ba759291 100644 --- a/latex.el +++ b/latex.el @@ -8195,7 +8195,8 @@ This happens when \\left is inserted." ;; This entry is necessary for M-? to work. ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg2.html> ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg5.html> - (push '(LaTeX-mode "*.ltx" "*.sty" "*.cls" "*.clo" "*.bbl" "*.drv" "*.hva") + (push '(LaTeX-mode "*.[tT]e[xX]" "*.ltx" "*.sty" "*.cl[so]" "*.bbl" + "*.drv" "*.hva") semantic-symref-filepattern-alist)) (declare-function LaTeX-preview-setup "preview") diff --git a/plain-tex.el b/plain-tex.el index 2b777869..9bd48eb3 100644 --- a/plain-tex.el +++ b/plain-tex.el @@ -118,6 +118,14 @@ plain-TeX file, or any mode derived thereof. See variable (TeX-abbrev-mode-setup plain-TeX-mode plain-tex-mode-abbrev-table) +(defvar semantic-symref-filepattern-alist) ; Silence compiler +(with-eval-after-load 'semantic/symref/grep + ;; This entry is necessary for M-? to work. + ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg2.html> + ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg5.html> + (push '(plain-TeX-mode "*.[tT]e[xX]" "*.ins") +semantic-symref-filepattern-alist)) + ;; Delete alias predefined in tex-mode.el so that AUCTeX autoload ;; takes precedence. ;;;###autoload (if (eq (symbol-function 'plain-TeX-mode) 'plain-tex-mode) @@ -318,6 +326,12 @@ that is, you do _not_ have to cater for this yourself by adding \\=' or $." :type 'hook :group 'TeX-misc) +(with-eval-after-load 'semantic/symref/grep + ;; This entry is necessary for M-? to work. + ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg2.html> + ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg5.html> + (push '(AmSTeX-mode "*.[tT]e[xX]") semantic-symref-filepattern-alist)) + ;;;###autoload (define-derived-mode AmSTeX-mode plain-TeX-mode "AmS-TeX" "Major mode in AUCTeX for editing AmSTeX files.
Re: tex-site.elc generation on main branch
>>>>> Arash Esbati writes: > Uwe Brauer writes: >> Ok, the compilation takes awfully long. Tassilo explained why, but it >> is really annoying and makes testing a bit cumbersome . > Do you run make with the '-j' switch? I tried building AUCTeX on my old > Windows box with 'time make -j8' and it took around 2:20 minutes. The > same process takes 0:22 minutes on my Macbook Air M2. I agree, it takes > longer than it used to, but there are reasons to do so. >> But it works! >> tex-site.elc is generated >> >> So I think your patch provides a working solution. > Thanks for testing, I also think Keita's patch is good. Thank you both. I pushed the fix. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
main 6b1c1f6d: Tune byte compile condition
branch: main commit 6b1c1f6da312fc113a80bedabf703f8cff5cd6d6 Author: Ikumi Keita Commit: Ikumi Keita Tune byte compile condition * lpath.el: Add appropriate file local variables section to suppress spurious byte compile. * GNUmakefile: Make sure that tex-site.elc is generated. --- GNUmakefile | 2 +- lpath.el| 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 4f90cd07..73bdeace 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -42,7 +42,7 @@ ALL_GENERATED_FILES=$(MAIN_GENERATED_FILES) \ # Generate & compile everything including the manuals below doc/. all: $(ALL_GENERATED_FILES) compile auctex-autoloads.el -compile: $(patsubst %.el,%.elc,$(wildcard *.el style/*.el)) +compile: $(patsubst %.el,%.elc,$(wildcard *.el style/*.el)) tex-site.elc # If we were depending on emacs 29.1, we could simply use # loaddefs-generate. If we were depending on 28.1, we could still use diff --git a/lpath.el b/lpath.el index f43a9841..021ed463 100644 --- a/lpath.el +++ b/lpath.el @@ -11,3 +11,9 @@ (add-to-list 'load-path (expand-file-name "style" auctex-dir)) (setq TeX-lisp-directory "" TeX-auto-global "")) + +;; Local Variables: +;; no-byte-compile: t +;; no-update-autoloads: t +;; no-native-compile: t +;; End:
Re: tex-site.elc generation on main branch
>>>>> Uwe Brauer writes: > Difficult to say, because there is no attached patch Sorry! Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW >From 6b1c1f6da312fc113a80bedabf703f8cff5cd6d6 Mon Sep 17 00:00:00 2001 From: Ikumi Keita Date: Sat, 27 Apr 2024 18:23:45 +0900 Subject: [PATCH] Tune byte compile condition * lpath.el: Add appropriate file local variables section to suppress spurious byte compile. * GNUmakefile: Make sure that tex-site.elc is generated. --- GNUmakefile | 2 +- lpath.el| 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 4f90cd07..73bdeace 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -42,7 +42,7 @@ ALL_GENERATED_FILES=$(MAIN_GENERATED_FILES) \ # Generate & compile everything including the manuals below doc/. all: $(ALL_GENERATED_FILES) compile auctex-autoloads.el -compile: $(patsubst %.el,%.elc,$(wildcard *.el style/*.el)) +compile: $(patsubst %.el,%.elc,$(wildcard *.el style/*.el)) tex-site.elc # If we were depending on emacs 29.1, we could simply use # loaddefs-generate. If we were depending on 28.1, we could still use diff --git a/lpath.el b/lpath.el index f43a9841..021ed463 100644 --- a/lpath.el +++ b/lpath.el @@ -11,3 +11,9 @@ (add-to-list 'load-path (expand-file-name "style" auctex-dir)) (setq TeX-lisp-directory "" TeX-auto-global "")) + +;; Local Variables: +;; no-byte-compile: t +;; no-update-autoloads: t +;; no-native-compile: t +;; End: -- 2.44.0
tex-site.elc generation on main branch
Hi all, On the main branch, tex-site.elc isn't generated at the first "make" after "make clean" because expansion of $(wildcard *.el style/*.el) in GNUmakefile doesn't include tex-site.el which doesn't exist yet when we issue the "make". Does it make sense to apply the attached patch for the reproducibility? (It includes addition to lpath.el to suppress spurious generation of lpath.elc as well.) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: master 45ee2f9e 3/3: Update documentaion on changes related to delete-selection
Hi Arash, >>>>> Arash Esbati writes: >> +When @code{TeX-electric-math} is a pair of dollars and the point is in >> +inline math (without active region, @kbd{$} inserts two dollars, not one >^ > Thanks for the change. Is the above possibly a typo or is closing > parenthesis missing? Ah, I think so. I just pushed the fix. Thanks for spotting this. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master 8485b4bb: ; * doc/changes.texi: Fix typo.
branch: master commit 8485b4bbdf6a38c741a62a37fdfdafafdca9d168 Author: Ikumi Keita Commit: Ikumi Keita ; * doc/changes.texi: Fix typo. --- doc/changes.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes.texi b/doc/changes.texi index 7a5f95fe..a8de7322 100644 --- a/doc/changes.texi +++ b/doc/changes.texi @@ -241,7 +241,7 @@ while it inserts @samp{\(} and @samp{\)} when @code{TeX-electric-math} is @code{("\(" . "\)")}. @item When @code{TeX-electric-math} is a pair of dollars and the point is in -inline math (without active region, @kbd{$} inserts two dollars, not one +inline math (without active region), @kbd{$} inserts two dollars, not one dollar which just closes the math mode. @end itemize
Re: [PATCH] fix delete-property handling
>>>>> Artem Yurchenko writes: > Hi, Ikumi, > I have finally got my assignment back! Thank you! I pushed your changesets to the git repository. I'm happy to have your nice contribution and thank for your patiance. Best regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master 45ee2f9e 3/3: Update documentaion on changes related to delete-selection
branch: master commit 45ee2f9e674a82037c5d67d8851721255b8237d0 Author: Artem Yurchenko Commit: Ikumi Keita Update documentaion on changes related to delete-selection * doc/auctex.texi: * doc/changes.texi: Update documentaion on changes related to delete-selection. --- doc/auctex.texi | 17 ++--- doc/changes.texi | 34 +- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/doc/auctex.texi b/doc/auctex.texi index ca1eb339..e6bd045a 100644 --- a/doc/auctex.texi +++ b/doc/auctex.texi @@ -413,7 +413,7 @@ first dollar sign. @deffn Command TeX-insert-dollar @var{arg} @kindex $ -(@kbd{$}) Insert dollar sign. +(@kbd{$}) Insert dollar sign (or another math delimiter). Show matching dollar sign if this dollar sign end the @TeX{} math mode. @@ -437,14 +437,6 @@ Besides @code{nil}, possible values for this variable are @code{("$" . "$")} for @TeX{} inline equations @samp{$...$}, and @code{("\(" . "\)")} for @LaTeX{} inline equations @samp{\(...\)}. -If the variable is non-@code{nil} and point is inside math mode right -between a couple of single dollars, pressing @kbd{$} will insert another -pair of dollar signs and leave the point between them. Thus, if -@code{TeX-electric-math} is set to @code{("$" . "$")} you can easily -obtain a @TeX{} display equation @samp{$$...$$} by pressing @kbd{$} twice -in a row. (Note that you should not use double dollar signs in @LaTeX{} -because this practice can lead to wrong spacing in typeset documents.) - In addition, when the variable is non-@code{nil} and there is an active region outside math mode, typing @kbd{$} will put around the active region symbols for opening and closing inline equation and keep the region @@ -469,6 +461,9 @@ following to your init file Math mode which didn't start with dollar(s) shouldn't be closed with dollar. @defopt TeX-refuse-unmatched-dollar +This option @emph{has no effect} when @code{TeX-electric-math} is +non-@code{nil}. + This option determines the behavior when the user types @kbd{$} at a position where @AUCTeX{} thinks that it is in math mode which didn't start with dollar(s). @@ -5326,7 +5321,7 @@ Here is a simple example of a style file. (TeX-add-style-hook "book" - (lambda () + (lambda () (LaTeX-largest-level-set "part")) TeX-dialect) @end lisp @@ -6290,7 +6285,7 @@ buffer. Note that you can make, say @samp{Makeinfo}, the default by adding this statement in your init file: @lisp -(add-hook 'Texinfo-mode-hook +(add-hook 'Texinfo-mode-hook (lambda () (setq TeX-command-default "Makeinfo"))) @end lisp diff --git a/doc/changes.texi b/doc/changes.texi index 0d57a654..7a5f95fe 100644 --- a/doc/changes.texi +++ b/doc/changes.texi @@ -213,6 +213,38 @@ Now synctex option is @option{--synctex=repeat} instead of ignores @option{--synctex} option if @option{--nonstop} is present. @end itemize +@item +@code{LaTeX-insert-left-brace}, @code{TeX-insert-dollar} and +@code{TeX-insert-backslash} now have appropriate @code{delete-selection} +properties, that differentiate between the ``electric'' and +``just-insert-the-symbol'' behavior. That should simplify cooperation +with other electric modes. + +As a result of this adjustment, the behavior of @code{TeX-insert-dollar} +is affected in some ways: +@itemize @minus +@item +With raw prefix argument @kbd{C-u}, @kbd{$} (@code{TeX-insert-dollar}) now +inserts four dollars as opposed to one. This behavior is in-line with +other symbols, in particular @kbd{"} (@code{TeX-insert-quote}) and @kbd{\} +(@code{TeX-insert-backslash}). If you need one literal @samp{$}, you can +type @kbd{C-1 $} or @kbd{C-q $}. +@item +We no longer have explicit support of the special behavior that +if @code{TeX-electric-math} is non-nil and point is inside math +mode right between a couple of single dollars, pressing @kbd{$} +will insert another pair of dollar signs and leave the point +between them. + +It still works as before if @code{TeX-electric-math} is pair of dollars +while it inserts @samp{\(} and @samp{\)} when @code{TeX-electric-math} is +@code{("\(" . "\)")}. +@item +When @code{TeX-electric-math} is a pair of dollars and the point is in +inline math (without active region, @kbd{$} inserts two dollars, not one +dollar which just closes the math mode. +@end itemize + @item @AUCTeX{} now requires GNU Emacs 27.1 or higher. @end itemize @@ -1621,7 +1653,7 @@ Verbatim commands like @samp{\verb|...|} will not be broken anymore during filling. @item -You can customize the completion for graphic files with +You can customize the completion for graphic files with @code{LaTeX-includegraphics-read-file}. @item
master updated (dc1a8ee5 -> 45ee2f9e)
ikumi pushed a change to branch master. from dc1a8ee5 Delete `LaTeX-env-contents' new 3b0becf0 Split out the electric version of `LaTeX-insert-left-brace' new 7b8ae52d Amend TeX electric commands to allow alternative electric modes new 45ee2f9e Update documentaion on changes related to delete-selection Summary of changes: doc/auctex.texi | 17 ++- doc/changes.texi | 34 +- latex.el | 123 ++ tex.el | 313 +++ 4 files changed, 270 insertions(+), 217 deletions(-)
master 7b8ae52d 2/3: Amend TeX electric commands to allow alternative electric modes
branch: master commit 7b8ae52d828db69294abf0f79d8111e105a9595a Author: Artem Yurchenko Commit: Ikumi Keita Amend TeX electric commands to allow alternative electric modes 1. In particular, we are splitting out the electric logic of `TeX-insert-dollar'. 2. We've clarified that `TeX-refuse-unmatched-dollar' doesn't have an effect when `TeX-electric-math' is non-nil. The reason is that it's complicated to support all math delimiters consistently, and the need for this feature is unclear. If there is a demand to support this in the future, it can be done. It's explained below in Appendix I. 3. We've removed the special case where > If [[`TeX-electric-math']] non-nil and point is inside math > mode right between a couple of single dollars, pressing `$' > will insert another pair of dollar signs and leave the point > between them. 4. We've changed `C-u $' to insert four dollars as opposed to one. This behavior is in-line with other symbols, in particular `TeX-insert-quote' and `TeX-insert-backslash'. If someone needs one literal `$', they can type `C-1 $' or `C-q $'. 5. We've set appropriate `delete-selection' properties for `TeX-insert-backslash', `TeX-newline' and `TeX-insert-dollar'. See the backstory below or the docstring for `TeX--put-electric-delete-selection'. 6. We didn't fix `TeX-insert-quote'. Maybe later. The backstory. When a function bound to SYMBOL has optional «electric» behavior, it might interfere with other «electric» modes, e.g. `electric-pair-mode', `smartparens-mode'; see bug#47936. As a way to «override» those modes, we use raw `insert' instead of `self-insert-command'. That prevents those electric modes from running their hooks tied to `self-insert-command'. However, when /our/ electric behavior is disabled (ELECTRICP is nil), we want other electric modes to operate freely. That means, on the non-electric path, we should use `self-insert-command' instead of `insert'. Now, there arises an issue of `delete-selection'. The electric path usually doesn't want to delete selection, it wants to operate some electricity on it; see bug#36385, bug#23177. Now, we could think that `delete-selection' for the non-electric path should be t. That would disable other electric modes from working, as they also need to operate on selection. The decision is to inherit `delete-selection' from `self-insert-command', which queries hooks from other electric modes to determine whether deletion is necessary. Appendix I. To support a (generalized) TeX-insert-dollar with electric-math, we would want the following. We would want to forbid /arbitrary/ math mode nesting, independent of the delimiter in TeX-electric-math. However, the naive approach causes issues with display math via "$$ bla-bla $$". When the user presses $ once, they get "$-!-$". When they press $ again, they can't get "$$-!-$$", because that is considered as "nested math". A simple way to fix this would be to special-case handling of a dollar insert. However, a more satisfactory way would be to "cycle" through inline math, display math and no math on $ presses. We actually already implement that behavior on $ presses on a region. * tex.el: (TeX-insert-dollar-electric-region, TeX-insert-dollar-electric): (TeX--blink-matching-dollar, TeX-insert-dollar-action): New function to refactor `TeX-insert-dollar'. (TeX-insert-dollar): Use them. (TeX-insert-dollar-1): Remove. (TeX-electric-math, TeX-refuse-unmatched-dollar): Adjust the doc stirng. (): Add appropriate `delete-selection' property to `TeX-insert-backslash', `TeX-insert-dollar' and `TeX-insert-quote'. --- tex.el | 271 - 1 file changed, 135 insertions(+), 136 deletions(-) diff --git a/tex.el b/tex.el index 2235df27..503a54b3 100644 --- a/tex.el +++ b/tex.el @@ -5141,6 +5141,9 @@ This function implements the idea from the last paragraph." (TeX-electric-macro) (self-insert-command arg))) +(TeX--put-electric-delete-selection + #'TeX-insert-backslash (lambda () TeX-electric-escape)) + (defun TeX-insert-sub-or-superscript (arg) "Insert typed key ARG times and possibly a pair of braces. Brace insertion is only done if point is in a math construct and @@ -5155,6 +5158,8 @@ Brace insertion is only done if point is in a math construct and "Call the function specified by the variable `TeX-newline-function'." (interactive) (call-interactively TeX-newline-function)) +(put #'TeX-newline 'delete-selection t) + (progn (let ((map TeX-mode-map)) ;; Standard @@ -6149,18 +6154,14 @@ See `TeX-math-input-meth
master 3b0becf0 1/3: Split out the electric version of `LaTeX-insert-left-brace'
branch: master commit 3b0becf00535f77d47db8e39e17a726504254f53 Author: Artem Yurchenko Commit: Ikumi Keita Split out the electric version of `LaTeX-insert-left-brace' Set the proper `delete-selection` property. The backstory. When a function bound to SYMBOL has optional «electric» behavior, it might interfere with other «electric» modes, e.g. `electric-pair-mode', `smartparens-mode'; see bug#47936. As a way to «override» those modes, we use raw `insert' instead of `self-insert-command'. That prevents those electric modes from running their hooks tied to `self-insert-command'. However, when /our/ electric behavior is disabled (ELECTRICP is nil), we want other electric modes to operate freely. That means, on the non-electric path, we should use `self-insert-command' instead of `insert'. Now, there arises an issue of `delete-selection'. The electric path usually doesn't want to delete selection, it wants to operate some electricity on it; see bug#36385, bug#23177. Now, we could think that `delete-selection' for the non-electric path should be t. That would disable other electric modes from working, as they also need to operate on selection. The decision is to inherit `delete-selection' from `self-insert-command', which queries hooks from other electric modes to determine whether deletion is necessary. The changelog. * tex.el (TeX--put-electric-delete-selection): New function, sets the appropriate `delete-selection' property for electric functions. * latex.el (LaTeX-insert-left-brace): Split out electric logic into a few function `LaTeX-insert-left-brace-electric' Set appropriate `delete-selection'. --- latex.el | 123 --- tex.el | 42 ++ 2 files changed, 96 insertions(+), 69 deletions(-) diff --git a/latex.el b/latex.el index e66f4116..67680cee 100644 --- a/latex.el +++ b/latex.el @@ -3285,80 +3285,65 @@ supply the corresponding macro such as \\right before the right brace macro." (LaTeX-insert-corresponding-right-macro-and-brace left-macro left-brace optional) +(defun LaTeX-insert-left-brace-electric (brace) + "Insert typed left BRACE and a corresponding right brace. + +BRACE should be a character. See `LaTeX-insert-left-brace' for +allowed BRACE values." + (when (and (TeX-active-mark) (> (point) (mark))) +(exchange-point-and-mark)) + (let ((lbrace (char-to-string brace)) lmacro skip-p) +;; Use `insert' rather than `self-insert-command' so that +;; unexpected side effects from `post-self-insert-hook', +;; e.g. `electric-pair-mode', won't mess up the following +;; outcomes. (bug#47936) +(insert brace) +(save-excursion + (backward-char) + ;; The brace "{" is exceptional in two aspects. + ;; 1. "\{" should be considered as a single brace + ;;like "(" and "[". + ;; 2. "\left{" is nonsense while "\left\{" and + ;;"\left(" are not. + (if (string= lbrace TeX-grop) + ;; If "{" follows "\", set lbrace to "\{". + (if (TeX-escaped-p) + (progn +(backward-char) +(setq lbrace (concat TeX-esc TeX-grop))) +;; Otherwise, don't search for left macros. +(setq skip-p t))) + (unless skip-p +;; Obtain the name of preceding left macro, if any, +;; such as "left", "bigl" etc. +(setq lmacro (LaTeX--find-preceding-left-macro-name +(let ((TeX-arg-right-insert-p t) + ;; "{" and "}" are paired temporally so that typing + ;; a single "{" should insert a pair "{}". + (TeX-braces-association + (cons (cons TeX-grop TeX-grcl) TeX-braces-association))) + (save-excursion +(if (TeX-active-mark) +(goto-char (mark))) +(LaTeX-insert-corresponding-right-macro-and-brace + lmacro lbrace) + (defun LaTeX-insert-left-brace (arg) - "Insert typed left brace ARG times and possibly a correspondig right brace. + "Insert typed left brace ARG times and possibly a corresponding right brace. Automatic right brace insertion is done only if no prefix ARG is given and `LaTeX-electric-left-right-brace' is non-nil. Normally bound to keys \(, { and [." (interactive "*P") - ;; If you change the condition for `auto-p', adjust the condition in - ;; the `delete-selection' property, just below this defun, accordingly. - (let ((auto-p (and LaTeX-electric-left-right-brace (not arg -(if (and auto-p - (TeX-active-mark) - (> (point) (mark))) -(exchange-point-and-mark)) -(i
master 970787f9: Improve paragraph commands management for ConTeXt mode (bug#70811)
branch: master commit 970787f92d21447296c474bee954ac1ac3e0b8de Author: Ikumi Keita Commit: Ikumi Keita Improve paragraph commands management for ConTeXt mode (bug#70811) * context.el (ConTeXt-paragraph-commands): New customize option similar to LaTeX counterpart. (ConTeXt-extra-paragraph-commands): Provide proper defvar. (ConTeXt-paragraph-commands-regexp-make): Rename from `ConTeXt-paragraph-commands-regexp' for consistency with latex.el. Include `ConTeXt-paragraph-commands' to generate the regexp. (ConTeXt-paragraph-commands-regexp): Add alias for backward compatibility. (ConTeXt-set-paragraph-start): Factor out following latex.el. (ConTeXt-paragraph-commands-add-locally): New convinience function similar to LaTeX counterpart. (ConTeXt-mode-cleanup): Use new functions. --- context.el | 63 +++--- 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/context.el b/context.el index 0d5b9adb..8b0c88ee 100644 --- a/context.el +++ b/context.el @@ -53,9 +53,6 @@ (require 'latex) ; for functions like `TeX-look-at' and `LaTeX-split-long-menu' (require 'plain-tex) ; for `plain-TeX-common-initialization' -;; Silence the compiler: -(defvar ConTeXt-extra-paragraph-commands) - (defgroup ConTeXt-macro nil "Special support for ConTeXt macros in AUCTeX." :prefix "TeX-" @@ -1121,18 +1118,59 @@ If OPTIONAL, only insert it if not empty, and then use square brackets." (defvar ConTeXt-item-list () "List of macro's considered items.") -(defun ConTeXt-paragraph-commands-regexp () - "Return a regexp matching macros that should have their own line." +(defvar ConTeXt-extra-paragraph-commands nil + "List of default ConTeXt macros that should begin their own line. +Unlike `ConTeXt-paragraph-commands', each entry should be a regular +expression without leading backslash. +Updated in language-specific initialization.") + +(defcustom ConTeXt-paragraph-commands nil + "List of user ConTeXt macros that should begin their own line. +The list should contain macro names without the leading backslash. + +If you change this variable, its value is reflected to only new buffers +created afterwards; existing ConTeXt mode buffers aren't affected." + :group 'ConTeXt-macro + :type '(repeat (string))) + +(defun ConTeXt-paragraph-commands-regexp-make () + "Return a regexp matching macros that should begin their own line." (concat - (regexp-quote TeX-esc) "\\(" + (regexp-quote TeX-esc) "\\(?:" "[][]\\|" ; display math delimitors (is this applicable to ConTeXt??) (ConTeXt-environment-start-name) "\\|" (ConTeXt-environment-stop-name) "\\|" (mapconcat #'car ConTeXt-numbered-section-list "\\b\\|") "\\b\\|" (mapconcat #'car ConTeXt-unnumbered-section-list "\\b\\|") "\\b\\|" + (mapconcat #'identity ConTeXt-paragraph-commands "\\b\\|") "\\b\\|" (mapconcat #'identity ConTeXt-extra-paragraph-commands "\\b\\|") "\\b\\|" (mapconcat #'identity ConTeXt-item-list "\\b\\|") "\\b\\)")) +;; Backward compatibility. +(defalias 'ConTeXt-paragraph-commands-regexp + #'ConTeXt-paragraph-commands-regexp-make) + +(defun ConTeXt-set-paragraph-start () + "Set `paragraph-start'." + (setq paragraph-start +(concat + "[ \t]*\\(?:" + LaTeX-paragraph-commands-regexp "\\|" + "\\$\\$\\|" ; Plain TeX display math + "$\\)"))) + +(defun ConTeXt-paragraph-commands-add-locally (commands) + "Make COMMANDS be recognized as paragraph commands. +COMMANDS can be a single string or a list of strings which will be added +to `ConTeXt-extra-paragraph-commands'. Additionally +`LaTeX-paragraph-commands-regexp' will be updated. +This is mainly a convenience function which can be used in style files." + (unless (listp commands) (setq commands (list commands))) + (dolist (elt commands) +(add-to-list 'ConTeXt-extra-paragraph-commands elt)) + (setq-local LaTeX-paragraph-commands-regexp + (ConTeXt-paragraph-commands-regexp-make)) + (ConTeXt-set-paragraph-start)) ;; Outline support @@ -1908,16 +1946,11 @@ Run after mode hooks and file local variables application." (mapconcat #'identity ConTeXt-item-list "\\|") "\\)\\>"))) - ;; Don't do locally-bound test for `LaTeX-paragraph-commands-regexp' - ;; and `paragraph-start'. See comments in similar part in latex.el. (setq-local LaTeX-paragraph-commands-regexp - (ConTeXt-paragraph-commands-regexp)) - (setq paragraph-start -(concat - "[ \t]*\\(" - (ConTeXt-paragraph-commands-regexp) "\\|"
Re: [PATCH] fix delete-property handling
Hi Artem, >>>>> Artem Yurchenko writes: >> I moved the call to `TeX-math-input-method-off' out of the `if' form in >> my local repository so that it's called always when >> `TeX-insert-dollar-electric' runs, because this is the current behavior >> of `TeX-insert-dollar'. > While it is indeed the current behaviour, it didn't seem right. When > we call electric math on a region, we end up /outside/ of math > mode. For example: > point bla-bla mark → press $ → $bla-bla$ point. > So, if we're outside of math, why turn off the input methods? Indeed! I'll revert it and let it be as you proposed again. Thank you. >> Now I think AUCTeX can incorporate your patches. Did your copyright >> assignment process finish? If not, I'll push the change to the git repo >> after you notify us the completion of the process. > It's been more than a month since I've sent my signed papers, and > still no progress :( I have signed them though, I can send them here > too. It's just the FSF signature that is missing. Hmm, that's a pity. Arash, Tassilo, Mosè and David, what do you think about it? Best regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master 77497418: Fix compilation on Emacs 27
branch: master commit 774974185a1a49db4ff0d48121c33b77e0546a04 Author: Ikumi Keita Commit: Ikumi Keita Fix compilation on Emacs 27 * tex.el (require): Require subr-x for `if-let' introduced in `TeX-master-output-file'. --- tex.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tex.el b/tex.el index e13c02ce..749037b5 100644 --- a/tex.el +++ b/tex.el @@ -34,7 +34,8 @@ (require 'custom) (require 'tex-site) (eval-when-compile - (require 'cl-lib)) + (require 'cl-lib) + (require 'subr-x)) (require 'texmathp) ;; seq.el is preloaded in Emacs 29, so the next form can be removed ;; once 29 is the minimum required Emacs version
Re: [PATCH] fix delete-property handling
Hi Artem, >>>>> Artem Yurchenko writes: > I haven't seen any objections, so I moved on with restoring the old > behaviour. Thank you for your cooperation. >>> +(define-obsolete-variable-alias 'TeX-refuse-unmatched-dollar >>> + 'TeX-refuse-nested-math "13.4" >> The next AUCTeX version would be 14. (The ELPA releases already reached >> 14.) So the version should be "14" or "14.1". > Since I've restored the old behaviour, it makes sense to preserve the > old variable name. OK. >> In general, an elisp function whose name ends with "-mode" is a major or >> minor mode function, or is expected to do something related to major or >> minor modes, at least within AUCTeX source. Thus I'd like you to change >> this name `TeX-insert-dollar-mode' to `TeX-insert-dollar-action' or >> something like that for coherency. (Since it can be considered as a >> private helper function, you might as well assign it a name >> "TeX--insert-..."; but that isn't much important.) > Done. However, I don't want to make it private, since the helper could > be useful to other electric modes, which can enable or disable > features based on the operation mode. OK. >> In addition, I'd request to provide appropriate patches for >> doc/auctex.texi and doc/changes.texi, too. :-) > Done. Thanks. I'll add one minor modification, in addition to some trivial adjustments: -- (defun TeX-insert-dollar-electric () "Perform electric math symbol insertion. See `TeX-electric-math'." (if (and (TeX-active-mark) (/= (point) (mark))) (TeX-insert-dollar-electric-region) (insert (car TeX-electric-math)) (save-excursion (insert (cdr TeX-electric-math (TeX-math-input-method-off)) <-- CHANGED -- I moved the call to `TeX-math-input-method-off' out of the `if' form in my local repository so that it's called always when `TeX-insert-dollar-electric' runs, because this is the current behavior of `TeX-insert-dollar'. Now I think AUCTeX can incorporate your patches. Did your copyright assignment process finish? If not, I'll push the change to the git repo after you notify us the completion of the process. Best regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
main 56b5dab1: Recover compatibility with non-GNU sed
branch: main commit 56b5dab16630ea31dbcec239f10b04a3748c5408 Author: Ikumi Keita Commit: Ikumi Keita Recover compatibility with non-GNU sed * GNUmakefile (LASTVERSION): Avoid syntax invalid for non-GNU sed. --- GNUmakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 507d69fd..4f90cd07 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -101,7 +101,8 @@ AUCTEXDATE:=$(shell (git log -n1 --pretty=tformat:"%ci" 2>/dev/null \ THISVERSION:=$(shell git show HEAD -- auctex.el 2>/dev/null \ | sed -nre 's/[+];; Version: ([0-9]+.[0-9]+.[0-9]+)/\1/p') # Extract the last released version number from `auctex.el`. -LASTVERSION:=$(shell sed -nre '/Version:/{s/;; Version: ([0-9]+.[0-9]+.[0-9]+)/\1/p;q}' auctex.el) +LASTVERSION:=$(shell grep "^;; Version:" auctex.el \ + | sed -nre 's/;; Version: ([0-9]+.[0-9]+.[0-9]+)/\1/p;q') AUCTEXVERSION:=$(if $(THISVERSION),$(THISVERSION),$(LASTVERSION).$(AUCTEXDATE)) tex-site.el: tex-site.el.in
master 255da611: Add function TeX-master-output-file
branch: master commit 255da61131a20b1f72ce656bec5d4cf8ccf0f0ac Author: Paul Nelson Commit: Ikumi Keita Add function TeX-master-output-file * tex.el (TeX-master-output-file): New function. --- tex.el | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tex.el b/tex.el index 9fb533ff..d2864b5f 100644 --- a/tex.el +++ b/tex.el @@ -2608,6 +2608,16 @@ ARGNAME is prepended to the quoted output directory. If (concat argname "\"" out-dir "\"") ""))) +(defun TeX-master-output-file (extension) + "Return the output file with given EXTENSION. +If `TeX-output-dir' is nil, then defer to `TeX-master-file'. Otherwise, +return the file of the same name, but in the build directory specified by +`TeX-output-dir'." + (let ((master (TeX-master-file extension))) +(if-let ((output-dir (TeX--master-output-dir (TeX-master-directory) t))) +(concat output-dir (file-name-nondirectory master)) + master))) + (defcustom TeX-style-local "style" "Directory containing hand generated TeX information.
Re: [can't compile the main branch]
Hi all, >>>>> Stefan Monnier writes: >> And I like the way the manual is formatted. Compare this: >> https://www.gnu.org/software/auctex/manual/auctex.html >> with this: >> https://elpa.gnu.org/devel/doc/auctex.html > Hmm... nice. FWIW, the elpa rendering is the same as that of > https://www.gnu.org/software/emacs/manual/html_node/emacs/index.html > not sure why https://www.gnu.org/software/auctex/manual/auctex.html is > not as nice. The reason must be that the traditional AUCTeX html manuals are generated with texi2html, not makeinfo. A while ago, I noticed that the preview-latex html manual lacks its contents in the FAQ section[1] and am preparing to propose the attached change to use makeinfo rather than texi2html, so that others can test it. But it seems it's no longer necessary :-) [1] all nodes below https://www.gnu.org/software/auctex/manual/preview-latex/Frequently-Asked-Questions.html Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW >From 37a225843d9995b308a36942f3d38fdfbaec9a46 Mon Sep 17 00:00:00 2001 From: Ikumi Keita Date: Thu, 18 Apr 2024 22:18:24 +0900 Subject: [PATCH] Immigrate from texi2html to makeinfo * gendocs.sh.patch: New file. Copy from gendocspatch branch and arrange for use with makeinfo. * Makefile.in (www-doc): Arrange options for gendocs.sh for makeinfo. Change URL to retrieve gendocs.sh.patch from master branch. --- Makefile.in | 12 - gendocs.sh.patch | 67 2 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 gendocs.sh.patch diff --git a/Makefile.in b/Makefile.in index bc2ea951..c2c8bf83 100644 --- a/Makefile.in +++ b/Makefile.in @@ -605,17 +605,17 @@ www-doc: check-tag $(CP) auctex-$(TAG)/doc/*.texi $(WWWDIR)/manual cd $(WWWDIR)/manual \ && wget -O gendocs.sh 'https://cvs.savannah.gnu.org/viewvc/%2acheckout%2a/texinfo/texinfo/util/gendocs.sh' \ - && wget -O gendocs.sh.patch 'https://git.savannah.gnu.org/gitweb/?p=auctex.git;a=blob_plain;f=gendocs.sh.patch;hb=gendocspatch' \ + && wget -O gendocs.sh.patch 'https://git.savannah.gnu.org/gitweb/?p=auctex.git;a=blob_plain;f=gendocs.sh.patch;hb=master' \ && patch https://cvs.savannah.gnu.org/viewvc/%2acheckout%2a/texinfo/texinfo/util/gendocs_template' \ && sed -i -e 's/html_node\/index\.html/%%PACKAGE%%\/index.html/' gendocs_template \ && mkdir .texinfo \ - && echo -e "emacs split https://www.gnu.org/software/emacs/manual/html_node/emacs/\nemacs mono https://www.gnu.org/software/emacs/manual/html_mono/emacs.html\nreftex split https://www.gnu.org/software/auctex/manual/reftex/\nreftex mono https://www.gnu.org/software/auctex/manual/reftex.html\n; > .texinfo/htmlxref.cnf \ - && ./gendocs.sh --email bug-auc...@gnu.org --texi2html \ - --html --use-nodes auctex "AUCTeX Manual" \ - && ./gendocs.sh --email bug-auc...@gnu.org --texi2html \ - --html --use-nodes preview-latex "preview-latex Manual" + && echo -e "emacs node https://www.gnu.org/software/emacs/manual/html_node/emacs/\nemacs mono https://www.gnu.org/software/emacs/manual/html_mono/emacs.html\nreftex node https://www.gnu.org/software/auctex/manual/reftex/\nreftex mono https://www.gnu.org/software/auctex/manual/reftex.html\n; > .texinfo/htmlxref.cnf \ + && ./gendocs.sh --email bug-auc...@gnu.org \ + auctex "AUCTeX Manual" \ + && ./gendocs.sh --email bug-auc...@gnu.org \ + preview-latex "preview-latex Manual" preview-ball: check-tag test ! -d $(PREVIEW_BUILD_DIR) || rm -r $(PREVIEW_BUILD_DIR) diff --git a/gendocs.sh.patch b/gendocs.sh.patch new file mode 100644 index ..3c3967ce --- /dev/null +++ b/gendocs.sh.patch @@ -0,0 +1,67 @@ +--- gendocs.sh.orig 2014-10-29 14:25:47.404620794 +0100 gendocs.sh 2014-10-29 14:35:45.812600075 +0100 +@@ -320,9 +320,9 @@ + tar -czf "$abs_outdir/${PACKAGE}.html_$1.tar.gz" -- *.html + ) + eval html_$1_tgz_size=`calcsize "$outdir/${PACKAGE}.html_$1.tar.gz"` +- rm -f "$outdir"/html_$1/*.html +- mkdir -p "$outdir/html_$1/" +- mv ${split_html_dir}/*.html "$outdir/html_$1/" ++ rm -f "$outdir"/${PACKAGE}/*.html ++ mkdir -p "$outdir/${PACKAGE}/" ++ mv ${split_html_dir}/*.html "$outdir/${PACKAGE}/" + rmdir ${split_html_dir} + } + +@@ -351,9 +351,9 @@ + ) + eval \ + html_${split}_tgz_size=`calcsize "$outdir/$PACKAGE.html_$split.tar.gz"` +- rm -rf "$outdir/html_$split/" +- mv $split_html_dir "$outdir/html_$split/" +- du -s "$outdir/html_$split/" ++ rm -rf "$outdir/${PACKAGE}/" ++ mv $split_html_dir "$outdir/${PACKAGE}/" ++ du -s "$outdir/${PACKAGE}/" + ls -l "$outdir/$PACKAGE.html_$
master 0e315c7f: Support indirect buffer
branch: master commit 0e315c7fbeed081addf369fd42e7206d83580bc5 Author: Vangelis Evangelou Commit: Ikumi Keita Support indirect buffer * tex.el (TeX-buffer-file-name): New wrapper function for `buffer-file-name'. It returns base buffer's file name in indirect buffer. (TeX-master-file, TeX-normal-mode): Wrap the body in `with-current-buffer' in case called in indirect buffer. Omit an unused return value in `save-excursion' form. (TeX-master-directory): Omit redundant optional argument for `expand-file-name'. * bib-cite.el: * latex.el: * preview.el.in: * style/catchfilebetweentags.el: * style/pdfsync.el: * tex-info.el: * tex.el: * toolbar-x.el: Replace call to `buffer-file-name' and reference to `buffer-file-name' with call to `TeX-buffer-file-name' (or equivalent form). Copyright-paperwork-exempt: yes --- bib-cite.el | 2 +- doc/changes.texi | 12 +++ latex.el | 4 +- preview.el.in | 8 +- style/catchfilebetweentags.el | 2 +- style/pdfsync.el | 2 +- tex-info.el | 2 +- tex.el| 223 ++ toolbar-x.el | 6 +- 9 files changed, 142 insertions(+), 119 deletions(-) diff --git a/bib-cite.el b/bib-cite.el index 5a7de98f..7b425cac 100644 --- a/bib-cite.el +++ b/bib-cite.el @@ -1903,7 +1903,7 @@ If no master file, then return current default." ;; rather than\input file (re-search-forward "^[ \t]*\\(include\\|input\\){" nil t - (buffer-file-name)) + (TeX-buffer-file-name)) (t nil (cond diff --git a/doc/changes.texi b/doc/changes.texi index cae91aa2..0d57a654 100644 --- a/doc/changes.texi +++ b/doc/changes.texi @@ -11,6 +11,18 @@ @heading News in 14.1 @itemize @bullet +@item +@AUCTeX{} can be used with indirect buffers cloned from buffers visiting a +file. This feature allows having different perspectives of the same +buffer (narrowing, folding, previewing, etc). The indirect buffer has the +same master file as its base buffer. + +In indirect buffer, @previewlatex{} works naturally for region preview +such as @code{preview-region} (@kbd{C-c C-p C-r}), but document preview +@code{preview-document} (@kbd{C-c C-p C-d}) puts preview images in the +base buffer, not in the indirect buffer itself. We expect this behavior +doesn't matter because of the users' intent. + @item @AUCTeX{} changes major mode names. Its primary purpose is to avoid conflicts with Emacs built-in @TeX{} major modes. It also improves diff --git a/latex.el b/latex.el index c5965b05..9e769e97 100644 --- a/latex.el +++ b/latex.el @@ -2569,7 +2569,7 @@ string." Initial input is the name of the file being visited in the current buffer, with extension. If OPTIONAL is non-nil, insert it as an optional argument. Use PROMPT as the prompt string." - (let ((name (file-name-nondirectory buffer-file-name))) + (let ((name (file-name-nondirectory (TeX-buffer-file-name (TeX-argument-insert (TeX-read-string (TeX-argument-prompt optional @@ -2590,7 +2590,7 @@ current buffer, without extension. If OPTIONAL is non-nil, insert it as an optional argument. Use PROMPT as the prompt string." (let ((name (file-name-sans-extension - (file-name-nondirectory buffer-file-name + (file-name-nondirectory (TeX-buffer-file-name) (TeX-argument-insert (TeX-read-string (TeX-argument-prompt optional diff --git a/preview.el.in b/preview.el.in index 12500011..7b59a3de 100644 --- a/preview.el.in +++ b/preview.el.in @@ -3079,8 +3079,8 @@ pp") #'desktop-buffer-preview-misc-data) (add-hook 'pre-command-hook #'preview-mark-point nil t) (add-hook 'post-command-hook #'preview-move-point nil t) - (when buffer-file-name -(let* ((filename (expand-file-name buffer-file-name)) + (when (TeX-buffer-file-name) +(let* ((filename (expand-file-name (TeX-buffer-file-name))) format-cons) (when (string-match (concat "\\." TeX-default-extension "\\'") filename) @@ -4128,8 +4128,8 @@ The function bound to this variable will be called inside (if preview-preprocess-function (funcall preview-preprocess-function str) str)) - (if buffer-file-name - (file-name-nondirectory buffer-file-name) + (if (TeX-buffer-file-name) + (file-name-nondirectory (TeX-buffer-file-name)) "") (TeX-current-offset begin))) (setq TeX-current-proce
master 36590b04: Fix preview bug involving long common suffixes
branch: master commit 36590b044f86a546b1a0b21e89e301ed29408be4 Author: Paul Nelson Commit: Ikumi Keita Fix preview bug involving long common suffixes * preview.el.in (preview-parse-messages): Fix it. --- preview.el.in | 8 1 file changed, 8 insertions(+) diff --git a/preview.el.in b/preview.el.in index a2c0235d..12500011 100644 --- a/preview.el.in +++ b/preview.el.in @@ -3340,6 +3340,7 @@ call, and in its CDR the final stuff for the placement hook." (let (TeX-error-file TeX-error-offset snippet box counters file line (lsnippet 0) lstart (lfile "") lline lbuffer lpoint + lpos lcounters string after-string offset @@ -3610,6 +3611,12 @@ name(\\([^)]+\\))\\)\\|\ (car preview-current-region)) (goto-char (car preview-current-region))) + ;; Make sure that we don't accidentally match + ;; something earlier in the search that follows. + (and (eq (current-buffer) lbuffer) + (= lline line) + (goto-char (max (point) (- (1+ lpos) (length string) + (cond ((search-forward (concat string after-string) (line-end-position) t) @@ -3645,6 +3652,7 @@ name(\\([^)]+\\))\\)\\|\ string (line-end-position) t (setq lline line + lpos (point) lbuffer (current-buffer)) (if box (progn
Re: [can't compile the main branch]
>>>>> Uwe Brauer writes: > So I am confused now, shall I try out to make a symbolic link or not? You can try either way. Try one of the symblic link or this patch: diff --git a/build-aux/gitlog-to-auctexlog b/build-aux/gitlog-to-auctexlog index 808597d5..944d90ff 100755 --- a/build-aux/gitlog-to-auctexlog +++ b/build-aux/gitlog-to-auctexlog @@ -60,6 +60,12 @@ fi gen_origin=$2 } +# If this is not a Git repository, just generate an empty ChangeLog. +test -d .git || { + >"$output" + exit +} + # Get the new value for gen_origin from the latest version in the repository. new_origin=`git log --pretty=format:%H 'HEAD^!'` || exit @@ -68,12 +74,6 @@ if [ -f "$output" ]; then rm -f "$output" || exit 1 fi -# If this is not a Git repository, just generate an empty ChangeLog. -test -d .git || { - >"$output" - exit -} - # Use Gnulib's packaged ChangeLog generator. # Maybe we should skip all "Merge branch 'master'" messages. ./build-aux/gitlog-to-changelog \ Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: [can't compile the main branch]
Hi all, Hmm, build-aux/gitlog-to-auctexlog is not a perl script, actually is a Bourne shell script. I was looking at gitlog-to-changelog >>>>> Arash Esbati writes: > Hmm, build-aux/gitlog-to-auctexlog contains[1]: > # If this is not a Git repository, just generate an empty ChangeLog. > test -d .git || { >> "$output" > exit > } > Maybe Uwe has a .git directory in his setup, but it isn't a real .git > directory as Git would expect? It seems that the script bails out before reaching that line, here: new_origin=`git log --pretty=format:%H 'HEAD^!'` || exit ^^^ Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: [can't compile the main branch]
>>>>> Uwe Brauer writes: >>>> "SM" == Stefan Monnier writes: >>> Hence either >>> 1) Uwe installs git >> He does have Git installed. He's just working in a directory that's not >> under Git's control. > That is correct. I prefer to clone the auctex devel repo with mercurial, > since I am much more acquainted with mercurial, and therefore it is > easier for me to make a new branch for testing, than it is with git. I'm sorry, I was wrong about it. Uwe uses hg-git and the local repository doesn't contain .git directory. I don't remember well what hg-git does, but isn't there the "real" .git direcotry in the .hg directory? In other words, I suspect the directory structure is repo-dir -+- .hg -+- .git | | +- bib-cite.el +- FILES_FOR_MERCURIAL_REPO +- ... +- ... If this is correct, making symbolic link by ln -s .hg/.git . might be another mean to make gitlog-to-auctexlog work. > I tried out also the repository that I cloned with git and encounter > other problems, since my Emacs-repository-version is > "7bf17ceee8c2d347917541e143ce25609e90ebbb" > Even though emacs-version tells me 29.0.50 > And therefore too old. This is another problem. I suggest to use master branch and stay away from main branch until Uwe can use emacs 29.1 or newer. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: [can't compile the main branch]
Hi Uwe, >>>>> Uwe Brauer writes: > Thanks I applied the patch and run make EMACSBIN=/opt/emacs29/bin/emacs > Result: > fatal: not a git repository (or any of the parent directories): .git > sed -e 's|@lisppackagelispdir@|(file-name-directory load-file-name)|'\ > -e 's|@lisppackagedatadir@|(file-name-directory load-file-name)|'\ > -e 's|@lispautodir@|(if (file-writable-p "/usr/local/var/auctex") > "/usr/local/var/auctex" "~/.emacs.d/auctex")|'\ > -e 's|@AUCTEXVERSION@|14.0.4.2024-04-24_08:10:19|'\ > -e 's|@AUCTEXDATE@|2024-04-24_08:10:19|'\ > tex-site.el.in >tex-site.el > make: *** No rule to make target 'ChangeLog', needed by 'doc/version.texi'. > Stop. > Sorry, still does not work The GNUmakefile uses perl script build-aux/gitlog-to-auctexlog to generate Changelog, and that script calls git internally. Thus Changelog isn't generated without running git binary. Hence either 1) Uwe installs git 2) AUCTeX implements fallback in build-aux/gitlog-to-auctexlog is necessary to have Changelog. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master 195bceed: Supplement documentation
branch: master commit 195bceed828c7a16bed9c63a2db08ec1667a8264 Author: Ikumi Keita Commit: Ikumi Keita Supplement documentation * doc/preview-latex.texi (The Emacs interface): * preview.el.in (preview-leave-open-previews-visible): Adjust and enhance the explanation of the new customize option. --- doc/preview-latex.texi | 7 ++- preview.el.in | 8 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/preview-latex.texi b/doc/preview-latex.texi index 0c1fb730..0bce9747 100644 --- a/doc/preview-latex.texi +++ b/doc/preview-latex.texi @@ -674,7 +674,12 @@ current point should be temporarily opened. Default value is @code{nil}. @item preview-leave-open-previews-visible This boolean variable determines whether to leave preview images visible -(above their generating TeX code) when they are opened. +when they are opened. + +There is a side effect in enabling this option. The preview image doesn't +turn into construction sign temporarily when you edit the underlying +@LaTeX{} code and regenerate the preview; it is just replaced by updated +image when ready. This behavior suppresses flicker in the appearance. @end vtable diff --git a/preview.el.in b/preview.el.in index 1f65f728..a2c0235d 100644 --- a/preview.el.in +++ b/preview.el.in @@ -1213,7 +1213,13 @@ is located." (defcustom preview-leave-open-previews-visible nil "Whether to leave previews visible when they are opened. If nil, then the TeX preview icon is used when the preview is opened. -If non-nil, then the preview image is moved above the text." +If non-nil, then the preview image remains visible. In either case, the +TeX code appears either below or to the right of the displayed graphic. + +If you enable this option, the preview image doesn't turn into +construction sign temporarily when you edit the underlying LaTeX code +and regenerate the preview; it is just replaced by updated image when +ready. This behavior suppresses flicker in the appearance." :group 'preview-appearance :type 'boolean)
master 44879847: Adjust ConTeXt options (bug#70399)
branch: master commit 44879847609f0ac14a18841a363012e5e979b8ca Author: Ikumi Keita Commit: Ikumi Keita Adjust ConTeXt options (bug#70399) * tex.el (TeX-command-list): Remove obsolete option "--texutil". * context.el (ConTeXt-expand-options): Use "repeat" for synctex option for the latest ConTeXt. Don't add nonstop option when synctex option exists. * doc/changes.texi: Mention the above changes. --- context.el | 9 +++-- doc/changes.texi | 14 ++ tex.el | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/context.el b/context.el index 29bbccd6..0d5b9adb 100644 --- a/context.el +++ b/context.el @@ -1747,8 +1747,13 @@ Use `ConTeXt-Mark-version' to choose the command." ((string= ConTeXt-Mark-version "IV") (concat (if TeX-source-correlate-mode - "--synctex=1 ") - (unless TeX-interactive-mode + "--synctex=repeat ") + ;; Omit nonstop option when we set synctex option. According to + ;; Jim in bug#70399 report, + ;; "if context is called with "--nonstopmode" (or "--nonstop") + ;; the "--synctex=..." request to create a synctex file is + ;; over-ridden." + (unless (or TeX-interactive-mode TeX-source-correlate-mode) ConTeXt-texexec-option-nonstop))) ;; In any other case fall back on Mark II. (t diff --git a/doc/changes.texi b/doc/changes.texi index 098195ac..cae91aa2 100644 --- a/doc/changes.texi +++ b/doc/changes.texi @@ -187,6 +187,20 @@ In Fold mode, the original source text is revealed when you click the folded portion by mouse. You can customize the detailed behavior by new customize option @code{TeX-fold-auto-reveal}. +@item +@AUCTeX{} adjusts @ConTeXt{} option. +@itemize @minus +@item +Obsolete option @option{--texutil} was removed. +@item +Now synctex option is @option{--synctex=repeat} instead of +@option{--synctex=1} for @ConTeXt{}. +@item +@AUCTeX{} omits @option{--nonstop} option when +@code{TeX-source-correlate-mode} is enabled because @command{context} +ignores @option{--synctex} option if @option{--nonstop} is present. +@end itemize + @item @AUCTeX{} now requires GNU Emacs 27.1 or higher. @end itemize diff --git a/tex.el b/tex.el index 2ab35875..985cb71e 100644 --- a/tex.el +++ b/tex.el @@ -211,7 +211,7 @@ If nil, none is specified." TeX-run-TeX nil (AmSTeX-mode) :help "Run AMSTeX") ;; support for ConTeXt --pg ;; first version of ConTeXt to support nonstopmode: 2003.2.10 -("ConTeXt" "%(cntxcom) --once --texutil %(extraopts) %(execopts)%t" +("ConTeXt" "%(cntxcom) --once %(extraopts) %(execopts)%t" TeX-run-TeX nil (ConTeXt-mode) :help "Run ConTeXt once") ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t" TeX-run-TeX nil
Re: [PATCH] fix delete-property handling
Hi Artem, >>>>> Artem Yurchenko writes: > I'm attaching two patches for the current master. I've tried to fix > all of the regressions you've pointed out and apply all of the > suggestions you've made. Thank you! >>> 2. Suppose that TeX-electric-math is a pair of dollars. Then typing $ >>> at >>> $E = mc^2-!- >>> inserts two dollars, not one dollar. > I am personally still not a fan for special casing of dollars in a > situation like that. > While it can happen in some situations as you've pointed out, we're > supporting this «insert the matching sign» behaviour only for the > dollar sign. All other electric math options do not get this benefit. > Furthermore, it's easily amended by typing C-d. > Furthemore, if we had > $E = mc^2-!- bar-bar $ foo-foo > and typed $, we would get > $E = mc^2$-!- bar-bar $ foo-foo > which moves previously math-mode «bar-bar» into text-mode and > previously text-mode «foo-foo» into (an unclosed) math-mode. > With the new behaviour from my previous pacthes, it would turn into > $E = mc^2$-!-$ bar-bar $ foo-foo, > preserving the modes. > All in all, given that neither solution is without flaws, I lean in > favour of the consistent one. Your argument makes sense, so I think AUCTeX can accept that suggestion. Are there anyone who object to this new behavior? (It is only relevant for users who customized `TeX-refuse-unmatched-dollar' to non-nil.) I'll comment on other minor matters. > +(define-obsolete-variable-alias 'TeX-refuse-unmatched-dollar > + 'TeX-refuse-nested-math "13.4" The next AUCTeX version would be 14. (The ELPA releases already reached 14.) So the version should be "14" or "14.1". > +(defun TeX-insert-dollar-mode (arg) In general, an elisp function whose name ends with "-mode" is a major or minor mode function, or is expected to do something related to major or minor modes, at least within AUCTeX source. Thus I'd like you to change this name `TeX-insert-dollar-mode' to `TeX-insert-dollar-action' or something like that for coherency. (Since it can be considered as a private helper function, you might as well assign it a name "TeX--insert-..."; but that isn't much important.) In addition, I'd request to provide appropriate patches for doc/auctex.texi and doc/changes.texi, too. :-) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Supporting LatexMK in AUCTeX OOTB
Hi Arash, >>>>> Arash Esbati writes: > This doesn't feel right. AUCTeX has some options to control the output, > and I think we should support them. I mean, the only issue is currently > with dvipdfmx as discussed above, and I don't think we should throw the > baby out with the bathwater because of this one glitch. And I think we > should also get close to what auctex-latexmk offers, and we're not far > away. WDYT? I think most Latexmk users have their own .latexmkrc because the stock Latexmk just runs latex enough times and generate .dvi file. (no pdflatex and no .pdf output) So I guess they are accustomed to have full control over the options with their .latexmkrc. However, I don't object to your idea, so please proceed. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: [PATCH] fix delete-property handling
Hi Artem, >>>>> Artem Yurchenko writes: > Suppose that TeX-electric-math is set to dollar and > TeX-refuse-unmatched-dollar is set to true. I am thinking, when is the > «refuse the dollar» behaviour going to happen? It's not going to > happen in inline math or display math — the user uses dollars for math > and we never «refuse the dollar» when enclosed by dollars. It's /only/ > going to apply in some environments that don't explicitly use dollars, > such as «equation», «align», «cases*» and so on. However, in some of > those environments this behaviour is going to be /incorrect/, as noted > in bug#57626, for example. > So, the only environment (sorry for the pun) where we «refuse the > dollar» is also the environment where that feature breaks > occasionally. Thanks, now I see what you mean. I naively imagine that users (if exist at all) who like such customization would happily type C-q $ when they encounter such refusal. Anyway, I think this topic isn't much important. >> I think other occurrence of single quotes in >>> you need exactly one $, you can use `C-1 $'. > I think I should use `C-1 \\[TeX-insert-dollar]' according to the help > entry on «Keys in Documentation»? I'm talking about single quotes surrounding the key sequence. ...Hm, I was thinking that elisp reference discourages to surround key sequence by single quotes, but it seems that's my hasty conclusion. Sorry, forget about this. >>> Otherwise, when in a verbatim construct or escaped with `\\', > >should also fixed according to the elisp reference direction. > Oh, yes, missed that. By the same argument, I withdraw this remark as well. > I had an impression that it should blink to the closing paren when > applied to a region in the electric mode, but per docs it's not > required. However, it doesn't respect the behaviour of > blink-matching-paren, which allows the user to choose between jumping > onscreen, jumping offscreen or just blinking. Thanks for clarification. I don't think blinking is needed when there is an active region because the starting position is obvious without blinking. On the other hand, I realize that `TeX-insert-dollar' falls much behind at emulating emacs built-in paren-matching behavior. Well, it seems to me that poor blinking feature isn't a serious issue, so my opinion is to postpone it for now. :-) >> I noticed two incompatibilities with the current behavior. > Okay, I guess it is more difficult than I felt initially :D :-) >> 2. Suppose that TeX-electric-math is a pair of dollars. Then typing $ >> at >> $E = mc^2-!- >> inserts two dollars, not one dollar. > That is indeed a regression, however, I feel that it might be not very > serious. An electric user will almost always have balanced dollars. Unbalanced dollar often occurs during editing drafts and revising existing documents even for an electric user. Thus I think this behavior must be fixed. >> (This is optional) The revised patch increases calls to `texmathp'. It >> doesn't make much difference anyway, it is preferable if you can reduce >> them. > Will consider the best approach to this. My first idea is actually to > «cache» texmathp. That is, when we see that the buffer is unmodified > since the last call, we just don't do anything. I think it's enough to cache in one command execution. When the user types "$", `texmathp' is called once in `TeX-insert-dollar-refuse-p' and again at -- ((and (texmathp) (or (string= (car texmathp-why) "\$") (string= (car texmathp-why) "\$\$"))) -- in the body of `TeX-insert-dollar', in your last patch. I'm not sure whether you plan to keep the basic logic structure of electricity, but if it is kept, the first result of `texmathp' can be used for the second. (There is another call in `delete-selection' property which calls `TeX-insert-dollar-refuse-p', but it seems difficult to me to make use of cache in a simple and robust way.) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Supporting LatexMK in AUCTeX OOTB
Hi Arash, >>>>> Arash Esbati writes: > This is my next approximation: > diff --git a/tex.el b/tex.el > index c4e4104e..a0649c73 100644 > --- a/tex.el > +++ b/tex.el > @@ -250,6 +250,9 @@ If nil, none is specified." > ("Ps2pdf" "ps2pdf %f %(O?pdf)" TeX-run-ps2pdf nil > (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) > :help "Convert PostScript file to PDF") > +("LaTeXMK" "latexmk -recorder %(latexmk-out) %(file-line-error) \ I think we can omit "-recorder" option. It seems that Latexmk adds "-recorder" option to latex command by default. The reason why I put "-recorder-" in my proposal was to suppress that option; when %l expansion includes "\input", Latexmk puts "-recorder" between "\input" and .tex file name when it invokes latex, which leads to error. (I forgot to mention this in my previous message, sorry.) > Reg. this part: > +;; FIXME: This might be inaccurate: > +((and TeX-PDF-mode > + (string=3D (TeX-PDF-from-DVI) "Dvipdfmx")) > + " -pdfdvi") > I think users have to control the behavior of $dvipdf inside their > latexmk config file; I have no idea how this should work (and don't want > to investigate further). WDYT? Yes, I think so, too. Without changing $dvipdf value, Latexmk calls dvipdf, not dvipdfmx, in response to "-pdfdvi" option. Thus this treatment is half-cooked. :-( Maybe we should minimize the command option like ("LaTeXMK" "latexmk %(extraopts) %t" TeX-run-format nil (LaTeX-mode docTeX-mode) :help "Run LaTeXMK") and let the user to do all control over the option through .latexmkrc? Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Supporting LatexMK in AUCTeX OOTB
Hi Arash, >>>>> Arash Esbati writes: > So lets call it a preliminary solution ;-) I plan to install this > change as a starter: [...] > + ;; This is essentially (eq TeX-engine 'default) since we > + ;; ignore 'omega completely: This isn't quite correct because this clause covers cases for Japanese LaTeX engines (`TeX-engine' being ptex or uptex※) as well. ※ `jtex' engine became obsolete and isn't maintained anymore as far as I know. > + (t > + (cond ((and TeX-PDF-mode > + (not (TeX-PDF-from-DVI))) > + " -pdf") > +((and TeX-PDF-mode > + (TeX-PDF-from-DVI)) > + " -pdfdvi") > +;; FIXME: Which LaTeXMK options cover this: > +;; ((and TeX-PDF-mode > +;; (string= (TeX-PDF-from-DVI) "Dvipdfmx")) > +;; " ???") > +((and TeX-PDF-mode > + (string= (TeX-PDF-from-DVI) "Dvips")) > + " -pdfps") This clause is always ignored because of the above > +((and TeX-PDF-mode > + (TeX-PDF-from-DVI)) conditional, isn't it? Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: [PATCH] fix delete-property handling
Hi Artem, >>>>> Artem Yurchenko writes: > However, if we apply it when electricity is on, this option seems > somewhat misleadingly named and documented and doesn't make sense IMO. I agree that the situation is not totally consistent, because of the historical reason[1]. :-) > First, the name (and the doc) say that the option controls the insert > of a /dollar/ sign. Thus, if the TeX-electric-math is not a dollar, then > technically, this option shouldn't apply? That seems somewhat > inconsistent, because the reasoning behind the option is the same for > any math delimiter: «nested» math mode is invalid. I haven't considered the discrepancy seriously before. :-) But I think you speak right. > Now, suppose that the user sets TeX-electric-math to dollars. Then, > that option is not going to be applicable in many cases, as the user > is likely using «$» and «$$» as math delimiters. There are however > other environments, «equation», «align» etc where this option works. > There are also environments where this option breaks, which is why > this behaviour was made optional in the first place. Sorry, I can't follow. Can you elaborate? > Suppose that the user sets TeX-electric-math to non-nil, and not > dollars. Then, this option is not going to be applicable at all, as > the dollar key never inserts a dollar. In fact, the very name > «unmatched-dollar» no longer makes sense, because we are automatically > inserting two matching delimiters which are not dollars. If we follow the name «unmatched-dollar» rigorously, your argument makes sense. > So, the options I see are: > 1. Extend semantics of TeX-refuse-unmatched-dollar to other > delimiters, change the documentation, possibly change the name, create > the deprecated alias with the old name. > 2. Keep semantics and docs of TeX-refuse-unmatched-dollar, but confine > to when electricity is off. I don't have strong opinion about it. If you want to sort out the confusion and provide a consistent solution, I'm fine with either way. >>> +When ARG is given, insert a literal `$' ARG times. E.g., if you >> The elisp reference node "(elisp) Documentation Tips" directs not to use >> single quotes in the doc string in that way: >> , >> | • In documentation strings, do not quote expressions that are not >> | Lisp symbols, as these expressions can stand for themselves. For >> | example, write ‘Return the list (NAME TYPE RANGE) ...’ instead of >> | ‘Return the list `(NAME TYPE RANGE)' ...’ or ‘Return the list >> | \\='(NAME TYPE RANGE) ...’. >> ` > Fixed. I think other occurrence of single quotes in > you need exactly one $, you can use `C-1 $'. and > Otherwise, when in a verbatim construct or escaped with `\\', should also fixed according to the elisp reference direction. > The blinking probably should also be removed due to being very > inconsistent. Or fixed, if worth it. I wasn't aware of that inconsistency. Could you explain it? By the way... > It is not extremely difficult to keep that feature, and I have already > written a patch to do it. I noticed two incompatibilities with the current behavior. 1. In math environment (including \[...\]), it no longer allows to insert a escaped dollar sign (in other words, users cannot write "\$" by typing backslash followed by dollar.) Similarly, it no longer allows to insert dollar sign inside \verb|...| in math environment. This was introduced anew in the revised patch. 2. Suppose that TeX-electric-math is a pair of dollars. Then typing $ at $E = mc^2-!- inserts two dollars, not one dollar. This behavior existed prior to the revised patch. (This is optional) The revised patch increases calls to `texmathp'. It doesn't make much difference anyway, it is preferable if you can reduce them. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW [1] The option `TeX-electric-math' was added afterwards; the behavior when $ is typed in situation discussed now varied from time to time: https://lists.gnu.org/archive/html/auctex-devel/2005-12/msg0.html https://git.savannah.gnu.org/cgit/auctex.git/commit/?id=05c78e15cf89ee3cc5828a8decc21a0420729714 https://lists.gnu.org/archive/html/auctex-devel/2020-01/msg2.html https://git.savannah.gnu.org/cgit/auctex.git/commit/?id=13e6746758abcaf28bc61c2cbafcd52a8c9a6dd1 bug#57626 https://git.savannah.gnu.org/cgit/auctex.git/commit/?id=42150568f1d8ef9a556ecdc3f107e7f4cb02e7a9
Re: Supporting LatexMK in AUCTeX OOTB
Hi Arash, >>>>> Arash Esbati writes: >> AUCTeX users can deginate latex binary file names through >> `TeX-engine-alist' and `LaTeX-command', which can be different from >> standard "latex", "xelatex" and "lualatex". If we are to support such >> non-standard binary names, we need %l. (However, maybe this isn't much >> meaningful because fixed binary names of "latexmk" and "dvipdfmx" after >> all in my patch. :-)) > So the question is: What is the best course of action? I have no > problems with %l, but breaking Windows compatibility is bad. I realized that %l played an important role for Japanese LaTeX document, too; it gave latex binary name such as "platex" as well as its supplementary option such as "-kanji=xxx". However, I haven't come up with a good solution which is compatible for both windows and non-windows with respect to quoting. :-( I concluded that AUCTeX should incorporate your simple proposal and users who need other non-default options, e.g. Japanese latex binary names, should prepare their own config file such as .latexmkrc. It isn't a literal "OOB" solution, but I think it is the most practical approach and is user-friendly enough. :-) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: [PATCH] fix delete-property handling
Hi Artem, > This is my first time contributing and I expect to have made mistakes. I am > willing to react to comments and fix any deficiencies. Commentaries on the second patch follow. I think the two incompatibilities discussed there are permissible: (1) The special case where > If [[`TeX-electric-math']] non-nil and point is inside math ... (2) We've changed `C-u $' to insert four dollars as opposed to one. They are reasonable and we can announce work arounds for them. On the other hand, I'm afraid another incompatibility, due to refactoring of the electric logic of `TeX-insert-dollar', can be bad. Suppose that `TeX-electric-math' is "$...$" or "\(...\)" and `TeX-refuse-unmatched-dollar' is t. Then the current `TeX-insert-dollar' refuses to insert anything if the point is in math-mode which doesn't begin with "$" nor "$$". However, after your patch is applied, it just shows ordinary electric behavior; it inserts pair of "$...$" or "\(...\)". I'm not sure how this feature is important; maybe very few users concern about it. But I ask you to try to keep the compatibility first. If it is extremely difficult, let's discuss what to do. > +(TeX--put-electric-delete-selection > + #'TeX-newline (lambda () nil)) Is it right to inherit `delete-selection' property from `self-insert-command' for the command associated with RET key? I'm not familiar with delete selection mode, so I cannot tell. (By the way, (lambda () nil) can just be #'ignore .) > +(defun TeX-insert-dollar-electric-p () > + "Non-nil if `TeX-insert-dollar' should use the electric behaviour." This doc string looks like to explain a variable because it starts with "Non-nil if...". A doc string for a function should tell what this function does. > +(defun TeX-insert-dollar-electric-p () > + "Non-nil if `TeX-insert-dollar' should use the electric behaviour." > + (and (not current-prefix-arg) > + (not (TeX-escaped-p)) > + (not (TeX-verbatim-p)) > + TeX-electric-math)) It would be slightly efficient if it refers to `TeX-electric-math' before evaluation of `TeX-escaped-p' and `TeX-verbatim-p'. > +When ARG is given, insert a literal `$' ARG times. E.g., if you The elisp reference node "(elisp) Documentation Tips" directs not to use single quotes in the doc string in that way: , |• In documentation strings, do not quote expressions that are not | Lisp symbols, as these expressions can stand for themselves. For | example, write ‘Return the list (NAME TYPE RANGE) ...’ instead of | ‘Return the list `(NAME TYPE RANGE)' ...’ or ‘Return the list | \\='(NAME TYPE RANGE) ...’. ` In addition, the same node discourages to use "e.g." in the doc string: , |• Try to avoid using abbreviations such as “e.g.” (for “for | example”), “i.e.” (for “that is”), “no.” (for “number”), “cf.” (for | “compare”/“see also”) and “w.r.t.” (for “with respect to”) as much | as possible. It is almost always clearer and easier to read the | expanded version.(1) ` > +Otherwise, when in a verbatim or an escaped (with `\\') > +environment, insert one literal `$'. The term "environment" is ambiguous in this context because it's difficult to distinguish from "LaTeX environment". How about Otherwise, when in a verbatim construct or escaped with \"\\\",... instead? > +(TeX--put-electric-delete-selection > + #'TeX-insert-dollar TeX-insert-dollar-electric-p) The second argument must be quoted. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: [PATCH] fix delete-property handling
Hi Artem, >>>>> Artem Yurchenko writes: > Hello, > I am sending two patches that fix delete-property handling. They improve > interaction of auctex with other «electric» modes. Thanks for your proposals. I'm now reading through the proposed codes. They basically look good to me. I think that AUCTeX can accept them and it requires copyright assignment. I assume that you haven't signed FSF copyright assignment form before, so please follow this instruction if you want to have your proposal incorporated into AUCTeX: https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.future > This is my first time contributing and I expect to have made mistakes. I am > willing to react to comments and fix any deficiencies. I'd like to comment on the first patch now; I haven't read the second patch in detail yet. Commentary on the second would follow on another day. > +(defun TeX--put-electric-delete-selection (symbol electricp) > + "Set appropriate `delete-selection' property for electric functions. > + > +When the function bound to SYMBOL has «electric» behaviour, as > +determined by ELECTRICP, `delete-selection' is set to nil. In I think it should explicitly state that ELECTRICP is actually a predicate (function). > +However, when /our/ electric behaviour is disabled (ELECTRICP is > +nil), we want other electric modes to operate freely. Shouldn't it be "ELECTRICP returns nil" instead of "ELECTRICP is nil"? It seems as if ELECTRICP was just an boolean flag rather than a predicate. (This isn't a suggestion, just an impression.) > + (put symbol 'delete-selection > + (lambda () > + (unless (funcall electricp) > + (get #'self-insert-command 'delete-selection) Good simple solution. I wasn't aware that `delete-selection' property can return a function because of the commentary of delsel.el: ;; FUNCTION ;; For commands which need to dynamically determine this behavior. ;; FUNCTION should take no argument and return one of the above ;; values, or nil. In the latter case, FUNCTION should itself ;; do with the active region whatever is appropriate." I took that "one of the above values" doesn't include FUCTTION itself. However, `delete-selection-helper' is actually written to operate recursively, which I didn't realize. (That was the reason I wrote the current `delete-selection' property of `LaTeX-insert-left-brace' to discriminate the cases between '(yank supersede kill t nil) and a function.) (This is optional.) > +(defun LaTeX-insert-left-brace-electric () [...] > + (let ((lbrace (char-to-string last-command-event)) lmacro skip-p) [...] > +(insert last-command-event) Since `LaTeX-insert-left-brace-electric' is no longer a command bound to a key, I'm inclined to writing it to receive `last-command-event' as an argument of the function rather than to refer to the variable directly. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Supporting LatexMK in AUCTeX OOTB
Hi Arash, >>>>> Arash Esbati writes: >> 2. After C-c C-c LaTeXMK, in dvi+dvips case, C-c C-c View offers xdvi, >> not postscript viewer, as default candidate. Similarly, in >> dvi+dvipdfmx case, C-c C-c offers Dvipdfmx, not View, as default >> candidate. > Yes, I can confirm this. I also tried it with my approach with the same > result: C-c C-c View doesn't work. I didn't try to find out why, > though. It would need to write a new sentinel for latexmk if we are going to provide the most suitable candidate in all cases. > I have a question: Is putting the "progname='%`%l%(mode)%''" in each > entry necessary? AUCTeX users can deginate latex binary file names through `TeX-engine-alist' and `LaTeX-command', which can be different from standard "latex", "xelatex" and "lualatex". If we are to support such non-standard binary names, we need %l. (However, maybe this isn't much meaningful because fixed binary names of "latexmk" and "dvipdfmx" after all in my patch. :-)) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Supporting LatexMK in AUCTeX OOTB
>>>>> Ikumi Keita writes: > Hi Arash, >>>>> Arash Esbati writes: >> I knew you would understand me ;-) Can you do me a favor please and have >> a look at the code I posted? I'm not sure how (XeLaTeX/)Dvipdfmx works >> in .dvi mode, I think you have more experience in that area. I'd >> appreciate if you can give a me hint where to put that stuff. I took >> the conditional from our style/graphicx.el. > I don't use latexmk either, but I expect that an article[1] posted in > Japanese TeX users community would provide some insights about dvipdfmx > usage for us. I'll take a look tomorrow. > [1] https://texwiki.texjp.org/?AUCTeX I expect the attached patch basically works. It still has shortcomings: 1. It uses single quote to prevent variable expansion of '$dvipdf' in the shell command line. However, it doesn't work for windows. 2. After C-c C-c LaTeXMK, in dvi+dvips case, C-c C-c View offers xdvi, not postscript viewer, as default candidate. Similarly, in dvi+dvipdfmx case, C-c C-c offers Dvipdfmx, not View, as default candidate. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW diff --git a/tex.el b/tex.el index 053a0ade..6386ff24 100644 --- a/tex.el +++ b/tex.el @@ -250,6 +250,10 @@ If nil, none is specified." ("Ps2pdf" "ps2pdf %f %(O?pdf)" TeX-run-ps2pdf nil (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) :help "Convert PostScript file to PDF") +;; Suppress "-recorder" option because %l expantion can include +;; "\input", after which latexmk inserts "-recorder". +("LaTeXMK" "latexmk -recorder- %(latexmk-opt) %t" + TeX-run-format nil (LaTeX-mode docTeX-mode) :help "Run LaTeXMK") ("Glossaries" "makeglossaries %(d-dir) %s" TeX-run-command nil (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode) :help "Run makeglossaries to create glossary file") @@ -672,7 +676,35 @@ string." ;; Okular forward PDF search requires absolute path. ("%a" (lambda nil (prin1-to-string (expand-file-name (buffer-file-name) ;; the following is for preview-latex. -("%m" preview-create-subdirectory)) +("%m" preview-create-subdirectory) +;; LaTeXMK support +("%(latexmk-opt)" + (lambda () + (cond ((eq TeX-engine 'luatex) ; Running lualatex: + (if TeX-PDF-mode + " -pdflua -pdflualatex='%`%l%(mode)%''" +" -dvilua -ps -dvilualatex='%`%l%(mode)%''")) + ((eq TeX-engine 'xetex) ; Running xetex in any mode: + ;; FIXME: What to do when TeX-PDF-mode is nill? + " -pdfxe -pdfxelatex='%`%l%(mode)%''") + (t ; For anything else; we don't care Omega: + (cond ((and TeX-PDF-mode + ;; We want to produce a pdf + ;; Return t if default compiler produces PDF, + ;; nil for "Dvips" or "Dvipdfmx" + (not (TeX-PDF-from-DVI))) + ;; We're using pdflatex in pdf-mode + " -pdf -pdflatex='%`%l%(mode)%''") +;; We're generating a .dvi to process with dvips or +;; dvipdfmx. +((and TeX-PDF-mode + (equal (TeX-PDF-from-DVI) "Dvipdfmx")) + " -pdfdvi -latex='%`%l%(mode)%'' -e '$dvipdf=q/dvipdfmx %%O -o %%D %%S/'") +((and TeX-PDF-mode + (equal (TeX-PDF-from-DVI) "Dvips")) + " -pdfps -latex='%`%l%(mode)%''") +(t + " -dvi -ps -latex='%`%l%(mode)%''"))) "List of built-in expansion strings for TeX command names. This should not be changed by the user who can use @@ -2200,7 +2232,8 @@ Must be the car of an entry in `TeX-command-list'." "\\.glo" "\\.gls" "\\.idx" "\\.ilg" "\\.ind" "\\.lof" "\\.log" "\\.lot" "\\.nav" "\\.out" "\\.snm" "\\.toc" "\\.url" "\\.synctex\\.gz" -"\\.bcf" "\\.run\\.xml" "\\.fls" "-blx\\.bib") +"\\.bcf" "\\.run\\.xml" "\\.fls" "-blx\\.bib" +"\\.fdb_latexmk") "List of regexps matching suffixes of files to be cleaned. Used as a default in TeX, LaTeX and docTeX mode.")
Re: Supporting LatexMK in AUCTeX OOTB
Hi Arash, >>>>> Arash Esbati writes: > I knew you would understand me ;-) Can you do me a favor please and have > a look at the code I posted? I'm not sure how (XeLaTeX/)Dvipdfmx works > in .dvi mode, I think you have more experience in that area. I'd > appreciate if you can give a me hint where to put that stuff. I took > the conditional from our style/graphicx.el. I don't use latexmk either, but I expect that an article[1] posted in Japanese TeX users community would provide some insights about dvipdfmx usage for us. I'll take a look tomorrow. [1] https://texwiki.texjp.org/?AUCTeX Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Supporting LatexMK in AUCTeX OOTB
Hi Arash, >>>>> Arash Esbati writes: > Hi all, > I was looking through our old bugs and I saw bug#48144[1] which was > about LatexMK and the issue is resolved. Looking at auctex-latexmk > package[2], it seems dormant. Acc. to this message[3], the fix in > #48144 was helpful and adding LatexMK support to AUCTeX isn't hard. I > don't use LatexMK and don't have any idea how it works, but adding two > entries to `TeX-expand-list' and `TeX-command-list' should be doable. > What do others think? Is there a market for this addition? I'm fine with your idea. AUCTeX already has plenty of supplementary entries in `TeX-command-list', so it would be good to have another one :-) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master ec4e27ec: * doc/changes.texi: Add an entry for `TeX-fold-auto-reveal'.
branch: master commit ec4e27ec215a7023da2de13ac534b9cdbda8ab20 Author: Ikumi Keita Commit: Ikumi Keita * doc/changes.texi: Add an entry for `TeX-fold-auto-reveal'. --- doc/changes.texi | 5 + 1 file changed, 5 insertions(+) diff --git a/doc/changes.texi b/doc/changes.texi index 2ac2ee05..098195ac 100644 --- a/doc/changes.texi +++ b/doc/changes.texi @@ -182,6 +182,11 @@ The boolean custom variable @code{TeX-kill-process-without-query} can be used to disable the user query before aborting a running process for a @TeX{} document. Default is @code{nil}. +@item +In Fold mode, the original source text is revealed when you click the +folded portion by mouse. You can customize the detailed behavior by +new customize option @code{TeX-fold-auto-reveal}. + @item @AUCTeX{} now requires GNU Emacs 27.1 or higher. @end itemize
master 0fcc1523: Document the new customize option
branch: master commit 0fcc152333c411670230e6c8203da54f170c1362 Author: Ikumi Keita Commit: Ikumi Keita Document the new customize option * doc/auctex.texi (Folding): Add description about `TeX-fold-auto-reveal' to follow up the last commit (bug#69954). --- doc/auctex.texi | 24 1 file changed, 24 insertions(+) diff --git a/doc/auctex.texi b/doc/auctex.texi index b499c63b..6e9d33c3 100644 --- a/doc/auctex.texi +++ b/doc/auctex.texi @@ -2826,6 +2826,30 @@ Maximum length of original text displayed in a tooltip or the echo area for folded content. Set it to zero in order to disable this feature. @end defopt +@defopt TeX-fold-auto-reveal +This option determines the auto-reveal behavior when the point enters the +folded portion of the buffer. Possible values and the corresponding +behaviors are: +@itemize +@item +@code{t}: @AUCTeX{} always opens the folded expression and reveal the +original source text. +@item +@code{nil}: @AUCTeX{} never reveals. +@item +@var{SYMBOL}: The value of @var{SYMBOL} is used as a boolean flag. If +@var{SYMBOL} isn't bound as a variable, it is treated as @code{nil}. +@item +Cons cell @code{(@var{FUNCTION} . @var{ARGUMENTS})}: @AUCTeX{} calls the +@var{FUNCTION} with arbitrary number of @var{ARGUMENTS}. The return value +is regarded as a boolean flag. +@end itemize + +It has a reasonable default value to reveal when the point enters the +folded portion with @kbd{@key{left}}, @kbd{@key{right}}, @kbd{C-b}, +@kbd{C-f} or mouse click under standard key binding. +@end defopt + @node Outline @section Outlining the Document
master c008bb60: Make auto reveal feature configurable in folding
branch: master commit c008bb60b2fbd6e8e0220439109070d600080724 Author: Ikumi Keita Commit: Ikumi Keita Make auto reveal feature configurable in folding * tex-fold.el (TeX-fold-auto-reveal): New customize option following `preview-auto-reveal'. (TeX-fold-auto-reveal-p, TeX-fold-arrived-via): New function following `preview-auto-reveal-p' and `preview-arrived-via'. (TeX-fold-post-command): Use it. --- tex-fold.el | 50 +- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/tex-fold.el b/tex-fold.el index 92304fb2..d786ff62 100644 --- a/tex-fold.el +++ b/tex-fold.el @@ -254,6 +254,34 @@ After that, changing the prefix key requires manipulating keymaps." (define-key map "i"#'TeX-fold-clearout-item) map)) +(defcustom TeX-fold-auto-reveal + '(eval (TeX-fold-arrived-via (key-binding [left]) (key-binding [right]) + #'backward-char #'forward-char + #'mouse-set-point)) + "Predicate to open a fold when entered. +Possibilities are: +t autoopens, +nil doesn't, +a symbol will have its value consulted if it exists, +defaulting to nil if it doesn't. +A CONS-cell means to call a function for determining the value. +The CAR of the cell is the function to call which receives +the CDR of the CONS-cell in the rest of the arguments, while +point and current buffer point to the position in question. +All of the options show reasonable defaults." + :group 'TeX-fold + :type '(choice (const :tag "Off" nil) + (const :tag "On" t) + (symbol :tag "Indirect variable" :value reveal-mode) + (cons :tag "Function call" + :value (eval (TeX-fold-arrived-via + (key-binding [left]) + (key-binding [right]) + #'backward-char #'forward-char + #'mouse-set-point)) + function (list :tag "Argument list" + (repeat :inline t sexp) + ;;; Folding @@ -833,6 +861,22 @@ Remove the respective properties from the overlay OV." (when font-lock-mode (overlay-put ov 'face TeX-fold-unfolded-face))) +(defun TeX-fold-auto-reveal-p (mode) + "Decide whether to auto-reveal. +Return non-nil if folded region should be auto-opened. +See `TeX-fold-auto-reveal' for definitions of MODE." + (cond ((symbolp mode) + (and (boundp mode) + (symbol-value mode))) +((consp mode) + (apply (car mode) (cdr mode))) +(t mode))) + +(defun TeX-fold-arrived-via ( list) + "Indicate auto-opening. +Return non-nil if called by one of the commands in LIST." + (memq this-command list)) + ;; Copy and adaption of `reveal-post-command' from reveal.el in GNU ;; Emacs on 2004-07-04. (defun TeX-fold-post-command () @@ -855,11 +899,7 @@ Remove the respective properties from the overlay OV." (setq TeX-fold-open-spots (cdr spots)) (when (or disable-point-adjustment global-disable-point-adjustment -;; See preview.el on how to make this configurable. -(memq this-command - (list (key-binding [left]) (key-binding [right]) -#'backward-char #'forward-char -#'mouse-set-point))) +(TeX-fold-auto-reveal-p TeX-fold-auto-reveal)) ;; Open new overlays. (dolist (ol (nconc (when (and TeX-fold-unfold-around-mark mark-active)
Re: Emacs 27 problem with :local keyword in defcustom
Hi Arash, >>>>> Arash Esbati writes: > I pushed a change 509a71b436 which should fix this issue. Can you please > give it a new try with 27.1? If the result is Ok, I'll ask Tassilo to > make a new ELPA release. It works for emacs 27.1. By the way, this chunk should be reverted :-) modified latex.el @@ -1,6 +1,6 @@ ;;; latex.el --- Support for LaTeX documents. -*- lexical-binding: t; -*- -;; Copyright (C) 1991, 1993-2024 Free Software Foundation, Inc. +;; Copyright (C) 1991, 1993-2023 Free Software Foundation, Inc. ;; Maintainer: auctex-devel@gnu.org ;; Keywords: tex Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Emacs 27 problem with :local keyword in defcustom
Hi Arash, I noticed that emacs 27.1 fails with the current AUCTeX master. When I open circ.tex with emacs 27.1, it signals error with "(wrong-type-argument number-or-marker-p nil)" in `TeX-auto-parse'. The local values of `TeX-auto-parse-length' and `TeX-auto-x-parse-length' are both nil in the circ.tex buffer. It seems that it is due to introduction of :local keyword in defcustom: , | 77a02f837a0d32e2f7b47764d6e7f64ad76001ba | Author: Arash Esbati | AuthorDate: Thu Jan 18 22:55:12 2024 +0100 | Commit: Arash Esbati | CommitDate: Thu Jan 18 22:55:12 2024 +0100 | | Mark options as buffer-local with the :local keyword ` As far as I can see, it is a bug of emacs 27.1. The function `custom-declare-variable', which is the essential part of `defcustom', puts the `make-variable-buffer-local' declaration _before_ the actual `defvar', thus ending up with inconsistent local values. Hence we have to refrain from using :local in `defcustom' until we drop support for emacs 27 :-( Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Deleting compat code from commit 087b030001
>>>>> Arash Esbati writes: > Hi Keita, > can I delete this code in tex.el: > (if (< emacs-major-version 27) > (or (assq 'compilation-in-progress minor-mode-alist) > (setq minor-mode-alist (cons '(compilation-in-progress " Compiling") > minor-mode-alist > It was introduced with commit 087b030001: > Simplify mode line for emacs 27 > * tex-buf.el: Don't add an entry in `minor-mode-alist' for > `compilation-in-progress'. In emacs 27, compile.el adds a similar > entry in `mode-line-modes'. > We require Emacs=E2=89=A527 now, I think we can delete it. WDYT? Yes, I think so. Please go ahead. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master 0f8901dc: Set up outline mode variables early (bug#69254)
branch: master commit 0f8901dc5dff4687def1250983ff1a66d2322db5 Author: Ikumi Keita Commit: Ikumi Keita Set up outline mode variables early (bug#69254) * latex.el (LaTeX-mode-cleanup): (LaTeX-common-initialization): Revert the fix for bug#65750 partially so that call to outline mode in `LaTeX-mode-hook' works. * context.el (ConTeXt-mode-common-initialization): (ConTeXt-mode-cleanup): * tex-info.el: (Texinfo-mode): (Texinfo-mode-cleanup): Follow the above change for LaTeX mode. --- context.el | 10 +++--- latex.el| 23 ++- tex-info.el | 26 ++ 3 files changed, 15 insertions(+), 44 deletions(-) diff --git a/context.el b/context.el index 5ee0217d..86991ccf 100644 --- a/context.el +++ b/context.el @@ -1875,9 +1875,8 @@ that is, you do _not_ have to cater for this yourself by adding \\=' or $." ;; Outline support (require 'outline) (set (make-local-variable 'outline-level) #'ConTeXt-outline-level) - ;; Moved after `run-mode-hooks'. (bug#65750) - ;; (set (make-local-variable 'outline-regexp) (ConTeXt-outline-regexp t)) - ;;(make-local-variable 'outline-heading-end-regexp) + (set (make-local-variable 'outline-regexp) (ConTeXt-outline-regexp t)) + (make-local-variable 'outline-heading-end-regexp) (setq TeX-header-end (ConTeXt-header-end) TeX-trailer-start (ConTeXt-trailer-start)) @@ -1913,10 +1912,7 @@ Run after mode hooks and file local variables application." "[ \t]*\\(" (ConTeXt-paragraph-commands-regexp) "\\|" "\\$\\$\\|" ; Plain TeX display math - "$\\)")) - - (or (local-variable-p 'outline-regexp) - (setq-local outline-regexp (ConTeXt-outline-regexp t + "$\\)"))) (defun context-guess-current-interface () "Guess what ConTeXt interface the current buffer is using." diff --git a/latex.el b/latex.el index 83de0e84..de70c7f5 100644 --- a/latex.el +++ b/latex.el @@ -8268,16 +8268,6 @@ Run after mode hooks and file local variables application." (if (bound-and-true-p filladapt-mode) (turn-off-filladapt-mode)) - ;; Don't overwrite the value the user set by hooks or file - ;; (directory) local variables. - (or (local-variable-p 'outline-regexp) - (setq-local outline-regexp (LaTeX-outline-regexp t))) - (or (local-variable-p 'outline-heading-alist) - (setq outline-heading-alist -(mapcar (lambda (x) - (cons (concat "\\" (nth 0 x)) (nth 1 x))) -LaTeX-section-list))) - ;; Keep `LaTeX-paragraph-commands-regexp' in sync with ;; `LaTeX-paragraph-commands' in case the latter is updated by ;; hooks or file (directory) local variables. @@ -8441,13 +8431,12 @@ function would return non-nil and `(match-string 1)' would return (require 'outline) (set (make-local-variable 'outline-level) #'LaTeX-outline-level) - ;; Moved after `run-mode-hooks'. (bug#65750) - ;; (set (make-local-variable 'outline-regexp) (LaTeX-outline-regexp t)) - ;; (when (boundp 'outline-heading-alist) - ;; (setq outline-heading-alist - ;; (mapcar (lambda (x) - ;; (cons (concat "\\" (nth 0 x)) (nth 1 x))) - ;; LaTeX-section-list))) + (set (make-local-variable 'outline-regexp) (LaTeX-outline-regexp t)) + (when (boundp 'outline-heading-alist) +(setq outline-heading-alist + (mapcar (lambda (x) +(cons (concat "\\" (nth 0 x)) (nth 1 x))) + LaTeX-section-list))) (setq-local TeX-auto-full-regexp-list (delete-dups (append LaTeX-auto-regexp-list diff --git a/tex-info.el b/tex-info.el index fc10f018..9f919ee3 100644 --- a/tex-info.el +++ b/tex-info.el @@ -31,9 +31,6 @@ (require 'texinfo) -;; Silence the compiler for variables: -(defvar outline-heading-alist) - ;;; Environments: (defvar Texinfo-environment-list '(("cartouche") ("command") ("copying") ("defcv") ("deffn") ("defivar") @@ -672,13 +669,12 @@ value of `Texinfo-mode-hook'." (set (make-local-variable 'syntax-propertize-function) texinfo-syntax-propertize-function) - ;; Moved after `run-mode-hooks'. (bug#65750) - ;; (setq-local outline-heading-alist - ;; (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x))) - ;; texinfo-section-list)) - ;; (setq-local outline-regexp - ;; (concat (regexp-opt (mapcar #'car outline-heading-alist) t) - ;; "\\>")) + (setq-local outline-heading-alist + (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x))) + texinfo-section-list)) + (setq-local outline-regexp + (concat (regexp-opt (mapcar #'car outline-heading-alist) t) +
master b95c47a1: Fix and enhance pseudo-parent mode facility (bug#69069)
branch: master commit b95c47a1c268ac6b6dc28e292bb67cd32c263a53 Author: Ikumi Keita Commit: Ikumi Keita Fix and enhance pseudo-parent mode facility (bug#69069) * tex-info.el: Fill in missing pseudo-parent relation for `Texinfo-mode'. ; Update copyright year. * tex.el (TeX--compat-provided-mode-derived-p): Rename from `TeX--compat-derived-mode-p' and extend psuedo-parent mode facility, which was formerly restricted to `derived-mode-p', to support `provided-mode-derived-p'. * tests/tex/utility.el (TeX-pseudo-parent-mode): Add a new test. ; Update copyright year. * tests/latex/latex-test.el (LaTeX-align): Add a new test. (AUCTeX-set-ert-path): Add paths for the new test. ; Update copyright year. * tests/latex/align-in.tex: * tests/latex/align-out.tex: New files for the new test. * latex.el: * plain-tex.el: * tex-jp.el: Add `tex-mode' explicitly to the pseudo-parents of `LaTeX-mode', `docTeX-mode', `plain-TeX-mode', `japanese-plain-TeX-mode' and `japanese-LaTeX-mode' for compatibility with Emacs<30. ; Update copyright year. --- latex.el | 8 ++-- plain-tex.el | 4 +++- tests/latex/align-in.tex | 9 + tests/latex/align-out.tex | 9 + tests/latex/latex-test.el | 21 - tests/tex/utility.el | 19 ++- tex-info.el | 7 ++- tex-jp.el | 11 +++ tex.el| 23 --- 9 files changed, 90 insertions(+), 21 deletions(-) diff --git a/latex.el b/latex.el index ff8d7a85..f077acd4 100644 --- a/latex.el +++ b/latex.el @@ -8333,7 +8333,9 @@ Run after mode hooks and file local variables application." ;; Compatibility for former mode name. Directory local variables ;; prepared for `latex-mode' continue to be valid for `LaTeX-mode'. -(TeX-derived-mode-add-parents 'LaTeX-mode '(latex-mode)) +;; COMPATIBILITY for emacs<30: `tex-mode' can be removed from the list +;; once the least supported emacsen becomes 30. +(TeX-derived-mode-add-parents 'LaTeX-mode '(latex-mode tex-mode)) (with-eval-after-load 'semantic/symref/grep (push '(docTeX-mode "*.dtx") semantic-symref-filepattern-alist)) @@ -8370,7 +8372,9 @@ runs the hooks in `docTeX-mode-hook'." ;; prepared for `doctex-mode' continue to be valid for `docTeX-mode'. ;; In addition, dir local vars for `latex-mode' are now valid for ;; `docTeX-mode' as well. -(TeX-derived-mode-add-parents 'docTeX-mode '(doctex-mode latex-mode)) +;; COMPATIBILITY for emacs<30: `latex-mode' and `tex-mode' can be removed +;; from the list once the least supported emacsen becomes 30. +(TeX-derived-mode-add-parents 'docTeX-mode '(doctex-mode latex-mode tex-mode)) (defcustom docTeX-clean-intermediate-suffixes TeX-clean-default-intermediate-suffixes diff --git a/plain-tex.el b/plain-tex.el index 76de05e2..5691859d 100644 --- a/plain-tex.el +++ b/plain-tex.el @@ -155,7 +155,9 @@ Run after mode hooks and file local variables application." ;; Compatibility for former mode name. Directory local variables ;; prepared for `plain-tex-mode' continue to be valid for ;; `plain-TeX-mode'. -(TeX-derived-mode-add-parents 'plain-TeX-mode '(plain-tex-mode)) +;; COMPATIBILITY for emacs<30: `tex-mode' can be removed from the list +;; once the least supported emacsen becomes 30. +(TeX-derived-mode-add-parents 'plain-TeX-mode '(plain-tex-mode tex-mode)) (defun plain-TeX-common-initialization () "Common initialization for plain TeX like modes." diff --git a/tests/latex/align-in.tex b/tests/latex/align-in.tex new file mode 100644 index ..b2c8a99e --- /dev/null +++ b/tests/latex/align-in.tex @@ -0,0 +1,9 @@ +\documentclass{article} +\begin{document} +% Broken by new mode name (Bug#69069) +\begin{tabular}{} + Mat.-Nr. & Nachname & Vorname & Unterschrift \\ + Mat. No. & Surname & Name& Signature +\end{tabular} + +\end{document} diff --git a/tests/latex/align-out.tex b/tests/latex/align-out.tex new file mode 100644 index ..b2c8a99e --- /dev/null +++ b/tests/latex/align-out.tex @@ -0,0 +1,9 @@ +\documentclass{article} +\begin{document} +% Broken by new mode name (Bug#69069) +\begin{tabular}{} + Mat.-Nr. & Nachname & Vorname & Unterschrift \\ + Mat. No. & Surname & Name& Signature +\end{tabular} + +\end{document} diff --git a/tests/latex/latex-test.el b/tests/latex/latex-test.el index eae951f1..e22d2a08 100644 --- a/tests/latex/latex-test.el +++ b/tests/latex/latex-test.el @@ -1,6 +1,6 @@ ;;; latex-test.el --- tests for LaTeX mode -*- lexical-binding: t; -*- -;; Copyright (C) 2014-2022 Free Software Foundation, Inc. +;; Copyright (C) 2014-2024 Free Software Foundation, Inc. ;; This file is part of AUCTeX. @@ -53,6 +53,10 @@ "nested-indent-in.tex" 'LaTeX-nested-indent/out
Re: Eglot activation
Hi Arash, >>>>> Arash Esbati writes: > Thanks for digging into this. Your patch LGTM, do you want to install > it? Yes, I'll do after I reshape its detail. >> ;; Don't quote by #'-style to avoid compiler warning. >> - 'TeX--compat-derived-mode-p) > I'm not sure but I think you can add > (declare-function TeX--compat-provided-mode-derived-p "tex") > here if you want to silence the compiler; `declare-function' doesn't > need to be top-level, IIRC. Well, it's just a gimmick to suppress expected warning and not important whether to take after all☺️ Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master d150b0f1: ; Add comments
branch: master commit d150b0f1b14bcaddf0df28231b542f47f103c6af Author: Ikumi Keita Commit: Ikumi Keita ; Add comments * latex.el: * plain-tex.el: * tex.el: Add comments for previous workarounds. --- latex.el | 2 ++ plain-tex.el | 2 ++ tex.el | 1 + 3 files changed, 5 insertions(+) diff --git a/latex.el b/latex.el index 1b9a1656..ff8d7a85 100644 --- a/latex.el +++ b/latex.el @@ -8214,6 +8214,8 @@ This happens when \\left is inserted." (declare-function LaTeX-preview-setup "preview") +;; Delete alias predefined in tex-mode.el so that AUCTeX autoload +;; takes precedence. ;;;###autoload (if (eq (symbol-function 'LaTeX-mode) 'latex-mode) ;;;###autoload (defalias 'LaTeX-mode nil)) ;;;###autoload diff --git a/plain-tex.el b/plain-tex.el index e3ffd53d..76de05e2 100644 --- a/plain-tex.el +++ b/plain-tex.el @@ -115,6 +115,8 @@ plain-TeX file, or any mode derived thereof. See variable (TeX-abbrev-mode-setup plain-TeX-mode plain-tex-mode-abbrev-table) +;; Delete alias predefined in tex-mode.el so that AUCTeX autoload +;; takes precedence. ;;;###autoload (if (eq (symbol-function 'plain-TeX-mode) 'plain-tex-mode) ;;;###autoload (defalias 'plain-TeX-mode nil)) ;;;###autoload diff --git a/tex.el b/tex.el index 17cb1aa9..8396c949 100644 --- a/tex.el +++ b/tex.el @@ -3758,6 +3758,7 @@ other entries will enter `plain-TeX-mode'." (memq 'font-latex-verbatim-face face) (eq face 'font-latex-verbatim-face)) +;; Delete alias predefined in tex-mode.el. ;;;###autoload (if (eq (symbol-function 'TeX-mode) 'tex-mode) ;;;###autoload (defalias 'TeX-mode nil)) (define-derived-mode TeX-mode text-mode "TeX"
Eglot activation (Re: bug#69057: AUCTeX 14.0.2 and TexLab 5.12.3)
[ Cc: changed ] Hi Arash, >>>>> Arash Esbati writes: > Hmm, strange. I don't have Emacs 29 installed so I can't test it > myself. > I put this on my todo list and ask on emacs-devel how to proceed. I > think Emacs core should arrange to support this OOTB. I think I have figured out the reason. The culprit is the insufficient capability of pseudo-parent mode facility I discussed in bug#69069[1]. Eglot finds out the correct server if we extend `provided-mode-derived-p' so that several our new modes identify themselves as descended from `tex-mode' as the attached patch. [1] https://lists.gnu.org/r/bug-auctex/2024-02/msg00041.html Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW diff --git a/latex.el b/latex.el index 1b9a1656..d3c1c22c 100644 --- a/latex.el +++ b/latex.el @@ -8331,7 +8331,9 @@ Run after mode hooks and file local variables application." ;; Compatibility for former mode name. Directory local variables ;; prepared for `latex-mode' continue to be valid for `LaTeX-mode'. -(TeX-derived-mode-add-parents 'LaTeX-mode '(latex-mode)) +;; COMPATIBILITY for emacs<30: `tex-mode' can be removed from the list +;; once least supported emacsen becomes 30. +(TeX-derived-mode-add-parents 'LaTeX-mode '(latex-mode tex-mode)) (with-eval-after-load 'semantic/symref/grep (push '(docTeX-mode "*.dtx") semantic-symref-filepattern-alist)) @@ -8368,7 +8370,9 @@ runs the hooks in `docTeX-mode-hook'." ;; prepared for `doctex-mode' continue to be valid for `docTeX-mode'. ;; In addition, dir local vars for `latex-mode' are now valid for ;; `docTeX-mode' as well. -(TeX-derived-mode-add-parents 'docTeX-mode '(doctex-mode latex-mode)) +;; COMPATIBILITY for emacs<30: `latex-mode' and `tex-mode' can be removed +;; from the list once least supported emacsen becomes 30. +(TeX-derived-mode-add-parents 'docTeX-mode '(doctex-mode latex-mode tex-mode)) (defcustom docTeX-clean-intermediate-suffixes TeX-clean-default-intermediate-suffixes diff --git a/plain-tex.el b/plain-tex.el index e3ffd53d..4be55edc 100644 --- a/plain-tex.el +++ b/plain-tex.el @@ -153,7 +153,9 @@ Run after mode hooks and file local variables application." ;; Compatibility for former mode name. Directory local variables ;; prepared for `plain-tex-mode' continue to be valid for ;; `plain-TeX-mode'. -(TeX-derived-mode-add-parents 'plain-TeX-mode '(plain-tex-mode)) +;; COMPATIBILITY for emacs<30: `tex-mode' can be removed from the list +;; once least supported emacsen becomes 30. +(TeX-derived-mode-add-parents 'plain-TeX-mode '(plain-tex-mode tex-mode)) (defun plain-TeX-common-initialization () "Common initialization for plain TeX like modes." diff --git a/tests/latex/align-in.tex b/tests/latex/align-in.tex new file mode 100644 index ..b2c8a99e --- /dev/null +++ b/tests/latex/align-in.tex @@ -0,0 +1,9 @@ +\documentclass{article} +\begin{document} +% Broken by new mode name (Bug#69069) +\begin{tabular}{} + Mat.-Nr. & Nachname & Vorname & Unterschrift \\ + Mat. No. & Surname & Name& Signature +\end{tabular} + +\end{document} diff --git a/tests/latex/align-out.tex b/tests/latex/align-out.tex new file mode 100644 index ..b2c8a99e --- /dev/null +++ b/tests/latex/align-out.tex @@ -0,0 +1,9 @@ +\documentclass{article} +\begin{document} +% Broken by new mode name (Bug#69069) +\begin{tabular}{} + Mat.-Nr. & Nachname & Vorname & Unterschrift \\ + Mat. No. & Surname & Name& Signature +\end{tabular} + +\end{document} diff --git a/tests/latex/latex-test.el b/tests/latex/latex-test.el index eae951f1..e22d2a08 100644 --- a/tests/latex/latex-test.el +++ b/tests/latex/latex-test.el @@ -1,6 +1,6 @@ ;;; latex-test.el --- tests for LaTeX mode -*- lexical-binding: t; -*- -;; Copyright (C) 2014-2022 Free Software Foundation, Inc. +;; Copyright (C) 2014-2024 Free Software Foundation, Inc. ;; This file is part of AUCTeX. @@ -53,6 +53,10 @@ "nested-indent-in.tex" 'LaTeX-nested-indent/out "nested-indent-out.tex" + 'LaTeX-align/in + "align-in.tex" + 'LaTeX-align/out + "align-out.tex" 'docTeX/in "doctex-indent-in.dtx" 'docTeX/out @@ -696,6 +700,21 @@ check the indentation for optional argument of \\usepackage." (insert-file-contents LaTeX-conditionals-indent/out) (buffer-string) +(ert-deftest LaTeX-align () + "Test if align.el works correctly." + (should (string= + (with-temp-buffer + (insert-file-contents LaTeX-align/in) + (goto-char (point-min)) + (LaTeX-mode) + (search-forward "\\begin{") + (forward-line 1) + (align-current) + (buffer-string)) + (with-temp-buffer + (insert-file-contents LaTeX-align/out) +
Re: Documentation enhancement about `TeX-modes'
>>>>> Arash Esbati writes: > Thanks for working on this. Yes, LGTM. Please go ahead and install it. Thanks, done. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master 09a181fa: Increase description of `TeX-modes' in the document
branch: master commit 09a181fa148d27c0351097bdb5da1ed018a49112 Author: Ikumi Keita Commit: Ikumi Keita Increase description of `TeX-modes' in the document * doc/install.texi (Loading the package): Increase the explanation of the purpose and usage of `TeX-modes' with proper entry of @defopt. Add a paragraph for an alternative method to arrange the redirections. ; Update copyright year. --- doc/install.texi | 28 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/doc/install.texi b/doc/install.texi index 52be62f9..c2499e63 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -1,6 +1,6 @@ @c This is part of the AUCTeX Manual. @c Copyright (C) 1994, 1996, 2003-2007, 2012-2013, -@c 2015-2023 Free Software Foundation, Inc. +@c 2015-2024 Free Software Foundation, Inc. @c See the file auctex.texi for copying conditions. @ifset rawfile @include macros.texi @@ -353,11 +353,31 @@ below. @end ifclear Once activated, the modes provided by @AUCTeX{} are used per default for -all supported file types. If you want to change the modes for which it -is operative instead of the default, use +all supported file types, namely @code{plain-tex-mode}, @code{latex-mode}, +@code{doctex-mode} and @code{texinfo-mode}. This might not match your +preference. You can have control over which @AUCTeX{} mode is activated +per file types by @code{TeX-modes} option. For example, you can use Emacs +built-in @code{plain-tex-mode} for plain @TeX{} files while you can use +@AUCTeX{} @code{LaTeX-mode} for @LaTeX{} files. + +@defopt TeX-modes +List of Emacs built-in @TeX{} modes redirected to @AUCTeX{} modes. If you +prefer a particular built-in mode over @AUCTeX{} mode, remove it from this +list. Type @example @kbd{M-x customize-option @key{RET} TeX-modes @key{RET}} @end example +@noindent +to manipulate the contents of @code{TeX-modes}. +@end defopt + +Don't remove @code{tex-mode} from @code{TeX-modes} because it results in +inconsistent behavior. + +On Emacs 29 and later, you can alter @code{major-mode-remap-alist} instead +of @code{TeX-modes} as you like to arrange @AUCTeX{} redirections. In +fact, @code{TeX-modes} option does nothing other than setting up +@code{major-mode-remap-alist} according its value on those Emacsens. If you want to remove a preinstalled @AUCTeX{} completely before any of its modes have been used, @@ -365,7 +385,7 @@ its modes have been used, (unload-feature 'tex-site) @end lisp @noindent -should accomplish that. +in your init file should accomplish that. @node Advice for package providers @section Providing @AUCTeX{} as a package
master fd7b5aac: ; * doc/faq.texi: Update copyright year.
branch: master commit fd7b5aacfa1b5baf11684c827e86020239c06afd Author: Ikumi Keita Commit: Ikumi Keita ; * doc/faq.texi: Update copyright year. --- doc/faq.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/faq.texi b/doc/faq.texi index 845164fc..cd71ac95 100644 --- a/doc/faq.texi +++ b/doc/faq.texi @@ -1,5 +1,5 @@ @c This is part of the AUCTeX Manual. -@c Copyright (C) 2004-2023 Free Software Foundation, Inc. +@c Copyright (C) 2004-2024 Free Software Foundation, Inc. @c See the file auctex.texi for copying conditions. @ifset rawfile @include macros.texi
Documentation enhancement about `TeX-modes' (Re: [Announcement] Feature branch merged)
Hi Arash, >>>>> Arash Esbati writes: > I'm contemplating the possibilities, actually. If we agree that > `TeX-modes' is the best way to control AUCTeX's behavior, fine with me. > We should then document it better, `TeX-modes' is currently somewhat > underrepresented in the manual, IMO. >> Ikumi Keita writes: >> Hmm, I now realized the current document is sparse about it. I wasn't >> aware of that. I hope I can make some addition in a few days (or next >> week?). I made the attached patch. Do you think it's enough? Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW >From afac62646f54cd4dc3d26bd2507b11ef02fca3a8 Mon Sep 17 00:00:00 2001 From: Ikumi Keita Date: Fri, 9 Feb 2024 00:06:39 +0900 Subject: [PATCH] Increase description of `TeX-modes' in the document * doc/install.texi (Loading the package): Increase the explanation of the purpose and usage of `TeX-modes' with proper entry of @defopt. Add a paragraph for an alternative method to arrange the redirections. --- doc/install.texi | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/doc/install.texi b/doc/install.texi index 52be62f9..98975060 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -353,11 +353,31 @@ below. @end ifclear Once activated, the modes provided by @AUCTeX{} are used per default for -all supported file types. If you want to change the modes for which it -is operative instead of the default, use +all supported file types, namely @code{plain-tex-mode}, @code{latex-mode}, +@code{doctex-mode} and @code{texinfo-mode}. This might not match your +preference. You can have control over which @AUCTeX{} mode is activated +per file types by @code{TeX-modes} option. For example, you can use Emacs +built-in @code{plain-tex-mode} for plain @TeX{} files while you can use +@AUCTeX{} @code{LaTeX-mode} for @LaTeX{} files. + +@defopt TeX-modes +List of Emacs built-in @TeX{} modes redirected to @AUCTeX{} modes. If you +prefer a particular built-in mode over @AUCTeX{} mode, remove it from this +list. Type @example @kbd{M-x customize-option @key{RET} TeX-modes @key{RET}} @end example +@noindent +to manipulate the contents of @code{TeX-modes}. +@end defopt + +Don't remove @code{tex-mode} from @code{TeX-modes} because it results in +inconsistent behavior. + +On Emacs 29 and later, you can alter @code{major-mode-remap-alist} instead +of @code{TeX-modes} as you like to arrange @AUCTeX{} redirections. In +fact, @code{TeX-modes} option does nothing other than setting up +@code{major-mode-remap-alist} according its value on those Emacsens. If you want to remove a preinstalled @AUCTeX{} completely before any of its modes have been used, @@ -365,7 +385,7 @@ its modes have been used, (unload-feature 'tex-site) @end lisp @noindent -should accomplish that. +in your init file should accomplish that. @node Advice for package providers @section Providing @AUCTeX{} as a package -- 2.43.0
master 4b77d8eb: * doc/faq.texi: Add FAQ entry for ELPA upgrade failure.
branch: master commit 4b77d8ebaac9b143cb3ff596ab04556621847455 Author: Ikumi Keita Commit: Ikumi Keita * doc/faq.texi: Add FAQ entry for ELPA upgrade failure. --- doc/faq.texi | 55 +++ 1 file changed, 55 insertions(+) diff --git a/doc/faq.texi b/doc/faq.texi index 0fb58dd5..845164fc 100644 --- a/doc/faq.texi +++ b/doc/faq.texi @@ -13,6 +13,10 @@ @item Something is not working correctly. What should I do? +If you are having trouble with upgrading @acronym{ELPA} package, first +have a look at the dedicated entry below. If that doesn't resolve your +issue, then come back here and proceed. + Well, you might have guessed it, the first place to look is in the available documentation packaged with @AUCTeX{}. This could be the release notes (in the @file{RELEASE} file) or the news section of the @@ -68,6 +72,57 @@ error. If everything is working now, you know that you have to search either in the site configuration file or your personal init file for statements related to the problem. +@item +@acronym{ELPA} upgrade fails. What should I do? + +In general, @acronym{ELPA} upgrade can fail in a Emacs session you are +running, especially when @AUCTeX{} major version increases. This entry +covers the following cases in such casual upgrade. +@itemize +@item +Upgrade stops with error and doesn't complete. +@item +Upgrade falls in infinite loop and doesn't terminate. You have +to interrupt it with @kbd{C-g} and upgrade doesn't complete. +@item +It looks like upgrade finishes successfully but afterwards @AUCTeX{} +breaks with mysterious error like: +@example +TeX-command-expand: Wrong type argument: stringp, nil +@end example + +@end itemize + +These issues involve byte compilation failure. In the third case, the +generated @file{.elc} files are actually corrupted. Thus the point is to +have sane byte compilation. + +The first thing which is worth trying is: +@enumerate +@item +Terminate the current running Emacs session and restart Emacs. +@item +Type @kbd{M-x package-recompile @key{RET} auctex @key{RET}}. +@item +Restart your Emacs again. +@end enumerate + +If you are lucky enough, this will basically resolve the issue. There is +still old @samp{auctex-X.Y.Z} directory left behind under +@file{~/.emacs.d/elpa/}, so delete it manually to avoid future trouble. + +If the above prescription doesn't work, then try: +@enumerate +@item +Uninstall @AUCTeX{} once. +@item +Restart your Emacs and (before doing anything else) reinstall @AUCTeX{}. +@end enumerate + +In theory, this recipe will circumvent all caveats in @acronym{ELPA} +upgrade of @AUCTeX{}. Find and delete old @samp{auctex-X.Y.Z} directory +remaining under @file{~/.emacs.d/elpa/}. + @item What versions of Emacs are supported?
Re: Missing compatibility for customized `TeX-command-list'
Hi all, >>>>> Ikumi Keita writes: >> Thanks. I can't spot huge performance differences, >> but maybe after some days I will update the TeX-command-list to the >> modern one. I pushed the fix to the git repo. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
master 32fe3f2c: Cater for former mode name in customized `TeX-command-list'
branch: master commit 32fe3f2c3b1972f635ae6273391e30b6ac085ed8 Author: Ikumi Keita Commit: Ikumi Keita Cater for former mode name in customized `TeX-command-list' * tex.el (TeX-mode-comparison-alist): Comparison table for former and new mode names. (TeX-mode-specific-command-list): Compare the former mode name as well against the mode list in `TeX-command-list'. --- tex.el | 27 --- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/tex.el b/tex.el index 49723108..17cb1aa9 100644 --- a/tex.el +++ b/tex.el @@ -103,6 +103,19 @@ (defvar compilation-error-regexp-alist) ; compile.el (defvar compilation-in-progress); compile.el +(defconst TeX-mode-comparison-alist + '((plain-tex-mode . plain-TeX-mode) +(latex-mode . LaTeX-mode) +(doctex-mode . docTeX-mode) +(context-mode . ConTeXt-mode) +(texinfo-mode . Texinfo-mode) +(ams-tex-mode . AmSTeX-mode) +(japanese-plain-tex-mode . japanese-plain-TeX-mode) +(japanese-latex-mode . japanese-LaTeX-mode)) + "Comparison table of AUCTeX former and current mode names. +Each entry is of the form (FORMER . CURRENT) where FORMER and +CURRENT are each mode name symbols.") + (defgroup TeX-file nil "Files used by AUCTeX." :group 'AUCTeX) @@ -5207,12 +5220,20 @@ Brace insertion is only done if point is in a math construct and "Return the list of commands available in the given MODE." (let ((full-list TeX-command-list) out-list -entry) +entry fourth-element +former-mode) (while (setq entry (pop full-list)) + (setq fourth-element (nth 4 entry)) ;; `(nth 4 entry)' may be either an atom in case of which the ;; entry should be present in any mode or a list of major modes. - (if (or (atom (nth 4 entry)) - (memq mode (nth 4 entry))) + (if (or (atom fourth-element) + (memq mode fourth-element) + ;; Compatibility for former mode names. The user can + ;; have customized `TeX-command-list' with former mode + ;; names listed in `(nth 4 entry)'. + (and (setq former-mode + (car (rassq mode TeX-mode-comparison-alist))) + (memq former-mode fourth-element))) (push entry out-list))) (nreverse out-list)))
Re: another problem folding.el
Hi Uwe, >>>>> Uwe Brauer writes: > I am using folding.el for more than 10 years. > It allows you to well fold text, in a very general highly configurable way. > The fold marks are defined for, yes latex-mode > (folding-add-to-marks-list 'latex-mode "%{{{" "%}}}" nil t) > So now, with the latest merge, there is a problem with the new > auctex-latex-mode when I try to fold a text folding mode complains that > the top folding marks is missing. > I just checked the commit just before the merge behaves as usuall > I tried to add > (folding-add-to-marks-list 'LaTeX-mode "%{{{" "%}}}" nil t) > But that did not help. I will contact the folding maintainters, but is > there anything I need to tell them? It seems that folding.el contains similar entry already. All I can think of is this portion of folding.el: -- ;; XEmacs latex-mode, after (tex-site), indents the whole ;; fold 50 characters right. Don't do that. (unless (string-match "latex" (symbol-name major-mode)) (indent-according-to-mode)) -- This conditional now yields nil for AUCTeX LaTeX-mode because `string-match' distinguishes cases by default. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Missing compatibility for customized `TeX-command-list'
Hi Uwe, >>>>> Uwe Brauer writes: > So after deleting the old installation, running make clean, make, make > install and restarting emacs, with the old TeX-command-list setting > Your patch *works*! > Thanks. I can't spot huge performance differences, > but maybe after some days I will update the TeX-command-list to the > modern one. Thank you for the feedback. I apologize that I looked over an important factor and caused you trouble. > BTW > %%% Local Variables: > %%% mode: latex > %%% show-trailing-whitespace: t > %%% End: > Now seems *not* to cause problems. > That is another important annoyance, since I have these lines in many > but not all of my files. > Can somebody please confirm that it is ok to leave these lines in, Don't worry, it's OK. Even with "mode: latex" tag, emacs calls `LaTeX-mode' instead if AUCTeX is enabled, according to `major-mode-remap-alist'. > Ok, I start with a short comment. I am on Linux/Ubuntu and I run > patch < 0001-Cater-for-former-mode-name-in-customized-TeX-command.patch > obtaining > (Stripping trailing CRs from patch; use --binary to disable.) > patching file tex.el [...] > Since > file 0001-Cater-for-former-mode-name-in-customized-TeX-command.patch > gave me > 0001-Cater-for-former-mode-name-in-customized-TeX-command.patch: unified > diff output, ASCII text, with CRLF line terminators > So I simply converted your patch to Unix line end convention and applied > the patch. Hmm, the same command file 0001-Cater-for-former-mode-name-in-customized-TeX-command.patch gives me 0001-Cater-for-former-mode-name-in-customized-TeX-command.patch: unified diff output, ASCII text I suppose that MTA or MUA mungled the EOL format. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: Missing compatibility for customized `TeX-command-list'
Hi Uwe, >>>>> Uwe Brauer writes: > Thanks for the patch. > Do you want me to test it with my old pre merge configuration? I'd appreciate if you could. > BTW a simple defalias wouldn't be helpful? Unfortunately, no. Basically, `defalias' is for a function call. However, it is a matter of direct comparison of function names in this case. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: 14.0.0 broken
Hi Uwe, >>>>> "Uwe Siart" writes: > yes, it works fine again. Thanks for the quick fix. Thanks for the feedback. Have a happy TeX'ing! Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Missing compatibility for customized `TeX-command-list'
Hi all, Thanks to Uwe Brauer, I realized that an important compatibility is missing in the current master branch. `TeX-command-list' has lists of "available modes" for each command such as "LaTeX", "BibTeX". When a user customized `TeX-command-list' before the feature branch merge, the mode names in those lists are recorded in the former mode names. Hence the current `TeX-mode-specific-command-list' doesn't recognize them and C-c C-c doesn't offer "LaTeX" as an available command in LaTeX mode. A tentative fix is attached with this message. I expect the performance hit is small enough, but what do you think? `TeX-mode-specific-command-list' is called repeatedly when "Command" menu is opened. Best regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW >From 6b6c39654e028c85e8e0fd5859fac5f95cab3b3f Mon Sep 17 00:00:00 2001 From: Ikumi Keita Date: Sun, 11 Feb 2024 14:48:27 +0900 Subject: [PATCH] Cater for former mode name in customized `TeX-command-list' * tex.el (TeX-mode-comparison-alist): Comparison table for former and new mode names. (TeX-mode-specific-command-list): Compare the former mode name as well against the mode list in `TeX-command-list'. --- tex.el | 27 --- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/tex.el b/tex.el index 49723108..2dacbad4 100644 --- a/tex.el +++ b/tex.el @@ -103,6 +103,19 @@ (defvar compilation-error-regexp-alist) ; compile.el (defvar compilation-in-progress); compile.el +(defconst TeX-mode-comparison-alist + '((plain-tex-mode . plain-TeX-mode) +(latex-mode . LaTeX-mode) +(doctex-mode . docTeX-mode) +(context-mode . ConTeXt-mode) +(texinfo-mode . Texinfo-mode) +(ams-tex-mode . AmSTeX-mode) +(japanese-plain-tex-mode . japanese-plain-TeX-mode) +(japanese-latex-mode . japanese-LaTeX-mode)) + "Comparison table of AUCTeX former and current mode names. +Each entry is of the form (FORMER . CURRENT) where FORMER and +CURRENT are each mode name symbols.") + (defgroup TeX-file nil "Files used by AUCTeX." :group 'AUCTeX) @@ -5207,12 +5220,20 @@ Brace insertion is only done if point is in a math construct and "Return the list of commands available in the given MODE." (let ((full-list TeX-command-list) out-list -entry) +entry fourth-entry +former-mode) (while (setq entry (pop full-list)) + (setq fourth-entry (nth 4 entry)) ;; `(nth 4 entry)' may be either an atom in case of which the ;; entry should be present in any mode or a list of major modes. - (if (or (atom (nth 4 entry)) - (memq mode (nth 4 entry))) + (if (or (atom fourth-entry) + (memq mode fourth-entry) + ;; Compatibility for former mode names. The user can + ;; have customized `TeX-command-list' with former mode + ;; names listed in `(nth 4 entry)'. + (and (setq former-mode (car + (rassq mode TeX-mode-comparison-alist))) + (memq former-mode fourth-entry))) (push entry out-list))) (nreverse out-list))) -- 2.43.0
Re: can compile and install but not user latest master: now auctex behaves strangly
Hi Uwe, >>>>> Uwe Brauer writes: >> '(TeX-command-list >> '(("TeX" "%(PDF)%(tex) %(file-line-error) %`%(extraopts) >> %S%(PDFout)%(mode)%' %(output-dir) %t" TeX-run-TeX nil >> (plain-tex-mode texinfo-mode ams-tex-mode) >> :help "Run plain TeX") >> ("LaTeX" "%`%l%(mode)%' %T" TeX-run-TeX nil >> (latex-mode doctex-mode) >> :help "Run LaTeX") > It seems the problem is that this syntax uses, still, latex-mode, while > now it must be LaTeX-mode. Ok I solved it. Thank you, now I realized what the culprit is. I indeed should have taken care of the customized `TeX-command-list'. I'll work on the compatibility code immediately. > May I suggest to add some notes the NEWS file, like > «Things to be aware when using the new version» > that changes /the mode convention/ (or however you want to call it You are right, it should have been catched in advance and spelled out explicitly. Best regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: can compile and install but not user latest master: now auctex behaves strangly
Hi Uwe, >>>>> Uwe Brauer writes: >> I see, sorry for inconvenience. Then please provide us concrete >> materials which cause errorneous behavior for you so that we can study >> the detail. > So I presume TeX-submit-bug-report should be sufficient. > Or do shall I add all my auctex init files? The more the materials, the more it approaches the solution. In addition to output of TeX-submit-bug-report and your init files, the LaTeX document file you encountered the trouble is most welcome. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: can compile and install but not user latest master: now auctex behaves strangly
Hi Uwe, >>>>> Uwe Brauer writes: >> Did you restart your emacs session after you install the new version? If >> you did, we need more detail to work on this issue. > Yes, I always do, I described my steps as > - I pulled (commit ba27accea2f9 is then actual) > - I run make clean > - I run make > - before running make install, I deleted my old installation which > is according to configuration in: > ~/ALLES/emacs/site-lisp/packages/auctex-git > - I run make install > - I restart emacs and open a LaTeX file > Right now I am running commit d7f1d2815986 > Which is fine. > So it must be your merge I see, sorry for inconvenience. Then please provide us concrete materials which cause errorneous behavior for you so that we can study the detail. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: 14.0.0 broken
Hi Uwe, >>>>> Ikumi Keita writes: > Thanks for the report. We are aware of the issue and expect we can work > on it soon. Until a fixed version is released, please stay with the > former version of AUCTeX. AUCTeX 14.0.2 is released on ELPA and we expect that the problem was solved. Please give it a try. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW
Re: can compile and install but not user latest master: now auctex behaves strangly
Hi Uwe, >>>>> Uwe Brauer writes: > Ok I mananged to get rid of all old auctex installations, then I deleted my > installed auctex version, checked out master, > compiled and installed (I know this is not necessary but I like it this way) > So I open a LaTeX file, everything seems alright, like fontifying etc. But > when I run C-c C-C only > 8 possible completions: > Clean Clean All Other Print > Queue Spell View > Is offered but not the usual commands like LaTeX etc. [...] > Any ideas what's up? Did you restart your emacs session after you install the new version? If you did, we need more detail to work on this issue. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW