[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
append-to-file can crash Emacs
From: |
Alex Schroeder |
Subject: |
append-to-file can crash Emacs |
Date: |
22 Apr 2001 23:31:24 +0200 |
User-agent: |
Gnus/5.090003 (Oort Gnus v0.03) Emacs/20.7 |
In GNU Emacs 20.7.1 (i686-pc-linux-gnu, X toolkit)
of Sun Apr 8 2001 on snail
The code I attached crashes my Emacs. An other version of this code
inserted the strings into a buffer, finally causing a "buffer maximum
size reached" error (or a similar error, I didn't reproduce it).
Probably append-to-file reaches the same limit, but crashes.
Alex.
;; Generate a fortune cookie file for all emacs commands
(require 'cl)
(defun command-cookies (file)
(interactive "FWrite cookie file: (~/tmp/commands) ")
(setq file (or file "~/tmp/commands"))
(my-append-string-to-file "%\n%\n" file)
(loop for s being the symbols
when (commandp s) do
(my-append-string-to-file
(concat (describe-function s)
"\n\nInvoke with:\n\n"
(with-temp-buffer
(where-is s t)
(buffer-string))
"%\n")
file)))
(defun my-append-string-to-file (str file)
"Append string STR to FILE."
(with-temp-buffer
(insert str)
(append-to-file (point-min) (point-max) file)))
- append-to-file can crash Emacs,
Alex Schroeder <=