emacs: simplify prot-simple-duplicate-line-or-region

This commit is contained in:
Protesilaos Stavrou 2024-02-04 07:16:16 +02:00
parent 55885648e1
commit 66bb3598d5
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA
2 changed files with 6 additions and 10 deletions

View file

@ -15637,11 +15637,9 @@ BOUNDARIES is a cons cell representing buffer positions."
(error "`%s' is not a cons cell" boundaries))
(let ((beg (car boundaries))
(end (cdr boundaries)))
(save-excursion
(goto-char end)
(newline)
(insert (buffer-substring-no-properties beg end))
(indent-for-tab-command))))
(goto-char end)
(newline)
(insert (buffer-substring-no-properties beg end))))
;;;###autoload
(defun prot-simple-duplicate-line-or-region (&optional beg end)

View file

@ -224,11 +224,9 @@ BOUNDARIES is a cons cell representing buffer positions."
(error "`%s' is not a cons cell" boundaries))
(let ((beg (car boundaries))
(end (cdr boundaries)))
(save-excursion
(goto-char end)
(newline)
(insert (buffer-substring-no-properties beg end))
(indent-for-tab-command))))
(goto-char end)
(newline)
(insert (buffer-substring-no-properties beg end))))
;;;###autoload
(defun prot-simple-duplicate-line-or-region (&optional beg end)