From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [PATCH] Allow datetree to find years with trailing whitespace. Date: Fri, 25 May 2012 13:16:26 -0500 Message-ID: <87zk8w5dm3.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXz5P-0002yY-UL for emacs-orgmode@gnu.org; Fri, 25 May 2012 14:18:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXz5O-0005op-8H for emacs-orgmode@gnu.org; Fri, 25 May 2012 14:18:03 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:38094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXz5N-0005no-NJ for emacs-orgmode@gnu.org; Fri, 25 May 2012 14:18:02 -0400 Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 2598A215E9 for ; Fri, 25 May 2012 14:17:59 -0400 (EDT) Received: from archeee (unknown [98.213.43.118]) by mail.messagingengine.com (Postfix) with ESMTPA id BC0EA482521 for ; Fri, 25 May 2012 14:17:58 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode * 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