From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kH0wITm4F2GU6AAAgWs5BA (envelope-from ) for ; Sat, 14 Aug 2021 14:34:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EHIBHTm4F2GydgAAB5/wlQ (envelope-from ) for ; Sat, 14 Aug 2021 12:34:01 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 800B33FA1F for ; Sat, 14 Aug 2021 14:34:00 +0200 (CEST) Received: from localhost ([::1]:54084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEsrO-0004Ue-SB for larch@yhetil.org; Sat, 14 Aug 2021 08:33:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEsqj-0004UU-UG for emacs-orgmode@gnu.org; Sat, 14 Aug 2021 08:33:17 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:42911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEsqh-0003Dc-6h for emacs-orgmode@gnu.org; Sat, 14 Aug 2021 08:33:17 -0400 Received: by mail-wm1-x32e.google.com with SMTP id w21-20020a7bc1150000b02902e69ba66ce6so8604758wmi.1 for ; Sat, 14 Aug 2021 05:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew-cmu-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H6YyjN5FsXNQZhKx8kQIv3z32qYMPqGsZvYUgkAmV5s=; b=Ma2BkqI5grXkONc8g4dKFkVeQz9h3FdReFEOVgwVh0QIvh9uSgOyG7v3iZBosdp9g/ ie5DsA96aXZBTpnowAGNEWq0NFbuYov9K7jREM7vTM6gl6q1ShMBrpbzHLbGBkdtgZPR 1ljRcU35HcxxEq+T3gYP2TQAaoyjYlktDoaRJIfWdzHcgovTRQXDjKL5Ueg3eucZFBRz LWEZQdyifOKaAZsgpBCSNDYN2wBAy7Gq4FQUAaNre352nIx91xbq3GibUKZCaWL8PvYi m7CW/7OuxspT6mTmZgXt/u80OoG00KbSwJHFzNGG6v6nayLQ9ujcM95WekX4qRz8IIG9 M8YQ== 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=H6YyjN5FsXNQZhKx8kQIv3z32qYMPqGsZvYUgkAmV5s=; b=e1+KMHMQbC/vBNsxao6SO7d2xDHdKq9+cgij5If3iQf/q/30Hdyq3eO6/uNwEW9Ztf MPI2tdpIRcWM+LEPt0K1K3NFeHGXpI4Fl+gDPWjwyLCNHlqphNjfwcBDQfBAZKBLleqQ V7LtvlevGGWTLOWYz/VhmnIUqoNBK02FCLsieENkT98+aDywr2lApVcV6rQI0wvGvQgP UY+/sCqsvOe6zsZSzBoEww4QZmSCeybfjdS3EColmiF4SBc6Bg680maM1gZ/CGNc/L+O +ZQxyR3kv9kS6rpj+js9QUSHxBx0C9CPnxAvn7XieoNb1pLbA/ER4RnFiYIhWKpxesCA erhw== X-Gm-Message-State: AOAM530xIRMM5jywdLk97OX0ppbiMWLhHK5aneNnp9lH5BXtVQKl+u7Q nqgGMuYnxrULOS/vmpoIzDEy/HOxyLENbgE30fs= X-Google-Smtp-Source: ABdhPJypVwhvOwxK8/0m3/HGp3kSMlSx970TKEphuk2oiQAKb4KCKcCK5Fk7kDr1XnIQCXi49+3cAhGdlWNN29caEQQ= X-Received: by 2002:a1c:3c87:: with SMTP id j129mr6913375wma.54.1628944393535; Sat, 14 Aug 2021 05:33:13 -0700 (PDT) MIME-Version: 1.0 References: <87im095682.fsf@gmail.com> <87o8a07qaj.fsf@localhost> In-Reply-To: <87o8a07qaj.fsf@localhost> From: John Kitchin Date: Sat, 14 Aug 2021 08:33:02 -0400 Message-ID: Subject: Re: Custom function for killing the thing at point To: Ihor Radchenko Content-Type: multipart/alternative; boundary="000000000000ef859405c9842b79" Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=johnrkitchin@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: org-mode-email , Rodrigo Morales Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628944440; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=H6YyjN5FsXNQZhKx8kQIv3z32qYMPqGsZvYUgkAmV5s=; b=hdmsKw/bJevD2wbwBcre0+H2jK4m9fArXMXEdmopwzp/5+4gR0EMnJEfqZnj5x/FegL/sM ywETS6PxeGXgZU6etQiTZDzo7/OwZrondftiWP3xTqceB0/V0iUE4rclxztFtZyy+u6i/G 90nSUe8bxRMtSxHs29gxu6FuwvvrHFpf5bK/V9Z+fco83hy+LqvRLSphd3ashxlqfH1VNH U1L95Quv11t7mKAeWflTtody1xXB8oJaqCPj7gVoD/3f2j6mAic9kv/D5k63FsmE2zsiUw H6RaG/3NBoaNOrXwpqpx1O9ForVqtqxFsKeBeSpSl7NdkUqx2uDOavGd4jkt3Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628944440; a=rsa-sha256; cv=none; b=i1CstV6vRET3biL+QlyLSRHq87EbHlBBU5PmZ2AZpulsmqoFKI98yID6kHxpI8Ws5C4MN7 3JMJrjtNtQaWiFizq8Z3JS0/u2g68HwDF88INa1Vhr1Pw4OzgjZQGk7IWXku31wpnEeruC YZoTUfite4fvJ/c4aEjUkBnHp05uxYFgBwpa6XfnHlnOp6WDE4dwILnFtM3kgclbjVtUY7 FW8P5HCZql+UWZE6mIc8FEZffgJNZwXAUOqRg9BwDHhKSfU2/IulsHiLIAQ9bagya/Og8v xKAvLUISiXc7sVC9yZnRhG8e/1/zD01gcTZAfQ8w+BtkEUc4uCp7+qabncibTQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=Ma2BkqI5; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=Ma2BkqI5; dmarc=fail reason="SPF not aligned (relaxed)" header.from=andrew.cmu.edu (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 800B33FA1F X-Spam-Score: -1.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: iG1PJEeCKZWV --000000000000ef859405c9842b79 Content-Type: text/plain; charset="UTF-8" alternatively, fall back to org-mark-element. I am not sure what differences in what you are trying to achieve and this are, but this should cover all org elements: (defun org-kill-element () (interactive) (org-mark-element) (call-interactively #'kill-region)) John ----------------------------------- Professor John Kitchin (he/him/his) Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Fri, Aug 13, 2021 at 9:45 PM Ihor Radchenko wrote: > Rodrigo Morales writes: > > > (t > > (error "The element at point couldn't be copied."))) > > I would fall back to region between :begin and :end of the element. > > Also, it might be helpful to print a short message about what element > have just been copied. > > Best, > Ihor > > --000000000000ef859405c9842b79 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
alternatively, fall back to org-mark-element. I am not sur= e what differences in what you are trying to achieve=C2=A0and this are, but= this should cover all org elements:

(defun org-kill-ele= ment ()
=C2=A0 (interactive)
=C2=A0 (org-mark-element)
=C2=A0 (cal= l-interactively #'kill-region))

John

--------------------------------= ---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Departm= ent of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA= 15213
412-268-7803

On Fri, A= ug 13, 2021 at 9:45 PM Ihor Radchenko <yantar92@gmail.com> wrote:
Rodrigo Morales <moralesrodrigo1100@gmail.com> writ= es:

>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(t
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (error "The element at p= oint couldn't be copied.")))

I would fall back to region between :begin and :end of the element.

Also, it might be helpful to print a short message about what element
have just been copied.

Best,
Ihor

--000000000000ef859405c9842b79--