From ce80a0e727fb4152462641209f41fea735ee459f Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 16 Jan 2016 15:56:03 +0100 Subject: [PATCH] Fix memory leak in `org-agenda-prepare-buffers' * lisp/org.el (org-agenda-prepare-buffers): Do not use `org-uniquify-alist' since it uses `eq' for comparison, whereas where are using strings as keys. Reported-by: Vincent Emanuele --- lisp/org.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index f741d5ee9..51c4c4a19 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -18755,10 +18755,14 @@ When a buffer is unmodified, it is just killed. When modified, it is saved (append org-tag-alist-for-agenda org-tag-alist org-tag-persistent-alist))) - (if org-group-tags - (setq org-tag-groups-alist-for-agenda - (org-uniquify-alist - (append org-tag-groups-alist-for-agenda org-tag-groups-alist)))) + ;; Merge current file's tag groups into global + ;; `org-tag-groups-alist-for-agenda'. + (when org-group-tags + (dolist (alist org-tag-groups-alist) + (let ((old (assoc (car alist) org-tag-groups-alist-for-agenda))) + (if old + (setcdr old (org-uniquify (append (cdr old) (cdr alist)))) + (push alist org-tag-groups-alist-for-agenda))))) (org-with-silent-modifications (save-excursion (remove-text-properties (point-min) (point-max) pall)