monnier pushed a commit to branch externals/auctex in repository elpa. commit a9820d3b147bac2214375ddbe644186f9f1ed3ed Author: Mosè Giordano <giordano.m...@libero.it> Date: Sat Feb 22 13:21:22 2014 +0100
Fix selection of default environment in LaTeX-environment. * latex.el (LaTeX-environment): Do not set `LaTeX-default-environment' to `environment' if the latter is equal to the current default environment. --- ChangeLog | 6 ++++++ latex.el | 13 ++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba2dcc0..d18a120 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-02-22 Mos� Giordano <giordano.m...@libero.it> + + * latex.el (LaTeX-environment): Do not set + `LaTeX-default-environment' to `environment' if the latter is + equal to the current default environment. + 2014-02-21 Mos� Giordano <giordano.m...@libero.it> * latex.el (LaTeX-arg-usepackage-read-packages-with-options): New diff --git a/latex.el b/latex.el index 9ecceeb..af8dd27 100644 --- a/latex.el +++ b/latex.el @@ -538,11 +538,14 @@ It may be customized with the following variables: (string-equal (LaTeX-current-environment) "document")) LaTeX-default-document-environment) (t LaTeX-default-environment))) - (environment (completing-read (concat "Environment type: (default " - default ") ") - (LaTeX-environment-list-filtered) nil nil nil - 'LaTeX-environment-history default))) - (setq LaTeX-default-environment environment) + (environment (completing-read (concat "Environment type: (default " + default ") ") + (LaTeX-environment-list-filtered) nil nil + nil 'LaTeX-environment-history default))) + ;; Use `environment' as default for the next time only if it is different + ;; from the current default. + (unless (equal environment default) + (setq LaTeX-default-environment environment)) (let ((entry (assoc environment (LaTeX-environment-list)))) (if (null entry)