Authentication-Results: mail-b.sr.ht; dkim=pass header.d=phundrak.com header.i=@phundrak.com Received: from mail.phundrak.com (105.ip-51-83-47.eu [51.83.47.105]) by mail-b.sr.ht (Postfix) with ESMTPS id BC58211F008 for <~bzg/emacsfr@lists.sr.ht>; Wed, 15 Jun 2022 12:59:12 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5A8E3C0076 for <~bzg/emacsfr@lists.sr.ht>; Wed, 15 Jun 2022 14:59:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phundrak.com; s=dkim; t=1655297949; h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to: references; bh=ZS0biyds3TQHTsu0PSmJAj69y9fwpJ3HoEYH5P2AH8k=; b=Mt8YSCFc0gGcVdevrdrnWp2oyKWJXFZezxlsAGOfXBnHv/A23jGVsL/SBBfCGAUGpx6/AK Id2E/WWzb5UaABJvCeSjZjVtpCkiKH4TSru1zYCxIKTD/3BexSIP7PYn/1lEV/92BMdzUT Rud24z7fyg3cY33GWyvrvvV0GesivhM= From: Lucien Cartier-Tilet To: ~bzg/emacsfr@lists.sr.ht Subject: Re: Macro pour les variables custom Date: Wed, 15 Jun 2022 14:58:00 +0200 References: <87tu8m6qog.fsf@phundrak.com> User-agent: mu4e 1.6.11; emacs 29.0.50 In-reply-to: <87tu8m6qog.fsf@phundrak.com> Message-ID: <87sfo66q1v.fsf@phundrak.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="===-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Last-TLS-Session-Version: TLSv1.3 --===-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: multipart/mixed; boundary="==-=-=" --==-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Petite mise =C3=A0 jour du code apr=C3=A8s un retour sur le serveur Discord= de SystemCrafters=E2=80=AF: ,---- | (defmacro csetq (&rest forms) | "Bind each custom variable FORM to the value of its VAL. |=20 | FORMS is a list of pairs of values [FORM VAL]. |=20 | If FORM has a custom setter, use it to set FORM to VAL. | Otherwise, use `set-default'. |=20 | \(fn [FORM VAL]...)" | (declare (debug (&rest sexp form)) | (indent 1)) | ;; Check if we have an even number of arguments | (when (=3D (mod (length forms) 2) 1) | (signal 'wrong-number-of-arguments (list 'csetq (1+ (length forms))))) | (let (sexps) | ;; Transform FORMS into a list of pairs (FORM . VALUE) | `(progn ,@(progn | (while forms | (let ((form (pop forms)) | (value (pop forms))) | (push `(,(or (get `,form 'custom-set) | 'custom-set) | ',form | ,value) | sexps))) | (reverse sexps))))) `---- =2D- Lucien =E2=80=9CPhundrak=E2=80=9D Cartier-Tilet (Fran=C3=A7ais) (English) Sent from GNU/Emacs --==-=-=-- --=-=-=-- --===-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCAAyFiEEViv9D3b9mE+uAC3AvXeJ5wXLjcoFAmKp15wUHGx1Y2llbkBw aHVuZHJhay5jb20ACgkQvXeJ5wXLjcrrdQ/8DZllF0Pw6bYu9yFgkayl2tU4Fq9O wOwqgTcg/RP+fZa/E/2mqOQ1YpxDQz33lExoFXMK9/iMetsyqnHAGRJWVAMVXHHq 88FevLvVHTwuc3vd5VG4NW/FMaTaeY7vQhnLrcJIFBfUl+/uadQn1qPNnFX33wWf o6jWYznk4zXFx4hTck8xlTrOYtvi5tsa5u06kEM97jWwg6OIwOc2tnG8VQPr9MsD G51iSfBUJkMQo8DF/B6/SIf/msfs127mlVqt0Fy3vHwO4Qx2NkAEEYvqbzUcc6l5 eWAmrB+4TCRBJ2pdPz8k5yxtylf5Xa51uFWaVt37c5NnogyBv98JxOzoj9twi3DX 4mzBYerFkM9uD9cNSzOgkoYQydSNbtJUsIa+42QqxA/IWhj6IXF8zdTE12q/vj0i V7VB6FKgv+M0w0m/I1ykztwg5hdcIp7HuiwGswgvL508OomBNfhkSu/N9m0Nagx4 hTe17PQL321Y6oeMVWtotN0SKUTnjIBSIJw2RBp5XZLroq5WacxXlaj9KUCyixOG mDf1zdtf+MC5Hgkcl6S72JaxXTiGE2qwKSojVNdNisVL/dk9HrFwbJ4KRjn6OIqQ 5jcSlI9bvCvmmFTvPorHw9Q/jmxf/mRnCOxatRf8qm2Tl9sVK4vAkmrL/6DJuI56 dTRKYXnbuzoHmlY= =EOiV -----END PGP SIGNATURE----- --===-=-=--