alphapapa / org-ql

A searching tool for Org-mode, including custom query languages, commands, saved searches and agenda-like views, etc.
GNU General Public License v3.0
1.4k stars 110 forks source link
emacs org-agenda org-mode

+TITLE: org-ql

NOTE: Using =BEGIN_HTML= for this causes TeX/info export to fail, but this HTML block works.

+HTML:

NOTE: To avoid having this in the info manual, we use HTML rather than Org syntax; it still appears with the GitHub renderer.

+HTML:

This package provides a query language for Org files. It offers two syntax styles: Lisp-like sexps and search engine-like keywords.

It includes three libraries: The =org-ql= library is flexible and may be used as a backend for other tools. The libraries =org-ql-search= and =helm-org-ql= (a separate package) provide interactive search commands and saved views.

[[images/org-ql-search.gif]]

[[images/org-ql-view-dispatch.gif]]

[[images/helm-org-ql.gif]]

[[images/org-ql-view-sidebar.gif]]

The package =org-ql= may be installed directly from [[https://melpa.org/#/org-ql][MELPA]] or with other tools like [[https://framagit.org/steckerhalter/quelpa][Quelpa]].

After installation, you can use the commands without additional configuration. To use the functions and macros in your own Elisp code, use libraries =org-ql= and =org-ql-view=.

** Quelpa

Installing with [[https://framagit.org/steckerhalter/quelpa][Quelpa]] is easy:

  1. Install [[https://framagit.org/steckerhalter/quelpa-use-package#installation][quelpa-use-package]] (which can be installed directly from MELPA).
  2. Add this form to your init file:

+BEGIN_SRC elisp

(use-package org-ql :quelpa (org-ql :fetcher github :repo "alphapapa/org-ql" :files (:defaults (:exclude "helm-org-ql.el"))))

+END_SRC

** Helm support

The command =helm-org-ql= is available in the package =helm-org-ql=. It may be installed from MELPA, or with Quelpa, like so:

+BEGIN_SRC elisp

(use-package helm-org-ql :quelpa (helm-org-ql :fetcher github :repo "alphapapa/org-ql" :files ("helm-org-ql.el")))

+END_SRC

These links work on GitHub's Org renderer but not in Org.

Feedback on these APIs is welcome. Eventually, after being tested and polished, they will be considered stable.

TODO: Find a way to get these examples included in the info manual.

Lisp code examples are in [[examples.org]].

** Commands :PROPERTIES: :TOC: ignore-children :END:

*** org-ql-find

/Note: These commands use [[#non-sexp-query-syntax][non-sexp queries]]./

These commands jump to a heading selected using Emacs's built-in completion facilities with an Org QL query:

Note that these commands are compatible with [[https://github.com/oantolin/embark][Embark]]: the ~embark-act~ command can be called on a completion candidate (i.e. a search result) to act on it immediately, without having to visit the entry in its source Org buffer, and ~embark-export~ may be called to show the results in an ~org-ql-view~ buffer.

[[images/org-ql-find.png]]

*** org-ql-open-link

This command finds links in entries matching the input query and offers them for selection; the selected link is then opened with ~org-open-at-point~.

The input is matched using the default predicate, which means it searches both entry content and outline paths. This is helpful when a collection of links are kept in Org files: rather than having to first visit the entry containing the desired link, then locate it within the entry, and then open it, the user can simply select the link and open it directly. For example, if an entry with the heading =Emacs= contained a link named =mailing list=, one could search for =Emacs list= and open the link to the mailing list directly.

*** org-ql-refile

This command refiles the current Org entry to one selected by searching with Org QL completion. It searches files listed in ~org-refile-targets~ as well as the current buffer.

*** org-ql-search

/Note: This command supports both sexp queries and [[#non-sexp-query-syntax][non-sexp queries]]./

Read ~QUERY~ and search with ~org-ql~. Interactively, prompt for these variables:

~BUFFERS-FILES~: ~A~ list of buffers and/or files to search. Interactively, may also be:

~GROUPS~: An ~org-super-agenda~ group set. See variable ~org-super-agenda-groups~.

~NARROW~: When non-nil, don't widen buffers before searching. Interactively, with prefix, leave narrowed.

~SORT~: One or a list of ~org-ql~ sorting functions, like ~date~ or ~priority~.

Bindings: Keys bound in results buffer.

Note: The view buffer is currently put in ~org-agenda-mode~, which means that /some/ Org Agenda commands work, such as jumping to entries and changing item priorities (without necessarily updating the view). This feature is experimental and not guaranteed to work correctly with all commands. (It works to the extent it does because the appropriate text properties are placed on each item, imitating an Agenda buffer.)

Note: Also, this buffer is compatible with [[https://github.com/oantolin/embark][Embark]]: the ~embark-act~ command can be called on an entry to act on it immediately, without having to visit the entry in its source Org buffer.

*** helm-org-ql

/Note: This command uses [[#non-sexp-query-syntax][non-sexp queries]]. It is available separately in the package =helm-org-ql=./

This command displays matches with Helm.

*** org-ql-view

Choose and display a view stored in ~org-ql-views~.

Bindings: Keys bound in view buffer.

*** org-ql-view-sidebar

Show a sidebar window listing views stored in =org-ql-views= for easy access. In the sidebar, press =RET= or =mouse-1= to show the view at point, and press =c= to customize the view at point.

*** org-ql-view-recent-items

Show items in ~FILES~ from last ~DAYS~ days with timestamps of ~TYPE~. ~TYPE~ may be ~ts~, ~ts-active~, ~ts-inactive~, ~clocked~, ~closed~, ~deadline~, ~planning~, or ~scheduled~. =FILES= defaults to those returned by the function =org-agenda-files=.

*** org-ql-sparse-tree

Arguments: ~(query &key keep-previous (buffer (current-buffer)))~

Show a sparse tree for ~QUERY~ in ~BUFFER~ and return number of results. The tree will show the lines where the query matches, and any other context defined in ~org-show-context-detail~, which see.

~QUERY~ is an ~org-ql~ query sexp (quoted, since this is a function). ~BUFFER~ defaults to the current buffer. When ~KEEP-PREVIOUS~ is non-nil (interactively, with prefix), the outline is not reset to the overview state before finding matches, which allows stacking calls to this command. Runs ~org-occur-hook~ after making the sparse tree.

** Queries :PROPERTIES: :TOC: :include descendants :depth 1 :END: :CONTENTS:

An =org-ql= query is a Lisp expression which may contain arbitrary expressions, as well as calling certain built-in predicates. It is byte-compiled into a predicate function which is tested with point on each heading in an Org buffer; when it returns non-nil, the heading matches the query. When possible, certain built-in predicates are optimized away to whole-buffer regular expression searches, which are much faster to search for than testing the predicate on each heading.

Notes:

*** Non-sexp query syntax

The command =org-ql-search= also accepts, and the command =helm-org-ql= only accepts, an alternative, non-sexp query syntax. The syntax is simple, and a few examples of queries in both syntaxes should suffice. By default, when multiple predicates are used, they are combined with boolean =and=.

| Sexp syntax | Non-sexp syntax | |-------------------------------------------------+----------------------------------------------| | ~(todo)~ | ~todo:~ | | ~(todo "SOMEDAY")~ | ~todo:SOMEDAY~ | | ~(todo "SOMEDAY" "WAITING")~ | ~todo:SOMEDAY,WAITING~ | | ~(ts :on today)~ | ~ts:on=today~ | | ~(ts-active :from "2017-01-01" :to "2018-01-01")~ | ~ts-active:from=2017-01-01,to=2018-01-01~ | | ~(clocked :on -1)~ | ~clocked:on=-1~ | | ~(heading "quoted phrase" "word")~ | ~heading:"quoted phrase",word~ | | ~(and (tags "book" "books") (priority "A"))~ | ~tags:book,books priority:A~ | | ~(src :lang "elisp" :regexps ("defun"))~ | ~src:defun,lang=elisp~ or ~src:lang=elisp,defun~ | | ~(and (tags "space") (not (regexp "moon")))~ | ~tags:space !moon~ | | ~(priority >= B)~ | ~priority:A,B~ |

Note that the =effort=, =level=, and =priority= predicates do not support comparators in the non-sexp syntax, so multiple arguments should be passed instead, as seen in the last example.

*** General predicates

Arguments are listed next to predicate names, where applicable.

*** Ancestor/descendant predicates

*** Date/time predicates

These predicates take optional keyword arguments:

Timestamp/date arguments should be either a number of days (positive to look forward, or negative to look backward), a string parseable by ~parse-time-string~ (the string may omit the time value), the symbol ~today~, or a ~ts~ struct.

The following predicates, in addition to the keyword arguments, can also take a single argument, a number, which looks backward or forward a number of days. The number can be negative to invert the direction.

These two predicates interpret a single number argument as if it were passed to the ~:from~ keyword argument, which eases the common case of searching for items clocked or closed in the past few days:

These predicates interpret a single number argument as if it were passed to the ~:to~ keyword argument, which eases the common case of searching for items planned in the next few days:

** Functions / Macros :PROPERTIES: :TOC: :include descendants :END: :CONTENTS:

*** Agenda-like views

**** Function: ~org-ql-block~

For use as a custom agenda block type in ~org-agenda-custom-commands~. For example, you could define a custom series command like this, which would list all priority A items tagged =Emacs= with to-do keyword =SOMEDAY=, followed by the standard agenda view, in a single buffer:

+BEGIN_SRC elisp

(setq org-agenda-custom-commands '(("ces" "Custom: Agenda and Emacs SOMEDAY [#A] items" ((org-ql-block '(and (todo "SOMEDAY") (tags "Emacs") (priority "A")) ((org-ql-block-header "SOMEDAY :Emacs: High-priority"))) (agenda)))))

+END_SRC

Which would be equivalent to a ~tags-todo~ search like this:

+BEGIN_SRC elisp

(setq org-agenda-custom-commands '(("ces" "Custom: Agenda and Emacs SOMEDAY [#A] items" ((tags-todo "PRIORITY=\"A\"+Emacs/!SOMEDAY") (agenda)))))

+END_SRC

However, the ~org-ql-block~ version runs in about 1/5th the time.

The variable =org-ql-block-header= may be bound to a string to use as the block header, otherwise the header is formed automatically.

*** Listing / acting-on results

**** Caching

Org QL uses a per-buffer cache to speed up subsequent searches. It's keyed on query expressions and match actions, which means that, for the same query and same match action in the same buffer, if the buffer has not been modified since the last time the query was run, the cached match-action result will be returned, and the query will not be evaluated in that buffer again.

Therefore, since neither query expressions nor match actions are guaranteed to be evaluated when the following functions are called, they should be free of side effects. Or, if a side effect is required, the cache should be invalidated (e.g. by incrementing the buffer's modified tick, or by using a query expression or match action that has yet to be cached). /Note: Future improvements will allow the cache to be more easily disabled or cleared./

**** Function: ~org-ql-select~

/Arguments:/ ~(buffers-or-files query &key action narrow sort)~

Return items matching ~QUERY~ in ~BUFFERS-OR-FILES~.

~BUFFERS-OR-FILES~ is a one or a list of files and/or buffers.

~QUERY~ is an ~org-ql~ query sexp (quoted, since this is a function).

~ACTION~ is a function which is called on each matching entry with point at the beginning of its heading. It may be:

If ~NARROW~ is non-nil, buffers are not widened (the default is to widen and search the entire buffer).

~SORT~ is either nil, in which case items are not sorted; or one or a list of defined ~org-ql~ sorting methods (~date~, ~deadline~, ~scheduled~, ~closed~, ~todo~, ~priority~, or ~random~); or a user-defined comparator function that accepts two items as arguments and returns nil or non-nil.

Examples:

+BEGIN_SRC elisp

;; Return list of to-do headings in inbox file with tags and to-do keywords: (org-ql-select "~/org/inbox.org" '(todo) :action #'org-get-heading) ;; => ("TODO Practice leaping tall buildings in a single bound :personal:" ...)

;; Without tags and to-do keywords: (org-ql-select "~/org/inbox.org" '(todo) :action '(org-get-heading t t)) ;; => ("Practice leaping tall buildings in a single bound" ...)

;; Return WAITING heading elements in agenda files: (org-ql-select (org-agenda-files) '(todo "WAITING") :action 'element) ;; => ((headline (:raw-value "Visit the moon" ...) ...) ...)

;; Since `element' is the default for ACTION, it may be omitted: (org-ql-select (org-agenda-files) '(todo "WAITING")) ;; => ((headline (:raw-value "Visit the moon" ...) ...) ...)

+END_SRC

**** Function: ~org-ql-query~

/Arguments:/ ~(&key (select 'element-with-markers) from where order-by narrow)~

Like ~org-ql-select~, but arguments are named more like a ~SQL~ query.

Examples:

+BEGIN_SRC elisp

;; Return list of to-do headings in inbox file with tags and to-do keywords: (org-ql-query :select #'org-get-heading :from "~/org/inbox.org" :where '(todo)) ;; => ("TODO Practice leaping tall buildings in a single bound :personal:" ...)

;; Without tags and to-do keywords: (org-ql-query :select '(org-get-heading t t) :from "~/org/inbox.org" :where '(todo)) ;; => ("Practice leaping tall buildings in a single bound" ...)

;; Return WAITING heading elements in agenda files: (org-ql-query :select 'element :from (org-agenda-files) :where '(todo "WAITING")) ;; => ((headline (:raw-value "Visit the moon" ...) ...) ...)

;; Since `element' is the default for SELECT, it may be omitted: (org-ql-query :from (org-agenda-files) :where '(todo "WAITING")) ;; => ((headline (:raw-value "Visit the moon" ...) ...) ...)

+END_SRC

**** Macro: ~org-ql~ (deprecated)

/Arguments:/ ~(buffers-or-files query &key sort narrow markers action)~

Expands into a call to ~org-ql-select~ with the same arguments. For convenience, arguments should be unquoted.

/Note: This macro is deprecated and will be removed in v0.7./

*** Custom predicates

**** Macro: =org-ql-defpred=

/Arguments:/ ~(name args docstring &key body preambles normalizers)~

Define an ~org-ql~ selector predicate named ~org-ql--predicate-NAME~. ~NAME~ may be a symbol or a list of symbols: if a list, the first is used as ~NAME~ and the rest are aliases. ~A~ function is only created for ~NAME~, not for aliases, so a normalizer should be used to replace aliases with ~NAME~ in queries (keep reading).

~ARGS~ is a ~cl-defun~-style argument list. ~DOCSTRING~ is the function's docstring.

~BODY~ is the body of the predicate. It will be evaluated with point on the beginning of an Org heading and should return non-nil if the heading's entry is a match.

~PREAMBLES~ and ~NORMALIZERS~ are lists of ~pcase~ forms matched against Org ~QL~ query sexps. They are spliced into ~pcase~ forms in the definitions of the functions ~org-ql--query-preamble~ and ~org-ql--normalize-query~, which see. Those functions are redefined when this macro is expanded, unless variable ~org-ql-defpred-defer~ is non-nil, in which case those functions should be redefined manually after defining predicates by calling ~org-ql--define-query-preamble-fn~ and ~org-ql--define-normalize-query-fn~.

~NORMALIZERS~ are used to normalize query expressions to standard forms. For example, when the predicate has aliases, the aliases should be replaced with predicate names using a normalizer. Also, predicate arguments may be put into a more optimal form so that the predicate has less work to do at query time. NOTE: Normalizers are applied to a query repeatedly until the query is fully normalized, so normalizers should be carefully written to avoid infinite loops.

~PREAMBLES~ refer to regular expressions which may be used to search through a buffer directly to a potential match rather than testing the predicate body on each heading. (Naming things is hard.) In each ~pcase~ form in ~PREAMBLES~, the ~pcase~ expression (not the pattern) should be a plist with the following keys, each value of which should be an expression which may refer to variables bound in the pattern:

~:regexp~ Regular expression which searches directly to a potential match.

~:case-fold~ Bound to ~case-fold-search~ around the regexp search.

~:query~ Expression which should replace the query expression, or ~query~ if it should not be changed (e.g. if the regexp is insufficient to determine whether a heading matches, in which case the predicate's body needs to be tested on the heading). If the regexp guarantees a match, this may be simply ~t~, leaving the query expression with no work to do, which improves performance.

For convenience, within the ~pcase~ patterns, the symbol ~predicate-names~ is a special form which is replaced with a pattern matching any of the predicate's name and aliases. For example, if ~NAME~ were:

~(heading h)~

Then if ~NORMALIZERS~ were:

~(((,predicate-names . ,args)(heading ,@args)))~

It would be expanded to:

~(((,(or 'heading 'h) . ,args)(heading ,@args)))~

** Dynamic block

Org QL provides a dynamic block that lists entries in the current document matching a query. In the header, these parameters are supported:

The heading column is formatted as a link to the heading (not shown in the following example).

For example, this dynamic block shows the first seven headings that are to-do items with priority A or B, sorted by deadline then priority, with certain columns (including the value of the =agenda-group= property with a custom header) and timestamp format:

NOTE: These results are edited manually because the Org links don't display well in the Info manual.

+BEGIN_SRC org

,#+BEGIN: org-ql :query "todo: priority:A,B" :columns (todo (priority "P") ((property "agenda-group") "Group") deadline heading) :sort (deadline priority) :take 7 :ts-format "%Y-%m-%d %H:%M" | Todo | P | Group | Deadline | Heading | |------+---+-------+------------------+---------------------------------------| | TODO | A | | 2017-07-07 00:00 | Take over the world | | TODO | B | | 2017-07-10 00:00 | Renew membership in supervillain club | | TODO | A | plans | 2017-07-15 00:00 | Take over the universe | | TODO | B | | 2017-07-21 00:00 | Internet | | TODO | A | bills | 2017-08-01 00:00 | Spaceship lease | | TODO | A | | | Skype with president of Antarctica | | TODO | B | | | Take over Mars | ,#+END:

+END_SRC

** Links

Org QL View searches may be accessed by opening ~org-ql-search:~ links in an Org file.

In an Org QL View buffer, the command ~org-store-link~ (i.e. ~C-c l~) stores a link to the current search, and it may be inserted into an Org buffer with the command ~org-insert-link~ (~C-c C-l~). The stored link records all of the view settings, like title, sorting, and grouping.

Simple links may also be written manually in either sexp or non-sexp form, like:

+BEGIN_SRC org

[[org-ql-search:todo:NEXT priority:A]] [[org-ql-search:(and (todo "NEXT") (priority "A"))]]

+END_SRC

** Tips

/Note:/ Breaking changes may be made before version 1.0, but in the event of major changes, attempts at backward compatibility will be made with obsolescence declarations, translation of arguments, etc. Users who need stability guarantees before 1.0 may choose to use tagged stable releases.

** 0.9-pre

Additions

Changes

Fixes

*** helm-org-ql

Tagged v0.6.2, fixing a compilation warning.

** 0.8.9

Fixes

Compatibility

** 0.8.8

Fixes

** 0.8.7

Fixes

Compatibility

** 0.8.6

Fixes

** 0.8.5

Fixes

** 0.8.4

Fixes

** 0.8.3

Fixes

** 0.8.2

Fixes

** 0.8.1

Fixes

** 0.8

Additions

Fixes

Compatibility

** 0.7.4

Fixes

** 0.7.3

Fixes

** 0.7.2

Fixes

** 0.7.1

Fixes

** 0.7

Added

Changed

Fixed

Internal

Credits

** 0.6.3

Fixed

** 0.6.2

Fixed

** 0.6.1

Fixed

Updated

** 0.6

Added

Changed

Removed

Fixed

Internal

** 0.5.2

Fixed

** 0.5.1

Fixed

** 0.5

Added

Changed

Internal

Deprecated

Acknowledgments

** 0.4.9

Fixed

** 0.4.8

Fixed

** 0.4.7

Fixed

** 0.4.6

Fixed

** 0.4.5

Fixed

** 0.4.4

Fixed

** 0.4.3

Fixed

** 0.4.2

Fixed

** 0.4.1

Fixed

** 0.4

/Note:/ The next release, 0.5, may include changes which will require minor updates to written queries (e.g. a few predicates may be renamed). Users who wish to avoid those changes happening unexpectedly in their configs should avoid upgrading =org-ql= beyond 0.4 automatically, as they will be pushed to the =master= branch when ready.

Added

Changed

Fixed

Internal

** 0.3.2

Fixed

** 0.3.1

Fixed

** 0.3

Added

Changed

Removed

Fixed

Internal

** 0.2.3

Fixed

** 0.2.2

Fixed

** 0.2.1

Fixed

** 0.2 :PROPERTIES: :ID: 67be09f9-e959-4333-9be2-93ad8f458fbe :END:

Added

Changed

Removed

Fixed

Compatibility

Internal

** 0.1

First tagged release.

Bug reports, feature requests, and suggestions are welcome. For patches, see below.

** Copyright assignment

While Org QL is currently distributed in MELPA, it's [[https://github.com/alphapapa/org-ql/issues/409][intended]] to merge Org QL into Org mode. When that happens, it will become a part of Emacs and Org, and therefore cumulative contributions of more than 15 lines of code will require that the author assign copyright of such contributions to the FSF. Authors who are interested in doing so may contact [[mailto:assign@gnu.org][assign@gnu.org]] to request the appropriate form.

** Comparison with Org Agenda searches

Of course, queries like these can already be written with Org Agenda searches, but the syntax can be complex. For example, this query would be difficult to write in a standard Org Agenda search, because it matches against a to-do keyword /and/ a plain-text search. As described in the [[https://orgmode.org/worg/org-tutorials/advanced-searching.html#combining-metadata-and-full-text-queries][advanced searching tutorial]], it would require using ~org-search-view~ with a query with specific regular expression syntax, like this:

+BEGIN_EXAMPLE

+lisp +{^*+\s-+TO-READ\s-}

+END_EXAMPLE

But with =org-ql-search=, you would write a query like =lisp todo:TO-READ=, or in Lisp syntax, ~(and "lisp" (todo "TO-READ"))~.

** org-sidebar

This package is used by [[https://github.com/alphapapa/org-sidebar][org-sidebar]], which presents a customizable agenda-like view in a sidebar window.

GPLv3

The COMMENT keyword prevents GitHub's renderer from showing this entry.

Code used to update this document.

** Predicates

Generates the predicate subtree.

+BEGIN_SRC elisp :results silent :exports code

(defun org-ql--readme-update-predicates () "Update predicate subtree in current document." (interactive) (org-ql--readme-replace-node '("Usage" "Queries" "Predicates") (org-ql--readme-predicate-list)))

(defun org-ql--readme-replace-node (outline-path string) "Replace contents of node at OUTLINE-PATH with STRING." (org-with-wide-buffer (-let* ((subtree-marker (org-find-olp outline-path t)) ((_headline element) (progn (goto-char subtree-marker) (org-element-headline-parser (point-max)))) ((&plist :contents-begin beg :contents-end end) element)) (goto-char beg) (delete-region (point) (1- end)) (insert string "\n"))))

(defun org-ql--readme-predicate-list () "Return an Org list string documenting predicates." (concat (unpackaged/docstring-to-org "Arguments are listed next to predicate names, where applicable.

Note that, for convenience, standard numeric comparator function symbols (<',=', etc.) do not need to be quoted when passed as an argument to these predicates. The resemblance to infix notation is coincidental. See examples in documentation.\n\n") (s-join "\n" (->> org-ql-predicates (--sort (string< (symbol-name (plist-get it :name)) (symbol-name (plist-get other :name)))) (--map (-let* (((&plist :name name :docstring docstring :fn fn :args args) it) (args (->> args (--replace-where (listp it) (car it)) (--replace-where (eq '&rest it) '&optional)))) (if docstring (progn (setq docstring (s-replace "\n" " " docstring)) (format "+ ~%s%s~ :: %s" name (if args (format " %s" args) "") (unpackaged/docstring-to-org docstring))) (when (s-prefix? "org-ql-" (symbol-name name)) (warn "No docstring for: %s" name)) nil))) -non-nil))))

+END_SRC

*** TODO Use async

If ~org-ql~ is loaded byte-compiled, the argument lists are not named properly (not sure why, as ~help-function-arglist~ is supposed to handle that). We could run the function in another Emacs process with ~async~ to avoid this.

Copied from org-super-agenda's readme, in which much was borrowed from Org's =org-manual.org=.

+OPTIONS: broken-links:t *:t

** Info export options

+TEXINFO_DIR_CATEGORY: Emacs

+TEXINFO_DIR_TITLE: Org QL: (org-ql)

+TEXINFO_DIR_DESC: Query language, search commands, and saved views for Org files

NOTE: We could use these, but that causes a pointless error, "org-compile-file: File "..README.info" wasn't produced...", so we just rename the files in the after-save-hook instead.

+TEXINFO_FILENAME: org-ql.info

+EXPORT_FILE_NAME: org-ql.texi

** File-local variables

NOTE: Setting org-comment-string buffer-locally is a nasty hack to work around GitHub's org-ruby's HTML rendering, which does not respect noexport tags. The only way to hide this tree from its output is to use the COMMENT keyword, but that prevents Org from processing the export options declared in it. So since these file-local variables don't affect org-ruby, wet set org-comment-string to an unused keyword, which prevents Org from deleting this tree from the export buffer, which allows it to find the export options in it. And since org-export does respect the noexport tag, the tree is excluded from the info page.

Local Variables:

before-save-hook: org-make-toc

after-save-hook: (lambda nil (when (and (require 'ox-texinfo nil t) (org-texinfo-export-to-info)) (delete-file "README.texi") (rename-file "README.info" "org-ql.info" t)))

org-export-initial-scope: buffer

org-comment-string: "NOTCOMMENT"

End: