From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: How to bind keys in emacs? Date: Sat, 24 Dec 2005 06:16:27 GMT Organization: EarthLink Inc. -- http://www.EarthLink.net Message-ID: <%I5rf.9205$3Z.4241@newsread1.news.atl.earthlink.net> References: <1135323536.675947.257490@o13g2000cwo.googlegroups.com> <87psnodxvh.fsf@thalassa.informatimago.com> <8764pfe6ku.fsf@thalassa.informatimago.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1135405157 2039 80.91.229.2 (24 Dec 2005 06:19:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 24 Dec 2005 06:19:17 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 24 07:19:16 2005 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eq2kJ-00071M-GL for geh-help-gnu-emacs@m.gmane.org; Sat, 24 Dec 2005 07:19:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eq2lO-0007Q0-SZ for geh-help-gnu-emacs@m.gmane.org; Sat, 24 Dec 2005 01:20:18 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread1.news.atl.earthlink.net.POSTED!0847253b!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 55 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Original-NNTP-Posting-Host: 4.159.167.69 Original-X-Complaints-To: abuse@earthlink.net Original-X-Trace: newsread1.news.atl.earthlink.net 1135404987 4.159.167.69 (Fri, 23 Dec 2005 22:16:27 PST) Original-NNTP-Posting-Date: Fri, 23 Dec 2005 22:16:27 PST Original-Xref: shelby.stanford.edu gnu.emacs.help:136580 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor 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:32199 Archived-At: "Pascal Bourguignon" wrote in message news:8764pfe6ku.fsf@thalassa.informatimago.com... > "B. T. Raven" writes: > > > "Cameron Desautels" wrote in message > > news:mailman.20269.1135361990.20277.help-gnu-emacs@gnu.org... > >> On Fri, Dec 23, 2005 at 09:24:34AM +0100, Pascal Bourguignon wrote: > >> > > I want to use F5 keys to serve as C-x C-s [save buffer]. > >> > > and use F5 keys to serve as C-z [suspend]. > >> > > > >> > > What should i write in my ~/.emacs? > >> > > >> > If find it strange that you have non-deterministics wants, but here > > you are: > >> > >> Hah. I think that was a typo. I think he wants [f5] as save-buffer > >> and [f6] as suspend. Like so: > >> > >> (global-set-key [f5] 'save-buffer) > >> (global-set-key [f6] 'suspend-emacs) > >> -- > >> Cameron Desautels > >> > >> > >> Given infinite time, 100 monkeys could type out the complete works of > >> Shakespeare. Win 98 source code? Eight monkeys, five minutes. > >> > >> > > > > Or 'iconify-or-deiconify-frame for w32, apparently, instead of > > 'suspend-emacs. I don't know why this is. Do both work under Linux? > > Why do you think I wrote: > (if window-system > (iconify-or-deiconify-frame) > (suspend-emacs)) > > ? Why do you think I wrote "I don't know why this is": ?? In fact, when I read your code I really didn't understand it. All I did was identify what was happening with C-z on my (w32) machine. Also I read that suspend-emacs "makes no sense" in a window environment. Now I know that window-system can take a value of 'x in addition to 'w32 or nil (terminal?). I suppose I was flummoxed by the (to my mind) infelicitous (oddp (random... statement. I don't have oddp or evenp here. Would the op have learned something if she had obediently added your code to her .emacs or would he (!) just have seen "Debugger entered--Lisp error: (void-function oddp)?" Anyway (as we all know) every tyro (randomly male or female) has certain indeterminate needs. Ed