From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: $EDITOR to open at file end? Date: Sun, 8 Mar 2015 18:18:52 -0600 Message-ID: <20150308170959263276762@bob.proulx.com> References: <20150306171620044258862@bob.proulx.com> <87zj7o98s9.fsf@robertthorpeconsulting.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1425860353 21711 80.91.229.3 (9 Mar 2015 00:19:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Mar 2015 00:19:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 09 01:19:13 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YUlPc-0002MI-8C for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Mar 2015 01:19:12 +0100 Original-Received: from localhost ([::1]:40968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUlPb-00067G-Cv for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Mar 2015 20:19:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUlPP-000678-7u for help-gnu-emacs@gnu.org; Sun, 08 Mar 2015 20:19:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUlPK-0004wL-77 for help-gnu-emacs@gnu.org; Sun, 08 Mar 2015 20:18:59 -0400 Original-Received: from joseki.proulx.com ([216.17.153.58]:41078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUlPJ-0004wF-Sc for help-gnu-emacs@gnu.org; Sun, 08 Mar 2015 20:18:54 -0400 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id C49332182B for ; Sun, 8 Mar 2015 18:18:52 -0600 (MDT) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id 8C3022DC45; Sun, 8 Mar 2015 18:18:52 -0600 (MDT) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87zj7o98s9.fsf@robertthorpeconsulting.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 216.17.153.58 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103078 Archived-At: Robert Thorpe wrote: > It sounds like you're using several computers in some way. If you > describe the setup that would be useful. I have already described this. And I have already gotten good answers and good discussion. I consider the original problem solved. I am very familiar with emacsclient and already use it all of the time. I think the 'emacsclient -t' feature is a killer feature of emacs. Among the different ways I read and respond to email is that I will ssh into my desktop from somewhere else on the network. Most of the time that is using OpenSSH from a real system. Sometimes that means using putty.exe. Sometimes that means using a tablet. In the terminal I will run screen. When working over a long WAN link from an unreliable network location using screen is a great saver after a dropped connection. Screen with emacs is an awesome combination after the default screen escape character of C-a has been changed to C-z. C-a is inconvenient for me as either an emacs or vi user. I also use C-z for job control all of the time too. But I don't usually use job control in screen. In screen I would normally use different windows in those times when I would normally use C-z and job control. Therefore using C-z for the screen escape makes the most sense for me. I also like having a hard status bar. And the extended terminal attributes is useful too. Here would be a minimum. escape ^z^z hardstatus on hardstatus alwayslastline hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a " In a screen window I will run mutt. I normally use mutt for all of my email. I may have more than 10,000 messages various mailboxes such as mailing lists. Mutt will open them in less than a second. It is very fast. I know many people at this point will want to suggest using imap. Using imap slows that down quite significantly! For me imap just isn't as good as having real mailboxes available. When replying to a message in mutt I of course use emacs to edit my message. Mutt prepares a template and quotes the previous message for the reply. I write the reply in a newly started emacs running in a terminal environment. This thought of starting a new emacs will scare some people that have long emacs initialization that takes a long time to start. I have optimized my emacs init so that it doesn't take very long to start. I wrote about this on this list a couple of years ago. $ time emacs -f kill-emacs real 0m0.155s user 0m0.128s sys 0m0.024s Emacs can really be quite fast! Even if I force dropping all of the caches and requiring everything to load from the file system (SSD) then things are quite fast. The SSD makes a large difference over spinning disks here. My SSD cold start is around 1.5 seconds and my spinning disk cold start time is around 6-7 seconds. But I don't usually do cold starts except for testing. Typical for me has the caches being warm and speed is as above. > The people on this list may know a way to deal with it using > emacsclient. In the past I have used emacs, screen, and other applications in this following configuration. Some people may like this. I have a helper script that I call emacs-screen: #!/bin/sh screen -X select 0 emacsclient "$@" screen -X select $WINDOW In screen $WINDOW is the window number. "0" for the first window. "1" for the next and so forth. The above assumes emacs running in the first window 0 and that emacs has server-start running an emacs server. Executing "screen -X select 0" tells screen to make window 0 the currently visible window. Running emacsclient of course tells emacs to visit that file. After editing that file C-x # runs server-edit causing emacsclient to exit. "screen -X select $WINDOW" tells screen to make the previous window, the one you started in, visible again effectively returning you back to mutt. This type of environment allows you to use an emacs server to edit email with mutt and avoid the startup time. Plus all of your previously exiting visited buffers are still availble allowing an easy cut and paste of text all around. It is a good setup. I hope people reading this give it a try. It's pretty cool! I don't normally use it however. As you can see the startup time isn't a problem for me. My emacs starts quite fast. I don't miss connecting to an always running emacs with all of the visited buffers already there. Actually I rather like the pristine cleanness of a freshly started emacs. Everything is clean and nice right at that point. I also don't like the need to have the exact environment up and running in order to operate. Not much hardship. Here is the setup for the above. This starts up screen, runs emacs as the first process in window 0, tells emacs to start a server. $ screen emacs -f server-start This doesn't even talk about the killer feature "emacsclient -t". When I am doing software development on a system and it is convenient that it be *over there on that system* then I do all of the above of starting an emacs with a server running. Then I connect to it using "emacsclient -t" outside of screen. That attaches my terminal to the currently running emacs. I have a persistently running emacs client with all of my state available to me for that development. Using screen is awesome if I want everything in one terminal. But if I have my large dual monitor desktop with lots of space then I will usually run multiple terminals outside of screen. It all depends upon what I am wanting to do at the time. Emacs 24 has some annoying mode line font features that become visible when using "term screen-256color". I would speak about them but I have written much here already so will stop at this point. Previously I used emacs-vm to read email. Previous to using emacs-vm I used rmail. I don't want to offend anyone that is currently using rmail but I found emacs-vm to be vastly superior. I liked emacs-vm. I used it for a long time. But I like using mutt better. Long, long ago I had tried gnus. This was a long time ago and it was glacially slow then. I know that things have changed considerably and trying gnus again is on my todo list one of these days. I will eventually get around to it. Learning curve being that it is one must learn to pace themselves! :-) Bob