emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Clément Pit--Claudel" <clement.pitclaudel@live.com>
To: emacs-orgmode@gnu.org
Subject: Bug: org-hierarchical-todo-statistics + org-update-statistics cookies in before-save-hook breaks overlays [8.3.5 (8.3.5-elpaplus @ /home/clement/.emacs.d/.cask/25.1.50.7/elpa/org-plus-contrib-20160719/)]
Date: Sun, 31 Jul 2016 10:38:10 -0400	[thread overview]
Message-ID: <5a92df02-770d-4c2f-67f3-62861454a8e7@live.com> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 977 bytes --]

Hi emacs-orgmode,

Setting ‘org-hierarchical-todo-statistics’ to nil confuses ‘org-update-statistics-cookies’ when that function is used in a before-save-hook.

More precisely, every time I save the attached org file, the hidden section of the buffer shrinks a bit, revealing a few characters at the end of the buffer. This is weird. Fortunately, it's reproducible in emacs -Q. Here's a video: http://asciinema.org/a/1h4otbt9cviod3nef0nx1sa5s

I have attached minimal org.el and test.org files. With these, run

  emacs -Q -l org.el test.org

Then make a change on the first line and save. This will reveal a few characters at the end of the file-local variables section. Repeating the edit+save cycle shows a few more characters each time (if this is abstruse, watch the asciinema video above)

Let me know if I can provide more information!

Cheers,
Clément.

Emacs  : GNU Emacs 25.1.50.7 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2016-07-20

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: org.el --]
[-- Type: text/x-emacs-lisp; name="org.el", Size: 203 bytes --]

(defun ~/org/update-cookies ()
  (org-update-statistics-cookies 'all))

(defun ~/org/setup ()
  (add-hook 'before-save-hook #'~/org/update-cookies nil t))

(add-hook 'org-mode-hook #'~/org/setup)

[-- Attachment #1.1.3: test.org --]
[-- Type: application/vnd.lotus-organizer, Size: 303 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

             reply	other threads:[~2016-07-31 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-31 14:38 Clément Pit--Claudel [this message]
2016-08-08 20:00 ` Bug: org-hierarchical-todo-statistics + org-update-statistics cookies in before-save-hook breaks overlays [8.3.5 (8.3.5-elpaplus @ /home/clement/.emacs.d/.cask/25.1.50.7/elpa/org-plus-contrib-20160719/)] 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=5a92df02-770d-4c2f-67f3-62861454a8e7@live.com \
    --to=clement.pitclaudel@live.com \
    --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).