diff options
| author | Kim F. Storm | 2002-04-21 17:00:41 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2002-04-21 17:00:41 +0000 |
| commit | 3b8690f6157419fbe33113ec50356249a01f3b77 (patch) | |
| tree | c10271848df99abd52d5a3980b5ffa85a853b29b | |
| parent | 6036654ee8ea9bb2a78a5eca6e6455160b3552f2 (diff) | |
| download | emacs-3b8690f6157419fbe33113ec50356249a01f3b77.tar.gz emacs-3b8690f6157419fbe33113ec50356249a01f3b77.zip | |
(insert-buffer-substring-no-properties): New function.
(insert-buffer-substring-as-yank): New function.
| -rw-r--r-- | lisp/subr.el | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index c4e4d3a73ae..afe5d3ebb02 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1287,6 +1287,31 @@ Otherwise just like (insert STRINGS...)." | |||
| 1287 | (set-text-properties opoint (point) nil) | 1287 | (set-text-properties opoint (point) nil) |
| 1288 | (remove-list-of-text-properties opoint (point) | 1288 | (remove-list-of-text-properties opoint (point) |
| 1289 | yank-excluded-properties))))) | 1289 | yank-excluded-properties))))) |
| 1290 | |||
| 1291 | (defun insert-buffer-substring-no-properties (buf &optional start end) | ||
| 1292 | "Insert before point a substring of buffer BUFFER, without text properties. | ||
| 1293 | BUFFER may be a buffer or a buffer name. | ||
| 1294 | Arguments START and END are character numbers specifying the substring. | ||
| 1295 | They default to the beginning and the end of BUFFER." | ||
| 1296 | (let ((opoint (point))) | ||
| 1297 | (insert-buffer-substring buf start end) | ||
| 1298 | (let ((inhibit-read-only t)) | ||
| 1299 | (set-text-properties opoint (point) nil)))) | ||
| 1300 | |||
| 1301 | (defun insert-buffer-substring-as-yank (buf &optional start end) | ||
| 1302 | "Insert before point a part of buffer BUFFER, stripping some text properties. | ||
| 1303 | BUFFER may be a buffer or a buffer name. Arguments START and END are | ||
| 1304 | character numbers specifying the substring. They default to the | ||
| 1305 | beginning and the end of BUFFER. Strip text properties from the | ||
| 1306 | inserted text according to `yank-excluded-properties'." | ||
| 1307 | (let ((opoint (point))) | ||
| 1308 | (insert-buffer-substring buf start end) | ||
| 1309 | (let ((inhibit-read-only t)) | ||
| 1310 | (if (eq yank-excluded-properties t) | ||
| 1311 | (set-text-properties opoint (point) nil) | ||
| 1312 | (remove-list-of-text-properties opoint (point) | ||
| 1313 | yank-excluded-properties))))) | ||
| 1314 | |||
| 1290 | 1315 | ||
| 1291 | ;; Synchronous shell commands. | 1316 | ;; Synchronous shell commands. |
| 1292 | 1317 | ||