Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Adding string to 'missing attachment detection'
@ 2011-10-05 19:18 Philipp
  2011-10-06  0:00 ` Ben Walton
  0 siblings, 1 reply; 7+ messages in thread
From: Philipp @ 2011-10-05 19:18 UTC (permalink / raw)
  To: sup-talk

Hi there,
I sometimes need to write mails in German and need to attach some files
to those mails. I also tend to send mails before attaching the files.
I have the 'mentioned "attachment" but it's missing'-option enabled, but
it doesn't help me in German mails. 

All I'd need is a way to add the word 'Anhang' to that mechanism. Can
you tell me where to do this? I tried a web search and looked through
some source files but couldn't find the right place so far.

Regards,
Philipp

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-talk] Adding string to 'missing attachment detection'
  2011-10-05 19:18 [sup-talk] Adding string to 'missing attachment detection' Philipp
@ 2011-10-06  0:00 ` Ben Walton
  2011-10-06  7:04   ` Philipp Überbacher
  0 siblings, 1 reply; 7+ messages in thread
From: Ben Walton @ 2011-10-06  0:00 UTC (permalink / raw)
  To: sup-talk

Excerpts from Philipp's message of Wed Oct 05 15:18:49 -0400 2011:

Hi Philipp,

> All I'd need is a way to add the word 'Anhang' to that mechanism. Can
> you tell me where to do this? I tried a web search and looked through
> some source files but couldn't find the right place so far.

You want to write a 'mentions-attachments' hook.  You'll get the
variables header, and body.  Scan the body for whatever terms you
want/need and return true/false as desired.

HTH.
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-talk] Adding string to 'missing attachment detection'
  2011-10-06  0:00 ` Ben Walton
@ 2011-10-06  7:04   ` Philipp Überbacher
  2011-10-06 12:17     ` Tero Tilus
  2011-10-06 12:55     ` Ben Walton
  0 siblings, 2 replies; 7+ messages in thread
From: Philipp Überbacher @ 2011-10-06  7:04 UTC (permalink / raw)
  To: sup-talk

Excerpts from Ben Walton's message of 2011-10-06 02:00:00 +0200:
> Excerpts from Philipp's message of Wed Oct 05 15:18:49 -0400 2011:
> 
> Hi Philipp,
> 
> > All I'd need is a way to add the word 'Anhang' to that mechanism. Can
> > you tell me where to do this? I tried a web search and looked through
> > some source files but couldn't find the right place so far.
> 
> You want to write a 'mentions-attachments' hook.  You'll get the
> variables header, and body.  Scan the body for whatever terms you
> want/need and return true/false as desired.
> 
> HTH.
> -Ben

Thanks,
but sup does this already, it should be possible to add this single Word
in the appropriate place and be done with this. After all, ruby is an
interpreted language. The sup releases are infrequent, if another one
follows at all, and thus modifying a file is no problem. I don't have
the time to dig deep enough into ruby and sup either. I see that
http://sup.rubyforge.org/wiki/wiki.pl?Hooks lists such a hook but sadly
no example.
Guess I can live without that.

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-talk] Adding string to 'missing attachment detection'
  2011-10-06  7:04   ` Philipp Überbacher
@ 2011-10-06 12:17     ` Tero Tilus
  2011-10-06 13:33       ` Philipp Überbacher
  2011-10-06 12:55     ` Ben Walton
  1 sibling, 1 reply; 7+ messages in thread
From: Tero Tilus @ 2011-10-06 12:17 UTC (permalink / raw)
  To: Sup users

Philipp Überbacher, 2011-10-06 10:04:
> the time to dig deep enough into ruby and sup either. I see that
> http://sup.rubyforge.org/wiki/wiki.pl?Hooks lists such a hook but sadly
> no example.

Oh my!  Need to fix it.  My ~/.sup/hooks/mentions-attachments looks like

body.any? { |l| l =~ /^[^>]/ && l =~ /\b(attach|liite|liittee|ohessa|oheise|oheist)[^ ]*\b/i }

Not pretty but works.

-- 
Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-talk] Adding string to 'missing attachment detection'
  2011-10-06  7:04   ` Philipp Überbacher
  2011-10-06 12:17     ` Tero Tilus
@ 2011-10-06 12:55     ` Ben Walton
  2011-10-06 13:34       ` Philipp Überbacher
  1 sibling, 1 reply; 7+ messages in thread
From: Ben Walton @ 2011-10-06 12:55 UTC (permalink / raw)
  To: sup-talk

Excerpts from Philipp Überbacher's message of Thu Oct 06 03:04:27 -0400 2011:

> but sup does this already, it should be possible to add this single Word
> in the appropriate place and be done with this. After all, ruby is
> an

Sure, lib/sup/modes/edit-message-mode.rb on line 473 (my version of
sup is fairly old, but this should be close).

The hook is cleaner, but if you want to hack it in directly, that's
where you'd do it.

Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-talk] Adding string to 'missing attachment detection'
  2011-10-06 12:17     ` Tero Tilus
@ 2011-10-06 13:33       ` Philipp Überbacher
  0 siblings, 0 replies; 7+ messages in thread
From: Philipp Überbacher @ 2011-10-06 13:33 UTC (permalink / raw)
  To: sup-talk

Excerpts from Tero Tilus's message of 2011-10-06 14:17:30 +0200:
> Philipp Überbacher, 2011-10-06 10:04:
> > the time to dig deep enough into ruby and sup either. I see that
> > http://sup.rubyforge.org/wiki/wiki.pl?Hooks lists such a hook but sadly
> > no example.
> 
> Oh my!  Need to fix it.  My ~/.sup/hooks/mentions-attachments looks like
> 
> body.any? { |l| l =~ /^[^>]/ && l =~ /\b(attach|liite|liittee|ohessa|oheise|oheist)[^ ]*\b/i }
> 
> Not pretty but works.

Thanks, this works. I don't understand what this line is doing but it
looks very similar in the source and this line is simply easier to hack
for me, so I go with this solution.

Thanks for sharing,
Philipp

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sup-talk] Adding string to 'missing attachment detection'
  2011-10-06 12:55     ` Ben Walton
@ 2011-10-06 13:34       ` Philipp Überbacher
  0 siblings, 0 replies; 7+ messages in thread
From: Philipp Überbacher @ 2011-10-06 13:34 UTC (permalink / raw)
  To: sup-talk

Excerpts from Ben Walton's message of 2011-10-06 14:55:07 +0200:
> Excerpts from Philipp Überbacher's message of Thu Oct 06 03:04:27 -0400 2011:
> 
> > but sup does this already, it should be possible to add this single Word
> > in the appropriate place and be done with this. After all, ruby is
> > an
> 
> Sure, lib/sup/modes/edit-message-mode.rb on line 473 (my version of
> sup is fairly old, but this should be close).
> 
> The hook is cleaner, but if you want to hack it in directly, that's
> where you'd do it.
> 
> Thanks
> -Ben
> --
> Ben Walton
> Systems Programmer - CHASS
> University of Toronto
> C:416.407.5610 | W:416.978.4302

Thanks,
I looked it up, it looks similar to the suggested hook line, but the
hook line was easier to modify without risking to mess stuff up.
Thanks for your help.

Regards,
Philipp

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-10-06 13:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-05 19:18 [sup-talk] Adding string to 'missing attachment detection' Philipp
2011-10-06  0:00 ` Ben Walton
2011-10-06  7:04   ` Philipp Überbacher
2011-10-06 12:17     ` Tero Tilus
2011-10-06 13:33       ` Philipp Überbacher
2011-10-06 12:55     ` Ben Walton
2011-10-06 13:34       ` Philipp Überbacher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox