From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Greg Hill Newsgroups: gmane.emacs.help Subject: Re: Reading from a buffer Date: Thu, 2 Jul 2020 23:33:57 -0700 Message-ID: References: <0884F1C1-94B7-4E69-B62C-C826A1E78637@traduction-libre.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32596"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs mailing list To: Jean-Christophe Helary Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 03 08:34:59 2020 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 1jrFHm-0008MR-Pg for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 03 Jul 2020 08:34:58 +0200 Original-Received: from localhost ([::1]:50374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrFHl-00066z-Oz for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 03 Jul 2020 02:34:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrFHR-00066q-O3 for help-gnu-emacs@gnu.org; Fri, 03 Jul 2020 02:34:37 -0400 Original-Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]:38072) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrFHP-00030p-H4 for help-gnu-emacs@gnu.org; Fri, 03 Jul 2020 02:34:37 -0400 Original-Received: by mail-il1-x12e.google.com with SMTP id s21so11253174ilk.5 for ; Thu, 02 Jul 2020 23:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JXDyvFn3hysg6DkQuxuWNIp09TZOaevoUJipbyijSqY=; b=HMBcmO1tGzHgvMtkYXo4zYgrARHsay5jrSQ2FfpxSHihlC0wo1hR75VMhq3qBwRXJT UaJNpiOa5kpIw0nLpfYvxNWiiZotyFz4q1Ud95e7V+zfi3yhwa3f0YlD94SJgrE0zilb eanNANzX2uI117ptWph4j8yYrnL9cJt7l5bV5BMmTi7HO2YLRGU5vhfCuhFuM82KkmT/ TOSp7Y25isfTN5H7GAvYDeQ8YlW9wCGm3s+73B5i6uJjtQN47v4nsG1MLZORGm0vDqc6 2eWqvyqPMmwy8TJ1nhKr6WFDUL4MaPt89i7pfrZNZabTqh2/8QOKY3FfSvtkz0KKdvgE UwSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JXDyvFn3hysg6DkQuxuWNIp09TZOaevoUJipbyijSqY=; b=HeUjwubL+QaXOPohpbrXh2PDwNzF3IK9O5xaoSIrg0ZoGQ8Wftx/CwaiYBdgdYq7YA QCGnfxNEY/TNaAgCPympMe4hbb6L9WMv3huDIdW9k4xDgR94d2VfxNqI5cN29T/GeIpA Efq9GM24bMTDRRkS7JW87Jh1rZJsbD283tyQEEidUWh2ThNNCgK2WAmH0aC6fJuiXcqg /TPo7pVFJj+OKfvUG4+h1vKMKuO1BuN7513mZpZ0379y9tMum2mwwOtir3pDrer1dRGc VYCrBnIwfTmJzaR13/Qf+F7kpQSkqyQbo5LaeF2ArpVHCj4KE58gVovqhJrYUk6e69Zl UY2A== X-Gm-Message-State: AOAM532eCznGhfYOaiLcVcpWeGxiEyKCrRbuJvK2GrhsC749ER7HvhSh ar10o0VteoQcX1hAFg8/TvvEzePWWPMR3gqPgkbIBQ== X-Google-Smtp-Source: ABdhPJwHlBr8Lq0mepvKSZ2hKLlolhx+BKRKAw/rNJKTC2oRZ0GVVEH4v/LqXYKviANSUitYfm7x2+1BJDfTuIgKJXw= X-Received: by 2002:a92:794f:: with SMTP id u76mr15100055ilc.215.1593758073827; Thu, 02 Jul 2020 23:34:33 -0700 (PDT) In-Reply-To: <0884F1C1-94B7-4E69-B62C-C826A1E78637@traduction-libre.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::12e; envelope-from=gregoryohill@gmail.com; helo=mail-il1-x12e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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:123488 Archived-At: Thank you, Jean-Christophe. I did take a look at the f.el library and didn't see anything there that appears to be even remotely close to what I'm looking for. Since I'm just learning all this stuff for my own amusement (70 years old, retired, and doing "brain exercises" to keep my mind sharp) I really don't mind writing my own functions to do exactly what I have in mind. In fact I have already written a first rough draft of what will ultimately serve as documentation for it. Once I've written and thoroughly debugged the code to implement it, I'll post a copy of the documentation here on the help-gnu-emacs mailing list. I'll also send copies of it wherever you folks suggest making it available to anyone who might be interested in checking it out and maybe teaching me how to write it more efficiently using tricks I haven't even discovered yet. Anyway, the bottom line is, it doesn't really matter to me if I'm just re-inventing a wheel that somebody else has already invented and made publicly available. On Thu, Jul 2, 2020 at 8:38 PM Jean-Christophe Helary < jean.christophe.helary@traduction-libre.org> wrote: > As Jakub mentioned, did you check the f.el library ? > > https://github.com/rejeep/f.el > > > On Jul 2, 2020, at 5:19, Greg Hill wrote: > > > > The function 'buffer-substring-no-properties' is certainly a step in the > > right direction, thank you. I've now got it down to: > > (setq count (car (read-from-string (buffer-substring-no-properties (mark) > > (point))))) > > But I'm nothing short of astonished that there is not yet anything in > > standard Emacs Lisp that is comparable to a formatted read-from-buffer > > statement in a more conventional programming language like Fortran or C. > > I'm imagining something akin to '(insert (format...' but working in the > > opposite direction, something like '(unformat (read...'. Perhaps I'll > just > > create my own library of intuitive and easy-to-use buffer I/O functions > > since I expect to be doing quite a bit of this sort of thing in the > future. > > -- > Jean-Christophe Helary @brandelune > http://mac4translators.blogspot.com > >