Skip to content

Commit

Permalink
Fix: Aliases
Browse files Browse the repository at this point in the history
One of them seems to break on Emacs 26.3 only...
  • Loading branch information
alphapapa committed Mar 9, 2023
1 parent d21da36 commit e5e9daa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
9 changes: 3 additions & 6 deletions org-ql-search.el
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,17 @@
(cond ((fboundp 'org-link--normalize-string) #'org-link--normalize-string)
((fboundp 'org-link-heading-search-string) #'org-link-heading-search-string)
((fboundp 'org-make-org-heading-search-string) #'org-make-org-heading-search-string)
(t (warn "org-ql: Unable to define alias `org-ql-search--link-heading-search-string'. This may affect links in dynamic blocks. Please report this as a bug.")
#'identity)))
(t (error "org-ql: Unable to define alias `org-ql-search--link-heading-search-string'. This may affect links in dynamic blocks. Please report this as a bug"))))

(defalias 'org-ql-search--org-make-link-string
(cond ((fboundp 'org-link-make-string) #'org-link-make-string)
((fboundp 'org-make-link-string) #'org-make-link-string)
(t (warn "org-ql: Unable to define alias `org-ql-search--org-make-link-string'. Please report this as a bug.")
#'identity)))
(t (error "org-ql: Unable to define alias `org-ql-search--org-make-link-string'. Please report this as a bug"))))

(defalias 'org-ql-search--org-link-store-props
(cond ((fboundp 'org-link-store-props) #'org-link-store-props)
((fboundp 'org-store-link-props) #'org-store-link-props)
(t (warn "org-ql: Unable to define alias `org-ql-search--org-link-store-props'. Please report this as a bug.")
#'identity)))
(t (error "org-ql: Unable to define alias `org-ql-search--org-link-store-props'. Please report this as a bug"))))

;;;; Variables

Expand Down
3 changes: 1 addition & 2 deletions org-ql.el
Original file line number Diff line number Diff line change
Expand Up @@ -1351,8 +1351,7 @@ result form."
;; TODO: Remove when compatibility with Org 9.0 is dropped.
(cond ((fboundp 'org-duration-to-minutes) #'org-duration-to-minutes)
((fboundp 'org-duration-string-to-minutes) #'org-duration-string-to-minutes)
(t (warn "org-ql: Unable to define alias `org-ql-search--link-heading-search-string'. Please report this as a bug.")
#'identity))
(t (error "org-ql: Unable to define alias `org-ql-search--link-heading-search-string'. Please report this as a bug")))
"Return DURATION string as a number of minutes.
For compatibility, since Org 9.1 deprecated
`org-duration-string-to-minutes', replacing it with
Expand Down
5 changes: 1 addition & 4 deletions tests/test-org-ql.el
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,7 @@ with keyword arg NOW in PLIST."
(insert "* Heading 1")
;; FIXME: `--value-at' does not actually move point, so we do it here.
(goto-char (point-min))
(expect (org-ql--value-at (point-min)
;; TODO: Just use org-get-tags when requiring Org 9.2+.
(cond ((fboundp 'org-get-tags) #'org-get-tags)
((fboundp 'org-get-local-tags) #'org-get-local-tags)))
(expect (org-ql--value-at (point-min) #'ignore)
:to-be nil))))

(describe "Query pre-processing"
Expand Down

0 comments on commit e5e9daa

Please sign in to comment.