Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: calfw-org: Ensure that string-match does not get nil input #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions calfw-org.el
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ For example,
(props (cfw:extract-text-props item 'face 'keymap))
(extra (cfw:org-tp item 'extra)))
(setq text (substring-no-properties text))
(when (string-match (concat "^" org-deadline-string ".*") extra)
(when (and extra (string-match (concat "^" org-deadline-string ".*") extra))
(add-text-properties 0 (length text) (list 'face (org-agenda-deadline-face 1.0)) text))
(if org-todo-keywords-for-agenda
(when (string-match (concat "^[\t ]*\\<\\(" (mapconcat 'identity org-todo-keywords-for-agenda "\\|") "\\)\\>") text)
Expand Down Expand Up @@ -230,10 +230,10 @@ If this function splits into a list of string, the calfw displays those string i
"Return a range object (begin end text).
If TEXT does not have a range, return nil."
(let* ((dotime (cfw:org-tp text 'dotime)))
(and (stringp dotime) (string-match org-ts-regexp dotime)
(and (stringp dotime) (and dotime (string-match org-ts-regexp dotime))
(let ((date-string (match-string 1 dotime))
(extra (cfw:org-tp text 'extra)))
(if (string-match "(\\([0-9]+\\)/\\([0-9]+\\)): " extra)
(if (and extra (string-match "(\\([0-9]+\\)/\\([0-9]+\\)): " extra))
(let* ((cur-day (string-to-number
(match-string 1 extra)))
(total-days (string-to-number
Expand Down