diff options
author | Kyle Meyer <kyle@kyleam.com> | 2019-11-16 21:40:31 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2019-11-16 21:40:59 -0500 |
commit | af296d7c9e936838f44e8cbbf93a2d0ebc19b45a (patch) | |
tree | 337bba252c67a7111e81812179b0038646b4e3f6 | |
parent | 6458bbcaace90cce5d385f4830e74aed246927bb (diff) | |
download | orgmode-backport-notes-af296d7c9e936838f44e8cbbf93a2d0ebc19b45a.tar.gz |
org-maint.el: Take in org-maint commands from km-untracked.el
~/auto 7f82ab64dbf9622f8786c55e9bad083d50f7d5f8
-rw-r--r-- | org-maint.el | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/org-maint.el b/org-maint.el new file mode 100644 index 0000000..0d7e8b6 --- /dev/null +++ b/org-maint.el @@ -0,0 +1,33 @@ +(defvar km/org-maint-emacs-dir "~/src/emacs/emacs/") +(defvar km/org-maint-org-dir "~/src/emacs/org-mode-devel/") + +(defun km/org-maint-apply-emacs-commit (commit &optional apply) + "Apply COMMIT from `km/org-maint-emacs-dir' to `km/org-maint-org-dir'. +If APPLY is non-nil, use 'git apply' instead of 'git am'." + (interactive (list (or (and (use-region-p) + (buffer-substring-no-properties + (region-beginning) (region-end))) + (magit-commit-at-point) + (read-string "Emacs commit: ")) + current-prefix-arg)) + (unless (and km/org-maint-org-dir km/org-maint-emacs-dir) + (user-error "Need to set km/org-maint-org-dir and km/org-maint-emacs-dir")) + (with-temp-buffer + (let ((default-directory km/org-maint-emacs-dir)) + (call-process "git" nil t nil + "format-patch" "--stdout" + (format "%s^..%s" commit commit) + "--" "lisp/org")) + (let ((default-directory km/org-maint-org-dir)) + (call-process-region (point-min) (point-max) + "git" nil t nil + (if apply "apply" "am") + "-p3" "--directory=lisp/")))) + +(defun km/org-maint-insert-emacs-commit-info (commit) + "Insert information about COMMIT in `km/org-maint-emacs-dir'." + (interactive "sCommit: ") + (let ((default-directory km/org-maint-emacs-dir)) + (call-process "git" nil t nil + "show" "-s" "--format=%b%n%s%n%H%n%an%n%cd" + commit))) |