GDB in Emacs 24 messed up - emacs

I am using emacs 24.5.1 and GDB 7.10 in conjunction with the GUD integration.
I am starting GUD with the following bash command:
emacs --eval "(gdb \"gdb -i=mi --fullname --cd=`pwd` -args $*\")" &
I have set the following variables
'(gdb-show-main t)
With the previous version of emacs (23), I had two windows/buffers:
Output of the program being run AND the GUD prompt (gdb)
The code/source window showing the code and where the debugger is at
+--------------+
| *gud-binary* |
+--------------+
| source.cpp |
+--------------+
Whenever I stepped in the *gud-binary* window in emacs 23, the result was shown in the source window below.
What's strange in emacs 24 is that emacs replaces the *gud-binary* buffer with the source buffer whenever I step in gdb. It seems that every buffer is displayed in the first window. So, the second window actually doesn't have any function at all.
How can I fix that?

Related

Emacs / AUCTeX slow to start

When I run emacs test.ltx, it takes about 5 seconds for the buffer to open. The problem exists even when my init file and test.ltx are empty. M-x emacs-init-time returns 0.1 seconds. *Messages* says Applying style hooks... done. There is no delay when instead I run emacs -Q test.ltx, or when I open non-TeX files.

Why won't a new emacs window open in x11

When I type emacs & in X11, a new window doesn't open. Instead I just get the PID of the process. This illustrates what I mean.
bash-3.2$ emacs &
[1] 38624
Why is this happening and how can I get emacs to open in a separate window?
You can't start terminal Emacs as a background job -- it needs to interact with the terminal. Whenever a background job attempts to write to the tty, it is immediately stopped.
I would expect that your next input into the terminal would have resulted in a message similar to this?
[1]+ Stopped emacs
(which would have been useful).
You could then foreground the job with fg.
Running emacs & only makes any sense with GUI Emacs.

emacs CUA-mode OK in X but not working console

I have been struggling to get emacs CUA-mode working in the console where it works fine in X (in an xterm using emacs -nw).
The main features I want are shift-movement selection and ^C,^V,^X but any more would be helpful. So far I am using a local keyboard and monitor but ultimate goal is to get all this working over ssh using something like putty.
So far I have been working on getting my terminal to output the same control sequences that emacs expects to see for shift-movement (specifically S-<down> or <S-down>) and this works in the console when shift-select-mode is set in .emacs. So far so good, so I can shift select text from any emacs invocation type: X-windows, terminal ($TERM=linux or $TERM=xterm). This site has been very useful.
Shift-<down> displays as follows using cat -v and emacs happily maps <S-down> to this control sequence.
cat -v (then type shift-down)
^[O2B
Here's the problem, switch on cua-mode and the shift-selection stops working but ^C,^V and ^X starts working !? So I can either have shift-selection or ^C,^V,^X but not both at the same time.
-------
Setup:
emacs 23
Raspberry Pi
Raspian (similar to Debian)
You might like to try a more recent version of Emacs, since cua-mode has been slowly changed to use the same code as shift-select-mode. In Emacs-24.4, cua-mode actually uses shift-select-mode directly.

How to view man pages using emacs when invoking man command in command line?

I would like to view man pages using emacs when invoking man command.
I modified the pager parameter in /etc/man.conf PAGER to emacs.
But, it doesn't work. Is there anything I should modify ?
Indeed, emacs cannot read STDIN into a buffer, meaning
cat foobar | emacs
does not work in any case. So setting your PAGER variable to 'emacs', or 'emacs -nw' does not do the job.
Only way around I see is to write the man output into a tmp-file and then load that file into emacs:
man find > tmp-file; emacs tmp-file
You could alias this.
For example, assuming a tc-shell, and a directory called 'tmp' in your home-path, you can put the following line into your ~/.tcshrc file:
alias man '/usr/bin/man \!* > ~/tmp/tmp-file; emacs ~/tmp/tmp-file; rm ~/tmp/tmp-file'
So next time you call man find, emacs will fire up.
Emacs has a "Man mode", which can be invoked by M-x man RET and then typing in your command.
You can profit from emacs's function man. Just define a function in bash that will run emacs that will call it:
function man () {
emacs -e '(man "'"$1"'")'
}
You might want to call emacs -nw or even emacsclient instead.

Why emacs tab-completion does not split window

Run emacs without X support. M-x shell to open shell.
after i cd to a directory which contains to sub directories, namely "dirA", "dirB"
then i type "ls dir" and then press Tab to complete
emacs does not split the current window into two windows and show the Completions buffer below the shell buffer. it shows the Completions just in the window that originally shows the shell, and the shell disappeared.
how can the completion automatically split the shell window and display below the shell, instead of replacing the shell window?