2 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/97ece44f19cf/
Changeset: 97ece44f19cf
User: kehoea
Date: 2017-09-07 08:16:19+00:00
Summary: Remove #'spaces-string, rect.el, call #'format instead.
lisp/ChangeLog addition:
2017-09-07 Aidan Kehoe <kehoea(a)parhasard.net>
* rect.el (delete-extract-rectangle-line):
Use (format "%*s" N "") instead of (spaces-string N) in this
function.
* rect.el (extract-rectangle-line): Ditto.
* rect.el (spaces-strings): Removed.
* rect.el (spaces-string): Removed.
These aren't needed, (format "*s" N "") does the same job.
Affected #: 2 files
diff -r 97140cfdeca785747a13192343cf357ea21a3dc1 -r
97ece44f19cfad8a1892d2a542dcceea679ae93c lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
+2017-09-07 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * rect.el (delete-extract-rectangle-line):
+ Use (format "%*s" N "") instead of (spaces-string N) in this
+ function.
+ * rect.el (extract-rectangle-line): Ditto.
+ * rect.el (spaces-strings): Removed.
+ * rect.el (spaces-string): Removed.
+ These aren't needed, (format "*s" N "") does the same job.
+
2017-06-28 Aidan Kehoe <kehoea(a)parhasard.net>
* subr.el (char-width): Move this to C, necessary as part of the
diff -r 97140cfdeca785747a13192343cf357ea21a3dc1 -r
97ece44f19cfad8a1892d2a542dcceea679ae93c lisp/rect.el
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -133,39 +133,16 @@
(interactive "*r\nP")
(apply-on-rectangle 'delete-rectangle-line start end fill))
-
-;; I love ascii art ;-)
-(defconst spaces-strings '[""
- " "
- " "
- " "
- " "
- " "
- " "
- " "
- " "])
-
-;; This function is untouched --dv
-(defun spaces-string (n)
- (if (<= n 8) (aref spaces-strings n)
- (let ((val ""))
- (while (> n 8)
- (setq val (concat " " val)
- n (- n 8)))
- (concat val (aref spaces-strings n)))))
-
-
(defun delete-extract-rectangle-line (startcol endcol lines fill)
(let ((pt (point-at-eol)))
(if (< (move-to-column startcol (or fill 'coerce)) startcol)
- (setcdr lines (cons (spaces-string (- endcol startcol))
+ (setcdr lines (cons (format "%*s" (- endcol startcol) "")
(cdr lines)))
;; else
(setq pt (point))
(move-to-column endcol t)
(setcdr lines (cons (buffer-substring pt (point)) (cdr lines)))
- (delete-region pt (point)))
- ))
+ (delete-region pt (point)))))
;;;###autoload
(defun delete-extract-rectangle (start end &optional fill)
@@ -201,14 +178,12 @@
(let ((width (- (current-column)
(save-excursion (backward-char 1)
(current-column)))))
- (setq line (concat (substring line 0 (- (point) end 1))
- (spaces-string width)
- (substring line (+ (length line)
- (- (point) end)))))))
+ (setq line (format "%.*s%*s%s"
+ (- (point) end 1) line
+ width ""
+ (subseq line (+ (length line) (- (point) end)))))))
(if (or (> begextra 0) (> endextra 0))
- (setq line (concat (spaces-string begextra)
- line
- (spaces-string endextra))))
+ (setq line (format "%*s%s%*s" begextra "" line endextra
"")))
(setcdr lines (cons line (cdr lines)))))
;;;###autoload
https://bitbucket.org/xemacs/xemacs/commits/8dea4d0549ac/
Changeset: 8dea4d0549ac
User: kehoea
Date: 2017-09-07 08:19:50+00:00
Summary: Fix up whitespace, rect.el
2017-09-07 Aidan Kehoe <kehoea(a)parhasard.net>
[...]
* rect.el (apply-on-rectangle):
* rect.el (delete-rectangle-line):
* rect.el (open-rectangle-line):
* rect.el (string-rectangle-line):
* rect.el (clear-rectangle-line):
* rect.el (rect):
Fixup whitespace in this file.
Affected #: 2 files
diff -r 97ece44f19cfad8a1892d2a542dcceea679ae93c -r
8dea4d0549ac0a49456d01bba96171399456c227 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -7,6 +7,13 @@
* rect.el (spaces-strings): Removed.
* rect.el (spaces-string): Removed.
These aren't needed, (format "*s" N "") does the same job.
+ * rect.el (apply-on-rectangle):
+ * rect.el (delete-rectangle-line):
+ * rect.el (open-rectangle-line):
+ * rect.el (string-rectangle-line):
+ * rect.el (clear-rectangle-line):
+ * rect.el (rect):
+ Fixup whitespace in this file.
2017-06-28 Aidan Kehoe <kehoea(a)parhasard.net>
diff -r 97ece44f19cfad8a1892d2a542dcceea679ae93c -r
8dea4d0549ac0a49456d01bba96171399456c227 lisp/rect.el
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -106,9 +106,7 @@
(goto-char startpt)
(while (< (point) endpt)
(apply function startcol endcol args)
- (forward-line 1)))
- ))
-
+ (forward-line 1)))))
(defun delete-rectangle-line (startcol endcol fill)
(let ((pt (point-at-eol)))
@@ -118,8 +116,7 @@
;; else
(setq pt (point))
(move-to-column endcol t)
- (delete-region pt (point))))
- ))
+ (delete-region pt (point))))))
;;;###autoload
(defun delete-rectangle (start end &optional fill)
@@ -155,7 +152,6 @@
(apply-on-rectangle 'delete-extract-rectangle-line start end lines fill)
(nreverse (cdr lines))))
-
;; #### NOTE: this is actually the only function that needs to do complicated
;; stuff like what's happening in `operate-on-rectangle', because the buffer
;; might be read-only. --dv
@@ -194,7 +190,6 @@
(apply-on-rectangle 'extract-rectangle-line start end lines)
(nreverse (cdr lines))))
-
;;;###autoload
(defvar killed-rectangle nil
"Rectangle for `yank-rectangle' to insert.")
@@ -220,7 +215,6 @@
(interactive "*")
(insert-rectangle killed-rectangle))
-
;; This function is untouched --dv
;;;###autoload
(defun insert-rectangle (rectangle)
@@ -244,7 +238,6 @@
(insert (car lines))
(setq lines (cdr lines)))))
-
(defun open-rectangle-line (startcol endcol fill)
(when (= (move-to-column startcol (or fill 'coerce)) startcol)
(unless (and (not fill)
@@ -262,7 +255,6 @@
(apply-on-rectangle 'open-rectangle-line start end fill)
(goto-char start))
-
(defun string-rectangle-line (startcol endcol string delete)
(move-to-column startcol t)
(if delete
@@ -290,7 +282,6 @@
(interactive "*r\nsString rectangle: ")
(apply-on-rectangle 'string-rectangle-line start end string t))
-
(defun clear-rectangle-line (startcol endcol fill)
(let ((pt (point-at-eol))
spaces)
@@ -303,8 +294,7 @@
(move-to-column endcol t)
(setq spaces (- (point) pt))
(delete-region pt (point))
- (indent-to (+ (current-column) spaces))))
- ))
+ (indent-to (+ (current-column) spaces))))))
;;;###autoload
(defun clear-rectangle (start end &optional fill)
@@ -317,7 +307,6 @@
(interactive "*r\nP")
(apply-on-rectangle 'clear-rectangle-line start end fill))
-
(provide 'rect)
;;; rect.el ends here
Repository URL:
https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.