all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* find-file-at-point expanding environment variables?
@ 2010-04-13 22:58 David Rogoff
  2010-04-14  0:31 ` David Rogoff
  0 siblings, 1 reply; 4+ messages in thread
From: David Rogoff @ 2010-04-13 22:58 UTC (permalink / raw)
  To: help-gnu-emacs

I could use some help.  I use ffap (bound to c-x c-f) all the time. 
However, I edit many files in which there are references to filenames 
that use shell environment variables as part of the path.  For example 
-  /home/${USER}/.cshrc .  Is there a way for ffap to expand/substitute 
this?  It would make my life a lot easier.

Thanks,

 David



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: find-file-at-point expanding environment variables?
  2010-04-13 22:58 find-file-at-point expanding environment variables? David Rogoff
@ 2010-04-14  0:31 ` David Rogoff
  2010-04-14  9:31   ` Andreas Politz
  0 siblings, 1 reply; 4+ messages in thread
From: David Rogoff @ 2010-04-14  0:31 UTC (permalink / raw)
  To: help-gnu-emacs

On 2010-04-13 15:58:31 -0700, David Rogoff said:

> I could use some help.  I use ffap (bound to c-x c-f) all the time. 
> However, I edit many files in which there are references to filenames 
> that use shell environment variables as part of the path.  For example 
> -  /home/${USER}/.cshrc .  Is there a way for ffap to expand/substitute 
> this?  It would make my life a lot easier.

I did some experimenting and see that ffap will expand variables ... 
except if they are enclosed in curly braces. This isn't too bad a 
limitation, but it would be better if I didn't have to edit the files 
and remove the curly braces.

 David



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: find-file-at-point expanding environment variables?
  2010-04-14  0:31 ` David Rogoff
@ 2010-04-14  9:31   ` Andreas Politz
  2010-04-14 17:38     ` David Rogoff
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Politz @ 2010-04-14  9:31 UTC (permalink / raw)
  To: help-gnu-emacs

David Rogoff <david@therogoffs.com> writes:

> On 2010-04-13 15:58:31 -0700, David Rogoff said:
>
>> I could use some help.  I use ffap (bound to c-x c-f) all the
>> time. However, I edit many files in which there are references to
>> filenames that use shell environment variables as part of the path.
>> For example -  /home/${USER}/.cshrc .  Is there a way for ffap to
>> expand/substitute this?  It would make my life a lot easier.
>
> I did some experimenting and see that ffap will expand variables
> ... except if they are enclosed in curly braces. This isn't too bad a
> limitation, but it would be better if I didn't have to edit the files
> and remove the curly braces.
>
> David

(add-to-list 'ffap-string-at-point-mode-alist
             '(file "--:\\\\$+<>@-Z_[:alpha:]~*?{}" "<@" "@>;.,!:"))
             
Try this.
-ap


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: find-file-at-point expanding environment variables?
  2010-04-14  9:31   ` Andreas Politz
@ 2010-04-14 17:38     ` David Rogoff
  0 siblings, 0 replies; 4+ messages in thread
From: David Rogoff @ 2010-04-14 17:38 UTC (permalink / raw)
  To: help-gnu-emacs

On 2010-04-14 02:31:29 -0700, Andreas Politz said:

> David Rogoff <david@therogoffs.com> writes:
> 
>> On 2010-04-13 15:58:31 -0700, David Rogoff said:
>> 
>>> I could use some help.  I use ffap (bound to c-x c-f) all the
>>> time. However, I edit many files in which there are references to
>>> filenames that use shell environment variables as part of the path.
>>> For example -  /home/${USER}/.cshrc .  Is there a way for ffap to
>>> expand/substitute this?  It would make my life a lot easier.
>> 
>> I did some experimenting and see that ffap will expand variables
>> ... except if they are enclosed in curly braces. This isn't too bad a
>> limitation, but it would be better if I didn't have to edit the files
>> and remove the curly braces.
>> 
>> David
> 
> (add-to-list 'ffap-string-at-point-mode-alist
>              '(file "--:\\\\$+<>@-Z_[:alpha:]~*?{}" "<@" "@>;.,!:"))

Great -it appears to work perfectly!

Thanks,

 David



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-14 17:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-13 22:58 find-file-at-point expanding environment variables? David Rogoff
2010-04-14  0:31 ` David Rogoff
2010-04-14  9:31   ` Andreas Politz
2010-04-14 17:38     ` David Rogoff

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.