emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Remove redundant tags of headlines


From: Sebastien Vauban
Subject: [O] Remove redundant tags of headlines
Date: Thu, 13 Mar 2014 16:36:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)

Hello,

FYI, the code to "Remove redundant tags of headlines" (see
http://orgmode.org/worg/org-hacks.html#sec-1-8-1) is not functioning
anymore.

--8<---------------cut here---------------start------------->8---
(defun dmj/org-remove-redundant-tags ()
  "Remove redundant tags of headlines in current buffer.

A tag is considered redundant if it is local to a headline and
inherited by a parent headline."
  (interactive)
  (when (eq major-mode 'org-mode)
    (save-excursion
      (org-map-entries
       '(lambda ()
          (let ((alltags (split-string (or (org-entry-get (point) "ALLTAGS") 
"") ":"))
                local inherited tag)
            (dolist (tag alltags)
              (if (get-text-property 0 'inherited tag)
                  (push tag inherited) (push tag local)))
            (dolist (tag local)
              (if (member tag inherited) (org-toggle-tag tag 'off)))))
       t nil))))
--8<---------------cut here---------------end--------------->8---

The problem seems to be that `org-map-entries' return a sequence of
`nil'.

I tried Edebugging it, but Edebug does not jump into the execution of
the anonymous function...

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

[Prev in Thread] Current Thread [Next in Thread]