bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

append-to-file & write-region from kbd-macro


From: St/\\n_P/\\rm/\\n
Subject: append-to-file & write-region from kbd-macro
Date: Fri, 1 Feb 2008 17:15:27 -0500

append-to-file and write-region seems to have a bug in that:

1)  (append-to-file START END FILENAME)

The command can be called with M-x append-to-file when defining a
keyboard macro and it will then pass the region to the file
/some/foo/appendedfile

*Edit Macro* buffer shows this:

Command: append-a-region
Key: C-x C-k 2
Counter: 0
Format: "%d"

Macro:

<<append-to-file>>      ;; append-to-file
appendedfile    ;; self-insert-command * 17
RET                     ;; newline

and the insert-kbd-macro output

(fset 'append-a-region
  [?\M-x ?a ?p ?p ?e ?n ?d ?- ?t ?o ?- ?f ?i ?l ?e ?\C-m ?a ?p ?p ?e
?n ?d ?e ?d ?f ?i ?l ?e ?\C-m])

So... it DOES appear that append-to-file can be called from within an
interactive keyboard macro definition.

However;

2) write-region can not have START passed a string from the
mini-buffer and  no new functionality is extended to the Command
write-region (at least from within a kbd macro definition) despite
what appear to be claims by the manual otherwise, e.g.:

---
The GNU Emacs Lisp Reference Manual rev 2.9 April '07 Chapter 25 p. 441 states:

Command: append-to-file start end filename

.....
.....

When called from Lisp, this function is completely equivalent to:

         (write-region start end filename t)

Command: write-region start end filename &optional append visit
lockname mustbenew

....
....
....

''if START is a string, then that string is written to the file,
instead of any buffer contents, and END is ignored."

----

How does one pass the START of a string to the command?

This ?bug? is identified by another user in the the thread below @:

http://lists.gnu.org/archive/html/help-gnu-emacs/2007-10/msg00704.html

---
As the manual would indicate, it seems relevant for one to be able to
pass a string to a file as a discrete step within certain routinely
automated tasks commonly encapsulated within kbd macros.  Are we
missing something?
---
This ?bug? was encountered using:

GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE




reply via email to

[Prev in Thread] Current Thread [Next in Thread]