From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pierre Rouleau Newsgroups: gmane.emacs.help Subject: Re: Getting substring Date: Wed, 16 Aug 2023 23:07:35 -0400 Message-ID: References: <9fm604dCSvQkhO587DywcXOS5jONHikAYJ4WtrWnM8ZR89XF9PXE6TEG0R852J8kUWBUoxIWk6oZZcbgG7kgVG5jcX_UlCMSlESsIeywEhw=@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="4704"; 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 Thu Aug 17 05:08:24 2023 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 1qWTN2-0000xz-8e for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Aug 2023 05:08:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWTMW-0002v7-Q6; Wed, 16 Aug 2023 23:07:52 -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 1qWTMU-0002ue-Qu for help-gnu-emacs@gnu.org; Wed, 16 Aug 2023 23:07:50 -0400 Original-Received: from mail-vs1-xe34.google.com ([2607:f8b0:4864:20::e34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qWTMR-0003EF-Uw for help-gnu-emacs@gnu.org; Wed, 16 Aug 2023 23:07:50 -0400 Original-Received: by mail-vs1-xe34.google.com with SMTP id ada2fe7eead31-447c7607b72so2673773137.1 for ; Wed, 16 Aug 2023 20:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692241667; x=1692846467; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=mj456IAAMpal+pIzU8pHzK7Ymyt2hMJjVQpOiP4Lj2Y=; b=MOYoi1UAZJHuoFufITWbQnaiTc/3QzuApr5GbKvNJFYO9yPKEgMG2ID8UcQiEI3h1L zIwPqBdF0UhIbDsq9CNttHGOD3kerQdEjTzknypBmx37CNPzkflwEb0VsKW2PI9XaEUO /IO/kMqAJhxeVzVi0owZFPqqMK+CBbUoNwjO4zVz1JuBALHZhvpKGZ/EkvR4xu06UF/q 6Vf0+ykp8tABRdYVxpOaFPe4bW08uecYxtHkg/vYYyLzxqRdgdk5TOVIZylzSIxf3Gy2 SGiBOFmHvA15bNGBVaMMIi+XGAKmS9U+rCLNL3d8taqrt02ufVAEuIGQ1Z0k6wdRmOHe c83Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692241667; x=1692846467; h=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=mj456IAAMpal+pIzU8pHzK7Ymyt2hMJjVQpOiP4Lj2Y=; b=H2h/83E9wHIrwscpMQq+sgKmUULQLqESOfD6/HJXWo+KnmPy26H0xIa4efPBgSRueC mjZre8n/xRGB3zcdW1FQc/huvgjTyoV2sQnXjhNB66pxTdpjLfuG2j/s9P4YlTdpRXg0 vWCsPDOHPla7+r2SVpG974VHgdpEQJHV1TStQI6sB/gl3o1zJZ5/KG7FRb4Z4bccNYsj RYdORSGtg0x8M99kSL9bMp96/1v4YcsBrmfmfFpHtMQ65ibHlPw2zVinBF8tYdNk+3/P FcuwqPjB+D+Tt8NpMmsS1jRTo7zj/AE7V+hQnIWTX+FgZwESeD9XNHbB4bmHhSxxIfo3 c+qw== X-Gm-Message-State: AOJu0YyGNnAKb+cZW+kfzWjWoUfFbEf1z+xaDyMMTSM7tSDow393mN5f EZGOjLG748LeNZ32BjEQXJwcslkTUrZ8lOoraJEE0KCg X-Google-Smtp-Source: AGHT+IGIi2OJpyi14j07DZn/ybP9FTeR2OUzJINe4cwP4F/5hfjBfIUq5zwuzMVe/XvxO7Vq3BKGbANQz++sJD99DxU= X-Received: by 2002:a05:6102:cd:b0:440:a8c8:f34 with SMTP id u13-20020a05610200cd00b00440a8c80f34mr3741373vsp.3.1692241666768; Wed, 16 Aug 2023 20:07:46 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e34; envelope-from=prouleau001@gmail.com; helo=mail-vs1-xe34.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=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-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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:144849 Archived-At: Heime, I think you need to learn a little bit of Emacs Lisp, or Lisp. Read a book on Lisp to get you going. Asking questions like you do won't help you much. You first need to understand LIsp and the way it deals with functions, the concepts. LISPcraft from Robert Wilensky is old (1984) but small and it covers the basics which apply to Emacs Lisp. It's a nice read and the book is relatively small. On Wed, Aug 16, 2023 at 11:01=E2=80=AFPM Heime = wrote: > > > > > > Sent with Proton Mail secure email. > > ------- Original Message ------- > On Thursday, August 17th, 2023 at 2:52 PM, Heime < > heimeborgia@protonmail.com> wrote: > > > > > > > > > > > > > > Sent with Proton Mail secure email. > > > > > > ------- Original Message ------- > > On Thursday, August 17th, 2023 at 2:33 PM, Pierre Rouleau > prouleau001@gmail.com wrote: > > > > > > > > > I mean, > > > Executing : > > > > > > > (setq str "bigoplus =E2=A8=81=EF=B8=81") > > > > (message "%s TEST: " (car (split-string str))) > > > > > > prints bigoplus. > > > > > > but > > > > > > (message "%s TEST: " (car (split-string grafm))) > > > > > > will depend of what grafm holds. > > > > > > On Wed, Aug 16, 2023 at 10:30=E2=80=AFPM Pierre Rouleau prouleau001@g= mail.com > > > > > > wrote: > > > > > > > Why does the following not print the first word? > > > > > > > > > (message "%s TEST: " (car (split-string grafm))) > > > > > > > > Are you sure it does not print it? It prints bigoplus for me. > > > > You can also look into the 'Message' buffer to see what was printed > by > > > > the message function. - Pierre > > > > > > I now realise my mistake of putting "%s" before "TEST". I was thus doin= g > things > > correctly after all. > > > > The command (car (split-string grafm)) also works if there are no space= s > in > > 'grafm', it still returns the string as a first element in the list > result. > > Have started to wonder whether the following is wrong to do > > (setq grafm "bigoplus =E2=A8=81=EF=B8=81") > (pcase (car (split-string grafm)) > "bigoplus" ("Detected bigoplus")) > > It is not a string. > > --=20 /Pierre