脚本宝典收集整理的这篇文章主要介绍了如何将php模式设置从.emacs移动到.dir-locals.el?,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
(add-hook 'PHP-mode-hook (lambda () (c-set-style "bsd") (setq indent-tabs-mode t) (setq c-basic-offset 4) (setq tab-width 4) (c-set-offset 'arglist-close 'c-lineup-arglist-operators) (c-set-offset 'arglist-intro '+) (c-set-offset 'arglist-cont-nonempty 'c-lineup-math) (c-set-offset 'case-label '+) ))
我想将这些格式设置移动到项目特定目录.虽然我可以轻松地为setq语句(例如(setq indent-tabs-mode t))执行此操作,但我无法对以下函数调用执行此操作:(c-set-offset’arglist-intro’).
这是我放入.dir-locals.el的内容:
;;; Directory Local VARiables ;;; See Info node `(emacs) Directory Variables' for more information. ((PHP-mode (c-set-style "bsd") (indent-tabs-mode . t) (c-basic-offset . 4) (tab-width . 4) (c-set-offset 'arglist-close 'c-lineup-arglist-oPErators) (c-set-offset 'arglist-intro 'c-basic-offset) (c-set-offset 'arglist-cont-nonempty 'c-lineup-math) (c-set-offset 'case-label '+) ))
这有什么不对?
((PHP-mode (indent-tabs-mode . t) (c-basic-offset . 4) (tab-width . 4) (eval . (PRogn (c-set-style "bsd") (c-set-offset 'arglist-close 'c-lineup-arglist-operators) (c-set-offset 'arglist-intro 'c-basic-offset) (c-set-offset 'arglist-cont-nonempty 'c-lineup-math) (c-set-offset 'case-label '+)))))
当遇到代码时,Emacs会要求您确认代码是否安全,如果您愿意,它会将其保存到inIT文件的custom-set-variables部分的safe-local-variable-values列表中.
以上是脚本宝典为你收集整理的如何将php模式设置从.emacs移动到.dir-locals.el?全部内容,希望文章能够帮你解决如何将php模式设置从.emacs移动到.dir-locals.el?所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。