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:41:44 +0200	[thread overview]
Message-ID: <87ee8nthbb.fsf@gnus.org> (raw)
In-Reply-To: <87ilxzthly.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 14 Oct 2021 23:35:21 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

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

It's to be able to have different predefined alignments depending on the
prefix, I guess:

    ;; 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))))))

    ;; With a negative prefix argument, lists of dollar figures will
    ;; be aligned.
    (text-dollar-figure
     (regexp   . "\\$?\\(\\s-+[0-9]+\\)\\.")
     (modes    . align-text-modes)
     (justify  . t)
     (run-if   . ,(lambda ()
                    (eq '- current-prefix-arg))))

It still doesn't explain why the first one doesn't just test that it's
not minus.

The `align' doc string should mention that the prefix can influence
which rule is used, at the very least.

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



  reply	other threads:[~2021-10-14 21:41 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
2021-10-14 21:41         ` Lars Ingebrigtsen [this message]
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=87ee8nthbb.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.