🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.comp.os.linux
Article #10656

comment-dwim命令,爽!!

#10656
From: It's me FKtPp ;)
Date: Sun, 29 Jun 2003 02:14
35 lines
3025 bytes
һֱ�����������ƣ�ΪɶEmacs��Ĭ�ϼ��̰�����û��comment-region��
uncomment-region�Ķ��壬ֱ����һ�����������з����������ǿ����
comment-dwim��ʵ����̫�������䡫����˵��������ϵͳ����ν�����������
�ɣ�
--8<---------------cut here---------------start------------->8---
comment-dwim is an interactive compiled Lisp function in `newcomment'.
(comment-dwim ARG)

Call the comment command you want (Do What I Mean).
If the region is active and `transient-mark-mode' is on, call
  `comment-region' (unless it only consists of comments, in which
  case it calls `uncomment-region').
Else, if the current line is empty, insert a comment and indent it.
Else if a prefix ARG is specified, call `comment-kill'.
Else, call `comment-indent'.
--8<---------------cut here---------------end--------------->8---
comment-dwim �Ǹ��ɽ�������������`newcomment'��Lisp����ӿ�Ϊ
(comment-dwim ARG)

��������Ҫ��ע��������ҵ���˼������

�����ǰѡ�����Ǽ���Ķ���`transient-mark-mode'ģʽ�ǿ����ģ��͵���
`comment-region'�������ǰѡ�����������ע�͹��ɣ���������¾ͻ��
��`uncomment-region'����
�����ǰ��Ϊ�գ�����ע�ͷ�ţ������ʵ�����
�������յ�һ���������`comment-kill'��
�����򣬵���`comment-indent'��

BTW����һ��ı༭ģʽ�£����ǻ���text-mode��ģʽ��������������
M-;���档�� ;P

-- 
Soap and education are not as sudden as a massacre, but they are more
deadly in the long run.
		-- Mark Twain
Technical Details
Message-ID: <868yrl8wb5.fsf@yahoo.com.cn>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: 10b277,838c13d6c0c1beb4,start
X-Google-Attributes: gid10b277,public
X-Google-ArrivalTime: 2003-06-28 19:52:45 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!not-for-mail
From: "It's me FKtPp ;)" <m_pupil@yahoo.com.cn>
Newsgroups: cn.comp.os.linux
Subject: comment-dwim命令,爽!!
Date: Sun, 29 Jun 2003 10:14:06 +0800
Organization: Bentium Ltd. (CN99)
Lines: 35
Message-ID: <868yrl8wb5.fsf@yahoo.com.cn>
NNTP-Posting-Host: 218.11.79.70
Mime-Version: 1.0
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: 8bit
X-Trace: mail.cn99.com 1056855158 41277 218.11.79.70 (29 Jun 2003 02:52:38 GMT)
X-Complaints-To: usenet@news.cn99.com
NNTP-Posting-Date: Sun, 29 Jun 2003 02:52:38 +0000 (UTC)
User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)