[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Improve the docstring of case-fold-search
From: |
Stefan Monnier |
Subject: |
Re: Improve the docstring of case-fold-search |
Date: |
Tue, 21 Jul 2009 23:38:48 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) |
> In the current docstring, the expression "ignore case" is not really
> appropriate because the search will not ignore uppercase characters in
> the search string. A very short way to tell this would be "*Non-nil if
> searches and matches should ignore lowercase." But while accurate, this
> is confusing IMO. Hence the long sentence in this patch, inspired by
> the "Search case" section of Emacs manual.
> Should I apply it?
As written, the doc is wrong. The magic "pay attention to case if
there's a capital letter" is not done "within case-fold-search" but
within isearch (and maybe a few more places) which then bind
case-fold-search to the appropriate value.
The case-fold-search variable is pretty low-level and applies to
functions like re-search-forward. Maybe it shouldn't be customizable to
avoid such confusion.
Stefan
> --- buffer.c.~1.583.~ 2009-07-17 21:12:21.000000000 +0200
> +++ buffer.c 2009-07-22 03:55:26.000000000 +0200
> @@ -5727,7 +5727,9 @@
> DEFVAR_PER_BUFFER ("case-fold-search", ¤t_buffer->case_fold_search,
> Qnil,
> - doc: /* *Non-nil if searches and matches should ignore
> case. */);
> + doc: /* *Non-nil if searches and matches should ignore
> case.
> +If there is an uppercase character in the search string
> +then the search becomes case sensitive. */);
> DEFVAR_PER_BUFFER ("fill-column", ¤t_buffer->fill_column,
> make_number (Lisp_Int),
> --
> Bastien