From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: RE: [External] : Getting text from next non-blank line Date: Fri, 19 Apr 2024 21:50:12 +0000 Message-ID: References: <-NcWr6V6uYcDio-D72eweQPC4nx1UypEOtbiY6bgBb0qLt9NeDKFi_XI4h7x8WoVI5z7wJRDiVk2XRjl7KrLJET8YX6pf1Up-GIp4SUfajw=@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="19397"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 19 23:51:10 2024 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 1rxw8U-0004nz-NZ for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 19 Apr 2024 23:51:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxw7y-0001yt-1Q; Fri, 19 Apr 2024 17:50:38 -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 1rxw7r-0001xg-7q for help-gnu-emacs@gnu.org; Fri, 19 Apr 2024 17:50:32 -0400 Original-Received: from mail-40135.protonmail.ch ([185.70.40.135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxw7n-0007L2-RI for help-gnu-emacs@gnu.org; Fri, 19 Apr 2024 17:50:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1713563423; x=1713822623; bh=wYHH0tZnf9O2c0B8YjJBsbe4hIFq8ZgBRAY6VHe8h3s=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Q1AREKAFCGVU111gbMtRspCRFLOV4YM/zPxrUCv6e1uDqif8gekC3AxosOYDHANdo /HXtQV/BO6xeimHh5K8mCTNh9up0DvQO/qI8G/v2XZIcwru2bMxikl4ZjyRlKGzWIr LmBeZSNn0ASoRGeSr/h0433gq28gLtAAtIBIxU6C9LzfR7Aszujr7Fy6FjLj93Bo8J xZ+2N+4NKoS11AVsO+0UwrYt4cHbpYS8v0iooQPRNIZ0AG35iZC3GV2uXb7yfbhRXA zZhNEka5XyLdxIKR/3lx1rLnbsUOgXUXdzJptC5Hk2jvb4UHiSIw+ErK7/gHdEdSup vFAKbGmNEe6Fg== In-Reply-To: Feedback-ID: 57735886:user:proton X-Pm-Message-ID: f385e5ec850c55f147a0aa59c540347a8b0cd94d Received-SPF: pass client-ip=185.70.40.135; envelope-from=heimeborgia@protonmail.com; helo=mail-40135.protonmail.ch 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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.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:146387 Archived-At: Sent with Proton Mail secure email. On Saturday, April 20th, 2024 at 9:04 AM, Drew Adams wrote: > > This interactive function requests the user to input a string > > associated with > > the current line number. I want to change it so that the function > > picks out > > the text on the current line or the text of the next non-blank line. > > But also > > allow the user to write their own text for the line. >=20 > ... >=20 > > (interactive "sString: ") >=20 >=20 > Don't use that, if you want to provide a > default value for the user input. >=20 > Instead, use a function that accepts a > default value. E.g., `read-string' or` completing-read'. >=20 > Read how to use `interactive' with a sexp as argument that returns the li= st of args you want` interactive' to pass > to the function body. >=20 > https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interacti= ve.html Have started with this to get the non-blank text. But still no way for use to use his own text. (defun tema-mark (text) "Associate line number at cursor position with text." (interactive (list (if (string-blank-p (thing-at-point 'line t)) (progn (forward-line) (thing-at-point 'line t)) (thing-at-point 'line t)))) (let ( (line-number (line-number-at-pos)) ) (setq-local tema-lugar (append tema-lugar (list (cons text line-number)))) ))