From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Regexp with comment character of buffer Date: Tue, 13 Aug 2024 00:11:59 +0700 Message-ID: References: <5my4_hPxAvHxrSRXBqG0sOdSxA9OXe9rRX9fl7efeXWgi5h6EAw4Oh3a7VllRQNz6URMUcjIPkRcOGMn6RCYxbF0Au7lTb2BCkm4ffPuv3A=@protonmail.com> Mime-Version: 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="17540"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 12 19:12:52 2024 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 1sdYbB-0004Lg-Tu for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 12 Aug 2024 19:12:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdYah-0003X5-84; Mon, 12 Aug 2024 13:12:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdYac-0003Wd-Vg for help-gnu-emacs@gnu.org; Mon, 12 Aug 2024 13:12:15 -0400 Original-Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdYaa-0007Z5-VF for help-gnu-emacs@gnu.org; Mon, 12 Aug 2024 13:12:14 -0400 Original-Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3db35ec5688so2844651b6e.3 for ; Mon, 12 Aug 2024 10:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723482731; x=1724087531; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gdDJ8t9ph3o0jhaR8746CN6edMbiGxz1C2uVeVh3q6I=; b=Hz4GD6+Ry7urS/TKA+XokMat5mBIwm12xgb+sFF+RYfBv7xpPxQAsgc9KO/HJOjC4W I8Ox2gZftgIbumgzrZuPjw6EvhABfRxNSHwcU8SSYW4OsNtHAUyBP0x7vAn3kMooi0e4 UyMwmQyrKVAzxnu6Tbf/LZudf6/1Y61S28E4C/0n0mu4WfNdjfmWW9xTEEFpBqCPtV0l URvqubwkKVXuLKOt0f/QPZGnVQSEI2zSAmz7hectbCqFpoJP7/xi7SSnkM3v91h3M14K ENz3OtyUZxtf99sKwMxGdyLkTMpukQi6u5xGOTFLI32GPmJl+v8Ogq54DllQGZZDfhi0 Bq2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723482731; x=1724087531; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gdDJ8t9ph3o0jhaR8746CN6edMbiGxz1C2uVeVh3q6I=; b=amZVjIgZtTTw64DhIsIKoF282LQhMPF9e0B1WOEEGoOSf77GEUyHtouMZAIncWS3+d 2IxkZZ4c1G/n/hfTZ/jqd0XQiCMN1ZThmT2tZrIn3w2Zt/Y3IgPkHoqsg1yXU7AKtcVk mfi+KolDoA/GhQwcI011JFPvXYSnZqB+WT8kMTadKkfFuW1hwUs2txRKWyN2eDG2bC6T RQYy5o7gHomHDqmgXfhTljWcRjplj3AYIOLW/SzBd/mvKLStBRaZrD4JS81Ex3wY2is+ NHr+4LzgaYfjRT8sAR0VH0TIjY4G+spmfYKG69BjyASRJ3qXhsb4LiLDcf5Jh/pj3ZIK QbDQ== X-Gm-Message-State: AOJu0YyW+Gv/rbSI8bUhX59U84FexTqI4zRymM1C3bEDvwzNwGkHBbFS /BXY+0nM6n7cflvLBiKll2XTe4h4JyUaUMSLnBDartdHGAWuh6ihv1ewHts77b6WpRM+6VtkR1v IiV1OkNOFSyQsG1ONtd5tzMFGYkU= X-Google-Smtp-Source: AGHT+IGlPOrAg1fff0S5i2ciKvGacU2pTwTsrzsccoy1VA6EZ3qIULqo35ZY+XoOxVaygfSHj04aHGAzDG3nNmIfawo= X-Received: by 2002:a05:6358:998f:b0:1a8:c0fd:cf2d with SMTP id e5c5f4694b2df-1b19d2c3499mr141443555d.9.1723482731424; Mon, 12 Aug 2024 10:12:11 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=yurivkhan@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, 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147641 Archived-At: On Mon, 12 Aug 2024 at 19:36, Heime wrote: > > > (let* ((comment-char (regexp-quote (string-trim comment-start))) > > > (three-comment-chars (make-string 3 (string-to-char comment-char))) > Is a string-trim required for comment-start ? Required *for comment-start*? No. What does the docstring for comment-start tell you? String to insert to start a new comment, or[=E2=80=A6] The space is there so that when the string is inserted, the user will be able to start typing the comment text and it will be separated from the delimiter. # comment in shell or Python ; comment in Elisp // comment in C++ /* comment in C */ Required for *your use* of comment-start? Maybe. Anyway, what=E2=80=99s your plan for modes whose comment-start is longer th= an a single character after trimming the space?