From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bastian Ballmann Newsgroups: gmane.emacs.help Subject: Re: execute a command with euc-jp Date: Thu, 5 May 2011 10:44:52 +0200 Message-ID: <20110505104452.68b35b2d@chaostal.de> References: <20110505002934.GB18433@masashi-netbook> <87wri5r1jb.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1304585105 3064 80.91.229.12 (5 May 2011 08:45:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 May 2011 08:45:05 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 05 10:45:01 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QHuB5-0006rM-AT for geh-help-gnu-emacs@m.gmane.org; Thu, 05 May 2011 10:44:55 +0200 Original-Received: from localhost ([::1]:51386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHuB4-00067V-Pu for geh-help-gnu-emacs@m.gmane.org; Thu, 05 May 2011 04:44:54 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:44790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHuAz-00067P-5Z for help-gnu-emacs@gnu.org; Thu, 05 May 2011 04:44:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHuAx-0006O1-Tc for help-gnu-emacs@gnu.org; Thu, 05 May 2011 04:44:49 -0400 Original-Received: from lucy.chaostal.de ([217.69.77.130]:37239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHuAx-0006Nv-Lv for help-gnu-emacs@gnu.org; Thu, 05 May 2011 04:44:47 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by lucy.chaostal.de (Postfix) with ESMTP id 3B86311264C for ; Thu, 5 May 2011 10:44:44 +0200 (CEST) Original-Received: from lucy.chaostal.de ([127.0.0.1]) by localhost (lucy.openit.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 13190-07 for ; Thu, 5 May 2011 10:44:21 +0200 (CEST) Original-Received: from localhost.localdomain (frbg-5f730940.pool.mediaWays.net [95.115.9.64]) by lucy.chaostal.de (Postfix) with ESMTP id ECDC8112684 for ; Thu, 5 May 2011 10:44:20 +0200 (CEST) In-Reply-To: <87wri5r1jb.fsf@ambire.localdomain> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; i686-pc-linux-gnu) X-Virus-Scanned: Debian amavisd-new at lucy.chaostal.de X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 217.69.77.130 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:80916 Archived-At: Am Thu, 05 May 2011 10:31:52 +0200 schrieb Thien-Thi Nguyen : > () masashi ito > () Wed, 4 May 2011 20:29:34 -0400 >=20 > (defun myhowm-menu-eucjp () > "to show howm menu with eucjp" > (interactive) > (universal-coding-system-argument 'euc-jp) > (howm-menu) > ) >=20 > What should I do to run the command, howm-menu, with the euc-jp > encoding automatically without prompting me to enter "howm-menu." >=20 > The long (but more satisfying IMHO) way: >=20 > Move the cursor to =E2=80=98universal-coding-system-argument=E2=80=99 an= d type > =E2=80=98C-h f RET=E2=80=99. Emacs will show a buffer *Help* at the top= of > which appears: > =20 > universal-coding-system-argument is an interactive compiled > Lisp function in `mule-cmds.el'. > =20 > If your Emacs is properly installed, the words mule-cmds.el will be > presented as a hyperlink. You can move the cursor there (by typing > TAB repeatedly) and type RET to follow it, or click with the mouse. > Doing so will open a buffer viewing that file, with cursor at > function =E2=80=98universal-coding-system-argument=E2=80=99. > =20 > Type =E2=80=98C-M-e=E2=80=99 to go to the end of the defun. Note the fo= rm: > =20 > (let ((coding-system-for-read coding-system) > (coding-system-for-write coding-system) > (coding-system-require-warning t) > (current-prefix-arg prefix)) > (message "") > (call-interactively cmd)) > =20 > or something like that. This shows the basic approach of how to > invoke a command using a specific coding system: =E2=80=98let=E2=80=99-b= ind some > variables to the desired value around a call to =E2=80=98call-interactiv= ely=E2=80=99. > Transfer this form into =E2=80=98myhowm-menu-eucjp=E2=80=99, hard-coding= the constant > bits as you see fit, and pruning the parts that don't seem relevant. > You might end up with: >=20 > The short (but untested, only derived) way: >=20 > (defun myhowm-menu-eucjp () > "to show howm menu with eucjp" > (interactive) > (let ((coding-system-for-read 'euc-jp) > (coding-system-for-write 'euc-jp) > (coding-system-require-warning t)) > (call-interactively 'howm-menu))) >=20 > In any case, if your Emacs is not properly installed, fix that first. >=20