Mercurial > hg > xemacs-beta
comparison lisp/simple.el @ 829:42a86787d173
[xemacs-hg @ 2002-05-07 15:58:46 by stephent]
fix kill-ring bug <87elgoufss.fsf_-_@tleepslib.sk.tsukuba.ac.jp>
author | stephent |
---|---|
date | Tue, 07 May 2002 15:59:03 +0000 |
parents | 2b676dc88c66 |
children | f46864126a0d |
comparison
equal
deleted
inserted
replaced
828:4ead1e0842f0 | 829:42a86787d173 |
---|---|
1269 `interprogram-paste-function'. The functions `kill-new', | 1269 `interprogram-paste-function'. The functions `kill-new', |
1270 `kill-append', and `current-kill' are supposed to implement this | 1270 `kill-append', and `current-kill' are supposed to implement this |
1271 interaction; you may want to use them instead of manipulating the kill | 1271 interaction; you may want to use them instead of manipulating the kill |
1272 ring directly.") | 1272 ring directly.") |
1273 | 1273 |
1274 (defcustom kill-ring-max 30 | 1274 (defcustom kill-ring-max 60 |
1275 "*Maximum length of kill ring before oldest elements are thrown away." | 1275 "*Maximum length of kill ring before oldest elements are thrown away." |
1276 :type 'integer | 1276 :type 'integer |
1277 :group 'killing) | 1277 :group 'killing) |
1278 | 1278 |
1279 (defvar kill-ring-yank-pointer nil | 1279 (defvar kill-ring-yank-pointer nil |
1280 "The tail of the kill ring whose car is the last thing yanked.") | 1280 "The tail of the kill ring whose car is the last thing yanked.") |
1281 | 1281 |
1282 (defun kill-new (string &optional replace) | 1282 (defun kill-new (string &optional replace) |
1283 "Make STRING the latest kill in the kill ring. | 1283 "Make STRING the latest kill in the kill ring. |
1284 Set `kill-ring-yank-pointer' to point to it. | 1284 Set `kill-ring-yank-pointer' to point to it. |
1285 If `interprogram-cut-function' is non-nil, apply it to STRING. | |
1285 Run `kill-hooks'. | 1286 Run `kill-hooks'. |
1286 Optional second argument REPLACE non-nil means that STRING will replace | 1287 Optional second argument REPLACE non-nil means that STRING will replace |
1287 the front of the kill ring, rather than being added to the list." | 1288 the front of the kill ring, rather than being added to the list." |
1288 ; (and (fboundp 'menu-bar-update-yank-menu) | 1289 ; (and (fboundp 'menu-bar-update-yank-menu) |
1289 ; (menu-bar-update-yank-menu string (and replace (car kill-ring)))) | 1290 ; (menu-bar-update-yank-menu string (and replace (car kill-ring)))) |
1290 (if replace | 1291 (if (and replace kill-ring) |
1291 (setcar kill-ring string) | 1292 (setcar kill-ring string) |
1292 (setq kill-ring (cons string kill-ring)) | 1293 (setq kill-ring (cons string kill-ring)) |
1293 (if (> (length kill-ring) kill-ring-max) | 1294 (if (> (length kill-ring) kill-ring-max) |
1294 (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))) | 1295 (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))) |
1295 (setq kill-ring-yank-pointer kill-ring) | 1296 (setq kill-ring-yank-pointer kill-ring) |