From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Chris Van Dusen Newsgroups: gmane.emacs.help Subject: Re: Adding major-mode selection to new buffer Date: Mon, 27 Jun 2022 19:28:06 -0500 Message-ID: <51505AC2-DFB5-42C3-AF32-B585C34F77C6@gmail.com> References: Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29775"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: carlmarcos@tutanota.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 28 02:29:27 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 1o5z6c-0007Xw-P7 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 28 Jun 2022 02:29:26 +0200 Original-Received: from localhost ([::1]:52866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5z6b-0007PR-Mh for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 27 Jun 2022 20:29:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5z5P-0007LS-PX for help-gnu-emacs@gnu.org; Mon, 27 Jun 2022 20:28:11 -0400 Original-Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]:44951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5z5O-0005Vy-5m for help-gnu-emacs@gnu.org; Mon, 27 Jun 2022 20:28:11 -0400 Original-Received: by mail-oi1-x233.google.com with SMTP id h65so15101060oia.11 for ; Mon, 27 Jun 2022 17:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=wikmCywylAtuZEnjf4mG63B2iDHuXlsRx5IU/CQlaz4=; b=JJWpsF6bNTRRKkah+VKOdsl97nDvyKk2VzpDMWOwTi7twX/REZEQiqzWz2gcXe6tWG +VOcylMoi/eyAx78NJQs44hXCdCKw67cynsu7hQpCh54MJzBdNWL6rvVpM9+hFhghU0B tR0Rgxc+toW6MW+nx0tJLcW+6Ypcz6j8AF2JM4X3i0zRHzdWi/P6qZc748Ef27IKPOrm C5smj3CaU1jlxrZ7Iz+00KVtSVUCXKxB9OwcdVGkkh6NVyf/zt/Nx2PK9UVYNMQKecjS HmA/UYDCBQHAXRv8EXWiqEmhenpdEqSk4IqMjDjiflNRlo2aWB1UVfJ4Q/DOkmTU7TSv LIKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=wikmCywylAtuZEnjf4mG63B2iDHuXlsRx5IU/CQlaz4=; b=UQYN50zG7Ju8qO5P3uee4MN/A1psoZVyH69KPghWksFFEjJyN6sWulMEFReuDjbT/B UKzeaTSWagARing0ms3TK70wDvuIkiQ9utXX+kF1qoGF4LazaqLDy2wBwdS/zqaoXXMr pVxgMAGiVEusDHmhJNNtNEh0cGQTJm+JjjmwZNpxVRbbDwidRPjEH5iixGMfwUZoikMo 23XUMT1brBAenDyaS0090hGiaXCf+xLuOHZgrufhnUz8uqdP6bkNGtNCFCUTAKYce5tr 39NGXR4g9TKOhUC7GVh91+6HC/fHRXu2XKuKfTFBOg7wFkaxJeLKV+RuOACFs+DVnTgJ Ngfg== X-Gm-Message-State: AJIora9B70T6t2w6H32cN1TI+IC58L3VMxRI6spuhUR4eHFHkLdjTKz3 4HUvAkFlnPKrpJYtN2jhgCdKHPLxkKE= X-Google-Smtp-Source: AGRyM1tjtSaoC51kSUTWmIoI3hEgQbR/mXokI+oO4asFy6B9hhs19GzOsgKLI2cHanv2b134hLd6CA== X-Received: by 2002:a05:6808:1797:b0:335:1e4e:41bf with SMTP id bg23-20020a056808179700b003351e4e41bfmr9710272oib.224.1656376088196; Mon, 27 Jun 2022 17:28:08 -0700 (PDT) Original-Received: from smtpclient.apple ([2600:1700:2f00:d980:d07f:3782:d4ca:b81d]) by smtp.gmail.com with ESMTPSA id l16-20020a056870f15000b00101bd4914f9sm7984859oac.43.2022.06.27.17.28.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jun 2022 17:28:07 -0700 (PDT) In-Reply-To: X-Mailer: iPhone Mail (19F77) Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=cavandusen@gmail.com; helo=mail-oi1-x233.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, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=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-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:138146 Archived-At: Check the scratch package to see if it fits your needs.=20 https://github.com/ieure/scratch-el Chris.=20 > On Jun 27, 2022, at 17:51, carlmarcos--- via Users list for the GNU Emacs t= ext editor wrote: >=20 > =EF=BB=BFWith the following function I can make a new buffer with a name. = Would also=20 > like to set the major-mode from the minibuffer. >=20 > Perhaps using `completing-read`=20 >=20 > (cseq '("sh-mode" "emacs-lisp-mode" "org-mode" "f90-mode" "c-mode" )) > (csel (completing-read "Major Mode: " cseq nil t "org-mode")) >=20 > How can I introduce the above functionality in the `workbench' function? >=20 > (defun workbench (&optional name) > "Make new buffer with unique name based on NAME." > (interactive "s Buffer Name: ") > (switch-to-buffer > (generate-new-buffer > (if (string-blank-p name) "wb" name))))