unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#69187: 29.2; Poor compatibility in align.el
@ 2024-02-17 12:03 Ikumi Keita
  2024-02-18 19:02 ` Ikumi Keita
  0 siblings, 1 reply; 11+ messages in thread
From: Ikumi Keita @ 2024-02-17 12:03 UTC (permalink / raw)
  To: 69187

[Summary]
There is an entry in `align-rules-list' incompatible with recent AUCTeX
change (and possible user-defined derived mode).

[Detail]
In `tex-tabbing-separator' entry of `align-rules-list', the run-if
property contains a conditional (eq major-mode 'latex-mode). This isn't
compatible with AUCTeX 14, which changes its major mode name from
`latex-mode' to `LaTeX-mode'.

Apart from AUCTeX issue, this entry doesn't work in user-defined derived
mode such as
(define-derived-mode latex-thesis-mode latex-mode "LaTeX-Thesis")
as well.

I propose to change this entry as:
    (tex-tabbing-separator
     (regexp   . ,(lambda (end reverse)
                    (align-match-tex-pattern "\\\\[=>]" end reverse)))
     (group    . (1 2))
     (modes    . '(latex-mode))
     (repeat   . t))

This entry becomes effective in doctex-mode also because it is derived
from latex-mode, but I don't think it matters.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



In GNU Emacs 29.2 (build 1, x86_64-unknown-freebsd14.0, GTK+ Version
3.24.34, cairo version 1.17.4)
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: 14.0-RELEASE-p5

Configured using:
 'configure --with-canna --with-canna-includes=/usr/local/canna/include
--with-canna-libraries=/usr/local/canna/lib --without-xim
--disable-largefile --without-modules --with-sound=yes
--with-file-notification=yes --disable-build-details
--localstatedir=/var --without-gconf --without-libsystemd
--without-selinux CFLAGS=-O2'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBXML2 NOTIFY KQUEUE PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $EMACSLOADPATH: /home/keita/elisp:
  value of $LANG: ja_JP.UTF-8
  locale-coding-system: utf-8-unix

Major mode: MH-Folder

Minor modes in effect:
  TeX-PDF-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  server-mode: t
  hl-line-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/keita/.emacs.d/elpa/transient-20240201.1100/transient hides /usr/local/share/emacs/29.2/lisp/transient
/home/keita/elisp/reftex-parse hides /usr/local/share/emacs/29.2/lisp/textmodes/reftex-parse
/home/keita/.emacs.d/elpa/soap-client-3.2.3/soap-inspect hides /usr/local/share/emacs/29.2/lisp/net/soap-inspect
/home/keita/.emacs.d/elpa/soap-client-3.2.3/soap-client hides /usr/local/share/emacs/29.2/lisp/net/soap-client

Features:
(shadow emacsbug facemenu two-column view ehelp url-misc mh-funcs
git-rebase magit-sparse-checkout emoji-labels emoji multisession sqlite
edebug eglot external-completion array jsonrpc ert ewoc debug backtrace
company-oddmuse company-keywords company-etags etags fileloop generator
company-gtags company-dabbrev-code company-dabbrev company-files
company-clang company-capf company-cmake company-semantic
company-template company-bbdb company skeleton tex-info texinfo
texinfo-loaddefs reftex-sel reftex-ref reftex-parse reftex-dcr
reftex-auc reftex reftex-loaddefs reftex-vars preview tex-bar toolbar-x
noutline outline tex-mode font-latex tex-jp latex latex-flymake
flymake-proc flymake tex-ispell tex-style tex texmathp latexenc
mule-util network-stream url-cache debbugs-gnu debbugs-compat debbugs
soap-client url-http url-auth url-gw nsm warnings icons rng-xsd rng-dt
rng-util xsd-regexp display-line-numbers vc-hg pp cl-print magit-patch
magit-subtree magit-extras magit-gitignore magit-ediff ediff ediff-merg
ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util pulse
color compile xref project jka-compr find-func shortdoc align help-fns
radix-tree misearch multi-isearch vc-git vc-dispatcher bug-reference
face-remap magit-submodule magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode
diff diff-mode git-commit log-edit pcvs-util add-log magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process with-editor shell pcomplete comint ansi-osc ring server
ansi-color magit-mode transient cl-extra edmacro kmacro help-mode
magit-git magit-base magit-section format-spec cursor-sensor crm dash
compat mh-thread supercite easy-mmode regi qp mh-identity mh-comp
mh-search mh-letter smiley mm-archive mail-extr mh-mime mh-gnus mh-alias
mh-show goto-addr thingatpt gnus-cite gnus-art mm-uu mml2015 mm-view
mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg
dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap
nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int
message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec
epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums gmm-utils mailheader
gnus-win gnus-range gnus nnheader mail-utils range mm-util mail-prsvr
wid-edit mh-seq mh-inc hl-line mh-tool-bar mh-acros mh-xface mh-utils
mailabbrev mh-folder which-func imenu gnus-util text-property-search
time-date mh-scan mh-e mh-buffers mh-loaddefs preview-latex auctex
tex-site canna-im boxquote-autoloads company-autoloads debbugs-autoloads
magit-autoloads pcase git-commit-autoloads magit-section-autoloads
dash-autoloads transient-autoloads with-editor-autoloads info
compat-autoloads package browse-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie generate-lisp-file url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp
byte-compile url-vars cl-loaddefs cl-lib japan-util rmc iso-transl
tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
kqueue lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process emacs)

Memory information:
((conses 16 828605 112581)
 (symbols 48 36917 1)
 (strings 32 163184 25079)
 (string-bytes 1 5406471)
 (vectors 16 96481)
 (vector-slots 8 2009935 134540)
 (floats 8 1886 2171)
 (intervals 56 83849 1835)
 (buffers 976 76))





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#69187: 29.2; Poor compatibility in align.el
  2024-02-17 12:03 bug#69187: 29.2; Poor compatibility in align.el Ikumi Keita
@ 2024-02-18 19:02 ` Ikumi Keita
  2024-04-03 12:22   ` Arash Esbati
  0 siblings, 1 reply; 11+ messages in thread
From: Ikumi Keita @ 2024-02-18 19:02 UTC (permalink / raw)
  To: 69187

Sorry, I included a spurious quote at
     (modes    . '(latex-mode))
in my proposal. The proposal for `tex-tabbing-separator' should have
been:
----------------------------------------------------------------------
    (tex-tabbing-separator
     (regexp   . ,(lambda (end reverse)
                    (align-match-tex-pattern "\\\\[=>]" end reverse)))
     (group    . (1 2))
     (modes    . (latex-mode))
     (repeat   . t))
----------------------------------------------------------------------

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#69187: 29.2; Poor compatibility in align.el
  2024-02-18 19:02 ` Ikumi Keita
@ 2024-04-03 12:22   ` Arash Esbati
  2024-04-05 16:57     ` Ikumi Keita
  0 siblings, 1 reply; 11+ messages in thread
From: Arash Esbati @ 2024-04-03 12:22 UTC (permalink / raw)
  To: Ikumi Keita; +Cc: 69187

Hi Keita,

Ikumi Keita <ikumi@ikumi.que.jp> writes:

> Sorry, I included a spurious quote at
>      (modes    . '(latex-mode))
> in my proposal. The proposal for `tex-tabbing-separator' should have
> been:
> ----------------------------------------------------------------------
>     (tex-tabbing-separator
>      (regexp   . ,(lambda (end reverse)
>                     (align-match-tex-pattern "\\\\[=>]" end reverse)))
>      (group    . (1 2))
>      (modes    . (latex-mode))
>      (repeat   . t))
> ----------------------------------------------------------------------

Thanks for raising this issue.  I have a question though: Does the
change below fit the bill as well:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/align.el b/lisp/align.el
index 81ccc4b5e2d..21e2e12ac24 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -538,9 +538,7 @@ align-rules-list
                     (align-match-tex-pattern "\\\\[=>]" end reverse)))
      (group    . (1 2))
      (modes    . align-tex-modes)
-     (repeat   . t)
-     (run-if   . ,(lambda ()
-                    (eq major-mode 'latex-mode))))
+     (repeat   . t))

     (tex-record-break
      (regexp   . "\\(\\s-*\\)\\\\\\\\")
--8<---------------cut here---------------end--------------->8---

`align-tex-modes' is defined like this:

,----[ C-h v align-tex-modes RET ]
| align-tex-modes is a variable defined in ‘align.el’.
| 
| Its value is (tex-mode plain-tex-mode latex-mode slitex-mode)
| 
| A list of modes whose syntax resembles TeX (and family).
| 
|   You can customize this variable.
| 
`----

And IIUC, the `run-if' attribute doesn't make sense, i.e., define 4
modes and then run the show only in `latex-mode'.  WDYT?

Best, Arash





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#69187: 29.2; Poor compatibility in align.el
  2024-04-03 12:22   ` Arash Esbati
@ 2024-04-05 16:57     ` Ikumi Keita
  2024-04-05 19:59       ` Arash Esbati
  0 siblings, 1 reply; 11+ messages in thread
From: Ikumi Keita @ 2024-04-05 16:57 UTC (permalink / raw)
  To: Arash Esbati; +Cc: 69187

Hi Arash,

>>>>> Arash Esbati <arash@gnu.org> writes:
> Thanks for raising this issue.  I have a question though: Does the
> change below fit the bill as well:
> diff --git a/lisp/align.el b/lisp/align.el
> index 81ccc4b5e2d..21e2e12ac24 100644
> --- a/lisp/align.el
> +++ b/lisp/align.el
> @@ -538,9 +538,7 @@ align-rules-list
>                      (align-match-tex-pattern "\\\\[=3D>]" end reverse)))
>       (group    . (1 2))
>       (modes    . align-tex-modes)
> -     (repeat   . t)
> -     (run-if   . ,(lambda ()
> -                    (eq major-mode 'latex-mode))))
> +     (repeat   . t))

>      (tex-record-break
>       (regexp   . "\\(\\s-*\\)\\\\\\\\")

That would practically do the job as well, because this entry wouldn't be
relevant in buffers in modes other than latex (LaTeX) mode actually. My
proposal is just to keep the precise behavior the same.

> Ikumi Keita <ikumi@ikumi.que.jp> writes:

>> Sorry, I included a spurious quote at
>> (modes    . '(latex-mode))
>> in my proposal. The proposal for `tex-tabbing-separator' should have
>> been:
>> ----------------------------------------------------------------------
>> (tex-tabbing-separator
>> (regexp   . ,(lambda (end reverse)
>> (align-match-tex-pattern "\\\\[=3D>]" end reverse)))
>> (group    . (1 2))
>> (modes    . (latex-mode))
>> (repeat   . t))
>> ----------------------------------------------------------------------

Sorry again, this was my mistake. After the second (third?) thought, my
first propoal was actually correct. The entry I should propose is
    (tex-tabbing-separator
     (regexp   . ,(lambda (end reverse)
                    (align-match-tex-pattern "\\\\[=>]" end reverse)))
     (group    . (1 2))
     (modes    . '(latex-mode))
     (repeat   . t))
, not
     (modes    . (latex-mode))
.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#69187: 29.2; Poor compatibility in align.el
  2024-04-05 16:57     ` Ikumi Keita
@ 2024-04-05 19:59       ` Arash Esbati
  2024-04-06  6:21         ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Arash Esbati @ 2024-04-05 19:59 UTC (permalink / raw)
  To: Ikumi Keita; +Cc: 69187

Ikumi Keita <ikumi@ikumi.que.jp> writes:

> That would practically do the job as well, because this entry wouldn't
> be relevant in buffers in modes other than latex (LaTeX) mode
> actually. My proposal is just to keep the precise behavior the same.

Agreed, so the change would look like this, right?

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/align.el b/lisp/align.el
index 81ccc4b5e2d..0e77a857585 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -537,10 +537,8 @@ align-rules-list
      (regexp   . ,(lambda (end reverse)
                     (align-match-tex-pattern "\\\\[=>]" end reverse)))
      (group    . (1 2))
-     (modes    . align-tex-modes)
-     (repeat   . t)
-     (run-if   . ,(lambda ()
-                    (eq major-mode 'latex-mode))))
+     (modes    . '(latex-mode))
+     (repeat   . t))

     (tex-record-break
      (regexp   . "\\(\\s-*\\)\\\\\\\\")
--8<---------------cut here---------------end--------------->8---

@Maintainers: How do you want to proceed with this proposal?  Do you
like to ask John W., or should I prepare a patch and send/install it, or
anything else?

For bonus points, I offer to delete the unnecessary ":group 'align" in
the defcustom's in align.el.

Please advise.  Thanks.

Best, Arash





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#69187: 29.2; Poor compatibility in align.el
  2024-04-05 19:59       ` Arash Esbati
@ 2024-04-06  6:21         ` Eli Zaretskii
  2024-04-06  9:30           ` Ikumi Keita
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2024-04-06  6:21 UTC (permalink / raw)
  To: Arash Esbati; +Cc: 69187, ikumi, John Wiegley

> Cc: 69187@debbugs.gnu.org
> From: Arash Esbati <arash@gnu.org>
> Date: Fri, 05 Apr 2024 21:59:06 +0200
> 
> Ikumi Keita <ikumi@ikumi.que.jp> writes:
> 
> > That would practically do the job as well, because this entry wouldn't
> > be relevant in buffers in modes other than latex (LaTeX) mode
> > actually. My proposal is just to keep the precise behavior the same.
> 
> Agreed, so the change would look like this, right?
> 
> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/align.el b/lisp/align.el
> index 81ccc4b5e2d..0e77a857585 100644
> --- a/lisp/align.el
> +++ b/lisp/align.el
> @@ -537,10 +537,8 @@ align-rules-list
>       (regexp   . ,(lambda (end reverse)
>                      (align-match-tex-pattern "\\\\[=>]" end reverse)))
>       (group    . (1 2))
> -     (modes    . align-tex-modes)
> -     (repeat   . t)
> -     (run-if   . ,(lambda ()
> -                    (eq major-mode 'latex-mode))))
> +     (modes    . '(latex-mode))
> +     (repeat   . t))
> 
>      (tex-record-break
>       (regexp   . "\\(\\s-*\\)\\\\\\\\")
> --8<---------------cut here---------------end--------------->8---
> 
> @Maintainers: How do you want to proceed with this proposal?  Do you
> like to ask John W., or should I prepare a patch and send/install it, or
> anything else?
> 
> For bonus points, I offer to delete the unnecessary ":group 'align" in
> the defcustom's in align.el.
> 
> Please advise.  Thanks.

Please explain the issue in more detail and in terms that someone who
doesn't use AUCTeX and has only superficial understanding of align.el
can understand and reason about.

Three questions that pop up immediately, perhaps because I'm missing
something:

  . what is the rationale for not using align-tex-modes here, only
    latex-mode?
  . why not just add the new LaTeX-mode to the list in
    align-tex-modes, so that people who use an old AUCTeX will not
    have their align rules broken?
  . why not use derived-mode-p instead of 'equal' in the run-if form
    (and why remove it in the first place)?

(And, btw, why did AUCTeX change the name of the mode?  What useful
purpose could that possibly serve?  Changing names of major modes is
the last thing I'd expect from a veteran package that respects its
users.)





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#69187: 29.2; Poor compatibility in align.el
  2024-04-06  6:21         ` Eli Zaretskii
@ 2024-04-06  9:30           ` Ikumi Keita
  2024-04-06 11:03             ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Ikumi Keita @ 2024-04-06  9:30 UTC (permalink / raw)
  To: Arash Esbati, Eli Zaretskii; +Cc: 69187, John Wiegley

Hi Arash and Eli,

>> > That would practically do the job as well, because this entry wouldn't
>> > be relevant in buffers in modes other than latex (LaTeX) mode
>> > actually. My proposal is just to keep the precise behavior the same.
>> 
>> Agreed, so the change would look like this, right?

Yes, that's exactly the same with the one at the tail of my previous
message.

>>>>> Eli Zaretskii <eliz@gnu.org> writes:
> Please explain the issue in more detail and in terms that someone who
> doesn't use AUCTeX and has only superficial understanding of align.el
> can understand and reason about.

> Three questions that pop up immediately, perhaps because I'm missing
> something:

>   . why not use derived-mode-p instead of 'equal' in the run-if form

That's what I thought. Arash and I are proposing to _remove_ the run-if
form so that `derived-mode-p' in `align-region' would do the expected
job.

>     (and why remove it in the first place)?

See above.

>   . what is the rationale for not using align-tex-modes here, only
>     latex-mode?

Because the current `tex-tabbing-separator' entry in `align-rules-list'
excludes other modes by `run-if' form. I'm just following that behavior
for AUCTeX modes. As I said in my previous message, this isn't much
relavant; using `align-tex-modes' instead of '(latex-mode) would almost
be the same for practical usage, provided that the `run-if' form is
removed.

>   . why not just add the new LaTeX-mode to the list in
>     align-tex-modes, so that people who use an old AUCTeX will not
>     have their align rules broken?

That isn't necessary. Only `latex-mode' is needed there because
`derived-mode-p' considers that `latex-mode' is parent of `LaTeX-mode'.
However, the current `run-if' form excludes `LaTeX-mode' because if uses
`eq', not `derived-mode-p'.

> (And, btw, why did AUCTeX change the name of the mode?  What useful
> purpose could that possibly serve?  Changing names of major modes is
> the last thing I'd expect from a veteran package that respects its
> users.)

Major motivation is the following two:
(1) to follow emacs standard convention about naming scheme of user
    customize option.
(2) to get rid of ugly hack and simplify the code.

The thread beginning with [1] motivated this change. This thread was
stimulated by a thread beginning with [2], which claims that
the major mode name `latex-mode' and hook name `LaTeX-mode-hook' are
inconsistent and doesn't follow the emacs standard naming convention
without good reason.
In addition, there have been very ugly hack to put dual roles on the
symbol `latex-mode', which accidentaly broke a compatibility[3]. This
topic is discussed in the thread [1], too.

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

[1] https://lists.gnu.org/r/auctex-devel/2022-09/msg00039.html
[2] https://lists.gnu.org/r/help-gnu-emacs/2022-09/msg00104.html
[3] https://lists.gnu.org/r/auctex/2022-08/msg00001.html
    https://tex.stackexchange.com/questions/648955/auctex-inconsistent-behavior-tex-vs-latex





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#69187: 29.2; Poor compatibility in align.el
  2024-04-06  9:30           ` Ikumi Keita
@ 2024-04-06 11:03             ` Eli Zaretskii
  2024-04-06 20:14               ` Arash Esbati
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2024-04-06 11:03 UTC (permalink / raw)
  To: Ikumi Keita; +Cc: 69187, arash, johnw

> From: Ikumi Keita <ikumi@ikumi.que.jp>
> cc: 69187@debbugs.gnu.org, John Wiegley <johnw@gnu.org>
> Comments: In-reply-to Eli Zaretskii <eliz@gnu.org>
>    message dated "Sat, 06 Apr 2024 09:21:18 +0300."
> Date: Sat, 06 Apr 2024 18:30:49 +0900
> 
> >>>>> Eli Zaretskii <eliz@gnu.org> writes:
> > Please explain the issue in more detail and in terms that someone who
> > doesn't use AUCTeX and has only superficial understanding of align.el
> > can understand and reason about.
> 
> > Three questions that pop up immediately, perhaps because I'm missing
> > something:
> 
> >   . why not use derived-mode-p instead of 'equal' in the run-if form
> 
> That's what I thought. Arash and I are proposing to _remove_ the run-if
> form so that `derived-mode-p' in `align-region' would do the expected
> job.
> 
> >     (and why remove it in the first place)?
> 
> See above.
> 
> >   . what is the rationale for not using align-tex-modes here, only
> >     latex-mode?
> 
> Because the current `tex-tabbing-separator' entry in `align-rules-list'
> excludes other modes by `run-if' form. I'm just following that behavior
> for AUCTeX modes. As I said in my previous message, this isn't much
> relavant; using `align-tex-modes' instead of '(latex-mode) would almost
> be the same for practical usage, provided that the `run-if' form is
> removed.
> 
> >   . why not just add the new LaTeX-mode to the list in
> >     align-tex-modes, so that people who use an old AUCTeX will not
> >     have their align rules broken?
> 
> That isn't necessary. Only `latex-mode' is needed there because
> `derived-mode-p' considers that `latex-mode' is parent of `LaTeX-mode'.
> However, the current `run-if' form excludes `LaTeX-mode' because if uses
> `eq', not `derived-mode-p'.

Then I'm okay with installing the proposed change.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#69187: 29.2; Poor compatibility in align.el
  2024-04-06 11:03             ` Eli Zaretskii
@ 2024-04-06 20:14               ` Arash Esbati
  2024-04-07  5:49                 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Arash Esbati @ 2024-04-06 20:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 69187, Ikumi Keita, johnw

[-- Attachment #1: Type: text/plain, Size: 912 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Ikumi Keita <ikumi@ikumi.que.jp>
>> 
>> >   . what is the rationale for not using align-tex-modes here, only
>> >     latex-mode?
>> 
>> Because the current `tex-tabbing-separator' entry in `align-rules-list'
>> excludes other modes by `run-if' form.

Which is correct, in general.  The tabbing environment looks like this
and is only available in LaTeX and not in other formats (AFAICT):

\begin{tabbing}
  Zero \=One \=Two \=Three\\
  \>First tab stop\\
  \>A\>\>B\\
  \>\>Second tab stop
\end{tabbing}

And the rule is designed to match these separators.

> Then I'm okay with installing the proposed change.

Thanks, the change is attached; I can push it myself, or you can do it
in case you want to change the commit message etc.  I will close the
report once the change is installed.

@Keita: Thanks for the report and answering Eli's questions.

Best, Arash

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-tex-tabbing-separator-alignment-rule.patch --]
[-- Type: text/x-patch, Size: 1043 bytes --]

From 76f30b873a0e358606ad92e2df799e5c0cea474d Mon Sep 17 00:00:00 2001
From: Arash Esbati <arash@gnu.org>
Date: Sat, 6 Apr 2024 21:58:03 +0200
Subject: [PATCH] Fix tex-tabbing-separator alignment rule

* lisp/align.el (align-rules-list): Remove the check of
`latex-mode' with `eq' which doesn't work with newer AUCTeX mode
names and modes defined by user with `define-derived-mode'.
(bug#69187)
---
 lisp/align.el | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lisp/align.el b/lisp/align.el
index 81ccc4b5e2d..0e77a857585 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -537,10 +537,8 @@ align-rules-list
      (regexp   . ,(lambda (end reverse)
                     (align-match-tex-pattern "\\\\[=>]" end reverse)))
      (group    . (1 2))
-     (modes    . align-tex-modes)
-     (repeat   . t)
-     (run-if   . ,(lambda ()
-                    (eq major-mode 'latex-mode))))
+     (modes    . '(latex-mode))
+     (repeat   . t))
 
     (tex-record-break
      (regexp   . "\\(\\s-*\\)\\\\\\\\")
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#69187: 29.2; Poor compatibility in align.el
  2024-04-06 20:14               ` Arash Esbati
@ 2024-04-07  5:49                 ` Eli Zaretskii
  2024-04-07  8:49                   ` Arash Esbati
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2024-04-07  5:49 UTC (permalink / raw)
  To: Arash Esbati; +Cc: 69187, ikumi, johnw

> From: Arash Esbati <arash@gnu.org>
> Cc: Ikumi Keita <ikumi@ikumi.que.jp>,  69187@debbugs.gnu.org,  johnw@gnu.org
> Date: Sat, 06 Apr 2024 22:14:46 +0200
> 
> > Then I'm okay with installing the proposed change.
> 
> Thanks, the change is attached; I can push it myself, or you can do it
> in case you want to change the commit message etc.  I will close the
> report once the change is installed.

Feel free to install on master, the commit message LGTM.

Thanks.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#69187: 29.2; Poor compatibility in align.el
  2024-04-07  5:49                 ` Eli Zaretskii
@ 2024-04-07  8:49                   ` Arash Esbati
  0 siblings, 0 replies; 11+ messages in thread
From: Arash Esbati @ 2024-04-07  8:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 69187-done, ikumi, johnw

Eli Zaretskii <eliz@gnu.org> writes:

> Feel free to install on master, the commit message LGTM.

Thanks, pushed, and closing.

Best, Arash





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-04-07  8:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-17 12:03 bug#69187: 29.2; Poor compatibility in align.el Ikumi Keita
2024-02-18 19:02 ` Ikumi Keita
2024-04-03 12:22   ` Arash Esbati
2024-04-05 16:57     ` Ikumi Keita
2024-04-05 19:59       ` Arash Esbati
2024-04-06  6:21         ` Eli Zaretskii
2024-04-06  9:30           ` Ikumi Keita
2024-04-06 11:03             ` Eli Zaretskii
2024-04-06 20:14               ` Arash Esbati
2024-04-07  5:49                 ` Eli Zaretskii
2024-04-07  8:49                   ` Arash Esbati

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).