Re: tex-continuous.el: latexmk, auctex, flymake
Hi Paul, Paul Nelson writes: > I thought I'd share a package I'm hoping to eventually submit to ELPA. > It may be topical in view of the recent discussion here concerning > latexmk. I would appreciate any advice or suggestions, particularly > on ways that I could better leverage existing functionality from > AUCTeX. Thanks for sharing this. I only have a minor comment reg. compatibility with MS-Windonws: > (defcustom tex-continuous-command > "latexmk -pvc -shell-escape -pdf -view=none -e '$pdflatex=q/pdflatex %O > -synctex=1 -interaction=nonstopmode %S/'" > "Command to compile LaTeX documents." > :type 'string > :group 'tex-continuous) Will the above work on Windows? I was comparing this with examples in latexmk.pdf (texdoc latexmk) on pages 7-8. Best, Arash
master 03f1145c: ; * NEWS.org: Update the file.
branch: master commit 03f1145c8b22f0e349f83b53ecaee7c20432134a Author: Arash Esbati Commit: Arash Esbati ; * NEWS.org: Update the file. --- NEWS.org | 4 1 file changed, 4 insertions(+) diff --git a/NEWS.org b/NEWS.org index 9a3a0ce7..6ce49b99 100644 --- a/NEWS.org +++ b/NEWS.org @@ -30,6 +30,10 @@ (=style/biblatex.el=). - Support the =\verbatiminput*= macro (=style/verbatim.el=). +** Fixed + +- Adjust options when processing files with ConTeXt. + * [14.0.4] - 2024-03-31 ** Added
master 23b7267e: ; * NEWS.org: Update the file.
branch: master commit 23b7267e84abb02c9b31ca9b178f1209c4df274b Author: Arash Esbati Commit: Arash Esbati ; * NEWS.org: Update the file. --- NEWS.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.org b/NEWS.org index 6ce49b99..b0c8676a 100644 --- a/NEWS.org +++ b/NEWS.org @@ -32,7 +32,9 @@ ** Fixed -- Adjust options when processing files with ConTeXt. +- Adjust options when processing files with ConTeXt: Remove obsolete + =--texutil=, use =--synctex=repeat= and omit =--nonstop= when + ~TeX-source-correlate-mode~ is enabled. * [14.0.4] - 2024-03-31
master 4731168e: Allow opened previews to remain visible
branch: master commit 4731168eca3f103732a026f70912597faef8bd99 Author: Paul Nelson Commit: Arash Esbati Allow opened previews to remain visible * preview.el.in (preview-leave-open-previews-visible): New user option. (preview-gs-place, preview-disable, preview-inactive-string) (preview-place-preview, preview-check-changes): Use it. (preview-clearout): New optional argument, EXCEPTION. * doc/preview-latex.texi (The Emacs interface): Document the new user option. * NEWS.org (Added): Announce the new custom option. (bug#70455) --- NEWS.org | 6 -- doc/preview-latex.texi | 4 preview.el.in | 51 +- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/NEWS.org b/NEWS.org index b0c8676a..21b98e30 100644 --- a/NEWS.org +++ b/NEWS.org @@ -21,11 +21,13 @@ - Add new custom option ~TeX-fold-auto-reveal~ which contols how the original source text is revealed when user clicks the folded portion by mouse. +- Add new custom option ~TeX-fold-region-functions~ which is a list of + additional functions to call when folding a region. - Add new custom option ~preview-protect-point~ which determines whether previews generated on top of the current point should be temporarily opened (~nil~ by default). -- Add new custom option ~TeX-fold-region-functions~ which is a list of - additional functions to call when folding a region. +- Add new custom option ~preview-leave-open-previews-visible~ which + determines if the preview code stays visible once opened. - Support query and insert of ~mcite~ compatibility macro (=style/biblatex.el=). - Support the =\verbatiminput*= macro (=style/verbatim.el=). diff --git a/doc/preview-latex.texi b/doc/preview-latex.texi index 07adc2a9..0c1fb730 100644 --- a/doc/preview-latex.texi +++ b/doc/preview-latex.texi @@ -672,6 +672,10 @@ accordingly @code{split} is one entry in This boolean variable determines whether previews generated on top of the 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. + @end vtable @node The preview images, Misplaced previews, The Emacs interface, For advanced users diff --git a/preview.el.in b/preview.el.in index 5e6b556c..1f65f728 100644 --- a/preview.el.in +++ b/preview.el.in @@ -1210,6 +1210,13 @@ is located." (setcdr (car img) (cdar replacement)) (setcdr img (cdr replacement +(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." + :group 'preview-appearance + :type 'boolean) + (defun preview-gs-place (ov snippet box run-buffer tempdir ps-file _imagetype) "Generate an image placeholder rendered over by Ghostscript. This enters OV into all proper queues in order to make it render @@ -1231,7 +1238,21 @@ for the file extension." (overlay-put ov 'queued (vector box nil snippet)) (overlay-put ov 'preview-image - (list (preview-icon-copy preview-nonready-icon))) + (let ((default (list (preview-icon-copy preview-nonready-icon + (if preview-leave-open-previews-visible + (if-let ((img + (car +(delq + nil + (mapcar + (lambda (ovr) +(and + (eq (overlay-start ovr) (overlay-start ov)) + (overlay-get ovr 'preview-image))) + (overlays-at (overlay-start ov))) + img + default) + default))) (preview-add-urgentization #'preview-gs-urgentize ov run-buffer) (list ov)) @@ -1895,6 +1916,11 @@ Disable it if that is the case. Ignores text properties." text (overlay-get ov 'preview-prechange))) (overlay-put ov 'insert-in-front-hooks nil) (overlay-put ov 'insert-behind-hooks nil) +(when (and preview-leave-open-previews-visible + (eq (overlay-get ov 'preview-state) 'active)) + ;; This is so that remote commands, such as `undo', + ;; open active previews before disabling them. + (preview-toggle ov)) (preview-disable ov) (error nil)) (overlay-put ov 'preview-prechange nil)) @@ -2190,10 +2216
Re: reftex-citation is not able to deal with several databases
Hi Uwe, Uwe Brauer writes: > More and more I need more than one bibtex/biblatex database. > > If I stick for the moment to bibtex, the following is perfectly possible: > > \bibliography{bibgraf,mahir} > > Bibtex will find the citations form both databases > > However reftex-citations is not able to deal with this situation, it > only takes the first database, bibgraf in that case. I tried it with 2 arbitrary files I have like this: \bibliography{bib-test,my-biblatex} and in the .tex file, I hit 'C-c [' followed by '.' when asked for the regexp. I see all entries from both files, RefTeX "follow-mode" works as well. > Any idea what I miss here? Can you come up with a minimal example, ideally starting with 'emacs -Q'? Best, Arash
Re: Making AUCTeX ELPA releases from the master branch
Hi Tassilo, Tassilo Horn writes: > I've created a "main" branch (split off externals/auctex) and adjusted > it such that it should be buildable on elpa and the mere act of changing > the Version number in auctex.el in a commit would trigger a new ELPA > release. And every other commit would at least trigger a new release on > ELPA-devel. Many thanks for working on this (and to Stefan as well). > So basically, we should decide now if we switch to going ELPA-only in > which case we'd not use master anymore but develop directly in main. > (I'd be in favour of it, obviously.) > > We could also keep master as our development branch and still use the > new "main" branch (which I would probably rename to "elpa" in that case) > for elpa and turn on auto-sync. It would be a bit less automatic: we'd > need to keep merging from master to the "main" / "elpa" regularly and > increment the Version manually for releases. But it's still better than > the status quo (less committed generated files; better Version > determination). I was thinking about this too and my vote is to go with option 2 (i.e., not your favorite ;-). I think it would make sense to have a sort of "staging area" where we can install code which might break or have other problems. Syncing it directly to ELPA-DEVEL and letting people install it might end in too much trouble for the brave users. Merging into "branch-name-tbd" shouldn't be a big deal then, I can do it, if we need a volunteer. And yes, it will be much better than what we have right now. Reg. dropping tarball-release and for me to recap: We, or more precisely Mosè doesn't make any releases and distro-packagers should pick up the files from the ELPA release and work with that? Maybe this is a topic for another thread. Best, Arash
Re: reftex-citation is not able to deal with several databases
Uwe Brauer via Discussion list for AUCTeX developers writes: > Thanks for your answer. I found a solution that I posted, but it did not > land in the same thread sorry. Ah, Ok, I must have missed that, sorry. > So the solution I found in > https://bug-auctex.gnu.narkive.com/s2Oz8HpC/24-3-1-reftex-fails-to-find-multiple-bib-files-in-bibliography-with-commas > > I had to set (setq reftex-use-external-file-finders t) > > and everything worked as expected. So you have your .bib files somewhere not next to your .tex file? This was the case for me. > Maybe one should set this variable to t per default. I don't think this is a good idea: ,[ C-h v reftex-use-external-file-finders RET ] | reftex-use-external-file-finders is a variable defined in ‘reftex-vars.el’. | | Its value is nil | | Non-nil means, use external programs to find files. | Normally, RefTeX searches the paths given in the environment variables | TEXINPUTS and BIBINPUTS to find TeX files and BibTeX database files. | With this option turned on, it calls an external program specified in the | option ‘reftex-external-file-finders’ instead. As a side effect, | the variables ‘reftex-texpath-environment-variables’ and | ‘reftex-bibpath-environment-variables’ will be ignored. | ` Changing the default of `reftex-use-external-file-finders' will break for people who have set `reftex-texpath-environment-variables' and/or `reftex-bibpath-environment-variables'. Best, Arash
Re: Making AUCTeX ELPA releases from the master branch
Stefan Monnier writes: > FWIW, while we don't have good statistics to confirm it, I believe that > very few users routinely install packages from GNU-devel: contrary to > Melpa where the system is setup to encourage the use of Melpa over > Melpa-stable, the GNU ELPA archive is setup so as to encourage the use > of GNU ELPA over GNU-devel ELPA. > > So, those few users installing from GNU-devel ELPA are probably ready > and willing (if not eager) to try buggy software (that's what GNU-devel is > for). > Especially since fixes are also made available more promptly. Thanks. With this original intent of GNU-devel ELPA, let's go that route and skip AUCTeX master. Best, Arash
Re: Making AUCTeX ELPA releases from the master branch
Tassilo Horn writes: > Ok, I've adjusted the elpa recipe and merged from master to main. So > hopefully there will be some new devel package anytime soon at > > https://elpa.gnu.org/devel/auctex.html > > If that works fine, we can bump the Version in auctex.el and do a > regular ELPA release. Thanks. I see an issue. I did: • $ git clone https://git.savannah.gnu.org/git/auctex.git auctex-elpa • $ cd auctex-elpa • $ git switch main • $ make -j8 • $ emacs -Q • eval'ed in scratch: (load "~/path/to/auctex-elpa/auctex.el" nil t t) (load "~/path/to/auctex-elpa/preview.el" nil t t) • C-x C-f path/to/auctex-elpa/circ.tex RET throws: File mode specification error: (void-function font-latex-setup) Backtrace says: --8<---cut here---start->8--- Debugger entered--Lisp error: (void-function font-latex-setup) font-latex-setup() TeX-mode() LaTeX-mode() TeX-tex-mode() set-auto-mode-0(tex-mode nil) set-auto-mode--apply-alist((("\\.hva\\'" . LaTeX-mode) ("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file) ("\\.elc\\'" . elisp-byte-code-mode) ("\\.zst\\'" nil jka-compr) ("\\.dz\\'" nil jka-compr) ("\\.xz\\'" nil jka-compr) ("\\.lzma\\'" nil jka-compr) ("\\.lz\\'" nil jka-compr) ("\\.g?z\\'" nil jka-compr) ("\\.bz2\\'" nil jka-compr) ("\\.Z\\'" nil jka-compr) ("\\.vr[hi]?\\'" . vera-mode) ("\\(?:\\.\\(?:rbw?\\|ru\\|rake\\|thor\\|axlsx\\|jbuilder\\|rabl\\|gemspec\\|podspec\\)\\|/\\(?:Gem\\|Rake\\|Cap\\|Thor\\|Puppet\\|Berks\\|Brew\\|Fast\\|Vagrant\\|Guard\\|Pod\\)file\\)\\'" . ruby-mode) ("\\.re?st\\'" . rst-mode) ("/\\(?:Pipfile\\|\\.?flake8\\)\\'" . conf-mode) ("\\.py[iw]?\\'" . python-mode) ("\\.m\\'" . octave-maybe-mode) ("\\.less\\'" . less-css-mode) ("\\.scss\\'" . scss-mode) ("\\.cs\\'" . csharp-mode) ("\\.awk\\'" . awk-mode) ("\\.\\(u?lpc\\|pike\\|pmod\\(\\.in\\)?\\)\\'" . pike-mode) ("\\.idl\\'" . idl-mode) ("\\.java\\'" . java-mode) ("\\.m\\'" . objc-mode) ("\\.ii\\'" . c++-mode) ("\\.i\\'" . c-mode) ("\\.lex\\'" . c-mode) ("\\.y\\(acc\\)?\\'" . c-mode) ("\\.h\\'" . c-or-c++-mode) ("\\.c\\'" . c-mode) ("\\.\\(CC?\\|HH?\\)\\'" . c++-mode) ("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode) ("\\.\\(cc\\|hh\\)\\'" . c++-mode) ("\\.\\(bat\\|cmd\\)\\'" . bat-mode) ("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . mhtml-mode) ("\\.svgz?\\'" . image-mode) ("\\.svgz?\\'" . xml-mode) ("\\.x[bp]m\\'" . image-mode) ("\\.x[bp]m\\'" . c-mode) ("\\.p[bpgn]m\\'" . image-mode) ("\\.tiff?\\'" . image-mode) ("\\.gif\\'" . image-mode) ("\\.png\\'" . image-mode) ("\\.jpe?g\\'" . image-mode) ("\\.webp\\'" . image-mode) ("\\.te?xt\\'" . text-mode) ("\\.[tT]e[xX]\\'" . tex-mode) ("\\.ins\\'" . tex-mode) ("\\.ltx\\'" . latex-mode) ...) nil nil) set-auto-mode() normal-mode(t) after-find-file(nil t) find-file-noselect-1(# "~/path/to/auctex-elpa/circ.tex" nil nil "~/path/to/auctex-elpa/circ.tex" (21398298 16777231)) find-file-noselect("~/path/to/auctex-elpa/circ.tex" nil nil t) find-file("~/path/to/auctex-elpa/circ.tex" t) funcall-interactively(find-file "~/path/to/auctex-elpa/circ.tex" t) command-execute(find-file) --8<---cut here---end--->8--- Am I missing something? Best, Arash
Re: Making AUCTeX ELPA releases from the master branch
Tassilo Horn writes: > I think we need to adapt our instructions. To run straight from the > clone, this seems to work fine: > > (add-to-list 'load-path "~/Repos/el/auctex") > (load "~/Repos/el/auctex/loaddefs.el" nil t t) Thanks, this does the job. Yes, we will have to adapt our instructions: the way I see it the whole machinery around ./configure, make, and make install will be gone, right? Best, Arash
Re: Making AUCTeX ELPA releases from the master branch
Stefan Monnier writes: >> I think we need to adapt our instructions. To run straight from the >> clone, this seems to work fine: >> >> (add-to-list 'load-path "~/Repos/el/auctex") >> (load "~/Repos/el/auctex/loaddefs.el" nil t t) > > Side note: an AUCTeX installed with `package.el` behaves very similarly > except the autoloads file is called `auctex-autoloads.el` instead of > `loaddefs.el` and that this file takes care of the `add-to-list`, so > users just need to > > (load "~/Repos/el/auctex/auctex-autoloads") Thanks, but in which scenario do users have to use the form above? I thought when AUCTeX is installed via package.el, say with regular updates or `package-install-from-archive', `package-initialize' and some such would do the job. Or am I missing something? Side question: Is it possible to achieve something similar for the setup above, i.e., running AUCTeX directly from the clone? This looks really ugly to me: (load "~/Repos/el/auctex/loaddefs.el" nil t t) Best, Arash
Re: Making AUCTeX ELPA releases from the master branch
Stefan Monnier writes: > I use it with `emacs -Q ...` when I want to try and isolate a problem. Thanks for the hint. My approach to that for package `foo' until now was: (progn (package-initialize t) (package-activate 'foo)) > Indeed, usually `package-activate(-all)` performs those `load`s for the user. > I was just pointing out that there's a pre-existing and very similar > "convention" and that convention is slightly simpler for the users, so > if it's not too cumbersome it might be worth following that convention > (it's not very important, tho, so it's really up to the maintainers). I think we're on the same page, but I wasn't clear: The one-liner you sent is more appealing to me than what we have on the table now: (add-to-list 'load-path "~/Repos/el/auctex") (load "~/Repos/el/auctex/loaddefs.el" nil t t) By ugly I meant (load "loaddefs.el"). So my question was that for the scenario "Start AUCTeX out of Git repo and not installed as an ELPA package", if you have a pointer how to: • Get auctex-autoloads.el instead of loaddefs.el, and • Put the addition to `load-path' in that file, so the forms above turn into (load "~/Repos/el/auctex/auctex-autoloads" nil t t) as well? I hope I could explain it better this time. Best, Arash
Re: compilation using git needs 10 minutes and fails
Uwe Brauer writes: > Time needed 56 sec on my X1 Thinkpad form 2017 > > I switched to main > > 1) make distclean > 2) git switch main > 3) make > 4) after 10 min! I obtain > > Error: void-function (loaddefs-generate-batch) > mapbacktrace(#f(compiled-function (evald func args flags) # 0x1b7c116e2faef0ed>)) > debug-early-backtrace() > debug-early(error (void-function loaddefs-generate-batch)) > loaddefs-generate-batch() > command-line-1(("-l" "lpath.el" "-f" "loaddefs-generate-batch" > "loaddefs.el" ".")) > command-line() > normal-top-level() > Symbol’s function definition is void: loaddefs-generate-batch > GNUmakefile:47: recipe for target 'autoloads' failed > make: *** [autoloads] Error 255 Which Emacs version is this? The library loaddefs-gen.el which provides the function was introduced with Emacs 29.1, IIRC. I remember the fun I had with this change: https://git.savannah.gnu.org/cgit/auctex.git/commit/Makefile.in?id=19a2607b > Call me nitpicking but I prefer master over main C'mon Uwe, don't be like that. The whole thing is half a day old, so maybe you give us another day before you make your mind. And thanks for testing, BTW. Best, Arash
Re: Making AUCTeX ELPA releases from the master branch
Stefan Monnier writes: > That works as well, indeed. There are many ways to skin this cat. 🙂 Meow! 🙀 > Ah, OK. Not sure why you find it ugly, but there's no accounting > for taste. I find it a bit unnatural to load a file containing the autoloads by hand. But maybe I have to change my mental model on that. > I think the patch below does that. > > > diff --git a/GNUmakefile b/GNUmakefile > index b5cec4822e..fbf653ab09 100644 > --- a/GNUmakefile > +++ b/GNUmakefile > @@ -17,7 +17,8 @@ > # latex: prtightpage.def > # latex: prtracingall.def > > autoloads: > - $(EMACS) -f loaddefs-generate-batch loaddefs.el . > + $(EMACS) --eval \ > + "(loaddefs-generate \".\" \"auctex-autoloads.el\" \ > +nil \"(add-to-list 'load-path\ > + (directory-file-name \ > +(file-name-directory load-file-name)))\")" Thanks, it works. The only issue we have to solve next is how to cater for Emacs<29 which don't have `loaddefs-generate' (we have a solution for that in the old Makefile; we have to check if have to reactivate that part.) Best, Arash
Re: compilation using git needs 10 minutes and fails
Uwe Brauer writes: > Well, it compiled from master but 29.0.5 so pre 29.1 What do you see if you do: • emacs -Q • C-h f loaddefs-generate-batch RET in scratch This is what I get: --8<---cut here---start->8--- loaddefs-generate-batch is an autoloaded Lisp function in ‘loaddefs-gen.el’. [Arg list not available until function definition is loaded.] Generate loaddefs.el files in batch mode. This scans for ;;;###autoload forms and related things. The first element on the command line should be the (main) loaddefs.el output file, and the rest are the directories to use. --8<---cut here---end--->8--- > the problem is that more recent emacs version cause sever problems > with my old bbdb package I using on a daily base (I wrote a lot of > useful add-ons that do not work on more recent bbdb version, mostly > because of renaming functions and changing syntax). BBDB is showing age, so I moved to EBDB, note that it has a manual as well ;-) > Point taken, Thanks. > but the compilation needs 10 minutes, 10! That makes testing > cumbersome, don't you agree? Yes, and we have to find out why. If the Emacs you're using to compile AUCTeX doesn't have the function above, we can stop right away. So please make you have an recent version at hand, then we can proceed. For me, 'time make -j8' returns: real0m25.407s user2m35.401s sys 0m17.996s on a MacBook Air M2. Best, Arash
Re: compilation using git needs 10 minutes and fails
Uwe Brauer writes: > This function is not defined. > > emacs-version is a variable defined in ‘C source code’. > > Its value is "29.0.50" > > Version numbers of this version of Emacs. > > But > > , > | emacs-repository-version is a variable defined in ‘version.el’. > | > | Its value is "7bf17ceee8c2d347917541e143ce25609e90ebbb" > ` > > > So in short, that might explain why I can't compile (or why it takes so > long)? This is one reason why you can't compile the current main branch. This doesn't explain the error: fatal: not a git repository (or any of the parent directories): .git I suspect this has something to do with your Git-Mercurial setup/workflow. But let sort things out one after the other, Ok? > If I understand you correctly: I should have a version, for the > moment just for compiling the main auctex branch purpose, but not my > daily use? My understanding is that you're sticking to that Emacs 29.0.50 version because of your BBDB setup. If so, you can stick with that and wait until we have a solution for older Emacs as well. AUCTeX claims to support Emacs≥27, so we can't only stay with `loaddefs-generate-batch'. So in short, be a little patient :-) > Since as I said if I compile and install say the current master version, > I cannot use it in my daily workflow and could not test real world > documents, at least not for the next two months. Side note: I recommend you try to resolve this situation somehow. Emacs current release is 29.3. Sitting on an old dev-version is not really satisfactory, IMHO. Best, Arash
Re: [can't compile the main branch]
Stefan Monnier writes: > IMO `build-aux/gitlog-to-auctexlog` should gracefully fail > (e.g. generate an empty file, or put the Git error into that > file). Hmm, build-aux/gitlog-to-auctexlog contains[1]: --8<---cut here---start->8--- # If this is not a Git repository, just generate an empty ChangeLog. test -d .git || { >"$output" exit } --8<---cut here---end--->8--- Maybe Uwe has a .git directory in his setup, but it isn't a real .git directory as Git would expect? Footnotes: [1] https://git.savannah.gnu.org/cgit/auctex.git/tree/build-aux/gitlog-to-auctexlog#n71
Re: [can't compile the main branch]
Stefan Monnier writes: >> +# 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 > > I suspect it would be better to merge those two (i.e. instead of > testing for the presence of `.git` just use `git log`s failure as the > test). gitlog-to-auctexlog is based on gitlog-to-emacslog. Should the issue be reported there as well? gitlog-to-emacslog isn't different in this regard: https://git.savannah.gnu.org/cgit/emacs.git/tree/build-aux/gitlog-to-emacslog#n62 Best, Arash
Re: [can't compile the main branch]
Tassilo Horn writes: > I just wanted to say that I'll have a look about making the build > succeed in the absence of git or when running it not in a normal git > clone when I find some spare time. Thanks Tassilo. One other issue Uwe brought up was that `loaddefs-generate' isn't available for Emacs<29. So we have to cater for that as well. This is basically this change to Makefile.in in the master branch: https://git.savannah.gnu.org/cgit/auctex.git/commit/Makefile.in?id=19a2607b AFAIU, using `update-file-autoloads' again means keeping track of all AUCTeX files in the new GNUmakefile, or is there a better solution? Best, Arash
Re: [can't compile the main branch]
Stefan Monnier writes: >> AFAIU, using `update-file-autoloads' again means keeping track of all >> AUCTeX files in the new GNUmakefile, or is there a better solution? > > You should be able to use `update-directory-autoloads`. > It's a bit more cumbersome to use than `loaddefs-generate` but other > than that it should be OK. I think `make-directory-autoloads' would be even easier, but it was introduced with 28.1, and we currently support 27.1, sigh! I think I can solve it with the patch below. @Uwe: Can you please apply this to a clean main branch and run make? This change contains what Stefan sent, but I don't think it can take care of your Mercurial setup, try it in a real Git repo. It should at least cater for your Emacs version. Thanks. Best, Arash diff --git a/GNUmakefile b/GNUmakefile index b5cec482..49b677cf 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -17,7 +17,8 @@ # latex: prtightpage.def # latex: prtracingall.def -EMACS=emacs --batch -q -no-site-file -no-init-file -l lpath.el +EMACSBIN=emacs +EMACS=$(EMACSBIN) --batch -q -no-site-file -no-init-file -l lpath.el MAKEINFO=makeinfo INSTALL_INFO=install-info PERL=perl @@ -39,12 +40,41 @@ ALL_GENERATED_FILES=$(MAIN_GENERATED_FILES) \ $(INFO_FILES) # Generate & compile everything including the manuals below doc/. -all: $(ALL_GENERATED_FILES) compile autoloads +all: $(ALL_GENERATED_FILES) compile auctex-autoloads.el compile: $(patsubst %.el,%.elc,$(wildcard *.el style/*.el)) -autoloads: - $(EMACS) -f loaddefs-generate-batch loaddefs.el . +AUCSRC = tex.el tex-style.el plain-tex.el latex.el tex-info.el \ +texmathp.el multi-prompt.el tex-mik.el font-latex.el tex-font.el \ +context.el context-en.el context-nl.el tex-fold.el tex-jp.el \ +toolbar-x.el tex-bar.el bib-cite.el tex-ispell.el latex-flymake.el \ +preview.el + +AUTOLOAD=--eval '\ +(let* ((autoload-file (expand-file-name "$@")) \ + (autoload-file-dir (file-name-directory autoload-file))) \ + (if (fboundp `loaddefs-generate) \ + (loaddefs-generate autoload-file-dir autoload-file \ + (list "tex-wizard.el") \ + "(add-to-list `load-path\n\ + (directory-file-name\n\ + (file-name-directory load-file-name)))")\ +(mapc (lambda (file) \ +(update-file-autoloads file nil autoload-file)) \ + command-line-args-left)) \ + (save-buffers-kill-emacs t))' $(AUCSRC) + +auctex-autoloads.el: + -rm -f $@ + $(EMACS) $(AUTOLOAD) $(AUCSRC) + +# auctex-autoloads.el: +# $(EMACS) --eval \ +# "(loaddefs-generate \".\" \"auctex-autoloads.el\" nil \"\ +# (add-to-list 'load-path\n\ +# (directory-file-name\n\ +# (file-name-directory load-file-name)))\ +# \")" %.elc: %.el $(EMACS) -f batch-byte-compile $< @@ -63,7 +93,7 @@ elpa: $(MAIN_GENERATED_FILES) clean: rm -f $(ALL_GENERATED_FILES) \ $(wildcard *.elc style/*.elc) \ - loaddefs.el + auctex-autoloads.el # Copied&adapted from doc/Makefile.in. MAKEINFO_PLAIN=$(MAKEINFO) -D rawfile --no-headers @@ -74,18 +104,16 @@ README: doc/intro.texi doc/preview-readme.texi doc/macros.texi # Commands copied&adapted from autogen.sh and doc/Makefile.in. IGNORED:=$(shell rm -f ChangeLog && ./build-aux/gitlog-to-auctexlog && cat ChangeLog.1 >> ChangeLog) # Committer date of HEAD. -AUCTEXDATE:=$(shell git log -n1 --pretty=tformat:"%ci" \ - | sed -nre 's/ /_/p' | sed -nre 's/ .*//p') +AUCTEXDATE:=$(shell (git log -n1 --pretty=tformat:"%ci" 2>/dev/null \ + || date +"%Y-%m-%d %T") \ +| sed -re 's/ /_/' -e 's/ .*//') # Extract the version number from the diff line "+;; Version: 14.0.4" of # the commit HEAD which is only filled when we did a release in the last # commit. -THISVERSION:=$(shell git show HEAD -- auctex.el \ +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 version number from the previous change to auctex.el, -# i.e., only look at commits starting at HEAD~1. -LASTVERSION:=$(shell git log HEAD~1 -p --first-parent -- auctex.el \ - | grep "+;; Version: " \ - | sed -nre 's/[+];; Version: ([0-9]+.[0-9]+.[0-9]+)/\1/p;q') +# 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) AUCTEXVERSION:=$(if $(THISVERSION),$(THISVERSION),$(LASTVERSION).$(AUCTEXDATE)) tex-site.el: tex-site.el.in
main 4714c740: ; * GNUmakefile: Delete code remainder.
branch: main commit 4714c740616b42997d1cca09a0297753d8246a91 Author: Arash Esbati Commit: Arash Esbati ; * GNUmakefile: Delete code remainder. --- GNUmakefile | 8 1 file changed, 8 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index c10a6cd8..1b4499a3 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -65,14 +65,6 @@ auctex-autoloads.el: rm -f $@ $(EMACS) $(AUTOLOAD) $(wildcard *.el) -# auctex-autoloads.el: -# $(EMACS) --eval \ -# "(loaddefs-generate \".\" \"auctex-autoloads.el\" nil \"\ -# (add-to-list 'load-path\n\ -# (directory-file-name\n\ -# (file-name-directory load-file-name)))\ -# \")" - %.elc: %.el $(EMACS) -f batch-byte-compile $<
Re: [can't compile the main branch]
Tassilo Horn writes: > Thanks, applied with the minor change that I use $(wildcard *.el) > instead of listing all lisp files and binding them to AUCSRC. Thanks. Yes, $(wildcard *.el) is easier. I removed also some code remainder. Best, Arash
Re: [can't compile the main branch]: SOLVED
Uwe Brauer writes: > First of all thanks Arash, that might have been a bit complicated. I > appreciate it. You're welcome. Actually not, I took most of it from our old Makefile.in. > I was late yesterday night, so since Tassilo already applied the patch, > > * From my git clone > > I pulled > and run using my <29.1: > > time make -j8 > > > 1. It compiled, there were some errors about functions not to be >known. Shall I send these byte compilation errors? I see them as well. I will address them, but probably on the master branch. Best, Arash
Re: [can't compile the main branch]: SOLVED
Tassilo Horn writes: > If you have more than those, yes: > > In bib-find-next: > bib-cite.el:944:8: Warning: ‘find-tag’ is an obsolete function (as of > 25.1); use ‘xref-find-definitions’ instead. > > In end of data: > tex-info.el: Warning: the function ‘cl-member’ might not be defined at > runtime. > > In toolbarx-process-dropdown-group: > toolbar-x.el:886:10: Warning: in defcustom: missing :type keyword parameter > toolbar-x.el:886:10: Warning: in defcustom: fails to specify containing > group Would it make sense to add the dynvars-check rule to the GNUmakefile? I never really understood how that works. Can you have a look at it, please? Best, Arash
Re: [can't compile the main branch]: SOLVED
Tassilo Horn writes: > Done. Thanks. Do you mind if I add this change to it: --8<---cut here---start->8--- diff --git a/GNUmakefile b/GNUmakefile index 892d1c3c..999861cb 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -83,7 +83,8 @@ clean: rm -f $(ALL_GENERATED_FILES) \ $(wildcard *.elc style/*.elc) \ auctex-autoloads.el \ - ChangeLog + ChangeLog \ + $(DYNVARSFILES) # Copied&adapted from doc/Makefile.in. MAKEINFO_PLAIN=$(MAKEINFO) -D rawfile --no-headers @@ -138,12 +139,12 @@ $(LATEX_FILES): latex/preview.dtx latex/bootstrap.ins DYNVARSFILES = *.dynvars style/*.dynvars auctex-dynvars dynvars-check: - rm -f $(wildcard *.elc) $(wildcard style/*elc) $(DYNVARSFILES) + rm -f $(wildcard *.elc) $(wildcard style/*.elc) $(DYNVARSFILES) EMACS_GENERATE_DYNVARS=1 $(EMACS) -f batch-byte-compile \ - $(wildcard *.el) $(wildcard style/*el) \ + $(wildcard *.el) $(wildcard style/*.el) \ > /dev/null 2>&1 cat *.dynvars style/*.dynvars > auctex-dynvars - rm -f $(wildcard *.elc) $(wildcard style/*elc) + rm -f $(wildcard *.elc) $(wildcard style/*.elc) EMACS_DYNVARS_FILE=auctex-dynvars $(EMACS) \ -f batch-byte-compile \ - $(wildcard *.el) $(wildcard style/*el) + $(wildcard *.el) $(wildcard style/*.el) --8<---cut here---end--->8--- > Strange enough, it doesn't catch the cl-member warning above and also > not the ones Uwe mentioned I see what Uwe reported when I run the regular make, with dynvars-check I get the same results as you. Best, Arash
main 16a5896f: ; * GNUmakefile: Fix last change.
branch: main commit 16a5896f6d61c3ab693bfe374608b088163a2b69 Author: Arash Esbati Commit: Arash Esbati ; * GNUmakefile: Fix last change. --- GNUmakefile | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 892d1c3c..999861cb 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -83,7 +83,8 @@ clean: rm -f $(ALL_GENERATED_FILES) \ $(wildcard *.elc style/*.elc) \ auctex-autoloads.el \ - ChangeLog + ChangeLog \ + $(DYNVARSFILES) # Copied&adapted from doc/Makefile.in. MAKEINFO_PLAIN=$(MAKEINFO) -D rawfile --no-headers @@ -138,12 +139,12 @@ $(LATEX_FILES): latex/preview.dtx latex/bootstrap.ins DYNVARSFILES = *.dynvars style/*.dynvars auctex-dynvars dynvars-check: - rm -f $(wildcard *.elc) $(wildcard style/*elc) $(DYNVARSFILES) + rm -f $(wildcard *.elc) $(wildcard style/*.elc) $(DYNVARSFILES) EMACS_GENERATE_DYNVARS=1 $(EMACS) -f batch-byte-compile \ - $(wildcard *.el) $(wildcard style/*el) \ + $(wildcard *.el) $(wildcard style/*.el) \ > /dev/null 2>&1 cat *.dynvars style/*.dynvars > auctex-dynvars - rm -f $(wildcard *.elc) $(wildcard style/*elc) + rm -f $(wildcard *.elc) $(wildcard style/*.elc) EMACS_DYNVARS_FILE=auctex-dynvars $(EMACS) \ -f batch-byte-compile \ - $(wildcard *.el) $(wildcard style/*el) + $(wildcard *.el) $(wildcard style/*.el)
Re: [can't compile the main branch]: SOLVED
Tassilo Horn writes: > I totally don't mind when you fix my errors and oversights. That's > exactly why I've hired you. ;-) And I rely on Keita looknig after me ;-) I have another question about this rule: clean: rm -f $(ALL_GENERATED_FILES) \ $(wildcard *.elc style/*.elc) \ auctex-autoloads.el \ ChangeLog \ $(DYNVARSFILES) Is it necessary to delete ChangeLog here? This rule just killed my local ChangeLog :-( We still have: ChangeLog: rm -f $@ ./build-aux/gitlog-to-auctexlog && cat ChangeLog.1 >> $@ elpa: $(MAIN_GENERATED_FILES) ChangeLog which should do the job, or am I missing something? > I don't get them with regular make either. Maybe because I run emacs > master which is a bit more clever? My Emacs is from master and 9c01da56a5 smart. Best, Arash
Re: [can't compile the main branch]: SOLVED
Tassilo Horn writes: > We are lucky. Good that we have him. 👍 > It depends on how clean the clean target should make. I went for very > clean but wouldn't mind if the ChangeLog was kept. For what purpose? I maintain a ChangeLog: I use 'C-x 4 a' to make a ChangeLog entry and depending on how I make a commit, I plonk that entry into the commit message (vc or copy&paste); I don't use Magit. So I rely on that file. > And you get Uwe's additional warnings with that, too? Yes, I see them as well. Best, Arash
main 80f47a4b: * GNUmakefile (clean): Don't clean up ChangeLog.
branch: main commit 80f47a4b72eeac0d1b5a83badfa7482b5f9378eb Author: Arash Esbati Commit: Arash Esbati * GNUmakefile (clean): Don't clean up ChangeLog. --- GNUmakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 999861cb..507d69fd 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -83,7 +83,6 @@ clean: rm -f $(ALL_GENERATED_FILES) \ $(wildcard *.elc style/*.elc) \ auctex-autoloads.el \ - ChangeLog \ $(DYNVARSFILES) # Copied&adapted from doc/Makefile.in.
Re: [can't compile the main branch]: SOLVED
Tassilo Horn writes: > Ah, ok, and you do that probably over multiple emacs sessions so that > the buffer isn't there anymore. Yes, my workflow is to write the ChangeLog entry directly after the change and not before the actual commit, hence I need a file. > You might as well customize change-log-default-name to > "MyTmpChangeLog" or something so that the name doesn't clash with a > generated, untracked file which might be deleted or re-generated at > will. It worked quite well until now, and loosing that file isn't a big deal, but that shouldn't happen on a regular basis. I pushed that change. Best, Arash
Re: [can't compile the main branch]
Tassilo Horn writes: > And there it is! So it seems to work now; you can stop knocking. ;-) 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 Thanks! Best, Arash
Re: emacs 29.1 more problems
Hi Uwe, Uwe Brauer writes: > I concentrated on the repository that I cloned with git. > > I compiled and installed GNU emacs > commit 1d4e90341782 > 31.05.2022, where the function loaddefs-generate-batch was introduced. If you look at this page, you'll see that the function/functionality went through some improvement loops. https://git.savannah.gnu.org/cgit/emacs.git/log/lisp/emacs-lisp/loaddefs-gen.el I don't think that the issue below is related to your Emacs, but you've been warned ;-) > 2. Compilation fails with error > > > lisp/debug-early.el") nil t) > loaddefs-generate-batch() > command-line-1(("-l" "lpath.el" "-f" "loaddefs-generate-batch" > "loaddefs.el" ".")) > command-line() > normal-top-level() > Opening output file: Permission denied, > /opt/emacs29.1/share/emacs/29.0.50/lisp/loaddefs.el > GNUmakefile:47: recipe for target 'autoloads' failed > make: *** [autoloads] Error 255 > make: *** Waiting for unfinished jobs > 267.572u 26.032s 1:21.80 358.9% 0+0k 0+10696io 0pf+0w I somehow lost track, but IIUC this issue isn't present anymore and you're back in business, right? Best, Arash
master a401c3fc: Silence the compiler for the "main" branch
branch: master commit a401c3fcc678541384b0cda915069c7998729fe0 Author: Arash Esbati Commit: Arash Esbati Silence the compiler for the "main" branch * latex.el: * plain-tex.el: * tex.el: Declare functions which are reported as not known to be defined when compiling the "main" branch. * style/pstricks.el (LaTeX-pst-env-pspicture): Use `TeX-read-key-val' instead of `multi-prompt-key-value'. --- latex.el | 12 ++-- plain-tex.el | 3 +++ style/pstricks.el | 9 + tex.el| 14 -- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/latex.el b/latex.el index 9e769e97..e2d2d88e 100644 --- a/latex.el +++ b/latex.el @@ -39,12 +39,12 @@ (require 'subr-x))) ;; Silence the compiler for functions: -(declare-function outline-level "ext:outline" - nil) -(declare-function outline-mark-subtree "ext:outline" - nil) -(declare-function turn-off-filladapt-mode "ext:filladapt" - nil) +(declare-function multi-prompt "multi-prompt") +(declare-function multi-prompt-key-value "multi-prompt") +(declare-function LaTeX-install-toolbar "tex-bar" nil) +(declare-function outline-level "ext:outline" nil) +(declare-function outline-mark-subtree "ext:outline" nil) +(declare-function turn-off-filladapt-mode "ext:filladapt" nil) ;; Silence the compiler for variables: (defvar outline-heading-alist) diff --git a/plain-tex.el b/plain-tex.el index 5691859d..2b777869 100644 --- a/plain-tex.el +++ b/plain-tex.el @@ -30,6 +30,9 @@ (require 'tex) +;; Silence the compiler for functions: +(declare-function TeX-install-toolbar "tex-bar" nil) + ;;; Tool bar (defcustom plain-TeX-enable-toolbar t diff --git a/style/pstricks.el b/style/pstricks.el index b5b93df6..f40db099 100644 --- a/style/pstricks.el +++ b/style/pstricks.el @@ -1,6 +1,6 @@ ;;; pstricks.el --- AUCTeX style for the `pstricks' package. -*- lexical-binding: t; -*- -;; Copyright (C) 2007-2022 Free Software Foundation, Inc. +;; Copyright (C) 2007-2024 Free Software Foundation, Inc. ;; Author: Holger Sparr ;; Maintainer: auctex-devel@gnu.org @@ -652,9 +652,10 @@ package PNAME" ;;; Environments (defun LaTeX-pst-env-pspicture (env) "Create new pspicure environment." - (let ((opt (multi-prompt-key-value - (TeX-argument-prompt t "Options" nil) - '(("showgrid") ("shift" + (let ((opt (TeX-read-key-val t + '(("showgrid" ("true" "false")) + ("shift")) + "Options")) (p0 (LaTeX-pst-what "point" "Lower left (default 0,0)" "0,0")) (p1 (LaTeX-pst-what "point" "Upper right (default 1,1)" "1,1")) corn) diff --git a/tex.el b/tex.el index 325f883b..9fb533ff 100644 --- a/tex.el +++ b/tex.el @@ -54,11 +54,13 @@ (bus service path interface method &rest args)) (declare-function dbus-register-signal "ext:dbus" (bus service path interface signal handler &rest args)) +(declare-function font-latex-setup "font-latex" nil) (declare-function LaTeX-environment-list "latex" nil) (declare-function LaTeX-bibliography-list "latex" nil) (declare-function LaTeX-completion-label-annotation-function "latex" (label)) (declare-function LaTeX-completion-label-list "latex" nil) (declare-function LaTeX-section-name "latex" (level)) +(declare-function TeX-fold-mode "tex-fold" (&optional arg)) (declare-function comint-exec "ext:comint" (buffer name command startfile switches)) (declare-function comint-mode "ext:comint" nil) @@ -801,12 +803,12 @@ emacs 24.1 and is then later run by emacs 24.5." (advice-add 'hack-one-local-variable :after #'TeX--call-minor-mode) (defun TeX--call-minor-mode (var val &rest _) "Call minor mode function if minor mode variable is found." -;; Instead of checking for each mode explicitly `minor-mode-list' -;; could be used. But this may make the byte compiler pop up. -(when (memq var '(TeX-PDF-mode - TeX-source-correlate-mode TeX-interactive-mode - TeX-fold-mode LaTeX-math-mode)) - (funcall var (if (symbol-value val) 1 0 + ;; Instead of checking for each mode explicitly `minor-mode-list' + ;; could be used. But this may make the byte compiler pop up. + (when (memq var '(TeX-PDF-mode +TeX-source-correlate-mode TeX-interactive-mode +TeX-fold-mode LaTeX-math-mode)) +(funcall var (if (symbol-value val) 1 0 (defvar TeX-overlay-priority-step 16 "Numerical difference of priorities between nested overlays.
master f5546d1d: ; * NEWS.org: Update the file.
branch: master commit f5546d1da0feacc43d0673dab262a7a7f44f26e9 Author: Arash Esbati Commit: Arash Esbati ; * NEWS.org: Update the file. --- NEWS.org | 4 1 file changed, 4 insertions(+) diff --git a/NEWS.org b/NEWS.org index 21b98e30..10e890e0 100644 --- a/NEWS.org +++ b/NEWS.org @@ -10,6 +10,10 @@ ** Added +- Add support for indirect buffers cloned from buffers visiting a file. + In indirect buffer, preview-latex works correctly when the command + ~preview-region~ is invoked. The command ~preview-document~ puts + preview images in the base buffer, not in the indirect buffer itself. - Add preliminary support for processing files with latexmk. Support for =dvipdfmx= and the choice for viewer after compilation are not optimal, yet. Overall, the support comes close to what the
master 63968cc5: * tex.el (TeX-one-master): Consider .ltx as ordinary TeX files.
branch: master commit 63968cc5cf56a0bcbabca55e49861865578b5bd5 Author: Arash Esbati Commit: Arash Esbati * tex.el (TeX-one-master): Consider .ltx as ordinary TeX files. --- tex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tex.el b/tex.el index d2864b5f..cda1d7f6 100644 --- a/tex.el +++ b/tex.el @@ -2335,7 +2335,7 @@ It is suggested that you use the File Variables (see the info node (member x (quote (t nil shared dwim)) (make-variable-buffer-local 'TeX-master) -(defcustom TeX-one-master "\\.\\(texi?\\|dtx\\)$" +(defcustom TeX-one-master "\\.\\(texi?\\|[dl]tx\\)\\'" "Regular expression matching ordinary TeX files. You should set this variable to match the name of all files, where
master 8db1e90b: Make auto-reveal customizations easier to extend
branch: master commit 8db1e90b6d25beb72b5ebbc706b6def64794dcf8 Author: Paul Nelson Commit: Arash Esbati Make auto-reveal customizations easier to extend * preview.el.in (preview-auto-reveal-commands): New user option. (preview-auto-reveal): Use it. * doc/preview-latex.texi (Simple customization): Document it. * tex-fold.el (TeX-fold-auto-reveal-commands): New user option. (TeX-fold-auto-reveal): Use it. (doc/auctex.texi): Document it. (bug#70525) --- doc/auctex.texi| 12 +--- doc/preview-latex.texi | 4 +++- preview.el.in | 13 +++-- tex-fold.el| 15 --- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/doc/auctex.texi b/doc/auctex.texi index 4d338c39..05695f0f 100644 --- a/doc/auctex.texi +++ b/doc/auctex.texi @@ -2864,9 +2864,15 @@ Cons cell @code{(@var{FUNCTION} . @var{ARGUMENTS})}: @AUCTeX{} calls the 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. +The default behavior is to reveal when the point enters the folded portion +via one of the commands specified in @code{TeX-fold-auto-reveal-commands}. +@end defopt + +@defopt TeX-fold-auto-reveal-commands +This is a list of commands, consulted under the default behavior of +@code{TeX-fold-auto-reveal}. By default, it consists of the commands +@kbd{@key{left}}, @kbd{@key{right}}, @kbd{C-b}, @kbd{C-f} or mouse click +under standard key binding. @end defopt diff --git a/doc/preview-latex.texi b/doc/preview-latex.texi index 0bce9747..84d80be1 100644 --- a/doc/preview-latex.texi +++ b/doc/preview-latex.texi @@ -393,7 +393,9 @@ again once the cursor leaves them again (this is also done when doing incremental search, or query-replace operations), unless you changed anything in it. In that case, you will have to regenerate the preview (via e.g., @kbd{C-c C-p C-p}). Other options for -@code{preview-auto-reveal} are available via @code{customize}. +@code{preview-auto-reveal} are available via @code{customize}. Note that +the default behavior of @code{preview-auto-reveal} derives from the list +@code{preview-auto-reveal-commands} which can be customized as well. @item Automatically cache preambles diff --git a/preview.el.in b/preview.el.in index 7b59a3de..9f7db674 100644 --- a/preview.el.in +++ b/preview.el.in @@ -1641,9 +1641,18 @@ numbers (can be float if available)." Fallback to :inherit and \\='default implemented." :group 'preview-appearance) +(defcustom preview-auto-reveal-commands + '((key-binding [left]) +(key-binding [right]) +backward-char +forward-char) + "List of commands that may cause a preview to be revealed. +This list is consulted by the default value of `preview-auto-reveal'." + :type '(repeat (choice (function :tag "Function") + (sexp :tag "Key binding" + (defcustom preview-auto-reveal - '(eval (preview-arrived-via (key-binding [left]) (key-binding [right]) - #'backward-char #'forward-char)) + '(eval (apply #'preview-arrived-via preview-auto-reveal-commands)) "Cause previews to open automatically when entered. Possibilities are: t autoopens, diff --git a/tex-fold.el b/tex-fold.el index 62f0834c..e45188a6 100644 --- a/tex-fold.el +++ b/tex-fold.el @@ -257,10 +257,19 @@ After that, changing the prefix key requires manipulating keymaps." (define-key map "i"#'TeX-fold-clearout-item) map)) +(defcustom TeX-fold-auto-reveal-commands + '((key-binding [left]) +(key-binding [right]) +backward-char +forward-char +mouse-set-point) + "List of commands that may cause a fold to be revealed. +This list is consulted by the default value of `TeX-fold-auto-reveal'." + :type '(repeat (choice (function :tag "Function") + (sexp :tag "Key binding" + (defcustom TeX-fold-auto-reveal - '(eval (TeX-fold-arrived-via (key-binding [left]) (key-binding [right]) - #'backward-char #'forward-char - #'mouse-set-point)) + '(eval (apply #'TeX-fold-arrived-via TeX-fold-auto-reveal-commands)) "Predicate to open a fold when entered. Possibilities are: t autoopens,
master 2d0c7011: Allow multiple preview preprocessors
branch: master commit 2d0c70114e5c475f311c1c481dae060c3e2cd882 Author: Paul Nelson Commit: Arash Esbati Allow multiple preview preprocessors * preview.el.in (preview-preprocessor-functions): New variable, replacing `preview-preprocessor-function'. (preview-region): Use it. (bug#70607) --- preview.el.in | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/preview.el.in b/preview.el.in index 9f7db674..72568be7 100644 --- a/preview.el.in +++ b/preview.el.in @@ -4120,9 +4120,9 @@ stored in `preview-dumped-alist'." (preview-format-kill old-format) (setcdr old-format nil)) -(defvar preview-preprocess-function nil - "Function used to preprocess region before previewing. -The function bound to this variable will be called inside +(defvar preview-preprocess-functions nil + "List of functions used to preprocess region before previewing. +The functions in this variable will each be called inside `preview-region' with one argument which is a string.") (defun preview-region (begin end) @@ -4134,9 +4134,9 @@ The function bound to this variable will be called inside TeX-region-extra))) (TeX-region-create (TeX-region-file TeX-default-extension) (let ((str (buffer-substring-no-properties begin end))) - (if preview-preprocess-function - (funcall preview-preprocess-function str) - str)) + (dolist (fun preview-preprocess-functions) + (setq str (funcall fun str))) + str) (if (TeX-buffer-file-name) (file-name-nondirectory (TeX-buffer-file-name)) "")
master 8b6a6bbc 1/2: Allow programmatic preview abortion
branch: master commit 8b6a6bbce4704ac3b759a5f09ea0844dfd624892 Author: Paul Nelson Commit: Arash Esbati Allow programmatic preview abortion * preview.el.in (preview-abort-flag): New variable. (preview-TeX-inline-sentinel): Use it. (bug#70630) --- preview.el.in | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/preview.el.in b/preview.el.in index 72568be7..64473e60 100644 --- a/preview.el.in +++ b/preview.el.in @@ -3902,6 +3902,12 @@ If FAST is set, do a fast conversion." TeX-shell-command-option command +(defvar-local preview-abort-flag nil + "Cause ongoing preview generation to abort. +If non-nil, then `preview-TeX-inline-sentinel' aborts and resets this +variable to nil. This is intended to give a way for external packages +to abort preview generation, more reliably than via process signals.") + (defun preview-TeX-inline-sentinel (process _name) "Sentinel function for preview. See `TeX-sentinel-function' and `set-process-sentinel' @@ -3910,7 +3916,12 @@ for definition of PROCESS and NAME." (let ((status (process-status process))) (if (memq status '(signal exit)) (delete-process process)) -(when (eq status 'exit) +(cond + ((with-current-buffer TeX-command-buffer +(prog1 +preview-abort-flag + (setq preview-abort-flag nil + ((eq status 'exit) (save-excursion (goto-char (point-max)) (forward-line -1) @@ -3921,7 +3932,7 @@ for definition of PROCESS and NAME." (condition-case err (preview-call-hook 'open) (error (preview-log-error err "LaTeX" process))) - (preview-reraise-error process + (preview-reraise-error process) (defcustom preview-format-extensions '(".fmt" ".efmt") "Possible extensions for format files.
master updated (2d0c7011 -> 06c0df55)
esbati pushed a change to branch master. from 2d0c7011 Allow multiple preview preprocessors new 8b6a6bbc Allow programmatic preview abortion new 06c0df55 Expand default auto-reveal options Summary of changes: preview.el.in | 19 --- tex-fold.el | 4 +++- 2 files changed, 19 insertions(+), 4 deletions(-)
master 06c0df55 2/2: Expand default auto-reveal options
branch: master commit 06c0df55a49cf1946042ec540a0c5ac503279cfb Author: Paul Nelson Commit: Arash Esbati Expand default auto-reveal options * preview.el.in (preview-auto-reveal-commands): * tex-fold.el (TeX-fold-auto-reveal-commands): Add pop-to-mark-command and undo to the default setting. (bug#70710) --- preview.el.in | 4 +++- tex-fold.el | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/preview.el.in b/preview.el.in index 64473e60..ee176c79 100644 --- a/preview.el.in +++ b/preview.el.in @@ -1645,7 +1645,9 @@ Fallback to :inherit and \\='default implemented." '((key-binding [left]) (key-binding [right]) backward-char -forward-char) +forward-char +pop-to-mark-command +undo) "List of commands that may cause a preview to be revealed. This list is consulted by the default value of `preview-auto-reveal'." :type '(repeat (choice (function :tag "Function") diff --git a/tex-fold.el b/tex-fold.el index e45188a6..f7b1c32f 100644 --- a/tex-fold.el +++ b/tex-fold.el @@ -262,7 +262,9 @@ After that, changing the prefix key requires manipulating keymaps." (key-binding [right]) backward-char forward-char -mouse-set-point) +mouse-set-point +pop-to-mark-command +undo) "List of commands that may cause a fold to be revealed. This list is consulted by the default value of `TeX-fold-auto-reveal'." :type '(repeat (choice (function :tag "Function")
master 5fdc2350: Generalize some error description regexp
branch: master commit 5fdc23508032d08097b1c1a82928267426b0f03b Author: Paul Nelson Commit: Arash Esbati Generalize some error description regexp * latex.el (LaTeX-error-description-list): Generalize regexp for begin/end mismatch error, so that a line number may be given. (bug#70776) --- latex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latex.el b/latex.el index e2d2d88e..5c6a8510 100644 --- a/latex.el +++ b/latex.el @@ -7160,7 +7160,7 @@ error message occurs when the is used in a centering or flushing environment or else in the scope of a centering or flushing declaration.") -("begin{[^ ]*} ended by end{[^ ]*}." . +("begin{[^ ]*} \\(?:on input line [0-9]+ \\)?ended by end{[^ ]*}." . "LaTeX has found an \\end command that doesn't match the corresponding \\begin command. You probably misspelled the environment name in the \\end command, have an extra \\begin, or else forgot an \\end.")
master 0caa1706: Fix previews in indirect buffers
branch: master commit 0caa1706494d465d00c82c268e35acee52e8fd9a Author: Paul Nelson Commit: Arash Esbati Fix previews in indirect buffers * preview.el.in (preview-region): Revert the change from buffer-file-name to (TeX-buffer-file-name) introduced in 0e315c7fbeed081addf369fd42e7206d83580bc5 (see bug#58005). --- preview.el.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/preview.el.in b/preview.el.in index ee176c79..e8c2c695 100644 --- a/preview.el.in +++ b/preview.el.in @@ -4150,8 +4150,8 @@ The functions in this variable will each be called inside (dolist (fun preview-preprocess-functions) (setq str (funcall fun str))) str) - (if (TeX-buffer-file-name) - (file-name-nondirectory (TeX-buffer-file-name)) + (if buffer-file-name + (file-name-nondirectory buffer-file-name) "") (TeX-current-offset begin))) (setq TeX-current-process-region-p t)
master 1d66dd1f: Enable lexical-binding in auto-generated styles
branch: master commit 1d66dd1f6f047c05f0802b58c1924ec1f9700fd9 Author: Arash Esbati Commit: Arash Esbati Enable lexical-binding in auto-generated styles * tex.el (TeX-auto-store): Add lexical cookie to auto-generated style files. --- tex.el | 1 + 1 file changed, 1 insertion(+) diff --git a/tex.el b/tex.el index cda1d7f6..0dec8568 100644 --- a/tex.el +++ b/tex.el @@ -4267,6 +4267,7 @@ If TEX is a directory, generate style files for all files in the directory." (TeX-unload-style style) (with-current-buffer (generate-new-buffer file) (erase-buffer) + (insert ";; -*- lexical-binding: t; -*-\n\n") (insert "(TeX-add-style-hook\n \"" style "\"\n (lambda ()") (unless (string= tex-cmd-opts "")
master 5f039df9: ; * NEWS.org: Update the file.
branch: master commit 5f039df961e910402f4a8b742cc2f82371f2e688 Author: Arash Esbati Commit: Arash Esbati ; * NEWS.org: Update the file. --- NEWS.org | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/NEWS.org b/NEWS.org index 10e890e0..f0649d6f 100644 --- a/NEWS.org +++ b/NEWS.org @@ -22,16 +22,21 @@ hides all configured macros in the section containing point when ~TeX-fold-mode~ is active. The unfold counterpart ~TeX-fold-clearout-section~ is bound to =C-c C-o s=. -- Add new custom option ~TeX-fold-auto-reveal~ which contols how the - original source text is revealed when user clicks the folded portion - by mouse. - Add new custom option ~TeX-fold-region-functions~ which is a list of additional functions to call when folding a region. +- Add new custom option ~TeX-fold-auto-reveal~ which controls how the + original source text is revealed when user clicks the folded portion + by mouse. +- Add new custom options ~TeX-fold-auto-reveal-commands~ and + ~preview-auto-reveal-commands~ which are lists of commands revealing + folded or previewed buffer text. - Add new custom option ~preview-protect-point~ which determines whether previews generated on top of the current point should be temporarily opened (~nil~ by default). - Add new custom option ~preview-leave-open-previews-visible~ which determines if the preview code stays visible once opened. +- Change the default value of ~TeX-one-master~ in order to recognize the + suffix =.ltx= as regular TeX files. - Support query and insert of ~mcite~ compatibility macro (=style/biblatex.el=). - Support the =\verbatiminput*= macro (=style/verbatim.el=).
master cba5820c: Allow compilation messages to be suppressed
branch: master commit cba5820cf80ca46b08956d7f94f9b98e0e222db8 Author: Paul Nelson Commit: Arash Esbati Allow compilation messages to be suppressed * tex.el (TeX-suppress-compilation-message): New variable. (TeX-run-command): Use it. (bug#70783) --- tex.el | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tex.el b/tex.el index 0dec8568..e13c02ce 100644 --- a/tex.el +++ b/tex.el @@ -7997,6 +7997,9 @@ requires special treatment." :group 'TeX-command :type 'boolean) +(defvar TeX-suppress-compilation-message nil + "If non-nil, suppress \"display results of compilation\" message.") + (defun TeX-run-command (name command file) "Create a process for NAME using COMMAND to process FILE. Return the new process." @@ -8018,9 +8021,10 @@ Return the new process." (TeX-output-mode) (if TeX-show-compilation (display-buffer buffer) - (message "Type `%s' to display results of compilation." - (substitute-command-keys -"[TeX-recenter-output-buffer]"))) + (unless TeX-suppress-compilation-message +(message "Type `%s' to display results of compilation." + (substitute-command-keys + "[TeX-recenter-output-buffer]" (setq TeX-parse-function #'TeX-parse-command) (setq TeX-command-default default) (setq TeX-sentinel-function
Re: [PATCH 1/3] Let it byte compile even with GNU Emacs 29.3
Werner Fink writes: > Signed-off-by: Werner Fink > --- Hi Werner, thanks for the change set. I have some question, see below. > latex.el | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/latex.el b/latex.el > index 5c6a8510..0f970949 100644 > --- a/latex.el > +++ b/latex.el > @@ -2030,7 +2030,7 @@ TYPE is one of the symbols mac or env." > ;; over [>=] and a balanced {} > ((looking-at-p "[>=]") > (forward-char 1) > - (with-syntax-table syntax (forward-sexp))) > + (with-syntax-table syntax (ignore-errors (forward-sexp Can you please elaborate why `ignore-errors' is needed here? IIUC this is about byte compiling with Emacs 29.3? I have no problems compiling latex.el with Emacs 30 until now. > From 26c22d66eea3307106da436edb7ad7fc4e3abe8f Mon Sep 17 00:00:00 2001 > From: Werner Fink > Date: Tue, 7 May 2024 09:01:17 +0200 > Subject: [PATCH 2/3] Enable initial reset for LaTeX classes > > Enable initial reset for LaTeX classes to load the class mode > at creation of the document. The declared variable is called > LaTeX-global-class-files and not TeX-global-class-files. > > Signed-off-by: Werner Fink > --- > latex.el | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/latex.el b/latex.el > index 0f970949..957586c2 100644 > --- a/latex.el > +++ b/latex.el > @@ -2714,7 +2714,7 @@ Initialized once at the first time you prompt for a > LaTeX class. > May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.") > > ;; Add the variable to `TeX-normal-mode-reset-list': > -(add-to-list 'TeX-normal-mode-reset-list 'TeX-global-class-files) > +(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-global-class-files) > > (defcustom TeX-arg-input-file-search t >"If `TeX-arg-input-file' should search for files. > -- > > 2.43.0 Argh, thanks, `TeX-global-class-files' is plain wrong. > From f9c892d072b6fd58b934c46ed334381e8e6f4786 Mon Sep 17 00:00:00 2001 > From: Werner Fink > Date: Tue, 7 May 2024 09:17:30 +0200 > Subject: [PATCH 3/3] Update dinbrief class > > Nowadays UTF-8 is standard, also port the features of the letter class > to dinbrief class. > > Signed-off-by: Werner Fink > --- > style/dinbrief.el | 45 - > 1 file changed, 32 insertions(+), 13 deletions(-) > > diff --git a/style/dinbrief.el b/style/dinbrief.el > index c3108466..49e1071c 100644 > --- a/style/dinbrief.el > +++ b/style/dinbrief.el > @@ -32,14 +32,26 @@ > (require 'tex) > (require 'latex) > > +;; Silence the compiler: > +(declare-function font-latex-add-keywords > + "font-latex" > + (keywords class)) > + > +(defvar LaTeX-dinbrief-class-options > + '("10pt" "11pt" "12pt" "norm" "a4paper" "a5paper" "b5paper" > +"letterpaper" "legalpaper" "executivepaper" "twoside" > +"addresshigh" "addressstd" "onecolumn" "twocolumn") > + "Package options for the letter class.") > + > (TeX-add-style-hook > "dinbrief" > (lambda () > - (add-hook 'LaTeX-document-style-hook > - #'LaTeX-dinbrief-style) > (LaTeX-add-environments > '("letter" LaTeX-dinbrief-env-recipient) > "dinquote") > + (add-hook 'LaTeX-document-style-hook > + #'LaTeX-dinbrief-style) I suspect this change is just aesthetic? > (defmacro LaTeX-dinbrief-insert (&rest args) > @@ -77,17 +104,9 @@ > (beginning-of-line 1)) > (open-line 2) > (indent-relative-first-indent-point) > -(LaTeX-dinbrief-insert TeX-esc "usepackage" > - LaTeX-optop "latin1,utf8" LaTeX-optcl > - TeX-grop "inputenc" TeX-grcl) > -(newline-and-indent) > -(LaTeX-dinbrief-insert TeX-esc "usepackage" > - LaTeX-optop "T1" LaTeX-optcl > - TeX-grop "fontenc" TeX-grcl) > -(indent-relative-first-indent-point) > (LaTeX-dinbrief-insert TeX-esc "usepackage" > TeX-grop "ngerman" TeX-grcl)) > - (TeX-run-style-hooks "inputenc" "fontenc" "ngerman")) > + (TeX-run-style-hooks "ngerman")) I agree with dropping inputenc, but fontenc is a different beast, and for German text, I think \usepackage[T1]{fontenc} is a good choice which we should keep. And what about switching from \usepackage{ngerman} to \usepackage[ngerman]{babel}? Best, Arash
master 59ddea9f: Correct variable name
branch: master commit 59ddea9f134e1c16206749b38314a47acde680de Author: Arash Esbati Commit: Arash Esbati Correct variable name * latex.el (TeX-normal-mode-reset-list): Fix the name of the variable added to the list which is `LaTeX-global-class-files'. Reported by Werner Fink . --- latex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latex.el b/latex.el index 5c6a8510..acdb5f73 100644 --- a/latex.el +++ b/latex.el @@ -2714,7 +2714,7 @@ Initialized once at the first time you prompt for a LaTeX class. May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.") ;; Add the variable to `TeX-normal-mode-reset-list': -(add-to-list 'TeX-normal-mode-reset-list 'TeX-global-class-files) +(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-global-class-files) (defcustom TeX-arg-input-file-search t "If `TeX-arg-input-file' should search for files.
Re: [PATCH 1/3] Let it byte compile even with GNU Emacs 29.3
Hi Werner, "Dr. Werner Fink" writes: > normally with every update of AUCTeX or TeXlive I do within a clean > chroot with full TeXLive tree a scan of all style files via > TeX-auto-generate-global ... This is a dangerous operation; AUCTeX is known to produce sub-optimal (not to say gibberish) when auto-parsing .sty files. For an example of what can happen, have look at this report: https://emacs.stackexchange.com/q/80913/12242 I think the issue was that Debian does the same thing above and the auto-parsed bibentry.el actually messed up the AUCTeX setup for the one user. > ``` > %if %{with tex4auto} > pwd > echo "Run the command TeX-auto-generate-global in mini buffer" > emacs-gtk -batch -Q -L %{buildroot}%{_sitedir}/auctex > \ > --eval '(setq TeX-lisp-directory "%{buildroot}%{_aucdir}")' > \ > --eval '(setq TeX-auto-global "%{buildroot}%{_aucdir}/auto")' > \ > -l %{buildroot}%{_sitedir}/tex-site.el -f TeX-auto-generate-global > exit 1 > %else > ``` > and collect this in an addon tar ball, now > auctex-13.3-auto-TL-2024.tar.xz . Is this something (open)suse offers for download and usage? If so, I would vote for dropping this practice, the usual end of story is that we recommend people not use the tarballs provided by distros and install the ELPA version (see above). > Without this `ignore-errors' several scaned files causes errors. I had > added those `ignore-errors' step by step means broken scan by broken > scan to catch all of them :) Got it. Can you point me to the offending files? If the AUCTeX parser was fooled by valid LaTeX code, we should try to fix AUCTeX instead of just silencing the errors. `LaTeX-xparse-macro-parse' was the function in question. > The addon tar ball will then installed without any scan at install > time. This saves time in our build system here as this step is done > only once. See above. And while we're at: Do I understand correctly that you maintain the AUCTeX package for (open)suse? (Sorry, I lost track about what suse and/or opensuse do and what the differences are.) > Yep it broken the dinbrief calls handling, means the default > environment was not "letter" nor the code in dinbrief.el ask the user > for intput. Thanks, I installed that change. > OK your point ... here our setup T1 is the default but this is not > common indeed. To be honest, I'm not happy with being too smart and add stuff into a file where a user then start deleting it. What do you think about deleting all those additions, so people can insert whatever they really use? > Should I change the patch? Yes, that would be great, if you agree with the suggestion above. Best, Arash
master 61f8825c: Add new style/amsrefs.el
branch: master commit 61f8825cfdd2d3746e7d85e0d9c91811d0ec3d38 Author: Arash Esbati Commit: Arash Esbati Add new style/amsrefs.el * Makefile.in (STYLESRC): Add new style. * style/amsrefs.el: New file. --- Makefile.in | 2 +- style/amsrefs.el | 233 +++ 2 files changed, 234 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index bc2ea951..9dcb3d7b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -198,7 +198,7 @@ STYLESRC = style/prosper.el \ style/amsaddr.el style/parskip.el style/catchfilebetweentags.el \ style/physics.el style/soul.el style/algpseudocodex.el \ style/wasysym.el style/refcount.el style/simpleicons.el \ - style/changebar.el + style/changebar.el style/amsrefs.el STYLEELC = $(STYLESRC:.el=.elc) diff --git a/style/amsrefs.el b/style/amsrefs.el new file mode 100644 index ..babfebb1 --- /dev/null +++ b/style/amsrefs.el @@ -0,0 +1,233 @@ +;;; amsrefs.el --- AUCTeX style for `amsrefs.sty' -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Free Software Foundation, Inc. + +;; Author: Arash Esbati +;; Maintainer: auctex-devel@gnu.org +;; Created: 2024-02-21 +;; Keywords: tex + +;; This file is part of AUCTeX. + +;; AUCTeX is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; AUCTeX is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with AUCTeX; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301 USA. + +;;; Commentary: + +;; This file adds support for `amsrefs.sty' form 2013-01-16. + +;;; Code: + +(require 'tex) +(require 'latex) + +;; Silence the compiler: +(declare-function font-latex-add-keywords + "font-latex" + (keywords class)) + +(defun LaTeX-item-amsrefs-bib () + "Insert a new bib item from the amsrefs package." + (TeX-insert-macro "bib")) + +(defun LaTeX-env-amsrefs-biblist (_environment) + "Ignore ENVIRONMENT and insert a \"biblist\" environment with arguments." + (let ((opt (TeX-read-string + (TeX-argument-prompt t nil "argument"))) +(keyvals (unless (LaTeX-provided-class-options-member "amsrefs" + "author-year") + (TeX-read-key-val t '(("labels" ("numeric" "alphabetic" +"shortalphabetic")) + ("prefix")) +(LaTeX-insert-environment "biblist" + (concat (unless (string-empty-p opt) +(concat LaTeX-optop opt LaTeX-optcl)) + (unless (string-empty-p keyvals) +(concat "*" TeX-grop keyvals TeX-grcl) + (end-of-line 0) + (delete-char 1) + (delete-horizontal-space) + (LaTeX-insert-item)) + +(defvar LaTeX-amsrefs-bib-regexp + `(,(concat "bib\\*?{\\(" TeX-token-char "[^, \n\r\t%\"#'()={}]*\\)}") +1 LaTeX-auto-bibitem) + "Matches the cite key after the \\bib macro.") + +(defvar LaTeX-amsrefs-bib-key-val + '(;; Simple fields +("accessdate") +("address") +("booktitle") +("date") +("edition") +("eprint") +("hyphenation") +("journal") +("label") +("language") +("note") +("number") +("organization") +("pages") +("part") +("publisher") +("series") +("status") +("subtitle") +("title") +("type") +("volume") +;; Repeatable fields +("author") +("editor") +("translator") +("isbn") +("issn") +("review") +;; Compound fields: Not support by key=val system +("book" ("{}")) +("conference" ("{}")) +("contribution" ("{}")) +("partial" ("{}")) +("reprint" ("{}")) +("translation" (
master bf7ceef1: ; * NEWS.org: Update the file.
branch: master commit bf7ceef14fbe8e9c3deb8d285de33147977ef0ed Author: Arash Esbati Commit: Arash Esbati ; * NEWS.org: Update the file. --- NEWS.org | 137 +++ 1 file changed, 137 insertions(+) diff --git a/NEWS.org b/NEWS.org index f0649d6f..09e98daa 100644 --- a/NEWS.org +++ b/NEWS.org @@ -67,3 +67,140 @@ - Revert usage of ~:local~ tag inside ~defcustom~. This tag isn't handled correctly in Emacs 27.1 and breaks AUCTeX. + +* [14.0.3] - 2024-02-20 + +** Fixed + +- Cater for former mode name in customized ~TeX-command-list~. +- Fix and enhance pseudo-parent mode facility. + +* [14.0.2] - 2024-02-09 + +** Fixed + +- Fix ELPA releases. + +* [14.0.1] - 2024-02-08 + +** Added + +- AUCTeX changes major mode names. Its primary purpose is to avoid + conflicts with Emacs built-in TeX major modes. It also improves + consistency of the source code. + - The overview of the former names and new names are: +| Former name | New name | +|---+---| +| ~plain-tex-mode~ | ~plain-TeX-mode~ | +| ~latex-mode~ | ~LaTeX-mode~ | +| ~doctex-mode~ | ~docTeX-mode~ | +| ~texinfo-mode~| ~Texinfo-mode~| +| ~ams-tex-mode~| ~AmSTeX-mode~ | +| ~japanese-plain-tex-mode~ | ~japanese-plain-TeX-mode~ | +| ~japanese-latex-mode~ | ~japanese-LaTeX-mode~ | + +The undocumented modes ~context-en-mode~ and ~context-nl-mode~ were +deleted. + - We paid much attention to the compatibility and expect that almost +no particular treatment on the user side is needed. For example, +the names of the keymaps and mode hooks remain unchanged, and the +=mode:= tag in the file local variables in the existing files works +with old mode names. See below for more details + - If your Emacs is 29 or newer and you use =desktop.el= to save and +restore Emacs sessions, be careful before you update AUCTeX; You +should attempt to update only after +1. you kill all buffer under former AUCTeX modes which have + overlapped name with Emacs built-in TeX modes, and +2. you terminate the current Emacs session. +The modes with such overlapped name are ~plain-tex-mode~, +~latex-mode~, ~doctex-mode~ and ~texinfo-mode~. (The above +prescription ensures no buffer of such modes is recorded in the +desktop file. Otherwise those buffers would be restored in the +built-in modes, not AUCTeX modes, after the update of AUCTeX.) + - New mode names are chosen to match the existing variables, so most +user customizations as well as the third party libraries would +continue to work without modification. For example, names of +keymaps and hooks don't change as stated above. +(~AmS-TeX-mode-hook~ is renamed to ~AmSTeX-mode-hook~, but +compatibility alias is provided.) + - Now ~TeX-add-local-master~ adds entry of new mode names such as +#+begin_example + %%% Local Variables: + %%% mode: LaTeX <-- not `latex' + %%% End: +#+end_example + - The compatibility with the former mode names with respect to +invoking the major mode are retained. +1. Former modes which overlap with built-in modes, namely + ~plain-tex-mode~, ~latex-mode~, ~doctex-mode~, ~texinfo-mode~ and + ~tex-mode~ are handled by redirections; the same override advices + as before are continued to used for Emacs<29 while + ~major-mode-remap-alist~ is used for Emacs 29 and later. + (Therefore, if there are user codes which call ~latex-mode~ + directly, built-in ~latex-mode~ runs instead of AUCTeX + ~LaTeX-mode~ in Emacs 29 and later.) + + These redirections still honor your customization to ~TeX-modes~ + option. Thus you are served by built-in ~plain-tex-mode~ and + AUCTeX ~LaTeX-mode~ if you exclude ~plain-tex-mode~ from + ~TeX-modes~. +2. Other former names, e.g. ~context-mode~ and + ~japanese-latex-mode~, are handled by aliases such as + #+begin_src emacs-lisp + (defalias 'context-mode #'ConTeXt-mode) + #+end_src + - New modes recognize directory local variables prepaired for the +former mode name. For example, directory local variables for +~latex-mode~ are valid in ~LaTeX-mode~ as well. So you don~t have +to rewrite every former mode name to the new one in +=.dir-locals.el=. + - Your abbrevs are preserved. For example, ~latex-mode-abbrev-table~, +if exists, is automatically included as a parent of +~LaTeX-mode-abbrev-table~. + - Now all major modes are defined by ~define-derived-mode~, so +standard inheritance of keymaps, syntax tables etc. takes place. +The inheritance relations are: +#+begin_example +
Re: [PATCH] fix delete-property handling
Ikumi Keita writes: >> 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? Please ping them again -- it shouldn't take so long, but sometimes it happens. So writing a kind reminder should help. Best, Arash
master 7b9efc2e: ; * style/amsrefs.el ("amsrefs"): Add the "biblist*" environment.
branch: master commit 7b9efc2e17c25bdb7e928e9eb865d2c09f3326b8 Author: Arash Esbati Commit: Arash Esbati ; * style/amsrefs.el ("amsrefs"): Add the "biblist*" environment. --- style/amsrefs.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/style/amsrefs.el b/style/amsrefs.el index babfebb1..0452b894 100644 --- a/style/amsrefs.el +++ b/style/amsrefs.el @@ -121,7 +121,8 @@ ;; 3 The biblist and biblist* environments (LaTeX-add-environments '("bibdiv") -'("biblist" LaTeX-env-amsrefs-biblist)) +'("biblist" LaTeX-env-amsrefs-biblist) +'("biblist*" LaTeX-env-amsrefs-biblist)) (TeX-add-symbols ;; 5 More about the \bib command
master 600b9244: ; * NEWS.org: Fix last change.
branch: master commit 600b92446fd767a7888ca7924b2c34252074d7ff Author: Arash Esbati Commit: Arash Esbati ; * NEWS.org: Fix last change. --- NEWS.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.org b/NEWS.org index 09e98daa..7a21f227 100644 --- a/NEWS.org +++ b/NEWS.org @@ -151,7 +151,7 @@ #+end_src - New modes recognize directory local variables prepaired for the former mode name. For example, directory local variables for -~latex-mode~ are valid in ~LaTeX-mode~ as well. So you don~t have +~latex-mode~ are valid in ~LaTeX-mode~ as well. So you don't have to rewrite every former mode name to the new one in =.dir-locals.el=. - Your abbrevs are preserved. For example, ~latex-mode-abbrev-table~, @@ -190,7 +190,7 @@ However, ~Texinfo-mode~ is exceptional in the following two aspects: 1. It doesn't inherit ~text-mode-syntax-table~ because it simply - uses built-in mode~s ~texinfo-mode-syntax-table~, which is + uses built-in mode's ~texinfo-mode-syntax-table~, which is independent of ~text-mode-syntax-table~. This situation is the same with the former AUCTeX Texinfo mode. 2. ~Texinfo-mode-map~ has ~TeX-mode-map~ as its direct parent. This
master a7f80ab8: Replace `TeX-arg-eval' in style/moodle.el
branch: master commit a7f80ab858775cd00f76637d70504941535898ae Author: Arash Esbati Commit: Arash Esbati Replace `TeX-arg-eval' in style/moodle.el * style/moodle.el (LaTeX-moodle-question-env-with-args): Delete function. (LaTeX-moodle-answer-key-val-options): New variable. (LaTeX-moodle-key-val-options): Use it. (LaTeX-moodle-question-env-with-args): Delete function. (LaTeX-moodle-item-argument): Expand function to recognize different environments. (LaTeX-moodle-query-question-text): New function. ("moodle"): Use new functions and replace `TeX-arg-eval'. Don't expose lambda's to the compiler. (LaTeX-moodle-package-options): Update package options. --- style/moodle.el | 263 +--- 1 file changed, 134 insertions(+), 129 deletions(-) diff --git a/style/moodle.el b/style/moodle.el index ac5f2866..cf629078 100644 --- a/style/moodle.el +++ b/style/moodle.el @@ -1,6 +1,6 @@ ;;; moodle.el --- AUCTeX style for `moodle.sty' (v0.5) -*- lexical-binding: t; -*- -;; Copyright (C) 2017, 2018, 2020 Free Software Foundation, Inc. +;; Copyright (C) 2017--2024 Free Software Foundation, Inc. ;; Author: Arash Esbati ;; Maintainer: auctex-devel@gnu.org @@ -43,158 +43,161 @@ "font-latex" (keywords class)) +(defvar LaTeX-moodle-answer-key-val-options + '(("fraction") +("fractiontol") +("feedback"))) + (defvar LaTeX-moodle-key-val-options - '(("points") -("default grade") -("penalty") -("fraction") -("feedback")) + (append '(("points") +("default grade") +("penalty") +("tags")) + LaTeX-moodle-answer-key-val-options) "Key=value options for moodle macros and environments.") -(defun LaTeX-moodle-question-env-with-args (env) - "Insert ENV provided by moodle.sty incl. arguments and first \\item." - (LaTeX-insert-environment - env - (let ((opts (TeX-read-key-val -t -(cond (;; 3.3.1 Multiple Choice - (string= env "multi") - (append '(("shuffle" ("true" "false")) - ("numbering" ("alph" "Alph" "arabic" - "roman" "Roman" "none")) - ("single"("true" "false")) - ("multiple" ("true" "false"))) - (when (string= "cloze" (LaTeX-current-environment)) - '(("vertical" ("true" "false")) - ("horizonal" ("true" "false" - LaTeX-moodle-key-val-options)) - ;; 3.3.3 Short Answer - ((string= env "shortanswer") - (append '(("case sensitive" ("true" "false")) - ("usecase"("true" "false"))) - (when (string= "cloze" (LaTeX-current-environment)) - '(("vertical" ("true" "false")) - ("horizonal" ("true" "false" - LaTeX-moodle-key-val-options)) - ;; 3.3.4 Essay Questions - ((string= env "essay") - (append '(("response required" ("true" "false")) - ("response format" ("html" "file" - "html+file" - "text" "monospaced")) - ("response field lines") - ("attachments allowed" ("0" "1" "2" "3" - "unlimited")) - ("attachments required" ("0" "1" "2" "3")) - ("response template")) - (when (string= "cloze" (LaTeX-current-environment)) - '(("vertical" ("true&qu
Re: enhance tex-fold to include the exam class
Uwe Brauer writes: > Please consider this minimal example > > \documentclass[addpoints,12pt]{exam} > \usepackage[utf8]{inputenc} > \usepackage[T1]{fontenc} > > \begin{document} > > \begin{questions} > \titledquestion{Chevalier de Méré and the dices} > \label{sec:org8ae33b2} > \droptotalpoints > > The following game was quite popular in the 17th century. > The famous «Chevalier de Méré» is the most well known player of that > epoch. > > \begin{parts}%Parts > \label{sec:orgec24546} > > \part[1] > \label{sec:orgdd21b38} > ¿What is the probability of obtaining at least one 6 if you throw > the dice 4 times? > \end{parts} > \titledquestion{Statistical testing} > \end{questions} > \end{document} > > I want to include titledquestion into the folding syntax > > So that TeX-fold-buffer fold result in > \titledquestion{Chevalier de Méré and the dices} > \titledquestion{Statistical testing}... > > That would help me quite a bit to change the order of questions in an > exam. Maybe I'm getting this wrong, but the requirement above sounds like your looking for outlining and not folding. You could something like this: --8<---cut here---start->8--- (setq TeX-outline-extra '(("[ \t]*titledquestion\\b" 5))) --8<---cut here---end--->8--- and then activate `outline-mode' in your .tex buffer. Best, Arash
Re: enhance tex-fold to include the exam class
Arash Esbati writes: > Maybe I'm getting this wrong, but the requirement above sounds like your > looking for outlining and not folding. You could something like this: > > (setq TeX-outline-extra > '(("[ \t]*titledquestion\\b" 5))) > > and then activate `outline-mode' in your .tex buffer. ^^ `outline-minor-mode', sorry.
Re: enhance tex-fold to include the exam class
Uwe Brauer writes: >> Uwe Brauer writes: > > Well > > 1. I tried that setting, > > 2. Opened the file sent in an earlier message > > 3. Run outline-minor-mode > > 4. Then I run either > >1. Hide entry > >2. Or hide body > > But in no case is see > > \titledquestion{Chevalier de Méré and the dices} This is what I see with "emacs -Q" and the recipe above after running `outline-hide-body': Side note: Using \part as a command with different meaning inside the environments provided by exam class is unfortunate, IMO. It breaks so many things inside AUCTeX and RefTeX; fontification is the smallest issue. Best, Arash
Re: enhance tex-fold to include the exam class
Uwe Brauer writes: > Confirmed. So my init file is the culprit. Sigh, that will take some > time to debug. 👍 > Yeah, this class goes back to 199X and the author, although still active > confesses that he is not a very acquainted with modern LaTeX constructs. > Ok this is a lame excuse, but I presume if I am telling him this, he is > not going to change exam syntax after so many years. Yes, changing the syntax is not an option, I think. But one could provide other macro names which do the same job, say \questionpart or \qpart etc. I don't know how other editors deal with exam package and its \part, but AUCTeX and RefTeX users suffer from this; and I don't see that we change things on our end. Best, Arash
master e30189d9: ; * NEWS.org: Update for 14.0.5 ELPA release.
branch: master commit e30189d92a701ab22a69a09fe2b9e9619fff6ce8 Author: Arash Esbati Commit: Arash Esbati ; * NEWS.org: Update for 14.0.5 ELPA release. --- NEWS.org | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS.org b/NEWS.org index 7a21f227..451056a7 100644 --- a/NEWS.org +++ b/NEWS.org @@ -6,7 +6,7 @@ # License: GNU General Public License 3 # The format is based on [[https://keepachangelog.com/en/1.1.0/][Keep a Changelog]] -* [Unreleased] +* [14.0.5] - 2024-05-19 ** Added @@ -37,9 +37,12 @@ determines if the preview code stays visible once opened. - Change the default value of ~TeX-one-master~ in order to recognize the suffix =.ltx= as regular TeX files. +- Add new custom option ~ConTeXt-paragraph-commands~ containing a list + of macros which should begin their own line. - Support query and insert of ~mcite~ compatibility macro (=style/biblatex.el=). - Support the =\verbatiminput*= macro (=style/verbatim.el=). +- Add new support file =style/amsrefs.el=. ** Fixed
Re: [PATCH 1/3] Let it byte compile even with GNU Emacs 29.3
(Resend this time with auctex-devel in CC) Hi Werner, > "Dr. Werner Fink" writes: >> Hmmm ... for me this is a service for the users and customers. If >> this really does not work I suggest to drop this feature. I had done >> this now appr. 30 year, means longer than I worked here at SUSE. I think dropping the feature from AUCTeX isn't necessary; one should be careful how to use it. At any rate, I think I have an opinion about rifling this function through a texmf-tree, but of course I leave the final decision to the distros. >> SUSE as well openSUSE is an rpm based system and this is part of the rpm >> package emacs-auctex. Thanks for the clarification. >> I've a log file with 21 examples and there are more I guess but to catch >> them one have to run emacs in batch mode with TeX-auto-generate-global >> and remove afterwards the TeX file. See log1.xz in the attachment. >> The main error is >> >> Error: error ("Font-lock trying to use keywords before setting them up") Thanks, that reminds me of an issue we had in our test suite, but before looking at that, have you tried to run your setup with font-latex disabled? So something like this: --8<---cut here---start->8--- %if %{with tex4auto} pwd echo "Run the command TeX-auto-generate-global in mini buffer" emacs-gtk -batch -Q -L %{buildroot}%{_sitedir}/auctex \ --eval '(setq TeX-lisp-directory "%{buildroot}%{_aucdir}")' \ --eval "(setq TeX-install-font-lock #'ignore)"\ --eval '(setq TeX-auto-global "%{buildroot}%{_aucdir}/auto")' \ -l %{buildroot}%{_sitedir}/tex-site.el -f TeX-auto-generate-global exit 1 %else --8<---cut here---end--->8--- Maybe that helps. >> The feaure of this dinbrief.el I'd like not to remove as it enables >> even a novice to write from scratch a german letter accordingly to >> the legal norm. I use this at my own therefore I stumbled over the >> bug above :) Ok, thanks. Best, Arash
Re: enhance tex-fold to include the exam class
Uwe Brauer writes: "UB" == Uwe Brauer writes: > >> Confirmed. So my init file is the culprit. Sigh, that will take some >> time to debug. > > I have to correct this statement. When trying to bisect my init file, I > failed. So I repeated the emacs -Q procedure and *it failed* for some > bizarre reason \titeledquestion is not displayed after running > outline-hide-body > > How can this be? I can't tell. I tried again this recipe: • emacs -Q • Activate AUCTeX (which is eval'ing 2 forms in my .emacs) • eval in scratch: (setq TeX-outline-extra '(("[ \t]*titledquestion\\b" 5))) • Open the file you sent • M-x outline-minor-mode RET • M-x outline-hide-body RET It gives me the results I already sent as snapshot. Best, Arash
Re: [PATCH 1/3] Let it byte compile even with GNU Emacs 29.3
"Dr. Werner Fink" writes: > That help a lot but at the end it stumbles over lwarp.sty with an other > error: > > [ 109s] Error: scan-error ("Containing expression ends prematurely" 4 5) > > I'll attach the lisp backtrace I think this is an issue within lwarp.sty which has entries like this: \NewDocumentCommand{\LWR@htmlspanclass}{o D(){} m +m}{% which are parsed correctly and entries like this: \NewDocumentCommand{\LWR@HTML@InlineClass}{D{(}{)}{} o m +m}{% which break AUCTeX. Note the extra pair of braces around the parenthesis. `LaTeX-xparse-macro-parse' expects the specifier like this: D(){} which is how it is documented in usrguide.tex. So D{(}{)}{} might be valid LaTeX code, but it is not the way it is expected. For me, this is currently "won't fix" until I see more examples that AUCTeX really has to cater for extra pair of braces around the delimiter tokens. > Meanwhile I've send via git a futher patch for dinbrief.el Thanks, I saw that, I will respond so that message separately. Best, Arash
Re: [SOLVED]
Uwe Brauer writes: > ah, I am an idiot. I did it the other way around. I first opened the > file and then set the variable. After changing the order and following > *precisely* your steps, it works. It works even with my init file. > > Thanks so much for you patience and sorry for me being careless.. You're welcome, and no worries. Best, Arash
Re: [PATCH 1/3] Let it byte compile even with GNU Emacs 29.3
"Dr. Werner Fink" writes: > I now skip lwarp.sty by using: > > %if %{with tex4auto} > pwd > echo "Run the command TeX-auto-generate-global in mini buffer" > ignore="$(sed -rn '/^\(defcustom TeX-ignore-file/,+1{ > s@^\s+@@;s@()(\)\$)@\1|lwarp\\.sty\2@p }' < ../tex.el)" > emacs-gtk -batch -Q -L %{buildroot}%{_sitedir}/auctex > \ > --eval '(setq TeX-lisp-directory "%{buildroot}%{_aucdir}")' > \ > --eval "(setq TeX-install-font-lock #'ignore)" > \ > --eval "(setq TeX-ignore-file ${ignore})" > \ > --eval '(setq TeX-auto-global "%{buildroot}%{_aucdir}/auto")' > \ > -l %{buildroot}%{_sitedir}/tex-site.el -f TeX-auto-generate-global > exit 1 > %else > > and it finally works. Thanks a lot! You're welcome, glad we have this sorted out; and thanks for reporting in the first place. Best, Arash
Re: [PATCH] Update dinbrief class
Werner Fink writes: > Nowadays UTF-8 is standard, also port the features of the letter class > to dinbrief class. Thanks for the patch. I admit I've never had a closer look at dinbrief.el, but after applying your patch, I had a brief look and I suggest this which includes your change. I fixed a typo in the docstring of `LaTeX-dinbrief-class-options', uses the function `TeX-active-mark' and deletes double spaces in the prompt. WDYT? Best, Arash diff --git a/style/dinbrief.el b/style/dinbrief.el index c3108466..27354875 100644 --- a/style/dinbrief.el +++ b/style/dinbrief.el @@ -32,14 +32,26 @@ (require 'tex) (require 'latex) +;; Silence the compiler: +(declare-function font-latex-add-keywords + "font-latex" + (keywords class)) + +(defvar LaTeX-dinbrief-class-options + '("10pt" "11pt" "12pt" "norm" "a4paper" "a5paper" "b5paper" +"letterpaper" "legalpaper" "executivepaper" "twoside" +"addresshigh" "addressstd" "onecolumn" "twocolumn") + "Class options for the dinbrief class.") + (TeX-add-style-hook "dinbrief" (lambda () - (add-hook 'LaTeX-document-style-hook - #'LaTeX-dinbrief-style) (LaTeX-add-environments '("letter" LaTeX-dinbrief-env-recipient) "dinquote") + (add-hook 'LaTeX-document-style-hook + #'LaTeX-dinbrief-style) + (setq LaTeX-default-document-environment "letter") (TeX-add-symbols '("address" "Absender") '("postremark" "Postvermerk") @@ -61,12 +73,28 @@ '("backaddress" "Retouradresse") '("signature" "Unterschrift") '("opening" "Anrede") -'("closing" "Schluss"))) +'("closing" "Schluss")) + + ;; Fontification + (when (and (featurep 'font-latex) + (eq TeX-install-font-lock 'font-latex-setup)) + (font-latex-add-keywords '(("subject" "{") +("address" "{") +("signature" "{") +("opening" "{") +("closing" "{") +("location" "{") +("handling" "{") +("cc" "{") +("encl" "{") +("ps" "{")) + 'function))) TeX-dialect) (defmacro LaTeX-dinbrief-insert (&rest args) "Insert text ignoring active markers." - `(progn (if mark-active (deactivate-mark)) + `(progn + (if (TeX-active-mark) (deactivate-mark)) (insert ,@args))) (defun LaTeX-dinbrief-style () @@ -77,17 +105,14 @@ (beginning-of-line 1)) (open-line 2) (indent-relative-first-indent-point) -(LaTeX-dinbrief-insert TeX-esc "usepackage" - LaTeX-optop "latin1,utf8" LaTeX-optcl - TeX-grop "inputenc" TeX-grcl) -(newline-and-indent) (LaTeX-dinbrief-insert TeX-esc "usepackage" LaTeX-optop "T1" LaTeX-optcl TeX-grop "fontenc" TeX-grcl) -(indent-relative-first-indent-point) +(newline-and-indent) (LaTeX-dinbrief-insert TeX-esc "usepackage" - TeX-grop "ngerman" TeX-grcl)) - (TeX-run-style-hooks "inputenc" "fontenc" "ngerman")) + LaTeX-optop "ngerman" LaTeX-optcl + TeX-grop "babel" TeX-grcl)) + (TeX-run-style-hooks "fontenc" "babel")) (defun LaTeX-dinbrief-env-recipient (environment) "Insert ENVIRONMENT and prompt for recipient and address." @@ -118,8 +143,10 @@ (newline-and-indent) (if (not (zerop (length retouradr))) (progn - (if mark-active (deactivate-mark)) - (LaTeX-dinbrief-insert TeX-esc "backaddress" TeX-grop retouradr TeX-grcl) + (if (TeX-active-mark) (deactivate-mark)) + (LaTeX-dinbrief-insert TeX-esc + "backaddress" + TeX-grop retouradr TeX-grcl) (newline-and-indent) (LaTeX-dinbrief-insert TeX-esc "enabledraftstandard") (newline-and-indent) @@ -205,8 +232,8 @@ "Read and write the senders address." (interactive) (let ((name (TeX-read-string "Absender: " (user-full-name))) -(str (TeX-read-string "Meine Strasse: ")) -(ort (TeX-read-string "Mein Wohnort: "))) +(str (TeX-read-string "Meine Strasse: ")) +(ort (TeX-read-string "Mein Wohnort: "))) (if (not (zerop (length name))) (progn (goto-char (point-min)) ; insert before \end{document} @@ -231,8 +258,8 @@ (defun LaTeX-dinbrief-recipient () "Read and return the recipient address." (interactive) - (let ((str (TeX-read-string "Wohnhaft in Strasse: ")) -(ort (TeX-read-string "Aus der Ortschaft: "))) + (let ((str (TeX-read-string "Wohnhaft in Strasse: ")) +(ort (TeX-read-strin
master 9cd9d15c: Improve style/dinbrief.el
branch: master commit 9cd9d15cf807c3d5ef160f288d88568e757073da Author: Werner Fink Commit: Arash Esbati Improve style/dinbrief.el * style/dinbrief.el (LaTeX-dinbrief-class-options): New variable. ("dinbrief"): Add fontification support. (LaTeX-dinbrief-insert): Use `TeX-active-mark'. (LaTeX-dinbrief-style): Don't insert \usepackage[latin1,utf8]{inputenc} into the buffer; we assume that UTF8 is widely used as default. Use the babel package with the ngerman option instead of ngerman package. (LaTeX-dinbrief-env-recipient): Use `TeX-active-mark'. (LaTeX-dinbrief-recipient): Fix prompt. (LaTeX-dinbrief-today): Use German Umlaut. Add coding cookie. --- style/dinbrief.el | 69 --- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/style/dinbrief.el b/style/dinbrief.el index c3108466..2e2ad933 100644 --- a/style/dinbrief.el +++ b/style/dinbrief.el @@ -1,6 +1,6 @@ ;;; dinbrief.el --- Special code for LaTeX-Style dinbrief. -*- lexical-binding: t; -*- -;; Copyright (C) 1994-2023 Free Software Foundation, Inc. +;; Copyright (C) 1994-2024 Free Software Foundation, Inc. ;; Author: Werner Fink ;; Maintainer: auctex-devel@gnu.org @@ -32,14 +32,26 @@ (require 'tex) (require 'latex) +;; Silence the compiler: +(declare-function font-latex-add-keywords + "font-latex" + (keywords class)) + +(defvar LaTeX-dinbrief-class-options + '("10pt" "11pt" "12pt" "norm" "a4paper" "a5paper" "b5paper" +"letterpaper" "legalpaper" "executivepaper" "twoside" +"addresshigh" "addressstd" "onecolumn" "twocolumn") + "Class options for the dinbrief class.") + (TeX-add-style-hook "dinbrief" (lambda () - (add-hook 'LaTeX-document-style-hook - #'LaTeX-dinbrief-style) (LaTeX-add-environments '("letter" LaTeX-dinbrief-env-recipient) "dinquote") + (add-hook 'LaTeX-document-style-hook + #'LaTeX-dinbrief-style) + (setq LaTeX-default-document-environment "letter") (TeX-add-symbols '("address" "Absender") '("postremark" "Postvermerk") @@ -61,12 +73,28 @@ '("backaddress" "Retouradresse") '("signature" "Unterschrift") '("opening" "Anrede") -'("closing" "Schluss"))) +'("closing" "Schluss")) + + ;; Fontification + (when (and (featurep 'font-latex) + (eq TeX-install-font-lock 'font-latex-setup)) + (font-latex-add-keywords '(("subject" "{") +("address" "{") +("signature" "{") +("opening" "{") +("closing" "{") +("location" "{") +("handling" "{") +("cc" "{") +("encl" "{") +("ps" "{")) + 'function))) TeX-dialect) (defmacro LaTeX-dinbrief-insert (&rest args) "Insert text ignoring active markers." - `(progn (if mark-active (deactivate-mark)) + `(progn + (if (TeX-active-mark) (deactivate-mark)) (insert ,@args))) (defun LaTeX-dinbrief-style () @@ -77,17 +105,14 @@ (beginning-of-line 1)) (open-line 2) (indent-relative-first-indent-point) -(LaTeX-dinbrief-insert TeX-esc "usepackage" - LaTeX-optop "latin1,utf8" LaTeX-optcl - TeX-grop "inputenc" TeX-grcl) -(newline-and-indent) (LaTeX-dinbrief-insert TeX-esc "usepackage" LaTeX-optop "T1" LaTeX-optcl TeX-grop "fontenc" TeX-grcl) -(indent-relative-first-indent-point) +(newline-and-indent) (LaTeX-dinbrief-insert TeX-esc "usepackage" - TeX-grop "ngerman" TeX-grcl)) - (TeX-run-style-hooks "inputenc" "fontenc" "ngerman")) + LaTeX-optop "ngerman" LaTeX-optcl + TeX-grop "babel" TeX-grcl)) + (TeX-run-style-hooks "fontenc" "babel")) (defun LaTeX-dinbrief-env-r
Re: [PATCH] Update dinbrief class
"Dr. Werner Fink" writes: > It works here, sorry for the typo. Thanks for checking and the update. I installed that change (commit 9cd9d15c) under your name. Best, Arash
master updated (9cd9d15c -> dc1a8ee5)
esbati pushed a change to branch master. from 9cd9d15c Improve style/dinbrief.el new 4666795a Drop usage of `LaTeX-env-contents' new dc1a8ee5 Delete `LaTeX-env-contents' Summary of changes: doc/auctex.texi | 3 --- latex.el| 29 - 2 files changed, 8 insertions(+), 24 deletions(-)
master 4666795a 1/2: Drop usage of `LaTeX-env-contents'
branch: master commit 4666795a8f6f5e5b436629b9828c77aad4477789 Author: Arash Esbati Commit: Arash Esbati Drop usage of `LaTeX-env-contents' * latex.el (LaTeX-common-initialization): Drop `LaTeX-env-contents' and use the new way of query for arguments. This allows in-buffer completion for the optional argument. --- latex.el | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/latex.el b/latex.el index acdb5f73..af9bc6be 100644 --- a/latex.el +++ b/latex.el @@ -8758,8 +8758,14 @@ function would return non-nil and `(match-string 1)' would return (when (string-equal LaTeX-version "2e") (LaTeX-add-environments - '("filecontents" LaTeX-env-contents) - '("filecontents*" LaTeX-env-contents)) + '("filecontents" LaTeX-env-args + [TeX-arg-completing-read-multiple +("overwrite" "force" "nosearch" "nowarn" "noheader")] + "File") + '("filecontents*" LaTeX-env-args + [TeX-arg-completing-read-multiple +("overwrite" "force" "nosearch" "nowarn")] + "File")) (TeX-add-symbols '("enlargethispage" (TeX-arg-length nil "1.0\\baselineskip"))
master dc1a8ee5 2/2: Delete `LaTeX-env-contents'
branch: master commit dc1a8ee51e5ed8365aa969c1e845ba6b70203848 Author: Arash Esbati Commit: Arash Esbati Delete `LaTeX-env-contents' * doc/auctex.texi (Adding Environments): * latex.el (LaTeX-env-contents): Delete now unused function. --- doc/auctex.texi | 3 --- latex.el| 19 --- 2 files changed, 22 deletions(-) diff --git a/doc/auctex.texi b/doc/auctex.texi index 05695f0f..ca1eb339 100644 --- a/doc/auctex.texi +++ b/doc/auctex.texi @@ -5839,9 +5839,6 @@ Insert the given environment with width and height specifications. @item LaTeX-env-bib Insert the given environment with a label for a bibitem. -@item LaTeX-env-contents -Insert the given environment with a filename as its argument. - @item LaTeX-env-args Insert the given environment with arguments. You can use this as a hook in case you want to specify multiple complex arguments just like in diff --git a/latex.el b/latex.el index af9bc6be..e66f4116 100644 --- a/latex.el +++ b/latex.el @@ -1451,25 +1451,6 @@ Just like array and tabular." (delete-horizontal-space) (LaTeX-insert-item)) -(defun LaTeX-env-contents (environment) - "Insert ENVIRONMENT with optional argument and filename for contents." - (let* ((opt '("overwrite" "force" "nosearch" "nowarn")) - (arg (mapconcat #'identity - (TeX-completing-read-multiple - (TeX-argument-prompt t nil "Options") - (if (string= environment "filecontents*") - opt -(cons "noheader" opt))) - ","))) -(LaTeX-insert-environment environment - (concat - (when (and arg (not (string= arg ""))) - (concat LaTeX-optop arg LaTeX-optcl)) - TeX-grop - (TeX-read-string "File: ") - TeX-grcl))) - (delete-horizontal-space)) - (defun LaTeX-env-args (environment &rest args) "Insert ENVIRONMENT and arguments defined by ARGS." (LaTeX-insert-environment environment)
master 2e52d827: * doc/auctex.texi (Multifile): Mention addition of .ltx extension.
branch: master commit 2e52d827734d8b0f3c883c7c19ea4a44688247ff Author: Arash Esbati Commit: Arash Esbati * doc/auctex.texi (Multifile): Mention addition of .ltx extension. --- doc/auctex.texi | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/auctex.texi b/doc/auctex.texi index e6bd045a..f57fa752 100644 --- a/doc/auctex.texi +++ b/doc/auctex.texi @@ -4447,9 +4447,10 @@ it is a good idea to append a @code{TeX-master} file variable entry automatically. When @AUCTeX{} adds the name of the master file as a file variable, it does not need to ask next time you edit the file. -If you dislike @AUCTeX{} automatically modifying your files, you can -set this variable to @samp{""}. By default, @AUCTeX{} will modify -any file with an extension of @samp{.tex}, @samp{.texi} or @samp{.dtx}. +If you dislike @AUCTeX{} automatically modifying your files, you can set +this variable to @samp{""}. By default, @AUCTeX{} will modify any +file with an extension of @samp{.tex}, @samp{.ltx}, @samp{.texi} or +@samp{.dtx}. @end defopt @deffn Command TeX-master-file-ask
Re: Supporting .ltx extension in `TeX-one-master'
Arash Esbati writes: > diff --git a/tex.el b/tex.el > index da2f91fe..374f202f 100644 > --- a/tex.el > +++ b/tex.el > @@ -2296,7 +2296,7 @@ It is suggested that you use the File Variables (see > the info node >(member x (quote (t nil shared dwim) >:local t) > > -(defcustom TeX-one-master "\\.\\(texi?\\|dtx\\)$" > +(defcustom TeX-one-master "\\.\\(texi?\\|[dl]tx\\)\\'" >"Regular expression matching ordinary TeX files. > > You should set this variable to match the name of all files, where > > auctex.texi has to touched as well. I installed this with commits 63968cc5 and 2e52d827. Best, Arash
Re: AUCTeX style for amsrefs package
Arash Esbati writes: > based on this Q&A[1], I had a brief but closer look and it seems it is > not that hard to support amsrefs package within AUCTeX, given that there > is amsreftex[2]. I don't have a clue about amsrefs, so this is a stab > in the dark. I installed amsrefs.el (61f8825) which will be available with next AUCTeX release. Best, Arash
Re: AUCTeX style for amsrefs package
Wierdl Máté writes: > Fantastic, thank you! You're welcome. Feel free to report any glitches with the style. Best, Arash
main 73edb373: Release GNU AUCTeX 14.0.5
branch: main commit 73edb3731e4bdbe3760fb4c12f94ae1aa075458f Author: Arash Esbati Commit: Arash Esbati Release GNU AUCTeX 14.0.5 * auctex.el: Bump version for ELPA release. --- auctex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auctex.el b/auctex.el index 7971867f..40a3b311 100644 --- a/auctex.el +++ b/auctex.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2014-2024 Free Software Foundation, Inc. -;; Version: 14.0.4 +;; Version: 14.0.5 ;; URL: https://www.gnu.org/software/auctex/ ;; Maintainer: auctex-devel@gnu.org ;; Notifications-To: auctex-di...@gnu.org
main 8d0569db: * auctex.el: Fix Commentary section.
branch: main commit 8d0569dbd09a5e237e18bc0b3733b24f34755072 Author: Arash Esbati Commit: Arash Esbati * auctex.el: Fix Commentary section. --- auctex.el | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/auctex.el b/auctex.el index 40a3b311..b308fd78 100644 --- a/auctex.el +++ b/auctex.el @@ -26,6 +26,14 @@ ;;; Commentary: +;; AUCTeX is a comprehensive customizable integrated environment for +;; writing input files for TeX, LaTeX, ConTeXt, Texinfo, and docTeX +;; using Emacs. One component of AUCTeX is preview-latex, a combination +;; of folding and in-source previewing that provides true "What You See +;; Is What You Get" experience in the sourcebuffer. + +;;; Code: + ;; This can be used for starting up AUCTeX. The following somewhat ;; strange trick causes tex-site.el to be loaded in a way that can be ;; safely undone using (unload-feature 'tex-site). @@ -35,8 +43,6 @@ ;; (require 'tex-site (expand-file-name "tex-site.el" ;; (file-name-directory load-file-name)) -;;; Code: - (autoload 'TeX-load-hack (expand-file-name "tex-site.el" (file-name-directory load-file-name)))
master 14a9e220: ; * NEWS.org: Update the file.
branch: master commit 14a9e22062dd7381d6570fefd302858cf5bf4585 Author: Arash Esbati Commit: Arash Esbati ; * NEWS.org: Update the file. --- NEWS.org | 29 + 1 file changed, 29 insertions(+) diff --git a/NEWS.org b/NEWS.org index 451056a7..169cca83 100644 --- a/NEWS.org +++ b/NEWS.org @@ -6,6 +6,35 @@ # License: GNU General Public License 3 # The format is based on [[https://keepachangelog.com/en/1.1.0/][Keep a Changelog]] +* [Unreleased] + +** Fixed + +- Add appropriate ~delete-selection~ properties for + ~LaTeX-insert-left-brace~, ~TeX-insert-dollar~ and + ~TeX-insert-backslash~ 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 ~TeX-insert-dollar~ + is affected in some ways: + - With raw prefix argument =C-u=, =$= (~TeX-insert-dollar~) now +inserts four dollars as opposed to one. This behavior is in-line +with other symbols, in particular ="= (~TeX-insert-quote~) and =\= +(~TeX-insert-backslash~). If you need one literal =$=, you can type +=C-1 $= or =C-q $=. + - We no longer have explicit support of the special behavior that if +~TeX-electric-math~ is 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. + +It still works as before if ~TeX-electric-math~ is pair of dollars +while it inserts =\(= and =\)= when ~TeX-electric-math~ is +=("\(" . "\)")=. + - When ~TeX-electric-math~ is a pair of dollars and the point is in +inline math without active region, =$= inserts two dollars, not one +dollar which just closes the math mode. + * [14.0.5] - 2024-05-19 ** Added
Re: master 45ee2f9e 3/3: Update documentaion on changes related to delete-selection
Ikumi Keita writes: > 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/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 > +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? > +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. Best, Arash
master updated (14a9e220 -> ae9efe74)
esbati pushed a change to branch master. from 14a9e220 ; * NEWS.org: Update the file. new ad433865 ; Checkdoc improvements new ae9efe74 ; * latex.el (TeX-arg-savebox): Checkdoc fix (bug#71152). Summary of changes: latex.el | 2 +- tex.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
master ad433865 1/2: ; Checkdoc improvements
branch: master commit ad4338652bac5807bc3433ab10619a3ffc02fbec Author: Jeremy Bryant Commit: Arash Esbati ; Checkdoc improvements * tex.el (TeX-engine-in-engine-alist): Capitalize argument. (TeX-source-correlate-start-server-flag): Follow non-nil convention (bug#71132). --- tex.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tex.el b/tex.el index 503a54b3..0795e602 100644 --- a/tex.el +++ b/tex.el @@ -1621,7 +1621,7 @@ where an entry with the same car exists in the user-defined part." (TeX-delete-dups-by-car (append TeX-engine-alist TeX-engine-alist-builtin))) (defun TeX-engine-in-engine-alist (engine) - "Return the `engine' entry in `TeX-engine-alist'. + "Return entry ENGINE in `TeX-engine-alist'. Throw an error if `engine' is not present in the alist." (or @@ -1723,7 +1723,7 @@ as a string.") "Keep track if question about server start search was asked.") (defvar TeX-source-correlate-start-server-flag nil - "If non-nil, `TeX-source-correlate-start-server-maybe' will start a server. + "Non-nil means `TeX-source-correlate-start-server-maybe' will start a server. Code related to features requiring a server, for example, for inverse search, can set the variable.")
master ae9efe74 2/2: ; * latex.el (TeX-arg-savebox): Checkdoc fix (bug#71152).
branch: master commit ae9efe74e16469f53d08659e911888d8b3e17ffa Author: Jeremy Bryant Commit: Arash Esbati ; * latex.el (TeX-arg-savebox): Checkdoc fix (bug#71152). --- latex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latex.el b/latex.el index 67680cee..baedfdc8 100644 --- a/latex.el +++ b/latex.el @@ -2491,7 +2491,7 @@ the list of defined counters." "Prompt for a LaTeX savebox. If OPTIONAL is non-nil, insert the resulting value as an optional argument, otherwise as a mandatory one. Use PROMPT as the prompt -string. If definition is non-nil, the savebox is added to the +string. If DEFINITION is non-nil, the savebox is added to the list of defined saveboxes." (let ((savebox (completing-read (TeX-argument-prompt optional prompt (concat "Savebox: "
master 06801482: ; * NEWS.org (Fixed): Track last change in changes.texi.
branch: master commit 06801482839fa811dfe5a4a829e901b16900debc Author: Arash Esbati Commit: Arash Esbati ; * NEWS.org (Fixed): Track last change in changes.texi. --- NEWS.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.org b/NEWS.org index 169cca83..28c70289 100644 --- a/NEWS.org +++ b/NEWS.org @@ -32,8 +32,8 @@ while it inserts =\(= and =\)= when ~TeX-electric-math~ is =("\(" . "\)")=. - When ~TeX-electric-math~ is a pair of dollars and the point is in -inline math without active region, =$= inserts two dollars, not one -dollar which just closes the math mode. +inline math (without active region), =$= inserts two dollars, not +one dollar which just closes the math mode. * [14.0.5] - 2024-05-19
Re: tex-site.elc generation on main branch
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. Best, Arash
Re: master 45ee2f9e 3/3: Update documentaion on changes related to delete-selection
Hi Keita, Ikumi Keita writes: > Ah, I think so. I just pushed the fix. Thanks for spotting this. Thanks, I tracked your change in our NEWS.org. Best, Arash
master d4485d06: Improve documentation for interactive functions
branch: master commit d4485d06604b8369dee4cd842fbf039e330eaa2f Author: Jeremy Bryant Commit: Arash Esbati Improve documentation for interactive functions * latex.el (LaTeX-environment): Correct docstring for required arg. (LaTeX-close-environment, LaTeX-fill-paragraph) (LaTeX-fill-environment, LaTeX-fill-section) (LaTeX-fill-buffer): Capitalize argument. (bug#71215) --- latex.el | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/latex.el b/latex.el index baedfdc8..885a7e91 100644 --- a/latex.el +++ b/latex.el @@ -583,7 +583,7 @@ Styles such as tabularx may set it according to their needs.") (defun LaTeX-environment (arg) "Make LaTeX environment (\\begin{...}-\\end{...} pair). -With optional ARG, modify current environment. +With prefix ARG, modify current environment. It may be customized with the following variables: @@ -652,7 +652,7 @@ It may be customized with the following variables: (defun LaTeX-close-environment (&optional reopen) "Create an \\end{...} to match the current environment. -With prefix-argument, reopen environment afterwards." +With prefix argument REOPEN, reopen environment afterwards." (interactive "*P") (if (> (point) (save-excursion @@ -5266,6 +5266,9 @@ See `fill-move-to-break-point' for the meaning of LINEBEG." (defun LaTeX-fill-paragraph (&optional justify) "Like `fill-paragraph', but handle LaTeX comments. + +With prefix argument JUSTIFY, justify as well. + If any of the current line is a comment, fill the comment or the paragraph of it that point is in. Code comments, that is, comments with uncommented code preceding them in the same line, will not @@ -5564,7 +5567,9 @@ environments." (TeX-activate-region))) (defun LaTeX-fill-environment (justify) - "Fill and indent current environment as LaTeX text." + "Fill and indent current environment as LaTeX text. + +With prefix argument JUSTIFY, justify as well." (interactive "*P") (save-excursion (LaTeX-mark-environment) @@ -5573,7 +5578,9 @@ environments." (concat " environment " (TeX-match-buffer 1) (defun LaTeX-fill-section (justify) - "Fill and indent current logical section as LaTeX text." + "Fill and indent current logical section as LaTeX text. + +With prefix argument JUSTIFY, justify as well." (interactive "*P") (save-excursion (LaTeX-mark-section) @@ -5608,7 +5615,9 @@ value of NO-SUBSECTIONS." (TeX-activate-region)) (defun LaTeX-fill-buffer (justify) - "Fill and indent current buffer as LaTeX text." + "Fill and indent current buffer as LaTeX text. + +With prefix argument JUSTIFY, justify as well." (interactive "*P") (save-excursion (LaTeX-fill-region
master 41546c5b: Adjust color macros support for in-buffer completion
branch: master commit 41546c5b912dfcc37c813b8113bb69ac84e9b55e Author: Arash Esbati Commit: Arash Esbati Adjust color macros support for in-buffer completion * style/color.el (LaTeX-color-used-model-regexp) (LaTeX-color-used-model, LaTeX-color-used-model-requires-spec-p) (LaTeX-color-available-models, LaTeX-color-available-colors): New variables and functions. (TeX-arg-color-definecolor, TeX-arg-color) (TeX-arg-color-fcolorbox): Query and insert only the color specification argument and not all arguments. ("color"): Use the new setup in the hook. * style/xcolor.el (LaTeX-xcolor-color-cmds-regexp) (LaTeX-xcolor-defcolor-cmds-regexp) (LaTeX-xcolor-used-type-model, LaTeX-xcolor-cmd-requires-spec-p): New variables and functions. (TeX-arg-xcolor): Query and insert only the color specification argument. (TeX-arg-xcolor-definecolor): Query and insert only the newly defined color name and not all arguments. ("xcolor"): Use the new setup in the hook. (LaTeX-xcolor-package-options): Comment out obsolete options. * style/changebar.el ("changebar"): * style/colortbl.el ("colortbl"): * style/paracol.el ("paracol"): Adjust hooks to the new setup. --- style/changebar.el | 21 ++- style/color.el | 366 +++--- style/colortbl.el | 131 +- style/paracol.el | 128 ++ style/xcolor.el| 386 - 5 files changed, 656 insertions(+), 376 deletions(-) diff --git a/style/changebar.el b/style/changebar.el index b3020bd7..7783b94e 100644 --- a/style/changebar.el +++ b/style/changebar.el @@ -60,11 +60,26 @@ ;; Options management: (when (LaTeX-provided-package-options-member "changebar" "color") (TeX-run-style-hooks "color") - (TeX-add-symbols '("cbcolor" TeX-arg-color))) + (TeX-add-symbols + '("cbcolor" +[TeX-arg-completing-read (LaTeX-color-available-models) + "Color model"] +(TeX-arg-conditional (LaTeX-color-used-model-requires-spec-p) +(TeX-arg-color) + ((TeX-arg-completing-read (LaTeX-color-available-colors) +"Color name")) (when (LaTeX-provided-package-options-member "changebar" "xcolor") (TeX-run-style-hooks "xcolor") - (TeX-add-symbols '("cbcolor" TeX-arg-xcolor))) + (TeX-add-symbols + '("cbcolor" +[TeX-arg-completing-read-multiple (LaTeX-xcolor-color-models) + "Color model" + nil nil "/" "/"] +(TeX-arg-conditional (LaTeX-xcolor-cmd-requires-spec-p 'col) +(TeX-arg-xcolor) + ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list) +"Color name")) (when (or (LaTeX-provided-package-options-member "changebar" "xetex") (LaTeX-provided-package-options-member "changebar" "XeTeX")) @@ -111,3 +126,5 @@ "grey" "color" "xcolor") "Package options for the changebar package. This variable contains only the lowercase version of the options.") + +;;; changebar.el ends here diff --git a/style/color.el b/style/color.el index a98b01bd..76f80209 100644 --- a/style/color.el +++ b/style/color.el @@ -1,6 +1,6 @@ ;;; color.el --- AUCTeX style for `color.sty' (v1.3d) -*- lexical-binding: t; -*- -;; Copyright (C) 2015--2022 Free Software Foundation, Inc. +;; Copyright (C) 2015--2024 Free Software Foundation, Inc. ;; Author: Arash Esbati ;; Maintainer: auctex-devel@gnu.org @@ -34,7 +34,7 @@ ;;; Code: -;; Needed for compiling `LaTeX-check-insert-macro-default-style': +(require 'tex) (require 'latex) ;; Silence the compiler: @@ -66,9 +66,6 @@ "WildStrawberry" "Yellow" "YellowGreen" "YellowOrange") "List of colors defined by package option `dvipsnames' from `color.sty'.") -;; Needed for auto-parsing. -(require 'tex) - ;; Plug \definecolor into the parser (TeX-auto-add-type "color-definecolor" "LaTeX") @@ -83,167 +80,148 @@ (add-hook 'TeX-auto-prepare-hook #'LaTeX-color-auto-prepare t) (add-hook 'TeX-update-style-hook #'TeX-auto-parse t) -(defun TeX-arg-color-definecolor (optional &optional prompt) - "Insert arguments of `\\definecolor' from `color.sty'." +(defconst LaTeX-color-used-model-regexp + (concat (regexp-quote TeX-esc) + (regexp-opt '("
master 7de5f1bb: Make opt. args more resilient against color bleeds
branch: master commit 7de5f1bbdd186bc84a8bd764e843a308f798210f Author: Arash Esbati Commit: Arash Esbati Make opt. args more resilient against color bleeds * font-latex.el (font-latex-find-matching-close): Improve boundaries recognition of optional arguments, especially when the closing delimiter is masked inside braces, e.g., \foo[key={]}]. This prevents color bleeding. (bug#57516) --- font-latex.el | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/font-latex.el b/font-latex.el index ccddd8b1..d814642a 100644 --- a/font-latex.el +++ b/font-latex.el @@ -1473,12 +1473,21 @@ ignored during the search." ;; closing brace gets a comment end syntax. ;; (2022 Mar) The latter half of the above paragraph no longer ;; applies since we changed the way to fontify ^^A comment. -(parse-sexp-lookup-properties nil)) +(parse-sexp-lookup-properties nil) +(syntax (TeX-search-syntax-table openchar closechar))) (or (condition-case nil (progn - (goto-char (with-syntax-table - (TeX-search-syntax-table openchar closechar) + ;; It is possible to have an opt. arg like \foo[key={]}]. + ;; Since braces are always balanced in opt. arguments, we + ;; change the syntax to "generic comment delimiter". For the + ;; backslash, we switch to "/" in order to ignore things like + ;; \{ and \}: + (unless (and (= openchar ?\{) (= closechar ?\})) + (modify-syntax-entry ?\{ "|" syntax) + (modify-syntax-entry ?\} "|" syntax) + (modify-syntax-entry ?\\ "/" syntax)) + (goto-char (with-syntax-table syntax (scan-sexps (point) 1))) ;; No error code. See if closechar is unquoted (save-excursion
master 04fc7313: ; Fix docstring and comment
branch: master commit 04fc731398b2980a17e0665b286c8423b5245b6e Author: Arash Esbati Commit: Arash Esbati ; Fix docstring and comment * latex.el (LaTeX-check-insert-macro-default-style): Fix docstring. * style/floatrow.el: Remove stale comment. --- latex.el | 11 +-- style/floatrow.el | 7 ++- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/latex.el b/latex.el index 885a7e91..d0a9ee6f 100644 --- a/latex.el +++ b/latex.el @@ -9357,12 +9357,11 @@ arguments POS and COL for efficiency." (defmacro LaTeX-check-insert-macro-default-style (&rest body) "Check for values of `TeX-insert-macro-default-style' and `current-prefix-arg'. -This is a utility macro with code taken from -`TeX-parse-arguments'. It should be used inside more complex -function within AUCTeX style files where optional and mandatory -arguments are queried and inserted. For examples, check the -functions `TeX-arg-color' (style/color.el) or -`LaTeX-arg-bicaption-bicaption' (style/bicaption.el)." +This is a utility macro with code taken from `TeX-parse-arguments'. It +should be used inside more complex function within AUCTeX style files +where optional and mandatory arguments are queried and inserted. For +example, check the function `LaTeX-arg-bicaption-bicaption' +defined in style/bicaption.el." `(unless (if (eq TeX-insert-macro-default-style 'show-all-optional-args) (equal current-prefix-arg '(4)) (or diff --git a/style/floatrow.el b/style/floatrow.el index 00c2a4be..c0023687 100644 --- a/style/floatrow.el +++ b/style/floatrow.el @@ -1,6 +1,6 @@ ;;; floatrow.el --- AUCTeX style for `floatrow.sty' (v0.3b) -*- lexical-binding: t; -*- -;; Copyright (C) 2017--2022 Free Software Foundation, Inc. +;; Copyright (C) 2017--2024 Free Software Foundation, Inc. ;; Author: Arash Esbati ;; Maintainer: auctex-devel@gnu.org @@ -62,11 +62,8 @@ (eval-when-compile (require 'cl-lib)) -;; Needed for compiling `LaTeX-check-insert-macro-default-style': -(require 'latex) - -;; Needed for auto-parsing: (require 'tex) +(require 'latex) ;; Silence the compiler: (declare-function font-latex-add-keywords
master d0af6f6c: ; * NEWS.org: Update the file.
branch: master commit d0af6f6c77940cc1dd124030d5c7809d675783ca Author: Arash Esbati Commit: Arash Esbati ; * NEWS.org: Update the file. --- NEWS.org | 5 + 1 file changed, 5 insertions(+) diff --git a/NEWS.org b/NEWS.org index 28c70289..92c41293 100644 --- a/NEWS.org +++ b/NEWS.org @@ -34,6 +34,11 @@ - When ~TeX-electric-math~ is a pair of dollars and the point is in inline math (without active region), =$= inserts two dollars, not one dollar which just closes the math mode. +- Recognize =.ltx= extension as regular LaTeX file. + +** Removed + +- Delete function ~LaTeX-env-contents~. * [14.0.5] - 2024-05-19
main updated (6b1c1f6d -> 2d271c90)
esbati pushed a change to branch main. from 6b1c1f6d Tune byte compile condition adds 9cd9d15c Improve style/dinbrief.el adds 4666795a Drop usage of `LaTeX-env-contents' adds dc1a8ee5 Delete `LaTeX-env-contents' adds 3b0becf0 Split out the electric version of `LaTeX-insert-left-brace' adds 7b8ae52d Amend TeX electric commands to allow alternative electric modes adds 45ee2f9e Update documentaion on changes related to delete-selection adds 2e52d827 * doc/auctex.texi (Multifile): Mention addition of .ltx extension. adds 14a9e220 ; * NEWS.org: Update the file. adds ad433865 ; Checkdoc improvements adds ae9efe74 ; * latex.el (TeX-arg-savebox): Checkdoc fix (bug#71152). adds 8485b4bb ; * doc/changes.texi: Fix typo. adds 06801482 ; * NEWS.org (Fixed): Track last change in changes.texi. adds d4485d06 Improve documentation for interactive functions adds 41546c5b Adjust color macros support for in-buffer completion adds 7de5f1bb Make opt. args more resilient against color bleeds adds 04fc7313 ; Fix docstring and comment adds d0af6f6c ; * NEWS.org: Update the file. new 2d271c90 Merge remote-tracking branch 'origin/master' Summary of changes: NEWS.org | 34 + doc/auctex.texi| 27 ++-- doc/changes.texi | 34 - font-latex.el | 15 ++- latex.el | 184 - style/changebar.el | 21 ++- style/color.el | 366 +++--- style/colortbl.el | 131 +- style/dinbrief.el | 69 +++--- style/floatrow.el | 7 +- style/paracol.el | 128 ++ style/xcolor.el| 386 - tex.el | 317 --- 13 files changed, 1058 insertions(+), 661 deletions(-)
main 2d271c90: Merge remote-tracking branch 'origin/master'
branch: main commit 2d271c90605476024c474194aca615bdf4a8ab90 Merge: 6b1c1f6d d0af6f6c Author: Arash Esbati Commit: Arash Esbati Merge remote-tracking branch 'origin/master' --- NEWS.org | 34 + doc/auctex.texi| 27 ++-- doc/changes.texi | 34 - font-latex.el | 15 ++- latex.el | 184 - style/changebar.el | 21 ++- style/color.el | 366 +++--- style/colortbl.el | 131 +- style/dinbrief.el | 69 +++--- style/floatrow.el | 7 +- style/paracol.el | 128 ++ style/xcolor.el| 386 - tex.el | 317 --- 13 files changed, 1058 insertions(+), 661 deletions(-) diff --git a/NEWS.org b/NEWS.org index 451056a7..92c41293 100644 --- a/NEWS.org +++ b/NEWS.org @@ -6,6 +6,40 @@ # License: GNU General Public License 3 # The format is based on [[https://keepachangelog.com/en/1.1.0/][Keep a Changelog]] +* [Unreleased] + +** Fixed + +- Add appropriate ~delete-selection~ properties for + ~LaTeX-insert-left-brace~, ~TeX-insert-dollar~ and + ~TeX-insert-backslash~ 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 ~TeX-insert-dollar~ + is affected in some ways: + - With raw prefix argument =C-u=, =$= (~TeX-insert-dollar~) now +inserts four dollars as opposed to one. This behavior is in-line +with other symbols, in particular ="= (~TeX-insert-quote~) and =\= +(~TeX-insert-backslash~). If you need one literal =$=, you can type +=C-1 $= or =C-q $=. + - We no longer have explicit support of the special behavior that if +~TeX-electric-math~ is 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. + +It still works as before if ~TeX-electric-math~ is pair of dollars +while it inserts =\(= and =\)= when ~TeX-electric-math~ is +=("\(" . "\)")=. + - When ~TeX-electric-math~ is a pair of dollars and the point is in +inline math (without active region), =$= inserts two dollars, not +one dollar which just closes the math mode. +- Recognize =.ltx= extension as regular LaTeX file. + +** Removed + +- Delete function ~LaTeX-env-contents~. + * [14.0.5] - 2024-05-19 ** Added diff --git a/doc/auctex.texi b/doc/auctex.texi index 05695f0f..f57fa752 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). @@ -4452,9 +4447,10 @@ it is a good idea to append a @code{TeX-master} file variable entry automatically. When @AUCTeX{} adds the name of the master file as a file variable, it does not need to ask next time you edit the file. -If you dislike @AUCTeX{} automatically modifying your files, you can -set this variable to @samp{""}. By default, @AUCTeX{} will modify -any file with an extension of @samp{.tex}, @samp{.texi} or @samp{.dtx}. +If you dislike @AUCTeX{} automatically modifying your files, you can set +this variable to @samp
Re: distribution of AUCTeX and built-in TeX/LaTeX modes
Jeremy Bryant writes: > The Emacs manual says > >• The AUCTeX package provides more advanced features for editing TeX > and its related formats, including the ability to preview TeX > equations within Emacs buffers. Unlike BibTeX mode and the RefTeX > package, AUCTeX is not distributed with Emacs by default. It can > be downloaded via the Package Menu (*note Packages::); once > installed, see *note The AUCTeX Manual: (auctex)Top. > > Distribution question: > Is there a reason why it would not be possible to bundle the latest > available version of AUCTeX with Emacs, say from ELPA? Sorry, I don't follow. AUCTeX is available from ELPA: https://elpa.gnu.org/packages/auctex.html For me, the text above says: RefTeX and BibTeX mode are part of Emacs core, AUCTeX not. But you can fetch it via Package Menu, in this case from ELPA exclusively. Or am I missing something? Best, Arash
Re: distribution of AUCTeX and built-in TeX/LaTeX modes
Uwe Brauer writes: > I presume, he wants to clone GNU emacs from the git repository, compile > it and auctex is already included in that tree, like gnus, so that it > would not be necessary to use the package system. Ah, thanks for the translation ;-) So the question was: Why isn't AUCTeX in core, and the latest version on ELPA? > But I have to say I like the way as things are now, because it allows me > in simple manner to upgrade auctex, without upgrading the whole emacs. Things wouldn't be much different. There are packages developed like that, take Eglot or Org for instance. Best, Arash
master dab82282: ; Clarify manual reference to `prettify-symbols-mode'
branch: master commit dab82282bfea86d2a417c5ba044f176a34b68078 Author: Jeremy Bryant Commit: Arash Esbati ; Clarify manual reference to `prettify-symbols-mode' * doc/auctex.texi (Prettifying): Spell out code required to enable `prettify-symbols-mode' to help new users. (bug#71234) --- doc/auctex.texi | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/auctex.texi b/doc/auctex.texi index f57fa752..c79e8c20 100644 --- a/doc/auctex.texi +++ b/doc/auctex.texi @@ -2959,10 +2959,13 @@ behaviour however you need to set @code{right-edge} which will unprettify the symbol when point moves into or near it. -To enable prettification in @AUCTeX{}, simply add -@code{prettify-symbols-mode} to @code{TeX-mode-hook}. If you enabled -prettification globally with @code{global-prettify-symbols-mode}, then -it's automatically enabled in @AUCTeX{}, too. +To enable prettification in @AUCTeX{}, simply add this to your init file: +@lisp +(add-hook 'TeX-mode-hook #'prettify-symbols-mode) +@end lisp +If you enabled prettification globally with +@code{(global-prettify-symbols-mode)}, then it's automatically enabled in +@AUCTeX{}, too. You can also add custom symbol unicode-character pairs for prettification by adding to @code{tex--prettify-symbols-alist}. Note
Re: distribution of AUCTeX and built-in TeX/LaTeX modes
Jeremy Bryant writes: > There are however at least 2 scenarios where there are benefits to > having auctex, a functional albeit perhaps not the most recent version, > in a distribution of Emacs. > > 1. > New LaTeX users can discover and try auctex straightaway. If they > want to upgrade, they also can. (e.g. case of org-mode) One obstacle was that AUCTeX took over the hook names of the built-in mode, so putting AUCTeX into core wasn't feasible until now, at least this was my understanding. FWIW, this is resolved with v14.x, > 2. > Some sites don't allow downloading of packages (for policy or security > reasons), so all users have access to is whatever is included in their > Emacs distribution (and indeed their system distro). (e.g. some > corporate environments.) You can still download the tarball form ELPA and do 'M-x package-install-file RET': ,[ C-h f package-install-file RET ] | package-install-file is an autoloaded interactive subr-native-elisp in | ‘package.el’. | | (package-install-file FILE) | | Install a package from FILE. | The file can either be a tar file, an Emacs Lisp file, or a | directory. | | Probably introduced at or before Emacs version 25.1. | ` > Perhaps this is a question I'll bring up on emac-devel, I was just > wondering if there was any perspective from auctex developers. > Thoughts welcome. Putting AUCTeX into core was one of project targets[1], I can't tell where it currently stands on the list. Best, Arash Footnotes: [1] https://git.savannah.gnu.org/cgit/auctex.git/tree/RELEASE#n79
Re: distribution of AUCTeX and built-in TeX/LaTeX modes
Jeremy Bryant writes: > Great, this seems to be a major obstacle removed! That was a good change also for other reasons -- kudos to Keita for doing it. > Again, this only works if users are provided with general network > access. Depending on site policy, this is sometimes not permitted, > hence my original question. I see the point, but I'm not sure if that justifies putting AUCTeX and all other ELPA packages into core -- this is for Emacs maintainers to judge. > Good to know. I agree this is a worthy goal. > > Was the main blocker checking on FSF copyright assignment? Or was it > the hooks renaming as above? FSF assignment is not an issue, AUCTeX wouldn't be available on GNU ELPA otherwise. The major mode names was an issue, but I think more importantly, it wasn't high on our and Emacs developers list -- all seemed happy with what we have. Best, Arash
master b4ffddfa: ; Checkdoc fixes for interactive commands
branch: master commit b4ffddfa5915e005a8ffb302a4e7c3dee25b23ab Author: Jeremy Bryant Commit: Arash Esbati ; Checkdoc fixes for interactive commands * preview.el.in (preview-copy-region-as-mml): Add docstring. (preview-install-styles): Add arg in docstring, and add checkdoc fix for prompt. (bug#71247) --- preview.el.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/preview.el.in b/preview.el.in index e8c2c695..9404bc94 100644 --- a/preview.el.in +++ b/preview.el.in @@ -2881,6 +2881,7 @@ using MML mode." (preview-regenerate ov (defun preview-copy-region-as-mml (start end) + "Copy into kill ring an MML representation of region from START to END." (interactive "r") (when (catch 'badcolor (let (str lst dont-ask) @@ -3048,7 +3049,7 @@ changes get properly reflected in the environment." ;;;###autoload (defun preview-install-styles (dir &optional force-overwrite force-save) - "Installs the TeX style files into a permanent location. + "Install the TeX style files into a permanent location DIR. This must be in the TeX search path. If FORCE-OVERWRITE is greater than 1, files will get overwritten without query, if it is less than 1 or nil, the operation will fail. The default of 1 for interactive @@ -3077,7 +3078,7 @@ pp") (> force-overwrite 1)) (t force-overwrite (if (cond ((eq force-save 1) - (y-or-n-p "Stop using non-installed styles permanently ")) + (y-or-n-p "Stop using non-installed styles permanently? ")) ((numberp force-save) (> force-save 1)) (t force-save))
Re: Feature comparison Re: distribution of AUCTeX and built-in TeX/LaTeX modes
Tassilo Horn writes: > I guess when you only write short documents like letters, there's > probably no need for all those features that come with AUCTeX. But > that's just a guess. No actual user told me their reasons. This is also what I've read over the time: Some people don't like AUCTeX's "feature-bloat"[1]. And also the size of the manual seems to be daunting. And to be honest, if one once wants to write a document with vanilla LaTeX, no other packages etc. involved, then the built-in mode might be a good/right choice. Best, Arash Footnotes: [1] https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg01253.html
Re: distribution of AUCTeX and built-in TeX/LaTeX modes
Jeremy Bryant writes: > Arash, is the below wording on copyright assignment(from your link) > still accurate? See Tassilo's response. > Are new contributors checked Of course. Best, Arash
Re: Feature comparison Re: distribution of AUCTeX and built-in TeX/LaTeX modes
Paul Nelson writes: > There is some relevant discussion at > https://www.reddit.com/r/emacs/comments/8wpatw/auctex_vs_texmode_or_giving_a_texmode_another/, > which notes the slower load time of AUCTeX (once per session), some > difference in the behavior of imenu (not an issue if you use > consult-imenu, for instance), In case this is about bug#32062, then you can mark it checked[1]. > and some advantages of sexp-based navigation in tex-mode (not an issue > for me, since I use https://github.com/ultronozm/tex-parens.el). Maybe I'll ask Stefan M. about the relevant code in tex-mode.el and try to adjust AUCTeX, if that is still missing in AUCTeX. > There's also some psychological comfort to knowing all the entry > points to the software one uses, which is easier to do for tex-mode > than for AUCTeX. When all else is equal, This is really my personal view on it (and I've never seriously used the built-in mode), but the things I like in AUCTeX are (and I think they're missing built-in tex-mode): • Support for LaTeX packages which are loaded on demand: Have a look at the style-directory • Possibility to extend the parser, heavily used for commands provided by packages. Suppose you do: \usepackage{fvextra} \DefineVerbatimEnvironment{codesnippet}{Verbatim}{% fontsize = \small , frame= topline , breaklines = false , framesep = 4.5pt } Now you only have to hit 'C-c C-n' and the new verbatim environment is setup completely and ready to use • Completion support for (key=val) arguments • Customized Ispell skip additions (not for flyspell, though) • In-buffer completion for macros and their arguments, incl. user defined stuff like colors etc. • Tight integration to RefTeX • Better support for `docTeX-mode' • Other minor issues which I think work better in AUCTeX, e.g., put this in a file and hit M-q: \begin{verbatim} foobar foobar foobar and hit M-q here \end{verbatim} Note also that the 2 spaces are added after 'C-c C-o verbatim RET'. > I think this is essentially the "feature bloat" criticism noted > elsewhere in this thread. My observation is that people start writing their first real document, say PhD-thesis, with LaTeX and are overwhelmed by LaTeX itself, then want to use AUCTeX and RefTeX in addition for the first time, see the huge manuals, the time pressure in their neck, and then go with something else because of the "feature bloat". Of course, if one is using LaTeX/RefTeX for only one project, it is probably not worth it to spend the time. But if one has to deal with LaTeX more often, then it will pay off. At any rate, we should be happy we have 2 modes and people have a choice. I'm not really fond of these feature comparisons; people should try them out and make their own decision. And to cite from the link you mentioned above: UPDATE: I figured out how to bring the two things I wanted from tex-mode to AucTeX (so now AucTeX is perfect, as far as I can tell :P). ;-) Best, Arash Footnotes: [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32062