emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: No Wayman <iarchivedmywholelife@gmail.com>
To: theophilusx@gmail.com
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Rename headline to heading
Date: Sun, 15 Aug 2021 12:50:44 -0400	[thread overview]
Message-ID: <87sfza642q.fsf@gmail.com> (raw)
In-Reply-To: <87v94665h9.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]


No Wayman <iarchivedmywholelife@gmail.com> writes:

> As far as org-capture is concerned, support for transparently 
> upgrading the
> user's templates could easily be added to the 
> `org-capture-upgrade-templates`
> function.
>
> It would just be one more case added to the existing pcase 
> statement and would
> prevent breakage for users.

See the attached patch which adds the mentioned case.
The docstring for `org-capture-upgrade-templates` could be worded 
better/more generally.
I believe we could also do a better job notifying the user when 
they have outdated
capture syntax. Really we should be recording *which* templates 
use outdated syntax
and pointing them to a solution. These are separate issues, 
though.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-capture-upgrade-templates-headline-to-heading-proposal --]
[-- Type: text/x-patch, Size: 1604 bytes --]

From 4a133f0c5a7fef18ea1dfb38e2e1539da1db834e Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer <iarchivedmywholelife@gmail.com>
Date: Sun, 15 Aug 2021 12:48:00 -0400
Subject: [PATCH] org-capture.el: Upgrade file+headline template target syntax

* lisp/org-capture.el (org-capture-upgrade-templates): Upgrade
templates which utilize file+headline target syntax to file+heading
---
 lisp/org-capture.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 831c3e1f4..28b3e33f4 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -109,7 +109,8 @@
   "Update the template list to the new format.
 TEMPLATES is a template list, as in `org-capture-templates'. The
 new format unifies all the date/week tree targets into one that
-also allows for an optional outline path to specify a target."
+also allows for an optional outline path to specify a target.
+It also accounts for renaming `headline` to `heading`."
   (let ((modified-templates
 	 (mapcar
 	  (lambda (entry)
@@ -128,6 +129,9 @@ also allows for an optional outline path to specify a target."
 	      (`(,key ,desc ,type (file+weektree+prompt . ,path) ,tpl . ,props)
 	       `(,key ,desc ,type (file+olp+datetree ,@path) ,tpl
 		      :tree-type week :time-prompt t ,@props))
+              ;; Rename "headline" to "heading"
+	      (`(,key ,desc ,type (file+headline . ,file+heading) ,tpl . ,props)
+	       `(,key ,desc ,type (file+heading ,@file+heading) ,tpl ,@props))
 	      ;; Other templates are left unchanged.
 	      (_ entry)))
 	  templates)))
-- 
2.32.0


  reply	other threads:[~2021-08-15 16:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 12:12 [PATCH] Rename headline to heading André A. Gomes
2021-08-05 15:04 ` Maxim Nikulin
2021-08-14 22:54   ` Tim Cross
2021-08-15 16:22     ` No Wayman
2021-08-15 16:50       ` No Wayman [this message]
2021-08-15 22:32     ` Jim Porter
2021-08-15 23:17       ` Tim Cross
2021-08-16  0:38         ` Jim Porter
2021-08-16  1:18           ` Tim Cross
2021-08-08 16:59 ` Tom Gillespie
2021-08-14 23:19 ` Tim Cross
2021-09-19 11:06 ` Timothy
2021-09-30 12:08   ` André A. Gomes
2021-09-26  9:27 ` Bastien
2021-09-30 12:21   ` André A. Gomes
2021-10-01  8:38     ` Bastien
2021-10-15  8:52       ` André A. Gomes
2021-10-15  9:56         ` Timothy
2021-10-15 10:18           ` André A. Gomes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfza642q.fsf@gmail.com \
    --to=iarchivedmywholelife@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=theophilusx@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).