On Sun, Dec 27, 2020 at 10:57 PM Hongyi Zhao <hongyi.z...@gmail.com> wrote: > > On Sun, Dec 27, 2020 at 10:12 PM <to...@tuxteam.de> wrote: > > > > On Sun, Dec 27, 2020 at 09:34:18PM +0800, Hongyi Zhao wrote: > > > On Ubuntu 20.10, I compiled the latest git master version of emacs, > > > but I can't activate the org-mode command from within it. So I try to > > > install > > > the orgmode using its git repository according to the official guidance > > > [1] as > > > shown below. > > > > > > $ git clone https://code.orgmode.org/bzg/org-mode.git > > > Public/repo/code.orgmode.org/bzg/org-mode.git > > > $ cd code.orgmode.org/bzg/org-mode.git > > > $ make autoloads > > > > > > Then add the following lines into ~/.emacs.d/init.el: > > > > > > (add-to-list 'load-path > > > "~/Public/repo/code.orgmode.org/bzg/org-mode.git/lisp") > > > (add-to-list 'load-path > > > "~/Public/repo/code.orgmode.org/bzg/org-mode.git/contrib/lisp" t) > > > > > > But after I started emacs and issue the instructions 'M-x org-mode RET', I > > > see the following information in the minibuffer: > > > > > > M-x org-mode [No match] > > > > My guess is that org-mode isn't arranged to autoload > > the org library. > > > > Before doing "M-x org-mode" try doing "M-x load-library <RET> org <RET>". > > > > If that works, then autoload is your problem. > > Yes. It does the trick. > > > > > (Background: Emacs doesn't load all available libraries: this would > > make startup times too long for things you are probably not going to > > need. Instead, it has a mapping of commands to libraries, to help it > > load the right library whenever that command is seen the first time). > > > > Once we know whether your problem is autoload, we can refine the > > quest. > > Then how should I revise my ~/.emacs.d/init.el to load org library > automatically before enable org-mode?
I finally figured out the following initialization code for orgmode based on your above wonderful notes: (add-to-list 'load-path "~/Public/repo/code.orgmode.org/bzg/org-mode.git/lisp") (add-to-list 'load-path "~/Public/repo/code.orgmode.org/bzg/org-mode.git/contrib/lisp" t) (require 'org) Thanks again for your help. Regards -- Assoc. Prof. Hongyi Zhao <hongyi.z...@gmail.com> Theory and Simulation of Materials Hebei Polytechnic University of Science and Technology engineering NO. 552 North Gangtie Road, Xingtai, China