[OS X Emacs] Aquamacs and autopair

Stefan Vollmar vollmar at nf.mpg.de
Mon Aug 2 17:35:18 EDT 2010


Dear Ieyasu,
dear Jack,

On 02.08.2010, at 21:28, Ieyasu Sugimoto wrote:

> I just want to ask if somebody is using Aquamacs with autopair (http://code.google.com/p/autopair/).
> 
> I have the problem that when I enter one of the "special brackets { } or [ ], then the brackets are not added, but instead the minibuffer gives the error message "wrong type argument: characterp, 134217784" ({) or "wrong type argument: characterp, 134217785" (}) or "wrong type argument: characterp, 134217781" {[} or "wrong type argument: characterp, 134217782" (]).
> 
> The thing is I am using a German Keyboard which also might be the culprit. I have posted the problem already to the developer of autopair, who now has the question whether autopair works with Aquamacs and English keyboards.
> Any information would be appreciated.


I am also using a German keyboard and I can confirm your error messages when trying "[" or "{". However, "(" works just fine and pairs correctly with the cursor inside "()".

One of the problems with the German keyboard layout is this mapping (thank you, Apple):

Alt-5: [
Alt-6: ]
Alt-8: {
Alt-9: }

and I am really thankful to David that he provides a one-click-configuration to have Aquamacs interpret the above keyboard combinations as brackets and not as Meta-something.

The round brackets just require the shift key and this is probably why this works as it should with autopair and we only see problems with square and curly brackets.

Unfortunately, I have very little knowledge of Lisp, so I can only contribute a little debugging information.

The problem seems to be that with the Aquamacs German M-mapping we have:

(autopair-find-pair 134217781)   ; '['
(autopair-find-pair 134217782)   ; ']'
(autopair-find-pair 134217784)   ; '{'
(autopair-find-pair 134217785)   ; '}'

Here is the backtrace for '[':

Debugger entered--Lisp error: (wrong-type-argument characterp 134217781)
  aref(#^[nil #^[(0) nil syntax-table 
#^^[3 0 ...................................................] #^^[1 0 #^^[2 0 
#^^[3 0 ...................................................] 
#^^[3 128 ...................................................] 
#^^[3 256 ...................................................] ..
#^^[3 640 ...................................................] .

[...]

#^^[3 2596864 ...................................................] .
#^^[3 2597120 ...................................................] .
#^^[3 2597376 ...................................................] 
#^^[3 2597504 ...................................................] ............................] .......] (2) (2) (2) (2) (2) (2) ...] syntax-table 
#^^[3 0 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil (1) nil nil nil nil (1048578) nil nil nil nil nil nil nil nil ...] #^^[1 0 #^^[2 0 
#^^[3 0 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ... nil nil nil nil ... nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] 134217781)
  (let ((syntax-entry ...)) (cond (... ...) (... delim) (... ...) (autopair-extra-pairs ...)))
  (progn (let (...) (cond ... ... ... ...)))
  (if delim (progn (let ... ...)))
  (when delim (let (...) (cond ... ... ... ...)))
  autopair-find-pair(134217781)
  (let ((pos-pair ...) (prev-point ...) (expected-closing ...)) (condition-case err (progn ... t) (error ...)))
  (save-excursion (let (... ... ...) (condition-case err ... ...)))
  (and (not (autopair-escaped-p syntax-info)) (save-excursion (let ... ...)))
  (cond ((eq autopair-pair-criteria ...) (and ... ...)) ((eq autopair-pair-criteria ...) t) (t (not ...)))
  (and (not (some ... ...)) (cond (... ...) (... t) (t ...)))
  (let* ((syntax-triplet ...) (syntax-info ...) (where-sym ...) (orig-point ...)) (and (not ...) (cond ... ... ...)))
  autopair-pair-p()
  (if (autopair-pair-p) (progn (setq autopair-action ...)))
  (when (autopair-pair-p) (setq autopair-action (list ... ... ...)))
  autopair-insert-opening()
  call-interactively(autopair-insert-opening)
  (and kb (call-interactively kb))
  (let ((last-command-char 91) (kb ...)) (and kb (call-interactively kb)))
  (if (aq-list-contains (event-modifiers last-command-event) (quote meta)) (let (... ...) (and kb ...)) (let* (... ...) (and kb ... ...)))
  emkm-german-7(1)
  call-interactively(emkm-german-7 nil nil)

Warm regards,
 Stefan
-- 
Dr. Stefan Vollmar, Dipl.-Phys.
Head of IT group
Max-Planck-Institut für neurologische Forschung
Gleuelerstr. 50, 50931 Köln, Germany
Tel.: +49-221-4726-213  FAX +49-221-4726-298
Tel.: +49-221-478-5713  Mobile: 0160-93874279
Email: vollmar at nf.mpg.de   http://www.nf.mpg.de






-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4409 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/macosx-emacs/attachments/20100802/8394c54a/attachment.p7s>


More information about the MacOSX-Emacs mailing list