From: Matt Lundin <mdl@imapmail.org>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] Allow datetree to find years with trailing whitespace.
Date: Fri, 25 May 2012 13:16:26 -0500 [thread overview]
Message-ID: <87zk8w5dm3.fsf@fastmail.fm> (raw)
* lisp/org-datetree.el: Fix regexp to allow datetree to find headings
with trailing whitespace. This fixes a bug in which an existing
datetree heading (e.g., "* 2012 ") would not be found by
org-datetree-find-year-create if it had trailing whitespace. This can
cause problems, for instance, if one is using column view on the date
tree, since editing subheadings with column view adds whitespace at
the end of the top heading.
---
lisp/org-datetree.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/org-datetree.el b/lisp/org-datetree.el
index 192d1d6..8c04507 100644
--- a/lisp/org-datetree.el
+++ b/lisp/org-datetree.el
@@ -63,7 +63,7 @@ tree can be found."
(goto-char (prog1 (point) (widen))))))
(defun org-datetree-find-year-create (year)
- (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)$")
+ (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)\\s-*$")
match)
(goto-char (point-min))
(while (and (setq match (re-search-forward re nil t))
--
1.7.10.2
next reply other threads:[~2012-05-25 18:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-25 18:16 Matt Lundin [this message]
2012-05-25 21:22 ` [PATCH] Allow datetree to find years with trailing whitespace Bastien
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=87zk8w5dm3.fsf@fastmail.fm \
--to=mdl@imapmail.org \
--cc=emacs-orgmode@gnu.org \
/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).