From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: How do I use a var as a string? Date: Fri, 29 Jul 2016 10:20:23 -0700 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1469812886 7180 80.91.229.3 (29 Jul 2016 17:21:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Jul 2016 17:21:26 +0000 (UTC) Cc: Tom Browder To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 29 19:21:26 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bTBTR-0007rn-Pa for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Jul 2016 19:21:25 +0200 Original-Received: from localhost ([::1]:60722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTBTL-00018y-Jl for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Jul 2016 13:21:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTBSo-00018t-9B for help-gnu-emacs@gnu.org; Fri, 29 Jul 2016 13:20:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTBSl-0006bl-QQ for help-gnu-emacs@gnu.org; Fri, 29 Jul 2016 13:20:45 -0400 Original-Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]:35555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTBSl-0006bd-E3 for help-gnu-emacs@gnu.org; Fri, 29 Jul 2016 13:20:43 -0400 Original-Received: by mail-qk0-x22f.google.com with SMTP id s63so96792121qkb.2 for ; Fri, 29 Jul 2016 10:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CDKIiGBeTPWVLv94OxVadot5N1/cDO/EhUyB4e4YC2E=; b=l7VvoD3QNz1pMtBRKGCp8ViTOJt9mpETYVZZTXo6SKXSdnIEqL4UwELvtBcEEfer/Q Nwe6tnf3HxTTvdQet/rFKSU49SALSbyT9cKYwh2EvjWRBLWYBN0sfFMhTD31Xy/Hqfd4 20r+Ne5x7Pwhwms3KjfD2w+7JTJSKp0qpjHgmdwaQ6+baG96Sd8bVz9kqdkxb+lVyeOi zrn/6mF4WuMkOprkY+UhPBLNRnTT2/AYOet20SH5uNJ929ims0v1STLDyVI4kGYTWsWx iNJ0tMgO8q6gybjopMTPydWkPl+QOoIjKnCdUZBsp94V7Twdcab9SKM+wj94/K5re8Cy i49g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CDKIiGBeTPWVLv94OxVadot5N1/cDO/EhUyB4e4YC2E=; b=hd7jIPB1Oo70G4NDvugd5qmC0/C/OvMCLYM8H/m7tvPM+0hSZER/m8NdWqLxMNDTg7 3kJmrDvauQV/VKd7Bk7Tt3MRH4dZCWvfFa+voSehUcoxS4daDU80/ofgexKnk8TIv5CT hM1IAmnH1o4Y/ey5S1D5l1kmHp9STRyhYUFkVXawIqG2tfmBayv709+gmewEaB8TwC8P JPbuzzG5WZRzGyEG/MTemm3qqnbPEPQxy6xI2kH/2v3td5+k2sVKUZMwbnTli79fUp4f n1u/v2Xu3pqP5uOn4X1lfuYVPuQKapr+O7QnrN1TfOT20lc+qsFzOkEbuNuccy8dQ6c4 BUbw== X-Gm-Message-State: AEkoout9aNYo2gk3dSSYziUseYYrsLNVo+JweFrTkT5TM+vndfcK+XjWQaZy9CQm/TOOpgQbeEQnA3U5c/InjQ== X-Received: by 10.55.102.85 with SMTP id a82mr53981611qkc.173.1469812843014; Fri, 29 Jul 2016 10:20:43 -0700 (PDT) Original-Received: by 10.237.33.46 with HTTP; Fri, 29 Jul 2016 10:20:23 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::22f X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111004 Archived-At: Tom Browder wrote: > Here is the best I can do for the moment to show my actual problem. > The code is from an attempt at modifying the following code chunk > which is part of the file "perl6-imenu.el" (branch "my-branch") found > at my github account at: > > https://github.com/tbrowder/perl6-mode > > The working code chunk is at: > > https://gist.github.com/tbrowder/effb3ed0540591506015846b0511a045 > > and the chunk I'm trying to replace it with is here: > > https://gist.github.com/tbrowder/7959e77fcf5aee4be3edb342503cc282 > > The substitution of the explicit regex with the string var doesn't > work. It may be because of some problem with the scope of the > variables, and that is WAY beyond my elisp understanding at the > moment. I haven't followed this discussion in detail, but try this[1]. You used a quoted list in your definition of perl6-imenu-generic-expression, meaning the list isn't evaluated, meaning it contained the symbol `perl6-vars' rather than the value bound to that symbol (the regular expression you constructed). Instead, you probably want to use backquote. This is all a bit difficult to explain succinctly in an email, but this is a common point of confusion so there's plenty of material on "quote" and "backquote" (or sometimes "quasiquote") in Lisp out there. In Emacs's Elisp manual, check out the node "(elisp) Backquote". [1] https://gist.github.com/johnmastro/53535e8cbddf7c669788bc2a9105f70e Hope that helps John