Re: Completion: Tilde and environment variables

  • From: <tpgww@xxxxxxxxxxx>
  • To: emelfm2@xxxxxxxxxxxxx
  • Date: Mon, 2 Mar 2009 23:20:27 +1100

On Sun, 1 Mar 2009 14:09:00 +0100
kba <unixprog@xxxxxxxxxxxxxx> wrote:

> On Sun, Mar 01, 2009 at 11:39:57PM +1100, tpgww@xxxxxxxxxxx wrote:
> > On Fri, 27 Feb 2009 21:15:37 +0100
> > kba <unixprog@xxxxxxxxxxxxxx> wrote:
> > 
> > > Is it possible to complete from shortened home dirs (~/ for $HOME,
> > > ~john/ for /home/john etc.) directly?
> Somehow this does not work for me. When I enter '~/<Tab>' in a dir line,
> nothing happens, whereas when I enter '/home/kba/<Tab>' I get the wanted
> completion.

Until now, things like ~ or ~john were interpreted just before a command is 
run, and not interpreted at all before a directory is changed, and the 'tab 
completer' didn't do any interpretation either. I've just added those missing 
capabilities to svn code. Perhaps you'd like to test that.

> > 
> > Yes, this works in dir lines and command line.
> > 
> > > Another thing I would find nice to have is expansion of environment
> > > variables (like $HOME, $XDG_CONFIG_HOME) in dirline/commandline. Is this
> > > possible?
> > 
> > Yes. Also works for 'internal' variables.
> What is the right syntax for this? '$HOME' does not work, it just spits
> out "Directory '/home/kba/$HOME/' does not exist".
> I'm using emelFM2 v. 0.5.1

I forgot to mention - 0.5.1 does not cope with any $VAR in a commandline 
generally. It expects any $VAR to be distinct - at end of string or surrounded 
by whitespace. As it happens, I fixed this about a day after 0.5.1 release, and 
is now in svn. But even so, $VAR interpretation is not entirely structureless. 
If VAR is internal, we can check easily enough whether "$VAR<any text>" is 
meant to include that a variable. But for externals, there's too many 
combinations of variable and text to evaluate. So for externals you must use {} 
delimiters e.g. /path/${DATA}/subdir.

Also, dirlines did not interpret any $VAR (or %macro) until now, that was a 
FIXME. Now done, and in svn.


Users can unsubscribe from the list by sending email to 
emelfm2-request@xxxxxxxxxxxxx with 'unsubscribe' in the subject field or by 
logging into the web interface.

Other related posts: