From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id EPr2IYpxMGFxygAAgWs5BA (envelope-from ) for ; Thu, 02 Sep 2021 08:39:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aAKqHYpxMGE7IAAAB5/wlQ (envelope-from ) for ; Thu, 02 Sep 2021 06:39:06 +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 93A481D039 for ; Thu, 2 Sep 2021 08:39:05 +0200 (CEST) Received: from localhost ([::1]:57478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLgNM-0000iF-G6 for larch@yhetil.org; Thu, 02 Sep 2021 02:39:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLgLb-0008Ev-FN for emacs-orgmode@gnu.org; Thu, 02 Sep 2021 02:37:15 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:43949) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLgLY-0004gF-0E for emacs-orgmode@gnu.org; Thu, 02 Sep 2021 02:37:15 -0400 Received: by mail-wr1-x429.google.com with SMTP id b6so1088412wrh.10 for ; Wed, 01 Sep 2021 23:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:references:user-agent:in-reply-to :message-id:mime-version; bh=4s1DxzsL28hV90CrHzCYhNOhZMkXn9g3P/YJBkpzdQc=; b=Yzv9Zjb7JWlSgIVNQSYGK805F/Oi7Z9nwHugRx9/aMQal4PfLsmve/js5akt0ve5re JxBg/wwF1OWQykhH95w3E0v6vKaIBj//tYLQPaDPKZ0MbL72km6+CATF8cVYPoZJsoAl iYQ6aAPyaBrcACUp7viE64NDoGOMCImypxY20fGB1Wzc00N0BxbfakSxOR3IWknhhq14 7nX8+e9vi6rYmvHdwwgsI2cKbvbfNKlrh+74YCSoi0KnUF3tGQBhtKQmQFwzHXbj7QOW gViPpfOA6FXwqChHn3A0S7e/7dVVPzQsb5bJcWr65aBPMHkCl6kJmJ3Mu6cDW9jL+vGS EfVg== 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=4s1DxzsL28hV90CrHzCYhNOhZMkXn9g3P/YJBkpzdQc=; b=OiMDKzJvX0L9j8vCu+HW970g98lAwKTGbUuRgJvgTcChEDnIu7kpL4FZ0n32x66tuO LmhfJzdV97tY45S+59adMV3ydxUKbG5C+TZA3l28RWl00F0qBY2s+oodaC2kZ1QI4xkB MY0lvY5ea4NlbpN+JTgFLIArxi/trOOPH2wbsriN1ZECyXLTWc690JAFuma2JpnfL+Bl 3z9Yqq4TPwZYF5IF9bRdwdmkpAx90djLVybrX3TD63bZgLeI0IHL4sXxpewG05JJ0f3b ijYXcODa+VuwO47Az/oEa/B+GKZHg+3fhDS/hTaP/76lvliLyaQwh4DCd5wlRYcQKSY2 tMLg== X-Gm-Message-State: AOAM533/+FAKkqXbn1Ko5kiIi5IxhTWVclT+XbKygMF1wti8iDDRYUdQ c6KTxGOwkiUkbmi5dI2sIOpkkcxdsohzYA== X-Google-Smtp-Source: ABdhPJyasPlT1ku/gSnBNs94EQUXvwuowzTiOP2dUnIymn8afKb/bEl2PXJy8T/7ey7LqM9x3DiiOg== X-Received: by 2002:a5d:6e84:: with SMTP id k4mr1688024wrz.426.1630564628959; Wed, 01 Sep 2021 23:37:08 -0700 (PDT) Received: from Home-Mac ([141.226.13.159]) by smtp.gmail.com with ESMTPSA id a10sm872649wrd.51.2021.09.01.23.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 23:37:08 -0700 (PDT) From: Daniel Fleischer To: Timothy Subject: [PATCH] Re: [BUG] Creating sparse tree with regexp property matches Date: Thu, 02 Sep 2021 09:35:39 +0300 References: <877dg1q2fp.fsf@gmail.com> <87sfypojox.fsf@gmail.com> <874kb4oa0z.fsf@gmail.com> User-agent: mu4e 1.6.5; emacs 28.0.50 In-reply-to: Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=danflscr@gmail.com; helo=mail-wr1-x429.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=1630564745; 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=4s1DxzsL28hV90CrHzCYhNOhZMkXn9g3P/YJBkpzdQc=; b=mF4bPlCfSUsqiJrWJOqw5zYqHtLt0sgKTqEK+zWSWjCYF9UEuNBc3kx9m3NGJ6+QiBPZUK NfPOyCGVY0GK/Glcp/Y8MJbs3F3aayHV6kkSQslfVMKi2lT3SJItfhkLNuKDRZwqYHwnEX 9edOmFcIa6KfhSN/VKPJWfFJLLszzqIsdaHJfbbKtkcS3FH7eICg2sJA4oNm8oz2CvBCh2 N3eKWQHnyHhLu6pUGGGMYRdUf58R+rqCIY57Myn8WreCtNYSorQi43bCkNi1J477v2TI38 SyrQfCDVX9DZUJQ0qxRVYX147X8tDVtR+THL2k/HuMPpAsA72EM8t7xYZbz/EA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630564745; a=rsa-sha256; cv=none; b=LbNjgXI+1e70qMlYfADkKsMN0SPAiZSNwgIVEkSHxEJGmMKG383CJDBzz587luT1LW5gWc uxn+2xCqZ6JlQfHomeqDzxklzvlT3qIqqXIRBGkTtm0Te5KbOJbXkWNd/O6nmrARqido2+ 9k/sodEPjOqcODwioXH1wpyCRm3znjg0/7Ue/UXibAD9lJ4g/MRPpH7np7XwLJOou0dNXU F3x2Y22wtvAdzWklETorakkzw5gnMW2HEkrRlAoFdrFI6leDuHsiHAAeaQp2Yj7GRnyaK8 oEmM/Ad+C9Y1poMAJP8GRO/oDwz49sDpAMwBD8P+PEjXeo5fafXkkC4HSrJhVQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Yzv9Zjb7; 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=20210112 header.b=Yzv9Zjb7; 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: 93A481D039 X-Spam-Score: -1.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: BzpdCPmqbDmn --=-=-= Content-Type: text/plain Content-Disposition: inline Attached is a patch with improvement to documentation regarding regular expressions. Best, Daniel Fleischer --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-manual-added-section-about-regular-expressions.patch >From d3d1dcbc5f62ea111e7bcd1741114cae6b1280c5 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 | 80 ++++++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 31 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index 10e0baa28..02eaa10f2 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,22 @@ ** 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 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= matches either =home= +or =work=. + +For more information, see [[info:emacs::Regexps][Regular Expressions in Emacs]]. ** Org Syntax :PROPERTIES: -- 2.33.0 --=-=-=--