[Top][All Lists]

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

Re: Why won't this command kill a buffer?

From: Joe Fineman
Subject: Re: Why won't this command kill a buffer?
Date: Sat, 12 Feb 2011 17:50:55 -0500
User-agent: Gnus/5.101 (Gnus v5.10.10) Emacs/22.3 (windows-nt)

"B. T. Raven" <address@hidden> writes:

> If you really mean "append" (put at the end) then this works
> (on msw2000 with Emacs 22.3):
> "
> append-to-file is an interactive compiled Lisp function in `files.el'.
> It is bound to <f4>.
> (append-to-file START END FILENAME)
> Append the contents of the region to the end of file FILENAME.
> When called from a function, expects three arguments,
> START, END and FILENAME.  START and END are buffer positions
> saying what text to write.
> "
> Interactively I had bound this function to f4 in .emacs
> (define-key global-map [f4] 'append-to-file)
> I made a test file with a few chars in it and saved it.
> Inserted backspace into buffer with C-q *backspacekey* and then made
> that single character (shows as ^?) the region and pressed f4.
> Inspection of the last character of the file appended to shows:
> Char: DEL (127, #o177, #x7f) point=5 of 5 (80%) column=0
> I assume that what can be done interactively can also be done
> programmatically.

Thank you.  I will give that a try.  It may turn out to be a nuisance,
tho, that it requires inserting the character in the current buffer &
then deleting it.  The function I defined is usually run in the
background, and it might cause confusion in that it would cause the
current buffer to be marked as modified, and might interact oddly with
my keying.  What I would really like is an append-to-file command that
takes as its argument an arbitrary character or string, rather than a
substring of the current buffer.
---  Joe Fineman    address@hidden

||:  What's wrong with the world?  I am.  :||

reply via email to

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