[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-20 Thread Stefan Monnier
>> - maybe we can even adjust_match_data in every call to replace_range
>> rather than just in the one from Freplace_match.
> That would be simpler, though I wasn't sure if it would be correct.

I think it's definitely not an option for emacs-25.  But maybe we can
try it on master.


Stefan





[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-20 Thread Eli Zaretskii
> From: npost...@users.sourceforge.net
> Cc: Eli Zaretskii ,  23...@debbugs.gnu.org,  
> nljlistb...@gmail.com,  jwieg...@gmail.com,  rpl...@gmail.com,  
> alex.ben...@linaro.org
> Date: Wed, 20 Jul 2016 20:56:28 -0400
> 
> >> Maybe there's a misunderstanding.  What Noam suggested was just to
> >> move the code which adjusts search_regs.start[i] and .end[i] to before
> >> the call to replace_range.
> >
> > Oh, right, that's also an option.  It might suffer from another problem,
> > which is that the match-data will be broken while the
> > before-change-functions are run, so if there's a save-match-data there
> > we're back to square one.
> 
> Solution: adjust in between the before and after change functions.
> Patch below.  I think there shouldn't be performance problems, although
> it does add yet another flag to replace_range (by the way, I noticed
> that the MARKERS flags is never 0, so it's redundant).  I tested with
> the attached bug-23917-match-data-buffer-modhook.el.

Thanks.

Please also make sure bug#23869 is still fixed after this.





[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-20 Thread Stefan Monnier
> Solution: adjust in between the before and after change functions.
> Patch below.  I think there shouldn't be performance problems, although
> it does add yet another flag to replace_range (by the way, I noticed
> that the MARKERS flags is never 0, so it's redundant).  I tested with
> the attached bug-23917-match-data-buffer-modhook.el.

Looks pretty good, indeed.  More specifically, looks like the better fix.
2 comments:
- I'd take advantage of this change to replace the 0/1 booleans with
  false/true [but that's just my preference of bikeshed color).
- maybe we can even adjust_match_data in every call to replace_range
  rather than just in the one from Freplace_match.
Thanks,


Stefan


> From a8098080dff5f83f7cbcbec2bc263f9db3b45ad9 Mon Sep 17 00:00:00 2001
> From: Noam Postavsky 
> Date: Wed, 20 Jul 2016 20:15:14 -0400
> Subject: [PATCH v1] Adjust match data before calling after-change-funs

> * src/insdel.c (replace_range): Add new parameter ADJUST_MATCH_DATA, if
> true.  Update all callers except Freplace_match to pass 0 for the new
> parameter.
> * src/search.c (update_search_regs): New function, extracted from
> Freplace_match.
> (Freplace_match): Remove match data adjustment code, pass 1 for
> ADJUST_MATCH_DATA to replace_range instead.
> ---
>  src/cmds.c|  2 +-
>  src/editfns.c |  6 +++---
>  src/insdel.c  | 10 --
>  src/lisp.h|  4 +++-
>  src/search.c  | 50 +-
>  5 files changed, 44 insertions(+), 28 deletions(-)

> diff --git a/src/cmds.c b/src/cmds.c
> index 1e44ddd..4003d8b 100644
> --- a/src/cmds.c
> +++ b/src/cmds.c
> @@ -447,7 +447,7 @@ internal_self_insert (int c, EMACS_INT n)
> string = concat2 (string, tem);
>   }
 
> -  replace_range (PT, PT + chars_to_delete, string, 1, 1, 1);
> +  replace_range (PT, PT + chars_to_delete, string, 1, 1, 1, 0);
>Fforward_char (make_number (n));
>  }
>else if (n > 1)
> diff --git a/src/editfns.c b/src/editfns.c
> index 412745d..32c8bec 100644
> --- a/src/editfns.c
> +++ b/src/editfns.c
> @@ -3192,7 +3192,7 @@ DEFUN ("subst-char-in-region", Fsubst_char_in_region,
> /* replace_range is less efficient, because it moves the gap,
>but it handles combining correctly.  */
> replace_range (pos, pos + 1, string,
> -  0, 0, 1);
> +  0, 0, 1, 0);
> pos_byte_next = CHAR_TO_BYTE (pos);
> if (pos_byte_next > pos_byte)
>   /* Before combining happened.  We should not increment
> @@ -3405,7 +3405,7 @@ DEFUN ("translate-region-internal", 
> Ftranslate_region_internal,
> /* This is less efficient, because it moves the gap,
>but it should handle multibyte characters correctly.  */
> string = make_multibyte_string ((char *) str, 1, str_len);
> -   replace_range (pos, pos + 1, string, 1, 0, 1);
> +   replace_range (pos, pos + 1, string, 1, 0, 1, 0);
> len = str_len;
>   }
> else
> @@ -3446,7 +3446,7 @@ DEFUN ("translate-region-internal", 
> Ftranslate_region_internal,
>   {
> string = Fmake_string (make_number (1), val);
>   }
> -   replace_range (pos, pos + len, string, 1, 0, 1);
> +   replace_range (pos, pos + len, string, 1, 0, 1, 0);
> pos_byte += SBYTES (string);
> pos += SCHARS (string);
> cnt += SCHARS (string);
> diff --git a/src/insdel.c b/src/insdel.c
> index 4ad1074..fc3f19f 100644
> --- a/src/insdel.c
> +++ b/src/insdel.c
> @@ -1268,7 +1268,9 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t 
> from_byte,
>  /* Replace the text from character positions FROM to TO with NEW,
> If PREPARE, call prepare_to_modify_buffer.
> If INHERIT, the newly inserted text should inherit text properties
> -   from the surrounding non-deleted text.  */
> +   from the surrounding non-deleted text.
> +   If ADJUST_MATCH_DATA, then adjust the match data before calling
> +   signal_after_change.  */
 
>  /* Note that this does not yet handle markers quite right.
> Also it needs to record a single undo-entry that does a replacement
> @@ -1279,7 +1281,8 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t 
> from_byte,
 
>  void
>  replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new,
> -bool prepare, bool inherit, bool markers)
> +   bool prepare, bool inherit, bool markers,
> +   bool adjust_match_data)
>  {
>ptrdiff_t inschars = SCHARS (new);
>ptrdiff_t insbytes = SBYTES (new);
> @@ -1426,6 +1429,9 @@ replace_range (ptrdiff_t from, ptrdiff_t to, 
> Lisp_Object new,
>MODIFF++;
>CHARS_MODIFF = MODIFF;
 
> +  if (adjust_match_data)
> +update_search_regs (from, to, from + SCHARS (new));
> +
>signal_after_change (from, nchars_del, GPT - from);
>

[O] wishful thinking: using SQL to process tables. in the meantime, use R

2016-07-20 Thread dmg
Hi everybody,

I was wondering if there was a way to join two tables given
a common column. I searched but found nothing.

it would be awesome to be able to process tables in SQLITE.
something like this:

#+BEGIN_SRC sqlite :var a=table1 b=table2  :colnames yes
  select * from $a join $b using column;
#+END_SRC

I think it is not that hard. The infrastructure is there already.
It is just a matter of creating temp tables (this is the major part missing
which implies making a create statement from the table, but given
that sqlite is very type agnostic, it might not be hard),
load them from the CSV files
the execute the block. A db parameter might be needed
for a scratch database file, but it could be a temporary one if
none is provided.

But in the meantime, it occurred to me, it is simple in R to do the join
and might be useful to others:

#+BEGIN_SRC R :var a=table1 b=table2 :results value :colnames yes
merge(a,b,by.x="column")
#+END_SRC

merge can do left joins, right joins, full joins, joins,

https://stat.ethz.ch/R-manual/R-devel/library/base/html/merge.html

but there is nothing like the power of SQL to process tables, though.

-- 
--dmg

---
Daniel M. German
http://turingmachine.org


[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-20 Thread Stefan Monnier
> Maybe there's a misunderstanding.  What Noam suggested was just to
> move the code which adjusts search_regs.start[i] and .end[i] to before
> the call to replace_range.

Oh, right, that's also an option.  It might suffer from another problem,
which is that the match-data will be broken while the
before-change-functions are run, so if there's a save-match-data there
we're back to square one.

Admittedly, before-change-functions is used less often, so it might be
good enough.


Stefan





[O] Bug: org-add-note closes log book drawer

2016-07-20 Thread N. Jackson
When org-log-into-drawer is t and the log book drawer is open, using
org-add-note closes the log book drawer.

I think it would be better if org-add-note left the state (open or
closed) of the log book drawer alone.

In comparison org-clock-in and org-clock-out do leave the state of the
log book drawer alone, which is much more satisfactory.

This is with org-20160718 from GNU Elpa (which is Org Mode version
8.3.4) on GNU Emacs 25.0.95 (from the pre-release tarball).




Re: [O] [BUG] External unicode links without a description in ox-html

2016-07-20 Thread Nicolas Goaziou
Hello,

Arun Isaac  writes:

> For external links without a description, `org-html-link' resuses the
> `path' as the inner text of the exported  element. However, the
> `path' variable contains the URL encoded version of the `raw-path'. It
> would be more appropriate to put the actual unescaped unicode URL in the
> inner text of the  element.

Done. Thanks.

Regards,

-- 
Nicolas Goaziou



Re: [O] Support for 24.3? WAS: Re: Funcition definiion is void: with-eval-after-load

2016-07-20 Thread Nicolas Goaziou
Hello,

"Charles C. Berry"  writes:

> I thought org-mode was committed to supporting 24.3.
>
> Did this recently change?

No, I didn't change. I'll change `with-eval-after-load' into
`eval-after-load' ASAP.

Regards,

-- 
Nicolas Goaziou



[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-20 Thread Eli Zaretskii
> From: Stefan Monnier 
> Cc: rpl...@gmail.com,  23...@debbugs.gnu.org,  alex.ben...@linaro.org,  
> jwieg...@gmail.com,  nljlistb...@gmail.com,  npost...@users.sourceforge.net
> Date: Wed, 20 Jul 2016 14:19:59 -0400
> 
> > Is it OK to adjust the match data before actually making the
> > replacement?  If so, I think it's a simpler solution.
> >> PS: I can think of one (theoretical) other/better way to fix this
> >> problem: move the match-data adjustment so it's done within
> >> replace_range before running the after-change-functions.
> > Isn't that almost the same as what Noam suggested?
> 
> Yes, it's the same.  And yes, I like the idea, but I just don't know
> what it would look like as a patch.  I have the impression that it could
> prove either expensive in CPU time and backward incompatible
> (e.g. adjust markers for every buffer modification), or require
> extensive code surgery and/or breaking some abstractions.
> 
> This is just an impression, tho.  I think it'd definitely be the better
> solution, so it's worth investigating anyway, if only for "master" rather
> than for "emacs-25".

Maybe there's a misunderstanding.  What Noam suggested was just to
move the code which adjusts search_regs.start[i] and .end[i] to before
the call to replace_range.  The above values are not markers, and no
other markers are involved, so I'm not sure which markers did you
allude to.  Or why it would be CPU intensive.

What did I miss?





[O] Support for 24.3? WAS: Re: Funcition definiion is void: with-eval-after-load

2016-07-20 Thread Charles C. Berry

On Wed, 20 Jul 2016, Kaushal Modi wrote:


Hi Claude,

`with-eval-after-load` macro was introduced in emacs 24.4. Please make sure
that you are running that or a newer emacs version.


I thought org-mode was committed to supporting 24.3.

Did this recently change?

(I am just asking --- not complaining. 24.4 has nadavice.el which I might 
use in ox-ravel if 24.4 is required for org-mode.)


Chuck



Re: [O] convert rmarkdown (rmd) files to orgmode?

2016-07-20 Thread Xebar Saram
ahh i see what you mean.

thats a cool tip yet i find i have to find/replace also for images,
find/replace to change example blocks to R code blocks etc which is quite
tedious since i have about 50 of these converted Rmd to org files :)
ill keep investigating this and report back

thx so much for the tips! :)

Z

On Wed, Jul 20, 2016 at 8:42 PM, Charles C. Berry  wrote:

> On Wed, 20 Jul 2016, Xebar Saram wrote:
>
> thx for the tips!
>>
>> when i try to run the source block :
>>
>> #+BEGIN_SRC emacs-lisp :results silent
>>  (replace-regexp "^=[{]r \\([^}]*\\)[}]\\(.*\\)=$"
>>  "#+name: \\1
>>  ,#+begin_src R
>>  \\2
>>  ,#+end_src")
>>
>> #+END_SRC
>>
>> i just get a nil in the message area. what am i missing?
>>
>>
>
> Nothing!
>
> The `:results silent' should suppress any output.
>
> Anyway, what you should see is that the code chunks that pandoc placed
> inside equal signs like
>
> : ={r my-name} code =
>
> are now in src blocks.
>
> I think you need to put the src block at the top or add a
>
> : (goto-char (point-min))
>
> as its first line to be sure it converts all the code chunks.
>
>
> Chuck
>


[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-20 Thread Stefan Monnier
> Is it OK to adjust the match data before actually making the
> replacement?  If so, I think it's a simpler solution.
>> PS: I can think of one (theoretical) other/better way to fix this
>> problem: move the match-data adjustment so it's done within
>> replace_range before running the after-change-functions.
> Isn't that almost the same as what Noam suggested?

Yes, it's the same.  And yes, I like the idea, but I just don't know
what it would look like as a patch.  I have the impression that it could
prove either expensive in CPU time and backward incompatible
(e.g. adjust markers for every buffer modification), or require
extensive code surgery and/or breaking some abstractions.

This is just an impression, tho.  I think it'd definitely be the better
solution, so it's worth investigating anyway, if only for "master" rather
than for "emacs-25".


Stefan





Re: [O] convert rmarkdown (rmd) files to orgmode?

2016-07-20 Thread Charles C. Berry

On Wed, 20 Jul 2016, Xebar Saram wrote:


thx for the tips!

when i try to run the source block :

#+BEGIN_SRC emacs-lisp :results silent
 (replace-regexp "^=[{]r \\([^}]*\\)[}]\\(.*\\)=$"
 "#+name: \\1
 ,#+begin_src R
 \\2
 ,#+end_src")

#+END_SRC

i just get a nil in the message area. what am i missing?




Nothing!

The `:results silent' should suppress any output.

Anyway, what you should see is that the code chunks that pandoc placed 
inside equal signs like


: ={r my-name} code =

are now in src blocks.

I think you need to put the src block at the top or add a

: (goto-char (point-min))

as its first line to be sure it converts all the code chunks.


Chuck



Re: [O] convert rmarkdown (rmd) files to orgmode?

2016-07-20 Thread Xebar Saram
thx for the tips!

when i try to run the source block :

#+BEGIN_SRC emacs-lisp :results silent
  (replace-regexp "^=[{]r \\([^}]*\\)[}]\\(.*\\)=$"
  "#+name: \\1
  ,#+begin_src R
  \\2
  ,#+end_src")

#+END_SRC

i just get a nil in the message area. what am i missing?

thx

Z

On Wed, Jul 20, 2016 at 8:20 PM, Charles C. Berry  wrote:

> On Wed, 20 Jul 2016, Xebar Saram wrote:
>
> thx phil
>>
>> the Rmd format is actually quite different than md so that conversion
>> didnt
>> go well
>>
>>
> I tried this
>
> pandoc -f markdown -t org input-file.Rmd -o output-file.org
>
> then I opened `output-file.org' and put this src block at the very top:
>
> #+BEGIN_SRC emacs-lisp :results silent
>   (replace-regexp "^=[{]r \\([^}]*\\)[}]\\(.*\\)=$"
>   "#+name: \\1
>   ,#+begin_src R
>   \\2
>   ,#+end_src")
>
> #+END_SRC
>
> When I execute that code block, all the converted code chunks become src
> blocks.
>
> This isn't perfect as chunk options are appended to the `#+NAME:...' line,
> but if you want to play with the regexp's you can probably get it to pick
> those out and put them on a separate line. Or just write another src block
> with another `replace-regexp' to fix those lines.
>
> With a little effort you can write a command file for `sed' to do what the
> code block above does and then pipe the pandoc output to that command like
> this:
>
> : pandoc -f markdown -t org input-file.Rmd | \
> : sed -f convert-chunks > output-file.org
>
> and you have an org document ready (or almost ready) to go.
>
>
> HTH,
>
> Chuck
>
>


Re: [O] convert rmarkdown (rmd) files to orgmode?

2016-07-20 Thread Charles C. Berry

On Wed, 20 Jul 2016, Xebar Saram wrote:


thx phil

the Rmd format is actually quite different than md so that conversion didnt
go well



I tried this

pandoc -f markdown -t org input-file.Rmd -o output-file.org

then I opened `output-file.org' and put this src block at the very top:

#+BEGIN_SRC emacs-lisp :results silent
  (replace-regexp "^=[{]r \\([^}]*\\)[}]\\(.*\\)=$"
  "#+name: \\1
  ,#+begin_src R
  \\2
  ,#+end_src")

#+END_SRC

When I execute that code block, all the converted code chunks become src 
blocks.


This isn't perfect as chunk options are appended to the `#+NAME:...' line, 
but if you want to play with the regexp's you can probably get it to pick 
those out and put them on a separate line. Or just write another src block 
with another `replace-regexp' to fix those lines.


With a little effort you can write a command file for `sed' to do what the 
code block above does and then pipe the pandoc output to that command like 
this:


: pandoc -f markdown -t org input-file.Rmd | \
: sed -f convert-chunks > output-file.org

and you have an org document ready (or almost ready) to go.


HTH,

Chuck




Re: [O] how to update and add info to babel documentation?

2016-07-20 Thread Thomas S. Dye
Aloha Daniel,

Please feel free to push your changes directly to Worg.

Thanks again for your help.

All the best,
Tom

dmg writes:

> Thanks Tom,
>
> Here is my patch.
>
>
> On Tue, Jul 19, 2016 at 10:05 AM, Thomas S. Dye  wrote:
>
> Aloha dmg,
>
> You can find instructions here:
>
> http://orgmode.org/worg/worg-git.html
>
> Thanks for your help.
>
> All the best,
> Tom
>
> dmg writes:
>
> > hi there,
> >
> > I was trying to find the sources for the babel language documentation.
> > Specifically:
> >
> >
> > http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-sqlite.html
> >
> > Could anybody please tell me which is the best way to submit a patch to
> it?
> >
> > Specifically, I would like to document the use of variables in the mode.
> I had
> > to read its source code to know that you can to prefix the variable name
> with
> > $ for it to work, eg:
> >
> >
> > #+BEGIN_SRC sqlite :db /tmp/rip.db :var x="table"
> > select * from $x;
> > #+END_SRC
> >
> >
> > ​thank you,​
>
>
> --
> Thomas S. Dye
> http://www.tsdye.com


-- 
Thomas S. Dye
http://www.tsdye.com



[O] bug#23917: bug#23917: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-20 Thread Eli Zaretskii
> From: Alex Bennée 
> Cc: 23...@debbugs.gnu.org, rpl...@gmail.com, jwieg...@gmail.com, 
> monn...@iro.umontreal.ca, nljlistb...@gmail.com
> Date: Wed, 20 Jul 2016 10:48:45 +0100
> 
> So is the match data already out of sync by the time the
> save-match-data call is made?

Yes.





[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-20 Thread Eli Zaretskii
> From: Stefan Monnier 
> Cc: rpl...@gmail.com,  23...@debbugs.gnu.org,  alex.ben...@linaro.org,  
> jwieg...@gmail.com,  nljlistb...@gmail.com
> Date: Tue, 19 Jul 2016 21:50:07 -0400
> 
> > Do we care that using save-match-data in every call to replace-match
> > might mean a performance hit?
> 
> I do but:
> - to be honest, it's probably lost in the noise.
> - if we copy search_regs.start and search_regs.end with something like
>   alloca+memcpy (instead of calling Fmatch_data), the cost should be even more
>   lost in the noise.  Especially if you consider that the current code
>   already loops through the match-data to adjust it.
> - it's the best fix we've found so far.

What about Noam's suggestion:

> Is it not possible to adjust the match data *before* calling buffer
> modification hooks?  Seems to me the root of the problem is that buffer
> modification hooks get to see this invalid intermediate state where the
> match data is out of sync with the buffer.

Is it OK to adjust the match data before actually making the
replacement?  If so, I think it's a simpler solution.

> PS: I can think of one (theoretical) other/better way to fix this
> problem: move the match-data adjustment so it's done within
> replace_range before running the after-change-functions.

Isn't that almost the same as what Noam suggested?





[O] [BUG] External unicode links without a description in ox-html

2016-07-20 Thread Arun Isaac

For external links without a description, `org-html-link' resuses the
`path' as the inner text of the exported  element. However, the
`path' variable contains the URL encoded version of the `raw-path'. It
would be more appropriate to put the actual unescaped unicode URL in the
inner text of the  element.

Regards,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] Funcition definiion is void: with-eval-after-load

2016-07-20 Thread Kaushal Modi
On Wed, Jul 20, 2016 at 6:48 AM claude fuhrer  wrote:

> Thank you for your advice. My emacs version is 24.3.1 (the standard
> version packaged with Linux Mint 17.2).
>
The latest stable version right now is 24.5. See if you can install it
directly from the release tarball.

I will try if I can install emacs25.
>

The next release vesion after 24.5 is going to be 25.1. While it is not yet
released, I have been using the versions built from the git emacs-25 branch
and they are very stable from my experience.

Feel free to try the latest pretest as of today:
http://alpha.gnu.org/gnu/emacs/pretest/emacs-25.0.95.tar.xz if building
emacs locally from git is not an option.
-- 

Kaushal Modi


Re: [O] convert rmarkdown (rmd) files to orgmode?

2016-07-20 Thread Xebar Saram
thx phil

the Rmd format is actually quite different than md so that conversion didnt
go well

i ended up doing a 2 step conversion:

in R (via the GUI or through R -e command line), first convert the Rmd
files to md files:

require(knitr) # required for knitting from rmd to md
require(markdown) # required for md to html
knit('test.rmd', 'test.md') # creates md file

then use pandoc to convert the md files to org:

pandoc -o test.org  test.md

this gives an almost 1:1 org file


thx

Z

On Wed, Jul 20, 2016 at 1:08 PM, Philip Hudson 
wrote:

> pandoc -f markdown -t org myfile.rmd
>
> On 20 July 2016 at 05:28, Xebar Saram  wrote:
> > Hi all
> >
> > anyone know of a way to convert rmarkdown (rmd) files to orgmode?
> >
> > im preparing a R course and lots of cool examples in R are in rmd format
> so
> > it could be very useful to me
> >
> > best
> >
> > Z
>
>
>
> --
> Phil Hudson   http://hudson-it.ddns.net
> @UWascalWabbit PGP/GnuPG ID: 0x887DCA63
>


Re: [O] Funcition definiion is void: with-eval-after-load

2016-07-20 Thread claude fuhrer

Hi Kaushal


On 20/07/16 12:30, Kaushal Modi wrote:

Hi Claude,

`with-eval-after-load` macro was introduced in emacs 24.4. Please make 
sure that you are running that or a newer emacs version.


Thank you for your advice. My emacs version is 24.3.1 (the standard 
version packaged with Linux Mint 17.2).


I will try if I can install emacs25.

Thanks again

claude



On Wed, Jul 20, 2016, 5:29 AM claude fuhrer > wrote:


Symbol's function definition is void: with-eval-after-load

--

Kaushal Modi





Re: [O] Funcition definiion is void: with-eval-after-load

2016-07-20 Thread Kaushal Modi
Hi Claude,

`with-eval-after-load` macro was introduced in emacs 24.4. Please make sure
that you are running that or a newer emacs version.

On Wed, Jul 20, 2016, 5:29 AM claude fuhrer  wrote:

> Symbol's function definition is void: with-eval-after-load
>
-- 

Kaushal Modi


[O] bug#23917: bug#23917: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-20 Thread Alex Bennée

Eli Zaretskii  writes:

>> From: Alex Bennée 
>> Cc: monn...@iro.umontreal.ca, 23...@debbugs.gnu.org, rpl...@gmail.com, 
>> jwieg...@gmail.com, nljlistb...@gmail.com, m...@lunaryorn.com
>> Date: Tue, 19 Jul 2016 18:45:44 +0100
>>
>>   ;; Save and restore the match data, as recommended in (elisp)Change Hooks
>>   (save-match-data
>> (when flycheck-mode
>>   ;; The buffer was changed, thus clear the idle timer
>>   (flycheck-clear-idle-change-timer)
>>   (if (string-match-p (rx "\n") (buffer-substring beg end))
>>   (flycheck-buffer-automatically 'new-line 'force-deferred)
>> (setq flycheck-idle-change-timer
>>   (run-at-time flycheck-idle-change-delay nil
>>#'flycheck-handle-idle-change))
>>
>> However it doesn't look as though it tweaks the buffer until idle timer
>> has run. Weird
>
> Tweaking the buffer is not what causes the problem.  It's the call to
> save-match-data itself.  It doesn't matter at all what the code inside
> save-match-data does.

Ahh I misunderstood the description of the problem. I thought it was a
changing of the buffer underneath that meant the match data wasn't
updated and hence got out of sync. So is the match data already out of
sync by the time the save-match-data call is made?

--
Alex Bennée





[O] Funcition definiion is void: with-eval-after-load

2016-07-20 Thread claude fuhrer

Hi all


I've just updated my org-mode config (git pull) and now the "make all" 
process returns an error.


org-version: 8.3.5 (release_8.3.5-970-g41c0f5)
Loading /home/azubi/bin/local-lisp/org-mode/lisp/org-compat.el (source)...
Symbol's function definition is void: with-eval-after-load
make[1]: *** [org-version.el] Error 255
make[1]: Leaving directory `/home/azubi/bin/local-lisp/org-mode/lisp'
make: *** [all] Error 2


Starting my emacs with --debug-init gives:


Debugger entered--Lisp error: (void-function with-eval-after-load)
  (with-eval-after-load (quote org) (org-link-set-parameters 
"file+emacs") (org-link-set-parameters "file+sys"))
  eval-buffer(# nil 
"/home/azubi/bin/local-lisp/org-mode/lisp/org-compat.el" nil t)  ; 
Reading at buffer position 11282
load-with-code-conversion("/home/azubi/bin/local-lisp/org-mode/lisp/org-compat.el" 
"/home/azubi/bin/local-lisp/org-mode/lisp/org-compat.el" nil t)

  require(org-compat)
  eval-buffer(# nil 
"/home/azubi/bin/local-lisp/org-mode/lisp/ob.el" nil t)  ; Reading at 
buffer position 978
load-with-code-conversion("/home/azubi/bin/local-lisp/org-mode/lisp/ob.el" 
"/home/azubi/bin/local-lisp/org-mode/lisp/ob.el" nil t)

  require(ob)
  eval-buffer(# nil 
"/home/azubi/bin/local-lisp/org-config.el" nil t)  ; Reading at buffer 
position 1497
load-with-code-conversion("/home/azubi/bin/local-lisp/org-config.el" 
"/home/azubi/bin/local-lisp/org-config.el" nil nil)

  load("/home/azubi/bin/local-lisp/org-config.el" nil nil t)
  load-file("/home/azubi/bin/local-lisp/org-config.el")
  eval-buffer(# nil "/home/azubi/.emacs" nil t)  ; 
Reading at buffer position 7422

  load-with-code-conversion("/home/azubi/.emacs" "/home/azubi/.emacs" t t)
  load("~/.emacs" t t)
  #[0 "\205\262


Can you please help me to identify more precisely what is wrong in my 
config ?



Thank you for your help


claude





Re: [O] MobileOrg: index.org links files to the wrong folder

2016-07-20 Thread Nicolas Goaziou
Hello,

Martin Leduc  writes:

> The generated index.org file in MobileOrg/ looks like:
>
> #+READONLY
> #+TODO: TODO
> #+TODO: NEXT WAITING SOMEDAY |
> #+TAGS: @HOME WORK EMAIL CALL READ ERRAND AGENDAS
> #+ALLPRIORITIES: A B C
> * [[file:agendas.org][Agenda Views]]
> * [[file:~/org-mode-files/test.org][test.org]]
>
> The test.org file cannot be read from my iPhone since only the 
> org-mobile-directory is accessible to it.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] [ox-publish, patch] More flexible sitemaps

2016-07-20 Thread Nicolas Goaziou
Hello,

Rasmus  writes:

> Sorry about the slow reply.  Sometimes there's not enough time.

So true.

> I obviously agree with your criticism.  It’s not obvious how to do this
> properly.
>
> If we provide a backend we’d have to move the index preparation to
> beginning of each export process as :publishing-function can be a list.
> Also, I’m not sure how we’d know about the backend.  Before the exporting
> starts, we at most know the names of the functions right?  If one of the
> publishing functions is anonymous we don’t even have that.
>
> Perhaps the best way is to move keywords back to ox, though I’d rather opt
> for something else.

You're right, "ox-publish" is mostly back-end agnostic so the
information is not readily available.

However, we're creating an Org file here. We don't need to have parsed
values for keywords. So, what about simply looking for, e.g., #+SUBTITLE
value in the document and use it instead as a template replacement? IOW,
what about eschewing so-called "environment" altogether?

>>> +;; Call function to build sitemap based on files and the project-plist.
>>> +(let* ((style (or (plist-get project-plist :sitemap-style) 'tree))
>>> +   (fun (intern (format "org-publish-org-sitemap-as-%s" style
>>
>> Side note : I think this is a bit too smart. It prevents, e.g., from
>> grepping for a function name. Maybe 
>>
>>   (if (eq style 'something) #'... #')
>>
>> would be better.
>
> The point is that it should be easy to supply your own functions.  All
> sorts of requirements for the index/sitemap could come up, and it is
> important to not limit to the tree-style and the flat-style.

But that's outside the scope of the patch currently considered. My point
is that we should avoid forging function names as a UI.

> I might want to provide an index ordered by keywords, say.
>
> Perhaps styles should be stores in an alist with elements like
>
> (STYLE STYLE-FUNCTION) ?

Some functions may handle multiple styles, as `org-publish-org-sitemap'
does. Besides, any user-provided sitemap function is likely to handle
its own style without relying on :sitemap-style property.

Therefore, providing :sitemap-function and :sitemap-style is enough,
there's no need to merge them together.

WDYT?


Regards,

-- 
Nicolas Goaziou