From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joel Reicher Newsgroups: gmane.emacs.help Subject: Re: Get second character from comment-start Date: Tue, 13 Aug 2024 20:39:04 +1000 Message-ID: <86wmkkd7w7.fsf@gmail.com> References: <86o75xc8au.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24973"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) 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 Tue Aug 13 12:39:55 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 1sdowU-0006LO-Rd for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 13 Aug 2024 12:39:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdovp-0000Ml-IM; Tue, 13 Aug 2024 06:39:13 -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 1sdovn-0000MK-U6 for help-gnu-emacs@gnu.org; Tue, 13 Aug 2024 06:39:12 -0400 Original-Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdovm-0000YE-CE for help-gnu-emacs@gnu.org; Tue, 13 Aug 2024 06:39:11 -0400 Original-Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-7104f939aa7so4468853b3a.1 for ; Tue, 13 Aug 2024 03:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723545549; x=1724150349; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=5ZtHoYeepSWwm9gKRcpBNQuRPQ1oGSDbT7ezdtB4COU=; b=fJvDDiFCpSAGBW43NyEvLejoT/SEAQsMbs8ns5M3TqII9z3iIKsj0vhsGTOoi/8fqW jAoPZF7evt3U11siRZzN2NrYcsX3fgUdmjg+JIiB++Okg5ab8rvz1vG5JiFxckv79REx apV4QsJGIfXX3W2yemUcFqvUYG98G/8GZ8gb467H+eKUF83jmtIaCD5+qw9e1Ps3/coH c7mEQsZth6/acnb/qEx0qDHBsGTuxrV6Km/AEj7DCM1C5QV07h3G3HAnwB5cS/Fc3doc 8pYWw+oGonuOLZuKKGjMwrKV3SFmXAYu7G+l+afyT9HJNXGJDqjG6dhiKSJdz7hvq7MK aSGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723545549; x=1724150349; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5ZtHoYeepSWwm9gKRcpBNQuRPQ1oGSDbT7ezdtB4COU=; b=uVGj3kYiFOwl1oABvQeUYOyBYf0xc7Ra12MhuK/pO/l2cvw6q3C1nb7S0MC+m6mUcp jwRgX/++dzpg2Mdj+pE+RaVDdlaoJBr//DeG+dlSggS7YyZIl5Qons7XsuKFA/3FBc2Y ZWOh4wBl0guI2UIC3E8Qe9PQ+oXmub/UMjqBNo6iXZhDf6BTYz7UguXbpgPu7jlEKJwR GC6+8AuHpsiJeIJTFwovYfuRGj02CPdM1mGTSJlW3v3Mw62ZmOR0OdVNrWyw4jtYJbXy lXL8qCPLh4DSXm7iM7e0swVODfhLIWx95Gu4wkM5ufZQAoRY9Q1cX2/70CEs/EJXIqzm 4J7g== X-Gm-Message-State: AOJu0YyFfK7wHnU/j7vDewnJbkzj5EnWY2jRyBlLv+tzMVT625B0Lov/ hbaq7x6wOgGMBAnkBb8VJcP8hr4CrcoPtBLHUP/Aqia2nvNchvxdyO/IOZEO X-Google-Smtp-Source: AGHT+IE4irtTGEuJLzWy2ju3pZ2xnLEB5aqkgMlwy8PHwzx7MV7Y1P3FPy2rbnQtQViLm6VzAiXJaA== X-Received: by 2002:a05:6a20:d528:b0:1c4:8291:e94e with SMTP id adf61e73a8af0-1c8d75b19c9mr4087625637.45.1723545548557; Tue, 13 Aug 2024 03:39:08 -0700 (PDT) Original-Received: from LAPTOP-ACR66VVN (139-218-25-158.sta.wbroadband.net.au. [139.218.25.158]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201cd1b8ee4sm10709445ad.195.2024.08.13.03.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 03:39:08 -0700 (PDT) In-Reply-To: (Heime's message of "Tue, 13 Aug 2024 08:10:38 +0000") Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=joel.reicher@gmail.com; helo=mail-pf1-x42e.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:147657 Archived-At: Heime writes: > On Tuesday, August 13th, 2024 at 5:15 PM, Joel Reicher > wrote: > >> Any reason not to do (aref ... 1)? Not sure what you're worried >> about. > > What is the standard way of capturing characters from strings, > is it with aref ? I don't know what makes something "standard" for you. As covered in (info "(elisp) String Basics") a string is an array, and as covered in (info "(elisp) Array Functions"), aref can be used to fetch an element of an array. And as a random sample of some core code, aref is used 17 times in files.el from what I can see. Cheers, - Joel