all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Robert L." <No_spamming@noWhere_7073.org>
To: help-gnu-emacs@gnu.org
Subject: Re: ask for the value of several variables at once
Date: Fri, 9 Mar 2018 20:07:43 +0000 (UTC)	[thread overview]
Message-ID: <p7upie$14in$1@gioia.aioe.org> (raw)
In-Reply-To: 86muzhps3c.fsf@zoho.com

On 3/9/2018, Emanuel Berg wrote:

> > OK, but better (and much more difficult) to do
> > a function/macro which is used like this,
> > NB with no string or quotes to protect the
> > original symbols:
> > 
> >     (vars-and-values var-1 ... var-n)
> > 
> > which should give a list:
> > 
> >     (var-1 var-1-value ... var-n var-n-value)
> > 
> > or
> > 
> >     ((var-1 var-1-value) ... (var-n var-n-value))
> > 
> > Do it today - in a different way :)
> 
> This is how far I got - next step to make it
> work with a list of vars...
> 
>     (defmacro echo-var (var)
>       `(list ,(symbol-name var) ,var) )
>     ;; (echo-var fill-column) ; ("fill-column" 47)


(defun syms-status (&rest sym-list)
  (mapcar (lambda (s) (list s (symbol-value s))) sym-list))

(defmacro vars-status (&rest sym-list)
  `(quote ,(apply #'syms-status sym-list)))

(setq  foo 22  bar 88)
(vars-status foo bar)
 ===>
((foo 22) (bar 88))

-- 
[Amazon bans history book after it received 300 5-star reviews.]
http://archive.org/details/nolies


  parent reply	other threads:[~2018-03-09 20:07 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08 15:52 ask for the value of several variables at once Uwe Brauer
2018-03-08 16:08 ` tomas
2018-03-08 17:56   ` Uwe Brauer
2018-03-08 21:55     ` tomas
2018-03-09 18:13       ` Uwe Brauer
2018-03-09 20:07         ` Nick Dokos
     [not found]         ` <mailman.10352.1520626056.27995.help-gnu-emacs@gnu.org>
2018-03-09 20:24           ` Emanuel Berg
2018-03-09 23:44             ` Nick Dokos
     [not found]       ` <mailman.10340.1520619259.27995.help-gnu-emacs@gnu.org>
2018-03-09 19:36         ` Emanuel Berg
2018-03-14  9:26           ` Uwe Brauer
2018-03-14  9:42             ` Yuri Khan
     [not found]             ` <mailman.10592.1521020572.27995.help-gnu-emacs@gnu.org>
2018-03-14 10:31               ` Emanuel Berg
2018-03-14 11:53                 ` Yuri Khan
     [not found]                 ` <mailman.10597.1521028463.27995.help-gnu-emacs@gnu.org>
2018-03-14 12:47                   ` Emanuel Berg
2018-03-17 16:44                   ` Emanuel Berg
2018-03-17 17:25                     ` Emanuel Berg
2018-03-17 20:59                     ` John Mastro
     [not found]                     ` <mailman.10810.1521320411.27995.help-gnu-emacs@gnu.org>
2018-03-18 12:14                       ` Emanuel Berg
2018-03-18 12:30                         ` Emanuel Berg
2018-03-19 21:14                           ` John Mastro
2018-03-18 15:00                         ` Stefan Monnier
     [not found]                         ` <mailman.10837.1521385252.27995.help-gnu-emacs@gnu.org>
2018-03-18 15:09                           ` Emanuel Berg
     [not found]           ` <mailman.10591.1521019620.27995.help-gnu-emacs@gnu.org>
2018-03-14  9:39             ` Emanuel Berg
     [not found]     ` <mailman.10293.1520546129.27995.help-gnu-emacs@gnu.org>
2018-03-09  8:01       ` Emanuel Berg
2018-03-09  8:32         ` Emanuel Berg
2018-03-09  9:18           ` Emanuel Berg
2018-03-09 10:14             ` tomas
     [not found]             ` <mailman.10313.1520590498.27995.help-gnu-emacs@gnu.org>
2018-03-09 10:42               ` Emanuel Berg
2018-03-09 11:49                 ` tomas
     [not found]                 ` <mailman.10316.1520596187.27995.help-gnu-emacs@gnu.org>
2018-03-09 14:23                   ` Emanuel Berg
2018-03-09 18:18                 ` Uwe Brauer
     [not found]                 ` <mailman.10342.1520619737.27995.help-gnu-emacs@gnu.org>
2018-03-09 19:30                   ` Emanuel Berg
2018-03-09  9:19           ` tomas
     [not found]           ` <mailman.10308.1520587214.27995.help-gnu-emacs@gnu.org>
2018-03-09 10:09             ` Emanuel Berg
2018-03-09 10:21               ` tomas
2018-03-09 20:07           ` Robert L. [this message]
2018-03-09 20:17             ` Emanuel Berg
2018-03-09 10:03     ` Yuri Khan
2018-03-09 18:15       ` Uwe Brauer
     [not found]     ` <mailman.10310.1520589843.27995.help-gnu-emacs@gnu.org>
2018-03-09 10:05       ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='p7upie$14in$1@gioia.aioe.org' \
    --to=no_spamming@nowhere_7073.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.