From: "St/\\n_P/\\rm/\\n" <stan@derbycityprints.com>
To: bug-gnu-emacs@gnu.org
Subject: append-to-file & write-region from kbd-macro
Date: Fri, 1 Feb 2008 17:15:27 -0500 [thread overview]
Message-ID: <d2afcfda0802011415t58a4ae9br8a8ddf9c5c2dce61@mail.gmail.com> (raw)
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
next reply other threads:[~2008-02-01 22:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-01 22:15 St/\n_P/\rm/\n [this message]
2008-02-03 16:19 ` append-to-file & write-region from kbd-macro Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d2afcfda0802011415t58a4ae9br8a8ddf9c5c2dce61@mail.gmail.com \
--to=stan@derbycityprints.com \
--cc=bug-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.