Re: [AUCTeX-devel] A bug in texmathp

2015-11-16 Thread Mosè Giordano
2015-11-15 17:55 GMT+01:00 Mosè Giordano :
> How about the attached patch?

Oops, I forgot to attach it, here it is!

Bye,
Mosè
diff --git a/texmathp.el b/texmathp.el
index f13e237..6280231 100644
--- a/texmathp.el
+++ b/texmathp.el
@@ -172,7 +172,7 @@ customize (customize calls it when setting the variable)."
 		  (mapconcat 'regexp-quote switches "\\|")
 		  "\\)")
 	  texmathp-toggle-regexp
-	  (concat "\\([^\\$]\\|\\`\\)\\("
+	  (concat "\\([^$]\\|\\`\\)\\("
 		  (mapconcat 'regexp-quote togglers "\\|")
 		  "\\)"
 
@@ -285,7 +285,10 @@ See the variable `texmathp-tex-commands' about which commands are checked."
 (if (not math-on)
 	(save-excursion
 	  (goto-char (cdr match))
-	  (while (re-search-forward texmathp-toggle-regexp pos t)
+	  (while (and (re-search-forward texmathp-toggle-regexp pos t)
+		  ;; Check if the toggle is un-escaped.  Use the same test
+		  ;; of `TeX-escaped-p'.
+		  (save-excursion (zerop (mod (skip-chars-backward "") 2
 	(if (setq math-on (not math-on))
 		(setq sw-match (cons (match-string 2) (match-beginning 2)))
 	  (setq sw-match nil)))
___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] A bug in texmathp

2015-11-16 Thread Mosè Giordano
2015-11-15 15:54 GMT+01:00 Mosè Giordano :
> Hi Marcin,
>
> 2015-11-14 0:19 GMT+01:00 Marcin Borkowski :
>> Hi all,
>>
>> I'm currently reading the source for texmathp, and I've just found
>> a bug.  Assuming that "|" is the position of point, evaluating
>> (texmathp) in this situation: "\\$|...$" yields nil instead of t.  The
>> culprit is the texmathp-onoff-regexp variable.
>
> Did you mean `texmathp-toggle-regexp`?  I can't see how
> `texmathp-onoff-regexp` affects this behavior.  Do you have
> suggestions for fixing this?

How about the attached patch?  I thought at first something like

"\\([^\\$]\\(?:\\)*\\|\\`\\)\\(\\$\\$\\|\\$\\)"

for the value of ``texmathp-toggle-regexp', but this doesn't work in the case of

$...$$|...$

with point at "|".

Actually, it would be better to have a mechanism based only on
re-search-forward, instead of re-search-forward + skip-chars-backward,
because of performance reasons.  Comments welcome.

Bye,
Mosè

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] A bug in texmathp

2015-11-16 Thread Mosè Giordano
Hi Marcin,

2015-11-14 0:19 GMT+01:00 Marcin Borkowski :
> Hi all,
>
> I'm currently reading the source for texmathp, and I've just found
> a bug.  Assuming that "|" is the position of point, evaluating
> (texmathp) in this situation: "\\$|...$" yields nil instead of t.  The
> culprit is the texmathp-onoff-regexp variable.

Did you mean `texmathp-toggle-regexp`?  I can't see how
`texmathp-onoff-regexp` affects this behavior.  Do you have
suggestions for fixing this?

Bye,
Mosè

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-devel] Changing coding of files

2015-11-16 Thread Mosè Giordano
Hi all,

any objections against changing the coding of tex.el and font-latex.el
to utf-8?  In particular, font-latex.el is recognized by grep as a
binary file because of the guillemets at line 72.  (Does it occur only
to me?)  I know I could use the -a switch, but I'd rather avoid this,
and I seem to remember having read that utf-8 encoded elisp files are
loaded a bit faster anyway.

Bye,
Mosè

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 4ed66ee71b12f88010808972f1cf697a7b72828d

2015-11-16 Thread Mosè Giordano
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  4ed66ee71b12f88010808972f1cf697a7b72828d (commit)
  from  e4cde665461df3397113aea7e1976eeec01f5dfc (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 4ed66ee71b12f88010808972f1cf697a7b72828d
Author: Mosè Giordano 
Date:   Sun Nov 15 22:27:51 2015 +0100

Activate RefTeX reference styles

* tex-style.el (LaTeX-reftex-ref-style-auto-activate): New
  customizable variable.
* style/cleveref.el ("cleveref"): Activate RefTeX reference style.
* style/fancyref.el ("fancyref"): Ditto.
* style/varioref.el ("varioref"): Ditto.
* style/hyperref.el ("hyperref"): Use
  `LaTeX-reftex-ref-style-auto-activate'.

diff --git a/style/cleveref.el b/style/cleveref.el
index 755239d..4d039e1 100644
--- a/style/cleveref.el
+++ b/style/cleveref.el
@@ -1,6 +1,6 @@
 ;;; cleveref.el --- Style hook for the `cleveref.sty' package.
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
 
 ;; Author: Matthew Leach 
 ;; Maintainer: auctex-devel@gnu.org
@@ -93,7 +93,12 @@ list of defined labels."
 ("labelcpageref" "{"))
  'reference)
  ;; For syntactic fontification, e.g. verbatim constructs.
- (font-latex-set-syntactic-keywords)))
+ (font-latex-set-syntactic-keywords))
+
+   ;; Activate RefTeX reference style.
+   (and LaTeX-reftex-ref-style-auto-activate
+   (fboundp 'reftex-ref-style-activate)
+   (reftex-ref-style-activate "Cleveref")))
  LaTeX-dialect)
 
 (defvar LaTeX-cleveref-package-options
diff --git a/style/fancyref.el b/style/fancyref.el
index 94b7e15..ce3053d 100644
--- a/style/fancyref.el
+++ b/style/fancyref.el
@@ -1,6 +1,6 @@
 ;;; fancyref.el --- AUCTeX style file with support for fancyref.sty
 
-;; Copyright (C) 1999, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2014, 2015 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik 
 ;; Maintainer: auctex-devel@gnu.org
@@ -92,7 +92,12 @@
  ;; Fontification
  (when (and (featurep 'font-latex)
(eq TeX-install-font-lock 'font-latex-setup))
-   (font-latex-add-keywords '(("fref" "[{") ("Fref" "[{")) 'reference)))
+   (font-latex-add-keywords '(("fref" "[{") ("Fref" "[{")) 'reference))
+
+ ;; Activate RefTeX reference style.
+ (and LaTeX-reftex-ref-style-auto-activate
+ (fboundp 'reftex-ref-style-activate)
+ (reftex-ref-style-activate "Fancyref")))
LaTeX-dialect)
 
 ;; The following list keeps a list of available format names
diff --git a/style/hyperref.el b/style/hyperref.el
index 630f24c..f2063b9 100644
--- a/style/hyperref.el
+++ b/style/hyperref.el
@@ -299,9 +299,10 @@
  ;; For syntactic fontification, e.g. verbatim constructs.
  (font-latex-set-syntactic-keywords))
 
-   ;; RefTeX
-   (when (fboundp 'reftex-ref-style-activate)
- (reftex-ref-style-activate "Hyperref")))
+   ;; Activate RefTeX reference style.
+   (and LaTeX-reftex-ref-style-auto-activate
+   (fboundp 'reftex-ref-style-activate)
+   (reftex-ref-style-activate "Hyperref")))
  LaTeX-dialect)
 
 (defun LaTeX-hyperref-package-options ()
diff --git a/style/varioref.el b/style/varioref.el
index 8811391..7684ba4 100644
--- a/style/varioref.el
+++ b/style/varioref.el
@@ -1,6 +1,6 @@
 ;;; varioref.el --- AUCTeX style file with support for varioref.sty
 
-;; Copyright (C) 1999, 2013 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2013, 2015 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik 
 ;; Mads Jensen 
@@ -64,7 +64,12 @@
   ("fullref{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
   ("vpageref\\*?\\(\\[[^]]*\\]\\)*{\\([^{}\n\r\\%,]*\\)"
   2 LaTeX-label-list "}"))
-   TeX-complete-list)))
+   TeX-complete-list))
+
+ ;; Activate RefTeX reference style.
+ (and LaTeX-reftex-ref-style-auto-activate
+ (fboundp 'reftex-ref-style-activate)
+ (reftex-ref-style-activate "Varioref")))
LaTeX-dialect)
 
 (defvar LaTeX-varioref-package-options
diff --git a/tex-style.el b/tex-style.el
index b03a004..a1ffb97 100644
--- a/tex-style.el
+++ b/tex-style.el
@@ -1,6 +1,6 @@
 ;;; tex-style.el --- Customizable variables for AUCTeX style files
 
-;; Copyright (C) 2005, 2007, 2009, 2012-2014
+;; Copyright (C) 2005, 2007, 2009, 2012-2015
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Reiner Steib 
@@ -34,6 +34,13 @@
 ;; Note: We don't have any defcustom in plain TeX style files yet.  Else we
 ;; should also create a TeX-style group.
 
+;; Common
+