From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Determining existence of text following point Date: Tue, 18 May 2021 11:31:00 +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="37516"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eric Abrahamsen , Skip Montanaro , Help Gnu Emacs To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 18 11:58:21 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 1liwUX-0009b3-T9 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 18 May 2021 11:58:21 +0200 Original-Received: from localhost ([::1]:41428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liwUW-0000TM-M6 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 18 May 2021 05:58:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liw4x-0000WB-2Z for help-gnu-emacs@gnu.org; Tue, 18 May 2021 05:31:59 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:42369) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liw4n-0001yO-11 for help-gnu-emacs@gnu.org; Tue, 18 May 2021 05:31:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1621330260; bh=JyzRxAvIlfqvgHILuKwAaNfejJzjeXrRMGvnd1TbJUc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=D9pMtLHJImzIIKdLRpuynckK9QSdowOAYoLBtybR60z02C2bFYuni4tBUihcs0MNH csYRq3CaNv0Ef88G3a6S/3zkCIc8zj2GmT5pLFh8Tp37c6LVPhSlZ5pKLSEYU0Zjaq iTrLKzw8WFvfi5hr52yB0gZsgdq4M4XbP9HBGyw4= 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 11:31:00 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:BisIAHZs1P4Uc/qw+vLSkxpNH7gpPFLsAVC+5ScARotEqQRCvWYPxwsjbTZ9c7A2DqQrI ybN7d3dLX7ICvTp5J39uBg/01gk3PC+DLD5hZ5GFrzt4WDE5f2xAZYPA8glNgMcvUVw0wnSLJ0Cs YaxMA6wD8ba9AG2LIBcVtiXH3zFAKWetUPHOEAhyMtcB63HTLlv4hVxPsvGx6EcD48h8uG65faBH cuuNvMnSRZRakW+/fvobCrJ5FwQh8zqd1l3DJBsOBE/6xSWfJL6G3vqVhtprtbO9nRvJPqjNJEYz WY= X-UI-Out-Filterresults: notjunk:1;V03:K0:juTZ8eJ6tko=:33mUj/y/IYppacaIsZgfne zmeMm2VxtV/goUxk0Ny5OI7RSWP5u0hWWPMwfFqOritQfuMXFfEsyssldjDr0WiATLQajIRtu +FbQInU/2FJLVfIG26mqaQndlhM9qV7gcUxdrjueFPbdD7fAiEp+qMLW1auXsTXJX/T0ZN4nj 5mDofJQgCPt0xuNqPYUxbzvIA11yALhiJ9ybaG5FeIbFlW9PWhPJtjUKuWH1OmmGXyWZ4TXBU 1q52Apof36aN3iTNmonsVdsQjxl8B0LVRuD0PreXMhJBnBtscjcshj2B3k6psMRa/zzWjHxU1 5xbET11zcfcxMBaxxFBdhYNVekfVO8aZFdtPAPuZGzN8tN7RTuFujMOIzk5/v/QP1fv6zBgRV zh89joPJYle2UaS3Nim3XHV/DAIpjHpXk9gewpTBvVO7LA0h9Zg4w1LbkLHcInaB69emhb/pF 99yHqT+vLd6JWtsLncG42TlUm84MfOl12olTP/NjPsMisq1cuWZBV1rLg+5sg0Vl4vSbfAZwV HRQjUGYRo00SP6WFqrdlkiCA9sIAcv2P3Vk+l61zk5WBZN2Uj6zoIwPGOS9XYNkvImFFaMEFi PsXoJJDAvd5PpAwAy6nW2nRfYQH6TpUV2krxxxLbOQ4rYdfpJEIHZGOGVGXue1xRJOSHjjrE1 bEzm4bjA2LMPWMr/776TCSb6y98+D4kwxAywI0sbkw+3ttsCmqCjCCEnC4A9c82mU9C4jNe9I 03+2ymhI8RCVbNm3sDB2/b9u+6TcWTgzEtb9vrR63f71u46ao88FMBnOC8dVgDpobF7F+I8d Received-SPF: pass client-ip=212.227.15.19; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:129862 Archived-At: > Sent: Tuesday, May 18, 2021 at 8:56 PM > From: "Jean Louis" > To: "Eric Abrahamsen" > Cc: "Skip Montanaro" , "Help Gnu Emacs" , michael-franzese@gmx.com > Subject: Re: Determining existence of text following point > > * Eric Abrahamsen [2021-05-18 03:09]: > > michael-franzese@gmx.com writes: > > > > > But if there are only empty spaces it is ok too. > > (defun my-insert-on-empty-end-of-line (s) > (let ((line-cut (buffer-substring-no-properties (point) (line-end-posi= tion)))) > (when (or (not (string-match "[^[:blank:]]" line-cut)) (eolp)) > (insert s)))) I understand that "string-match" returns index of start of first blank mat= ch. Suppose the cursor is just after the first period. Then because there is = still text left on the line, the string "s" is not inserted. The text should on= ly be inserted when the rest of the line is blank. A neutrino is a fermion. Some more text here. ^ > -- > Jean > > Take action in Free Software Foundation campaigns: > https://www.fsf.org/campaigns > > Sign an open letter in support of Richard M. Stallman > https://stallmansupport.org/ > https://rms-support-letter.github.io/ > > > =2D-------------------- Christopher Dimech General Administrator - Naiad Informatics - GNU Project (Geocomputation) - Geophysical Simulation - Geological Subsurface Mapping - Disaster Preparedness and Mitigation - Natural Resource Exploration and Production - Free Software Advocacy