Tidy: Use compat and newer symbol names

This commit is contained in:
Adam Porter 2023-12-16 05:15:36 -06:00
parent 0ab236f95b
commit c62ff77cd3
3 changed files with 8 additions and 7 deletions

View file

@ -82,7 +82,7 @@ To be used in, e.g. annotation functions.")
(defun org-ql-completing-read-action () (defun org-ql-completing-read-action ()
"Default action for `org-ql-completing-read'. "Default action for `org-ql-completing-read'.
Returns (STRING . MARKER) cons for entry at point." Returns (STRING . MARKER) cons for entry at point."
(font-lock-ensure (point-at-bol) (point-at-eol)) (font-lock-ensure (pos-bol) (pos-eol))
(cons (org-link-display-format (org-entry-get nil "ITEM")) (point-marker))) (cons (org-link-display-format (org-entry-get nil "ITEM")) (point-marker)))
(defun org-ql-completing-read-snippet (marker) (defun org-ql-completing-read-snippet (marker)
@ -155,7 +155,7 @@ single predicate)."
(cl-labels (;; (debug-message (cl-labels (;; (debug-message
;; (f &rest args) (apply #'message (concat "ORG-QL-COMPLETING-READ: " f) args)) ;; (f &rest args) (apply #'message (concat "ORG-QL-COMPLETING-READ: " f) args))
(action () (action ()
(font-lock-ensure (point-at-bol) (point-at-eol)) (font-lock-ensure (pos-bol) (pos-eol))
;; This function needs to handle multiple candidates per ;; This function needs to handle multiple candidates per
;; call, so we loop over a list of values by default. ;; call, so we loop over a list of values by default.
(pcase-dolist (`(,string . ,marker) (funcall action-filter (funcall action))) (pcase-dolist (`(,string . ,marker) (funcall action-filter (funcall action)))

View file

@ -302,10 +302,10 @@ SLOT is passed to `display-buffer-in-side-window', which see."
(defun org-ql-view-switch () (defun org-ql-view-switch ()
"Switch to view at point." "Switch to view at point."
(interactive) (interactive)
(let ((key (buffer-substring-no-properties (point-at-bol) (point-at-eol)))) (let ((key (buffer-substring-no-properties (pos-bol) (pos-eol))))
(unless (string-empty-p key) (unless (string-empty-p key)
(ov-clear :org-ql-view-selected) (ov-clear :org-ql-view-selected)
(ov (point-at-bol) (1+ (point-at-eol)) :org-ql-view-selected t (ov (pos-bol) (1+ (pos-eol)) :org-ql-view-selected t
'face '(:weight bold :inherit highlight)) 'face '(:weight bold :inherit highlight))
(org-ql-view key)))) (org-ql-view key))))
@ -369,7 +369,7 @@ update search arguments."
(defun org-ql-view-customize () (defun org-ql-view-customize ()
"Customize view at point in `org-ql-view-sidebar' buffer." "Customize view at point in `org-ql-view-sidebar' buffer."
(interactive) (interactive)
(let ((key (buffer-substring-no-properties (point-at-bol) (point-at-eol)))) (let ((key (buffer-substring-no-properties (pos-bol) (pos-eol))))
(customize-option 'org-ql-views) (customize-option 'org-ql-views)
(search-forward (concat "Name: " key)))) (search-forward (concat "Name: " key))))

View file

@ -5,7 +5,7 @@
;; Author: Adam Porter <adam@alphapapa.net> ;; Author: Adam Porter <adam@alphapapa.net>
;; Url: https://github.com/alphapapa/org-ql ;; Url: https://github.com/alphapapa/org-ql
;; Version: 0.8-pre ;; Version: 0.8-pre
;; Package-Requires: ((emacs "26.1") (dash "2.18.1") (f "0.17.2") (map "2.1") (org "9.0") (org-super-agenda "1.2") (ov "1.0.6") (peg "1.0.1") (s "1.12.0") (transient "0.1") (ts "0.2-pre")) ;; Package-Requires: ((emacs "26.1") (compat "29.1") (dash "2.18.1") (f "0.17.2") (map "2.1") (org "9.0") (org-super-agenda "1.2") (ov "1.0.6") (peg "1.0.1") (s "1.12.0") (transient "0.1") (ts "0.2-pre"))
;; Keywords: hypermedia, outlines, Org, agenda ;; Keywords: hypermedia, outlines, Org, agenda
;;; License: ;;; License:
@ -43,6 +43,7 @@
(require 'seq) (require 'seq)
(require 'subr-x) (require 'subr-x)
(require 'compat)
(require 'dash) (require 'dash)
(require 'map) (require 'map)
(require 'ts) (require 'ts)
@ -1973,7 +1974,7 @@ language. Matching is done case-insensitively."
(point))) (point)))
(contents-end (progn (contents-end (progn
(goto-char (match-end 0)) (goto-char (match-end 0))
(point-at-bol)))) (pos-bol))))
(cl-loop for re in regexps (cl-loop for re in regexps
do (goto-char contents-beg) do (goto-char contents-beg)
always (re-search-forward re contents-end t)))))))))) always (re-search-forward re contents-end t))))))))))