all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* curious bug in Emacs (or slime.el or autopair.el)
@ 2010-07-03 17:11 João Távora
  0 siblings, 0 replies; only message in thread
From: João Távora @ 2010-07-03 17:11 UTC (permalink / raw)
  To: emacs-devel

Hi,

I've come across a problem using these packages that makes Emacs quite unusable, but can't seem to trace down the problem.  The bug causes emacs to emit frequent errors

error in process filter: define-key: Wrong type argument: characterp, nil
error in process filter: Wrong type argument: characterp, nil
error in process filter: define-key: Wrong type argument: characterp, nil
error in process filter: Wrong type argument: characterp, nil
Error in post-command-hook: (wrong-type-argument characterp nil)

but (setq debug-on-error t) does *not* pop up a backtrace which leads me to suspect emacs as well. It can be reproduced like so

$ /Applications/Emacs\ -\ 23.app/Contents/MacOS/Emacs -Q --load ~/Source/autopair/autopair.el --load 50sbcl.el -e autopair-global-mode -e slime

where autopair.el is at http://autopair.googlecode.com/svn/trunk/autopair.el and 50sbcl.el sets up a some recent CVS of slime.

(add-to-list 'load-path "~/Source/Emacs/slime")
(require 'slime)
;; (add-hook 'sldb-mode-hook #'(lambda () (setq autopair-dont-activate t))) ;; this line will work around the problem.
(setq inferior-lisp-program "/opt/local/bin/sbcl")
(setenv "SBCL_HOME" "/opt/local/lib/sbcl")

As soon as the user attempts to evaluate an unbound symbol in the REPL,  the strange error appears. 
I apologize for such a complicated recipe, but couldn't come up with anything simpler.

The following things cause the error not to happen:
1. (add-hook 'sldb-mode-hook #'(lambda () (setq autopair-dont-activate t))) ;; disables autopair.el in the sbcl-mode buffer, where it was useless anyway
2. disable slime.el setting of ">" to the syntax class ")" in slime.el
3. in sldb-mode's function definition, remove the call to (kill-all-local-variables)
4. in sldb-mode's function definition, which I got by pretty-printing (symbol-function sldb-mode), insert a `debug' call between the calls to 'use-local-map and 'set-syntax-table. Continue after the debug and no error should happen.
5. prevent autopair.el from  binding ">" to 'autopair-skip-close-maybe in a keymap which is used in a keymap alist which in turn autopair uses as an element of `emulation-mode-map-alists'

The error has been reproduced by more people, also in w32 i think.  See http://code.google.com/p/autopair/issues/detail?id=32. No idea how to catch it in the act. I could attach gdb to it,  but then what?

J


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-03 17:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-03 17:11 curious bug in Emacs (or slime.el or autopair.el) João Távora

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.