diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-10-21 18:22:47 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-10-21 18:26:31 +0200 |
commit | e40903a6b6087ab4b97c51830bfc36cc2f3a83c8 (patch) | |
tree | 6a45bbbe42b01637d2dbf2fd4c492981f5f2b67a | |
parent | 52b07a584c1b6ee7444065497acdf100716d6701 (diff) | |
download | org-mode-e40903a6b6087ab4b97c51830bfc36cc2f3a83c8.tar.gz |
lisp/org-indent.el: Fix bug in org-indent that changes the selection
* lisp/org-indent.el: (org-indent-add-properties): Use
`with-silent-modificaitons'.
(org-indent-remove-properties): Use `with-silent-modificaitons'.
Julien Danjou writes:
> I'm using org 7.01h with Emacs 24 trunk. When I set org-startup-indented
> to t, I observe the following:
>
> ** TODO Some stuff
>
> I select "stuff" and press M-w. Then I go the the line under and press
> C-y (org-yank).
>
> Now I got:
>
> ** TODO Some stuff
> ** TODO Some
>
> instead of:
>
> ** TODO Some stuff
> stuff
>
> Note that after M-w, `kill-ring' has a correct first entry of "stuff":
>
> (#("stuff" 0 5
> (fontified t face org-level-2))
> ...)
>
> But on C-y (org-yank) something happens, and it paste the wrong text. I
> think it's trying to be smart but it's not.
>
> I've found that setting org-startup-indented to nil fix that behaviour.
-rw-r--r-- | lisp/org-indent.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/org-indent.el b/lisp/org-indent.el index e3edd25..9376aa2 100644 --- a/lisp/org-indent.el +++ b/lisp/org-indent.el @@ -204,8 +204,8 @@ useful to make it ever so slightly different." (defun org-indent-remove-properties (beg end) "Remove indentations between BEG and END." (let ((inhibit-modification-hooks t)) - (org-unmodified - (remove-text-properties beg end '(line-prefix nil wrap-prefix nil))))) + (with-silent-modifications + (remove-text-properties beg end '(line-prefix nil wrap-prefix nil))))) (defun org-indent-remove-properties-from-string (string) "Remove indentations between BEG and END." @@ -222,7 +222,7 @@ Assumes that BEG is at the beginning of a line." (when (or t org-indent-mode) (let ((inhibit-modification-hooks t) ov b e n level exit nstars) - (org-unmodified + (with-silent-modifications (save-excursion (goto-char beg) (while (not exit) |