From: Gerd Moellmann Date: Mon, 11 Dec 2000 15:33:34 +0000 (+0000) Subject: (kill-new): Don't try to setcar kill-ring if it is X-Git-Tag: emacs-pretest-21.0.93~25 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ab7e20d586cae93a2f763ca54aa5273926cb894a;p=emacs.git (kill-new): Don't try to setcar kill-ring if it is nil. --- diff --git a/lisp/simple.el b/lisp/simple.el index 2158d35891c..aded4e0650d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1668,7 +1668,7 @@ Optional second argument REPLACE non-nil means that STRING will replace the front of the kill ring, rather than being added to the list." (and (fboundp 'menu-bar-update-yank-menu) (menu-bar-update-yank-menu string (and replace (car kill-ring)))) - (if replace + (if (and replace kill-ring) (setcar kill-ring string) (setq kill-ring (cons string kill-ring)) (if (> (length kill-ring) kill-ring-max)