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: Mon, 09 Nov 2009 02:44:36 +0200 Organization: JURTA Message-ID: <87ocnc8tuj.fsf@mail.jurta.org> References: <3b31caf90911051613w80af4cu61352a29ce5dcd77@mail.gmail.com> <87vdhoe73d.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 1257731840 21213 80.91.229.12 (9 Nov 2009 01:57:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Nov 2009 01:57:20 +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 Mon Nov 09 02:57:13 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 1N7JVI-0004Vq-RW for ged-emacs-devel@m.gmane.org; Mon, 09 Nov 2009 02:57:13 +0100 Original-Received: from localhost ([127.0.0.1]:43271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7JVI-00033L-DT for ged-emacs-devel@m.gmane.org; Sun, 08 Nov 2009 20:57:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7JUS-0002cE-Cb for emacs-devel@gnu.org; Sun, 08 Nov 2009 20:56:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7JUN-0002Zn-5i for emacs-devel@gnu.org; Sun, 08 Nov 2009 20:56:19 -0500 Original-Received: from [199.232.76.173] (port=36806 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7JUN-0002Zk-0m for emacs-devel@gnu.org; Sun, 08 Nov 2009 20:56:15 -0500 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:33626 helo=mx2.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N7JUM-00056Q-Ft for emacs-devel@gnu.org; Sun, 08 Nov 2009 20:56:14 -0500 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (62.65.208.58.cable.starman.ee [62.65.208.58]) by mx2.starman.ee (Postfix) with ESMTP id 145F13F412F; Mon, 9 Nov 2009 03:56:06 +0200 (EET) In-Reply-To: <87vdhoe73d.fsf@mail.jurta.org> (Juri Linkov's message of "Fri, 06 Nov 2009 03:45:45 +0200") 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:116725 Archived-At: > 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. Below is a patch that implements `ffap-literally' using `ffap-file-finder' and `call-interactively' like other similar functions do. It also adds `ffap-alternate-file-other-window' - the remaining missing find-file related function that has no keybinding. Index: lisp/ffap.el =================================================================== RCS file: /sources/emacs/emacs/lisp/ffap.el,v retrieving revision 1.86 diff -c -r1.86 ffap.el *** lisp/ffap.el 2 Oct 2009 03:48:40 -0000 1.86 --- lisp/ffap.el 9 Nov 2009 00:39:51 -0000 *************** *** 1435,1441 **** (string-match ffap-dired-wildcards filename) find-file-wildcards ;; Check if it's find-file that supports wildcards arg ! (memq ffap-file-finder '(find-file find-alternate-file))) (funcall ffap-file-finder (expand-file-name filename) t)) ((or (not ffap-newfile-prompt) (file-exists-p filename) --- 1435,1443 ---- (string-match ffap-dired-wildcards filename) find-file-wildcards ;; Check if it's find-file that supports wildcards arg ! (memq ffap-file-finder '(find-file ! find-alternate-file ! find-alternate-file-other-window))) (funcall ffap-file-finder (expand-file-name filename) t)) ((or (not ffap-newfile-prompt) (file-exists-p filename) *************** *** 1708,1713 **** --- 1710,1729 ---- (let ((ffap-file-finder 'find-alternate-file)) (call-interactively 'ffap))) + (defun ffap-alternate-file-other-window () + "Like `ffap' and `find-alternate-file-other-window'. + Only intended for interactive use." + (interactive) + (let ((ffap-file-finder 'find-alternate-file-other-window)) + (call-interactively 'ffap))) + + (defun ffap-literally () + "Like `ffap' and `find-file-literally'. + Only intended for interactive use." + (interactive) + (let ((ffap-file-finder 'find-file-literally)) + (call-interactively 'ffap))) + ;;; Bug Reporter: -- Juri Linkov http://www.jurta.org/emacs/