Fix indent

This commit is contained in:
Phil Bajsicki 2025-04-15 15:42:37 +02:00
parent ca1fa23ca9
commit 9174b29437
2 changed files with 35 additions and 34 deletions

View file

@ -546,6 +546,7 @@ And, the "grab everything that matches" tool.
:category "org-ql") :category "org-ql")
#+end_src #+end_src
** End ** End
:PROPERTIES: :PROPERTIES:
:CREATED: <2025-04-14 Mon 22:46> :CREATED: <2025-04-14 Mon 22:46>

View file

@ -39,8 +39,8 @@
(with-temp-buffer (with-temp-buffer
(ibuffer) (ibuffer)
(let ((content (buffer-string))) (let ((content (buffer-string)))
(kill-buffer (current-buffer)) (kill-buffer (current-buffer))
content))) content)))
:name "list-buffers" :name "list-buffers"
:description "Access the list of buffers open in Emacs, including file names and full paths." :description "Access the list of buffers open in Emacs, including file names and full paths."
:args (list '(:name "arg" :args (list '(:name "arg"
@ -76,12 +76,12 @@
(gptel-make-tool (gptel-make-tool
:function (lambda (file) :function (lambda (file)
(find-file-noselect file)) (find-file-noselect file))
:name "find-file-noselect" :name "find-file-noselect"
:description "Open the file in a buffer. This doesn't interfere with the user." :description "Open the file in a buffer. This doesn't interfere with the user."
:args (list '(:name "file" :args (list '(:name "file"
:type string :type string
:description "Path to file..")) :description "Path to file.."))
:category "filesystem") :category "filesystem")
(defun gptel-org-tools-org-extract-tags (buffer) (defun gptel-org-tools-org-extract-tags (buffer)
@ -136,8 +136,8 @@
(buffer-substring-no-properties (buffer-substring-no-properties
(line-beginning-position) (line-beginning-position)
(progn (progn
(outline-next-heading) (outline-next-heading)
(line-beginning-position))))))) (line-beginning-position)))))))
(gptel-make-tool (gptel-make-tool
:function #'gptel-org-tools-org-ql-select :function #'gptel-org-tools-org-ql-select
@ -179,8 +179,8 @@
(with-temp-buffer (with-temp-buffer
(org-agenda-list (or days 14)) (org-agenda-list (or days 14))
(let ((content (buffer-string))) (let ((content (buffer-string)))
(kill-buffer (current-buffer)) (kill-buffer (current-buffer))
content))) content)))
:name "org-agenda-fortnight" :name "org-agenda-fortnight"
:description "Get the next 14 days of user's org-agenda." :description "Get the next 14 days of user's org-agenda."
:args (list '(:name "days" :args (list '(:name "days"
@ -212,27 +212,27 @@
:category "org-ql") :category "org-ql")
(defun gptel-org-tools-org-ql-select-headings-rifle (buf query) (defun gptel-org-tools-org-ql-select-headings-rifle (buf query)
(org-ql-select (org-ql-select
(get-buffer buf) (get-buffer buf)
`(rifle ,query) `(rifle ,query)
:action :action #'(lambda () :action :action #'(lambda ()
(concat (concat
(buffer-substring-no-properties (buffer-substring-no-properties
(line-beginning-position) (line-beginning-position)
(line-end-position)))))) (line-end-position))))))
(gptel-make-tool (gptel-make-tool
:function #'gptel-org-tools-org-ql-select-headings-rifle :function #'gptel-org-tools-org-ql-select-headings-rifle
:name "org-ql-select-headings-rifle" :name "org-ql-select-headings-rifle"
:description "Retreive headings from buffer using org-ql-select. Matches against both heading and content. Using filename fails." :description "Retreive headings from buffer using org-ql-select. Matches against both heading and content. Using filename fails."
:args (list '(:name "buffer" :args (list '(:name "buffer"
:type string :type string
:description "The name of the buffer. See the NAME column in ~emacs-list-buffers~.") :description "The name of the buffer. See the NAME column in ~emacs-list-buffers~.")
'(:name "query" '(:name "query"
:type string :type string
:description "The string to pass into org-ql-select-headings-rifle. This is a bare string. Example: \"searchterm\"")) :description "The string to pass into org-ql-select-headings-rifle. This is a bare string. Example: \"searchterm\""))
:category "org-ql") :category "org-ql")
(defun gptel-org-tools-org-ql-select-tags-local (buf query) (defun gptel-org-tools-org-ql-select-tags-local (buf query)
(org-ql-select (org-ql-select
@ -243,8 +243,8 @@
(buffer-substring-no-properties (buffer-substring-no-properties
(line-beginning-position) (line-beginning-position)
(progn (progn
(outline-next-heading) (outline-next-heading)
(line-beginning-position))))))) (line-beginning-position)))))))
(gptel-make-tool (gptel-make-tool
@ -268,8 +268,8 @@
(buffer-substring-no-properties (buffer-substring-no-properties
(line-beginning-position) (line-beginning-position)
(progn (progn
(outline-next-heading) (outline-next-heading)
(line-beginning-position))))))) (line-beginning-position)))))))
(gptel-make-tool (gptel-make-tool
@ -293,8 +293,8 @@
(buffer-substring-no-properties (buffer-substring-no-properties
(line-beginning-position) (line-beginning-position)
(progn (progn
(outline-next-heading) (outline-next-heading)
(line-beginning-position))))))) (line-beginning-position)))))))
(gptel-make-tool (gptel-make-tool
:function #'gptel-org-tools-org-ql-select-rifle :function #'gptel-org-tools-org-ql-select-rifle