help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with PHP setup


From: Rusi
Subject: Re: Help with PHP setup
Date: Fri, 20 Jul 2018 20:38:26 -0700 (PDT)
User-agent: G2/1.0

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]