免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: flw
打印 上一主题 下一主题

有关 Emacs 使用技巧的内容请在这个帖子讨论。 [复制链接]

论坛徽章:
0
581 [报告]
发表于 2007-09-20 23:31 |只看该作者
想问一下,emacs要支持代码自动提示,需要装什么插件?
刚把ecb+jde装好,发觉没有代码提示,不知道emacs写java程序是否能够代码自动提示?

论坛徽章:
0
582 [报告]
发表于 2007-09-21 10:09 |只看该作者
想问一下,怎么知道当前的emacs是运行在xwin下面还是term下面。因为在其下面的习惯不同,所以.emacs的内容也会不同。

像平台不台可以这样:
(defvar iswindow (string-match "windows" (symbol-name system-type)))
(defvar islinux (string-match "linux" (symbol-name system-type)))

;; linux的设置
(if islinux
  ( ... ))

;; windows的设置
(if iswindow
  ( ... ))

;; 公共的设置

但是现在不知道怎么区别term/x-win

论坛徽章:
0
583 [报告]
发表于 2007-09-21 12:38 |只看该作者

  1. ;; example 1: if windowing (X window or windows etc.), use color theme gnome2,
  2. ;; otherwise, use color theme calm-forest
  3. (if window-system
  4.     (color-theme-gnome2)
  5.   (color-theme-calm-forest))
复制代码
window-system is a variable defined in `C source code'.
Its value is w32


Documentation:
Name of window system that Emacs is displaying through.
The value is a symbol--for instance, `x' for X windows.
The value is nil if Emacs is using a text-only terminal.


  1. ;; example 2: only do following actions if run in windows nt (2000, XP)
  2. (when (eq system-type 'windows-nt)
  3.   (load-file (concat my-extension-path "w32-fontified-region-to-clipboard.el"))
  4.   (require 'w32-winprint)

  5.   (defun w32-maximize-frame (&optional arg)
  6.     "Maximize the current frame"
  7.     (interactive)
  8.     (w32-send-sys-command 61488 arg))

  9.   (w32-maximize-frame)

  10.   )

复制代码

[ 本帖最后由 lgfang 于 2007-9-21 12:41 编辑 ]

论坛徽章:
0
584 [报告]
发表于 2007-09-21 17:48 |只看该作者
emacs如何规整代码???

就像vim中的gg=G

论坛徽章:
0
585 [报告]
发表于 2007-09-21 19:43 |只看该作者
原帖由 gosapphire 于 2007-9-21 17:48 发表
emacs如何规整代码???

就像vim中的gg=G


C-X h
M-C-\


[ 本帖最后由 leyyer 于 2007-9-21 19:44 编辑 ]

论坛徽章:
0
586 [报告]
发表于 2007-09-21 23:05 |只看该作者
原帖由 lgfang 于 2007-9-21 12:38 发表

;; example 1: if windowing (X window or windows etc.), use color theme gnome2,
;; otherwise, use color theme calm-forest
(if window-system
    (color-theme-gnome2)
  (color-theme-calm-fore ...


hee, thanks.
I found something like that in the file:

  1. file: emacs-2x.x/lisp/term/mac-win.el
  2. (if (not (eq window-system 'mac))
  3.     (error "%s: Loading mac-win.el but not compiled for Mac" (invocation-name))

  4. file:  emacs-2x.x/lisp/term/x-win.el
  5. (if (not (eq window-system 'x))
  6.     (error "%s: Loading x-win.el but not compiled for X" (invocation-name)))

  7. file: emacs-2x.x/lisp/term/w32-win.el
  8. (if (not (eq window-system 'w32))
  9.     (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name)))
复制代码

论坛徽章:
0
587 [报告]
发表于 2007-09-27 22:30 |只看该作者
想请教一个问题,
emacs有没有快捷键可以刷新所有在缓冲区里打开的文档?

比如我现在在emacs里面打开了1.java 2.java 3.java这几个文件,然后按快捷键后emacs可以重新载入这几个文件?

论坛徽章:
0
588 [报告]
发表于 2007-10-04 13:53 |只看该作者
emacs如何不产生~备份
GNU Emacs 21.2.1

论坛徽章:
0
589 [报告]
发表于 2007-10-06 12:09 |只看该作者

回复 #587 sanbiangongzi 的帖子

不产生备份文件(setq make-backup-files nil)。或者

  1. ;; all backups goto ~/.backups instead in the current directory
  2. (setq backup-directory-alist (quote (("." . "~/.backups"))))
复制代码

论坛徽章:
0
590 [报告]
发表于 2007-10-07 11:33 |只看该作者
emacs可以实现类似 ms word的对内容自动编号?比如,回车,就自动产生1,2,3。
现在只会用*,**这样的大纲模式,觉得没有自动编号还是不方便。要在1,2,3前添加一个编号,就要修改后面的所有编号。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP