「エディタから本サイトを検索」の版間の差分
細編集の要約なし |
細 (→xyzzy から検索) |
||
| 51行目: | 51行目: | ||
==xyzzy から検索== | ==xyzzy から検索== | ||
こちら http://sonic64.com/2005-09-06.html を参考に作り変えました。 | |||
下記を保存して .xyzzy ファイルに追加。 | 下記を保存して .xyzzy ファイルに追加。 | ||
| 58行目: | 58行目: | ||
<pre class="brush:autolisp;"> | <pre class="brush:autolisp;"> | ||
; GizmoLabsWiki を検索 | ; GizmoLabsWiki を検索 | ||
(defun search- | (defun search-gzwiki (&optional str) | ||
(interactive) | (interactive) | ||
(unless str | (unless str | ||
| 84行目: | 84行目: | ||
</pre> | </pre> | ||
* xyzzy の右クリックメニューに「Google で検索」を追加するには下記も追加 | |||
<pre class="brush:autolisp;">; | <pre class="brush:autolisp;"> | ||
; 右クリックメニューに「選択文字をGizmoLabs Wikiで検索」を追加 | |||
(add-hook '*post-startup-hook* | (add-hook '*post-startup-hook* | ||
#'(lambda() | #'(lambda() | ||
(add-menu-item *app-popup-menu* nil "選択文字をGizmoLabs Wikiで検索 (&G)" | (add-menu-item *app-popup-menu* nil "選択文字をGizmoLabs Wikiで検索 (&G)" | ||
'search- | 'search-gzwiki-selection nil))) | ||
</pre> | </pre> | ||
2013年5月8日 (水) 17:08時点における版
秀丸から検索
秀丸エディタからの検索は下記のマクロを登録して使うといいかも。
//gzwiki.mac
//by gizmon
//2012.02.06
//
//範囲選択している文字列、カーソル位置にある単語、または任意の
//文字列を入力して gizmolabs wiki をブラウザ検索をします。
//Hidemernet Explorer をインストールしているときは秀丸エディタ
//上に検索結果を出すこともできます。
//以下設定
#fHmnetex = false; //Hidemernet Explorerを使う場合true
//以上設定
if( selecting ) {
$s = gettext(seltopx,seltopy,selendx,selendy);
} else {
selectword;
$s = gettext(seltopx,seltopy,selendx,selendy);
$s = input( "GizmoLabsWiki検索", $s );
}
if( $s == "" ) {
endmacro;
}
$param = "";
if( #fHmnetex ) {
$percent = "%";
$and = "&";
} else {
$percent = "^%%";
$and = "^&";
}
#c = strlen( $s );
#i = 0;
while( #i < #c ) {
$param = $param + $percent +
leftstr( hex( ascii( midstr( $s, #i, 1 ) ) ), 2 );
#i = #i + 1;
}
$param = "http://wiki.gz-labs.net/index.php?search=" + $param ;
if( #fHmnetex ) {
openfile $param;
} else {
run getenv("Comspec") + " /c start " + $param + " >nul";
}
endmacro;
xyzzy から検索
こちら http://sonic64.com/2005-09-06.html を参考に作り変えました。
下記を保存して .xyzzy ファイルに追加。 文字列を選択して、CTRL + C g を押す。
; GizmoLabsWiki を検索
(defun search-gzwiki (&optional str)
(interactive)
(unless str
(setq str (read-string "GizmoLabs Wiki: ")))
(long-operation
(let ((url (concat "http://wiki.gz-labs.net/index.php?search="
(si:www-url-encode str))))
;─────────────────────
; 1. 標準ブラウザを使う場合
(shell-execute url t)
; 2. browser.dll & browserex.l を使う場合
;(bx::navigate url)
; 3. www-mode を使う場合
;(www-open-url url)
;─────────────────────
)))
; セレクションの文字列を検索
(defun search-gzwiki-selection ()
(interactive)
(search-gzwiki (if (pre-selection-p)
(selection-start-end (beg end)
(buffer-substring beg end))
nil)))
(global-set-key '(#\C-c #\g) 'search-gzwiki-selection)
- xyzzy の右クリックメニューに「Google で検索」を追加するには下記も追加
; 右クリックメニューに「選択文字をGizmoLabs Wikiで検索」を追加
(add-hook '*post-startup-hook*
#'(lambda()
(add-menu-item *app-popup-menu* nil "選択文字をGizmoLabs Wikiで検索 (&G)"
'search-gzwiki-selection nil)))