Merge branch 'master' of orgmode.org:org-mode

This commit is contained in:
Bastien Guerry 2014-03-15 16:11:34 +01:00
commit b345cc759a
2 changed files with 34 additions and 12 deletions

View File

@ -33,6 +33,22 @@
(require 'org) (require 'org)
(defcustom org-effectiveness-max-todo 50
"This variable is useful to advice to the user about
many TODO pending"
:type 'integer
:group 'org-effectiveness)
(defun org-effectiveness-advice()
"Advicing about a possible excess of TODOS"
(interactive)
(goto-char (point-min))
(if (< org-effectiveness-max-todo (count-matches "* TODO"))
(message "An excess of TODOS!")))
;; Check advice starting an org file
(add-hook 'org-mode-hook 'org-effectiveness-advice)
(defun org-effectiveness-count-keyword(keyword) (defun org-effectiveness-count-keyword(keyword)
"Print a message with the number of keyword outline in the current buffer" "Print a message with the number of keyword outline in the current buffer"
(interactive "sKeyword: ") (interactive "sKeyword: ")
@ -208,21 +224,26 @@
(defun org-effectiveness-plot-ascii (startdate enddate) (defun org-effectiveness-plot-ascii (startdate enddate)
(interactive "sGive me the start date: \nsGive me the end date: " startdate enddate) (interactive "sGive me the start date: \nsGive me the end date: " startdate enddate)
(setq dates (org-effectiveness-check-dates startdate enddate)) (setq dates (org-effectiveness-check-dates startdate enddate))
(setq syear (cadr (assoc 'startyear dates))) (let ((syear (cadr (assoc 'startyear dates)))
(setq smonth (cadr (assoc 'startmonth dates))) (smonth (cadr (assoc 'startmonth dates)))
(setq eyear (cadr (assoc 'endyear dates))) (year (cadr (assoc 'startyear dates)))
(setq emonth (cadr (assoc 'endmonth dates))) (month (cadr (assoc 'startmonth dates)))
;; (switch-to-buffer "*org-effectiveness*") (emonth (cadr (assoc 'endmonth dates)))
(let ((month smonth) (eyear (cadr (assoc 'endyear dates)))
(year syear) (buffer (current-buffer))
(str "")) (str ""))
(while (and (>= eyear year) (>= emonth month)) (while (or (> eyear year) (and (= eyear year) (>= emonth month)))
(org-effectiveness-ascii-bar (string-to-number (org-effectiveness-in-date (concat (number-to-string year) "-" (org-effectiveness-month-to-string month)) 1)) (format "%s-%s" year month)) (setq str (org-effectiveness-in-date (concat (number-to-string year) "-" (org-effectiveness-month-to-string month)) 1))
(if (= month 12) (switch-to-buffer "*org-effectiveness*")
(org-effectiveness-ascii-bar (string-to-number str) (format "%s-%s" year month))
(switch-to-buffer buffer)
(if (eq month 12)
(progn (progn
(setq year (+ 1 year)) (setq year (+ 1 year))
(setq month 1)) (setq month 1))
(setq month (+ 1 month)))))) (setq month (+ 1 month)))))
(switch-to-buffer "*org-effectiveness*"))
(provide 'org-effectiveness) (provide 'org-effectiveness)

View File

@ -10556,7 +10556,8 @@ is used internally by `org-open-link-from-string'."
(cond ((not option) nil) (cond ((not option) nil)
((org-string-match-p "\\`[0-9]+\\'" option) ((org-string-match-p "\\`[0-9]+\\'" option)
(list (string-to-number option))) (list (string-to-number option)))
(t (list nil option)))))))) (t (list nil
(org-link-unescape option)))))))))
((assoc type org-link-protocols) ((assoc type org-link-protocols)
(funcall (nth 1 (assoc type org-link-protocols)) path)) (funcall (nth 1 (assoc type org-link-protocols)) path))
((equal type "help") ((equal type "help")