🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

5 total messages Started by Atsushi Totsuka Thu, 25 Nov 1999 00:00
Private template of HTML-HELPER-MODE
#416
Author: Atsushi Totsuka
Date: Thu, 25 Nov 1999 00:00
16 lines
1388 bytes
MuleでHTML-HELPER-MODEを使っています.このモードの機能に「あらかじめ
html-helper-mode.elファイルに書いておいたテンプレートを自動的に挿入する
」というものがありますが,私の利用するシステムはこのファイルが

/usr/local/gnu/lib/mule/site-lisp

にあってカスタマイズできないため,新しいhtmlファイルを開く時に自分のテン
プレートを挿入できません.

~/.emacsを書き換えるか,.elファイルをホームディレクトリにコピーなどすれ
ば可能なのでしょうか?
-- 
東北大学工学部 電気通信研究所 白鳥研究室
戸塚  厚  Atsushi Totsuka / mailto:totsuka@shiratori.riec.tohoku.ac.jp
Shiratori Laboratory, Research Institute of Electrical Communication,
Tohoku University, Sendai, 980-8577 Japan
Re: Private template of HTML-HELPER-MODE
#417
Author: NAKAI Tetsushi
Date: Thu, 25 Nov 1999 00:00
23 lines
1846 bytes
中井@東大精密です.

>>>>> 時刻 Thu, 25 Nov 1999 11:17:11 GMTに
       Atsushi Totsuka <totsuka@shiratori.riec.tohoku.ac.jp> さんは言いました。

> MuleでHTML-HELPER-MODEを使っています.このモードの機能に「あらかじめ

> にあってカスタマイズできないため,新しいhtmlファイルを開く時に自分のテン
> プレートを挿入できません.

> ~/.emacsを書き換えるか,.elファイルをホームディレクトリにコピーなどすれ
> ば可能なのでしょうか?

.emacs の中で,
(setq-default html-helper-new-buffer-template 
        '("template"))

でカスタマイズできると思います.
--
Tetsushi Nakai               E-MAIL:Mr.nakai@tsl.pe.u-tokyo.ac.jp
Sasaki Lab, Dept. of Precision Engineering, The University of Tokyo
------------------------------------------------------------------
P.S. My E-mail address adds Mr. for the reason of SPAMer
Re: Private template of HTML-HELPER-MODE
#418
Author: Toshio HORI
Date: Thu, 25 Nov 1999 00:00
31 lines
2154 bytes
In article <w03dtusr8e.fsf@tsl.pe.u-tokyo.ac.jp>,
	NAKAI Tetsushi <nakai@tsl.pe.u-tokyo.ac.jp> writes:
> ~/.emacsを書き換えるか,.elファイルをホームディレクトリにコピーなどすれ
> ば可能なのでしょうか?
nakai> .emacs の中で,
nakai> (setq-default html-helper-new-buffer-template 
nakai>         '("template"))
nakai> でカスタマイズできると思います.

setqでいいと思います…で終わるのもアレなので:p 堀の設定を載せてみます。

(setq html-helper-new-buffer-template
      '(html-helper-htmldtd-version
	"<html> <head>\n"
	"<title>" p "</title>\n"
	"<link rev=\"made\" href=\"mailto:toshi@etl.go.jp\">\n"
	"<meta http-equiv=\"Content-Type\" content=\"text-html; "
	"charset=ISO-2022-JP\">\n</head>\n\n"
	"<body bgcolor=\"ffffff\" text=\"#000000\" link=\"#ff0000\""
	" vlink=\"#0000ff\" alink=\"#00ff00\">\n"
	"<h1 align=center></h1>\n\n"
	html-helper-timestamp-start html-helper-timestamp-end
	"\n"
	"\n\n<hr>\n"
	"<address>" html-helper-address-string "</address>\n"
	"</body> </html>\n"))

新しくHTML fileを作成すると、"<title>" p "</title>\n" の p の位置に
cursorが来ます。

---ほり。
Re: Private template of HTML-HELPER-MODE
#419
Author: Atsushi Totsuka
Date: Fri, 26 Nov 1999 00:00
36 lines
2191 bytes
元記事の戸塚です..emacsを書き換えてカスタマイズを成功させました.ご教授
ありがとうございます.

Toshio HORI wrote:

> In article <w03dtusr8e.fsf@tsl.pe.u-tokyo.ac.jp>,
>         NAKAI Tetsushi <nakai@tsl.pe.u-tokyo.ac.jp> writes:

> setqでいいと思います…で終わるのもアレなので:p 堀の設定を載せてみます。

.elファイルではdefvarを使っていました.defvarと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が来ます。

これができません.ファイルの先頭にカーソルが出ます.この"p"の動作を記述
する部分が.elファイルの中に見つかりませんでした.

以上,課題として

○defvarとsetqの差異
○開始時に<title>と</title>の間にカーソルを出したい
○html-helper-new-buffer-templateの中の"p"の機能ははどのような構造になっ
ているのか

が残りました.ご存知の方お願いします.
-- 
東北大学工学部 電気通信研究所 白鳥研究室
戸塚  厚  Atsushi Totsuka / mailto:totsuka@shiratori.riec.tohoku.ac.jp
Shiratori Laboratory, Research Institute of Electrical Communication,
Tohoku University, Sendai, 980-8577 Japan
Re: Private template of HTML-HELPER-MODE
#420
Author: Toshio HORI
Date: Fri, 26 Nov 1999 00:00
73 lines
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> が残りました.ご存知の方お願いします.

…ということで(第二の質問には答えてませんが;-)よろしいでしょうか?

---ほり。
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads