From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: Bug: Refile sometimes loses the last line [7.7 (release_7.7.15.gc363)] Date: Thu, 04 Aug 2011 16:07:06 +0200 Message-ID: <877h6ti839.wl%dmaus@ictsoc.de> References: <8762mh69yj.fsf@norang.ca> <8762meedru.fsf@riotblast.dunsmor.com> <87y5zarmab.fsf@norang.ca> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Thu_Aug__4_16:07:05_2011-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoyZv-0003uW-Gn for emacs-orgmode@gnu.org; Thu, 04 Aug 2011 10:07:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QoyZt-0003GP-R4 for emacs-orgmode@gnu.org; Thu, 04 Aug 2011 10:07:15 -0400 Received: from app1b.xlhost.de ([213.202.242.162]:48734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoyZt-0003DW-Jq for emacs-orgmode@gnu.org; Thu, 04 Aug 2011 10:07:13 -0400 In-Reply-To: <87y5zarmab.fsf@norang.ca> 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: Bernt Hansen Cc: emacs-orgmode@gnu.org, Jason Dunsmore --pgp-sign-Multipart_Thu_Aug__4_16:07:05_2011-1 Content-Type: text/plain; charset=US-ASCII At Wed, 03 Aug 2011 21:35:40 -0400, Bernt Hansen wrote: > > Jason Dunsmore writes: > > > Hi Bernt, > > > > Can you see if this patch fixes the problem? > > > > diff --git a/lisp/org.el b/lisp/org.el > > index c7b28dd..41ac8c6 100644 > > --- a/lisp/org.el > > +++ b/lisp/org.el > > @@ -19212,7 +19212,9 @@ Returns the number of empty lines passed." > > (let ((pos (point))) > > (if (cdr (assoc 'heading org-blank-before-new-entry)) > > (skip-chars-backward " \t\n\r") > > - (forward-line -1)) > > + (unless (eq (line-number-at-pos) > > + (count-lines (point-min) (point-max))) > > + (forward-line -1))) > > (beginning-of-line 2) > > (goto-char (min (point) pos)) > > (count-lines (point) pos))) > > This patch fixes it for me. Thanks!! I just pushed a simplified version of the solution: No need to count lines, just check if point is at end of buffer. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Thu_Aug__4_16:07:05_2011-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAk46p4kACgkQma24O1pEeOaiQQEAxJ6JomKw33iHyhpDtYbUf1mb pSeJBgM7YL+bXfp7/NcBANAx1YtHukLzy8vnLQ4l6Sxlh0k1LhRm+swQUKr8Xk/m =wmi4 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Thu_Aug__4_16:07:05_2011-1--