* Problem with align-regexp with GNU/Emacs 29+
@ 2023-03-08 19:54 Lele Gaifax
2023-03-10 0:41 ` Michael Heerdegen
0 siblings, 1 reply; 5+ messages in thread
From: Lele Gaifax @ 2023-03-08 19:54 UTC (permalink / raw)
To: help-gnu-emacs
Hi all,
today I faced a problem using `align-regexp' that I was not able to
solve.
Basically, I wanted to align a CSV set of rows, say a buffer containing
the following text
1, 2, 3
aa, bb, cc
long string, shorter, a
using current (well, compiled around a week ago) Emacs master (with
native compilation).
Using `C-x h C-U M-x align-regexp RET ,\(\s-*\) RET RET RET y' didn't change
the buffer at all. Since I do not use that facility often, I consulted
the related manual section, then the AlignCommands on the wiki, and
several other sources around the web, but could not figure out what I'm
doing wrong.
Then I installed version 28, and there the above worked as expected.
Back home, I retried with both version 30 (commit 750bc59c, 2023-02-18)
and version 29 (commit a5d4c29a, 2022-11-02), and the problem was
present as well. Then I installed Debian's Emacs 28.2, and the thing
worked.
Am I doing something wrong?
Thanks in advance for any hint,
bye, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it | -- Fortunato Depero, 1929.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem with align-regexp with GNU/Emacs 29+
2023-03-08 19:54 Problem with align-regexp with GNU/Emacs 29+ Lele Gaifax
@ 2023-03-10 0:41 ` Michael Heerdegen
2023-03-10 7:32 ` Lele Gaifax
0 siblings, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2023-03-10 0:41 UTC (permalink / raw)
To: help-gnu-emacs
Lele Gaifax <lele@metapensiero.it> writes:
> [...]
> Using `C-x h C-U M-x align-regexp RET ,\(\s-*\) RET RET RET y' didn't
> change the buffer at all.
> [...]
> Am I doing something wrong?
I don't know. Your example works as expected for me in Emacs master
compiled an hour ago.
In which kind of buffer did you try that?
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem with align-regexp with GNU/Emacs 29+
2023-03-10 0:41 ` Michael Heerdegen
@ 2023-03-10 7:32 ` Lele Gaifax
2023-03-10 15:57 ` Michael Heerdegen
2023-03-10 16:38 ` Lele Gaifax
0 siblings, 2 replies; 5+ messages in thread
From: Lele Gaifax @ 2023-03-10 7:32 UTC (permalink / raw)
To: help-gnu-emacs
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Lele Gaifax <lele@metapensiero.it> writes:
>
>> [...]
>> Using `C-x h C-U M-x align-regexp RET ,\(\s-*\) RET RET RET y' didn't
>> change the buffer at all.
>> [...]
>> Am I doing something wrong?
>
> I don't know. Your example works as expected for me in Emacs master
> compiled an hour ago.
That's really surprising, as five different compilations (two under
NixOS, both packaged upstream, and three under Debian sid (emacs-28 from
Debian's repo, 29 and 30 compiled by me)) that give the same result
is... puzzling!
But your positive check suggest that the problem is on my side, in some
way: I will try to update my Emacses and report back.
> In which kind of buffer did you try that?
I tried several major modes, but that did not alter the result: this
originated in a sql-mode buffer (I needed to align the VALUES of a
multi-row INSERT), then I tried in a text-mode, and used the latter to
test the much simpler snippet I used in my original mail. Right now I
tried also in fundamental-mode, and the text does not align.
Thanks&bye, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it | -- Fortunato Depero, 1929.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem with align-regexp with GNU/Emacs 29+
2023-03-10 7:32 ` Lele Gaifax
@ 2023-03-10 15:57 ` Michael Heerdegen
2023-03-10 16:38 ` Lele Gaifax
1 sibling, 0 replies; 5+ messages in thread
From: Michael Heerdegen @ 2023-03-10 15:57 UTC (permalink / raw)
To: help-gnu-emacs
Lele Gaifax <lele@metapensiero.it> writes:
> But your positive check suggest that the problem is on my side, in some
> way: I will try to update my Emacses and report back.
Are you in emacs -Q?
> > In which kind of buffer did you try that?
>
> I tried several major modes, but that did not alter the result: this
> originated in a sql-mode buffer (I needed to align the VALUES of a
> multi-row INSERT), then I tried in a text-mode, and used the latter to
> test the much simpler snippet I used in my original mail. Right now I
> tried also in fundamental-mode, and the text does not align.
I also tried in several modes (text, fundamental, and in *scratch*).
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem with align-regexp with GNU/Emacs 29+
2023-03-10 7:32 ` Lele Gaifax
2023-03-10 15:57 ` Michael Heerdegen
@ 2023-03-10 16:38 ` Lele Gaifax
1 sibling, 0 replies; 5+ messages in thread
From: Lele Gaifax @ 2023-03-10 16:38 UTC (permalink / raw)
To: help-gnu-emacs
Lele Gaifax <lele@metapensiero.it> writes:
> But your positive check suggest that the problem is on my side, in some
> way: I will try to update my Emacses and report back.
Ok, I found *my* problem after all!
I took the long route to realize that it was actually mine, convinced as
I was that what I did in the various Emacses was exactly the same: I
extracted a fresh copy of Emacs master and compiled it, then added the
following simple test in test/lisp/align-tests.el
(ert-deftest align-regexp ()
(should (equal
(with-temp-buffer
(text-mode)
(insert "a, b, c\none, two, three\n")
(align-regexp (point-min) (point-max) ",\\(\\s-*\\)" 1 1 t)
(buffer-substring-no-properties (point-min) (point-max)))
"a,\tb,\tc\none,\ttwo,\tthree\n")))
that, with my surprise, a "make lisp/align-tests" passed! 8-}
The good news is that, back to my interactive Emacs session, I did my
original task again and this time it worked flawlessly, both with Emacs
29 *and* with Emacs 30.
The bad news is that I could not replicate what I did wrong: I can only
assume I blindly entered the wrong regexp.
TIL!
Thank you and sorry for the noise,
bye, lele.
--
nickname: Lele Gaifax | Dire che Emacs è "conveniente" è come
real: Emanuele Gaifas | etichettare l'ossigeno come "utile"
lele@etour.tn.it | -- Rens Troost
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-03-10 16:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-08 19:54 Problem with align-regexp with GNU/Emacs 29+ Lele Gaifax
2023-03-10 0:41 ` Michael Heerdegen
2023-03-10 7:32 ` Lele Gaifax
2023-03-10 15:57 ` Michael Heerdegen
2023-03-10 16:38 ` Lele Gaifax
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.