From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0PY/HEGSLmG6UgAAgWs5BA (envelope-from ) for ; Tue, 31 Aug 2021 22:34:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id eJnlF0GSLmHVNgAA1q6Kng (envelope-from ) for ; Tue, 31 Aug 2021 20:34:09 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6529B1D790 for ; Tue, 31 Aug 2021 22:34:08 +0200 (CEST) Received: from localhost ([::1]:33794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLASM-0005fP-FC for larch@yhetil.org; Tue, 31 Aug 2021 16:34:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLARG-0005dc-8F for emacs-orgmode@gnu.org; Tue, 31 Aug 2021 16:32:58 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:33770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLARE-0002fz-4E for emacs-orgmode@gnu.org; Tue, 31 Aug 2021 16:32:57 -0400 Received: by mail-wm1-x32f.google.com with SMTP id j14-20020a1c230e000000b002e748b9a48bso2548017wmj.0 for ; Tue, 31 Aug 2021 13:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:references:user-agent:in-reply-to :message-id:mime-version; bh=gOtyT0eSd+QsqcLCgZUcOEpWD1tgVOENqt079pq8mpE=; b=cTO34EDLvAdGVJZhDMigBVCxWElPl8mo4rlMtXEFdcgEfgxlxxO1BQLCsFEf0EDaPN brvQN0uiCj/frV0I+1+KblngTpr1XP2GhTH9tWH8vBIXUiIn4qlCyqE32ETY2F64/hk7 w8vj8CPoaToNtfGy4q5bWWD6Vj9bvgfsJG/m/K6u55pLXJi6H6OuiuZE2SYOtqOGsQOb eIAdCAgbouS5dY7jyw+DCMJs/Mei+MQQr23iop/JOEobhE0RjLSMf72ctPimihgFz2m9 /TAnEl200SDiqMXjjPdRZL97fmFTRNeJTJoaeGgo05U/qVvg7op5n1Pz5xBTD3YUIGTZ qdnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:references:user-agent :in-reply-to:message-id:mime-version; bh=gOtyT0eSd+QsqcLCgZUcOEpWD1tgVOENqt079pq8mpE=; b=lpBKlP52/n8TKPxXk0+78KwCD8N3VTH2GiPkgzf5qGyw7NtKeJ5eIkPqq7v68YbN4R G7kVOqzN8jspZpwpzyy9+1+hL59U1DIRykJvK+BS5G94jlPsZ8e4vQFo/9LrrVwcTaVu aGXmM7Yfvw4LajJjCBR8xu2HMgsQ3oB6006iiLm1zneRndRXp7KY9JSQFxYaV5yo2J9V ZeM/c3ZXzYspViU+VswDJkWE77k39MWKzYVN/b6OXL4TZHEK9mKOkPh/+HR6EjHobnLj zHgo/ztiuYORLfvRtFE+1AD+xco4X86fWzep3vBC5U8/nmvGJ37c/mab7ylp3x6YyNh9 IIjQ== X-Gm-Message-State: AOAM533jqVoLeZJe8BsHMr5Xu1HznLA3uLYqsP2lTSrXRZNGCqqz8XLE wd+niQoOJiPzC3dq96ScWLxtQClm91v3Gw== X-Google-Smtp-Source: ABdhPJybzN93inHItfhH7RMTc3KTauY6cLkbdoW75wFe1b+/l//IDkuvnXjn6wJZlFffrfP8hltp/Q== X-Received: by 2002:a05:600c:3b9c:: with SMTP id n28mr6130043wms.184.1630441974661; Tue, 31 Aug 2021 13:32:54 -0700 (PDT) Received: from Home-Mac ([141.226.13.209]) by smtp.gmail.com with ESMTPSA id m186sm3457538wme.48.2021.08.31.13.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 13:32:54 -0700 (PDT) From: Daniel Fleischer To: Timothy Subject: Re: [BUG] Creating sparse tree with regexp property matches Date: Tue, 31 Aug 2021 23:31:40 +0300 References: <877dg1q2fp.fsf@gmail.com> <87sfypojox.fsf@gmail.com> User-agent: mu4e 1.6.5; emacs 28.0.50 In-reply-to: <87sfypojox.fsf@gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=danflscr@gmail.com; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org, Cassio Koshikumo Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630442048; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=gOtyT0eSd+QsqcLCgZUcOEpWD1tgVOENqt079pq8mpE=; b=UgE0I/ZtvbgAHoDV7dviOv7MWGtoUtI44v9O57AthktAW8SkdOl26RAeBsmbSTrvjlm/oI SxXPhsbGLd9IISdGOnAdU993VQ/EZ2QqTD1HFkC0/aTY6Dg0Rhh+NafZBZms5l2u1V818Z IAnwh/HjZEnDv+vBDJnF2dIgrJpwTEEVx/44hnUw59BR9FmbmGc+a6nujDGCimzWOFFFNU FoqPTr24UGKIYVrH8Mpj6xXkczjFVo9/6kuSBsGzNKelT7Xc1CGQsSbk1u385wSKMLHrxz rJudI5J1jYSe3f4szGzMKn7V1c4CNCYs42ZuIhRjcz2QqVwLtVn8bdFLLnk63w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630442048; a=rsa-sha256; cv=none; b=igng3z/VRZ71PGq5WyH3TpZreNZwtKu7B3UGWrPsjS7VZPnvcVjy26z+6P7aNX0dmBy3Wq ndEldxSQ79ft0PhsT6x3HFZHhwFgvOaMABrKtG7CNEC+Fw/2l3CMS3SOFpk2fofpMhNuaO Uueu330xYUdeplRuj0KA/QtIeeCwc8BIddkxCYr332QxzOkkHdnvngAOej+2G5fS4sdszf B/9uA15yHgtmlcR+DIVzHwv4I/oorGtBnEM68gldsQ228Pm67WuUIsr+ZXPH3t0Awi6oF+ ppnuyJOvkDPaaQhWWHtpvTmQi6YEs5Mib54rQgWflTE50sqbwsMEQwYsQhiu4g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=cTO34EDL; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=cTO34EDL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 6529B1D790 X-Spam-Score: -1.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: T2G7u46by1KD --=-=-= Content-Type: text/plain Content-Disposition: inline Hi Timothy, Attached is my patch. Best, *Daniel Fleischer* --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-manual-added-section-about-regular-expressions.patch >From 05602a3eb453672893e7e92cc0384e1b6b7784aa Mon Sep 17 00:00:00 2001 From: Daniel Fleischer Date: Tue, 31 Aug 2021 20:01:47 +0300 Subject: [PATCH] org-manual: added section about regular expressions Telling users it's based on Elisp regular expressions, linking to its info node and putting some links to this new node in places where regexp are presented. Signed-off-by: Daniel Fleischer --- doc/org-manual.org | 78 ++++++++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 31 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index 10e0baa28..38884ad72 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -916,16 +916,16 @@ ** Sparse Trees #+kindex: C-c / / #+findex: org-occur #+vindex: org-remove-highlights-with-change - Prompts for a regexp and shows a sparse tree with all matches. If - the match is in a headline, the headline is made visible. If the - match is in the body of an entry, headline and body are made - visible. In order to provide minimal context, also the full - hierarchy of headlines above the match is shown, as well as the - headline following the match. Each match is also highlighted; the - highlights disappear when the buffer is changed by an editing - command, or by pressing {{{kbd(C-c C-c)}}}[fn:8]. When called with - a {{{kbd(C-u)}}} prefix argument, previous highlights are kept, so - several calls to this command can be stacked. + Prompts for a regexp (see [[*Regular Expressions]]) and shows a sparse + tree with all matches. If the match is in a headline, the headline + is made visible. If the match is in the body of an entry, headline + and body are made visible. In order to provide minimal context, + also the full hierarchy of headlines above the match is shown, as + well as the headline following the match. Each match is also + highlighted; the highlights disappear when the buffer is changed by + an editing command, or by pressing {{{kbd(C-c C-c)}}}[fn:8]. When + called with a {{{kbd(C-u)}}} prefix argument, previous highlights + are kept, so several calls to this command can be stacked. - {{{kbd(M-g n)}}} or {{{kbd(M-g M-n)}}} (~next-error~) :: @@ -3663,10 +3663,10 @@ ** Search Options in File Links - =/REGEXP/= :: - Do a regular expression search for {{{var(REGEXP)}}}. This uses the - Emacs command ~occur~ to list all matches in a separate window. If - the target file is in Org mode, ~org-occur~ is used to create - a sparse tree with the matches. + Do a regular expression search for {{{var(REGEXP)}}} (see [[*Regular + Expressions]]). This uses the Emacs command ~occur~ to list all + matches in a separate window. If the target file is in Org mode, + ~org-occur~ is used to create a sparse tree with the matches. As a degenerate case, a file link with an empty file name can be used to search the current file. For example, =[[file:::find me]]= does @@ -4978,8 +4978,9 @@ ** Tag Hierarchy Furthermore, the members of a group tag can also be regular expressions, creating the possibility of a more dynamic and rule-based -tag structure. The regular expressions in the group must be specified -within curly brackets. Here is an expanded example: +tag structure (see [[*Regular Expressions]]). The regular expressions in +the group must be specified within curly brackets. Here is an +expanded example: #+begin_example ,#+TAGS: [ Vision : {V@.+} ] @@ -5321,7 +5322,7 @@ ** Property Searches tree is created with all entries that define this property with the given value. If you enclose the value in curly braces, it is interpreted as a regular expression and matched against the property - values. + values (see [[*Regular Expressions]]). ** Property Inheritance :PROPERTIES: @@ -8913,8 +8914,9 @@ *** Matching tags and properties #+cindex: regular expressions, with tags search Instead of a tag, you may also specify a regular expression enclosed -in curly braces. For example, =work+{^boss.*}= matches headlines that -contain the tag =:work:= and any tag /starting/ with =boss=. +in curly braces (see [[*Regular Expressions]]). For example, +=work+{^boss.*}= matches headlines that contain the tag =:work:= and +any tag /starting/ with =boss=. #+cindex: group tags, as regular expressions Group tags (see [[*Tag Hierarchy]]) are expanded as regular expressions. @@ -8954,7 +8956,7 @@ *** Matching tags and properties #+begin_example +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 - +With={Sarah|Denny}+SCHEDULED>="<2008-10-11>" + +With={Sarah\|Denny}+SCHEDULED>="<2008-10-11>" #+end_example #+texinfo: @noindent @@ -8984,7 +8986,7 @@ *** Matching tags and properties not =boss=, which also have a priority value =A=, a =Coffee= property with the value =unlimited=, an =EFFORT= property that is numerically smaller than 2, a =With= property that is matched by the regular -expression =Sarah|Denny=, and that are scheduled on or after October +expression =Sarah\|Denny=, and that are scheduled on or after October 11, 2008. You can configure Org mode to use property inheritance during @@ -9362,16 +9364,16 @@ **** Filtering in the agenda selects entries with category =work= and effort estimates below 10 minutes, and deselects entries with tag =John= or matching the - regexp =plot=. You can leave =+= out if that does not lead to - ambiguities. The sequence of elements is arbitrary. The filter - syntax assumes that there is no overlap between categories and tags. - Otherwise, tags take priority. If you reply to the prompt with the - empty string, all filtering is removed. If a filter is specified, - it replaces all current filters. But if you call the command with - a double prefix argument, or if you add an additional =+= (e.g., - =++work=) to the front of the string, the new filter elements are - added to the active ones. A single prefix argument applies the - entire filter in a negative sense. + regexp =plot= (see [[*Regular Expressions]]). You can leave =+= out if + that does not lead to ambiguities. The sequence of elements is + arbitrary. The filter syntax assumes that there is no overlap + between categories and tags. Otherwise, tags take priority. If you + reply to the prompt with the empty string, all filtering is removed. + If a filter is specified, it replaces all current filters. But if + you call the command with a double prefix argument, or if you add an + additional =+= (e.g., =++work=) to the front of the string, the new + filter elements are added to the active ones. A single prefix + argument applies the entire filter in a negative sense. - {{{kbd(|)}}} (~org-agenda-filter-remove-all~) :: @@ -19242,6 +19244,20 @@ ** Summary of In-Buffer Settings #+vindex: org-todo-keywords These lines set the TODO keywords and their interpretation in the current file. The corresponding variable is ~org-todo-keywords~. + +** Regular Expressions +:PROPERTIES: +:DESCRIPTION: Elisp regular expressions. +:END: +#+cindex: regular expressions syntax +#+cindex: regular expressions, in searches + +Org, as an Emacs mode, makes use of Elisp regular expressions for +searching, matching and filtering. Elisp regular expressions are +defined in [[info:elisp::Regular Expressions][Regular Expressions]] and have a somewhat different syntax +then some common standards. Most notably, alternation is indicated +using =\|= and matching groups are denoted by =\(...\)=. For example +the string =home\|work= denotes either =home= or =work=. ** Org Syntax :PROPERTIES: base-commit: 1690fbd88f4d55dc0e3c3af44f9fec534e75b601 -- 2.33.0 --=-=-=--