emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: emacs-orgmode@gnu.org,
	Jason Dunsmore <emacs-orgmode@deathroller.dunsmor.com>
Subject: Bug: Refile sometimes loses the last line [7.7 (release_7.7.15.gc363)]
Date: Mon, 01 Aug 2011 00:18:28 -0400	[thread overview]
Message-ID: <8762mh69yj.fsf@norang.ca> (raw)

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)

             reply	other threads:[~2011-08-01  4:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01  4:18 Bernt Hansen [this message]
2011-08-03 15:05 ` Bug: Refile sometimes loses the last line [7.7 (release_7.7.15.gc363)] 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8762mh69yj.fsf@norang.ca \
    --to=bernt@norang.ca \
    --cc=emacs-orgmode@deathroller.dunsmor.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).