From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Cycle Org Shift Select Date: Mon, 09 Nov 2020 22:18:48 +0100 Message-ID: <87v9eefcuf.fsf@web.de> References: <87tutyguk0.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14750"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Help Gnu Emacs To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 09 22:19:17 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcEZI-0003ie-SC for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 09 Nov 2020 22:19:16 +0100 Original-Received: from localhost ([::1]:41864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcEZH-00007P-UZ for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 09 Nov 2020 16:19:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcEYw-000073-BR for help-gnu-emacs@gnu.org; Mon, 09 Nov 2020 16:18:54 -0500 Original-Received: from mout.web.de ([212.227.17.11]:35903) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcEYu-0004WL-FT for help-gnu-emacs@gnu.org; Mon, 09 Nov 2020 16:18:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1604956729; bh=NDMl7+RVni86CcnvyYrPJdsllKbnlp0dFW6gAQHXisc=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=CZQb3KMLQJEFrgsvdeuRV6LEanYtubiE58BGIjxLNTMXIYhPaO631wdxz9JKTH8Oc 3VRKLPuBR3p63OEehfKMGKwYQ0tiiOf4dGNlxInUvhCW5o/FIlWnz2le+ShmS7l0A3 4AlDXSXjdOMEXUOecWJbP5peDLGXparUvCue4z94= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([94.218.215.213]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MHmm4-1kZQzv16Xe-00ErT0; Mon, 09 Nov 2020 22:18:49 +0100 In-Reply-To: (Christopher Dimech's message of "Mon, 9 Nov 2020 21:35:14 +0100") X-Provags-ID: V03:K1:Dtb+D4b9znkc0jR5eCATcVtLlcZN6hpo1HDe85TL2yHcfeKuD3H LCDLmhaUpC4QRakhrezC/BOIW6ApcubrNdCEwazzoA7wX6N4HDTzQ38lVFG2gEvvWkjJBut EZNgDk6X3bs0TwLFjyS2pJD+RsCKeWq5npCeDmYCMZYmIyqOyT2lktYRjH7awdtK9LZ0ad4 e0BBDFSpzj+TDUPMx1iWw== X-UI-Out-Filterresults: notjunk:1;V03:K0:QnGytWZfL/4=:32ZfgRbk2aONa2hWMu30Fr 4WuADZxGYvNIupR1nMhxNUkJSYzJiCBJaMLrikHVWr5tRWwYuzjfQLOEJAJGMde9GsyUyrEnM ClPvtbHw6Myb9cCBfjkaArogvJdRZ/Wk7hgzIkbA3yDdUwOTjog9Ea8T3/htRtSLOG5+zqMNz YNYTr0RtQacw0geD2qni9EsqPeWVy0S36p4Ouf/GQqLjHuYPSiwynhR2ghd+y8nOmQPy/Rahc qKPkHWRSx95uMV7x1eRoVJJ+BsGZtSKDxZt0KIs0SLr38haHjgpRJFjuxgkwFcBHYmp9jxTb6 uxbjXokYqkJTiSmisHjBKpYwuCkQcn8ETTvq2aik5rMcihelRyTzW4ov7qXwBAkX3hlrHCXfw HSRiNacFZNRDQ9h8ZfPy1462zr8KHqsPKIVx0eNcQZBzVv1+2Axbjzv+4rXgaN0HKpHVV57+K Cquyh66MQ3t0BBruIvOZrNmm+RwAZyIWatGFNkTx3k8NQzX5Rc36TA/75fNgwAS1DmK/53So8 1ccWr1MfflIcwyaEckScr8LMjWQQGPbgI8A2tleRrqziUHa2V64JDHwhImc8FSL5Tpt+x/b34 kcq1WoQ0lAWWN/h80a/McCLSqO+C3RVT467LZHITNtE82Amj19dwCcZWlaRuvX4dZ5kDkyn3X yFiKMyYX12dz/kVUEkHy0/1wP0CJdKsaxVIxfFuDsL3Auuzu5CSn9cZE2vOuSxOGY/DAMTFE5 agpuRi402eMSXDaG17+h2pkClqNS5XDKWN+mqQILryTZqeJvpe0AgfUgw/yEwlIgV4QL0Z9f Received-SPF: pass client-ip=212.227.17.11; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/09 16:18:50 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125152 Archived-At: Christopher Dimech writes: > It can always start from the first item in the list. Then I can > check if (eq last-command this-command). That is, if the user calls > same command it will cycle. Can start with the first item in the list, > and when I get to the last, get back to the beginning. I would just use a special variable (defined globally with `defvar') to store your cyclic list. Then your command can just `pop' to get the next state. If you want the command can reinitialize the variable if (not (eq last-command this-command)). Michael.