mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-27 10:54:40 +00:00
* eintr-3: updated `Introduction to Programming in Emacs Lisp'
This commit is contained in:
parent
70468157b3
commit
6c850af4a1
59
info/eintr-3
59
info/eintr-3
@ -10,7 +10,7 @@ END-INFO-DIR-ENTRY
|
||||
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.
|
||||
@ -38,6 +38,61 @@ License".
|
||||
this GNU Manual, like GNU software. Copies published by the Free
|
||||
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
|
||||
|
||||
@ -2370,7 +2425,7 @@ Index
|
||||
* 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.
|
||||
|
Loading…
Reference in New Issue
Block a user