From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.help Subject: Re: changing a variable with a keystroke Date: Wed, 14 Jan 2009 13:14:20 +0100 Message-ID: References: <50abee650901140332u1cd4727atd7324d1fedf5a9ac@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1231935301 31686 80.91.229.12 (14 Jan 2009 12:15:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Jan 2009 12:15:01 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Joff Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 14 13:16:13 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LN4fK-0003gV-2P for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jan 2009 13:16:10 +0100 Original-Received: from localhost ([127.0.0.1]:36979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LN4e3-0001TN-1C for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jan 2009 07:14:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LN4dd-0001Qk-6l for help-gnu-emacs@gnu.org; Wed, 14 Jan 2009 07:14:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LN4db-0001Oj-0H for help-gnu-emacs@gnu.org; Wed, 14 Jan 2009 07:14:24 -0500 Original-Received: from [199.232.76.173] (port=44627 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LN4da-0001Oe-Qt for help-gnu-emacs@gnu.org; Wed, 14 Jan 2009 07:14:22 -0500 Original-Received: from mail-ew0-f13.google.com ([209.85.219.13]:56403) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LN4da-0006L2-9b for help-gnu-emacs@gnu.org; Wed, 14 Jan 2009 07:14:22 -0500 Original-Received: by ewy6 with SMTP id 6so553094ewy.18 for ; Wed, 14 Jan 2009 04:14:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=b+VrKtPk0r3dqqCuvcAZiBbIRQd/O5l+TI3omXG/qzM=; b=lyB/96TB7a81JXOVfl/JzMsY4aVAPX3ZwvSQFKeoimd33CHBXBgqdaf1ooJN5/eBX9 5TuwgdTIsQvpMb0PIg6L79/PLxcAZgPwLlyVidx6LqUNH0plGPP7OHQiv7zdqr408nJ/ R8uig46YzmGABQtpXJ71KLTCdjS+0R6Ex4YJo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=T0Fl5ct3aBqhpTqLT1LVY/T/rIPqtNmy1rua7Oy90AFORJ7Y1Bi91Q67bjmwaN5uKB xZTeZKSeK9qo16kkou2n4+5BBlYzRQbFM/ymp9Q8ryLPMxi4FunJIYsCzwez/PWWx1dw g1hdybopG3bf4wIzdMQkcPFLm4K7TnpLRowF8= Original-Received: by 10.210.89.13 with SMTP id m13mr34524ebb.43.1231935260800; Wed, 14 Jan 2009 04:14:20 -0800 (PST) Original-Received: by 10.210.141.18 with HTTP; Wed, 14 Jan 2009 04:14:20 -0800 (PST) In-Reply-To: <50abee650901140332u1cd4727atd7324d1fedf5a9ac@mail.gmail.com> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:61326 Archived-At: On Wed, Jan 14, 2009 at 12:32, Joff wrote: > (defun set_recursive_dired () "Set dired mode to recursive view" > (interactive "p") > (setq dired-listing-switches "-lR")) > > (global-set-key (kbd "C-l") nil) > (global-set-key (kbd "C-l C-r") 'set_recursive_dired) > > because I thought setq might not be a command (?) `setq' is an elisp function (more properly, a "special form"; see the Emacs Lisp Intro), but it is not an interactive command. Functions bound to keys must be interactive commands. > which got me: > > call-interactively: Wrong number of arguments: (lambda nil "Set dired mode > to recursive view" (interactive "p") (setq dired-listing-switches "-lR")), 1 You are using (interactive "p"), which says that the function has an argument, but it has none. If you use just (interactive) it will work. See the documentation for function `interactive'. However, it's a bit weird that you need a keybinding just to set switches for dired. Doesn't it work if you just add (setq dired-listing-switches "-lR") to your .emacs file? Unless you don't always want these switches, of course. Juanma