From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: michael-franzese@gmx.com Newsgroups: gmane.emacs.help Subject: Re: Determining existence of text following point Date: Tue, 18 May 2021 10:24:20 +0200 Message-ID: References: <87cztpx8oz.fsf@ericabrahamsen.net> <87zgwsx5r3.fsf@ericabrahamsen.net> 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="4323"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Skip Montanaro , Help Gnu Emacs To: Eric Abrahamsen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 18 10:25:06 2021 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 1liv2H-0000v8-R8 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 18 May 2021 10:25:05 +0200 Original-Received: from localhost ([::1]:41274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liv2G-0007ND-NE for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 18 May 2021 04:25:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liv1n-0007Mp-NQ for help-gnu-emacs@gnu.org; Tue, 18 May 2021 04:24:35 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:42025) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liv1l-0003UR-07 for help-gnu-emacs@gnu.org; Tue, 18 May 2021 04:24:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1621326261; bh=XQCxSy9UUaoAyJS5PZ7Nj7MWOaUw08XpWkhFK/cQAtQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=WfmxX5/s62zab1M9V1mhGv4yd7ohNSF0bAwwxPwq1AnLGH/lLZ7NvlZZOkzFs+lO0 AzqodPCyzX3ujtVBMQdOWi7T95hO9cyw06o1cFAFXJ62sq6FV83SpRinbrAAPzoE0L 1ul0MkcOV65OZ16D9AUO44g/9NBmaKNvHG+Vn8SY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs13.server.lan [172.19.170.181]) (via HTTP); Tue, 18 May 2021 10:24:20 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <87zgwsx5r3.fsf@ericabrahamsen.net> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:smamQ9bQwWok0qlHLUhX49SUAmb5xFerh6PN2zhO9LukckVIHXiGL/s1w0ygaLnbFA5nP y9K5dejLTppwuhP/7AerGAI9OXuebUxuOFG7T0noRMdFQ2GBnsRgyWGJEh3HUdgrzdbFWZkf/aWp Cif5LF/+yKEnR4Ga5b9OzRjabwnQJEajkZQp1pPXytzptJqGhELT+7jMgwb1YBlvhYOI6jCOxsgw fCwg9y/b0Uu7Aa8/zlJs1j23GcdlumbX3d8aIKy5Bv9dbyYmutl8N7tDZ/ErqhJdt96cHgiz1v31 3A= X-UI-Out-Filterresults: notjunk:1;V03:K0:etU+n0QyecY=:z5fX31LiaoL82C0GB8RnPq 8EcDZcdWemCgpQ4/uxCauNRTDH29GXVOHeA53tZwO15Y/xMa0sK2BdRdGPu/CK+NW9oNGqnE3 hy6m+InWncNJ+NP2BbUth0mSgyb7i70OogM4erES1DQbrq9rE09mtFdqNPo1G7SlN6IeOK9Ip wkzRN8VEkRgGAmmzVDLvZqq2TWR3ki0A0NQJhTecrp25/gfiEJeNEsCfoPYyslFIRJ3eFxTGH dZRdg5A47CdtMD/2wJs6nfmiicMrpgh8/I/CrGI18RJC+6iehAUzrxbvtRWUahbt5/6jVPen5 0vhpC0p//SHS70ogovc2lp88qfw6zPj3eCTONqAWh0NHrMXWatwixIxbxSSwpx0+hOycHcgBm 4XveZw/AY2JJjVzSsGWWqa9RMxmIEC18bvpLUpdyuwXSClmy6kQ/X1MqOE7SmmYj55BisqQHs Oan2rH+TpzmgYhRTv5ByTVaL8kc5e6MF+a+Mdq2Vu9BPBSd6MH593g2uITnuPywoaZrM1HtrO ahYtIRiNyl+bVnp3Wq7G5sCoP1IpSltsWaVCahOSA0j5xBV4xMugfGqiZVFGUqPzpg48O6GIN AJ7TFHSEUjrh6DRLBxkNUnX30CuM98FY8VMKqEdeow03xUW5xUnDgjgYQT/pz204vYkP0UtYE 751UA3JBrXeaE0d+/n49a9QtYA67wa7udMpkB14oDbEZOK0WlGEe26q5zn7znafGk1VYFNwuW DTiyseFZ8IjOhNG8jlRzIljku7hTJC/7cyjo2Rwgq1VrTExG8XP2vY2i/v3fNT/0INfDgrUS Received-SPF: pass client-ip=212.227.17.20; envelope-from=michael-franzese@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:129859 Archived-At: Would like to set a function which I could then use with an if statement Have constructed something as follows. But naturally the name of the func= tion is the reverse of having no text (including empty spaces) (defun looking-at-text () "todo" (looking-at-p "\\([[:blank:]]+\\)?\\(\n\\|\\'\\)") ) Then my condition for inserting my string would be (unless (looking-at-text) (delete-region (point) (line-end-position)) (save-excursion (insert s)) ) > Sent: Tuesday, May 18, 2021 at 12:09 PM > From: "Eric Abrahamsen" > To: michael-franzese@gmx.com > Cc: "Skip Montanaro" , "Help Gnu Emacs" > Subject: Re: Determining existence of text following point > > michael-franzese@gmx.com writes: > > > But if there are only empty spaces it is ok too. > > Ah, then Skip's looking-at is a fine solution: > > (looking-at-p "\\([[:blank:]]+\\)?\\(\n\\|\\'\\)") > > That's as a test. Or you could use a single `replace-regexp' invocation, > to detect and replace the whitespace in one go. >