emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Bug: Refile sometimes loses the last line [7.7 (release_7.7.15.gc363


From: Bernt Hansen
Subject: [O] Bug: Refile sometimes loses the last line [7.7 (release_7.7.15.gc363)]
Date: Mon, 01 Aug 2011 00:18:28 -0400
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux)

Hi Jason,

I noticed a nasty refile bug this evening.  The problem commit is
identified as:

,----
| 85f03c0859d84d0b3b51764f379644d1461733df is the first bad commit
| commit 85f03c0859d84d0b3b51764f379644d1461733df
| Author: Jason Dunsmore <address@hidden>
| Date:   Tue Feb 15 21:31:17 2011 +0000
| 
|     Bugfix: honor `org-blank-before-new-entry' correctly in various contexts.
|     
|     * org.el (org-back-over-empty-lines): Bugfix.  Honor
|     `org-blank-before-new-entry' correctly in various contexts.
| 
| :040000 040000 b820d279cd7b170907d9171494dc65dd4c944d0b 
f45fdfa1a6e6181c4b9de712cafbd40fac38deb9 M      lisp
`----

I have the following minimal emacs setup to reproduce the problem:

~/bin/minimal-emacs
--8<---------------cut here---------------start------------->8---
#!/bin/sh
TESTEL=
TESTFILE=/tmp/test.el
if test -e $TESTFILE
then
  TESTEL="-l /tmp/test.el"
fi
emacs -q -l ~/minimal.emacs $TESTEL $1
--8<---------------cut here---------------end--------------->8---

~/minimal.emacs
--8<---------------cut here---------------start------------->8---
(add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
(require 'org-install)

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
--8<---------------cut here---------------end--------------->8---

/tmp/test.el
--8<---------------cut here---------------start------------->8---
(setq org-blank-before-new-entry (quote ((heading)
                                         (plain-list-item))))
(setq org-refile-targets (quote ((nil :maxlevel . 3)
                                 (org-agenda-files :maxlevel . 3))))
--8<---------------cut here---------------end--------------->8---

/tmp/scratch.org
--8<---------------cut here---------------start------------->8---
* Target for refile
* Tasks
** Refile me
this is a test
** TODO Refile me too
this loses the last line
** Foo
no end on this line
--8<---------------cut here---------------end--------------->8---

There is no newline at end of file in /tmp/scratch.org

Steps to reproduce:
| Keystrokes                       | Notes                               |
|----------------------------------+-------------------------------------|
| $ minimal-emacs /tmp/scratch.org | Start minimal emacs session         |
| C-u C-u C-u TAB                  | Reveal the entire file              |
| M-S-.                            | Go to end of file                   |
| backspace                        | Delete last newline in file         |
| C-c C-w                          | Refile * Foo to * Target for refile |
| TargetTAB                        | Complete * Target for refile name   |
| RET                              | Refile                              |

This refiles * Foo under * Target for refile but the "no end on this
line" is left behind.

If you repeat the above but refile to * Tasks instead of * Target for
refile then the last line "no end on this line" is deleted and lost.

I've locally reverted the above problem commit which seems to fix this
for me.

Regards,
Bernt

----------------------------------------------------------------------
Emacs  : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
 of 2010-12-11 on raven, modified by Debian
Package: Org-mode version 7.7 (release_7.7.15.gc363)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]