[NTG-context] Emacs and spell check

2024-07-24 Thread Shiv Shankar Dayal
Hi,

Does anyone use Emacs with ConTeXt with spell check? Can you please share
your Emacs config for this?

-- 
Respect,
Shiv Shankar Dayal
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


Re: [NTG-context] Emacs with context lmtx

2019-04-09 Thread Fabrice Couvreur
Hi Vladimir,
This seems to work well :


(eval-after-load "context"
  '(setq TeX-command-list
(append
  '(
("context"
"PATH=/home/viserion/context/tex/texmf-linux-64/bin:$PATH context
--purgeall %s"
  TeX-run-command nil t :help "Run context (MarkIV)")
("luametatex"
"PATH=/home/viserion/data/context/tex/texmf-linux-64/bin:$PATH context
--purgeall %s"
  TeX-run-command nil t :help "Run context (LMTX)")
  ) TeX-command-list
)
  )
)



Thank you so much.
Fabrice


Le mar. 9 avr. 2019 à 09:04, Vladimir Lomov  a écrit :

> Hello,
> ** Fabrice Couvreur [2019-04-09 00:58:46 +0200]:
>
> > Hi Vladimir,
> > I use AUCTeX and I compile with the command C-c C-c. The configuration
> you
> > proposed for my .emacs file last time works perfectly. So I tried to do
> the
> > same thing with context lmtx and if I add this
> >
> > ("ConTeXt" "PATH = /home/viserion/data/context/tex/texmf-linux-64/bin: $
> > PATH context --purgeall% s"
> >  TeX-run-command nil t: help "Run context (LMTX)") TeX-command-list)
> > I get the message
> >
> > For information about GNU Emacs and the GNU system, type C-h C-a.
> > File mode specification error: (wrong-type-argument symbolp (ConTeXt
> PATH =
> > / home / viserion / data / context / tex / texmf-linux-64 / bin: $ PATH
> > context -purgeall% s TeX-run-command nil t : help Run context (LMTX)))
>
> This message tells that something wrong with your settings (I assume the
> spaces in above strings are side effect of mail system). The 'cons'
> function that you use allows to add only one element to a list (see
> Emacs Lisp documentation). I'm not familiar very well with Emacs Lisp
> but tested a bit and think this should work:
>
>  8< 
> (eval-after-load "context"
>   '(setq TeX-command-list
> (append
>   '(
> ("ConTeXt" "PATH=...:$PATH context --purgeall %s"
>   TeX-run-command nil t :help "Run context (MarkIV)")
> ("LMTX""PATH=...:$PATH context --purgeall %s"
>   TeX-run-command t   t :help "Run context (LMTX)")
>   ) TeX-command-list
> )
>   )
> )
>  8< 
>
> I'm not absolutely sure about 'TeX-run-command' (code of AUCTeX uses
> 'TeX-run-TeX' for TeX stuff). You may test and use 'TeX-run-TeX' instead
> of 'TeX-run-command'. Also you may change the 'nil t' to 't
> (context-mode)' if you what to edit (expanded) string and only want to
> see these entries for buffers set in 'context' mode.
>
> And please check the binary name and it's location (I didn't play with
> LMTX yet).
>
> > Fabrice
>
> ---
> WBR, Vladimir Lomov
>
> --
>  Anyone here knowledgable in matters of water fowl?  If you
>  walk through a park, and a goose starts following you... and
>  ends up following you more than half a mile until you reach
>  your car... at 11pm.  Is the goose rabid or something?
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Emacs with context lmtx

2019-04-09 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2019-04-09 00:58:46 +0200]:

> Hi Vladimir,
> I use AUCTeX and I compile with the command C-c C-c. The configuration you
> proposed for my .emacs file last time works perfectly. So I tried to do the
> same thing with context lmtx and if I add this
> 
> ("ConTeXt" "PATH = /home/viserion/data/context/tex/texmf-linux-64/bin: $
> PATH context --purgeall% s"
>  TeX-run-command nil t: help "Run context (LMTX)") TeX-command-list)
> I get the message
> 
> For information about GNU Emacs and the GNU system, type C-h C-a.
> File mode specification error: (wrong-type-argument symbolp (ConTeXt PATH =
> / home / viserion / data / context / tex / texmf-linux-64 / bin: $ PATH
> context -purgeall% s TeX-run-command nil t : help Run context (LMTX)))

This message tells that something wrong with your settings (I assume the
spaces in above strings are side effect of mail system). The 'cons'
function that you use allows to add only one element to a list (see
Emacs Lisp documentation). I'm not familiar very well with Emacs Lisp
but tested a bit and think this should work:

 8< 
(eval-after-load "context"
  '(setq TeX-command-list
(append
  '(
("ConTeXt" "PATH=...:$PATH context --purgeall %s"
  TeX-run-command nil t :help "Run context (MarkIV)")
("LMTX""PATH=...:$PATH context --purgeall %s"
  TeX-run-command t   t :help "Run context (LMTX)")
  ) TeX-command-list
)
  )
)
 8< 

I'm not absolutely sure about 'TeX-run-command' (code of AUCTeX uses
'TeX-run-TeX' for TeX stuff). You may test and use 'TeX-run-TeX' instead
of 'TeX-run-command'. Also you may change the 'nil t' to 't
(context-mode)' if you what to edit (expanded) string and only want to
see these entries for buffers set in 'context' mode.

And please check the binary name and it's location (I didn't play with
LMTX yet).

> Fabrice

---
WBR, Vladimir Lomov

-- 
 Anyone here knowledgable in matters of water fowl?  If you
 walk through a park, and a goose starts following you... and
 ends up following you more than half a mile until you reach
 your car... at 11pm.  Is the goose rabid or something?


signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Emacs with context lmtx

2019-04-08 Thread Fabrice Couvreur
Hi Vladimir,
I use AUCTeX and I compile with the command C-c C-c. The configuration you
proposed for my .emacs file last time works perfectly. So I tried to do the
same thing with context lmtx and if I add this

("ConTeXt" "PATH = /home/viserion/data/context/tex/texmf-linux-64/bin: $
PATH context --purgeall% s"
 TeX-run-command nil t: help "Run context (LMTX)") TeX-command-list)
I get the message

For information about GNU Emacs and the GNU system, type C-h C-a.
File mode specification error: (wrong-type-argument symbolp (ConTeXt PATH =
/ home / viserion / data / context / tex / texmf-linux-64 / bin: $ PATH
context -purgeall% s TeX-run-command nil t : help Run context (LMTX)))

Fabrice

Le lun. 8 avr. 2019 à 14:01, Vladimir Lomov  a écrit :

> Hello,
> ** Fabrice Couvreur [2019-04-08 12:08:44 +0200]:
>
> > Hi,
> > I compile all my files with Emacs and standalone context. I would like to
> > compare context lmtx.
> > I added this in my .emacs file but it does not work.
>
> Does Emacs prints error messages? How do you run the command in Emacs?
> Do you use AUCTeX or not? What messages do you see in *Messages* buffer?
>
> >
> #
> > (eval-after-load "context"
> >   '(setq TeX-command-list
> >(cons '("ConTeXt"
> > "PATH=/home/viserion/context/tex/texmf-linux-64/bin:$PATH context
> > --purgeall %s"
> > TeX-run-command nil t :help "Run context (MarkIV)")
> > TeX-command-list)
> >("ConTeXt"
> > "PATH=/home/viserion/data/context/tex/texmf-linux-64/bin:$PATH context
> > --purgeall %s"
> > TeX-run-command t t :help "Run context (LMTX)") t)
> > )
> >
> #
> >
> >
> > For information about GNU Emacs and the GNU system, type C-h C-a.
> > File mode specification error: (wrong-type-argument symbolp (ConTeXt
> > PATH=/home/viserion/data/context/tex/texmf-linux-64/bin:$PATH context
> > --purgeall %s TeX-run-command t t :help Run context (LMTX)))
> >
> > Thank you.
> > Fabrice
>
> P.S. I didn't try lmtx yet, on my agenda.
>
> P.P.S. It might be more useful to discuss this topic on AUCTeX mailing
> list if you use AUCTeX.
>
> ---
> WBR, Vladimir Lomov
>
> --
> Nothing recedes like success.
> -- Walter Winchell
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Emacs with context lmtx

2019-04-08 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2019-04-08 12:08:44 +0200]:

> Hi,
> I compile all my files with Emacs and standalone context. I would like to
> compare context lmtx.
> I added this in my .emacs file but it does not work.

Does Emacs prints error messages? How do you run the command in Emacs?
Do you use AUCTeX or not? What messages do you see in *Messages* buffer?

> #
> (eval-after-load "context"
>   '(setq TeX-command-list
>(cons '("ConTeXt"
> "PATH=/home/viserion/context/tex/texmf-linux-64/bin:$PATH context
> --purgeall %s"
> TeX-run-command nil t :help "Run context (MarkIV)")
> TeX-command-list)
>("ConTeXt"
> "PATH=/home/viserion/data/context/tex/texmf-linux-64/bin:$PATH context
> --purgeall %s"
> TeX-run-command t t :help "Run context (LMTX)") t)
> )
> #
> 
> 
> For information about GNU Emacs and the GNU system, type C-h C-a.
> File mode specification error: (wrong-type-argument symbolp (ConTeXt
> PATH=/home/viserion/data/context/tex/texmf-linux-64/bin:$PATH context
> --purgeall %s TeX-run-command t t :help Run context (LMTX)))
> 
> Thank you.
> Fabrice

P.S. I didn't try lmtx yet, on my agenda.

P.P.S. It might be more useful to discuss this topic on AUCTeX mailing
list if you use AUCTeX.

---
WBR, Vladimir Lomov

-- 
Nothing recedes like success.
-- Walter Winchell


signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Emacs with context lmtx

2019-04-08 Thread Fabrice Couvreur
Hi,
I compile all my files with Emacs and standalone context. I would like to
compare context lmtx.
I added this in my .emacs file but it does not work.

#
(eval-after-load "context"
  '(setq TeX-command-list
   (cons '("ConTeXt"
"PATH=/home/viserion/context/tex/texmf-linux-64/bin:$PATH context
--purgeall %s"
TeX-run-command nil t :help "Run context (MarkIV)")
TeX-command-list)
   ("ConTeXt"
"PATH=/home/viserion/data/context/tex/texmf-linux-64/bin:$PATH context
--purgeall %s"
TeX-run-command t t :help "Run context (LMTX)") t)
)
#


For information about GNU Emacs and the GNU system, type C-h C-a.
File mode specification error: (wrong-type-argument symbolp (ConTeXt
PATH=/home/viserion/data/context/tex/texmf-linux-64/bin:$PATH context
--purgeall %s TeX-run-command t t :help Run context (LMTX)))

Thank you.
Fabrice
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Emacs + latest beta

2018-08-30 Thread Fabrice Couvreur
Hello Vladimir,

I suppose this is from within Emacs.
>

 File compiled with Emacs
.


I assumed that you installed auctex package, like
>
>   $ sudo pacman -S auctex
>
> and do
>
>   (load "auctex")
>

No with MELPA.


P.S. Why you install auctex as MELPA and don't use Archlinux package ?
>

I do not know !
What is the difference between both ?
If it's better to do it with Arch Linux, I do it !

Is it necessary to add this at the end of each file  ?


%%% Local Variables:
%%% mode: context
%%% TeX-master: t
%%% End:

Thanks,
Fabrice


Le mer. 29 août 2018 à 16:12, Vladimir Lomov  a écrit :

> Hello,
> ** Fabrice Couvreur [2018-08-29 12:01:46 +0200]:
>
> > Hello,
> > Here is the content of my file ~/.profile :
> >
> > export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH
> > export PATH=$HOME/texlive/2018/bin/x86_64-linux:$PATH
> > export PATH=$HOME/bin:$PATH
> >
> >> $ command -v context
> >
> >  [aragorn@fab ~]$  command -v context
> > /home/aragorn/texlive/2018/bin/x86_64-linux/context
> > [aragorn@fab ~]$
>
> And this means that when you run 'context' in shell (terminal) the
> context from TeX Live will be used. Note the above 'export' commands.
> The first prepend the path to ConTeXt Standalone binaries, the next on
> prepends TeX Live binaries, so TeX Live binaries will be used if you run
> 'context' in terminal/shell.
>
> > I then tested the vladimir.tex file
> >
> > \setupsynctex[state=start]
> >
> > \startusableMPgraphic{NumberHead}
> >   draw outlinetext.f
> >   ("\bf\namedheadnumber{chapter}")
> >   (withcolor "blue")
> >   ysized 50pt ;
> > \stopusableMPgraphic
> >
> > \unexpanded\def\processMPheadnumber#1%
> >   {\useMPgraphic{NumberHead}}
> >
> > \setuphead%
> > [chapter]%
> > [command=\HeadTitle,%
> >  headstyle=\ss,%
> >  numbercommand=\processMPheadnumber]
> >
> > \unexpanded\def\HeadTitle#1#2%
> > {\framed%
> >   [frame=off,%
> > bottomframe=on,%
> > width=broad,
> > align={broad,nothyphenated,left}]%
> > {#1\blank[nowhite]#2}}
> >
> > \starttext
> > \startchapter[title=First chapter]
> >   \input ward
> > \stopchapter
> > \stoptext
> > ~/
> >
> > % Local Variables:
> > % mode: context
> > % TeX-master: t
> > % End:
> >
> > Here is the output vladimir output
>
> I suppose this is from within Emacs.
>
> >
> > Running `ConTeXt' on `vladimir' with
> > ``PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context
> > --purgeall vladimir''
> > resolvers   | trees | analyzing 'home:texmf'
> > mtx-context | warning: no (local) file './vladimir', proceeding
> > mtx-context | run 1: luatex
> >
> --fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
> > --jobname="vladimir"
> >
> --lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
> > --no-parse-first-line --c:currentrun=1 --c:fulljobname="./vladimir"
> > --c:input="./vladimir" --c:kindofrun=1 --c:maxnofruns=9 --c:purgeall
> > "cont-yes.mkiv"
> >
> > This is LuaTeX, Version 1.08.0 (TeX Live 2018)
> >  system commands enabled.
> >
> > resolvers   > trees > analyzing 'home:texmf'
> > open source > level 1, order 1, name
> >
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
> > system  >
> > system  > ConTeXt  ver: 2018.08.25 10:04 MKIV beta  fmt:
> 2018.8.25
> > int: english/english
> > system  >
> > system  > 'cont-new.mkiv' loaded
> > open source > level 2, order 2, name
> >
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
> > system  > beware: some patches loaded from cont-new.mkiv
> > close source> level 2, order 2, name
> >
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
> > system  > files > jobname 'vladimir', input './vladimir', result
> > 'vladimir'
> > fonts   > latin modern fonts are not preloaded
> > languages   > language 'en' is active
> > open source > level 2, order 3, name '/home/aragorn/vladimir.tex'
> > system  > synctex functionality is enabled, expect 5-10 pct
> runtime
> > overhead!
> > fonts   > preloading latin modern fonts (second stage)
> > fonts   > 'fallback modern-designsize rm 12pt' is loaded
> > structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
> > metapost> initializing instance 'metafun:1' using format
> 'metafun'
> > and method 'default'
> > metapost> loading 'metafun' as
> >
> '/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
> > using method 'default'
> > metapost> initializing number mode 'scaled'
> > open source > level 3, order 4, name
> >
> '/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
> > close source> level 3, order 4, name
> >
> '/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
> > backend > xmp 

Re: [NTG-context] Emacs + latest beta

2018-08-29 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2018-08-29 12:01:46 +0200]:

> Hello,
> Here is the content of my file ~/.profile :
> 
> export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH
> export PATH=$HOME/texlive/2018/bin/x86_64-linux:$PATH
> export PATH=$HOME/bin:$PATH
> 
>> $ command -v context
> 
>  [aragorn@fab ~]$  command -v context
> /home/aragorn/texlive/2018/bin/x86_64-linux/context
> [aragorn@fab ~]$

And this means that when you run 'context' in shell (terminal) the
context from TeX Live will be used. Note the above 'export' commands.
The first prepend the path to ConTeXt Standalone binaries, the next on
prepends TeX Live binaries, so TeX Live binaries will be used if you run
'context' in terminal/shell.

> I then tested the vladimir.tex file
> 
> \setupsynctex[state=start]
> 
> \startusableMPgraphic{NumberHead}
>   draw outlinetext.f
>   ("\bf\namedheadnumber{chapter}")
>   (withcolor "blue")
>   ysized 50pt ;
> \stopusableMPgraphic
> 
> \unexpanded\def\processMPheadnumber#1%
>   {\useMPgraphic{NumberHead}}
> 
> \setuphead%
> [chapter]%
> [command=\HeadTitle,%
>  headstyle=\ss,%
>  numbercommand=\processMPheadnumber]
> 
> \unexpanded\def\HeadTitle#1#2%
> {\framed%
>   [frame=off,%
> bottomframe=on,%
> width=broad,
> align={broad,nothyphenated,left}]%
> {#1\blank[nowhite]#2}}
> 
> \starttext
> \startchapter[title=First chapter]
>   \input ward
> \stopchapter
> \stoptext
> ~/
> 
> % Local Variables:
> % mode: context
> % TeX-master: t
> % End:
> 
> Here is the output vladimir output

I suppose this is from within Emacs.

> 
> Running `ConTeXt' on `vladimir' with
> ``PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context
> --purgeall vladimir''
> resolvers   | trees | analyzing 'home:texmf'
> mtx-context | warning: no (local) file './vladimir', proceeding
> mtx-context | run 1: luatex
> --fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
> --jobname="vladimir"
> --lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
> --no-parse-first-line --c:currentrun=1 --c:fulljobname="./vladimir"
> --c:input="./vladimir" --c:kindofrun=1 --c:maxnofruns=9 --c:purgeall
> "cont-yes.mkiv"
> 
> This is LuaTeX, Version 1.08.0 (TeX Live 2018)
>  system commands enabled.
> 
> resolvers   > trees > analyzing 'home:texmf'
> open source > level 1, order 1, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
> system  >
> system  > ConTeXt  ver: 2018.08.25 10:04 MKIV beta  fmt: 2018.8.25
> int: english/english
> system  >
> system  > 'cont-new.mkiv' loaded
> open source > level 2, order 2, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
> system  > beware: some patches loaded from cont-new.mkiv
> close source> level 2, order 2, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
> system  > files > jobname 'vladimir', input './vladimir', result
> 'vladimir'
> fonts   > latin modern fonts are not preloaded
> languages   > language 'en' is active
> open source > level 2, order 3, name '/home/aragorn/vladimir.tex'
> system  > synctex functionality is enabled, expect 5-10 pct runtime
> overhead!
> fonts   > preloading latin modern fonts (second stage)
> fonts   > 'fallback modern-designsize rm 12pt' is loaded
> structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
> metapost> initializing instance 'metafun:1' using format 'metafun'
> and method 'default'
> metapost> loading 'metafun' as
> '/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
> using method 'default'
> metapost> initializing number mode 'scaled'
> open source > level 3, order 4, name
> '/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
> close source> level 3, order 4, name
> '/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
> backend > xmp > using file
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
> pages   > flushing realpage 1, userpage 1, subpage 1
> close source> level 2, order 4, name '/home/aragorn/vladimir.tex'
> close source> level 1, order 4, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
> 
> mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
> mkiv lua stats  > used cache path:
> /home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
> mkiv lua stats  > resource resolver: loadtime 0.008 seconds, 1 scans with
> scantime 0.000 seconds, 0 shared scans, 31 found files, scanned paths:
> /home/aragorn/texmf
> mkiv lua stats  > stored bytecode data: 437 modules (0.227 sec), 93 tables
> (0.015 sec), 530 chunks

Re: [NTG-context] Emacs + latest beta

2018-08-29 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2018-08-29 11:39:07 +0200]:

> Hello,
> Before considering modifications, here's what I get when I do which context
> :
> 
> Setting "/home/aragorn/context/tex" as ConTeXt root.
> [aragorn@fab ~]$ which context
> /home/aragorn/context/tex/texmf-linux-64/bin/context
> [aragorn@fab ~]$

Ok, context from ConTeXt Standalone.

> $ pacman -Qs texlive

Ok, your system doesn't have any texlive packages.

> 
>  [root@fab aragorn]# pacman -Qs texlive
> [root@fab aragorn]#

Running commands as root is a bit dangerous.

> $ pacman -Qs emacs
>
> 
>  [root@fab aragorn]# pacman -Qs emacs
> local/emacs 26.1-2
> The extensible, customizable, self-documenting real-time display editor
> local/emacs-python-mode 6.2.3-1
> Python mode for Emacs
> [root@fab aragorn]#

Your system has only these two packages.

> you mentioned that commands run in terminal worked fine, but you
> >   invoked them by full path;
> >
> 
> 
> To be able to test with the
> texlive context binary and context standalone context binary
> .

Got it.

> 
> 
> The next in the next message after restarting my PC ...
> 
> Fabrice

[..]

---
WBR, Vladimir Lomov

-- 
I think that I shall never see
A thing as lovely as a tree.
But as you see the trees have gone
They went this morning with the dawn.
A logging firm from out of town
Came and chopped the trees all down.
But I will trick those dirty skunks
And write a brand new poem called 'Trunks'.


signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Emacs + latest beta

2018-08-29 Thread Fabrice Couvreur
Hello,
Here is the content of my file ~/.profile :

export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH
export PATH=$HOME/texlive/2018/bin/x86_64-linux:$PATH
export PATH=$HOME/bin:$PATH

$ command -v context
>

 [aragorn@fab ~]$  command -v context
/home/aragorn/texlive/2018/bin/x86_64-linux/context
[aragorn@fab ~]$

I then tested the vladimir.tex file



\setupsynctex[state=start]

\startusableMPgraphic{NumberHead}
  draw outlinetext.f
  ("\bf\namedheadnumber{chapter}")
  (withcolor "blue")
  ysized 50pt ;
\stopusableMPgraphic

\unexpanded\def\processMPheadnumber#1%
  {\useMPgraphic{NumberHead}}

\setuphead%
[chapter]%
[command=\HeadTitle,%
 headstyle=\ss,%
 numbercommand=\processMPheadnumber]

\unexpanded\def\HeadTitle#1#2%
{\framed%
  [frame=off,%
bottomframe=on,%
width=broad,
align={broad,nothyphenated,left}]%
{#1\blank[nowhite]#2}}

\starttext
\startchapter[title=First chapter]
  \input ward
\stopchapter
\stoptext
~/

% Local Variables:
% mode: context
% TeX-master: t
% End:

Here is the output vladimi
r
.output


Running `ConTeXt' on `vladimir' with
``PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context
--purgeall vladimir''
resolvers   | trees | analyzing 'home:texmf'
mtx-context | warning: no (local) file './vladimir', proceeding
mtx-context | run 1: luatex
--fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
--jobname="vladimir"
--lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
--no-parse-first-line --c:currentrun=1 --c:fulljobname="./vladimir"
--c:input="./vladimir" --c:kindofrun=1 --c:maxnofruns=9 --c:purgeall
"cont-yes.mkiv"

This is LuaTeX, Version 1.08.0 (TeX Live 2018)
 system commands enabled.

resolvers   > trees > analyzing 'home:texmf'
open source > level 1, order 1, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system  >
system  > ConTeXt  ver: 2018.08.25 10:04 MKIV beta  fmt: 2018.8.25
int: english/english
system  >
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 2, order 2, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > files > jobname 'vladimir', input './vladimir', result
'vladimir'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name '/home/aragorn/vladimir.tex'
system  > synctex functionality is enabled, expect 5-10 pct runtime
overhead!
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
metapost> initializing instance 'metafun:1' using format 'metafun'
and method 'default'
metapost> loading 'metafun' as
'/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
using method 'default'
metapost> initializing number mode 'scaled'
open source > level 3, order 4, name
'/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
close source> level 3, order 4, name
'/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
backend > xmp > using file
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 2, order 4, name '/home/aragorn/vladimir.tex'
close source> level 1, order 4, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'

mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path:
/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.008 seconds, 1 scans with
scantime 0.000 seconds, 0 shared scans, 31 found files, scanned paths:
/home/aragorn/texmf
mkiv lua stats  > stored bytecode data: 437 modules (0.227 sec), 93 tables
(0.015 sec), 530 chunks (0.241 sec)
mkiv lua stats  > traced context: maxstack: 1328, freed: 5, unreachable:
1323
mkiv lua stats  > cleaned up reserved nodes: 58 nodes, 9 lists of 455
mkiv lua stats  > node memory usage: 2 glue, 2 kern, 2 penalty, 14
attribute, 50 glue_spec, 4 attribute_list, 2 temp, 2 user_defined
mkiv lua stats  > node list callback tasks: 8 unique task lists, 6
instances (re)created, 55 calls
mkiv lua stats  > synctex tracing: 2 referenced files, 5 files ignored, 3
objects flushed, logfile: vladimir.synctex
mkiv lua stats  > used backend: pdf (backend for directly generating pdf
output)
mkiv lua stats  > jobdata time: 0.001 seconds 

Re: [NTG-context] Emacs + latest beta

2018-08-29 Thread Fabrice Couvreur
Hello,
Before considering modifications, here's what I get when I do which context
:

Setting "/home/aragorn/context/tex" as ConTeXt root.
[aragorn@fab ~]$ which context
/home/aragorn/context/tex/texmf-linux-64/bin/context
[aragorn@fab ~]$

$ pacman -Qs texlive
>

 [root@fab aragorn]# pacman -Qs texlive
[root@fab aragorn]#

$ pacman -Qs emacs
>

 [root@fab aragorn]# pacman -Qs emacs
local/emacs 26.1-2
The extensible, customizable, self-documenting real-time display editor
local/emacs-python-mode 6.2.3-1
Python mode for Emacs
[root@fab aragorn]#

you mentioned that commands run in terminal worked fine, but you
>   invoked them by full path;
>


To be able to test with the
texlive context binary and context standalone context binary
.


The next in the next message after restarting my PC ...

Fabrice


Le mer. 29 août 2018 à 04:58, Vladimir Lomov  a écrit :

> Hello,
> ** Fabrice Couvreur [2018-08-28 11:18:58 +0200]:
>
> > Hi Vladimir,
>
> > I do not use Arch Linux repositories to install  texlive 2018 packages
>
> Some texlive-* packages could be installed as dependencies of other
> packages. You may check if your system has any texlive package:
>
>   $ pacman -Qs texlive
>
> > but I installed texlive 2018 "scheme-full" with tlmgr -gui  in
> > /home/aragorn /texlive/2018.  I then make regular updates in the same
> > way. No texlive traces in the \usr\share\ directory or elsewhere.
>
> I prefer to rely on package manager.
>
> > Standalone Context is also installed in my home directory. However,
> > Emacs is installed from the Arch Linux repositories and is located in
> > /usr/share/emacs.
>
>   $ pacman -Qs emacs
>
> > So I have to add the path of texlive 2018 ?
> > Maybe you do not need to add the Context Standalone path ?
> > My ~/.profile file would be this :
> >
> > source /home/aragorn/context/tex/setuptex
> > export PATH = $ PATH: /home/aragorn/texlive/2018/bin/x86_64-linux
> > export PATH = $ PATH: /home/aragorn /bin
>
> This part is a bit strange:
> - in message
>   https://mailman.ntg.nl/pipermail/ntg-context/2018/092418.html
>   you mentioned that commands run in terminal worked fine, but you
>   invoked them by full path;
>
> - in the same message you set PATH in emacs as
>
> (setenv "PATH" "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)
>
>   (I have to admit that I didn't know it is possible to use '$PATH' in
>   setenv), so it prepends path to context binary to PATH list. The above
>   lines do opposite: they append path to context binary to the end of
>   PATH list.
>
>   The first line, 'source ...', helps here because 'setuptex' in turns
>   prepend path to context binary to PATH.
>
> When you invoke 'context' in terminal (I assume it is bash shell) the
> shell searches program in current directory (depends on configuration)
> and then in PATH, the first wins. So to use context from ConTeXt
> standalone you may simply do
>
>   $ export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH
>
> either in terminal or in ~/.profile. You may always check if this is
> true by runnig
>
>   $ command -v context
>
> (for bash shell) or
>
>   $ which context
>
> Returning to your problem. I looked closely again in messages with
> output from context and I don't understand what may cause the error.
> Seems that Emacs uses correct context (according to loading files).
> Could you show in full your ~/.emacs file? Do you use AUCTeX or bare
> Emacs?
>
> > Regards,
> > Fabrice
> >
>
> [...]
>
> ---
> WBR, Vladimir Lomov
>
>
> --
> Uncontrolled power will turn even saints into savages.  And we can all
> be counted on to live down to our lowest impulses.
> -- Parmen, "Plato's Stepchildren", stardate 5784.3
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Emacs + latest beta

2018-08-28 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2018-08-28 11:18:58 +0200]:

> Hi Vladimir,

> I do not use Arch Linux repositories to install  texlive 2018 packages

Some texlive-* packages could be installed as dependencies of other
packages. You may check if your system has any texlive package:

  $ pacman -Qs texlive

> but I installed texlive 2018 "scheme-full" with tlmgr -gui  in
> /home/aragorn /texlive/2018.  I then make regular updates in the same
> way. No texlive traces in the \usr\share\ directory or elsewhere.

I prefer to rely on package manager.

> Standalone Context is also installed in my home directory. However,
> Emacs is installed from the Arch Linux repositories and is located in
> /usr/share/emacs.

  $ pacman -Qs emacs

> So I have to add the path of texlive 2018 ?
> Maybe you do not need to add the Context Standalone path ?
> My ~/.profile file would be this :
> 
> source /home/aragorn/context/tex/setuptex
> export PATH = $ PATH: /home/aragorn/texlive/2018/bin/x86_64-linux
> export PATH = $ PATH: /home/aragorn /bin

This part is a bit strange:
- in message
  https://mailman.ntg.nl/pipermail/ntg-context/2018/092418.html
  you mentioned that commands run in terminal worked fine, but you
  invoked them by full path;

- in the same message you set PATH in emacs as

(setenv "PATH" "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)

  (I have to admit that I didn't know it is possible to use '$PATH' in
  setenv), so it prepends path to context binary to PATH list. The above
  lines do opposite: they append path to context binary to the end of
  PATH list.

  The first line, 'source ...', helps here because 'setuptex' in turns
  prepend path to context binary to PATH.

When you invoke 'context' in terminal (I assume it is bash shell) the
shell searches program in current directory (depends on configuration)
and then in PATH, the first wins. So to use context from ConTeXt
standalone you may simply do

  $ export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH

either in terminal or in ~/.profile. You may always check if this is
true by runnig

  $ command -v context

(for bash shell) or

  $ which context

Returning to your problem. I looked closely again in messages with
output from context and I don't understand what may cause the error.
Seems that Emacs uses correct context (according to loading files).
Could you show in full your ~/.emacs file? Do you use AUCTeX or bare
Emacs?

> Regards,
> Fabrice
> 

[...]

---
WBR, Vladimir Lomov


-- 
Uncontrolled power will turn even saints into savages.  And we can all
be counted on to live down to our lowest impulses.
-- Parmen, "Plato's Stepchildren", stardate 5784.3


signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Emacs + latest beta

2018-08-28 Thread Fabrice Couvreur
Hi Vladimir,
I do not use Arch Linux repositories to install  texlive 2018 packages but
I installed texlive 2018 "scheme-full" with tlmgr -gui  in /home/aragorn
/texlive/2018.  I then make regular updates in the same way. No texlive
traces in the \usr\share\ directory or elsewhere. Standalone Context is
also installed in my home directory. However, Emacs is installed from the
Arch Linux repositories and is located in /usr/share/emacs.
So I have to add the path of texlive 2018 ?
Maybe you do not need to add the Context Standalone path ?
My ~/.profile file would be this :

source /home/aragorn/context/tex/setuptex
export PATH = $ PATH: /home/aragorn/texlive/2018/bin/x86_64-linux
export PATH = $ PATH: /home/aragorn /bin

Regards,
Fabrice

Le mar. 28 août 2018 à 07:57, Vladimir Lomov  a écrit :

> Hello,
> ** Fabrice Couvreur [2018-08-27 15:47:41 +0200]:
>
> > Le lun. 27 août 2018 à 11:51, Fabrice Couvreur <
> fabrice1.couvr...@gmail.com>
> > a écrit :
> >
> >> Hi Vladimir,
> >> I just made a new standalone context install and added this to my
> >> ~/.profile :  source /home/aragorn/context/tex/setuptex
> >> It finally seems to work !
>
> I'm glad it works for you though
>
> >> export PATH=$PATH:/home/aragorn/context/tex/texmf-linux-64/bin
> >> source /home/aragorn/context/tex/setuptex
> >> export PATH=$PATH:/home/aragorn/texlive/2018/bin/x86_64-linux
> >> export PATH=$PATH:/home/aragorn/bin
>
> don't understand how these lines help you. As you said you were able to
> typeset a sample document in terminal, so all settings in terminal (bash
> I presume) were fine, especially taking into account that 'setuptex'
> exports only PATH variable with correct path for Standalone ConTeXt.
> They might change environment from which Emacs is launched but again,
> you use full path to run context so they must be irrelevant here.
>
> In one of previous messages
> (https://www.mail-archive.com/ntg-context@ntg.nl/msg88742.html) you told
> that you use Archlinux, did you install texlive-* packages? Did you
> update your system? I use Archlinux and have not only ConTeXt
> standalone/suite and TeX Live (TUG) installed but also I have installed
> texlive-* packages from distribution repository and don't have any
> problem with the example either in terminal or Emacs(+AUCTeX), I suspect
> that your Emacs configuration might be the cause of the problem.
>
> > Hi Vladimir,
> > I just realized that does not work anymore
> > !
> >
> > (setq ConTeXt-mode-hook
> >   (lambda () (setq TeX-command-extra-options "--purgeall")))
>
> Why you insist on using hooks when you specify in full the custom
> target? Just add this option to the custom target:
>
> (eval-after-load "context"
>   '(setq TeX-command-list
>(cons '("ConTeXt"
> "PATH=/usr/local/opt/context/tex/texmf-linux-64/bin:$PATH context
> --purgeall %s"
>  TeX-run-command nil t :help "Run context (MarkIV)")
> TeX-command-list))
> )
>
> > Thanks
> > Fabrice
>
> [...]
>
> ---
> WBR, Vladimir Lomov
>
> --
> It is necessary for the welfare of society that genius should be privileged
> to utter sedition, to blaspheme, to outrage good taste, to corrupt the
> youthful mind, and generally to scandalize one's uncles.
> -- George Bernard Shaw
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___


.emacs
Description: Binary data
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Emacs + latest beta

2018-08-27 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2018-08-27 15:47:41 +0200]:

> Le lun. 27 août 2018 à 11:51, Fabrice Couvreur 
> a écrit :
> 
>> Hi Vladimir,
>> I just made a new standalone context install and added this to my
>> ~/.profile :  source /home/aragorn/context/tex/setuptex
>> It finally seems to work !

I'm glad it works for you though

>> export PATH=$PATH:/home/aragorn/context/tex/texmf-linux-64/bin
>> source /home/aragorn/context/tex/setuptex
>> export PATH=$PATH:/home/aragorn/texlive/2018/bin/x86_64-linux
>> export PATH=$PATH:/home/aragorn/bin

don't understand how these lines help you. As you said you were able to
typeset a sample document in terminal, so all settings in terminal (bash
I presume) were fine, especially taking into account that 'setuptex'
exports only PATH variable with correct path for Standalone ConTeXt.
They might change environment from which Emacs is launched but again,
you use full path to run context so they must be irrelevant here.

In one of previous messages
(https://www.mail-archive.com/ntg-context@ntg.nl/msg88742.html) you told
that you use Archlinux, did you install texlive-* packages? Did you
update your system? I use Archlinux and have not only ConTeXt
standalone/suite and TeX Live (TUG) installed but also I have installed
texlive-* packages from distribution repository and don't have any
problem with the example either in terminal or Emacs(+AUCTeX), I suspect
that your Emacs configuration might be the cause of the problem.

> Hi Vladimir,
> I just realized that does not work anymore
> !
> 
> (setq ConTeXt-mode-hook
>   (lambda () (setq TeX-command-extra-options "--purgeall")))

Why you insist on using hooks when you specify in full the custom
target? Just add this option to the custom target:

(eval-after-load "context"
  '(setq TeX-command-list
   (cons '("ConTeXt" 
"PATH=/usr/local/opt/context/tex/texmf-linux-64/bin:$PATH context --purgeall %s"
 TeX-run-command nil t :help "Run context (MarkIV)") TeX-command-list))
)

> Thanks
> Fabrice

[...]

---
WBR, Vladimir Lomov

-- 
It is necessary for the welfare of society that genius should be privileged
to utter sedition, to blaspheme, to outrage good taste, to corrupt the
youthful mind, and generally to scandalize one's uncles.
-- George Bernard Shaw


signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Emacs + latest beta

2018-08-27 Thread Fabrice Couvreur
Hello,
I installed texlive 2018 and context standalone in my home directory. It
seems to me that I must therefore indicate the path where texlive is
located 2018, but maybe I'm wrong.

You can check this by running `which context` in a terminal.
>

 Setting "/home/aragorn/context/tex" as ConTeXt root.
[aragorn@fab ~]$ which context
/home/aragorn/context/tex/texmf-linux-64/bin/context
[aragorn@fab ~]$

Fabrice

Le lun. 27 août 2018 à 16:36, Aditya Mahajan  a écrit :

> On Mon, 27 Aug 2018, Fabrice Couvreur wrote:
>
> > I just made a new standalone context install and added this to my
> ~/.profile
> > :  source /home/aragorn/context/tex/setuptex
> > It finally seems to work !
> >
> > export PATH=$PATH:/home/aragorn/context/tex/texmf-linux-64/bin
> > source /home/aragorn/context/tex/setuptex
> > export PATH=$PATH:/home/aragorn/texlive/2018/bin/x86_64-linux
> > export PATH=$PATH:/home/aragorn/bin
>
> I haven't read the whole thread, but why are you adding BOTH
> context-minimal
> and texlive to path. The whole idea of `source ...setuptex` is to set the
> PATH
> so that `context` resolves to the script provided by context-minimals
> rather
> than texlive.
>
> You can check this by running `which context` in a terminal.
>
> Aditya
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Emacs + latest beta

2018-08-27 Thread Aditya Mahajan

On Mon, 27 Aug 2018, Fabrice Couvreur wrote:


I just made a new standalone context install and added this to my ~/.profile
:  source /home/aragorn/context/tex/setuptex
It finally seems to work !

export PATH=$PATH:/home/aragorn/context/tex/texmf-linux-64/bin
source /home/aragorn/context/tex/setuptex
export PATH=$PATH:/home/aragorn/texlive/2018/bin/x86_64-linux
export PATH=$PATH:/home/aragorn/bin


I haven't read the whole thread, but why are you adding BOTH context-minimal
and texlive to path. The whole idea of `source ...setuptex` is to set the PATH
so that `context` resolves to the script provided by context-minimals rather
than texlive.

You can check this by running `which context` in a terminal.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Emacs + latest beta

2018-08-27 Thread Fabrice Couvreur
Hi Vladimir,
I just realized that does not work anymore
!

(setq ConTeXt-mode-hook
  (lambda () (setq TeX-command-extra-options "--purgeall")))

Thanks
Fabrice


Le lun. 27 août 2018 à 11:51, Fabrice Couvreur 
a écrit :

> Hi Vladimir,
> I just made a new standalone context install and added this to my
> ~/.profile :  source /home/aragorn/context/tex/setuptex
> It finally seems to work !
>
> export PATH=$PATH:/home/aragorn/context/tex/texmf-linux-64/bin
> source /home/aragorn/context/tex/setuptex
> export PATH=$PATH:/home/aragorn/texlive/2018/bin/x86_64-linux
> export PATH=$PATH:/home/aragorn/bin
>
> Thanks
> Fabrice
>
>
> Le lun. 27 août 2018 à 06:07, Vladimir Lomov  a
> écrit :
>
>> Hello,
>> ** Fabrice Couvreur [2018-08-25 01:23:28 +0200]:
>>
>> > Hi Vladimir,
>> > I use ConTeXt Full following this question asked on the forum
>> > https://mailman.ntg.nl/pipermail/ntg-context/2017/089501.html
>> > Then, if I compile with ConTeXt, the problem is not solved and the file
>> > vladimir.log is empty !
>>
>> I don't know what trigger this error, in my configuration (even in
>> minimal one, see below) the sample document is typeset just fine.
>>
>> > This is the buffer vladimir.output with emacs
>> >
>> >  8<
>> >
>> --
>> > Running `ConTeXt' on `vladimir' with
>> > ``PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context
>> vladimir''
>> > resolvers   | trees | analyzing 'home:texmf'
>> > mtx-context | warning: no (local) file './vladimir', proceeding
>> > mtx-context | run 1: luatex
>> >
>> --fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
>> > --jobname="vladimir"
>> >
>> --lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
>> > --no-parse-first-line --c:currentrun=1 --c:fulljobname="./vladimir"
>> > --c:input="./vladimir" --c:kindofrun=1 --c:maxnofruns=9 "cont-yes.mkiv"
>> >
>> > This is LuaTeX, Version 1.08.0 (TeX Live 2018)
>> >  system commands enabled.
>> >
>> > resolvers   > trees > analyzing 'home:texmf'
>> > open source > level 1, order 1, name
>> >
>> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
>> > system  >
>> > system  > ConTeXt  ver: 2018.08.20 17:47 MKIV beta  fmt:
>> 2018.8.20
>> > int: english/english
>> > system  >
>> > system  > 'cont-new.mkiv' loaded
>> > open source > level 2, order 2, name
>> >
>> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
>> > system  > beware: some patches loaded from cont-new.mkiv
>> > close source> level 2, order 2, name
>> >
>> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
>> > system  > files > jobname 'vladimir', input './vladimir', result
>> > 'vladimir'
>> > fonts   > latin modern fonts are not preloaded
>> > languages   > language 'en' is active
>> > open source > level 2, order 3, name '/home/aragorn/vladimir.tex'
>> > system  > synctex functionality is enabled, expect 5-10 pct
>> runtime
>> > overhead!
>> > fonts   > preloading latin modern fonts (second stage)
>> > fonts   > 'fallback modern-designsize rm 12pt' is loaded
>> > structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
>> > metapost> initializing instance 'metafun:1' using format
>> 'metafun'
>> > and method 'default'
>> > metapost> loading 'metafun' as
>> >
>> '/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
>> > using method 'default'
>> > metapost> initializing number mode 'scaled'
>> >
>> > lua error   > lua error on line 10 in file
>> /home/aragorn/vladimir.tex:
>> >
>> > ...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190:
>> attempt to
>> > call a nil value (global 'getid')
>> > stack traceback:
>> > ...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: in
>> > upvalue 'getexpansion'
>> > ...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:343: in
>> > function
>> <...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:338>
>> > ...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:437: in
>> > local 'boxtomp'
>> > ...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1894: in
>> > function
>> <...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1891>
>> > (...tail calls...)
>> >
>> >  1
>> >  2 \setupsynctex[state=start]
>> >  3
>> >  4 \startusableMPgraphic{NumberHead}
>> >  5   draw outlinetext.f
>> >  6   ("\bf\namedheadnumber{chapter}")
>> >  7   (withcolor "red")
>> >  8   ysized 50pt ;
>> >  9 \stopusableMPgraphic
>> > 10 >>
>> > 11 \unexpanded\def\processMPheadn

Re: [NTG-context] Emacs + latest beta

2018-08-27 Thread Fabrice Couvreur
Hi Vladimir,
I just made a new standalone context install and added this to my ~/.profile
:  source /home/aragorn/context/tex/setuptex
It finally seems to work !

export PATH=$PATH:/home/aragorn/context/tex/texmf-linux-64/bin
source /home/aragorn/context/tex/setuptex
export PATH=$PATH:/home/aragorn/texlive/2018/bin/x86_64-linux
export PATH=$PATH:/home/aragorn/bin

Thanks
Fabrice


Le lun. 27 août 2018 à 06:07, Vladimir Lomov  a écrit :

> Hello,
> ** Fabrice Couvreur [2018-08-25 01:23:28 +0200]:
>
> > Hi Vladimir,
> > I use ConTeXt Full following this question asked on the forum
> > https://mailman.ntg.nl/pipermail/ntg-context/2017/089501.html
> > Then, if I compile with ConTeXt, the problem is not solved and the file
> > vladimir.log is empty !
>
> I don't know what trigger this error, in my configuration (even in
> minimal one, see below) the sample document is typeset just fine.
>
> > This is the buffer vladimir.output with emacs
> >
> >  8<
> >
> --
> > Running `ConTeXt' on `vladimir' with
> > ``PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context
> vladimir''
> > resolvers   | trees | analyzing 'home:texmf'
> > mtx-context | warning: no (local) file './vladimir', proceeding
> > mtx-context | run 1: luatex
> >
> --fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
> > --jobname="vladimir"
> >
> --lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
> > --no-parse-first-line --c:currentrun=1 --c:fulljobname="./vladimir"
> > --c:input="./vladimir" --c:kindofrun=1 --c:maxnofruns=9 "cont-yes.mkiv"
> >
> > This is LuaTeX, Version 1.08.0 (TeX Live 2018)
> >  system commands enabled.
> >
> > resolvers   > trees > analyzing 'home:texmf'
> > open source > level 1, order 1, name
> >
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
> > system  >
> > system  > ConTeXt  ver: 2018.08.20 17:47 MKIV beta  fmt:
> 2018.8.20
> > int: english/english
> > system  >
> > system  > 'cont-new.mkiv' loaded
> > open source > level 2, order 2, name
> >
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
> > system  > beware: some patches loaded from cont-new.mkiv
> > close source> level 2, order 2, name
> >
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
> > system  > files > jobname 'vladimir', input './vladimir', result
> > 'vladimir'
> > fonts   > latin modern fonts are not preloaded
> > languages   > language 'en' is active
> > open source > level 2, order 3, name '/home/aragorn/vladimir.tex'
> > system  > synctex functionality is enabled, expect 5-10 pct
> runtime
> > overhead!
> > fonts   > preloading latin modern fonts (second stage)
> > fonts   > 'fallback modern-designsize rm 12pt' is loaded
> > structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
> > metapost> initializing instance 'metafun:1' using format
> 'metafun'
> > and method 'default'
> > metapost> loading 'metafun' as
> >
> '/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
> > using method 'default'
> > metapost> initializing number mode 'scaled'
> >
> > lua error   > lua error on line 10 in file
> /home/aragorn/vladimir.tex:
> >
> > ...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: attempt
> to
> > call a nil value (global 'getid')
> > stack traceback:
> > ...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: in
> > upvalue 'getexpansion'
> > ...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:343: in
> > function
> <...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:338>
> > ...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:437: in
> > local 'boxtomp'
> > ...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1894: in
> > function
> <...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1891>
> > (...tail calls...)
> >
> >  1
> >  2 \setupsynctex[state=start]
> >  3
> >  4 \startusableMPgraphic{NumberHead}
> >  5   draw outlinetext.f
> >  6   ("\bf\namedheadnumber{chapter}")
> >  7   (withcolor "red")
> >  8   ysized 50pt ;
> >  9 \stopusableMPgraphic
> > 10 >>
> > 11 \unexpanded\def\processMPheadnumber#1%
> > 12   {\useMPgraphic{NumberHead}}
> > 13
> > 14 \setuphead%
> > 15 [chapter]%
> > 16 [command=\HeadTitle,%
> > 17  headstyle=\ss,%
> > 18  numbercommand=\processMPheadnumber]
> > 19
> > 20 \unexpanded\def\HeadTitle#1#2%
> >
>
> I didn't see nothing suspicios, only the message with lua error, I
> didn't see it in t

Re: [NTG-context] Emacs + latest beta

2018-08-26 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2018-08-25 01:23:28 +0200]:

> Hi Vladimir,
> I use ConTeXt Full following this question asked on the forum
> https://mailman.ntg.nl/pipermail/ntg-context/2017/089501.html
> Then, if I compile with ConTeXt, the problem is not solved and the file
> vladimir.log is empty !

I don't know what trigger this error, in my configuration (even in
minimal one, see below) the sample document is typeset just fine.

> This is the buffer vladimir.output with emacs
> 
>  8<
> --
> Running `ConTeXt' on `vladimir' with
> ``PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context vladimir''
> resolvers   | trees | analyzing 'home:texmf'
> mtx-context | warning: no (local) file './vladimir', proceeding
> mtx-context | run 1: luatex
> --fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
> --jobname="vladimir"
> --lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
> --no-parse-first-line --c:currentrun=1 --c:fulljobname="./vladimir"
> --c:input="./vladimir" --c:kindofrun=1 --c:maxnofruns=9 "cont-yes.mkiv"
> 
> This is LuaTeX, Version 1.08.0 (TeX Live 2018)
>  system commands enabled.
> 
> resolvers   > trees > analyzing 'home:texmf'
> open source > level 1, order 1, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
> system  >
> system  > ConTeXt  ver: 2018.08.20 17:47 MKIV beta  fmt: 2018.8.20
> int: english/english
> system  >
> system  > 'cont-new.mkiv' loaded
> open source > level 2, order 2, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
> system  > beware: some patches loaded from cont-new.mkiv
> close source> level 2, order 2, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
> system  > files > jobname 'vladimir', input './vladimir', result
> 'vladimir'
> fonts   > latin modern fonts are not preloaded
> languages   > language 'en' is active
> open source > level 2, order 3, name '/home/aragorn/vladimir.tex'
> system  > synctex functionality is enabled, expect 5-10 pct runtime
> overhead!
> fonts   > preloading latin modern fonts (second stage)
> fonts   > 'fallback modern-designsize rm 12pt' is loaded
> structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
> metapost> initializing instance 'metafun:1' using format 'metafun'
> and method 'default'
> metapost> loading 'metafun' as
> '/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
> using method 'default'
> metapost> initializing number mode 'scaled'
> 
> lua error   > lua error on line 10 in file /home/aragorn/vladimir.tex:
> 
> ...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: attempt to
> call a nil value (global 'getid')
> stack traceback:
> ...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: in
> upvalue 'getexpansion'
> ...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:343: in
> function <...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:338>
> ...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:437: in
> local 'boxtomp'
> ...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1894: in
> function <...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1891>
> (...tail calls...)
> 
>  1
>  2 \setupsynctex[state=start]
>  3
>  4 \startusableMPgraphic{NumberHead}
>  5   draw outlinetext.f
>  6   ("\bf\namedheadnumber{chapter}")
>  7   (withcolor "red")
>  8   ysized 50pt ;
>  9 \stopusableMPgraphic
> 10 >>
> 11 \unexpanded\def\processMPheadnumber#1%
> 12   {\useMPgraphic{NumberHead}}
> 13
> 14 \setuphead%
> 15 [chapter]%
> 16 [command=\HeadTitle,%
> 17  headstyle=\ss,%
> 18  numbercommand=\processMPheadnumber]
> 19
> 20 \unexpanded\def\HeadTitle#1#2%
> 

I didn't see nothing suspicios, only the message with lua error, I
didn't see it in terminal and in Emacs.

Last try, could you make a backup of your ~/.emacs file and use attached
one to test your system (Emacs+AUCTeX). Just
1. make a copy of your original ~/.emacs;
2. change it's context to the provided one;
3. start new Emacs session;
4. open a test file and
5. do C-c C-c on it. Be sure that you choose the "ConTeXt" target.

Besides that check the *Messages* buffer, may be you find something
unusual there.

[...]

---
WBR, Vladimir Lomov

-- 
Ship it.
(setenv "TEXMFCNF" nil)
(setenv "TEXMFCACHE" (getenv "X_CACHE_DIR"))
(setenv "TEXROOT" "/usr/local/opt/context/tex")
(setenv "OSFONTDIR" 
"/usr/share/fonts;/usr/local/share/fonts;/us

Re: [NTG-context] Emacs + latest beta

2018-08-26 Thread Vladimir Lomov
Hello,
** Hans Hagen [2018-08-24 16:39:54 +0200]:

> On 8/24/2018 3:48 PM, Vladimir Lomov wrote:
> 
>> I don't know why you get "damaged" pdf file (in fact how do you know
>> that file is damaged?) but "TEXMFCNF" is special variable that I uses to
>> tweak TeX Live configuration for my latex workflow but context
>> (standalone and from TL) refuses to work if this variable is set (in
>> terminal I do 'unset' while in Emacs I set its value to 'nil' because
>> this is identical to "unset" it). The "TEXROOT" variable I found in
>> update script, I'm not sure if context requires it to work but IMHO, it
>> is harmless. And the last variable "TEXMFCACHE" I use to force context
>> to use ~/.cache for "luatex-cache" directory and not "pollute" my home
>> directory (without it the "luatex-cache" directory will be created in
>> $HOME directory).
> 
> context does listen to some of these variables but all lookups are done
> independent of kpse,

And I suspect this causes strange behaviour of context in my case. I have

$ echo $TEXMFCNF
/home/vladimir/.texlive2018/texmf-config/web2c:

The last colon is kpse feature to use not only the first texmf.cnf
(https://www.tug.org/texinfohtml/kpathsea.html#Config-files) but all
others (I use personal texmf.cnf to adjust some TEXMF variables for my
latex workflow). With that TEXMFCNF context can't find its files (this
is for context from TeX Live:
 8< ---
mtxrun  | forcing cache reload
resolvers   | resolving | looking for regular 'texmfcnf.lua' on given path 
'/home/vladimir/.texlive2018/texmf-config/web2c:' from specification 
'/home/vladimir/.texlive2018/texmf-config/web2c:'
resolvers   | resolving | looking for fallback 'contextcnf.lua' on given 
path '/home/vladimir/.texlive2018/texmf-config/web2c:' from specification 
'/home/vladimir/.texlive2018/texmf-config/web2c:'
resolvers   | resolving |
resolvers   | resolving | warning: no lua configuration files found
resolvers   | resolving | no texmf paths are defined (using TEXMF)
resolvers   | resolving |
mtxrun  | the resolver databases are not present or outdated
resolvers   | resolving | using suffix based filetype 'lua'
resolvers   | resolving | remembering file 'mtx-context.lua' using hash 
'lua::mtx-context.lua'
resolvers   | resolving | using suffix based filetype 'lua'
resolvers   | resolving | remembering file 'mtx-contexts.lua' using hash 
'lua::mtx-contexts.lua'
resolvers   | resolving | remembered file 'mtx-context.lua'
resolvers   | resolving | using suffix based filetype 'lua'
resolvers   | resolving | remembering file 'mtx-t-context.lua' using hash 
'lua::mtx-t-context.lua'
resolvers   | resolving | using suffix based filetype 'lua'
resolvers   | resolving | remembering file 'mtx-t-contexts.lua' using hash 
'lua::mtx-t-contexts.lua'
resolvers   | resolving | remembered file 'mtx-t-context.lua'
resolvers   | resolving | using suffix based filetype 'lua'
resolvers   | resolving | remembering file 'context.lua' using hash 
'lua::context.lua'
mtxrun  | unknown script 'context.lua' or 'mtx-context.lua'
 8< ---

). I didn't try to figure out how to "fix" this, I simply unset that variable
when I use context (both standalone and from TeX Live).

> basically you only need to set the path or run context
> / mtxrun with a full path, often from an editor
> /mtxrun --script context 
>
> works ok

context script do exactly that.

> Hans

---
WBR, Vladimir Lomov

-- 
If you ever want to have a lot of fun, I recommend that you go off and program
an imbedded system.  The salient characteristic of an imbedded system is that
it cannot be allowed to get into a state from which only direct intervention
will suffice to remove it.  An imbedded system can't permanently trust
anything it hears from the outside world.  It must sniff around, adapt,
consider, sniff around, and adapt again.  I'm not talking about ordinary
modular programming carefulness here.  No.  Programming an imbedded system
calls for undiluted raging maniacal paranoia.  For example, our ethernet front
ends need to know what network number they are on so that they can address and
route PUPs properly.  How do you find out what your network number is?  Easy,
you ask a gateway.  Gateways are required by definition to know their correct
network numbers.  Once you've got your network number, you start using it and
before you can blink you've got it wired into fifteen different sockets spread
all over creation.  Now what happens when the panic-stricken operator realizes
he was running the wrong version of the gateway which was giving out the wrong
network number?  Never supposed to happen.  Tough.  Supposing that your
software discovers that the gateway is now giving out a different network
number than before, what's it supposed to do about it?  This is

Re: [NTG-context] Emacs + latest beta

2018-08-24 Thread Fabrice Couvreur
Hi Vladimir,
I use ConTeXt Full following this question asked on the forum
https://mailman.ntg.nl/pipermail/ntg-context/2017/089501.html
Then, if I compile with ConTeXt, the problem is not solved and the file
vladimir.log is empty !
This is the buffer vladimir.output with emacs

 8<
--
Running `ConTeXt' on `vladimir' with
``PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context vladimir''
resolvers   | trees | analyzing 'home:texmf'
mtx-context | warning: no (local) file './vladimir', proceeding
mtx-context | run 1: luatex
--fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
--jobname="vladimir"
--lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
--no-parse-first-line --c:currentrun=1 --c:fulljobname="./vladimir"
--c:input="./vladimir" --c:kindofrun=1 --c:maxnofruns=9 "cont-yes.mkiv"

This is LuaTeX, Version 1.08.0 (TeX Live 2018)
 system commands enabled.

resolvers   > trees > analyzing 'home:texmf'
open source > level 1, order 1, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system  >
system  > ConTeXt  ver: 2018.08.20 17:47 MKIV beta  fmt: 2018.8.20
int: english/english
system  >
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 2, order 2, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > files > jobname 'vladimir', input './vladimir', result
'vladimir'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name '/home/aragorn/vladimir.tex'
system  > synctex functionality is enabled, expect 5-10 pct runtime
overhead!
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
metapost> initializing instance 'metafun:1' using format 'metafun'
and method 'default'
metapost> loading 'metafun' as
'/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
using method 'default'
metapost> initializing number mode 'scaled'

lua error   > lua error on line 10 in file /home/aragorn/vladimir.tex:

...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: attempt to
call a nil value (global 'getid')
stack traceback:
...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: in
upvalue 'getexpansion'
...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:343: in
function <...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:338>
...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:437: in
local 'boxtomp'
...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1894: in
function <...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1891>
(...tail calls...)

 1
 2 \setupsynctex[state=start]
 3
 4 \startusableMPgraphic{NumberHead}
 5   draw outlinetext.f
 6   ("\bf\namedheadnumber{chapter}")
 7   (withcolor "red")
 8   ysized 50pt ;
 9 \stopusableMPgraphic
10 >>
11 \unexpanded\def\processMPheadnumber#1%
12   {\useMPgraphic{NumberHead}}
13
14 \setuphead%
15 [chapter]%
16 [command=\HeadTitle,%
17  headstyle=\ss,%
18  numbercommand=\processMPheadnumber]
19
20 \unexpanded\def\HeadTitle#1#2%


?
 8<
-
But if I compile from a terminal without using emacs it works !

[aragorn@fab ~]$ /home/aragorn/context/tex/texmf-linux-64/bin/context
vladimir.tex

Are we sure it is context standalone that is used by emacs rather than
context texlive 2018 ?
When reading the file vladimir.log, I doubt a little ...
Thanks
Fabrice

PS : Here is the content of the file ~/.profile :

export PATH=$PATH:/home/aragorn/context/tex/texmf-linux-64/bin/context
export PATH=$PATH:/home/aragorn/texlive/2018/bin/x86_64-linux
export PATH=$PATH:/home/aragorn/bin

Le ven. 24 août 2018 à 15:48, Vladimir Lomov  a écrit :

> Hello,
> ** Fabrice Couvreur [2018-08-24 12:31:19 +0200]:
>
> > Hi Vladimir,
> > Thanks for everything, it seems to work !
>
> > You are the only one who knew how to solve the problem.
>
> > Here is the content of my ~./emacs file that you probably need to
> improve :
> >
> >  8< 

Re: [NTG-context] Emacs + latest beta

2018-08-24 Thread Hans Hagen

On 8/24/2018 3:48 PM, Vladimir Lomov wrote:


I don't know why you get "damaged" pdf file (in fact how do you know
that file is damaged?) but "TEXMFCNF" is special variable that I uses to
tweak TeX Live configuration for my latex workflow but context
(standalone and from TL) refuses to work if this variable is set (in
terminal I do 'unset' while in Emacs I set its value to 'nil' because
this is identical to "unset" it). The "TEXROOT" variable I found in
update script, I'm not sure if context requires it to work but IMHO, it
is harmless. And the last variable "TEXMFCACHE" I use to force context
to use ~/.cache for "luatex-cache" directory and not "pollute" my home
directory (without it the "luatex-cache" directory will be created in
$HOME directory).


context does listen to some of these variables but all lookups are done 
independent of kpse, basically you only need to set the path or run 
context / mtxrun with a full path, often from an editor


/mtxrun --script context 

works ok

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Emacs + latest beta

2018-08-24 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2018-08-24 12:31:19 +0200]:

> Hi Vladimir,
> Thanks for everything, it seems to work !

> You are the only one who knew how to solve the problem.

> Here is the content of my ~./emacs file that you probably need to improve :
> 
>  8< -
> 
> (eval-after-load "context"
>   '(setq TeX-command-list
>  (cons '("ConTeXt"
> "PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context %s"
>TeX-run-command nil t :help "Run context (MarkIV)")
> TeX-command-list))
> )
> 
> (setq ConTeXt-mode-hook
>   (lambda () (setq TeX-command-extra-options "--purgeall")))
> 
> 
> (add-hook 'ConTeXt-mode-hook
>   (lambda()
> (setq TeX-command-default "ConTeXt Full")))

Why did you set "ConTeXt Full" as your default command? The above
'setq' introduces "ConTeXt" command to process a context file. When I
said that everything is OK I meant that I did C-c C-c, checked that in
minibuffer the "ConTeXt" command is chosen and then hit Enter.

>  8< -
> 
> By cons if I add this :
> 
>  8< -
> 
> (setenv "TEXMFCNF" nil)
> (setenv "TEXROOT" "/home/aragorn/context/tex")
> (setenv "TEXMFCACHE" (format "%s/.cache" (getenv "HOME")))
> 
> 
>  8< -
> 
> 
>  the compilation returns a damaged pdf file that I can not open.

I don't know why you get "damaged" pdf file (in fact how do you know
that file is damaged?) but "TEXMFCNF" is special variable that I uses to
tweak TeX Live configuration for my latex workflow but context
(standalone and from TL) refuses to work if this variable is set (in
terminal I do 'unset' while in Emacs I set its value to 'nil' because
this is identical to "unset" it). The "TEXROOT" variable I found in
update script, I'm not sure if context requires it to work but IMHO, it
is harmless. And the last variable "TEXMFCACHE" I use to force context
to use ~/.cache for "luatex-cache" directory and not "pollute" my home
directory (without it the "luatex-cache" directory will be created in
$HOME directory).

> I installed texlive 2018 and context standalone in my home directory and
> emacs in the /usr/share/emacs directory with Arch Linux ; can that explain
> my problems ?

Not sure but I'll wait you answer about "ConTeXt Full" vs "ConTeXt" I
mentioned above.

> Fabrice

[...]

---
WBR, Vladimir Lomov

-- 
I'm serious about thinking through all the possibilities before we
settle on anything.  All things have the advantages of their
disadvantages, and vice versa.
 -- Larry Wall in <199709032332.qaa21...@wall.org>


signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Emacs + latest beta

2018-08-24 Thread Fabrice Couvreur
Hi Vladimir,
Thanks for everything, it seems to work !
You are the only one who knew how to solve the problem.
Here is the content of my ~./emacs file that you probably need to improve :

 8<
-

(eval-after-load "context"
  '(setq TeX-command-list
 (cons '("ConTeXt"
"PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context %s"
   TeX-run-command nil t :help "Run context (MarkIV)")
TeX-command-list))
)

(setq ConTeXt-mode-hook
  (lambda () (setq TeX-command-extra-options "--purgeall")))


(add-hook 'ConTeXt-mode-hook
  (lambda()
(setq TeX-command-default "ConTeXt Full")))


 8<
--

By cons if I add this :

 8<
-

(setenv "TEXMFCNF" nil)
(setenv "TEXROOT" "/home/aragorn/context/tex")
(setenv "TEXMFCACHE" (format "%s/.cache" (getenv "HOME")))


 8<
---


 the compilation returns a damaged pdf file that I can not open.

I installed texlive 2018 and context standalone in my home directory and
emacs in the /usr/share/emacs directory with Arch Linux ; can that explain
my problems ?

Fabrice


Le ven. 24 août 2018 à 04:21, Vladimir Lomov  a écrit :

> Hello,
> ** Fabrice Couvreur [2018-08-23 10:48:42 +0200]:
>
> > Hi,
> > Thanks for your help but ...
>
> I checked again and it is fine. May be I was too unspecific. First, I
> changed a bit your example to this one:
>
> [test.tex]
>  8< 
> \setupsynctex[state=start]
>
> \startusableMPgraphic{NumberHead}
>   draw outlinetext.f
>   ("\bf\namedheadnumber{chapter}")
>   (withcolor "lightgray")
>   ysized 50pt ;
> \stopusableMPgraphic
>
> \unexpanded\def\processMPheadnumber#1%
>   {\useMPgraphic{NumberHead}}
>
> \setuphead%
> [chapter]%
> [command=\HeadTitle,%
>  headstyle=\ss,%
>  numbercommand=\processMPheadnumber]
>
> \unexpanded\def\HeadTitle#1#2%
> {\framed%
>   [frame=off,%
> bottomframe=on,%
> width=broad,
> align={broad,nothyphenated,left}]%
> {#1\blank[nowhite]#2}}
>
> \starttext
> \startchapter[title=First chapter]
>   \input ward
> \stopchapter
> \stoptext
>
> %%% Local Variables:
> %%% mode: context
> %%% TeX-master: t
> %%% End:
>  8< 
>
> And second, I tweaked a bit my Emacs configuration:
>
>  8< 
> (setenv "TEXMFCNF" nil)
> (setenv "TEXROOT" "/usr/local/opt/context/tex")
> (setenv "TEXMFCACHE" (format "%s/.cache" (getenv "HOME")))
>  8< 
>
> (I have to do that because I have both TeX Live and ConTeXt
> Standalone/Suite in parallel, and use mainly LaTeX.)
>
> You should check your Emacs configuration.
>
> This is my Emacs configuration:
> https://bitbucket.org/vp1981/scripts/src/master/config/emacs/
> and I have
> Emacs:  27.0.50 (git)
> AUCTEX: 12.1 (git)
>
> [...]
>
> ---
> WBR, Vladimir Lomov
>
> --
> Come, you spirits
> That tend on mortal thoughts, unsex me here,
> And fill me, from the crown to the toe, top-full
> Of direst cruelty! make thick my blood,
> Stop up the access and passage to remorse
> That no compunctious visiting of nature
> Shake my fell purpose, not keep peace between
> The effect and it! Come to my woman's breasts,
> And take my milk for gall, you murdering ministers,
> Wherever in your sightless substances
> You wait on nature's mischief! Come, thick night,
> And pall the in the dunnest smoke of hell,
> That my keen knife see not the wound it makes,
> Nor heaven peep through the blanket of the dark,
> To cry `Hold, hold!'
> -- Lady MacBeth
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.

Re: [NTG-context] Emacs + latest beta

2018-08-23 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2018-08-23 10:48:42 +0200]:

> Hi,
> Thanks for your help but ...

I checked again and it is fine. May be I was too unspecific. First, I
changed a bit your example to this one:

[test.tex]
 8< 
\setupsynctex[state=start]

\startusableMPgraphic{NumberHead}
  draw outlinetext.f
  ("\bf\namedheadnumber{chapter}")
  (withcolor "lightgray")
  ysized 50pt ;
\stopusableMPgraphic

\unexpanded\def\processMPheadnumber#1%
  {\useMPgraphic{NumberHead}}

\setuphead%
[chapter]%
[command=\HeadTitle,%
 headstyle=\ss,%
 numbercommand=\processMPheadnumber]

\unexpanded\def\HeadTitle#1#2%
{\framed%
  [frame=off,%
bottomframe=on,%
width=broad,
align={broad,nothyphenated,left}]%
{#1\blank[nowhite]#2}}

\starttext
\startchapter[title=First chapter]
  \input ward
\stopchapter
\stoptext

%%% Local Variables:
%%% mode: context
%%% TeX-master: t
%%% End:
 8< 

And second, I tweaked a bit my Emacs configuration:

 8< 
(setenv "TEXMFCNF" nil)
(setenv "TEXROOT" "/usr/local/opt/context/tex")
(setenv "TEXMFCACHE" (format "%s/.cache" (getenv "HOME")))
 8< 

(I have to do that because I have both TeX Live and ConTeXt
Standalone/Suite in parallel, and use mainly LaTeX.)

You should check your Emacs configuration.

This is my Emacs configuration:
https://bitbucket.org/vp1981/scripts/src/master/config/emacs/
and I have
Emacs:  27.0.50 (git)
AUCTEX: 12.1 (git)

[...]

---
WBR, Vladimir Lomov

-- 
Come, you spirits
That tend on mortal thoughts, unsex me here,
And fill me, from the crown to the toe, top-full
Of direst cruelty! make thick my blood,
Stop up the access and passage to remorse
That no compunctious visiting of nature
Shake my fell purpose, not keep peace between
The effect and it! Come to my woman's breasts,
And take my milk for gall, you murdering ministers,
Wherever in your sightless substances
You wait on nature's mischief! Come, thick night,
And pall the in the dunnest smoke of hell,
That my keen knife see not the wound it makes,
Nor heaven peep through the blanket of the dark,
To cry `Hold, hold!'
-- Lady MacBeth


signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Emacs + latest beta

2018-08-23 Thread Vladimir Lomov
Hello,
** Wolfgang Schuster [2018-08-23 20:58:01 +0200]:

> You get an error message because outlinetext doesn’t work.
> 
> \starttext
> 
> \startMPcode
> draw outlinetext.f
> ("A")
> () ;
> \stopMPcode
> 
> \stoptext

The example that Fabrice Couvreur presented works fine on my side,
besides

> Fabrice Couvreur schrieb am 22.08.18 um 13:05:
>> Hello,
>> Sorry to insist, but could anyone help me understand the problem I'm
>> having in using Emacs with standalone context ?
>> The following file compiles perfectly from a terminal :

--^^

[...]

---
WBR, Vladimir Lomov

-- 
No snowflake in an avalanche ever feels responsible.


signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Emacs + latest beta

2018-08-23 Thread Wolfgang Schuster

You get an error message because outlinetext doesn’t work.

\starttext

\startMPcode
draw outlinetext.f
("A")
() ;
\stopMPcode

\stoptext


Wolfgang


Fabrice Couvreur schrieb am 22.08.18 um 13:05:

Hello,
Sorry to insist, but could anyone help me understand the problem I'm 
having in using Emacs with standalone context ?

The following file compiles perfectly from a terminal :

/home/aragorn/texlive/2018/bin/x86_64-linux/context test.tex

/home/aragorn/context/tex/texmf-linux-64/bin/context test.tex (latest 
beta)


With Emacs, it compiles perfectly if you use the 2018 texlive context 
binary.


If I want to use the latest beta context binary, I need to add this to 
my ~/.emacs file :


(setenv "PATH" "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)

And there, I encounter a compilation problem :

Running `ConTeXt Full' on `pouf' with ``context --purgeall --nonstop 
pouf.tex''resolvers   | trees | analyzing 'home:texmf'
mtx-context | run 1: luatex 
--fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en" 
--interaction="nonstopmode" --jobname="pouf" 
--lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui" 
--no-parse-first-line --c:currentrun=1 --c:fulljobname="./pouf.tex" 
--c:input="./pouf.tex" --c:kindofrun=1 --c:maxnofruns=9 
--c:nonstopmode --c:purgeall "cont-yes.mkiv"


This is LuaTeX, Version 1.08.0 (TeX Live 2018)
 system commands enabled.

resolvers   > trees > analyzing 'home:texmf'
open source > level 1, order 1, name 
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'

job > passes > version mismatch: 1.3 <> 1.31
system >
system  > ConTeXt  ver: 2018.08.20 17:47 MKIV beta fmt: 
2018.8.20  int: english/english

system  >
system > 'cont-new.mkiv' loaded
open source > level 2, order 2, name 
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'

system > beware: some patches loaded from cont-new.mkiv
close source > level 2, order 2, name 
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'


system > files > jobname 'pouf', input './pouf', result 'pouf'
fonts > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name '/home/aragorn/pouf.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
metapost> initializing instance 'metafun:1' using format 
'metafun' and method 'default'
metapost> loading 'metafun' as 
'/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv' 
using method 'default'

metapost> initializing number mode 'scaled'

lua error   > lua error on line 10 in file /home/aragorn/pouf.tex:

...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: 
attempt to call a nil value (global 'getid')

stack traceback:
...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: in 
upvalue 'getexpansion'
...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:343: in 
function <...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:338>
...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:437: in 
local 'boxtomp'
...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1894: in 
function 
<...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1891>

(...tail calls...)

 1
 2 \startusableMPgraphic{NumberHead}
 3  draw outlinetext.f
 4 ("\bf\namedheadnumber{chapter}")
 5  (withcolor "lightgray")
 6   ysized 50pt ;
 7 \stopusableMPgraphic
 8
 9 \unexpanded\def\processMPheadnumber#1%
10 >> {\useMPgraphic{NumberHead}}
11
12 \setuphead
13 [chapter]
14[command=\HeadTitle,
15 headstyle=\ss,
16 numbercommand=\processMPheadnumber,
17 ]
18
19
20 \unexpanded\def\HeadTitle#1#2%


open source > level 3, order 4, name 
'/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
close source> level 3, order 4, name 
'/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
backend > xmp > using file 
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'

pages > flushing realpage 1, userpage 1, subpage 1
close source> level 2, order 4, name '/home/aragorn/pouf.tex'
close source> level 1, order 4, name 
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'


mkiv lua stats  > used config file: 
selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: 
/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.007 seconds, 1 scans 
with scantime 0.000 seconds, 0 shared scans, 31 found files, scan

Re: [NTG-context] Emacs + latest beta

2018-08-23 Thread Fabrice Couvreur
Hi,
Thanks for your help but ...

Running `ConTeXt' on `vladimir' with
``PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context vladimir''
resolvers   | trees | analyzing 'home:texmf'
mtx-context | warning: no (local) file './vladimir', proceeding
mtx-context | run 1: luatex
--fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
--jobname="vladimir"
--lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
--no-parse-first-line --c:currentrun=1 --c:fulljobname="./vladimir"
--c:input="./vladimir" --c:kindofrun=1 --c:maxnofruns=9 "cont-yes.mkiv"

This is LuaTeX, Version 1.08.0 (TeX Live 2018)
 system commands enabled.

resolvers   > trees > analyzing 'home:texmf'
open source > level 1, order 1, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system  >
system  > ConTeXt  ver: 2018.08.20 17:47 MKIV beta  fmt: 2018.8.20
int: english/english
system  >
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 2, order 2, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > files > jobname 'vladimir', input './vladimir', result
'vladimir'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name '/home/aragorn/vladimir.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
metapost> initializing instance 'metafun:1' using format 'metafun'
and method 'default'
metapost> loading 'metafun' as
'/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
using method 'default'
metapost> initializing number mode 'scaled'

lua error   > lua error on line 10 in file /home/aragorn/vladimir.tex:

...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: attempt to
call a nil value (global 'getid')
stack traceback:
...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: in
upvalue 'getexpansion'
...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:343: in
function <...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:338>
...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:437: in
local 'boxtomp'
...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1894: in
function <...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1891>
(...tail calls...)

 1 \startusableMPgraphic{NumberHead}
 2  draw outlinetext.f
 3  ("\bf\namedheadnumber{chapter}")
 4  (withcolor "lightgray")
 5   ysized 50pt ;
 6 \stopusableMPgraphic
 7
 8 \unexpanded\def\processMPheadnumber#1%
 9   {\useMPgraphic{NumberHead}}
10 >>
11 \setuphead
12[chapter]
13[command=\HeadTitle,
14 headstyle=\ss,
15 numbercommand=\processMPheadnumber,
16]
17
18
19 \unexpanded\def\HeadTitle#1#2%
20   {\framed


?
Fabrice

Le jeu. 23 août 2018 à 08:06, Vladimir Lomov  a écrit :

> Hello,
> ** Fabrice Couvreur [2018-08-22 13:05:31 +0200]:
>
> > Hello,
> > Sorry to insist, but could anyone help me understand the problem I'm
> having
> > in using Emacs with standalone context ?
>
> Check environment variables both in terminal and Emacs.
>
> > The following file compiles perfectly from a terminal :
> >
> > /home/aragorn/texlive/2018/bin/x86_64-linux/context  test.tex
> >
> > /home/aragorn/context/tex/texmf-linux-64/bin/context  test.tex (latest
> beta)
> >
> > With Emacs, it compiles perfectly if you use the 2018 texlive context
> > binary.
> >
> > If I want to use the latest beta context binary, I need to add this to my
> > ~/.emacs file :
> >
> > (setenv "PATH" "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)
>
> Instead of this I use this (in my ~/.emacs):
>
> (eval-after-load "context"
>   '(setq TeX-command-list
>  (cons '("ConTeXt"
> "PATH=/usr/local/opt/context/tex/texmf-linux-64/bin:$PATH context %s"
>TeX-run-command nil t :help "Run context (MarkIV)")
> TeX-command-list))
> )
>
> > And there, I encounter a compilation problem :
>
> and I don't see any errors (note, that in my case the "target" in
> "ConTeXt", not "ConTeXt Full").
>
> > Running `ConTeXt Full' on `pouf' with ``context --purgeall --nonstop
> > pouf.tex''resolvers   | trees | analyzing 'home:texmf'
> > mtx-context | run 1: luatex
> >
> --fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
> > --interaction="non

Re: [NTG-context] Emacs + latest beta

2018-08-22 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2018-08-22 13:05:31 +0200]:

> Hello,
> Sorry to insist, but could anyone help me understand the problem I'm having
> in using Emacs with standalone context ?

Check environment variables both in terminal and Emacs.

> The following file compiles perfectly from a terminal :
> 
> /home/aragorn/texlive/2018/bin/x86_64-linux/context  test.tex
> 
> /home/aragorn/context/tex/texmf-linux-64/bin/context  test.tex (latest beta)
> 
> With Emacs, it compiles perfectly if you use the 2018 texlive context
> binary.
> 
> If I want to use the latest beta context binary, I need to add this to my
> ~/.emacs file :
> 
> (setenv "PATH" "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)

Instead of this I use this (in my ~/.emacs):

(eval-after-load "context"
  '(setq TeX-command-list
 (cons '("ConTeXt" 
"PATH=/usr/local/opt/context/tex/texmf-linux-64/bin:$PATH context %s"
   TeX-run-command nil t :help "Run context (MarkIV)") TeX-command-list))
)

> And there, I encounter a compilation problem :

and I don't see any errors (note, that in my case the "target" in
"ConTeXt", not "ConTeXt Full").

> Running `ConTeXt Full' on `pouf' with ``context --purgeall --nonstop
> pouf.tex''resolvers   | trees | analyzing 'home:texmf'
> mtx-context | run 1: luatex
> --fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
> --interaction="nonstopmode" --jobname="pouf"
> --lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
> --no-parse-first-line --c:currentrun=1 --c:fulljobname="./pouf.tex"
> --c:input="./pouf.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:nonstopmode
> --c:purgeall "cont-yes.mkiv"
[...]

---
WBR, Vladimir Lomov

-- 
Old timer, n.:
One who remembers when charity was a virtue and not an organization.


signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Emacs + latest beta

2018-08-22 Thread Fabrice Couvreur
Hello,
Sorry to insist, but could anyone help me understand the problem I'm having
in using Emacs with standalone context ?
The following file compiles perfectly from a terminal :

/home/aragorn/texlive/2018/bin/x86_64-linux/context  test.tex

/home/aragorn/context/tex/texmf-linux-64/bin/context  test.tex (latest beta)

With Emacs, it compiles perfectly if you use the 2018 texlive context
binary.

If I want to use the latest beta context binary, I need to add this to my
~/.emacs file :

(setenv "PATH" "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)

And there, I encounter a compilation problem :

Running `ConTeXt Full' on `pouf' with ``context --purgeall --nonstop
pouf.tex''resolvers   | trees | analyzing 'home:texmf'
mtx-context | run 1: luatex
--fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
--interaction="nonstopmode" --jobname="pouf"
--lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
--no-parse-first-line --c:currentrun=1 --c:fulljobname="./pouf.tex"
--c:input="./pouf.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:nonstopmode
--c:purgeall "cont-yes.mkiv"

This is LuaTeX, Version 1.08.0 (TeX Live 2018)
 system commands enabled.

resolvers   > trees > analyzing 'home:texmf'
open source > level 1, order 1, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
job > passes > version mismatch: 1.3 <> 1.31
system  >
system  > ConTeXt  ver: 2018.08.20 17:47 MKIV beta  fmt: 2018.8.20
int: english/english
system  >
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 2, order 2, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'

system  > files > jobname 'pouf', input './pouf', result 'pouf'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name '/home/aragorn/pouf.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
metapost> initializing instance 'metafun:1' using format 'metafun'
and method 'default'
metapost> loading 'metafun' as
'/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
using method 'default'
metapost> initializing number mode 'scaled'

lua error   > lua error on line 10 in file /home/aragorn/pouf.tex:

...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: attempt to
call a nil value (global 'getid')
stack traceback:
...ext/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:190: in
upvalue 'getexpansion'
...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:343: in
function <...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:338>
...ext/tex/texmf-context/tex/context/base/mkiv/font-mps.lua:437: in
local 'boxtomp'
...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1894: in
function <...ext/tex/texmf-context/tex/context/base/mkiv/mlib-pps.lua:1891>
(...tail calls...)

 1
 2 \startusableMPgraphic{NumberHead}
 3  draw outlinetext.f
 4  ("\bf\namedheadnumber{chapter}")
 5  (withcolor "lightgray")
 6   ysized 50pt ;
 7 \stopusableMPgraphic
 8
 9 \unexpanded\def\processMPheadnumber#1%
10 >>{\useMPgraphic{NumberHead}}
11
12 \setuphead
13[chapter]
14[command=\HeadTitle,
15 headstyle=\ss,
16 numbercommand=\processMPheadnumber,
17]
18
19
20 \unexpanded\def\HeadTitle#1#2%


open source > level 3, order 4, name
'/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
close source> level 3, order 4, name
'/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
backend > xmp > using file
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 2, order 4, name '/home/aragorn/pouf.tex'
close source> level 1, order 4, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'

mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path:
/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.007 seconds, 1 scans with
scantime 0.000 seconds, 0 shared scans, 31 found files, scanned paths:
/home/aragorn/texmf
mkiv lua stats  > stored bytecode data: 437 modules (0.226 sec), 93 tables
(0.0

Re: [NTG-context] Emacs templates for ConTeXt

2009-05-15 Thread Piotr Kopszak
Hello Jean,

I never tried to use muse, surely have to try one day. Now I was
thinking about something more modest and I think msf-abbrevs is just
excellent for my needs. There are only eight tags to use in abbrevs
file which I learnt in 5 minutes so I could start writing my templates
in no time. Perhaps if somebody else was also interested it would be
useful to make a public version. I always use texshow but it would be
even more useful with templates I think.

Piotr

2009/5/15 Jean Magnan de Bornier :
> Le 15 mai à 13:23:52 Piotr Kopszak  écrit notamment:
>
> | Hello,
>>
> | I have just started using Emacs msf-abbrevs mode with ConTeXt files.
> | Just would like to know if anyone is using other templating systems
> | for Emacs with ConTeXt files? Are there any templates for ConTeXt
> | commands around?
>
> Hi Piotr,
>
> Not exactly a template, but emacs-muse can have its output as a context
> file, highly configurable; you can find a short description here:
>
> http://wiki.contextgarden.net/ConTeXt_and_emacs-muse
>
> cheers,
> --
> Jean
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___
>



-- 
http://okle.pl
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Emacs templates for ConTeXt

2009-05-15 Thread Jean Magnan de Bornier
Le 15 mai à 13:23:52 Piotr Kopszak  écrit notamment:

| Hello,
>
| I have just started using Emacs msf-abbrevs mode with ConTeXt files.
| Just would like to know if anyone is using other templating systems
| for Emacs with ConTeXt files? Are there any templates for ConTeXt
| commands around?

Hi Piotr,

Not exactly a template, but emacs-muse can have its output as a context
file, highly configurable; you can find a short description here:

http://wiki.contextgarden.net/ConTeXt_and_emacs-muse

cheers,
-- 
Jean
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Emacs templates for ConTeXt

2009-05-15 Thread Piotr Kopszak
Hello,

I have just started using Emacs msf-abbrevs mode with ConTeXt files.
Just would like to know if anyone is using other templating systems
for Emacs with ConTeXt files? Are there any templates for ConTeXt
commands around?

Best

Piotr

-- 
http://okle.pl
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] emacs

2009-02-05 Thread Peter Münster
On Thu, 5 Feb 2009, luigi scarso wrote:

> Here some code that you can attach to your .emacs file (just a copy from
> auctex with minor modifications):
> 
> Peter, can you put it into wiki ?

Of course, just as everybody else can do it ;)

But this is only a quick workaround. It would be nicer, if a clean solution
could be integrated into auctex.

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] emacs

2009-02-05 Thread luigi scarso
On Thu, Feb 5, 2009 at 4:06 PM, Peter Münster  wrote:

> On Fri, 24 Oct 2008, Marcin Borkowski wrote:
>
> > > > * Unlike when editing LaTeX files, it does not insert an \item when
> > > >   doing C-c C-e itemize.  I use itemizations a lot and this is a bit
> > > >   annoying, especially that I got used to its behaior when doing
> LaTeX.
> > > >   Also, having C-c C-j asking about the (optional) label all the time
> is
> > > >   also tiring, I would prefer to be asked for it only with C-u C-c
> C-j.
> > >
> > > This is also annoying to me. I'll try to solve this, should no be too
> > > complicated I think (only problem I have, is no spare time, just like
> > > you...).
> >
> > That would be great, also from the point of view of learning elisp...
>
> Hello,
>
> Here some code that you can attach to your .emacs file (just a copy from
> auctex with minor modifications):
>
Peter, can you put it into wiki ?


-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] emacs

2009-02-05 Thread Peter Münster
On Fri, 24 Oct 2008, Marcin Borkowski wrote:

> > > * Unlike when editing LaTeX files, it does not insert an \item when
> > >   doing C-c C-e itemize.  I use itemizations a lot and this is a bit
> > >   annoying, especially that I got used to its behaior when doing LaTeX.
> > >   Also, having C-c C-j asking about the (optional) label all the time is
> > >   also tiring, I would prefer to be asked for it only with C-u C-c C-j.
> > 
> > This is also annoying to me. I'll try to solve this, should no be too
> > complicated I think (only problem I have, is no spare time, just like
> > you...).
> 
> That would be great, also from the point of view of learning elisp...

Hello,

Here some code that you can attach to your .emacs file (just a copy from
auctex with minor modifications):

(require 'context-en)

(defun ConTeXt-en-mode-initialization ()
  "ConTeXt english interface specific initialization."
  (mapcar 'ConTeXt-add-environments (reverse ConTeXt-environment-list-en))
  (TeX-add-symbols
   '("but" ConTeXt-arg-define-ref (TeX-arg-literal " "))
   '("item" (TeX-arg-literal " "))
   '("items" [ConTeXt-arg-setup] (TeX-arg-string "Comma separated list"))
   '("its" ConTeXt-arg-define-ref (TeX-arg-literal " "))
   '("nop" (TeX-arg-literal " "))
   '("ran" TeX-arg-string (TeX-arg-literal " "))
   '("sub" ConTeXt-arg-define-ref (TeX-arg-literal " "))
   '("sym" (TeX-arg-string "Symbol") (TeX-arg-literal " "

(defun ConTeXt-insert-environment (environment &optional extra)
  "Insert ENVIRONMENT, with optional argument EXTRA."
  (if (and (TeX-active-mark)
   (not (eq (mark) (point
  (save-excursion
(if (< (mark) (point))
(exchange-point-and-mark))
(insert TeX-esc (ConTeXt-environment-start-name) environment)
(newline)
(forward-line -1)
(indent-according-to-mode)
(if extra (insert extra))
(goto-char (mark))
(or (TeX-looking-at-backward "^[ \t]*")
(newline))
(insert TeX-esc (ConTeXt-environment-stop-name) environment)
(newline)
(forward-line -1)
(indent-according-to-mode)
;;(goto-char (point))
)
(or (TeX-looking-at-backward "^[ \t]*")
(newline))
(insert TeX-esc (ConTeXt-environment-start-name) environment)
(indent-according-to-mode)
(if extra (insert extra))
(end-of-line)
(newline-and-indent)
(if (string-equal environment "itemize")
(ConTeXt-insert-item))
(newline)
(insert TeX-esc (ConTeXt-environment-stop-name) environment)
(or (looking-at "[ \t]*$")
(save-excursion (newline-and-indent)))
(indent-according-to-mode)
(end-of-line 0)))

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] emacs

2008-10-23 Thread Marcin Borkowski
Dnia Thu, Oct 23, 2008 at 11:08:20PM +0200, Peter Münster napisał(a):
> On Wed, Oct 22 2008, Marcin Borkowski wrote:
> 
> > > What are the problems with emacs?
> > 
> > Here is the (unordered) list of what I remember at the moment.
> > 
> > * It almost never knows when to launch "View"; it almost always offers
> >   me to "ConTeXt" the file.
> 
> Hello Marcin,
> 
> Right, this is a bug. I could make a bug report for that issue.
> I haven't done this before, because I don't really need this feature:
> - I open a ConTeXt file
> - then I begin with the View command to open an xpdf window
> - then I only need ConTeXt commands, that refresh automatically the xpdf
>   window (C-c C-c return)

The same I do, but if I work on a few files simultaneously, or just want
to jump into a new file (to check something or so) the current behavior
is a bit inconvenient.

> 
> Customization code for TeX-command-list:
> ("ConTeXt" "context --once --nonstopmode %t; xpdfcheck \"%s\" &&
>  xpdf -remote \"%s\" -reload" TeX-run-TeX nil (context-mode) :help
>  "Run ConTeXt once") ("ConTeXt Full" "context --nonstopmode %t;
>  xpdfcheck \"%s\" && xpdf -remote \"%s\" -reload" TeX-run-TeX nil
>  (context-mode) :help "Run ConTeXt until completion")
> 
> This is xpdfcheck.c :
> 
> #include 
> #include 
> int main(int argc, char *argv[])
> {
>   Display *display;
>   Atom remoteAtom;
>   char remoteName[256];
>   if(argc != 2){
>   fprintf(stderr, "Usage: %s \n", argv[0]);
>   return 1;
>   }
>   snprintf(remoteName, sizeof(remoteName), "xpdf_%s", argv[1]);
>   if(!(display = XOpenDisplay(NULL)))
>   return 1;
>   remoteAtom = XInternAtom(display, remoteName, False);
>   return !XGetSelectionOwner(display, remoteAtom);
> }

Wow, thanks!  I'll try it (but not today;))!

> > * (This is probably related to the previous one.)  When finished
> >   compilation, it says "ConTeXt: problems after {1} page." or something
> >   like this.
> 
> Indeed, this should be mentioned in the bug report.
> 
> 
> > * When finding files, it offers me to find not only the .tex file, but
> >   also all the .tui, .tuo stuff etc. by default, which is rather
> >   inconvenient.
> 
> (setq completion-ignored-extensions
>   (append completion-ignored-extensions '(".tui" ".tuo")))

Thanks!  I'll have it added together with .aux;).

Edit: it was there already.  Emacs, I'm scared of you.

> > * It has no idea about most of ConTeXt commands, e.g., it tries to
> >   insert {} after ConTeXt commands put by C-c C-m.
> 
> Don't know about this one, I just type the command (often with the help of
> "dabbrev-expand").

Well, in case of LaTeX-mode, it's very useful, since it knows about the
usage of many standard commands and asks for the arguments.

> > * Unlike when editing LaTeX files, it does not insert an \item when
> >   doing C-c C-e itemize.  I use itemizations a lot and this is a bit
> >   annoying, especially that I got used to its behaior when doing LaTeX.
> >   Also, having C-c C-j asking about the (optional) label all the time is
> >   also tiring, I would prefer to be asked for it only with C-u C-c C-j.
> 
> This is also annoying to me. I'll try to solve this, should no be too
> complicated I think (only problem I have, is no spare time, just like
> you...).

That would be great, also from the point of view of learning elisp...

> > * By default, being in dvi or pdf mode doesn't matter: you always end up
> >   with a pdf file.  This is fine when you have a fast computer, but on
> >   low-end, older ones (like mine;)) xdvi is *a lot* faster than xpdf.
> 
> Start xpdf just once, then use only "xpdf -reload". Besides, there are more
> and more issues with dvi, since it's no more supported by ConTeXt (clipping
> of figures, protrusion with TTF and perhaps a lot more). So I consider dvi
> as obsolete.

I know, but I edit mostly rather simple files (no figures, no non-type1
fonts, no rotation etc...) and then uses xdvi a lot (when using LaTeX).

> Cheers, Peter
> 
> -- 
> http://pmrb.free.fr/contact/

Thanks, greets!

PS. I visited your homepage.  Loved the M$ jokes; the essay on viruses
on linux was also *very* interesting.

-- 
Marcin Borkowski (http://mbork.pl)
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] emacs

2008-10-23 Thread Peter Münster
On Wed, Oct 22 2008, Marcin Borkowski wrote:

> > What are the problems with emacs?
> 
> Here is the (unordered) list of what I remember at the moment.
> 
> * It almost never knows when to launch "View"; it almost always offers
>   me to "ConTeXt" the file.

Hello Marcin,

Right, this is a bug. I could make a bug report for that issue.
I haven't done this before, because I don't really need this feature:
- I open a ConTeXt file
- then I begin with the View command to open an xpdf window
- then I only need ConTeXt commands, that refresh automatically the xpdf
  window (C-c C-c return)

Customization code for TeX-command-list:
("ConTeXt" "context --once --nonstopmode %t; xpdfcheck \"%s\" &&
 xpdf -remote \"%s\" -reload" TeX-run-TeX nil (context-mode) :help
 "Run ConTeXt once") ("ConTeXt Full" "context --nonstopmode %t;
 xpdfcheck \"%s\" && xpdf -remote \"%s\" -reload" TeX-run-TeX nil
 (context-mode) :help "Run ConTeXt until completion")

This is xpdfcheck.c :

#include 
#include 
int main(int argc, char *argv[])
{
Display *display;
Atom remoteAtom;
char remoteName[256];
if(argc != 2){
fprintf(stderr, "Usage: %s \n", argv[0]);
return 1;
}
snprintf(remoteName, sizeof(remoteName), "xpdf_%s", argv[1]);
if(!(display = XOpenDisplay(NULL)))
return 1;
remoteAtom = XInternAtom(display, remoteName, False);
return !XGetSelectionOwner(display, remoteAtom);
}


> * (This is probably related to the previous one.)  When finished
>   compilation, it says "ConTeXt: problems after {1} page." or something
>   like this.

Indeed, this should be mentioned in the bug report.


> * When finding files, it offers me to find not only the .tex file, but
>   also all the .tui, .tuo stuff etc. by default, which is rather
>   inconvenient.

(setq completion-ignored-extensions
  (append completion-ignored-extensions '(".tui" ".tuo")))


> * It has no idea about most of ConTeXt commands, e.g., it tries to
>   insert {} after ConTeXt commands put by C-c C-m.

Don't know about this one, I just type the command (often with the help of
"dabbrev-expand").


> * Unlike when editing LaTeX files, it does not insert an \item when
>   doing C-c C-e itemize.  I use itemizations a lot and this is a bit
>   annoying, especially that I got used to its behaior when doing LaTeX.
>   Also, having C-c C-j asking about the (optional) label all the time is
>   also tiring, I would prefer to be asked for it only with C-u C-c C-j.

This is also annoying to me. I'll try to solve this, should no be too
complicated I think (only problem I have, is no spare time, just like
you...).


> * By default, being in dvi or pdf mode doesn't matter: you always end up
>   with a pdf file.  This is fine when you have a fast computer, but on
>   low-end, older ones (like mine;)) xdvi is *a lot* faster than xpdf.

Start xpdf just once, then use only "xpdf -reload". Besides, there are more
and more issues with dvi, since it's no more supported by ConTeXt (clipping
of figures, protrusion with TTF and perhaps a lot more). So I consider dvi
as obsolete.

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] emacs

2008-10-22 Thread Gour
> "Marcin" == Marcin Borkowski <[EMAIL PROTECTED]> writes:

Marcin> I know that these are not *serious* problems; but the UX is poor
Marcin> with them...  

I agree :-/

Marcin> I plan to learn emacs lisp a bit in my spare time (though I
Marcin> almost forgot what "spare time" means;P), but I certainly won't
Marcin> do any serious hacking there.

Same here...when I learn about 'spare time', I'll join you ;)

For now, I'm simply writing in *.rst (restructured text) hoping that
Pandoc will get full* parser for it so that one will be able to convert
to ConTeXt :-)


* atm there is only partial support for rst markup.


Sincerely,
Gour


-- 

Gour  | Zagreb, Croatia  | GPG key: C6E7162D



pgpmYFk01YHtw.pgp
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] emacs (was: Re: PhD Thesis in ConTeXt)

2008-10-21 Thread Marcin Borkowski
Dnia Wed, Oct 22, 2008 at 07:31:32AM +0200, Peter Münster napisał(a):
> On Wed, Oct 22 2008, Marcin Borkowski wrote:
> 
> > Well, my heart is breaking when I type this, but my beloved emacs;) has
> > rather poor ConTeXt support...  I use Emacs 22 with AUCTeX 11.84.  Well,
> > although it *works*, it is by no means convenient - at least not that
> > convenient as an emacs should be;).
> 
> Hello Marcin,
> 
> What are the problems with emacs?

Here is the (unordered) list of what I remember at the moment.

* It almost never knows when to launch "View"; it almost always offers
  me to "ConTeXt" the file.

* (This is probably related to the previous one.)  When finished
  compilation, it says "ConTeXt: problems after {1} page." or something
  like this.

* When finding files, it offers me to find not only the .tex file, but
  also all the .tui, .tuo stuff etc. by default, which is rather
  inconvenient.

* It has no idea about most of ConTeXt commands, e.g., it tries to
  insert {} after ConTeXt commands put by C-c C-m.

* Unlike when editing LaTeX files, it does not insert an \item when
  doing C-c C-e itemize.  I use itemizations a lot and this is a bit
  annoying, especially that I got used to its behaior when doing LaTeX.
  Also, having C-c C-j asking about the (optional) label all the time is
  also tiring, I would prefer to be asked for it only with C-u C-c C-j.

* Only recently I discovered the --arrange parameter for texexec, and
  the fact that AUCTeX does not know about it.

* By default, being in dvi or pdf mode doesn't matter: you always end up
  with a pdf file.  This is fine when you have a fast computer, but on
  low-end, older ones (like mine;)) xdvi is *a lot* faster than xpdf.

I use the emacs & AUCTeX shipped with ubuntu 8.04.  It seems that emacs
comes preconfigured in this system in a rather stupid way, e.g.,
transient-mark-mode is on by default, which is not what I was used to.
A skim through the initialization files shows, however, that the ubuntu
people messed with almost everything but ConTeXt support, so this seems
to be a general AUCTeX issue.

I know that these are not *serious* problems; but the UX is poor with
them...  I plan to learn emacs lisp a bit in my spare time (though I
almost forgot what "spare time" means;P), but I certainly won't do any
serious hacking there.

> Cheers, Peter
> 
> -- 
> http://pmrb.free.fr/contact/

Greets

-- 
Marcin Borkowski (http://mbork.pl)

- Is it a Perl program or a Perl script?
- Well, a script is what you give the actors.
  A program is what you give the audience.

(Larry Wall)
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] emacs (was: Re: PhD Thesis in ConTeXt)

2008-10-21 Thread Peter Münster
On Wed, Oct 22 2008, Marcin Borkowski wrote:

> Well, my heart is breaking when I type this, but my beloved emacs;) has
> rather poor ConTeXt support...  I use Emacs 22 with AUCTeX 11.84.  Well,
> although it *works*, it is by no means convenient - at least not that
> convenient as an emacs should be;).

Hello Marcin,

What are the problems with emacs?

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] emacs lisp for context in AucTeX

2006-04-20 Thread Johan Sandblom
Yes, I have 11.55. I will adopt your suggestion to avoid updating
problems. Still, strange though, seems to be an old feature. Do you
know a convenient way of finding where these bindings are defined?
Perhaps it is a matter of order of precedence differing between the
emacs versions.

Johan

2006/4/20, Sanjoy Mahajan <[EMAIL PROTECTED]>:
> > C-c C-f is not bound to TeX-font for me, which is odd.
>
> Maybe an earlier AUCTeX?  I have 11.82 (from Debian testing/unstable).
>
> -Sanjoy
>
> `Never underestimate the evil of which men of power are capable.'
>  --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.
>


--
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
"What is wanted is not the will to believe, but the
will to find out, which is the exact opposite"
- Bertrand Russell
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] emacs lisp for context in AucTeX

2006-04-20 Thread Sanjoy Mahajan
Great.  Mojca suggested that I wikify my Emacs lisp.  It's now at
.  Following that method ('a
method is a trick I use twice.' --Polya), I've put your elisp there too
-- hope that's okay.  I removed the

(local-set-key "$" 'start-context-math)

so that your code can stand alone (in case people want one or the
other).

I had to change a few things at the end (some maybe because I'm using
GNU Emacs rather than XEmacs, not sure).  Below is the diff and I've
attached the resulting version.  Most of the trouble was in the
keybindings:

(local-set-key "\C-c\C-fc" 'context-insert-FLOW-cells)

doesn't work because C-c C-f is already defined as TeX-font, so it can't
be a prefix as well.  So I chose "\C-cnF".  Also the function name
needed an "s" at the end.  These two:

(local-set-key "\C-cnn" 'context-insert-nattab)
(local-set-key "\C-cnr" 'context-insert-nattab-row)

have a related problem, in that "\C-cn" is not a prefix yet, so "\C-cnn"
and "\C-cnr" are not valid sequences.  So I changed the first use of
"\C-cn" as a prefix to use define-key(), which seems to make a
prefix-map automatically as I eventually learnt by inspecting tex.el.
So:

(define-key (current-local-map) "\C-cnF" 'context-insert-FLOW-cells)
Then the following local-set-key's work.  As I say, this is on Emacs
21.4, and the tricks may be different on XEmacs.

-Sanjoy

--- a/tables.el 2006-04-20 10:46:16.0 -0400
+++ b/tables.el 2006-04-20 10:43:41.0 -0400
@@ -1,5 +1,5 @@
 (defun context-insert-nattab (rows columns)
-  ;; Johan Sandblom 060128
+  ;; Johan Sandblom 2006-01-28
   "Insert a TABLE skeleton"
   (interactive "nNumber of rows: \nnNumber of columns: \n")
   (newline)
@@ -44,8 +44,8 @@
  (newline)
  (backward-char 5))
 
-(defun context-insert-FLOW-cell (n)
- ;; Johan Sandblom 060128
+(defun context-insert-FLOW-cells (n)
+ ;; Johan Sandblom 2006-01-28
  "Insert a FLOWchart cell"
  (interactive "nNumber of cells: \n")
  (newline)
@@ -62,8 +62,7 @@
 
 (add-hook 'ConTeXt-mode-hook
  '(lambda ()
-   (local-set-key "\C-c\C-fc" 'context-insert-FLOW-cells)
+   (define-key (current-local-map) "\C-cnF" 'context-insert-FLOW-cells)
(local-set-key "\C-cnr" 'context-insert-nattab-row)
(local-set-key "\C-cnc" 'context-insert-nattab-column)
-   (local-set-key "\C-cnn" 'context-insert-nattab)
-(local-set-key "$" 'start-context-math)))
+   (local-set-key "\C-cnn" 'context-insert-nattab)))

(defun context-insert-nattab (rows columns)
  ;; Johan Sandblom 2006-01-28
  "Insert a TABLE skeleton"
  (interactive "nNumber of rows: \nnNumber of columns: \n")
  (newline)
  (insert "\\bTABLE\n\\setupTABLE\[\]\n")
  ;; First a TABLE header
  (insert "\\bTABLEhead\n\\bTR\\bTH \\eTH\n")
  (let ((column 1))
(while (< column (- columns 1))
  (insert "\\bTH \\eTH\n")
  (setq column (1+ column
  (insert "\\bTH \\eTH\\eTR\n\\eTABLEhead\n\\bTABLEbody\n")
  ;; The rows and columns
  (let ((row 1))
(while (<= row rows)
  (insert "\\bTR\\bTD \\eTD\n")
  ;; The let expression makes sure that each loop starts at the
  ;; right place
  (let ((column 1))
(while (< column (- columns 1))
  (insert "\\bTD \\eTD\n")
  (setq column (1+ column)))
(insert "\\bTD \\eTD\\eTR\n")
(setq row (1+ row
(insert "\\eTABLEbody\n\\eTABLE\n")))

(defun context-insert-nattab-row (columns)
 "Insert a row in a TABLE"
 (interactive "nNumber of columns: \n")
 (newline)
 (insert "\\bTR\\bTD \\eTD\n")
 (let ((column 1))
   (while (< column (- columns 1))
 (insert "\\bTD \\eTD\n")
 (setq column (1+ column)))
   (insert "\\bTD \\eTD\\eTR\n")))

(defun context-insert-nattab-column (&optional arg)
 "Insert a column in a TABLE"
 (interactive "P")
 (insert "\\bTD \\eTD")
 (indent-for-tab-command)
 (newline)
 (backward-char 5))

(defun context-insert-FLOW-cells (n)
 ;; Johan Sandblom 2006-01-28
 "Insert a FLOWchart cell"
 (interactive "nNumber of cells: \n")
 (newline)
 (let ((x 1))
   (while (<= x n)
 (insert "\\startFLOWcell\n")
 (insert "  \\name  {}\n")
 (insert "  \\location  {}\n")
 (insert "  \\shape {action}\n")
 (insert "  \\text  {}\n")
 (insert "  \\connection[rl]{}\n")
 (insert "\\stopFLOWcell\n")
 (setq x (1+ x)

(add-hook 'ConTeXt-mode-hook
 '(lambda ()
(define-key (current-local-map) "\C-cnF" 'context-insert-FLOW-cells)
(local-set-key "\C-cnr" 'context-insert-nattab-row)
(local-set-key "\C-cnc" 'context-insert-nattab-column)
(local-set-key "\C-cnn" 'context-insert-nattab)))
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] emacs lisp for context in AucTeX

2006-04-20 Thread Sanjoy Mahajan
> C-c C-f is not bound to TeX-font for me, which is odd. 

Maybe an earlier AUCTeX?  I have 11.82 (from Debian testing/unstable).

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
 --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] emacs lisp for context in AucTeX

2006-04-20 Thread Johan Sandblom
Strange that I did not run into these issues, I use GNU emacs as well,
version 22.0.50.1, so presumably a difference in the versions. C-c C-f
is not bound to TeX-font for me, which is odd. Sorry about the
cell/cells issue, I renamed the function just before sending it. Of
course it is ok to put it on the wiki (and thank you for doing that),
the code can be used and altered entirely according to anyone's taste.

Johan

2006/4/20, Sanjoy Mahajan <[EMAIL PROTECTED]>:
> Great.  Mojca suggested that I wikify my Emacs lisp.  It's now at
> .  Following that method ('a
> method is a trick I use twice.' --Polya), I've put your elisp there too
> -- hope that's okay.  I removed the
>
> (local-set-key "$" 'start-context-math)
>
> so that your code can stand alone (in case people want one or the
> other).
>
> I had to change a few things at the end (some maybe because I'm using
> GNU Emacs rather than XEmacs, not sure).  Below is the diff and I've
> attached the resulting version.  Most of the trouble was in the
> keybindings:
>
> (local-set-key "\C-c\C-fc" 'context-insert-FLOW-cells)
>
> doesn't work because C-c C-f is already defined as TeX-font, so it can't
> be a prefix as well.  So I chose "\C-cnF".  Also the function name
> needed an "s" at the end.  These two:
>
> (local-set-key "\C-cnn" 'context-insert-nattab)
> (local-set-key "\C-cnr" 'context-insert-nattab-row)
>
> have a related problem, in that "\C-cn" is not a prefix yet, so "\C-cnn"
> and "\C-cnr" are not valid sequences.  So I changed the first use of
> "\C-cn" as a prefix to use define-key(), which seems to make a
> prefix-map automatically as I eventually learnt by inspecting tex.el.
> So:
>
> (define-key (current-local-map) "\C-cnF" 
> 'context-insert-FLOW-cells)
> Then the following local-set-key's work.  As I say, this is on Emacs
> 21.4, and the tricks may be different on XEmacs.
>
> -Sanjoy
>
> --- a/tables.el 2006-04-20 10:46:16.0 -0400
> +++ b/tables.el 2006-04-20 10:43:41.0 -0400
> @@ -1,5 +1,5 @@
>  (defun context-insert-nattab (rows columns)
> -  ;; Johan Sandblom 060128
> +  ;; Johan Sandblom 2006-01-28
>"Insert a TABLE skeleton"
>(interactive "nNumber of rows: \nnNumber of columns: \n")
>(newline)
> @@ -44,8 +44,8 @@
>   (newline)
>   (backward-char 5))
>
> -(defun context-insert-FLOW-cell (n)
> - ;; Johan Sandblom 060128
> +(defun context-insert-FLOW-cells (n)
> + ;; Johan Sandblom 2006-01-28
>   "Insert a FLOWchart cell"
>   (interactive "nNumber of cells: \n")
>   (newline)
> @@ -62,8 +62,7 @@
>
>  (add-hook 'ConTeXt-mode-hook
>   '(lambda ()
> -   (local-set-key "\C-c\C-fc" 'context-insert-FLOW-cells)
> +   (define-key (current-local-map) "\C-cnF" 
> 'context-insert-FLOW-cells)
> (local-set-key "\C-cnr" 'context-insert-nattab-row)
> (local-set-key "\C-cnc" 'context-insert-nattab-column)
> -   (local-set-key "\C-cnn" 'context-insert-nattab)
> -(local-set-key "$" 'start-context-math)))
> +   (local-set-key "\C-cnn" 'context-insert-nattab)))
>
>
>
>


--
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
"What is wanted is not the will to believe, but the
will to find out, which is the exact opposite"
- Bertrand Russell
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] emacs lisp for context in AucTeX

2006-04-20 Thread Johan Sandblom
Thank you for this. I have written the following much more amateurish
emacs lisp code in order to make it easier to enter natural tables and
flowcharts. Perhaps someone may find it useful or can suggest
improvements. I also added some keybindings for them.

Johan

(defun context-insert-nattab (rows columns)
  ;; Johan Sandblom 060128
  "Insert a TABLE skeleton"
  (interactive "nNumber of rows: \nnNumber of columns: \n")
  (newline)
  (insert "\\bTABLE\n\\setupTABLE\[\]\n")
  ;; First a TABLE header
  (insert "\\bTABLEhead\n\\bTR\\bTH \\eTH\n")
  (let ((column 1))
(while (< column (- columns 1))
  (insert "\\bTH \\eTH\n")
  (setq column (1+ column
  (insert "\\bTH \\eTH\\eTR\n\\eTABLEhead\n\\bTABLEbody\n")
  ;; The rows and columns
  (let ((row 1))
(while (<= row rows)
  (insert "\\bTR\\bTD \\eTD\n")
  ;; The let expression makes sure that each loop starts at the
  ;; right place
  (let ((column 1))
(while (< column (- columns 1))
  (insert "\\bTD \\eTD\n")
  (setq column (1+ column)))
(insert "\\bTD \\eTD\\eTR\n")
(setq row (1+ row
(insert "\\eTABLEbody\n\\eTABLE\n")))

(defun context-insert-nattab-row (columns)
 "Insert a row in a TABLE"
 (interactive "nNumber of columns: \n")
 (newline)
 (insert "\\bTR\\bTD \\eTD\n")
 (let ((column 1))
   (while (< column (- columns 1))
 (insert "\\bTD \\eTD\n")
 (setq column (1+ column)))
   (insert "\\bTD \\eTD\\eTR\n")))

(defun context-insert-nattab-column (&optional arg)
 "Insert a column in a TABLE"
 (interactive "P")
 (insert "\\bTD \\eTD")
 (indent-for-tab-command)
 (newline)
 (backward-char 5))

(defun context-insert-FLOW-cell (n)
 ;; Johan Sandblom 060128
 "Insert a FLOWchart cell"
 (interactive "nNumber of cells: \n")
 (newline)
 (let ((x 1))
   (while (<= x n)
 (insert "\\startFLOWcell\n")
 (insert "  \\name  {}\n")
 (insert "  \\location  {}\n")
 (insert "  \\shape {action}\n")
 (insert "  \\text  {}\n")
 (insert "  \\connection[rl]{}\n")
 (insert "\\stopFLOWcell\n")
 (setq x (1+ x)

(add-hook 'ConTeXt-mode-hook
 '(lambda ()
(local-set-key "\C-c\C-fc" 'context-insert-FLOW-cells)
(local-set-key "\C-cnr" 'context-insert-nattab-row)
(local-set-key "\C-cnc" 'context-insert-nattab-column)
(local-set-key "\C-cnn" 'context-insert-nattab)
(local-set-key "$" 'start-context-math)))

2006/4/20, Sanjoy Mahajan <[EMAIL PROTECTED]>:
> I wrote the following emacs lisp for my .emacs and pass it on (no
> copyright) in case others find it useful.  I used variants for a decade
> with the old tex mode, but just rewrote it for auctex and for context's
> display math syntax (which deprecates $$...$$).
>
> The purpose:
>
> 1. If you type {, [, or (, the appropriate right delimiter is inserted
>for you and the insertion point is placed between them.  So I never
>get unbalanced XYZ errors.  If you think it's a misfeature, delete
>the last three local-set-key's in the TeX-mode-hook.
>
> 2. Same feature if you type $ for inline math: you get $here>$.  The old tex-mode code would do the same on typing a second $,
>so you'd get  for tex's display math.
>
>The code below will also do that, except in context mode.
>
> 3. In context mode, typing the second $ will gobble up preceding
>whitespace and then insert
> \placeformula\startformula
> 
> \stopformula
>
> The whitespace-deletion code in start-context-math is a bit pathetic and
> any improvements are welcome.  I couldn't get re-search-backward to work
> for me because it wouldn't match greedily (so it would gobble up one
> space but not all of them, for example), so instead it just looks one
> character at a time and deletes what it should.
>
> -Sanjoy
>
>
> (defun insert-balanced (left right)
>   "Make a left, right delmiter pair and be poised to type inside of them."
>   (interactive)
>   (insert left)
>   (save-excursion
> (insert right)))
>
> (defun start-context-math ()
>   (interactive)
>   (let* ((start (max (point-min) (- (point) 1)))
>  (stop  (min (point-max) (+ (point) 1
> ; if in the middle of a $$, turn inline math into context display math
> (if (equal "$$" (buffer-substring-no-properties start stop))
> (progn
>   (delete-region start stop);get rid of the $$
>   ; delete preceding spaces, if any
>   (while (and (< (point-min) (point))
>   (equal (buffer-substring-no-properties (- (point) 1)
>  (point))
>  " "))
> (backward-delete-char 1))
>   ; delete a preceding newline, if any
>   (if (equal (buffer-substring-no-properties (- (point) 1)
>  (point))
>  "\n")
> (backward-d

[NTG-context] emacs lisp for context in AucTeX

2006-04-19 Thread Sanjoy Mahajan
I wrote the following emacs lisp for my .emacs and pass it on (no
copyright) in case others find it useful.  I used variants for a decade
with the old tex mode, but just rewrote it for auctex and for context's
display math syntax (which deprecates $$...$$).

The purpose:

1. If you type {, [, or (, the appropriate right delimiter is inserted
   for you and the insertion point is placed between them.  So I never
   get unbalanced XYZ errors.  If you think it's a misfeature, delete
   the last three local-set-key's in the TeX-mode-hook.

2. Same feature if you type $ for inline math: you get $$.  The old tex-mode code would do the same on typing a second $,
   so you'd get  for tex's display math.

   The code below will also do that, except in context mode.

3. In context mode, typing the second $ will gobble up preceding
   whitespace and then insert 
\placeformula\startformula

\stopformula

The whitespace-deletion code in start-context-math is a bit pathetic and
any improvements are welcome.  I couldn't get re-search-backward to work
for me because it wouldn't match greedily (so it would gobble up one
space but not all of them, for example), so instead it just looks one
character at a time and deletes what it should.

-Sanjoy


(defun insert-balanced (left right)
  "Make a left, right delmiter pair and be poised to type inside of them."
  (interactive)
  (insert left)
  (save-excursion
(insert right)))

(defun start-context-math ()
  (interactive)
  (let* ((start (max (point-min) (- (point) 1)))
 (stop  (min (point-max) (+ (point) 1
; if in the middle of a $$, turn inline math into context display math
(if (equal "$$" (buffer-substring-no-properties start stop))
(progn
  (delete-region start stop);get rid of the $$
  ; delete preceding spaces, if any
  (while (and (< (point-min) (point))
  (equal (buffer-substring-no-properties (- (point) 1)
 (point))
 " "))
(backward-delete-char 1))
  ; delete a preceding newline, if any
  (if (equal (buffer-substring-no-properties (- (point) 1)
 (point))
 "\n")
(backward-delete-char 1))
  ; place 
  (insert "\n\\placeformula\\startformula\n")
  (save-excursion (insert "\n\\stopformula")))
  ; else: just doing inline math
  (insert-balanced ?\$ ?\$

(add-hook 'ConTeXt-mode-hook
  '(lambda ()
 (local-set-key "$" 'start-context-math)))

(add-hook 'TeX-mode-hook
  '(lambda ()
 (local-set-key "$" 
'(lambda ()
   (interactive)
   (insert-balanced ?\$ ?\$)))
 (local-set-key "{"
'(lambda ()
   (interactive)
   (insert-balanced ?\{ ?\})))
 (local-set-key "["
'(lambda ()
   (interactive)
   (insert-balanced ?\[ ?\])))
 (local-set-key "("
'(lambda ()
   (interactive)
   (insert-balanced ?\( ?\))

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Emacs

2003-07-28 Thread Alexander Klink
Hi,

On Sat, Jul 26, 2003 at 04:18:30PM -0700, David Arnold wrote:
> What can people tell me about setting up Emacs to work with Context?
I use the AUCTeX from CVS, which can do ConTeXt by now (and has
the keybindings I'm used to). Unluckily, it always says "Problems
after n pages", even though it compiles ok...
Anyways, except for that, it works for me...

Greetings,
Alex



pgp0.pgp
Description: PGP signature


Re: [NTG-context] Emacs

2003-07-28 Thread David Arnold
Mari,

Thanks. I have all of this working.

At 10:33 AM 7/28/03 +0300, you wrote:
>On Sat, 26 Jul 2003, David Arnold wrote:
>> What can people tell me about setting up Emacs to work with Context?
>
>I use TeXLive7 + NTEmacs + Berend Boer's context.el (ConTeXt mode) and my
>OS is Windows (NT/2000/XP depending on the computer I happen to be using).
>I tried using WinEdt as the editor, but as I was already familiar with
>Emacs I found that using NtEmacs was a lot easier (less mousework, too)
>and I now do all my ConTeXt work with this setup.
>
>NTEmacs comes on the TeXLive CD so installing it is very easy, this can be
>done in connection with the TeXLive installation or right after it. I've
>never had problems with the Emacs part of the installation. :-)
>
>After installing TeXLive and NTEmacs I go to Berend's homepage and get the
>context.el (http://www.berenddeboer.net/emacs/index.html), create a .emacs
>settings file and add the required lines in there (or, nowadays, I just
>copy my old .emacs from another computer); the README tells you what to
>do. Or, if you think it will be helpful, I can give you a copy of mine or
>the relevant lines of mine.
>
>There's another helpful Emacs mode that I've downloaded (and made work) on
>one of the computers I use, but I haven't really gotten used to it yet;
>should be real handy, though: etexshow, Patrick Gundlach's browser for
>ConTeXt commands. That you can get at .
>
>I have no idea how to make things work in unix or linux, but the Windows
>part is not too bad if one has an idea of Emacs otherwise.
>
>
>Hope this helps,
>   Mari
>___
>ntg-context mailing list
>[EMAIL PROTECTED]
>http://www.ntg.nl/mailman/listinfo/ntg-context
>
>
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Emacs

2003-07-28 Thread Mari Voipio
On Sat, 26 Jul 2003, David Arnold wrote:
> What can people tell me about setting up Emacs to work with Context?

I use TeXLive7 + NTEmacs + Berend Boer's context.el (ConTeXt mode) and my
OS is Windows (NT/2000/XP depending on the computer I happen to be using).
I tried using WinEdt as the editor, but as I was already familiar with
Emacs I found that using NtEmacs was a lot easier (less mousework, too)
and I now do all my ConTeXt work with this setup.

NTEmacs comes on the TeXLive CD so installing it is very easy, this can be
done in connection with the TeXLive installation or right after it. I've
never had problems with the Emacs part of the installation. :-)

After installing TeXLive and NTEmacs I go to Berend's homepage and get the
context.el (http://www.berenddeboer.net/emacs/index.html), create a .emacs
settings file and add the required lines in there (or, nowadays, I just
copy my old .emacs from another computer); the README tells you what to
do. Or, if you think it will be helpful, I can give you a copy of mine or
the relevant lines of mine.

There's another helpful Emacs mode that I've downloaded (and made work) on
one of the computers I use, but I haven't really gotten used to it yet;
should be real handy, though: etexshow, Patrick Gundlach's browser for
ConTeXt commands. That you can get at .

I have no idea how to make things work in unix or linux, but the Windows
part is not too bad if one has an idea of Emacs otherwise.


Hope this helps,
Mari
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Emacs

2003-07-26 Thread David Arnold
All,

What can people tell me about setting up Emacs to work with Context?

I'd like to gather all information I can.

Thanks.
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context