tags:

views:

145

answers:

1

Hello,

I have installed A+ and set up XEmacs in Debian, using the aplus-fsf-dev and aplus-fsf-el packages; XEmacs was installed as a dependency.

I checked the A+ site (http://www.aplusdev.org/), and there seems to be nothing about running A+ on plain Emacs (and not XEmacs).

Does anyone know if there are elisp files somewhere for setting up A+ on plain (FSF) Emacs?

Thanks!

PS: So, the elisp files for XEmacs do not run on Emacs. I tried converting them, but I had to go farther and farther into the code, so I gave up.

PS2: In Emacs, when I do (require 'aplus), this is what I get:

Debugger entered--Lisp error: (wrong-type-argument arrayp (super 97))
  define-key((keymap) (super 97) a-self-insert)
  (let ((key ...) (apl ...)) (define-key a-minor-map (append a-modifier-list ...) (quote a-self-insert)) (define-key a-minor-map (vector ... key) (quote a-self-insert)) (aset a-key-string (char-to-int key) apl))
  a-insert-map((97 . 193))
  mapcar(a-insert-map ((97 . 193) (98 . 194) (99 . 195) (100 . 196) (101 . 197) (102 . 95) (103 . 199) (104 . 200) (105 . 201) (106 . 202) (107 . 39) (108 . 204) (109 . 124) (110 . 206) (111 . 207) (112 . 42) (113 . 63) (114 . 210) (115 . 211) (116 . 126) (117 . 213) (118 . 214) (119 . 215) (120 . 216) (121 . 217) (122 . 218) (49 . 161) (50 . 162) (51 . 60) (52 . 164) (53 . 61) (54 . 166) (55 . 62) (56 . 168) (57 . 169) (48 . 94) (45 . 171) (61 . 223) (92 . 220) (96 . 254) (44 . 172) (91 . 251) (93 . 253) (59 . 219) (39 . 221) (46 . 220) (47 . 175) (33 . 224) (64 . 230) (35 . 231) ...))
  eval-buffer(#<buffer  *load*<3>> nil "/usr/share/emacs/site-lisp/aplus-fsf-el/keyb.el" nil t)  ; Reading at buffer position 3754
  load-with-code-conversion("/usr/share/emacs/site-lisp/aplus-fsf-el/keyb.el" "/usr/share/emacs/site-lisp/aplus-fsf-el/keyb.el" nil t)
  require(keyb)
  eval-buffer(#<buffer  *load*<2>> nil "/usr/share/emacs/site-lisp/aplus-fsf-el/xa.el" nil t)  ; Reading at buffer position 16
  load-with-code-conversion("/usr/share/emacs/site-lisp/aplus-fsf-el/xa.el" "/usr/share/emacs/site-lisp/aplus-fsf-el/xa.el" nil t)
  load("xa" nil t)
  (if aplus-setup-global-bindings (load "xa" nil t))
  eval-buffer(#<buffer  *load*> nil "/usr/share/emacs/site-lisp/aplus-fsf-el/aplus.el" nil t)  ; Reading at buffer position 1373
  load-with-code-conversion("/usr/share/emacs/site-lisp/aplus-fsf-el/aplus.el" "/usr/share/emacs/site-lisp/aplus-fsf-el/aplus.el" nil t)
  require(aplus)
  eval((require (quote aplus)))
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)

This is because in keyb.el, there is this function:

(defun a-insert-map (akeydef)
  (let ((key (car akeydef))
        (apl (cdr akeydef)))
    (define-key a-minor-map (append a-modifier-list (list key)) 'a-self-insert)
    (define-key a-minor-map (vector '(control c) key) 'a-self-insert)
    (aset a-key-string (char-to-int key) apl)))

I changed append to vconcat, and then I got an error on the last line of that function, because Emacs does not have an char-to-int function. I removed the function call and replaced by the argument ("key") itself, since I understand that Emacs will already treat that character as a number.

Then There were other not so obvious errors in other functions; most of them dealing with define-key and keymaps.

I suppose Emacs and XEmacs deal with keymaps differently?

+2  A: 

Let the answers begin. SO wasn't really designed for a running debugging session, but here goes.

Depending on whether you want to make the same .el files loadable by both Emacs and XEmacs, you'll have to figure how you want to isolate the differences.

The most(?) portable way to define keys in Emacs is using the 'kbd macro. So, the 'define-key invocation should look something like:

(define-key a-minor-map (kbd (format "C-c %c" key)) 'a-self-insert)

I don't know what the a-modifier-list is for, but it probably can be massaged into a string to pass to 'kbd. A good introduction to 'kbd or 'read-kbd-macro can be found here. A long document on Emacs keybindings can be found here. It covers all sorts of notations for keybindings, and perhaps it would be of use to decode some of the XEmacs things.

Trey Jackson