Skip to content

Commit ffc92b1

Browse files
authored
Merge pull request #56 from jcsims/print-path-to-minibuffer
Print path to JSON node to minibuffer, instead of temp buffer
2 parents 32d5a9b + 3006f8e commit ffc92b1

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

json-mode.el

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,9 @@ This function calls `json-mode--update-auto-mode' to change the
125125

126126
;;;###autoload
127127
(defun json-mode-show-path ()
128+
"Print the path to the node at point to the minibuffer, and yank to the kill ring."
128129
(interactive)
129-
(let ((temp-name "*json-path*"))
130-
(with-output-to-temp-buffer temp-name (jsons-print-path))
131-
132-
(let ((temp-window (get-buffer-window temp-name)))
133-
;; delete the window if we have one,
134-
;; so we can recreate it in the correct position
135-
(if temp-window
136-
(delete-window temp-window))
137-
138-
;; always put the temp window below the json window
139-
(set-window-buffer (if (fboundp 'split-window-below)
140-
(split-window-below)
141-
(split-window-vertically)) temp-name))
142-
))
130+
(message (jsons-print-path)))
143131

144132
(define-key json-mode-map (kbd "C-c C-p") 'json-mode-show-path)
145133

0 commit comments

Comments
 (0)