Article View: fj.editor.mule
Article #420Re: Private template of HTML-HELPER-MODE
From: Toshio HORI
Date: Fri, 26 Nov 1999 00:00
Date: Fri, 26 Nov 1999 00:00
73 lines
4413 bytes
4413 bytes
In article <383E8492.614B@shiratori.riec.tohoku.ac.jp>, Atsushi Totsuka <totsuka@shiratori.riec.tohoku.ac.jp> writes: > setqでいいと思います…で終わるのもアレなので:p 堀の設定を載せてみます。 totsuka> .elファイルではdefvarを使っていました.defvarとsetqの違いは何 totsuka> なのでしょうか? (setq xxx yyy) は(大域)変数xxxに式yyyの評価値を(強制的に)設定します。 (defvar xxx yyy) は(大域)変数xxxに式yyyの評価値を設定しますが、この式 を評価する時点で既に変数xxxに何らかの値が設定されている場合には式yyyは 評価されず、xxxの値は変化しません。 ということで、.emacsなどで変数の設定をするのは、通常、systemに用意され ている *.el などでdefvarされている変数のdefault値を自分用に設定しなお すのが主な目的でしょうから、その際にはsetqすればいいわけです。 > (setq html-helper-new-buffer-template > '(html-helper-htmldtd-version > "<html> <head>\n" > "<title>" p "</title>\n" > 新しくHTML fileを作成すると、"<title>" p "</title>\n" の p の位置に > cursorが来ます。 totsuka> これができません.ファイルの先頭にカーソルが出ます.この"p"の totsuka> 動作を記述する部分が.elファイルの中に見つかりませんでした. "p"の意味(「そこにcursorが行く」)は堀の誤認かもしれません。"p"の動作に ついては html-helper-mode.el と一緒に使っている(はずの) tempo.el の中 に書かれていました。 -----<tempo.elより抜粋:はじまり>----- ;;; tempo.el --- Flexible template insertion ;; Copyright (C) 1994 Free Software Foundation, Inc. ;; Author: David K}gedal <davidk@lysator.liu.se > ;; Created: 16 Feb 1994 ;; Version: 1.2.2 ;; Keywords: extensions, languages, tools ;; $Revision: 1.32 $ [中略] ;; ;; tempo-define-template (defun tempo-define-template (name elements &optional tag documentation taglist) "Define a template. This function creates a template variable `tempo-template-NAME' and an interactive function `tempo-template-NAME' that inserts the template at the point. The created function is returned. NAME is a string that contains the name of the template, ELEMENTS is a list of elements in the template, TAG is the tag used for completion, DOCUMENTATION is the documentation string for the insertion command created, and TAGLIST (a symbol) is the tag list that TAG (if provided) should be added to). If TAGLIST is nil and TAG is non-nil, TAG is added to `tempo-tags' The elements in ELEMENTS can be of several types: - A string. It is sent to the hooks in `tempo-insert-string-functions', and the result is inserted. - The symbol 'p. This position is saved in `tempo-marks'. [以下略] -----<tempo.elより抜粋:おわり>----- totsuka> ○defvarとsetqの差異 totsuka> ○開始時に<title>と</title>の間にカーソルを出したい totsuka> ○html-helper-new-buffer-templateの中の"p"の機能ははどのよう totsuka> な構造になっているのか totsuka> が残りました.ご存知の方お願いします. …ということで(第二の質問には答えてませんが;-)よろしいでしょうか? ---ほり。
Technical Details
Message-ID:
<19991127000526P.toshi@stockton.etl.go.jp>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<383D1AB7.7A2B@shiratori.riec.tohoku.ac.jp> <w03dtusr8e.fsf@tsl.pe.u-tokyo.ac.jp> <19991125232213G.toshi@stockton.etl.go.jp> <383E8492.614B@shiratori.riec.tohoku.ac.jp>Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS X-Google-Thread: 10eba4,32d85b05c2960e7e X-Google-Attributes: gid10eba4,public From: Toshio HORI <toshi@etl.go.jp> Subject: Re: Private template of HTML-HELPER-MODE Date: 1999/11/26 Message-ID: <19991127000526P.toshi@stockton.etl.go.jp> X-Deja-AN: 553322660 X-PGP-Publickey: http://www.etl.go.jp/~toshi/misc/toshi.asc Content-Transfer-Encoding: 7bit References: <383D1AB7.7A2B@shiratori.riec.tohoku.ac.jp> <w03dtusr8e.fsf@tsl.pe.u-tokyo.ac.jp> <19991125232213G.toshi@stockton.etl.go.jp> <383E8492.614B@shiratori.riec.tohoku.ac.jp> Content-Type: Text/Plain; charset=iso-2022-jp X-Dispatcher: imput version 991025(IM133) X-Fingerprint: F6 39 15 C8 2D D2 83 D2 20 25 EF 25 AA 6F E0 6B X-Complaints-To: usenet@news-server.etl.go.jp X-Trace: ecce10-1.etl.go.jp 943628701 1603 192.31.204.150 (26 Nov 1999 15:05:01 GMT) Organization: Electrotechnical Laboratory, AIST, MITI. X-URL: http://www.etl.go.jp/~toshi/ Mime-Version: 1.0 NNTP-Posting-Date: 26 Nov 1999 15:05:01 GMT Newsgroups: fj.editor.mule