125 |
;; User Options: |
;; User Options: |
126 |
|
|
127 |
(defgroup columns nil |
(defgroup columns nil |
128 |
"Prettify columns" |
"Prettify columns." |
129 |
:link '(emacs-library-link :tag "Source Lisp File" "delim-col.el") |
:link '(emacs-library-link :tag "Source Lisp File" "delim-col.el") |
130 |
:prefix "delimit-columns-" |
:prefix "delimit-columns-" |
131 |
:group 'internal) |
:group 'internal) |
424 |
(and delimit-columns-format |
(and delimit-columns-format |
425 |
(make-string (- (aref delimit-columns-max ncol) |
(make-string (- (aref delimit-columns-max ncol) |
426 |
(- (current-column) origin)) |
(- (current-column) origin)) |
427 |
?\ ))) |
?\s))) |
428 |
(setq ncol (1+ ncol))) |
(setq ncol (1+ ncol))) |
429 |
;; Prepare last column spaces |
;; Prepare last column spaces |
430 |
(let ((spaces (and delimit-columns-format |
(let ((spaces (and delimit-columns-format |
431 |
(make-string (- (aref delimit-columns-max ncol) |
(make-string (- (aref delimit-columns-max ncol) |
432 |
(- (current-column) origin)) |
(- (current-column) origin)) |
433 |
?\ )))) |
?\s)))) |
434 |
;; Adjust extra columns, if needed |
;; Adjust extra columns, if needed |
435 |
(and delimit-columns-extra |
(and delimit-columns-extra |
436 |
(while (and (< (setq ncol (1+ ncol)) len) |
(while (and (< (setq ncol (1+ ncol)) len) |
438 |
(delimit-columns-format spaces) |
(delimit-columns-format spaces) |
439 |
(setq spaces (and delimit-columns-format |
(setq spaces (and delimit-columns-format |
440 |
(make-string (aref delimit-columns-max ncol) |
(make-string (aref delimit-columns-max ncol) |
441 |
?\ ))))) |
?\s))))) |
442 |
;; insert last formating |
;; insert last formating |
443 |
(cond ((null delimit-columns-format) |
(cond ((null delimit-columns-format) |
444 |
(insert delimit-columns-after delimit-columns-str-after)) |
(insert delimit-columns-after delimit-columns-str-after)) |