annotate lisp/delim-col.el @ 97520:656560acf99f

Remove dead code. (handle_invisible_prop, next_overlay_string): Defer call to setup_for_ellipsis. (handle_stop, set_iterator_to_next): Call setup_for_ellipsis.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 17 Aug 2008 23:48:30 +0000
parents ee5932bf781d
children d42aff5ca541
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38436
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 33092
diff changeset
1 ;;; delim-col.el --- prettify all columns in a region or rectangle
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
2
74439
ddcbd2c1b70d Update copyright years.
Glenn Morris <rgm@gnu.org>
parents: 74417
diff changeset
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
79721
73661ddc7ac7 Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 78236
diff changeset
4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
5
54326
814ffa309985 Doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 52401
diff changeset
6 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
814ffa309985 Doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 52401
diff changeset
7 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
38436
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 33092
diff changeset
8 ;; Version: 2.1
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 33092
diff changeset
9 ;; Keywords: internal
73026
c801be549845 Adjust X-URL
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 68651
diff changeset
10 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
11
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
13
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
14 ;; GNU Emacs is free software: you can redistribute it and/or modify
26040
8500b0f62b8e Header comments changed.
Dave Love <fx@gnu.org>
parents: 25761
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
16 ;; the Free Software Foundation, either version 3 of the License, or
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
17 ;; (at your option) any later version.
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
18
26040
8500b0f62b8e Header comments changed.
Dave Love <fx@gnu.org>
parents: 25761
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
8500b0f62b8e Header comments changed.
Dave Love <fx@gnu.org>
parents: 25761
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
8500b0f62b8e Header comments changed.
Dave Love <fx@gnu.org>
parents: 25761
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8500b0f62b8e Header comments changed.
Dave Love <fx@gnu.org>
parents: 25761
diff changeset
22 ;; GNU General Public License for more details.
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
23
26040
8500b0f62b8e Header comments changed.
Dave Love <fx@gnu.org>
parents: 25761
diff changeset
24 ;; You should have received a copy of the GNU General Public License
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
26
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
27 ;;; Commentary:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
28
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
29 ;; delim-col helps to prettify columns in a text region or rectangle.
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
30 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
31 ;; To use it, make sure that this file is in load-path and insert in your
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
32 ;; .emacs:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
33 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
34 ;; (require 'delim-col)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
35 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
36 ;; If you have, for example, the following columns:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
37 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
38 ;; a b c d
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
39 ;; aaaa bb ccc ddddd
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
40 ;; aaa bbb cccc dddd
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
41 ;; aa bb ccccccc ddd
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
42 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
43 ;; And the following settings:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
44 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
45 ;; (setq delimit-columns-str-before "[ ")
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
46 ;; (setq delimit-columns-str-after " ]")
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
47 ;; (setq delimit-columns-str-separator ", ")
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
48 ;; (setq delimit-columns-before "")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
49 ;; (setq delimit-columns-after "")
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
50 ;; (setq delimit-columns-separator "\t")
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
51 ;; (setq delimit-columns-format 'separator)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
52 ;; (setq delimit-columns-extra t)
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
53 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
54 ;; If you select the lines above and type:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
55 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
56 ;; M-x delimit-columns-region RET
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
57 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
58 ;; You obtain the following result:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
59 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
60 ;; [ a , b , c , d ]
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
61 ;; [ aaaa, bb , ccc , ddddd ]
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
62 ;; [ aaa , bbb, cccc , dddd ]
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
63 ;; [ aa , bb , ccccccc, ddd ]
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
64 ;;
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
65 ;; But if you select start from the very first b to the very last c and type:
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
66 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
67 ;; M-x delimit-columns-rectangle RET
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
68 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
69 ;; You obtain the following result:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
70 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
71 ;; a [ b , c ] d
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
72 ;; aaaa [ bb , ccc ] ddddd
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
73 ;; aaa [ bbb, cccc ] dddd
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
74 ;; aa [ bb , ccccccc ] ddd
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
75 ;;
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
76 ;; Now, if we change settings to:
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
77 ;;
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
78 ;; (setq delimit-columns-before "<")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
79 ;; (setq delimit-columns-after ">")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
80 ;;
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
81 ;; For the `delimit-columns-region' example above, the result is:
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
82 ;;
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
83 ;; [ <a> , <b> , <c> , <d> ]
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
84 ;; [ <aaaa>, <bb> , <ccc> , <ddddd> ]
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
85 ;; [ <aaa> , <bbb>, <cccc> , <dddd> ]
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
86 ;; [ <aa> , <bb> , <ccccccc>, <ddd> ]
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
87 ;;
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
88 ;; And for the `delimit-columns-rectangle' example above, the result is:
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
89 ;;
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
90 ;; a [ <b> , <c> ] d
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
91 ;; aaaa [ <bb> , <ccc> ] ddddd
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
92 ;; aaa [ <bbb>, <cccc> ] dddd
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
93 ;; aa [ <bb> , <ccccccc> ] ddd
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
94 ;;
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
95 ;; Note that `delimit-columns-region' operates over all text region
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
96 ;; selected, extending the region start to the beginning of line and the
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
97 ;; region end to the end of line. While `delimit-columns-rectangle'
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
98 ;; operates over the text rectangle selected which rectangle diagonal is
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
99 ;; given by the region start and end.
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
100 ;;
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
101 ;; See `delimit-columns-format' variable documentation for column formating.
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
102 ;;
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
103 ;; `delimit-columns-region' is useful when you have columns of text that
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
104 ;; are not well aligned, like:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
105 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
106 ;; horse apple bus
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
107 ;; dog pineapple car
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
108 ;; porcupine strawberry airplane
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
109 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
110 ;; `delimit-columns-region' and `delimit-columns-rectangle' handle lines
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
111 ;; with different number of columns, like:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
112 ;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
113 ;; horse apple bus
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
114 ;; dog pineapple car EXTRA
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
115 ;; porcupine strawberry airplane
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
116 ;;
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
117 ;; Use `delimit-columns-customize' to customize delim-col package variables.
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
118
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
119 ;;; Code:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
120
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
121
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
122 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
123 ;; User Options:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
124
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
125 (defgroup columns nil
64003
bf6ae7cf12eb (columns): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents: 54326
diff changeset
126 "Prettify columns."
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
127 :link '(emacs-library-link :tag "Source Lisp File" "delim-col.el")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
128 :prefix "delimit-columns-"
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
129 :group 'internal)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
130
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
131 (defcustom delimit-columns-str-before ""
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
132 "*Specify a string to be inserted before all columns."
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
133 :type '(string :tag "Before All Columns")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
134 :group 'columns)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
135
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
136 (defcustom delimit-columns-str-separator ", "
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
137 "*Specify a string to be inserted between each column."
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
138 :type '(string :tag "Between Each Column")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
139 :group 'columns)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
140
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
141 (defcustom delimit-columns-str-after ""
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
142 "*Specify a string to be inserted after all columns."
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
143 :type '(string :tag "After All Columns")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
144 :group 'columns)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
145
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
146 (defcustom delimit-columns-before ""
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
147 "*Specify a string to be inserted before each column."
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
148 :type '(string :tag "Before Each Column")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
149 :group 'columns)
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
150
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
151 (defcustom delimit-columns-after ""
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
152 "*Specify a string to be inserted after each column."
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
153 :type '(string :tag "After Each Column")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
154 :group 'columns)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
155
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
156 (defcustom delimit-columns-separator "\t"
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
157 "*Specify a regexp which separates each column."
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
158 :type '(regexp :tag "Column Separator")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
159 :group 'columns)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
160
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
161 (defcustom delimit-columns-format t
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
162 "*Specify how to format columns.
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
163
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
164 For examples below, consider:
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
165
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
166 + columns `ccc' and `dddd',
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
167 + the maximum column length for each column is 6,
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
168 + and the following settings:
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
169 (setq delimit-columns-before \"<\")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
170 (setq delimit-columns-after \">\")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
171 (setq delimit-columns-separator \":\")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
172
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
173 Valid values are:
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
174
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
175 nil no formating. That is, `delimit-columns-after' is followed by
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
176 `delimit-columns-separator'.
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
177 For example, the result is: \"<ccc>:<dddd>:\"
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
178
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
179 t align columns. That is, `delimit-columns-after' is followed by
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
180 `delimit-columns-separator' and then followed by spaces.
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
181 For example, the result is: \"<ccc>: <dddd>: \"
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
182
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
183 'separator align separators. That is, `delimit-columns-after' is followed
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
184 by spaces and then followed by `delimit-columns-separator'.
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
185 For example, the result is: \"<ccc> :<dddd> :\"
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
186
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
187 'padding format column by filling with spaces before
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
188 `delimit-columns-after'. That is, spaces are followed by
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
189 `delimit-columns-after' and then followed by
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
190 `delimit-columns-separator'.
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
191 For example, the result is: \"<ccc >:<dddd >:\"
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
192
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
193 Any other value is treated as t."
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
194 :type '(choice :menu-tag "Column Formating"
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
195 :tag "Column Formating"
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
196 (const :tag "No Formating" nil)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
197 (const :tag "Column Alignment" t)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
198 (const :tag "Separator Aligment" separator)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
199 (const :tag "Column Padding" padding))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
200 :group 'columns)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
201
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
202 (defcustom delimit-columns-extra t
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
203 "*Non-nil means that lines will have the same number of columns.
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
204
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
205 This has effect only when there are lines with different number of columns."
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
206 :type '(boolean :tag "Lines With Same Number Of Column")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
207 :group 'columns)
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
208
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
209 (defcustom delimit-columns-start 0
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
210 "*Specify column number to start prettifing.
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
211
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
212 See also `delimit-columns-end' for documentation.
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
213
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
214 The following relation must hold:
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
215 0 <= delimit-columns-start <= delimit-columns-end
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
216
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
217 The column number start from 0 and it's relative to the beginning of selected
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
218 region. So if you selected a text region, the first column (column 0) is
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
219 located at beginning of line. If you selected a text rectangle, the first
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
220 column (column 0) is located at left corner."
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
221 :type '(integer :tag "Column Start")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
222 :group 'columns)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
223
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
224 (defcustom delimit-columns-end 1000000
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
225 "*Specify column number to end prettifing.
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
226
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
227 See also `delimit-columns-start' for documentation.
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
228
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
229 The following relation must hold:
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
230 0 <= delimit-columns-start <= delimit-columns-end
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
231
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
232 The column number start from 0 and it's relative to the beginning of selected
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
233 region. So if you selected a text region, the first column (column 0) is
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
234 located at beginning of line. If you selected a text rectangle, the first
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
235 column (column 0) is located at left corner."
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
236 :type '(integer :tag "Column End")
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
237 :group 'columns)
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
238
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
239
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
240 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
241 ;; User Commands:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
242
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
243
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
244 ;;;###autoload
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
245 (defun delimit-columns-customize ()
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
246 "Customization of `columns' group."
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
247 (interactive)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
248 (customize-group 'columns))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
249
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
250
33092
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
251 (defmacro delimit-columns-str (str)
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
252 `(if (stringp ,str) ,str ""))
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
253
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
254
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
255 ;;;###autoload
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
256 (defun delimit-columns-region (start end)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
257 "Prettify all columns in a text region.
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
258
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
259 START and END delimits the text region."
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
260 (interactive "*r")
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
261 (let ((delimit-columns-str-before
33092
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
262 (delimit-columns-str delimit-columns-str-before))
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
263 (delimit-columns-str-separator
33092
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
264 (delimit-columns-str delimit-columns-str-separator))
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
265 (delimit-columns-str-after
33092
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
266 (delimit-columns-str delimit-columns-str-after))
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
267 (delimit-columns-before
33092
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
268 (delimit-columns-str delimit-columns-before))
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
269 (delimit-columns-after
33092
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
270 (delimit-columns-str delimit-columns-after))
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
271 (delimit-columns-start
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
272 (if (and (integerp delimit-columns-start)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
273 (>= delimit-columns-start 0))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
274 delimit-columns-start
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
275 0))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
276 (delimit-columns-end
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
277 (if (integerp delimit-columns-end)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
278 delimit-columns-end
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
279 1000000))
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
280 (delimit-columns-limit (make-marker))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
281 (the-end (copy-marker end))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
282 delimit-columns-max)
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
283 (when (<= delimit-columns-start delimit-columns-end)
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
284 (save-excursion
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
285 (goto-char start)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
286 (beginning-of-line)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
287 ;; get maximum length for each column
33056
6566390db905 Little fix: replace delimit-columns-align-columns by
Gerd Moellmann <gerd@gnu.org>
parents: 32835
diff changeset
288 (and delimit-columns-format
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
289 (save-excursion
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
290 (while (< (point) the-end)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
291 (delimit-columns-rectangle-max
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
292 (prog1
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
293 (point)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
294 (end-of-line)))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
295 (forward-char 1))))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
296 ;; prettify columns
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
297 (while (< (point) the-end)
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
298 (delimit-columns-rectangle-line
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
299 (prog1
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
300 (point)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
301 (end-of-line)))
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
302 (forward-char 1))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
303 ;; nullify markers
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
304 (set-marker delimit-columns-limit nil)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
305 (set-marker the-end nil)))))
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
306
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
307
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
308 (require 'rect)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
309
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
310
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
311 ;;;###autoload
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
312 (defun delimit-columns-rectangle (start end)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
313 "Prettify all columns in a text rectangle.
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
314
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
315 START and END delimits the corners of text rectangle."
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
316 (interactive "*r")
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
317 (let ((delimit-columns-str-before
33092
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
318 (delimit-columns-str delimit-columns-str-before))
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
319 (delimit-columns-str-separator
33092
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
320 (delimit-columns-str delimit-columns-str-separator))
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
321 (delimit-columns-str-after
33092
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
322 (delimit-columns-str delimit-columns-str-after))
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
323 (delimit-columns-before
33092
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
324 (delimit-columns-str delimit-columns-before))
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
325 (delimit-columns-after
33092
181e948ec3ac Little programming improvement.
Gerd Moellmann <gerd@gnu.org>
parents: 33056
diff changeset
326 (delimit-columns-str delimit-columns-after))
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
327 (delimit-columns-start
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
328 (if (and (integerp delimit-columns-start)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
329 (>= delimit-columns-start 0))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
330 delimit-columns-start
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
331 0))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
332 (delimit-columns-end
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
333 (if (integerp delimit-columns-end)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
334 delimit-columns-end
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
335 1000000))
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
336 (delimit-columns-limit (make-marker))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
337 (the-end (copy-marker end))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
338 delimit-columns-max)
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
339 (when (<= delimit-columns-start delimit-columns-end)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
340 ;; get maximum length for each column
33056
6566390db905 Little fix: replace delimit-columns-align-columns by
Gerd Moellmann <gerd@gnu.org>
parents: 32835
diff changeset
341 (and delimit-columns-format
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
342 (save-excursion
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
343 (operate-on-rectangle 'delimit-columns-rectangle-max
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
344 start the-end nil)))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
345 ;; prettify columns
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
346 (save-excursion
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
347 (operate-on-rectangle 'delimit-columns-rectangle-line
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
348 start the-end nil))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
349 ;; nullify markers
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
350 (set-marker delimit-columns-limit nil)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
351 (set-marker the-end nil))))
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
352
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
353
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
354 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
355 ;; Internal Variables and Functions:
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
356
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
357
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
358 ;; to avoid compilation gripes
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
359 (defvar delimit-columns-max nil)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
360 (defvar delimit-columns-limit nil)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
361
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
362
39867
e4e8b9d662e2 (delimit-columns-rectangle-max): Do not double variables in the lambda-list.
Pavel Janík <Pavel@Janik.cz>
parents: 38436
diff changeset
363 (defun delimit-columns-rectangle-max (startpos &optional ignore1 ignore2)
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
364 (set-marker delimit-columns-limit (point))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
365 (goto-char startpos)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
366 (let ((ncol 1)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
367 origin values)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
368 ;; get current column length
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
369 (while (progn
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
370 (setq origin (current-column))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
371 (re-search-forward delimit-columns-separator
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
372 delimit-columns-limit 'move))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
373 (save-excursion
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
374 (goto-char (match-beginning 0))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
375 (setq values (cons (- (current-column) origin)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
376 values)))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
377 (setq ncol (1+ ncol)))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
378 (setq values (cons (- (current-column) origin)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
379 values))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
380 ;; extend delimit-columns-max, if needed
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
381 (let ((index (length delimit-columns-max)))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
382 (and (> ncol index)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
383 (let ((extend (make-vector ncol 0)))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
384 (while (> index 0)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
385 (setq index (1- index))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
386 (aset extend index (aref delimit-columns-max index)))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
387 (setq delimit-columns-max extend))))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
388 ;; get maximum column length
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
389 (while values
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
390 (setq ncol (1- ncol))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
391 (aset delimit-columns-max ncol (max (aref delimit-columns-max ncol)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
392 (car values)))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
393 (setq values (cdr values)))))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
394
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
395
39867
e4e8b9d662e2 (delimit-columns-rectangle-max): Do not double variables in the lambda-list.
Pavel Janík <Pavel@Janik.cz>
parents: 38436
diff changeset
396 (defun delimit-columns-rectangle-line (startpos &optional ignore1 ignore2)
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
397 (let ((len (length delimit-columns-max))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
398 (ncol 0)
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
399 origin)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
400 (set-marker delimit-columns-limit (point))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
401 (goto-char startpos)
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
402 ;; skip initial columns
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
403 (while (and (< ncol delimit-columns-start)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
404 (< (point) delimit-columns-limit)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
405 (re-search-forward delimit-columns-separator
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
406 delimit-columns-limit 'move))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
407 (setq ncol (1+ ncol)))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
408 ;; insert first formating
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
409 (insert delimit-columns-str-before delimit-columns-before)
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
410 ;; Adjust all columns but last one
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
411 (while (progn
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
412 (setq origin (current-column))
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
413 (and (< (point) delimit-columns-limit)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
414 (re-search-forward delimit-columns-separator
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
415 delimit-columns-limit 'move)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
416 (or (< ncol delimit-columns-end)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
417 (progn
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
418 (goto-char (match-beginning 0))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
419 nil))))
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
420 (delete-region (match-beginning 0) (point))
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
421 (delimit-columns-format
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
422 (and delimit-columns-format
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
423 (make-string (- (aref delimit-columns-max ncol)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
424 (- (current-column) origin))
64003
bf6ae7cf12eb (columns): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents: 54326
diff changeset
425 ?\s)))
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
426 (setq ncol (1+ ncol)))
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
427 ;; Prepare last column spaces
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
428 (let ((spaces (and delimit-columns-format
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
429 (make-string (- (aref delimit-columns-max ncol)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
430 (- (current-column) origin))
64003
bf6ae7cf12eb (columns): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents: 54326
diff changeset
431 ?\s))))
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
432 ;; Adjust extra columns, if needed
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
433 (and delimit-columns-extra
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
434 (while (and (< (setq ncol (1+ ncol)) len)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
435 (<= ncol delimit-columns-end))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
436 (delimit-columns-format spaces)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
437 (setq spaces (and delimit-columns-format
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
438 (make-string (aref delimit-columns-max ncol)
64003
bf6ae7cf12eb (columns): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents: 54326
diff changeset
439 ?\s)))))
32835
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
440 ;; insert last formating
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
441 (cond ((null delimit-columns-format)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
442 (insert delimit-columns-after delimit-columns-str-after))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
443 ((eq delimit-columns-format 'padding)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
444 (insert spaces delimit-columns-after delimit-columns-str-after))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
445 (t
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
446 (insert delimit-columns-after spaces delimit-columns-str-after))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
447 ))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
448 (goto-char (max (point) delimit-columns-limit))))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
449
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
450
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
451 (defun delimit-columns-format (spaces)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
452 (cond ((null delimit-columns-format)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
453 (insert delimit-columns-after
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
454 delimit-columns-str-separator
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
455 delimit-columns-before))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
456 ((eq delimit-columns-format 'separator)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
457 (insert delimit-columns-after
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
458 spaces
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
459 delimit-columns-str-separator
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
460 delimit-columns-before))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
461 ((eq delimit-columns-format 'padding)
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
462 (insert spaces
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
463 delimit-columns-after
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
464 delimit-columns-str-separator
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
465 delimit-columns-before))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
466 (t
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
467 (insert delimit-columns-after
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
468 delimit-columns-str-separator
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
469 spaces
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
470 delimit-columns-before))
001414add3a5 Now there is a column formatting mechanism.
Gerd Moellmann <gerd@gnu.org>
parents: 26040
diff changeset
471 ))
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
472
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
473
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
474 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
475
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
476
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
477 (provide 'delim-col)
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
478
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
479
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 79721
diff changeset
480 ;; arch-tag: 1cc0c5c5-1b2a-43e4-9ba5-bf9441cfd1a9
25761
605bd4f82d45 Initial revision
Dave Love <fx@gnu.org>
parents:
diff changeset
481 ;;; delim-col.el ends here