emacsfodder / move-text

move current line or region up or down
199 stars 12 forks source link

Fail: When a region/mark has never been set in the buffer #7

Closed jasonm23 closed 8 years ago

jasonm23 commented 8 years ago

I'm using (interactive "r/np") (get region and prefix arg) Which fails if the mark was never set in the local buffer.

I'll fix it with something like:

(defun test-it (start end n)
  (interactive
   (let ((args `(,@(if (region-active-p)
                       `(,(region-beginning) ,(region-end))
                     `(nil nil))
                 ,current-prefix-arg)))
     args))
(message "s:%s e:%s prefix:%s" start end n))
jasonm23 commented 8 years ago

fixed in 58f66f9