emacs swaps windows

Discussion in 'Python' started by tschulz, Nov 9, 2004.

  1. tschulz

    tschulz Guest

    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
     
    tschulz, Nov 9, 2004
    #1
    1. Advertising

  2. tschulz

    Harry George Guest

    tschulz <> writes:

    > 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


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


    --

    6-6M21 BCA CompArch Design Engineering
    Phone: (425) 294-4718
     
    Harry George, Nov 10, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bender MX

    Help with Image Swaps

    Bender MX, Nov 14, 2003, in forum: HTML
    Replies:
    4
    Views:
    401
    Bender MX
    Nov 15, 2003
  2. Ook
    Replies:
    9
    Views:
    295
    Sandeep
    Oct 9, 2005
  3. Aaron Graham
    Replies:
    20
    Views:
    1,734
    Aaron Graham
    Feb 2, 2006
  4. Replies:
    8
    Views:
    359
  5. BootNic

    Re: CS4 image swaps problem

    BootNic, Nov 9, 2013, in forum: HTML
    Replies:
    5
    Views:
    198
    dorayme
    Nov 11, 2013
Loading...

Share This Page