[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: defconst in lao.el
From: |
Luc Teirlinck |
Subject: |
Re: defconst in lao.el |
Date: |
Wed, 17 Nov 2004 08:26:46 -0600 (CST) |
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
============================================================