我正在尝试在eshell中运行git命令.当我跑:
git log -p
Run Code Online (Sandbox Code Playgroud)
它看起来像这样:

请注意^ [[光标之前的k].箭头键向下不起作用,它会给出"未找到"错误.你可以在迷你缓冲区看到.向下滚动的唯一方法是使用RETURN键,它看起来很乱:

我的$ TERM设置为eterm,我也尝试了ansi.他们是一样的.以前有人经历过这个吗?
谢谢
编辑:
我有办法解决这个问题.我创建了这个函数:
(defun eshell/git (&rest args)
(apply 'eshell-exec-visual (cons "git" args)))
Run Code Online (Sandbox Code Playgroud)
所以每次运行git命令时,它都会在*git*缓冲区中启动输出.
如果您有其他方式,请告诉我.
有人知道什么#+和#-运营商意味着.sbclrc什么?我在手册中找不到它.我#-在.sbclrc安装quicklisp之后看到了:
#-quicklisp
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
Run Code Online (Sandbox Code Playgroud)
我也在#+SBCL用户手册中看到,但我找不到其功能的解释.看起来像是加载单个模块相关的东西.
它们仅用于SBCL实施还是Common lisp的一部分?
我有一个函数可以将 Emacs 的颜色主题设置为我自己定义的主题。在这个功能中,我做:
(set-face-attribute 'default cur-frame :foreground fg-color :background bg-color)
Run Code Online (Sandbox Code Playgroud)
然后我为default-frame-alist、initial-frame-alist和设置背景颜色、前景色和光标颜色special-display-frame-alist。
所有这些在我的 Mac 上都运行良好。但是当我在 Linux 上使用它时,对于已经打开的所有框架看起来都很好,但是在新创建的框架上它看起来像这样:

如果使用set-background-color/set-foreground-color函数而不是 ( set-face-attribute 'default ...) ,则新框架不会出现此问题。但是如果我这样做,我必须手动重置已经打开的每个帧的颜色。
我在 Mac 和 Ubuntu 上都使用 Emacs 23.3 版。
为了澄清起见,这是我使用的主题文件:
emacs 中 ipython 提示符中的一个非常烦人的问题:
In [128]: if 1==1:
.....: print "yes"
.....: else:
.....: print "no"
.....:
IndentationError: unindent does not match any outer indentation level
Run Code Online (Sandbox Code Playgroud)
它看起来与我完全一致,不确定是什么触发了错误。当我在终端中执行此操作时没有这样的问题。
我正在尝试将cffi包安装到sbcl中.首先,我尝试了在cffi安装页面上推荐的clbuild.当我试图跑:
clbuild quickload cffi
Run Code Online (Sandbox Code Playgroud)
我收到一个错误说:
The function ASDF::SOURCE-REGISTRY is undefined.
Run Code Online (Sandbox Code Playgroud)
然后我尝试了asdf-install,它最终抱怨了
Component "cffi-examples" not found
Run Code Online (Sandbox Code Playgroud)
任何有关这方面的帮助将不胜感激.
UPDATE
对于asdf-install,我正在使用slime运行sbcl.似乎每当它抱怨缺少一个组件时,实际上就安装了该组件.我只需要中止调试器并重新启动Emacs,启动粘液,再次安装,它将成功完成.如果我不使用slime运行它,只是在终端的sbcl提示符下运行它,它将继续抱怨组件缺少不间断.
因此,要使用asdf-install安装cffi,我必须重新启动Emacs大约4-5次.
我不确定sbcl是否存在配置问题?
我想我应该在不同的主题中提出这个问题.
我有字符串列表,我正在寻找这样的行:
键:af12d9索引:0字段1:1234字段2:1234字段3:-10
在找到这样的行之后,我想将每一个存储为字典{'key':af12d9,'index':0,'field 1':....},然后将这个字典存储到列表中,所以我会有一个词典列表.
我能够让它像这样工作:
listconfig = []
for line in list_of_strings:
matched = findall("(Key:[\s]*[0-9A-Fa-f]+[\s]*)|(Index:[\s]*[0-9]+[\s]*)|(Field 1:[\s]*[0-9]+[\s]*)|(Field 2:[\s]*[0-9]+[\s]*)|(Field 3:[\s]*[-+]?[0-9]+[\s]*)", line)
if matched:
listconfig += [dict(map(lambda pair: (pair[0].strip().lower(), pair[1].strip().lower()),
map(lambda line: line[0].split(':'),
[filter(lambda x: x, group) for group in matched])))]
Run Code Online (Sandbox Code Playgroud)
我只是想知道是否有更好的方法(简短而有效),因为我认为findall每个字符串会进行5次搜索.(对吗?因为它返回了5个元组的列表.)
谢谢.
解:
好的,在brandizzi的帮助下,我找到了这个问题的答案.
解:
listconfig = []
for line in list_of_strings:
matched = re.search(r"Key:[\s]*(?P<key>[0-9A-Fa-f]+)[\s]*" \
r"(Index:[\s]*(?P<index>[0-9]+)[\s]*)?" \
r"(Field 1:[\s]*(?P<field_1>[0-9]+)[\s]*)?" \
r"(Field 2:[\s]*(?P<field_2>[0-9 A-Za-z]+)[\s]*)?" \
r"(Field 3:[\s]*(?P<field_3>[-+]?[0-9]+)[\s]*)?", line)
if matched:
print matched.groupdict()
listconfig.append(matched.groupdict())
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用交互式功能名称功能.在emacs lisp手册上,它说:
'a'函数名称(即满足fboundp的符号).现有,完成,提示.
所以我尝试了一个小测试代码:
(defun testfun1 ()
(message "hello, world!"))
(defun test (abcd)
(interactive "aTheme name: ")
(abcd))
Run Code Online (Sandbox Code Playgroud)
Emacs提出错误说,
test:Symbol的函数定义为void:abcd
我尝试用fboundp测试abcd,它返回t.所以我对如何在交互式中使用'a'选项感到很困惑.任何身体都可以提供一些提示吗?
emacs ×4
common-lisp ×2
sbcl ×2
asdf ×1
elisp ×1
emacs-faces ×1
eshell ×1
git ×1
ipython ×1
lisp ×1
parsing ×1
python ×1
reader-macro ×1
regex ×1
search ×1