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.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1455 invoked from network); 30 Aug 2021 16:11:18 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 30 Aug 2021 16:11:18 -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 1mKjsS-00BFx5-Ug for ml@inbox.vuxu.org; Mon, 30 Aug 2021 11:11:17 -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 1mKjsS-000s18-9z for ml@inbox.vuxu.org; Mon, 30 Aug 2021 11:11:16 -0500 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1mKjsR-000s12-GR for ding@lists.math.uh.edu; Mon, 30 Aug 2021 11:11:15 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1mKjsM-001ddj-Ma for ding@lists.math.uh.edu; Mon, 30 Aug 2021 11:11:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:Mime-Version:References:Message-ID:Date:Subject: From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Qfy6EAxa1YMJ6tMJzU5uBBusDJ+Mj4nuC7ggDF+tfsc=; b=hw0feqsuL714nwnjcyJ5JHgvz5 AzHccMmMyJ5YP/Rxy6tYN0eoJOMKeu2H+cFSNEj3JWcOqbEJJYH2N3MArzBA57KkdhMtlzU2BP8gt HSfvA5W/kyFaj2JLRGkBxX71FtqzRV/C+h2HULkwKA8U1Gz/vDcAXLeE2qvSeCzklxNw=; Received: from ciao.gmane.io ([116.202.254.214]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mKjsF-0006yy-7w for ding@gnus.org; Mon, 30 Aug 2021 18:11:05 +0200 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mKjsD-0002sq-Ga for ding@gnus.org; Mon, 30 Aug 2021 18:11:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: ding@gnus.org From: Eric S Fraga Subject: Re: for a given emacs session: insert a subject with an increasing counter Date: Mon, 30 Aug 2021 17:10:56 +0100 Organization: On the Interweb somewhere Message-ID: <87h7f629rj.fsf@ucl.ac.uk> References: <87v93maplq.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:4UIuBEdvAb0deoJi2rRIRZ1XFrY= X-Url: http://twitter.com/ericsfraga/ List-ID: Precedence: bulk On Monday, 30 Aug 2021 at 18:01, Uwe Brauer wrote: > Does not work since the counter is not saved when increased. Why not save it then? I.e. something like this: (defun my-insert-add-counter () (interactive) (setq my-subject-counter (+ my-subject-counter 1)) (insert (int-to-string my-subject-counter))) [untested] HTH, eric PS by the way, there is an elisp function called 1+ which you might like to use ;-)) -- Eric S Fraga via Emacs 28.0.50 & org 9.4.6 on Debian 11.0