emacs java_emacs java 项目开发 jdee介绍(Emacs Java Development Environment)

jde-compile-option-directory jde-built-class-path jde-run-class-path jde-sourcepath jde-global-classpath 还有很多这些变量,JDEE分得挺细的。你可以查阅:http://jdee.sourceforge.net/jdedoc/html/jde-ug/jde-ug.html 了解到更多的相关变量地功能。还有JDE menu中自定义代码生成的过程。 以上一些变量都是可以通过M-x customize-variable 来进行配置的,你可以选择 set current session把它保存到当前的工程文件prj.el中或者选择set future session自动保存到.emacs配置文件中供所有项目使用。 jde-complete-functions 对这个变量特别做些说明,因为这个变量是设定语义补全的方式的,他有jde-complete-inline,jde-complete-menu,jde-complete-minibuffer三种默认的提示形式,但是都不是特别好用,可以用网上有人开发的一个自定义的补全形式jde-complete-ido,它可以将补全形式和ido和yasnippet结合起来,比较友好,速度也还可以。这个函数地代码如下: 转载:

;;jde completion with ido and yasnippet

(defun jde-complete-ido ()

"Custom method completion for JDE using ido-mode and yasnippet."

(interactive)

(let ((completion-list '()) (variable-at-point (jde-parse-java-variable-at-point)))

(dolist (element (jde-complete-find-completion-for-pair variable-at-point nil) nil)

(add-to-list 'completion-list (cdr element)))

(if completion-list

(let ((choise (ido-completing-read "> " completion-list nil nil (car (cdr variable-at-point)))) (method))

(unless (string-match "^.*()$" choise)

(setq method (replace-regexp-in-string ")" "})"(replace-regexp-in-string ", " "}, ${" (replace-regexp-in-string "(" "(${" choise)))))

(delete-region (point) (re-search-backward "\\." (line-beginning-position)))

(insert ".")

(if method

(yas/expand-snippet method)

(insert choise)))

(message "No completions at this point"))))

(add-hook 'jde-mode-hook 'jde-complete-ido)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值