unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [Roland.Winkler@physik.uni-erlangen.de: align fails]
@ 2005-12-11 22:57 Richard Stallman
  2005-12-19 23:37 ` Stuart D. Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2005-12-11 22:57 UTC (permalink / raw)


John Wiegly, the maintainer of align.el, can't work on this now.
Can someone else please DTRT and ack?

------- Start of forwarded message -------
Date: Sat, 03 Dec 2005 04:53:39 +0100
From: "Roland Winkler" <Roland.Winkler@physik.uni-erlangen.de>
To: emacs-pretest-bug@gnu.org
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at tfkp06
Subject: align fails
Sender: emacs-pretest-bug-bounces+rms=gnu.org@gnu.org
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on monty-python
X-Spam-Level: 
X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63

Symptoms:

Visit the following buffer foo.txt in a fresh emacs (using text-mode)

cat > foo.txt <<EOF
Fred (123)   456-7890
Alice (123) 456-7890
Mary-Anne (123)     456-7890
Joe      (123) 456-7890
EOF

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 not what I would expect from an alignment command.

Roland


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------

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

* Re: [Roland.Winkler@physik.uni-erlangen.de: align fails]
  2005-12-11 22:57 [Roland.Winkler@physik.uni-erlangen.de: align fails] Richard Stallman
@ 2005-12-19 23:37 ` Stuart D. Herring
  2005-12-20 14:05   ` Thien-Thi Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Stuart D. Herring @ 2005-12-19 23:37 UTC (permalink / raw)
  Cc: emacs-devel

[-- 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

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

* Re: [Roland.Winkler@physik.uni-erlangen.de: align fails]
  2005-12-19 23:37 ` Stuart D. Herring
@ 2005-12-20 14:05   ` Thien-Thi Nguyen
  0 siblings, 0 replies; 3+ messages in thread
From: Thien-Thi Nguyen @ 2005-12-20 14:05 UTC (permalink / raw)
  Cc: emacs-devel

"Stuart D. Herring" <herring@lanl.gov> writes:

> addressed by the attached trivial patch to align.el [below]

thanks, installed!

thi

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

end of thread, other threads:[~2005-12-20 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-11 22:57 [Roland.Winkler@physik.uni-erlangen.de: align fails] Richard Stallman
2005-12-19 23:37 ` Stuart D. Herring
2005-12-20 14:05   ` Thien-Thi Nguyen

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