Is there a way of putting the Python Shell output in a tkinter window?

Customizing the size of the tex-shell window

  • I want to make a very small but critical change in the way emacs behaves in latex-mode. Can I force the tex-shell window to be a different size than half the current window? When I'm editing a *.tex file, I hit C-c C-f to typeset it. The first result of this is that the window splits vertically into two equal windows, of which the top is the *.tex file and the bottom is the tex-shell buffer. Then various typesetting stuff happens (which I don't care about at the moment). What I'd like is for the new tex-shell window to be only about 5 lines tall, rather than taking up half of the current window. I found http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_428.html, which indicates that 'split-window' accepts optional arguments for the size of the new window, but I can't figure out how to change the way 'C-c C-f' calls the split-window command.

  • Answer:

    You want sticky-repl.el Download this file: http://twb.ath.cx/~twb/canon/sticky-repl/sticky-repl.el and put it somewhere like ~/.emacs_addons/sticky-repl.el Then add the following to ~/.emacs: (load "~/.emacs_addons/sticky-repl.el") (setq special-display-function 'sticky-repl-display) (setq compilation-window-height 5) (setq same-window-buffer-names nil) (setq special-display-buffer-names '("*Apropos*" "*Backtrace*" "*Calculator*" "*Compile-log*" "*Help*" "*Messages*" "*Occur*" "*Shell Command Output*" "*compilation*" "*grep*" "*ielm*" "*inferior-lisp*" "*scheme*" "*vc*" "*vc-diff*" "*tex-shell*")) (setq special-display-regexps '("\\*shell\\(\\)?\\*" "\\*slime-repl .*\\*" "\\*sldb .*\\*")) > Now, every time a buffer called "*tex-shell*" (or any of those other names) is opened, it will be given special characteristics. You can set the buffer height to something else than 5 by changing compilation-window-height.

gleuschk at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

C-c C-f is bound to the function tex-file in tex-mode.el (which includes latex-mode). tex-file doesn't call split-window, at least not directly. I don't see any built-in hooks that would make this easy. Probably the easiest thing to do would be to write an elisp function that calls tex-file and then resizes the buffers, then bind C-c C-f in latex-mode to this new function. If you're not already an elisp hacker, that's probably not a very attractive value for easiest, but there you are.

Zed_Lopez

Well, you can enarge/shrink a window vertically with the 'enlarge-window' command, and you can set a tex-mode hook, so maybe something like:(setq tex-mode-hook '(lambda () (enlarge-window -8) ))(where -8 is the adjustment to be made to the height; I don't know which window this will apply to, so maybe you'd have to enlarge one instead of shrinking the other.)

Rhomboid

That works perfectly, beniamino, thanks.

gleuschk

That is awesome. I hate my perforce windows taking over half the display.

RustyBrooks

http://ask.metafilter.com/mefi/55743#838949 it doesn’t actually matter for that example, but lambda expressions are self-quoting--so this is equivalent to what you wrote:(setq tex-mode-hook (lambda () (enlarge-window -8) ))with the ocasionally important difference that it will be byte-compiled, while the version quoted with ' won’t be. If you still want to explicitly quote the lambda expression, use #'(lambda …)which allows byte-compilation.

Aidan Kehoe

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.