Skip to content

Commit 297e31c

Browse files
committed
feat(jq-mode): add +xq-interactively for XML
1 parent b03a091 commit 297e31c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

core/me-external-tools.el

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
(:tool yq
3030
:link "https://github.com/mikefarah/yq"
3131
:desc "A portable command-line YAML, JSON, XML, CSV, TOML and properties processor")
32+
(:tool xq
33+
:link "https://github.com/sibprogrammer/xq"
34+
:desc "Command-line XML and HTML beautifier and content extractor")
3235
(:tool xmllint
3336
:link "https://github.com/GNOME/libxml2"
3437
:desc "Parse the XML files and output the result of the parsing")

modules/me-data.el

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,24 @@
5757
:straight t
5858
:custom
5959
(jq-interactive-font-lock-mode (if (+emacs-features-p 'tree-sitter) #'json-ts-mode #'json-mode))
60-
:init
60+
:commands +yq-interactively +xq-interactively
61+
:config
6162
(defun +yq-interactively ()
6263
"Use `jq-interactively' with \"yq\" for YAML."
6364
(interactive)
6465
(let ((jq-interactive-command "yq")
6566
(jq-interactive-default-prompt "yq: ")
6667
(jq-interactive-font-lock-mode (if (+emacs-features-p 'tree-sitter) #'yaml-ts-mode #'yaml-mode))
6768
(jq-interactive-default-options "")) ;; "--yaml-roundtrip"
69+
(call-interactively #'jq-interactively)))
70+
71+
(defun +xq-interactively ()
72+
"Use `jq-interactively' with \"xq\" for XML."
73+
(interactive)
74+
(let ((jq-interactive-command "xq")
75+
(jq-interactive-default-prompt "xq: ")
76+
(jq-interactive-font-lock-mode #'nxml-mode)
77+
(jq-interactive-default-options "--node -x"))
6878
(call-interactively #'jq-interactively))))
6979

7080
(use-package graphviz-dot-mode

0 commit comments

Comments
 (0)