From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Reinhard Kotucha Newsgroups: gmane.emacs.devel Subject: dired-view-command-alist Date: Mon, 27 Sep 2004 04:00:32 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <16727.29760.450838.453550@zarniwoop.ms25.local> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1096250474 24756 80.91.229.6 (27 Sep 2004 02:01:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Sep 2004 02:01:14 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 27 04:01:00 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CBkp1-0007uW-00 for ; Mon, 27 Sep 2004 04:01:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CBkvD-0000gA-Nc for ged-emacs-devel@m.gmane.org; Sun, 26 Sep 2004 22:07:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CBkv5-0000fi-PE for emacs-devel@gnu.org; Sun, 26 Sep 2004 22:07:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CBkv3-0000es-SK for emacs-devel@gnu.org; Sun, 26 Sep 2004 22:07:15 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CBkv3-0000ep-J7 for emacs-devel@gnu.org; Sun, 26 Sep 2004 22:07:13 -0400 Original-Received: from [217.72.192.226] (helo=smtp08.web.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CBkod-0002rn-MT for emacs-devel@gnu.org; Sun, 26 Sep 2004 22:00:36 -0400 Original-Received: from [213.23.233.26] (helo=zarniwoop.ms25.local) by smtp08.web.de with esmtp (TLSv1:DES-CBC3-SHA:168) (WEB.DE 4.101 #44) id 1CBkoc-0003Gc-00 for emacs-devel@gnu.org; Mon, 27 Sep 2004 04:00:34 +0200 Original-Received: from zarniwoop.ms25.local (reinhard@localhost [127.0.0.1]) by zarniwoop.ms25.local (8.12.9/8.12.9) with ESMTP id i8R20WIT024150 for ; Mon, 27 Sep 2004 04:00:33 +0200 Original-To: emacs-devel@gnu.org X-Mailer: VM 7.18 under Emacs 21.3.50.2 X-Sender: reinhard.kotucha@web.de 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27592 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27592 Hi, I recently installed a CVS version of emacs. There is obviously a new feature: if you press "v" in dired mode then a program is launched according to the entries in dired-view-command-alist. The idea is not bad, but I think the user interface is. 1. It is IMO wrong to execute a program depending on the file name extension without asking the user. In most cases you want to run Perl on .pl files but you certainly do not want to do this if the .pl file is a TeX font property list. 2. It makes the features of the view mode unavailable for files that appear in dired-view-command-alist. The alternative is to use the function find-file-read-only but this very inconvenient as compared to view-mode. Some years ago, when emacs-20 was released, I wrote a small function which provides a similar feature but does not make other features unavailable. I just copied the function dired-do-shell-command to an other file, changed it's name, added some code and then bound it to the key "!". It behaves like this: 1. If you press "!" and there is no entry in shell-command-alist for the particular file, it behaves as usual. 2. If you have marked more than one file it behaves as usual. 3. If you have marked one or no file (in the latter case the position of the cursor is relevant), it adds something like (default: gv -antialias) to the minibuffer. Instead of "! on example.ps:" you get "! on example.ps (default: gv -antialias):" in the minibuffer. 4. If you just press the return key the default program (from shell-command-alist) is executed. But if you enter a program name before pressing the return key, this program is executed. The command history is still available. This has some advantages: 1. view-mode always works. 2. You can execute any program you want. The patch just provides a default, you can make use of it if you want or enter another program name or make use of the command history. I think that view-mode is quite useful and should behave as it behaved all the years, I don't want to miss it. So as a quick fix I added (setq dired-view-command-alist nil) to my ~/.emacs. But dired-do-shell-command can be improved. It does not have command completion, maybe this can be added in the future. But it is a great help to have an alist which provides some defaults. I think that something like dired-view-command-alist should better be integrated in dired-do-shell-command. And it should not execute any program without asking the user. It would be nice if you consider to change the user interface as described. Regards, Reinhard -- ---------------------------------------------------------------------------- Reinhard Kotucha Phone: +49-511-4592165 Marschnerstr. 25 D-30167 Hannover mailto:reinhard.kotucha@web.de ---------------------------------------------------------------------------- Microsoft isn't the answer. Microsoft is the question, and the answer is NO. ----------------------------------------------------------------------------