1875 |
(setq this-command 'kill-region) |
(setq this-command 'kill-region) |
1876 |
(message "If the next command is a kill, it will append")) |
(message "If the next command is a kill, it will append")) |
1877 |
(setq last-command 'kill-region))) |
(setq last-command 'kill-region))) |
1878 |
|
|
1879 |
;; Yanking. |
;; Yanking. |
1880 |
|
|
1881 |
|
;; This is actually used in subr.el but defcustom does not work there. |
1882 |
|
(defcustom yank-excluded-properties |
1883 |
|
'(read-only invisible intangible field mouse-face local-map keymap) |
1884 |
|
"*Text properties to discard when yanking." |
1885 |
|
:type '(choice (const :tag "All" t) (repeat symbol)) |
1886 |
|
:group 'editing |
1887 |
|
:version 21.4) |
1888 |
|
|
1889 |
(defun yank-pop (arg) |
(defun yank-pop (arg) |
1890 |
"Replace just-yanked stretch of killed text with a different stretch. |
"Replace just-yanked stretch of killed text with a different stretch. |
1891 |
This command is allowed only immediately after a `yank' or a `yank-pop'. |
This command is allowed only immediately after a `yank' or a `yank-pop'. |
1907 |
(before (< (point) (mark t)))) |
(before (< (point) (mark t)))) |
1908 |
(delete-region (point) (mark t)) |
(delete-region (point) (mark t)) |
1909 |
(set-marker (mark-marker) (point) (current-buffer)) |
(set-marker (mark-marker) (point) (current-buffer)) |
1910 |
(let ((opoint (point))) |
(insert-for-yank (current-kill arg)) |
|
(insert (current-kill arg)) |
|
|
(let ((inhibit-read-only t)) |
|
|
(remove-text-properties opoint (point) '(read-only nil)))) |
|
1911 |
(if before |
(if before |
1912 |
;; This is like exchange-point-and-mark, but doesn't activate the mark. |
;; This is like exchange-point-and-mark, but doesn't activate the mark. |
1913 |
;; It is cleaner to avoid activation, even though the command |
;; It is cleaner to avoid activation, even though the command |
1929 |
;; for the following command. |
;; for the following command. |
1930 |
(setq this-command t) |
(setq this-command t) |
1931 |
(push-mark (point)) |
(push-mark (point)) |
1932 |
(let ((opoint (point))) |
(insert-for-yank (current-kill (cond |
1933 |
(insert (current-kill (cond |
((listp arg) 0) |
1934 |
((listp arg) 0) |
((eq arg '-) -1) |
1935 |
((eq arg '-) -1) |
(t (1- arg))))) |
|
(t (1- arg))))) |
|
|
(let ((inhibit-read-only t)) |
|
|
;; Clear `field' property for the sake of copying from the |
|
|
;; minibuffer prompt or a *shell* prompt. |
|
|
(remove-text-properties opoint (point) '(read-only nil field nil)))) |
|
1936 |
(if (consp arg) |
(if (consp arg) |
1937 |
;; This is like exchange-point-and-mark, but doesn't activate the mark. |
;; This is like exchange-point-and-mark, but doesn't activate the mark. |
1938 |
;; It is cleaner to avoid activation, even though the command |
;; It is cleaner to avoid activation, even though the command |