emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Question about updating a package for the org-get-tags change


From: Kaushal Modi
Subject: Re: [O] Question about updating a package for the org-get-tags change
Date: Mon, 23 Apr 2018 17:08:28 +0000

On Mon, Apr 23, 2018 at 12:02 PM Kaushal Modi <address@hidden> wrote:
But ox-hugo still compiles with this warning with Org 9.2:

In org-hugo--get-tags:
ox-hugo.el:1371:6:Warning: ‘org-get-tags-at’ is an obsolete function (as of
    Org 9.2); use ‘org-get-tags’ instead.

What's the canonical way to deal with such cases?

Replying to self.. not sure if this is the best way.. but it works. I'd like to know if there's a way without defining and calling a macro like this (may be there's a way to use one of the eval-* macros, but I cannot figure out how):

;; Using the correct function for getting inherited Org tags.
(defmacro org-hugo--get-tags-alias ()
  "Generate alias to point to the correct fn for getting inherited Org tags."
  ;; Starting Org 9.2, `org-get-tags' returns all the inherited tags
  ;; instead of returning only the local tags i.e. only the current
  ;; headline tags.
  ;; https://code.orgmode.org/bzg/org-mode/commit/fbe56f89f75a8979e0ba48001a822518df2c66fe
  ;; For Org <= 9.1, `org-get-tags' returned a list of tags *only* at
  ;; the current heading, while `org-get-tags-at' returned inherited
  ;; tags too.
  (if (fboundp #'org--get-local-tags)   ;If using Org 9.2+
      `(defalias 'org-hugo--get-tags 'org-get-tags)
    `(defalias 'org-hugo--get-tags 'org-get-tags-at)))
(org-hugo--get-tags-alias)
--

Kaushal Modi


reply via email to

[Prev in Thread] Current Thread [Next in Thread]