#!/usr/bin/env sh
":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-
;;;learn from here
;;;https://github.com/lujun9972/emacs-document/blob/63b37f7cf8166065f3d162080dd74e7ac61ccc27/elisp-common/emacs-script%E4%B8%AD%E7%9A%84%E9%82%A3%E4%BA%9B%E5%9D%91.org
(require 'org)
(setq org-confirm-babel-evaluate nil)
(org-babel-tangle-file "emacs-config.org")
在使用如上脚本 管理配置 执行的时候会提示
Could not read ‘org-id-values’ from ~/.emacs.d/.org-id-locations, setting it to nil
修了好久没有修好…求大佬帮忙
#!/usr/bin/env sh
":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-
;;;learn from here
;;;https://github.com/lujun9972/emacs-document/blob/master/elisp-common/emacs- script%E4%B8%AD%E7%9A%84%E9%82%A3%E4%BA%9B%E5%9D%91.org
(require 'org)
(setq org-id-locations '(""))
(defun my/org-babel-tangle-file-with-progress (file)
"Tangle the specified Org Mode file with automatic progress report."
(interactive "fFile to tangle: ")
(let ((progress-reporter (make-progress-reporter "Tangling..." 0 100))
(num-done 0)
(num-total 100))
(unwind-protect
(progn
(setq org-babel-tangle-progress-callback
(lambda (num-done num-total)
(progress-reporter-update progress-reporter
(* 100.0 (/ num-done num-total)))
(setq num-done num-done)
(setq num-total num-total)
(when (= num-done num-total)
(progress-reporter-done progress-reporter))))
(org-babel-tangle-file file))
(progress-reporter-done progress-reporter))))
;;(setq org-confirm-babel-evaluate nil)
(my/org-babel-tangle-file-with-progress "emacs-config.org")
搞定了 设置一下 (setq org-id-locations '(“”))