diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-10-06 21:51:51 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-10-06 22:04:27 +0200 |
commit | 956858a39562c2272807704ef128258804ce45a0 (patch) | |
tree | ebf36c01c2e3c3fbda4e953db940182577cb5355 | |
parent | 36306bae4e48b711edb2e05da87a50ebc5c41a1d (diff) | |
download | org-mode-956858a39562c2272807704ef128258804ce45a0.tar.gz |
org-export: Fix menu leak when reloading Org
* contrib/lisp/org-export.el (org-export-define-backend,
org-export-define-derived-backend): Make sure a given entry won't be
added to menu more than once.
-rw-r--r-- | contrib/lisp/org-export.el | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/contrib/lisp/org-export.el b/contrib/lisp/org-export.el index b1b5f9a..faea885 100644 --- a/contrib/lisp/org-export.el +++ b/contrib/lisp/org-export.el @@ -832,9 +832,8 @@ See `org-export-filters-alist' for more information.")) ',export-block)) ;; Add an entry for back-end in `org-export-dispatch'. ,(when menu-entry - (let ((menu (assq (car menu-entry) org-export-dispatch-menu-entries))) - (unless menu - `(push ',menu-entry org-export-dispatch-menu-entries)))) + `(unless (assq (car ',menu-entry) org-export-dispatch-menu-entries) + (add-to-list 'org-export-dispatch-menu-entries ',menu-entry))) ;; Splice in the body, if any. ,@body))) @@ -965,9 +964,8 @@ structure of the values." "Alist between element or object types and translators.") ;; Add an entry for back-end in `org-export-dispatch'. ,(when menu-entry - (let ((menu (assq (car menu-entry) org-export-dispatch-menu-entries))) - (unless menu - `(push ',menu-entry org-export-dispatch-menu-entries)))) + `(unless (assq (car ',menu-entry) org-export-dispatch-menu-entries) + (add-to-list 'org-export-dispatch-menu-entries ',menu-entry))) ,(when sub-menu-entry (let ((menu (nth 2 (assq (car sub-menu-entry) org-export-dispatch-menu-entries)))) |