[Mew-dist 05980] Re: about Aliases file

Kazu Yamamoto ( 山本和彦 ) kazu at example.com
1998年 8月 18日 (火) 22:39:53 JST


From: Murata Takashi <Takashi.Murata at example.com>
Subject: [Mew-dist 05978] Re: about Aliases file
Date: Tue, 18 Aug 1998 17:14:12 +0900

> "/usr/local/lib/mh/MailAliases" "~/.im/../Mail/aliases"
> 
> というようにして戴けるという意味であれば、OKです。よろしくお願いします。

できました。親ファイルは、相対なら ~/.im/ からの相対。子ファイルは、親
ファイルからの相対にしました。

--かず


-------------- next part --------------
Index: mew.el
===================================================================
RCS file: /usr/local/cvsroot/Mew/mew/mew.el,v
retrieving revision 1.97
diff -c -r1.97 mew.el
*** mew.el	1998/08/15 05:35:03	1.97
--- mew.el	1998/08/18 13:35:10
***************
*** 239,283 ****
    (setq mew-alias-alist (mew-alias-make-alist)))
  
  (defun mew-alias-make-alist ()
!   "Make alias alist with association of (alias . expantion) from
! IM \"imali\" command. Currently, only \"user: user at example.com\" syntax
! is supported."
!   (if (and mew-alias-file (file-readable-p mew-alias-file))
!       (save-excursion
! 	(let ((case-fold-search t)
! 	      (alias nil)
! 	      (expn nil)
! 	      (alist nil))
! 	  (mew-set-buffer-tmp)
! 	  (insert-file-contents mew-alias-file)
! 	  ;; remove commets
! 	  (goto-char (point-min))
! 	  (while (re-search-forward "[;#].*$" nil t)
! 	    (delete-region (match-beginning 0) (match-end 0)))
! 	  ;; concat continuation lines
! 	  (goto-char (point-min))
! 	  (while (re-search-forward "\\\\\n" nil t)
! 	    (delete-region (match-beginning 0) (match-end 0)))
! 	  ;; concat separated lines by comma
! 	  (goto-char (point-min))
! 	  (while (re-search-forward ",$" nil t)
! 	    (end-of-line)
! 	    (forward-char 1)
! 	    (delete-backward-char 1))
! 	  ;; remove optional white spaces
! 	  (goto-char (point-min))
! 	  (while (re-search-forward "[ \t]+" nil t)
! 	    (replace-match " "))
! 	  ;;
! 	  (goto-char (point-min))
! 	  (while (re-search-forward "^\\([a-zA-Z0-9-_]+\\): \\(.*\\)$" nil t)
! 	    (setq alias (mew-match 1)
! 		  expn (mew-match 2))
! 	    ;; append for first assoc comes first
! 	    (setq alist (cons (cons alias expn) alist)))
! 	  ;; load from mew-refile-from-alist
! 	  (setq alist (mew-refile-alist-append-alias alist))
! 	  (nreverse alist))))) ;; return value
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;;
--- 239,300 ----
    (setq mew-alias-alist (mew-alias-make-alist)))
  
  (defun mew-alias-make-alist ()
!   "Make alias alist with association of (alias . expantion).
! Currently, only \"user: user at example.com\" syntax is supported."
!   (save-excursion
!     (let* ((case-fold-search t)
! 	   (pars (mew-split mew-alias-file ?,)) ;; parents
! 	   (files pars) ;; included
! 	   par chr path alias expn alist)
!       (mew-set-buffer-tmp)
!       ;; include parents files
!       (while pars
! 	(setq par (car pars))
! 	(setq pars (cdr pars))
! 	(if (not (file-readable-p par))
! 	    ()
! 	  (insert-file-contents par)
! 	  (setq path (file-name-directory par))
! 	  ;; include children files
! 	  (while (re-search-forward "^\<[ \t]*\\([^ \t\n]+\\).*$" nil t)
! 	    (setq chr (mew-match 1))
! 	    (if (file-name-absolute-p chr)
! 		(setq chr (expand-file-name chr)) ;; "~/ali"
! 	      (setq chr (expand-file-name chr path)))
! 	    (delete-region (match-beginning 0) (match-end 0))
! 	    (if (and (file-readable-p chr) (not (member chr files)))
! 		(progn
! 		  (insert-file-contents chr)
! 		  (setq files (cons chr files)))))
! 	  (goto-char (point-max))))
!       ;; remove commets
!       (goto-char (point-min))
!       (while (re-search-forward "[;#].*$" nil t)
! 	(delete-region (match-beginning 0) (match-end 0)))
!       ;; concat continuation lines
!       (goto-char (point-min))
!       (while (re-search-forward "\\\\\n" nil t)
! 	(delete-region (match-beginning 0) (match-end 0)))
!       ;; concat separated lines by comma
!       (goto-char (point-min))
!       (while (re-search-forward ",$" nil t)
! 	(end-of-line)
! 	(forward-char 1)
! 	(delete-backward-char 1))
!       ;; remove optional white spaces
!       (goto-char (point-min))
!       (while (re-search-forward "[ \t]+" nil t)
! 	(replace-match " "))
!       ;;
!       (goto-char (point-min))
!       (while (re-search-forward "^ ?\\([^ \n:]+\\) ?: ?\\(.*\\)$" nil t)
! 	(setq alias (mew-match 1))
! 	(setq expn (mew-match 2))
! 	;; append for first assoc comes first
! 	(setq alist (cons (cons alias expn) alist)))
!       ;; load from mew-refile-from-alist
!       (setq alist (mew-refile-alist-append-alias alist))
!       (nreverse alist)))) ;; return value
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;;
-------------- next part --------------
Index: IM.in/Config.pm.in
===================================================================
RCS file: /usr/local/cvsroot/Mew/im/IM.in/Config.pm.in,v
retrieving revision 1.11
diff -c -r1.11 Config.pm.in
*** Config.pm.in	1998/08/14 10:48:46	1.11
--- Config.pm.in	1998/08/18 13:00:50
***************
*** 734,740 ****
  }
  
  sub aliases_file () {
!     return &expand_path($AliasesFile);
  }
  
  sub context_file () {
--- 734,740 ----
  }
  
  sub aliases_file () {
!     return join(',', map {expand_path($_)} split(',', $AliasesFile));
  }
  
  sub context_file () {
***************
*** 868,874 ****
--- 868,876 ----
  sub expand_path ($) {
      my $folder = shift;
  
+     $folder =~ s/\s*//g;
      return '' unless $folder;
+ 
      if ($folder =~ /^\//) {
  	# nothing
      } elsif ($folder eq '.') {


Mew-dist メーリングリストの案内