1

我已经使用 aplus-fsf-dev 和 aplus-fsf-el 软件包在 Debian 中安装了 A+ 并设置了 XEmacs;XEmacs 是作为依赖项安装的。

我检查了 A+ 站点(http://www.aplusdev.org/),似乎没有关于在普通 Emacs(而不是 XEmacs)上运行 A+。

有谁知道某处是否有用于在普通(FSF)Emacs 上设置 A+ 的 elisp 文件?

谢谢!

PS:所以,XEmacs 的 elisp 文件不能在 Emacs 上运行。我尝试将它们转换,但我不得不在代码中走得更远,所以我放弃了。

PS2:在 Emacs 中,当我这样做时(需要 'aplus),这就是我得到的:

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)

这是因为在 keyb.el 中有这个函数:

(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)))

我将 append 更改为 vconcat,然后在该函数的最后一行出现错误,因为 Emacs 没有 char-to-int 函数。我删除了函数调用并替换为参数(“key”)本身,因为我知道 Emacs 已经将该字符视为数字。

然后在其他功能中还有其他不那么明显的错误;他们中的大多数处理定义键和键映射。

我想 Emacs 和 XEmacs 以不同的方式处理键盘映射?

4

1 回答 1

2

让答案开始吧。SO 并不是真正为正在运行的调试会话而设计的,但在这里。

根据您是否想让 Emacs 和 XEmacs 都可以加载相同的 .el 文件,您必须弄清楚如何隔离这些差异。

在 Emacs 中定义键的最(?)可移植方式是使用'kbd宏。因此,'define-key调用应该类似于:

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

我不知道 a-modifier-list 的用途,但它可能可以被按摩成一个字符串传递给'kbd. 一个很好的介绍'kbd'read-kbd-macro可以在这里找到。可以在此处找到有关 Emacs 键绑定的文档。它涵盖了各种键绑定的符号,也许它可以用来解码一些 XEmacs 的东西。

于 2009-08-20T02:48:33.540 回答