From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: how can I tell emacs to treat a text file as html? Date: 09 Apr 2005 20:11:49 +0200 Organization: [posted via Easynet Spain] Message-ID: <87oecnhlay.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1113070443 14365 80.91.229.2 (9 Apr 2005 18:14:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Apr 2005 18:14:03 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 09 20:13:58 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DKKSX-0001DD-TS for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Apr 2005 20:13:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DKK2I-0007Y9-9q for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Apr 2005 13:46:22 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!proxad.net!proxad.net!easynet-quince!easynet.net!easynet-post2!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Lines: 61 Original-NNTP-Posting-Host: 62.93.174.79 Original-X-Trace: DXC=n;`OEjmU9KDbW29Cl2TO`XO4V7M>Uh List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:25512 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:25512 Angelina Carlton writes: > Hello > > I use a bash based blogging software called nanoblogger. It lets you > use the editor of your choice and I had set this to be emacsclient. > > The blog script then sends /tmp/nb_entry1078.html to my already > running emacs and I can edit using html syntax hilighting as emacs > recognizes the file type. > > This worked fine until the latest version of the software now sends > a txt file instead. /tmp/nb_entry1078.txt > > Emacs of course thinks this is plain text which is right, but I would > like to treat it as html, actually XHTML, but either would do. > > The blog conf file has: > EDITOR="emacslient"; > > I cant find in my documentation a way to set EDITOR to > "emacsclient --"treat this as html" > > Is this possible from the command line? Or is there a way to turn on > html font locking from inside emacs even if the file is txt? This > would be acceptable if I could bind it to like F8 or something. emacsclient -e "(progn (find-file \"$file\") (html-mode))" Also, it might be possible to append: or to prepend: if not already present in the file, and then use merely: emacsclient $file For example: tail -10 $file \ | grep -q -s 'mode: html' \ || cat >> $file < EOF emacsclient $file -- __Pascal Bourguignon__ http://www.informatimago.com/ In a World without Walls and Fences, who needs Windows and Gates?