all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>,
	"Basil L. Contovounesios" <contovob@tcd.ie>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: master 2a7488d: Add support for displaying short documentation for function groups
Date: Tue, 27 Oct 2020 22:02:21 +0000	[thread overview]
Message-ID: <CADwFkmk3k53q3J9+utA0JBJW8kBnDB6AZ7UzoCMByQ-hN-5Juw@mail.gmail.com> (raw)
In-Reply-To: <87pn53375p.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 546 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
>
>>> I think so.  What about save-match-data?
>>
>> Perhaps under a "match data" subgroup?
>
> Makes sense.

How about the attached?

- I moved match-beginning and match-end to the new section "Match Data",
  and moved it below "Looking in Buffers".

- I added rx to the "Utilities" group.

Perhaps I went a bit overboard with the rx example, but it's useful to
just show off a bunch of syntax at a glance.  Let me know if it's too
much though...

[-- Attachment #2: 0001-Add-save-match-data-and-rx-to-regexp-shortdoc-group.patch --]
[-- Type: text/x-diff, Size: 1728 bytes --]

From cf0f47acf5fbd96c7e1f0c40f6efd075fb624481 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
Date: Tue, 27 Oct 2020 22:50:20 +0100
Subject: [PATCH] Add save-match-data and rx to regexp shortdoc group

* lisp/emacs-lisp/shortdoc.el (regexp): Add save-match-data and rx
to group.  New section "Match Data".
---
 lisp/emacs-lisp/shortdoc.el | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index a2e5ce6e29..98994ed501 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -628,12 +628,6 @@ regexp
   (match-string
    :eval (and (string-match "^\\([fo]+\\)b" "foobar")
               (match-string 0 "foobar")))
-  (match-beginning
-   :no-eval (match-beginning 1)
-   :eg-result 0)
-  (match-end
-   :no-eval (match-end 1)
-   :eg-result 3)
   "Looking in Buffers"
   (re-search-forward
    :no-eval (re-search-forward "^foo$" nil t)
@@ -644,6 +638,15 @@ regexp
   (looking-at-p
    :no-eval (looking-at "f[0-9]")
    :eg-result t)
+  "Match Data"
+  (match-beginning
+   :no-eval (match-beginning 1)
+   :eg-result 0)
+  (match-end
+   :no-eval (match-end 1)
+   :eg-result 3)
+  (save-match-data
+    :no-eval (save-match-data ...))
   "Replacing Match"
   (replace-match
    :no-eval (replace-match "new")
@@ -659,7 +662,9 @@ regexp
   (regexp-opt-depth
    :eval (regexp-opt-depth "\\(a\\(b\\)\\)"))
   (regexp-opt-charset
-   :eval (regexp-opt-charset '(?a ?b ?c ?d ?e))))
+   :eval (regexp-opt-charset '(?a ?b ?c ?d ?e)))
+  (rx
+   :eval (rx (| (* "f") (+ "o") (? "o")) (any "bar") (group "baz"))))
 
 (define-short-documentation-group sequence
   "Sequence Predicates"
-- 
2.28.0


  reply	other threads:[~2020-10-27 22:02 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201011035127.7723.3256@vcs0.savannah.gnu.org>
     [not found] ` <20201011035128.E3FD320667@vcs0.savannah.gnu.org>
2020-10-11  3:55   ` master 2a7488d: Add support for displaying short documentation for function groups Lars Ingebrigtsen
2020-10-11 13:49     ` Eli Zaretskii
2020-10-11 21:47       ` Lars Ingebrigtsen
2020-10-11 23:38         ` Drew Adams
2020-10-12  8:05           ` Gregory Heytings via Emacs development discussions.
2020-10-12 16:20             ` Drew Adams
2020-10-12 16:50               ` Gregory Heytings via Emacs development discussions.
2020-10-12 17:29                 ` Drew Adams
2020-10-13 20:05     ` Juri Linkov
2020-10-13 20:35       ` Drew Adams
2020-10-14  7:48         ` Juri Linkov
2020-10-13 20:55       ` T.V Raman
2020-10-14  7:52         ` Juri Linkov
2020-10-14 14:41           ` T.V Raman
2020-10-14  4:12       ` Lars Ingebrigtsen
2020-10-14  7:59         ` Juri Linkov
2020-10-15  6:43           ` Lars Ingebrigtsen
2020-10-15 12:24             ` Stefan Monnier
2020-10-18 20:12               ` Juri Linkov
2020-10-19  3:47                 ` Richard Stallman
2020-10-19  8:05                   ` Juri Linkov
2020-10-23 20:24     ` Stefan Kangas
2020-10-24 19:59       ` Lars Ingebrigtsen
2020-10-24 23:51         ` Stefan Kangas
2020-10-25 13:04           ` Lars Ingebrigtsen
2020-10-27 13:48       ` Basil L. Contovounesios
2020-10-27 14:33         ` Stefan Kangas
2020-10-27 15:43           ` Basil L. Contovounesios
2020-10-27 17:33             ` Lars Ingebrigtsen
2020-10-27 22:02               ` Stefan Kangas [this message]
2020-10-28  8:20                 ` Mattias Engdegård
2020-10-28 13:50                   ` Stefan Kangas
2020-10-28 11:04                 ` Lars Ingebrigtsen
     [not found]   ` <CADwFkmnXuyh2cAddLtgTNmsSv8av3o9qk98CVcTAzq6B8Lrpkw@mail.gmail.com>
     [not found]     ` <87blgknjze.fsf@gnus.org>
2020-10-30 11:58       ` Stefan Kangas
2020-10-30 12:05         ` Lars Ingebrigtsen
2020-10-30 12:27           ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmk3k53q3J9+utA0JBJW8kBnDB6AZ7UzoCMByQ-hN-5Juw@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=contovob@tcd.ie \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.