emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 283/299: Document TeX-add-style-hook's new 3rd argument.


From: Stefan Monnier
Subject: [elpa] 283/299: Document TeX-add-style-hook's new 3rd argument.
Date: Sun, 02 Nov 2014 03:11:59 +0000

monnier pushed a commit to branch externals/auctex
in repository elpa.

commit 25887f8f74710cf927fc91592ff9d347c0432a07
Author: Vincent Belaïche <address@hidden>
Date:   Sun Sep 14 11:20:55 2014 +0200

    Document TeX-add-style-hook's new 3rd argument.
    
    * latex.el (LaTeX-dialect): Correct doctstring for consistency
    with definition of function TeX-add-style-hook.
    
    * doc/auctex.texi (Simple Style): modify example with
    'TeX-add-style-hook', so that 3rd argument is added. Modify @defun
    of 'TeX-add-style-hook' also to document addition of 3rd argument.
    
    Signed-off-by: Tassilo Horn <address@hidden>
---
 ChangeLog       |    9 +++++++++
 doc/auctex.texi |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
 latex.el        |    5 +++--
 3 files changed, 64 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a5c842e..ca4d1e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-09-13  Vincent Bela�che  <address@hidden>
+
+       * latex.el (LaTeX-dialect): Correct doctstring for consistency
+       with definition of function TeX-add-style-hook.
+
+       * doc/auctex.texi (Simple Style): modify example with
+       'TeX-add-style-hook', so that 3rd argument is added. Modify @defun
+       of 'TeX-add-style-hook' also to document addition of 3rd argument.
+
 2014-09-11  Vincent Bela�che  <address@hidden>
 
        * doc/changes.texi: Add information about style hook labelling by 
dialect.
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 84ac235..08bf8cf 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -4269,7 +4269,8 @@ Here is a simple example of a style file.
 (TeX-add-style-hook
  "book"
  (lambda () 
-   (LaTeX-largest-level-set "chapter")))
+   (LaTeX-largest-level-set "chapter"))
+ LaTeX-dialect)
 @end lisp
 
 The example is from the @AUCTeX{} sources and is loaded for any @LaTeX{}
@@ -4288,11 +4289,59 @@ hooks will be called for each buffer using the style 
file.
 Note that the basename of the style file and the name of the style hook
 should usually be identical.
 
address@hidden TeX-add-style-hook @var{style} @var{hook}
address@hidden TeX-add-style-hook @var{style} @var{hook} &optional 
@var{dialect-expr}
 Add @var{hook} to the list of functions to run when we use the @TeX{}
-file @var{style}.
+file @var{style} and the current dialect is one in the set derived from
address@hidden When @var{dialect-expr} is omitted, then @var{hook}
+is allowed to be run whatever the current dialect is.
+
address@hidden may be one of:
+
address@hidden
address@hidden
+A symbol indicating a singleton containing one basic @TeX{} dialect,
+this symbol shall be selected among:
address@hidden @code
address@hidden :latex
+For all files in @LaTeX{} mode, or any mode derived thereof
address@hidden :bibtex
+For all files in address@hidden mode, or any mode derived thereof
address@hidden :texinfo
+For all files in @acronym{Texinfo} mode.
address@hidden table
address@hidden
+A logical expression like:
address@hidden @code
address@hidden (or @var{dialect-expression1} @dots{} @address@hidden)
+For union of the sets of dialects corresponding to  @var{dialect-expression1}
+through @address@hidden
address@hidden (and @var{dialect-expression1} @dots{} @address@hidden)
+For intersection of the sets of dialects corresponding to
address@hidden through @address@hidden
address@hidden (nor @var{dialect-expression1} @dots{} @address@hidden)
+For complement of the union sets of dialects corresponding to
address@hidden through @address@hidden
+relatively to the set of all supported dialects
address@hidden (not @var{dialect-expr})
+For complement set of dialect corresponding to @var{dialect-expr}
+relatively to the set of all supported dialects
address@hidden table
address@hidden itemize
+
 @end defun
 
+In case of adding a style hook for @LaTeX{}, when calling function
address@hidden it is thought more futureproof for argument
address@hidden to pass constant @code{LaTeX-dialect} currently
+defined to @code{:latex}, rather than passing @code{:latex} directly.
+
address@hidden Constant LaTeX-dialect
+Default dialect for use with function @code{TeX-add-style-hook} for
+argument @var{dialect-expr} when the hook is to be run only on LaTeX
+file, or any mode derived thereof.
address@hidden defvr
+
+
 @node Adding Macros
 @subsection Adding Support for Macros
 @cindex Adding macros
diff --git a/latex.el b/latex.el
index 2cd2b65..32a431f 100644
--- a/latex.el
+++ b/latex.el
@@ -4537,8 +4537,9 @@ use \\[customize]."
 
 (defconst LaTeX-dialect :latex
   "Default dialect for use with function `TeX-add-style-hook' for
-  argument DIALECT when the hook is to be run only on LaTeX file,
-  or any mode derived thereof. See variable `TeX-style-hook-dialect'." )
+argument DIALECT-EXPR when the hook is to be run only on LaTeX
+file, or any mode derived thereof. See variable
+`TeX-style-hook-dialect'." )
 
 (defconst LaTeX-math-default
   '((?a "alpha" "Greek Lowercase" 945) ;; #X03B1



reply via email to

[Prev in Thread] Current Thread [Next in Thread]