Newsgroups: fj.editor.emacs
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!nec-tyo!tyo1-nec!newssv1-nec!dsp.cl.nec!necscc!csl.cl.nec!csls6!suehiro
From: suehiro@csl.cl.nec.co.jp (SUEHIRO Kenji)
Subject: Re: Customization of elisp programs
In-Reply-To: suehiro@csl.cl.nec.co.jp's message of Fri, 3 Feb 1995 11:34:45 GMT
Message-ID: <SUEHIRO.95Feb15133030@csls21.csl.cl.nec.co.jp>
Sender: news@csl.cl.nec.co.jp
Organization: NEC Corporation, Japan.
References: <SUEHIRO.95Jan31151312@csls21.csl.cl.nec.co.jp>
	<IIDA.95Feb3173543@sayla.secom-sis.co.jp>
	<SUEHIRO.95Feb3203445@csls21.csl.cl.nec.co.jp>
Date: Wed, 15 Feb 1995 04:30:30 GMT
Lines: 78
Xref: galaxy.trc.rwcp.or.jp fj.editor.emacs:5301
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.editor.emacs&nb=5301&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

iida $B$5$s$+$i0J2<$N$h$&$J%j%W%i%$$r$$$?$@$-$^$7$?!#(B
$B%K%e!<%9%7%9%F%`$,ITD4$H$$$&$3$H$J$N$G!"Be$o$j$KEj9FCW$7$^$9!#(B
                _
--<IIII>--   _ | |
  --<IIII>--| |TTT     $BKv9-(B $B8,Fs!JKv9-!w#C!u#C8&5f=j!%#N#E#C!K(B
            TTT                         suehiro@csl.cl.nec.co.jp

$B!]!]!]!]!]!]!]!]!]!]!]!]!]!]!]$3$3$+$i!]!]!]!]!]!]!]!]!]!]!]!]!]!]!](B
I write:
>>$B%U%C%/$r0z$C3]$1$F$"$2$l$P$h$$$N$G$O!)(B

In article <SUEHIRO.95Feb3203445@csls21.csl.cl.nec.co.jp>,
 suehiro@csl.cl.nec.co.jp (SUEHIRO Kenji) writes:
>$B$b$&>/$76qBNE*$K@bL@$7$F$$$?$@$1$J$$$G$7$g$&$+!#(B

  $B$3$s$J$b$N$G$O$$$+$,$G$7$g$&$+!)(B

|;; Copyright (C) 1995 iida@secom-sis.co.jp
|
|;; This program is free software; you can redistribute it and/or modify
|;; it under the terms of the GNU General Public License as published by
|;; the Free Software Foundation; either version 2, or (at your option)
|;; any later version.
|
|;; This program is distributed in the hope that it will be useful,
|;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
|;; GNU General Public License for more details.
|
|;; If you do not have a copy of the GNU General Public License, send an
|;; E-mail to  iida@secom-sis.co.jp  or write to the Free Software
|;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|(defun main ()
|  "Call  sub1, then run  sub2-hook, and finally call  sub3.
|sub2-hook  may be nil or unbound and it defaults to  default-sub2-hook."
|  (sub1)
|  (run-hooks (if (and (boundp 'sub2-hook)
|      sub2-hook)
| 'sub2-hook
|       'default-sub2-hook))
|  (sub3))
|(defun sub1 ()
|  (insert "sub1 "))
|(defun sub3 ()
|  (insert "sub3 "))
|(defun sub2 ()
|  (insert "sub2 "))
|(defconst default-sub2-hook
|  'sub2 "Default hook for  sub2-hook.")

  *scratch* $B%P%C%U%!!<$G;n$7$F$_$^$7$?!#(B

------ Buffer: *scratch* ------
(setq sub2-hook '(lambda () (insert "foobar ")))
(lambda nil (insert "foobar "))
(main)
sub1 foobar sub3 nil

(setq sub2-hook nil)
nil
(main)
sub1 sub2 sub3 nil

(makunbound 'sub2-hook)
sub2-hook
(main)
sub1 sub2 sub3 nil
------ Buffer: *scratch* ------

  $B$3$l$,$"$J$?$N$*Lr$KN)$D$J$i9,$$$G$9!#(B

-- 
# GNU's Not UNIX.  UNG's Not GNU.  IIDA, Yosiaki the Epigonen of RMS.
# IIDA, Yosiaki                          E-mail: iida@secom-sis.co.jp
# SECOM zyouhou sisutemu kabusiki gaisya                    vvvv
# 141 Toukyou-to Sinagawa-ku Nisigotanda  phone: +81-3(5434)6444
# 2-30-4 BR-Gotanda-Bldg,  JAPAN            FAX: +81-3(5434)6453
