all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: Hong Xu <hong@topbug.net>
Cc: 25193@debbugs.gnu.org, tino.calancha@gmail.com
Subject: bug#25193: [PATCH] Improve the doc of re-search-forward and re-search-backward.
Date: Tue, 13 Dec 2016 15:27:03 +0900	[thread overview]
Message-ID: <87mvg0pcnc.fsf@gmail.com> (raw)
In-Reply-To: <1481599231-19381-1-git-send-email-hong@topbug.net> (Hong Xu's message of "Mon, 12 Dec 2016 19:20:31 -0800")

Hong Xu <hong@topbug.net> writes:

> 	* search.c (Fre_search_forward, Fre_search_backward): Improve doc.
> ---
>  src/search.c | 58 ++++++++++++++++++++++++----------------------------------
>  1 file changed, 24 insertions(+), 34 deletions(-)
>
> diff --git a/src/search.c b/src/search.c
> index 9f55d728362a..81edc27ecdc8 100644
> --- a/src/search.c
> +++ b/src/search.c
> @@ -2257,26 +2257,12 @@ See also the functions `match-beginning', `match-end' and `replace-match'.  */)
>  
>  DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4,
>         "sRE search backward: ",
> -       doc: /* Search backward from point for match for regular expression REGEXP.
> -Set point to the beginning of the occurrence found, and return point.
> -An optional second argument bounds the search; it is a buffer position.
> -  The match found must not begin before that position.  A value of nil
> -  means search to the beginning of the accessible portion of the buffer.
> -Optional third argument, if t, means if fail just return nil (no error).
> -  If not nil and not t, position at limit of search and return nil.
> -Optional fourth argument COUNT, if a positive number, means to search
> -  for COUNT successive occurrences.  If COUNT is negative, search
> -  forward, instead of backward, for -COUNT occurrences.  A value of
> -  nil means the same as 1.
> -With COUNT positive, the match found is the COUNTth to last one (or
> -  last, if COUNT is 1 or nil) in the buffer located entirely before
> -  the origin of the search; correspondingly with COUNT negative.
> -
> -Search case-sensitivity is determined by the value of the variable
> -`case-fold-search', which see.
> +       doc: /* Search backward from point for regular expression REGEXP.
> +This function is almost identical to `re-search-forward', except for
> +that by default it searches backward instead of forward, and the sign
> +of COUNT also indicates exactly the opposite searching direction.
>  
> -See also the functions `match-beginning', `match-end', `match-string',
> -and `replace-match'.  */)
> +See `re-search-forward' for details.  */)
Thanks for the report.
You could refer for details to the manual, maybe providing a link to the
proper node; but you don't want to refer to the doc string of another
function 'B' to document the arguments of the current function 'A'.
IMO the doc string of 'A' must introduce all its arguments.

Otherwise, i am worry you could go an step further, f.i.
`search-forward'/ `search-backward' share the same optional arguments, so:

1) doc string `re-search-backward': See the doc string of `re-search-forward'
   for details.
2)  doc string `re-search-forward': See the doc string of
   `search-backward' for details.
3)  doc string `search-backward': See the doc string of
   `search-forward' for details.
4)  doc string `search-forward': Wow, you are are very persistent
    user! Please see the manual for details, i am a very busy doc string.

(Reminds me the paperwork in some public agencies).





  reply	other threads:[~2016-12-13  6:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13  3:20 bug#25193: [PATCH] Improve the doc of re-search-forward and re-search-backward Hong Xu
2016-12-13  6:27 ` Tino Calancha [this message]
2017-04-02  4:42   ` npostavs
2017-04-02  4:57     ` Tino Calancha
2017-04-02  6:21 ` eliz
2017-04-06 23:19   ` npostavs
2017-04-14 15:12 ` Nicolas Petton

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=87mvg0pcnc.fsf@gmail.com \
    --to=tino.calancha@gmail.com \
    --cc=25193@debbugs.gnu.org \
    --cc=hong@topbug.net \
    /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.