How to disable emacs console messages - emacs

When I open emacs from a terminal with the emacs& command, I get a lot of debug messages on that terminal. This obscures what I was doing before. Is there a way of suppressing debug message output to the terminal?
Thanks!

Redirect stderr to /dev/null.
emacs 2>/dev/null& command
This alias should to the trick, just put in in .bashrc or your shells rc file.
alias emacs="emacs 2>/dev/null"

It depends on your OS, but you seem to be on Linux.
If it is the case, create a launcher icon, eg for Ubuntu.
This way the desktop environment, like Gnome or KDE, starts the process instead of the terminal, and messages do not appear.

Related

NeoVim make terminal window automatically close when program exits

The vim version has a ++close option that automatically closes the terminal when the job terminates, but since the NeoVim terminal came first it doesn't have that feature.
I need this because i am trying to run programs directly from vim, but i regularly make
curses applications which the popup window you get from :!python % can't handle, so i need the terminal window.
I am using NeoVim on arch linux if that's relevant.

How can I redirect linux terminal output to Eclipse console?

I am trying to redirect Terminal output to Eclipse console using external tools where I specified Terminal path (for example /usr/bin/xterm). When I run this tool it opens Terminal outside eclipse. When I did same thing in Windows 7, setting external tool location to Windows\System32\cmd.exe it ran inside Eclipse console. I wonder how I can make Terminal (in Ubuntu 14.04) work the same way.
You should use /bin/sh as command interpreter.
In Windows, cmd.exe combines two functions—interpreting commands and displaying terminal window. In Unix these functions are strictly separated. /bin/sh interprets commands and /usr/bin/xterm (or /usr/bin/x-terminal-emulator) displays terminal window, inside which it runs /bin/sh (or other shell like /bin/bash, /bin/zsh etc.) to interpret commands.
So if you ask Eclipse to run something via /usr/bin/xterm, it will appear in a new window, because that's what XTerm does. If you just want Eclipse to capture the output, ask it to run it directly via /bin/sh.

Emacs on Windows disable cmd

I've always used Emacs under Linux, but now I got a Windows machine and installed it.
However, every time I open Emacs it also opens a terminal (called cmd.exe on Windows, I think). Is there a way I can disable that terminal?
Thank you.
If you got the GNU version of emacs for Windows from here: http://ftp.gnu.org/gnu/emacs/windows/, there is an .exe called runemacs.exe. Use that instead of emacs.exe. "runemacs" will not pop up the annoying cmd window.

How Can I Get MinTTY (Cygwin Terminal) to Open Emacs in a New Window?

I can't figure out why this isn't easy to find on Google, but after searching for about 10 minutes, I just decided to give up and post here.
The subject basically says it all. I'm running MinTTY as a cygwin terminal on a Windows XP desktop. All I want to do is have emacs open up in a new window rather than inside my terminal. What would be best is a switch for this, so I could toggle it depending on my current needs. This seems like something that would be useful to a lot of people, and I know I've done it before on Linux boxes, so I imagine there must be a way to do this in cygwin too. Anyone know how?
Just start a new mintty, telling it to invoke emacs:
mintty emacs
There are a couple of scenarios that you might clarify:
Running the cygwin version of emacs within a standard windows environment will call emacs within the current shell
If the Cygwin X-Windows server (i.e., “XWin Server”) has been started and the DISPLAY environment variable has been set in the mintty terminal (e.g., export DISPLAY=":0"), calling emacs will start it in its own window.
running the Windows version of emacs within the cygwin terminal should launch the new frame you are seeking.
If you want a separate emacs 'window', you would be best served by installing the Windows native version of emacs (I use the gnu emacs precompiled binaries), and calling it from the cygwin terminal.

.emacs Edit to Always Start Emacs in Terminal Mode?

I use emacs as my editor-of-choice, and since I'm doing a lot of work in a terminal I always run emacs as
emacs -nw
so that it runs in the terminal instead of in a window.
I'd like to just run emacs and have it know that it should run in a terminal. My question is - how do I edit my .emacs file so that this is the default behavior?
You can't do this in the .emacs file. By the time that file is being parsed, the "chosen" emacs binary is already running.
You can install the emacs-nox package as one commenter suggests, or create an alias in your shell so that "emacs" is always treated as "emacs -nw".
Randy
I'm using a bash alias instead of .emacs to do that.
Add this line to your ~/.bashrc.
alias emacs='emacs -nw'
There is any easy way to solve the problem in general that has nothing to do with emacs at all and will work for any program that can choose between running in the console vs X:
unset DISPLAY
Of course you may not want to put that in your configuration file to be applied globally to all your shell sessions, so if you want it to apply to only emacs, then either call it from the command line like this:
DISPLAY= emacs
note the space!!! if you leave the space out it means you're setting the DISPLAY to emacs instead of setting DISPLAY to nothing... this command is a shorthand for:
DISPLAY=; emacs
So either use the above from the command line(s) or put that in a wrapper script that would look something like this:
#!/bin/bash
unset DISPLAY
exec emacs
I recommend the exec there because it will replace your wrapper script with emacs; to see the difference between the two you can run:
pstree -p
When I was first setting up a "emacs -nw" alias for emacs in windows I got stuck in a situation where I thought tototoshi's explanation hadn't worked. Yet all that was required was a restart of my terminal. Therefore, i think its worth mentioning that in windows (at least) if you are using emacs within the git bash terminal to create the .bashrc file and add "alias emacs='emacs -nw" to it (as tototoshi mentions) you have to close and reopen your terminal for it to work.