zsh-workers
 help / color / mirror / code / Atom feed
From: Hugo Haas <hugo@larve.net>
To: Wayne Davison <wayned@users.sourceforge.net>
Cc: zsh-workers@sunsite.dk, 262247@bugs.debian.org
Subject: Re: Bug#262247: zsh: Improved make completion
Date: Thu, 26 Aug 2004 12:10:53 -0400	[thread overview]
Message-ID: <20040826161053.GH19259@larve.net> (raw)
In-Reply-To: <20040821180920.GA24266@blorf.net>

[-- Attachment #1: Type: text/plain, Size: 2204 bytes --]

Hi Wayne.

* Wayne Davison <wayned@users.sourceforge.net> [2004-08-21 11:09-0700]
> On Wed, Aug 18, 2004 at 11:07:36AM -0400, Hugo Haas wrote:
> > Attached is an attempt at doing this. It seems to work, though I only
> > enabled it for the gnu case.
> 
> I tried your patch, and it ignored targets that had dependencies (since
> it only matched a colon at the end of the line).

Oh, that's right…

> Here's my attempt at a zsh-only verson of _make.  It not only
> follows include files, but it expands variables too.

It's pretty cool. I found an issue with the code though, which I don't
know how to work around: variable names are different in make and zsh.

In make:

  A variable name may be any sequence of characters not containing
  `:', `#', `=', or leading or trailing whitespace.

In zsh:

  A name may be any sequence of alphanumeric characters and
  underscores, or  the single  characters ‘*’, ‘@’, ‘#’, ‘?’, ‘-’,
  ‘$’, or ‘!’.

I guess that it's not a big deal: there will be cases where variables
won't be expanded, and certain rules will be missing, but it's better
than the previous code which didn't look at variables at all.

Also, the make documentation says:

  However, variable names containing characters other than letters,
  numbers, and underscores should be avoided, as they may be given
  special meanings in the future, and with some shells they cannot be
  passed through the environment to a sub-`make' (*note Communicating
  Variables to a Sub-`make': Variables/Recursion.).

Therefore, it's recommended to use cases which are actually going to
work with your code. So I think it's fine.

> I tried to make it handle both gnu and non-gnu include files, but I
> assume that the ".include <...>" form needs more code to handle
> where the include really resides.
> 
> Since the patch was larger than the new _make script, I'm just attaching
> the new _make script here.  Give it a try and see how you like it.

I think it's a great improvement on the current _make script, and
would be happy to see it included in zsh.

Regards,

Hugo

-- 
Hugo Haas - http://larve.net/people/hugo/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 307 bytes --]

      parent reply	other threads:[~2004-08-26 19:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040730101751.GA11905@larve.net>
2004-07-30 15:30 ` Clint Adams
2004-07-30 16:51   ` Hugo Haas
2004-08-18 15:07     ` Hugo Haas
2004-08-18 17:04       ` Wayne Davison
2004-08-21 18:09       ` Wayne Davison
2004-08-22  1:47         ` Bart Schaefer
2004-08-26 16:10         ` Hugo Haas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040826161053.GH19259@larve.net \
    --to=hugo@larve.net \
    --cc=262247@bugs.debian.org \
    --cc=wayned@users.sourceforge.net \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).