From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: find-file-literally-at-point Date: Fri, 06 Nov 2009 03:45:45 +0200 Organization: JURTA Message-ID: <87vdhoe73d.fsf@mail.jurta.org> References: <3b31caf90911051613w80af4cu61352a29ce5dcd77@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257474498 13444 80.91.229.12 (6 Nov 2009 02:28:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Nov 2009 02:28:18 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Edward O'Connor" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 06 03:28:10 2009 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 1N6EYc-00027y-3q for ged-emacs-devel@m.gmane.org; Fri, 06 Nov 2009 03:28:10 +0100 Original-Received: from localhost ([127.0.0.1]:47437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6EYb-0004Ef-IL for ged-emacs-devel@m.gmane.org; Thu, 05 Nov 2009 21:28:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6EYU-0004CD-HF for emacs-devel@gnu.org; Thu, 05 Nov 2009 21:28:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6EYP-00041a-IZ for emacs-devel@gnu.org; Thu, 05 Nov 2009 21:28:01 -0500 Original-Received: from [199.232.76.173] (port=49431 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6EYP-00041B-CA for emacs-devel@gnu.org; Thu, 05 Nov 2009 21:27:57 -0500 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:60272 helo=mx2.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N6EYO-0003Q7-V0 for emacs-devel@gnu.org; Thu, 05 Nov 2009 21:27:57 -0500 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (62.65.208.152.cable.starman.ee [62.65.208.152]) by mx2.starman.ee (Postfix) with ESMTP id D2B053F42FC; Fri, 6 Nov 2009 04:27:48 +0200 (EET) In-Reply-To: <3b31caf90911051613w80af4cu61352a29ce5dcd77@mail.gmail.com> (Edward O'Connor's message of "Thu, 5 Nov 2009 16:13:27 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:116670 Archived-At: > I recently found myself in need of such a function (I was going through > a bunch of files to strip out their UTF-8 BOMs, if you're curious), Oh, I see. That's what I regularly had to do on files produced by Windows editors :) Some time ago Emacs used to display BOMs, so it was easy to see and delete BOMs, but now doesn't anymore, since now the default coding system of files with the BOM is `utf-8-with-signature'. Forcing it to use `utf-8' with e.g. `C-x RET c utf-8 RET C-x C-f' is a way to display BOMs in an UTF-8 file. > and it was quick enough to put together: > > (autoload 'ffap-guesser "ffap") > (defun find-file-literally-at-point () > "Open the file at point (like `ffap') with `find-file-literally'." > (interactive) > (find-file-literally (ffap-guesser))) > > Is this something people might like to see added to ffap.el? When I added a few find-file related functions to ffap, I don't remember why I missed `find-file-literally'. Maybe because it has no keybinding (should we try to find one?). So we definitely need such a function. However, I wonder why you don't implement it using `ffap-file-finder' and `call-interactively', like e.g. `ffap-alternate-file' does? Like other ffap functions, it asks for a filename in the minibuffer, and allows to get the default behavior with C-u. -- Juri Linkov http://www.jurta.org/emacs/