]> code.delx.au - gnu-emacs/blobdiff - lisp/delim-col.el
Dired recognize dirs when file size in human units
[gnu-emacs] / lisp / delim-col.el
index f24e187ba3c5d46fc0867025a97276789d9980e5..cfa7c76622a1c949d364a4742fab79671308d7c0 100644 (file)
@@ -1,20 +1,19 @@
-;;; 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-2016 Free Software Foundation, Inc.
 
-;; Author:     Vinicius Jose Latorre <vinicius@cpqd.com.br>
-;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br>
-;; Time-stamp: <2000/10/28 09:34:15 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 +21,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:
 
 ;; operates over the text rectangle selected which rectangle diagonal is
 ;; given by the region start and end.
 ;;
-;; See `delimit-columns-format' variable documentation for column formating.
+;; See `delimit-columns-format' variable documentation for column formatting.
 ;;
 ;; `delimit-columns-region' is useful when you have columns of text that
 ;; are not well aligned, like:
 ;; 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)
+  :group 'wp)
 
 (defcustom delimit-columns-str-before ""
-  "*Specify a string to be inserted before all columns."
+  "Specify a string to be inserted before all columns."
   :type '(string :tag "Before All Columns")
   :group 'columns)
 
 (defcustom delimit-columns-str-separator ", "
-  "*Specify a string to be inserted between each column."
+  "Specify a string to be inserted between each column."
   :type '(string :tag "Between Each Column")
   :group 'columns)
 
 (defcustom delimit-columns-str-after ""
-  "*Specify a string to be inserted after all columns."
+  "Specify a string to be inserted after all columns."
   :type '(string :tag "After All Columns")
   :group 'columns)
 
 (defcustom delimit-columns-before ""
-  "*Specify a string to be inserted before each column."
+  "Specify a string to be inserted before each column."
   :type '(string :tag "Before Each Column")
   :group 'columns)
 
 (defcustom delimit-columns-after ""
-  "*Specify a string to be inserted after each column."
+  "Specify a string to be inserted after each column."
   :type '(string :tag "After Each Column")
   :group 'columns)
 
 (defcustom delimit-columns-separator "\t"
-  "*Specify a regexp which separates each column."
+  "Specify a regexp which separates each column."
   :type '(regexp :tag "Column Separator")
   :group 'columns)
 
 (defcustom delimit-columns-format t
-  "*Specify how to format columns.
+  "Specify how to format columns.
 
 For examples below, consider:
 
@@ -174,7 +171,7 @@ For examples below, consider:
 
 Valid values are:
 
-   nil         no formating.  That is, `delimit-columns-after' is followed by
+   nil         no formatting.  That is, `delimit-columns-after' is followed by
                `delimit-columns-separator'.
                For example, the result is: \"<ccc>:<dddd>:\"
 
@@ -182,34 +179,34 @@ Valid values are:
                `delimit-columns-separator' and then followed by spaces.
                For example, the result is: \"<ccc>:   <dddd>:  \"
 
-   'separator  align separators.  That is, `delimit-columns-after' is followed
+   `separator' align separators.  That is, `delimit-columns-after' is followed
                by spaces and then followed by `delimit-columns-separator'.
                For example, the result is: \"<ccc>   :<dddd>  :\"
 
-   'padding    format column by filling with spaces before
+   `padding'   format column by filling with spaces before
                `delimit-columns-after'.  That is, spaces are followed by
                `delimit-columns-after' and then followed by
                `delimit-columns-separator'.
                For example, the result is: \"<ccc   >:<dddd  >:\"
 
 Any other value is treated as t."
-  :type '(choice :menu-tag "Column Formating"
-                :tag "Column Formating"
-                (const :tag "No Formating" nil)
+  :type '(choice :menu-tag "Column Formatting"
+                :tag "Column Formatting"
+                (const :tag "No Formatting" nil)
                 (const :tag "Column Alignment" t)
-                (const :tag "Separator Aligment" separator)
+                (const :tag "Separator Alignment" separator)
                 (const :tag "Column Padding" padding))
   :group 'columns)
 
 (defcustom delimit-columns-extra t
-  "*Non-nil means that lines will have the same number of columns.
+  "Non-nil means that lines will have the same number of columns.
 
 This has effect only when there are lines with different number of columns."
   :type '(boolean :tag "Lines With Same Number Of Column")
   :group 'columns)
 
 (defcustom delimit-columns-start 0
-  "*Specify column number to start prettifing.
+  "Specify column number to start prettifying.
 
 See also `delimit-columns-end' for documentation.
 
@@ -224,7 +221,7 @@ column (column 0) is located at left corner."
   :group 'columns)
 
 (defcustom delimit-columns-end 1000000
-  "*Specify column number to end prettifing.
+  "Specify column number to end prettifying.
 
 See also `delimit-columns-start' for documentation.
 
@@ -243,6 +240,11 @@ column (column 0) is located at left corner."
 ;; User Commands:
 
 
+;; to avoid compilation gripes
+(defvar delimit-columns-max nil)
+(defvar delimit-columns-limit nil)
+
+
 ;;;###autoload
 (defun delimit-columns-customize ()
   "Customization of `columns' group."
@@ -357,12 +359,7 @@ START and END delimits the corners of text rectangle."
 ;; Internal Variables and Functions:
 
 
-;; to avoid compilation gripes
-(defvar delimit-columns-max nil)
-(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)
@@ -395,7 +392,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)
@@ -407,7 +404,7 @@ START and END delimits the corners of text rectangle."
                (re-search-forward delimit-columns-separator
                                   delimit-columns-limit 'move))
       (setq ncol (1+ ncol)))
-    ;; insert first formating
+    ;; insert first formatting
     (insert delimit-columns-str-before delimit-columns-before)
     ;; Adjust all columns but last one
     (while (progn
@@ -424,13 +421,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)
@@ -438,8 +435,8 @@ 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)
-                                           ?\ )))))
-      ;; insert last formating
+                                           ?\s)))))
+      ;; insert last formatting
       (cond ((null delimit-columns-format)
             (insert delimit-columns-after delimit-columns-str-after))
            ((eq delimit-columns-format 'padding)