From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: how to completely redefine effects of define-derived-mode Date: Sat, 22 Nov 2008 06:47:07 -0800 (PST) Organization: http://groups.google.com Message-ID: <7f3fd105-c8b2-439f-8d33-43ca63ea3f7f@t26g2000prh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1227368664 3339 80.91.229.12 (22 Nov 2008 15:44:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Nov 2008 15:44:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 22 16:45:26 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L3ufh-0005SI-Oe for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Nov 2008 16:45:21 +0100 Original-Received: from localhost ([127.0.0.1]:59374 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3ueY-0005Dd-Cb for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Nov 2008 10:44:10 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!postnews.google.com!t26g2000prh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs,comp.lang.lisp Original-Lines: 42 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1227365227 9324 127.0.0.1 (22 Nov 2008 14:47:07 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 22 Nov 2008 14:47:07 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t26g2000prh.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.26.2 (KHTML, like Gecko) Version/3.2 Safari/525.26.12, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:164686 comp.emacs:97380 comp.lang.lisp:255987 X-Mailman-Approved-At: Sat, 22 Nov 2008 10:43:35 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60022 Archived-At: i'm experimenting and learing the use of define-derived-mode to define various styled comment syntax, and i don't want to restart emacs each time. Is there a way to do it? for example, i evaluate: (define-derived-mode xx-mode fundamental-mode "xx" "xx-mode does this and that." ;; bash style comment: =E2=80=9C# ...=E2=80=9D (modify-syntax-entry ?# "< b" xx-mode-syntax-table) (modify-syntax-entry ?\n "> b" xx-mode-syntax-table) ;; ;; c style comment =E2=80=9C// comment=E2=80=9D ;; (modify-syntax-entry ?\/ ". 12b" xx-mode-syntax-table) ;; (modify-syntax-entry ?\n "> b" xx-mode-syntax-table) ) and after i tested it, i want to comment out the perl styled syntax entry i made, and try a different style such as =E2=80=9C// ...=E2=80=9D or= =E2=80=9C/* ... */=E2=80=9D or =E2=80=9C(* ... *)=E2=80=9D style. However, it won't work because the char =E2=80=9C#=E2=80=9D already got a d= efined as comment start. (it won't go away unless i explicitly redefine that char. To redefine them is somewhat more work than restarting emacs) I tried to add (unintern xx-mode-syntax-table) before the define- derived-mode, and eval the buffer again, but that doesn't work. I also tried (setq xx-mode-syntax-table nil) that also didn't work. I tried (setq xx-mode nil) in the beginning but that didn't work neither. is there a way that i can re-eval this and try different settings of syntax table? (as opposed to restarting emacs each time) Xah =E2=88=91 http://xahlee.org/ =E2=98=84