unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#46781: read-file-name-completion-ignore-case: who would still be looking for m when they typed M?
@ 2021-02-25 17:32 積丹尼 Dan Jacobson
  2021-02-26  6:46 ` Eli Zaretskii
  2021-02-26  8:55 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 9+ messages in thread
From: 積丹尼 Dan Jacobson @ 2021-02-25 17:32 UTC (permalink / raw)
  To: 46781

Today let's talk about
read-file-name-completion-ignore-case .
(info "(emacs) Completion Options")

Well just like for search, if we type "m" we probably are looking for
both "M" and "m", but if we go through all the trouble of holding down
the SHIFT button to type "M" then we certainly are only looking for "M"
and would be out of our mind to also be looking for "m". (Or "into pain,
a pain freak.") Therefore read-file-name-completion-ignore-case needs
more options than just t and nil.

E.g., I have Makefile and murmurfile. Well if I set
read-file-name-completion-ignore-case to nil and type M TAB then of course I
am only wanting to complete Makefile.

P.S., C-h v read-file-name-completion-ignore-case doesn't say what its
original value was. Odd. Yes even though "it might differ on different
operating systems."
emacs-version "27.1"





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46781: read-file-name-completion-ignore-case: who would still be looking for m when they typed M?
  2021-02-25 17:32 bug#46781: read-file-name-completion-ignore-case: who would still be looking for m when they typed M? 積丹尼 Dan Jacobson
@ 2021-02-26  6:46 ` Eli Zaretskii
  2021-02-26  8:55 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2021-02-26  6:46 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 46781

> From: 積丹尼 Dan Jacobson
>  <jidanni@jidanni.org>
> Date: Fri, 26 Feb 2021 01:32:04 +0800
> 
> Today let's talk about
> read-file-name-completion-ignore-case .
> (info "(emacs) Completion Options")
> 
> Well just like for search, if we type "m" we probably are looking for
> both "M" and "m", but if we go through all the trouble of holding down
> the SHIFT button to type "M" then we certainly are only looking for "M"
> and would be out of our mind to also be looking for "m". (Or "into pain,
> a pain freak.") Therefore read-file-name-completion-ignore-case needs
> more options than just t and nil.
> 
> E.g., I have Makefile and murmurfile. Well if I set
> read-file-name-completion-ignore-case to nil and type M TAB then of course I
> am only wanting to complete Makefile.

Did you actually see what happens when you set this variable non-nil
and try this?  If not, please do; if you did, and the result was not
what you expected, please show the details: what you types, which
files are there on disk, and what completion candidates were
suggested.

Because AFAIK Emacs already does what you want it to do in these
cases, without needing any additional values for this option.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46781: read-file-name-completion-ignore-case: who would still be looking for m when they typed M?
  2021-02-25 17:32 bug#46781: read-file-name-completion-ignore-case: who would still be looking for m when they typed M? 積丹尼 Dan Jacobson
  2021-02-26  6:46 ` Eli Zaretskii
@ 2021-02-26  8:55 ` Lars Ingebrigtsen
  2021-02-27 23:38   ` bug#46781: read-buffer-completion-ignore-case: " 積丹尼 Dan Jacobson
  1 sibling, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-26  8:55 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 46781

積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

> E.g., I have Makefile and murmurfile. Well if I set
> read-file-name-completion-ignore-case to nil and type M TAB then of course I
> am only wanting to complete Makefile.

Did you mean "if I set read-file-name-completion-ignore-case to t" here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46781: read-buffer-completion-ignore-case: who would still be looking for m when they typed M?
  2021-02-26  8:55 ` Lars Ingebrigtsen
@ 2021-02-27 23:38   ` 積丹尼 Dan Jacobson
  2021-02-28 13:44     ` Lars Ingebrigtsen
  2021-02-28 17:18     ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: 積丹尼 Dan Jacobson @ 2021-02-27 23:38 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: control, 46781

retitle 46781 read-buffer-completion-ignore-case: who would still be looking for m when they typed M?
thanks
Oops, for the entire bug I meant to talk about
buffer names, not file names! Sorry.

read-buffer-completion-ignore-case is a variable defined in ‘C source code’.
Its value is t
Original value was nil

So how did young Dan, usually sharp in the wits, ever make such a
blunder?

Well, one day he was innocently looking up in the manual
(Info-index "read-buffer-completion-ignore-case")
when the forces of evil linked it to the same place that
(Info-index "read-file-name-completion-ignore-case")
goes, instead of seven lines below it!!
Ever trustful, young Dan didn't notice the Toyota XLE he had intended to
discuss was now switched for a Toyota XLD, so he ended up discussing
that instead.

>>>>> "LI" == Lars Ingebrigtsen <larsi@gnus.org> writes:
LI> 積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

>> E.g., I have Makefile and murmurfile. Well if I set
>> read-file-name-completion-ignore-case to nil and type M TAB then of course I
>> am only wanting to complete Makefile.

LI> Did you mean "if I set read-file-name-completion-ignore-case to t" here?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46781: read-buffer-completion-ignore-case: who would still be looking for m when they typed M?
  2021-02-27 23:38   ` bug#46781: read-buffer-completion-ignore-case: " 積丹尼 Dan Jacobson
@ 2021-02-28 13:44     ` Lars Ingebrigtsen
  2021-02-28 17:18     ` Eli Zaretskii
  1 sibling, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-28 13:44 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 46781

積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

> retitle 46781 read-buffer-completion-ignore-case: who would still be
> looking for m when they typed M?
> thanks
> Oops, for the entire bug I meant to talk about
> buffer names, not file names! Sorry.

Thanks for the clarification.  :-)

But could you now possibly restate what problem you're actually seeing,
with a test case (starting from "emacs -Q") so that we can follow along?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46781: read-buffer-completion-ignore-case: who would still be looking for m when they typed M?
  2021-02-27 23:38   ` bug#46781: read-buffer-completion-ignore-case: " 積丹尼 Dan Jacobson
  2021-02-28 13:44     ` Lars Ingebrigtsen
@ 2021-02-28 17:18     ` Eli Zaretskii
  2021-03-01  4:08       ` 積丹尼 Dan Jacobson
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2021-02-28 17:18 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: larsi, 46781

> From: 積丹尼 Dan Jacobson <jidanni@jidanni.org>
> Cc: 46781@debbugs.gnu.org, control@debbugs.gnu.org, eliz@gnu.org
> Date: Sun, 28 Feb 2021 07:38:33 +0800
> 
> retitle 46781 read-buffer-completion-ignore-case: who would still be looking for m when they typed M?
> thanks
> Oops, for the entire bug I meant to talk about
> buffer names, not file names! Sorry.
> 
> read-buffer-completion-ignore-case is a variable defined in ‘C source code’.
> Its value is t
> Original value was nil
> 
> So how did young Dan, usually sharp in the wits, ever make such a
> blunder?
> 
> Well, one day he was innocently looking up in the manual
> (Info-index "read-buffer-completion-ignore-case")
> when the forces of evil linked it to the same place that
> (Info-index "read-file-name-completion-ignore-case")
> goes, instead of seven lines below it!!
> Ever trustful, young Dan didn't notice the Toyota XLE he had intended to
> discuss was now switched for a Toyota XLD, so he ended up discussing
> that instead.

Could you please describe the actual problem you see with
read-buffer-completion-ignore-case?  What did you type, which relevant
buffers existed in the session, what happened, what did you expect to
happen?  I see no relevant information about the issue above.

Or should we close this bug report because there is no problem?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46781: read-buffer-completion-ignore-case: who would still be looking for m when they typed M?
  2021-02-28 17:18     ` Eli Zaretskii
@ 2021-03-01  4:08       ` 積丹尼 Dan Jacobson
  2021-03-01 12:43         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: 積丹尼 Dan Jacobson @ 2021-03-01  4:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: larsi, 46781

$ emacs -nw -Q --eval '(setq read-buffer-completion-ignore-case t)' Makefile murmurfile BLA
C-x b                  ;; switch-to-buffer
M                      ;; self-insert-command
TAB                    ;; minibuffer-complete

I am saying that if I typed "m", then offer me both choices.

But I have gone through all the trouble of holding down SHIFT, that
means I am serious about only matching uppercase M.

"Then don't tamper with read-buffer-completion-ignore-case in the first
place."

But then I don't get the two choices for little "m". Too much price to pay.

So maybe read-buffer-completion-ignore-case should allow a third value,
not just nil and t.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46781: read-buffer-completion-ignore-case: who would still be looking for m when they typed M?
  2021-03-01  4:08       ` 積丹尼 Dan Jacobson
@ 2021-03-01 12:43         ` Lars Ingebrigtsen
  2021-03-07 13:21           ` Tomas Nordin
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-01 12:43 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 46781

積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

> $ emacs -nw -Q --eval '(setq read-buffer-completion-ignore-case t)' Makefile murmurfile BLA
> C-x b                  ;; switch-to-buffer
> M                      ;; self-insert-command
> TAB                    ;; minibuffer-complete
>
> I am saying that if I typed "m", then offer me both choices.
>
> But I have gone through all the trouble of holding down SHIFT, that
> means I am serious about only matching uppercase M.

Thanks for the recipe for reproduction.

Yes, I also see this behaviour, and it does indeed behave as documented
(i.e., case is ignored).

But as you say, that's perhaps not optimal behaviour -- in other cases
like this in Emacs (like isearch), Emacs stops ignoring case if the user
enters some upper case characters, and that would make sense here too?

Anybody have opinions here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46781: read-buffer-completion-ignore-case: who would still be looking for m when they typed M?
  2021-03-01 12:43         ` Lars Ingebrigtsen
@ 2021-03-07 13:21           ` Tomas Nordin
  0 siblings, 0 replies; 9+ messages in thread
From: Tomas Nordin @ 2021-03-07 13:21 UTC (permalink / raw)
  To: Lars Ingebrigtsen, 積丹尼 Dan Jacobson; +Cc: 46781

Lars Ingebrigtsen <larsi@gnus.org> writes:

> 積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:
>
>> $ emacs -nw -Q --eval '(setq read-buffer-completion-ignore-case t)' Makefile murmurfile BLA
>> C-x b                  ;; switch-to-buffer
>> M                      ;; self-insert-command
>> TAB                    ;; minibuffer-complete
>>
>> I am saying that if I typed "m", then offer me both choices.
>>
>> But I have gone through all the trouble of holding down SHIFT, that
>> means I am serious about only matching uppercase M.
>
> Thanks for the recipe for reproduction.
>
> Yes, I also see this behaviour, and it does indeed behave as documented
> (i.e., case is ignored).
>
> But as you say, that's perhaps not optimal behaviour -- in other cases
> like this in Emacs (like isearch), Emacs stops ignoring case if the user
> enters some upper case characters, and that would make sense here too?
>
> Anybody have opinions here?

I think it make sense too. It makes sense to treat users upper-case
query as a request to temporarily respect case. But I am using
ido-switch-buffer so I don't see this problem really.

--
Tomas





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-07 13:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25 17:32 bug#46781: read-file-name-completion-ignore-case: who would still be looking for m when they typed M? 積丹尼 Dan Jacobson
2021-02-26  6:46 ` Eli Zaretskii
2021-02-26  8:55 ` Lars Ingebrigtsen
2021-02-27 23:38   ` bug#46781: read-buffer-completion-ignore-case: " 積丹尼 Dan Jacobson
2021-02-28 13:44     ` Lars Ingebrigtsen
2021-02-28 17:18     ` Eli Zaretskii
2021-03-01  4:08       ` 積丹尼 Dan Jacobson
2021-03-01 12:43         ` Lars Ingebrigtsen
2021-03-07 13:21           ` Tomas Nordin

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).