no need for reg normalisation

This commit is contained in:
Jean-Philippe Bernardy 2016-09-08 22:03:25 +02:00
parent 998c766f11
commit a1281e0434
2 changed files with 3 additions and 6 deletions

View file

@ -190,7 +190,7 @@ the region, in insertion mode. Subregions won't be overlapping."
(defun boon-select-borders (how-much regs)
"Return the bordering (of size HOW-MUCH) of a region list REGS."
(interactive (list (prefix-numeric-value current-prefix-arg) (boon-spec-selector "select contents")))
(lambda ()(apply 'append (mapcar (lambda (reg) (boon-borders reg how-much)) (mapcar 'boon-normalize-reg (funcall regs))))))
(lambda ()(apply 'append (mapcar (lambda (reg) (boon-borders reg how-much)) (funcall regs)))))
(defun boon-select-with-spaces (regs)
"Return the regions REGS, including some surrounding spaces on one side."
@ -200,7 +200,7 @@ the region, in insertion mode. Subregions won't be overlapping."
(defun boon-select-content (regs)
"Return the contents (of size HOW-MUCH) of a region list REGS."
(interactive (list (boon-spec-selector "select borders")))
(lambda ()(mapcar 'boon-content (mapcar 'boon-normalize-reg (funcall regs)))))
(lambda ()(mapcar 'boon-content (funcall regs))))
(defun boon-bypass-mc ()
"Should we bypass multiple cursors when gathering regions?"

View file

@ -27,15 +27,12 @@
(defun boon-reg-cursor (reg)
(caddr reg))
(defun boon-normalize-reg (reg)
"Normalize the region REG by making sure that mark < point."
(boon-mk-reg (boon-reg-begin reg) (boon-reg-end reg) (boon-reg-cursor reg)))
(defun boon-reg-to-markers (reg)
"Put copy the markers defining REG borders, and return that."
(boon-mk-reg (copy-marker (boon-reg-mark reg)) (copy-marker (boon-reg-point reg)) (boon-reg-cursor reg)))
(defun boon-reg-from-markers (reg)
"Put convert markers to numbers in REG."
(boon-mk-reg (marker-position (boon-reg-mark reg)) (marker-position (boon-reg-point reg)) (boon-reg-cursor reg)))
(defun boon-borders (reg how-much)