开发者

Importing files in Emacs Lisp/Emacs configuration file in the same directory

开发者 https://www.devze.com 2023-03-31 17:58 出处:网络
I have a couple of emacs configuration files. I was going to consolidate them down into a common file and then a couple other files that import the common file. Then have their own functions. I was ju

I have a couple of emacs configuration files. I was going to consolidate them down into a common file and then a couple other files that import the common file. Then have their own functions. I was just 开发者_如何学Pythongoing to have them all as .emacsCommon in my home folder but when I write:

(require '.emacsCommon)

it doesn't load the function. What is the right way to do this??

Cheers


Use 'load-file' to load a EmacsLisp file

(load-file "./.emacsCommon")


If you want to use require, you should add (provide 'foo) at the end of a file named foo.el. If that file is on the load-path, you can then use (require 'foo) to load this file, and add the feature (foo) to the feature list. (The printname of 'foo, the feature name, is used as a filename here.)

Since your filename has a leading dot, and doesn't end in .el, you should give the filename as an argument to require though:

(require 'foo ".foo")

Note, that you could also just use load or load-file.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号