From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WMlYK2fSTF95EAAA0tVLHw (envelope-from ) for ; Mon, 31 Aug 2020 10:35:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id aOVdJ2fSTF/9dAAA1q6Kng (envelope-from ) for ; Mon, 31 Aug 2020 10:35:19 +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 2F35F9402C8 for ; Mon, 31 Aug 2020 10:35:19 +0000 (UTC) Received: from localhost ([::1]:33074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCh9i-0008Ep-57 for larch@yhetil.org; Mon, 31 Aug 2020 06:35:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCh9N-0008Eh-1L for emacs-orgmode@gnu.org; Mon, 31 Aug 2020 06:34:57 -0400 Received: from mail-vs1-xe44.google.com ([2607:f8b0:4864:20::e44]:37079) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCh9L-0004e7-5J for emacs-orgmode@gnu.org; Mon, 31 Aug 2020 06:34:56 -0400 Received: by mail-vs1-xe44.google.com with SMTP id p3so2946339vsr.4 for ; Mon, 31 Aug 2020 03:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=1wMPBGbhVoOvNihYpGKXtUcxMW+nwZ0o+2cZownohwQ=; b=JKG28gg3SHZPGyUs0TBXuj1Cmj5oGmwthHNtlL9lXxTUPro1uvACiIGUxiClDEKlWW P8NODZGb+9t4tiooIONvs9r1gTswiXwOJvEM1uv8Slraou+DNydk8eHYRxqMQXW219wj f4RkSlbaHDQVc2niDCwo0vHizTKUNzKIC/VrGTLswIECYFwPrfbtSRosa8QARQ/i2eZn z9vW0Ge9zFPoD9xsqtvVEfa6kAhZyHB1JW0SWvd1BTlTehvXYkUW9Vjkx8B/gL3C8Ot4 OvbZz6A+BYKqOef0VKsfZSjUnCcikqkamb6kPzLZLveyyy/Sh3BuqHBIF7T4OPag2nGr 8mFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=1wMPBGbhVoOvNihYpGKXtUcxMW+nwZ0o+2cZownohwQ=; b=SYHimVJFerMcmHqoXQbOxk8c/CPHddvqXe8LksHUuoAjA9laeKjkSiVwgjW4BjjJbD czMFNrOqeqg6b5/RLj8usjXTCUj3zxDszJyscCA9vjrzBnzQ88U87AV7H0IXt+Vd9Ay6 5kY3PYxoELaXWu+gLYdw4C/Bt6BO5rUHrL5s/LHbFjZ9TlPxRtZRsufOXwdh6JmC7P+e khjO6styF7Xicz1TcjkjzUYqpsVGjqaOaiCXHkK3EjTi1jJsEeQrld4LEIiAJCL8btw6 qhGorM+eSBZTSR01svxS2W0uS6IIq2VEZQ7LLepcUdfU+qCqXyxGfIF/6F+tzxqr3zwe jGJw== X-Gm-Message-State: AOAM531VqUNt/z/Y35IGFA8751wdhGB/T2Ms9TVel+N9a1m+G0V6fCt9 q5/5wrr+ONmYm4wLU13n05d0ODj6IO8m+gEyfg== X-Google-Smtp-Source: ABdhPJyPP0g3LDTbOgs5bYwqhVPnS2ENIToYgJhAkyru2lcW/ym9IuAotsl+6fGBsdM2RR6xJEamG7RcE18jrMg+74w= X-Received: by 2002:a67:c916:: with SMTP id w22mr409797vsk.22.1598870093983; Mon, 31 Aug 2020 03:34:53 -0700 (PDT) MIME-Version: 1.0 References: <87h7t2q5jj.fsf@nicolasgoaziou.fr> In-Reply-To: From: "numbchild@gmail.com" Date: Mon, 31 Aug 2020 18:34:27 +0800 Message-ID: Subject: Re: [PATCH] improve ol-man.el with occur searching To: "numbchild@gmail.com" , Org-mode Content-Type: multipart/alternative; boundary="000000000000fe755805ae29f39c" Received-SPF: pass client-ip=2607:f8b0:4864:20::e44; envelope-from=numbchild@gmail.com; helo=mail-vs1-xe44.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, HTML_MESSAGE=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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=JKG28gg3; dmarc=pass (policy=none) header.from=gmail.com; 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-Spam-Score: -0.71 X-TUID: xVhPxC5ttDCb --000000000000fe755805ae29f39c Content-Type: text/plain; charset="UTF-8" Hi, Nicolas, gentle ping about this patch. [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ On Mon, Aug 17, 2020 at 11:22 AM numbchild@gmail.com wrote: > Thanks for reviewing my code and points. :) > Fixed in this attached patch. > > [stardiviner] GPG key ID: 47C32433 > IRC(freeenode): stardiviner Twitter: @numbchild > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 > Blog: http://stardiviner.github.io/ > > > On Sun, Aug 16, 2020 at 5:54 PM Nicolas Goaziou > wrote: > >> Hello, >> >> "numbchild@gmail.com" writes: >> >> > With this patch, ol-man.el link type can be a link like this: >> > ```org >> > [[man:grep::--extended-regexp][grep --extended-regexp]] >> > ``` >> > Occur will auto search "--extended-regexp" string in man page buffer. >> >> Thanks. >> >> > +PATH should be a topic that can be thrown at the man command. >> > +If PATH contains extra ::STRING which will use `occur' to search >> > +matched strings in man buffer." >> >> > + (string-match "\\(.*?\\)\\(?:::\\(.*\\)\\)?$" path) >> > + (let* ((command (match-string 1 path)) >> > + (search (match-string 2 path))) >> > + (funcall org-man-command command) >> > + (with-current-buffer (concat "*Man " command "*") >> >> This should only be called if search is non-empty. >> >> > + (occur search)))) >> >> Why occur? Org uses `search-forward' for [[foo.org::text]] text links, >> and uses `occur' with [[foo.org::/text/]] links. >> >> Wouldn't it be more idiomatic to use a regular text search here? >> >> Regards, >> -- >> Nicolas Goaziou >> > --000000000000fe755805ae29f39c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, Nicolas, gentle ping about this patch= .

[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 <Hack this world!>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GPG key ID= : 47C32433
IRC(freeenode): stardiviner =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 Twitter:=C2=A0 @numbchild
Key fingerprint =3D 9BAA 92BC CDDD B9EF= 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
<= /div>


On Mon, Aug 17, 2020 at 11:22 AM numbchild@gmail.com <numbchild@gmail.com> wrote:
Thanks for reviewing my code and points. :)
=
Fixed in this atta= ched patch.
[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 <Hack this world!>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GPG key ID= : 47C32433
IRC(freeenode): stardiviner =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 Twitter:=C2=A0 @numbchild
Key fingerprint =3D 9BAA 92BC CDDD B9EF= 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
<= /div>


On Sun, Aug 16, 2020 at 5:54 PM Nicolas Goaziou = <mail@nicola= sgoaziou.fr> wrote:
Hello,

"numbchild@gm= ail.com" <numbchild@gmail.com> writes:

> With this patch, ol-man.el link type can be a link like this:
> ```org
> [[man:grep::--extended-regexp][grep --extended-regexp]]
> ```
> Occur will auto search "--extended-regexp" string in man pag= e buffer.

Thanks.

> +PATH should be a topic that can be thrown at the man command.
> +If PATH contains extra ::STRING which will use `occur' to search<= br> > +matched strings in man buffer."

> +=C2=A0 (string-match "\\(.*?\\)\\(?:::\\(.*\\)\\)?$" path)<= br> > +=C2=A0 (let* ((command (match-string 1 path))
> +=C2=A0 =C2=A0 =C2=A0 (search (match-string 2 path)))
> +=C2=A0 =C2=A0 (funcall org-man-command command)
> +=C2=A0 =C2=A0 (with-current-buffer (concat "*Man " command = "*")

This should only be called if search is non-empty.

> +=C2=A0 =C2=A0 =C2=A0 (occur search))))

Why occur? Org uses `search-forward' for [[foo.org::text]] text links,<= br> and uses `occur' with [[foo.org::/text/]] links.

Wouldn't it be more idiomatic to use a regular text search here?

Regards,
--
Nicolas Goaziou
--000000000000fe755805ae29f39c--