Mercurial > emacs
comparison lisp/simple.el @ 20484:089c85c48eab
(copy-region-as-kill): Deactivate mark in transient-mark-mode.
(copy-region-as-kill, kill-ring-save): Doc fixes.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 21 Dec 1997 01:52:31 +0000 |
parents | 1fe822fa93e6 |
children | d175ee25287e |
comparison
equal
deleted
inserted
replaced
20483:141c2d41d39c | 20484:089c85c48eab |
---|---|
1467 ;; copy-region-as-kill no longer sets this-command, because it's confusing | 1467 ;; copy-region-as-kill no longer sets this-command, because it's confusing |
1468 ;; to get two copies of the text when the user accidentally types M-w and | 1468 ;; to get two copies of the text when the user accidentally types M-w and |
1469 ;; then corrects it with the intended C-w. | 1469 ;; then corrects it with the intended C-w. |
1470 (defun copy-region-as-kill (beg end) | 1470 (defun copy-region-as-kill (beg end) |
1471 "Save the region as if killed, but don't kill it. | 1471 "Save the region as if killed, but don't kill it. |
1472 In Transient Mark mode, deactivate the mark. | |
1472 If `interprogram-cut-function' is non-nil, also save the text for a window | 1473 If `interprogram-cut-function' is non-nil, also save the text for a window |
1473 system cut and paste." | 1474 system cut and paste." |
1474 (interactive "r") | 1475 (interactive "r") |
1475 (if (eq last-command 'kill-region) | 1476 (if (eq last-command 'kill-region) |
1476 (kill-append (buffer-substring beg end) (< end beg)) | 1477 (kill-append (buffer-substring beg end) (< end beg)) |
1477 (kill-new (buffer-substring beg end))) | 1478 (kill-new (buffer-substring beg end))) |
1479 (if transient-mark-mode | |
1480 (setq mark-active nil)) | |
1478 nil) | 1481 nil) |
1479 | 1482 |
1480 (defun kill-ring-save (beg end) | 1483 (defun kill-ring-save (beg end) |
1481 "Save the region as if killed, but don't kill it. | 1484 "Save the region as if killed, but don't kill it. |
1485 In Transient Mark mode, deactivate the mark. | |
1486 If `interprogram-cut-function' is non-nil, also save the text for a window | |
1487 system cut and paste. | |
1488 | |
1482 This command is similar to `copy-region-as-kill', except that it gives | 1489 This command is similar to `copy-region-as-kill', except that it gives |
1483 visual feedback indicating the extent of the region being copied. | 1490 visual feedback indicating the extent of the region being copied." |
1484 If `interprogram-cut-function' is non-nil, also save the text for a window | |
1485 system cut and paste." | |
1486 (interactive "r") | 1491 (interactive "r") |
1487 (copy-region-as-kill beg end) | 1492 (copy-region-as-kill beg end) |
1488 (if (interactive-p) | 1493 (if (interactive-p) |
1489 (let ((other-end (if (= (point) beg) end beg)) | 1494 (let ((other-end (if (= (point) beg) end beg)) |
1490 (opoint (point)) | 1495 (opoint (point)) |