【问题标题】:Error capturing table in emacs24在 emacs24 中捕获表时出错
【发布时间】: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 我尝试在第一列添加一些内容,但错误仍然存​​在。

标签: emacs emacs24


【解决方案1】:

就像@phils 所说,从emacs -Q 开始,然后给我们提供带有版本信息的重现步骤。它也适用于 Emacs 24。

你有没有像 ido 一样开启完成包?

【讨论】:

  • 是的,我确实有 ido(双关语不是故意的:)。我正在使用这里的 emacs 设置:github.com/purcell/emacs.d
  • 我试图看看是什么导致了错误,我终于弄清楚设置(ido-ubiquitous-mode t)会导致错误。
【解决方案2】:

我终于明白这是因为ido-ubuquitous中的know issue

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-04-04
    • 2014-02-27
    • 1970-01-01
    • 1970-01-01
    • 2018-08-03
    • 2012-09-19
    • 1970-01-01
    • 2018-06-04
    相关资源
    最近更新 更多