From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Stefan_M=C3=B6ding?= Newsgroups: gmane.emacs.help Subject: Re: Using comment characters for specific major modes Date: Sun, 06 Jun 2021 18:02:20 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5937"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 06 18:03:05 2021 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 1lpvEu-0001E5-Rd for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 06 Jun 2021 18:03:04 +0200 Original-Received: from localhost ([::1]:50902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpvEt-0005qI-1Z for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 06 Jun 2021 12:03:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpvEK-0005lK-PP for help-gnu-emacs@gnu.org; Sun, 06 Jun 2021 12:02:28 -0400 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:51822) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpvEH-0003jj-4o for help-gnu-emacs@gnu.org; Sun, 06 Jun 2021 12:02:28 -0400 Original-Received: by mail-wm1-x32c.google.com with SMTP id r13so8389115wmq.1 for ; Sun, 06 Jun 2021 09:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:user-agent:mail-copies-to :date:message-id:mime-version; bh=D3+jf4TtGJAyLd1FCdkxKgAtNDYXSGs3Vcfky4+hUXI=; b=jbPhB8Twz2ZgAFwvdj8TfAjkPEqSIsbzoozIVZgoqAyt+ylMmWG0wg+sWO7w8XPafk oJmJ5dI11/qAv0utdsCYyLLpzM+B2kK855GTVAJq8CUjNcqgZQXrN9e3WvOygBnuVM+v D5+UTFXJKwW1v9sTP8Iz5/y8lMcQYpe99x1IwrpNJIhdmdE65uE1/70yVxoxugVxHEt1 yL4Ooj7Gsk8/I/ex6lDGqjbGNESpCPzs22OvrrztqKRbAQFqcSZ6WiLDHly5bZ2hnuMq 4Cb8AZd5bMNxActdi03a7p1Pdr8HJVYQekqTdNqAM0Dh86DfJcUW2l0VTuqBdQDlUjHc sh7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references :user-agent:mail-copies-to:date:message-id:mime-version; bh=D3+jf4TtGJAyLd1FCdkxKgAtNDYXSGs3Vcfky4+hUXI=; b=DwF28cDz0f81AQfhGDJiYOmVKQoGr+IRVAsCB0lIOGJ5tESUugaXvLAP8scL93vUgJ 1z5UOckbklq8gTlY/2LvAzdcxh9VTaiyzQ7/24OAWG+cf/uHHnh1Rq52SprygAu+8tWy 3ugVJd88N53K21RDDnK6YyCIIAvEf9qTaGmHe0eSai3eBQN/EO0nd9qCbcQSoHmoRoss FUNBAtFSBCm0yoQrnLX+uc31jTSjdQ5/sEhSyvMxoTp8XINIXqy51u2qQLlJjdm1ky8m qr04zTISrD9ZJkNjeUwhtxbvsetkUR/71MzWz73B6rISPFjfiKp+B/FcZj6rLVTdeayh 5kvA== X-Gm-Message-State: AOAM531WDkSmCLbnxOYaV46D0FXvwq1SELSL4hFclotUMLYV8tq/UnAw VK/PL2H5nDgUhrUokbrgYADBFySAZP8= X-Google-Smtp-Source: ABdhPJx4SaU51l03p2gV20H86sxsXYXisSS1w+iFry9XLdT9rvZGlTpR27A0tIXPuyC8LBXTVvoh2A== X-Received: by 2002:a7b:c4da:: with SMTP id g26mr13173624wmk.64.1622995341966; Sun, 06 Jun 2021 09:02:21 -0700 (PDT) Original-Received: from athena.moeding.net (ip-176-199-80-138.hsi06.unitymediagroup.de. [176.199.80.138]) by smtp.gmail.com with ESMTPSA id b10sm15510821wrr.27.2021.06.06.09.02.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Jun 2021 09:02:21 -0700 (PDT) In-Reply-To: (martin-kemp@brusseler.com's message of "Sun, 6 Jun 2021 11:14:26 +0200 (CEST)") Mail-Copies-To: never Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=s.moeding@gmail.com; helo=mail-wm1-x32c.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 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:130580 Archived-At: martin-kemp@brusseler.com writes: > What I need is to set "cm" to ";;" for 'emacs-lisp-mode, "@c" for > texinfo-mode etc. The value returned by the cond form is the value of the selected cond clause. You can use the literals without calling any additional code: (let ((cm (cond ((eq major-mode 'emacs-lisp-mode) ";;") ((eq major-mode 'texinfo-mode) "@c") ... Remember that `cm' will be nil if nothing was matched. -- Stefan