emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Remove redundant tags of headlines
@ 2014-03-13 15:36 Sebastien Vauban
  2014-03-13 15:54 ` Bastien
  2014-03-14 12:05 ` Nicolas Richard
  0 siblings, 2 replies; 9+ messages in thread
From: Sebastien Vauban @ 2014-03-13 15:36 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-03-14 16:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-13 15:36 Remove redundant tags of headlines Sebastien Vauban
2014-03-13 15:54 ` Bastien
2014-03-14 11:31   ` Sebastien Vauban
2014-03-14 14:49     ` Bastien
2014-03-14 15:03       ` Sebastien Vauban
2014-03-14 15:28         ` Bastien
     [not found]           ` <87bnx8re93.fsf-E3UqQZAQFPqWIDz0JBNUog@public.gmane.org>
2014-03-14 16:17             ` Sebastien Vauban
2014-03-14 12:05 ` Nicolas Richard
2014-03-14 14:53   ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).