From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs Subject: bug#3230: 23.0.93; Make dired-actual-switches safe local variable? Date: Fri, 25 Feb 2011 22:38:21 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1298646427 17241 80.91.229.12 (25 Feb 2011 15:07:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 25 Feb 2011 15:07:07 +0000 (UTC) Cc: 3230@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 25 16:07:03 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PszG1-0006pD-2p for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Feb 2011 16:07:01 +0100 Original-Received: from localhost ([127.0.0.1]:43978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PszG0-00074o-9H for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Feb 2011 10:07:00 -0500 Original-Received: from [140.186.70.92] (port=42354 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PszFn-00071w-L5 for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2011 10:06:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PszFl-0004TV-Bp for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2011 10:06:46 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PszFl-0004TR-AO for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2011 10:06:45 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Psyov-0003EC-Qt; Fri, 25 Feb 2011 09:39:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Feb 2011 14:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3230 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 3230-submit@debbugs.gnu.org id=B3230.129864473012390 (code B ref 3230); Fri, 25 Feb 2011 14:39:01 +0000 Original-Received: (at 3230) by debbugs.gnu.org; 25 Feb 2011 14:38:50 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Psyoj-0003Dn-OF for submit@debbugs.gnu.org; Fri, 25 Feb 2011 09:38:49 -0500 Original-Received: from mail-pv0-f172.google.com ([74.125.83.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Psyoh-0003Db-PQ for 3230@debbugs.gnu.org; Fri, 25 Feb 2011 09:38:48 -0500 Original-Received: by pvd12 with SMTP id 12so267690pvd.3 for <3230@debbugs.gnu.org>; Fri, 25 Feb 2011 06:38:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=EuhKSidujUBgrrKruPV8lJcwIevEevjkuuSEiEMdTNQ=; b=UmIj2OObqE4rKKvPnkThAsKvYX1GICxsoTYrT4GIHTKht379do1mxTzGuuDh6JWEvc L/ByTWfQEt/eaQYbynjxFlq/WGmny94gXzzaBWWlM+IQe4aD7ShtmBOf4fooC9Hy7JxX DdRzsx2Q3625VIDos/rT1fGlG6YnKISC+66OM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; b=QjxGB0sorZmM1NWevadLg4ViZpaqoSkGFgrzNVAyF1toCwiZzNX/TtiuzLQBl7jCC5 h6Fl6T1T3aAkOSPJV8qY7Wb+2za2xPwtJMcuBUoenTJVsF2OC2p9oQms9cBhB9Qxv9WQ mtBi9XeEd+lAWYrysVhvv9wLU3t7vaD2C9iqA= Original-Received: by 10.142.188.2 with SMTP id l2mr1753940wff.4.1298644722002; Fri, 25 Feb 2011 06:38:42 -0800 (PST) Original-Received: from Victoria.local ([110.81.36.68]) by mx.google.com with ESMTPS id z1sm1056713wfd.9.2011.02.25.06.38.34 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Feb 2011 06:38:39 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Thu, 24 Feb 2011 09:57:04 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.94 (Mac OS X 10.6.6) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 25 Feb 2011 09:39:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44364 Archived-At: On 2011-02-24 22:57 +0800, Stefan Monnier wrote: > Hmm, what about "-l;reboot" ? Thanks. > BTW, writing a predicate is the right thing to so, and the predicate > should then go to safe-local-variable. I'd recommend something simple > like > > (defun dired-safe-switches-p (switches) > (string-match "\\`[- [[:alnum:]]]+\\'" switches)) A typo: should be [:alnum:]. > Hopefully that one is safe (tho maybe we should check string-length to > avoid attacks playing on overflow). And if it proves too restrictive, > we can make it a bit more permissive once we encounter a particular > example that warrants it. > > Stefan I think I like this. Glenn, would you agree to this? If this is accepted, I have one use case that can be easily done: I have one directory where I file regularly. I like that directory to be sorted by time instead of by name in dired. This change will allow me to set dired-actual-switches to achieve that. Leo