From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Bug: Refile sometimes loses the last line [7.7 (release_7.7.15.gc363)] Date: Mon, 01 Aug 2011 00:18:28 -0400 Message-ID: <8762mh69yj.fsf@norang.ca> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:54613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnjxg-0001YJ-Ep for emacs-orgmode@gnu.org; Mon, 01 Aug 2011 00:18:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qnjxf-0000gr-5m for emacs-orgmode@gnu.org; Mon, 01 Aug 2011 00:18:40 -0400 Received: from mho-04-ewr.mailhop.org ([204.13.248.74]:47325 helo=mho-02-ewr.mailhop.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnjxf-0000gh-3d for emacs-orgmode@gnu.org; Mon, 01 Aug 2011 00:18:39 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org, 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 | 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)