Recent

Author Topic: MailHighligher  (Read 13968 times)

Edson

  • Hero Member
  • *****
  • Posts: 1302
Re: MailHighligher
« Reply #15 on: November 05, 2015, 08:39:18 pm »
Sorry for another question: I added lines beginning with FROM, DATE and SUBJECT to the displayed mail body to show the corresponding information in the synedit control along with the mail text. Good candidates for key words... But defining them as keywords highlights these words also in the text - see attached screenshot. Is there a way to restrict a keyword such that it must be the first word of a line? Or is there another concept in the highlighter terminology which could be "abused" for this purpose?

Yes. Keywords are defined in SynFacilSyn as "special identifiers". You can define the position (token order), it must be, to be considered as Keyword (or another special identifier). Just use:

Code: Pascal  [Select][+][-]
  1.  
  2.   hlt.AddIdentSpec('FROM', hlt.tkKeyword, 1);
  3.  

The last parameter indicates the order:
0 -> any position.
1-> first token.
2 > second token.
...
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

wp

  • Hero Member
  • *****
  • Posts: 11912
Re: MailHighligher
« Reply #16 on: November 05, 2015, 09:59:10 pm »
Perfect! (I had used only an ordinary "hlt.AddKeyword('FROM');")

This highlighter is amazing!

A question which is not needed in my current project, but I had dealt with a long time ago: Is it possible to use several highlighters for the same document? I am thinking of a html document which contains javascript or php sections. Can each section have its own highlighter? Is there a "multi-highlighter"?

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: MailHighligher
« Reply #17 on: November 06, 2015, 12:57:01 pm »
offtopic words
Then please send me a dictionary of "on topic words" - I seem to have misplaced my copy.   :'(  While you're at it, maybe revise the rules of this forum and had the new clause "on topic words only".
« Last Edit: November 06, 2015, 02:52:59 pm by Graeme »
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

Thaddy

  • Hero Member
  • *****
  • Posts: 14364
  • Sensorship about opinions does not belong here.
Re: MailHighligher
« Reply #18 on: November 06, 2015, 01:01:51 pm »
"On topic" is always political.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11446
  • FPC developer.
Re: MailHighligher
« Reply #19 on: November 06, 2015, 01:44:51 pm »
Then please send me a dictionary of "ontopic words" - I seem to have misplaced my copy.   :'(  While you're at it, maybe revise the rules of this forum and had the new clause "ontopic words only".

This is a synedit subgroup. Your post is nothing but "regex" without any concrete pointers, and the fpgui name drop.  So except for a very generic "regex" that can be dropped in anything parsing related there is no connection to both the question. That makes the post extremely low quality with a hint that it's main purpose was dropping fpgui into a conversation.

If it was a hard violation it would have been removed directly, so that is not the question.

Moreover, even the moderator thresholds for on and off topic are pretty lax, and more importantly even one post in itself this is not something I as a moderator strive to correct, we all have an off day and like to talk about what currently occupies us.

It is just that for you that seems to be a pattern. A very long term pattern with regular flareups.
« Last Edit: November 06, 2015, 02:05:32 pm by marcov »

Edson

  • Hero Member
  • *****
  • Posts: 1302
Re: MailHighligher
« Reply #20 on: November 06, 2015, 02:02:50 pm »
A question which is not needed in my current project, but I had dealt with a long time ago: Is it possible to use several highlighters for the same document? I am thinking of a html document which contains javascript or php sections. Can each section have its own highlighter? Is there a "multi-highlighter"?

Sadly, SynFacilSyn is not a "multihighlighter". I have analyzed that possibility, but it presents several technical difficulties. It is some of the requirements I have in mind, but probably it will take some time to implement.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: MailHighligher
« Reply #21 on: November 06, 2015, 02:52:12 pm »
This is a synedit subgroup. Your post is nothing but "regex" without any concrete pointers
So lets try this for the 3rd time.... Is there a SynEdit highlighter that bases its rules purely on regex? Something like what EditPad Pro does?  [or gEdit, mcedit etc]

Sorry in advance is "EditPad Pro" is also an offtopic word or some product name drop. These rules are so complicated.

Quote
It is just that for you that seems to be a pattern. A very long term pattern with regular flareups.
Actually I seem to have quite normal conversations with everybody else. Others have even thanked me for being so helpful. It seems the only issue here (and in the mailing lists) is you interpreting every single message of mine as malice.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

Edson

  • Hero Member
  • *****
  • Posts: 1302
Re: MailHighligher
« Reply #22 on: November 06, 2015, 03:41:06 pm »
 :-\ I would say something, but I'm afraid it will be considered as "offtopic"  :-\
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: MailHighligher
« Reply #23 on: November 06, 2015, 06:27:19 pm »
:-\ I would say something, but I'm afraid it will be considered as "offtopic"  :-\
Edson, I think life's too short to worry about such things.  I do find it odd though... In all my years as a developer [and it has been many], and all the communities I've been involved in, it is only FPC and Lazarus that are so anal about what they consider offtopic messages here and there.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

wp

  • Hero Member
  • *****
  • Posts: 11912
Re: MailHighligher
« Reply #24 on: November 06, 2015, 06:30:36 pm »
Anyway, I think all has been said, and I would be happy if there would not be any more pollution of "my" thread.

Morton

  • Full Member
  • ***
  • Posts: 111
Re: MailHighligher
« Reply #25 on: November 11, 2015, 07:44:44 pm »

So lets try this for the 3rd time.... Is there a SynEdit highlighter that bases its rules purely on regex? Something like what EditPad Pro does?  [or gEdit, mcedit etc]

I have designed the orginal editor to be fast, flexible and versatile
and I have told the comunity that it can do everything imageable
provided someone other than me will do the work.

As there had been many requests for a  regular expression highlighter.
I have decided to make an exception and implemented
a generic regular expression engine for syntactical evaluation,
with unlimited nesting depth and thus an unlimited amount of "languages"
within a single piece of text, which can beat everything published before with ease.

Intentionaly I have published it as a generic lexer not as a highlighter
and without a rule reader, just to left over a little bit work.

However James Jacobson has publisched a sample highlighter based on it many years ago.

 

TinyPortal © 2005-2018