mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 06:02:53 +00:00
Avoid compiler warnings about reference to free variable `old-level'
This commit is contained in:
parent
e04b71649e
commit
e1de4db669
|
@ -1,3 +1,8 @@
|
||||||
|
2010-06-08 Christian Egli <christian.egli@sbszh.ch>
|
||||||
|
|
||||||
|
* org-taskjuggler.el (org-export-taskjuggler-old-level):
|
||||||
|
define local variable to avoid compiler warning.
|
||||||
|
|
||||||
2010-06-07 Christian Egli <christian.egli@sbszh.ch>
|
2010-06-07 Christian Egli <christian.egli@sbszh.ch>
|
||||||
|
|
||||||
* org-exp.el (org-export): Added taskjuggler export to the export
|
* org-exp.el (org-export): Added taskjuggler export to the export
|
||||||
|
|
|
@ -148,8 +148,6 @@
|
||||||
;; - Make sure multiple dependency definitions (i.e. BLOCKER on
|
;; - Make sure multiple dependency definitions (i.e. BLOCKER on
|
||||||
;; previous-sibling and on a specific task_id) in multiple
|
;; previous-sibling and on a specific task_id) in multiple
|
||||||
;; attributes are properly exported.
|
;; attributes are properly exported.
|
||||||
;; - Fix compiler warnings about reference and assignment to free
|
|
||||||
;; variable `old-level' in org-taskjuggler-close-maybe
|
|
||||||
;;
|
;;
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
@ -237,6 +235,9 @@ but before any resource and task declarations."
|
||||||
|
|
||||||
;;; Autoload functions:
|
;;; Autoload functions:
|
||||||
|
|
||||||
|
;; avoid compiler warning about free variable
|
||||||
|
(defvar org-export-taskjuggler-old-level)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun org-export-as-taskjuggler ()
|
(defun org-export-as-taskjuggler ()
|
||||||
"Export parts of the current buffer as a TaskJuggler file.
|
"Export parts of the current buffer as a TaskJuggler file.
|
||||||
|
@ -271,7 +272,7 @@ defined in `org-export-taskjuggler-default-reports'."
|
||||||
(file-name-nondirectory buffer-file-name))
|
(file-name-nondirectory buffer-file-name))
|
||||||
org-export-taskjuggler-extension)))
|
org-export-taskjuggler-extension)))
|
||||||
(buffer (find-file-noselect filename))
|
(buffer (find-file-noselect filename))
|
||||||
(old-level 0)
|
(org-export-taskjuggler-old-level 0)
|
||||||
task resource)
|
task resource)
|
||||||
(unless tasks
|
(unless tasks
|
||||||
(error "No tasks specified"))
|
(error "No tasks specified"))
|
||||||
|
@ -305,14 +306,14 @@ defined in `org-export-taskjuggler-default-reports'."
|
||||||
(let ((level (cdr (assoc "level" resource))))
|
(let ((level (cdr (assoc "level" resource))))
|
||||||
(org-taskjuggler-close-maybe level)
|
(org-taskjuggler-close-maybe level)
|
||||||
(org-taskjuggler-open-resource resource)
|
(org-taskjuggler-open-resource resource)
|
||||||
(setq old-level level)))
|
(setq org-export-taskjuggler-old-level level)))
|
||||||
(org-taskjuggler-close-maybe 1)
|
(org-taskjuggler-close-maybe 1)
|
||||||
(setq old-level 0)
|
(setq org-export-taskjuggler-old-level 0)
|
||||||
(dolist (task tasks)
|
(dolist (task tasks)
|
||||||
(let ((level (cdr (assoc "level" task))))
|
(let ((level (cdr (assoc "level" task))))
|
||||||
(org-taskjuggler-close-maybe level)
|
(org-taskjuggler-close-maybe level)
|
||||||
(org-taskjuggler-open-task task)
|
(org-taskjuggler-open-task task)
|
||||||
(setq old-level level)))
|
(setq org-export-taskjuggler-old-level level)))
|
||||||
(org-taskjuggler-close-maybe 1)
|
(org-taskjuggler-close-maybe 1)
|
||||||
(org-taskjuggler-insert-reports)
|
(org-taskjuggler-insert-reports)
|
||||||
(save-buffer)
|
(save-buffer)
|
||||||
|
@ -630,10 +631,10 @@ org-mode priority string."
|
||||||
"\n"))))
|
"\n"))))
|
||||||
|
|
||||||
(defun org-taskjuggler-close-maybe (level)
|
(defun org-taskjuggler-close-maybe (level)
|
||||||
(while (> old-level level)
|
(while (> org-export-taskjuggler-old-level level)
|
||||||
(insert "}\n")
|
(insert "}\n")
|
||||||
(setq old-level (1- old-level)))
|
(setq org-export-taskjuggler-old-level (1- org-export-taskjuggler-old-level)))
|
||||||
(when (= old-level level)
|
(when (= org-export-taskjuggler-old-level level)
|
||||||
(insert "}\n")))
|
(insert "}\n")))
|
||||||
|
|
||||||
(defun org-taskjuggler-insert-reports ()
|
(defun org-taskjuggler-insert-reports ()
|
||||||
|
|
Loading…
Reference in a new issue