Commit 8482d727 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

(cua-do-rectangle-padding): Remove period from end of messages.

(cua--rectangle-seq-format): Fix typo in docstring.
(cua-sequence-rectangle, cua-fill-char-rectangle): Improve argument/docstring
consistency.
parent c23eed1b
...@@ -992,7 +992,7 @@ With prefix argument, the toggle restriction." ...@@ -992,7 +992,7 @@ With prefix argument, the toggle restriction."
(defun cua-do-rectangle-padding () (defun cua-do-rectangle-padding ()
(interactive) (interactive)
(if buffer-read-only (if buffer-read-only
(message "Cannot do padding in read-only buffer.") (message "Cannot do padding in read-only buffer")
(cua--rectangle-operation nil nil t t t) (cua--rectangle-operation nil nil t t t)
(cua--rectangle-set-corners)) (cua--rectangle-set-corners))
(cua--keep-active)) (cua--keep-active))
...@@ -1098,14 +1098,14 @@ The length of STRING need not be the same as the rectangle width." ...@@ -1098,14 +1098,14 @@ The length of STRING need not be the same as the rectangle width."
'(lambda (l r) '(lambda (l r)
(cua--rectangle-right (max l (+ l (length string) -1))))))) (cua--rectangle-right (max l (+ l (length string) -1)))))))
(defun cua-fill-char-rectangle (ch) (defun cua-fill-char-rectangle (character)
"Replace CUA rectangle contents with CHARACTER." "Replace CUA rectangle contents with CHARACTER."
(interactive "cFill rectangle with character: ") (interactive "cFill rectangle with character: ")
(cua--rectangle-operation 'clear nil t 1 nil (cua--rectangle-operation 'clear nil t 1 nil
'(lambda (s e l r) '(lambda (s e l r)
(delete-region s e) (delete-region s e)
(move-to-column l t) (move-to-column l t)
(insert-char ch (- r l))))) (insert-char character (- r l)))))
(defun cua-replace-in-rectangle (regexp newtext) (defun cua-replace-in-rectangle (regexp newtext)
"Replace REGEXP with NEWTEXT in each line of CUA rectangle." "Replace REGEXP with NEWTEXT in each line of CUA rectangle."
...@@ -1137,9 +1137,9 @@ The length of STRING need not be the same as the rectangle width." ...@@ -1137,9 +1137,9 @@ The length of STRING need not be the same as the rectangle width."
(t nil))))) (t nil)))))
(defvar cua--rectangle-seq-format "%d" (defvar cua--rectangle-seq-format "%d"
"Last format used by cua-sequence-rectangle.") "Last format used by `cua-sequence-rectangle'.")
(defun cua-sequence-rectangle (first incr fmt) (defun cua-sequence-rectangle (first incr format)
"Resequence each line of CUA rectangle starting from FIRST. "Resequence each line of CUA rectangle starting from FIRST.
The numbers are formatted according to the FORMAT string." The numbers are formatted according to the FORMAT string."
(interactive (interactive
...@@ -1150,13 +1150,13 @@ The numbers are formatted according to the FORMAT string." ...@@ -1150,13 +1150,13 @@ The numbers are formatted according to the FORMAT string."
(string-to-number (string-to-number
(read-string "Increment: (1) " nil nil "1")) (read-string "Increment: (1) " nil nil "1"))
(read-string (concat "Format: (" cua--rectangle-seq-format ") ")))) (read-string (concat "Format: (" cua--rectangle-seq-format ") "))))
(if (= (length fmt) 0) (if (= (length format) 0)
(setq fmt cua--rectangle-seq-format) (setq format cua--rectangle-seq-format)
(setq cua--rectangle-seq-format fmt)) (setq cua--rectangle-seq-format format))
(cua--rectangle-operation 'clear nil t 1 nil (cua--rectangle-operation 'clear nil t 1 nil
'(lambda (s e l r) '(lambda (s e l r)
(delete-region s e) (delete-region s e)
(insert (format fmt first)) (insert (format format first))
(setq first (+ first incr))))) (setq first (+ first incr)))))
(defmacro cua--convert-rectangle-as (command tabify) (defmacro cua--convert-rectangle-as (command tabify)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment