From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Rusi Newsgroups: gmane.emacs.help Subject: Re: Help with PHP setup Date: Fri, 20 Jul 2018 20:38:26 -0700 (PDT) Message-ID: <5668048e-4dc5-438f-a7f7-dacb89f99f81@googlegroups.com> References: <20180720165431792380014@bob.proulx.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1532144305 29119 195.159.176.226 (21 Jul 2018 03:38:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Jul 2018 03:38:25 +0000 (UTC) Injection-Date: Sat, 21 Jul 2018 03:38:26 +0000 User-Agent: G2/1.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 21 05:38:21 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgiip-0007Ud-NR for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Jul 2018 05:38:19 +0200 Original-Received: from localhost ([::1]:50583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgikw-0004oi-KE for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Jul 2018 23:40:30 -0400 X-Received: by 2002:a37:6256:: with SMTP id w83-v6mr2533027qkb.47.1532144306595; Fri, 20 Jul 2018 20:38:26 -0700 (PDT) X-Received: by 2002:ac8:65cc:: with SMTP id t12-v6mr70091qto.6.1532144306376; Fri, 20 Jul 2018 20:38:26 -0700 (PDT) Original-Path: usenet.stanford.edu!s10-v6no279021qth.0!news-out.google.com!k17-v6ni161qtj.0!nntp.google.com!s10-v6no279019qth.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Original-Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=117.195.53.182; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 117.195.53.182 Original-Xref: usenet.stanford.edu gnu.emacs.help:223405 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117530 Archived-At: On Saturday, July 21, 2018 at 5:07:36 AM UTC+5:30, Jean-Christophe Helary wrote: > On a different thread I just asked how to call the file in the front buffer without explicitly referring to its name and Eli was nice enough to point at the obvious answer: buffer-file-name. I have this in my emacs setup: (define-key minibuffer-local-map (kbd "C-f") (lambda () (interactive) (let ((file-path-maybe (buffer-file-name (window-buffer (minibuffer-selected-window))))) (insert (if file-path-maybe (file-name-nondirectory file-path-maybe) "%"))))) It emulates vi's replacement of % with filename with a more emacsish replace C-f with filename