ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Peter Münster" <pmlists@free.fr>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: emacs
Date: Thu, 5 Feb 2009 16:06:59 +0100 (CET)	[thread overview]
Message-ID: <alpine.LNX.2.00.0902051602570.30276@gaston.couberia.bzh> (raw)
In-Reply-To: <20081023224638.GO21389@atos.labs.wmid.amu.edu.pl>

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
___________________________________________________________________________________


  reply	other threads:[~2009-02-05 15:06 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 17:56 PhD Thesis in ConTeXt Piotr
2008-10-21 18:58 ` Jeff Smith
2008-10-21 19:35 ` Henning Hraban Ramm
2008-10-21 20:32   ` Diego Depaoli
2008-10-21 22:46 ` Marcin Borkowski
2008-10-22  5:31   ` emacs (was: Re: PhD Thesis in ConTeXt) Peter Münster
2008-10-22  6:18     ` Marcin Borkowski
2008-10-22 10:50       ` emacs Gour
2008-10-23 21:08       ` emacs Peter Münster
2008-10-23 22:46         ` emacs Marcin Borkowski
2009-02-05 15:06           ` Peter Münster [this message]
2009-02-05 15:19             ` emacs luigi scarso
2009-02-05 19:15               ` emacs Peter Münster
2009-02-11 15:35             ` local footnotes Albrecht Kauffmann
2009-02-13 14:44               ` Thomas Floeren
2009-02-20  8:17               ` Albrecht Kauffmann
2009-02-20 10:28                 ` Thomas Floeren
2009-02-24  7:37                   ` Albrecht Kauffmann
2009-02-26 19:28                   ` rulethickness in columns Albrecht Kauffmann
2009-03-01 18:26                     ` Mojca Miklavec
2009-03-01 18:45                       ` Hans Hagen
2009-03-02 10:19                       ` Wolfgang Schuster
2009-03-02 10:41                         ` Hans Hagen
2009-03-03  1:25                           ` Wolfgang Schuster
2009-03-03 18:04                             ` Wolfgang Schuster
2009-03-03 18:26                               ` Hans Hagen
2009-03-03 18:44                                 ` Wolfgang Schuster
2009-03-03 18:29                               ` Hans Hagen
2009-03-03 18:50                                 ` Wolfgang Schuster
2009-03-02 14:31                     ` Mojca Miklavec
2009-03-02 14:58                       ` Peter Rolf
2008-10-22  1:24 ` PhD Thesis in ConTeXt Mojca Miklavec
2008-10-22  3:10 ` Aditya Mahajan
2008-10-22  5:41   ` Alan BRASLAU
2008-10-28  1:29   ` Mohamed Bana
2008-10-28 15:20     ` Aditya Mahajan
2008-10-22  7:13 ` Stephen A. Tjemkes
2008-10-22  8:18   ` Steffen Wolfrum
2008-10-22 12:45     ` John Devereux
2008-10-22 18:53       ` Peter Münster
2008-10-22 20:52   ` Alan BRASLAU
2008-10-22 21:25     ` Aditya Mahajan
2008-10-23 14:37       ` Taco Hoekwater
2008-10-23 14:54         ` John Devereux
2008-10-23 15:38           ` Documentation (Re: PhD Thesis in ConTeXt) Taco Hoekwater
2008-10-23 18:09             ` Rory Molinari
2008-10-23 22:30             ` Marcin Borkowski
2008-10-24  7:18               ` luigi scarso
2008-10-23 21:27         ` documentation, was PhD Thesis in ConTeXt Alan BRASLAU
2008-10-23 22:21         ` Marcin Borkowski
     [not found] <3.0.5.32.20030726161830.00b22cf0@mail.northcoast.com>
2003-07-27  8:12 ` Emacs Guy Worthington
2003-07-28  7:33 ` Emacs Mari Voipio
2003-07-28 15:52   ` Emacs David Arnold
2003-07-28 16:57 ` Emacs Alexander Klink
2003-07-28 17:20   ` Emacs Patrick Gundlach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.0902051602570.30276@gaston.couberia.bzh \
    --to=pmlists@free.fr \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).