Usage of GNU Emacs by non-programmers ...... Shell mode 3rd set command line editing

Source: Internet
Author: User

Bash brings command line editing, and countless people are blessed.

Yes. This is the case. The command line editing is really a good friend in our daily work. Can you still imagine how it feels to work in an ancient Bourne shell without command line editing every day? The past is terrible... And it's not very far away. Just two or three years ago, some early operating systems, I'm not talking about Linux. By default, they didn't include the cute Bourne again shell.

This is not all the problem. Even now, for some applications that implement Command Parsing by themselves, such as the command interpreter mqsc of WebSphere MQ, in some system environments without GNU Readline, for example, the default installation of HP-UX above, will be a very painful experience... Of course, you may not have the chance to access a program such as WebSphere MQ, but there is nothing. You can compile a python installation without GNU Readline, I think there is no big difference in experience.

Now you start to feel a little bit of hard work. This is a completely different experience from working on machines with their own unique configurations and armed teeth,

However, the difficulties have not ended yet. We also have machines that are far away from us. Such a machine is connected through a very slow network. It is even more painful to operate a machine with a slow connection. It takes one or two seconds to display each of your buttons on the screen. You cannot determine how much the cursor is moving in time for every response, think about this environment. You have to work all day long. Of course there will be tomorrow and tomorrow... How do you feel? Do you want to work in a command interpreter without GNU Readline at the same time ......

I am not talking about ghost stories here. This is our daily real work environment. That's why I chose the GNU Emacs shell-mode. One core principle is that the command line control cannot be handed over to shell. We need to take control of this, or let Emacs take control of it.

The most obvious difference between using shell-mode and using terminal is that the shell at Terminal can no longer see every button. In fact, the previous terminal communication method is not to mention a small historical problem of UNIX. Currently, terminals have powerful processing capabilities. Therefore, we have withdrawn this right. Since then, the whole world has been quiet.

When we enter the command in the shell-mode of Emacs, each of our buttons is only input into the buffer of Emacs. In this case, for the remote shell, our buttons do not exist. Everything is done in Emacs, and everything is processed in eamcs. After a complete command is edited, the command is sent to the remote shell at one time.

Working in this mode, all the difficulties we mentioned above have been solved. Whether in the face of third-party command interpreters without GNU Readline, slow connection machines in the distant American Citi country, or any combination of them, all my work, each line of commands is edited in the local GNU Emacs before being sent to the remote shell. Therefore, the above problems do not exist for me.

For command interpreters without GNU Readline, since all my commands are input to the Shell Buffer of Emacs, emacs has excellent text editing functions, I can edit my commands as I like. For the command interpreter below, since I only sent the final result to him, does he have Readline or can He edit the command line, it doesn't matter to me.

For slow machines in Citi, all my commands are input to the Shell Buffer of Emacs, instead of having to interact with Citi every time I press a button, GNU Emacs is installed on my local machine, so the speed of connection has little impact on me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.