all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* append-to-file & write-region from kbd-macro
@ 2008-02-01 22:15 St/\n_P/\rm/\n
  2008-02-03 16:19 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: St/\n_P/\rm/\n @ 2008-02-01 22:15 UTC (permalink / raw)
  To: bug-gnu-emacs

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: append-to-file & write-region from kbd-macro
  2008-02-01 22:15 append-to-file & write-region from kbd-macro St/\n_P/\rm/\n
@ 2008-02-03 16:19 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2008-02-03 16:19 UTC (permalink / raw)
  To: St/\n_P/\rm/\n; +Cc: bug-gnu-emacs

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

Yes, it can.

    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.:

I do not understand.  What is the bug?

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

That refers to calling the function from Lisp.
It has nothing to do with interactive calls.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-03 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-01 22:15 append-to-file & write-region from kbd-macro St/\n_P/\rm/\n
2008-02-03 16:19 ` Richard Stallman

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.