Mercurial > hg > xemacs-beta
comparison lisp/mu/mu-cite.el @ 98:0d2f883870bc r20-1b1
Import from CVS: tag r20-1b1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:13:56 +0200 |
parents | 364816949b59 |
children | fe104dbd9147 |
comparison
equal
deleted
inserted
replaced
97:498bf5da1c90 | 98:0d2f883870bc |
---|---|
4 | 4 |
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> | 5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> |
6 ;; MINOURA Makoto <minoura@netlaputa.or.jp> | 6 ;; MINOURA Makoto <minoura@netlaputa.or.jp> |
7 ;; Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> | 7 ;; Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> |
8 ;; Maintainer: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> | 8 ;; Maintainer: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> |
9 ;; Version: $Revision: 1.3 $ | 9 ;; Version: $Revision: 1.4 $ |
10 ;; Keywords: mail, news, citation | 10 ;; Keywords: mail, news, citation |
11 | 11 |
12 ;; This file is part of MU (Message Utilities). | 12 ;; This file is part of MU (Message Utilities). |
13 | 13 |
14 ;; This program is free software; you can redistribute it and/or | 14 ;; This program is free software; you can redistribute it and/or |
52 | 52 |
53 ;;; @ version | 53 ;;; @ version |
54 ;;; | 54 ;;; |
55 | 55 |
56 (defconst mu-cite/RCS-ID | 56 (defconst mu-cite/RCS-ID |
57 "$Id: mu-cite.el,v 1.3 1997/01/30 02:22:36 steve Exp $") | 57 "$Id: mu-cite.el,v 1.4 1997/02/15 22:21:09 steve Exp $") |
58 (defconst mu-cite/version (get-version-string mu-cite/RCS-ID)) | 58 (defconst mu-cite/version (get-version-string mu-cite/RCS-ID)) |
59 | 59 |
60 | 60 |
61 ;;; @ formats | 61 ;;; @ formats |
62 ;;; | 62 ;;; |
63 | 63 |
64 (defvar mu-cite/cited-prefix-regexp "\\(^[^ \t\n>]+>+[ \t]*\\|^[ \t]*$\\)" | 64 (defvar mu-cite/cited-prefix-regexp "\\(^[^ \t\n<>]+>+[ \t]*\\|^[ \t]*$\\)" |
65 "*Regexp to match the citation prefix. | 65 "*Regexp to match the citation prefix. |
66 If match, mu-cite doesn't insert citation prefix.") | 66 If match, mu-cite doesn't insert citation prefix.") |
67 | 67 |
68 (defvar mu-cite/prefix-format '(prefix-register-verbose "> ") | 68 (defvar mu-cite/prefix-format '(prefix-register-verbose "> ") |
69 "*List to represent citation prefix. | 69 "*List to represent citation prefix. |
388 )) | 388 )) |
389 | 389 |
390 | 390 |
391 ;;; @ message editing utilities | 391 ;;; @ message editing utilities |
392 ;;; | 392 ;;; |
393 | 393 |
394 (defvar citation-mark-chars ">}|" | 394 (defvar citation-mark-chars ">}|" |
395 "*String of characters for citation delimiter. [mu-cite.el]") | 395 "*String of characters for citation delimiter. [mu-cite.el]") |
396 | |
397 (defvar citation-disable-chars "<{" | |
398 "*String of characters not allowed as citation-prefix.") | |
396 | 399 |
397 (defun detect-paragraph-cited-prefix () | 400 (defun detect-paragraph-cited-prefix () |
398 (save-excursion | 401 (save-excursion |
399 (goto-char (point-min)) | 402 (goto-char (point-min)) |
400 (let ((i 0) | 403 (let ((i 0) |
408 (setq str (buffer-substring | 411 (setq str (buffer-substring |
409 (progn (beginning-of-line)(point)) | 412 (progn (beginning-of-line)(point)) |
410 (progn (end-of-line)(point)))) | 413 (progn (end-of-line)(point)))) |
411 (setq ret (string-compare-from-top prefix str)) | 414 (setq ret (string-compare-from-top prefix str)) |
412 ) | 415 ) |
413 (setq prefix (second ret)) | 416 (setq prefix |
417 (if (stringp ret) | |
418 ret | |
419 (second ret))) | |
414 (setq i (1+ i)) | 420 (setq i (1+ i)) |
415 ) | 421 ) |
416 (cond ((> i 1) prefix) | 422 (cond ((> i 1) prefix) |
417 ((> i 0) | 423 ((> i 0) |
418 (goto-char (point-min)) | 424 (goto-char (point-min)) |
430 (buffer-substring (point-min)(point)) | 436 (buffer-substring (point-min)(point)) |
431 ) | 437 ) |
432 prefix))) | 438 prefix))) |
433 ((progn | 439 ((progn |
434 (goto-char (point-max)) | 440 (goto-char (point-max)) |
435 (re-search-backward (concat "[" citation-mark-chars "]") | 441 (re-search-backward |
436 nil t) | 442 (concat "[" citation-disable-chars "]") nil t) |
443 (re-search-backward | |
444 (concat "[" citation-mark-chars "]") nil t) | |
437 ) | 445 ) |
438 (goto-char (match-end 0)) | 446 (goto-char (match-end 0)) |
439 (if (looking-at "[ \t]+") | 447 (if (looking-at "[ \t]+") |
440 (goto-char (match-end 0)) | 448 (goto-char (match-end 0)) |
441 ) | 449 ) |