From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Andrew W. Nosenko" Newsgroups: gmane.emacs.bugs Subject: bug#8439: [PATCH] ffap.el -- detect paths with spaces (v2) Date: Sat, 20 Oct 2012 00:47:55 +0300 Message-ID: References: <87pqoyaxu0.fsf@blue.sea.net> <874nlq9ah3.fsf@picasso.cante.net> <83a9vi23mi.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1350683325 1177 80.91.229.3 (19 Oct 2012 21:48:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Oct 2012 21:48:45 +0000 (UTC) Cc: hochberg@dmhsoftware.com, 8439@debbugs.gnu.org, Jari Aalto To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 19 23:48:51 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TPKQx-00088R-7h for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Oct 2012 23:48:47 +0200 Original-Received: from localhost ([::1]:39188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPKQq-0005VE-28 for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Oct 2012 17:48:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPKQk-0005P9-DW for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 17:48:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPKQg-00006j-UT for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 17:48:34 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPKQg-00006M-PN for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 17:48:30 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TPKS9-0001W7-QW for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 17:50:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Andrew W. Nosenko" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Oct 2012 21:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8439 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 8439-submit@debbugs.gnu.org id=B8439.13506833755793 (code B ref 8439); Fri, 19 Oct 2012 21:50:01 +0000 Original-Received: (at 8439) by debbugs.gnu.org; 19 Oct 2012 21:49:35 +0000 Original-Received: from localhost ([127.0.0.1]:52213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TPKRj-0001VO-41 for submit@debbugs.gnu.org; Fri, 19 Oct 2012 17:49:35 -0400 Original-Received: from mail-vb0-f44.google.com ([209.85.212.44]:43593) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TPKRh-0001VB-CV for 8439@debbugs.gnu.org; Fri, 19 Oct 2012 17:49:34 -0400 Original-Received: by mail-vb0-f44.google.com with SMTP id fc26so1217581vbb.3 for <8439@debbugs.gnu.org>; Fri, 19 Oct 2012 14:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=yQQYysxS3XYJaoHANMwnzKf7n9oCSVjOpgwQcQrZE+E=; b=QUT+LvYqLuVXr3ikjGmyhsnypuW1xahLF1VeJ2Fm4lhW9OWX2AD0xVA3jr1PDt1cow KhEpLOFZxpKeGeFz6H7m2pBpZrDxdcfynHTMwkDzXBPimcD9w3f0bq9eGqwCAp41YlSU CYRtd9oz3E5Iti857EsTmO7PApZWM1wSY0gZpelk6kdUpWOMyuA6T0yWqIlFG3aYxfdW z5Vtdgwlc/K+Xm/kLIykJxEqxIREGibhdWf1gino2UxRfJKCJeon+NxCkGxk+VfZmh82 ITEtZaE6yO13lzJcN9k096PFNZzfUl81d/KITp06tK0bRNRhXyqxoDAPu0k3sOTS28hj AJwA== Original-Received: by 10.58.32.234 with SMTP id m10mr3488951vei.60.1350683276045; Fri, 19 Oct 2012 14:47:56 -0700 (PDT) Original-Received: by 10.58.1.103 with HTTP; Fri, 19 Oct 2012 14:47:55 -0700 (PDT) In-Reply-To: <83a9vi23mi.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:65762 Archived-At: On Fri, Oct 19, 2012 at 12:49 PM, Eli Zaretskii wrote: >> From: Jari Aalto >> Date: Fri, 19 Oct 2012 10:39:36 +0300 >> Cc: Yigal Hochberg >> >> >> With some more field testing, the following patch works better. >> >> 1. New variable ffap-paths-with-spaces controls if the behavior is in use. >> By default it is set to "t" in Windows/Cygwin where spaces in paths >> are encountered. > > GNU Coding Standards frown upon using "path" for anything except > PATH-style lists of directories. Use "file name" or "leading > directories" instead. > >> 2. The "path skipping" is based on finding longest distance: >> >> - from first "drive letter", "/" or "\" >> - until last "/", "\" followed by last non-matching-char-not-usually-found-in-file-names > > What will this do to text such as the one below? > > C:\emacs\bin\prog1.exe on Windows or /usr/bin/prog1 on Unix. Eli, excuse me very much, but you cheating. Even under Unix (where spaces inside filenames are very unusual) people instinctively trying heavy to distinguish/decorate them from outside/descriptive text. The only one problem that there no consensus about how to do it. What characters pair to use? <>? ""? ''? But anyway just separate filename with possible spaces just by spaces... It's out of my ability to imagine. Therefore, I would to discard this example as rare. After all, any heuristic have his own false positives (and it is the reason, why I said "cheating": for every heuristic it's always possible to imagine a situation/input data when heuristic will fail). But, if there no way to make false positives amount small enough, I would to propose an idea for extension: find-file-at-region(). You just select a region of text, and Emacs tries to interprets it as default value for find-file(). > >> 3. In Cygwin Emacs the paths are expected to be in "/cygdrive//" >> format. > > What about Posix-standard /foo/bar/baz, which is the usual case on > Cygwin? > > > -- Andrew W. Nosenko