From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Ingram Newsgroups: gmane.emacs.help Subject: Elisp newbie string to symbol help Date: Thu, 7 Mar 2019 11:36:57 -0500 Message-ID: <0b0ec3c9-dfb5-fc9a-df6b-d5debc786b5d@mtu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="196972"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 07 17:39:23 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1w3G-000p9C-I8 for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Mar 2019 17:39:22 +0100 Original-Received: from localhost ([127.0.0.1]:55038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1w3F-0007PS-G9 for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Mar 2019 11:39:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1w10-0005yJ-PI for help-gnu-emacs@gnu.org; Thu, 07 Mar 2019 11:37:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1w0z-00042k-8V for help-gnu-emacs@gnu.org; Thu, 07 Mar 2019 11:37:02 -0500 Original-Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:40945) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1w0y-00041v-VU for help-gnu-emacs@gnu.org; Thu, 07 Mar 2019 11:37:01 -0500 Original-Received: by mail-io1-xd36.google.com with SMTP id p17so14051175iol.7 for ; Thu, 07 Mar 2019 08:37:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mtu-edu.20150623.gappssmtp.com; s=20150623; h=from:subject:to:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=m5siO7LV7OZ/HCh6jsnG2kpHxH0QcfqmwQYZmmadXos=; b=xxeHaVNwIXigOZboMvqE8e1CCi4RK5JqBagwZsbmMQiNlJxQZNpaonzQAIYVI4P0Z8 8NMn51yjEYDISbNeWgCOkZ/L+L2M6WzqpVcmPiBuSB/UdkTEzuzAvNp7mSNvEG/Dqt56 IKKfxrVl+GiJaH3VlzcTmNFS1LBGQpaWdaVuQ/y7c+rbNbYUsOMaA2iJ/Kbc5wtqwWqP VcJlJwuh+DylJ6AjDEqszDsrbDcvyRY7rDt+b1muUCnACLEgGjs5cBdJfkl3CKuSfIxY wlusCKSE6Unqgbir2mu4e/KFko089XUEBWC620vkrzckLOAfIIdr4QFeG/rKLH3LMEGM X7vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=m5siO7LV7OZ/HCh6jsnG2kpHxH0QcfqmwQYZmmadXos=; b=OcWcftxvSpkdAqbmk1553+EawsGa9nC93Hdx4m0u4Olaotb4AqhRAiwM0+kSv+xzUi m1CyXWDBGKf3b4ogM0zKVzWorL87S+No/CPXd38cFLVyhfo6i9+B9kI2oF8v/yRRdr6N QjVCI/6cMTIcsvR66CiqDlNkBoAeUJKdFjF/66B8CVNDHPo8V+UUWUAOnwWlvk2Jy/Ug WCj4+giuHh9IOeGK6HmzYtFD2DYlxdTxNbWQmvZMIh1o3NyDwdg2FgDDu9WGehiSOvjo mXDqW6qwOWOll8HZyrkzIHLvPbNpFf8MliBmrn5GzuZ4BnzJCOHG0FMzCEG0i4pyONzM RSZQ== X-Gm-Message-State: APjAAAXVZ9SdxgyGd2QJ70CKgBEQ441gpJEDVvHcgARgdvn63ATFqsSa r6DkbBBIdPb2LLXMsZu0MdEJXlskKE0= X-Google-Smtp-Source: APXvYqweBgvVhOO7Lkd28xvo4BinC/tFclDw9fHhGmx0s/RDVXJddfuj266su13A5NDq41sCy8NhZA== X-Received: by 2002:a6b:f716:: with SMTP id k22mr7274495iog.110.1551976618956; Thu, 07 Mar 2019 08:36:58 -0800 (PST) Original-Received: from [141.219.232.201] (rover-232-201.rovernet.mtu.edu. [141.219.232.201]) by smtp.gmail.com with ESMTPSA id b20sm2118868ioj.12.2019.03.07.08.36.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 08:36:58 -0800 (PST) Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d36 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:119569 Archived-At: I'm looking for some help with a simple function I am trying to write. I'm a long time Emacs user but I have little experience with Emacs lisp. The issue I am having is with the load-theme lines. (defun my/theme-toggle ()   "Toggle between light to dark theme."   (interactive)   (require 'custom)   (let* ((current-theme (symbol-name (car custom-enabled-themes)))      (theme (substring current-theme 0                (- (length current-theme)                   ; Probably a better way to do this with regex?                   (if (string-suffix-p "dark" current-theme)                   (length "-dark")                 (length "-light"))))))   (if (string-suffix-p "dark" current-theme)       (load-theme (concat theme "-light"))     (load-theme (concat theme "-dark"))))   ;; (spaceline-emacs-theme)   (start-process "toggle Gtk theme" nil "~/bin/change-theme" "toggle")) I get the message "load-theme: Invalid theme name ‘spacemacs-dark’" which doesn't make sense as that is a theme I have installed.  I've tried quoting those lines but then it doesn't evaluate. How can I properly pass this concatenated string to load-theme? I vaguely understand that it is expecting a symbol not a string and I've tried passing the string to make-symbol but that just changed the error to "Undefined Custom theme spacemacs-dark" Any help is appreciated. Thanks, Thomas Ingram