Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OK9xv-0006id-GW for mharc-grub-devel@gnu.org; Thu, 03 Jun 2010 08:56:07 -0400 Received: from [140.186.70.92] (port=40195 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OK9xp-0006gC-5p for grub-devel@gnu.org; Thu, 03 Jun 2010 08:56:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OK9xn-0003uf-Mw for grub-devel@gnu.org; Thu, 03 Jun 2010 08:56:01 -0400 Received: from smarthost03.mail.zen.net.uk ([212.23.3.142]:60263) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OK9xn-0003uL-If for grub-devel@gnu.org; Thu, 03 Jun 2010 08:55:59 -0400 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1OK9xl-0003Rq-GQ for grub-devel@gnu.org; Thu, 03 Jun 2010 12:55:57 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1OK9xl-0007ws-00; Thu, 03 Jun 2010 13:55:57 +0100 Date: Thu, 3 Jun 2010 13:55:56 +0100 From: Colin Watson To: grub-devel@gnu.org Message-ID: <20100603125556.GT21862@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost03-IP: [82.69.40.219] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH] Complete 'set root=(' X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 12:56:06 -0000 While reviewing the Texinfo documentation for references to GRUB Legacy constructs that needed to be updated, I found some discussion of completion that used "root (" as an example. For GRUB 2, this would need to become "set root=(" - but that doesn't work! The completion code isn't smart enough to complete only the part after the '=' in this case. What do people think about the following patch, which makes this work so that we can document it with a clear conscience? 2010-06-03 Colin Watson * normal/completion.c (grub_normal_do_completion): When completing arguments to "set" and the current word contains an equals sign, skip to after the equals sign before starting completion. === modified file 'normal/completion.c' --- normal/completion.c 2010-01-20 08:12:47 +0000 +++ normal/completion.c 2010-06-03 12:49:47 +0000 @@ -414,6 +414,14 @@ grub_normal_do_completion (char *buf, in else current_word = argv[argc - 1]; + if (argc > 1 && ! grub_strcmp (argv[0], "set")) + { + char *equals = grub_strchr (current_word, '='); + if (equals) + /* Complete the value of the variable. */ + current_word = equals + 1; + } + /* Determine the state the command line is in, depending on the state, it can be determined how to complete. */ cmdline_state = get_state (buf); Thanks, -- Colin Watson [cjwatson@ubuntu.com]