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: Wed, 1 Jul 2020 13:19:58 -0700 Message-ID: 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="20797"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 01 22:21:32 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 1jqjEa-0005K0-8Y for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 01 Jul 2020 22:21:32 +0200 Original-Received: from localhost ([::1]:53382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqjEZ-0007zo-Ai for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 01 Jul 2020 16:21:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqjDh-0007bY-IY for help-gnu-emacs@gnu.org; Wed, 01 Jul 2020 16:20:40 -0400 Original-Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:34715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jqjDf-00016y-IM for help-gnu-emacs@gnu.org; Wed, 01 Jul 2020 16:20:37 -0400 Original-Received: by mail-io1-xd33.google.com with SMTP id q74so2864454iod.1 for ; Wed, 01 Jul 2020 13:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=pCluH+QbZLopXfan3dpub4zN5JWIKc5hTOLDZSeuZEc=; b=uQXNulcyw8YntawGM66MPo6wEQFZOsg/hbw/rPqMi9DKKP6XDqJdir1z1Z/Rsz2E86 XX4+RTvk1pBd9rkVfAkqkhkUtGn8GjBF7Jr1IQYeCSQ2H/d4WaqO6Wd0VKUqqdqsfZWn cMQ6ZGB6+/+ZwAMg2KHgT41fwB6mnntCWMb8fzBdyQ0xvFEDMmHxXqTjgdJyx1rKhTuX 6DBSXgLo7gQH5fg17rZBVVQYQK8kazy3AZdBhsuXDsJHdetao5mnV+rjO/s85CvoKCwh XmhB8AJLraJPpOtPFJS29P0HJLli7E3vGIsLsDzjuDin8R/Z6Z0wm38Z1H9lFEbRZbyP ErMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=pCluH+QbZLopXfan3dpub4zN5JWIKc5hTOLDZSeuZEc=; b=Y5X3YkSmfWm8HzRlppwpmSuGi9XDT4Qtpq90gk14zQeQSMpn03EOVq/h8s67A1JcpH Aao9dIhv8GRxyRLOAUZBQQv5yxiSVKu9/7BuQWxy58MuaysZ7vv1etns3YotWPijhk1I KTtxUT70gDHmoUYqs50fcFwZaLXjWoYRF0kCygzMMe2w+d1fa7+FkKLza9ngvTc6tBNJ kQ9xVKNoFbK2BXcGViVXP0eOcVDKS/bAXTpc+lIrG1PZOuGfFOYjpEnn5ANdkPPjKysx 70sQ1NGCJJpDK5/1cjeABOaFE1C3rrtnxNO2k1hvi05lwp9Z0Rv6t/R9KoiVBUPw66q5 9QkA== X-Gm-Message-State: AOAM5338zRnNbC2O2CUCJSsRYu1yxIvnSVLzdn3JxDS0s6UBVJMcMiI/ x05qZZ98nlbr0B3davw9ksZZx6rGVzpIAYSmtCykGSH5 X-Google-Smtp-Source: ABdhPJyit/9MCWoCa+XX5vNWvvISwpwzLdPMRxZ270iNPMJTaOoc/r8F7X8c1sECJ725v5ac1v6JKCADxYoiGMlen14= X-Received: by 2002:a6b:5b14:: with SMTP id v20mr4110173ioh.182.1593634834034; Wed, 01 Jul 2020 13:20:34 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::d33; envelope-from=gregoryohill@gmail.com; helo=mail-io1-xd33.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 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:123466 Archived-At: 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.