emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Maus <dmaus@ictsoc.de>
To: Bernt Hansen <bernt@norang.ca>
Cc: emacs-orgmode@gnu.org,
	Jason Dunsmore <emacs-orgmode@deathroller.dunsmor.com>
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	[thread overview]
Message-ID: <877h6ti839.wl%dmaus@ictsoc.de> (raw)
In-Reply-To: <87y5zarmab.fsf@norang.ca>

[-- Attachment #1: Type: text/plain, Size: 1064 bytes --]

At Wed, 03 Aug 2011 21:35:40 -0400,
Bernt Hansen wrote:
>
> Jason Dunsmore <emacs-orgmode@deathroller.dunsmor.com> 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

[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]

  reply	other threads:[~2011-08-04 14:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=877h6ti839.wl%dmaus@ictsoc.de \
    --to=dmaus@ictsoc.de \
    --cc=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).