all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* minibuffer-completion-contents obsolete
@ 2013-04-20  7:49 Thierry Volpiatto
  2013-04-20 14:38 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Thierry Volpiatto @ 2013-04-20  7:49 UTC (permalink / raw)
  To: emacs-devel

Hi,
I see that `minibuffer-completion-contents' has been make obsolete, the
warning say to use `minibuffer-contents' instead which is a different
thing, why ?

minibuffer-c!ontents
minibuffer-completion-contents => "minibuffer-c"
minibuffer-contents => "minibuffer-contents"

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




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

* Re: minibuffer-completion-contents obsolete
  2013-04-20  7:49 minibuffer-completion-contents obsolete Thierry Volpiatto
@ 2013-04-20 14:38 ` Stefan Monnier
  2013-04-20 15:21   ` Thierry Volpiatto
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2013-04-20 14:38 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

> I see that `minibuffer-completion-contents' has been make obsolete, the
> warning say to use `minibuffer-contents' instead which is a different
> thing, why ?

> minibuffer-c!ontents
> minibuffer-completion-contents => "minibuffer-c"
> minibuffer-contents => "minibuffer-contents"

If you really want "minibuffer-c" you can use (buffer-substring
(minibuffer-prompt-end) (point)).

What do you use minibuffer-completion-contents for?


        Stefan



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

* Re: minibuffer-completion-contents obsolete
  2013-04-20 14:38 ` Stefan Monnier
@ 2013-04-20 15:21   ` Thierry Volpiatto
  2013-04-21  3:28     ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Thierry Volpiatto @ 2013-04-20 15:21 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I see that `minibuffer-completion-contents' has been make obsolete, the
>> warning say to use `minibuffer-contents' instead which is a different
>> thing, why ?
>
>> minibuffer-c!ontents
>> minibuffer-completion-contents => "minibuffer-c"
>> minibuffer-contents => "minibuffer-contents"
>
> If you really want "minibuffer-c" you can use (buffer-substring
> (minibuffer-prompt-end) (point)).

Yes, sure, but it is more or less the same than
`minibuffer-completion-contents', and I think this function is (or
maybe) used by third party libraries and making it obsolete add annoying
warnings. (I have now to inline it under a different name).
Well, it is very small, it is not a problem to inline it where needed,
but it was convenient.
So my question was just: why did you made it obsolete ?

Anyway if you decide to make it obsolete, the warning that say to use
`minibuffer-contents' instead is wrong, they do (as described in doc)
two different things.

> What do you use minibuffer-completion-contents for?

I use it in helm and eldoc-eval.


Thanks.

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

* Re: minibuffer-completion-contents obsolete
  2013-04-20 15:21   ` Thierry Volpiatto
@ 2013-04-21  3:28     ` Stefan Monnier
  2013-04-21  4:03       ` Stefan Monnier
  2013-04-21  5:14       ` Thierry Volpiatto
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2013-04-21  3:28 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

> So my question was just: why did you made it obsolete ?

Here's what I think happened:
- before Emacs-22, completion was done on the whole minibuffer content,
  regardless of the position of point.  So `minibuffer-content' returned
  "what completion commands operate on".
- Emacs-22 changed the completion behavior to ignore (and leave
  untouched) any text after point.  So `minibuffer-completion-contents'
  was introduced to return "what completion commands operate on".
- Emacs-23 changed this again such that text after point can be taken
  into account or can be ignored, depending on completion-styles (and
  depending on choices made on a case-by-case basis by those styles).

So, ever since Emacs-23, `minibuffer-completion-contents' returns
something which is not really "what completion commands operate on",
despite what its docstring says.

> Anyway if you decide to make it obsolete, the warning that say to use
> `minibuffer-contents' instead is wrong, they do (as described in doc)
> two different things.

AFAIK the only uses of `minibuffer-completion-contents' that are not
somewhat broken are necessarily unrelated to minibuffer completion.
IOW, the only uses I can think of that are not somewhat broken would
have to basically use it as a way to get "the text before point".
As for why they'd use this function rather than the usual primitives
non-specific to the minibuffer...

This said, I could only find a single use of this function in Emacs
(both 23 and 24), so I doubt it's used very heavily in third
party packages.

Maybe I should remove the message to use `minibuffer-contents'
instead, indeed.

>> What do you use minibuffer-completion-contents for?
> I use it in helm and eldoc-eval.

That says where you use it, but not what you use it for.


        Stefan



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

* Re: minibuffer-completion-contents obsolete
  2013-04-21  3:28     ` Stefan Monnier
@ 2013-04-21  4:03       ` Stefan Monnier
  2013-04-21  5:31         ` Thierry Volpiatto
  2013-04-21  6:07         ` Thierry Volpiatto
  2013-04-21  5:14       ` Thierry Volpiatto
  1 sibling, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2013-04-21  4:03 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

>> I use it in helm and eldoc-eval.
> That says where you use it, but not what you use it for.

E.g. why not use the patch below?


        Stefan


=== modified file 'packages/eldoc-eval/eldoc-eval.el'
--- packages/eldoc-eval/eldoc-eval.el	2013-01-13 20:20:14 +0000
+++ packages/eldoc-eval/eldoc-eval.el	2013-04-21 04:02:47 +0000
@@ -149,21 +149,15 @@
 
 (defun eldoc-mode-in-minibuffer ()
   "Show eldoc for current minibuffer input."
-  (let ((buf (with-selected-window (minibuffer-window)
-               (buffer-name))))
+  (let ((buf (window-buffer (minibuffer-window))))
     ;; If this minibuffer have been started with
     ;;`with-eldoc-in-minibuffer' give it eldoc support
     ;; and update mode-line, otherwise do nothing.
     (when (member buf eldoc-active-minibuffers-list)
-      (let* ((str-all (with-current-buffer buf
-                        (minibuffer-completion-contents)))
-             (sym     (when str-all
-                        (with-temp-buffer
-                          (insert str-all)
-                          (goto-char (point-max))
+      (let* ((sym (with-current-buffer buf
                           (unless (looking-back ")\\|\"")
                             (forward-char -1))
-                          (eldoc-current-symbol))))
+                    (eldoc-current-symbol)))
              (info-fn (eldoc-fnsym-in-current-sexp))
              (doc     (or (eldoc-get-var-docstring sym)
                           (eldoc-get-fnsym-args-string




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

* Re: minibuffer-completion-contents obsolete
  2013-04-21  3:28     ` Stefan Monnier
  2013-04-21  4:03       ` Stefan Monnier
@ 2013-04-21  5:14       ` Thierry Volpiatto
  1 sibling, 0 replies; 8+ messages in thread
From: Thierry Volpiatto @ 2013-04-21  5:14 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Hi Stefan,

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> So my question was just: why did you made it obsolete ?
>
> Here's what I think happened:
> - before Emacs-22, completion was done on the whole minibuffer content,
>   regardless of the position of point.  So `minibuffer-content' returned
>   "what completion commands operate on".
> - Emacs-22 changed the completion behavior to ignore (and leave
>   untouched) any text after point.  So `minibuffer-completion-contents'
>   was introduced to return "what completion commands operate on".
> - Emacs-23 changed this again such that text after point can be taken
>   into account or can be ignored, depending on completion-styles (and
>   depending on choices made on a case-by-case basis by those styles).
>
> So, ever since Emacs-23, `minibuffer-completion-contents' returns
> something which is not really "what completion commands operate on",
> despite what its docstring says.

Thanks for explanations.

>> Anyway if you decide to make it obsolete, the warning that say to use
>> `minibuffer-contents' instead is wrong, they do (as described in doc)
>> two different things.
>
> AFAIK the only uses of `minibuffer-completion-contents' that are not
> somewhat broken are necessarily unrelated to minibuffer completion.
> IOW, the only uses I can think of that are not somewhat broken would
> have to basically use it as a way to get "the text before point".
> As for why they'd use this function rather than the usual primitives
> non-specific to the minibuffer...
>
> This said, I could only find a single use of this function in Emacs
> (both 23 and 24), so I doubt it's used very heavily in third
> party packages.
>
> Maybe I should remove the message to use `minibuffer-contents'
> instead, indeed.

Yes because at first we think something have also changed in
minibuffer-contents to fit minibuffer-completion-contents.

>>> What do you use minibuffer-completion-contents for?
>> I use it in helm and eldoc-eval.
>
> That says where you use it, but not what you use it for.

In helm it is used only in two places, one same as in eldoc-eval and one
to delete the pattern from point with C-u C-k (C-k delete
`minibuffer-contents', and C-u C-k `minibuffer-completion-contents')
but well, I can live without `minibuffer-completion-contents' :-)


Thanks.

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

* Re: minibuffer-completion-contents obsolete
  2013-04-21  4:03       ` Stefan Monnier
@ 2013-04-21  5:31         ` Thierry Volpiatto
  2013-04-21  6:07         ` Thierry Volpiatto
  1 sibling, 0 replies; 8+ messages in thread
From: Thierry Volpiatto @ 2013-04-21  5:31 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Hi Stefan,

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> E.g. why not use the patch below?

Thanks for the patch!  I will try it soon.

BTW the most recent code (the one on ELPA is broken for now) is here:

https://github.com/thierryvolpiatto/eldoc-eval.git

It's easy from there to fork and make pull-request.

Anyway I will try again to get a bzr repo and merge. (maybe not before
June though)

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

* Re: minibuffer-completion-contents obsolete
  2013-04-21  4:03       ` Stefan Monnier
  2013-04-21  5:31         ` Thierry Volpiatto
@ 2013-04-21  6:07         ` Thierry Volpiatto
  1 sibling, 0 replies; 8+ messages in thread
From: Thierry Volpiatto @ 2013-04-21  6:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> I use it in helm and eldoc-eval.
>> That says where you use it, but not what you use it for.
>
> E.g. why not use the patch below?

Here the change with little modification to make it working.
Same changes in helm for helm-eldoc-show-in-eval.

http://tinyurl.com/d2ltf5q

Thanks.

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

end of thread, other threads:[~2013-04-21  6:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-20  7:49 minibuffer-completion-contents obsolete Thierry Volpiatto
2013-04-20 14:38 ` Stefan Monnier
2013-04-20 15:21   ` Thierry Volpiatto
2013-04-21  3:28     ` Stefan Monnier
2013-04-21  4:03       ` Stefan Monnier
2013-04-21  5:31         ` Thierry Volpiatto
2013-04-21  6:07         ` Thierry Volpiatto
2013-04-21  5:14       ` Thierry Volpiatto

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.