From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: wdired-change-to-wdired-mode needs a key binding in dired-mode Date: Fri, 27 Jul 2007 23:53:41 -0400 Message-ID: References: <200707240216.l6O2GiND022670@oogie-boogie.ics.uci.edu> <7dbe73ed0707232231w790d93f4o8b095a19bdc1757f@mail.gmail.com> <87bqe2493t.fsf@ambire.localdomain> <87y7h15zrk.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1185594836 20839 80.91.229.12 (28 Jul 2007 03:53:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 28 Jul 2007 03:53:56 +0000 (UTC) Cc: dann@ics.uci.edu, Thien-Thi Nguyen , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 28 05:53:49 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IEdND-0006Fk-TC for ged-emacs-devel@m.gmane.org; Sat, 28 Jul 2007 05:53:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IEdNC-0004jk-T1 for ged-emacs-devel@m.gmane.org; Fri, 27 Jul 2007 23:53:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IEdNA-0004jf-BA for emacs-devel@gnu.org; Fri, 27 Jul 2007 23:53:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IEdN9-0004iS-Nu for emacs-devel@gnu.org; Fri, 27 Jul 2007 23:53:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IEdN9-0004i1-HX for emacs-devel@gnu.org; Fri, 27 Jul 2007 23:53:43 -0400 Original-Received: from tomts43.bellnexxia.net ([209.226.175.110] helo=tomts43-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IEdN9-0000Rw-0a for emacs-devel@gnu.org; Fri, 27 Jul 2007 23:53:43 -0400 Original-Received: from pastel.home ([70.53.195.62]) by tomts43-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070728035341.NHKR26794.tomts43-srv.bellnexxia.net@pastel.home> for ; Fri, 27 Jul 2007 23:53:41 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 96301896C; Fri, 27 Jul 2007 23:53:41 -0400 (EDT) In-Reply-To: <87y7h15zrk.fsf@jurta.org> (Juri Linkov's message of "Fri\, 27 Jul 2007 23\:59\:27 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-detected-kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:75736 Archived-At: > Since wdired doesn't work in modes that inherit from dired-mode, > it would be useful to leave the original binding to toggle-read-only > in them: Rather than "fix" each derived mode one by one, how 'bout doing (define-key dired-mode-map "\C-x\C-q" '(menu-item nil wdired-change-to-wdired-mode :filter (lambda (x) (if (eq major-mode 'dired-mode) x)))) Or maybe more simply create a new function dired-toggle-read-only which either calls wdired-change-to-wdired-mode or toggle-read-only depending on whether wdired makes sense or not (by testing (eq major-mode 'dired-mode) or whatever else). Stefan