unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Nikolaus Rath <Nikolaus@rath.org>
To: emacs-devel@gnu.org
Subject: Re: nnoo.el: how to update server variables
Date: Sat, 26 Dec 2015 20:09:02 -0800	[thread overview]
Message-ID: <87y4cgttwh.fsf@vostro.rath.org> (raw)
In-Reply-To: <87a8ozu6q4.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 24 Dec 2015 17:55:15 +0100")

On Dec 24 2015, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> 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.

Ok, so why doesn't the above work then?

Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«



  reply	other threads:[~2015-12-27  4:09 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
2015-12-27  4:09   ` Nikolaus Rath [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87y4cgttwh.fsf@vostro.rath.org \
    --to=nikolaus@rath.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).