From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilya Shlyakhter Subject: [PATCH] Colview bugfix: blank headline causes a crash Date: Sat, 24 Mar 2012 20:38:45 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090206030904050604000801" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBbU0-0006TU-CM for emacs-orgmode@gnu.org; Sat, 24 Mar 2012 20:38:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBbTy-0008PW-IA for emacs-orgmode@gnu.org; Sat, 24 Mar 2012 20:38:55 -0400 Received: from plane.gmane.org ([80.91.229.3]:33357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBbTy-0008PO-B9 for emacs-orgmode@gnu.org; Sat, 24 Mar 2012 20:38:54 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SBbTw-0002dR-V9 for emacs-orgmode@gnu.org; Sun, 25 Mar 2012 01:38:52 +0100 Received: from wrls-249-68-21.wrls-client.fas.harvard.edu ([140.247.130.21]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Mar 2012 01:38:52 +0100 Received: from ilya_shl by wrls-249-68-21.wrls-client.fas.harvard.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Mar 2012 01:38:52 +0100 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: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------090206030904050604000801 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit A blank headline (e.g. with just a TODO keyword) caused a crash when building colview. Patch attached. --------------090206030904050604000801 Content-Type: text/plain; charset=windows-1252; name="0001-Colview-bugfix-A-headline-with-just-a-TODO-keyword-a.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Colview-bugfix-A-headline-with-just-a-TODO-keyword-a.pa"; filename*1="tch" >From 6bb1413821a7cbf94b3abbfc6e985e187dd8d6d9 Mon Sep 17 00:00:00 2001 From: Ilya Shlyakhter Date: Sat, 24 Mar 2012 12:25:59 -0400 Subject: [PATCH] Colview bugfix: A headline with just a TODO keyword and blank headline content would crash * lisp/org-colview.el (org-columns-cleanup-item): Handle case of empty headline * lisp/org-colview-xemacs.el (org-columns-cleanup-item): Handle case of empty headline TINYCHANGE --- lisp/org-colview-xemacs.el | 2 +- lisp/org-colview.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-colview-xemacs.el b/lisp/org-colview-xemacs.el index ec892fe..b65aa18 100644 --- a/lisp/org-colview-xemacs.el +++ b/lisp/org-colview-xemacs.el @@ -516,7 +516,7 @@ This is the compiled version of the format.") 'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1)))))) (and (match-end 2) (not (assoc "TODO" fmt)) (concat " " (match-string 2 item))) (and (match-end 3) (not (assoc "PRIORITY" fmt)) (concat " " (match-string 3 item))) - " " (save-match-data (org-columns-compact-links (match-string 4 item))) + " " (save-match-data (org-columns-compact-links (or (match-string 4 item) ""))) (and (match-end 5) (not (assoc "TAGS" fmt)) (concat " " (match-string 5 item))))) (add-text-properties 0 (1+ (match-end 1)) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 95def1c..fb15880 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -357,7 +357,7 @@ CPHR is the complex heading regexp to use for parsing ITEM." 'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1)))))) (and (match-end 2) (not (assoc "TODO" fmt)) (concat " " (match-string 2 item))) (and (match-end 3) (not (assoc "PRIORITY" fmt)) (concat " " (match-string 3 item))) - " " (save-match-data (org-columns-compact-links (match-string 4 item))) + " " (save-match-data (org-columns-compact-links (or (match-string 4 item) ""))) (and (match-end 5) (not (assoc "TAGS" fmt)) (concat " " (match-string 5 item))))) (add-text-properties 0 (1+ (match-end 1)) -- 1.7.9.3 --------------090206030904050604000801--