emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [bug?] org-repair-property-drawers does not repair whole file
Date: Sun, 08 Mar 2015 22:45:28 +0100	[thread overview]
Message-ID: <87d24j40zr.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <20150308200218.GA13900@boo.workgroup> (Gregor Zattler's message of "Sun, 8 Mar 2015 21:02:18 +0100")

Gregor Zattler <telegraph@gmx.net> writes:

> Sadly no: I reapplied `org-repair-property-drawers' on my org
> file with no customisation at all:
>
> emacs-snapshot -Q -nw -L /home/grfz/src/org-mode/lisp/ file.org ~/src/org-mode/etc/ORG-NEWS
>
> I loaded `org-repair-property-drawers' from
> ~/src/org-mode/etc/ORG-NEWS and executed it in file.org.  Result
> is ’(nil nil nil nil nil nil nil nil nil nil nil nil ... )’ and
> the buffer file.org remains unmodified.

Doesn't the function fix the "anon" file you sent?

Is it possible to have access to the file? You might want to hide
contents first with the following function

  (defun scramble-contents ()
    (interactive)
    (let ((tree (org-element-parse-buffer)))
      (org-element-map tree '(code comment comment-block example-block fixed-width
                                   keyword link node-property plain-text verbatim)
        (lambda (obj)
          (cl-case (org-element-type obj)
            ((code comment comment-block example-block fixed-width keyword
                   node-property verbatim)
             (let ((value (org-element-property :value obj)))
               (org-element-put-property
                obj :value (replace-regexp-in-string "[[:alnum:]]" "x" value))))
            (link
             (unless (string= (org-element-property :type obj) "radio")
               (org-element-put-property obj :raw-link "http://orgmode.org")))
            (plain-text
             (org-element-set-element
              obj (replace-regexp-in-string "[[:alnum:]]" "x" obj)))))
        nil nil nil t)
      (let ((buffer (get-buffer-create "*Scrambled text*")))
        (with-current-buffer buffer
          (insert (org-element-interpret-data tree))
          (goto-char (point-min)))
        (switch-to-buffer buffer))))

Regards,

  reply	other threads:[~2015-03-08 21:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 23:36 [bug?] org-repair-property-drawers does not repair whole file Gregor Zattler
2015-03-08 17:01 ` Nicolas Goaziou
2015-03-08 20:02   ` Gregor Zattler
2015-03-08 21:45     ` Nicolas Goaziou [this message]
2015-03-09 11:09       ` Gregor Zattler
2015-03-09 16:43         ` Nicolas Goaziou
2015-03-09 19:27           ` Gregor Zattler
2015-03-10  8:18             ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d24j40zr.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).