Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmark buffer modified at markdown-unfontify-region-wiki-links #146

Merged
merged 1 commit into from
Jun 29, 2016

Conversation

nibble
Copy link
Contributor

@nibble nibble commented Jun 28, 2016

In Emacs 24.3 (tested Emacs 24.3.1 from Ubuntu 14.04 LTS) any Markdown buffer is marked as modified at creation when visiting the file (or activating the markdown major mode). This couldn't be reproduced in some later Emacs versions, like 24.4.1 from Debian Jessie.

The test / bisect script used to reproduce the bug is:

#!/bin/sh
rm -f \#README.md#
emacs -nw -Q -l markdown-mode.el \
    --eval '(setq enable-local-variables nil)' --visit README.md \
    --eval '(if (buffer-modified-p) (kill-emacs 1) (kill-emacs 0))'

The bisection showed that the commit that introduced this behavior was 3c2cfee, where the function markdown-unfontify-region-wiki-links is invoked from markdown-mode unless some non-default settings prevent it.

The problem seems to be that in Emacs 24.3 some remove-text-properties calls, like the ones in markdown-unfontify-region-wiki-links, mark the buffer modified. The proposed change unsets the buffer modified mark if it wasn't previously set.

In Emacs 24.3 some `remove-text-properties` calls, like the ones in
`markdown-unfontify-region-wiki-links`, mark the buffer modified. This
function is invoked by default from `markdown-mode`, and so it makes
that a Markdown buffer is marked modified just by visiting a file or
changing to this major mode.

This change unsets the buffer modified mark if it wasn't previously set.
@jrblevin jrblevin merged commit c5f9265 into jrblevin:master Jun 29, 2016
@jrblevin
Copy link
Owner

Merged--thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants