mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-24 10:38:38 +00:00
(undo, yank): Set this-command to t at start,
and set it correctly at the end.
This commit is contained in:
parent
188420314b
commit
456c617c0b
@ -604,6 +604,9 @@ Get previous element of history which is a completion of minibuffer contents."
|
|||||||
Repeat this command to undo more changes.
|
Repeat this command to undo more changes.
|
||||||
A numeric argument serves as a repeat count."
|
A numeric argument serves as a repeat count."
|
||||||
(interactive "*p")
|
(interactive "*p")
|
||||||
|
;; If we don't get all the way thru, make last-command indicate that
|
||||||
|
;; for the following command.
|
||||||
|
(setq this-command t)
|
||||||
(let ((modified (buffer-modified-p))
|
(let ((modified (buffer-modified-p))
|
||||||
(recent-save (recent-auto-save-p)))
|
(recent-save (recent-auto-save-p)))
|
||||||
(or (eq (selected-window) (minibuffer-window))
|
(or (eq (selected-window) (minibuffer-window))
|
||||||
@ -611,10 +614,11 @@ A numeric argument serves as a repeat count."
|
|||||||
(or (eq last-command 'undo)
|
(or (eq last-command 'undo)
|
||||||
(progn (undo-start)
|
(progn (undo-start)
|
||||||
(undo-more 1)))
|
(undo-more 1)))
|
||||||
(setq this-command 'undo)
|
|
||||||
(undo-more (or arg 1))
|
(undo-more (or arg 1))
|
||||||
(and modified (not (buffer-modified-p))
|
(and modified (not (buffer-modified-p))
|
||||||
(delete-auto-save-file-if-necessary recent-save))))
|
(delete-auto-save-file-if-necessary recent-save)))
|
||||||
|
;; If we do get all the way thru, make this-command indicate that.
|
||||||
|
(setq this-command 'undo))
|
||||||
|
|
||||||
(defvar pending-undo-list nil
|
(defvar pending-undo-list nil
|
||||||
"Within a run of consecutive undo commands, list remaining to be undone.")
|
"Within a run of consecutive undo commands, list remaining to be undone.")
|
||||||
@ -1165,6 +1169,9 @@ With argument N, reinsert the Nth most recently killed stretch of killed
|
|||||||
text.
|
text.
|
||||||
See also the command \\[yank-pop]."
|
See also the command \\[yank-pop]."
|
||||||
(interactive "*P")
|
(interactive "*P")
|
||||||
|
;; If we don't get all the way thru, make last-command indicate that
|
||||||
|
;; for the following command.
|
||||||
|
(setq this-command t)
|
||||||
(push-mark (point))
|
(push-mark (point))
|
||||||
(insert (current-kill (cond
|
(insert (current-kill (cond
|
||||||
((listp arg) 0)
|
((listp arg) 0)
|
||||||
@ -1176,6 +1183,8 @@ See also the command \\[yank-pop]."
|
|||||||
;; loop would deactivate the mark because we inserted text.
|
;; loop would deactivate the mark because we inserted text.
|
||||||
(goto-char (prog1 (mark t)
|
(goto-char (prog1 (mark t)
|
||||||
(set-marker (mark-marker) (point) (current-buffer)))))
|
(set-marker (mark-marker) (point) (current-buffer)))))
|
||||||
|
;; If we do get all the way thru, make this-command indicate that.
|
||||||
|
(setq this-command 'yank)
|
||||||
nil)
|
nil)
|
||||||
|
|
||||||
(defun rotate-yank-pointer (arg)
|
(defun rotate-yank-pointer (arg)
|
||||||
|
Loading…
Reference in New Issue
Block a user