all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: emacs-devel@gnu.org
Subject: Re: nnoo.el: how to update server variables
Date: Thu, 24 Dec 2015 17:55:15 +0100	[thread overview]
Message-ID: <87a8ozu6q4.fsf@gnus.org> (raw)
In-Reply-To: <874mla7a2e.fsf@vostro.rath.org> (Nikolaus Rath's message of "Sat, 11 Jul 2015 12:45:13 -0700")

Nikolaus Rath <Nikolaus@rath.org> writes:

> I am trying to update a server variable from one of (Gnus') backend
> functions. My first attempt was
>
> (defvoo nnimap-my-state nil)
> (deffoo nnimap-request-list (&optional server)
>   (nnoo-change-server 'nnimap server nil)
>   (message "Old state: %s" nnimap-my-state)
>   (setq nnimap-my-state 42))
>
> but that did not work (successive invocations would all run with
> nnimap-my-state being nil). After studying the nnoo.el sources for a
> bit, I concluded that nnoo-change-server updates the declared server
> variables to the per-server values, but does not copy any changes back.

I don't think that's correct.  When you change the server, nnoo will
stash all the values of all the "defvoo" values, and will copy them back
again when you change back to the original server.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



  reply	other threads:[~2015-12-24 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-11 19:45 nnoo.el: how to update server variables Nikolaus Rath
2015-12-24 16:55 ` Lars Ingebrigtsen [this message]
2015-12-27  4:09   ` Nikolaus Rath
2015-12-27  6:08     ` Lars Ingebrigtsen

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=87a8ozu6q4.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@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.