Dear Bug Team!
I recently have been working at a small program, which makes FreeBSD's
"cdcontrol"-command accessible from within XEmacs, in order to add a
small cdplayer to my local setup and learn more elisp.
I heavily rely on that command-line tool and need to call it regularly
via `shell-command-to-string'. Letting my program run over night, I
found a pretty slow XEmacs the next morning, because lots of
*string-output*-buffers had been opened.
The problem seems to be in `with-output-to-string', which opens
temporary buffers, but instead of removing them, just deletes the
buffers' content.
I locally defined a substitute for `with-output-to-string', replacing
the last line of
,----
| (defmacro with-output-to-string (&rest forms)
| "Collect output to `standard-output' while evaluating FORMS and return
| it as a string."
| ;; by "William G. Dubuque" <wgd(a)zurich.ai.mit.edu> w/ mods from Stig
| `(with-current-buffer (get-buffer-create
| (generate-new-buffer-name " *string-output*"))
| (setq buffer-read-only nil)
| (buffer-disable-undo (current-buffer))
| (erase-buffer)
| (let ((standard-output (current-buffer)))
| ,@forms)
| (prog1
| (buffer-string)
| (erase-buffer))))
`----
with
(kill-buffer(current-buffer)))))
and now everything works as expected for me.
Is this something which should be changed in the XEmacs-distribution
or did I just misunderstand the purpose and/or implementation of
`with-output-to-string'?
Alexander
================================================================
System Info to help track down your bug:
---------------------------------------
uname -a: FreeBSD
deepspace.reinwarth.com 4.5-RELEASE FreeBSD 4.5-RELEASE #4: Wed May 15
01:01:51 CEST 2002 root@deepspace.reinwarth.com:/usr/src/sys/compile/DEEPSPACE i386
./configure '--site-includes=/usr/local/include/'
'--site-libraries=/usr/local/lib' '--with-ldap'
'--with-site-lisp=yes' '--with-mule' '--with-wmcommand=yes'
'--with-xim=xlib' '--with-xfs' '--with-widgets'
XEmacs 21.4.8 "Honest Recruiter" configured for `i386-unknown-freebsd4.5'.
Compilation / Installation:
Source code location: /usr/local/xemacs-21.4.8
Installation prefix: /usr/local
Additional header files: /usr/local/include/
Additional libraries: /usr/local/lib
Runtime library search path: /usr/local/lib:/usr/X11R6/lib:/usr/libexec
Operating system description file: `s/freebsd.h'
Machine description file: `m/intel386.h'
Compiler: gcc -g -O3 -Wall -Wno-switch -Winline
-Wmissing-prototypes -Wsign-compare -Wshadow -Wpointer-arith
Relocating allocator for buffers: yes
GNU version of malloc: yes
Window System:
Compiling in support for the X window system:
- X Windows headers location: /usr/X11R6/include
- X Windows libraries location: /usr/X11R6/lib
- Handling WM_COMMAND properly.
Compiling in support for the Athena widget set:
- Athena headers location: X11/Xaw
- Athena library to link: Xaw
Using Lucid menubars.
Using Lucid scrollbars.
Using Athena dialog boxes.
Using Athena native widgets.
TTY:
Compiling in support for ncurses.
Images:
Compiling in support for GIF images (builtin).
Compiling in support for XPM images.
Compiling in support for PNG images.
Compiling in support for JPEG images.
Compiling in support for TIFF images.
Compiling in support for X-Face message headers.
Sound:
Compiling in support for sound (native).
Databases:
Compiling in support for Berkeley database.
Compiling in support for GNU DBM.
Compiling in support for LDAP.
Internationalization:
Compiling in support for Mule (multi-lingual Emacs).
Compiling in support for XIM (X11R5+ I18N input method).
- Using raw Xlib to provide XIM support.
- Using XFontSet to provide bilingual menubar.
Mail:
Compiling in support for "flock" mail spool file locking method.
Other Features:
Inhibiting IPv6 canonicalization at startup.
Compiling in support for dynamic shared object modules.
Load-Path Lisp Shadows:
----------------------
(/usr/home/alex/.lisp/snake
/usr/local/lib/xemacs/xemacs-packages/lisp/games/snake
/usr/home/alex/software/gnus/lisp/starttls
/usr/local/lib/xemacs/xemacs-packages/lisp/mail-lib/starttls
/usr/home/alex/software/gnus/lisp/rfc2104
/usr/local/lib/xemacs/xemacs-packages/lisp/mail-lib/rfc2104
/usr/home/alex/software/gnus/lisp/pop3
/usr/local/lib/xemacs/xemacs-packages/lisp/mail-lib/pop3
/usr/home/alex/software/gnus/lisp/netrc
/usr/local/lib/xemacs/xemacs-packages/lisp/mail-lib/netrc)
Installed XEmacs Packages:
-------------------------
((zenirc:version 1.13 :type regular)
(xslt-process :version 1.1 :type regular)
(xslide :version 1.03 :type regular)
(xemacs-devel :version 1.48 :type single-file)
(xemacs-base :version 1.67 :type regular)
(w3 :version 1.25 :type regular)
(vm :version 7.07 :type regular)
(viper :version 1.34 :type regular)
(view-process :version 1.11 :type regular)
(vhdl :version 1.15 :type regular)
(vc :version 1.33 :type regular)
(tramp :version 1.07 :type regular)
(tpu :version 1.12 :type regular)
(tooltalk :version 1.13 :type regular)
(time :version 1.11 :type regular)
(textools :version 1.12 :type regular)
(text-modes :version 1.51 :type single-file)
(texinfo :version 1.2 :type regular)
(strokes :version 1.08 :type regular)
(speedbar :version 1.24 :type regular)
(sounds-wav :version 1.1 :type regular)
(sounds-au :version 1.1 :type regular)
(slider :version 1.13 :type regular)
(sh-script :version 1.15 :type regular)
(sgml :version 1.08 :type regular)
(semantic :version 1.14 :type regular)
(scheme :version 1.11 :type regular)
(reftex :version 1.26 :type regular)
(psgml :version 1.3 :type regular)
(ps-print-nomule :version 1.05 :type regular)
(prog-modes
:version
1
.63
:type
single-file)
(pcomplete :version 1.01 :type regular)
(pcl-cvs :version 1.64 :type regular)
(pc :version 1.25 :type single-file)
(os-utils :version 1.28 :type single-file)
(net-utils :version 1.27 :type single-file)
(mule-ucs :version 1.04 :type regular)
(mule-base :version 1.42 :type regular)
(mmm-mode :version 1.0 :type regular)
(misc-games :version 1.15 :type single-file)
(mine :version 1.14 :type regular)
(mew :version 1.17 :type regular)
(mailcrypt :version 2.11 :type regular)
(mail-lib :version 1.48 :type regular)
(locale :version 1.18 :type regular)
(liece :version 1.07 :type regular)
(leim :version 1.19 :type regular)
(latin-unity :version 1.05 :type regular)
(ispell :version 1.24 :type regular)
(ilisp :version 1.27 :type regular)
(igrep :version 1.08 :type regular)
(ibuffer :version 1.08 :type regular)
(hm--html-menus :version 1.18 :type regular)
(gnats :version 1.15 :type regular)
(games :version 1.13 :type regular)
(fsf-compat :version 1.11 :type single-file)
(frame-icon :version 1.09 :type regular)
(forms :version 1.14 :type regular)
(footnote :version 1.15 :type regular)
(eudc :version 1.36 :type regular)
(eterm :version 1.13 :type regular)
(eshell :version 1.03 :type regular)
(emerge :version 1.09 :type regular)
(elib :version 1.1 :type single-file)
(eieio :version 1.03 :type regular)
(efs :version 1.29 :type regular)
(edt :version 1.12 :type regular)
(edit-utils :version 1.91 :type single-file)
(ediff :version 1.41 :type regular)
(edebug :version 1.14 :type regular)
(dired :version 1.12 :type regular)
(debug :version 1.15 :type regular)
(crisp :version 1.12 :type regular)
(cookie :version 1.14 :type regular)
(cc-mode :version 1.29 :type regular)
(calendar :version 1.18 :type regular)
(calc :version 1.23 :type regular)
(c-support :version 1.16 :type single-file)
(build :version 1.06 :type regular)
(bbdb :version 1.21 :type regular)
(auctex :version 1.32 :type regular)
(apel :version 1.25 :type regular)
(ada :version 1.1 :type regular)
(Sun :version 1.13 :type regular)
(x-symbol :version 4.42 :type regular))
Features:
--------
(xemacsbug shadow semantic-el view-less view hyper-apropos
balloon-help flow-fill annotations gnus-fun pp sort gnus-cite
gnus-async gnus-logic gnus-score score-mode gnus-ml gnus-msg
gnus-topic byte-optimize nndraft nnmh nnml nnfolder gnus-cache efs-cu
bbdb-gnus bbdb-snarf mail-extr nntp bytecomp byte-compile bbdb-w3
browse-url bbdb-hooks bbdb-xemacs bbdb-gui bbdb-com bbdb timezone
gnus-art mm-uu mm-view nnir gnus-sum gnus-group gnus-undo nnmail
mail-source format-spec nnoo env gnus-start message mml mml-sec
mml-smime smime dig mml1991 mml2015 mailcrypt comint ring mm-decode
mm-bodies mm-encode mailcap mail-parse rfc2045 rfc2231 rfc2047 qp
ietf-drums mail-abbrevs sendmail rfc822 mailheader canlock gnus-range
gnus-spec gnus-int gnus-win gnus gnus-ems gnus-xmas messagexmas
gnus-util netrc time-date parse-time nnheader nnheaderxm mail-utils
mm-util mail-prsvr are-apm cdcontrol un-define mule-uni ecb
ecb-upgrade ecb-face ecb-cycle ecb-compilation ecb-eshell ecb-navigate
ecb-help ecb-mode-line ecb-layout compile ecb-util tree-buffer
semantic-load eieio advice advice-preload semantic-util-modes timer
semantic-util semantic assoc working backup-dir emacs-wiki executable
pcomplete cal-tex diary-lib calendar font-lock tex-site boxquote rect
edmacro font disp-table alist x-font-menu font-menu mwheel cus-edit
cus-load wid-edit time highlight-current-line overlay info cus-face
zenirc-autoloads xslt-process-autoloads xslide-autoloads
xemacs-devel-autoloads xemacs-base-autoloads w3-autoloads vm-autoloads
viper-autoloads view-process-autoloads vhdl-autoloads vc-autoloads
tramp-autoloads tpu-autoloads tooltalk-autoloads time-autoloads
textools-autoloads text-modes-autoloads texinfo-autoloads
strokes-autoloads speedbar-autoloads sounds-wav-autoloads
sounds-au-autoloads slider-autoloads sh-script-autoloads
sgml-autoloads semantic-autoloads scheme-autoloads reftex-autoloads
psgml-autoloads ps-print-nomule-autoloads prog-modes-autoloads
pcomplete-autoloads pcl-cvs-autoloads pc-autoloads os-utils-autoloads
net-utils-autoloads mule-ucs-autoloads mule-base-autoloads
mmm-mode-autoloads misc-games-autoloads mine-autoloads mew-autoloads
mailcrypt-autoloads mail-lib-autoloads locale-autoloads
liece-autoloads leim-autoloads latin-unity-autoloads ispell-autoloads
ilisp-autoloads igrep-autoloads ibuffer-autoloads
hm--html-menus-autoloads gnats-autoloads games-autoloads
fsf-compat-autoloads frame-icon-autoloads forms-autoloads
footnote-autoloads eudc-autoloads eterm-autoloads eshell-autoloads
emerge-autoloads elib-autoloads eieio-autoloads efs-autoloads
edt-autoloads edit-utils-autoloads ediff-autoloads edebug-autoloads
dired-autoloads debug-autoloads crisp-autoloads cookie-autoloads
cc-mode-autoloads calendar-autoloads calc-autoloads
c-support-autoloads build-autoloads bbdb-autoloads auctex-autoloads
apel-autoloads ada-autoloads Sun-autoloads x-symbol-autoloads
lisp-autoloads loadhist auto-show fontl-hooks x-iso8859-1 slovenian
czech romanian ccl mule-help code-cmds gutter-items menubar-items
x-menubar mode-motion mouse itimer auto-save lisp-mode easymenu
iso8859-1 page buff-menu lib-complete cus-file derived frame
text-props obsolete cus-start custom widget cl-extra mini-cl cl cl-19
packages backquote very-early-lisp file-coding mule lucid-scrollbars
cut-buffer lucid-menubars athena-dialogs x c-balloon-help tty-frames
tty toolbar native-sound scrollbar unix-processes multicast
network-streams subprocesses modules menu-accelerator-support menubar
berkeley-db dbm md5 xemacs xim gutter tiff png gif jpeg xface xpm xbm
lisp-float-type berkeley-unix dialog devices window-system base64)