[PATCH] doc/prerst2man.py: swap execfile with an exec call

2014-08-09 Thread Tomi Ollila
On Sat, Aug 09 2014, Gaute Hope  wrote:

> at some point in python 3.* execfile was removed. per
> http://stackoverflow.com/questions/6357361/alternative-to-execfile-in-python-3-2
> the execefile has been replaced in the same manner as python 2to3 helper
> script would do.
>
> tested on python 3.4.1 and 2.7.8.
> ---

Thanks for the patch -- I have use the idea elsewhere with ipython :D

Trevor has a patch series which takes care e.g. of this:

id:"8cc9dd580ad672527e12f43706f9803b2c8e99d8.1405220724.git.wking at tremily.us"

http://article.gmane.org/gmane.mail.notmuch.general/18661


Tomi


>  doc/prerst2man.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/doc/prerst2man.py b/doc/prerst2man.py
> index 437dea9..3f85c0c 100644
> --- a/doc/prerst2man.py
> +++ b/doc/prerst2man.py
> @@ -10,7 +10,8 @@ outdir = argv[2]
>  if not isdir(outdir):
>  makedirs(outdir, 0o755)
>  
> -execfile(sourcedir + "/conf.py")
> +filename = sourcedir + "/conf.py"
> +exec(compile(open(filename, "rb").read(), filename, 'exec'))
>  
>  
>  def header(file, startdocname, command, description, authors, section):
> -- 
> 2.0.3
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] doc/prerst2man.py: swap execfile with an exec call

2014-08-09 Thread Gaute Hope
Aight! Whatever works. This bit me today at least, building notmuch
git on Arch Linux fails without it.

Cheers, Gaute

On Sat, Aug 9, 2014 at 3:56 PM, Tomi Ollila  wrote:
> On Sat, Aug 09 2014, Gaute Hope  wrote:
>
>> at some point in python 3.* execfile was removed. per
>> http://stackoverflow.com/questions/6357361/alternative-to-execfile-in-python-3-2
>> the execefile has been replaced in the same manner as python 2to3 helper
>> script would do.
>>
>> tested on python 3.4.1 and 2.7.8.
>> ---
>
> Thanks for the patch -- I have use the idea elsewhere with ipython :D
>
> Trevor has a patch series which takes care e.g. of this:
>
> id:"8cc9dd580ad672527e12f43706f9803b2c8e99d8.1405220724.git.wking at 
> tremily.us"
>
> http://article.gmane.org/gmane.mail.notmuch.general/18661
>
>
> Tomi
>
>
>>  doc/prerst2man.py | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/doc/prerst2man.py b/doc/prerst2man.py
>> index 437dea9..3f85c0c 100644
>> --- a/doc/prerst2man.py
>> +++ b/doc/prerst2man.py
>> @@ -10,7 +10,8 @@ outdir = argv[2]
>>  if not isdir(outdir):
>>  makedirs(outdir, 0o755)
>>
>> -execfile(sourcedir + "/conf.py")
>> +filename = sourcedir + "/conf.py"
>> +exec(compile(open(filename, "rb").read(), filename, 'exec'))
>>
>>
>>  def header(file, startdocname, command, description, authors, section):
>> --
>> 2.0.3
>>
>> ___
>> notmuch mailing list
>> notmuch at notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] doc/prerst2man.py: swap execfile with an exec call

2014-08-09 Thread Gaute Hope
at some point in python 3.* execfile was removed. per
http://stackoverflow.com/questions/6357361/alternative-to-execfile-in-python-3-2
the execefile has been replaced in the same manner as python 2to3 helper
script would do.

tested on python 3.4.1 and 2.7.8.
---
 doc/prerst2man.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/prerst2man.py b/doc/prerst2man.py
index 437dea9..3f85c0c 100644
--- a/doc/prerst2man.py
+++ b/doc/prerst2man.py
@@ -10,7 +10,8 @@ outdir = argv[2]
 if not isdir(outdir):
 makedirs(outdir, 0o755)

-execfile(sourcedir + "/conf.py")
+filename = sourcedir + "/conf.py"
+exec(compile(open(filename, "rb").read(), filename, 'exec'))


 def header(file, startdocname, command, description, authors, section):
-- 
2.0.3



[PATCH v2] emacs: Improved compatibility for window-body-width in Emacs < 24

2014-08-09 Thread Tomi Ollila
On Fri, Aug 08 2014, Austin Clements  wrote:

> Fix byte compiler warning "Warning: the function `window-body-width'
> is not known to be defined." by moving our compatibility wrapper
> before its use and simplify the definition to a defalias for the old
> name of the function.
> ---
>
> Tomi pointed out that window-body-width simply used to be called
> window-width, so this simplifies the wrapper to a defalias.

LGTM. Tested w/ (notmuch-jump nil "foo") in emacs 23.1.1 -- call failed
but after calling (window-body-width).

Tomi


>
>  emacs/notmuch-jump.el | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
> index 05bbce5..5eb0949 100644
> --- a/emacs/notmuch-jump.el
> +++ b/emacs/notmuch-jump.el
> @@ -25,6 +25,10 @@
>  (require 'notmuch-lib)
>  (require 'notmuch-hello)
>  
> +(unless (fboundp 'window-body-width)
> +  ;; Compatibility for Emacs pre-24
> +  (defalias 'window-body-width 'window-width))
> +
>  ;;;###autoload
>  (defun notmuch-jump-search ()
>"Jump to a saved search by shortcut key.
> @@ -165,9 +169,3 @@ (defun notmuch-jump--make-keymap (action-map)
>  (setq notmuch-jump--action ',(third action))
>  (exit-minibuffer
>  map))
> -
> -(unless (fboundp 'window-body-width)
> -  ;; Compatibility for Emacs pre-24
> -  (defun window-body-width ( window)
> -(let ((edges (window-inside-edges window)))
> -  (- (caddr edges) (car edges)
> -- 
> 2.0.0
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v2] emacs: Improved compatibility for window-body-width in Emacs 24

2014-08-09 Thread Tomi Ollila
On Fri, Aug 08 2014, Austin Clements amdra...@mit.edu wrote:

 Fix byte compiler warning Warning: the function `window-body-width'
 is not known to be defined. by moving our compatibility wrapper
 before its use and simplify the definition to a defalias for the old
 name of the function.
 ---

 Tomi pointed out that window-body-width simply used to be called
 window-width, so this simplifies the wrapper to a defalias.

LGTM. Tested w/ (notmuch-jump nil foo) in emacs 23.1.1 -- call failed
but after calling (window-body-width).

Tomi



  emacs/notmuch-jump.el | 10 --
  1 file changed, 4 insertions(+), 6 deletions(-)

 diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
 index 05bbce5..5eb0949 100644
 --- a/emacs/notmuch-jump.el
 +++ b/emacs/notmuch-jump.el
 @@ -25,6 +25,10 @@
  (require 'notmuch-lib)
  (require 'notmuch-hello)
  
 +(unless (fboundp 'window-body-width)
 +  ;; Compatibility for Emacs pre-24
 +  (defalias 'window-body-width 'window-width))
 +
  ;;;###autoload
  (defun notmuch-jump-search ()
Jump to a saved search by shortcut key.
 @@ -165,9 +169,3 @@ (defun notmuch-jump--make-keymap (action-map)
  (setq notmuch-jump--action ',(third action))
  (exit-minibuffer
  map))
 -
 -(unless (fboundp 'window-body-width)
 -  ;; Compatibility for Emacs pre-24
 -  (defun window-body-width (optional window)
 -(let ((edges (window-inside-edges window)))
 -  (- (caddr edges) (car edges)
 -- 
 2.0.0

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] doc/prerst2man.py: swap execfile with an exec call

2014-08-09 Thread Gaute Hope
at some point in python 3.* execfile was removed. per
http://stackoverflow.com/questions/6357361/alternative-to-execfile-in-python-3-2
the execefile has been replaced in the same manner as python 2to3 helper
script would do.

tested on python 3.4.1 and 2.7.8.
---
 doc/prerst2man.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/prerst2man.py b/doc/prerst2man.py
index 437dea9..3f85c0c 100644
--- a/doc/prerst2man.py
+++ b/doc/prerst2man.py
@@ -10,7 +10,8 @@ outdir = argv[2]
 if not isdir(outdir):
 makedirs(outdir, 0o755)
 
-execfile(sourcedir + /conf.py)
+filename = sourcedir + /conf.py
+exec(compile(open(filename, rb).read(), filename, 'exec'))
 
 
 def header(file, startdocname, command, description, authors, section):
-- 
2.0.3

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] doc/prerst2man.py: swap execfile with an exec call

2014-08-09 Thread Tomi Ollila
On Sat, Aug 09 2014, Gaute Hope e...@gaute.vetsj.com wrote:

 at some point in python 3.* execfile was removed. per
 http://stackoverflow.com/questions/6357361/alternative-to-execfile-in-python-3-2
 the execefile has been replaced in the same manner as python 2to3 helper
 script would do.

 tested on python 3.4.1 and 2.7.8.
 ---

Thanks for the patch -- I have use the idea elsewhere with ipython :D

Trevor has a patch series which takes care e.g. of this:

id:8cc9dd580ad672527e12f43706f9803b2c8e99d8.1405220724.git.wk...@tremily.us

http://article.gmane.org/gmane.mail.notmuch.general/18661


Tomi


  doc/prerst2man.py | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

 diff --git a/doc/prerst2man.py b/doc/prerst2man.py
 index 437dea9..3f85c0c 100644
 --- a/doc/prerst2man.py
 +++ b/doc/prerst2man.py
 @@ -10,7 +10,8 @@ outdir = argv[2]
  if not isdir(outdir):
  makedirs(outdir, 0o755)
  
 -execfile(sourcedir + /conf.py)
 +filename = sourcedir + /conf.py
 +exec(compile(open(filename, rb).read(), filename, 'exec'))
  
  
  def header(file, startdocname, command, description, authors, section):
 -- 
 2.0.3

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] doc/prerst2man.py: swap execfile with an exec call

2014-08-09 Thread Gaute Hope
Aight! Whatever works. This bit me today at least, building notmuch
git on Arch Linux fails without it.

Cheers, Gaute

On Sat, Aug 9, 2014 at 3:56 PM, Tomi Ollila tomi.oll...@iki.fi wrote:
 On Sat, Aug 09 2014, Gaute Hope e...@gaute.vetsj.com wrote:

 at some point in python 3.* execfile was removed. per
 http://stackoverflow.com/questions/6357361/alternative-to-execfile-in-python-3-2
 the execefile has been replaced in the same manner as python 2to3 helper
 script would do.

 tested on python 3.4.1 and 2.7.8.
 ---

 Thanks for the patch -- I have use the idea elsewhere with ipython :D

 Trevor has a patch series which takes care e.g. of this:

 id:8cc9dd580ad672527e12f43706f9803b2c8e99d8.1405220724.git.wk...@tremily.us

 http://article.gmane.org/gmane.mail.notmuch.general/18661


 Tomi


  doc/prerst2man.py | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

 diff --git a/doc/prerst2man.py b/doc/prerst2man.py
 index 437dea9..3f85c0c 100644
 --- a/doc/prerst2man.py
 +++ b/doc/prerst2man.py
 @@ -10,7 +10,8 @@ outdir = argv[2]
  if not isdir(outdir):
  makedirs(outdir, 0o755)

 -execfile(sourcedir + /conf.py)
 +filename = sourcedir + /conf.py
 +exec(compile(open(filename, rb).read(), filename, 'exec'))


  def header(file, startdocname, command, description, authors, section):
 --
 2.0.3

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch