Re: [AUCTeX-devel] Extending `LaTeX-array-count-columns'
Hi Mosè, Mosè Giordanowrites: > 2016-12-20 12:19 GMT+01:00 Arash Esbati : >> The in and out file are attached. Running make in tests directory >> shows that my test fails due to this excerpt: > > I think that now it'll work ;-) Adding > > (setq TeX-parse-self t) > > before (LaTeX-mode) should suffice. works like a charme. Thanks for looking at this. I will update the test case. Best, Arash ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
Re: [AUCTeX-devel] Updating minted.el
Hi Tassilo, Tassilo Hornwrites: > Arash Esbati writes: >> >> Thanks. My original approach is attached as myminted.el. The only >> difference is the re-arrangement at the beginning of the file and the >> ,(list "style" (LaTeX-minted-style-list)) line in >> `LaTeX-minted-key-val-options'. > > Just a nitpick, I think > > ("style" ,(LaTeX-minted-style-list)) > > is slightly more readable (and completely equivalent). Of course. Thanks. >> Here a small .tex file for testing. When I restart Emacs and open >> this file, Emacs asks if I want to apply TeX-command-extra-options: >> "-shell-escape" and then does not kill the frame. This happens only >> on the first run, after that, it works as expected. > > I can't reproduce that with neither the current Emacs master branch nor > Emacs 25.1 (starting them with -Q) and the current AUCTeX master. For > me, the window where Emacs asks if the file-local variable should be > applied is buried after I give my response. Then it is an issue with my init file. I will investigate and will come back. > But you say the "frame" is not killed. Do we talk about the same > thing? Yes, we do. My wording above was not so accurate as yours :-) Best, Arash ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
Re: [AUCTeX-devel] Updating minted.el
Arash Esbatiwrites: Hi Arash, >> Hm, the anomaly sounds strange. Anyhow, your patch looks very good, >> so feel free to commit it as is. I'll try to reproduce that issue >> then an see if there can be something done. > > Thanks. My original approach is attached as myminted.el. The only > difference is the re-arrangement at the beginning of the file and the > ,(list "style" (LaTeX-minted-style-list)) line in > `LaTeX-minted-key-val-options'. Just a nitpick, I think ("style" ,(LaTeX-minted-style-list)) is slightly more readable (and completely equivalent). > Here a small .tex file for testing. When I restart Emacs and open > this file, Emacs asks if I want to apply TeX-command-extra-options: > "-shell-escape" and then does not kill the frame. This happens only > on the first run, after that, it works as expected. I can't reproduce that with neither the current Emacs master branch nor Emacs 25.1 (starting them with -Q) and the current AUCTeX master. For me, the window where Emacs asks if the file-local variable should be applied is buried after I give my response. But you say the "frame" is not killed. Do we talk about the same thing? A frame in Emacs is what everyone else calls a window (i.e., an X11 window with a title bar), and a window in Emacs is what most people would call a pane. Bye, Tassilo ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
[AUCTeX-devel] patch for the exam class.
Hi I send a patch (in 2 formats since I am not 100 % sure) which provides support for the exam class. Thanks very much to essential contributions from Arash. Please tell me which form of the patch is more appropriate. Regards Uwe Brauer diff -r 021a78034fbd -r 05d2ddc50cef Makefile.in --- a/Makefile.in Thu Dec 22 15:19:11 2016 +0100 +++ b/Makefile.in Thu Dec 22 16:43:26 2016 + @@ -159,7 +159,7 @@ style/framed.elstyle/paracol.el style/menukeys.el \ style/bidi.el style/FiraMono.el style/FiraSans.el \ style/bicaption.el style/amsfonts.el style/subfiles.el \ - style/dcolumn.el + style/dcolumn.el style/exam.el STYLEELC = $(STYLESRC:.el=.elc) diff -r 021a78034fbd -r 05d2ddc50cef style/exam.el --- /dev/null Thu Jan 01 00:00:00 1970 + +++ b/style/exam.el Thu Dec 22 16:43:26 2016 + @@ -0,0 +1,338 @@ +;;; exam.el --- AUCTeX style for the (LaTeX) exam class + + +;; Copyright (C) 2016 Free Software Foundation, Inc. + +;; Author: Uwe Brauer+;; Created: 2016-03-06 +;; 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 St, Fifth Floor, Boston, MA +;; 02110-1301, USA. + +;;; Commentary: + +;; This file adds support for the exam class. + +;; Acknowledgements +;; Arash Esbati for a almost complete rewrite. + +;;; Code: + +;;; Code: + +(defcustom LaTeX-exam-reftex-quick-id-key ?x + "Unique letter identifying exam class macros in RefTeX. + +A character argument for quick identification when RefTeX inserts +new labels with `reftex-label'. It must be unique. It is +initialized to ?x." + :group 'LaTeX-style + :type 'character) + +(defcustom LaTeX-exam-label "exm:" + "Default prefix to labels in environments of exam class." + :group 'LaTeX-style + :type 'string) + +(defvar LaTeX-exam-class-options '("answers" "addpoints") + "Class options for the exam class.") + +(defun LaTeX-exam-insert-item () + "Insert a new item in an environment from exam class. +Item inserted depends on the environment." + (TeX-insert-macro + (cond ((string= environment "questions") + "question") + ((string= environment "parts") + "part") + ((string= environment "subparts") + "subpart") + ((string= environment "subsubparts") + "subsubpart") + ;; Fallback + (t "item" + +(defun LaTeX-exam-insert-label (_optional name type) + "Indent the line and query/insert a label incl. the \"\\label\" macro. +Arguments NAME and TYPE are the same as for the function +`LaTeX-label'. OPTIONAL is ignored." + (indent-according-to-mode) + (let ((currenv (LaTeX-current-environment))) +(LaTeX-label (or name currenv) (or type 'environment + +(TeX-add-style-hook + "exam" + (lambda () + + ;; Make our label prefix available ... + (let ((envs '("questions"))) + (dolist (env envs) + ;; to AUCTeX + (add-to-list 'LaTeX-label-alist + (cons env 'LaTeX-exam-label)) + ;; to RefTeX with `reftex-add-label-environments' + (when (fboundp 'reftex-add-label-environments) + (reftex-add-label-environments + `((,env ,LaTeX-exam-reftex-quick-id-key ,LaTeX-exam-label + "~\\ref{%s}" nil + (regexp "[Qq]uestions?" "[Nn]umbers?"))) + + (LaTeX-add-environments "solution" + "solutionorbox" + "solutionorlines" + "solutionordottedlines" + '("questions" LaTeX-env-item) + '("parts" LaTeX-env-item) + '("subparts" LaTeX-env-item) + '("subsubparts" LaTeX-env-item)) + + ;; Tell AUCTeX about special environments: + (let ((envs '("questions" "parts" "subparts" "subsubparts"))) + (dolist (env envs) + (add-to-list 'LaTeX-item-list + (cons env 'LaTeX-exam-insert-item + + ;; Append us only once: + (unless (and (string-match "question" LaTeX-item-regexp) + (string-match "subsub" LaTeX-item-regexp)) + (set (make-local-variable 'LaTeX-item-regexp) + (concat + LaTeX-item-regexp + "\\|" + "\\(titled\\)?question\\b" + "\\|" + "\\(sub\\|subsub\\)?part\\b")) + (LaTeX-set-paragraph-start)) + + (TeX-add-symbols +'("part" [ "Points" ] (TeX-arg-literal " ")) +'("subpart" [ "Points" ] (TeX-arg-literal " ")) +'("gradetable" [ "1. Option" ](TeX-arg-literal "")[ "2. Option" ](TeX-arg-literal "")) +'("partialgradetable" 1 [ "1.
Re: [AUCTeX-devel] Updating minted.el
Arash Esbatiwrites: > Thanks. My original approach is attached as myminted.el. Sorry, file was missing. myminted.el Description: application/emacs-lisp ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
Re: [AUCTeX-devel] Updating minted.el
Hi Tassilo, Tassilo Hornwrites: > Arash Esbati writes: > >> It can be cured easily be setting the variable >> `LaTeX-minted-language-list' at the of the first run. > > That has been my intent. Thanks for your response. I've just pushed an update to git. >> I've also added a similar function `LaTeX-minted-style-list' for the >> styles, but found another anomaly (see FIXME comment in >> `LaTeX-minted-key-val-options'). > > Hm, the anomaly sounds strange. Anyhow, your patch looks very good, so > feel free to commit it as is. I'll try to reproduce that issue then an > see if there can be something done. Thanks. My original approach is attached as myminted.el. The only difference is the re-arrangement at the beginning of the file and the ,(list "style" (LaTeX-minted-style-list)) line in `LaTeX-minted-key-val-options'. Here a small .tex file for testing. When I restart Emacs and open this file, Emacs asks if I want to apply TeX-command-extra-options: "-shell-escape" and then does not kill the frame. This happens only on the first run, after that, it works as expected. --8<---cut here---start->8--- \documentclass{article} \usepackage{myminted} \begin{document} \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% TeX-command-extra-options: "-shell-escape" %%% End: --8<---cut here---end--->8--- Best, Arash ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
[AUCTeX-commit] GNU AUCTeX branch, master, updated. a9ec6ba8cc86b22d97da6ca4946aa6690cc059ad
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU AUCTeX". The branch, master has been updated via a9ec6ba8cc86b22d97da6ca4946aa6690cc059ad (commit) from b44d52469fb7b3dc7743881e9927a01999b6fef1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - commit a9ec6ba8cc86b22d97da6ca4946aa6690cc059ad Author: Arash EsbatiDate: Thu Dec 22 15:19:11 2016 +0100 Update style/minted.el to package version 2.4.1. * style/minted.el (LaTeX-minted-key-val-options): Add new key=vals from package version 2.4.1. (LaTeX-minted-key-val-options-local): New variable. (LaTeX-minted-language-list): Set the variable `LaTeX-minted-language-list' after the first call of function. (LaTeX-minted-style-list): New variable. (LaTeX-minted-style-list): New function analogous to `LaTeX-minted-language-list' returning styles provided by pymentize program. (LaTeX-arg-minted-style): New function to insert styles provided by pymentize program into buffer. (LaTeX-minted-update-key-vals): New function to update key=vals in `LaTeX-minted-key-val-options-local'. (LaTeX-minted-auto-cleanup): Call `LaTeX-minted-update-key-vals'. ("minted"): Use `LaTeX-minted-key-val-options-local' for all key=val queries. Update macros incl. fontification. Run style hook for `newfloat' when package option is given. --- Summary of changes: style/minted.el | 197 --- 1 file changed, 175 insertions(+), 22 deletions(-) hooks/post-receive -- GNU AUCTeX ___ auctex-commit mailing list auctex-com...@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-commit
[AUCTeX-diffs] GNU AUCTeX branch, master, updated. a9ec6ba8cc86b22d97da6ca4946aa6690cc059ad
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU AUCTeX". The branch, master has been updated via a9ec6ba8cc86b22d97da6ca4946aa6690cc059ad (commit) from b44d52469fb7b3dc7743881e9927a01999b6fef1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - commit a9ec6ba8cc86b22d97da6ca4946aa6690cc059ad Author: Arash EsbatiDate: Thu Dec 22 15:19:11 2016 +0100 Update style/minted.el to package version 2.4.1. * style/minted.el (LaTeX-minted-key-val-options): Add new key=vals from package version 2.4.1. (LaTeX-minted-key-val-options-local): New variable. (LaTeX-minted-language-list): Set the variable `LaTeX-minted-language-list' after the first call of function. (LaTeX-minted-style-list): New variable. (LaTeX-minted-style-list): New function analogous to `LaTeX-minted-language-list' returning styles provided by pymentize program. (LaTeX-arg-minted-style): New function to insert styles provided by pymentize program into buffer. (LaTeX-minted-update-key-vals): New function to update key=vals in `LaTeX-minted-key-val-options-local'. (LaTeX-minted-auto-cleanup): Call `LaTeX-minted-update-key-vals'. ("minted"): Use `LaTeX-minted-key-val-options-local' for all key=val queries. Update macros incl. fontification. Run style hook for `newfloat' when package option is given. diff --git a/style/minted.el b/style/minted.el index b4bc572..914ee66 100644 --- a/style/minted.el +++ b/style/minted.el @@ -1,4 +1,4 @@ -;;; minted.el --- AUCTeX style for `minted.sty' +;;; minted.el --- AUCTeX style for `minted.sty' (v2.4.1) ;; Copyright (C) 2014-2016 Free Software Foundation, Inc. @@ -26,7 +26,7 @@ ;;; Commentary: -;; This file adds support for `minted.sty'. +;; This file adds support for `minted.sty' (v2.4.1) from 2016/10/31. ;;; Code: @@ -35,12 +35,31 @@ (defvar LaTeX-minted-key-val-options '(("autogobble" ("true" "false")) ("baselinestretch" ("auto")) +("breakafter") +("breakaftergroup" ("true" "false")) +("breakaftersymbolpre") +("breakaftersymbolpost") +("breakbytoken" ("true" "false")) +("breakbytokenanywhere" ("true" "false")) +("breakindent") +("breaklines" ("true" "false")) +("breaksymbol") +("breaksymbolleft") +("breaksymbolright") +("breaksymbolindent") +("breaksymbolindentleft") +("breaksymbolindentright") +("breaksymbolsep") +("breaksymbolsepleft") +("breaksymbolsepright") ("bgcolor") ("codetagify") +("curlyquotes" ("true" "false")) ("encoding") ("outencoding") +("escapeinside") ("firstline") -("firstnumber" ("auto")) +("firstnumber" ("auto" "last" "integer")) ("fontfamily" ("tt" "courier" "helvetica")) ("fontseries" ("auto")) ("fontsize" ("auto" "\\tiny" "\\large" "\\scriptsize" "\\Large" @@ -53,12 +72,15 @@ ("framesep") ("funcnamehighlighting" ("true" "false")) ("gobble") +("highlightcolor") +("highlightlines") ("keywordcase" ("lower" "upper" "capitalize")) ("label") ("labelposition" ("none" "topline" "bottomline" "all")) ("lastline") ("linenos" ("true" "false")) -("numbers" ("left" "right")) +("numberfirstline" ("true" "false")) +("numbers" ("left" "right" "both" "none")) ("mathescape" ("true" "false")) ("numberblanklines" ("true" "false")) ("numbersep") @@ -69,10 +91,27 @@ ("samepage" ("true" "false")) ("showspaces" ("true" "false")) ("showtabs" ("true" "false")) +("space") +("spacecolor") ("startinline" ("true" "false")) -("style") +;; FIXME: It would be nice to use the function +;; `LaTeX-minted-style-list' here, but with a file local var like: +;; %%% TeX-command-extra-options: "-shell-escape" +;; in a .tex file, Emacs asks to apply a variable which is not +;; safe and does not restore the frame; the splitted frame +;; remains. I couldn't figure out why, so for now, I add the +;; styles from Pygments version 2.1.3 here. +("style" ("colorful" "default" "emacs" "friendly" "fruity" "igor" + "lovelace" "manni" "monokai" "murphy" "native" + "paraiso-dark" "paraiso-light" "pastie" "perldoc" + "rrt" "tango" "trac" "vim" "vs" "xcode")) ("stepnumber") +("stepnumberfromfirst") +("stepnumberoffsetvalues" ("true" "false")) +("stripall" ("true" "false")) ("stripnl") +("tab") +("tabcolor") ("tabsize") ("texcl" ("true" "false")) ("texcomments" ("true" "false")) @@ -80,11 +119,18 @@ ("xrightmargin")) "Key=value options for minted macros and
[AUCTeX-commit] GNU AUCTeX branch, master, updated. b44d52469fb7b3dc7743881e9927a01999b6fef1
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU AUCTeX". The branch, master has been updated via b44d52469fb7b3dc7743881e9927a01999b6fef1 (commit) from 70c649961416be00181844277a5cc34b41946839 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - commit b44d52469fb7b3dc7743881e9927a01999b6fef1 Author: Tassilo HornDate: Thu Dec 22 13:58:35 2016 +0100 Uniform font-lock updates/don't break prettify (bug#25245) * font-latex.el (font-latex-update-font-lock): New function. (font-latex-add-keywords): Use it. (font-latex-after-hacking-local-variables): Use it. * style/alltt.el: Use font-latex-update-font-lock. * style/beamer.el: Ditto. * style/comment.el: Ditto. * style/expl3.el: Ditto. * style/fancyhdr.el: Ditto. * style/fancyvrb.el: Ditto. * style/listings.el: Ditto. * style/minted.el: Ditto. * style/url.el: Ditto. --- Summary of changes: font-latex.el | 34 +- style/alltt.el|7 ++- style/beamer.el |6 +- style/comment.el |7 +++ style/expl3.el|7 ++- style/fancyhdr.el |6 +++--- style/fancyvrb.el |7 ++- style/listings.el |7 ++- style/minted.el | 14 -- style/url.el |8 +++- 10 files changed, 47 insertions(+), 56 deletions(-) hooks/post-receive -- GNU AUCTeX ___ auctex-commit mailing list auctex-com...@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-commit
[AUCTeX-diffs] GNU AUCTeX branch, master, updated. b44d52469fb7b3dc7743881e9927a01999b6fef1
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU AUCTeX". The branch, master has been updated via b44d52469fb7b3dc7743881e9927a01999b6fef1 (commit) from 70c649961416be00181844277a5cc34b41946839 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - commit b44d52469fb7b3dc7743881e9927a01999b6fef1 Author: Tassilo HornDate: Thu Dec 22 13:58:35 2016 +0100 Uniform font-lock updates/don't break prettify (bug#25245) * font-latex.el (font-latex-update-font-lock): New function. (font-latex-add-keywords): Use it. (font-latex-after-hacking-local-variables): Use it. * style/alltt.el: Use font-latex-update-font-lock. * style/beamer.el: Ditto. * style/comment.el: Ditto. * style/expl3.el: Ditto. * style/fancyhdr.el: Ditto. * style/fancyvrb.el: Ditto. * style/listings.el: Ditto. * style/minted.el: Ditto. * style/url.el: Ditto. diff --git a/font-latex.el b/font-latex.el index e932577..df33ad0 100644 --- a/font-latex.el +++ b/font-latex.el @@ -225,7 +225,7 @@ effect unless you call \\[font-lock-fontify-buffer] or restart Emacs." ;; Possibly add some words about XEmacs here. :-( :type '(choice (number :tag "Scale factor") - (const color)) +(const color)) :initialize 'custom-initialize-default :set (lambda (symbol value) (set-default symbol value) @@ -842,8 +842,7 @@ locking machinery will be triggered." (dolist (elt keywords) (add-to-list list elt)) (funcall (intern (format "font-latex-match-%s-make" class))) -(setq font-lock-set-defaults nil) -(font-lock-set-defaults))) +(font-latex-update-font-lock))) (defvar font-latex-keywords font-latex-keywords-1 "Default expressions to highlight in TeX mode.") @@ -1264,6 +1263,25 @@ triggers Font Lock to recognize the change." ;; influencing fontification in her file-local variables section. (add-hook 'hack-local-variables-hook #'font-latex-after-hacking-local-variables t t)) +(defun font-latex-update-font-lock ( syntactic-kws) + "Tell font-lock about updates of fontification rules. +If SYNTACTIC-KWS is non-nil, also update +`font-latex-syntactic-keywords'." + ;; Update syntactic keywords. + (when syntactic-kws +(font-latex-set-syntactic-keywords)) + + ;; Let font-lock recompute its fontification rules. + (setq font-lock-set-defaults nil) + (font-lock-set-defaults) + + ;; Re-initialize prettification if needed. + (when (and (boundp 'prettify-symbols-mode) +(boundp 'prettify-symbols--keywords) +prettify-symbols-mode +prettify-symbols--keywords) +(font-lock-add-keywords nil prettify-symbols--keywords))) + (defun font-latex-jit-lock-force-redisplay (buf start end) "Compatibility for Emacsen not offering `jit-lock-force-redisplay'." ;; The following block is an expansion of `jit-lock-force-redisplay' @@ -1362,9 +1380,7 @@ modified. Such variables include (memq 'LaTeX-verbatim-macros-with-braces-local hacked-local-vars) (memq 'LaTeX-verbatim-macros-with-delims-local hacked-local-vars)) ;; Ok, we need to refresh fontification. - (font-latex-set-syntactic-keywords) - (setq font-lock-set-defaults nil) - (font-lock-set-defaults + (font-latex-update-font-lock t ;;; Utility functions @@ -1375,7 +1391,7 @@ character. Character pairs are usually { } or [ ]. Comments are ignored during the search." (let ((parse-sexp-ignore-comments (not (eq major-mode 'doctex-mode))) ; scan-sexps ignores comments -(init-point (point)) + (init-point (point)) (mycount 1) (esc-char (or (and (boundp 'TeX-esc) TeX-esc) "\\")) ;; XXX: Do not look up syntax-table properties since they may @@ -1761,9 +1777,9 @@ The \\begin{equation} and \\end{equation} are not fontified here." ;; XXX: Should this rather be done by ;; extending the region to be fontified? (+ limit font-latex-multiline-boundary) 'move) - (setq end (match-beginning 0)) + (setq end (match-beginning 0)) (goto-char beg) -(setq end beg)) + (setq end beg)) (font-latex-put-multiline-property-maybe beg end) (store-match-data (list beg end)) t))) diff --git a/style/alltt.el b/style/alltt.el index ccb6ac9..ed64ac4 100644 --- a/style/alltt.el +++ b/style/alltt.el @@ -38,13 +38,10 @@ '("alltt" current-indentation) t) (add-to-list 'LaTeX-verbatim-environments-local "alltt") ;; Fontification - (when (and (featurep 'font-latex) + (when (and