From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/46623 Path: main.gmane.org!not-for-mail From: Micha Wiedenmann Newsgroups: gmane.emacs.gnus.general Subject: Documentation of `message-position-on-field' Date: 20 Sep 2002 14:41:15 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: <87bs6sdgcy.fsf@ID-56226.news.dfncis.de> Reply-To: Micha Wiedenmann NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1032525567 22985 127.0.0.1 (20 Sep 2002 12:39:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 20 Sep 2002 12:39:27 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17sN4A-0005yb-00 for ; Fri, 20 Sep 2002 14:39:26 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17sN21-0004vT-00; Fri, 20 Sep 2002 07:37:13 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 20 Sep 2002 07:37:51 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id HAA02476 for ; Fri, 20 Sep 2002 07:37:35 -0500 (CDT) Original-Received: (qmail 29404 invoked by alias); 20 Sep 2002 12:36:52 -0000 Original-Received: (qmail 29399 invoked from network); 20 Sep 2002 12:36:51 -0000 Original-Received: from quimby.gnus.org (80.91.224.244) by gnus.org with SMTP; 20 Sep 2002 12:36:51 -0000 Original-Received: from news by quimby.gnus.org with local (Exim 3.12 #1 (Debian)) id 17sNgV-0003nI-00 for ; Fri, 20 Sep 2002 15:19:03 +0200 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 42 Original-NNTP-Posting-Host: dialin-145-254-177-215.arcor-ip.net Original-X-Trace: quimby.gnus.org 1032527943 14587 145.254.177.215 (20 Sep 2002 13:19:03 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 20 Sep 2002 13:19:03 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:46623 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:46623 Hi, could explain the use of `narrow-to-region' in `message-position-on-field'. I think it doesn't do anything. What about a Docstring: "Move point to HEADER. Insert HEADER after first matching AFTERS if HEADER does not exits." ,---- | (defun message-position-on-field (header &rest afters) | (let ((case-fold-search t)) | (save-restriction | (narrow-to-region | (goto-char (point-min)) | (progn | (re-search-forward | (concat "^" (regexp-quote mail-header-separator) "$")) | (match-beginning 0))) | (goto-char (point-min)) | (if (re-search-forward (concat "^" (regexp-quote header) ":") nil t) | (progn | (re-search-forward "^[^ \t]" nil 'move) | (beginning-of-line) | (skip-chars-backward "\n") | t) | (while (and afters | (not (re-search-forward | (concat "^" (regexp-quote (car afters)) ":") | nil t))) | (pop afters)) | (when afters | (re-search-forward "^[^ \t]" nil 'move) | (beginning-of-line)) | (insert header ": \n") | (forward-char -1) | nil)))) `---- TIA, Micha -- Bus error -- driver executed.