From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2291 invoked from network); 31 Aug 2021 16:30:06 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 31 Aug 2021 16:30:06 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mL6eB-00Bsi8-Tg for ml@inbox.vuxu.org; Tue, 31 Aug 2021 11:30:04 -0500 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1mL6eB-0014xF-8Y for ml@inbox.vuxu.org; Tue, 31 Aug 2021 11:30:03 -0500 Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1mL6eA-0014x9-31 for ding@lists.math.uh.edu; Tue, 31 Aug 2021 11:30:02 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mL6e5-00Bshn-1d for ding@lists.math.uh.edu; Tue, 31 Aug 2021 11:30:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kj/OVQ+ST1CudmPDgKWyK0WmTkbCqoh0h1+rQMWlp7E=; b=WBMSqU+PI3WWRiJx4UzOCwZl8p SU+/2ziT5D2p3qUfFF/m3yfrui7slIdYmPXnXrxfhT9O3watzSM6UwPvyFcoXarJQg1Jf86q7eyQM 9f457thI8U4hmrzjXff3j7McUIm7wgHsoWfEL0rmVFo2cH0SClsnsEuUJBbYCtUr1qM4=; Received: from mail.ericabrahamsen.net ([52.70.2.18]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mL6du-0004nv-9c for ding@gnus.org; Tue, 31 Aug 2021 18:29:50 +0200 Received: from localhost (24-113-148-110.wavecable.com [24.113.148.110]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 742D5FA07E for ; Tue, 31 Aug 2021 16:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1630427382; bh=kj/OVQ+ST1CudmPDgKWyK0WmTkbCqoh0h1+rQMWlp7E=; h=From:To:Subject:References:Date:In-Reply-To:From; b=C/p4D936F9qqMMi+ksRxM+b3aipKEgUu+emobCzZug3GZIuCWWbVutODvuvICRsbf H238kLTsdWS+47vb+UYVc/kuGITRLN1QqFqsD7zUlent7U3EBy+rSiWRgosZ1OoWvc TFRM79smYsodZzZROPAwUnkHghGYyTZssOyvZIys= From: Eric Abrahamsen To: ding@gnus.org Subject: Re: for a given emacs session: insert a subject with an increasing counter References: <87v93maplq.fsf@mat.ucm.es> <87h7f629rj.fsf@ucl.ac.uk> <87o89e85vg.fsf@mat.ucm.es> <871r6a2h49.fsf@zoho.eu> <87r1e9bo3g.fsf@mat.ucm.es> Date: Tue, 31 Aug 2021 09:29:41 -0700 In-Reply-To: <87r1e9bo3g.fsf@mat.ucm.es> (Uwe Brauer's message of "Tue, 31 Aug 2021 18:01:07 +0200") Message-ID: <87h7f5mvbe.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-ID: Precedence: bulk Uwe Brauer writes: >>>> "EB" == Emanuel Berg writes: > >> Uwe Brauer wrote: > > Thanks for your advice: > > I have now > > (defun my-reset-subject-counter () > "Reset the counter to ZERO!" > (interactive) > (setq my-subject-counter 0) > (message "Counter value is NOW: %s" my-subject-counter)) > > (defun my-new-insert-subject-counter (total) > "Insert a string of the form [`counter/Total'] " > (interactive "nTotal number: ") > (save-excursion > (setq my-subject-counter (+ my-subject-counter 1)) > (message-carefully-insert-headers (list (cons 'Subject (format "[%s/%s]" my-subject-counter total)))))) > > But this part I don't understand > > >> (require 'cl-lib) > >> (defun ... >> (cl-incf my-subject-counter) ... ) The line above "increments" an integer variable "in place", in other words that line is the exact equivalent of: (setq my-subject-counter (+ my-subject-counter 1)) In effect, the `cl-incf' "contains" the `setq' inside it.