From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: How to preprocess emacsclient with a mode choice? Date: Fri, 29 Nov 2013 09:21:42 -0700 Message-ID: References: <8f3ccb5f-72ca-4ea8-bb4a-103e74e7b4c0@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1385742048 22265 80.91.229.3 (29 Nov 2013 16:20:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Nov 2013 16:20:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 29 17:20:51 2013 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 1VmQoE-0004go-Jr for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Nov 2013 17:20:50 +0100 Original-Received: from localhost ([::1]:48177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmQoE-0002fn-5g for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Nov 2013 11:20:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmQnl-0002eH-2g for help-gnu-emacs@gnu.org; Fri, 29 Nov 2013 11:20:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VmQnd-00030H-La for help-gnu-emacs@gnu.org; Fri, 29 Nov 2013 11:20:21 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:59647) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmQnd-0002zo-EP for help-gnu-emacs@gnu.org; Fri, 29 Nov 2013 11:20:13 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VmQna-00048a-6e for help-gnu-emacs@gnu.org; Fri, 29 Nov 2013 17:20:10 +0100 Original-Received: from 70-59-29-67.hlrn.qwest.net ([70.59.29.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Nov 2013 17:20:10 +0100 Original-Received: from kevin.d.rodgers by 70-59-29-67.hlrn.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Nov 2013 17:20:10 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 70-59-29-67.hlrn.qwest.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 In-Reply-To: <8f3ccb5f-72ca-4ea8-bb4a-103e74e7b4c0@googlegroups.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:94716 Archived-At: On 11/28/13 7:48 AM, Rustom Mody wrote: > If I want to jump-into a running emacs with visiting file foo I can do: > $ emacsclient foo > > However this does not give me foo with the mode I want. That behavior is no different than if you did: $ emacs foo is it? > Lets say I want to visit foo with auto-fill-mode. So I try > > $ emacsclient -e "(let ((find-file-hook (cons 'auto-fill-mode find-file-hook))) > (find-file \"foo\"))" > > This kindof works but does not pop up the emacs window. > > How to get pop-up behavior of first with the mode-choice of second? Just do the same thing you would do in a new emacs instance: M-x auto-file-mode Better yet, put something in the file to turn on auto-fill-mode, either directly or via a major mode hook. -- Kevin Rodgers Denver, Colorado, USA