【发布时间】:2012-06-30 06:46:41
【问题描述】:
我想将以下文本捕获为表格:
question,answer
id,id
content,question_id
,content
我用M-x table-capture 和
行分隔符:,
列分隔符:换行符 (C-q C-j)
运行时,emacs 会引发以下错误:
downcase: Symbol's value as variable is void: collection
我不知道出了什么问题。任何帮助将不胜感激。
-- 编辑--
phils 建议打开调试。报错是:
Debugger entered--Lisp error: (void-variable collection)
completing-read("Justify (default left): " (("left") ("center") ("right")) nil t nil table-capture-justify-history "left")
(downcase (completing-read (format "Justify (default %s): " default) (quote (("left") ("center") ("right"))) nil t nil (quote table-capture-justify-history) default))
(intern (downcase (completing-read (format "Justify (default %s): " default) (quote (("left") ("center") ("right"))) nil t nil (quote table-capture-justify-history) default)))
(if (and (string= col-delim-regexp "") (string= row-delim-regexp "")) (quote left) (intern (downcase (completing-read (format "Justify (default %s): " default) (quote (("left") ("center") ("right"))) nil t nil (quote table-capture-justify-history) default))))
(let* ((completion-ignore-case t) (default (car table-capture-justify-history))) (if (and (string= col-delim-regexp "") (string= row-delim-regexp "")) (quote left) (intern (downcase (completing-read (format "Justify (default %s): " default) (quote (("left") ("center") ("right"))) nil t nil (quote table-capture-justify-history) default)))))
(list (mark) (point) (setq col-delim-regexp (read-from-minibuffer "Column delimiter regexp: " (car table-col-delim-regexp-history) nil nil (quote table-col-delim-regexp-history))) (setq row-delim-regexp (read-from-minibuffer "Row delimiter regexp: " (car table-row-delim-regexp-history) nil nil (quote table-row-delim-regexp-history))) (let* ((completion-ignore-case t) (default (car table-capture-justify-history))) (if (and (string= col-delim-regexp "") (string= row-delim-regexp "")) (quote left) (intern (downcase (completing-read (format "Justify (default %s): " default) (quote (... ... ...)) nil t nil (quote table-capture-justify-history) default))))) (if (and (string= col-delim-regexp "") (string= row-delim-regexp "")) "1" (table--read-from-minibuffer (quote ("Minimum cell width" . table-capture-min-cell-width-history)))) (if (and (not (string= col-delim-regexp "")) (string= row-delim-regexp "")) (string-to-number (table--read-from-minibuffer (quote ("Number of columns" . table-capture-columns-history)))) nil))
(let ((col-delim-regexp) (row-delim-regexp)) (barf-if-buffer-read-only) (if (table--probe-cell) (error "Can't insert a table inside a table")) (list (mark) (point) (setq col-delim-regexp (read-from-minibuffer "Column delimiter regexp: " (car table-col-delim-regexp-history) nil nil (quote table-col-delim-regexp-history))) (setq row-delim-regexp (read-from-minibuffer "Row delimiter regexp: " (car table-row-delim-regexp-history) nil nil (quote table-row-delim-regexp-history))) (let* ((completion-ignore-case t) (default (car table-capture-justify-history))) (if (and (string= col-delim-regexp "") (string= row-delim-regexp "")) (quote left) (intern (downcase (completing-read (format "Justify (default %s): " default) (quote ...) nil t nil (quote table-capture-justify-history) default))))) (if (and (string= col-delim-regexp "") (string= row-delim-regexp "")) "1" (table--read-from-minibuffer (quote ("Minimum cell width" . table-capture-min-cell-width-history)))) (if (and (not (string= col-delim-regexp "")) (string= row-delim-regexp "")) (string-to-number (table--read-from-minibuffer (quote ("Number of columns" . table-capture-columns-history)))) nil)))
call-interactively(table-capture record nil)
command-execute(table-capture record)
smex-read-and-run(("toggle-debug-on-error" "auto-fill-mode" "table-capture" "scratch" "table-justify" "table-insert" "replace-string" "customize-themes" "erc" "grep" "butterfly" "dired" "customize-group" "customize-option" "text-mode" "gist-region" "python-else" "python-mode" "magit-status" "customize-face" "package-install" "replace-rectangle" "diredp-do-bookmark" "ps-print-region-with-faces" "flymake-python-pyflakes-load" "rvm-activate-corresponding-ruby" "cd" "mf" "ri" "5x5" "arp" "dbx" "dig" "ert" "ftp" "gdb" "irc" "jdb" "kbd" "man" "mpc" "pdb" "pwd" "rsh" "sdb" "xdb" "yow" "calc" "dark" "diff" ...))
smex()
call-interactively(smex nil nil)
-- 编辑--
经过一些调试,如果我在我的 emacs 初始化脚本中设置 (ido-ubiquitous-mode t),我可以断定会发生错误。
【问题讨论】:
-
FWIW,它对我有用。使用
M-x toggle-debug-on-error准确检查失败的原因和位置。也可以在emacs -Q试试。 -
@phils,我用调试的输出更新了问题。
-
模糊地看起来第一列是空的。
-
@tripleee 我尝试在第一列添加一些内容,但错误仍然存在。