auctex-devel
[Top][All Lists]
Advanced

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

[Announcement] Feature branch merged


From: Ikumi Keita
Subject: [Announcement] Feature branch merged
Date: Sun, 21 Jan 2024 15:47:18 +0900

Hi all,

I've merged the feature branch "fix-mode-names-overlap" into the master
branch. The changes are described in the CHANGES file quoted below.

All comments and suggestions are greatly appreciated.

All the best,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

Changes and New Features in AUCTeX
**********************************

News in 14.1
============

   • AUCTeX changes major mode names.  Its primary purpose is to avoid
     conflicts with Emacs built-in TeX major modes.  It also improves
     consistency of the source code.

        − The overview of the former names and new names are:

          Former name                 New name
          --------------------------------------------------------
          ‘plain-tex-mode’            ‘plain-TeX-mode’
          ‘latex-mode’                ‘LaTeX-mode’
          ‘doctex-mode’               ‘docTeX-mode’
          ‘context-mode’              ‘ConTeXt-mode’
          ‘texinfo-mode’              ‘Texinfo-mode’
          ‘ams-tex-mode’              ‘AmSTeX-mode’
          ‘japanese-plain-tex-mode’   ‘japanese-plain-TeX-mode’
          ‘japanese-latex-mode’       ‘japanese-LaTeX-mode’

          The undocumented modes ‘context-en-mode’ and ‘context-nl-mode’
          were deleted.

        − We paid much attention to the compatibility and expect that
          almost no particular treatment on the user side is needed.
          For example, the names of the keymaps and mode hooks remain
          unchanged, and the ‘mode:’ tag in the file local variables in
          the existing files works with old mode names.  See below for
          more details.

        − If your Emacs is 29 or newer and you use ‘desktop.el’ to save
          and restore Emacs sessions, be careful before you update
          AUCTeX; You should attempt to update only after
            1. you kill all buffer under former AUCTeX modes which have
               overlapped name with Emacs built-in TeX modes, and
            2. you terminate the current Emacs session.
          The modes with such overlapped name are ‘plain-tex-mode’,
          ‘latex-mode’, ‘doctex-mode’ and ‘texinfo-mode’.  (The above
          prescription ensures no buffer of such modes is recorded in
          the desktop file.  Otherwise those buffers would be restored
          in the built-in modes, not AUCTeX modes, after the update of
          AUCTeX.)

        − New mode names are chosen to match the existing variables, so
          most user customizations as well as the third party libraries
          would continue to work without modification.  For example,
          names of keymaps and hooks don’t change as stated above.
          (‘AmS-TeX-mode-hook’ is renamed to ‘AmSTeX-mode-hook’, but
          compatibility alias is provided.)

        − Now ‘TeX-add-local-master’ adds entry of new mode names such
          as

               %%% Local Variables:
               %%% mode: LaTeX      <-- not `latex'
               %%% End:

        − The compatibility with the former mode names with respect to
          invoking the major mode are retained.

            1. Former modes which overlap with built-in modes, namely
               ‘plain-tex-mode’, ‘latex-mode’, ‘doctex-mode’,
               ‘texinfo-mode’ and ‘tex-mode’ are handled by
               redirections; the same override advices as before are
               continued to used for Emacs <29 while
               ‘major-mode-remap-alist’ is used for Emacs 29 and later.
               (Therefore, if there are user codes which call
               ‘latex-mode’ directly, built-in ‘latex-mode’ runs instead
               of AUCTeX ‘LaTeX-mode’ in Emacs 29 and later.)

               These redirections still honor your customization to
               ‘TeX-modes’ option.  Thus you are served by built-in
               ‘plain-tex-mode’ and AUCTeX ‘LaTeX-mode’ if you exclude
               ‘plain-tex-mode’ from ‘TeX-modes’.

            2. Other former names, e.g. ‘context-mode’ and
               ‘japanese-latex-mode’, are handled by aliases such as

                    (defalias 'context-mode #'ConTeXt-mode)

        − New modes recognize directory local variables prepaired for
          the former mode name.  For example, directory local variables
          for ‘latex-mode’ are valid in ‘LaTeX-mode’ as well.  So you
          don’t have to rewrite every former mode name to the new one in
          ‘.dir-locals.el’.

        − Your abbrevs are preserved.  For example,
          ‘latex-mode-abbrev-table’, if exists, is automatically
          included as a parent of ‘LaTeX-mode-abbrev-table’.

        − Now all major modes are defined by ‘define-derived-mode’, so
          standard inheritance of keymaps, syntax tables etc. takes
          place.  The inheritance relations are:
          text-mode      --+-- TeX-mode
                           +-- Texinfo-mode
          
          TeX-mode       --+-- plain-TeX-mode
                           +-- LaTeX-mode
                           +-- ConTeXt-mode
          
          plain-TeX-mode --+-- AmSTeX-mode
                           +-- japanese-plain-TeX-mode
          
          LaTeX-mode     --+-- docTeX-mode
                           +-- japanese-LaTeX-mode

          These inheritance relations are taken into account for
          directory local variables in the standard way.  For example,
          directory local variables for ‘LaTeX-mode’ are applied to
          ‘docTeX-mode’ now.

          Note that ‘TeX-mode’ isn’t meant for use for end users.  It is
          only meant for the base mode for other major modes.  Its role
          is to provide base keymap, hook and syntax table under the
          same name with the former AUCTeX and run the common
          initialization code.

          Now that all modes have ‘text-mode’ as their ancestor, they
          inherit its keymap and syntax table.  In addition, dir local
          vars for ‘text-mode’ are applied to all AUCTeX major mode.

          However, ‘Texinfo-mode’ is exceptional in the following two
          aspects:
            1. It doesn’t inherit ‘text-mode-syntax-table’ because it
               simply uses built-in mode’s ‘texinfo-mode-syntax-table’,
               which is independent of ‘text-mode-syntax-table’.  This
               situation is the same with the former AUCTeX Texinfo
               mode.

            2. ‘Texinfo-mode-map’ has ‘TeX-mode-map’ as its direct
               parent.  This is the same with the former AUCTeX Texinfo
               mode.  Now it inherits ‘text-mode-map’ indirectly through
               ‘TeX-mode-map’.

        − There are new keymaps, hooks and abbrev tables:
          ‘Texinfo-mode-abbrev-table’, ‘japanese-plain-TeX-mode-map’,
          ‘japanese-LaTeX-mode-map’, ‘japanese-plain-TeX-mode-hook’,
          ‘japanese-LaTeX-mode-hook’,
          ‘japanese-plain-TeX-mode-abbrev-table’,
          ‘japanese-LaTeX-mode-abbrev-table’



reply via email to

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