]> code.delx.au - gnu-emacs/blobdiff - lisp/delim-col.el
* completion.el (add-completion-to-head, add-completion): Doc fixes.
[gnu-emacs] / lisp / delim-col.el
index 749130c2a04b8ddd6aa8edf225823b1fe6f75508..92e4fe15930a1470e07385b1f8f68d8338ac3994 100644 (file)
@@ -1,20 +1,20 @@
-;;; delim-col.el --- Prettify all columns in a region or rectangle.
+;;; delim-col.el --- prettify all columns in a region or rectangle
 
-;; Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
-;; Author:     Vinicius Jose Latorre <vinicius@cpqd.com.br>
-;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br>
-;; Time-stamp: <2000/10/24 10:35:58 vinicius>
-;; Version:    2.1
-;; Keywords:   internal
-;; X-URL:      http://www.cpqd.com.br/~vinicius/emacs/
+;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
+;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
+;; Version: 2.1
+;; Keywords: internal
+;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,9 +22,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 ;; User Options:
 
 (defgroup columns nil
-  "Prettify columns"
+  "Prettify columns."
   :link '(emacs-library-link :tag "Source Lisp File" "delim-col.el")
   :prefix "delimit-columns-"
   :group 'internal)
@@ -250,6 +248,10 @@ column (column 0) is located at left corner."
   (customize-group 'columns))
 
 
+(defmacro delimit-columns-str (str)
+  `(if (stringp ,str) ,str ""))
+
+
 ;;;###autoload
 (defun delimit-columns-region (start end)
   "Prettify all columns in a text region.
@@ -257,25 +259,15 @@ column (column 0) is located at left corner."
 START and END delimits the text region."
   (interactive "*r")
   (let ((delimit-columns-str-before
-        (if (stringp delimit-columns-str-before)
-            delimit-columns-str-before
-          ""))
+        (delimit-columns-str delimit-columns-str-before))
        (delimit-columns-str-separator
-        (if (stringp delimit-columns-str-separator)
-            delimit-columns-str-separator
-          " "))
+        (delimit-columns-str delimit-columns-str-separator))
        (delimit-columns-str-after
-        (if (stringp delimit-columns-str-after)
-            delimit-columns-str-after
-          ""))
+        (delimit-columns-str delimit-columns-str-after))
        (delimit-columns-before
-        (if (stringp delimit-columns-before)
-            delimit-columns-before
-          ""))
+        (delimit-columns-str delimit-columns-before))
        (delimit-columns-after
-        (if (stringp delimit-columns-after)
-            delimit-columns-after
-          ""))
+        (delimit-columns-str delimit-columns-after))
        (delimit-columns-start
         (if (and (integerp delimit-columns-start)
                  (>= delimit-columns-start 0))
@@ -323,25 +315,15 @@ START and END delimits the text region."
 START and END delimits the corners of text rectangle."
   (interactive "*r")
   (let ((delimit-columns-str-before
-        (if (stringp delimit-columns-str-before)
-            delimit-columns-str-before
-          ""))
+        (delimit-columns-str delimit-columns-str-before))
        (delimit-columns-str-separator
-        (if (stringp delimit-columns-str-separator)
-            delimit-columns-str-separator
-          " "))
+        (delimit-columns-str delimit-columns-str-separator))
        (delimit-columns-str-after
-        (if (stringp delimit-columns-str-after)
-            delimit-columns-str-after
-          ""))
+        (delimit-columns-str delimit-columns-str-after))
        (delimit-columns-before
-        (if (stringp delimit-columns-before)
-            delimit-columns-before
-          ""))
+        (delimit-columns-str delimit-columns-before))
        (delimit-columns-after
-        (if (stringp delimit-columns-after)
-            delimit-columns-after
-          ""))
+        (delimit-columns-str delimit-columns-after))
        (delimit-columns-start
         (if (and (integerp delimit-columns-start)
                  (>= delimit-columns-start 0))
@@ -378,7 +360,7 @@ START and END delimits the corners of text rectangle."
 (defvar delimit-columns-limit nil)
 
 
-(defun delimit-columns-rectangle-max (startpos &optional ignore ignore)
+(defun delimit-columns-rectangle-max (startpos &optional ignore1 ignore2)
   (set-marker delimit-columns-limit (point))
   (goto-char startpos)
   (let ((ncol 1)
@@ -411,7 +393,7 @@ START and END delimits the corners of text rectangle."
       (setq values (cdr values)))))
 
 
-(defun delimit-columns-rectangle-line (startpos &optional ignore ignore)
+(defun delimit-columns-rectangle-line (startpos &optional ignore1 ignore2)
   (let ((len  (length delimit-columns-max))
        (ncol 0)
        origin)
@@ -440,13 +422,13 @@ START and END delimits the corners of text rectangle."
        (and delimit-columns-format
            (make-string (- (aref delimit-columns-max ncol)
                            (- (current-column) origin))
-                        ?\ )))
+                        ?\s)))
       (setq ncol (1+ ncol)))
     ;; Prepare last column spaces
     (let ((spaces (and delimit-columns-format
                       (make-string (- (aref delimit-columns-max ncol)
                                       (- (current-column) origin))
-                                   ?\ ))))
+                                   ?\s))))
       ;; Adjust extra columns, if needed
       (and delimit-columns-extra
           (while (and (< (setq ncol (1+ ncol)) len)
@@ -454,7 +436,7 @@ START and END delimits the corners of text rectangle."
             (delimit-columns-format spaces)
             (setq spaces (and delimit-columns-format
                               (make-string (aref delimit-columns-max ncol)
-                                           ?\ )))))
+                                           ?\s)))))
       ;; insert last formating
       (cond ((null delimit-columns-format)
             (insert delimit-columns-after delimit-columns-str-after))
@@ -495,4 +477,5 @@ START and END delimits the corners of text rectangle."
 (provide 'delim-col)
 
 
+;; arch-tag: 1cc0c5c5-1b2a-43e4-9ba5-bf9441cfd1a9
 ;;; delim-col.el ends here