mirror of
https://github.com/protesilaos/dotfiles.git
synced 2026-09-10 07:16:20 -04:00
emacs: make prot-simple-delete-line not err when end is out of bounds
This commit is contained in:
parent
bb4895da05
commit
7a7f9418ef
|
|
@ -16726,12 +16726,14 @@ This command can then be followed by the standard
|
|||
(defun prot-simple-delete-line ()
|
||||
"Delete (not kill) from point to the end of the line."
|
||||
(interactive)
|
||||
(let ((point (point))
|
||||
(end (line-end-position)))
|
||||
(if (eq point end)
|
||||
(delete-region point (+ end 1))
|
||||
(delete-region point end)))
|
||||
(setq this-command 'kill-whole-line))
|
||||
(let* ((point (point))
|
||||
(end (line-end-position))
|
||||
(end+ (+ end 1)))
|
||||
(cond
|
||||
((> end+ (point-max)))
|
||||
((= point end) (delete-region point end+))
|
||||
(t (delete-region point end))))
|
||||
(setq this-command 'delete-region))
|
||||
|
||||
;;;###autoload
|
||||
(defun prot-simple-delete-line-backward ()
|
||||
|
|
|
|||
|
|
@ -320,12 +320,14 @@ This command can then be followed by the standard
|
|||
(defun prot-simple-delete-line ()
|
||||
"Delete (not kill) from point to the end of the line."
|
||||
(interactive)
|
||||
(let ((point (point))
|
||||
(end (line-end-position)))
|
||||
(if (eq point end)
|
||||
(delete-region point (+ end 1))
|
||||
(delete-region point end)))
|
||||
(setq this-command 'kill-whole-line))
|
||||
(let* ((point (point))
|
||||
(end (line-end-position))
|
||||
(end+ (+ end 1)))
|
||||
(cond
|
||||
((> end+ (point-max)))
|
||||
((= point end) (delete-region point end+))
|
||||
(t (delete-region point end))))
|
||||
(setq this-command 'delete-region))
|
||||
|
||||
;;;###autoload
|
||||
(defun prot-simple-delete-line-backward ()
|
||||
|
|
|
|||
Loading…
Reference in a new issue