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: FFAP Date: Fri, 06 Nov 2009 23:19:45 +0200 Organization: JURTA Message-ID: <87bpjfiark.fsf@mail.jurta.org> References: <3b31caf90911051613w80af4cu61352a29ce5dcd77@mail.gmail.com> <87vdhoe73d.fsf@mail.jurta.org> <87y6mkb6qr.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257544774 27801 80.91.229.12 (6 Nov 2009 21:59:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Nov 2009 21:59:34 +0000 (UTC) Cc: Edward O'Connor , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 06 22:59:27 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 1N6Wq6-00012U-LJ for ged-emacs-devel@m.gmane.org; Fri, 06 Nov 2009 22:59:26 +0100 Original-Received: from localhost ([127.0.0.1]:58405 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6Wq6-0006Xi-84 for ged-emacs-devel@m.gmane.org; Fri, 06 Nov 2009 16:59:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6Wpy-0006WP-QX for emacs-devel@gnu.org; Fri, 06 Nov 2009 16:59:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6Wpu-0006R2-Px for emacs-devel@gnu.org; Fri, 06 Nov 2009 16:59:18 -0500 Original-Received: from [199.232.76.173] (port=59699 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6Wpu-0006Qs-Ij for emacs-devel@gnu.org; Fri, 06 Nov 2009 16:59:14 -0500 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:41765 helo=mx2.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N6Wpt-0000Z6-Bi for emacs-devel@gnu.org; Fri, 06 Nov 2009 16:59:14 -0500 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.55.243.cable.starman.ee [82.131.55.243]) by mx2.starman.ee (Postfix) with ESMTP id F3AC43F4245; Fri, 6 Nov 2009 23:59:04 +0200 (EET) In-Reply-To: (Stefan Monnier's message of "Fri, 06 Nov 2009 10:18:32 -0500") 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:116692 Archived-At: > By "integration" I mostly mean the functionality, not necessarily > the code. But if it means preloading ffap.el, that's not necessarily > a bad thing, although I think that by integrating it, we can make it > a lot simpler, so I expect that a complete rewrite will be preferable > (especially since we probably wouldn't provide every single last detail > of ffap's functionality). I forgot that we already have a clean and small counterpart of ffap that can be preloaded instead of ffap.el. It is thingatpt.el. With (thing-at-point 'filename) it returns the filename at point, and with (thing-at-point 'url) it returns the URL at point. >> The idea is to put a file/URL from the text around the point into >> the minibuffer's default values list. So typing `C-x C-f M-n' >> on a file name will bring in it from the current buffer into the >> minibuffer. > > I thought about it but M-n is already used in some file prompts for > other purposes, Let's see what currently M-n does in file prompts (0. means the default input, and 1. - the minibuffer's content after one M-n): `C-x C-f' in a non-file buffer: 0. current directory name `C-x C-f' in a file buffer: 0. current directory name 1. file name of the current buffer `C-x C-v' in a file buffer: 0. file name of the current buffer 1. file name of the current buffer (the last case has duplicates) > so the user would then have to hit M-n more than once to get the > file-at-point, which makes it cumbersome. After adding a file name at point: `C-x C-f' in a non-file buffer: 0. current directory name 1. file name at point `C-x C-f' in a file buffer: 0. current directory name 1. file name of the current buffer 2. file name at point `C-x C-v' in a file buffer: 0. file name of the current buffer 1. file name at point So M-n more than once is only in a file buffer, where we could add a file name at point before the file name of the current buffer: `C-x C-f' in a file buffer: 0. current directory name 1. file name at point 2. file name of the current buffer > I think a dedicated keybinding would be better. Of course, a dedicated keybinding would be good as well. IIRC, the last time this has been discussed where Drew proposed `M-.' to yank text at point into the minibuffer in: http://thread.gmane.org/gmane.emacs.devel/50372 -- Juri Linkov http://www.jurta.org/emacs/