[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/info/eintr-3,v
From: |
Robert J. Chassell |
Subject: |
[Emacs-diffs] Changes to emacs/info/eintr-3,v |
Date: |
Tue, 31 Oct 2006 18:05:16 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Robert J. Chassell <bob> 06/10/31 18:05:16
Index: eintr-3
===================================================================
RCS file: /cvsroot/emacs/emacs/info/eintr-3,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- eintr-3 31 Oct 2006 17:00:54 -0000 1.1
+++ eintr-3 31 Oct 2006 18:05:16 -0000 1.2
@@ -10,7 +10,7 @@
This is an `Introduction to Programming in Emacs Lisp', for people who
are not programmers.
-Edition 3.00, 2006 Oct 31
+Edition 3.01, 2006 Oct 31
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997, 2001, 2002,
2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -39,6 +39,61 @@
Software Foundation raise funds for GNU development."
+File: eintr, Node: current-kill, Next: yank, Prev: Kill Ring, Up: Kill Ring
+
+B.1 The `current-kill' Function
+===============================
+
+The `current-kill' function changes the element in the kill ring to
+which `kill-ring-yank-pointer' points. (Also, the `kill-new' function
+sets `kill-ring-yank-pointer' to point to the latest element of the the
+kill ring.)
+
+The `current-kill' function is used by `yank' and by `yank-pop'. Here
+is the code for `current-kill':
+
+ (defun current-kill (n &optional do-not-move)
+ "Rotate the yanking point by N places, and then return that kill.
+ If N is zero, `interprogram-paste-function' is set, and calling it
+ returns a string, then that string is added to the front of the
+ kill ring and returned as the latest kill.
+ If optional arg DO-NOT-MOVE is non-nil, then don't actually move the
+ yanking point; just return the Nth kill forward."
+ (let ((interprogram-paste (and (= n 0)
+ interprogram-paste-function
+ (funcall interprogram-paste-function))))
+ (if interprogram-paste
+ (progn
+ ;; Disable the interprogram cut function when we add the new
+ ;; text to the kill ring, so Emacs doesn't try to own the
+ ;; selection, with identical text.
+ (let ((interprogram-cut-function nil))
+ (kill-new interprogram-paste))
+ interprogram-paste)
+ (or kill-ring (error "Kill ring is empty"))
+ (let ((ARGth-kill-element
+ (nthcdr (mod (- n (length kill-ring-yank-pointer))
+ (length kill-ring))
+ kill-ring)))
+ (or do-not-move
+ (setq kill-ring-yank-pointer ARGth-kill-element))
+ (car ARGth-kill-element)))))
+
+In addition, the `kill-new' function sets `kill-ring-yank-pointer' to
+the latest element of the the kill ring. And indirectly so does
+`kill-append', since it calls `kill-new'. In addition, `kill-region'
+and `kill-line' call the `kill-new' function.
+
+Here is the line in `kill-new', which is explained in *Note The
+`kill-new' function: kill-new function.
+
+ (setq kill-ring-yank-pointer kill-ring)
+
+* Menu:
+
+* Understanding current-kill::
+
+
File: eintr, Node: Understanding current-kill, Prev: current-kill, Up:
current-kill
`current-kill' in Outline
@@ -2370,7 +2425,7 @@
* Else: else. (line 6)
* Emacs version, choosing: Simple Extension. (line 37)
* empty list defined: Lisp Atoms. (line 18)
-* empty string defined: Review. (line 139)
+* empty string defined: Review. (line 143)
* eobp: fwd-para while. (line 59)
* eq: Review. (line 113)
* eq (example of use): last-command & this-command.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/info/eintr-3,v,
Robert J. Chassell <=