Emacs 23.1和Mac OS X文件拖放问题 [英] Emacs 23.1 and Mac OS X problem with files drag and drop

查看:142
本文介绍了Emacs 23.1和Mac OS X文件拖放问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的Mac上编译并安装了emacs 23.1。它运行的是豹10.5.8。而且我注意到拖放不正常(因为它曾经与emacs 22一起使用)。现在,当将文件拖放到扩展坞上的emacs图标时,Emacs将从两个窗口(其术语中的框架)开始,一个显示启动屏幕,另一个显示文件的内容。我试图摆脱这种行为,我已经设置了禁止启动屏幕选项。但是这只能帮助这个问题。



我的另一个问题是当将文件拖动到正在运行的emacs窗口时,它只显示现有缓冲区中文件的内容,而不是打开新缓冲区(命名与文件相同)。
有什么帮助吗?



我已经使用本页面的引用编辑了emacs:
链接文本



另外我注意到这个Emacs的版本已经相当片面 - 它坠毁了几次。使用以前的版本时,我不记得这样的情况。任何帮助将高度赞赏。

解决方案

将以下内容放在.emacs文件中将有所帮助。您将不得不重新启动Emacs或评估代码。

 (define-key global-map [ns-drag-file] 'my-ns-open-files'
(defun my-ns-open-files()
打开列表中的文件`ns-input-file'
(interactive)
(mapc'find-file ns-input-file)
(setq ns-input-file nil))


I've just compiled and installed emacs 23.1 on my mac. It's running Leopard 10.5.8. And I've noticed that dragging and dropping does not work correctly (as it used to work with emacs 22). Now when dragging a file to the emacs icon on the dock, Emacs will start with two windows (frames in its terminology), one showing the startup screen and the other with the contents of the file. I've tried to get rid of this behaviour and I've set 'inhibit-startup-screen' option to t. But that only helped with this problem.

The other problem that I have is that when dragging a file onto a running emacs window, it justs shows the contents of the file in the existing buffer, instead of opening a new buffer (named the same as the file). Any help with that?

I've compiled emacs myself using guidlines from this page: link text

Also I've noticed that this version of Emacs has been rather flaky - it crashed a few times. I do not remember such situations when using previous versions. Any help will be highly appreciated.

解决方案

Putting the following in your .emacs file will help. You will either have to restart Emacs or evaluate the code.

(define-key global-map [ns-drag-file] 'my-ns-open-files)
(defun my-ns-open-files ()
  "Open files in the list `ns-input-file'."
  (interactive)
  (mapc 'find-file ns-input-file)
  (setq ns-input-file nil))

这篇关于Emacs 23.1和Mac OS X文件拖放问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆