ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: feature request
Date: Tue, 15 Nov 2011 09:56:16 +0100	[thread overview]
Message-ID: <4EC22930.7080308@wxs.nl> (raw)
In-Reply-To: <alpine.LNX.2.00.1111142359250.16555@ybpnyubfg.ybpnyqbznva>

On 15-11-2011 06:43, Aditya Mahajan wrote:

> Here is a slightly cleanup version that handles multiline comments better
>
> https://github.com/adityam/context-comments/blob/master/t-comments.mkvi

  if find(s,stop) then
    insideComment = false
    return cleaned_line .. currentfilter(strip_to_stop(s))
  else

as find returns a position, you can do things like this:

local stop = find(s,stop)
if stop then
  ...
  return cleaned_line .. sub(s,stop+#stop,#s)

(ok, you need to know the real unescaped length of stop)

> But this will only work if % has its usual catcode. I don't know how to
> get around that limitation.

for multiline we can plug into the texthandler instead, but it's not 
worth the trouble and the line based one permits selective enable/disable

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2011-11-15  8:56 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-11 15:34 Steffen Wolfrum
2011-11-11 15:53 ` Andreas Harder
2011-11-11 15:57   ` Wolfgang Schuster
2011-11-11 16:01 ` Wolfgang Schuster
2011-11-11 18:47 ` Idris Samawi Hamid ادريس  سماوي حامد
2011-11-13 10:55   ` Steffen Wolfrum
2011-11-13 21:33     ` Andreas Schneider
2011-11-14  7:57       ` Steffen Wolfrum
2011-11-14  8:07         ` Hans Hagen
2011-11-14  9:22           ` Steffen Wolfrum
2011-11-14 18:38             ` Idris Samawi Hamid ادريس  سماوي حامد
2011-11-15 22:03               ` Idris Samawi Hamid ادريس   سماوي حامد
2011-11-15 22:11                 ` Wolfgang Schuster
2011-11-15 22:28                 ` Aditya Mahajan
2011-11-15 22:47                   ` Idris Samawi Hamid ادريس   سماوي حامد
2011-11-14  8:47 ` Aditya Mahajan
2011-11-14 14:03   ` Hans Hagen
2011-11-15  3:35     ` Aditya Mahajan
2011-11-15  5:43       ` Aditya Mahajan
2011-11-15  8:56         ` Hans Hagen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-07-03  6:00 Atsuhito Kohda
2019-07-03  6:35 ` Henri Menke
2019-07-03  6:42 ` Henri Menke
2019-07-04  5:18   ` Atsuhito Kohda
2019-07-04  5:48     ` Henri Menke
2019-07-05 23:31       ` Atsuhito Kohda
2019-07-04 15:16     ` Aditya Mahajan
2019-07-04 15:54       ` Alan Braslau
2019-07-05 23:44         ` Atsuhito Kohda
2019-07-05 23:35       ` Atsuhito Kohda
2007-07-05 17:41 Feature request John R. Culleton
2007-07-05 21:37 ` Patrick Gundlach
2007-07-05 22:27   ` John R. Culleton
2007-07-06  8:09     ` Patrick Gundlach
2005-07-27  9:58 Steffen Wolfrum
2005-07-27 22:16 ` Hans Hagen
     [not found] <a06210200bf0958f2bc0f@87.193.3.198>
2005-07-26 16:20 ` Mojca Miklavec
2005-07-26 22:56   ` Hans Hagen
2005-07-27  5:15     ` luigi.scarso
2005-07-26 15:33 Steffen Wolfrum
2005-07-26 22:38 ` Hans Hagen
2005-07-26 15:00 Steffen Wolfrum
2005-07-26 13:32 Steffen Wolfrum
2005-07-26 14:21 ` Hans Hagen
2005-07-26 14:32 ` Hans Hagen

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=4EC22930.7080308@wxs.nl \
    --to=pragma@wxs.nl \
    --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).