From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: defconst in lao.el Date: Wed, 17 Nov 2004 08:26:46 -0600 (CST) Message-ID: <200411171426.iAHEQk320975@raven.dms.auburn.edu> References: <200411141856.iAEIuEM24284@raven.dms.auburn.edu><200411170141.KAA24828 @etlken.m17n.org> <200411170301.iAH31kc20206@raven.dms.auburn.edu> <63300.217.194.34.123.1100673566.squirrel@wwws.franken.de> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1100701689 29572 80.91.229.6 (17 Nov 2004 14:28:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 17 Nov 2004 14:28:09 +0000 (UTC) Cc: handa@m17n.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 17 15:27:57 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CUQmr-0000qC-00 for ; Wed, 17 Nov 2004 15:27:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CUQve-0006H4-Uo for ged-emacs-devel@m.gmane.org; Wed, 17 Nov 2004 09:37:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CUQvX-0006Gp-TG for emacs-devel@gnu.org; Wed, 17 Nov 2004 09:36:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CUQvX-0006Gd-F3 for emacs-devel@gnu.org; Wed, 17 Nov 2004 09:36:55 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CUQvX-0006Ga-BR for emacs-devel@gnu.org; Wed, 17 Nov 2004 09:36:55 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CUQmc-0001fZ-Ru for emacs-devel@gnu.org; Wed, 17 Nov 2004 09:27:43 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id iAHEReFu004916; Wed, 17 Nov 2004 08:27:40 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id iAHEQk320975; Wed, 17 Nov 2004 08:26:46 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: stahl@eos.franken.de In-reply-to: <63300.217.194.34.123.1100673566.squirrel@wwws.franken.de> (stahl@eos.franken.de) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:29973 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29973 Stephan Stahl wrote: Wouldn't it be better to include this comment as lao-key-alist's doc-string or maybe even make it a defcustom with an :set that calls lao-initialize-alists ? I think this would make it harder to miss the fact that lao-initialize-alists has to be called. If I understand correctly, the probability that somebody might want to customize `lao-key-alist' is just big enough not to remove the possibility of doing so by using defconst. On the other hand, it might not be worth a defcustom. It might not be worth an autoload either, as my original patch does. Somebody wanting to change `lao-key-alists' would probably have to read the source code anyway as it stands. Maybe somebody more familiar with lao.el than me might want to write a proper docstring including the comment. Also, with my original patch, there is the (small) problem that `lao-initialize-alists' needlessly gets called twice if lao.el is already loaded. Maybe the following smaller patch is actually better. Asking people to re-load a file instead of calling a function is somewhat unusual, but the situation may occur seldom enough that this does not really matter too much in this case. ===File ~/lao-newdiff======================================= diff -c /home/teirllm/emacscvsdir/emacs/leim/quail/lao.el.\~1.8.\~ /home/teirllm/emacscvsdir/emacs/leim/quail/lao-alt.el *** /home/teirllm/emacscvsdir/emacs/leim/quail/lao.el.~1.8.~ Mon Sep 1 16:08:19 2003 --- /home/teirllm/emacscvsdir/emacs/leim/quail/lao-alt.el Wed Nov 17 07:57:56 2004 *************** *** 2,7 **** --- 2,8 ---- ;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. + ;; Copyright (C) 2004 Free Software Foundation. ;; Keywords: multilingual, input method, Lao *************** *** 42,48 **** (compose-string (quail-lookup-map-and-concat quail-current-key)))) control-flag) ! (defconst lao-key-alist '(("!" . "1") ("\"" . "=") ("#" . "3") --- 43,53 ---- (compose-string (quail-lookup-map-and-concat quail-current-key)))) control-flag) ! ;; If you change the value of this variable, be sure to execute ! ;; `(when (featurep 'lao) (load "lao"))' afterward. If lao is already ! ;; loaded, it needs to be re-loaded to properly re-initialize related ! ;; alists. ! (defvar lao-key-alist '(("!" . "1") ("\"" . "=") ("#" . "3") *************** *** 148,159 **** ("\\9" . "(1y(B") )) ! (defconst lao-consonant-key-alist nil) ! (defconst lao-semivowel-key-alist nil) ! (defconst lao-vowel-key-alist nil) ! (defconst lao-voweltone-key-alist nil) ! (defconst lao-tone-key-alist nil) ! (defconst lao-other-key-alist nil) (let ((tail lao-key-alist) elt phonetic-type) --- 153,172 ---- ("\\9" . "(1y(B") )) ! (defvar lao-consonant-key-alist nil) ! (defvar lao-semivowel-key-alist nil) ! (defvar lao-vowel-key-alist nil) ! (defvar lao-voweltone-key-alist nil) ! (defvar lao-tone-key-alist nil) ! (defvar lao-other-key-alist nil) ! ! ;; These need to be re-initialized if lao is re-loaded. ! (setq lao-consonant-key-alist nil ! lao-semivowel-key-alist nil ! lao-vowel-key-alist nil ! lao-voweltone-key-alist nil ! lao-tone-key-alist nil ! lao-other-key-alist nil) (let ((tail lao-key-alist) elt phonetic-type) *************** *** 197,201 **** --- 210,216 ---- (v-state (lao-vowel-key-alist . t-state)) (t-state lao-tone-key-alist)))) + (provide 'lao) + ;;; arch-tag: 23863a30-a8bf-402c-b7ce-c517a7aa8570 ;;; lao.el ends here Diff finished. Wed Nov 17 07:58:47 2004 ============================================================