From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: Invoking a function from a list of functions Date: Thu, 08 Nov 2018 17:25:30 -0800 Message-ID: <87o9azoxdh.fsf@ericabrahamsen.net> References: <20181108230125.GA2179@mail.akwebsoft.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1541726661 11379 195.159.176.226 (9 Nov 2018 01:24:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Nov 2018 01:24:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 09 02:24:17 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKvWy-0002rt-Mc for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Nov 2018 02:24:16 +0100 Original-Received: from localhost ([::1]:59758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKvZ4-0006HE-Pi for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Nov 2018 20:26:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKvYZ-0006H7-5v for help-gnu-emacs@gnu.org; Thu, 08 Nov 2018 20:25:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKvYU-0000wp-EQ for help-gnu-emacs@gnu.org; Thu, 08 Nov 2018 20:25:54 -0500 Original-Received: from [195.159.176.226] (port=49285 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gKvYU-0000io-1l for help-gnu-emacs@gnu.org; Thu, 08 Nov 2018 20:25:50 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gKvWB-0001ur-Db for help-gnu-emacs@gnu.org; Fri, 09 Nov 2018 02:23:27 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:GnleOg489zMUNWKdLfA1XTmXeMg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118599 Archived-At: Tim Johnson writes: > Given a list of functions: > (setq funcs '(scroll-up-line scroll-down-line)) > > And assuming that these functions have a similar argument list, > I can invoke a function as: > > (funcall (nth 1 funcs)) > ;; or optionally > (funcall (nth 1 funcs) 2) > > That approach is sufficient for my needs at the moment, an example > of which might be to cycle through color themes invoked by my own > functions. > > However, in the quest for futher edification I'd welcome URLs to > documentation or discussion, as well as any contributions other > emacsen might choose to make. Keywords also. > > I had a heck of a time getting relevant responses from google. I > actually don't know what keywords to search with. It isn't clear to me, at least, what else you might be trying to achieve here. Is it more accurately selecting a function from within a list, using a keyword? Or cycling through functions in a list? You'll have a heck of a time getting relevant responses on this list, too, unless you tell us what you're after! :)