* read-buffer-completion-ignore-case
@ 2009-05-05 17:46 Drew Adams
2009-05-06 2:29 ` read-buffer-completion-ignore-case Miles Bader
2009-05-06 3:20 ` read-buffer-completion-ignore-case Stefan Monnier
0 siblings, 2 replies; 8+ messages in thread
From: Drew Adams @ 2009-05-05 17:46 UTC (permalink / raw
To: emacs-devel
There is no real use of `read-buffer-completion-ignore-case' in the Emacs Lisp
files, and I haven't bothered to download the C source code to check all the
places it might be used (besides `read-buffer').
Question: How can Emacs-Lisp code know whether completion involves buffer names?
Suppose I want to do something depending on the value of
`read-buffer-completion-ignore-case', but only when completion is for buffer
names - how can I test that? It's relatively easy to test for file-name
completion, but how to do that for buffer-name completion?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: read-buffer-completion-ignore-case
2009-05-05 17:46 read-buffer-completion-ignore-case Drew Adams
@ 2009-05-06 2:29 ` Miles Bader
2009-05-06 2:38 ` read-buffer-completion-ignore-case Drew Adams
2009-05-06 3:20 ` read-buffer-completion-ignore-case Stefan Monnier
1 sibling, 1 reply; 8+ messages in thread
From: Miles Bader @ 2009-05-06 2:29 UTC (permalink / raw
To: emacs-devel
"Drew Adams" <drew.adams@oracle.com> writes:
> There is no real use of `read-buffer-completion-ignore-case' in the Emacs Lisp
> files, and I haven't bothered to download the C source code to check all the
> places it might be used (besides `read-buffer').
>
> Question: How can Emacs-Lisp code know whether completion involves buffer names?
>
> Suppose I want to do something depending on the value of
> `read-buffer-completion-ignore-case', but only when completion is for buffer
> names - how can I test that? It's relatively easy to test for file-name
> completion, but how to do that for buffer-name completion?
Do you really need to know explicitly? Could you instead just test
`completion-ignore-case', which is let-bound to the value of
read-buffer-completion-ignore-case inside of read-buffer?
-Miles
--
Philosophy, n. A route of many roads leading from nowhere to nothing.
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: read-buffer-completion-ignore-case
2009-05-06 2:29 ` read-buffer-completion-ignore-case Miles Bader
@ 2009-05-06 2:38 ` Drew Adams
2009-05-06 3:00 ` read-buffer-completion-ignore-case Miles Bader
0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2009-05-06 2:38 UTC (permalink / raw
To: 'Miles Bader', emacs-devel
> > There is no real use of
> > `read-buffer-completion-ignore-case' in the Emacs Lisp
> > files, and I haven't bothered to download the C source code
> > to check all the places it might be used (besides `read-buffer').
> >
> > Question: How can Emacs-Lisp code know whether completion
> > involves buffer names?
> >
> > Suppose I want to do something depending on the value of
> > `read-buffer-completion-ignore-case', but only when
> > completion is for buffer names - how can I test that?
> > It's relatively easy to test for file-name
> > completion, but how to do that for buffer-name completion?
>
> Do you really need to know explicitly? Could you instead just test
> `completion-ignore-case', which is let-bound to the value of
> read-buffer-completion-ignore-case inside of read-buffer?
Not sure I follow you. Do you mean compare the values of
`completion-ignore-case' and `read-buffer-completion-ignore-case', and assume
that a buffer name is being read if (and only if) they are different?
For what I have in mind that test wouldn't be sufficient. I really want to know
whether buffer-name completion is happening.
But I wouldn't go so far as to say I "need" this. I don't really need any
particular feature - or Emacs itself, for that matter. ;-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: read-buffer-completion-ignore-case
2009-05-06 2:38 ` read-buffer-completion-ignore-case Drew Adams
@ 2009-05-06 3:00 ` Miles Bader
2009-05-06 5:42 ` read-buffer-completion-ignore-case Drew Adams
0 siblings, 1 reply; 8+ messages in thread
From: Miles Bader @ 2009-05-06 3:00 UTC (permalink / raw
To: emacs-devel
"Drew Adams" <drew.adams@oracle.com> writes:
>> Do you really need to know explicitly? Could you instead just test
>> `completion-ignore-case', which is let-bound to the value of
>> read-buffer-completion-ignore-case inside of read-buffer?
>
> Not sure I follow you. Do you mean compare the values of
> `completion-ignore-case' and `read-buffer-completion-ignore-case', and
> assume that a buffer name is being read if (and only if) they are
> different?
No, I mean, make your code generic, and only pay attention to
`completion-ignore-case', as it will have the correct value in the
various different circumstances.
> For what I have in mind that test wouldn't be sufficient. I really
> want to know whether buffer-name completion is happening.
Why? Maybe the fact that you want to know indicates the completion
interface is missing something...
-Miles
--
Selfish, adj. Devoid of consideration for the selfishness of others.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: read-buffer-completion-ignore-case
2009-05-05 17:46 read-buffer-completion-ignore-case Drew Adams
2009-05-06 2:29 ` read-buffer-completion-ignore-case Miles Bader
@ 2009-05-06 3:20 ` Stefan Monnier
1 sibling, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2009-05-06 3:20 UTC (permalink / raw
To: Drew Adams; +Cc: emacs-devel
> Question: How can Emacs-Lisp code know whether completion involves
> buffer names?
It can't, currently. Can you explain to us what you're trying to do?
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: read-buffer-completion-ignore-case
2009-05-06 3:00 ` read-buffer-completion-ignore-case Miles Bader
@ 2009-05-06 5:42 ` Drew Adams
2009-05-06 7:27 ` read-buffer-completion-ignore-case Miles Bader
0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2009-05-06 5:42 UTC (permalink / raw
To: 'Miles Bader', emacs-devel
> No, I mean, make your code generic, and only pay attention to
> `completion-ignore-case', as it will have the correct value in the
> various different circumstances.
Not in what I have in mind.
> > For what I have in mind that test wouldn't be sufficient. I really
> > want to know whether buffer-name completion is happening.
>
> Why? Maybe the fact that you want to know indicates the completion
> interface is missing something...
No, nevermind, but thanks. I would like to be able to know whether completion
involves buffer names, but there is ultimately no complete solution to that
anyway, obviously. There is in the end no way for completing-read to know
whether its COLLECTION argument involves buffer names. Sticking with
recognizable commands and functions (e.g. read-buffer), as I'm doing anyway, is
a partial solution.
I was thinking of something akin to `minibuffer-completing-file-name', but the
buffer case is not really parallel. (Yes, even for file names there is no 100%
solution, since you can complete them using completing-read instead of
read-file-name, but `minibuffer-completing-file-name' is a pretty good
indicator.)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: read-buffer-completion-ignore-case
2009-05-06 5:42 ` read-buffer-completion-ignore-case Drew Adams
@ 2009-05-06 7:27 ` Miles Bader
2009-05-06 8:29 ` read-buffer-completion-ignore-case Drew Adams
0 siblings, 1 reply; 8+ messages in thread
From: Miles Bader @ 2009-05-06 7:27 UTC (permalink / raw
To: emacs-devel
"Drew Adams" <drew.adams@oracle.com> writes:
>> No, I mean, make your code generic, and only pay attention to
>> `completion-ignore-case', as it will have the correct value in the
>> various different circumstances.
>
> Not in what I have in mind.
>
>> > For what I have in mind that test wouldn't be sufficient. I really
>> > want to know whether buffer-name completion is happening.
>>
>> Why? Maybe the fact that you want to know indicates the completion
>> interface is missing something...
>
> No, nevermind, but thanks.
Drew, it seems like _every time_ somebody asks you for more information
about what you're doing in hopes of trying to understand the general
problem better, you demure, saying "never mind what I'm doing, I just
_need_ functionality X."
Of course it requires some effort on your part to describe things, and
there's some risk that the response will be "no, no, you're approaching
the problem all wrong" but it's very hard for Emacs to develop good
general features without information on what is actually needed...
-Miles
--
The automobile has not merely taken over the street, it has dissolved the
living tissue of the city. Its appetite for space is absolutely insatiable;
moving and parked, it devours urban land, leaving the buildings as mere
islands of habitable space in a sea of dangerous and ugly traffic.
[James Marston Fitch, New York Times, 1 May 1960]
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: read-buffer-completion-ignore-case
2009-05-06 7:27 ` read-buffer-completion-ignore-case Miles Bader
@ 2009-05-06 8:29 ` Drew Adams
0 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2009-05-06 8:29 UTC (permalink / raw
To: 'Miles Bader', emacs-devel
> > No, nevermind, but thanks.
>
> Drew, it seems like _every time_ somebody asks you for more
> information about what you're doing in hopes of trying to
> understand the general problem better, you demure, saying
> "never mind what I'm doing, I just _need_ functionality X."
No, I never said that I "_need_" this. And I never said "never mind what I'm
doing". In fact, I explicitly said that I do _not_ need this, in just so many
words. And there is no "what I'm doing" to nevermind - I'm not doing anything.
I said I might like such a thing, if it were available. And I later said I
realized that it is not too realistic. That is why (and when) I said nevermind -
I dropped it; you can too. ;-)
There is no special reason for the "Suppose I want to do something...when
completion is for buffer names - how can I test that?" (to quote the original
query). I just think it might be handy to be able to recognize buffer
completion.
If you insist "But what are you really trying to do?", there is no answer. I'm
not _really_ trying to do anything. There is no hidden motivation or agenda. I
simply thought it would be useful to be able to recognize buffer-name
completion, just as it can be useful to recognize file-name completion. That was
"what I have in mind". That's all.
Perhaps I shouldn't have mentioned `read-buffer-completion-ignore-case' at all.
My question, from the beginning, was about recognizing buffer-name completion -
no more, no less. Anything else was beside the point, which is what I was trying
to clarify by saying that it didn't respond to what I was requesting.
I accept responsibility for not being 100% clear. I really only had the one
question. And I dropped it, afer talking it out and convincing myself that it
wasn't realistic. Thinking out loud, I guess.
> Of course it requires some effort on your part to describe things, and
> there's some risk that the response will be "no, no, you're
> approaching the problem all wrong" but it's very hard for Emacs
> to develop good general features without information on what is
> actually needed...
I don't think you need worry about that. When I really need something, or I
really think Emacs could use some good general feature I have in mind, I tend to
provide more than enough detail wrt the problem/need/feature, as I'm sure you're
aware. ;-)
Thanks for trying to help; sorry if I wasted your time.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-05-06 8:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-05 17:46 read-buffer-completion-ignore-case Drew Adams
2009-05-06 2:29 ` read-buffer-completion-ignore-case Miles Bader
2009-05-06 2:38 ` read-buffer-completion-ignore-case Drew Adams
2009-05-06 3:00 ` read-buffer-completion-ignore-case Miles Bader
2009-05-06 5:42 ` read-buffer-completion-ignore-case Drew Adams
2009-05-06 7:27 ` read-buffer-completion-ignore-case Miles Bader
2009-05-06 8:29 ` read-buffer-completion-ignore-case Drew Adams
2009-05-06 3:20 ` read-buffer-completion-ignore-case Stefan Monnier
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.