emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Refile sometimes loses the last line [7.7 (release_7.7.15.gc363)]
@ 2011-08-01  4:18 Bernt Hansen
  2011-08-03 15:05 ` Jason Dunsmore
  0 siblings, 1 reply; 10+ messages in thread
From: Bernt Hansen @ 2011-08-01  4:18 UTC (permalink / raw)
  To: emacs-orgmode, Jason Dunsmore

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 <emacs-orgmode@deathroller.dunsmor.com>
| 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)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-08-16 17:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-01  4:18 Bug: Refile sometimes loses the last line [7.7 (release_7.7.15.gc363)] Bernt Hansen
2011-08-03 15:05 ` Jason Dunsmore
2011-08-04  1:35   ` Bernt Hansen
2011-08-04 14:07     ` David Maus
2011-08-04 14:35       ` Jason Dunsmore
2011-08-04 15:46         ` David Maus
2011-08-04 23:07           ` Bernt Hansen
2011-08-16 13:17       ` Bastien
2011-08-16 16:19         ` Bastien
2011-08-16 17:18           ` Achim Gratz

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).