emacs swaps windows

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tschulz

    #1

    emacs swaps windows

    In emacs' python-mode, a file can be executed by pressing Ctrl-C Ctrl-C.
    If the code execution terminates with an Exception, emacs swaps the
    source code window and the python output window.
    Is there a way to stop that annoying behavior?

    Tom
  • Harry George

    #2
    Re: emacs swaps windows

    tschulz <thomas.schulz@ esands.com> writes:
    [color=blue]
    > In emacs' python-mode, a file can be executed by pressing Ctrl-C
    > Ctrl-C. If the code execution terminates with an Exception, emacs
    > swaps the source code window and the python output window.
    > Is there a way to stop that annoying behavior?
    >
    > Tom[/color]

    Personally I spit windows, open a shell, and run a script called "go"
    (typically by doing alt-p to get previous commandline), which sets
    paths and other variables before calling the program. So ^C^C never
    is an issues.

    However, a similar behavior with emacs's dired is solved with:

    ;;;----------------------------------------------------------------------
    ;;; Change C-x C-b buffer listing so that the current window is used
    ;;; if more than one window is displayed, otherwise splits the window.
    ;;;
    (defun my-list-buffers (&rest args)
    (interactive)
    (let ((buff-window (get-buffer-window "*Buffer List*")))
    (if (and (not buff-window) ; Not visible.
    (not (one-window-p 'no-mini))) ; Multiple windows.
    ;; Attach "*Buffer List*" to current window.
    (switch-to-buffer "*Buffer List*")))
    (apply 'list-buffers args)
    (pop-to-buffer "*Buffer List*") ; Go there.
    (forward-line 3)) ; Skip usually uninteresting stuff.

    (global-set-key "\C-x\C-b" 'my-list-buffers)

    ;;;----------------------------------------------------------------------
    ;;; Modified from original in buff-menu.el, this one buries the
    ;;; menu buffer after selecting a buffer.
    ;;;
    (defun Buffer-menu-this-window ()
    "Select this line's buffer in this window, and bury menu buffer."
    (interactive)
    (let ((menu-buffer (current-buffer)))
    (switch-to-buffer (Buffer-menu-buffer t))
    (bury-buffer menu-buffer)))


    --
    harry.g.george@ boeing.com
    6-6M21 BCA CompArch Design Engineering
    Phone: (425) 294-4718

    Comment

    Working...