all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de>
Cc: dick <dick.r.chiang@gmail.com>, emacs-devel@gnu.org
Subject: Re: align mysteries
Date: Thu, 14 Oct 2021 23:35:21 +0200	[thread overview]
Message-ID: <87ilxzthly.fsf@gnus.org> (raw)
In-Reply-To: <86pms7xq0x.fsf@duenenhof-wilhelm.de> (H. Dieter Wilhelm's message of "Thu, 14 Oct 2021 23:19:58 +0200")

"H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de> writes:

> For my needs it is working perfectly (I didn't study it, because it
> works so nicely in my programming mode "APDL-Mode" on Melpa). Here's an
> example when setting parameters:
>
> mp = 3333333
> l =40.0
> kkkkk=8
>
> M-x apdl-align
>
> mp    = 3333333
> l     =	     40.0
> kkkkk =	      8

Ah, I see.  apdl-mode has set up a bunch of rules in
apdl-align-rules-list, and that makes `M-x align' work perfectly.

text-mode hasn't set up any alignment rules, so `M-x align' does nothing
and `C-u M-x align' does...  weird stuff?

No, not quite?

(defcustom align-rules-list
[...]
    ;; With a numeric prefix argument, or C-u, space delimited text
    ;; tables will be aligned.
    (text-column
     (regexp   . "\\(^\\|\\S-\\)\\([ \t]+\\)\\(\\S-\\|$\\)")
     (group    . 2)
     (modes    . align-text-modes)
     (repeat   . t)
     (run-if   . ,(lambda ()
                    (and current-prefix-arg
                         (not (eq '- current-prefix-arg))))))

So this is where the prefix action comes from!  Wow, that's a weird way
to control this.

But...  why?  Why only have `M-x align' do something in text modes if
you give it a prefix?

And the other oddness I was seeing with this indentation:

foo	bar	zot	
lalala	y indeed

It indents it the expected way if I change the "y" into a "yy".

foo	bar	zot	
lalala	yy	indeed

I guess there's some heavy DWIM involved here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



  reply	other threads:[~2021-10-14 21:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 18:59 align mysteries Lars Ingebrigtsen
2021-10-14 19:58 ` dick
2021-10-14 20:59   ` Lars Ingebrigtsen
2021-10-14 21:19     ` H. Dieter Wilhelm
2021-10-14 21:35       ` Lars Ingebrigtsen [this message]
2021-10-14 21:41         ` Lars Ingebrigtsen
2021-10-15  6:20           ` Eli Zaretskii
2021-10-15 10:01             ` Lars Ingebrigtsen
2021-10-16 17:48           ` H. Dieter Wilhelm
2021-10-14 22:04 ` Stefan Monnier
2021-10-15 10:00   ` Lars Ingebrigtsen
2021-10-15  9:32 ` Teemu Likonen
2021-10-15 10:10   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ilxzthly.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=dick.r.chiang@gmail.com \
    --cc=dieter@duenenhof-wilhelm.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.