[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] improve ol-man.el with occur searching

From: Nicolas Goaziou
Subject: Re: [PATCH] improve ol-man.el with occur searching
Date: Sun, 16 Aug 2020 11:54:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)


"numbchild@gmail.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 page buffer.


> +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?

Nicolas Goaziou

reply via email to

[Prev in Thread] Current Thread [Next in Thread]