all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrew Helsley <helsleya@cs.ucr.edu>
To: emacs-devel@gnu.org
Subject: Re: Completion: minibuffer.el vs comint.el
Date: Mon, 15 Nov 2010 13:56:19 -0800 (PST)	[thread overview]
Message-ID: <alpine.LRH.2.00.1011151339580.20678@eon.cs.ucr.edu> (raw)
In-Reply-To: <20101114173358.683A6628353@mail.cs.ucr.edu>

Hi,

I think it may become dedicated in the function `minibuffer-completion-help'
in `minibuffer.el'. Notice the local binding of the variable 
`display-buffer-mark-dedicated'.  From the documentation of the variable:

 	If non-nil, `display-buffer' marks the windows it creates as dedicated.

`display-buffer' itself is called from the `with-output-to-temp-buffer' C
function (at least that is what `with-output-...'s docs suggest).

Unfortunately as for intent/reason behind this behavior, I don't have a clue.
There are some comments in the `minibuffer-completion-help' function that may
provide further insight.  Hopefully seeing where it makes the window dedicated
can help you find your reason or reasonably conclude that it can be safely be
changed to be more like comint.el.

--------
regards,
Andy


On Sun, 14 Nov 2010, cmr.pent@gmail.com wrote:

> Date: Sun, 14 Nov 2010 19:44:52 +0300
> From: ?????? ????????? 	<cmr.pent@gmail.com>
> Subject: Completion: minibuffer.el vs comint.el
> To: emacs-devel@gnu.org
> Cc: martin rudalics <rudalics@gmx.at>
> Message-ID:
> 	<AANLkTinrm12uLLEMbhb1yxRbzB+zQs77P0=m-Kiq84nE@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hello!
>
> I'm investigating possibilities to use Emacs Python IDE. Before I used
> Emacs for writing programs in R language, with the help of ESS
> package. Both ESS mode and Python mode have helper inferior modes to
> interact with interpreter. Also, both have very decent completion.
>
> I've found out that ESS mode completion works via comint.el 's
> comint-dynamic-complete, while Python mode (and, in fact, the majority
> of modes including Emacs Lisp mode and Semantic) completion works via
> minibuffer.el 's completion-at-point. Why bother, may you ask? In
> fact, I would never bother about internals and even wouldn't notice
> any difference if not subtle, but extremely annoying detail. It's
> about how display-buffer acts in presence of *Completions* buffer.
>
> To reproduce:
>
> 0) Make sure pop-up-frames is nil (the default).
>
> 1) comint.el completion (this required you to press a key in the
> middle of program -- it there a way to make this testcase fully
> automated?):
>
> (global-set-key [(f12)] '(lambda() (interactive)
> 			   (progn
> 			     (if (window-dedicated-p (get-buffer-window "*Completions*"))
> 				 (message "*Completions* is dedicated")
> 			       (message "*Completions* is NOT dedicated"))
> 			     (display-buffer "bar" t))))
>
> (require 'comint)
> (let ((foo (get-buffer-create "foo"))
>      (bar (get-buffer-create "bar")))
>  (switch-to-buffer foo)
>  (delete-other-windows)
>  (comint-dynamic-list-completions (list "alice" "anastasia" "anna"))
>  ;; The following display-buffer call is impossible because we want
>  ;; to display-buffer while *Completions* is visible. Press F12.
>  ;; (display-buffer bar t)
>  )
>
> On pressing F12, you will see buffer "bar" open in place of
> *Completions* window. This is the expected thing, actually.
>
> 2) minibuffer.el completion:
>
> (let ((foo (get-buffer-create "foo"))
>      (bar (get-buffer-create "bar")))
>  (switch-to-buffer foo)
>  (delete-other-windows)
>  (emacs-lisp-mode)
>  (insert "(a")
>  (completion-at-point)
>  (if (window-dedicated-p (get-buffer-window "*Completions*"))
>      (message "*Completions* is dedicated")
>    (message "*Completions* is NOT dedicated"))
>  (display-buffer bar t))
>
> You will see buffer "bar" open in a new frame despite pop-up-frames
> being nil (documentation says: if nil, never make a separate frame!).
> Also you will see why it happens: *Completions* window is "dedicated".
> This is damn annoying!
>
> I have limited experience in elisp so I can't understand why and where
> *Completions* buffer becomes dedicated (set-window-dedicated-p is a
> built-in function in `C source code' -- is there a way to set a
> breakpoint for it?). If it's intentional, is there a reason for it?
> comint.el doesn't set "dedicated" flag, and seems to work just fine.
>
> See also debbugs.gnu.org/7368 .
>
> Best wishes,
> Andrey Paramonov
>
>
>
> ------------------------------
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel
>



       reply	other threads:[~2010-11-15 21:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20101114173358.683A6628353@mail.cs.ucr.edu>
2010-11-15 21:56 ` Andrew Helsley [this message]
2011-03-28 14:11   ` Completion: minibuffer.el vs comint.el Stefan Monnier
2011-03-29  9:14     ` martin rudalics
2011-03-29 13:39       ` Stefan Monnier
2011-03-29 15:18         ` martin rudalics
2011-03-29 20:55           ` Stefan Monnier
2010-11-14 16:44 Андрей Парамонов

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=alpine.LRH.2.00.1011151339580.20678@eon.cs.ucr.edu \
    --to=helsleya@cs.ucr.edu \
    --cc=emacs-devel@gnu.org \
    /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.