Emacs initialization as org file: how can I get the right version of org-mode?

后端 未结 5 1220
失恋的感觉
失恋的感觉 2021-02-14 06:39

I\'ve been experimenting with the org-babel tutorial that describes how to put the bulk of your emacs init.el file into an org file. However, I would like to use org-mode 8 (mai

5条回答
  •  甜味超标
    2021-02-14 07:35

    Unloaded shipped org-mode and installed development version this way

    (defun unload-org-mode ()
      (interactive)
      (and (featurep 'org-agenda)(unload-feature 'org-agenda t ))
      (and (featurep 'org-bbdb)(unload-feature 'org-bbdb t ))
      (and (featurep 'org-bibtex)(unload-feature 'org-bibtex t ))
      (and (featurep 'org-compat)(unload-feature 'org-compat t ))
      (and (featurep 'org-exp)(unload-feature 'org-exp t ))
      (and (featurep 'org-exp-blocks)(unload-feature 'org-exp-blocks t ))
      (and (featurep 'org-faces)(unload-feature 'org-faces t ))
      (and (featurep 'org-footnote)(unload-feature 'org-footnote t ))
      (and (featurep 'org-gnus)(unload-feature 'org-gnus t ))
      (and (featurep 'org-html)(unload-feature 'org-html t ))
      (and (featurep 'org-info)(unload-feature 'org-info t ))
      (and (featurep 'org-infojs)(unload-feature 'org-infojs t ))
      (and (featurep 'org-irc)(unload-feature 'org-irc t ))
      (and (featurep 'org-jsinfo)(unload-feature 'org-jsinfo t ))
      (and (featurep 'org-list)(unload-feature 'org-list t ))
      (and (featurep 'org-macs)(unload-feature 'org-macs t ))
      (and (featurep 'org-mew)(unload-feature 'org-mew t ))
      (and (featurep 'org-mhe)(unload-feature 'org-mhe t ))
      (and (featurep 'org-rmail)(unload-feature 'org-rmail t ))
      (and (featurep 'org-src)(unload-feature 'org-src t ))
      (and (featurep 'org-vm)(unload-feature 'org-vm t))
      (and (featurep 'org-w3m)(unload-feature 'org-w3m t))
      (and (featurep 'org-wl)(unload-feature 'org-wl t )))
    
    (defun ar-load-PATH-TO-NEW-org-mode ()
      (interactive)
      (unload-org-mode)
      (find-file "~/PATH-TO-NEW-org-mode/lisp/ob-python.el")
      (add-to-list 'load-path "~/PATH-TO-NEW-org-mode")
      (add-to-list 'load-path "~/PATH-TO-NEW-org-mode/lisp")
      (load "~/PATH-TO-NEW-org-mode/lisp/ob-comint.el" nil t)
      (load "~/PATH-TO-NEW-org-mode/lisp/ob-emacs-lisp.el" nil t)
      (load "~/PATH-TO-NEW-org-mode/lisp/org.el" nil t)
      (load "~/PATH-TO-NEW-org-mode/lisp/ob-eval.el" nil t)
      (load "~/PATH-TO-NEW-org-mode/lisp/ob.el" nil t)
      (load "~/PATH-TO-NEW-org-mode/lisp/ob-python.el")
      ;; (load "~/PATH-TO-NEW-org-mode/testing/org-test-ob-consts.el" nil t)
      ;; (load "~/PATH-TO-NEW-org-mode/testing/org-test.el" nil t)
      (load-this-directory "~/PATH-TO-NEW-org-mode/lisp")
        (org-babel-do-load-languages
       'org-babel-load-languages
       '(
         (sh . t)
         (python . t)
         (emacs-lisp . t)
         (perl . t)
         (R . t)
         ))
    )
    
    (ar-load-PATH-TO-NEW-org-mode)
    

    Replace PATH-TO-NEW-org-mode with the directory your version whished resides.

提交回复
热议问题