From mboxrd@z Thu Jan 1 00:00:00 1970 From: Piyush Srivastava Subject: Re: Org-info-js folding is broken in 8.3 releases Date: Sat, 5 Sep 2015 20:32:49 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1135329c84a277051f0bc97d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYQhI-0003mn-IX for emacs-orgmode@gnu.org; Sat, 05 Sep 2015 23:32:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYQhH-00062m-C3 for emacs-orgmode@gnu.org; Sat, 05 Sep 2015 23:32:52 -0400 Received: from mail-oi0-x22b.google.com ([2607:f8b0:4003:c06::22b]:36158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYQhH-00062e-4A for emacs-orgmode@gnu.org; Sat, 05 Sep 2015 23:32:51 -0400 Received: by oibi136 with SMTP id i136so30019316oib.3 for ; Sat, 05 Sep 2015 20:32:49 -0700 (PDT) In-Reply-To: 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 --001a1135329c84a277051f0bc97d Content-Type: text/plain; charset=UTF-8 Of course, we will also need to change the regexp SID_REGEX (in org-info-src.js) to "/(^#)((sec-|orgheadline)\d+([._]\d+)*$)/" from the current value of "/(^#)(sec-\d+([._]\d+)*$)/". It's capturing groups are not used, to this should not propagate any more changes. On Sat, Sep 5, 2015 at 8:20 PM, Piyush Srivastava wrote: > I think I have finally isolated a fix. org-info.js uses the magic number > "4" (i.e. the length of the string "sec-") to substring DOM ids in order to > fin section numbers (this is on line number 97 in the source code of > org-info-src.js). However the changes to org-export-get-reference mean > that instead of using the string "sec-" before the section heading, ox-html > now used the string "orgheadline". Thus, the fix is to replace "4" by > "orgheadline".length in the source code of org-info-src.js. > > This seems to be the simplest way to fix this error. However, as it is, > it will break those people's code who are using the online version of the > script. We will probably need to detect what string the html file is using > in the DOM id for headlines and used the length of that string. I will try > to write a patch in the next few days if this strategy sounds good. > > -- Piyush. > > > > On Sat, Sep 5, 2015 at 5:20 PM, Piyush Srivastava > wrote: > >> In fact, further investigation shows that the first commit that actually >> breaks org-info-js is the replacement of `org-export-get-headline-id' by >> `org-export-get-reference' in commit id 459033 on April 13. These problems >> are temporarily fixed by commit cf7d64, and then reintroduced by commit >> 4ee8f4 which reverted the changes made to org-export-get-reference in >> cf7d64. >> >> -- Piyush. >> >> >> On Sat, Sep 5, 2015 at 4:20 PM, Piyush Srivastava >> wrote: >> >>> Hi, >>> >>> >>> In the current 8.3.1 release of org-mode the f/F keybinding that >>> org-info-js provides for folding headings in plain mode (of exported html >>> files) fails to work. Further, the 's' and 'o' keys for search and occur >>> respectively also fail to work. Both of these work with the 8.2.10 release. >>> >>> I have attached a minimal org-mode file with which I can reproduce this >>> error. By bisecting the commit history, I find that the breaking change is >>> introduced by commit 4ee8f4 which has the following commit message: >>> >>> Author: Rasmus >>> Date: Sun Apr 19 16:00:06 2015 +0200 >>> >>> Revert "ox: Change label naming scheme" >>> >>> This reverts commit cf7d64f1e456cad281674fc81a8074f969b7911c. >>> >>> The log produced by git bisect is also attached. >>> >>> >>> Thanks, >>> -- Piyush. >>> >>> >>> >>> >>> >> > --001a1135329c84a277051f0bc97d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Of course, we will also need to change the regexp SID_REGE= X (in org-info-src.js) to "/(^#)((sec-|orgheadline)\d+([._]\d+)*$)/&qu= ot; from the current value of "/(^#)(sec-\d+([._]\d+)*$)/".=C2=A0= It's capturing groups are not used, to this should not propagate any m= ore changes.

On Sat, Sep 5, 2015 at 8:20 PM, Piyush Srivastava &l= t;piyushsriva@gm= ail.com> wrote:
I think I have finally isolated a fix.=C2=A0 org-info.js us= es the magic number "4" (i.e. the length of the string "sec-= ") to substring DOM ids in order to fin section numbers (this is on li= ne number 97 in the source code of org-info-src.js).=C2=A0=C2=A0 However th= e changes to org-export-get-reference mean that instead of using the string= "sec-" before the section heading, ox-html now used the string &= quot;orgheadline".=C2=A0 Thus, the fix is to replace "4" by = "orgheadline".length in the source code of org-info-src.js.
This seems to be the simplest way to fix this error.=C2=A0 However,= as it is, it will break those people's code who are using the online v= ersion of the script.=C2=A0 We will probably need to detect what string the= html file is using in the DOM id for headlines and used the length of that= string.=C2=A0 I will try to write a patch in the next few days if this str= ategy sounds good.

-- Piyush.=



On Sat, Sep 5, 2015 = at 5:20 PM, Piyush Srivastava <piyushsriva@gmail.com> wr= ote:
In fact, furth= er investigation shows that the first commit that actually breaks org-info-= js is the replacement of `org-export-get-headline-id' by `org-export-ge= t-reference' in commit id 459033 on April 13.=C2=A0 These problems are = temporarily fixed by commit cf7d64, and then reintroduced by commit 4ee8f4 = which reverted the changes made to org-export-get-reference in cf7d64.

-- Piyush.


On Sat, Sep 5, 2015 at 4:20 PM, Piyu= sh Srivastava <piyushsriva@gmail.com> wrote:
Hi,


In t= he current 8.3.1 release of org-mode the f/F keybinding that org-info-js pr= ovides for folding headings in plain mode (of exported html files) fails to= work.=C2=A0 Further, the 's' and 'o' keys for search and o= ccur respectively also fail to work.=C2=A0 Both of these work with the 8.2.= 10 release.

I have attached a minimal org-mode file with which I can= reproduce this error.=C2=A0 By bisecting the commit history, I find that t= he breaking change is introduced by commit 4ee8f4 which has the following c= ommit message:

Author: Rasmus <rasmus@gmx.us>
Date:=C2=A0=C2=A0 Sun Apr 19 16:0= 0:06 2015 +0200

=C2=A0=C2=A0=C2=A0 Revert "ox: Change label nam= ing scheme"
=C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2=A0 This reverts = commit cf7d64f1e456cad281674fc81a8074f969b7911c.

The log = produced by git bisect is also attached.


Thanks,
<= /div>
-- Piyush.







--001a1135329c84a277051f0bc97d--