From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 12 09:46:27 2017 Received: (at 25425) by debbugs.gnu.org; 12 Jan 2017 14:46:27 +0000 Received: from localhost ([127.0.0.1]:50740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRge3-0005nV-5t for submit@debbugs.gnu.org; Thu, 12 Jan 2017 09:46:27 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21097) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRge1-0005nM-Kv for 25425@debbugs.gnu.org; Thu, 12 Jan 2017 09:46:26 -0500 Received: from localhost (xd933e5de.dyn.telefonica.de [217.51.229.222]) by mx.zohomail.com with SMTPS id 1484232379732247.56501610128362; Thu, 12 Jan 2017 06:46:19 -0800 (PST) References: <87shoo7dgx.fsf@mdc-berlin.de> <87r34879o1.fsf@elephly.net> <87bmvc2vjn.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.1.1 From: Ricardo Wurmus To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#25425: cannot express search path In-reply-to: <87bmvc2vjn.fsf@gnu.org> Date: Thu, 12 Jan 2017 15:46:15 +0100 Message-ID: <87lgug72vc.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 25425 Cc: 25425@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Ludovic Courtès writes: > I think this should work: > > (search-path-specification > (variable "LUA_PATH") > (separator ";") > (files '("share/lua/5.3")) > (file-pattern "\\.lua$") > (file-type 'regular)) I tried this very same thing but it doesn’t work because Lua expects placeholders (“?”) in the search paths. The placeholders are replaced with the actual package names. If the actual file name does not exist it will try the next pattern. If the file *does* exist – which *will* be the case for any of the files on LUA_PATH that have been generated by the search-path-specification — Lua will try to load the package from that path. This will fail because a search for the “lpeg” module would be satisfied by the file “re.lua”, because that’s the first valid file on the LUA_PATH. “re.lua” requires “lpeg” itself, so another lookup is performed, which will again result in “re.lua” to be loaded… AIUI we must generate a value for LUA_PATH that keeps the placeholders intact. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC http://elephly.net