]> code.delx.au - gnu-emacs-elpa/commitdiff
Update AUCTeX ELPA package to the new 11.87 release.
authorTassilo Horn <tsdh@gnu.org>
Sun, 2 Dec 2012 18:32:15 +0000 (19:32 +0100)
committerTassilo Horn <tsdh@gnu.org>
Sun, 2 Dec 2012 18:32:15 +0000 (19:32 +0100)
58 files changed:
packages/auctex/auctex-pkg.el
packages/auctex/auctex.info
packages/auctex/auctex.info-1
packages/auctex/auctex.info-2
packages/auctex/context-en.el
packages/auctex/context-nl.el
packages/auctex/context.el
packages/auctex/doc/auctex.texi
packages/auctex/doc/changes.texi
packages/auctex/doc/faq.texi
packages/auctex/doc/install.texi
packages/auctex/doc/macros.texi
packages/auctex/doc/preview-latex.texi
packages/auctex/doc/quickstart.texi
packages/auctex/doc/version.texi
packages/auctex/doc/wininstall.texi
packages/auctex/font-latex.el
packages/auctex/latex.el
packages/auctex/latex/preview.sty
packages/auctex/plain-tex.el [new file with mode: 0644]
packages/auctex/preview-latex.info
packages/auctex/preview.el
packages/auctex/style/beamer.el
packages/auctex/style/biblatex.el [new file with mode: 0644]
packages/auctex/style/bulgarian.el
packages/auctex/style/czech.el
packages/auctex/style/danish.el
packages/auctex/style/dinbrief.el [new file with mode: 0644]
packages/auctex/style/doc.el
packages/auctex/style/epsf.el [new file with mode: 0644]
packages/auctex/style/french.el [new file with mode: 0644]
packages/auctex/style/frenchb.el
packages/auctex/style/german.el
packages/auctex/style/harvard.el
packages/auctex/style/icelandic.el
packages/auctex/style/latexinfo.el [new file with mode: 0644]
packages/auctex/style/letter.el
packages/auctex/style/lettrine.el [new file with mode: 0644]
packages/auctex/style/multicol.el [new file with mode: 0644]
packages/auctex/style/natbib.el
packages/auctex/style/ngerman.el
packages/auctex/style/polish.el
packages/auctex/style/polski.el
packages/auctex/style/prosper.el [new file with mode: 0644]
packages/auctex/style/psfig.el [new file with mode: 0644]
packages/auctex/style/setspace.el [new file with mode: 0644]
packages/auctex/style/slovak.el
packages/auctex/style/swedish.el
packages/auctex/style/virtex.el
packages/auctex/style/xspace.el [new file with mode: 0644]
packages/auctex/tex-buf.el
packages/auctex/tex-fold.el
packages/auctex/tex-fptex.el [deleted file]
packages/auctex/tex-info.el
packages/auctex/tex-jp.el
packages/auctex/tex-site.el
packages/auctex/tex-style.el
packages/auctex/tex.el

index 0d6a0a87d9a8ceecb59a121d3ab565dc69104409..014a083c287ed7c6f05bf7664059d65a8ea47ab4 100644 (file)
@@ -1 +1 @@
-(define-package "auctex" "11.86" "Integrated environment for *TeX*")
+(define-package "auctex" "11.87" "Integrated environment for *TeX*")
index fde0099b13f553f8d1bf629fdc2f151cc8e67530..80d117d44ab67ff990d9842b5b2fcdab6609e007 100644 (file)
@@ -1,10 +1,10 @@
 This is auctex.info, produced by makeinfo version 4.13 from auctex.texi.
 
-This manual is for AUCTeX (version 11.86 from 2010-02-21), a
+This manual is for AUCTeX (version 11.87 from 2012-11-30), a
 sophisticated TeX environment for Emacs.
 
    Copyright (C) 1992, 1993, 1994, 1995, 2001, 2002, 2004, 2005, 2006,
-2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 
      Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License,
@@ -24,96 +24,104 @@ END-INFO-DIR-ENTRY
 
 \1f
 Indirect:
-auctex.info-1: 961
-auctex.info-2: 291546
+auctex.info-1: 973
+auctex.info-2: 290810
 \1f
 Tag Table:
 (Indirect)
-Node: Top\7f961
-Node: Copying\7f6965
-Node: Introduction\7f8921
-Node: Summary\7f9191
-Node: Installation\7f11935
-Node: Prerequisites\7f12901
-Node: Configure\7f15930
-Node: Build/install\7f21352
-Node: Loading the package\7f21843
-Node: Advice for package providers\7f23650
-Node: Advice for non-privileged users\7f27598
-Node: Installation under MS Windows\7f31555
-Node: Customizing\7f46789
-Node: Quick Start\7f48372
-Ref: Quick Start-Footnote-1\7f50165
-Node: Editing Facilities\7f50312
-Node: Processing Facilities\7f55108
-Node: Editing\7f59002
-Node: Quotes\7f60237
-Node: Font Specifiers\7f63978
-Node: Sectioning\7f65804
-Node: Environments\7f70118
-Node: Equations\7f72484
-Node: Floats\7f73075
-Node: Itemize-like\7f74614
-Node: Tabular-like\7f75156
-Node: Customizing Environments\7f75785
-Node: Mathematics\7f76025
-Node: Completion\7f78952
-Node: Commenting\7f83017
-Node: Indenting\7f84345
-Node: Filling\7f90138
-Node: Display\7f95459
-Node: Font Locking\7f96772
-Node: Fontification of macros\7f98847
-Node: Fontification of quotes\7f108294
-Node: Fontification of math\7f109789
-Node: Verbatim content\7f111509
-Node: Faces\7f112283
-Node: Known problems\7f112772
-Node: Folding\7f113700
-Node: Outline\7f124133
-Node: Processing\7f125387
-Node: Commands\7f126550
-Node: Starting a Command\7f127106
-Node: Selecting a Command\7f130849
-Node: Processor Options\7f133731
-Node: Viewing\7f139415
-Node: Starting Viewers\7f139789
-Node: I/O Correlation\7f145957
-Node: Debugging\7f148330
-Node: Checking\7f149844
-Node: Control\7f151148
-Node: Cleaning\7f151877
-Node: Documentation\7f153090
-Node: Customization\7f153870
-Node: Modes and Hooks\7f154363
-Node: Multifile\7f155571
-Node: Parsing Files\7f160282
-Node: Internationalization\7f164687
-Node: European\7f165868
-Node: Japanese\7f172689
-Node: Automatic\7f174386
-Node: Automatic Global\7f176910
-Node: Automatic Private\7f178071
-Node: Automatic Local\7f179384
-Node: Style Files\7f180471
-Node: Simple Style\7f181264
-Node: Adding Macros\7f182355
-Node: Adding Environments\7f187859
-Node: Adding Other\7f192128
-Node: Hacking the Parser\7f192715
-Node: Appendices\7f196588
-Node: Copying this Manual\7f196839
-Node: GNU Free Documentation License\7f197762
-Node: Changes\7f222900
-Node: Development\7f246154
-Node: Mid-term Goals\7f246800
-Node: Wishlist\7f248362
-Node: Bugs\7f255300
-Node: FAQ\7f256695
-Node: Indices\7f262843
-Node: Key Index\7f263006
-Node: Function Index\7f268016
-Node: Variable Index\7f275687
-Node: Concept Index\7f291546
+Node: Top\7f973
+Node: Copying\7f7008
+Node: Introduction\7f8964
+Node: Summary\7f9234
+Node: Installation\7f11978
+Node: Prerequisites\7f13355
+Node: Configure\7f16366
+Node: Build/install\7f21788
+Node: Loading the package\7f22279
+Node: Advice for package providers\7f24086
+Node: Advice for non-privileged users\7f28034
+Node: Installation under MS Windows\7f31991
+Node: Customizing\7f47194
+Node: Quick Start\7f48777
+Ref: Quick Start-Footnote-1\7f50766
+Node: Editing Facilities\7f50913
+Node: Processing Facilities\7f55709
+Node: Editing\7f59603
+Node: Quotes\7f60919
+Node: Font Specifiers\7f64660
+Node: Sectioning\7f66486
+Node: Environments\7f70800
+Node: Equations\7f73166
+Node: Floats\7f73757
+Node: Itemize-like\7f75296
+Node: Tabular-like\7f75838
+Node: Customizing Environments\7f76467
+Node: Mathematics\7f76707
+Node: Completion\7f79634
+Node: Marking\7f83696
+Node: Marking (LaTeX)\7f84320
+Node: Marking (Texinfo)\7f85262
+Node: Commenting\7f86872
+Node: Indenting\7f88197
+Node: Filling\7f93990
+Node: Display\7f99313
+Node: Font Locking\7f100626
+Node: Fontification of macros\7f102701
+Node: Fontification of quotes\7f112148
+Node: Fontification of math\7f113643
+Node: Verbatim content\7f115363
+Node: Faces\7f116137
+Node: Known problems\7f116626
+Node: Folding\7f117554
+Node: Outline\7f127987
+Node: Processing\7f129241
+Node: Commands\7f130404
+Node: Starting a Command\7f130960
+Node: Selecting a Command\7f134703
+Node: Processor Options\7f137787
+Node: Viewing\7f143471
+Node: Starting Viewers\7f143845
+Node: I/O Correlation\7f150013
+Node: Debugging\7f152386
+Node: Checking\7f153900
+Node: Control\7f155204
+Node: Cleaning\7f155933
+Node: Documentation\7f157146
+Node: Customization\7f157926
+Node: Modes and Hooks\7f158419
+Node: Multifile\7f159627
+Node: Parsing Files\7f164338
+Node: Internationalization\7f168743
+Node: European\7f169924
+Node: Japanese\7f176745
+Node: Automatic\7f178442
+Node: Automatic Global\7f180967
+Node: Automatic Private\7f182128
+Node: Automatic Local\7f183441
+Node: Style Files\7f184528
+Node: Simple Style\7f185321
+Node: Adding Macros\7f186620
+Node: Adding Environments\7f192514
+Node: Adding Other\7f196783
+Node: Hacking the Parser\7f197370
+Node: Appendices\7f201243
+Node: Copying this Manual\7f201539
+Node: GNU Free Documentation License\7f202474
+Node: Changes\7f227612
+Node: Development\7f251844
+Node: Mid-term Goals\7f252490
+Node: Wishlist\7f254052
+Node: Bugs\7f260990
+Node: FAQ\7f262385
+Node: Texinfo mode\7f268429
+Node: Exploiting\7f269565
+Node: Superseding\7f270383
+Node: Mapping\7f274586
+Node: Unbinding\7f276415
+Node: Indices\7f277236
+Node: Key Index\7f277399
+Node: Function Index\7f282774
+Node: Variable Index\7f290810
+Node: Concept Index\7f306815
 \1f
 End Tag Table
index 478d5bdcb49830961dc667bc34fb198a564f0192..1ee50f4d190e40a6cfc9f4da936afef219b44208 100644 (file)
@@ -1,10 +1,10 @@
 This is auctex.info, produced by makeinfo version 4.13 from auctex.texi.
 
-This manual is for AUCTeX (version 11.86 from 2010-02-21), a
+This manual is for AUCTeX (version 11.87 from 2012-11-30), a
 sophisticated TeX environment for Emacs.
 
    Copyright (C) 1992, 1993, 1994, 1995, 2001, 2002, 2004, 2005, 2006,
-2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 
      Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License,
@@ -80,7 +80,7 @@ announcement list by sending "subscribe" in the subject of a mail to
 * Display::                     Controlling Screen Display
 * Processing::                  Starting Processors, Viewers and Other Programs
 * Customization::               Customization and Extension
-* Appendices::                  Copying, Changes, Development, FAQ
+* Appendices::                  Copying, Changes, Development, FAQ, Texinfo mode
 * Indices::                     Indices
 
  --- The Detailed Node Listing ---
@@ -173,6 +173,7 @@ Copying, Changes, Development, FAQ
 * Changes::
 * Development::
 * FAQ::
+* Texinfo mode::
 
 Copying this Manual
 
@@ -303,6 +304,15 @@ File: auctex.info,  Node: Installation,  Next: Quick Start,  Prev: Summary,  Up:
 1.2 Installing AUCTeX
 =====================
 
+   The simplest way of installing AUCTeX is by using the Emacs package
+manager integrated in Emacs 24 and greater (ELPA).  Simply do `M-x
+package-list-packages RET', mark the auctex package for installation
+with `i', and hit `x' to execute the installation procedure.  That's
+all.
+
+   The remainder of this section is about installing AUCTeX from a
+release tarball or from a checkout of the AUCTeX repository.
+
    Installing AUCTeX should be simple: merely `./configure', `make',
 and `make install' for a standard site-wide installation (most other
 installations can be done by specifying a `--prefix=...' option).
@@ -337,7 +347,7 @@ File: auctex.info,  Node: Prerequisites,  Next: Configure,  Up: Installation
      version of `xemacs-base' older than 1.84 (released in sumo from
      02/02/2004).  Using preview-latex requires a version of Emacs
      compiled with image support.  While the X11 version of Emacs 21
-     will likely work, Emacs 22 and later is the preferred platform.
+     will likely work, Emacs 22 and later is preferred.
 
     Windows
           Precompiled versions are available from
@@ -349,8 +359,8 @@ File: auctex.info,  Node: Prerequisites,  Next: Configure,  Up: Installation
           `http://www.emacswiki.org/cgi-bin/wiki/EmacsForMacOS'.
 
     GNU/Linux
-          Most GNU/Linux distributions nowadays provide a variant of
-          Emacs 22 or later via their package repositories.
+          Most GNU/Linux distributions nowadays provide a recent
+          variant of Emacs via their package repositories.
 
     Self-compiled
           Compiling Emacs yourself requires a C compiler and a number
@@ -1045,12 +1055,10 @@ used single quotes for that.
      `~/.xemacs/init.el' from within XEmacs).
 
      The default configuration of AUCTeX is probably not the best fit
-     for Windows systems.  You might want to add
+     for Windows systems with MiKTeX.  You might want to add
           (require 'tex-mik)
-     or
-          (require 'tex-fptex)
-     in order to get more appropriate values for MiKTeX and fpTeX,
-     respectively after loading `auctex.el' and `preview-latex.el'.
+     after loading `auctex.el' and `preview-latex.el' in order to get
+     more appropriate values for some customization options.
 
      You can always use
 
@@ -1150,9 +1158,14 @@ inserting
 
      (load "auctex.el" nil t t)
 
-   in your user init file.(1)  In order to get support for many of the
-LaTeX packages you will use in your documents, you should enable
-document parsing as well, which can be achieved by putting
+   in your user init file.(1)  If you've installed AUCTeX from the
+Emacs package manager (ELPA), you must not have this line in your user
+init file.  The installation procedure already cares about loading
+AUCTeX correctly.
+
+   In order to get support for many of the LaTeX packages you will use
+in your documents, you should enable document parsing as well, which can
+be achieved by putting
 
      (setq TeX-auto-save t)
      (setq TeX-parse-self t)
@@ -1413,6 +1426,7 @@ by indenting and filling and for navigating through the document.
 * Environments::                Inserting Environment Templates
 * Mathematics::                 Entering Mathematics
 * Completion::                  Completion of macros
+* Marking::                     Marking Environments, Sections, or Texinfo Nodes
 * Commenting::                  Commenting text
 * Indenting::                   Reflecting syntactic constructs with whitespace
 * Filling::                     Automatic and manual line breaking
@@ -1938,7 +1952,7 @@ enable this feature, set the variable
      If non-nil, insert braces after typing <^> and <_> in math mode.
 
 \1f
-File: auctex.info,  Node: Completion,  Next: Commenting,  Prev: Mathematics,  Up: Editing
+File: auctex.info,  Node: Completion,  Next: Marking,  Prev: Mathematics,  Up: Editing
 
 2.6 Completion
 ==============
@@ -2030,9 +2044,91 @@ after you enabled automatic parsing on save, and that the basename of
 the BibTeX file does not conflict with the basename of one of TeX files.
 
 \1f
-File: auctex.info,  Node: Commenting,  Next: Indenting,  Prev: Completion,  Up: Editing
+File: auctex.info,  Node: Marking,  Next: Commenting,  Prev: Completion,  Up: Editing
+
+2.7 Marking Environments, Sections, or Texinfo Nodes
+====================================================
+
+You can mark the current environment by typing `C-c .', or the current
+section by typing `C-c *'.
+
+   In Texinfo documents you can type `M-C-h' to mark the current node.
+
+   When the region is set, the point is moved to its beginning and the
+mark to its end.
+
+* Menu:
+
+* Marking (LaTeX):: LaTeX Commands for Marking Environments and Sections
+* Marking (Texinfo):: Texinfo Commands for Marking Environments, Sections, and Nodes
+
+\1f
+File: auctex.info,  Node: Marking (LaTeX),  Next: Marking (Texinfo),  Up: Marking
+
+2.7.1 LaTeX Commands for Marking Environments and Sections
+----------------------------------------------------------
+
+ -- Command: LaTeX-mark-section
+     (`C-c *') Set mark at end of current logical section, and point at
+     top.
+
+     With a non-nil prefix argument, mark only the region from the
+     current section start to the next sectioning command.  Thereby
+     subsections are not being marked.  Otherwise, any included
+     subsections are also marked along with current section.
+
+ -- Command: LaTeX-mark-environment
+     (`C-c .') Set mark to the end of the current environment and point
+     to the matching beginning.
+
+     If a prefix argument is given, mark the respective number of
+     enclosing environments.  The command will not work properly if
+     there are unbalanced begin-end pairs in comments and verbatim
+     environments.
+
+\1f
+File: auctex.info,  Node: Marking (Texinfo),  Prev: Marking (LaTeX),  Up: Marking
 
-2.7 Commenting
+2.7.2 Texinfo Commands for Marking Environments and Sections
+------------------------------------------------------------
+
+ -- Command: Texinfo-mark-section
+     (`C-c *') Mark the current section, with inclusion of any
+     containing node.
+
+     The current section is detected as starting by any of the
+     structuring commands matched by the regular expression in the
+     variable `outline-regexp' which in turn is a regular expression
+     matching any element of the variable `texinfo-section-list'.
+
+     With a non-nil prefix argument, mark only the region from the
+     current section start to the next sectioning command.  Thereby
+     subsections are not being marked.  Otherwise, any included
+     subsections are also marked
+
+     Note that when the current section is starting immediately after a
+     node command, then the node command is also marked as part of the
+     section.
+
+ -- Command: Texinfo-mark-environment
+     (`C-c .') Set mark to the end of the current environment and point
+     to the matching beginning.
+
+     If a prefix argument is given, mark the respective number of
+     enclosing environments.  The command will not work properly if
+     there are unbalanced begin-end pairs in comments and verbatim
+     environments.
+
+ -- Command: Texinfo-mark-node
+     (`M-C-h') Mark the current node.  This is the node in which point
+     is located.  It is starting at the previous occurrence of the
+     keyword `@node' and ending at next occurrence of the keywords
+     `@node' or `@bye'.
+
+\1f
+File: auctex.info,  Node: Commenting,  Next: Indenting,  Prev: Marking,  Up: Editing
+
+2.8 Commenting
 ==============
 
 It is often necessary to comment out temporarily a region of TeX or
@@ -2060,7 +2156,7 @@ or remove a single `%' respectively.
 \1f
 File: auctex.info,  Node: Indenting,  Next: Filling,  Prev: Commenting,  Up: Editing
 
-2.8 Indenting
+2.9 Indenting
 =============
 
 Indentation means the addition of whitespace at the beginning of lines
@@ -2182,8 +2278,8 @@ to indenting with a small summary in each case:
 \1f
 File: auctex.info,  Node: Filling,  Prev: Indenting,  Up: Editing
 
-2.9 Filling
-===========
+2.10 Filling
+============
 
 Filling deals with the insertion of line breaks to prevent lines from
 becoming wider than what is specified in `fill-column'.  The linebreaks
@@ -3147,6 +3243,10 @@ variable (*note File Variables: (emacs)File Variables.).
      The default command to run in this buffer.  Must be an entry in
      `TeX-command-list'.
 
+   In case you use biblatex in a document, AUCTeX switches from BibTeX
+to Biber for bibliography processing.  In case you want to keep using
+BibTeX, set the variable `LaTeX-biblatex-use-Biber' to nil.
+
    After confirming a command to execute, AUCTeX will try to save any
 buffers related to the document, and check if the document needs to be
 reformatted.  If the variable `TeX-save-query' is non-nil, AUCTeX will
@@ -4132,7 +4232,7 @@ recursively search through subdirectories.
      recurse, a positive integer means go that far deep in the directory
      hierarchy, t means recurse indefinitely.
 
-   By default, AUCTeX will ignore files name `.', `..', `SCCS', `RCS',
+   By default, AUCTeX will ignore files named `.', `..', `SCCS', `RCS',
 and `CVS'.
 
  -- User Option: TeX-ignore-file
@@ -4269,17 +4369,22 @@ Here is a simple example of a style file.
       (lambda ()
         (LaTeX-largest-level-set "chapter")))
 
-   This file specifies that the largest kind of section in a LaTeX
-document using the book document style is chapter.  The interesting
-thing to notice is that the style file defines an (anonymous) function,
-and adds it to the list of loaded style hooks by calling
-`TeX-add-style-hook'.
+   The example is from the AUCTeX sources and is loaded for any LaTeX
+document using the book document class (or style before LaTeX2e).  The
+file specifies that the largest kind of section in such a document is
+chapter.  The interesting thing to notice is that the style file
+defines an (anonymous) function, and adds it to the list of loaded style
+hooks by calling `TeX-add-style-hook'.
+
+   The first time the user indirectly tries to access some
+style-specific information, such as the largest sectioning command
+available, the style hooks for all files directly or indirectly read by
+the current document are executed.  The actual files will only be
+evaluated once, but the hooks will be called for each buffer using the
+style file.
 
-   The first time the user indirectly tries to access some style
-specific information, such as the largest sectioning command available,
-the style hooks for all files directly or indirectly read by the
-current document is executed.  The actual files will only be evaluated
-once, but the 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.
 
  -- Function: TeX-add-style-hook STYLE HOOK
      Add HOOK to the list of functions to run when we use the TeX file
@@ -4338,7 +4443,11 @@ a `tref' you will be prompted for a label and no more.
      Use the string as a prompt to prompt for the argument.
 
 `number'
-     Insert that many braces, leave point inside the first.
+     Insert that many braces, leave point inside the first.  0 and -1
+     are special.  0 means that no braces are inserted.  -1 means that
+     braces are inserted around the macro and an active region (e.g.
+     `{\tiny foo}').  If there is no active region, no braces are
+     inserted.
 
 `nil'
      Insert empty braces.
@@ -4406,6 +4515,9 @@ overwrite the default prompt.
 `TeX-arg-input-file'
      Prompt for the name of an input file in TeX's search path, and use
      it without the extension.  Run the style hooks for the file.
+     (Note that the behavior (type of prompt and inserted file name) of
+     the function can be controlled by the variable
+     `TeX-arg-input-file-search'.)
 
 `TeX-arg-define-label'
      Prompt for a label completing with known labels.  Add label to
@@ -4706,8 +4818,8 @@ symbols found.
 \1f
 File: auctex.info,  Node: Appendices,  Next: Indices,  Prev: Customization,  Up: Top
 
-Appendix A Copying, Changes, Development, FAQ
-*********************************************
+Appendix A Copying, Changes, Development, FAQ, Texinfo Mode
+***********************************************************
 
 * Menu:
 
@@ -4715,6 +4827,7 @@ Appendix A Copying, Changes, Development, FAQ
 * Changes::
 * Development::
 * FAQ::
+* Texinfo mode::
 
 \1f
 File: auctex.info,  Node: Copying this Manual,  Next: Changes,  Up: Appendices
@@ -4724,11 +4837,11 @@ A.1 Copying this Manual
 
 The copyright notice for this manual is:
 
-   This manual is for AUCTeX (version 11.86 from 2010-02-21), a
+   This manual is for AUCTeX (version 11.87 from 2012-11-30), a
 sophisticated TeX environment for Emacs.
 
    Copyright (C) 1992, 1993, 1994, 1995, 2001, 2002, 2004, 2005, 2006,
-2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 
      Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License,
@@ -5235,6 +5348,31 @@ File: auctex.info,  Node: Changes,  Next: Development,  Prev: Copying this Manua
 A.2 Changes and New Features
 ============================
 
+News since 11.87
+----------------
+
+   * AUCTeX now supports Biber in conjunction with biblatex in addition
+     to BibTeX.
+
+   * Each AUCTeX mode now has its own abbrev table.  On Emacsen which
+     provide the possibility to inherit abbrevs from other tables, the
+     abbrevs from the Text mode abbrev table are available as well.
+     Newly defined abbrevs are written to the mode-specific tables,
+     though.
+
+   * The file `tex-fptex.el' was removed.
+
+   * Forward/backward search for Evince has been improved.  If Emacs is
+     compiled with DBUS support and a recent Evince version (3.x) is
+     installed, the communication goes over the desktop bus instead of
+     the command line, resulting in more accurate positioning of point
+     in Emacs and highlighting of the target paragraph in Evince.
+
+   * A problem where Ghostscript threw an /invalidfileaccess error when
+     running preview-latex was fixed.
+
+   * A lot of smaller fixes and additions have been made.
+
 News in 11.86
 -------------
 
@@ -6095,7 +6233,7 @@ A.3.3 Bugs
      in overfull lines. (XEmacs only)
 
 \1f
-File: auctex.info,  Node: FAQ,  Prev: Development,  Up: Appendices
+File: auctex.info,  Node: FAQ,  Next: Texinfo mode,  Prev: Development,  Up: Appendices
 
 A.4 Frequently Asked Questions
 ==============================
@@ -6118,9 +6256,9 @@ A.4 Frequently Asked Questions
      cause of the error yourself.
 
      First, you can try to generate a so-called backtrace which shows
-     functions involved in a program error.  In order to do this, start
-     Emacs with the command line `emacs --debug-init' and/or put the
-     line
+     the functions involved in a program error.  In order to do this,
+     start Emacs with the command line `emacs --debug-init' and/or put
+     the line
 
           (setq debug-on-error t)
 
@@ -6133,17 +6271,12 @@ A.4 Frequently Asked Questions
      Second, you can try to figure out if something in your personal or
      site configuration triggers the error by starting Emacs without
      such customizations.  You can do this by invoking Emacs with the
-     command line `emacs -q -no-site-file'.  Once Emacs is running,
-     copy the line
-
-          (load "auctex.el" nil t t)
-
-     into the `*scratch*' buffer and type `M-x eval-buffer RET'.  This
-     makes sure that AUCTeX will be used for the file types it
-     supports.  After you have done so, you can load the file
-     triggering the error.  If everything is working now, you know that
-     you have to search either in the site configuration file or your
-     personal init file for statements related to the problem.
+     command line `emacs -q -no-site-file -l auctex'.  The `-l' option
+     `auctex.el' which you normally do in your init file.  After you
+     have started Emacs like this, you can load the file triggering the
+     error.  If everything is working now, you know that you have to
+     search either in the site configuration file or your personal init
+     file for statements related to the problem.
 
   2. What versions of Emacs and XEmacs are supported?
 
@@ -6153,28 +6286,17 @@ A.4 Frequently Asked Questions
      through the XEmacs package system.  If you are looking for a
      recommendation, it would appear that the smoothest working
      platform on all operating systems at the current point of time
-     would be Emacs 22.1.  At the time of this writing, however, it has
-     not been released and is still under development.  The quality of
-     the development version is quite solid, so we recommend giving it
-     a try.  With a developer version, of course, you have to be
-     prepared to update in case you managed to get your snapshot at a
-     bad time.  The second best choice would be the latest released
-     Emacs 21.4.  However, Unicode support is less good, there is no
-     version for the popular GTK toolkit, and the native versions for
-     Windows and MacOS don't offer toolbar and preview-latex support.
-
-     Our success with XEmacs has been less than convincing.  Under the
-     Windows operating system, nominally the only option for a released,
-     stable Emacs variant supporting toolbars and preview-latex would be
-     XEmacs 21.4.  However, code for core functionality like formatting
-     and syntax highlighting tends to be different and often older than
-     even Emacs 21.4, and Unicode support as delivered is problematic
-     at best, missing on Windows.  Both AUCTeX and XEmacs developers
-     don't hear much from active users of the combination.  Partly for
-     that reason, problems tend to go unnoticed for long amounts of
-     time and are often found, if at all, after releases.  No
-     experiences or recommendations can be given for beta or developer
-     versions of XEmacs.
+     would be Emacs 22 or higher.
+
+     Our success with XEmacs has been less than convincing.  Code for
+     core functionality like formatting and syntax highlighting tends
+     to be different and often older than even Emacs 21.4, and Unicode
+     support as delivered is problematic at best, missing on Windows.
+     Both AUCTeX and XEmacs developers don't hear much from active
+     users of the combination.  Partly for that reason, problems tend
+     to go unnoticed for long amounts of time and are often found, if
+     at all, after releases.  No experiences or recommendations can be
+     given for beta or developer versions of XEmacs.
 
   3. What should I do when `./configure' does not find programs like
      latex?
@@ -6218,13 +6340,227 @@ A.4 Frequently Asked Questions
      The information in the debugging buffer can help you find the
      cause of the error in your init file.
 
-  8. What does AUC stand for?
+  8. Why does `TeX-next-error' (`C-c `') fail?
+
+     When writing the log file, TeX puts information related to a file,
+     including error messages, between a pair of parentheses.  AUCTeX
+     determines the file where the error happened by parsing the log
+     file and counting the parentheses.  This can fail when there are
+     other, unbalanced parentheses present.
+
+     As a workaround you can activate so-called file:line:error
+     messages for the log file.  (Those are are easier to parse, but
+     may lack some details.)  Either you do this in the configuration
+     of your TeX system (consult its manual to see where this is) or
+     you add a command line switch to the (la)tex call, e.g. by
+     customizing `LaTeX-command-style' or `TeX-command-list'.
+
+  9. What does AUC stand for?
 
      AUCTeX came into being at Aalborg University in Denmark.  Back then
      the Danish name of the university was Aalborg Universitetscenter;
      AUC for short.
 
 
+\1f
+File: auctex.info,  Node: Texinfo mode,  Prev: FAQ,  Up: Appendices
+
+A.5 Features specific to AUCTeX's Texinfo major mode
+====================================================
+
+AUCTeX includes a major mode for editting Texinfo files.  This major
+mode is not the same mode as the native Texinfo mode (*note (texinfo)
+Texinfo Mode::) of Emacs, although they have the same name.  However,
+AUCTeX still relies on a number of functions from the native Texinfo
+mode.
+
+   The following text describes which functionality is offered by AUCTeX
+and which by the native Texinfo mode.  This should enable you to decide
+when to consult the AUCTeX manual and when the manual of the native
+mode.  And in case you are a seasoned user of the native mode, the
+information should help you to swiftly get to know the AUCTeX-specific
+commands.
+
+* Menu:
+
+* Exploiting::                  How AUCTeX and the native mode work together
+* Superseding::                 Where the native mode is superseded
+* Mapping::                     Where key bindings are mapped to the native mode
+* Unbinding::                   Which native mode key bindings are missing
+
+\1f
+File: auctex.info,  Node: Exploiting,  Next: Superseding,  Up: Texinfo mode
+
+A.5.1 How AUCTeX and the native mode work together
+--------------------------------------------------
+
+In a nutshell the split between AUCTeX Texinfo mode, and native Texinfo
+mode is as follows:
+
+   * Most of the editing (environment creation, commenting, font command
+     insertions) and/or processing commands (e.g. compiling or printing)
+     which are available in other AUCTeX modes are also handled by
+     AUCTeX in Texinfo mode.
+
+   * Texinfo-related features (e.g. info node linkage or menu creation)
+     rely on the commands provided by the native Texinfo mode.  AUCTeX
+     provides the key bindings to reach these functions, keeping the
+     same keys as in native Texinfo whenever possible, or similar ones
+     otherwise.
+
+\1f
+File: auctex.info,  Node: Superseding,  Next: Mapping,  Prev: Exploiting,  Up: Texinfo mode
+
+A.5.2 Where the native mode is superseded
+-----------------------------------------
+
+This section is directed to users of the native Texinfo mode switching
+to AUCTeX.  It follows the summary of the native mode (*note (texinfo)
+Texinfo Mode Summary::) and lists which of its commands are no longer
+of use.
+
+Insert commands
+     In the native Texinfo mode, frequently used Texinfo commands can be
+     inserted with key bindings of the form `C-c C-c K' where K differs
+     for each Texinfo command; `c' inserts @code, `d' inserts @dfn, `k'
+     @kbd, etc.
+
+     In AUCTeX commands are inserted with the key binding `C-c C-m'
+     instead which prompts for the macro to be inserted.  For font
+     selection commands (like @b, @i, or @emph) and a few related ones
+     (like @var, @key or @code) there are bindings which insert the
+     respective macros directly.  They have the form `C-c C-f K' or
+     `C-c C-f C-K' and call the function `TeX-font'.  Type `C-c C-f
+     <RET>' to get a list of supported commands.
+
+     Note that the prefix argument is not handled the same way by
+     AUCTeX.  Note also that the node insertion command from the native
+     mode (`texinfo-insert-@node') can still accessed from the Texinfo
+     menu in AUCTeX.
+
+Insert braces
+     In AUCTeX braces can be inserted with the same key binding as in
+     the native Texinfo mode: `C-c {'.  But AUCTeX uses its own function
+     for the feature: `TeX-insert-braces'.
+
+Insert environments
+     The native Texinfo mode does not insert full environments.
+     Instead, it provides the function `texinfo-insert-@end' (mapped to
+     `C-c C-c e') for closing an open environment with a matching @end
+     statement.
+
+     In AUCTeX you can insert full environments, i.e. both the opening
+     and closing statements, with the function `Texinfo-environment'
+     (mapped to `C-c C-e').
+
+Format info files with makeinfo and TeX
+     In the native Texinfo mode there are various functions and
+     bindings to format a region or the whole buffer for info or to
+     typeset the respective text.  For example, there is
+     `makeinfo-buffer' (mapped to `C-c C-m C-b') which runs `makeinfo'
+     on the buffer or there is `texinfo-tex-buffer' (mapped to `C-c C-t
+     C-b') which runs TeX on the buffer in order to produce a DVI file.
+
+     In AUCTeX different commands for formatting or typesetting can be
+     invoked through the function `TeX-command-master' (mapped to `C-c
+     C-c').  After typing `C-c C-c', you can select the desired
+     command, e.g `Makeinfo' or `TeX', through a prompt in the mini
+     buffer.  Note that you can make, say `Makeinfo', the default by
+     adding this statement in your init file:
+
+          (add-hook 'Texinfo-mode-hook
+                    (lambda () (setq TeX-command-default "Makeinfo")))
+
+     Note also that `C-c C-c Makeinfo <RET>' is not completely
+     functionally equivalent to `makeinfo-buffer' as the latter will
+     display the resulting info file in Emacs, showing the node
+     corresponding to the position in the source file, just after a
+     successful compilation.  This is why, while using AUCTeX, invoking
+     `makeinfo-buffer' might still be more convenient.
+
+     Note also that in the case of a multifile document, `C-c C-c' in
+     AUCTeX will work on the whole document (provided that the file
+     variable `TeX-master' is set correctly), while `makeinfo-buffer'
+     in the native mode will process only the current buffer, provided
+     at the `@setfilename' statement is provided.
+
+Produce indexes and print
+     The native Texinfo mode provides the binding `C-c C-t C-i'
+     (`texinfo-texindex') for producing an index and the bindings `C-c
+     C-t C-p' (`texinfo-tex-print') and `C-c C-t C-q'
+     (`tex-show-print-queue') for printing and showing the printer
+     queue.  These are superseded by the respective commands available
+     through `C-c C-c' (`TeX-command-master') in AUCTeX: Index, Print,
+     and Queue.
+
+Kill jobs
+     The command `C-c C-t C-k' (`tex-kill-job') in the native mode is
+     superseded by `C-c C-k' (`TeX-kill-job') in AUCTeX.
+
+\1f
+File: auctex.info,  Node: Mapping,  Next: Unbinding,  Prev: Superseding,  Up: Texinfo mode
+
+A.5.3 Where key bindings are mapped to the native mode
+------------------------------------------------------
+
+This node follows the native Texinfo mode summary (*note (texinfo)
+Texinfo Mode Summary::) and lists only those commands to which AUCTeX
+provides a keybinding.
+
+   Basically all commands of the native mode related to producing menus
+and interlinking nodes are mapped to same or similar keys in AUCTeX,
+while a few insertion commands are mapped to AUCTeX-like keys.
+
+`@item' insertion
+     The binding `C-c C-c i' for the insertion of `@item' in the native
+     mode is mapped to `M-<RET>' or `C-c C-j' in AUCTeX, similar to
+     other AUCTeX modes.
+
+`@end' insertion
+     The binding `C-c C-c e' for closing a `@FOO' command by a
+     corresponding `@end FOO' statement in the native mode is mapped to
+     `C-c C-]' in AUCTeX, similar to other AUCTeX modes.
+
+Move out of balanced braces
+     The binding `C-}' (`up-list') is available both in the native mode
+     and in AUCTeX.  (This is because the command is not implemented in
+     either mode but a native Emacs command.)  However, in AUCTeX, you
+     cannot use `C-]' for this, as it is used for `@end' insertion.
+
+Update pointers
+     The bindings `C-c C-u C-n' (`texinfo-update-node') and `C-c C-u
+     C-e' (`texinfo-every-node-update') from the native mode are
+     available in AUCTeX as well.
+
+Update menus
+     The bindings `C-c C-u m' (`texinfo-master-menu'), `C-c C-u C-m'
+     (`texinfo-make-menu'), and `C-c C-u C-a'
+     (`texinfo-all-menus-update') from the native mode are available in
+     AUCTeX as well.  The command `texinfo-start-menu-description',
+     bound to `C-c C-c C-d' in the native mode, is bound to `C-c C-u
+     C-d' in AUCTeX instead.
+
+\1f
+File: auctex.info,  Node: Unbinding,  Prev: Mapping,  Up: Texinfo mode
+
+A.5.4 Which native mode key bindings are missing
+------------------------------------------------
+
+The following commands from the native commands might still be useful
+when working with AUCTeX, however, they are not accessible with a key
+binding any longer.
+
+`@node' insertion
+     The node insertion command, mapped to `C-c C-c n' in the native
+     mode, is not mapped to any key in AUCTeX.  You can still access it
+     through the Texinfo menu, though.  Another alternative is to use
+     the `C-c C-m' binding for macro insertion in AUCTeX.
+
+Show the section structure
+     The command `texinfo-show-structure' (`C-c C-s') from the native
+     mode does not have a key binding in AUCTeX.  The binding is used
+     by AUCTeX for sectioning.
+
 \1f
 File: auctex.info,  Node: Indices,  Prev: Appendices,  Up: Top
 
@@ -6252,6 +6588,10 @@ Key Index
 * <LFD>:                                 Indenting.           (line  72)
 * <TAB>:                                 Indenting.           (line  69)
 * C-c %:                                 Commenting.          (line  23)
+* C-c * <1>:                             Marking (Texinfo).   (line   7)
+* C-c *:                                 Marking (LaTeX).     (line   7)
+* C-c . <1>:                             Marking (Texinfo).   (line  25)
+* C-c .:                                 Marking (LaTeX).     (line  16)
 * C-c ;:                                 Commenting.          (line  15)
 * C-c <LFD>:                             Itemize-like.        (line  10)
 * C-c ?:                                 Documentation.       (line   7)
@@ -6313,6 +6653,7 @@ Key Index
 * C-c ~:                                 Mathematics.         (line  12)
 * C-j:                                   Indenting.           (line  81)
 * M-<TAB>:                               Completion.          (line  20)
+* M-C-h:                                 Marking (Texinfo).   (line  34)
 * M-q:                                   Filling.             (line  89)
 
 \1f
@@ -6347,6 +6688,8 @@ Function Index
 * LaTeX-indent-line:                     Indenting.           (line  69)
 * LaTeX-insert-environment:              Adding Environments. (line  70)
 * LaTeX-insert-item:                     Itemize-like.        (line  10)
+* LaTeX-mark-environment:                Marking (LaTeX).     (line  16)
+* LaTeX-mark-section:                    Marking (LaTeX).     (line   7)
 * LaTeX-math-mode:                       Mathematics.         (line  12)
 * LaTeX-section:                         Sectioning.          (line  23)
 * LaTeX-section-heading:                 Sectioning.          (line  85)
@@ -6354,34 +6697,34 @@ Function Index
 * LaTeX-section-section:                 Sectioning.          (line  95)
 * LaTeX-section-title:                   Sectioning.          (line  89)
 * LaTeX-section-toc:                     Sectioning.          (line  92)
-* TeX-add-style-hook:                    Simple Style.        (line  28)
+* TeX-add-style-hook:                    Simple Style.        (line  33)
 * TeX-add-symbols:                       Adding Macros.       (line  25)
-* TeX-arg-cite:                          Adding Macros.       (line 105)
-* TeX-arg-conditional:                   Adding Macros.       (line  82)
-* TeX-arg-coordinate:                    Adding Macros.       (line 165)
-* TeX-arg-corner:                        Adding Macros.       (line 143)
-* TeX-arg-counter:                       Adding Macros.       (line 108)
-* TeX-arg-define-cite:                   Adding Macros.       (line 134)
-* TeX-arg-define-counter:                Adding Macros.       (line 137)
-* TeX-arg-define-environment:            Adding Macros.       (line 130)
-* TeX-arg-define-label:                  Adding Macros.       (line 122)
-* TeX-arg-define-macro:                  Adding Macros.       (line 126)
-* TeX-arg-define-savebox:                Adding Macros.       (line 140)
-* TeX-arg-environment:                   Adding Macros.       (line 102)
-* TeX-arg-eval:                          Adding Macros.       (line  93)
-* TeX-arg-file:                          Adding Macros.       (line 114)
-* TeX-arg-free:                          Adding Macros.       (line  90)
-* TeX-arg-input-file:                    Adding Macros.       (line 118)
-* TeX-arg-label:                         Adding Macros.       (line  96)
-* TeX-arg-literal:                       Adding Macros.       (line  86)
-* TeX-arg-lr:                            Adding Macros.       (line 146)
-* TeX-arg-macro:                         Adding Macros.       (line  99)
-* TeX-arg-pagestyle:                     Adding Macros.       (line 152)
-* TeX-arg-pair:                          Adding Macros.       (line 158)
-* TeX-arg-savebox:                       Adding Macros.       (line 111)
-* TeX-arg-size:                          Adding Macros.       (line 162)
-* TeX-arg-tb:                            Adding Macros.       (line 149)
-* TeX-arg-verb:                          Adding Macros.       (line 155)
+* TeX-arg-cite:                          Adding Macros.       (line 109)
+* TeX-arg-conditional:                   Adding Macros.       (line  86)
+* TeX-arg-coordinate:                    Adding Macros.       (line 172)
+* TeX-arg-corner:                        Adding Macros.       (line 150)
+* TeX-arg-counter:                       Adding Macros.       (line 112)
+* TeX-arg-define-cite:                   Adding Macros.       (line 141)
+* TeX-arg-define-counter:                Adding Macros.       (line 144)
+* TeX-arg-define-environment:            Adding Macros.       (line 137)
+* TeX-arg-define-label:                  Adding Macros.       (line 129)
+* TeX-arg-define-macro:                  Adding Macros.       (line 133)
+* TeX-arg-define-savebox:                Adding Macros.       (line 147)
+* TeX-arg-environment:                   Adding Macros.       (line 106)
+* TeX-arg-eval:                          Adding Macros.       (line  97)
+* TeX-arg-file:                          Adding Macros.       (line 118)
+* TeX-arg-free:                          Adding Macros.       (line  94)
+* TeX-arg-input-file:                    Adding Macros.       (line 122)
+* TeX-arg-label:                         Adding Macros.       (line 100)
+* TeX-arg-literal:                       Adding Macros.       (line  90)
+* TeX-arg-lr:                            Adding Macros.       (line 153)
+* TeX-arg-macro:                         Adding Macros.       (line 103)
+* TeX-arg-pagestyle:                     Adding Macros.       (line 159)
+* TeX-arg-pair:                          Adding Macros.       (line 165)
+* TeX-arg-savebox:                       Adding Macros.       (line 115)
+* TeX-arg-size:                          Adding Macros.       (line 169)
+* TeX-arg-tb:                            Adding Macros.       (line 156)
+* TeX-arg-verb:                          Adding Macros.       (line 162)
 * TeX-auto-generate:                     Automatic Private.   (line  24)
 * TeX-clean:                             Cleaning.            (line   7)
 * TeX-command-buffer:                    Starting a Command.  (line  35)
@@ -6427,232 +6770,7 @@ Function Index
 * TeX-toggle-debug-warnings:             Debugging.           (line  23)
 * TeX-view <1>:                          I/O Correlation.     (line  20)
 * TeX-view:                              Starting Viewers.    (line  12)
-
-\1f
-File: auctex.info,  Node: Variable Index,  Next: Concept Index,  Prev: Function Index,  Up: Indices
-
-Variable Index
-==============
-
-\0\b[index\0\b]
-* Menu:
-
-* ConTeXt-clean-intermediate-suffixes:   Cleaning.            (line   7)
-* ConTeXt-clean-output-suffixes:         Cleaning.            (line   7)
-* ConTeXt-engine:                        Processor Options.   (line  83)
-* ConTeXt-Omega-engine:                  Processor Options.   (line  83)
-* docTeX-clean-intermediate-suffixes:    Cleaning.            (line   7)
-* docTeX-clean-output-suffixes:          Cleaning.            (line   7)
-* font-latex-deactivated-keyword-classes: Fontification of macros.
-                                                              (line 174)
-* font-latex-fontify-script:             Fontification of math.
-                                                              (line  21)
-* font-latex-fontify-sectioning:         Fontification of macros.
-                                                              (line 102)
-* font-latex-match-bold-command-keywords: Fontification of macros.
-                                                              (line 143)
-* font-latex-match-bold-declaration-keywords: Fontification of macros.
-                                                              (line 143)
-* font-latex-match-function-keywords:    Fontification of macros.
-                                                              (line  66)
-* font-latex-match-italic-command-keywords: Fontification of macros.
-                                                              (line 143)
-* font-latex-match-italic-declaration-keywords: Fontification of macros.
-                                                              (line 143)
-* font-latex-match-math-command-keywords <1>: Fontification of math.
-                                                              (line   6)
-* font-latex-match-math-command-keywords: Fontification of macros.
-                                                              (line 143)
-* font-latex-match-reference-keywords:   Fontification of macros.
-                                                              (line  66)
-* font-latex-match-sectioning-0-keywords: Fontification of macros.
-                                                              (line 113)
-* font-latex-match-sectioning-1-keywords: Fontification of macros.
-                                                              (line 113)
-* font-latex-match-sectioning-2-keywords: Fontification of macros.
-                                                              (line 113)
-* font-latex-match-sectioning-3-keywords: Fontification of macros.
-                                                              (line 113)
-* font-latex-match-sectioning-4-keywords: Fontification of macros.
-                                                              (line 113)
-* font-latex-match-sectioning-5-keywords: Fontification of macros.
-                                                              (line 113)
-* font-latex-match-slide-title-keywords: Fontification of macros.
-                                                              (line 120)
-* font-latex-match-textual-keywords:     Fontification of macros.
-                                                              (line  66)
-* font-latex-match-type-command-keywords: Fontification of macros.
-                                                              (line 143)
-* font-latex-match-type-declaration-keywords: Fontification of macros.
-                                                              (line 143)
-* font-latex-match-variable-keywords:    Fontification of macros.
-                                                              (line  66)
-* font-latex-match-warning-keywords:     Fontification of macros.
-                                                              (line  66)
-* font-latex-math-environments:          Fontification of math.
-                                                              (line   6)
-* font-latex-quotes:                     Fontification of quotes.
-                                                              (line  16)
-* font-latex-script-display:             Fontification of math.
-                                                              (line  29)
-* font-latex-sectioning-0-face:          Fontification of macros.
-                                                              (line 102)
-* font-latex-sectioning-1-face:          Fontification of macros.
-                                                              (line 102)
-* font-latex-sectioning-2-face:          Fontification of macros.
-                                                              (line 102)
-* font-latex-sectioning-3-face:          Fontification of macros.
-                                                              (line 102)
-* font-latex-sectioning-4-face:          Fontification of macros.
-                                                              (line 102)
-* font-latex-sectioning-5-face:          Fontification of macros.
-                                                              (line 102)
-* font-latex-slide-title-face:           Fontification of macros.
-                                                              (line 120)
-* font-latex-user-keyword-classes:       Fontification of macros.
-                                                              (line 204)
-* japanese-LaTeX-command-default:        Japanese.            (line   6)
-* japanese-LaTeX-default-style:          Japanese.            (line   6)
-* japanese-TeX-command-default:          Japanese.            (line   6)
-* LaTeX-amsmath-label:                   Equations.           (line  16)
-* LaTeX-auto-label-regexp-list:          Parsing Files.       (line 100)
-* LaTeX-auto-minimal-regexp-list:        Parsing Files.       (line  97)
-* LaTeX-auto-regexp-list:                Parsing Files.       (line 103)
-* LaTeX-babel-hyphen:                    European.            (line 150)
-* LaTeX-babel-hyphen-after-hyphen:       European.            (line 158)
-* LaTeX-babel-hyphen-language-alist:     European.            (line 137)
-* LaTeX-clean-intermediate-suffixes:     Cleaning.            (line   7)
-* LaTeX-clean-output-suffixes:           Cleaning.            (line   7)
-* LaTeX-command:                         Processor Options.   (line  83)
-* LaTeX-csquotes-close-quote:            Quotes.              (line  44)
-* LaTeX-csquotes-open-quote:             Quotes.              (line  44)
-* LaTeX-csquotes-quote-after-quote:      Quotes.              (line  44)
-* LaTeX-default-environment:             Environments.        (line  35)
-* LaTeX-default-format:                  Tabular-like.        (line  11)
-* LaTeX-default-position:                Tabular-like.        (line  14)
-* LaTeX-enable-toolbar:                  Processing.          (line  11)
-* LaTeX-eqnarray-label:                  Equations.           (line  13)
-* LaTeX-equation-label:                  Equations.           (line  10)
-* LaTeX-figure-label:                    Floats.              (line  25)
-* LaTeX-fill-break-at-separators:        Filling.             (line 104)
-* LaTeX-fill-break-before-code-comments: Filling.             (line 114)
-* LaTeX-float:                           Floats.              (line  14)
-* LaTeX-fold-env-spec-list:              Folding.             (line 189)
-* LaTeX-fold-macro-spec-list:            Folding.             (line 189)
-* LaTeX-fold-math-spec-list:             Folding.             (line 189)
-* LaTeX-font-list:                       Font Specifiers.     (line  59)
-* LaTeX-indent-environment-check:        Indenting.           (line  51)
-* LaTeX-indent-environment-list:         Indenting.           (line  37)
-* LaTeX-indent-level:                    Indenting.           (line  19)
-* LaTeX-item-indent:                     Indenting.           (line  19)
-* LaTeX-item-regexp:                     Indenting.           (line  19)
-* LaTeX-math-abbrev-prefix:              Mathematics.         (line  27)
-* LaTeX-math-list:                       Mathematics.         (line  37)
-* LaTeX-math-menu-unicode:               Mathematics.         (line  55)
-* LaTeX-Omega-command:                   Processor Options.   (line  83)
-* LaTeX-paragraph-commands:              Filling.             (line  55)
-* LaTeX-section-hook:                    Sectioning.          (line  50)
-* LaTeX-section-label:                   Sectioning.          (line  53)
-* LaTeX-syntactic-comments:              Indenting.           (line  63)
-* LaTeX-table-label:                     Floats.              (line  25)
-* LaTeX-top-caption-list:                Floats.              (line  20)
-* LaTeX-verbatim-environments:           Verbatim content.    (line  10)
-* LaTeX-verbatim-macros-with-braces:     Verbatim content.    (line  10)
-* LaTeX-verbatim-macros-with-delims:     Verbatim content.    (line  10)
-* plain-TeX-auto-regexp-list:            Parsing Files.       (line 106)
-* plain-TeX-clean-intermediate-suffixes: Cleaning.            (line   7)
-* plain-TeX-clean-output-suffixes:       Cleaning.            (line   7)
-* plain-TeX-enable-toolbar:              Processing.          (line  11)
-* TeX-auto-cleanup-hook:                 Hacking the Parser.  (line 101)
-* TeX-auto-empty-regexp-list:            Parsing Files.       (line  94)
-* TeX-auto-full-regexp-list:             Parsing Files.       (line 109)
-* TeX-auto-global:                       Automatic Global.    (line  26)
-* TeX-auto-local:                        Automatic Local.     (line  23)
-* TeX-auto-parse-length:                 Parsing Files.       (line  88)
-* TeX-auto-prepare-hook:                 Hacking the Parser.  (line  98)
-* TeX-auto-private:                      Automatic Private.   (line  20)
-* TeX-auto-regexp-list <1>:              Hacking the Parser.  (line  79)
-* TeX-auto-regexp-list:                  Parsing Files.       (line  85)
-* TeX-auto-save:                         Parsing Files.       (line  41)
-* TeX-auto-untabify:                     Parsing Files.       (line  58)
-* TeX-brace-indent-level:                Indenting.           (line 103)
-* TeX-check-path:                        Selecting a Command. (line  56)
-* TeX-clean-confirm:                     Cleaning.            (line  27)
-* TeX-close-quote:                       Quotes.              (line  26)
-* TeX-command:                           Processor Options.   (line  83)
-* TeX-command-default:                   Selecting a Command. (line  43)
-* TeX-command-list <1>:                  Selecting a Command. (line  14)
-* TeX-command-list:                      Starting a Command.  (line  16)
-* TeX-default-macro:                     Completion.          (line  52)
-* TeX-default-mode:                      Japanese.            (line   6)
-* TeX-display-help:                      Debugging.           (line  31)
-* TeX-DVI-via-PDFTeX:                    Processor Options.   (line  22)
-* TeX-electric-escape:                   Completion.          (line  59)
-* TeX-electric-sub-and-superscript:      Mathematics.         (line  69)
-* TeX-engine:                            Processor Options.   (line  67)
-* TeX-engine-alist:                      Processor Options.   (line  83)
-* TeX-engine-alist-builtin:              Processor Options.   (line  83)
-* TeX-expand-list:                       Selecting a Command. (line  14)
-* TeX-file-recurse:                      Automatic.           (line  46)
-* TeX-fold-command-prefix:               Folding.             (line 137)
-* TeX-fold-env-spec-list:                Folding.             (line 180)
-* TeX-fold-force-fontify:                Folding.             (line  64)
-* TeX-fold-help-echo-max-length:         Folding.             (line 217)
-* TeX-fold-macro-spec-list:              Folding.             (line 147)
-* TeX-fold-math-spec-list:               Folding.             (line 187)
-* TeX-fold-preserve-comments:            Folding.             (line  72)
-* TeX-fold-type-list:                    Folding.             (line  59)
-* TeX-fold-unspec-env-display-string:    Folding.             (line 200)
-* TeX-fold-unspec-macro-display-string:  Folding.             (line 196)
-* TeX-fold-unspec-use-name:              Folding.             (line 204)
-* TeX-font-list:                         Font Specifiers.     (line  50)
-* TeX-header-end:                        Starting a Command.  (line  32)
-* TeX-ignore-file:                       Automatic.           (line  54)
-* TeX-insert-braces:                     Completion.          (line  77)
-* TeX-insert-macro-default-style:        Completion.          (line  38)
-* TeX-install-font-lock:                 Font Locking.        (line  14)
-* TeX-interactive-mode:                  Processor Options.   (line  29)
-* TeX-language-bg-hook:                  European.            (line  53)
-* TeX-language-cz-hook:                  European.            (line  53)
-* TeX-language-de-hook:                  European.            (line  53)
-* TeX-language-dk-hook:                  European.            (line  53)
-* TeX-language-is-hook:                  European.            (line  53)
-* TeX-language-it-hook:                  European.            (line  53)
-* TeX-language-nl-hook:                  European.            (line  53)
-* TeX-language-pl-hook:                  European.            (line  53)
-* TeX-language-sk-hook:                  European.            (line  53)
-* TeX-language-sv-hook:                  European.            (line  53)
-* TeX-macro-global <1>:                  Automatic Global.    (line  17)
-* TeX-macro-global:                      Customizing.         (line  20)
-* TeX-macro-private:                     Automatic Private.   (line  13)
-* TeX-master <1>:                        Multifile.           (line  42)
-* TeX-master:                            Starting a Command.  (line  16)
-* TeX-math-close-double-dollar:          Quotes.              (line  72)
-* TeX-newline-function:                  Indenting.           (line  29)
-* TeX-Omega-command:                     Processor Options.   (line  83)
-* TeX-one-master:                        Multifile.           (line  57)
-* TeX-open-quote:                        Quotes.              (line  22)
-* TeX-outline-extra:                     Outline.             (line  14)
-* TeX-output-view-style:                 Starting Viewers.    (line 100)
-* TeX-parse-self:                        Parsing Files.       (line  38)
-* TeX-PDF-mode:                          Processor Options.   (line  15)
-* TeX-quote-after-quote:                 Quotes.              (line  30)
-* TeX-quote-language-alist:              European.            (line 124)
-* TeX-region:                            Starting a Command.  (line  32)
-* TeX-save-query:                        Multifile.           (line 102)
-* TeX-show-compilation:                  Processor Options.   (line 110)
-* TeX-source-correlate-method:           Processor Options.   (line  47)
-* TeX-source-correlate-mode:             Processor Options.   (line  36)
-* TeX-source-correlate-start-server:     I/O Correlation.     (line  26)
-* TeX-style-global:                      Automatic Global.    (line  20)
-* TeX-style-local:                       Automatic Local.     (line  17)
-* TeX-style-path:                        Automatic.           (line  39)
-* TeX-style-private:                     Automatic Private.   (line  29)
-* TeX-trailer-start:                     Starting a Command.  (line  32)
-* TeX-view-predicate-list:               Starting Viewers.    (line  58)
-* TeX-view-program-list:                 Starting Viewers.    (line  67)
-* TeX-view-program-selection:            Starting Viewers.    (line  38)
-* TeX-view-style:                        Starting Viewers.    (line 109)
-* Texinfo-clean-intermediate-suffixes:   Cleaning.            (line   7)
-* Texinfo-clean-output-suffixes:         Cleaning.            (line   7)
+* Texinfo-mark-environment:              Marking (Texinfo).   (line  25)
+* Texinfo-mark-node:                     Marking (Texinfo).   (line  34)
+* Texinfo-mark-section:                  Marking (Texinfo).   (line   7)
 
index 87100321e72816376103d25beeb5b655f6d36947..beb29980aad76c3d7c5529226d1a3bceb6cd4a71 100644 (file)
Binary files a/packages/auctex/auctex.info-2 and b/packages/auctex/auctex.info-2 differ
index c331cc82146ccb13e2005418e50f0cdd00cf2335..aba1d8c255e3145310c7ad2a685dd64be1737295 100644 (file)
   :group 'ConTeXt-en-environment
   :type 'string)
 
+(defvar ConTeXt-extra-paragraph-commands-en
+  '("crlf" "par" "place[A-Za-z]+")
+  "List of ConTeXt macros that should have their own line.
+That is, besides the section(-block) commands.")
 
 ;; Emacs en menu names and labels should go here
 ;; to be done
index 9369d0ee37fdcb7fdc5c46f41c49236f9b8e208e..9ddebe9abb8d3c4b22c34bd31298733def104b09 100644 (file)
     "voet" "voetnootdefinitie" "voetnoten" "voetteksten" "witruimte")
   "List of the names of ConTeXt nl interface macro's that setup things.")
 
+;; referencing in ConTeXt
+(defvar ConTeXt-referencing-list-nl
+  '("in" "op" "over" "paginareferentie" "tekstreferentie" "referentie")
+  "List of ConTeXt en macro's that are used for referencing."
+)
+
 (defvar ConTeXt-other-macro-list-nl
   '("regellinks" "regelmidden" "regelrechts" "toonexternefiguren")
   "List of ConTeXt nl interface macro's that are not an environment nor a setup.")
   :group 'ConTeXt-nl-environment
   :type 'string)
 
+(defvar ConTeXt-extra-paragraph-commands-nl
+  '("crlf" "par" "plaats[A-Za-z]+")
+  "List of ConTeXt macros that should have their own line.
+That is, besides the section(-block) commands.")
 
 ;; Emacs en menu names and labels should go here
 ;; to be done
index f7042a69fb14aa1c23bc9de492f6f2d9431cd4ce..6dff15e593e077dd66b58c7333b2a19a28f1f391 100644 (file)
@@ -1,6 +1,7 @@
 ;;; context.el --- Support for ConTeXt documents.
 
-;; Copyright (C) 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Free Software
+;;   Foundation, Inc.
 
 ;; Maintainer: Berend de Boer <berend@pobox.com>
 ;; Keywords: tex
@@ -51,8 +52,8 @@
 
 (require 'tex-buf)
 (require 'tex)
-;; need functions like TeX-look-at and LaTeX-split-long-menu
-(require 'latex)
+(require 'latex) ; for functions like `TeX-look-at' and `LaTeX-split-long-menu'
+(require 'plain-tex) ; for `plain-TeX-common-initialization'
 
 (defgroup ConTeXt-macro nil
   "Special support for ConTeXt macros in AUCTeX."
@@ -904,10 +905,6 @@ If OPTIONAL, only insert it if not empty, and then use square brackets."
 (defvar ConTeXt-item-list ()
   "List of macro's considered items.")
 
-(defvar ConTeXt-extra-paragraph-commands
-  '("crlf" "par")
-  "List of ConTeXt macros that should have their own line besides the section(-block) commands.")
-
 (defun ConTeXt-paragraph-commands-regexp ()
   "Return a regexp matching macros that should have their own line."
   (concat
@@ -1065,7 +1062,7 @@ An optional fourth (or sixth) element means always replace if t."
 (defvar ConTeXt-indent-arg 2)
 (defvar ConTeXt-indent-basic 2)
 (defvar ConTeXt-indent-item ConTeXt-indent-basic)
-(defvar ConTeXt-indent-item-re "\\\\\item\\>")
+(defvar ConTeXt-indent-item-re "\\\\\\(item\\|sym\\)\\>")
 
 (defvar ConTeXt-indent-syntax-table (make-syntax-table TeX-mode-syntax-table)
   "Syntax table used while computing indentation.")
@@ -1486,7 +1483,7 @@ else.  There might be text before point."
 (defun ConTeXt-expand-options ()
   "Expand options for texexec command."
   (concat
-   (let ((engine (nth 4 (assq TeX-engine (TeX-engine-alist)))))
+   (let ((engine (eval (nth 4 (assq TeX-engine (TeX-engine-alist))))))
      (when engine
        (format "--engine=%s " engine)))
    (unless (eq ConTeXt-current-interface "en")
@@ -1505,10 +1502,16 @@ else.  There might be text before point."
 ;; They are mapped to interface specific variables
 
 (defvar ConTeXt-language-variable-list
-  '(ConTeXt-define-list ConTeXt-setup-list ConTeXt-referencing-list ConTeXt-other-macro-list
-          ConTeXt-project-structure-list
-          ConTeXt-section-block-list ConTeXt-section-list
-                      ConTeXt-text ConTeXt-item-list))
+  '(ConTeXt-define-list
+    ConTeXt-setup-list
+    ConTeXt-referencing-list
+    ConTeXt-other-macro-list
+    ConTeXt-project-structure-list
+    ConTeXt-section-block-list
+    ConTeXt-section-list
+    ConTeXt-text
+    ConTeXt-item-list
+    ConTeXt-extra-paragraph-commands))
 
 (defcustom ConTeXt-clean-intermediate-suffixes
   ;; See *suffixes in texutil.pl.
@@ -1530,6 +1533,8 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
   :type '(repeat regexp)
   :group 'TeX-command)
 
+(TeX-abbrev-mode-setup context-mode)
+
 (defun ConTeXt-mode-common-initialization ()
   "Initialization code that is common for all ConTeXt interfaces."
   ;; `plain-TeX-common-initialization' kills all local variables, but
@@ -1541,6 +1546,8 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
     (setq ConTeXt-current-interface save-ConTeXt-current-interface))
   (setq major-mode 'context-mode)
 
+  (setq local-abbrev-table context-mode-abbrev-table)
+
   ;; Make language specific variables buffer local
   (dolist (symbol ConTeXt-language-variable-list)
     (make-variable-buffer-local symbol))
@@ -1550,6 +1557,8 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
     (set symbol (symbol-value (intern (concat (symbol-name symbol) "-"
                                              ConTeXt-current-interface)))))
 
+  ;; Create certain regular expressions based on language
+  (setq ConTeXt-indent-item-re (concat "\\\\\\(" (mapconcat 'identity ConTeXt-item-list "\\|") "\\)\\>"))
 
   ;; What's the deepest level at we can collapse a document?
   ;; set only if user has not set it. Need to be set before menu is created.
index 848cf8fd8cbe85d6ce53a2f8f72338585460245c..463c41a46eb65b66a8630e1f371a48351be08835 100644 (file)
@@ -13,7 +13,7 @@ This manual is for @AUCTeX{}
 a sophisticated TeX environment for Emacs.
 
 Copyright @copyright{} 1992, 1993, 1994, 1995, 2001, 2002, 2004, 2005,
-2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -126,7 +126,7 @@ sending ``subscribe'' in the subject of a mail to
 * Display::                     Controlling Screen Display
 * Processing::                  Starting Processors, Viewers and Other Programs
 * Customization::               Customization and Extension
-* Appendices::                  Copying, Changes, Development, FAQ
+* Appendices::                  Copying, Changes, Development, FAQ, Texinfo mode
 * Indices::                     Indices
 
 @detailmenu
@@ -220,6 +220,7 @@ Copying, Changes, Development, FAQ
 * Changes::                     
 * Development::                 
 * FAQ::                         
+* Texinfo mode::                
 
 Copying this Manual
 
@@ -320,6 +321,7 @@ indenting and filling and for navigating through the document.
 * Environments::                Inserting Environment Templates
 * Mathematics::                 Entering Mathematics
 * Completion::                  Completion of macros
+* Marking::                     Marking Environments, Sections, or Texinfo Nodes
 * Commenting::                  Commenting text
 * Indenting::                   Reflecting syntactic constructs with whitespace
 * Filling::                     Automatic and manual line breaking
@@ -478,7 +480,7 @@ Insert roman @r{\textrm@{@point{}@}} text.
 @item C-c C-f C-f
 @kindex C-c C-f C-f
 @cindex @code{\textsf}
-Insert @sans{sans serif} @samp{\textsf@{@point{}@}} text.
+Insert @sansserif{sans serif} @samp{\textsf@{@point{}@}} text.
 
 @item C-c C-f C-t
 @kindex C-c C-f C-t
@@ -1050,6 +1052,85 @@ the Bib@TeX{} files have been saved at least once after you enabled
 automatic parsing on save, and that the basename of the Bib@TeX{} file
 does not conflict with the basename of one of @TeX{} files.
 
+@node Marking
+@section Marking Environments, Sections, or Texinfo Nodes
+
+You can mark the current environment by typing @kbd{C-c .}, or the
+current section by typing @kbd{C-c *}.
+
+In Texinfo documents you can type @kbd{M-C-h} to mark the current node.
+
+When the region is set, the point is moved to its beginning and the mark
+to its end.
+
+@menu
+* Marking (LaTeX):: LaTeX Commands for Marking Environments and Sections
+* Marking (Texinfo):: Texinfo Commands for Marking Environments, Sections, and Nodes
+@end menu
+
+@node Marking (LaTeX)
+@subsection LaTeX Commands for Marking Environments and Sections
+
+@deffn Command LaTeX-mark-section
+@kindex C-c *
+(@kbd{C-c *}) Set mark at end of current logical section, and point at
+top.
+
+With a non-nil prefix argument, mark only the region from the current
+section start to the next sectioning command.  Thereby subsections are
+not being marked.  Otherwise, any included subsections are also marked
+along with current section.
+@end deffn
+
+@deffn Command LaTeX-mark-environment
+@kindex C-c .
+(@kbd{C-c .}) Set mark to the end of the current environment and point
+to the matching beginning.
+
+If a prefix argument is given, mark the respective number of enclosing
+environments.  The command will not work properly if there are
+unbalanced begin-end pairs in comments and verbatim environments.
+@end deffn
+
+@node Marking (Texinfo)
+@subsection Texinfo Commands for Marking Environments and Sections
+
+@deffn Command Texinfo-mark-section
+@kindex C-c *
+(@kbd{C-c *}) Mark the current section, with inclusion of any containing
+node.
+
+The current section is detected as starting by any of the structuring
+commands matched by the regular expression in the variable
+@code{outline-regexp} which in turn is a regular expression matching any
+element of the variable @code{texinfo-section-list}.
+
+With a non-nil prefix argument, mark only the region from the current
+section start to the next sectioning command.  Thereby subsections are
+not being marked.  Otherwise, any included subsections are also marked
+
+Note that when the current section is starting immediately after a node
+command, then the node command is also marked as part of the section.
+@end deffn
+
+@deffn Command Texinfo-mark-environment
+@kindex C-c .
+(@kbd{C-c .}) Set mark to the end of the current environment and point
+to the matching beginning.
+
+If a prefix argument is given, mark the respective number of enclosing
+environments.  The command will not work properly if there are
+unbalanced begin-end pairs in comments and verbatim environments.
+@end deffn
+
+@deffn Command Texinfo-mark-node
+@kindex M-C-h
+(@kbd{M-C-h}) Mark the current node.  This is the node in which point is
+located.  It is starting at the previous occurrence of the keyword
+@code{@@node} and ending at next occurrence of the keywords
+@code{@@node} or @code{@@bye}.
+@end deffn
+
 @node Commenting
 @section Commenting
 
@@ -2337,6 +2418,14 @@ The default command to run in this buffer.  Must be an entry in
 @code{TeX-command-list}.
 @end defopt
 
+@cindex Biber
+@cindex biblatex
+@vindex LaTeX-biblatex-use-Biber
+In case you use biblatex in a document, @AUCTeX{} switches from
+Bib@TeX{} to Biber for bibliography processing.  In case you want to
+keep using Bib@TeX{}, set the variable @code{LaTeX-biblatex-use-Biber}
+to nil.
+
 After confirming a command to execute, @AUCTeX{} will try to save any
 buffers related to the document, and check if the document needs to be
 reformatted.  If the variable @code{TeX-save-query} is non-nil,
@@ -3534,7 +3623,7 @@ recurse, a positive integer means go that far deep in the directory
 hierarchy, t means recurse indefinitely.
 @end defopt
 
-By default, @AUCTeX{} will ignore files name @file{.}, @file{..},
+By default, @AUCTeX{} will ignore files named @file{.}, @file{..},
 @file{SCCS}, @file{RCS}, and @file{CVS}.
 
 @defopt TeX-ignore-file
@@ -3697,17 +3786,22 @@ Here is a simple example of a style file.
    (LaTeX-largest-level-set "chapter")))
 @end lisp
 
-This file specifies that the largest kind of section in a @LaTeX{} document
-using the book document style is chapter.  The interesting thing to
-notice is that the style file defines an (anonymous) function, and adds it
-to the list of loaded style hooks by calling @code{TeX-add-style-hook}.
+The example is from the @AUCTeX{} sources and is loaded for any @LaTeX{}
+document using the book document class (or style before @LaTeX{}2e).
+The file specifies that the largest kind of section in such a document
+is chapter.  The interesting thing to notice is that the style file
+defines an (anonymous) function, and adds it to the list of loaded style
+hooks by calling @code{TeX-add-style-hook}.
 
-The first time the user indirectly tries to access some style specific
+The first time the user indirectly tries to access some style-specific
 information, such as the largest sectioning command available, the style
 hooks for all files directly or indirectly read by the current document
-is executed.  The actual files will only be evaluated once, but the
+are executed.  The actual files will only be evaluated once, but the
 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.
+
 @defun TeX-add-style-hook @var{style} @var{hook}
 Add @var{hook} to the list of functions to run when we use the @TeX{}
 file @var{style}.
@@ -3774,7 +3868,10 @@ You can use the following types of specifiers for arguments:
 Use the string as a prompt to prompt for the argument.
 
 @item number
-Insert that many braces, leave point inside the first.
+Insert that many braces, leave point inside the first.  0 and -1 are
+special.  0 means that no braces are inserted.  -1 means that braces are
+inserted around the macro and an active region (e.g. @samp{@{\tiny
+foo@}}).  If there is no active region, no braces are inserted.
 
 @item nil
 Insert empty braces.
@@ -3842,8 +3939,11 @@ Prompt for a filename in the current directory, and use it without the
 extension.
 
 @item TeX-arg-input-file
+@vindex TeX-arg-input-file-search
 Prompt for the name of an input file in @TeX{}'s search path, and use it
-without the extension.  Run the style hooks for the file.
+without the extension.  Run the style hooks for the file.  (Note that
+the behavior (type of prompt and inserted file name) of the function can
+be controlled by the variable @code{TeX-arg-input-file-search}.)
 
 @item TeX-arg-define-label
 Prompt for a label completing with known labels.  Add label to list of
@@ -4172,13 +4272,14 @@ List of functions to be called after parsing a @TeX{} file.
 @end defvar
 
 @node Appendices
-@appendix Copying, Changes, Development, FAQ
+@appendix Copying, Changes, Development, FAQ, Texinfo Mode
 
 @menu
 * Copying this Manual::         
 * Changes::                     
 * Development::                 
 * FAQ::                         
+* Texinfo mode::                
 @end menu
 
 @node Copying this Manual
@@ -4224,6 +4325,201 @@ See the file @file{history.texi} for older changes.
 @include faq.texi
 @raisesections
 
+@node Texinfo mode
+@appendixsec Features specific to @AUCTeX{}'s Texinfo major mode
+
+@AUCTeX{} includes a major mode for editting Texinfo files.  This major
+mode is not the same mode as the native Texinfo mode (@pxref{(texinfo)
+Texinfo Mode}) of Emacs, although they have the same name.  However,
+@AUCTeX{} still relies on a number of functions from the native Texinfo
+mode.
+
+The following text describes which functionality is offered by @AUCTeX{}
+and which by the native Texinfo mode.  This should enable you to decide
+when to consult the @AUCTeX{} manual and when the manual of the native
+mode.  And in case you are a seasoned user of the native mode, the
+information should help you to swiftly get to know the
+@AUCTeX{}-specific commands.
+
+@menu
+* Exploiting::                  How @AUCTeX{} and the native mode work together
+* Superseding::                 Where the native mode is superseded
+* Mapping::                     Where key bindings are mapped to the native mode
+* Unbinding::                   Which native mode key bindings are missing
+@end menu
+
+@node Exploiting
+@appendixsubsec How @AUCTeX{} and the native mode work together
+
+In a nutshell the split between @AUCTeX{} Texinfo mode, and native
+Texinfo mode is as follows:
+
+@itemize
+@item
+Most of the editing (environment creation, commenting, font command
+insertions) and/or processing commands (e.g. compiling or printing)
+which are available in other @AUCTeX{} modes are also handled by
+@AUCTeX{} in Texinfo mode.
+
+@item
+Texinfo-related features (e.g. info node linkage or menu creation) rely
+on the commands provided by the native Texinfo mode.  @AUCTeX{} provides
+the key bindings to reach these functions, keeping the same keys as in
+native Texinfo whenever possible, or similar ones otherwise.
+@end itemize
+
+@node Superseding
+@appendixsubsec Where the native mode is superseded
+
+This section is directed to users of the native Texinfo mode switching
+to @AUCTeX{}.  It follows the summary of the native mode
+(@pxref{(texinfo) Texinfo Mode Summary}) and lists which of its commands
+are no longer of use.
+
+@table @asis
+@item Insert commands
+In the native Texinfo mode, frequently used Texinfo commands can be
+inserted with key bindings of the form @kbd{C-c C-c @var{k}} where
+@var{k} differs for each Texinfo command; @kbd{c} inserts @@code,
+@kbd{d} inserts @@dfn, @kbd{k} @@kbd, etc.
+
+In @AUCTeX{} commands are inserted with the key binding @kbd{C-c C-m}
+instead which prompts for the macro to be inserted.  For font selection
+commands (like @@b, @@i, or @@emph) and a few related ones (like @@var,
+@@key or @@code) there are bindings which insert the respective macros
+directly.  They have the form @code{C-c C-f @var{k}} or @code{C-c C-f
+C-@var{k}} and call the function @code{TeX-font}.  Type @kbd{C-c C-f
+@key{RET}} to get a list of supported commands.
+
+Note that the prefix argument is not handled the same way by @AUCTeX{}.
+Note also that the node insertion command from the native mode
+(@code{texinfo-insert-@@node}) can still accessed from the Texinfo menu
+in @AUCTeX{}.
+
+@item Insert braces
+In @AUCTeX{} braces can be inserted with the same key binding as in the
+native Texinfo mode: @kbd{C-c @{}.  But @AUCTeX{} uses its own function
+for the feature: @code{TeX-insert-braces}.
+
+@item Insert environments
+The native Texinfo mode does not insert full environments.  Instead, it
+provides the function @code{texinfo-insert-@@end} (mapped to @kbd{C-c
+C-c e}) for closing an open environment with a matching @@end statement.
+
+In @AUCTeX{} you can insert full environments, i.e. both the opening and
+closing statements, with the function @code{Texinfo-environment} (mapped
+to @kbd{C-c C-e}).
+
+@item Format info files with makeinfo and @TeX{}
+In the native Texinfo mode there are various functions and bindings to
+format a region or the whole buffer for info or to typeset the
+respective text.  For example, there is @code{makeinfo-buffer} (mapped
+to @kbd{C-c C-m C-b}) which runs @samp{makeinfo} on the buffer or there
+is @code{texinfo-tex-buffer} (mapped to @kbd{C-c C-t C-b}) which runs
+@TeX{} on the buffer in order to produce a @acronym{DVI} file.
+
+In @AUCTeX{} different commands for formatting or typesetting can be
+invoked through the function @code{TeX-command-master} (mapped to
+@kbd{C-c C-c}).  After typing @kbd{C-c C-c}, you can select the desired
+command, e.g @samp{Makeinfo} or @samp{TeX}, through a prompt in the mini
+buffer.  Note that you can make, say @samp{Makeinfo}, the default by
+adding this statement in your init file:
+
+@lisp
+(add-hook 'Texinfo-mode-hook 
+          (lambda () (setq TeX-command-default "Makeinfo")))
+@end lisp
+
+Note also that @kbd{C-c C-c Makeinfo @key{RET}} is not completely
+functionally equivalent to @code{makeinfo-buffer} as the latter will
+display the resulting info file in Emacs, showing the node corresponding
+to the position in the source file, just after a successful compilation.
+This is why, while using @AUCTeX{}, invoking @code{makeinfo-buffer}
+might still be more convenient.
+
+Note also that in the case of a multifile document, @kbd{C-c C-c} in
+@AUCTeX{} will work on the whole document (provided that the file
+variable @code{TeX-master} is set correctly), while
+@code{makeinfo-buffer} in the native mode will process only the current
+buffer, provided at the @code{@@setfilename} statement is provided.
+
+@item Produce indexes and print
+The native Texinfo mode provides the binding @kbd{C-c C-t C-i}
+(@code{texinfo-texindex}) for producing an index and the bindings
+@kbd{C-c C-t C-p} (@code{texinfo-tex-print}) and @kbd{C-c C-t C-q}
+(@code{tex-show-print-queue}) for printing and showing the printer
+queue.  These are superseded by the respective commands available
+through @kbd{C-c C-c} (@code{TeX-command-master}) in @AUCTeX{}: Index,
+Print, and Queue.
+
+@item Kill jobs
+The command @kbd{C-c C-t C-k} (@code{tex-kill-job}) in the native mode
+is superseded by @kbd{C-c C-k} (@code{TeX-kill-job}) in @AUCTeX{}.
+@end table
+
+@node Mapping
+@appendixsubsec Where key bindings are mapped to the native mode
+
+This node follows the native Texinfo mode summary (@pxref{(texinfo)
+Texinfo Mode Summary}) and lists only those commands to which @AUCTeX{}
+provides a keybinding.
+
+Basically all commands of the native mode related to producing menus and
+interlinking nodes are mapped to same or similar keys in @AUCTeX{},
+while a few insertion commands are mapped to @AUCTeX{}-like keys.
+
+@table @asis
+
+@item @code{@@item} insertion
+The binding @kbd{C-c C-c i} for the insertion of @code{@@item} in the
+native mode is mapped to @kbd{M-@key{RET}} or @kbd{C-c C-j} in
+@AUCTeX{}, similar to other @AUCTeX{} modes.
+
+@item @code{@@end} insertion
+The binding @kbd{C-c C-c e} for closing a @code{@@@var{foo}} command by
+a corresponding @code{@@end @var{foo}} statement in the native mode is
+mapped to @kbd{C-c C-]} in @AUCTeX{}, similar to other @AUCTeX{} modes.
+
+@item Move out of balanced braces
+The binding @kbd{C-@}} (@code{up-list}) is available both in the native
+mode and in @AUCTeX{}.  (This is because the command is not implemented
+in either mode but a native Emacs command.)  However, in @AUCTeX{}, you
+cannot use @kbd{C-]} for this, as it is used for @code{@@end} insertion.
+
+@item Update pointers
+The bindings @kbd{C-c C-u C-n} (@code{texinfo-update-node}) and @kbd{C-c
+C-u C-e} (@code{texinfo-every-node-update}) from the native mode are
+available in @AUCTeX{} as well.
+
+@item Update menus
+The bindings @kbd{C-c C-u m} (@code{texinfo-master-menu}), @kbd{C-c C-u
+C-m} (@code{texinfo-make-menu}), and @kbd{C-c C-u C-a}
+(@code{texinfo-all-menus-update}) from the native mode are available in
+@AUCTeX{} as well.  The command @code{texinfo-start-menu-description},
+bound to @kbd{C-c C-c C-d} in the native mode, is bound to @kbd{C-c C-u
+C-d} in @AUCTeX{} instead.
+@end table
+
+@node Unbinding
+@appendixsubsec Which native mode key bindings are missing
+
+The following commands from the native commands might still be useful
+when working with @AUCTeX{}, however, they are not accessible with a
+key binding any longer.
+
+@table @asis
+@item @code{@@node} insertion
+The node insertion command, mapped to @kbd{C-c C-c n} in the native
+mode, is not mapped to any key in @AUCTeX{}.  You can still access it
+through the Texinfo menu, though.  Another alternative is to use the
+@kbd{C-c C-m} binding for macro insertion in @AUCTeX{}.
+
+@item Show the section structure
+The command @code{texinfo-show-structure} (@kbd{C-c C-s}) from the
+native mode does not have a key binding in @AUCTeX{}.  The binding is
+used by @AUCTeX{} for sectioning.
+@end table
+
 @node Indices
 @unnumbered Indices
 
index 0f429271bb97dc98de81de43eedd4cd0d870a343..8f5e8d91f2225d7241190d8f9eae9b912e0fe6b7 100644 (file)
@@ -1,6 +1,7 @@
 @c This is part of the AUCTeX manual.
 @c Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-@c   2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+@c   2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Free Software
+@c   Foundation, Inc.
 @c See file auctex.texi for copying conditions.
 @include macros.texi
 @ifset rawfile
@@ -8,6 +9,38 @@
 
 @end ifset
 
+@heading News since 11.87
+
+@itemize @bullet
+@item
+@AUCTeX{} now supports Biber in conjunction with biblatex in addition to
+BibTeX.
+
+@item
+Each @AUCTeX{} mode now has its own abbrev table.  On Emacsen which
+provide the possibility to inherit abbrevs from other tables, the
+abbrevs from the Text mode abbrev table are available as well.  Newly
+defined abbrevs are written to the mode-specific tables, though.
+
+@item
+The file @samp{tex-fptex.el} was removed.
+
+@item
+Forward/backward search for Evince has been improved.  If Emacs is
+compiled with DBUS support and a recent Evince version (3.x) is
+installed, the communication goes over the desktop bus instead of the
+command line, resulting in more accurate positioning of point in Emacs
+and highlighting of the target paragraph in Evince.
+
+@item
+A problem where Ghostscript threw an /invalidfileaccess error when
+running @previewlatex{} was fixed.
+
+@item
+A lot of smaller fixes and additions have been made.
+@end itemize
+
+
 @heading News in 11.86
 
 @itemize @bullet
index 60484325d6762e4d637b91493808be19f95b8350..f634560ce50a77161613714c77a5d762a7e8f620 100644 (file)
@@ -1,3 +1,6 @@
+@c This is part of the AUCTeX Manual.
+@c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+@c See the file auctex.texi for copying conditions.
 @ifset rawfile
 @include macros.texi
 @chapheading Frequently Asked Questions about @AUCTeX{}
@@ -25,7 +28,7 @@ But before you do this, you can try to get more information about the
 problem at hand which might also help you locate the cause of the error
 yourself.
 
-First, you can try to generate a so-called backtrace which shows
+First, you can try to generate a so-called backtrace which shows the
 functions involved in a program error.  In order to do this, start Emacs
 with the command line @samp{emacs --debug-init} and/or put the line
 
@@ -42,15 +45,9 @@ it in the bug report.
 Second, you can try to figure out if something in your personal or site
 configuration triggers the error by starting Emacs without such
 customizations.  You can do this by invoking Emacs with the command line
-@samp{emacs -q -no-site-file}.  Once Emacs is running, copy the line
-
-@lisp
-(load "auctex.el" nil t t)
-@end lisp
-
-into the @samp{*scratch*} buffer and type @kbd{M-x eval-buffer RET}.
-This makes sure that @AUCTeX{} will be used for the file types it
-supports.  After you have done so, you can load the file triggering the
+@samp{emacs -q -no-site-file -l auctex}.  The @samp{-l} option
+@samp{auctex.el} which you normally do in your init file.  After you
+have started Emacs like this, you can load the file triggering the
 error.  If everything is working now, you know that you have to search
 either in the site configuration file or your personal init file for
 statements related to the problem.
@@ -63,27 +60,17 @@ versions may work but are unsupported.  Older versions of XEmacs might
 possibly made to work by updating the @file{xemacs-base} package through
 the XEmacs package system.  If you are looking for a recommendation, it
 would appear that the smoothest working platform on all operating
-systems at the current point of time would be @w{Emacs 22.1}.  At the
-time of this writing, however, it has not been released and is still
-under development.  The quality of the development version is quite
-solid, so we recommend giving it a try.  With a developer version, of
-course, you have to be prepared to update in case you managed to get
-your snapshot at a bad time.  The second best choice would be the latest
-released @w{Emacs 21.4}.  However, Unicode support is less good, there
-is no version for the popular GTK toolkit, and the native versions for
-Windows and MacOS don't offer toolbar and @previewlatex{} support.
-
-Our success with XEmacs has been less than convincing.  Under the
-Windows operating system, nominally the only option for a released,
-stable Emacs variant supporting toolbars and @previewlatex{} would be
-@w{XEmacs 21.4}.  However, code for core functionality like formatting
-and syntax highlighting tends to be different and often older than even
-@w{Emacs 21.4}, and Unicode support as delivered is problematic at best,
-missing on Windows.  Both @AUCTeX{} and XEmacs developers don't hear
-much from active users of the combination.  Partly for that reason,
-problems tend to go unnoticed for long amounts of time and are often
-found, if at all, after releases.  No experiences or recommendations can
-be given for beta or developer versions of XEmacs.
+systems at the current point of time would be @w{Emacs 22} or higher.
+
+Our success with XEmacs has been less than convincing.  Code for core
+functionality like formatting and syntax highlighting tends to be
+different and often older than even @w{Emacs 21.4}, and Unicode support
+as delivered is problematic at best, missing on Windows.  Both @AUCTeX{}
+and XEmacs developers don't hear much from active users of the
+combination.  Partly for that reason, problems tend to go unnoticed for
+long amounts of time and are often found, if at all, after releases.  No
+experiences or recommendations can be given for beta or developer
+versions of XEmacs.
 
 @item
 What should I do when @code{./configure} does not find programs like latex?
@@ -138,6 +125,22 @@ loudly by opening a debugging buffer as soon as an error occurs.  The
 information in the debugging buffer can help you find the cause of the
 error in your init file.
 
+@item
+Why does @code{TeX-next-error} (@kbd{C-c `}) fail?
+
+When writing the log file, @TeX{} puts information related to a file,
+including error messages, between a pair of parentheses.  @AUCTeX{}
+determines the file where the error happened by parsing the log file and
+counting the parentheses.  This can fail when there are other,
+unbalanced parentheses present.
+
+As a workaround you can activate so-called file:line:error messages for
+the log file.  (Those are are easier to parse, but may lack some
+details.)  Either you do this in the configuration of your @TeX{} system
+(consult its manual to see where this is) or you add a command line
+switch to the (la)tex call, e.g. by customizing
+@code{LaTeX-command-style} or @code{TeX-command-list}.
+
 @item
 What does AUC stand for?
 
index f13798bbfd4ceb62eba47ea1a328a29f8f336cf9..851e6736d2750913d0632b38805d28b30fcdc2bb 100644 (file)
@@ -1,5 +1,5 @@
 @c This is part of the AUCTeX Manual.
-@c Copyright (C) 1994, 1996, 2003, 2004, 2005, 2006, 2007
+@c Copyright (C) 1994, 1996, 2003, 2004, 2005, 2006, 2007, 2012
 @c   Free Software Foundation, Inc.
 @c See the file auctex.texi for copying conditions.
 @ifset rawfile
 @chapter Installing @AUCTeX{}
 @end ifclear
 
+The simplest way of installing @AUCTeX{} is by using the Emacs package
+manager integrated in Emacs 24 and greater (@acronym{ELPA}).  Simply do
+@kbd{M-x package-list-packages RET}, mark the auctex package for
+installation with @kbd{i}, and hit @kbd{x} to execute the installation
+procedure.  That's all.
+
+The remainder of this section is about installing @AUCTeX{} from a
+release tarball or from a checkout of the @AUCTeX{} repository.
+
 Installing @AUCTeX{} should be simple: merely @command{./configure},
 @command{make}, and @code{make install} for a standard site-wide
 installation (most other installations can be done by specifying a
@@ -74,7 +83,7 @@ the file @file{INSTALL.windows}.
 version of @code{xemacs-base} older than 1.84 (released in sumo from
 02/02/2004).  Using @previewlatex{} requires a version of Emacs compiled
 with image support.  While the X11 version of @w{Emacs 21} will likely
-work, @w{Emacs 22} and later is the preferred platform.
+work, @w{Emacs 22} and later is preferred.
 
 @table @b
 @item Windows
@@ -84,8 +93,8 @@ Precompiled versions are available from
 For an overview of precompiled versions of Emacs for Mac OS X see for
 example @uref{http://www.emacswiki.org/cgi-bin/wiki/EmacsForMacOS}.
 @item GNU/Linux
-Most GNU/Linux distributions nowadays provide a variant of Emacs 22 or
-later via their package repositories.
+Most GNU/Linux distributions nowadays provide a recent variant of Emacs
+via their package repositories.
 @item Self-compiled
 Compiling Emacs yourself requires a C compiler and a number of tools and
 development libraries.  Details are beyond the scope of this manual.
index 36938ff391a71f97d0889ed2e48cf4dbad7d2e16..fdf37a07793afb9b583cfb1cb79dd46bc0d6a9d5 100644 (file)
@@ -7,9 +7,6 @@ AUC@TeX{}
 @macro ConTeXt {}
 Con@TeX{}t
 @end macro
-@macro LaTeX {}
-La@TeX{}
-@end macro
 @macro previewlatex {}
 preview-latex
 @end macro
@@ -41,7 +38,8 @@ font-latex
 @end macro
 @end ifset
 @end ifnottex
-@macro sans {text}@c
+@ifset no-sansserif
+@macro sansserif {text}@c
 @iftex
 {@textsf \text\}@c
 @end iftex
@@ -49,6 +47,7 @@ font-latex
 \text\@c
 @end ifnottex
 @end macro
+@end ifset
 @tex
 \global\let\savedTeX\TeX
 \gdef\TeX#1{\savedTeX#1}
index 35085be8b60395fe43f1b27bdc26d5ee6931446f..f66b914aa1d8a5c65dcbe211c4b36d5b5c3c534b 100644 (file)
@@ -702,8 +702,9 @@ customizable concerning aspects of that operation, see the customization
 group @code{Preview Gs} for this.
 
 Another noteworthy setting of @code{preview-image-type} is
-@samp{dvipng}: in this case, the @samp{dvipng}@pindex{dvipng} program
-will get run on @acronym{DVI} output (see below for @acronym{PDF}).
+@samp{dvipng}: in this case, the @samp{dvipng}
+@pindex dvipng 
+program will get run on @acronym{DVI} output (see below for @acronym{PDF}).
 This is in general much faster than Dvips and Ghostscript.  In that
 case, the option
 
index ceec41c49318a59495eae3faa78ac5b41d23d99a..e6fa66131315e3d4d3b2752912bdb42262d63787 100644 (file)
@@ -27,10 +27,14 @@ inserting
 
 in your user init file.@footnote{This usually is a file in your home
 directory called @file{.emacs} if you are utilizing GNU Emacs or
-@file{.xemacs/init.el} if you are using XEmacs.}  In order to get
-support for many of the @LaTeX{} packages you will use in your
-documents, you should enable document parsing as well, which can be
-achieved by putting
+@file{.xemacs/init.el} if you are using XEmacs.}  If you've installed
+@AUCTeX{} from the Emacs package manager (ELPA), you must not have this
+line in your user init file.  The installation procedure already cares
+about loading @AUCTeX{} correctly.
+
+In order to get support for many of the @LaTeX{} packages you will use
+in your documents, you should enable document parsing as well, which can
+be achieved by putting
 
 @lisp
 (setq TeX-auto-save t)
@@ -163,7 +167,7 @@ Insert roman @r{\textrm@{@point{}@}} text.
 @item C-c C-f C-f
 @kindex C-c C-f C-f
 @cindex @code{\textsf}
-Insert  @sans{sans serif} @samp{\textsf@{@point{}@}} text.
+Insert  @sansserif{sans serif} @samp{\textsf@{@point{}@}} text.
 
 @item C-c C-f C-t
 @kindex C-c C-f C-t
index 70eb7271ffe113006db8f250ab132271cd11eacd..f57c7e0fce65ddcb0ac3ad9974dc5549d2392f2d 100644 (file)
@@ -1,2 +1,2 @@
-@set VERSION 11.86
-@set UPDATED 2010-02-21
+@set VERSION 11.87
+@set UPDATED 2012-11-30
index 3aa93b23ef03d7ca5ea7329aff91669a7c02c304..38cb35eff3d5bad121db1fcec745b9ab35af66a1 100644 (file)
@@ -332,18 +332,13 @@ in either a site-wide @file{site-start.el} or your personal startup file
 @file{~/.xemacs/init.el} from within XEmacs).
 
 @cindex @file{tex-mik.el}
-@cindex @file{tex-fptex.el}
 The default configuration of @AUCTeX{} is probably not the best fit for
-Windows systems.  You might want to add
+Windows systems with MiK@TeX{}.  You might want to add
 @example
 (require 'tex-mik)
 @end example
-or
-@example
-(require 'tex-fptex)
-@end example
-in order to get more appropriate values for MiK@TeX{} and fp@TeX{},
-respectively after loading @file{auctex.el} and @file{preview-latex.el}.
+after loading @file{auctex.el} and @file{preview-latex.el} in order to
+get more appropriate values for some customization options.
 
 You can always use
 
index 2b146c7a6eee2bb6b3e474e2f6687be2465ea326..d14e8433e59ace13fc6ba61bb76235999167297f 100644 (file)
@@ -1,7 +1,7 @@
 ;;; font-latex.el --- LaTeX fontification for Font Lock mode.
 
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008 Free Software Foundation.
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Authors:    Peter S. Galbraith <psg@debian.org>
 ;;             Simon Marshall <Simon.Marshall@esrin.esa.it>
@@ -284,11 +284,43 @@ variable `font-latex-fontify-sectioning'." num)
       "appendix" "displaybreak" "allowdisplaybreaks" "include")
      'font-latex-warning-face 1 noarg)
     ("variable"
-     (("setlength" "|{\\{") ("settowidth" "|{\\{") ("setcounter" "{|{\\")
-      ("addtolength" "|{\\{") ("addtocounter" "{|{\\"))
+     (("setlength" "|{\\{") ("settowidth" "|{\\{") ("settoheight" "{{")
+      ("settodepth" "{{") ("setcounter" "{|{\\")
+      ("addtolength" "|{\\{") ("addtocounter" "{|{\\")
+      ("stepcounter" "{") ("refstepcounter" "{")
+      ("arabic" "{") ("roman" "{") ("Roman" "{") ("alph" "{") ("Alph" "{")
+      ("fnsymbol" "{"))
      'font-lock-variable-name-face 2 command)
+    ("biblatexnoarg"
+     ("newrefsegment" "mancite" "pno" "ppno" "nopp" "psq" "psqq")
+     'font-lock-variable-name-face 2 noarg)
+    ("biblatex"
+     (("newrefsection" "[") ("ExecuteBibliographyOptions" "[{")
+      ("printbibliography" "[") ("printshorthands" "[") ("printbibheading" "[")
+      ("addbibresource" "[{") ("addglobalbib" "[{") ("addsectionbib" "[{")
+      ("bibbysection" "[") ("bibbysegment" "[") ("bibbycategory" "[")
+      ("DeclareBibliographyCategory" "{") ("addtocategory" "{{") ("defbibenvironment" "{{{{")
+      ("defbibheading" "{[{") ("defbibnote" "{{") ("defbibfilter" "{{") ("defbibcheck" "{{")
+      ("defbibentryset" "{{") ("Cite" "[[{") ("parencite" "*[[{") ("Parencite" "[[{")
+      ("footcite" "[[{") ("footcitetext" "[[{") ("textcite" "[[{") ("Textcite" "[[{")
+      ("smartcite" "[[{") ("Smartcite" "[[{") ("supercite" "{") ("autocite" "*[{{")
+      ("Autocite" "*[{{") ("citeauthor" "[{{") ("Citeauthor" "[{{") ("citetitle" "*[{{")
+      ("citeyear" "*[[{") ("citedate" "*[[{") ("citeurl" "[[{") ("parentext" "{")
+      ("brackettext" "{") ("fullcite" "[[{") ("fullfootcite" "[[{") ("volcite" "[{[[")
+      ("Volcite" "[{[[") ("pvolcite" "[{[[") ("Pvolcite" "[{[[") ("fvolcite" "[{[[")
+      ("ftvolcite" "[{[[") ("svolcite" "[{[[") ("Svolcite" "[{[[") ("tvolcite" "[{[[")
+      ("Tvolcite" "[{[[") ("avolcite" "[{[[") ("Avolcite" "[{[[") ("notecite" "[[{")
+      ("Notecite" "[[{") ("pnotecite" "[[{") ("Pnotecite" "[[{") ("fnotecite" "[[{")
+      ("citename" "[[{[{") ("citelist" "[[{[{") ("citefield" "[[{[{") ("citereset" "*")
+      ("RN" "{") ("Rn" "{") ("DefineBibliographyStrings" "{{") ("DefineBibliographyExtras" "{{")
+      ("UndefineBibliographyExtras" "{{") ("DefineHyphenationExceptions" "{{")
+      ("NewBibliographyString" "{") ("autocites" "(([[{") ("Autocites" "(([[{")
+      ("cites" "(([[{") ("Cites" "(([[{") ("parencites" "(([[{") ("Parencites" "(([[{")
+      ("footcites" "(([[{") ("footcitetexts" "(([[{") ("smartcites" "(([[{")
+      ("Smartcites" "(([[{") ("textcites" "(([[{") ("Textcites" "(([[{") ("supercites" "(([[{"))
+     'font-lock-constant-face 2 command)
     ("reference"
-     (("nocite" "{") ("cite" "[{") ("label" "{") ("pageref" "{")
+     (("nocite" "*{") ("cite" "*[[{") ("label" "{") ("pageref" "{")
       ("vref" "{") ("eqref" "{") ("ref" "{") ("include" "{")
       ("input" "{") ("bibliography" "{") ("index" "{") ("glossary" "{")
       ("footnote" "[{") ("footnotemark" "[") ("footnotetext" "[{"))
@@ -297,12 +329,13 @@ variable `font-latex-fontify-sectioning'." num)
      (("begin" "{") ("end" "{") ("pagenumbering" "{")
       ("thispagestyle" "{") ("pagestyle" "{") ("nofiles" "")
       ("includeonly" "{") ("bibliographystyle" "{") ("documentstyle" "[{")
-      ("documentclass" "[{") ("newenvironment" "*{[[{{")
+      ("documentclass" "[{[") ("newenvironment" "*{[[{{")
       ("newcommand" "*|{\\[[{") ("newlength" "|{\\")
       ("newtheorem" "{[{[")
-      ("newcounter" "{[") ("renewenvironment" "*{[{{")
+      ("providecommand" "*|{\\[[{")
+      ("newcounter" "{[") ("renewenvironment" "*{[[{{")
       ("renewcommand" "*|{\\[[{") ("renewtheorem" "{[{[")
-      ("usepackage" "[{") ("fbox" "{") ("mbox" "{") ("sbox" "{")
+      ("usepackage" "[{[") ("fbox" "{") ("mbox" "{") ("rule" "[{{")
       ("vspace" "*{") ("hspace" "*{") ("thinspace" "") ("negthinspace" "")
       ;; XXX: Should macros without arguments rather be listed in a
       ;; separate category with 'noarg instead of 'command handling?
@@ -513,7 +546,10 @@ use."
           (7 (font-latex-matched-face 7) append t)))
        ((eq type 'noarg)
         `(,(intern (concat prefix name))
-          (0 ,face)))
+          ;; Quote a list of face properties but do not to quote a face symbol.
+          (0 ,(if (and (listp face) (not (fboundp (car face))))
+                  `',face
+                face))))
        ((eq type 'declaration)
         `(,(intern (concat prefix name))
           (0 'font-latex-warning-face t t)
@@ -787,11 +823,11 @@ Generated by `font-latex-make-user-keywords'.")))
   "Add KEYWORDS to CLASS.
 KEYWORDS is a list of keywords or keywords with syntax specs.
 CLASS corresponds to a keyword class and can be one of the
-symbols 'warning, 'variable, 'reference, 'function, sectioning-0,
-'sectioning-1, 'sectioning-2, 'sectioning-3, 'sectioning-4,
-'sectioning-5, 'slide-title, 'textual, 'bold-command,
-'italic-command, 'math-command, 'type-command, 'bold-declaration,
-'italic-declaration or 'type-declaration.
+symbols 'warning, 'variable, 'reference, 'biblatex, 'function,
+sectioning-0, 'sectioning-1, 'sectioning-2, 'sectioning-3,
+'sectioning-4, 'sectioning-5, 'slide-title, 'textual,
+'bold-command, 'italic-command, 'math-command, 'type-command,
+'bold-declaration, 'italic-declaration or 'type-declaration.
 
 The keywords will be added to the buffer-local list of keywords
 of the respective keyword class and necessary updates of the font
index f9859a6144b152c516a2c2911888eb9683096956..03e7ba939ac89ef83541fb53024befdacd54a6fd 100644 (file)
@@ -1,7 +1,8 @@
 ;;; latex.el --- Support for LaTeX documents.
 
 ;; Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2003,
-;;   2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+;;   Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Keywords: tex
@@ -1099,10 +1100,10 @@ Just like array and tabular."
 (defun LaTeX-env-args (environment &rest args)
   "Insert ENVIRONMENT and arguments defined by ARGS."
   (LaTeX-insert-environment environment)
-  (let ((pos (point-marker)))
-    (end-of-line 0)
-    (TeX-parse-arguments args)
-    (goto-char pos)))
+  (save-excursion
+    (LaTeX-find-matching-begin)
+    (end-of-line)
+    (TeX-parse-arguments args)))
 
 ;;; Item hooks
 
@@ -1197,27 +1198,48 @@ This is necessary since index entries may contain commands and stuff.")
        (1 2 3) LaTeX-auto-optional)
        (,(concat "\\\\\\(?:new\\|provide\\)command\\*?{?\\\\\\(" token "+\\)}?\\[\\([0-9]+\\)\\]")
        (1 2) LaTeX-auto-arguments)
-       (,(concat "\\\\\\(?:new\\|provide\\)command\\*?{?\\\\\\(" token "+\\)}?") 1 TeX-auto-symbol)
+       (,(concat "\\\\\\(?:new\\|provide\\)command\\*?{?\\\\\\(" token "+\\)}?")
+       1 TeX-auto-symbol)
        (,(concat "\\\\newenvironment\\*?{?\\(" token "+\\)}?\\[\\([0-9]+\\)\\]\\[")
        1 LaTeX-auto-environment)
        (,(concat "\\\\newenvironment\\*?{?\\(" token "+\\)}?\\[\\([0-9]+\\)\\]")
        (1 2) LaTeX-auto-env-args)
-       (,(concat "\\\\newenvironment\\*?{?\\(" token "+\\)}?") 1 LaTeX-auto-environment)
+       (,(concat "\\\\newenvironment\\*?{?\\(" token "+\\)}?")
+       1 LaTeX-auto-environment)
        (,(concat "\\\\newtheorem{\\(" token "+\\)}") 1 LaTeX-auto-environment)
        ("\\\\input{\\(\\.*[^#}%\\\\\\.\n\r]+\\)\\(\\.[^#}%\\\\\\.\n\r]+\\)?}"
        1 TeX-auto-file)
        ("\\\\include{\\(\\.*[^#}%\\\\\\.\n\r]+\\)\\(\\.[^#}%\\\\\\.\n\r]+\\)?}"
        1 TeX-auto-file)
-       (, (concat "\\\\bibitem{\\(" token "[^, \n\r\t%\"#'()={}]*\\)}") 1 LaTeX-auto-bibitem)
+       (, (concat "\\\\bibitem{\\(" token "[^, \n\r\t%\"#'()={}]*\\)}")
+         1 LaTeX-auto-bibitem)
        (, (concat "\\\\bibitem\\[[^][\n\r]+\\]{\\(" token "[^, \n\r\t%\"#'()={}]*\\)}")
          1 LaTeX-auto-bibitem)
-       ("\\\\bibliography{\\([^#}\\\\\n\r]+\\)}" 1 LaTeX-auto-bibliography)))
+       ("\\\\bibliography{\\([^#}\\\\\n\r]+\\)}" 1 LaTeX-auto-bibliography)
+       ("\\\\addbibresource\\(?:\\[[^]]+\\]\\)?{\\([^#}\\\\\n\r\.]+\\)\\..+}"
+       1 LaTeX-auto-bibliography)
+       ("\\\\add\\(?:global\\|section\\)bib\\(?:\\[[^]]+\\]\\)?{\\([^#}\\\\\n\r\.]+\\)\\(?:\\..+\\)?}" 1 LaTeX-auto-bibliography)
+       ("\\\\newrefsection\\[\\([^]]+\\)\\]" 1 LaTeX-split-bibs)
+       ("\\\\begin{refsection}\\[\\([^]]+\\)\\]" 1 LaTeX-split-bibs)))
    LaTeX-auto-class-regexp-list
    LaTeX-auto-label-regexp-list
    LaTeX-auto-index-regexp-list
    LaTeX-auto-minimal-regexp-list)
   "List of regular expression matching common LaTeX macro definitions.")
 
+(defun LaTeX-split-bibs (match)
+  "Extract bibliography resources from MATCH.
+Split the string at commas and remove Biber file extensions."
+  (let ((bibs (TeX-split-string " *, *" (TeX-match-buffer match))))
+    (dolist (bib bibs)
+      (LaTeX-add-bibliographies (replace-regexp-in-string 
+                                (concat "\\(?:\\."
+                                        (mapconcat 'regexp-quote
+                                                   TeX-Biber-file-extensions
+                                                   "\\|\\.")
+                                        "\\)")
+                                "" bib)))))
+
 (defun LaTeX-auto-prepare ()
   "Prepare for LaTeX parsing."
   (setq LaTeX-auto-arguments nil
@@ -1231,23 +1253,47 @@ This is necessary since index entries may contain commands and stuff.")
 (defun LaTeX-listify-package-options (options)
   "Return a list from a comma-separated string of package OPTIONS.
 The input string may include LaTeX comments and newlines."
-  ;; FIXME: Parse key=value options like "pdftitle={A Perfect
-  ;; Day},colorlinks=false" correctly.  When this works, the check for
-  ;; "=" can be removed again.
-  (let (opts)
-    (dolist (elt (TeX-split-string "\\(,\\|%[^\n\r]*[\n\r]\\)+"
-                                  options))
-      (unless (string-match "=" elt)
-       ;; Strip whitespace.
-       (dolist (item (TeX-split-string "[ \t\r\n]+" elt))
-         (unless (string= item "")
-           (add-to-list 'opts item)))))
+  ;; We jump through all those hoops and don't just use `split-string'
+  ;; or the like in order to be able to deal with key=value package
+  ;; options which can look like this: "pdftitle={A Perfect Day},
+  ;; colorlinks=false"
+  (let (opts match start)
+    (with-temp-buffer
+      (set-syntax-table LaTeX-mode-syntax-table)
+      (insert options)
+      (newline) ; So that the last entry can be found.
+      (goto-char (point-min))
+      (setq start (point))
+      (while (re-search-forward "[{ ,%\n\r]" nil t)
+       (setq match (match-string 0))
+       (cond
+        ;; Step over groups.  (Let's hope nobody uses escaped braces.)
+        ((string= match "{")
+         (up-list))
+        ;; Get rid of whitespace.
+        ((string= match " ")
+         (delete-region (1- (point))
+                        (save-excursion
+                          (skip-chars-forward " ")
+                          (point))))
+        ;; Add entry to output.
+        ((or (string= match ",") (= (point) (point-max)))
+         (add-to-list 'opts (buffer-substring-no-properties
+                             start (1- (point))) t)
+         (setq start (point)))
+        ;; Get rid of comments.
+        ((string= match "%")
+         (delete-region (1- (point))
+                        (line-beginning-position 2)))
+        ;; Get rid of newlines.
+        ((or (string= match "\n") (string= match "\r"))
+         (delete-backward-char 1)))))
     opts))
 
 (defun LaTeX-auto-cleanup ()
   "Cleanup after LaTeX parsing."
 
-  ;; Cleanup BibTeX files
+  ;; Cleanup BibTeX/Biber files
   (setq LaTeX-auto-bibliography
        (apply 'append (mapcar (lambda (arg)
                                 (TeX-split-string "," arg))
@@ -1383,6 +1429,12 @@ regenerated by the respective menu filter."
   (setq LaTeX-environment-menu nil)
   (setq LaTeX-environment-modify-menu nil))
 
+;;; Biber support
+
+(defvar LaTeX-using-Biber nil
+  "Used to track whether Biber is in use.")
+(make-variable-buffer-local 'LaTeX-using-Biber)
+
 ;;; BibTeX
 
 ;;;###autoload
@@ -1597,6 +1649,7 @@ string."
                              ("dinbrief")
                              ("foils")
                              ("letter")
+                             ("memoir")
                              ("minimal")
                              ("prosper")
                              ("report")
@@ -1636,7 +1689,8 @@ OPTIONAL and IGNORE are ignored."
 (defun LaTeX-arg-usepackage (optional)
   "Insert arguments to usepackage.
 OPTIONAL is ignored."
-  (let ((TeX-file-extensions '("sty")))
+  (let ((TeX-file-extensions '("sty"))
+       (TeX-input-file-search t))
     (TeX-arg-input-file nil "Package")
     (save-excursion
       (search-backward-regexp "{\\(.*\\)}")
@@ -1671,9 +1725,51 @@ OPTIONAL is ignored."
          (mapc 'TeX-run-style-hooks (LaTeX-listify-package-options options))
          (TeX-argument-insert options t))))))
 
+(defcustom LaTeX-search-files-type-alist
+  '((texinputs "${TEXINPUTS.latex}" ("tex/generic/" "tex/latex/")
+              TeX-file-extensions)
+    (docs "${TEXDOCS}" ("doc/") TeX-doc-extensions)
+    (graphics "${TEXINPUTS}" ("tex/") LaTeX-includegraphics-extensions)
+    (bibinputs "${BIBINPUTS}" ("bibtex/bib/") BibTeX-file-extensions)
+    (bstinputs "${BSTINPUTS}" ("bibtex/bst/") BibTeX-style-extensions)
+    (biberinputs "${BIBINPUTS}" ("bibtex/bib/") TeX-Biber-file-extensions))
+  "Alist of filetypes with locations and file extensions.
+Each element of the alist consists of a symbol expressing the
+filetype, a variable which can be expanded on kpathsea-based
+systems into the directories where files of the given type
+reside, a list of absolute directories, relative directories
+below the root of a TDS-compliant TeX tree or a list of variables
+with either type of directories as an alternative for
+non-kpathsea-based systems and a list of extensions to be matched
+upon a file search.  Note that the directories have to end with a
+directory separator.
+
+Reset the mode for a change of this variable to take effect."
+  :group 'TeX-file
+  :type '(alist :key-type symbol
+               :value-type
+               (group (string :tag "Kpathsea variable")
+                      (choice :tag "Directories"
+                              (repeat :tag "TDS subdirectories" string)
+                              (repeat :tag "Absolute directories" directory)
+                              (repeat :tag "Variables" variable))
+                      (choice :tag "Extensions"
+                              variable (repeat string)))))
+
+(defcustom TeX-arg-input-file-search t
+  "If `TeX-arg-input-file' should search for files.
+If the value is t, files in TeX's search path are searched for
+and provided for completion.  The file name is then inserted
+without directory and extension.  If the value is nil, the file
+name can be specified manually and is inserted with a path
+relative to the directory of the current buffer's file and with
+extension.  If the value is `ask', you are asked for the method
+to use every time `TeX-arg-input-file' is called."
+  :group 'LaTeX-macro
+  :type '(choice (const t) (const nil) (const ask)))
+
 (defvar TeX-global-input-files nil
   "List of the non-local TeX input files.
-
 Initialized once at the first time you prompt for an input file.
 May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
 
@@ -1683,28 +1779,32 @@ If OPTIONAL is non-nil, insert the resulting value as an optional
 argument, otherwise as a mandatory one.  PROMPT is the prompt,
 LOCAL is a flag.  If the flag is set, only complete with local
 files."
-  (unless (or TeX-global-input-files local)
-    (message "Searching for files...")
-    (setq TeX-global-input-files
-         (mapcar 'list (TeX-search-files (append TeX-macro-private
-                                                 TeX-macro-global)
-                                         TeX-file-extensions t t))))
-  (let ((file (if TeX-check-path
-                 (completing-read
-                  (TeX-argument-prompt optional prompt "File")
-                  (TeX-delete-dups-by-car
-                   (append (mapcar 'list
-                                   (TeX-search-files '("./")
-                                                     TeX-file-extensions
-                                                     t t))
-                           (unless local
-                             TeX-global-input-files))))
-               (read-file-name
-                (TeX-argument-prompt optional prompt "File")))))
-    (if (null file)
-       (setq file ""))
-    (if (not (string-equal "" file))
-       (TeX-run-style-hooks file))
+  (let ((search (if (eq TeX-arg-input-file-search 'ask)
+                   (not (y-or-n-p "Find file yourself? "))
+                 TeX-arg-input-file-search))
+       file style)
+    (if search
+       (progn
+         (unless (or TeX-global-input-files local)
+           (message "Searching for files...")
+           (setq TeX-global-input-files
+                 (mapcar 'list (TeX-search-files-by-type
+                                'texinputs 'global t t))))
+         (setq file (completing-read
+                     (TeX-argument-prompt optional prompt "File")
+                     (TeX-delete-dups-by-car
+                      (append (mapcar 'list (TeX-search-files-by-type
+                                             'texinputs 'local t t))
+                              (unless local
+                                TeX-global-input-files))))
+               style file))
+      (setq file (read-file-name
+                 (TeX-argument-prompt optional prompt "File") nil ""))
+      (unless (string-equal file "")
+       (setq file (file-relative-name file)))
+      (setq style (file-name-sans-extension (file-name-nondirectory file))))
+    (unless (string-equal "" style)
+      (TeX-run-style-hooks style))
     (TeX-argument-insert file optional)))
 
 (defvar BibTeX-global-style-files nil
@@ -1721,44 +1821,50 @@ string."
   (message "Searching for BibTeX styles...")
   (or BibTeX-global-style-files
       (setq BibTeX-global-style-files
-           (mapcar 'list
-                   (TeX-search-files (append TeX-macro-private
-                                             TeX-macro-global)
-                                     BibTeX-style-extensions t t))))
-
+           (mapcar 'list (TeX-search-files-by-type 'bstinputs 'global t t))))
   (TeX-argument-insert
    (completing-read (TeX-argument-prompt optional prompt "BibTeX style")
-                   (append (mapcar 'list
-                                   (TeX-search-files '("./")
-                                                     BibTeX-style-extensions
-                                                     t t))
+                   (append (mapcar 'list (TeX-search-files-by-type
+                                          'bstinputs 'local t t))
                            BibTeX-global-style-files))
    optional))
 
 (defvar BibTeX-global-files nil
   "Association list of BibTeX files.
 
-Initialized once at the first time you prompt for an BibTeX file.
+Initialized once at the first time you prompt for a BibTeX file.
+May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+
+(defvar TeX-Biber-global-files nil
+  "Association list of Biber files.
+
+Initialized once at the first time you prompt for an Biber file.
 May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
 
 (defun TeX-arg-bibliography (optional &optional prompt)
-  "Prompt for a BibTeX database file.
+  "Prompt for a BibTeX or Biber database file.
 If OPTIONAL is non-nil, insert the resulting value as an optional
 argument, otherwise as a mandatory one.  Use PROMPT as the prompt
 string."
-  (message "Searching for BibTeX files...")
-  (or BibTeX-global-files
-      (setq BibTeX-global-files
-           (mapcar 'list (TeX-search-files nil BibTeX-file-extensions t t))))
-
-  (let ((styles (multi-prompt
-                "," t
-                (TeX-argument-prompt optional prompt "BibTeX files")
-                (append (mapcar 'list
-                                (TeX-search-files '("./")
-                                                  BibTeX-file-extensions
-                                                  t t))
-                        BibTeX-global-files))))
+  (let (name files inputs styles)
+    (if LaTeX-using-Biber
+       (progn
+         (setq name "Biber"
+               files 'TeX-Biber-global-files
+               inputs 'biberinputs))
+      (setq name "BibTeX"
+           files 'BibTeX-global-files
+           inputs 'bibinputs))
+    (message "Searching for %s files..." name)
+    (or (symbol-value files)
+       (set files (mapcar 'list (TeX-search-files-by-type
+                                 'biberinputs 'global t t))))
+    (setq styles (multi-prompt
+                 "," t
+                 (TeX-argument-prompt optional prompt (concat name " files"))
+                 (append (mapcar 'list (TeX-search-files-by-type
+                                        inputs 'local t t))
+                         (symbol-value files))))
     (apply 'LaTeX-add-bibliographies styles)
     (TeX-argument-insert (mapconcat 'identity styles ",") optional)))
 
@@ -1929,7 +2035,7 @@ alist.  The car of each element should be a string representing a
 key and the optional cdr should be a list with strings to be used
 as values for the key."
   (let ((options (multi-prompt-key-value
-                 (TeX-argument-prompt optional "Options" nil)
+                 (TeX-argument-prompt optional "Options (k=v)" nil)
                  (if (symbolp key-val-alist)
                      (eval key-val-alist)
                    key-val-alist))))
@@ -2041,10 +2147,22 @@ non-parenthetical delimiters, like \\verb+foo+, are recognized."
                   (/= (point) (line-beginning-position))))))
       ;; Search forward for the macro end, unless we failed to find a start
       (unless (bolp)
-       (let ((beg (1- (point))))
-         (goto-char (1+ (match-end 0)))
-         (skip-chars-forward (concat "^" (buffer-substring-no-properties
-                                          (1- (point)) (point))))
+       (let* ((beg (1- (point)))
+              (macro-end (match-end 0))
+              ;; XXX: Here we assume we are dealing with \verb which
+              ;; expects the delimiter right behind the command.
+              ;; However, \lstinline can also cope with whitespace as
+              ;; well as an optional argument after the command.
+              (delimiter (buffer-substring-no-properties
+                          macro-end (1+ macro-end))))
+         ;; Heuristic: If an opening brace is encountered, search for
+         ;; both the opening and the closing brace as an end marker.
+         ;; Like that the function should work for \verb|...| as well
+         ;; as for \url{...}.
+         (when (string= delimiter TeX-grop)
+           (setq delimiter (concat delimiter TeX-grcl)))
+         (goto-char (1+ macro-end))
+         (skip-chars-forward (concat "^" delimiter))
          (when (<= orig (point))
            (cons beg (1+ (point)))))))))
 
@@ -2859,8 +2977,8 @@ space does not end a sentence, so don't break a line there."
            (unless (or (bolp)
                        ;; Comment starters and whitespace.
                        (TeX-looking-at-backward
-                        (concat "^\\([ \t]*" TeX-comment-start-regexp
-                                "+\\)+[ \t]*")
+                        (concat "^\\([ \t]*" TeX-comment-start-regexp "+\\)*"
+                                "[ \t]*")
                         (line-beginning-position)))
              (LaTeX-fill-newline)))))
       ;; Leave point after final newline.
@@ -3114,6 +3232,7 @@ space does not end a sentence, so don't break a line there."
                                    ((string= match-string "$$") "$$")
                                    (t (concat TeX-esc "]")))
                              (point-max) t)
+                            (skip-chars-forward "^ \n")
                             (point))
                           (line-beginning-position))
                        fill-column)))
@@ -4318,10 +4437,7 @@ use \\[customize]."
       (read-kbd-macro LaTeX-math-abbrev-prefix)
     LaTeX-math-abbrev-prefix))
 
-(defvar LaTeX-math-keymap
-  (let ((map (make-sparse-keymap)))
-    (define-key map (LaTeX-math-abbrev-prefix) 'self-insert-command)
-    map)
+(defvar LaTeX-math-keymap (make-sparse-keymap)
   "Keymap used for `LaTeX-math-mode' commands.")
 
 (defvar LaTeX-math-menu
@@ -4394,7 +4510,10 @@ the sequence by initializing this variable.")
                                  (list menu (vector (concat prefix value)
                                                     name t))
                                (vector menu name t))
-                             (cdr parent))))))))))
+                             (cdr parent)))))))))
+  ;; Make the math prefix char available if it has not been used as a prefix.
+  (unless (lookup-key map (LaTeX-math-abbrev-prefix))
+    (define-key map (LaTeX-math-abbrev-prefix) 'self-insert-command)))
 
 (define-minor-mode LaTeX-math-mode
   "A minor mode with easy access to TeX math macros.
@@ -4901,6 +5020,8 @@ This happens when \\left is inserted."
   :type 'hook
   :group 'LaTeX)
 
+(TeX-abbrev-mode-setup latex-mode)
+
 ;;;###autoload
 (add-to-list 'auto-mode-alist '("\\.drv\\'" . latex-mode))
 
@@ -4933,6 +5054,8 @@ of `LaTeX-mode-hook'."
           filladapt-mode)
       (turn-off-filladapt-mode)))
 
+(TeX-abbrev-mode-setup doctex-mode)
+
 ;;;###autoload
 (add-to-list 'auto-mode-alist '("\\.dtx\\'" . doctex-mode))
 
@@ -4941,6 +5064,7 @@ of `LaTeX-mode-hook'."
   "Major mode in AUCTeX for editing .dtx files derived from `LaTeX-mode'.
 Runs `LaTeX-mode', sets a few variables and
 runs the hooks in `docTeX-mode-hook'."
+  :abbrev-table doctex-mode-abbrev-table
   (setq major-mode 'doctex-mode)
   (set (make-local-variable 'LaTeX-insert-into-comments) t)
   (set (make-local-variable 'LaTeX-syntactic-comments) t)
@@ -5012,6 +5136,8 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
   (make-local-variable 'indent-line-function)
   (setq indent-line-function 'LaTeX-indent-line)
 
+  (setq local-abbrev-table latex-mode-abbrev-table)
+
   ;; Filling
   (make-local-variable 'paragraph-ignore-fill-prefix)
   (setq paragraph-ignore-fill-prefix t)
@@ -5051,6 +5177,8 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
   (setq TeX-verbatim-p-function 'LaTeX-verbatim-p)
   (setq TeX-search-forward-comment-start-function
        'LaTeX-search-forward-comment-start)
+  (set (make-local-variable 'TeX-search-files-type-alist)
+       LaTeX-search-files-type-alist)
 
   (make-local-variable 'LaTeX-item-list)
   (setq LaTeX-item-list '(("description" . LaTeX-item-argument)
@@ -5199,6 +5327,7 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
    '("nocite" TeX-arg-cite)
    '("bibliographystyle" TeX-arg-bibstyle)
    '("bibliography" TeX-arg-bibliography)
+   '("addbibresource" TeX-arg-bibliography)
    '("footnote"
      (TeX-arg-conditional TeX-arg-footnote-number-p ([ "Number" ]) nil)
      t)
@@ -5211,6 +5340,8 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
    '("setlength" TeX-arg-macro "Length")
    '("addtolength" TeX-arg-macro "Length")
    '("settowidth" TeX-arg-macro t)
+   '("settoheight" TeX-arg-macro t)
+   '("settodepth" TeX-arg-macro t)
    '("\\" [ "Space" ])
    '("\\*" [ "Space" ])
    '("hyphenation" t)
@@ -5257,11 +5388,11 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
    '("include" (TeX-arg-input-file "File" t))
    '("includeonly" t)
    '("input" TeX-arg-input-file)
-   '("addcontentsline" TeX-arg-file
-     (TeX-arg-eval
-      completing-read "Numbering style: " LaTeX-section-list)
-     t)
-   '("addtocontents" TeX-arg-file t)
+   '("addcontentsline"
+     (TeX-arg-eval completing-read "File: " '(("toc") ("lof") ("lot")))
+     (TeX-arg-eval completing-read "Numbering style: " LaTeX-section-list) t)
+   '("addtocontents"
+     (TeX-arg-eval completing-read "File: " '(("toc") ("lof") ("lot"))) t)
    '("typeout" t)
    '("typein" [ TeX-arg-define-macro ] t)
    '("verb" TeX-arg-verb)
@@ -5289,8 +5420,9 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
    "clearpage" "cleardoublepage" "twocolumn" "onecolumn"
 
    "maketitle" "tableofcontents" "listoffigures" "listoftables"
-   "tiny" "scriptsize" "footnotesize" "small"
-   "normalsize" "large" "Large" "LARGE" "huge" "Huge"
+   '("tiny" -1) '("scriptsize" -1) '("footnotesize" -1) '("small" -1)
+   '("normalsize" -1) '("large" -1) '("Large" -1) '("LARGE" -1) '("huge" -1)
+   '("Huge" -1)
    "pounds" "copyright"
    "hfil" "hfill" "vfil" "vfill" "hrulefill" "dotfill"
    "indent" "noindent" "today"
@@ -5346,6 +5478,7 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
        [ "Number of arguments" ] [ "Default value for first argument" ] t)
      '("usepackage" LaTeX-arg-usepackage)
      '("RequirePackage" LaTeX-arg-usepackage)
+     '("ProvidesPackage" "Name" [ "Version" ])
      '("documentclass" TeX-arg-document)))
 
   (TeX-add-style-hook "latex2e"
@@ -5390,6 +5523,7 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
        'LaTeX-imenu-create-index-function)
 
   (use-local-map LaTeX-mode-map)
+
   ;; Calling `easy-menu-add' may result in the menu filters being
   ;; executed which call `TeX-update-style'.  So this is placed very
   ;; late in mode initialization to assure that all relevant variables
index 30402981d4576683f560c5fef770d99eead8ac2d..757e80f5c5fc8d06247f78c3f468d5bb94f79491 100644 (file)
@@ -26,7 +26,7 @@
 \NeedsTeXFormat{LaTeX2e} \def\reserved@a #1#2$#3:
 #4${\xdef#1{\reserved@c #2#4 $}} \def\reserved@c #1 #2${#1}
 \begingroup \catcode`\_=12
-\reserved@a\pr@version $Name: release_11_86 $ \ifx\pr@version\@empty
+\reserved@a\pr@version $Name: release_11_87 $ \ifx\pr@version\@empty
 \reserved@a\pr@version CVS-$Revision: 1.126 $ \endgroup \else
   \def\next release_{} \lccode`\_=`.
   \edef\next{\lowercase{\endgroup
diff --git a/packages/auctex/plain-tex.el b/packages/auctex/plain-tex.el
new file mode 100644 (file)
index 0000000..476976b
--- /dev/null
@@ -0,0 +1,314 @@
+;;; plain-tex.el --- Support for plain TeX documents.
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Maintainer: auctex-devel@gnu.org
+;; 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 provides support for plain TeX in AUCTeX.
+
+;;; Code:
+
+(require 'tex)
+(require 'tex-buf)
+
+;;; Tool bar
+
+(defcustom plain-TeX-enable-toolbar t
+  "Enable TeX tool bar in plain TeX mode."
+  :group 'TeX-tool-bar
+  :type 'boolean)
+
+(defun plain-TeX-maybe-install-toolbar ()
+  "Conditionally install tool bar buttons for plain TeX mode.
+Install tool bar if `plain-TeX-enable-toolbar' is non-nil."
+  (when plain-TeX-enable-toolbar
+    ;; Defined in `tex-bar.el':
+    (TeX-install-toolbar)))
+
+
+;;; Keymap and menu
+
+(defvar plain-TeX-mode-map
+  (let ((map (make-sparse-keymap)))
+    (set-keymap-parent map TeX-mode-map)
+    map)
+  "Keymap used in plain TeX mode.")
+
+(defvar plain-TeX-menu-entries
+  (TeX-menu-with-help
+   `(["Macro..." TeX-insert-macro
+      :help "Insert a macro and possibly arguments"]
+     ["Complete" TeX-complete-symbol
+      :help "Complete the current macro"]
+     "-"
+     ("Insert Font"
+      ["Emphasize"  (TeX-font nil ?\C-e) :keys "C-c C-f C-e"]
+      ["Bold"       (TeX-font nil ?\C-b) :keys "C-c C-f C-b"]
+      ["Typewriter" (TeX-font nil ?\C-t) :keys "C-c C-f C-t"]
+      ["Small Caps" (TeX-font nil ?\C-c) :keys "C-c C-f C-c"]
+      ["Sans Serif" (TeX-font nil ?\C-f) :keys "C-c C-f C-f"]
+      ["Italic"     (TeX-font nil ?\C-i) :keys "C-c C-f C-i"]
+      ["Slanted"    (TeX-font nil ?\C-s) :keys "C-c C-f C-s"]
+      ["Roman"      (TeX-font nil ?\C-r) :keys "C-c C-f C-r"]
+      ["Calligraphic" (TeX-font nil ?\C-a) :keys "C-c C-f C-a"])
+     ("Replace Font"
+      ["Emphasize"  (TeX-font t ?\C-e) :keys "C-u C-c C-f C-e"]
+      ["Bold"       (TeX-font t ?\C-b) :keys "C-u C-c C-f C-b"]
+      ["Typewriter" (TeX-font t ?\C-t) :keys "C-u C-c C-f C-t"]
+      ["Small Caps" (TeX-font t ?\C-c) :keys "C-u C-c C-f C-c"]
+      ["Sans Serif" (TeX-font t ?\C-f) :keys "C-u C-c C-f C-f"]
+      ["Italic"     (TeX-font t ?\C-i) :keys "C-u C-c C-f C-i"]
+      ["Slanted"    (TeX-font t ?\C-s) :keys "C-u C-c C-f C-s"]
+      ["Roman"      (TeX-font t ?\C-r) :keys "C-u C-c C-f C-r"]
+      ["Calligraphic" (TeX-font t ?\C-a) :keys "C-u C-c C-f C-a"])
+     ["Delete Font" (TeX-font t ?\C-d) :keys "C-c C-f C-d"]
+     "-"
+     ["Comment or Uncomment Region" TeX-comment-or-uncomment-region
+      :help "Comment or uncomment the currently selected region"]
+     ["Comment or Uncomment Paragraph" TeX-comment-or-uncomment-paragraph
+      :help "Comment or uncomment the paragraph containing point"]
+     ,TeX-fold-menu
+     "-" . ,TeX-common-menu-entries)))
+
+(easy-menu-define plain-TeX-mode-command-menu
+    plain-TeX-mode-map
+    "Command menu used in TeX mode."
+    (TeX-mode-specific-command-menu 'plain-tex-mode))
+
+(easy-menu-define plain-TeX-mode-menu
+    plain-TeX-mode-map
+    "Menu used in plain TeX mode."
+    (cons "TeX" plain-TeX-menu-entries))
+
+
+;;; The mode
+
+(defcustom plain-TeX-mode-hook nil
+  "A hook run in plain TeX mode buffers."
+  :type 'hook
+  :group 'TeX-misc)
+
+(TeX-abbrev-mode-setup plain-tex-mode)
+
+;;;###autoload
+(defun TeX-plain-tex-mode ()
+  "Major mode in AUCTeX for editing plain TeX files.
+See info under AUCTeX for documentation.
+
+Special commands:
+\\{plain-TeX-mode-map}
+
+Entering `plain-tex-mode' calls the value of `text-mode-hook',
+then the value of `TeX-mode-hook', and then the value
+of plain-TeX-mode-hook."
+  (interactive)
+  (plain-TeX-common-initialization)
+  (setq major-mode 'plain-tex-mode)
+  (use-local-map plain-TeX-mode-map)
+  (easy-menu-add plain-TeX-mode-menu plain-TeX-mode-map)
+  (easy-menu-add plain-TeX-mode-command-menu plain-TeX-mode-map)
+  (setq TeX-base-mode-name "TeX")
+  (setq TeX-command-default "TeX")
+  (setq TeX-sentinel-default-function 'TeX-TeX-sentinel)
+  (add-hook 'tool-bar-mode-on-hook 'plain-TeX-maybe-install-toolbar nil t)
+  (when (if (featurep 'xemacs)
+           (featurep 'toolbar)
+         (and (boundp 'tool-bar-mode) tool-bar-mode))
+    (plain-TeX-maybe-install-toolbar))
+  (TeX-run-mode-hooks 'text-mode-hook 'TeX-mode-hook 'plain-TeX-mode-hook)
+  (TeX-set-mode-name))
+
+(defun plain-TeX-common-initialization ()
+  "Common initialization for plain TeX like modes."
+  (VirTeX-common-initialization)
+  (set-syntax-table TeX-mode-syntax-table)
+  (setq local-abbrev-table latex-mode-abbrev-table)
+  (setq paragraph-start
+       (concat
+        "\\(^[ \t]*$"
+        "\\|" (regexp-quote TeX-esc) "par\\|"
+        "^[ \t]*"
+        (regexp-quote TeX-esc)
+        "\\("
+        "begin\\|end\\|part\\|chapter\\|"
+        "section\\|subsection\\|subsubsection\\|"
+        "paragraph\\|include\\|includeonly\\|"
+        "tableofcontents\\|appendix\\|label\\|caption\\|"
+        "\\[\\|\\]"                    ; display math delimitors
+        "\\)"
+        "\\|"
+        "^[ \t]*\\$\\$"                ; display math delimitor
+        "\\)" ))
+  (setq paragraph-separate
+       (concat
+        "[ \t]*"
+        "\\("
+        (regexp-quote TeX-esc) "par\\|"
+        "%\\|"
+        "$\\|"
+        "\\$\\$\\|"
+        (regexp-quote TeX-esc)
+        "\\("
+        "begin\\|end\\|label\\|caption\\|part\\|chapter\\|"
+        "section\\|subsection\\|subsubsection\\|"
+        "paragraph\\|include\\|includeonly\\|"
+        "tableofcontents\\|appendix\\|" (regexp-quote TeX-esc)
+        "\\)"
+        "\\)"))
+  (setq TeX-header-end (regexp-quote "%**end of header"))
+  (setq TeX-trailer-start (regexp-quote (concat TeX-esc "bye")))
+  (TeX-add-symbols
+   ;; From the TeX Book, Appendix B
+   ;;
+   ;; XXX: This should be refined and extended by somebody who is
+   ;; familiar with plain TeX.
+   "dag"
+   "ddag"
+   "copyright"
+   "TeX"
+   "dots"
+   "break"
+   "nobreak"
+   "allowbreak"
+   "hbox"
+   "slash"
+   "enskip"
+   "quad"
+   "qquad"
+   "enspace"
+   "thinspace"
+   "negthinspace"
+   "smallskip"
+   "medskip"
+   "bigskip"
+   "eject"
+   "supereject"
+   "goodbreak"
+   "filbreak"
+   "smallbreak"
+   "medbreak"
+   "bigbreak"
+   "hrulefill"
+   "dotfill"
+   "rightarrowfill"
+   "leftarrowfill"
+   "upbracefill"
+   "downbracefill"
+   "halign"
+   "valign"
+   "omit"
+   "span"
+   "multispan"
+   "centerline"
+   "rightline"
+   "leftline"
+   "line"
+   "par"
+   "noindent"
+   "frenchspacing"
+   "nonfrenchspacing"
+   "llap"
+   "rlap"
+   "raggedright"
+   "ttraggedright"
+   "raggedbottom"
+   "normalbottom"
+   "obeylines"
+   "obeyspaces"
+   "hsize"
+   "vsize"
+   "hoffset"
+   "voffset"
+   "tolerance"
+   "looseness"
+   "parindent"
+   "baselineskip"
+   "parskip")
+  (TeX-run-style-hooks "TEX"))
+
+
+;;; Miscellaneous
+
+(defcustom plain-TeX-clean-intermediate-suffixes
+  TeX-clean-default-intermediate-suffixes
+  "List of regexps matching suffixes of intermediate files to be deleted.
+The regexps will be anchored at the end of the file name to be matched,
+i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
+  :type '(repeat regexp)
+  :group 'TeX-command)
+
+(defcustom plain-TeX-clean-output-suffixes TeX-clean-default-output-suffixes
+  "List of regexps matching suffixes of output files to be deleted.
+The regexps will be anchored at the end of the file name to be matched,
+i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
+  :type '(repeat regexp)
+  :group 'TeX-command)
+
+
+;;; AmSTeX
+
+(defvar AmSTeX-mode-map
+  (let ((map (make-sparse-keymap)))
+    (set-keymap-parent map TeX-mode-map)
+    map)
+  "Keymap used in `AmSTeX-mode'.")
+
+;; Menu for AmSTeX mode
+(easy-menu-define AmSTeX-mode-command-menu
+    AmSTeX-mode-map
+    "Command menu used in AmsTeX mode."
+    (TeX-mode-specific-command-menu 'ams-tex-mode))
+
+(easy-menu-define AmSTeX-mode-menu
+  AmSTeX-mode-map
+  "Menu used in AMS-TeX mode."
+  (cons "AmS-TeX" plain-TeX-menu-entries))
+
+;;;###autoload
+(defun ams-tex-mode ()
+  "Major mode in AUCTeX for editing AmS-TeX files.
+See info under AUCTeX for documentation.
+
+Special commands:
+\\{AmSTeX-mode-map}
+
+Entering AmS-tex-mode calls the value of `text-mode-hook',
+then the value of `TeX-mode-hook', and then the value
+of `AmS-TeX-mode-hook'."
+  (interactive)
+  (plain-TeX-common-initialization)
+  (setq major-mode 'ams-tex-mode)
+  (use-local-map AmSTeX-mode-map)
+
+  ;; Menu
+  (easy-menu-add AmSTeX-mode-menu AmSTeX-mode-map)
+  (easy-menu-add AmSTeX-mode-command-menu AmSTeX-mode-map)
+
+  (setq TeX-base-mode-name "AmS-TeX")
+  (setq TeX-command-default "AmSTeX")
+  (TeX-run-mode-hooks 'text-mode-hook 'TeX-mode-hook 'AmS-TeX-mode-hook)
+  (TeX-set-mode-name))
+
+(provide 'plain-tex)
+
+;;; plain-tex.el ends here
index db6780b0bfd0373c1519caa05e978d9e4cfac5d1..d66da6cd68f07fd0c7cd95cb1383e3b50b33acca 100644 (file)
@@ -2,7 +2,7 @@ This is preview-latex.info, produced by makeinfo version 4.13 from
 preview-latex.texi.
 
 This manual is for preview-latex, a LaTeX preview mode for AUCTeX
-(version 11.86 from 2010-02-21).
+(version 11.87 from 2012-11-30).
 
    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
 Foundation, Inc.
@@ -1469,9 +1469,9 @@ File: preview-latex.info,  Node: The preview images,  Next: Misplaced previews,
      operation, see the customization group `Preview Gs' for this.
 
      Another noteworthy setting of `preview-image-type' is `dvipng': in
-     this case, the `dvipng'will get run on DVI output (see below for
-     PDF).  This is in general much faster than Dvips and Ghostscript.
-     In that case, the option
+     this case, the `dvipng' program will get run on DVI output (see
+     below for PDF).  This is in general much faster than Dvips and
+     Ghostscript.  In that case, the option
 
 `preview-dvipng-command'
      will get run for doing the conversion, and it is expected that
@@ -2030,7 +2030,7 @@ Appendix C Copying this Manual
 The copyright notice for this manual is:
 
    This manual is for preview-latex, a LaTeX preview mode for AUCTeX
-(version 11.86 from 2010-02-21).
+(version 11.87 from 2012-11-30).
 
    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
 Foundation, Inc.
@@ -2684,17 +2684,17 @@ Node: Package options\7f36809
 Node: Provided commands\7f47744
 Node: The Emacs interface\7f55099
 Node: The preview images\7f64279
-Node: Misplaced previews\7f67751
-Node: ToDo\7f71194
-Node: Frequently Asked Questions\7f75979
-Node: Introduction to FAQ\7f76302
-Node: Requirements\7f76641
-Node: Installation Trouble\7f79605
-Node: Customization\7f82167
-Node: Troubleshooting\7f85715
-Node: Other formats\7f88232
-Node: Copying this Manual\7f89549
-Node: GNU Free Documentation License\7f90474
-Node: Index\7f115615
+Node: Misplaced previews\7f67761
+Node: ToDo\7f71204
+Node: Frequently Asked Questions\7f75989
+Node: Introduction to FAQ\7f76312
+Node: Requirements\7f76651
+Node: Installation Trouble\7f79615
+Node: Customization\7f82177
+Node: Troubleshooting\7f85725
+Node: Other formats\7f88242
+Node: Copying this Manual\7f89559
+Node: GNU Free Documentation License\7f90484
+Node: Index\7f115625
 \1f
 End Tag Table
index a2a17d318bcf79109c4d3d0db87b1a49632bf6fc..d39c0b2a41df8862d741b77a6c9d44b06165b051 100644 (file)
@@ -1,7 +1,7 @@
 ;;; preview.el --- embed preview LaTeX images in source buffer
 
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005,
-;;               2006  Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2010 Free
+;;   Software Foundation, Inc.
 
 ;; Author: David Kastrup
 ;; Keywords: tex, wp, convenience
@@ -23,7 +23,7 @@
 
 ;;; Commentary:
 
-;; $Id: preview.el,v 1.284 2009/06/18 19:20:46 angeli Exp $
+;; $Id: preview.el,v 1.286 2011/01/23 18:53:55 angeli Exp $
 ;;
 ;; This style is for the "seamless" embedding of generated images
 ;; into LaTeX source code.  Please see the README and INSTALL files
@@ -355,7 +355,7 @@ LIST consists of TeX dimensions in sp (1/65536 TeX point)."
   :group 'preview-gs
   :type 'string)
 
-(defcustom preview-gs-options '("-q" "-dSAFER" "-dNOPAUSE"
+(defcustom preview-gs-options '("-q" "-dDELAYSAFER" "-dNOPAUSE"
                                "-DNOPLATFONTS" "-dPrinted"
                                "-dTextAlphaBits=4"
                                "-dGraphicsAlphaBits=4")
@@ -1066,14 +1066,21 @@ NONREL is not NIL."
 
 (defun preview-prepare-fast-conversion ()
   "This fixes up all parameters for fast conversion."
-  (let ((file (if (consp (car preview-ps-file))
-                 (if (consp (caar preview-ps-file))
-                     (car (last (caar preview-ps-file)))
-                   (caar preview-ps-file))
-               (car preview-ps-file))))
+  (let* ((file (if (consp (car preview-ps-file))
+                  (if (consp (caar preview-ps-file))
+                      (car (last (caar preview-ps-file)))
+                    (caar preview-ps-file))
+                (car preview-ps-file)))
+        (all-files (if (and (consp (car preview-ps-file))
+                            (consp (caar preview-ps-file)))
+                       (caar preview-ps-file)
+                     (list file))))
     (setq preview-gs-dsc (preview-dsc-parse file))
     (setq preview-gs-init-string
-         (concat preview-gs-init-string
+         (concat (format "{<</PermitFileReading[%s]>> setuserparams \
+.locksafe} stopped pop "
+                         (mapconcat 'preview-ps-quote-filename all-files ""))
+                 preview-gs-init-string
                  (format "[%s(r)file]aload exch %s .runandhide aload pop "
                          (preview-ps-quote-filename file)
                          (preview-gs-dsc-cvx 0 preview-gs-dsc))))))
@@ -1456,9 +1463,9 @@ numbers (can be float if available)."
 Fallback to :inherit and 'default implemented."
   :group 'preview-appearance)
 
-(defcustom preview-auto-reveal '(eval (preview-arrived-via
-                                      (key-binding [left])
-                                      (key-binding [right])))
+(defcustom preview-auto-reveal
+  '(eval (preview-arrived-via (key-binding [left]) (key-binding [right])
+                             'backward-char 'forward-char))
   "*Cause previews to open automatically when entered.
 Possibilities are:
 T autoopens,
@@ -3511,8 +3518,8 @@ internal parameters, STR may be a log to insert into the current log."
             (preview-reraise-error process)))))
 
 (defconst preview-version (eval-when-compile
-  (let ((name "$Name: release_11_86 $")
-       (rev "$Revision: 1.284 $"))
+  (let ((name "$Name: release_11_87 $")
+       (rev "$Revision: 1.286 $"))
     (or (when (string-match "\\`[$]Name: *release_\\([^ ]+\\) *[$]\\'" name)
          (setq name (match-string 1 name))
          (while (string-match "_" name)
@@ -3526,7 +3533,7 @@ If not a regular release, CVS revision of `preview.el'.")
 
 (defconst preview-release-date
   (eval-when-compile
-    (let ((date "$Date: 2009/06/18 19:20:46 $"))
+    (let ((date "$Date: 2011/01/23 18:53:55 $"))
       (string-match
        "\\`[$]Date: *\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\)"
        date)
index 7b911cd4b7767e00729a1083189a971519ae7c49..cd4fa09537ae55b3908bfd60aa39b1aef27d3a5a 100644 (file)
     '("actionenv")
     '("alertblock" 1)
     '("beamerboxesrounded" 1)
-    '("block" 1)
+    '("block" (lambda (env &rest ignore)
+               (LaTeX-insert-environment
+                env (format "{%s}" (read-string "Title: ")))))
     '("column" "Width")
     "columns"
     "columnsonlytextwidth"
diff --git a/packages/auctex/style/biblatex.el b/packages/auctex/style/biblatex.el
new file mode 100644 (file)
index 0000000..3a66cff
--- /dev/null
@@ -0,0 +1,47 @@
+;;; biblatex.el --- AUCTeX style for `biblatex.sty'
+
+;; Copyright (C) 2012 Free Software Foundation, Inc.
+
+;; Author: Ralf Angeli <angeli@caeruleus.net>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2012-11-14
+;; 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 `biblatex.sty'.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "biblatex"
+ (lambda ()
+   ;; Unfortunately `(member "backend=biber" TeX-active-styles)' does
+   ;; not work as a test because "backend=biber" is added to
+   ;; `TeX-active-styles' after "biblatex".  So we check the value of
+   ;; `LaTeX-biblatex-use-biber' and let the user set it if desired.
+   (when LaTeX-biblatex-use-Biber
+     (setq LaTeX-using-Biber t))))
+
+;; TODO: Add package options.
+(defvar LaTeX-biblatex-package-options nil
+  "Package options for the biblatex package.")
+
+;;; biblatex.el ends here
index 3eb0144b8e9628f9a8b2360d159a12a577ac024b..77cb2b28cfbf5ae8c822d05c4e9e57efd9820704 100644 (file)
@@ -41,7 +41,9 @@
  "bulgarian"
  (lambda ()
    (set-syntax-table LaTeX-bulgarian-mode-syntax-table)
-   (setq TeX-quote-language `("bulgarian" "\"`" "\"'" ,TeX-quote-after-quote))
+   (unless (eq (car TeX-quote-language) 'override)
+     (setq TeX-quote-language
+          `("bulgarian" "\"`" "\"'" ,TeX-quote-after-quote)))
    (setq LaTeX-babel-hyphen-language "bulgarian")
    ;; Fontification of quotation marks.
    (when (fboundp 'font-latex-add-quotes)
index 4d8eb0b276382bf04ac35bfee1b70901d06d2502..6168189074de2300fc60b8974681dcddacde6af5 100644 (file)
@@ -3,5 +3,6 @@
 (TeX-add-style-hook
  "czech"
  (lambda ()
-   (setq TeX-quote-language `("czech" "\\uv{" "}" ,TeX-quote-after-quote))
+   (unless (eq (car TeX-quote-language) 'override)
+     (setq TeX-quote-language `("czech" "\\uv{" "}" ,TeX-quote-after-quote)))
    (run-hooks 'TeX-language-cz-hook)))
index 77a01642e715e49947fd02b7ab4fd4dce80294b7..775fee045bbf5b076d659af489a02bd7d70f79aa 100644 (file)
@@ -5,12 +5,13 @@
 (TeX-add-style-hook
  "danish"
  (lambda ()
-   (setq TeX-quote-language `("danish" "\"`" "\"'" ,TeX-quote-after-quote))
+   (unless (eq (car TeX-quote-language) 'override)
+     (setq TeX-quote-language `("danish" "\"`" "\"'" ,TeX-quote-after-quote)))
    (setq LaTeX-babel-hyphen-language "danish")
    ;; Fontification of quotation marks.
    (when (fboundp 'font-latex-add-quotes)
      (font-latex-add-quotes '("\"`" "\"'"))
-     (font-latex-add-quotes '("\"<" "\">" french)))
+     (font-latex-add-quotes '("\">" "\"<" german)))
    (run-hooks 'TeX-language-dk-hook)))
 
 ;;; danish.el ends here
diff --git a/packages/auctex/style/dinbrief.el b/packages/auctex/style/dinbrief.el
new file mode 100644 (file)
index 0000000..6049434
--- /dev/null
@@ -0,0 +1,163 @@
+;;; dinbrief.el - Special code for LaTeX-Style dinbrief.
+
+;; Contributed by Werner Fink <tex@itap.physik.uni-stuttgart.de>
+;; Please direct comments to him.
+
+;;; Commentary:
+
+;; LaTeX-Style: dinbrief.sty
+;;      Server: rusinfo.rus.uni-stuttgart.de
+;;   Directory: /pub/soft/tex/macros/latex/contrib/letters
+
+;;; Code:
+
+(TeX-add-style-hook "dinbrief"
+ (function
+  (lambda ()
+    (LaTeX-add-environments
+     '("letter" LaTeX-recipient-hook))
+    (TeX-add-symbols
+     '("Absender" "Absender: ")
+     '("Postvermerk" "Postvermerk: ")
+     '("Datum" "Datum: ")
+     '("Betreff" "Betreff: ")
+     '("Behandlungsvermerk" "Behandlungsvermerk: ")
+     '("Verteiler" "Verteiler: ")
+     "makelabel" "Retourlabel"
+     '("Anlagen" "Anlagen: ")
+     '("Fenster" "Fenster \(ja/nein\): ")
+     '("Retouradresse" "Retouradresse: ")
+     '("signature" "Unterschrift: ")
+     '("opening" "Anrede: ")
+     '("closing" "Schlu\"s: ")))))
+
+(defun LaTeX-recipient-hook (environment)
+  "Insert ENVIRONMENT and prompt for recipient and address."
+  (let ((sender (read-string "Absender: " (user-full-name)))
+       (recipient (read-string "Empf\"anger: "))
+       (address (read-string "Anschrift: "))
+       (postvermerk (read-string "Postvermerk: "))
+       (date (read-string "Datum: " (LaTeX-today)))
+       (betreff (read-string "Betreff: "))
+       (vermerk (read-string "Behandlungsvermerk: "))
+       (verteil (read-string "Verteiler: "))
+       (anlage (read-string "Anlagen: "))
+       (opening (read-string "Anrede: "))
+       (closing (read-string "Schlu\"s: "))
+       (fenster (read-string "Fenster \(ja/nein\): "))
+       (signature (read-string "Unterschrift: "))
+       )
+
+    (if (not (zerop (length sender)))
+       (progn
+         (insert TeX-esc "Absender" TeX-grop sender TeX-grcl)
+         (newline-and-indent)))
+    (if (not (zerop (length postvermerk)))
+       (progn
+         (insert TeX-esc "Postvermerk" TeX-grop postvermerk TeX-grcl)
+         (newline-and-indent)))
+    (if (not (zerop (length betreff)))
+       (progn
+         (insert TeX-esc "Betreff" TeX-grop betreff TeX-grcl)
+         (newline-and-indent)))
+    (if (not (zerop (length vermerk)))
+       (progn
+         (insert TeX-esc "Behandlungsvermerk" TeX-grop vermerk TeX-grcl)
+         (newline-and-indent)))
+    (if (not (zerop (length verteil)))
+       (progn
+         (insert TeX-esc "Verteiler" TeX-grop verteil TeX-grcl)
+         (newline-and-indent)))
+    (if (not (zerop (length anlage)))
+       (progn
+         (insert TeX-esc "Anlagen" TeX-grop anlage TeX-grcl)
+         (newline-and-indent)))
+    (if (string= fenster "ja")
+       (progn
+         (insert TeX-esc "Fenster")
+         (let ((retouradr (read-string "Retouradresse: " (user-full-name))))
+           (newline-and-indent)
+         (if (not (zerop (length retouradr)))
+             (progn
+               (insert TeX-esc "Retouradresse" TeX-grop retouradr TeX-grcl)
+               (newline-and-indent))))))
+    (if (not (zerop (length signature)))
+       (progn
+         (insert TeX-esc "signature" TeX-grop signature TeX-grcl)
+         (newline-and-indent)))
+    (if (not (zerop (length date)))
+       (progn
+         (insert TeX-esc "Datum" TeX-grop date TeX-grcl)
+         (newline-and-indent)))
+    (newline-and-indent)
+
+    (let ((indentation (current-column)))
+      (LaTeX-insert-environment
+       environment
+       (concat TeX-grop recipient
+              (if (not (zerop (length address)))
+                  (concat
+                   (if (not (zerop (length recipient)))
+                       (concat " " TeX-esc TeX-esc " "))
+                   address))
+              TeX-grcl))
+      (save-excursion                  ; Fix indentation of address
+       (if (search-backward TeX-grcl nil 'move)
+           (let ((addr-end (point-marker)))
+             (if (search-backward TeX-grop nil 'move)
+                 (let ((addr-column (current-column)))
+                   (while (search-forward
+                           (concat TeX-esc TeX-esc)
+                           (marker-position addr-end) 'move)
+                     (progn
+                       (newline)
+                       (indent-to addr-column))))))))
+      (insert "\n")
+      (indent-to indentation))
+    (insert TeX-esc "opening"
+           TeX-grop
+           (if (zerop (length opening))
+               (concat TeX-esc " ")
+             opening)
+           TeX-grcl "\n")
+
+    (indent-relative-maybe)
+    (save-excursion
+      (insert "\n" TeX-esc "closing"
+             TeX-grop
+             (if (zerop (length closing))
+                 (concat TeX-esc " ")
+               closing)
+             TeX-grcl "\n")
+      (indent-relative-maybe))))
+
+(defun LaTeX-today nil
+  "Return a string representing todays date according to flavor."
+  (interactive)
+   (let ((ctime-string (current-time-string))
+       (month-alist '(("Jan" . "Januar")
+                      ("Feb" . "Februar")
+                      ("Mar" . "M\\\"arz")
+                      ("Apr" . "April")
+                      ("May" . "Mai")
+                      ("Jun" . "Juni")
+                      ("Jul" . "Juli")
+                      ("Aug" . "August")
+                      ("Sep" . "September")
+                      ("Oct" . "Oktober")
+                      ("Nov" . "November")
+                      ("Dec" . "Dezember"))))
+    (string-match
+     "^\\S-+\\s-+\\(\\S-+\\)\\s-+\\(\\S-+\\)\\s-+\\S-+\\s-+\\(\\S-+\\)"
+     ctime-string)
+    (let ((year (substring ctime-string (match-beginning 3) (match-end 3)))
+         (month (substring ctime-string (match-beginning 1) (match-end 1)))
+         (day (substring ctime-string (match-beginning 2) (match-end 2))))
+      (if (assoc month month-alist)
+         (progn
+           (setq month (cdr (assoc month month-alist)))
+           (if (> 2 (length day))
+               (setq day (concat "0" day)))))
+      (format "Stuttgart, den %s. %s %s" day month year))))
+
+;;; dinbrief.el ends here
index 3c7022013b95ef31b459ed8bf3103e2e714d54d6..b342d87cfa9802e812056058050a0e5e4387d39e 100644 (file)
 
 (TeX-add-style-hook
  "doc"
- (function
-  (lambda ()
-    (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
-                '("macrocode" current-indentation))
-    (add-to-list 'LaTeX-indent-environment-list
-                '("macrocode*" current-indentation))
-    (add-hook 'LaTeX-after-insert-env-hooks 'LaTeX-doc-after-insert-macrocode
-             nil t)
-    (LaTeX-add-environments
-     "theglossary"
-     '("macrocode" LaTeX-env-no-comment)
-     '("macrocode*" LaTeX-env-no-comment)
-     '("macro" "Macro"))
-    (TeX-add-symbols
-     "EnableCrossrefs"
-     "DisableCrossrefs"
-     "DoNotIndex"
-     "DontCheckModules"
-     "CheckModules"
-     "Module"
-     '("DescribeMacro" "Macro")
-     '("DescribeEnv" "Environment")
-     "verbatim"
-     "verb"
-     "parg"
-     "oarg"
-     "marg"
-     "meta"
-     "cmd"
-     "makelabel"
-     "MacroFont"
-     "MacroFont"
-     "AltMacroFont"
-     "AltMacroFont"
-     "PrintMacroName"
-     "PrintDescribeMacro"
-     "PrintDescribeEnv"
-     "PrintEnvName"
-     "MakePrivateLetters"
-     "actualchar"
-     "quotechar"
-     "levelchar"
-     "encapchar"
-     "verbatimchar"
-     "SpecialIndex"
-     "SpecialMainIndex"
-     "SpecialMainEnvIndex"
-     "SpecialUsageIndex"
-     "SpecialEnvIndex"
-     "SortIndex"
-     "LeftBraceIndex"
-     "RightBraceIndex"
-     "PercentIndex"
-     "OldMakeindex"
-     "PercentIndex"
-     "IndexPrologue"
-     "IndexParms"
-     "subitem"
-     "subsubitem"
-     "indexspace"
-     "efill"
-     "pfill"
-     "PrintIndex"
-     '("changes" "version" "date (YYYY/MM/DD)")
-     "generalname"
-     "RecordChanges"
-     "GlossaryPrologue"
-     "GlossaryParms"
-     "PrintChanges"
-     "AlsoImplementation"
-     "StopEventually"
-     "OnlyDescription"
-     "Finale"
-     "IndexInput"
-     "maketitle"
-     "MakeShortVerb"
-     "DeleteShortVerb"
-     "MakeShortverb"
-     "DeleteShortverb"
-     "CheckSum"
-     "CharacterTable"
-     "CharTableChanges"
-     "CodelineNumbered"
-     "CodelineIndex"
-     "PageIndex"
-     "theCodelineNo"
-     "theCodelineNo"
-     "DocstyleParms"
-     "MakePercentIgnore"
-     "MakePercentComment"
-     "DocInput"
-     "DocInclude"
-     "GetFileInfo"
-     "filename"
-     "fileinfo"))))
+ (lambda ()
+   (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
+               '("macrocode" current-indentation))
+   (add-to-list 'LaTeX-indent-environment-list
+               '("macrocode*" current-indentation))
+   (add-hook 'LaTeX-after-insert-env-hooks 'LaTeX-doc-after-insert-macrocode
+            nil t)
+   (LaTeX-add-environments
+    "theglossary"
+    '("macrocode" LaTeX-env-no-comment)
+    '("macrocode*" LaTeX-env-no-comment)
+    '("macro" "Macro"))
+   (TeX-add-symbols
+    "EnableCrossrefs"
+    "DisableCrossrefs"
+    "DoNotIndex"
+    "DontCheckModules"
+    "CheckModules"
+    "Module"
+    '("DescribeMacro" "Macro")
+    '("DescribeEnv" "Environment")
+    "verbatim"
+    "verb"
+    "parg"
+    "oarg"
+    "marg"
+    "meta"
+    "cmd"
+    "makelabel"
+    "MacroFont"
+    "MacroFont"
+    "AltMacroFont"
+    "AltMacroFont"
+    "PrintMacroName"
+    "PrintDescribeMacro"
+    "PrintDescribeEnv"
+    "PrintEnvName"
+    "MakePrivateLetters"
+    "actualchar"
+    "quotechar"
+    "levelchar"
+    "encapchar"
+    "verbatimchar"
+    "SpecialIndex"
+    "SpecialMainIndex"
+    "SpecialMainEnvIndex"
+    "SpecialUsageIndex"
+    "SpecialEnvIndex"
+    "SortIndex"
+    "LeftBraceIndex"
+    "RightBraceIndex"
+    "PercentIndex"
+    "OldMakeindex"
+    "PercentIndex"
+    "IndexPrologue"
+    "IndexParms"
+    "subitem"
+    "subsubitem"
+    "indexspace"
+    "efill"
+    "pfill"
+    "PrintIndex"
+    '("changes" "version" "date (YYYY/MM/DD)")
+    "generalname"
+    "RecordChanges"
+    "GlossaryPrologue"
+    "GlossaryParms"
+    "PrintChanges"
+    "AlsoImplementation"
+    "StopEventually"
+    "OnlyDescription"
+    "Finale"
+    "IndexInput"
+    "maketitle"
+    "MakeShortVerb"
+    "DeleteShortVerb"
+    "MakeShortverb"
+    "DeleteShortverb"
+    "CheckSum"
+    "CharacterTable"
+    "CharTableChanges"
+    "CodelineNumbered"
+    "CodelineIndex"
+    "PageIndex"
+    "theCodelineNo"
+    "theCodelineNo"
+    "DocstyleParms"
+    "MakePercentIgnore"
+    "MakePercentComment"
+    "DocInput"
+    "DocInclude"
+    "GetFileInfo"
+    "filename"
+    "fileinfo")
+   (TeX-run-style-hooks "shortvrb")))
 
 ;; Local Variables:
 ;; coding: iso-8859-1
diff --git a/packages/auctex/style/epsf.el b/packages/auctex/style/epsf.el
new file mode 100644 (file)
index 0000000..f8b2c9f
--- /dev/null
@@ -0,0 +1,35 @@
+;;; epsf.el - Support for the epsf style option.
+
+;; Contributed by Marc Gemis <makke@wins.uia.ac.be>
+
+;;; Code: 
+
+(TeX-add-style-hook
+ "epsf"
+ (lambda ()
+   (TeX-add-symbols
+    '("epsfsize" TeX-arg-epsfsize)
+    '("epsffile" TeX-arg-file)
+    '("epsfbox" TeX-arg-file)
+    "epsflly" "epsfury" "testit" "epsfgetlitbb"
+    "epsfnormal" "epsfgetbb" "other" "epsfsetgraph"
+    "PsFragSpecialArgs" "epsfaux" "testit" "epsfgrab"
+    "epsfllx" "epsflly" "epsfury" "epsfverbosetrue")))
+
+(defun TeX-arg-epsfsize (optional &optional prompt definition)
+  "Create a line that print epsf figures at a certain percentage"
+  (interactive)
+  (let ((scale (read-string "Scale in percent (default 75): ")))
+    (setq scale (if (zerop (length scale)) "75" scale))
+    (save-excursion
+      ; append #1#{scale#1}
+      (insert "#1#2" TeX-grop "0." scale "#1" TeX-grcl)
+      ; insert \def before \epsfsize
+      (beginning-of-line 1)
+      (newline)
+      (insert TeX-esc "def")
+      (forward-line -1)
+      (insert "% From now on print figures at " scale "% of original size"))
+    (end-of-line)))
+
+;;; epsf.el ends here
diff --git a/packages/auctex/style/french.el b/packages/auctex/style/french.el
new file mode 100644 (file)
index 0000000..31a468a
--- /dev/null
@@ -0,0 +1,48 @@
+;;; french.el --- AUCTeX style for the `french' babel option.
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Author: Ralf Angeli <angeli@caeruleus.net>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2010-03-20
+;; 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:
+
+;; Set up AUCTeX for editing French text in connection with the
+;; `french' babel option.  The file basically loads the style file for
+;; the `frenchb' babel option.
+;; 
+;; Support for the FrenchPro package by Bernard Gaulle is _not_
+;; included.  If the presence of FrenchPro is detected, the `frenchb'
+;; support is not loaded.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "french"
+ (lambda ()
+   (when (and (member "babel" TeX-active-styles)
+             (not (member "frenchpro" TeX-active-styles))
+             (not (member "frenchle" TeX-active-styles))
+             (not (member "mlp" TeX-active-styles)))
+     (TeX-run-style-hooks "frenchb"))))
+
+;;; french.el ends here
index fcef8a1d33fba0de36a02fe93ab21430d3acdbc6..83f900241a287cbb45a4fe89fdebda664a3a54fb 100644 (file)
      "ThinSpaceInFrenchNumbers"
      "FrenchLayout"
      "StandardLayout")
-   (setq TeX-quote-language
-        `("french" "\\og "
-          (lambda ()
-            (concat "\\fg"
-                    (unless (member "xspace" TeX-active-styles) "{}")))
-          ,TeX-quote-after-quote))
+   (unless (eq (car TeX-quote-language) 'override)
+     (setq TeX-quote-language
+          `("french" "\\og "
+            (lambda ()
+              (concat "\\fg"
+                      (unless (member "xspace" TeX-active-styles) "{}")))
+            ,TeX-quote-after-quote)))
    (run-hooks 'TeX-language-fr-hook)))
 
 ;;; frenchb.el ends here
index 3676176d6b66db14e3fa83462c404e82ec8e545e..d1acbbfe4f0d92bd8ff86593b3fd1883e856ba3e 100644 (file)
             `("german" ,open-quote ,close-quote ,q-after-q))))
    (setq LaTeX-babel-hyphen-language "german")
    ;; Fontification of quotation marks.
-   (when (fboundp 'font-latex-add-quotes)
+   (when (and (eq TeX-install-font-lock 'font-latex-setup)
+             (featurep 'font-latex))
      (font-latex-add-quotes '("\"`" "\"'"))
-     (font-latex-add-quotes '("\">" "\"<" german)))
+     (font-latex-add-quotes '("\">" "\"<" german))
+     ;; Prevent "| from leading to color bleed.
+     (font-latex-add-to-syntax-alist (list (cons ?\" "\\"))))
    (run-hooks 'TeX-language-de-hook)))
 
 ;;; german.el ends here
index ce591e28c6c96b20768f3001ae7504749dfbe81d..b1f12bc00589301e82c3dd21abe87f448962dd24 100644 (file)
@@ -1,26 +1,27 @@
 ;;; harvard.el --- Support for Harvard Citation style package for AUCTeX.
 
-;; Copyright (C) 1994,1997,2005,2012  Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1997, 2005 Free Software Foundation, Inc.
 
-;; Harvard citation style is from Peter Williams
-;; available on the CTAN servers
+;; Author: Berwin Turlach <statba@nus.edu.sg>
+;; Maintainer: auctex-devel@gnu.org
+;; Keywords: tex
 
-;; Author: Berwin Turlach <berwin.turlach@anu.edu.au>
-;; Version: $Id: harvard.el,v 1.10 2008/02/03 14:53:30 angeli Exp $
+;; This file is part of AUCTeX.
 
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
+;; 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.
-;; 
-;; This program 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.
-;; 
+
+;; 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 this program; if not, write to the Free Software Foundation,
-;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+;; 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.
 
 ;;; Code:
 
index 6f4a9a12acd3ece135384d1a1716df93753bb3b9..f7750dd18eedce11bc12ab991e55d6f2f4cd35bd 100644 (file)
@@ -41,7 +41,8 @@
  "icelandic"
  (lambda ()
    (set-syntax-table LaTeX-icelandic-mode-syntax-table)
-   (setq TeX-quote-language '("icelandic" "\"`" "\"'" t))
+   (unless (eq (car TeX-quote-language) 'override)
+     (setq TeX-quote-language '("icelandic" "\"`" "\"'" t)))
    (setq LaTeX-babel-hyphen-language "icelandic")
    ;; Fontification of quotation marks.
    (when (fboundp 'font-latex-add-quotes)
diff --git a/packages/auctex/style/latexinfo.el b/packages/auctex/style/latexinfo.el
new file mode 100644 (file)
index 0000000..8903480
--- /dev/null
@@ -0,0 +1,181 @@
+;;; latexinfo.el - Support for LaTeXinfo files.
+
+;; Copyright (C) 1993 Marc Gemis <makke@wins.uia.ac.be>
+
+;; Author: Marc Gemis <makke@wins.uia.ac.be>
+;; Version: $Id: latexinfo.el,v 1.7 2008/02/03 14:53:30 angeli Exp $
+
+;; This program 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.
+;; 
+;; This program 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 this program; if not, write to the Free Software
+;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Code:
+
+;;; LaTeXinfo mode
+
+(defvar TeX-latexinfo-node-regexp
+  '("\\\\node[ \t]+\\([^,\n\r%]+\\)" 1 TeX-auto-label)
+  "Matches LaTeXinfo \\node commands, only current node will be found.
+We ignore next, previous and up fields.")
+
+(defvar LaTeXinfo-mode nil
+  "Non-nil means LaTeXinfo minor mode is active.")
+  (make-variable-buffer-local 'LaTeXinfo-mode)
+
+(defvar LaTeXinfo-mode-map nil
+  "Keymap containing LaTeXinfo commands.")
+
+(if LaTeXinfo-mode-map
+    ()
+  (setq LaTeXinfo-mode-map (make-sparse-keymap))
+  (define-key LaTeXinfo-mode-map "\C-c\C-u\C-b" 'latexinfo-format-buffer)
+  (define-key LaTeXinfo-mode-map "\C-c\C-u\C-r" 'latexinfo-format-region)
+  (define-key LaTeXinfo-mode-map "\C-c\C-u\C-s" 'latexinfo-show-structure)
+  (define-key LaTeXinfo-mode-map "\C-c\C-ud" 'makke:latexinfo-delete-structure)
+  (define-key LaTeXinfo-mode-map "\C-c\C-ug" 'latexinfo-goto-node)
+  (define-key LaTeXinfo-mode-map "\C-c\C-ui" 'makke:latexinfo-structure))
+
+(or (assq 'LaTeXinfo-mode minor-mode-map-alist)
+    (setq minor-mode-map-alist
+         (cons (cons 'LaTeXinfo-mode LaTeXinfo-mode-map)
+               minor-mode-map-alist)))
+
+(defun TeX-arg-latexinfo-index (optional &optional prompt)
+  "Prompt for a LaTeXinfo index type with completion."
+  (TeX-argument-insert
+   (completing-read (TeX-argument-prompt optional prompt "Index")
+                   '(("cp") ("vr") ("fn") ("tp") ("pg") ("ky"))
+                   nil t)
+   optional))
+
+(defun LaTeX-item-latexinfo-menu ()
+  "Insert a new menu item"
+  (insert "* ::")
+  (backward-char 2))
+
+(defun latexinfo-goto-node () ; temporarily here, later in latexinfo-upd.el ??
+  "Place pointer on the node given by the user, read node with completion
+This fails when the user types in the label of something else"
+  (interactive)
+  (let ((node-name (completing-read "Goto Node: " (LaTeX-label-list))))
+    (goto-char (point-min))
+    (if (re-search-forward
+        (concat
+         TeX-esc "node[ \\t]+" node-name ","
+         "\\|"
+         TeX-esc "label{" LaTeX-section-label node-name
+         "\\|"
+         TeX-esc "label{" node-name
+         )
+        (point-max) t)
+       (beginning-of-line 1)
+    (error "No such node"))))
+
+;;; Hook
+
+(TeX-add-style-hook "latexinfo"
+ (function
+  (lambda ()
+    (require 'latexinfo)
+    (require 'latexinfo-structure)
+
+    (require 'min-map)
+    (setq LaTeXinfo-mode t)
+    
+    (TeX-auto-add-regexp TeX-latexinfo-node-regexp)
+
+    (TeX-add-symbols
+     '("node"
+       (TeX-arg-literal " ")
+       (TeX-arg-free TeX-arg-define-label "Node name")
+       (TeX-arg-literal ", ")
+       (TeX-arg-free TeX-arg-label "Next node")
+       (TeX-arg-literal ", ")
+       (TeX-arg-free TeX-arg-label "Previous node")
+       (TeX-arg-literal ", ")
+       (TeX-arg-free TeX-arg-label "Up node"))
+     '("setfilename" TeX-arg-file)
+
+     '("var" t)
+     '("dfn" t)
+     '("emph" t)
+     '("kbd" t)
+     '("code" t)
+     '("samp" t)
+     '("key" t)
+     '("ctrl" t)
+     '("file" t)
+
+     '("comment"
+       (TeX-arg-literal " ")
+       (TeX-arg-free "Comment"))
+     '("c"
+       (TeX-arg-literal " ")
+       (TeX-arg-free "Comment"))
+
+     '("cindex" t)
+     '("cpsubindex" 2)
+     '("cpindexbold" t)
+
+     '("newindex" TeX-arg-latexinfo-index)
+
+     '("br" nil)
+     '("w" "Text")
+     '("dots" nil)
+     '("refill" nil)
+     '("bullet" nil)
+     '("copyright" nil)
+     '("sp" nil)
+
+     '("xref" TeX-arg-label)
+     '("pxref" TeX-arg-label)
+     '("inforef"
+       (TeX-arg-literal "{")
+       (TeX-arg-free "Name of node")
+       (TeX-arg-literal ", ")
+       (TeX-arg-free "Name for note")
+       (TeX-arg-literal ", ")
+       (TeX-arg-free TeX-arg-file "Info file")
+       (TeX-arg-literal "}")))
+
+    (LaTeX-add-environments "menu" "tex" "ignore" "ifinfo" "iftex"
+                           "example" "same" "display" "format")
+
+    ; Menu's have a special kind of items
+    (make-local-variable 'LaTeX-item-list)
+    (setq LaTeX-item-list (cons '("menu" . LaTeX-item-latexinfo-menu)
+                               LaTeX-item-list))
+
+    (make-local-variable 'TeX-font-list)
+    (setq TeX-font-list
+         (list (list ?\C-b (concat TeX-esc "b{") "}")
+               (list ?\C-c (concat TeX-esc "sc{") "}")
+               (list ?\C-e (concat TeX-esc "emph{") "}")
+               (list ?\C-i (concat TeX-esc "i{") "}")
+               (list ?\C-r (concat TeX-esc "r{") "}")
+               (list ?\C-s (concat TeX-esc "samp{") "}")
+               (list ?\C-t (concat TeX-esc "t{") "}")
+               (list ?s    (concat TeX-esc "strong{") "}")
+               (list ?\C-f (concat TeX-esc "file{") "}")
+               (list ?\C-d (concat TeX-esc "dfn{") "}")
+               (list ?\C-v (concat TeX-esc "var{") "}")
+               (list ?k    (concat TeX-esc "key{") "}")
+               (list ?\C-k (concat TeX-esc "kbd{") "}")
+               (list ?c    (concat TeX-esc "code{") "}")
+               (list ?C    (concat TeX-esc "cite{") "}")))
+
+    ;; need the following stuff to let xref and pxref work
+    (make-local-variable 'LaTeX-section-label)
+    (setq LaTeX-section-label ""))))
+
+;;; latexinfo.el ends here
index 76ab4d87cb43b92f75bb3687cbf1ad6d3269390c..67a9b5dc2e323b44cce5b0cd1cbcab63d6d63073 100644 (file)
@@ -1,6 +1,27 @@
 ;;; letter.el - Special code for letter style.
 
-;; $Id: letter.el,v 1.4 2008/05/25 06:50:33 angeli Exp $
+;; Copyright (C) 1993 Free Software Foundation, Inc.
+
+;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
+;; Maintainer: auctex-devel@gnu.org
+;; 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.
 
 ;;; Code:
 
@@ -46,7 +67,8 @@
          (newline-and-indent)))
     (if (not (zerop (length date)))
        (progn
-         (insert TeX-esc "def" TeX-esc "today" TeX-grop date TeX-grcl)
+         (insert TeX-esc "renewcommand" TeX-grop TeX-esc "today" TeX-grcl
+                 TeX-grop date TeX-grcl)
          (newline-and-indent)))
     (newline-and-indent)
 
diff --git a/packages/auctex/style/lettrine.el b/packages/auctex/style/lettrine.el
new file mode 100644 (file)
index 0000000..f595c43
--- /dev/null
@@ -0,0 +1,74 @@
+;;; lettrine.el --- AUCTeX style for `lettrine.sty'
+
+;; Copyright (C) 2011 Free Software Foundation, Inc.
+
+;; Author: Mads Jensen <mje@inducks.org>
+;; 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 `lettrine.sty'.
+
+;;; Code:
+
+(defvar LaTeX-lettrine-key-val-options
+  '(("lines")
+    ("lhang")
+    ("loversize")
+    ("lraise")
+    ("findent")
+    ("nindent")
+    ("slope")
+    ("ante")
+    ("image" ("true")))
+  "Key=value options for \\lettrine")
+
+(TeX-add-style-hook
+ "lettrine"
+ (lambda ()
+   (TeX-add-symbols
+    '("lettrine" [ TeX-arg-key-val LaTeX-lettrine-key-val-options ]
+      "Letter" "Text")
+    '("LettrineImageFalse" 0)
+    ;; all of the below can be configured with either \setlength or
+    ;; \renewcommand
+    '("LettrineFont" 0)
+    '("LettrineFontHook" 0)
+    '("LettrineTextFont" 0)
+    '("LettrineWidth" 0)
+    '("DefaultLhang" 0)
+    '("DefaultLoversize" 0)
+    '("DefaultLraise" 0)
+    '("DefaultFindent" 0)
+    '("DefaultNindent" 0)
+    '("DefaultSlope" 0)
+    ;; above settings can also be input a file, and pointed to with
+    ;; \renewcommand
+    '("DefaultOptionsFile" 0))
+
+   ;; Fontification
+   (when (and (fboundp 'font-latex-add-keywords)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("lettrine" "[{{")) 'textual))))
+
+(defvar LaTeX-lettrine-package-options nil
+  "Package options for the lettrine package.")
+
+;;; lettrine.el ends here
diff --git a/packages/auctex/style/multicol.el b/packages/auctex/style/multicol.el
new file mode 100644 (file)
index 0000000..5d73221
--- /dev/null
@@ -0,0 +1,62 @@
+;;; multicol.el --- AUCTeX style for `multicol.sty'
+
+;; Copyright (C) 2011 Free Software Foundation, Inc.
+
+;; Author: Mads Jensen <mje@inducks.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2011-01-24
+;; 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 `multicol.sty'.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "multicol"
+ (lambda ()
+   (LaTeX-add-environments
+    '("multicols" "Number of columns" [ "Text across columns" ]
+      [ "Local value for \\premulticols" ])
+    '("multicols*" "Number of columns" [ "Text across columns" ]
+      [ "Local value for \\premulticols" ]))
+
+   (TeX-add-symbols
+    '("multicoltolerance" 0)
+    '("multicolpretolerance" 0)
+    '("premulticols" 0)
+    '("postmulticols" 0)
+    '("multicolsep" 0)
+    '("multicolbaselineskip" 0)
+    '("multicolovershoot" 0)
+    '("multicolundershoot" 0)
+    '("columnsep" 0)
+    '("columnseprule" 0)
+    '("columnseprulecolor" 0)
+    '("raggedcolumns" 0)
+    '("flushcolumns" 0)
+    "columnbreak")))
+
+(defvar LaTeX-multicol-package-options
+  '("errorshow" "infoshow" "balancingshow" "markshow" "debugshow" "grid")
+  "Package options for the multicol package.")
+
+;;; multicol.el ends here
index 31243065406bea0b92f89157583a9bcb0209ab15..bf9971e267578cd4855cf4e5c7198e7ed4b3409b 100644 (file)
@@ -1,7 +1,28 @@
-;;; natbib.el --- Style hook for the NatBib package
-;;;
-;;; AUTHOR: Carsten Dominik <dominik@strw.leidenuniv.nl>
-;;;         building on older code from Berwin Turlach
+;;; natbib.el --- Style hook for the natbib package
+
+;; Copyright (C) 1997, 1998, 2004, 2007 Free Software Foundation, Inc.
+
+;; Authors: Berwin Turlach <statba@nus.edu.sg>
+;;          Carsten Dominik <dominik@strw.leidenuniv.nl>
+;; Maintainer: auctex-devel@gnu.org
+;; 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.
 
 ;;; Code:
 
index d6b972acf357b38bd547e74e0aea2d8d32e8f2f0..8acd2f56045782c48057e99f783a281003e9ed6e 100644 (file)
        (setq TeX-quote-language
             `("ngerman" ,open-quote ,close-quote ,q-after-q))))
    (setq LaTeX-babel-hyphen-language "ngerman")
-   ;; Fontification of quotation marks.
-   (when (fboundp 'font-latex-add-quotes)
+   ;; Fontification
+   (when (and (eq TeX-install-font-lock 'font-latex-setup)
+             (featurep 'font-latex))
      (font-latex-add-quotes '("\"`" "\"'"))
-     (font-latex-add-quotes '("\">" "\"<" german)))
+     (font-latex-add-quotes '("\">" "\"<" german))
+     ;; Prevent "| from leading to color bleed.
+     (font-latex-add-to-syntax-alist (list (cons ?\" "\\"))))
    (run-hooks 'TeX-language-de-hook)))
 
 ;;; ngerman.el ends here
index 312274af90cfe5c95c6edcc11a565a5ec0fc9c7a..1538f9c22f4b5f6a1bb6ff994702099d892fc564 100644 (file)
@@ -41,7 +41,8 @@
  "polish"
  (lambda ()
    (set-syntax-table LaTeX-polish-mode-syntax-table)
-   (setq TeX-quote-language '("polish" "\"`" "\"'" t))
+   (unless (eq (car TeX-quote-language) 'override)
+     (setq TeX-quote-language '("polish" "\"`" "\"'" t)))
    ;; Fontification of quotation marks.
    (when (fboundp 'font-latex-add-quotes)
      (font-latex-add-quotes '("\"`" "\"'"))
index 1f5d62ed159dc863be745a304f72d44b35c1f108..7b6fcfc0b04f7130fde362c6d6dcf22e7c9017ab 100644 (file)
@@ -45,7 +45,8 @@
     "pauza"
     "ppauza")
    ;; Quotation marks
-   (setq TeX-quote-language '("polski" ",," "''" t))
+   (unless (eq (car TeX-quote-language) 'override)
+     (setq TeX-quote-language '("polski" ",," "''" t)))
    ;; Fontification of quotation marks.
    (when (fboundp 'font-latex-add-quotes)
      (font-latex-add-quotes '(",," "''")))
diff --git a/packages/auctex/style/prosper.el b/packages/auctex/style/prosper.el
new file mode 100644 (file)
index 0000000..f01244a
--- /dev/null
@@ -0,0 +1,192 @@
+;;; prosper.el --- Prosper style file for AUCTeX
+
+;; Copyright (C) 2001, 2002 by Philip Lord, Nevin Kapur
+
+;; Authors:  Phillip Lord<p.lord@russet.org.uk>
+;;           Nevin Kapur <nevin@jhu.edu>
+;; Keywords: tex, wp, prosper
+;; Version: 0.6
+;; URL: http://www.mts.jhu.edu/~kapur/emacs/prosper.el
+
+;; This 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.
+
+;;; Commentary:
+
+;; This is a propser (http://prosper.sourceforge.net/) style file for
+;; AUCTeX.
+
+;;; Installation: 
+;; 
+;; For this file to work you need to have a working installation of 
+;; AucTeX. After that installtion is simple. Put this file into one of 
+;; the directories specified in `TeX-style-path', with the name 
+;; "style" rather than "auto" as it might get over written in the 
+;; latter.  
+;; 
+;; Then stick the current for into your .emacs 
+;; (eval-after-load "latex" 
+;;   '(add-to-list 'LaTeX-style-list '("prosper"))) 
+;;  
+;;
+;; And that should be it. You check whether it's worked or not by 
+;; opening a prosper document, and trying `LaTeX-environment'. "slide" 
+;; should be available by tab completion and it should ask you about 
+;; overlays.  
+;;
+;; The environment "prosper" should be inserted immediately after the
+;; document environment.  It will prompt you for options available
+;; under prosper and create a skeleton document.
+
+;;; Bugs:
+;;
+;; Currently the documentclass expansion doesn't work, unless you
+;; enter a documentclass line to let auctex know which style files to
+;; load. Then delete this and do it again. Not good. I know no way
+;; around this. 
+
+;;; Code:
+
+;; Constants:
+
+
+;;;; This is partly working now, and it a little neater than it
+;;;; was. The main problem is that the redefinition of "documentclass"
+;;;; does not happen until its all too late, so that stuff never
+;;;; happens correctly. This is easy enough to fix by fiddling with
+;;;; auctex. I shall have to download the latest version, and see if
+;;;; its already been fixed.
+
+
+
+(defconst LaTeX-prosper-version
+  "$Id: prosper.el,v 1.5 2008/05/25 06:50:33 angeli Exp $"
+  "prosper.el version.")
+
+(defconst LaTeX-prosper-transition-styles '("Split"
+                                         "Blinds"
+                                         "Box"
+                                         "Wipe"
+                                         "Dissolve"
+                                         "Glitter"
+                                         "Replace")
+  "List of transition styles provided by prosper.")
+
+(defconst LaTeX-prosper-slide-styles
+  '("alienglow" "autumn" "azure"
+    "contemporain" "darkblue" "default" "frames"
+    "lignesbleues" "nuancegris" "troispoints"
+    "alcatel" "gyom" "pascal" "rico"    
+    ))
+
+(defun LaTeX-prosper-insert-title (optional)
+  (newline)
+  (mapc (lambda(f)
+         (TeX-insert-macro f)
+         (newline))
+       '("title" "subtitle" "author" "email" "institution" "slideCaption"
+         "Logo" "DefaultTransition"))
+  (LaTeX-insert-environment "document")
+  (TeX-insert-macro "maketitle"))
+
+
+;; Utility functions
+(defun LaTeX-prosper-arg-pdftransition (environment)
+  (let ((default
+          (if (boundp 'LaTeX-prosper-transition-history)
+              (car LaTeX-prosper-transition-history)
+            "Replace")))
+    (TeX-argument-insert
+     (completing-read 
+      (TeX-argument-prompt nil 
+                           (format "Transition (Default %s) " default)
+                           t)
+      (mapcar 'list LaTeX-prosper-transition-styles)
+      nil
+      t
+      nil
+      'LaTeX-prosper-transition-history
+      default)
+     nil)))
+
+(defun LaTeX-prosper-slide-style-prompt()
+  (completing-read
+   "Slide Style?"
+   (mapcar 'list LaTeX-prosper-slide-styles)
+   nil nil nil nil "default" ))
+   
+   
+(defun LaTeX-prosper-insert-options(environment)
+  (insert "[" )
+  (insert (LaTeX-prosper-slide-style-prompt) " ")
+  (mapc (lambda(f)
+         (if (y-or-n-p (car f))
+             (insert (car (cdr f)) " ")))
+       '(("Draft?" "draft")
+         ("Color Slides?" "slideColor")
+         ("Disable running total on each slide?" "nototal")
+         ("Is the final version going to be PDF?" "pdf")
+         ("Are you going to use Adobe Distiller" "distiller")))
+  (delete-char -1)
+  (insert "]"))
+
+(defun LaTeX-prosper-insert-slide (environment) 
+  (if (y-or-n-p "Surround with overlay ?") 
+      (progn (TeX-insert-macro "overlays") 
+             (if (search-backward "{" 0 t) 
+                 (progn 
+                   (goto-char (+ 1 (point))) 
+                   (insert "%\n"))))) 
+  (let ((title (read-string "Title: "))) 
+    (LaTeX-insert-environment "slide" (concat TeX-grop title TeX-grcl)))) 
+
+
+
+;; AUCTeX configuration
+(TeX-add-style-hook "prosper"
+                   (function
+                    (lambda ()
+                      (LaTeX-add-environments
+                       '("slide" LaTeX-prosper-insert-slide)
+                       '("itemstep" LaTeX-env-item)
+                       '("Itemize" LaTeX-env-item))
+                       (TeX-add-symbols
+                        '("documentclass" 
+                          LaTeX-prosper-insert-options
+                          LaTeX-prosper-insert-title)
+                        '("title" "Title of the presentation")
+                       '("subtitle" "Subtitle of the presentation")
+                       '("author" "Author name")
+                       '("email" "Author email")
+                       '("institution" "Author institution")
+                       '("slideCaption" "Caption for slide")
+                       '("Logo" "Logo")
+                       '("displayVersion" TeX-arg-free)
+                       '("DefaultTransition"
+                         LaTeX-prosper-arg-pdftransition)
+                       '("NoFrenchBabelItemize" TeX-arg-free)
+                       '("part" LaTeX-prosper-arg-part)
+                       '("overlays" "Number of overlays" t)
+                       '("FontTitle" "Color slides" "Black & White Slides")
+                       '("FontText" "Color slides" "Black & White Slides")
+                       '("fontTitle" "Text")
+                       '("fontText" "Text")
+                       '("ColorFoot" "Color")
+                       '("PDFtransition" LaTeX-prosper-arg-pdftransition)
+                       '("myitem" "Level" "Definition")
+                       '("fromSlide" "Number" t)
+                       '("fromSlide*" "Number" t)
+                       '("onlySlide" "Number" t)
+                       '("onlySlide*" "Number" t)
+                       '("OnlySlide" "Number")
+                       '("UntilSlide" "Number")
+                       '("untilSlide*" "Number")
+                       '("PDForPS" TeX-arg-conditional)
+                       '("onlyInPS" t)
+                       '("onlyInPDF" t)
+                       '("FromSlide" "Number")))))
+
+
+;;; prosper.el ends here
diff --git a/packages/auctex/style/psfig.el b/packages/auctex/style/psfig.el
new file mode 100644 (file)
index 0000000..70fef60
--- /dev/null
@@ -0,0 +1,79 @@
+;;; psfig.el - Support for the psfig style option.
+
+;; Contributed by Marc Gemis <makke@wins.uia.ac.be>
+;; Please direct comments to him.
+
+;;; Code:
+
+(TeX-add-style-hook "psfig"
+ (function
+  (lambda ()
+       ;; probable some of the following symbols may be removed
+    (TeX-add-symbols "protect" "figurepath"  "fbox"
+                    "other" "letter" "other" "then" "Sine" "Cosine"
+                    "psdraft" "psfull" "psscalefirst" "psrotatefirst"
+                    "psnodraftbox" "psdraftbox" "pssilent" "psnoisy"
+                    "minmaxtest"
+     '("psfig" TeX-arg-psfig)
+     '("psfigurepath" t)
+                    )
+    (LaTeX-add-environments
+     '("psfigure" LaTeX-env-psfigure)
+     )
+    )))
+
+(defun TeX-arg-psfig (optional)
+   "Ask for file, width and length. Insert psfig macro"
+   (let ((psfile (read-file-name "PS-file: " "" "" nil))
+        (figwidth (read-string "Figure width: "))
+        (figheight (read-string "Figure height: "))
+        )
+
+     (insert TeX-grop "figure=" psfile)
+     (if (not (zerop (length figwidth)))
+        (insert ",width=" figwidth))
+     (if (not (zerop (length figheight)))
+        (insert ",height=" figheight))
+     (insert TeX-grcl)
+     )
+   )
+
+
+(defun LaTeX-env-psfigure (environment)
+  "Create  with \\label and \\caption and \\psfig commands."
+  (let ((float (read-string "Float to: " LaTeX-float))
+       (caption (read-string "Caption: "))
+       (label (read-string "Label: " LaTeX-figure-label))
+        ; gf: ask if this should be centered
+       (psfile (read-file-name "PS-file: " "" "" nil))
+       (figwidth (read-string "Figure width: "))
+       (figheight (read-string "Figure height: "))
+       )
+
+    (setq LaTeX-float (if (zerop (length float))
+                         LaTeX-float
+                       float))
+
+    (LaTeX-insert-environment "figure"
+                             (concat LaTeX-optop LaTeX-float LaTeX-optcl))
+
+    (insert TeX-esc "centerline" TeX-grop TeX-esc "psfig" TeX-grop
+           "figure=" psfile)
+    (if (not (zerop (length figwidth)))
+       (insert ",width=" figwidth))
+    (if (not (zerop (length figheight)))
+       (insert ",height=" figheight))
+    (insert TeX-grcl TeX-grcl)
+    (if (zerop (length caption))
+       ()
+      (newline-and-indent)
+      (insert TeX-esc "caption" TeX-grop caption TeX-grcl))
+    (if (or (zerop (length label))
+           (equal LaTeX-figure-label label))
+       ()
+      (newline-and-indent)
+      (insert TeX-esc "label" TeX-grop label TeX-grcl))
+
+    (forward-line 2)))
+
+;;; psfig.el ends here
diff --git a/packages/auctex/style/setspace.el b/packages/auctex/style/setspace.el
new file mode 100644 (file)
index 0000000..07db8ca
--- /dev/null
@@ -0,0 +1,61 @@
+;;; setspace.el --- AUCTeX style for `setspace.sty'
+
+;; Copyright (C) 2011 Free Software Foundation, Inc.
+
+;; Author: Mads Jensen <mje@inducks.org>
+;; Created: 2011-04-16
+;; 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 `setspace.sty'.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "setspace"
+ (lambda ()
+   (TeX-add-symbols
+    '("setstretch" "Stretch")
+    '("setdisplayskipstretch" "Stretch")
+    '("SetSinglespace" "Stretch")
+    '("onehalfspacing" 0)
+    '("doublespacing" 0)
+    '("singlespacing" 0))
+
+   (LaTeX-add-environments 
+    '("spacing" "Stretch")
+    "singlespace"
+    "singlespace*"
+    "onehalfspace"
+    "doublespace")
+
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("singlespacing" "")
+                               ("doublespacing" "")
+                               ("onehalfspacing" ""))
+                              'function))))
+
+(defvar LaTeX-setspace-package-options 
+  '("doublespacing" "onehalfspacing" "singlespacing" "nodisplayskipstretch")
+  "Package options for the setspace package.")
+
+;;; setspace.el ends here
index 57083a49224f6b5901b567b03d661613486ae78b..d14757310311cae2f1edabc5cf0824b1fd32944b 100644 (file)
@@ -3,7 +3,8 @@
 (TeX-add-style-hook
  "slovak"
  (lambda ()
-   (setq TeX-quote-language `("slovak" "\\uv{" "}" ,TeX-quote-after-quote))
+   (unless (eq (car TeX-quote-language) 'override)
+     (setq TeX-quote-language `("slovak" "\\uv{" "}" ,TeX-quote-after-quote)))
    (when (fboundp 'font-latex-add-quotes)
      (font-latex-add-quotes '("\"`" "\"'"))
      (font-latex-add-quotes '("\"<" "\">" french)))
index 01016328357de6c45b44b690dbefe292e567b840..75f633792f19f372693669edaf341db3e9864f51 100644 (file)
@@ -7,7 +7,8 @@
 (TeX-add-style-hook
  "swedish"
  (lambda ()
-   (setq TeX-quote-language
-        `("swedish" "''" ,TeX-close-quote ,TeX-quote-after-quote))
+   (unless (eq (car TeX-quote-language) 'override)
+     (setq TeX-quote-language
+          `("swedish" "''" ,TeX-close-quote ,TeX-quote-after-quote)))
    (setq LaTeX-babel-hyphen-language "swedish")
    (run-hooks 'TeX-language-sv-hook)))
index af44a993bc6a692f537619e34737aa2b029e5360..18f58bc211c3ff5b050d50b88203c1a6a69c0e10 100644 (file)
@@ -1,11 +1,10 @@
 ;;; virtex.el - Common code for all TeX formats.
 
-;; $Id: virtex.el,v 1.1 1994/01/23 08:14:44 amanda Exp $
+;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 
 ;;; Code:
 
 (TeX-add-style-hook "virtex"
- (function
   (lambda ()
     (TeX-add-symbols "/" "above" "abovedisplayshortskip"
                     "abovedisplayskip" "abovewithdelims" "accent"
@@ -78,6 +77,6 @@
                     "vcenter" "vfil" "vfill" "vfilneg" "vfuzz"
                     "voffset" "vrule" "vsize" "vskip" "vss" "vtop"
                     "wd" "widowpenalty" "write" "xdef" "xleaders"
-                    "xspaceskip" "year"))))
+                    "xspaceskip" "year")))
 
 ;;; virtex.el ends here
diff --git a/packages/auctex/style/xspace.el b/packages/auctex/style/xspace.el
new file mode 100644 (file)
index 0000000..15f9216
--- /dev/null
@@ -0,0 +1,51 @@
+;;; xspace.el --- AUCTeX style for `xspace.sty'
+
+;; Copyright (C) 2011 Free Software Foundation, Inc.
+
+;; Author: Mads Jensen <mje@inducks.org>
+;; Created: 2011-02-01
+;; 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 `xspace.sty'.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "xspace"
+ (lambda ()
+   (TeX-add-symbols
+    '("xspace" 0)
+    "xspaceaddexception"
+    "xspaceremoveexception")
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("xspace" "")
+                               ("xspaceaddexception" "{")
+                               ("xspaceremoveexception" "{"))
+                             'function))))
+
+(defvar LaTeX-xspace-package-options nil
+  "Package options for the xspace package.")
+
+;;; xspace.el ends here
index c1b7665b0900b6bdd7d50c1b0855ba7607692536..07f0502adac28aa6a194a2c807471fcb7dc5764e 100644 (file)
@@ -76,7 +76,7 @@
 
 (defun TeX-save-document (name)
   "Save all files belonging to the current document.
-Return non-nil if document need to be re-TeX'ed."
+Return non-nil if document needs to be re-TeX'ed."
   (interactive (list (TeX-master-file)))
   (if (string-equal name "")
       (setq name (TeX-master-file)))
@@ -366,36 +366,38 @@ without further expansion."
   command)
 
 (defun TeX-check-files (derived originals extensions)
-  "Check that DERIVED is newer than any of the ORIGINALS.
+  "Check if DERIVED is newer than any of the ORIGINALS.
 Try each original with each member of EXTENSIONS, in all directories
-in `TeX-check-path'."
-  (let ((found nil)
-       (regexp (concat "\\`\\("
-                       (mapconcat (lambda (dir)
-                                    (regexp-quote
-                                     (expand-file-name
-                                      (file-name-as-directory dir))))
-                                  TeX-check-path "\\|")
-                       "\\).*\\("
-                       (mapconcat 'regexp-quote originals "\\|")
-                       "\\)\\.\\("
-                       (mapconcat 'regexp-quote extensions "\\|")
-                       "\\)\\'"))
-       (buffers (buffer-list)))
+in `TeX-check-path'. Returns true if any of the ORIGINALS with any of the
+EXTENSIONS are newer than DERIVED. Will prompt to save the buffer of any
+ORIGINALS which are modified but not saved yet."
+  (let (existingoriginals
+        found
+       (extensions (TeX-delete-duplicate-strings extensions))
+        (buffers (buffer-list)))
+    (dolist (path (mapcar (lambda (dir)
+                           (expand-file-name (file-name-as-directory dir)))
+                         TeX-check-path))
+      (dolist (orig originals)
+       (dolist (ext extensions)
+         (let ((filepath (concat path orig "." ext)))
+           (if (file-exists-p filepath)
+                (setq existingoriginals (cons filepath existingoriginals)))))))
     (while buffers
       (let* ((buffer (car buffers))
-            (name (buffer-file-name buffer)))
-       (setq buffers (cdr buffers))
-       (if (and name (string-match regexp name))
-           (progn
-             (and (buffer-modified-p buffer)
-                  (or (not TeX-save-query)
-                      (y-or-n-p (concat "Save file "
-                                        (buffer-file-name buffer)
-                                        "? ")))
-                  (save-excursion (set-buffer buffer) (save-buffer)))
-             (if (file-newer-than-file-p name derived)
-                 (setq found t))))))
+             (name (buffer-file-name buffer)))
+        (setq buffers (cdr buffers))
+        (if (and name (member name existingoriginals))
+            (progn
+              (and (buffer-modified-p buffer)
+                   (or (not TeX-save-query)
+                       (y-or-n-p (concat "Save file "
+                                         (buffer-file-name buffer)
+                                         "? ")))
+                   (save-excursion (set-buffer buffer) (save-buffer)))))))
+    (dolist (eo existingoriginals)
+      (if (file-newer-than-file-p eo derived)
+          (setq found t)))
     found))
 
 (defcustom TeX-save-query t
@@ -407,34 +409,38 @@ in `TeX-check-path'."
 
 (defun TeX-command-query (name)
   "Query the user for what TeX command to use."
-  (let* ((default (cond ((if (string-equal name TeX-region)
-                            (TeX-check-files (concat name "." (TeX-output-extension))
-                                             (list name)
-                                             TeX-file-extensions)
-                          (TeX-save-document (TeX-master-file)))
-                        TeX-command-default)
-                       ((and (memq major-mode '(doctex-mode latex-mode))
-                             (TeX-check-files (concat name ".bbl")
-                                              (mapcar 'car
-                                                      (LaTeX-bibliography-list))
-                                              BibTeX-file-extensions))
-                        ;; We should check for bst files here as well.
-                        TeX-command-BibTeX)
-                       ((TeX-process-get-variable name
-                                                  'TeX-command-next
-                                                  TeX-command-Show))
-                       (TeX-command-Show)))
-        (completion-ignore-case t)
-        (answer (or TeX-command-force
-                    (completing-read
-                     (concat "Command: (default " default ") ")
-                     (TeX-mode-specific-command-list major-mode) nil t
-                     nil 'TeX-command-history))))
-    ;; If the answer "latex" it will not be expanded to "LaTeX"
+  (let* ((default
+          (cond ((if (string-equal name TeX-region)
+                     (TeX-check-files (concat name "." (TeX-output-extension))
+                                      (list name)
+                                      TeX-file-extensions)
+                   (TeX-save-document (TeX-master-file)))
+                 TeX-command-default)
+                ((and (memq major-mode '(doctex-mode latex-mode))
+                      ;; Want to know if bib file is newer than .bbl
+                      ;; We don't care whether the bib files are open in emacs
+                      (TeX-check-files (concat name ".bbl")
+                                       (mapcar 'car
+                                               (LaTeX-bibliography-list))
+                                       (append BibTeX-file-extensions
+                                               TeX-Biber-file-extensions)))
+                 ;; We should check for bst files here as well.
+                 (if LaTeX-using-Biber TeX-command-Biber TeX-command-BibTeX))
+                ((TeX-process-get-variable name
+                                           'TeX-command-next
+                                           TeX-command-Show))
+                (TeX-command-Show)))
+         (completion-ignore-case t)
+         (answer (or TeX-command-force
+                     (completing-read
+                      (concat "Command: (default " default ") ")
+                      (TeX-mode-specific-command-list major-mode) nil t
+                      nil 'TeX-command-history))))
+    ;; If the answer is "latex" it will not be expanded to "LaTeX"
     (setq answer (car-safe (TeX-assoc answer TeX-command-list)))
     (if (and answer
-            (not (string-equal answer "")))
-       answer
+             (not (string-equal answer "")))
+        answer
       default)))
 
 (defvar TeX-command-next nil
@@ -673,6 +679,14 @@ run of `TeX-run-TeX', use
        process
       (TeX-synchronous-sentinel name file process))))
 
+(defun TeX-run-Biber (name command file)
+  "Create a process for NAME using COMMAND to format FILE with Biber." 
+  (let ((process (TeX-run-command name command file)))
+    (setq TeX-sentinel-function 'TeX-Biber-sentinel)
+    (if TeX-process-asynchronous
+        process
+      (TeX-synchronous-sentinel name file process))))
+
 (defun TeX-run-compile (name command file)
   "Ignore first and third argument, start compile with second argument."
   (compile command))
@@ -796,7 +810,7 @@ reasons.  Use `TeX-run-function' instead."
 
 (defun TeX-synchronous-sentinel (name file result)
   "Process TeX command output buffer after the process dies."
-  (let* ((buffer (TeX-process-buffer file)))
+  (let ((buffer (TeX-process-buffer (file-name-nondirectory file))))
     (save-excursion
       (set-buffer buffer)
 
@@ -938,6 +952,21 @@ Warnings can be indicated by LaTeX or packages."
 (defun TeX-LaTeX-sentinel (process name)
   "Cleanup TeX output buffer after running LaTeX."
   (cond ((TeX-TeX-sentinel-check process name))
+       ((and (save-excursion
+               (re-search-forward
+                "^Package biblatex Warning: Please (re)run Biber on the file"
+                nil t))
+             (with-current-buffer TeX-command-buffer
+               (and (LaTeX-bibliography-list)
+                    (TeX-check-files (TeX-master-file "bbl")
+                                     (TeX-style-list)
+                                     (append TeX-file-extensions
+                                             BibTeX-file-extensions
+                                             TeX-Biber-file-extensions)))))
+        (message "%s%s" "You should run Biber to get citations right, "
+                 (TeX-current-pages))
+        (setq TeX-command-next (with-current-buffer TeX-command-buffer
+                                 TeX-command-Biber)))
        ((and (save-excursion
                (re-search-forward
                 "^\\(?:LaTeX\\|Package natbib\\) Warning: Citation" nil t))
@@ -946,11 +975,19 @@ Warnings can be indicated by LaTeX or packages."
                     (TeX-check-files (TeX-master-file "bbl")
                                      (TeX-style-list)
                                      (append TeX-file-extensions
-                                             BibTeX-file-extensions)))))
+                                             BibTeX-file-extensions
+                                             TeX-Biber-file-extensions)))))
         (message "%s%s" "You should run BibTeX to get citations right, "
                  (TeX-current-pages))
         (setq TeX-command-next (with-current-buffer TeX-command-buffer
                                  TeX-command-BibTeX)))
+  ((re-search-forward "Package biblatex Warning: Please rerun LaTeX" nil t)
+        (message "%s%s" "You should run LaTeX again, " (TeX-current-pages))
+        (setq TeX-command-next TeX-command-default))
+       ((re-search-forward "^(biblatex)\\W+Page breaks have changed" nil t)
+        (message "%s%s" "You should run LaTeX again - page breaks have changed, "
+                 (TeX-current-pages))
+        (setq TeX-command-next TeX-command-default))
        ((re-search-forward "^\\(?:LaTeX Warning: Label(s)\\|\
 Package natbib Warning: Citation(s)\\)" nil t)
         (message "%s%s" "You should run LaTeX again to get references right, "
@@ -1008,8 +1045,32 @@ changed\\. Rerun LaTeX\\." nil t)
              "\\<TeX-mode-map>\\[TeX-recenter-output-buffer]")))
    (t
     (message (concat "BibTeX finished successfully. "
-                    "Run LaTeX again to get citations right."))))
-  (setq TeX-command-next TeX-command-default))
+                    "Run LaTeX again to get citations right."))
+  (setq TeX-command-next TeX-command-default))))
+
+(defun TeX-Biber-sentinel (process name)
+  "Cleanup TeX output buffer after running Biber."
+  (goto-char (point-max))
+  (cond
+   ((re-search-backward (concat
+                         "^INFO - \\(WARNINGS\\|ERRORS\\): \\([0-9]+\\)") nil t)
+    (message (concat "Biber finished with %s %s. "
+                     "Type `%s' to display output.")
+             (match-string 2) (downcase (match-string 1))
+             (substitute-command-keys
+              "\\<TeX-mode-map>\\[TeX-recenter-output-buffer]"))
+    (setq TeX-command-next TeX-command-default))
+   ((re-search-backward (concat
+                         "^FATAL") nil t)
+    (message (concat "Biber had a fatal error and did not finish! "
+                     "Type `%s' to display output.")
+             (substitute-command-keys
+              "\\<TeX-mode-map>\\[TeX-recenter-output-buffer]"))
+    (setq TeX-command-next TeX-command-Biber))
+   (t
+    (message (concat "Biber finished successfully. "
+                     "Run LaTeX again to get citations right."))
+    (setq TeX-command-next TeX-command-default))))
 
 ;;; Process Control
 
@@ -1114,7 +1175,7 @@ command."
        ;; Remove line breaks at column 79
        (while (> (point) pt)
          (end-of-line 0)
-         (when (and (= (current-column) 79)
+         (when (and (= (- (point) (line-beginning-position)) 79)
                     ;; Heuristic: Don't delete the linebreak if the
                     ;; next line is empty or starts with an opening
                     ;; parenthesis or if point is located after a period.
@@ -1491,7 +1552,7 @@ You might want to examine and modify the free variables `file',
         
         ;; End of file -- Pop from stack
         ((match-beginning 4)
-         (when (> (length TeX-error-file) 1)
+         (when (> (length TeX-error-file) 0)
            (pop TeX-error-file)
            (pop TeX-error-offset))
          (goto-char (match-end 4))
@@ -1634,6 +1695,9 @@ You might want to examine and modify the free variables `file',
     (goto-char error-point)
     (setq TeX-error-point (point))
 
+    (unless file
+      (error "Could not determine file for warning"))
+
     ;; Go back to TeX-buffer
     (let ((runbuf (current-buffer))
          (master (with-current-buffer
index 0b8de3a002b9e67051705dd5be5c1e33089b9508..8856895041f26b79cab169d3719c2aa3f48533ee 100644 (file)
@@ -1,6 +1,7 @@
 ;;; tex-fold.el --- Fold TeX macros.
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Free Software
+;;   Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -763,21 +764,21 @@ Return non-nil if a removal happened, nil otherwise."
 Replace them with the respective macro argument."
   (let ((spec-list (split-string spec "||"))
        (delims '((?{ . ?}) (?[ . ?]) (?< . ?>) (?\( . ?\))))
-       match-end success)
+       index success)
     (catch 'success
       ;; Iterate over alternatives.
       (dolist (elt spec-list)
-       (setq spec elt)
+       (setq spec elt
+             index nil)
        ;; Find and expand every placeholder.
-       (while (and (string-match "\\([[{<]\\)\\([1-9]\\)\\([]}>]\\)" elt
-                                 match-end)
-                   ;; Does the closing delim fit to the opening one?
+       (while (and (string-match "\\([[{<]\\)\\([1-9]\\)\\([]}>]\\)" elt index)
+                   ;; Does the closing delim match the opening one?
                    (string-equal
                     (match-string 3 elt)
                     (char-to-string
                      (cdr (assq (string-to-char (match-string 1 elt))
                                 delims)))))
-         (setq match-end (match-beginning 0))
+         (setq index (match-end 0))
          (let ((arg (car (save-match-data
                            ;; Get the argument.
                            (TeX-fold-macro-nth-arg
@@ -788,6 +789,7 @@ Replace them with the respective macro argument."
            (when arg (setq success t))
            ;; Replace the placeholder in the string.
            (setq elt (replace-match (or arg TeX-fold-ellipsis) nil t elt)
+                 index (+ index (- (length elt) (length spec)))
                  spec elt)))
        (when success (throw 'success nil))))
     spec))
@@ -882,9 +884,10 @@ Remove the respective properties from the overlay OV."
                        (and (boundp 'global-disable-point-adjustment)
                             global-disable-point-adjustment)
                        ;; See preview.el on how to make this configurable.
-                       (memq this-command (list (key-binding [left])
-                                                (key-binding [right])
-                                                'mouse-set-point)))
+                       (memq this-command
+                             (list (key-binding [left]) (key-binding [right])
+                                   'backward-char 'forward-char
+                                   'mouse-set-point)))
                ;; Open new overlays.
                (dolist (ol (nconc (when (and TeX-fold-unfold-around-mark
                                              (boundp 'mark-active)
diff --git a/packages/auctex/tex-fptex.el b/packages/auctex/tex-fptex.el
deleted file mode 100644 (file)
index b00ed6d..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-;;; tex-fptex.el --- fpTeX support for AUCTeX.
-
-;; Copyright (C) 2000, 2004, 2012 Free Software Foundation, Inc.
-
-;; Author: Fabrice Popineau <Fabrice.Popineau@supelec.fr>
-;; Maintainer: auctex-devel@gnu.org
-;; 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 contains variables customized for fpTeX.
-
-;;; Code:
-
-(defmacro parent-directory (f)
-  "Return safe parent directory of the directory given as argument."
-  `(directory-file-name
-    (file-name-directory
-     (directory-file-name ,f))))
-
-(unless (get 'TeX-lisp-directory 'saved-value)
-  (setq-default TeX-lisp-directory
-               (concat (parent-directory (invocation-directory))
-                       "/site-lisp/auctex")))
-
-  ;; Remove the Queue entry from the default, and make a non-Unix
-  ;; specific print entry, assuming that dvips will print by default.
-(unless (get 'TeX-queue-command 'saved-value)
-  (setq TeX-queue-command nil))
-
-(unless (get 'TeX-printer-list 'saved-value)
-  (setq TeX-printer-list nil))
-
-(unless (get 'TeX-print-command 'saved-value)
-  (setq TeX-print-command
-       "dvips %d"))
-
-(unless (get 'TeX-view-style 'saved-value)
-  (setq TeX-view-style '(("^a5\\(?:comb\\|paper\\)?$" "windvi %d -qpaper a5")
-                        ("^landscape$" "windvi %d -qpaper a4r -s 4")
-                        ("^epsf$" "start \"\" %f")
-                        ("." "windvi %d"))))
-
-(unless (get 'TeX-output-view-style 'saved-value)
-  (setq TeX-output-view-style
-       '(("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$" "dvips %d -o && start \"\" %f")
-         ("^dvi$" ("^a5\\(?:comb\\|paper\\)$" "^landscape$")
-          "windvi %d %dS -qpaper a5r -s 0")
-         ("^dvi$" "^a5\\(?:comb\\|paper\\)$" "windvi %d %dS -qpaper a5")
-         ("^dvi$" "^b5paper$" "windvi %d %dS -qpaper b5")
-         ("^dvi$" ("^landscape$" "^pstricks$\\|^psfrag$")
-          "dvips -t landscape %d -o && start \"\" %f")
-         ("^dvi$" "^letterpaper$" "windvi %d %dS -qpaper us")
-         ("^dvi$" "^legalpaper$" "windvi %d %dS -qpaper legal")
-         ("^dvi$" "^executivepaper$" "windvi %d %dS -qpaper 7.25x10.5in")
-         ("^dvi$" "^landscape$" "windvi %d %dS -qpaper a4r")
-         ("^dvi$" "." "windvi %d %dS")
-         ("^pdf$" "." "start \"\" %o")
-         ("^html?$" "." "start \"\" %o"))))
-
-;; WinDVI does not support source specials?
-(unless (get 'TeX-source-specials-view-position-flags 'saved-value)
-  (setq TeX-source-specials-view-position-flags ""))
-
-(unless (get 'TeX-source-specials-view-editor-flags 'saved-value)
-  (setq TeX-source-specials-view-editor-flags ""))
-
-(unless (get 'TeX-kpathsea-path-delimiter 'saved-value)
-  (setq TeX-kpathsea-path-delimiter ";"))
-
-(provide 'tex-fptex)
-(require 'tex-site)
-
-;;; tex-fptex.el ends here
index 6f7b8497e2ab0d7b04b5eb0961f0434f32bba0a5..6649b4088868f89035439abcb7bda4e6d7bdf1d1 100644 (file)
@@ -1,7 +1,7 @@
 ;;; tex-info.el --- Support for editing Texinfo source.
 
-;; Copyright (C) 1993, 1994, 1997, 2000, 2001,
-;;               2004, 2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1994, 1997, 2000, 2001, 2004, 2005, 2006, 2011
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Keywords: tex
@@ -49,7 +49,7 @@
     ("ifxml") ("ignore") ("itemize") ("lisp") ("macro") ("menu")
     ("multitable") ("quotation") ("smalldisplay") ("smallexample")
     ("smallformat") ("smalllisp") ("table") ("tex") ("titlepage")
-    ("verbatim") ("vtable")) 
+    ("verbatim") ("vtable"))
   "Alist of Texinfo environments.")
 
 (defconst texinfo-environment-regexp
@@ -112,14 +112,18 @@ With optional ARG, modify current environment."
   (let* ((envs (mapcar 'car Texinfo-environment-list))
         (regexp (concat "^[ \t]*" (regexp-quote TeX-esc) "\\(end \\)*"
                         (regexp-opt envs t) "\\b"))
+        (orig-pos (point))
         (level 1)
         case-fold-search)
     (save-restriction
       (save-excursion
        (save-excursion
          (beginning-of-line)
+         ;; Stop if point is inside of an @end <env> command, but not
+         ;; if it is behind it.
          (when (and (looking-at regexp)
-                    (match-string 1))
+                    (match-string 1)
+                    (> (match-end 0) orig-pos))
            (setq level 0)))
        (while (and (> level 0) (re-search-forward regexp nil t))
          (if (match-string 1)
@@ -128,30 +132,163 @@ With optional ARG, modify current environment."
       (if (= level 0)
          (goto-char (match-end 0))
        (error "Can't locate end of current environment")))))
-      
+
 (defun Texinfo-find-env-start ()
   "Move point to the start of the current environment."
   (interactive)
   (let* ((envs (mapcar 'car Texinfo-environment-list))
-        (regexp (concat "^[ \t]*" (regexp-quote TeX-esc) "\\(end \\)*"
+        (regexp (concat "^[ \t]*\\(" (regexp-quote TeX-esc) "\\)\\(end \\)*"
                         (regexp-opt envs t) "\\b"))
         (level 1)
+        (orig-pos (point))
         case-fold-search)
     (save-restriction
       (save-excursion
        (save-excursion
          (beginning-of-line)
+         ;; Stop if point is inside of an @<env> command, but not if
+         ;; it is before it.
          (when (and (looking-at regexp)
-                    (not (match-string 1)))
+                    (not (match-string 2))
+                    (< (match-beginning 1) orig-pos))
            (setq level 0)))
        (while (and (> level 0) (re-search-backward regexp nil t))
-         (if (match-string 1)
+         (if (match-string 2)
              (setq level (1+ level))
            (setq level (1- level)))))
       (if (= level 0)
          (goto-char (match-beginning 0))
        (error "Can't locate start of current environment")))))
 
+(defun Texinfo-mark-environment (&optional count)
+  "Set mark to end of current environment and point to the matching begin.
+If prefix argument COUNT is given, mark the respective number of
+enclosing environments.  The command will not work properly if
+there are unbalanced begin-end pairs in comments and verbatim
+environments."
+  ;; TODO:
+  ;; This is identical to the LaTeX counterpart but for the find begin/end
+  ;; functions. So some day the implemenation should be factorized.
+  (interactive "p")
+  (setq count (if count (abs count) 1))
+  (let ((cur (point)) beg end)
+    ;; Only change point and mark after beginning and end were found.
+    ;; Point should not end up in the middle of nowhere if the search fails.
+    (save-excursion
+      (dotimes (c count)
+       (Texinfo-find-env-end))
+      (setq end (line-beginning-position 2))
+      (goto-char cur)
+      (dotimes (c count)
+       (Texinfo-find-env-start)
+       (unless (= (1+ c) count)
+         (beginning-of-line 0)))
+      (setq beg (point)))
+    (set-mark end)
+    (goto-char beg)
+    (TeX-activate-region)))
+
+(defun Texinfo-mark-section (&optional no-subsection)
+  "Mark current section, with inclusion of any containing node.
+
+The current section is detected as starting by any of the
+structuring commands matched by regexp in variable
+`outline-regexp' which in turn is a regexp matching any element
+of variable `texinfo-section-list'.
+
+If optional argument NO-SUBSECTION is set to any integer or is a
+non nil empty argument (i.e. `C-u \\[Texinfo-mark-section]'),
+then mark the current section with exclusion of any subsections.
+
+Otherwise, any included subsections are also marked along with
+current section.
+
+Note that when current section is starting immediatley after a
+node commande, then the node command is also marked as part as
+the section."
+  (interactive "P")
+  (let (beg end is-beg-section is-end-section
+           (section-re (concat "^\\s-*" outline-regexp)))
+    (if (and (consp no-subsection) (eq (car no-subsection) 4))
+       ;; section with exclusion of any subsection
+       (setq beg (save-excursion
+                   (unless (looking-at section-re)
+                     (end-of-line))
+                   (re-search-backward section-re nil t))
+             is-beg-section t
+             end (save-excursion
+                   (beginning-of-line)
+                   (when
+                       (re-search-forward (concat section-re
+                                                  "\\|^\\s-*@bye\\_>" ) nil t)
+                     (save-match-data
+                       (beginning-of-line)
+                       (point))))
+             is-end-section (match-string 1))
+      ;; full section without exclusion of any subsection
+      (let (section-command-level)
+       (setq beg
+             (save-excursion
+               (end-of-line)
+               (re-search-backward section-re nil t)))
+       (when beg
+         (setq is-beg-section t
+               section-command-level
+               (cadr (assoc (match-string 1) texinfo-section-list))
+               end
+               (save-excursion
+                 (beginning-of-line)
+                 (while
+                     (and (re-search-forward
+                           (concat section-re "\\|^\\s-*@bye\\_>" ) nil t)
+                          (or (null (setq is-end-section  (match-string 1)))
+                              (> (cadr (assoc is-end-section
+                                              texinfo-section-list))
+                                 section-command-level))))
+                 (when (match-string 0)
+                   (beginning-of-line)
+                   (point)))))));  (if ...)
+    (when (and beg end)
+      ;; now take also enclosing node of beg and end
+      (dolist
+         (boundary '(beg end))
+       (when (symbol-value (intern (concat "is-" (symbol-name boundary)
+                                           "-section")))
+         (save-excursion
+           (goto-char (symbol-value boundary))
+           (while
+               (and
+                (null (bobp))
+                (progn
+                  (beginning-of-line 0)
+                  (looking-at "^\\s-*\\($\\|@\\(c\\|comment\\)\\_>\\)"))))
+           (when  (looking-at "^\\s-*@node\\_>")
+             (set boundary (point))))))
+
+      (set-mark end)
+      (goto-char beg)
+      (TeX-activate-region) )))
+
+(defun Texinfo-mark-node ()
+  "Mark the current node.  \
+This is the node in which the pointer is.  It is starting at
+previous beginning of keyword `@node' and ending at next
+beginning of keyword `@node' or `@bye'."
+  (interactive)
+  (let ((beg (save-excursion
+              (unless (looking-at "^\\s-*@\\(?:node\\)\\_>")
+                (end-of-line))
+              (re-search-backward "^\\s-*@\\(?:node\\)\\_>" nil t )))
+       (end (save-excursion
+              (beginning-of-line)
+              (and (re-search-forward "^\\s-*@\\(?:node\\|bye\\)\\_>" nil t )
+                   (progn (beginning-of-line) (point))))))
+
+    (when (and beg end)
+      (set-mark end)
+      (goto-char beg)
+      (TeX-activate-region) )))
+
 (defun Texinfo-insert-node ()
   "Insert a Texinfo node in the current buffer.
 That means, insert the string `@node' and prompt for current,
@@ -206,6 +343,70 @@ for @node."
              (progn (skip-chars-forward "^,") (forward-char 2))
            (throw 'break nil)))))))
 
+;; Silence the byte-compiler from warnings for variables and functions declared
+;; in reftex.
+(eval-when-compile
+  (defvar reftex-section-levels-all)
+  (defvar reftex-level-indent)
+  (defvar reftex-label-menu-flags)
+  (defvar reftex-tables-dirty)
+
+  (when (fboundp 'declare-function)
+    (declare-function reftex-match-string "reftex" (n))
+    (declare-function reftex-section-number "reftex-parse" (&optional level star))
+    (declare-function reftex-nicify-text "reftex" (text))
+    (declare-function reftex-ensure-compiled-variables "reftex" ())))
+
+(defun Texinfo-reftex-section-info (file)
+  ;; Return a section entry for the current match.
+  ;; Carefull: This function expects the match-data to be still in place!
+  (let* ((marker (set-marker (make-marker) (1- (match-beginning 3))))
+         (macro (reftex-match-string 3))
+         (level-exp (cdr (assoc macro reftex-section-levels-all)))
+         (level (if (symbolp level-exp)
+                    (save-match-data (funcall level-exp))
+                  level-exp))
+         (unnumbered  (< level 0))
+         (level (abs level))
+         (section-number (reftex-section-number level unnumbered))
+         (text1 (save-match-data
+                  (save-excursion
+                   (buffer-substring-no-properties (point) (progn (end-of-line) (point))))))
+         (literal (buffer-substring-no-properties
+                   (1- (match-beginning 3))
+                   (min (point-max) (+ (match-end 0) (length text1) 1))))
+         ;; Literal can be too short since text1 too short. No big problem.
+         (text (reftex-nicify-text text1)))
+
+    ;; Add section number and indentation
+    (setq text
+          (concat
+           (make-string (* reftex-level-indent level) ?\ )
+           (if (nth 1 reftex-label-menu-flags) ; section number flag
+               (concat section-number " "))
+           text))
+    (list 'toc "toc" text file marker level section-number
+          literal (marker-position marker))))
+
+(defun Texinfo-reftex-hook ()
+  "Hook function to plug Texinfo into RefTeX."
+  ;; force recompilation of variables
+  (when (string= TeX-base-mode-name "Texinfo")
+    (dolist (v `((reftex-section-pre-regexp . "@")
+                ; section post-regexp must contain exactly one group
+                (reftex-section-post-regexp . "\\([ \t]+\\)")
+                (reftex-section-info-function . Texinfo-reftex-section-info)
+              (reftex-section-levels
+               . ,(mapcar
+                   (lambda (x)
+                     (if (string-match "\\(\\`unnumbered\\)\\|\\(heading\\'\\)\\|\\(\\`top\\'\\)"
+                                       (car x))
+                         (cons (car x) (- (cadr x)))
+                       (cons (car x) (cadr x))))
+                   texinfo-section-list))))
+      (set (make-local-variable (car v) ) (cdr v)))
+    (setq reftex-tables-dirty t)
+    (reftex-ensure-compiled-variables)))
 
 ;;; Keymap:
 
@@ -223,6 +424,9 @@ for @node."
 
     ;; Simulating LaTeX-mode
     (define-key map "\C-c\C-e" 'Texinfo-environment)
+    (define-key map "\C-c." 'Texinfo-mark-environment)
+    (define-key map "\C-c*" 'Texinfo-mark-section)
+    (define-key map "\M-\C-h" 'Texinfo-mark-node)
     (define-key map "\C-c\n"   'texinfo-insert-@item)
     (or (key-binding "\e\r")
        (define-key map "\e\r" 'texinfo-insert-@item)) ;*** Alias
@@ -310,7 +514,7 @@ for @node."
     (?C    "@cite{" "}")
     (?\C-d "" "" t))
   "Font commands used in Texinfo mode.  See `TeX-font-list'.")
-  
+
 ;;; Mode:
 
 ;;;###autoload
@@ -334,10 +538,10 @@ value of `Texinfo-mode-hook'."
   (use-local-map Texinfo-mode-map)
   (set-syntax-table texinfo-mode-syntax-table)
   (make-local-variable 'page-delimiter)
-  (setq page-delimiter 
-       (concat 
-        "^@node [ \t]*[Tt]op\\|^@\\(" 
-        texinfo-chapter-level-regexp 
+  (setq page-delimiter
+       (concat
+        "^@node [ \t]*[Tt]op\\|^@\\("
+        texinfo-chapter-level-regexp
         "\\)"))
   (make-local-variable 'require-final-newline)
   (setq require-final-newline t)
@@ -376,13 +580,13 @@ value of `Texinfo-mode-hook'."
       ;; This was included in 19.31.
       ()
     (make-local-variable 'outline-regexp)
-    (setq outline-regexp 
+    (setq outline-regexp
          (concat "@\\("
                  (mapconcat 'car texinfo-section-list "\\>\\|")
                  "\\>\\)"))
     (make-local-variable 'outline-level)
     (setq outline-level 'texinfo-outline-level))
-  
+
   ;; Mostly AUCTeX stuff
   (easy-menu-add Texinfo-mode-menu Texinfo-mode-map)
   (easy-menu-add Texinfo-command-menu Texinfo-mode-map)
@@ -401,7 +605,7 @@ value of `Texinfo-mode-hook'."
   (setq TeX-command-default "TeX")
   (setq TeX-header-end "%*end")
   (setq TeX-trailer-start (regexp-quote (concat TeX-esc "bye")))
-  
+
   (make-local-variable 'TeX-complete-list)
   (setq TeX-complete-list
        (list (list "@\\([a-zA-Z]*\\)" 1 'TeX-symbol-list nil)
@@ -411,7 +615,7 @@ value of `Texinfo-mode-hook'."
   (setq TeX-font-list Texinfo-font-list)
   (make-local-variable 'TeX-font-replace-function)
   (setq TeX-font-replace-function 'TeX-font-replace-macro)
-  
+
   (add-hook 'find-file-hooks (lambda ()
                               (unless (file-exists-p (buffer-file-name))
                                 (TeX-master-file nil nil t))) nil t)
@@ -540,7 +744,12 @@ value of `Texinfo-mode-hook'."
    '("vskip" (TeX-arg-literal " ") (TeX-arg-free "Amount"))
    '("w" "Text")
    '("xref" "Node name"))
-  
+
+  ;; RefTeX plugging
+  (add-hook 'reftex-mode-hook 'Texinfo-reftex-hook)
+  (if (and (boundp 'reftex-mode) reftex-mode)
+      (Texinfo-reftex-hook))
+
   (TeX-run-mode-hooks 'text-mode-hook 'Texinfo-mode-hook)
   (TeX-set-mode-name))
 
@@ -560,7 +769,7 @@ The regexps will be anchored at the end of the file name to be matched,
 i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
   :type '(repeat regexp)
   :group 'TeX-command)
-  
+
 (provide 'tex-info)
-  
+
 ;;; tex-info.el ends here
index 6af377a809756db91574ee99b21d2298f8e3343a..9d5153e510272e7005601ee31b85ac207601cf62 100644 (file)
@@ -1,9 +1,9 @@
 ;;; tex-jp.el --- Support for Japanese TeX.
 
-;; Copyright (C) 1999, 2001-2007, 2012  Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001 Hidenobu Nabetani <nabe@debian.or.jp>
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
 
-;; Author:     KOBAYASHI Shinji <koba@flab.fujitsu.co.jp>,
-;;             Hidenobu Nabetani <nabe@debian.or.jp>
+;; Author:     KOBAYASHI Shinji <koba@flab.fujitsu.co.jp>
 ;; Maintainer: Masayuki Ataka <masayuki.ataka@gmail.com>
 ;; Keywords: tex
 
   "Japanese support in AUCTeX."
   :group 'AUCTeX)
 
+(defcustom japanese-TeX-engine-default 'ptex
+  "Default TeX engine for Japanese TeX."
+  :group 'AUCTeX-jp
+  :type '(choice (const :tag "pTeX" ptex)
+                (const :tag "jTeX" jtex)
+                (const :tag "upTeX" uptex)))
+
+(setq TeX-engine-alist-builtin
+      (append TeX-engine-alist-builtin
+             '((ptex "pTeX" "ptex %(kanjiopt)" "platex %(kanjiopt)" "eptex")
+               (jtex "jTeX" "jtex" "jlatex" nil)
+               (uptex "upTeX" "euptex" "uplatex" "euptex"))))
+
+;; \e$B=gD4$K9T$1$PITMW$K$J$k!#\e(B
 (defcustom japanese-TeX-command-list
   ;; Changed to double quotes for Windows afflicted people.  I don't
   ;; use the %(latex) and %(tex) shorthands here because I have not
      TeX-run-TeX nil (plain-tex-mode) :help "Run NTT jTeX")
     ("jLaTeX" "%(PDF)jlatex %`%S%(PDFout)%(mode)%' %t"
      TeX-run-TeX nil (latex-mode) :help "Run NTT jLaTeX")
-    ("pTeX" "%(PDF)ptex %`%S%(PDFout)%(mode)%' %t"
+    ("pTeX" "%(PDF)ptex %(kanjiopt)%`%S%(PDFout)%(mode)%' %t"
      TeX-run-TeX nil (plain-tex-mode) :help "Run ASCII pTeX")
-    ("pLaTeX" "%(PDF)platex %`%S%(PDFout)%(mode)%' %t"
+    ("pLaTeX" "%(PDF)platex %(kanjiopt)%`%S%(PDFout)%(mode)%' %t"
      TeX-run-TeX nil (latex-mode) :help "Run ASCII pLaTeX")
-    ("Mendex" "mendex %s" TeX-run-command nil t :help "Create index file with mendex")
-    ("jBibTeX" "jbibtex %s" TeX-run-BibTeX nil t :help "Run jBibTeX"))
+    ("Mendex" "mendex %(mendexkopt)%s" TeX-run-command nil t :help "Create index file with mendex")
+    ("jBibTeX" "jbibtex %s" TeX-run-BibTeX nil t :help "Run jBibTeX")
+    ("pBibTeX" "pbibtex %(kanjiopt)%s" TeX-run-BibTeX nil t :help "Run pBibTeX"))
   "Additional list of commands, especially for Japanese.
-For detail, see `TeX-command-list', which this list is appended to."
+For detail, see `TeX-command-list', to which this list is appended."
   :group 'AUCTeX-jp
   :type '(repeat (group :value ("" "" TeX-run-command nil t)
                        (string :tag "Name")
@@ -74,6 +89,7 @@ For detail, see `TeX-command-list', which this list is appended to."
                                (function-item TeX-run-silent)
                                (function-item TeX-run-discard-foreground)
                                (function-item TeX-run-function)
+                               (function-item TeX-run-discard-or-function)
                                (function :tag "Other"))
                        (boolean :tag "Prompt")
                        (choice :tag "Modes"
@@ -86,16 +102,155 @@ For detail, see `TeX-command-list', which this list is appended to."
                                     (const :tag "AmSTeX" ams-tex-mode)))
                        (repeat :tag "Menu elements" :inline t sexp))))
 
+;; \e$B=gD4$K9T$1$PITMW$K$J$k!#\e(B
 (setq TeX-command-list
       (append japanese-TeX-command-list
              '(("-" "" ignore nil t)) ;; separator for command menu
              TeX-command-list))
 
+;; \e$B;CDj=hCV!#\e(Btex.el \e$B$K<h$j9~$s$G$b$i$($k$H$h$$!#\e(B
+(setcar (cdr (assoc "BibTeX" TeX-command-list)) "%(bibtex) %s")
+(setcar (cdr (assoc "Index" TeX-command-list)) "%(makeindex) %s")
+
+;; \e$B;CDj=hCV!#\e(Btex.el \e$B$K<h$j9~$s$G$b$i$($k$H$h$$!#\e(B
+(setq TeX-expand-list
+      (append
+       TeX-expand-list
+       '(
+        ;; -kanji \e$B%*%W%7%g%s$NJ8;zNs$r:n$k!#\e(B
+        ("%(kanjiopt)" (lambda ()
+                         (if (and
+                              ;; non-mule \e$B$J\e(B emacsen \e$B$O$=$b$=$bF|K\8l\e(B
+                              ;; \e$BJ8=q$r\e(B typeset \e$B$9$k$3$H$O9M$($J$/$F$b\e(B
+                              ;; \e$B$$$$$@$m$&!"$H$O;W$&$1$I0l1~!D!#\e(B
+                              (featurep 'mule)
+                              japanese-TeX-use-kanji-opt-flag)
+                             (let ((str (japanese-TeX-get-encoding-string)))
+                               (if str (format " -kanji=%s " str) ""))
+                           "")))
+        ;; pbibtex, jbibtex, upbibtex, bibtex \e$B$NCf$+$iE,@Z$J$b$N$rA*Br$9$k!#\e(B
+        ("%(bibtex)" (lambda ()
+                       (cond
+                        ((eq TeX-engine 'ptex)
+                         ;; pLaTeX \e$BMQF|K\8l\e(B BibTeX \e$B$,\e(B pbibtex \e$B$K$J$C$?\e(B
+                         ;; \e$B$N$OHf3SE*:G6a$J$N$G!"$^$@\e(B jbibtex \e$B$N?M$b$=\e(B
+                         ;; \e$B$l$J$j$K$$$k$@$m$&!#\e(B
+                         (if (executable-find "pbibtex")
+                             "pbibtex %(kanjiopt)" "jbibtex"))
+                        ((eq TeX-engine 'jtex) "jbibtex")
+                        ((eq TeX-engine 'uptex) "upbibtex")
+                        (t "bibtex"))))
+        ;; mendex \e$B$H\e(B makeindex \e$B$NE,@Z$JJ}$rA*Br$9$k!#\e(B
+        ("%(makeindex)" (lambda ()
+                          (if (memq TeX-engine '(ptex uptex))
+                              "mendex %(mendexkopt)" "makeindex")))
+        ;; mendex \e$BMQF|K\8l%3!<%I%*%W%7%g%s!#\e(B
+        ("%(mendexkopt)" (lambda ()
+                           (if (and (featurep 'mule)
+                                    japanese-TeX-use-kanji-opt-flag)
+                               (let ((str (japanese-TeX-get-encoding-string)))
+                                 ;; \e$B#1J8;zL\$rBgJ8;z$K!#\e(B
+                                 (if str (format " -%c " (upcase (aref str 0)))
+                                   ""))
+                             "")))
+        ;; pxdvi \e$B$H\e(B %(o?)xdvi \e$B$NE,@Z$JJ}$rA*Br$9$k!#\e(B
+        ("%(xdvi)" (lambda ()
+                     ;; pxdvi \e$B$O\e(B ptex, jtex \e$B6&MQ$J$N$G!"\e(B
+                     ;; japanese mode \e$B$+$I$&$+$GH=Dj$9$l$P\e(B OK\e$B!#\e(B
+                     (if (and japanese-TeX-mode (executable-find "pxdvi"))
+                         "pxdvi" "%(o?)xdvi"))))))
+
+;;; Viewing (new implementation)
+
+(unless (get 'TeX-view-predicate-list 'saved-value)
+  (setq TeX-view-predicate-list
+       '((paper-a4
+          (TeX-match-style
+           "\\`\\(a4j\\|a4paper\\|a4dutch\\|a4wide\\|sem-a4\\)\\'"))
+         (paper-a5
+          (TeX-match-style
+           "\\`\\(a5j\\|a5paper\\|a5comb\\)\\'"))
+         ;; jarticle \e$B$J$I$@$H\e(B b4paper, b5paper \e$B$O\e(B JIS B \e$B7ONs!#\e(B
+         ;; j-article \e$B$J$I$NJ}$K$O\e(B a4j, b5j \e$B$H$$$C$?%*%W%7%g%s$O$J$$!#\e(B
+         (paper-b5    ; ISO B5
+          (and (TeX-match-style "\\`b5paper\\'")
+               (not (memq TeX-engine '(ptex uptex)))))
+         (paper-b5jis ; JIS B5
+          (or (TeX-match-style "\\`b5j\\'")
+              (and (TeX-match-style "\\`b5paper\\'")
+                   (memq TeX-engine '(ptex uptex)))))
+         ;; article \e$B$J$I$K$O\e(B b4paper \e$B$H$$$&%*%W%7%g%s$O$J$$!#\e(B
+         ;; b4paper \e$B$H$$$&%*%W%7%g%s$,$"$C$?$i\e(B JIS B4 \e$B$H8+$J$9!#\e(B
+         (paper-b4jis
+          (TeX-match-style "\\`\\(b4j\\|b4paper\\)\\'")))))
+;; jsarticle \e$B$@$HB>$K$b$b$C$HH=7?$N%*%W%7%g%s$,$"$k$,!"\e(B
+;; \e$BA4ItLLE]8+$F$k$H%-%j$,$J$$$N$G!"$3$l$/$i$$$G$$$$$@$m$&!#\e(B
+;; jsarticle.el \e$B$d\e(B jsbook.el \e$B$GDI2CJ,$N=hM}$r;E9~$a$P$$$$$N$+$bCN$l$J$$!#\e(B
+
+;; \e$B;CDj=hCV!#\e(Btex.el \e$B$K<h$j9~$s$G$b$i$($k$H$h$$!#\e(B
+(unless (get 'TeX-view-program-list 'saved-value)
+  (setq TeX-view-program-list
+       (cond
+        ;; http://oku.edu.mie-u.ac.jp/~okumura/texwiki/?AUCTeX
+        ;; \e$B$r;29M$K$7$F$_$?!#\e(B
+        ((eq system-type 'windows-nt)
+         '(("Dviout" ("dviout -1 "
+                      ((paper-a4 paper-portrait) " -y=A4 ")
+                      ((paper-a4 paper-landscape) " -y=A4L ")
+                      ((paper-a5 paper-portrait) " -y=A5 ")
+                      ((paper-a5 paper-landscape) " -y=A5L ")
+                      ((paper-b5 paper-portrait) " -y=E5 ")
+                      ((paper-b5 paper-landscape) " -y=E5L ")
+                      ((paper-b4jis paper-portrait) " -y=B4 ")
+                      ((paper-b4jis paper-landscape) " -y=B4L ")
+                      ((paper-b5jis paper-portrait) " -y=B5 ")
+                      ((paper-b5jis paper-landscape) " -y=B5L ")
+                      (paper-legal " -y=Legal ")
+                      (paper-letter " -y=Letter ")
+                      (paper-executive " -y=Exective ")
+                      "%o" (mode-io-correlate " \"# %n '%b'\"")))
+           ("TeXworks" "TeXworks %o")
+           ("SumatraPDF" "SumatraPDF -reuse-instance %o"
+            (mode-io-correlate " -forward-search \"%b\" %n"))
+           ("MuPDF" "mupdf %o")))
+        ;; \e$B$3$l$G$$$$$N$+$I$&$+$OIT0B!#\e(B
+        ((eq system-type 'darwin)
+         '(("Preview" "open -a Preview.app %o")
+           ("TeXShop" "open -a TeXShop.app %o")
+           ("TeXworks" "open -a TeXworks.app %o")
+           ("Skim" "open -a Skim.app %o")
+           ("displayline" "displayline %n %o %b")
+           ("PictPrinter" "open -a PictPrinter.app %d")
+           ("Mxdvi" "open -a Mxdvi.app %d")
+           ("open" "open %o")))
+        (t
+         (setcar (cadr (assoc "xdvi" TeX-view-program-list-builtin))
+                 "%(xdvi) -unique")
+         '(("TeXworks" "texworks %o")
+           ("zathura" "zathura %o")
+           ("MuPDF" "mupdf %o"))))))
+
+;; \e$B$3$l$O\e(B tex.el \e$B$K<h$jF~$l$F$b$i$&$N$OFq$7$$$+!)\e(B
+;; tex-jp.el \e$B$,FI$_9~$^$l$k$@$1$G!"\e(Bdvi viewer \e$B$N%G%U%)%k%H$,\e(B dviout \e$B$K\e(B
+;; \e$B$J$C$F$7$^$&$N$ODq93$,Bg$-$$$+$b!#\e(B
+(unless (get 'TeX-view-program-selection 'saved-value)
+  (setq TeX-view-program-selection
+       (append
+        (cond
+         ((eq system-type 'windows-nt)
+          '((output-dvi "Dviout")
+            (output-pdf "TeXworks")))
+         ((eq system-type 'darwin)
+          '((output-pdf "Preview")))
+         (t
+          nil))
+        TeX-view-program-selection)))
+
 (mapc (lambda (dir) (add-to-list 'TeX-macro-global dir t))
       (or (TeX-tree-expand
           '("$SYSTEXMF" "$TEXMFLOCAL" "$TEXMFMAIN" "$TEXMFDIST")
-          "platex" '("/ptex/" "/jbibtex/bst/"))
-         '("/usr/share/texmf/ptex/" "/usr/share/texmf/jbibtex/bst/")))
+          "platex" '("/ptex/" "/pbibtex/bst/"))
+         '("/usr/share/texmf/ptex/" "/usr/share/texmf/pbibtex/bst/")))
 
 (mapc (lambda (dir) (add-to-list 'TeX-macro-global dir t))
       (or (TeX-tree-expand
@@ -103,13 +258,14 @@ For detail, see `TeX-command-list', which this list is appended to."
           "jlatex" '("/jtex/" "/jbibtex/bst/"))
          '("/usr/share/texmf/jtex/" "/usr/share/texmf/jbibtex/bst/")))
 
-;; Menus
-
+;; \e$B=gD4$K9T$1$PITMW$K$J$k!#\e(B
 (setq LaTeX-command-style
-      (append '(("^j-\\(article\\|report\\|book\\)$"
-                "%(PDF)jlatex %S%(PDFout)")
-               ("^[jt]s?\\(article\\|report\\|book\\)$"
-                "%(PDF)platex %S%(PDFout)"))
+      (append '(("\\`u[jt]\\(article\\|report\\|book\\)\\'\\|\\`uplatex\\'"
+                "%(PDF)uplatex %(kanjiopt)%S%(PDFout)")
+               ("\\`[jt]s?\\(article\\|report\\|book\\)\\'"
+                "%(PDF)platex %(kanjiopt)%S%(PDFout)")
+               ("\\`j-\\(article\\|report\\|book\\)\\'"
+                "%(PDF)jlatex %(kanjiopt)%S%(PDFout)"))
              LaTeX-command-style))
 
 (defcustom japanese-TeX-error-messages t
@@ -120,7 +276,7 @@ For detail, see `TeX-command-list', which this list is appended to."
 (when (featurep 'mule)
 
 ;; FIX-ME (2007-02-09) The default coding system in recent Unix (like Fedora and
-;; Ubuntu) is utf-8.  But Japanese TeX system is not support utf-8 yet
+;; Ubuntu) is utf-8.  But Japanese TeX system does not support utf-8 yet
 ;; (platex-utf is under development, may be alpha phase).  So,
 ;; process-coding-system for Japanese TeX is not defined from
 ;; default-coding-system.  When platex-utf is out, we should look this setting,
@@ -144,12 +300,14 @@ For detail, see `TeX-command-list', which this list is appended to."
 
 )
 
+;; \e$B=gD4$K9T$1$PITMW$K$J$k!#\e(B
 (defcustom japanese-TeX-command-default "pTeX"
   "*The default command for `TeX-command' in the japanese-TeX mode."
   :group 'AUCTeX-jp
   :type 'string)
   (make-variable-buffer-local 'japanese-TeX-command-default)
 
+;; \e$B=gD4$K9T$1$PITMW$K$J$k!#\e(B
 (defcustom japanese-LaTeX-command-default "LaTeX"
   "*The default command for `TeX-command' in the japanese-LaTeX mode."
   :group 'AUCTeX-jp
@@ -193,6 +351,55 @@ For detail, see `TeX-command-list', which this list is appended to."
                                 TeX-japanese-process-input-coding-system)))
 (setq TeX-after-start-process-function
       'japanese-TeX-set-process-coding-system)
+
+(defcustom japanese-TeX-use-kanji-opt-flag t
+  "Add kanji option to Japanese pTeX family if non-nil."
+  :group 'AUCTeX-jp
+  :type 'boolean)
+
+(defun japanese-TeX-coding-ejsu (coding-system)
+  "Convert japanese CODING-SYSTEM to mnemonic string.
+euc-jp:    \"euc\"
+jis:       \"jis\"
+shift_jis: \"sjis\"
+utf-8:     \"utf8\"
+Return nil otherwise."
+  (let ((base (coding-system-base coding-system)))
+    (cdr (assq base
+              '((japanese-iso-8bit . "euc")
+                (iso-2022-jp . "jis")
+                (japanese-shift-jis . "sjis")
+                (utf-8 . "utf8")
+
+                ;; xemacs \e$B$@$H0J2<$NL>A0$O0c$&$+$b!D!#\e(B
+                (euc-jis-2004 . "euc")
+                (iso-2022-jp-2004 . "jis")
+                (japanese-shift-jis-2004 . "sjis")
+
+                (japanese-cp932 . "sjis")
+                (eucjp-ms . "euc"))))))
+
+(defun japanese-TeX-get-encoding-string ()
+  "Return coding option string for Japanese pTeX family.
+For inappropriate encoding, nil instead."
+  (or (japanese-TeX-coding-ejsu buffer-file-coding-system)
+
+      ;; \e$BJ#?t%U%!%$%k$KJ,3d$7$?J8=q$N>l9g!"\e(Bemacs \e$B$G3+$$$?%U%!%$%k$,F|K\\e(B
+      ;; \e$B8l$r#1;z$b4^$^$J$$$3$H$,$"$k!#$3$N$?$a!"$=$N%U%!%$%k$N\e(B
+      ;; buffer-file-coding-system \e$B$OF|K\8l%3!<%I$,ITDj$KN1$^$C$F\e(B
+      ;; \e$B$7$^$&2DG=@-$,$"$k!#$=$N$h$&$J>l9g!"\e(Bmaster file \e$B$N\e(B
+      ;; buffer-file-coding-system \e$B$r;H$&!#\e(B
+      (if (stringp TeX-master) ; \e$B<+J,$,;R%U%!%$%k$N$H$-\e(B
+         (let ((buf (get-file-buffer (TeX-master-file t))))
+           (if buf
+               (japanese-TeX-coding-ejsu
+                (with-current-buffer buf buffer-file-coding-system)))))
+
+      ;; \e$B$=$l$G$b7h$a$i$l$J$$>l9g$O\e(B buffer-file-coding-system \e$B$N\e(B
+      ;; default \e$BCM$r;H$&!#\e(B
+      (japanese-TeX-coding-ejsu
+       (default-value 'buffer-file-coding-system))))
+
 )
 
 ;;; Japanese TeX modes
@@ -213,7 +420,8 @@ Set `japanese-TeX-mode' to t, and enter `TeX-plain-tex-mode'."
 (defun japanese-plain-tex-mode-initialization ()
   "Japanese plain-TeX specific initializations."
   (when japanese-TeX-mode
-    (setq TeX-command-default japanese-TeX-command-default)))
+;    (setq TeX-command-default japanese-TeX-command-default)
+    (TeX-engine-set japanese-TeX-engine-default)))
 
 (add-hook 'plain-TeX-mode-hook 'japanese-plain-tex-mode-initialization)
 
@@ -228,9 +436,24 @@ Set `japanese-TeX-mode' to t, and enter `TeX-latex-mode'."
 (defun japanese-latex-mode-initialization ()
   "Japanese LaTeX specific initializations."
   (when japanese-TeX-mode
-    (setq TeX-command-default japanese-LaTeX-command-default)
+;    (setq TeX-command-default japanese-LaTeX-command-default)
+    (TeX-engine-set
+     ;; class file \e$BL>$KMj$k$N$O@5$7$$$N$+!)\e(B
+     ;; jLaTeX \e$B$K$b\e(B jarticle \e$B$O0l1~$"$k$7!"\e(BpLaTeX \e$B$G$b<+J,$G\e(B j-article \e$B$r\e(B
+     ;; \e$B%$%s%9%H!<%k$7$F;H$C$F$$$1$J$$K!$O$J$$!#\e(B
+     (cond
+      ((TeX-match-style "\\`u[jt]\\(article\\|report\\|book\\)\\'\\|\\`uplatex\\'")
+       'uptex)
+      ((TeX-match-style "\\`[jt]s?\\(article\\|report\\|book\\)\\'")
+       'ptex)
+      ((TeX-match-style "\\`j-\\(article\\|report\\|book\\)\\'")
+       'jtex)
+      (t japanese-TeX-engine-default)))
     (setq LaTeX-default-style japanese-LaTeX-default-style)
-    (setq TeX-command-BibTeX "jBibTeX")))
+;    (setq TeX-command-BibTeX
+;        (if (and (eq TeX-engine 'ptex) (executable-find "pbibtex"))
+;            "pBibTeX" "jBibTeX"))
+))
 
 (add-hook 'LaTeX-mode-hook 'japanese-latex-mode-initialization)
 
@@ -376,10 +599,10 @@ thebibliography\e$B4D6-$G0z?t$rK:$l$?>l9g$K$b@8$8$^$9!%\e(B")
 \e$B$K@8$8$^$9!%$3$NLdBj$O4D6-$N$&$A$N$$$/$D$+$rJ8=q$N=*$o$j$NJ}$K0\F0$9$l\e(B
 \e$B$P2r7h$G$-$^$9!%$^$?!$$3$N%(%i!<$O\e(B``logjam''\e$B$K$h$C$F@8$8$k$3$H$b$"$j$^\e(B
 \e$B$9!%\e(B``logjam''\e$B$H$O!$\e(BLaTeX\e$B$,=P8==g=xDL$j$K$7$+?^I=$r=PNO$G$-$J$$$;$$$G!$\e(B
-\e$B$D$^$C$F$$$k8e$m$N?^I=$N$?$a$KA0$N?^I=$r=PNO$G$-$J$/$J$k$3$H$r$$$$$^$9!%\e(B
-\e$B$3$N%8%c%`$N860x$O!$Bg$-$9$.$F\e(B1\e$B%Z!<%8$J$$$7$O;XDj$5$l$?NN0h$K<}$^$i$J\e(B
-\e$B$$$h$&$J?^$dI=$G$"$k2DG=@-$,$"$j$^$9!%$3$l$O!$0z?t$K\e(Bp\e$B%*%W%7%g%s$,;XDj\e(B
-\e$B$5$l$F$$$J$$$H5/$-$d$9$/$J$j$^$9!%\e(B")
+\e$B?^I=$N=PNO$,\e(B1\e$B%v=j$G$b$D$^$k$H$=$N8e$m$N?^I=$,8.JB$_$9$Y$F$D$C$+$($F$7$^\e(B
+\e$B$&$3$H$r$$$$$^$9!%$3$N%8%c%`$N860x$O!$Bg$-$9$.$F\e(B1\e$B%Z!<%8$J$$$7$O%*%W%7%g\e(B
+\e$B%s0z?t$G;XDj$5$l$?0LCV$K<}$^$i$J$$$h$&$J?^$dI=$G$"$k2DG=@-$,$"$j$^$9!%$3\e(B
+\e$B$l$O!$0z?t$K\e(Bp\e$B%*%W%7%g%s$,;XDj$5$l$F$$$J$$$H5/$-$d$9$/$J$j$^$9!%\e(B")
 
     ("Undefined tab position." .
 "\\>\e$B!&\e(B\\+\e$B!&\e(B\\-\e$B$^$?$O\e(B\\<\e$BL?Na$G!$B8:_$7$J$$%?%V0LCV!$$9$J$o$A\e(B\\=\e$BL?Na$GDj\e(B
index 0a31f4d5d51e0db7b9be6f7fc8b5732521a07260..af624ba7fee7642ffbb848f7fb00d9f86f29e20d 100644 (file)
@@ -63,8 +63,9 @@ TeX-auto-* (automatically generated lisp).")
 (defvar TeX-data-directory (file-name-directory load-file-name)
   "The directory where the AUCTeX non-Lisp data is located.")
 
-(defcustom TeX-auto-global "/usr/local/var/auctex"
-  "Directory containing automatically generated information.
+(defcustom TeX-auto-global
+    "/usr/local/var/auctex"
+  "*Directory containing automatically generated information.
 Must end with a directory separator.
 
 For storing automatic extracted information about the TeX macros
@@ -139,26 +140,407 @@ set it with `TeX-modes-set'."
                      `(TeX-modes-set ',var ,var t))
                    (setq list (cdr list))))))
 
-(defconst AUCTeX-version "11.86"
+(defconst AUCTeX-version "11.87"
     "AUCTeX version.
 If not a regular release, the date of the last change.")
 
-(defconst AUCTeX-date "2010-02-21"
+(defconst AUCTeX-date "2012-11-30"
   "AUCTeX release date using the ISO 8601 format, yyyy-mm-dd.")
 
 ;; Store bibitems when saving a BibTeX buffer
 (add-hook 'bibtex-mode-hook 'BibTeX-auto-store)
 
+;;; auto-loads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+\f
+;;;### (autoloads (turn-on-bib-cite bib-cite-minor-mode) "bib-cite"
+;;;;;;  "bib-cite.el" (18341 54637 0 0))
+;;; Generated autoloads from bib-cite.el
+
+(autoload 'bib-cite-minor-mode "bib-cite" "\
+Toggle bib-cite mode.
+When bib-cite mode is enabled, citations, labels and refs are highlighted
+when the mouse is over them.  Clicking on these highlights with [mouse-2]
+runs bib-find, and [mouse-3] runs bib-display.
+
+\(fn ARG)" t nil)
+
+(autoload 'turn-on-bib-cite "bib-cite" "\
+Unconditionally turn on Bib Cite mode.
+
+\(fn)" nil nil)
+
+;;;***
+\f
+;;;### (autoloads (context-mode) "context" "context.el" (19707 64211
+;;;;;;  0 0))
+;;; Generated autoloads from context.el
+
+(defalias 'ConTeXt-mode 'context-mode)
+
+(autoload 'context-mode "context" "\
+Major mode in AUCTeX for editing ConTeXt files.
+
+Special commands:
+\\{ConTeXt-mode-map}
+
+Entering `context-mode' calls the value of `text-mode-hook',
+then the value of `TeX-mode-hook', and then the value
+of context-mode-hook.
+
+\(fn)" t nil)
+
+;;;***
+\f
+;;;### (autoloads (context-en-mode) "context-en" "context-en.el"
+;;;;;;  (19618 16518 0 0))
+;;; Generated autoloads from context-en.el
+
+(autoload 'context-en-mode "context-en" "\
+Major mode for editing files for ConTeXt using its english interface.
+
+Special commands:
+\\{ConTeXt-mode-map}
+
+Entering `context-mode' calls the value of `text-mode-hook',
+then the value of TeX-mode-hook, and then the value
+of context-mode-hook.
+
+\(fn)" t nil)
+
+;;;***
+\f
+;;;### (autoloads (context-nl-mode) "context-nl" "context-nl.el"
+;;;;;;  (19618 16529 0 0))
+;;; Generated autoloads from context-nl.el
+
+(autoload 'context-nl-mode "context-nl" "\
+Major mode for editing files for ConTeXt using its dutch interface.
+
+Special commands:
+\\{ConTeXt-mode-map}
+
+Entering `context-mode' calls the value of `text-mode-hook',
+then the value of TeX-mode-hook, and then the value
+of context-mode-hook.
+
+\(fn)" t nil)
+
+;;;***
+\f
+;;;### (autoloads (font-latex-setup) "font-latex" "font-latex.el"
+;;;;;;  (20561 45562 0 0))
+;;; Generated autoloads from font-latex.el
+
+(autoload 'font-latex-setup "font-latex" "\
+Setup this buffer for LaTeX font-lock.  Usually called from a hook.
+
+\(fn)" nil nil)
+
+;;;***
+\f
+;;;### (autoloads (docTeX-mode TeX-latex-mode BibTeX-auto-store)
+;;;;;;  "latex" "latex.el" (20659 51557 0 0))
+;;; Generated autoloads from latex.el
+
+(autoload 'BibTeX-auto-store "latex" "\
+This function should be called from `bibtex-mode-hook'.
+It will setup BibTeX to store keys in an auto file.
+
+\(fn)" nil nil)
+
+(add-to-list 'auto-mode-alist '("\\.drv\\'" . latex-mode))
+
+(autoload 'TeX-latex-mode "latex" "\
+Major mode in AUCTeX for editing LaTeX files.
+See info under AUCTeX for full documentation.
+
+Special commands:
+\\{LaTeX-mode-map}
+
+Entering LaTeX mode calls the value of `text-mode-hook',
+then the value of `TeX-mode-hook', and then the value
+of `LaTeX-mode-hook'.
+
+\(fn)" t nil)
+
+(add-to-list 'auto-mode-alist '("\\.dtx\\'" . doctex-mode))
+
+(autoload 'docTeX-mode "latex" "\
+Major mode in AUCTeX for editing .dtx files derived from `LaTeX-mode'.
+Runs `LaTeX-mode', sets a few variables and
+runs the hooks in `docTeX-mode-hook'.
+
+\(fn)" t nil)
+
+(defalias 'TeX-doctex-mode 'docTeX-mode)
+
+;;;***
+\f
+;;;### (autoloads (multi-prompt-key-value multi-prompt) "multi-prompt"
+;;;;;;  "multi-prompt.el" (18915 28236 0 0))
+;;; Generated autoloads from multi-prompt.el
+
+(autoload 'multi-prompt "multi-prompt" "\
+Completing prompt for a list of strings.  
+The first argument SEPARATOR should be the string (of length 1) to
+separate the elements in the list.  The second argument UNIQUE should
+be non-nil, if each element must be unique.  The remaining elements
+are the arguments to `completing-read'.  See that.
+
+\(fn SEPARATOR UNIQUE PROMPT TABLE &optional MP-PREDICATE REQUIRE-MATCH INITIAL HISTORY)" nil nil)
+
+(autoload 'multi-prompt-key-value "multi-prompt" "\
+Read multiple strings, with completion and key=value support.
+PROMPT is a string to prompt with, usually ending with a colon
+and a space.  TABLE is an alist.  The car of each element should
+be a string representing a key and the optional cdr should be a
+list with strings to be used as values for the key.
+
+See the documentation for `completing-read' for details on the
+other arguments: PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST,
+DEF, and INHERIT-INPUT-METHOD.
+
+The return value is the string as entered in the minibuffer.
+
+\(fn PROMPT TABLE &optional PREDICATE REQUIRE-MATCH INITIAL-INPUT HIST DEF INHERIT-INPUT-METHOD)" nil nil)
+
+;;;***
+\f
+;;;### (autoloads (ams-tex-mode TeX-plain-tex-mode) "plain-tex" "plain-tex.el"
+;;;;;;  (19707 64159 0 0))
+;;; Generated autoloads from plain-tex.el
+
+(autoload 'TeX-plain-tex-mode "plain-tex" "\
+Major mode in AUCTeX for editing plain TeX files.
+See info under AUCTeX for documentation.
+
+Special commands:
+\\{plain-TeX-mode-map}
+
+Entering `plain-tex-mode' calls the value of `text-mode-hook',
+then the value of `TeX-mode-hook', and then the value
+of plain-TeX-mode-hook.
+
+\(fn)" t nil)
+
+(autoload 'ams-tex-mode "plain-tex" "\
+Major mode in AUCTeX for editing AmS-TeX files.
+See info under AUCTeX for documentation.
+
+Special commands:
+\\{AmSTeX-mode-map}
+
+Entering AmS-tex-mode calls the value of `text-mode-hook',
+then the value of `TeX-mode-hook', and then the value
+of `AmS-TeX-mode-hook'.
+
+\(fn)" t nil)
+
+;;;***
+\f
+;;;### (autoloads (TeX-submit-bug-report TeX-auto-generate-global
+;;;;;;  TeX-auto-generate TeX-tex-mode) "tex" "tex.el" (20665 1626
+;;;;;;  0 0))
+;;; Generated autoloads from tex.el
+
+(autoload 'TeX-tex-mode "tex" "\
+Major mode in AUCTeX for editing TeX or LaTeX files.
+Tries to guess whether this file is for plain TeX or LaTeX.
+
+The algorithm is as follows:
+
+   1) if the file is empty or `TeX-force-default-mode' is not set to nil,
+      `TeX-default-mode' is chosen
+   2) If \\documentstyle or \\begin{, \\section{, \\part{ or \\chapter{ is
+      found, `latex-mode' is selected.
+   3) Otherwise, use `plain-tex-mode'
+
+\(fn)" t nil)
+
+(autoload 'TeX-auto-generate "tex" "\
+Generate style file for TEX and store it in AUTO.
+If TEX is a directory, generate style files for all files in the directory.
+
+\(fn TEX AUTO)" t nil)
+
+(autoload 'TeX-auto-generate-global "tex" "\
+Create global auto directory for global TeX macro definitions.
+
+\(fn)" t nil)
+
+(autoload 'TeX-submit-bug-report "tex" "\
+Submit a bug report on AUCTeX via mail.
+
+Don't hesitate to report any problems or inaccurate documentation.
+
+If you don't have setup sending mail from (X)Emacs, please copy the
+output buffer into your mail program, as it gives us important
+information about your AUCTeX version and AUCTeX configuration.
+
+\(fn)" t nil)
+
+;;;***
+\f
+;;;### (autoloads (LaTeX-install-toolbar TeX-install-toolbar) "tex-bar"
+;;;;;;  "tex-bar.el" (18580 49499 0 0))
+;;; Generated autoloads from tex-bar.el
+
+(autoload 'TeX-install-toolbar "tex-bar" "\
+Install toolbar buttons for TeX mode.
+
+\(fn)" t nil)
+
+(autoload 'LaTeX-install-toolbar "tex-bar" "\
+Install toolbar buttons for LaTeX mode.
+
+\(fn)" t nil)
+
+;;;***
+\f
+;;;### (autoloads nil "tex-fold" "tex-fold.el" (19887 15736 0 0))
+;;; Generated autoloads from tex-fold.el
+ (autoload 'TeX-fold-mode "tex-fold" "Minor mode for hiding and revealing macros and environments." t)
+
+(defalias 'tex-fold-mode 'TeX-fold-mode)
+
+;;;***
+\f
+;;;### (autoloads (tex-font-setup) "tex-font" "tex-font.el" (18341
+;;;;;;  54636 0 0))
+;;; Generated autoloads from tex-font.el
+
+(autoload 'tex-font-setup "tex-font" "\
+Setup font lock support for TeX.
+
+\(fn)" nil nil)
+
+;;;***
+\f
+;;;### (autoloads (TeX-texinfo-mode) "tex-info" "tex-info.el" (20659
+;;;;;;  23181 0 0))
+;;; Generated autoloads from tex-info.el
+
+(defalias 'Texinfo-mode 'texinfo-mode)
+
+(autoload 'TeX-texinfo-mode "tex-info" "\
+Major mode in AUCTeX for editing Texinfo files.
+
+Special commands:
+\\{Texinfo-mode-map}
+
+Entering Texinfo mode calls the value of `text-mode-hook'  and then the
+value of `Texinfo-mode-hook'.
+
+\(fn)" t nil)
+
+;;;***
+\f
+;;;### (autoloads (japanese-latex-mode japanese-plain-tex-mode) "tex-jp"
+;;;;;;  "tex-jp.el" (20588 36944 0 0))
+;;; Generated autoloads from tex-jp.el
+
+(autoload 'japanese-plain-tex-mode "tex-jp" "\
+Major mode in AUCTeX for editing Japanese plain TeX files.
+Set `japanese-TeX-mode' to t, and enter `TeX-plain-tex-mode'.
+
+\(fn)" t nil)
+
+(autoload 'japanese-latex-mode "tex-jp" "\
+Major mode in AUCTeX for editing Japanese LaTeX files.
+Set `japanese-TeX-mode' to t, and enter `TeX-latex-mode'.
+
+\(fn)" t nil)
+
+;;;***
+\f
+;;;### (autoloads (texmathp-match-switch texmathp) "texmathp" "texmathp.el"
+;;;;;;  (18489 3128 0 0))
+;;; Generated autoloads from texmathp.el
+
+(autoload 'texmathp "texmathp" "\
+Determine if point is inside (La)TeX math mode.
+Returns t or nil.  Additional info is placed into `texmathp-why'.
+The functions assumes that you have (almost) syntactically correct (La)TeX in
+the buffer.
+See the variable `texmathp-tex-commands' about which commands are checked.
+
+\(fn)" t nil)
+
+(autoload 'texmathp-match-switch "texmathp" "\
+Search backward for any of the math switches.
+Limit searched to BOUND.
+
+\(fn BOUND)" nil nil)
+
+;;;***
 \f
-;;; Code specific to ELPA packaging:
+;;;### (autoloads nil "toolbar-x" "toolbar-x.el" (18580 49487 0 0))
+;;; Generated autoloads from toolbar-x.el
+ (autoload 'toolbarx-install-toolbar "toolbar-x")
 
-;; From preview-latex.el:
+;;;***
+\f
+(provide 'auto-loads)
+
+;;; preview-latex.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+\f
+;;;### (autoloads (preview-report-bug LaTeX-preview-setup preview-install-styles)
+;;;;;;  "preview" "preview.el" (19772 31043 0 0))
+;;; Generated autoloads from preview.el
+
+(autoload 'preview-install-styles "preview" "\
+Installs the TeX style files into a permanent location.
+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
+use will query.
+
+Similarly FORCE-SAVE can be used for saving
+`preview-TeX-style-dir' to record the fact that the uninstalled
+files are no longer needed in the search path.
+
+\(fn DIR &optional FORCE-OVERWRITE FORCE-SAVE)" t nil)
+
+(autoload 'LaTeX-preview-setup "preview" "\
+Hook function for embedding the preview package into AUCTeX.
+This is called by `LaTeX-mode-hook' and changes AUCTeX variables
+to add the preview functionality.
+
+\(fn)" nil nil)
+ (add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)
+
+(autoload 'preview-report-bug "preview" "\
+Report a bug in the preview-latex package.
+
+\(fn)" t nil)
+
+;;;***
+\f
+(provide 'preview-latex)
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; preview-latex.el ends here
 
 (defvar preview-TeX-style-dir
   (expand-file-name "latex" (file-name-directory load-file-name)))
 
-;;; Ensure that loading the autoloads file also loads this file.
-;;;###autoload (require 'tex-site)
 
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; auto-loads.el ends here
 (provide 'tex-site)
 ;;; tex-site.el ends here
index 781aa11342716b52f866fceb39867c4772108aae..1c911688104f11fb5d1ef2ee094661d5fdc00fda 100644 (file)
@@ -213,6 +213,13 @@ It can be a list of themes or a function.  If it is the symbol
             :tag "Other"
             (string)))))
 
+;; style/biblatex.el
+
+(defcustom LaTeX-biblatex-use-Biber t
+  "Whether to use Biber with biblatex."
+  :type 'boolean
+  :group 'LaTeX-style)
+
 ;; style/comment.el
 
 (defcustom LaTeX-comment-env-list '("comment")
index e11f16b3ad795eb402a9032d3a16b946604949d9..85f82b38c4de1f27e37f1255c13763d4804043ad 100644 (file)
@@ -1,7 +1,8 @@
 ;;; tex.el --- Support for TeX documents.
 
-;; Copyright (C) 1985-1987, 1991, 1993, 1994, 1996, 1997, 1999-2012
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1987, 1991, 1993, 1994, 1996, 1997, 1999,
+;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+;;   2011 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Keywords: tex
@@ -25,9 +26,7 @@
 
 ;;; Commentary:
 
-;; This file provides AUCTeX support for plain TeX as well as basic
-;; functions used by other AUCTeX modes (e.g. for LaTeX, Texinfo and
-;; ConTeXt).
+;; This file provides basic functions used by the AUCTeX modes.
 
 ;;; Code:
 
 ;;; Site Customization
 ;;
 ;; The following variables are likely to need to be changed for your
-;; site.  You should do this with customize.  Here is the beef: If you
-;; want to print, TeX-print-command must be non-nil (if it is nil,
-;; you'll get a complaint when using the print menu).  If you want to
-;; view the queue, TeX-queue-command needs to be non-nil (if it is
-;; nil, it won't get mentioned in the menu).  If TeX-printer-list is
-;; nil, nothing else gets asked: the menu entries lead directly to the
-;; respective commands.  If those commands contain %p, the value of
-;; TeX-printer-default gets inserted there, no questions asked.  Now
-;; if TeX-printer-list is non-nil, you'll always get asked which
-;; printer you want to use.  You can enter a configured printer from
-;; TeX-printer-list, or an unknown one.  The respective menus will
-;; show all configured printers.  Since you can enter unknown
-;; printers, the printer name _must_ be set with %p in
-;; TeX-print-command.
-
-;; How to print.
-
-(defcustom TeX-print-command "%(o?)dvips -P%p %r %s"
-  "*Command used to print a file.
-
-First `%p' is expanded to the printer name, then ordinary expansion is
-performed as specified in `TeX-expand-list'.  If it is nil,
-then customization is requested."
-  :group 'TeX-command
-  :type '(choice (string :tag "Print command")
-                (const :tag "No print command customized" nil)))
+;; site.  You should do this with customize.
 
 (defcustom TeX-command "tex"
   "Command to run plain TeX."
@@ -123,16 +97,6 @@ If nil, none is specified."
 ;; At least in TeXLive 2009 ConTeXt does not support an omega option anymore.
 (make-obsolete-variable 'ConTeXt-Omega-engine 'TeX-engine-alist)
 
-(defcustom TeX-queue-command "lpq -P%p"
-  "*Command used to show the status of a printer queue.
-
-First `%p' is expanded to the printer name, then ordinary expansion is
-performed as specified in `TeX-expand-list'.  If this is nil,
-the printer has no corresponding command."
-  :group 'TeX-command
-  :type '(choice (string :tag "Queue check command")
-                (const :tag "No such command" nil)))
-
 (defcustom TeX-mode-hook nil
   "A hook run in TeX mode buffers."
   :type 'hook
@@ -171,6 +135,7 @@ the printer has no corresponding command."
      TeX-run-TeX nil
      (context-mode) :help "Run ConTeXt until completion")
     ("BibTeX" "bibtex %s" TeX-run-BibTeX nil t :help "Run BibTeX")
+    ("Biber" "biber %s" TeX-run-Biber nil t :help "Run Biber")
     ,(if (or window-system (getenv "DISPLAY"))
        '("View" "%V" TeX-run-discard-or-function t t :help "Run Viewer")
        '("View" "dvi2tty -q -w 132 %s" TeX-run-command t t
@@ -215,6 +180,8 @@ TeX-run-interactive: Run TeX or LaTeX interactively.
 
 TeX-run-BibTeX: For BibTeX output.
 
+TeX-run-Biber: For Biber output.
+
 TeX-run-compile: Use `compile' to run the process.
 
 TeX-run-shell: Use `shell-command' to run the process.
@@ -263,6 +230,7 @@ Any additional elements get just transferred to the respective menu entries."
                                (function-item TeX-run-TeX)
                                (function-item TeX-run-interactive)
                                (function-item TeX-run-BibTeX)
+                               (function-item TeX-run-Biber)
                                (function-item TeX-run-compile)
                                (function-item TeX-run-shell)
                                (function-item TeX-run-discard)
@@ -343,11 +311,52 @@ string."
   :type '(repeat (group :value ("" "")
                        regexp (string :tag "Style"))))
 
+;; Printing: If you want to print, TeX-print-command must be non-nil
+;; (if it is nil, you'll get a complaint when using the print menu).
+;; If you want to view the queue, TeX-queue-command needs to be
+;; non-nil (if it is nil, it won't get mentioned in the menu).  If
+;; TeX-printer-list is nil, nothing else gets asked: the menu entries
+;; lead directly to the respective commands.  If those commands
+;; contain %p, the value of TeX-printer-default gets inserted there,
+;; no questions asked.  Now if TeX-printer-list is non-nil, you'll
+;; always get asked which printer you want to use.  You can enter a
+;; configured printer from TeX-printer-list, or an unknown one.  The
+;; respective menus will show all configured printers.  Since you can
+;; enter unknown printers, the printer name _must_ be set with %p in
+;; TeX-print-command.
+
+(defcustom TeX-print-command
+  "{ test -e %s.dvi && %(o?)dvips -P%p %r %s; } || lpr -P%p %o"
+  "Command used to print a file.
+
+First `%p' is expanded to the printer name, then ordinary expansion is
+performed as specified in `TeX-expand-list'.  If it is nil,
+then customization is requested."
+  :group 'TeX-command
+  :type '(choice (string :tag "Print command")
+                (const :tag "No print command customized" nil)))
+
+(defcustom TeX-queue-command "lpq -P%p"
+  "Command used to show the status of a printer queue.
+
+First `%p' is expanded to the printer name, then ordinary expansion is
+performed as specified in `TeX-expand-list'.  If this is nil,
+the printer has no corresponding command."
+  :group 'TeX-command
+  :type '(choice (string :tag "Queue check command")
+                (const :tag "No such command" nil)))
+
 ;; Enter the names of the printers available at your site, or nil if
 ;; you only have one printer.
 
 (defcustom TeX-printer-list
-  '(("Default" "%(o?)dvips -f %s | lpr" "lpq"))
+  '(("Default"
+     ;; Print to the (unnamed) default printer.  If there is a DVI
+     ;; file print via Dvips.  If not, pass the output file (which
+     ;; should then be a Postscript or PDF file) directly to lpr.
+     "{ test -e %s.dvi && %(o?)dvips -f %r %s | lpr; } || lpr %o"
+     ;; Show the queue for the (unnamed) default printer.
+     "lpq"))
   "List of available printers.
 
 The first element of each entry is the printer name.
@@ -382,7 +391,7 @@ get consulted."
                                   (and TeX-printer-list
                                        (car (car TeX-printer-list)))
                                   "lp")
-  "*Default printer to use with `TeX-command'."
+  "Default printer to use with `TeX-command'."
   :group 'TeX-command
   :type 'string)
 
@@ -448,9 +457,9 @@ string."
     ("%dS" TeX-source-specials-view-expand-options)
     ("%cS" TeX-source-specials-view-expand-client)
     ("%(outpage)" (lambda ()
-                   (if TeX-source-correlate-output-page-function
-                       (funcall TeX-source-correlate-output-page-function)
-                     "1")))
+                   (or (when TeX-source-correlate-output-page-function
+                         (funcall TeX-source-correlate-output-page-function))
+                       "1")))
     ;; `file' means to call `TeX-master-file' or `TeX-region-file'
     ("%s" file nil t)
     ("%t" file t t)
@@ -844,13 +853,14 @@ If RESET is non-nil, `TeX-command-next' is reset to
                                      'TeX-command-next TeX-command-default))
          (set-buffer-modified-p (buffer-modified-p))))))
 
-(defun TeX-mode-prefix ()
-  "Return the prefix of the current mode as string."
-  (cdr (assoc major-mode '((plain-tex-mode . "plain-TeX")
-                          (latex-mode . "LaTeX")
-                          (doctex-mode . "docTeX")
-                          (texinfo-mode . "Texinfo")
-                          (context-mode . "ConTeXt")))))
+(defun TeX-mode-prefix (&optional mode)
+  "Return the prefix for the symbol MODE as string.
+If no mode is given the current major mode is used."
+  (cdr (assoc (or mode major-mode) '((plain-tex-mode . "plain-TeX")
+                                    (latex-mode . "LaTeX")
+                                    (doctex-mode . "docTeX")
+                                    (texinfo-mode . "Texinfo")
+                                    (context-mode . "ConTeXt")))))
 
 ;;; Viewing
 
@@ -997,6 +1007,72 @@ The following built-in predicates are available:
   :group 'TeX-view
   :type '(alist :key-type symbol :value-type (group sexp)))
 
+(defun TeX-evince-dbus-p (&rest options)
+  "Return non-nil, if evince is installed and accessible via DBUS.
+Additional OPTIONS may be given to extend the check.  If none are
+given, only the minimal requirements needed by backward search
+are checked.  If OPTIONS include `:forward', which is currently
+the only option, then additional requirements needed by forward
+search are checked, too."
+  (and (not (featurep 'xemacs)) ; XEmacs 21.4 has no `require' with
+                               ; arity 3, and no dbus support anyway.
+       (require 'dbus nil :no-error)
+       (functionp 'dbus-register-signal)
+       (getenv "DBUS_SESSION_BUS_ADDRESS")
+       (executable-find "evince")
+       (or (not (memq :forward options))
+          (let ((spec (dbus-introspect-get-method
+                       :session "org.gnome.evince.Daemon"
+                       "/org/gnome/evince/Daemon"
+                       "org.gnome.evince.Daemon"
+                       "FindDocument")))
+            ;; FindDocument must exist, and its signature must be (String,
+            ;; Boolean, String).  Evince versions between 2.30 and 2.91.x
+            ;; didn't have the Boolean spawn argument we need to start evince
+            ;; initially.
+            (and spec
+                 (equal '("s" "b" "s")
+                        (delq nil (mapcar (lambda (elem)
+                                            (when (and (listp elem)
+                                                       (eq (car elem) 'arg))
+                                              (cdr (caar (cdr elem)))))
+                                          spec))))))))
+
+(defun TeX-evince-sync-view ()
+  "Focus the focused page/paragraph in Evince with the position
+of point in emacs by using Evince's DBUS API.  Used by default
+for the Evince viewer entry in `TeX-view-program-list-builtin' if
+the requirements are met."
+  (let* ((uri (concat "file://" (expand-file-name
+                                (concat file "." (TeX-output-extension)))))
+        (owner (dbus-call-method
+                :session "org.gnome.evince.Daemon"
+                "/org/gnome/evince/Daemon"
+                "org.gnome.evince.Daemon"
+                "FindDocument"
+                uri
+                t)))
+    (if owner
+       (dbus-call-method
+        :session owner
+        "/org/gnome/evince/Window/0"
+        "org.gnome.evince.Window"
+        "SyncView"
+        (buffer-file-name)
+        (list :struct :int32 (line-number-at-pos) :int32 (1+ (current-column)))
+        :uint32 (let ((time (float-time)))
+                  ;; FIXME: Evince wants a timestamp as UInt32, but POSIX time
+                  ;; is too large for emacs integers on 32 bit systems.  Emacs
+                  ;; 24.2 will allow providing DBUS ints as floats, and this
+                  ;; dbus version will be identifiable by its new variables
+                  ;; `dbus-compiled-version' and `dbus-runtime-version'.  But
+                  ;; it seems providing just 1 as timestamp has no negative
+                  ;; consequences, anyway.
+                  (if (> most-positive-fixnum time)
+                      (round time)
+                    1)))
+      (error "Couldn't find the Evince instance for %s" uri))))
+
 (defvar TeX-view-program-list-builtin
   (cond
    ((eq system-type 'windows-nt)
@@ -1011,7 +1087,7 @@ The following built-in predicates are available:
 ;;       ("displayline" "displayline %n %o %b")
 ;;       ("open" "open %o")))
    (t
-    '(("xdvi" ("%(o?)xdvi"
+    `(("xdvi" ("%(o?)xdvi"
               (mode-io-correlate " -sourceposition \"%n %b\" -editor \"%cS\"")
               ((paper-a4 paper-portrait) " -paper a4")
               ((paper-a4 paper-landscape) " -paper a4r")
@@ -1025,7 +1101,16 @@ The following built-in predicates are available:
       ("dvips and gv" "%(o?)dvips %d -o && gv %f")
       ("gv" "gv %o")
       ("xpdf" ("xpdf -remote %s -raise %o" (mode-io-correlate " %(outpage)")))
-      ("Evince" ("evince" (mode-io-correlate " -p %(outpage)") " %o"))
+      ("Evince" ,(if (TeX-evince-dbus-p :forward)
+                    'TeX-evince-sync-view
+                  `("evince" (mode-io-correlate
+                              ;; With evince 3, -p N opens the page *labeled* N,
+                              ;; and -i,--page-index the physical page N.
+                              ,(if (string-match "--page-index"
+                                                 (shell-command-to-string "evince --help"))
+                                   " -i %(outpage)"
+                                 " -p %(outpage)")) " %o")))
+      ("Okular" ("okular --unique %o" (mode-io-correlate "#src:%n%b")))
       ("xdg-open" "xdg-open %o"))))
   "Alist of built-in viewer specifications.
 This variable should not be changed by the user who can use
@@ -1125,6 +1210,9 @@ defined in `TeX-view-predicate-list' or
 `TeX-view-predicate-list-builtin'.  The second element is a
 string referring to the name of a viewer as defined in
 `TeX-view-program-list' or `TeX-view-program-list-builtin'.
+\(Note: Viewers added to `TeX-view-program-list' in the current
+Emacs session will not show up in the customization interface of
+`TeX-view-program-selection' until you restart Emacs.)
 
 When a viewer is called for, the entries are evaluated in turn
 and the viewer related to the first entry all predicates of which
@@ -1215,7 +1303,9 @@ predicates are true, nil otherwise."
 (defvar TeX-engine-alist-builtin
   '((default "Default" TeX-command LaTeX-command ConTeXt-engine)
     (xetex "XeTeX" "xetex" "xelatex" "xetex")
-    (luatex "LuaTeX" "luatex" "lualatex" "luatex")
+    ;; Some lualatex versions before 0.71 would use "texput" as file
+    ;; name if --jobname were not supplied
+    (luatex "LuaTeX" "luatex" "lualatex --jobname=%s" "luatex")
     (omega "Omega" TeX-Omega-command LaTeX-Omega-command ConTeXt-Omega-engine))
   "Alist of built-in TeX engines and associated commands.
 For a description of the format see `TeX-engine-alist'.")
@@ -1263,10 +1353,8 @@ It should be one of the following symbols:\n\n"
      (lambda (arg) (memq arg (mapcar 'car TeX-engine-alist-builtin))))
 
 (defun TeX-engine-set (type)
-  (concat "Set TeX engine to TYPE.
-TYPE can be one of the following symbols:\n"
-         (mapconcat (lambda (x) (format "* `%s'" (car x)))
-                    (TeX-engine-alist) "\n"))
+  "Set TeX engine to TYPE.
+For available TYPEs, see variable `TeX-engine'."
   (interactive (list (completing-read "Engine: "
                                      (mapcar (lambda (x)
                                                (symbol-name (car x)))
@@ -1373,7 +1461,7 @@ This is the case if `TeX-source-correlate-start-server-flag' is non-nil."
                    (call-process LaTeX-command
                                  nil (list standard-output nil) nil "--help"))
                (error ""))))
-    (if (string-match "^[ ]*-synctex" help)
+    (if (string-match "^[ ]*-?-synctex" help)
        'synctex
       'source-specials)))
 
@@ -1403,6 +1491,36 @@ If this is nil, an empty string will be returned."
   "Keymap for `TeX-source-correlate-mode'.
 You could use this for unusual mouse bindings.")
 
+(defun TeX-source-correlate-sync-source (file linecol &rest ignored)
+  "Show TeX FILE with point at LINECOL.
+This function is called when emacs receives a SyncSource signal
+emitted from the Evince document viewer.  IGNORED absorbs an
+unused id field accompanying the DBUS signal sent by Evince-3.0.0
+or newer."
+  ;; FILE may be given as relative path to the TeX-master root document or as
+  ;; absolute file:// URL.  In the former case, the tex file has to be already
+  ;; opened.
+  (let ((buf (let ((f (condition-case nil
+                         (progn
+                           (require 'url-parse)
+                           (aref (url-generic-parse-url file) 6))
+                       ;; For Emacs 21 compatibility, which doesn't have the
+                       ;; url package.
+                       (file-error (replace-regexp-in-string "^file://" "" file)))))
+              (if (file-name-absolute-p f)
+                  (find-file f)
+                (get-buffer (file-name-nondirectory file)))))
+        (line (car linecol))
+        (col (cadr linecol)))
+    (if (null buf)
+        (message "No buffer for %s." file)
+      (switch-to-buffer buf)
+      (push-mark (point) 'nomsg)
+      (goto-char (point-min))
+      (forward-line (1- line))
+      (unless (= col -1)
+        (move-to-column col)))))
+
 (define-minor-mode TeX-source-correlate-mode
   "Minor mode for forward and inverse search.
 
@@ -1424,6 +1542,12 @@ SyncTeX are recognized."
                                       TeX-source-correlate-map))
   (TeX-set-mode-name 'TeX-source-correlate-mode t t)
   (setq TeX-source-correlate-start-server-flag TeX-source-correlate-mode)
+  ;; Register Emacs for the SyncSource DBUS signal emitted by Evince.
+  (when (TeX-evince-dbus-p)
+    (dbus-register-signal
+     :session nil "/org/gnome/evince/Window/0"
+     "org.gnome.evince.Window" "SyncSource"
+     'TeX-source-correlate-sync-source))
   (unless TeX-source-correlate-method-active
     (setq TeX-source-correlate-method-active
          (if (eq TeX-source-correlate-method 'auto)
@@ -1531,8 +1655,8 @@ returned."
 (defvar TeX-synctex-tex-flags "--synctex=1"
   "Extra flags to pass to TeX commands to enable SyncTeX.")
 
-(defun TeX-synctex-output-page ()
-  "Return the page corresponding to the current source position.
+(defun TeX-synctex-output-page-1 (file)
+  "Return the page corresponding to the current position in FILE.
 This method assumes that the document was compiled with SyncTeX
 enabled and the `synctex' binary is available."
   (let ((synctex-output
@@ -1540,16 +1664,30 @@ enabled and the `synctex' binary is available."
           (call-process "synctex" nil (list standard-output nil) nil "view"
                         "-i" (format "%s:%s:%s" (line-number-at-pos)
                                      (current-column)
-                                     ;; The file name relative to the
-                                     ;; directory of the master file.
-                                     (file-relative-name
-                                      (buffer-file-name)
-                                      (file-name-directory
-                                       (TeX-active-master))))
+                                     file)
                         "-o" (TeX-active-master (TeX-output-extension))))))
     (when (string-match "Page:\\([0-9]+\\)" synctex-output)
       (match-string 1 synctex-output))))
 
+(defun TeX-synctex-output-page ()
+  "Return the page corresponding to the position in the current buffer.
+This method assumes that the document was compiled with SyncTeX
+enabled and the `synctex' binary is available."
+  (let* ((file (file-relative-name (buffer-file-name)
+                                  (file-name-directory
+                                   (TeX-active-master))))
+        (abs-file (concat (expand-file-name (or (file-name-directory (TeX-active-master))
+                                                (file-name-directory (buffer-file-name))))
+                          "./" file)))
+    ;; It's known that depending on synctex version one of
+    ;; /absolute/path/./foo/bar.tex, foo/bar.tex, or ./foo/bar.tex (relative to
+    ;; TeX-master, and the "." in the absolute path is important) are needed.
+    ;; So try all variants before falling back to page 1.
+    (or (TeX-synctex-output-page-1 abs-file)
+       (TeX-synctex-output-page-1 file)
+       (TeX-synctex-output-page-1 (concat "./" file))
+       "1")))
+
 ;;; Miscellaneous minor modes
 
 (defvar TeX-mode-p nil
@@ -1649,6 +1787,12 @@ already established, don't do anything."
   :type 'string)
   (make-variable-buffer-local 'TeX-command-BibTeX)
 
+(defcustom TeX-command-Biber "Biber"
+  "*The name of the Biber entry in `TeX-command-list'."
+  :group 'TeX-command-name
+  :type 'string)
+  (make-variable-buffer-local 'TeX-command-Biber)
+
 (defcustom TeX-command-Show "View"
   "*The default command to show (view or print) a TeX file.
 Must be the car of an entry in `TeX-command-list'."
@@ -1687,7 +1831,8 @@ Must be the car of an entry in `TeX-command-list'."
   '("\\.aux" "\\.bbl" "\\.blg" "\\.brf" "\\.fot"
     "\\.glo" "\\.gls" "\\.idx" "\\.ilg" "\\.ind"
     "\\.lof" "\\.log" "\\.lot" "\\.nav" "\\.out"
-    "\\.snm" "\\.toc" "\\.url" "\\.synctex\\.gz")
+    "\\.snm" "\\.toc" "\\.url" "\\.synctex\\.gz"
+    "\\.bcf" "\\.run\\.xml")
   "List of regexps matching suffixes of files to be cleaned.
 Used as a default in TeX, LaTeX and docTeX mode.")
 
@@ -1719,7 +1864,7 @@ output files."
         (master (TeX-active-master))
         (master-dir (file-name-directory master))
         (regexp (concat "\\("
-                        (file-name-nondirectory master) "\\|"
+                        (regexp-quote (file-name-nondirectory master)) "\\|"
                         (TeX-region-file nil t)
                         "\\)"
                         "\\("
@@ -2052,43 +2197,23 @@ If REGEXP is nil, or \"\", an error will occur."
          (setq answers (cons entry answers))))
     answers))
 
-(defun TeX-macro-global ()
-  "Return directories containing the site's TeX macro and style files."
-  (or (TeX-tree-expand '("$SYSTEXMF" "$TEXMFLOCAL" "$TEXMFMAIN" "$TEXMFDIST")
-                      "latex" '("/tex/" "/bibtex/bst/"))
-      '("/usr/share/texmf/tex/" "/usr/share/texmf/bibtex/bst/")))
-
-(defun TeX-macro-private ()
-  "Return directories containing the user's TeX macro and style files."
-  (TeX-tree-expand '("$TEXMFHOME") "latex" '("/tex/" "/bibtex/bst/")))
-
-(defun TeX-tree-expand (trees program subdirs)
-  "Return directories corresponding to the TeX trees TREES.
-This is done calling `kpsewhich' where PROGRAM is passed as the
-parameter for --progname.  SUBDIRS are subdirectories which are
-appended to the directories of the TeX trees."
+(defun TeX-tree-expand (vars program &optional subdirs)
+  "Return directories corresponding to the kpathsea variables VARS.
+This is done calling `kpsewhich --expand-path' for each variable.
+PROGRAM is passed as the parameter for --progname.  SUBDIRS are
+subdirectories which are appended to the directories of the TeX
+trees.  Only existing directories are returned."
   (let (path-list path exit-status input-dir-list)
     (condition-case nil
-       (catch 'success
-         (dotimes (i (safe-length trees))
-           (setq path (with-output-to-string
-                        (setq exit-status
-                              (call-process
-                               "kpsewhich"  nil
-                               (list standard-output nil) nil
-                               "--progname" program
-                               "--expand-braces" (nth i trees)))))
-           (if (zerop exit-status)
-               (progn (add-to-list 'path-list path)
-                      (when (zerop i) (throw 'success nil)))
-             (setq path (with-output-to-string
-                          (setq exit-status
-                                (call-process
-                                 "kpsewhich"  nil
-                                 (list standard-output nil) nil
-                                 "--progname" program
-                                 "--expand-path" (nth i trees)))))
-             (when (zerop exit-status) (add-to-list 'path-list path)))))
+       (dolist (var vars)
+         (setq path (with-output-to-string
+                      (setq exit-status (call-process
+                                         "kpsewhich"  nil
+                                         (list standard-output nil) nil
+                                         "--progname" program
+                                         "--expand-path" var))))
+         (when (zerop exit-status)
+           (add-to-list 'path-list path t)))
       (error nil))
     (dolist (elt path-list)
       (let ((separators (if (string-match "^[A-Za-z]:" elt)
@@ -2098,15 +2223,26 @@ appended to the directories of the TeX trees."
                          (split-string elt separators t)
                        ;; COMPATIBILITY for XEmacs <= 21.4.15
                        (error (delete "" (split-string elt separators)))))
-         (when (string-match "^!+" item)
-           (setq item (substring item (match-end 0) (length item))))
-         (when (string-match "/+$" item)
-           (setq item (substring item 0 (match-beginning 0))))
-         (dolist (subdir subdirs)
-           (when (file-exists-p (file-name-as-directory (concat item subdir)))
-             (add-to-list 'input-dir-list (concat item subdir)))))))
+         (if subdirs
+             (dolist (subdir subdirs)
+               (setq path (file-name-as-directory (concat item subdir)))
+               (when (file-exists-p path)
+                 (add-to-list 'input-dir-list path t)))
+           (setq path (file-name-as-directory item))
+           (when (file-exists-p path)
+             (add-to-list 'input-dir-list path t))))))
     input-dir-list))
 
+(defun TeX-macro-global ()
+  "Return directories containing the site's TeX macro and style files."
+  (or (TeX-tree-expand '("$SYSTEXMF" "$TEXMFLOCAL" "$TEXMFMAIN" "$TEXMFDIST")
+                      "latex" '("/tex/" "/bibtex/bst/"))
+      '("/usr/share/texmf/tex/" "/usr/share/texmf/bibtex/bst/")))
+
+(defun TeX-macro-private ()
+  "Return directories containing the user's TeX macro and style files."
+  (TeX-tree-expand '("$TEXMFHOME") "latex" '("/tex/" "/bibtex/bst/")))
+
 (defcustom TeX-macro-global (TeX-macro-global)
   "Directories containing the site's TeX macro and style files."
   :group 'TeX-file
@@ -2354,18 +2490,6 @@ FORCE is not nil."
 (defvar TeX-grcl "}" "The TeX group closing character.")
  (make-variable-buffer-local 'TeX-grcl)
 
-(defcustom plain-TeX-enable-toolbar t
-  "Enable TeX tool bar in plain TeX mode."
-  :group 'TeX-tool-bar
-  :type 'boolean)
-
-(defun plain-TeX-maybe-install-toolbar ()
-  "Conditionally install tool bar buttons for plain TeX mode.
-Install tool bar if `plain-TeX-enable-toolbar' is non-nil."
-  (when plain-TeX-enable-toolbar
-    ;; Defined in `tex-bar.el':
-    (TeX-install-toolbar)))
-
 ;;; Symbols
 
 ;; Must be before keymaps.
@@ -2412,11 +2536,14 @@ Or alternatively:
               (pattern (TeX-match-buffer 0))
               (symbol (buffer-substring begin end))
               (list (funcall (nth 2 entry)))
-              (completion (try-completion symbol list)))
+              (completion (try-completion symbol list))
+              (buf-name "*Completions*"))
          (cond ((eq completion t)
                 (and close
                      (not (looking-at (regexp-quote close)))
-                     (insert close)))
+                     (insert close))
+                (let ((window (get-buffer-window buf-name)))
+                  (when window (delete-window window))))
                ((null completion)
                 (error "Can't find completion for \"%s\"" pattern))
                ((not (string-equal symbol completion))
@@ -2425,13 +2552,19 @@ Or alternatively:
                 (and close
                      (eq (try-completion completion list) t)
                      (not (looking-at (regexp-quote close)))
-                     (insert close)))
+                     (insert close))
+                (let ((window (get-buffer-window buf-name)))
+                  (when window (delete-window window))))
                (t
-                (message "Making completion list...")
-                (let ((list (all-completions symbol list nil)))
-                  (with-output-to-temp-buffer "*Completions*"
-                    (display-completion-list list)))
-                (message "Making completion list...done"))))
+                (if (fboundp 'completion-in-region)
+                    (completion-in-region begin end
+                                          (all-completions symbol list nil))
+                  (message "Making completion list...")
+                  (let ((list (all-completions symbol list nil)))
+                    (with-output-to-temp-buffer buf-name
+                      (display-completion-list list)))
+                  (set-window-dedicated-p (get-buffer-window buf-name) 'soft)
+                  (message "Making completion list...done")))))
       (funcall (nth 1 entry)))))
 
 (defcustom TeX-default-macro "ref"
@@ -2569,10 +2702,10 @@ type of ARGS:
           (goto-char (marker-position exit-mark))
           (set-marker exit-mark nil))
          ((and TeX-insert-braces
-               ;; Do not add braces for macros defined as `("foo" 0)'
+               ;; Do not add braces if the argument is 0 or -1.
                (not (and (= (safe-length args) 1)
                          (numberp (car args))
-                         (= (car args) 0)))
+                         (<= (car args) 0)))
                (equal position (point))
                (string-match "[a-zA-Z]+" symbol)
                (not (texmathp)))
@@ -2637,11 +2770,25 @@ See `TeX-parse-macro' for details."
           (TeX-arg-string optional arg)
           (setq insert-flag t))
          ((numberp arg)
-          (unless (< arg 1)
-            (TeX-parse-argument optional t)
-            (while (> arg 1)
-              (TeX-parse-argument optional nil)
-              (setq arg (- arg 1)))))
+          (cond ((< arg 0)
+                 (when (TeX-active-mark)
+                   ;; Put both the macro and the marked region in a TeX group.
+                   (let ((beg (min (point) (mark)))
+                         (end (set-marker (make-marker) (max (point) (mark)))))
+                     (insert " ")
+                     (goto-char beg)
+                     (skip-chars-backward "^\\\\")
+                     (backward-char)
+                     (insert TeX-arg-opening-brace)
+                     (goto-char (marker-position end))
+                     (insert TeX-arg-closing-brace)
+                     (setq insert-flag t))))
+                ((= arg 0)) ; nop for clarity
+                ((> arg 0)
+                 (TeX-parse-argument optional t)
+                 (while (> arg 1)
+                   (TeX-parse-argument optional nil)
+                   (setq arg (- arg 1))))))
          ((null arg)
           (insert TeX-arg-opening-brace)
           (when (and (not optional) (TeX-active-mark))
@@ -2835,7 +2982,6 @@ The algorithm is as follows:
   (kill-all-local-variables)
   (setq TeX-mode-p t)
   (setq TeX-output-extension (if TeX-PDF-mode "pdf" "dvi"))
-  (setq local-abbrev-table text-mode-abbrev-table)
   (setq indent-tabs-mode nil)
 
   ;; Ispell support
@@ -2927,95 +3073,6 @@ The algorithm is as follows:
                (TeX-master-file nil nil t))
              (TeX-update-style t)) nil t))
 
-;;; Plain TeX mode
-
-(defcustom plain-TeX-clean-intermediate-suffixes
-  TeX-clean-default-intermediate-suffixes
-  "List of regexps matching suffixes of intermediate files to be deleted.
-The regexps will be anchored at the end of the file name to be matched,
-i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
-  :type '(repeat regexp)
-  :group 'TeX-command)
-
-(defcustom plain-TeX-clean-output-suffixes TeX-clean-default-output-suffixes
-  "List of regexps matching suffixes of output files to be deleted.
-The regexps will be anchored at the end of the file name to be matched,
-i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
-  :type '(repeat regexp)
-  :group 'TeX-command)
-
-(defcustom plain-TeX-mode-hook nil
-  "A hook run in plain TeX mode buffers."
-  :type 'hook
-  :group 'TeX-misc)
-
-;;;###autoload
-(defun TeX-plain-tex-mode ()
-  "Major mode in AUCTeX for editing plain TeX files.
-See info under AUCTeX for documentation.
-
-Special commands:
-\\{plain-TeX-mode-map}
-
-Entering `plain-tex-mode' calls the value of `text-mode-hook',
-then the value of `TeX-mode-hook', and then the value
-of plain-TeX-mode-hook."
-  (interactive)
-  (plain-TeX-common-initialization)
-  (setq major-mode 'plain-tex-mode)
-  (use-local-map plain-TeX-mode-map)
-  (easy-menu-add plain-TeX-mode-menu plain-TeX-mode-map)
-  (easy-menu-add plain-TeX-mode-command-menu plain-TeX-mode-map)
-  (setq TeX-base-mode-name "TeX")
-  (setq TeX-command-default "TeX")
-  (setq TeX-sentinel-default-function 'TeX-TeX-sentinel)
-  (add-hook 'tool-bar-mode-on-hook 'plain-TeX-maybe-install-toolbar nil t)
-  (when (if (featurep 'xemacs)
-           (featurep 'toolbar)
-         (and (boundp 'tool-bar-mode) tool-bar-mode))
-    (plain-TeX-maybe-install-toolbar))
-  (TeX-run-mode-hooks 'text-mode-hook 'TeX-mode-hook 'plain-TeX-mode-hook)
-  (TeX-set-mode-name))
-
-(defun plain-TeX-common-initialization ()
-  "Common initialization for plain TeX like modes."
-  (VirTeX-common-initialization)
-  (set-syntax-table TeX-mode-syntax-table)
-  (setq paragraph-start
-       (concat
-        "\\(^[ \t]*$"
-        "\\|" (regexp-quote TeX-esc) "par\\|"
-        "^[ \t]*"
-        (regexp-quote TeX-esc)
-        "\\("
-        "begin\\|end\\|part\\|chapter\\|"
-        "section\\|subsection\\|subsubsection\\|"
-        "paragraph\\|include\\|includeonly\\|"
-        "tableofcontents\\|appendix\\|label\\|caption\\|"
-        "\\[\\|\\]"                    ; display math delimitors
-        "\\)"
-        "\\|"
-        "^[ \t]*\\$\\$"                ; display math delimitor
-        "\\)" ))
-  (setq paragraph-separate
-       (concat
-        "[ \t]*"
-        "\\("
-        (regexp-quote TeX-esc) "par\\|"
-        "%\\|"
-        "$\\|"
-        "\\$\\$\\|"
-        (regexp-quote TeX-esc)
-        "\\("
-        "begin\\|end\\|label\\|caption\\|part\\|chapter\\|"
-        "section\\|subsection\\|subsubsection\\|"
-        "paragraph\\|include\\|includeonly\\|"
-        "tableofcontents\\|appendix\\|" (regexp-quote TeX-esc)
-        "\\)"
-        "\\)"))
-  (setq TeX-header-end (regexp-quote "%**end of header"))
-  (setq TeX-trailer-start (regexp-quote (concat TeX-esc "bye")))
-  (TeX-run-style-hooks "TEX"))
 
 ;;; Hilighting
 
@@ -3195,6 +3252,24 @@ Generated by `TeX-auto-add-type'.")
   :group 'TeX-file
   :type 'directory)
 
+(defcustom TeX-ignore-file
+  "\\(^\\|[/\\]\\)\\(\\.\\|\\.\\.\\|RCS\\|SCCS\\|CVS\\|babel\\..*\\)$"
+  "Regular expression matching file names to ignore.
+
+These files or directories will not be considered when searching for
+TeX files in a directory."
+  :group 'TeX-parse
+  :type 'regexp)
+
+(defcustom TeX-file-recurse t
+  "Whether to search TeX directories recursively.
+nil means do not recurse, a positive integer means go that far deep in the
+directory hierarchy, t means recurse indefinitely."
+  :group 'TeX-parse
+  :type '(choice (const :tag "On" t)
+                (const :tag "Off" nil)
+                (integer :tag "Depth" :value 1)))
+
 ;;;###autoload
 (defun TeX-auto-generate (tex auto)
   "Generate style file for TEX and store it in AUTO.
@@ -3230,8 +3305,10 @@ If TEX is a directory, generate style files for all files in the directory."
               (concat (file-name-as-directory auto)
                       (TeX-strip-extension tex TeX-all-extensions t)
                       ".el"))))
-       ((TeX-match-extension tex (append TeX-file-extensions
-                                         BibTeX-file-extensions))
+       ((TeX-match-extension tex (TeX-delete-duplicate-strings
+                                  (append TeX-file-extensions
+                                          BibTeX-file-extensions
+                                          TeX-Biber-file-extensions)))
         (save-excursion
           (set-buffer (let (enable-local-eval)
                         (find-file-noselect tex)))
@@ -3251,7 +3328,8 @@ If TEX is a directory, generate style files for all files in the directory."
   (unless (file-directory-p TeX-auto-global)
     (make-directory TeX-auto-global))
   (let ((TeX-file-extensions '("cls" "sty"))
-       (BibTeX-file-extensions nil))
+       (BibTeX-file-extensions nil)
+       (TeX-Biber-file-extensions nil))
     (mapc (lambda (macro) (TeX-auto-generate macro TeX-auto-global))
          TeX-macro-global))
   (byte-recompile-directory TeX-auto-global 0))
@@ -3308,6 +3386,22 @@ If SKIP is not-nil, don't insert code for SKIP."
     "theenumv" "document" "par" "do" "expandafter")
   "List of symbols to ignore when scanning a TeX style file.")
 
+(defcustom TeX-auto-regexp-list 'TeX-auto-full-regexp-list
+  "List of regular expressions used for parsing the current file."
+  :type '(radio (variable-item TeX-auto-empty-regexp-list)
+               (variable-item TeX-auto-full-regexp-list)
+               (variable-item plain-TeX-auto-regexp-list)
+               (variable-item LaTeX-auto-minimal-regexp-list)
+               (variable-item LaTeX-auto-label-regexp-list)
+               (variable-item LaTeX-auto-regexp-list)
+               (symbol :tag "Other")
+               (repeat :tag "Specify"
+                       (group (regexp :tag "Match")
+                              (sexp :tag "Groups")
+                              symbol)))
+  :group 'TeX-parse)
+  (make-variable-buffer-local 'TeX-auto-regexp-list)
+
 (defun TeX-auto-add-regexp (regexp)
   "Add REGEXP to `TeX-auto-regexp-list' if not already a member."
   (if (symbolp TeX-auto-regexp-list)
@@ -3331,17 +3425,21 @@ alter the numbering of any ordinary, non-shy groups.")
 
 (defvar plain-TeX-auto-regexp-list
   (let ((token TeX-token-char))
-    `((,(concat "\\\\def\\\\\\(" token "+\\)[^a-zA-Z@]") 1 TeX-auto-symbol-check)
-      (,(concat "\\\\let\\\\\\(" token "+\\)[^a-zA-Z@]") 1 TeX-auto-symbol-check)
+    `((,(concat "\\\\def\\\\\\(" token "+\\)[^a-zA-Z@]")
+       1 TeX-auto-symbol-check)
+      (,(concat "\\\\let\\\\\\(" token "+\\)[^a-zA-Z@]")
+       1 TeX-auto-symbol-check)
       (,(concat "\\\\font\\\\\\(" token "+\\)[^a-zA-Z@]") 1 TeX-auto-symbol)
       (,(concat "\\\\chardef\\\\\\(" token "+\\)[^a-zA-Z@]") 1 TeX-auto-symbol)
-      (,(concat "\\\\new\\(?:count\\|dimen\\|muskip\\|skip\\)\\\\\\(" token "+\\)[^a-zA-Z@]")
+      (,(concat "\\\\new\\(?:count\\|dimen\\|muskip\\|skip\\)\\\\\\(" token
+               "+\\)[^a-zA-Z@]")
        1 TeX-auto-symbol)
       (,(concat "\\\\newfont{?\\\\\\(" token "+\\)}?") 1 TeX-auto-symbol)
       (,(concat "\\\\typein\\[\\\\\\(" token "+\\)\\]") 1 TeX-auto-symbol)
       ("\\\\input +\\(\\.*[^#%\\\\\\.\n\r]+\\)\\(\\.[^#%\\\\\\.\n\r]+\\)?"
        1 TeX-auto-file)
-      (,(concat "\\\\mathchardef\\\\\\(" token "+\\)[^a-zA-Z@]") 1 TeX-auto-symbol)))
+      (,(concat "\\\\mathchardef\\\\\\(" token "+\\)[^a-zA-Z@]")
+       1 TeX-auto-symbol)))
   "List of regular expression matching common LaTeX macro definitions.")
 
 (defvar TeX-auto-full-regexp-list plain-TeX-auto-regexp-list
@@ -3504,26 +3602,8 @@ Check for potential LaTeX environments."
            (add-to-list 'TeX-auto-symbol elt))
        (add-to-list 'TeX-auto-symbol symbol)))))
 
-;;; Utilities
-;;
-;; Some of these functions has little to do with TeX, but nonetheless we
-;; should use the "TeX-" prefix to avoid name clashes.
 
-(defcustom TeX-auto-regexp-list 'TeX-auto-full-regexp-list
-  "*List of regular expressions used for parsing the current file."
-  :type '(radio (variable-item TeX-auto-empty-regexp-list)
-               (variable-item TeX-auto-full-regexp-list)
-               (variable-item plain-TeX-auto-regexp-list)
-               (variable-item LaTeX-auto-minimal-regexp-list)
-               (variable-item LaTeX-auto-label-regexp-list)
-               (variable-item LaTeX-auto-regexp-list)
-               (symbol :tag "Other")
-               (repeat :tag "Specify"
-                       (group (regexp :tag "Match")
-                              (sexp :tag "Groups")
-                              symbol)))
-  :group 'TeX-parse)
-  (make-variable-buffer-local 'TeX-auto-regexp-list)
+;;; File Extensions
 
 (defgroup TeX-file-extension nil
   "File extensions recognized by AUCTeX."
@@ -3546,6 +3626,11 @@ Check for potential LaTeX environments."
 
   (make-variable-buffer-local 'TeX-default-extension)
 
+(defvar TeX-doc-extensions
+  '("dvi" "pdf" "ps" "txt" "html" "dvi.gz" "pdf.gz" "ps.gz" "txt.gz" "html.gz"
+    "dvi.bz2" "pdf.bz2" "ps.bz2" "txt.bz2" "html.bz2")
+  "File extensions of documentation files.")
+
 (defcustom docTeX-default-extension "dtx"
   "*Default extension for docTeX files."
   :group 'TeX-file-extension
@@ -3559,6 +3644,11 @@ Access to the value should be through the function `TeX-output-extension'.")
 
   (make-variable-buffer-local 'TeX-output-extension)
 
+(defcustom TeX-Biber-file-extensions '("bib" "ris" "xml")
+  "Valid file extensions for Biber files."
+  :group 'TeX-file-extension
+  :type '(repeat (string :format "%v")))
+
 (defcustom BibTeX-file-extensions '("bib")
   "Valid file extensions for BibTeX files."
   :group 'TeX-file-extension
@@ -3569,23 +3659,6 @@ Access to the value should be through the function `TeX-output-extension'.")
   :group 'TeX-file-extension
   :type '(repeat (string :format "%v")))
 
-(defcustom TeX-ignore-file "\\(^\\|[/\\]\\)\\(\\.\\|\\.\\.\\|RCS\\|SCCS\\|CVS\\|babel\\..*\\)$"
-  "Regular expression matching file names to ignore.
-
-These files or directories will not be considered when searching for
-TeX files in a directory."
-  :group 'TeX-parse
-  :type 'regexp)
-
-(defcustom TeX-file-recurse t
-  "*Whether to search TeX directories recursively.
-nil means do not recurse, a positive integer means go that far deep in the
-directory hierarchy, t means recurse indefinitely."
-  :group 'TeX-parse
-  :type '(choice (const :tag "On" t)
-                (const :tag "Off" nil)
-                (integer :tag "Depth" :value 1)))
-
 (defun TeX-match-extension (file &optional extensions)
   "Return non-nil if FILE has one of EXTENSIONS.
 
@@ -3628,6 +3701,23 @@ EXTENSIONS defaults to `TeX-file-extensions'."
        (file-name-nondirectory strip)
       strip)))
 
+
+;;; File Searching
+
+(defun TeX-tree-roots ()
+  "Return a list of available TeX tree roots."
+  (let (list)
+    (dolist (dir (TeX-tree-expand '("$TEXMFHOME" "$TEXMFMAIN" "$TEXMFLOCAL"
+                                   "$TEXMFDIST") "latex"))
+      (when (file-readable-p dir)
+       (add-to-list 'list dir t)))
+    list))
+
+(defcustom TeX-tree-roots (TeX-tree-roots)
+  "List of all available TeX tree root directories."
+  :group 'TeX-file
+  :type '(repeat directory))
+
 (defcustom TeX-kpathsea-path-delimiter t
   "Path delimiter for kpathsea output.
 t means autodetect, nil means kpathsea is disabled."
@@ -3637,78 +3727,46 @@ t means autodetect, nil means kpathsea is disabled."
                 (const :tag "Autodetect" t)
                 (const :tag "Off" nil)))
 
-(defcustom TeX-kpathsea-format-alist
-  '(("tex" "${TEXINPUTS.latex}" TeX-file-extensions)
-    ("sty" "${TEXINPUTS.latex}" '("sty"))
-    ("dvi" "${TEXDOCS}" '("dvi" "pdf" "ps" "txt" "html"
-                         "dvi.gz" "pdf.gz" "ps.gz" "txt.gz" "html.gz"
-                         "dvi.bz2" "pdf.bz2" "ps.bz2" "txt.bz2" "html.bz2"))
-    ("eps" "${TEXINPUTS}" LaTeX-includegraphics-extensions)
-    ("pdf" "${TEXINPUTS}" LaTeX-includegraphics-extensions)
-    ("png" "${TEXINPUTS}" LaTeX-includegraphics-extensions)
-    ("jpg" "${TEXINPUTS}" LaTeX-includegraphics-extensions)
-    ("jpeg" "${TEXINPUTS}" LaTeX-includegraphics-extensions)
-    ("bib" "$BIBINPUTS" BibTeX-file-extensions)
-    ("bst" "$BSTINPUTS" BibTeX-style-extensions))
-  "Formats to search for expansion using kpathsea.
-The key of the alist represents the name of the format.  The
-first element of the cdr of the alist is string to expand by the
-respective kpathsea program and the second element is a list of
-file extensions to match."
-  :group 'TeX-file
-  :type '(alist :key-type string :value-type (group string sexp)))
-
-;; FIXME: Despite the first parameter named `extensions',
-;; `TeX-search-files-kpathsea' basically treats this as a format
-;; specifier.  Only the first element in the respective list will be
-;; used to determine the search paths and file extensions with the
-;; help of `TeX-kpathsea-format-alist'.  Out of these differences
-;; arises a need to unify the behavior of `TeX-search-files' and
-;; `TeX-search-files-kpathsea' and their treatment of parameters.
-;; Additionally `TeX-search-files-kpathsea' should be made more
-;; general to work with other platforms and TeX systems as well.
-(defun TeX-search-files-kpathsea (extensions nodir strip)
-  "The kpathsea-enabled version of `TeX-search-files'.
-Except for DIRECTORIES (a kpathsea string), the arguments for
-EXTENSIONS, NODIR and STRIP are explained there."
+;; We keep this function in addition to `TeX-search-files' because it
+;; is faster.  Since it does not look further into subdirectories,
+;; this comes at the price of finding a smaller number of files.
+(defun TeX-search-files-kpathsea (var extensions scope nodir strip)
+  "Return a list of files in directories determined by expanding VAR.
+Only files which match EXTENSIONS are returned.  SCOPE defines
+the scope for the search and can be `local' or `global' besides
+nil.  If NODIR is non-nil, remove directory part.  If STRIP is
+non-nil, remove file extension."
   (and TeX-kpathsea-path-delimiter
        (catch 'no-kpathsea
-        (let* ((format-spec (assoc (car extensions)
-                                   TeX-kpathsea-format-alist))
-               (dirs (with-output-to-string
-                       (unless (zerop
-                                (call-process
-                                 "kpsewhich" nil (list standard-output nil)
-                                 nil
-                                 (concat
-                                  "-expand-path="
-                                  (nth 1 format-spec))))
-                        (if (eq TeX-kpathsea-path-delimiter t)
-                            (throw 'no-kpathsea
-                                   (setq TeX-kpathsea-path-delimiter nil))
-                          (error "kpsewhich error")))))
-              result)
+        (let* ((dirs (if (eq scope 'local)
+                         "."
+                       (with-output-to-string
+                         (unless (zerop (call-process
+                                         "kpsewhich" nil
+                                         (list standard-output nil) nil
+                                         (concat "-expand-path=" var)))
+                           (if (eq TeX-kpathsea-path-delimiter t)
+                               (throw 'no-kpathsea
+                                      (setq TeX-kpathsea-path-delimiter nil))
+                             (error "kpsewhich error"))))))
+               result)
           (when (eq TeX-kpathsea-path-delimiter t)
             (setq TeX-kpathsea-path-delimiter
-                  (cond ((string-match ";" dirs)
-                         ";")
-                        ((string-match ":" dirs)
-                         ":"))))
+                  (if (string-match ";" dirs) ";" ":")))
           (unless TeX-kpathsea-path-delimiter
             (throw 'no-kpathsea nil))
-          (setq dirs (split-string dirs (concat "[\n\r"
-                                                TeX-kpathsea-path-delimiter
-                                                "]+")))
-          (setq extensions (concat "\\."
-                                   (regexp-opt (eval (nth 2 format-spec)) t)
-                                   "\\'"))
-          (setq result
-                (apply #'append
-                       (mapcar
-                        (lambda(x) (directory-files x
-                                                    (not nodir)
-                                                    extensions))
-                        dirs)))
+          (setq dirs (delete "" (split-string
+                                 dirs (concat "[\n\r"
+                                              TeX-kpathsea-path-delimiter
+                                              "]+"))))
+          (if (eq scope 'global)
+              (delete "." dirs))
+          (setq extensions (concat "\\." (regexp-opt extensions t) "\\'")
+                result (apply #'append (mapcar (lambda (x)
+                                                 (when (file-readable-p x)
+                                                   (directory-files
+                                                    x (not nodir) extensions)))
+                                               dirs)))
           (if strip
               (mapcar (lambda(x)
                         (if (string-match extensions x)
@@ -3724,46 +3782,117 @@ If optional argument STRIP is set, remove file extension.
 If optional argument DIRECTORIES is set, search in those directories.
 Otherwise, search in all TeX macro directories.
 If optional argument EXTENSIONS is not set, use `TeX-file-extensions'"
-  (if (null extensions)
-      (setq extensions TeX-file-extensions))
-  (or (TeX-search-files-kpathsea extensions nodir strip)
-      (progn
-       (if (null directories)
-           (setq directories
-                 (cons "./" (append TeX-macro-private TeX-macro-global))))
-       (let (match
-             (TeX-file-recurse (cond ((symbolp TeX-file-recurse)
-                                      TeX-file-recurse)
-                                     ((zerop TeX-file-recurse)
-                                      nil)
-                                     ((1- TeX-file-recurse)))))
-         (while directories
-           (let* ((directory (car directories))
-                  (content (and directory
-                                (file-readable-p directory)
-                                (file-directory-p directory)
-                                (directory-files directory))))
-             (setq directories (cdr directories))
-             (while content
-               (let ((file (concat directory (car content))))
-                 (setq content (cdr content))
-                 (cond ((string-match TeX-ignore-file file))
-                       ((not (file-readable-p file)))
-                       ((file-directory-p file)
-                        (if TeX-file-recurse
-                            (setq match
-                                  (append match
-                                          (TeX-search-files
-                                           (list (file-name-as-directory file))
-                                           extensions
-                                           nodir strip)))))
-                       ((TeX-match-extension file extensions)
-                        (setq match (cons (TeX-strip-extension file
-                                                               extensions
-                                                               nodir
-                                                               (not strip))
-                                          match))))))))
-         match))))
+  (when (null extensions)
+    (setq extensions TeX-file-extensions))
+  (when (null directories)
+    (setq directories (cons "./" (append TeX-macro-private TeX-macro-global))))
+  (let (match
+       (TeX-file-recurse (cond ((symbolp TeX-file-recurse)
+                                TeX-file-recurse)
+                               ((zerop TeX-file-recurse)
+                                nil)
+                               ((1- TeX-file-recurse)))))
+    (while directories
+      (let* ((directory (car directories))
+            (content (and directory
+                          (file-readable-p directory)
+                          (file-directory-p directory)
+                          (directory-files directory))))
+       (setq directories (cdr directories))
+       (while content
+         (let ((file (concat directory (car content))))
+           (setq content (cdr content))
+           (cond ((string-match TeX-ignore-file file))
+                 ((not (file-readable-p file)))
+                 ((file-directory-p file)
+                  (if TeX-file-recurse
+                      (setq match
+                            (append match
+                                    (TeX-search-files
+                                     (list (file-name-as-directory file))
+                                     extensions nodir strip)))))
+                 ((TeX-match-extension file extensions)
+                  (setq match (cons (TeX-strip-extension
+                                     file extensions nodir (not strip))
+                                    match))))))))
+    match))
+
+;; The variables `TeX-macro-private' and `TeX-macro-global' are not
+;; used for specifying the directories because the number of
+;; directories to be searched should be limited as much as possible
+;; and the TeX-macro-* variables are just too broad for this.
+(defvar TeX-search-files-type-alist
+  '((texinputs "${TEXINPUTS}" ("tex/") TeX-file-extensions)
+    (docs "${TEXDOCS}" ("doc/") TeX-doc-extensions)
+    (graphics "${TEXINPUTS}" ("tex/") LaTeX-includegraphics-extensions)
+    (bibinputs "${BIBINPUTS}" ("bibtex/bib/") BibTeX-file-extensions)
+    (bstinputs "${BSTINPUTS}" ("bibtex/bst/") BibTeX-style-extensions))
+  "Alist of filetypes with locations and file extensions.
+Each element of the alist consists of a symbol expressing the
+filetype, a variable which can be expanded on kpathsea-based
+systems into the directories where files of the given type
+reside, a list of absolute directories, relative directories
+below the root of a TDS-compliant TeX tree or a list of variables
+with either type of directories as an alternative for
+non-kpathsea-based systems and a list of extensions to be matched
+upon a file search.  Note that the directories have to end with a
+directory separator.
+
+Each AUCTeX mode should set the variable buffer-locally with a
+more specific value.  See `LateX-search-files-type-alist' for an
+example.")
+
+(defun TeX-search-files-by-type (filetype &optional scope nodir strip)
+  "Return a list of files in TeX's search path with type FILETYPE.
+FILETYPE is a symbol used to choose the search paths and
+extensions.  See `TeX-search-file-type-alist' for supported
+symbols.
+
+The optional argument SCOPE sets the scope for the search.
+Besides nil the symbols `local' and `global' are accepted.
+`local' means to search in the current directory only, `global'
+in the global directories only and nil in both.
+
+If optional argument NODIR is non-nil, remove directory part.
+
+If optional argument STRIP is non-nil, remove file extension."
+  (let* ((spec (assq filetype TeX-search-files-type-alist))
+        (kpse-var (nth 1 spec))
+        (rawdirs (nth 2 spec))
+        (exts (nth 3 spec))
+        expdirs dirs local-files)
+    (setq exts (if (symbolp exts) (eval exts) exts))
+    (or (TeX-search-files-kpathsea kpse-var exts scope nodir strip)
+       (progn
+         (unless (eq scope 'global)
+           (setq local-files
+                 (let ((TeX-file-recurse nil))
+                   (TeX-search-files '("./") exts nodir strip))))
+         (if (eq scope 'local)
+             local-files
+           (if (null TeX-tree-roots)
+               (error "No TeX trees available; configure `TeX-tree-roots'")
+             ;; Expand variables.
+             (dolist (rawdir rawdirs)
+               (if (symbolp rawdir)
+                   (setq expdirs (append expdirs (eval rawdir)))
+                 (add-to-list 'expdirs rawdir t)))
+             (delete-dups expdirs)
+             ;; Assumption: Either all paths are absolute or all are relative.
+             (if (file-name-absolute-p (car expdirs))
+                 (setq dirs expdirs)
+               ;; Append relative TDS subdirs to all TeX tree roots.
+               (dolist (root TeX-tree-roots)
+                 (dolist (dir expdirs)
+                   (add-to-list 'dirs (concat (file-name-as-directory root)
+                                              dir) t)))))
+           (append local-files (TeX-search-files dirs exts nodir strip)))))))
+
+
+;;; Utilities
+;;
+;; Some of these functions has little to do with TeX, but nonetheless we
+;; should use the "TeX-" prefix to avoid name clashes.
 
 (defun TeX-car-string-lessp (s1 s2)
   "Compare the cars of S1 and S2 in lexicographic order.
@@ -4068,12 +4197,6 @@ Brace insertion is only done if point is in a math construct and
     map)
   "Keymap for common TeX and LaTeX commands.")
 
-(defvar plain-TeX-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map TeX-mode-map)
-    map)
-  "Keymap used in plain TeX mode.")
-
 (defun TeX-mode-specific-command-menu (mode)
   "Return a Command menu specific to the major MODE."
   ;; COMPATIBILITY for Emacs < 21
@@ -4213,13 +4336,6 @@ Brace insertion is only done if point is in a math construct and
       :help "Hide or show the item containing point"]))
    "Menu definition for commands from tex-fold.el.")
 
-
-;;; Menus for plain TeX mode
-(easy-menu-define plain-TeX-mode-command-menu
-    plain-TeX-mode-map
-    "Command menu used in TeX mode."
-    (TeX-mode-specific-command-menu 'plain-tex-mode))
-
 (defvar TeX-customization-menu nil)
 
 (defvar TeX-common-menu-entries
@@ -4258,91 +4374,6 @@ Brace insertion is only done if point is in a math construct and
       :help ,(format "Problems with AUCTeX %s? Mail us!"
                     AUCTeX-version)])))
 
-(defvar plain-TeX-menu-entries
-  (TeX-menu-with-help
-   `(["Macro..." TeX-insert-macro
-      :help "Insert a macro and possibly arguments"]
-     ["Complete" TeX-complete-symbol
-      :help "Complete the current macro"]
-     "-"
-     ("Insert Font"
-      ["Emphasize"  (TeX-font nil ?\C-e) :keys "C-c C-f C-e"]
-      ["Bold"       (TeX-font nil ?\C-b) :keys "C-c C-f C-b"]
-      ["Typewriter" (TeX-font nil ?\C-t) :keys "C-c C-f C-t"]
-      ["Small Caps" (TeX-font nil ?\C-c) :keys "C-c C-f C-c"]
-      ["Sans Serif" (TeX-font nil ?\C-f) :keys "C-c C-f C-f"]
-      ["Italic"     (TeX-font nil ?\C-i) :keys "C-c C-f C-i"]
-      ["Slanted"    (TeX-font nil ?\C-s) :keys "C-c C-f C-s"]
-      ["Roman"      (TeX-font nil ?\C-r) :keys "C-c C-f C-r"]
-      ["Calligraphic" (TeX-font nil ?\C-a) :keys "C-c C-f C-a"])
-     ("Replace Font"
-      ["Emphasize"  (TeX-font t ?\C-e) :keys "C-u C-c C-f C-e"]
-      ["Bold"       (TeX-font t ?\C-b) :keys "C-u C-c C-f C-b"]
-      ["Typewriter" (TeX-font t ?\C-t) :keys "C-u C-c C-f C-t"]
-      ["Small Caps" (TeX-font t ?\C-c) :keys "C-u C-c C-f C-c"]
-      ["Sans Serif" (TeX-font t ?\C-f) :keys "C-u C-c C-f C-f"]
-      ["Italic"     (TeX-font t ?\C-i) :keys "C-u C-c C-f C-i"]
-      ["Slanted"    (TeX-font t ?\C-s) :keys "C-u C-c C-f C-s"]
-      ["Roman"      (TeX-font t ?\C-r) :keys "C-u C-c C-f C-r"]
-      ["Calligraphic" (TeX-font t ?\C-a) :keys "C-u C-c C-f C-a"])
-     ["Delete Font" (TeX-font t ?\C-d) :keys "C-c C-f C-d"]
-     "-"
-     ["Comment or Uncomment Region" TeX-comment-or-uncomment-region
-      :help "Comment or uncomment the currently selected region"]
-     ["Comment or Uncomment Paragraph" TeX-comment-or-uncomment-paragraph
-      :help "Comment or uncomment the paragraph containing point"]
-     ,TeX-fold-menu
-     "-" . ,TeX-common-menu-entries)))
-
-(easy-menu-define plain-TeX-mode-menu
-    plain-TeX-mode-map
-    "Menu used in plain TeX mode."
-    (cons "TeX" plain-TeX-menu-entries))
-
-;;; AmSTeX
-
-(defvar AmSTeX-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map TeX-mode-map)
-    map)
-  "Keymap used in `AmSTeX-mode'.")
-
-;; Menu for AmSTeX mode
-(easy-menu-define AmSTeX-mode-command-menu
-    AmSTeX-mode-map
-    "Command menu used in AmsTeX mode."
-    (TeX-mode-specific-command-menu 'ams-tex-mode))
-
-(easy-menu-define AmSTeX-mode-menu
-  AmSTeX-mode-map
-  "Menu used in AMS-TeX mode."
-  (cons "AmS-TeX" plain-TeX-menu-entries))
-
-;;;###autoload
-(defun ams-tex-mode ()
-  "Major mode in AUCTeX for editing AmS-TeX files.
-See info under AUCTeX for documentation.
-
-Special commands:
-\\{AmSTeX-mode-map}
-
-Entering AmS-tex-mode calls the value of `text-mode-hook',
-then the value of `TeX-mode-hook', and then the value
-of `AmS-TeX-mode-hook'."
-  (interactive)
-  (plain-TeX-common-initialization)
-  (setq major-mode 'ams-tex-mode)
-  (use-local-map AmSTeX-mode-map)
-
-  ;; Menu
-  (easy-menu-add AmSTeX-mode-menu AmSTeX-mode-map)
-  (easy-menu-add AmSTeX-mode-command-menu AmSTeX-mode-map)
-
-  (setq TeX-base-mode-name "AmS-TeX")
-  (setq TeX-command-default "AmSTeX")
-  (TeX-run-mode-hooks 'text-mode-hook 'TeX-mode-hook 'AmS-TeX-mode-hook)
-  (TeX-set-mode-name))
-
 
 ;;; Verbatim constructs
 
@@ -5129,7 +5160,7 @@ sign.  With optional ARG, insert that many dollar signs."
   (TeX-math-input-method-off))
 
 (defvar TeX-math-input-method-off-regexp
-  "^\\(chinese\\|japanese\\|korean\\bulgarian\\russian\\)"
+  "^\\(chinese\\|japanese\\|korean\\|bulgarian\\|russian\\)"
   "Regexp matching input methods to be deactivated when entering math mode.")
 
 (defun TeX-math-input-method-off ()
@@ -5152,6 +5183,7 @@ With optional argument ARG, also reload the style hooks."
       (setq TeX-style-hook-list nil
            BibTeX-global-style-files nil
            BibTeX-global-files nil
+           TeX-Biber-global-files nil
            TeX-global-input-files nil))
   (let ((TeX-auto-save t))
     (if (buffer-modified-p)
@@ -5569,6 +5601,20 @@ NAME may be a package, a command, or a document."
              ispell-tex-major-modes))
 
 
+;;; Abbrev mode
+
+(defmacro TeX-abbrev-mode-setup (mode)
+  "Set up the abbrev table and variable for MODE."
+  (let ((symbol (intern (concat (symbol-name mode) "-abbrev-table")))
+       (name (TeX-mode-prefix mode)))
+    `(progn
+       (defvar ,symbol nil
+        ,(format "Abbrev table for %s mode." name))
+       (define-abbrev-table ',symbol nil)
+       (when (fboundp 'abbrev-table-put)
+        (abbrev-table-put ,symbol :parents (list text-mode-abbrev-table))))))
+
+
 ;;; Special provisions for other modes and libraries
 
 ;; desktop-locals-to-save is broken by design.  Don't have