From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Browder Newsgroups: gmane.emacs.help Subject: Re: How do I use a var as a string? Date: Fri, 29 Jul 2016 11:52:10 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a1134fea0b6ec870538c91489 X-Trace: ger.gmane.org 1469811222 28122 80.91.229.3 (29 Jul 2016 16:53:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Jul 2016 16:53:42 +0000 (UTC) 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 18:53:41 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 1bTB2a-0003Ob-So for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Jul 2016 18:53:41 +0200 Original-Received: from localhost ([::1]:60635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTB2U-0000gA-T5 for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Jul 2016 12:53:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTB1p-0000dr-Th for help-gnu-emacs@gnu.org; Fri, 29 Jul 2016 12:52:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTB1n-0000yA-Sd for help-gnu-emacs@gnu.org; Fri, 29 Jul 2016 12:52:52 -0400 Original-Received: from mail-oi0-x22f.google.com ([2607:f8b0:4003:c06::22f]:34021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTB1n-0000y5-Ns for help-gnu-emacs@gnu.org; Fri, 29 Jul 2016 12:52:51 -0400 Original-Received: by mail-oi0-x22f.google.com with SMTP id l65so113921801oib.1 for ; Fri, 29 Jul 2016 09:52:51 -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; bh=Aq1C9ErTNndAm/0HciEZacVakoPrJzDfrvZkOTpmw0U=; b=CUlshaK11f2BZk7PQ8/5xTHHQfKDrNqF6xIo5QwYqu07MsC6BXNJlM0xN2x/P5EWsR UHCQRiYzbHQ9OV1rigRLXvJ0R7E0i/wIOB9SS8xHS/mC09+9Gz2Aclcr4hoVPTfOUzXR jKf51ABJl8Hc9aY+7BinrnK4uXdkRxktHHQPNid+igXFRhQjI1ydCjx/E2ewkgPXIG8U soILZI6XqEzsv04cbb50zbRv1QPLI6j7qQmFtBjlGKJQa8tDqpVBMqI6nw9Ai6W2kYwm NQigNcz5gTjnc787kg2JN1NlhI4MZJI6dmAr8ob84sEBZ6Xd0o2Ahe46kB0nCgVAVP8d CQaQ== 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; bh=Aq1C9ErTNndAm/0HciEZacVakoPrJzDfrvZkOTpmw0U=; b=F8YmAfao2VOoyyK68wfOs47C12n7gDVxq9oUIQperSVPmW41i5GVgWCH161bw4gVN/ XGF1mGq9qtFPIvDJzdnCFEFPzhhzaxvYmVqd0wqp4UmEeT1ecFpUvmn/cxhyfR2S7TDG rZ+TiHrY8tKDi6HZRLjFcTZl2BMpVaWe3tmFiNpqNI14YkT3hKQOJLd4c9HFCnf3RUXR +mtECMPLtRQ6ZmaWVZda3d+gjIAtZMRnrS83YcfFObyQFnrFHYvjm9Em8z0vp0mxdyJy EHUv0uHx4Sc4g7ycRF08c1ztIlth26W3PxdZsy/omGnaSho1yYANJDgK9ERTocNwYxav 0wzQ== X-Gm-Message-State: AEkooutK6E1VOwCZ/Cw+U2nV4q9O38iN9fk1OpVx/rbf9sLvoveLXC6LwHPA2t6jla8VFZlRfpM91IxIOSPbpg== X-Received: by 10.157.22.153 with SMTP id c25mr28019574ote.111.1469811170658; Fri, 29 Jul 2016 09:52:50 -0700 (PDT) Original-Received: by 10.157.62.135 with HTTP; Fri, 29 Jul 2016 09:52:10 -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:4003:c06::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:111003 Archived-At: --001a1134fea0b6ec870538c91489 Content-Type: text/plain; charset=UTF-8 On Thu, Jul 28, 2016 at 11:42 AM, Tom Browder wrote: > I want to bind a string to a variable and then use the variable name as the > string when a string is expected. I have tried variations of this: > > (defvar my-str (concat "my " "string")) 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. If someone can show me a short, complete example that shows a var replacing an explicit regex that works I would greatly appreciate it. I have attached a short Perl 6 test file for testing the perl6-mode if anyone is interested (file 'test-imenu.p6'; it does NOT require Perl 6 to be installed). Best regards, -Tom --001a1134fea0b6ec870538c91489 Content-Type: application/octet-stream; name="test-imenu.p6" Content-Disposition: attachment; filename="test-imenu.p6" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ir7zkxyc0 IyBmaWxlOiB0ZXN0LWltZW51LnA2CgojIFBlcmwgNiBzeW50YXggZmlsZSBmb3IgdGVzdGluZyBw ZXJsNi1tb2RlIHdpdGggaW1lbnUgc3VwcG9ydCwgd2hpY2ggaXMgbG9jYXRlZCBhdDoKIwojICAg aHR0cHM6Ly9naXRodWIuY29tL3Ricm93ZGVyL3Blcmw2LW1vZGUgW2JyYW5jaDogIm15LWJyYW5j aCJdCgpteSAkYTsKbXkgQGI7Cm91ciAlYzsKCiBzdWIgYSgpe215IEB6ZX0KIG11bHRpIHN1YiB4 KCkge30KbWV0aG9kIGQoKSB7fQpteSBtdWx0aSBtZXRob2QgeigpIHt9Cm11bHRpIGMoKSB7fQo= --001a1134fea0b6ec870538c91489--