emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ilya Shlyakhter <ilya_shl@alum.mit.edu>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Colview bugfix: blank headline causes a crash
Date: Sat, 24 Mar 2012 20:38:45 -0400	[thread overview]
Message-ID: <jklpei$toh$1@dough.gmane.org> (raw)

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

A blank headline (e.g. with just a TODO keyword) caused a crash when 
building colview.   Patch attached.


[-- Attachment #2: 0001-Colview-bugfix-A-headline-with-just-a-TODO-keyword-a.patch --]
[-- Type: text/plain, Size: 2180 bytes --]

From 6bb1413821a7cbf94b3abbfc6e985e187dd8d6d9 Mon Sep 17 00:00:00 2001
From: Ilya Shlyakhter <ilya_shl@alum.mit.edu>
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


             reply	other threads:[~2012-03-25  0:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-25  0:38 Ilya Shlyakhter [this message]
2012-03-25  0:52 ` [PATCH] Colview bugfix: blank headline causes a crash 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='jklpei$toh$1@dough.gmane.org' \
    --to=ilya_shl@alum.mit.edu \
    --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).