Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <4uce.02.r.steib@gmx.net>
Subject: Re: [patch] More buttons for emacs stuff, MIDs, mail addresses
Date: Thu, 17 Oct 2002 17:03:30 +0200	[thread overview]
Message-ID: <v9of9tcdkt.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <gd.y1yk7kie1wm.fsf@fly.verified.de>

On Wed, Oct 16 2002, Raymond Scholz wrote:

> An option would be calling pi's Perl script from Gnus and parsing
> the output.

Does it make sense that the user is still prompted when the script
says "mail"? (I'm not sure.)

> (defun rs-is-mid (mid-or-mail)
>   (string-match
>    "-> m-id$"
[...]

We could add pre-defined function for both, pi's script
(id-or-mail.pl) and Florian Weimer's script (message-id-or-email.pl).

What do you think about the following? (Could you test it, please?)

--8<---------------cut here---------------start------------->8---
(defcustom gnus-button-guess-mid-external-name
  "id-or-mail.pl"
  "Program for guessing if a given string is a message IDs or mail address.
See the variable `gnus-button-prefer-mid-or-mail'.  The program must read a
string (message IDs or mail address) from stdin and print
`gnus-button-guess-mid-external-mid-regexp' on stdout iff the string is a
message ID.  If you change the program you probably need to change the
variable `gnus-button-guess-mid-external-mid-regexp' too.  See
<URL:http://piology.org/perl/id-or-mail.pl.html> or
<URL:http://www.enyo.de/fw/scripts/message-id-or-email.pl>."
  :group 'gnus-article-buttons
  :type '(choice (const "id-or-mail.pl")
		 (const "message-id-or-email.pl")
		 (regexp :tag "Other")))

(defcustom gnus-button-guess-mid-external-mid-regexp
  "-> m-id$"
  "The string returned by `gnus-button-guess-mid-external-name' should match
this regexp iff a message ID was found."
  :group 'gnus-article-buttons
  :type '(choice (const :tag "for id-or-mail.pl" "-> m-id$")
		 (const :tag "for message-id-or-email.pl" "^M")
		 (regexp :tag "Other")))

(defun gnus-button-guess-mid-external (mid-or-mail)
  "Function for `gnus-button-prefer-mid-or-mail'.  

The function should return a non-nil value, if the argument is supposed to be
a message ID.  You may need to set `gnus-button-guess-mid-external-name' and
`gnus-button-guess-mid-external-mid-regexp' to make this work."
  (string-match
   gnus-button-guess-mid-external-mid-regexp
   (with-temp-buffer
     (insert (concat "<" mid-or-mail ">"))
     (call-process-region (point-min) (point-max)
			  shell-file-name t (list (current-buffer) nil)
			  nil shell-command-switch
			  gnus-button-guess-mid-external-name)
     (buffer-string))))
--8<---------------cut here---------------end--------------->8---

`gnus-button-guess-mid-external' could be added to
`gnus-button-prefer-mid-or-mail':

--8<---------------cut here---------------start------------->8---
-		 (const mail)))
+		 (const mail)
+		 (function-item :tag "gnus-button-guess-mid-external"
+				gnus-button-guess-mid-external)
+		 (function :tag "Iff function evaluates to non-nil")))
--8<---------------cut here---------------end--------------->8---

> I'm not sure whether funcall should be protected with something like
> `save-window-excursion'.

Dunno.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/



  parent reply	other threads:[~2002-10-17 15:03 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <lcoumukovevvjjmjdn1svsl8ns6316aoca@4ax.com>
     [not found] ` <3D6FED17.6040201@yahoo.com.cn>
     [not found]   ` <m3ptvr2j4k.fsf@hartford-hwp.com>
     [not found]     ` <ilu8z2c4hl5.fsf@latte.josefsson.org>
     [not found]       ` <alfu5t$m59$1@quimby.gnus.org>
2002-09-09 12:43         ` Buttonize man page links Reiner Steib
2002-09-09 13:12           ` Simon Josefsson
2002-09-09 14:12             ` Reiner Steib
2002-09-09 14:16             ` Per Abrahamsen
2002-09-09 17:15               ` Andreas Fuchs
2002-09-10  7:26             ` Mats Lidell
2002-09-18 20:41             ` [patch] More buttons for emacs stuff, MIDs, mail addresses (was: Buttonize man page links) Reiner Steib
2002-09-19 11:42               ` [patch] More buttons for emacs stuff, MIDs, mail addresses Reiner Steib
2002-09-20 15:58               ` Kai Großjohann
2002-09-23 18:12                 ` Reiner Steib
2002-09-23 19:55                   ` Kai Großjohann
2002-09-24  0:32                     ` Katsumi Yamaoka
2002-09-24  8:07                       ` Kai Großjohann
2002-09-24 12:40                         ` Katsumi Yamaoka
2002-09-24 20:28                         ` XEmacs compiler warnings (was: [patch] More buttons for emacs stuff, MIDs, mail addresses) Reiner Steib
2002-09-25 13:16                           ` XEmacs compiler warnings Kai Großjohann
2002-09-25 17:44                             ` Reiner Steib
2002-09-24 20:29                       ` [patch] More buttons for emacs stuff, MIDs, mail addresses Reiner Steib
2002-09-24 20:39                         ` Paul Jarc
2002-09-24 22:15                           ` Reiner Steib
2002-09-25 13:52                         ` Kai Großjohann
2002-09-25 14:51                           ` Reiner Steib
2002-09-25 15:02                             ` Kai Großjohann
2002-09-24 19:28                   ` Raymond Scholz
2002-09-24 19:49                     ` Frank Schmitt
2002-09-24 20:56                     ` Reiner Steib
2002-10-16 17:20                       ` Raymond Scholz
2002-10-16 20:10                         ` Raymond Scholz
2002-10-17 15:03                         ` Reiner Steib [this message]
2002-12-29 17:55                       ` Lars Magne Ingebrigtsen
2002-12-30 17:58                         ` Reiner Steib
2003-01-01 19:09                           ` Lars Magne Ingebrigtsen
2003-01-01 20:38                             ` Reiner Steib
2003-01-01 20:59                               ` Lars Magne Ingebrigtsen
2003-01-07 18:21                                 ` Docu and menu patches for message.el/message.texi (was: [patch] More buttons for emacs stuff, MIDs, mail addresses) Reiner Steib
2003-01-08  4:08                                   ` Docu and menu patches for message.el/message.texi Lars Magne Ingebrigtsen
2003-01-08 12:03                                     ` Reiner Steib
2003-01-08 12:28                                       ` Lars Magne Ingebrigtsen
2003-01-08 15:12                                         ` Reiner Steib
2003-01-08 16:05                                           ` Lars Magne Ingebrigtsen
2003-01-02 16:47                         ` [patch] More buttons for emacs stuff, MIDs, mail addresses Reiner Steib
2003-01-02 18:00                           ` Henrik Enberg
2003-01-02 18:16                             ` Norbert Koch
2003-01-02 18:29                           ` Lars Magne Ingebrigtsen

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=v9of9tcdkt.fsf@marauder.physik.uni-ulm.de \
    --to=4uce.02.r.steib@gmx.net \
    --cc=reiner.steib@gmx.de \
    /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).