It would be nice if I could run a selected region of Emacs text as an input for a c or c++ program. The output of the program could then overwrite the selected text. Is there a feature like this?
121608
In vi[m] there is the  through a shell command -- like sort or indent -- and get the filtered text back into the buffer. Is there an equivalent in emacs?
13418
Is there a way to include an entire text file as a string in a C program at compile-time?  something like:   file.txt:  This is a little text file  main.c:  #include &lt;stdio.h&gt; int main(void) {    #blackmagicinclude("file.txt", content)    /*    equiv: char[] content = "This is\na little\ntext file";    */    printf("%s", content); }    obtaining a little program that prints on stdout "This is a little text file"  At the moment I used an hackish python script, but it's butt-ugly and limited to only one variable name, can you tell me another way to do it?
9412
Is it possible to make macros give different results at the beginning of a new sentence? Suppose that I want the macro "\secname" to write "Section" at the beginning of a new sentence, and "section" anywhere else. How can I do so?
2226
I am looking for a way to get the output of a command when it is run from within a C++ program.  I have looked at using the system() function, but that will just execute a command. Here's an example of what I'm looking for:  std::string result = system("./some_command");   I need to run an arbitrary command and get its output. I've looked at , but I have not found anything that will give me what I need.
12992
Is there a way to select text across lines as a single line in the Windows command prompt? For example, selecting this rectangular selection:    puts two separate lines in the clipboard, even though the lines are contiguous. Doing the same thing in xterm on Linux will put one line on the clipboard, which is what I want. Is there a way to get cmd.exe to behave like xterm?
610
I've always wondered how to write the "A ? B : C" syntax in a C++ compatible language.  I think it works something like: (Pseudo code)  If A &gt; B    C = A Else    C = B   Will any veteran C++ programmer please help me out?
25327
I know this is more of a general linux question but w/e. So when I enter a program like vim in the command prompt it displays all the text in the file and I can edit it etc. But I can't figure out how to close or save the file and get back to the command prompt without killing the process. Any help is appreciated.
101043
I use set -o vi setting in bash. The shorcut Alt+. (recalling last argument of previous command) here doesn't work as in emacs mode, so what is the equivalent for vi?
47535
How can I poll the keyboard from a console python app?  Specifically, I would like to do something akin to this in the midst of a lot of other I/O activities (socket selects, serial port access, etc.):     while 1:       # doing amazing pythonic embedded stuff       # ...        # periodically do a non-blocking check to see if       # we are being told to do something else       x = keyboard.read(1000, timeout = 0)        if len(x):           # ok, some key got pressed           # do something   What is the correct pythonic way to do this on Windows?  Also, portability to Linux wouldn't be bad, though it's not required.
23627
Is it possible for me to make Ctrl+C perform a copy command if there is highlighted text in the terminal? Otherwise, it should retain its normal behavior.  (If there is a terminal that can do this other than gnome-terminal, that's probably fine too.)
81273
Is there any way one can use \input to insert only a specific section of a document into another? I intend on using this to improve the readability of an article with lots of pgfplots graphs in it, by moving all of my graphs to another file, and using something like \input{file.tex:graph1} to insert each graph where it is needed, rather than have all of them displayed together
115653
When I execute a command from a terminal that prints coloured output (such as ls or gcc), the coloured output is printed. From my understanding, the process is actually outputting , and the terminal formats the colour.  However, if I execute the same command by another process (say a custom C application) and redirect the output to the application's own output, these colours do not persist.  How does a program decide whether or not to output text with colour format? Is there some environment variable?
29004
I need to copy text from vim to web browser since I'm not able to use gedit as I'm opening  an sql file. How do I get this done?
88156
I want to view (and/or edit) colorized text in emacs, such as is output by ls -l --color=always, tree..., or whatever.   The text I refer to exists in a file. When I open that file in emacs, I want to be able to see it colorized, or toggle it to show ANSI (SGR) escape sequences.     ansi-color.el seems be be what I need, but I haven't been able to get it to do any colorizing of the ANSi escape sequences, but I do see blue-bold for individual contol bytes (eg. ^A and ^[)... I'm not sure if that is a feature of ansi-color, but I think it is.       According to the , it can work with strings and regions, but even that doesn't seem to work.. For example the function ansi-color-apply-on-region is not recognized by M-x. It says, "No match"     I've added (require 'ansi-color) to my .emacs file and even (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on). I get no error or warning when emacs starts, so I'm stuck.        How can I get the standard functions to work, and can it be made to automatically apply when opening a file whose name is suffixed with .col?
20886
Is there a way of reading one single character from the user input? For instance, they press one key at the terminal and it is returned (sort of like getch()). I know there's a function in Windows for it, but I'd like something that is cross-platform.
64883
What does the C value for LC_ALL do in Unix-like systems?   I know that it forces the same locale for all aspects but what does C do?
71653
I'm trying to start an external application through system() - for example, system("ls"). I would like to capture its output as it happens so I can send it to another function for further processing. What's the best way to do that in C/C++?