From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6HPUHwT2uV5XBgAA0tVLHw (envelope-from ) for ; Tue, 12 May 2020 01:04:04 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cLEaKBL2uV4oHgAAbx9fmQ (envelope-from ) for ; Tue, 12 May 2020 01:04:18 +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 22992940E97 for ; Tue, 12 May 2020 01:04:16 +0000 (UTC) Received: from localhost ([::1]:37716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYJLE-0003VZ-W1 for larch@yhetil.org; Mon, 11 May 2020 21:04:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYJKT-0003VT-Le for emacs-orgmode@gnu.org; Mon, 11 May 2020 21:03:29 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:43450) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYJKS-0004sZ-O8 for emacs-orgmode@gnu.org; Mon, 11 May 2020 21:03:29 -0400 Received: by mail-wr1-x429.google.com with SMTP id i15so13226215wrx.10 for ; Mon, 11 May 2020 18:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tZHGe3fyGEZxoWI+SqKP5AOIp7mqduIh3KhsrbCozLc=; b=afRrzZgVqOssjKn2GK6POydoXREoVrLcgcsDmB17MTOmOHxI27r2evpqYnKNSmE+qv lPWmWZadT0oTcS+UUpDXOgbMRLXH4WZSvAWFFEWIdTMrV10cxPEyAL+zKKriOcYMjjvy RlxYD8fjE9VA4RvI/vJAbNSyQDOFi2JFQojyRvakPiq7tqd0jODCDrVoIVQBrpXpVcvI 4CgSRfcyf4uNOAHib3Bh3DKIlasDXL4MMqosAHo5Sbf6S1Fg3QQd91MNNFUEG0JXJ508 QbTRUcwAwMXvqmPc0Ci4GOORJM+iArBF2slk1Dgplrn6wC2DXDagCYW532EC9e/pqyN4 EI/w== 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=tZHGe3fyGEZxoWI+SqKP5AOIp7mqduIh3KhsrbCozLc=; b=dYJX8lPYEkWUFDm/bEHkREktgdAd4doGJdzFyyW2+3otFivjlUefQTZqxzkNdKjLUs WNPobz8tIPwzH+WpdSyuGVryfUZiV+iAnJTiS5m+KWLNwJK65wb4dndEtTa7qPssAets LEMT1UeDFgMHUxiIjNEhFqtLmE2EzQbIPUBAhaG/LtMHRHJyNukg4B40JOz1NZVvT4OB /tfOTFfeQdnrkjPuTThDd8/7P95gikZRj3+tERZHqsS4Jw50KxD9V3MBxUEc3fubfF/P G1L0jpo+GQreAjzKHa11h+r6dnDkM4oWJhKq6sZs3C1QeUmsM+wi2jrUdyu9NuR6ekYq 5HYg== X-Gm-Message-State: AGi0PuYb77f6+7DLmHYKLnietJ4GMwSE0uEEUyqOGTxl6hPRRE7lUeQu Xa/eavFHUBRqneSw1Owp/JDCRDw2LV0SC6eGL7U= X-Google-Smtp-Source: APiQypJ+OThwo0nqDAxQT0JiZ8wLwhpcdlHnafWM9bMUrstJG+vPE9UmFxH4q4Wgdav5YlO+dGUkOVJ73O40rK6jejQ= X-Received: by 2002:adf:f6c4:: with SMTP id y4mr23620826wrp.81.1589245406383; Mon, 11 May 2020 18:03:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "briangpowell ." Date: Mon, 11 May 2020 21:03:15 -0400 Message-ID: Subject: Re: get the body of a heading up to the next subheading To: John Kitchin Content-Type: multipart/alternative; boundary="000000000000e8925305a56907ed" Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=briangpowellms@gmail.com; helo=mail-wr1-x429.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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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 Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: -0.71 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=afRrzZgV; dmarc=pass (policy=none) header.from=gmail.com; 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-Scan-Result: default: False [-0.71 / 13.00]; GENERIC_REPUTATION(0.00)[-0.53989855892951]; DWL_DNSWL_FAIL(0.00)[gmail.com:server fail,209.51.188.17:server fail]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; FREEMAIL_FROM(0.00)[gmail.com]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.07), country: US(-0.00), ip: 209.51.188.17(-0.54)]; URI_COUNT_ODD(1.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[briangpowellms@gmail.com,emacs-orgmode-bounces@gnu.org]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[cmu.edu:email]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[209.51.188.17:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: DrrZXINpBvFL --000000000000e8925305a56907ed Content-Type: text/plain; charset="UTF-8" Emacs was created to do such things--in fact the name E-macs is a terse form of Editor-Macros {originally a derivative of TECO} {There is a huge list of what Emacs should stand for--my fave is: Emacs Makes All Computing Simple} Now, what I'm suggesting is you make a macro, and store and reuse it--to get you started, I suggest something like this Cs* Cn C@ Cs** Cx ( replace-string Cqj Return \n Return Cx ) name-last-macro Give it a name & save it & re-use it and/or EXTEND it later On Mon, May 11, 2020 at 7:05 PM John Kitchin wrote: > Hi everyone, > > I am trying to get the body of a heading up to the next subheading. For > example with this org file, > > * quiz one > > This is the description. > Use emacs for this. > > ** question 1 > what is 40 + 2 > > If the point is in the first heading, I want to run a function that would > return the string "This is the description.\nUse emacs for this." > > I thought there was a simple way to do that, but so far it has eluded my > google fu. Any hints? > > John > > ----------------------------------- > Professor John Kitchin > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > --000000000000e8925305a56907ed Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Emacs was created to do such things--in fact the name E-ma= cs is a terse form of Editor-Macros {originally a derivative of TECO}
{There is a huge list of what Emacs should stand for--my fave is: Emacs M= akes All Computing Simple}

Now, what I'm suggesting is you make = a macro, and store and reuse it--to get you started, I suggest something li= ke this

Cs*
Cn
C@
Cs**
Cx (
replace-string
Cqj
= Return
\n
Return
Cx )
name-last-macro
Give it a name & s= ave it & re-use it and/or EXTEND it later

On Mon, May 11, 2020 at 7:= 05 PM John Kitchin <jkitchin@= andrew.cmu.edu> wrote:
Hi everyone,

I am trying = to get the body of a heading up to the next subheading. For example with th= is org file,

* quiz one

T= his is the description.=C2=A0
Use emacs for this.

<= /div>
** question 1
what is 40=C2=A0+ 2

<= div>If the point is in the first heading, I want to run a function that wou= ld return the string "This is the description.\nUse emacs for this.&qu= ot;

I thought there was a simple way to do that, b= ut so far it has eluded my google fu. Any hints?

John

= -----------------------------------
Professor John Kitchin=C2=A0
Dohe= rty Hall A207F
Department of Chemical Engineering
Carnegie Mellon Uni= versity
Pittsburgh, PA 15213
412-268-7803
=
--000000000000e8925305a56907ed--