From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: Changing buffer mode Date: Thu, 21 Jul 2022 15:41:13 -0300 Message-ID: References: <87v8rr6awo.fsf@dataswamp.org> <87r12eo6yf.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4909"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emanuel Berg , help-gnu-emacs To: carlmarcos@tutanota.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 21 20:42:44 2022 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 1oEb8G-00016o-Os for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 21 Jul 2022 20:42:44 +0200 Original-Received: from localhost ([::1]:50982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEb8F-0003qm-Bi for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 21 Jul 2022 14:42:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEb78-0003o8-3L for help-gnu-emacs@gnu.org; Thu, 21 Jul 2022 14:41:34 -0400 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:33686) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oEb72-0002y3-Mp for help-gnu-emacs@gnu.org; Thu, 21 Jul 2022 14:41:32 -0400 Original-Received: by mail-wr1-x436.google.com with SMTP id h9so3545238wrm.0 for ; Thu, 21 Jul 2022 11:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F9Nh38iUNKD+s4gcyu1liIlDPrB28VITRPNAY8a3hpU=; b=Sc1aUu2TOXbxWG4cLeuYUXJjDcZnUezyPf8CqKOVNQBlkIKm+N+OZV6VUqSLFn2vpV xvfWlaczW4bRFj1c2svk8NpyPB9tHHFCCQkn2jGiEtaNWjHgPKJOV/jyoM8Q+vAISi91 U932mzj9tUTH3JLwz5igkYIi0FdROld2b6G0a3MUWt2Hluz+94o0gJ58myOhMZKcI5xr HGVYOldUyiEFXxHBM6E0MFHvkTEzT4XvDnhRZGPKVNqVHk77MDafPFOI8x4mWpVcBg8r m5OrKy+/ewLeoLI3aR14wMBLVyglZoz0duK8sUKmZRXM9d0CdolTaUFz9eZ0/Wtv0zHw kD5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F9Nh38iUNKD+s4gcyu1liIlDPrB28VITRPNAY8a3hpU=; b=H4ysD/ZMx3gdZbQOhqNBY3wy9/Vxrm5Dm2sKwXDzSx0jOjHISnefaT0W1XbOUREQ8k qvVUtmJGR4Jp5QX6iI3O8mxh2yVnv1kiZ5RU7owTZBd1Vb7KQ6ZgChiGMlQ2SvsJor8y v5l/h5NeRhNyUDy1Q9zH3Wr+LXwBGsH5cLAFQ4MBNSLpmvSFayOuzromUbJQIfRmW5O7 BKP0vu3fyn5leWM8hCOIStwC0Ub57nIU3hGh3Xzngh3RbwH0HW5ui4IBvEhbu3Hw0mt0 plz8Dp6vUk84zwgJ19wMC+yJlR/hp/oSOeGLaQf9B71RDUzk/feM5Y3thFIwyi146nEe EGyw== X-Gm-Message-State: AJIora/xpaazNMw3NHKlELE7pZxjCBCzA331tRWLjVI7jteULoOUl5sw hXu3Z3rdbePbv1qmEKwRILxxLT9FHtw+jlsU0mE= X-Google-Smtp-Source: AGRyM1uO93co6U9tG5yEncE9IMlU/EaxXctJOMXns5c1CIxVKWap0VYg7fGtB8VlaNdcpB1l4X0qCEfRYfWEYzIhFQE= X-Received: by 2002:a5d:4607:0:b0:21d:93fb:aace with SMTP id t7-20020a5d4607000000b0021d93fbaacemr35801719wrq.704.1658428885658; Thu, 21 Jul 2022 11:41:25 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=eduardoochs@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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:138555 Archived-At: On Thu, 21 Jul 2022 at 12:56, carlmarcos--- via Users list for the GNU Emacs text editor wrote: > Have started with the following but with few ideas of how to supply appropriate value to buffer. > > (defun mode-sweep (mode) > "Cycle the buffer through three major modes (text, org, normal)." > > (interactive > (list > (let ( (cseq '("org-mode" "text-mode" "normal-mode")) ) > (completing-read "Major-mode: " cseq nil t "normal-mode")))) > > (with-current-buffer buffer > (funcall (intern mode))) ) Is cseq an existing function? Where can I find it? I have my own function to cycle between major modes, but it is ugly, and I would like to rewrite it using something like cseq... [[]], Edrx http://angg.twu.net/#eev