From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leonard Avery Randall Subject: Re: (org-insert-headline '(4)) should insert new headline before point Date: Mon, 02 Jun 2014 13:11:10 +0100 Message-ID: <538C69DE.8050801@gmail.com> References: <87a9bk9guf.fsf@bzg.ath.cx> <87zjjdafa3.fsf@bzg.ath.cx> <87eh0lg940.fsf@bzg.ath.cx> <8738gwwbxb.fsf@bzg.ath.cx> <87siowqks8.fsf@bzg.ath.cx> <87fvkvfbqb.fsf@bzg.ath.cx> <8738g3ucrn.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------060704070608000902000703" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrR5M-0006vp-3m for emacs-orgmode@gnu.org; Mon, 02 Jun 2014 08:11:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrR5G-0003d4-Oh for emacs-orgmode@gnu.org; Mon, 02 Jun 2014 08:11:28 -0400 In-Reply-To: <8738g3ucrn.fsf@bzg.ath.cx> 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: Bastien Cc: York Zhao , emacs-orgmode This is a multi-part message in MIME format. --------------060704070608000902000703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Thanks! All best, Leonard > Bastien > May 21, 2014 at 2:43 AM > Hi Leonard, > > I followed your directions and added another fix. > > Things should be okay now, let me know if not. > > Thanks, > > Leonard Randall > May 4, 2014 at 3:37 AM > Hi Bastien, > > Just to follow up on the error, reverting commit 0ca4092 fixes the bug > that I mentioned in my last email and reverting the fourth hunk of > commit b8c85a1 should fix the bug that you tried to fix with that > commit. Carsten had added an 'unless (bolp)' condition to the > function that controls inserting new lines outside of headlines to > avoid deleting whitespace. However, so far as I can tell, the other > measures Carsten put in place with that commit made adding this > condition unnecessary. Outside of the contexts where it produces the > first bug I mentioned it does not seem to affect headline insertion > behaviour. > > Anyway, reverting those commits should get headline insertion to work > as advertised. > > All best > > Leonard > > Leonard Randall > April 30, 2014 at 6:03 PM > > Hi Bastien, > Thanks for the fix, and sorry to be the bearer of bad news, but there > seems to be a new issue. Now, if you press M-RET in a lower level tree > anywhere but in the headline, it will produce a new first level > headline. So, given buffer contents as in example (a), if i press > M-Ret at the end of `two', I get (b) which is what I would expect, > but if i press RET, then M-RET, I get (c) which is certainly not what > I would expect. > > --example-a-- > * Level one > > ** Level two > --end-example-a-- > > --example b-- > * Level one > > ** Level two > > ** > --end-example-b-- > > ----example-c-- > * Level one > > ** Level two > > * > ----end-example-c- > > Thanks again. > > All best, > Leonard > Bastien > April 30, 2014 at 9:44 AM > Hi Leonard, > > Okay, I see now and this is fixed -- thanks for your patience, > > Leonard Randall > April 30, 2014 at 8:12 AM > > > > > I'm having a hard time finding out what you *did* exactly -- can you > describe the way to reproduce the bug from an empty buffer, step by > step? > > > Sorry, I should have been more explicit about what I was doing. Step > by step instructions would look something like this. > > If I type the following commands, > > 1. emacs -q -l ~/minimal-init.el > 2. C-x C-f ~/test.org RET > 3. bla > 4. C-a > 5. M-RET > 6. C-e > 7. RET > 8. bla bla > 9. C-a > 10. M-RET > > I get: > ----begin-example--- > * bla > * > bla bla > ----end-example--- > > If I perform the same commands without loading the minimal init file > (Minimal-init just adds the most recent version org-mode to the load > path, and says to debug on error), I get this > > ----begin example--- > > * bla > * bla bla > ----end-example--- > > It adds a new line before the first headline, but otherwise it acts as > expected. I am not sure if it makes any difference. But I am running > the the Homebrew version of emacs 24.3.1 on OS X Mavericks. > > All best, > Leonard --------------060704070608000902000703 Content-Type: multipart/related; boundary="------------010400010806030402060004" --------------010400010806030402060004 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks!
All best,
Leonard

May 21, 2014 at 2:43 AM
Hi Leonard,

I followed your directions and added another fix.

Things should be okay now, let me know if not.

Thanks,

May 4, 2014 at 3:37 AM
Hi Bastien,

Just to follow up on the error, reverting commit 0ca4092 fixes the bug that I mentioned in my last email and reverting the fourth hunk of commit b8c85a1 should fix the bug that you tried to fix with that commit.  Carsten had added an 'unless (bolp)' condition to the function that controls inserting new lines outside of headlines to avoid deleting whitespace. However, so far as I can tell, the other measures Carsten put in place with that commit made adding this condition unnecessary. Outside of the contexts where it produces the first bug I mentioned it does not seem to affect headline insertion behaviour.

Anyway, reverting those commits should get headline insertion to work as advertised.

All best

Leonard

April 30, 2014 at 6:03 PM

Hi Bastien,
Thanks for the fix, and sorry to be the bearer of bad news, but there seems to be a new issue. Now, if you press M-RET in a lower level tree anywhere but in the headline, it will produce a new first level headline. So, given buffer contents as in example (a), if i press M-Ret at the end of `two', I get (b)  which is what I would expect, but if i press RET, then M-RET, I get (c) which is certainly not what I would expect.

--example-a--
* Level one

** Level two
--end-example-a--

--example b--
* Level one

** Level two

**
--end-example-b--

----example-c--
* Level one

** Level two

*
----end-example-c-

Thanks again.

All best,
Leonard
April 30, 2014 at 9:44 AM
Hi Leonard,

Okay, I see now and this is fixed -- thanks for your patience,

April 30, 2014 at 8:12 AM




I'm having a hard time finding out what you *did* exactly -- can you
describe the way to reproduce the bug from an empty buffer, step by
step? 
 
Sorry, I should have been more explicit about what I was doing. Step by step instructions would look something like this.

 If I type the following commands,

1. emacs -q -l ~/minimal-init.el
2. C-x C-f ~/test.org RET
3. bla
4. C-a
5. M-RET
6. C-e
7. RET
8. bla bla
9. C-a
10. M-RET

I get:
----begin-example---
* bla
*
bla bla
----end-example---

If I perform the same commands without loading the minimal init file (Minimal-init just adds the most recent version org-mode to the load path, and says to debug on error), I get this

----begin example---

* bla
* bla bla
----end-example---

It adds a new line before the first headline, but otherwise it acts as expected. I am not sure if it makes any difference. But I am running the the Homebrew version of emacs 24.3.1 on OS X Mavericks.

All best,
Leonard
--------------010400010806030402060004 Content-Type: image/jpeg; x-apple-mail-type=stationery; name="postbox-contact.jpg" Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: inline; filename="postbox-contact.jpg" /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgK CgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkL EBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAAR CAAZABkDAREAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAA AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl 5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYk NOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk 5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD9MdB0rSdT0LT9TvtKs7m5u7SKeWaaFXZ3 ZASSSM9T+FAHyX8YPjB488O6Np99qngvwdpUUmry2GqlLwGOOxUIJJLZYw0tzISzKCo42jKr k18ri80VfETw1KbUo7Wtbbr8z2qGCioxqJc11d3W2p2fw08caL4R8LWUPiLSLOx0nSrYg21x Zw21/GGXzE748xQfuoRzwOgFeXhOK631qFCvC8XpeKvfpf7zatlCqxc6OjfT9DzD/h4T4Q/6 DniD/wAA4/8A4qvr/wC0aPn9xn/q9jf7v3n014k+IVv4C+FPhzW21BIpms7FktxH5ktynlru RVAJGcjLdvUVx5/miynC/WHJKzW/VX1S8zjyvAzzCv7GEW20/v6Hz1f/ABQ8NeIviB4R8Naa uoRCU3N1qM88CMi3jLuRIlIPTkscYJxxXwlfG4PF0frWFlepJe89l9x9hhstxmBo1HWTSWiX lvqaUn7Pfw68f/HfTI/EV3qMaTafJrCrbzBGvbyB1jYuxBP3JgTtwflHSuzhF08dKdGo78m3 +QsTm+JwGASpRV+bd6tXT28jxT/hmL4B/wDQjJ/4Gz//ABdfoP1Wl2/E+O/tPEd/wR6547+L Xw4mvPDOi674h0/SdS0fQbTTsamhBhkZf3jFMZIDRhTnBHPvXy2eZf8A2vXi5/BC61V9e6Pq Mhw2OpYSVTC03Lne67LpcombwJ410PXfEGh3+lXWs+HtMj1CxuLJ4iRJa3HmysmMld0UUnDd j0715GH4do0Z1m425o+6le2m7a7vzPQq4zGUJUaOITV20+bez0Wrvon2PQdT8SWOg+KPBPjy O6VLSy1iO3uZc/ItpeIYWZjngBnjbJ6YrxeEJPCZnyvroY4ul7XCVaX92/zjr/wDy7+yvFX/ AELeq/8AgJJ/8TX7Gfn58m/8FFv+TsPEn/XC3/8AQK5a3xH3/C/+7fNnN/AP/kUvGf8A17yf +k8lRL/M5OJP49L+uqPRfCf/AB+eE/8AsKaP/wClUNfKYL/e16nHU+GXoz9ia+4Plz//2Q== --------------010400010806030402060004 Content-Type: image/jpeg; x-apple-mail-type=stationery; name="compose-unknown-contact.jpg" Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: inline; filename="compose-unknown-contact.jpg" /9j/4AAQSkZJRgABAQEARwBHAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEC AQEBAQEBAgICAgICAgICAgICAgICAgICAgICAgICAgICAgL/2wBDAQEBAQEBAQICAgICAgIC AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgL/wAAR CAAZABkDAREAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAABgcICQr/xAA0EAABAwMCAgUK BwAAAAAAAAACAQMEBQYRABITIQcUMUF2CBUXIjI2N0JRtVRWkZOV0dL/xAAYAQEAAwEAAAAA AAAAAAAAAAADAAEEAv/EACQRAAICAAQGAwAAAAAAAAAAAAABAhEDMrHREyExM0FxgfDx/9oA DAMBAAIRAxEAPwDuEt+gW/ULet6oVC3rfqNQqFv0OfPn1GhUqfOmzZtKZlS5UqZMaNwzNwiJ VIl7eXLCaZIGwBl3TY8epPx2+jy2ZNPjvkwc9uhW8j7nCPhvOsQliYIeS7cvCpp8o50qwrC4 v3lsNSDbdmTEhvs2tahxpfV3WnmbbozJEw/gwdadbYExVRXKEKoSdvJcaOSqxE7/AAiX0gXx +a69/JSf9alIlste0VzaNpeFrcT9KKymotyiaZ0KRCnzacoE7Kjzn4gi2KqUh3jqDHDHv4mR UfruTWlMzlVUKIVNp9GguEJnAh0+IZjyAiisgyRDnu5azS8miKqjOTVkKqS/psG37fo1Fbab eg25b8eZPeFJBBJSjMG5HjMeyihnaauZwe4OGiju13GAcpOwBeN+U8/IkGbsiS8b7ryogmbz hbyc9REROfZhERO5ETShjPtvpGqTUyLErytS4siSwx5x2tRH4hPOI0DkjZtaJtFxuVEbIUUi yeNujlBUJGbJN6nM/Cyf2Hf60YgjvKA+NPSP4gT7axpcPtr51YWJnYn9dnAQWl722p4ot37y zqnlfp6FrqbwawG8/9k= --------------010400010806030402060004-- --------------060704070608000902000703--