From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Steven Tamm Newsgroups: gmane.emacs.devel Subject: Re: find-file dialog in Carbon Emacs is broken Date: Sat, 9 Oct 2004 20:07:19 -0700 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <7F5EF7DC-1A69-11D9-9A62-000D93B67DC4@mac.com> References: <2E4D1BEC-197D-11D9-8298-00039384A728@rice.edu> <5860A2EC-1A19-11D9-BB9A-000D93505B76@swipnet.se> <20041009184338.GB22402@fencepost> <20041009192700.GA29314@fencepost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1097377678 3283 80.91.229.6 (10 Oct 2004 03:07:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Oct 2004 03:07:58 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 10 05:07:46 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 1CGU3l-0002aq-00 for ; Sun, 10 Oct 2004 05:07:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CGUAd-00039V-R8 for ged-emacs-devel@m.gmane.org; Sat, 09 Oct 2004 23:14:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CGUAW-00038Q-NS for emacs-devel@gnu.org; Sat, 09 Oct 2004 23:14:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CGUAV-00037F-Vx for emacs-devel@gnu.org; Sat, 09 Oct 2004 23:14:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CGUAV-000376-R9 for emacs-devel@gnu.org; Sat, 09 Oct 2004 23:14:43 -0400 Original-Received: from [17.250.248.84] (helo=smtpout.mac.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CGU3P-0004jq-8Q for emacs-devel@gnu.org; Sat, 09 Oct 2004 23:07:23 -0400 Original-Received: from mac.com (smtpin07-en2 [10.13.10.152]) by smtpout.mac.com (8.12.6/MantshX 2.0) with ESMTP id i9A37LMU022786 for ; Sat, 9 Oct 2004 20:07:21 -0700 (PDT) Original-Received: from [10.0.1.201] (c-24-5-11-73.client.comcast.net [24.5.11.73]) (authenticated bits=0) by mac.com (Xserve/smtpin07/MantshX 4.0) with ESMTP id i9A37Knb029054 for ; Sat, 9 Oct 2004 20:07:21 -0700 (PDT) In-Reply-To: Original-To: "emacs-devel '" X-Mailer: Apple Mail (2.619) 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:28163 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28163 Another distinction is whether or not we mean to open a file or a directory. To make the distinction in both the w32 & OSX code, we check for the prompt starting with "Dired". That makes me ill. It also figures out if it's open vs. save by comparing the directory with the default_filename (i.e. if there is no default filename, then it must be open). If we are going to change any semantics, we should also specify whether or not it is trying to open a file, open a directory, or save: Distinct from mustmatch. Right now, the code I have uses the following decision tree: - If prompt starts with "Dired" use a ChooseFolderDialog - If mustmatch, use the ChooseFileDialog - If the directory is the same as the default_filename, use ChooseFileDialog - Otherwise use the PutFileDialog With newer sematics, the dialogs would "do the right thing." For example, if the request was "open file"and mustmatch was t, then I should use the standard ChooseFileDialog. If mustmatch was nil, it's still "open file" but I would have to present the ability to enter a filename, which is not supported by default in the OS (but easy to add). -Steven On Oct 9, 2004, at 1:20 PM, Jan D. wrote: > >>> >>> No, it is no good at all. Most operations doesn't set MUST-MATCH >>> when >>> an existing file is to be opened. >> >> I can see two possibilities for such cases: (1) they are broken >> because they >> really do need an existing file, but don't ask for one, and (2) they >> really >> can handle entry of a non-existant filename (like find-file). > > First we must agree on what MUST-MATCH means. The Motif dialog box > thinks MUST-MATCH means that the user must select a file that exists > and has the name of the default file (or initial). The file name can > not > be changed by the user. This is for example the case when doing > next-error > but the current directory is wrong, so the user is basically asked to > change to the correct directory and select the file suggested by Emacs. > > But for read-file-name the user is only presented with the default file > name, but can change it. > > In the first case, ediff is not broken. In the second case it is, and > so > is the code for the Motif dialog. > > Jan D. >