🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.editor.mule
Article #224

Re: 括弧の対応は?

#224
From: KGK == Keiji KOSAKA
Date: Sat, 02 Mar 2002 10:25
21 lines
2263 bytes
! "<a5q0ts$8c8$1@news00.iij4u.or.jp>" という記事で
!     02 Mar 2002 17:02:12 +0900 頃に FURUKI Kenichi さん は言ったとさ:

> vi で % を入力すると対応する括弧にカーソルが移動しますが、emacs
> でこれに相当する機能はありますか?

昔、fj.editor.emacsで見て真似したんだと思いますが、
(defun match-paren (arg)
  "Go to the matching parenthesis if on parenthesis otherwise insert %."
  (interactive "p")
  (cond ((looking-at "[([{]") (forward-sexp 1) (backward-char))
        ((looking-at "[])}]") (forward-char) (backward-sexp 1))
        (t (self-insert-command (or arg 1)))))
(global-set-key "%" 'match-paren)
なんてのを .emacs に書いてます。
-- 
KGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGK
KGK  KGK (life name: Keiji KOSAKA), Dept. of Phys., Okayama Univ.         KGK
KGK kgk@film.rlss.okayama-u.ac.jp  http://film.rlss.okayama-u.ac.jp/~kgk/ KGK
KGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGKGK
# mule 2.3 @ 19.34.1 でのお話。
Technical Details
Message-ID: <a5q9b4$nlg$5@film.rlss.okayama-u.ac.jp>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!news.yamada.gr.jp!news.aquilax.co.jp!rlss-news!not-for-mail
References: <tUWe8.275$de.38718@news1.rdc1.ky.home.ne.jp> <c810727f.0202271233.2735bd20@posting.google.com> <a5q0ts$8c8$1@news00.iij4u.or.jp>

Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS
X-Google-Thread: 10eba4,f46795973fc116d1
X-Google-Attributes: gid10eba4,public
X-Google-ArrivalTime: 2002-03-02 02:25:47 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!news.yamada.gr.jp!news.aquilax.co.jp!rlss-news!not-for-mail
From: KGK == Keiji KOSAKA <kgk@mp.okayama-u.ac.jp>
Newsgroups: fj.editor.mule
Subject: Re: 括弧の対応は?
Date: 02 Mar 2002 19:25:38 +0900
Organization: Research Labo. of Surf. Sci., Okayama Univ.
Lines: 21
Message-ID: <a5q9b4$nlg$5@film.rlss.okayama-u.ac.jp>
References: <tUWe8.275$de.38718@news1.rdc1.ky.home.ne.jp> <c810727f.0202271233.2735bd20@posting.google.com> <a5q0ts$8c8$1@news00.iij4u.or.jp>
NNTP-Posting-Host: film.rlss.okayama-u.ac.jp
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: text/plain; charset=ISO-2022-JP
X-Trace: film.rlss.okayama-u.ac.jp 1015064740 24240 150.46.60.155 (2 Mar 2002 10:25:40 GMT)
X-Complaints-To: usenet@film.rlss.okayama-u.ac.jp
NNTP-Posting-Date: 2 Mar 2002 10:25:40 GMT
X-Nsubject: Re: $B3g8L$NBP1~$O!)(B
X-Newsreader: Gnus v5.4.61/Emacs 19.34