jq-mode icon indicating copy to clipboard operation
jq-mode copied to clipboard

can i view the result in separate buffer in interactive mode

Open huangyg11 opened this issue 5 years ago • 3 comments

In interactive mode, how can I view the result in a separate view instead of replacing current buffer.

Thanks!

huangyg11 avatar May 28 '19 10:05 huangyg11

This hasn't been implemented. You might be able to jury-rig it with another window showing a copy of the current buffer.

I will look into how to implement this at a later date unless someone else is interested in working on it.

ljos avatar May 28 '19 10:05 ljos

This is exactly what I just did for my doom-emacs config:

  (defadvice! dan/jq-interactivly--show-original-other-window (fn beg end)
    "TODO"
    :around #'jq-interactively
    (let ((cb  (current-buffer)))
      (with-current-buffer (get-buffer-create "*jq-interactive*")
        (insert (with-current-buffer cb (buffer-string)))
        (display-buffer (current-buffer) #'display-buffer-pop-up-window)
        (with-current-buffer cb
          (funcall fn beg end))
        (kill-buffer-and-window)))))

danilevy1212 avatar Sep 11 '22 12:09 danilevy1212