aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert J. Chassell2006-10-31 18:05:16 +0000
committerRobert J. Chassell2006-10-31 18:05:16 +0000
commit6c850af4a10e64f86433e554c801cbe3fcd337d1 (patch)
treeb990361594c021c8ff55068b921645f09e54f754
parent70468157b399e6e06902dc031b388a9ef31bf6b2 (diff)
downloademacs-6c850af4a10e64f86433e554c801cbe3fcd337d1.tar.gz
emacs-6c850af4a10e64f86433e554c801cbe3fcd337d1.zip
* eintr-3: updated `Introduction to Programming in Emacs Lisp'
-rw-r--r--info/eintr-359
1 files changed, 57 insertions, 2 deletions
diff --git a/info/eintr-3 b/info/eintr-3
index 8c5b0583a43..c172f95a389 100644
--- a/info/eintr-3
+++ b/info/eintr-3
@@ -10,7 +10,7 @@ END-INFO-DIR-ENTRY
10This is an `Introduction to Programming in Emacs Lisp', for people who 10This is an `Introduction to Programming in Emacs Lisp', for people who
11are not programmers. 11are not programmers.
12 12
13Edition 3.00, 2006 Oct 31 13Edition 3.01, 2006 Oct 31
14 14
15Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997, 2001, 2002, 15Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997, 2001, 2002,
162003, 2004, 2005, 2006 Free Software Foundation, Inc. 162003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -39,6 +39,61 @@ this GNU Manual, like GNU software. Copies published by the Free
39Software Foundation raise funds for GNU development." 39Software Foundation raise funds for GNU development."
40 40
41 41
42File: eintr, Node: current-kill, Next: yank, Prev: Kill Ring, Up: Kill Ring
43
44B.1 The `current-kill' Function
45===============================
46
47The `current-kill' function changes the element in the kill ring to
48which `kill-ring-yank-pointer' points. (Also, the `kill-new' function
49sets `kill-ring-yank-pointer' to point to the latest element of the the
50kill ring.)
51
52The `current-kill' function is used by `yank' and by `yank-pop'. Here
53is the code for `current-kill':
54
55 (defun current-kill (n &optional do-not-move)
56 "Rotate the yanking point by N places, and then return that kill.
57 If N is zero, `interprogram-paste-function' is set, and calling it
58 returns a string, then that string is added to the front of the
59 kill ring and returned as the latest kill.
60 If optional arg DO-NOT-MOVE is non-nil, then don't actually move the
61 yanking point; just return the Nth kill forward."
62 (let ((interprogram-paste (and (= n 0)
63 interprogram-paste-function
64 (funcall interprogram-paste-function))))
65 (if interprogram-paste
66 (progn
67 ;; Disable the interprogram cut function when we add the new
68 ;; text to the kill ring, so Emacs doesn't try to own the
69 ;; selection, with identical text.
70 (let ((interprogram-cut-function nil))
71 (kill-new interprogram-paste))
72 interprogram-paste)
73 (or kill-ring (error "Kill ring is empty"))
74 (let ((ARGth-kill-element
75 (nthcdr (mod (- n (length kill-ring-yank-pointer))
76 (length kill-ring))
77 kill-ring)))
78 (or do-not-move
79 (setq kill-ring-yank-pointer ARGth-kill-element))
80 (car ARGth-kill-element)))))
81
82In addition, the `kill-new' function sets `kill-ring-yank-pointer' to
83the latest element of the the kill ring. And indirectly so does
84`kill-append', since it calls `kill-new'. In addition, `kill-region'
85and `kill-line' call the `kill-new' function.
86
87Here is the line in `kill-new', which is explained in *Note The
88`kill-new' function: kill-new function.
89
90 (setq kill-ring-yank-pointer kill-ring)
91
92* Menu:
93
94* Understanding current-kill::
95
96
42File: eintr, Node: Understanding current-kill, Prev: current-kill, Up: current-kill 97File: eintr, Node: Understanding current-kill, Prev: current-kill, Up: current-kill
43 98
44`current-kill' in Outline 99`current-kill' in Outline
@@ -2370,7 +2425,7 @@ Index
2370* Else: else. (line 6) 2425* Else: else. (line 6)
2371* Emacs version, choosing: Simple Extension. (line 37) 2426* Emacs version, choosing: Simple Extension. (line 37)
2372* empty list defined: Lisp Atoms. (line 18) 2427* empty list defined: Lisp Atoms. (line 18)
2373* empty string defined: Review. (line 139) 2428* empty string defined: Review. (line 143)
2374* eobp: fwd-para while. (line 59) 2429* eobp: fwd-para while. (line 59)
2375* eq: Review. (line 113) 2430* eq: Review. (line 113)
2376* eq (example of use): last-command & this-command. 2431* eq (example of use): last-command & this-command.