From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.help Subject: Re: Basic elisp question: bind key to function with arg Date: Mon, 26 Jan 2015 01:16:15 +0200 Message-ID: <54C5793F.7040800@yandex.ru> References: <87d262ihel.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1422227806 5881 80.91.229.3 (25 Jan 2015 23:16:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Jan 2015 23:16:46 +0000 (UTC) To: torys.anderson@gmail.com (Tory S. Anderson), emacs list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 26 00:16:45 2015 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 1YFWQ8-0001V5-CU for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Jan 2015 00:16:44 +0100 Original-Received: from localhost ([::1]:39300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFWQ7-0006Yk-HH for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Jan 2015 18:16:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFWPr-0006Ph-5n for help-gnu-emacs@gnu.org; Sun, 25 Jan 2015 18:16:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFWPm-0000xY-6d for help-gnu-emacs@gnu.org; Sun, 25 Jan 2015 18:16:27 -0500 Original-Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:47850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFWPl-0000xR-W2 for help-gnu-emacs@gnu.org; Sun, 25 Jan 2015 18:16:22 -0500 Original-Received: by mail-wi0-f178.google.com with SMTP id em10so6598822wid.5 for ; Sun, 25 Jan 2015 15:16:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=bGo68C6vZycoadA4GVWeyGVREE2X9zhglOxQZJVJNJg=; b=GyGOOSRwWab1Su9uq5RFVVXhab0Y6jbiFx6sbskL4BhNRcJ0Nu3NnTwYFxPaIzyOEg TWyr7mScrhFh1Pm4shJR/8CvRaJ0l3IEqI9Gq3wWVeOc2n9wa7uWyoIvCdjLJtA10V/g U5atHkJfzgp1fsSD1T0JkAVNfCcJZbqhKdQtPnVzAeiB8Fd7SJCzICDEoicXIQm6DXuT HWmprHkqANohfLjvlg+o+mfiAtmqbNxkeYezW2pt4y3UjzUVgsnMebsnaMM9FgN3Mv6o ZbTMAkYQqv8g4y91u+tpJwej9+KrvE1S6fcAYhleNkWzYqeIaTTyjU2inhabeeIZNypp pX6Q== X-Received: by 10.194.5.37 with SMTP id p5mr39262028wjp.20.1422227781484; Sun, 25 Jan 2015 15:16:21 -0800 (PST) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id ej10sm11609533wib.1.2015.01.25.15.16.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Jan 2015 15:16:21 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Thunderbird/33.0 In-Reply-To: <87d262ihel.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::232 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:102265 Archived-At: On 01/26/2015 01:12 AM, torys.anderson@gmail.com (Tory S. Anderson) wrote: > I have the following in my emacs init, and it works fine: > > (global-set-key [C-up] 'enlarge-window) > (global-set-key [C-down] (lambda () (interactive) > (enlarge-window -1))) > > But it seems awkward to me that I need to add all the extra just to pass a -1 arg to the function, so I'm suspecting there's a simpler way to write this. Any tips? No, that's how you do it. Or you create a named function doing the same, and bind it instead.