GNU bug report logs -
#954
indentation in latex-mode in emacs-23
Previous Next
Reported by: "Chirok Han" <chirok.han <at> gmail.com>
Date: Wed, 10 Sep 2008 07:55:05 UTC
Severity: normal
Done: martin rudalics <rudalics <at> gmx.at>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 954 in the body.
You can then email your comments to 954 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Chirok Han" <chirok.han <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
Hi
I've been using gnu emacs 22 so far (happily) and recently I compiled
and installed cvs emacs-23 (updated today: 2008-09-10). I am very
happy with this new version. Thank you!
I do lots of latex work (and I don't use auctex). Up to emacs 22, the
line following \[ is not indented but now in emacs 23, the line after
\[ is indent. For example, in emacs 22, `indent-region' gives
\[
abc
\]
but now in emacs 23 it looks like
\[
abc
\]
This may be a new feature, but I would like the old style. Is there
any way I can get back the old behavior? I tried to read tex-mode.el
but it was too difficult for me.
Thank you.
ch
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
> but now in emacs 23 it looks like
> \[
> abc
> \]
This lookds like a bug in my indentation code which fails to take the \
into account. I'll take a look at it,
Stefan
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #20 received at 954 <at> emacsbugs.donarmstrong.com (full text, mbox):
> but now in emacs 23 it looks like
>
> \[
> abc
> \]
I've checked in a fix for this. Please retry.
Thanks for reporting, martin.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Chirok Han" <chirok.han <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #25 received at 954 <at> emacsbugs.donarmstrong.com (full text, mbox):
Thanks.
It is now
\[
abc
\]
I would like
\[
abc
\]
but if that's what you intend.
Thanks again. Chirok
On Tue, Sep 23, 2008 at 3:33 PM, martin rudalics <rudalics <at> gmx.at> wrote:
>> but now in emacs 23 it looks like
>>
>> \[
>> abc
>> \]
>
> I've checked in a fix for this. Please retry.
>
> Thanks for reporting, martin.
>
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #30 received at 954 <at> emacsbugs.donarmstrong.com (full text, mbox):
> It is now
> \[
> abc
> \]
>
> I would like
> \[
> abc
> \]
> but if that's what you intend.
This part of the Emacs 23 behavior is due to that change:
2007-09-21 Glenn Morris <rgm <at> gnu.org>
(latex-forward-sexp-1, latex-backward-sexp-1): Doc fix.
Handle escaped parens.
If you convinced us that
\[
abc
\]
is more correct LaTeX style than
\[
abc
\]
we might reconsider this.
Leslie, what's the preferred way to indent this?
martin
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Leslie Lamport <notlamport <at> microsoft.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #35 received at 954 <at> emacsbugs.donarmstrong.com (full text, mbox):
Martin,
I have no opinion on how a LaTeX input file should be formatted.
Leslie
-----Original Message-----
From: martin rudalics [mailto:rudalics <at> gmx.at]
Sent: Tuesday, September 23, 2008 5:28 AM
To: Chirok Han
Cc: 954 <at> debbugs.gnu.org; Stefan Monnier; Leslie Lamport
Subject: Re: bug#954: indentation in latex-mode in emacs-23
> It is now
> \[
> abc
> \]
>
> I would like
> \[
> abc
> \]
> but if that's what you intend.
This part of the Emacs 23 behavior is due to that change:
2007-09-21 Glenn Morris <rgm <at> gnu.org>
(latex-forward-sexp-1, latex-backward-sexp-1): Doc fix.
Handle escaped parens.
If you convinced us that
\[
abc
\]
is more correct LaTeX style than
\[
abc
\]
we might reconsider this.
Leslie, what's the preferred way to indent this?
martin
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Chirok Han" <chirok.han <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #40 received at 954 <at> emacsbugs.donarmstrong.com (full text, mbox):
Hi Martin,
It's not something I can convince you about. And I don't think there
is any correct or incorrect formatting style. It's just from my 10
years experience. As I get older, it gets harder to accommodate new
things no matter how small they are....
Many thanks for your efforts. I like latex on emacs very much.
Chirok
On Tue, Sep 23, 2008 at 9:28 PM, martin rudalics <rudalics <at> gmx.at> wrote:
>> It is now
>> \[
>> abc
>> \]
>>
>> I would like
>> \[
>> abc
>> \]
>> but if that's what you intend.
>
> This part of the Emacs 23 behavior is due to that change:
>
> 2007-09-21 Glenn Morris <rgm <at> gnu.org>
>
> (latex-forward-sexp-1, latex-backward-sexp-1): Doc fix.
> Handle escaped parens.
>
> If you convinced us that
>
> \[
> abc
> \]
>
> is more correct LaTeX style than
>
> \[
> abc
> \]
>
> we might reconsider this.
>
> Leslie, what's the preferred way to indent this?
>
> martin
>
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #45 received at 954 <at> emacsbugs.donarmstrong.com (full text, mbox):
[Message part 1 (text/plain, inline)]
> It's not something I can convince you about. And I don't think there
> is any correct or incorrect formatting style. It's just from my 10
> years experience. As I get older, it gets harder to accommodate new
> things no matter how small they are....
... sounds convincing. What about the attached patch?
martin
[954.diff (text/plain, inline)]
*** textmodes/tex-mode.el.~1.218.~ 2008-09-23 10:17:14.531250000 +0200
--- textmodes/tex-mode.el 2008-09-24 09:57:17.203125000 +0200
***************
*** 1482,1487 ****
--- 1482,1489 ----
(push-mark)
(goto-char spot)))
+ (defvar latex-handle-escaped-parens t)
+
;; Don't think this one actually _needs_ (for the purposes of
;; tex-mode) to handle escaped parens.
(defun latex-backward-sexp-1 ()
***************
*** 1489,1499 ****
(let ((pos (point))
(forward-sexp-function))
(backward-sexp 1)
! (cond ((looking-at "\\\\\\(begin\\>\\|[[({]\\)")
(signal 'scan-error
(list "Containing expression ends prematurely"
(point) (prog1 (point) (goto-char pos)))))
! ((looking-at "\\\\\\([])}]\\)")
(tex-last-unended-eparen (match-string 1)))
((eq (char-after) ?{)
(let ((newpos (point)))
--- 1491,1505 ----
(let ((pos (point))
(forward-sexp-function))
(backward-sexp 1)
! (cond ((looking-at
! (if latex-handle-escaped-parens
! "\\\\\\(begin\\>\\|[[({]\\)"
! "\\\\begin\\>"))
(signal 'scan-error
(list "Containing expression ends prematurely"
(point) (prog1 (point) (goto-char pos)))))
! ((and latex-handle-escaped-parens
! (looking-at "\\\\\\([])}]\\)"))
(tex-last-unended-eparen (match-string 1)))
((eq (char-after) ?{)
(let ((newpos (point)))
***************
*** 1528,1539 ****
(tex-next-unmatched-end))
;; A better way to handle this, \( .. \) etc, is probably to
;; temporarily change the syntax of the \ in \( to punctuation.
! ((looking-back "\\\\[])}]")
(signal 'scan-error
(list "Containing expression ends prematurely"
(- (point) 2) (prog1 (point)
(goto-char pos)))))
! ((looking-back "\\\\\\([({[]\\)")
(tex-next-unmatched-eparen (match-string 1)))
(t (goto-char newpos))))))
--- 1534,1547 ----
(tex-next-unmatched-end))
;; A better way to handle this, \( .. \) etc, is probably to
;; temporarily change the syntax of the \ in \( to punctuation.
! ((and latex-handle-escaped-parens
! (looking-back "\\\\[])}]"))
(signal 'scan-error
(list "Containing expression ends prematurely"
(- (point) 2) (prog1 (point)
(goto-char pos)))))
! ((and latex-handle-escaped-parens
! (looking-back "\\\\\\([({[]\\)"))
(tex-next-unmatched-eparen (match-string 1)))
(t (goto-char newpos))))))
***************
*** 2568,2670 ****
(indent-line-to indent)
(save-excursion (indent-line-to indent)))))))
(defun latex-find-indent (&optional virtual)
"Find the proper indentation of text after point.
VIRTUAL if non-nil indicates that we're only trying to find the indentation
in order to determine the indentation of something else.
There might be text before point."
! (save-excursion
! (skip-chars-forward " \t")
! (or
! ;; Stick the first line at column 0.
! (and (= (point-min) (line-beginning-position)) 0)
! ;; Trust the current indentation, if such info is applicable.
! (and virtual (save-excursion (skip-chars-backward " \t&") (bolp))
! (current-column))
! ;; Stick verbatim environments to the left margin.
! (and (looking-at "\\\\\\(begin\\|end\\) *{\\([^\n}]+\\)")
! (member (match-string 2) tex-verbatim-environments)
! 0)
! ;; Put leading close-paren where the matching open paren would be.
! (let (escaped)
! (and (or (eq (latex-syntax-after) ?\))
! ;; Try to handle escaped close parens but keep original
! ;; position if it doesn't work out.
! (setq escaped (looking-at "\\\\\\([])}]\\)")))
! (ignore-errors
! (save-excursion
! (when escaped
! (goto-char (match-beginning 1)))
! (latex-skip-close-parens)
(latex-backward-sexp-1)
! (latex-find-indent 'virtual)))))
! ;; Default (maybe an argument)
! (let ((pos (point))
! ;; Outdent \item if necessary.
! (indent (if (looking-at tex-indent-item-re) (- tex-indent-item) 0))
! up-list-pos)
! ;; Find the previous point which determines our current indentation.
! (condition-case err
! (progn
! (latex-backward-sexp-1)
! (while (> (current-column) (current-indentation))
! (latex-backward-sexp-1)))
! (scan-error
! (setq up-list-pos (nth 2 err))))
! (cond
! ((= (point-min) pos) 0) ; We're really just indenting the first line.
! ((integerp up-list-pos)
! ;; Have to indent relative to the open-paren.
! (goto-char up-list-pos)
! (if (and (not tex-indent-allhanging)
! (save-excursion
! ;; Make sure we're an argument to a macro and
! ;; that the macro is at the beginning of a line.
! (condition-case nil
! (progn
! (while (eq (char-syntax (char-after)) ?\()
! (forward-sexp -1))
! (and (eq (char-syntax (char-after)) ?/)
! (progn (skip-chars-backward " \t&")
! (bolp))))
! (scan-error nil)))
! (> pos (progn (latex-down-list)
! (forward-comment (point-max))
! (point))))
! ;; Align with the first element after the open-paren.
! (current-column)
! ;; We're the first element after a hanging brace.
(goto-char up-list-pos)
! (+ (if (and (looking-at "\\\\begin *{\\([^\n}]+\\)")
! (member (match-string 1)
! latex-noindent-environments))
! 0 tex-indent-basic)
! indent (latex-find-indent 'virtual))))
! ;; We're now at the "beginning" of a line.
! ((not (and (not virtual) (eq (char-after) ?\\)))
! ;; Nothing particular here: just keep the same indentation.
! (+ indent (current-column)))
! ;; We're now looking at a macro call.
! ((looking-at tex-indent-item-re)
! ;; Indenting relative to an item, have to re-add the outdenting.
! (+ indent (current-column) tex-indent-item))
! (t
! (let ((col (current-column)))
! (if (or (not (eq (char-syntax (or (char-after pos) ?\s)) ?\())
! ;; Can't be an arg if there's an empty line inbetween.
! (save-excursion (re-search-forward "^[ \t]*$" pos t)))
! ;; If the first char was not an open-paren, there's
! ;; a risk that this is really not an argument to the
! ;; macro at all.
! (+ indent col)
! (forward-sexp 1)
! (if (< (line-end-position)
! (save-excursion (forward-comment (point-max))
! (point)))
! ;; we're indenting the first argument.
! (min (current-column) (+ tex-indent-arg col))
! (skip-syntax-forward " ")
! (current-column))))))))))
;;; DocTeX support
(defun doctex-font-lock-^^A ()
--- 2576,2690 ----
(indent-line-to indent)
(save-excursion (indent-line-to indent)))))))
+ (defcustom latex-indent-within-escaped-parens nil
+ "Non-nil means add extra indent to text within escaped parens.
+ When this is non-nil, text within matching pairs of escaped
+ parens is indented at the column following the open paren. The
+ default value does not add any extra indent thus providing the
+ behavior of Emacs 22 and earlier."
+ :type 'boolean
+ :group 'tex
+ :version "23.1")
+
(defun latex-find-indent (&optional virtual)
"Find the proper indentation of text after point.
VIRTUAL if non-nil indicates that we're only trying to find the indentation
in order to determine the indentation of something else.
There might be text before point."
! (let ((latex-handle-escaped-parens latex-indent-within-escaped-parens))
! (save-excursion
! (skip-chars-forward " \t")
! (or
! ;; Stick the first line at column 0.
! (and (= (point-min) (line-beginning-position)) 0)
! ;; Trust the current indentation, if such info is applicable.
! (and virtual (save-excursion (skip-chars-backward " \t&") (bolp))
! (current-column))
! ;; Stick verbatim environments to the left margin.
! (and (looking-at "\\\\\\(begin\\|end\\) *{\\([^\n}]+\\)")
! (member (match-string 2) tex-verbatim-environments)
! 0)
! ;; Put leading close-paren where the matching open paren would be.
! (let (escaped)
! (and (or (eq (latex-syntax-after) ?\))
! ;; Try to handle escaped close parens but keep
! ;; original position if it doesn't work out.
! (and latex-handle-escaped-parens
! (setq escaped (looking-at "\\\\\\([])}]\\)"))))
! (ignore-errors
! (save-excursion
! (when escaped
! (goto-char (match-beginning 1)))
! (latex-skip-close-parens)
! (latex-backward-sexp-1)
! (latex-find-indent 'virtual)))))
! ;; Default (maybe an argument)
! (let ((pos (point))
! ;; Outdent \item if necessary.
! (indent (if (looking-at tex-indent-item-re) (- tex-indent-item) 0))
! up-list-pos)
! ;; Find the previous point which determines our current indentation.
! (condition-case err
! (progn
(latex-backward-sexp-1)
! (while (> (current-column) (current-indentation))
! (latex-backward-sexp-1)))
! (scan-error
! (setq up-list-pos (nth 2 err))))
! (cond
! ((= (point-min) pos) 0) ; We're really just indenting the first line.
! ((integerp up-list-pos)
! ;; Have to indent relative to the open-paren.
(goto-char up-list-pos)
! (if (and (not tex-indent-allhanging)
! (save-excursion
! ;; Make sure we're an argument to a macro and
! ;; that the macro is at the beginning of a line.
! (condition-case nil
! (progn
! (while (eq (char-syntax (char-after)) ?\()
! (forward-sexp -1))
! (and (eq (char-syntax (char-after)) ?/)
! (progn (skip-chars-backward " \t&")
! (bolp))))
! (scan-error nil)))
! (> pos (progn (latex-down-list)
! (forward-comment (point-max))
! (point))))
! ;; Align with the first element after the open-paren.
! (current-column)
! ;; We're the first element after a hanging brace.
! (goto-char up-list-pos)
! (+ (if (and (looking-at "\\\\begin *{\\([^\n}]+\\)")
! (member (match-string 1)
! latex-noindent-environments))
! 0 tex-indent-basic)
! indent (latex-find-indent 'virtual))))
! ;; We're now at the "beginning" of a line.
! ((not (and (not virtual) (eq (char-after) ?\\)))
! ;; Nothing particular here: just keep the same indentation.
! (+ indent (current-column)))
! ;; We're now looking at a macro call.
! ((looking-at tex-indent-item-re)
! ;; Indenting relative to an item, have to re-add the outdenting.
! (+ indent (current-column) tex-indent-item))
! (t
! (let ((col (current-column)))
! (if (or (not (eq (char-syntax (or (char-after pos) ?\s)) ?\())
! ;; Can't be an arg if there's an empty line inbetween.
! (save-excursion (re-search-forward "^[ \t]*$" pos t)))
! ;; If the first char was not an open-paren, there's
! ;; a risk that this is really not an argument to the
! ;; macro at all.
! (+ indent col)
! (forward-sexp 1)
! (if (< (line-end-position)
! (save-excursion (forward-comment (point-max))
! (point)))
! ;; we're indenting the first argument.
! (min (current-column) (+ tex-indent-arg col))
! (skip-syntax-forward " ")
! (current-column)))))))))))
;;; DocTeX support
(defun doctex-font-lock-^^A ()
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Message #48 received at 954 <at> emacsbugs.donarmstrong.com (full text, mbox):
martin rudalics wrote:
> > It's not something I can convince you about. And I don't think there
> > is any correct or incorrect formatting style. It's just from my 10
> > years experience. As I get older, it gets harder to accommodate new
> > things no matter how small they are....
>
> ... sounds convincing. What about the attached patch?
Sorry to disagree, but "change bad" is not a convincing argument to me.
I prefer the current form because I think that
\begin{math}
a = b
\end{math}
and
\(
a = b
\)
should be formatted the same. A comment in the original bug that
motivated this change seems more convincing to me:
http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00045.html
The correct solution would require that \(, \), \[, and \] are
treated the same as \begin{math}, \end{math}, \begin{displaymath},
and \end{displaymath}. (The latter are defined in terms of the
former in latex.ltx.)
But I have to admit that: i) I use AUCTeX; and ii) I don't use \( \),
so take all that with a large grain of salt. :)
So please just check that whatever change is installed does not bring
back the original tex-validate-region problem:
http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00038.html
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #53 received at 954 <at> emacsbugs.donarmstrong.com (full text, mbox):
> I prefer the current form because I think that
>
> \begin{math}
> a = b
> \end{math}
>
> and
>
> \(
> a = b
> \)
>
> should be formatted the same.
I think so too. On the other hand, indenting habits are persistent.
And, according to Leslie, there doesn't seem to exist a convention for
indentation of LaTeX source.
> A comment in the original bug that
> motivated this change seems more convincing to me:
>
> http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00045.html
>
> The correct solution would require that \(, \), \[, and \] are
> treated the same as \begin{math}, \end{math}, \begin{displaymath},
> and \end{displaymath}. (The latter are defined in terms of the
> former in latex.ltx.)
>
> But I have to admit that: i) I use AUCTeX; and ii) I don't use \( \),
> so take all that with a large grain of salt. :)
I don't know - how does AUCTeX indent this?
> So please just check that whatever change is installed does not bring
> back the original tex-validate-region problem:
>
> http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00038.html
Sure. I strongly hope that `tex-validate-region' doesn't care about
indentation.
martin
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #58 received at 954 <at> emacsbugs.donarmstrong.com (full text, mbox):
>> > It's not something I can convince you about. And I don't think there
>> > is any correct or incorrect formatting style. It's just from my 10
>> > years experience. As I get older, it gets harder to accommodate new
>> > things no matter how small they are....
>>
>> ... sounds convincing. What about the attached patch?
> Sorry to disagree, but "change bad" is not a convincing argument to me.
> I prefer the current form because I think that
> \begin{math}
> a = b
> \end{math}
> and
> \(
> a = b
> \)
> should be formatted the same. A comment in the original bug that
I don't think there's a right answer. But at least if the above two
alternative forms indent differently, that makes it possible for the
user to choose the indentation (indirectly) by choosing which form
to use.
So I'd argue that the two should *not* for indented identically.
Stefan
PS: The indentation in tex-mode (for which I largely plead guilty)
usually indents a good bit more than what I've seen used in most LaTeX
files. I tend to think of LaTeX as a programming language, and most of
what I write is LaTeX is about programming languages, so I like to
indent it more than people who think of it as "text with markup".
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#954
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Chirok Han" <chirok.han <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #63 received at 954 <at> emacsbugs.donarmstrong.com (full text, mbox):
Hi Glenn and Martin,
I have no objections to Glenn's argument. And also many thanks to
Martin; I can now figure out which part to modify for
customization.... :)
Chirok
PS. Just one correction. I think Glenn meant
\[
abc
\]
instead of
\(
abc
\)
On Thu, Sep 25, 2008 at 1:48 AM, Glenn Morris <rgm <at> gnu.org> wrote:
> martin rudalics wrote:
>
>> > It's not something I can convince you about. And I don't think there
>> > is any correct or incorrect formatting style. It's just from my 10
>> > years experience. As I get older, it gets harder to accommodate new
>> > things no matter how small they are....
>>
>> ... sounds convincing. What about the attached patch?
>
> Sorry to disagree, but "change bad" is not a convincing argument to me.
>
> I prefer the current form because I think that
>
> \begin{math}
> a = b
> \end{math}
>
> and
>
> \(
> a = b
> \)
>
> should be formatted the same. A comment in the original bug that
> motivated this change seems more convincing to me:
>
> http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00045.html
>
> The correct solution would require that \(, \), \[, and \] are
> treated the same as \begin{math}, \end{math}, \begin{displaymath},
> and \end{displaymath}. (The latter are defined in terms of the
> former in latex.ltx.)
>
> But I have to admit that: i) I use AUCTeX; and ii) I don't use \( \),
> so take all that with a large grain of salt. :)
>
> So please just check that whatever change is installed does not bring
> back the original tex-validate-region problem:
>
> http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00038.html
>
Reply sent to
martin rudalics <rudalics <at> gmx.at>
:
You have taken responsibility.
Full text and
rfc822 format available.
Notification sent to
"Chirok Han" <chirok.han <at> gmail.com>
:
bug acknowledged by developer.
Full text and
rfc822 format available.
Message #68 received at 954-done <at> emacsbugs.donarmstrong.com (full text, mbox):
Fixed as
2008-09-23 Martin Rudalics <rudalics <at> gmx.at>
* textmodes/tex-mode.el (latex-find-indent): Try to handle
escaped close parens correctly. (Bug#954)
for indenting the closing paren, and
2008-09-25 Martin Rudalics <rudalics <at> gmx.at>
* textmodes/tex-mode.el (latex-handle-escaped-parens): New variable.
(latex-backward-sexp-1, latex-forward-sexp-1): Treat escaped
parens specially only if latex-handle-escaped-parens is non-nil.
(latex-indent-within-escaped-parens): New option.
(latex-find-indent): Bind latex-handle-escaped-parens to
latex-indent-within-escaped-parens. Do not treat escaped parens
specially when this is nil. (Bug#954)
for indenting the text within the parens.
Thanks again for reporting, martin.
bug archived.
Request was from
Debbugs Internal Request <don <at> donarmstrong.com>
to
internal_control <at> emacsbugs.donarmstrong.com
.
(Tue, 28 Oct 2008 14:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 16 years and 253 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.