unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stuart D. Herring" <herring@lanl.gov>
Cc: emacs-devel@gnu.org
Subject: Re: [Roland.Winkler@physik.uni-erlangen.de: align fails]
Date: Mon, 19 Dec 2005 15:37:53 -0800 (PST)	[thread overview]
Message-ID: <42697.128.165.123.132.1135035473.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <E1Ela7o-0007hq-C4@fencepost.gnu.org>

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

> Set mark and point to beginning and end of the buffer.
> Execute C-u M-x align. This gives me
>
> Fred				(123)		456-7890
> 				Alice		(123)	456-7890
> 				Mary-Anne	(123)   456-7890
> 				Joe		(123)	456-7890

This is actually quite simple: align.el thinks that any whitespace
character is a column separator -- including newline.  Then Fred's space
and all the newlines end up getting expanded to match one of the original
newlines.

This is addressed by the attached trivial patch to align.el to make only
space and tab separate columns in its align-a-whitespace-separated-table
mode.  ChangeLog entry also attached; please install if there's no trouble
with it.

Davis Herring

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.

[-- Attachment #2: align.patch --]
[-- Type: application/octet-stream, Size: 724 bytes --]

diff -Nacr cvs/align.el new/align.el
*** cvs/align.el	2005-12-19 16:27:49.000000000 -0700
--- new/align.el	2005-12-19 16:28:42.000000000 -0700
***************
*** 559,565 ****
      ;; With a numeric prefix argument, or C-u, space delimited text
      ;; tables will be aligned.
      (text-column
!      (regexp   . "\\(^\\|\\S-\\)\\(\\s-+\\)\\(\\S-\\|$\\)")
       (group    . 2)
       (modes    . align-text-modes)
       (repeat   . t)
--- 559,565 ----
      ;; 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)

[-- Attachment #3: ChangeLog --]
[-- Type: application/octet-stream, Size: 141 bytes --]

2005-12-19  Davis Herring  <herring@lanl.gov>

	* align.el (align-rules-list): Use [ \t] instead of \s- for column
	separators in text mode.

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2005-12-19 23:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-11 22:57 [Roland.Winkler@physik.uni-erlangen.de: align fails] Richard Stallman
2005-12-19 23:37 ` Stuart D. Herring [this message]
2005-12-20 14:05   ` Thien-Thi Nguyen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=42697.128.165.123.132.1135035473.squirrel@webmail.lanl.gov \
    --to=herring@lanl.gov \
    --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 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).