- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
编辑 我的问题一直与片段语法有关...下面的配置完全有效。
我正在尝试同时使用 org-mode 和 yasnippet,但它甚至无法与 workarounds 中的一些一起使用在 org-mode FAQ 上。每当我在片段缩写上点击 TAB 时,这个词就会被删除。 TAB 如果我没有超过一个片段单词,则表现正常,所以发生了一些事情......
我正在使用 Org-mode 7.7 版
、yasnippet(0.7.0 版)
和 GNU Emacs 23.4.1
。
这是我的设置:
(setq load-path
(append (list nil
"~/.emacs.d/site-lisp/yasnippet"
"~/.emacs.d/site-lisp/org-7.7/lisp")
load-path))
;; set up yasnippet
(require 'yasnippet)
(yas/initialize)
(setq yas/snippet-dirs '("~/.emacs.d/mysnippets"
"~/.emacs.d/site-lisp/yasnippet/snippets"))
(mapc 'yas/load-directory yas/snippet-dirs)
;; set up org mode
(require 'org-install)
;; fix some org-mode + yasnippet conflicts:
(defun yas/org-very-safe-expand ()
(let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
(add-hook 'org-mode-hook
(lambda ()
(make-variable-buffer-local 'yas/trigger-key)
(setq yas/trigger-key [tab])
(add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
(define-key yas/keymap [tab] 'yas/next-field)))
而且我非常确定 Hook 正在按预期运行,因为组织缓冲区中的 C-h v org-tab-first-hook 输出如下:
org-tab-first-hook is a variable defined in `org.el'.
Its value is
(yas/org-very-safe-expand org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe)
这是组织缓冲区中的C-h k TAB:
<tab> runs the command org-cycle, which is an interactive Lisp
function in `org.el'.
编辑
在对我的 yas/org-very-safe-expand
函数执行 edebug-defun
后,我看到了以下消息
Result: "[yas] elisp error! Symbol's value as variable is void: err"
所以 yas 在某处出错了...我的 edebug
foo 不太符合标准,但如果我有时间,我会尝试单步执行并查看错误在哪里.我的完整 emacs 配置在 github 上 here .
最佳答案
原来我的问题与片段语法有关,而不是设置。傻傻的我...
换句话说,这完全有效:
;; fix some org-mode + yasnippet conflicts:
(defun yas/org-very-safe-expand ()
(let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
(add-hook 'org-mode-hook
(lambda ()
(make-variable-buffer-local 'yas/trigger-key)
(setq yas/trigger-key [tab])
(add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
(define-key yas/keymap [tab] 'yas/next-field)))
关于emacs - org-mode 和 yasnippet 之间的冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9418148/
我通过“emacs --daemon”启动了 emacs 服务器。然后我开了几个客户端。 我想将 .emacs 配置的更改应用于所有客户端,而无需重新启动 emacs 守护程序。这可能吗? 最佳答案
我通过“emacs --daemon”启动了 emacs 服务器。然后我开了几个客户端。 我想将 .emacs 配置的更改应用于所有客户端,而无需重新启动 emacs 守护程序。这可能吗? 最佳答案
我看到了一些关于使 emacs 便携(在 Windows 上)的建议。我的 site-start.el 中有这个: (defvar program-dir (substring data-direct
我是一名狂热的 Vim 用户。我的 Vimrc 有 800 多行。我是一个喜欢定制环境的每个部分的修补匠。 Emacs 似乎更容易配置。所以我尝试一下 Emacs。 当您想要缩小时,请按 Emacs
我是一名狂热的 Vim 用户。我的 Vimrc 有 800 多行。我是一个喜欢定制环境的每个部分的修补匠。 Emacs 似乎更容易配置。所以我尝试一下 Emacs。 当您想要缩小时,请按 Emacs
偶尔在term中使用emacs时模式我会误运行emacs file而不仅仅是打开文件。这将在当前客户端内创建一个嵌套的 emacs 客户端。我的问题是如何只关闭内部客户端? 最佳答案 回答 您应该可以
我一直在慢慢学习 elisp 和 emacs 的新命令,并且一直在稳步构建我的 .emacs。必须保持控制台打开以重复打开和关闭 emacs 实例似乎不是测试的最佳选择,但是从 emacs 中运行 e
我正在寻找一个 emacs 服务器,以便 emacsclients 指定的文件 是相对于 emacsclients 的文件系统而不是服务器的文件系统。例如,如果我设置一个 机器“darkstar”上的
我试图将我所有的 emacs 配置置于版本控制之下,以便在不同的计算机之间轻松切换。实际上我的首选系统是 OSX (10.8.3) 和来自 http://emacsformacosx.com/ 的 e
我正在学习 emacs,我认为使用 emacs 的内置帮助功能开发设施将真正平滑学习击键的学习曲线。 使用 emacs 的内置帮助功能来查找命令名称及其击键的有效过程是什么? 例如,我忘记了关闭框架的
我一直在尝试将 emacs minibuffer 的字体/字体与 emacs 默认字体分开,但没有太多运气。 具体来说,我有兴趣使 minibuffer 字体大小更大以用于 emacs MULE,因为
大约 4 年以来,我一直是一个相当普通的 emacs 用户,但在自定义 emacs 和排除 elisp 故障时,我仍然是新手。最近,我开始自定义 emacs 作为我的 ruby 开发环境,并且我从
我希望 emacs 能够处理一些耗时的任务,而不阻塞输入。为此,我尝试了(其中插入的意思是用耗时的任务来代替) (call-process "emacs" nil 0 nil "--eval=(ins
我的 init.el 中有这个设置 (desktop-save-mode 1) 这很好用,只是我想知道: 如何更改它以将 .emacs.desktop 文件保存到 ~/.emacs.d 而不是 ~/
我是 Emacs 包的作者,偶尔在处理我的包时,我会遇到一个看起来很有用的函数并在我的代码中使用它。然后,在我发布后不久,有人使用旧的 Emacs 版本(但仍然是我想要支持的版本)会报告该功能未定
我用 (message "..some text...") 在我的 init 文件中,在 EMACS 加载时将消息发送到消息缓冲区。这是我查看我刚刚所做的更改导致启动崩溃的快速方法。 但是,我无法找到
简单的问题,我在 Emacs 中使用通用模式进行颜色编码。除了在这种语言中 " 和 ' 可以用来表示字符串之外,下面的代码很好用,如 'this is a string' 或 “这是一个字符串”。默认
有没有办法让我的 Emacs 以预定义的框架作为我附加的屏幕截图开始?我不太熟悉如何在我的 .emacs 脚本中执行此操作... 就这么简单: split-window-horizontally(
在emacs markdown-mode写markdown时,我想让electric-pair-mode自动关闭**bold**和 *italic*成对语法,即当输入一个 * 一秒时 * 应该自动出现
Emacs 是否有一个简单的原始缩进模式可以执行以下操作: 当我转到新行(按 Enter)时,复制上述行 用于缩进的任何空格 当我按 Tab 时,在我按 Tab 的地方插入可以配置的缩进字符(空格/制
我是一名优秀的程序员,十分优秀!