From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rustom Mody Newsgroups: gmane.emacs.devel Subject: Re: aplus mode Date: Thu, 16 Aug 2012 22:55:03 +0530 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=14dae9340eb7ebf97404c765526c X-Trace: ger.gmane.org 1345137912 25208 80.91.229.3 (16 Aug 2012 17:25:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Aug 2012 17:25:12 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 16 19:25:12 2012 Return-path: Envelope-to: ged-emacs-devel@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 1T23ol-000390-2j for ged-emacs-devel@m.gmane.org; Thu, 16 Aug 2012 19:25:11 +0200 Original-Received: from localhost ([::1]:46196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T23oj-0003uW-Gv for ged-emacs-devel@m.gmane.org; Thu, 16 Aug 2012 13:25:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T23og-0003s6-AH for emacs-devel@gnu.org; Thu, 16 Aug 2012 13:25:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T23of-0002wU-2x for emacs-devel@gnu.org; Thu, 16 Aug 2012 13:25:06 -0400 Original-Received: from mail-gh0-f169.google.com ([209.85.160.169]:43134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T23oe-0002tw-Ub for emacs-devel@gnu.org; Thu, 16 Aug 2012 13:25:05 -0400 Original-Received: by ghrr18 with SMTP id r18so3522829ghr.0 for ; Thu, 16 Aug 2012 10:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=kz7Hf8bMjc8Rden5sZ2pIzYOHxuKF6JS4aaxfhAk53o=; b=PyuGKcQsrFlQxLXykdMVgVcVNwumYoUAZ6Q1+uBk9JkWpyrh5NlSBw38loxwaNC00U LpfgaotSzFHfRhDFhjbs8pGiQJpwaVA65mxDBVYjd8VokSo2yXh5buL/j+thes7QZYvP I0KQHikOHJWQbSSwK5JSCA9of7T5+GDyi95yWywsS7N1BikkU7loxQSXRqBModq45/dC vroZ76VXOC4YrpwYnOy8PBPtuvQQQNE5n1wBaKOVUuF0H5+1WOkbVS/d9OEV7PeO2Qxo RyJgdSIEOUZWs5PZ5BH2I5Y4u0ACSSjP52ARaDMaOj3gl4GdH4nDr43Nz+9Fs37jcXsD w17A== Original-Received: by 10.50.160.202 with SMTP id xm10mr3544913igb.10.1345137903663; Thu, 16 Aug 2012 10:25:03 -0700 (PDT) Original-Received: by 10.231.132.135 with HTTP; Thu, 16 Aug 2012 10:25:03 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152593 --14dae9340eb7ebf97404c765526c Content-Type: text/plain; charset=ISO-8859-1 On Tue, Aug 14, 2012 at 8:17 PM, Stefan Monnier wrote: > > > Trying to make an 'inside-emacs' version of the same hack I discovered > that > > the following does the trick of removing the need for LANG=C. > > > (setq coding-system-for-write 'iso-latin-1) > > (setq coding-system-for-read 'iso-latin-1) > > > Obviously this is not a proper solution. > > Firstly these variables should not be globally assigned. Whats the best > > way of scoping these assignments or should some other variables be used I > > am not sure. > > You should let-bind them around the `start-process' call. > > I now have (defun run-apl() "Major mode for running APlus under emacs" (interactive) (if (not (comint-check-proc "*a+*")) (let ((coding-system-for-write 'iso-latin-1) (coding-system-for-read 'iso-latin-1)) (set-buffer (make-comint "a+" "a+")))) (setq apl-buffer "*a+*") (inferior-apl-mode) (pop-to-buffer "*a+*")) Is this (use of let) the appropriate way? > > The second point is that iso-latin-1 just works by saying so-to-speak > > "Not-UTF" but it is obviously wrong. > > Yes, if it works, it's probably by accident. It might be preferable to > create a proper `apl' coding-system (use define-charset and then > define-coding-system). > > Thanks. I was looking for such functions. I will of course have to study code that uses them. Any suggestions where to start? Thanks Rusi --14dae9340eb7ebf97404c765526c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Tue, Aug 14, 2012 at 8:17 PM, Stefan Monnier = <monnier@iro.umontreal.ca> wrote:

> Trying to make an 'inside-emacs' version of the same hack I di= scovered that
> the following does the trick of removing the need for LANG=3DC.

> (setq coding-system-for-write 'iso-latin-1)
> (setq coding-system-for-read 'iso-latin-1)

> Obviously this is not a proper solution.
> Firstly these variables should not be globally assigned. =A0Whats the = best
> way of scoping these assignments or should some other variables be use= d I
> am not sure.

You should let-bind them around the `start-process' call.


I now have

(defun = run-apl()
=A0 "Major mode for running APlus under emacs"
= =A0 (interactive)
=A0 (if (not (comint-check-proc "*a+*"))
= =A0=A0=A0=A0=A0 (let ((coding-system-for-write 'iso-latin-1)
=A0=A0=A0 =A0=A0=A0 (coding-system-for-read 'iso-latin-1))
=A0=A0=A0= (set-buffer (make-comint "a+" "a+"))))
=A0 (setq ap= l-buffer "*a+*")
=A0 (inferior-apl-mode)
=A0 (pop-to-buffer= "*a+*"))

Is this (use of let) the appropriate way?


=A0
> The second point is that iso-latin-1 just works by saying so-to-speak<= br> > "Not-UTF" but it is obviously wrong.

Yes, if it works, it's probably by accident. =A0It might be prefe= rable to
create a proper `apl' coding-system (use define-charset and then
define-coding-system).


Thanks. I was looking for such functions.=A0 I will of course = have to study code that uses them.=A0 Any suggestions where to start?
Thanks
Rusi
--14dae9340eb7ebf97404c765526c--