unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* ESS completion buffer
@ 2007-03-19  7:34 cmr.Pent
  2007-03-19  8:07 ` David Hansen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: cmr.Pent @ 2007-03-19  7:34 UTC (permalink / raw)
  To: help-gnu-emacs

I'm sure some people reading this group have used ESS (Emacs Speaks
Statistics - Emacs' interface to R and other statistical programs).
This seems to be great, especially the completion feature.

But I'm having some problems with it. I'd like to have 2 buffers open
in my emacs frame (split vertically or horizontally), one for R
script, and another one for R (ESS buffer). C-x 2 / C-x 3 do the
thing, but when I hit Tab in ESS buffer to see the completions, a new
buffer emerges, and it _always_ hides my script buffer. That's
annoying, because when I actually complete the command, the
*Completions* buffer is still there. The same thing takes place even
if I have 2 separate frames :-(  The usual completions buffer (like
the one for opening files) always disappears when I complete the
command.

So, is this a problem of ESS? What emacs layout you use when working
with R by means of ESS?

Thanks in advance,
Andrey

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

* Re: ESS completion buffer
  2007-03-19  7:34 ESS completion buffer cmr.Pent
@ 2007-03-19  8:07 ` David Hansen
       [not found] ` <mailman.1105.1174291844.7795.help-gnu-emacs@gnu.org>
  2007-03-19 14:26 ` Stefan Monnier
  2 siblings, 0 replies; 8+ messages in thread
From: David Hansen @ 2007-03-19  8:07 UTC (permalink / raw)
  To: help-gnu-emacs

On 19 Mar 2007 00:34:56 -0700 cmr Pent wrote:

> I'm sure some people reading this group have used ESS (Emacs Speaks
> Statistics - Emacs' interface to R and other statistical programs).
> This seems to be great, especially the completion feature.
>
> But I'm having some problems with it. I'd like to have 2 buffers open
> in my emacs frame (split vertically or horizontally), one for R
> script, and another one for R (ESS buffer). C-x 2 / C-x 3 do the
> thing, but when I hit Tab in ESS buffer to see the completions, a new
> buffer emerges, and it _always_ hides my script buffer. That's
> annoying, because when I actually complete the command, the
> *Completions* buffer is still there. The same thing takes place even
> if I have 2 separate frames :-(  The usual completions buffer (like
> the one for opening files) always disappears when I complete the
> command.
>
> So, is this a problem of ESS? What emacs layout you use when working
> with R by means of ESS?

I use a "special" frame for this purpose (a small emacs frame in the
upper left corner), i use it to display *Completion* and some other
temporally buffers.

(info "(emacs)Special Buffer Frames")

This may require GNU Emacs 22.  If you are interested i can send my
configuration.

David

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

* Re: ESS completion buffer
       [not found] ` <mailman.1105.1174291844.7795.help-gnu-emacs@gnu.org>
@ 2007-03-19  8:35   ` cmr.Pent
  2007-03-19 11:43     ` Tyler Smith
                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: cmr.Pent @ 2007-03-19  8:35 UTC (permalink / raw)
  To: help-gnu-emacs

On 19 мар, 11:07, David Hansen <david.han...@gmx.net> wrote:
> If you are interested i can send my
> configuration.

Yes, it would be nice if you sent your .emacs to cmr.Pent(a)gmail.com.
I'll try special buffers when I get to my home computer.

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

* Re: ESS completion buffer
  2007-03-19  8:35   ` cmr.Pent
@ 2007-03-19 11:43     ` Tyler Smith
  2007-03-19 17:00     ` David Hansen
       [not found]     ` <mailman.1120.1174324208.7795.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 8+ messages in thread
From: Tyler Smith @ 2007-03-19 11:43 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-03-19, cmr.Pent@gmail.com <cmr.Pent@gmail.com> wrote:
> On 19 мар, 11:07, David Hansen <david.han...@gmx.net> wrote:
>> If you are interested i can send my
>> configuration.
>
> Yes, it would be nice if you sent your .emacs to cmr.Pent(a)gmail.com.
> I'll try special buffers when I get to my home computer.
>

I'd like to see that as well. It might be worth posting here. If not,
please send me a copy too!

tyler.smith@mail.mcgill.ca

-- 
Regards,

Tyler Smith

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

* Re: ESS completion buffer
  2007-03-19  7:34 ESS completion buffer cmr.Pent
  2007-03-19  8:07 ` David Hansen
       [not found] ` <mailman.1105.1174291844.7795.help-gnu-emacs@gnu.org>
@ 2007-03-19 14:26 ` Stefan Monnier
  2 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2007-03-19 14:26 UTC (permalink / raw)
  To: help-gnu-emacs

> thing, but when I hit Tab in ESS buffer to see the completions, a new
> buffer emerges, and it _always_ hides my script buffer. That's
> annoying, because when I actually complete the command, the
> *Completions* buffer is still there. The same thing takes place even
> if I have 2 separate frames :-(  The usual completions buffer (like
> the one for opening files) always disappears when I complete the
> command.

Yes, it's annoying and I hope we can find a solution to that problem at
some point.  The problem is that, contrary to completion done in
a minibuffer, completion done inside a normal buffer doesn't have a clearly
defined "end".
E.g. you type

     fo[TAB][TAB]

it completes to "foo", you then type

     b[TAB]c

Now, maybe you will hit TAB again now, or maybe you're done with
the completion.

Now that I think about it, maybe a good heuristic would simply be to do
(right after popping up the completions buffer):

    (add-hook 'pre-command-hook
              (lambda ()
                (unless (memq this-command '(<foo-bar-complete cmds>
                                             self-insert-command))
                  <pop-down-completion-buffer>)))


-- Stefan

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

* Re: ESS completion buffer
  2007-03-19  8:35   ` cmr.Pent
  2007-03-19 11:43     ` Tyler Smith
@ 2007-03-19 17:00     ` David Hansen
       [not found]     ` <mailman.1120.1174324208.7795.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 8+ messages in thread
From: David Hansen @ 2007-03-19 17:00 UTC (permalink / raw)
  To: help-gnu-emacs

On 19 Mar 2007 01:35:35 -0700 cmr Pent wrote:

> On 19 мар, 11:07, David Hansen <david.han...@gmx.net> wrote:
>> If you are interested i can send my
>> configuration.
>
> Yes, it would be nice if you sent your .emacs to cmr.Pent(a)gmail.com.
> I'll try special buffers when I get to my home computer.

Note that this is nothing more than some "dirty" configuration.
Comments, improvements welcome.  On a MAC or DOS box you may want to
change the `window-system' test (it's there b/c I run emacs from time
to time in non graphical mode where this makes no sense).

You'll have to tell your window manager to place/size the window
named "*special*" somewhere you like it (can maybe be done from
emacs as well).

David

(eval-when-compile (require 'cl))

(defun dh-get-special-window ()
  (let ((frame (or (loop for frame in (frame-list)
                      when (and (frame-live-p frame)
                                (frame-parameter frame 'dh-special))
                      do (return frame))
                   (make-frame '((name . "*special*")
                                 (dh-special . t)
                                 (unsplittable . t)
                                 (minibuffer . nil))))))
    (let ((window (frame-first-window frame)))
      (with-selected-window window
        (delete-other-windows))
      window)))

(defun dh-special-display (buffer &optional data)
  (let ((window (dh-get-special-window)))
    (with-selected-window window
      (switch-to-buffer buffer)
      window)))

(defun dh-scroll-up-special-window ()
  (interactive)
  (let ((window (dh-get-special-window)))
    (with-selected-window window
      (scroll-up))))

(defun dh-scroll-down-special-window ()
  (interactive)
  (let ((window (dh-get-special-window)))
    (with-selected-window window
      (scroll-down))))

(defun dh-switch-to-special-buffer ()
  (interactive)
  (let ((buffer (with-selected-window (dh-get-special-window)
                  (current-buffer))))
    (switch-to-buffer buffer)))

(when (eq window-system 'x)
  (setq display-buffer-reuse-frames t)

  (setq special-display-regexps
        '("^\\*Completions\\*$"
          "^\\*Help\\*$"
          "^\\*grep\\*$"
          "^\\*Apropos\\*$"
          "^\\*elisp macroexpansion\\*$"
          "^\\*local variables\\*$"
          "^\\*Compile-Log\\*$"
          "^\\*Quail Completions\\*$"
          "^\\*Occur\\*$"
          "^\\*frequencies\\*$"
          "^\\*compilation\\*$"
          "^\\*Locate\\*$"
          "^\\*Colors\\*$"
          "^\\*tumme-display-image\\*$"
          "^\\*SLIME Description\\*$"
          "^\\*.* output\\*$"           ; tex compilation buffer
          "^\\*TeX Help\\*$"))

  (global-set-key (kbd "C-c SPC") #'dh-scroll-up-special-window)
  (global-set-key (kbd "C-c DEL") #'dh-scroll-down-special-window)
  (global-set-key (kbd "C-c s SPC") #'dh-scroll-up-special-window)
  (global-set-key (kbd "C-c s DEL") #'dh-scroll-down-special-window)
  (global-set-key (kbd "C-c s b") #'dh-switch-to-special-buffer)

  (setq special-display-function #'dh-special-display))

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

* Re: ESS completion buffer
       [not found]     ` <mailman.1120.1174324208.7795.help-gnu-emacs@gnu.org>
@ 2007-03-19 22:44       ` Marc Schwartz
  2007-03-20  7:02       ` cmr.Pent
  1 sibling, 0 replies; 8+ messages in thread
From: Marc Schwartz @ 2007-03-19 22:44 UTC (permalink / raw)
  To: help-gnu-emacs

Just a quick FYI, in case folks are not aware of it. There is a 
dedicated ESS e-mail list, where the ESS devs tend to hang around.

More information here:

https://stat.ethz.ch/mailman/listinfo/ess-help

HTH,

Marc Schwartz

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

* Re: ESS completion buffer
       [not found]     ` <mailman.1120.1174324208.7795.help-gnu-emacs@gnu.org>
  2007-03-19 22:44       ` Marc Schwartz
@ 2007-03-20  7:02       ` cmr.Pent
  1 sibling, 0 replies; 8+ messages in thread
From: cmr.Pent @ 2007-03-20  7:02 UTC (permalink / raw)
  To: help-gnu-emacs

Thanks David.

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

end of thread, other threads:[~2007-03-20  7:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-19  7:34 ESS completion buffer cmr.Pent
2007-03-19  8:07 ` David Hansen
     [not found] ` <mailman.1105.1174291844.7795.help-gnu-emacs@gnu.org>
2007-03-19  8:35   ` cmr.Pent
2007-03-19 11:43     ` Tyler Smith
2007-03-19 17:00     ` David Hansen
     [not found]     ` <mailman.1120.1174324208.7795.help-gnu-emacs@gnu.org>
2007-03-19 22:44       ` Marc Schwartz
2007-03-20  7:02       ` cmr.Pent
2007-03-19 14:26 ` Stefan Monnier

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).