Enthought Canopy iPython console fills with text and loses prompt - enthought

I'm running the latest academic distribution of the Canopy IDE on a Windows 7 machine. In the iPython console, if I ask for a docstring (for example, typing "linspace?"), the resulting text fills up the console and gets cut off at the top and bottom. Afterwards, there is no longer an "In [#]" prompt and I cannot type any further commands into the console. If I don't want to lose all of the variables I have defined during the session, I have found that I can open a new editor window (File/New Editor Window) and I will once again have an "In [last #]" prompt where I can enter commands. However, this is a rather a nuisance. I would like to be able to view docstrings without having to open a new window each time. Is there a way I can fix this?
For reference, I have Canopy version 1.0.1.1189.
Update: this only seems to happen when I use the question mark, not if I enter, for example, "help(linspace)." Maybe I should just stick to using help() instead of question marks?

This isn't specific to Canopy and should apply to IPython in general. When you print a long docstring (i.e. one longer than your screen), it prints the output to something call a "pager" which allows you to scroll through the text. I think IPython (more or less) uses less.
When you're in the pager, you can press the q key to exit (and return to the IPython prompt). (Also, space bar pages down, b pages up.)

Related

How can I run emacs and terminal at the same time?

I've been opening emacs from the terminal but every time I want to compile my c program, i have to quit emacs first, compile it on terminal, then re-open emacs afterward again to edit some more.
Is there a simpler way to do this so I can keep emacs open while also compiling stuff on terminal?
I know this has something to do with entering shell mode but I'm not too familiar with that or editing the init file as im really new to emacs and still trying to get the hang of it
Any help is appreciated, thanks!
To compile your program while inside Emacs, type M-x compile and enter the compilation command. As a bonus, any errors or warnings in the output become links to the corresponding line in the source code.
Once your program is compiled, there are a few different ways to run it. If it's a non-interactive program, you may find that M-! (for running a shell command, waiting for it to finish, and displaying its output in a buffer) is sufficient. Otherwise, you may want to run a shell inside Emacs. You can do that with M-x eshell. (Some people prefer M-x shell; try both and see what you like.)
Alternatively, if you want to temporarily leave Emacs and go back to the terminal, you can type C-z to put Emacs in the background. To go back from the shell to Emacs, type % or fg (for "foreground"). To check whether Emacs is currently running in the background, type jobs.
Alternatively, it's straight-forward to run M-x ansi-term to have a functioning terminal inside of an Emacs buffer. It's nice having a working, interactive terminal in Emacs but also to be able to navigate that terminal output using your normal Emacs key bindings.
I use this this package to make sure all my environment variables are loaded.
Some operational notes:
When I'm editing something in Emacs and in need of a terminal, my usual procedure is to split vertically 'C-x 2' or horizontally 'C-x 3' in order to be able to open a terminal emulator (either 'M-x eshell' or 'M-x shell') side by side with the actual window. From here it is possible go forward and backward with 'C-x o' or 'C-u C-x o' as needed. This allows to continue editing while something is running visibly on the near window.
In rare cases where these emulators dont work exactly as the real OS terminal, we can split and use the native thing without layer or emulation 'C-x term RET RET' . Unfortunatly, in the later case, it is not possible to cycle between the framed windows (with 'C-x o') . Here, the exit command is required to be able to operate normally with emacs.

Using Emacs as external editor of Xilinx ISE, how to change the related buffer to current buffer when click a design file?

It has been like one year or so since I started to learn Emacs, and I do like its power and flexibility as a general text editor. When I had tried its Auctex mode for LaTeX/TeX, I knew I will never go back to read which TeX editor I should use. When I had tried its Pyhon mode, I knew I will never be bothered to choose a Python editor/IDE. Well, the same feeling for the VHDL mode of Emacs.
I do not intend to implement Emacs as a whole FPGA design solution (although I tried that). Instead, I prefer to use Emacs just as an external editor (Xilinx ISE in my case) and follow the design sequence according to the ventor's specific IDE. So according to this Editor Options, I set the editor options in my ISE {C:\Program Files (x86)\emacs\bin\emacsclient.exe} +$2 $1. However if I use runemacs.exe as suggested by Xilinx, everytime I clicked a file in ISE a new Emacs will be started. With the emacsclient.exe it helps a bit.
When I clicked a file in ISE now, its corresponding buffer will be opened in Emacs. But the buffer remains invisible and I have to C-x b to it by my self.
Also if I clicked the error information in ISE's console, the file containing the error will be opened in the background of Emacs with the cursor in the error position.
While it is not a big deal if I compare the benefits and drawbacks brought by Emacs VHDL mode, I do like Emacs can change the file I opened in ISE to the current buffer. So the question is how to set Emacs or Xilinx ISE to change Emacs's current buffer to the one I opened or clicked in ISE?
I suppose it should be some configuration related to Emacs rather than settings in ISE (obvious there is not too much choice in ISE's options). It maybe a simple question but it's beyond my current knowledge of Emacs configuration. I really appreciate if someone here could help me on this issue. Thank you guys in advance:)
P.S. Sorry for my poor English expression. Hopefully you can understand my quesition.
With some configuration it's possible to tell Emacs to switch to the related buffer. However, you might want to consider opening a new window (frame in Emacs term) when you call the editor in ISE.
The command line parameter -c tells Emacs client to open a new frame
{C:\Program Files (x86)\emacs\bin\emacsclient.exe} -c +$2 $1

How do I get PyCharm to show method signatures and documentation in the Python/IPython console and the editor?

In IPython's QT console (on Windows 7), if I type:
import scipy
scipy.zeros(
followed by Tab, it displays basic documentation for the method, like its signature, parameters, description, etc. In PyCharm CE 3.4.1, I have IPython enabled as my console, but this doesn't happen. The same is true in the actual editor; if I type this code in the editor, nothing shows up. I don't think this is related to the issue in this question (where PyCharm can't tell the type of something because it's not actually running it) but maybe it is.
In pycharm you have ctrl-q (or ctrl-j on a mac) for a quick-doc of the function under the cursor.
Ctrl + P to show method signature (parameters) as a pop-up.
other shortcut keys for pycharm are all available here.
If you are looking for Mac shortcut it's Command + P (⌘+P), accepted answer's solution didn't work.
Very old post but it's still a problem.
To see the function docstring, like what TAB in IPython shows, you should press Ctrl+Shift+I or go to View > Quick Definition while the cursor is within the function name (not between the parenthesis). A pop-up window shows the function docstring including few lines of the function code. However, it's not perfect and may not work in some cases, like pandas.read_csv().

set-mark-command not working emacs with C-SPC

I am not able to set the mark at the current point by C-SPC (both when emacs loads the init file and when it doesn't). However, when I do M-x set-mark-command, the mark is well set and I am able to select the region by moving the cursor. When I do M-x apropos set-mark-command, it shows two bindings C-# and C-SPC, but only the first one works. Any suggestions will be appreciated.
I am running emacs 24.3 on a GUI on Kubuntu 14.04.
Ubuntu 14.04 has an open bug affecting some desktop environments (at least KDE, LXDE and i3, but not Unity).
The default IBus key binding for "next input method" is Ctrl+Space, which prevents this key combination from reaching Emacs (or any other userspace program). To resolve the issue, run ibus-setup and change the key binding for "next input method" to something else (or delete it entirely by clicking the "..." button and then the "Delete" button).
Note that running ibus-setup from Unity, where C-SPC works already, shows a preferences window that does not include the key binding option that needs to be changed.
The "next input method" command cycles through your configured inputs, e.g. perhaps from English to French.
So I tracked down a similar issue to this on macOS. It seems that at some point C-SPC became bound to "Select the previous input source":
I just had the same issue today which I never had before. I am on Windows 7. As it turns out the Ctrl+SPC is bound to the OS's language switch. So the keystrokes are not sent to emacs at all.
But one thing that is even more weird is that I have never installed new languages/keyboards, yet the 'CH PRC' shows up in my language bar as a language/keyboard today. It turns out to be a Windows 7 bug and all I had to do to fix was:
Add 'CH PRC' in the language bar then Save.
Remove the language then Save again.
I know you are not on Windows, so the fix may not be the same as mine, but it is very likely Ctrl+SPC is bound to your OS's language switch as well.

Emacs - cursor misalignment, and disappearing text

I've been using a copy of emacs (in a Debian VM I ssh to with putty) at work for a couple of months now, and up until now everything has been working brilliantly... but this morning I'm trying to edit a file in shell-script-mode, and am seeing some weird behavior with text around the cursor.
Basically, when I type the following ( [ ] represents my cursor):
export DATABASE[]
After I've typed the first few characters of the variable name the export statement disappears and the variable name aligns to the left margin, and all I end up seeing is (with the cursor out in the wilderness):
DATABASE []
If I then hit CTRL-L, the screen refreshes, and I see the text as it should be displayed... until I start typing, and then the buffer start acting strangly again (characters disappearing, moving, cursor ending up in the wrong place, etc)
I've not, to my knowledge, added anything to my .emacs file since this last worked as I expect it to, so I'm at a loss as to what could be happening here. It doesn't seem specific to sh-mode either - I've tested a few other file types and observed similar strange behavior. Are there any emacs afficianados out there who might be able to point me in the right direction to figure out what's wrong here?
Thanks in advance
I'm not sure what to suggest, but this sounds awfully like an issue with the terminal: I suspect that Emacs redraws the current line whenever it changes and I guess it tries to do so incrementally. If something's got out of whack with your terminal, then it seems quite plausible that the current word would get written at the start of the line (all Emacs sent) and your cursor would get abandoned "out in the wilderness" :-)
Obviously, this is a new change. Since it doesn't sound like the sort of issue that would be caused by Elisp configurations in your .emacs, you should check whether you've recently upgraded one of
PuTTY
Emacs version
SSH version (unlikely...)
Then maybe the relevant tool will have something in the changelog (which maybe you can disable via a config?)
One thing you could check: you say this isn't just SH-mode. Is it "any mode with syntax highlighting"? Maybe Emacs just sends over the wire the text with the current colour?
I had a similar problem of disappearing text using PuTTY / Emacs / Remote AWS Ubuntu when running ABCL LISP in a shell window.
The solution was: I had changed my foreground and background font colors (essentially reversed) in PuTTY but had neglected to change the bold fonts, so they were disappearing into the background.