Skip to content

Commit 4261e5b

Browse files
committed
magit integration
1 parent c813d94 commit 4261e5b

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

src/el/sayid-magit.el

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
;;; sayid-magit.el --- Choose sayid tracing from magit -*- lexical-binding: t -*-
2+
3+
;; Author: Mark Dawson
4+
;; Maintainer: Bill Piel <[email protected]>
5+
;; Version: 0.0.1
6+
;; URL: https://github.com/clojure-emacs/sayid
7+
;; Package-Requires: ((cider "0.21.0"))
8+
9+
;; Licensed under the Apache License, Version 2.0 (the "License");
10+
;; you may not use this file except in compliance with the License.
11+
;; You may obtain a copy of the License at
12+
13+
;; http://www.apache.org/licenses/LICENSE-2.0
14+
15+
;; Unless required by applicable law or agreed to in writing, software
16+
;; distributed under the License is distributed on an "AS IS" BASIS,
17+
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
;; See the License for the specific language governing permissions and
19+
;; limitations under the License.
20+
21+
;;; Commentary:
22+
23+
;;; Code:
24+
25+
;;;###autoload
26+
(defun sayid-magit--trace-ns-in-files (file-names)
27+
"Trace namespace in FILE-NAMES."
28+
(mapcar (lambda (file-name)
29+
(with-current-buffer (find-file-noselect
30+
(expand-file-name file-name))
31+
(nrepl-send-sync-request (list "op" "sayid-trace-ns-in-file"
32+
"file" (buffer-file-name))
33+
(cider-current-connection))))
34+
file-names)
35+
(sayid-show-traced))
36+
37+
;;;###autoload
38+
(defun sayid-magit-trace-changed-ns ()
39+
"Trace the changed namespaces in a git commit."
40+
(interactive)
41+
(sayid--trace-ns-in-files
42+
(magit-changed-files (magit-read-starting-point "Sayid trace" nil "HEAD"))))
43+
44+
(provide 'sayid-magit)
45+
46+
;;; sayid-magit.el ends here

0 commit comments

Comments
 (0)