首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >A+和Emacs (但*不是* XEmacs)

A+和Emacs (但*不是* XEmacs)
EN

Stack Overflow用户
提问于 2009-08-19 22:48:50
回答 1查看 426关注 0票数 1

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

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

有没有人知道是否有elisp文件用于设置A+ on plain (FSF) Emacs?

谢谢!

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

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

代码语言:javascript
复制
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中,有这样一个函数:

代码语言:javascript
复制
(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处理keymaps的方式不同吧?

EN

回答 1

Stack Overflow用户

发布于 2009-08-20 02:48:34

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

根据您是否希望Emacs和XEmacs都可以加载相同的.el文件,您必须确定如何隔离差异。

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

代码语言:javascript
复制
(define-key a-minor-map (kbd (format "C-c %c" key)) 'a-self-insert)

我不知道a-modifier-list是用来做什么的,但它可能可以被传递到一个字符串中,传递给'kbd。可以在here中找到'kbd'read-kbd-macro的很好的介绍。有关Emacs键绑定的长篇文档可以在here中找到。它涵盖了键绑定的各种表示法,也许可以用来解码一些XEmacs内容。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1303044

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档