Mercurial > emacs
view lisp/international/ja-dic-utl.el @ 110523:a5ad4f188e19
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 18 Sep 2010 22:49:54 -0400 |
parents | 1d1d5d9bd884 |
children | 376148b31b5e |
line wrap: on
line source
;;; ja-dic-utl.el --- utilities for handling Japanese dictionary (SKK-JISYO.L) ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H14PRO021 ;; Keywords: i18n, mule, multilingual, Japanese ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: ;; This file provides a generic function to look up a Japanese ;; dictionary of SKK format. ;; ;; SKK is a free Japanese input method running on Mule created by ;; Masahiko Sato <masahiko@sato.riec.tohoku.ac.jp>. The Emacs Lisp ;; library kkc.el provides a facility to convert a Japanese kana ;; string to a kanji-kana-mixed string by using SKK's dictionary. ;; ;; The original SKK dictionary SKK-JISYO.L is converted to ja-dic.el ;; by ja-dic-cnv.el. We get entries of the dictionary in four ;; variables (listed below) by loading that file (or byte-compiled ;; version ja-dic.elc). ;;; Code: ;; The following four variables are set by loading ja-dic.el[c]. (defvar skkdic-okuri-ari nil "Nested alist for OKURI-ARI entries of SKK dictionary.") (defvar skkdic-postfix nil "Nested alist for SETSUBIJI (postfix) entries of SKK dictionary.") (defvar skkdic-prefix nil "Nested alist SETTOUJI (prefix) entries of SKK dictionary.") (defvar skkdic-okuri-nasi nil "Nested alist for OKURI-NASI entries of SKK dictionary.") (defconst skkdic-okurigana-table '((?$B$!(B . ?a) (?$B$"(B . ?a) (?$B$#(B . ?i) (?$B$$(B . ?i) (?$B$%(B . ?u) (?$B$&(B . ?u) (?$B$'(B . ?e) (?$B$((B . ?e) (?$B$)(B . ?o) (?$B$*(B . ?o) (?$B$+(B . ?k) (?$B$,(B . ?g) (?$B$-(B . ?k) (?$B$.(B . ?g) (?$B$/(B . ?k) (?$B$0(B . ?g) (?$B$1(B . ?k) (?$B$2(B . ?g) (?$B$3(B . ?k) (?$B$4(B . ?g) (?$B$5(B . ?s) (?$B$6(B . ?z) (?$B$7(B . ?s) (?$B$8(B . ?j) (?$B$9(B . ?s) (?$B$:(B . ?z) (?$B$;(B . ?s) (?$B$<(B . ?z) (?$B$=(B . ?s) (?$B$>(B . ?z) (?$B$?(B . ?t) (?$B$@(B . ?d) (?$B$A(B . ?t) (?$B$B(B . ?d) (?$B$C(B . ?t) (?$B$D(B . ?t) (?$B$E(B . ?d) (?$B$F(B . ?t) (?$B$G(B . ?d) (?$B$H(B . ?t) (?$B$I(B . ?d) (?$B$J(B . ?n) (?$B$K(B . ?n) (?$B$L(B . ?n) (?$B$M(B . ?n) (?$B$N(B . ?n) (?$B$O(B . ?h) (?$B$P(B . ?b) (?$B$Q(B . ?p) (?$B$R(B . ?h) (?$B$S(B . ?b) (?$B$T(B . ?p) (?$B$U(B . ?h) (?$B$V(B . ?b) (?$B$W(B . ?p) (?$B$X(B . ?h) (?$B$Y(B . ?b) (?$B$Z(B . ?p) (?$B$[(B . ?h) (?$B$\(B . ?b) (?$B$](B . ?p) (?$B$^(B . ?m) (?$B$_(B . ?m) (?$B$`(B . ?m) (?$B$a(B . ?m) (?$B$b(B . ?m) (?$B$c(B . ?y) (?$B$d(B . ?y) (?$B$e(B . ?y) (?$B$f(B . ?y) (?$B$g(B . ?y) (?$B$h(B . ?y) (?$B$i(B . ?r) (?$B$j(B . ?r) (?$B$k(B . ?r) (?$B$l(B . ?r) (?$B$m(B . ?r) (?$B$o(B . ?w) (?$B$p(B . ?w) (?$B$q(B . ?w) (?$B$r(B . ?w) (?$B$s(B . ?n) ) "Alist of Okuriganas vs trailing ASCII letters in OKURI-ARI entry.") (defun skkdic-merge-head-and-tail (heads tails postfix) (let ((min-len 2) l) (while heads (if (or (not postfix) (>= (length (car heads)) min-len)) (let ((tail tails)) (while tail (if (or postfix (>= (length (car tail)) min-len)) (setq l (cons (concat (car heads) (car tail)) l))) (setq tail (cdr tail))))) (setq heads (cdr heads))) l)) (defconst skkdic-jisx0208-hiragana-block (cons (decode-char 'japanese-jisx0208 #x2421) (decode-char 'japanese-jisx0208 #x247E))) (defun skkdic-lookup-key (seq len &optional postfix prefer-noun) "Return a list of conversion string for sequence SEQ of length LEN. SEQ is a vector of Kana characters to be converted by SKK dictionary. If LEN is shorter than the length of KEYSEQ, the first LEN keys in SEQ are took into account. Optional 3rd arg POSTFIX non-nil means SETSUBIJI (postfix) are also considered to find conversion strings. Optional 4th arg PREFER-NOUN non-nil means that the conversions without okurigana are placed at the head of the returned list." (or skkdic-okuri-nasi (condition-case err (load-library "ja-dic/ja-dic") (error (ding) (with-output-to-temp-buffer "*Help*" (princ "The library `ja-dic' can't be loaded. The most common case is that you have not yet installed the library included in LEIM (Libraries of Emacs Input Method) which is distributed separately from Emacs. LEIM is available from the same ftp directory as Emacs.")) (signal (car err) (cdr err))))) (let ((vec (make-vector len 0)) (i 0) entry) ;; At first, generate vector VEC from SEQ for looking up SKK ;; alists. Nth element in VEC corresponds to Nth element in SEQ. ;; The values are decided as follows. ;; If SEQ[N] is `$B!<(B', VEC[N] is 0, ;; else if SEQ[N] is a Hiragana character, VEC[N] is: ;; ((The 2nd position code of SEQ[N]) - 32), ;; else VEC[N] is 128. (while (< i len) (let ((ch (aref seq i)) code) (cond ((= ch ?$B!<(B) (aset vec i 0)) ((and (>= ch (car skkdic-jisx0208-hiragana-block)) (<= ch (cdr skkdic-jisx0208-hiragana-block))) (setq code (encode-char ch 'japanese-jisx0208)) (if code (aset vec i (- (logand code #xFF) 32)) (aset vec i 128))) (t (aset vec i 128)))) (setq i (1+ i))) ;; Search OKURI-NASI entries. (setq entry (lookup-nested-alist vec skkdic-okuri-nasi len 0 t)) (if (consp (car entry)) (setq entry (copy-sequence (car entry))) (setq entry nil)) (if postfix ;; Search OKURI-NASI entries with postfixes. (let ((break (max (- len (car skkdic-postfix)) 1)) entry-head entry-postfix entry2) (while (< break len) (if (and (setq entry-head (lookup-nested-alist vec skkdic-okuri-nasi break 0 t)) (consp (car entry-head)) (setq entry-postfix (lookup-nested-alist vec skkdic-postfix len break t)) (consp (car entry-postfix)) (setq entry2 (skkdic-merge-head-and-tail (car entry-head) (car entry-postfix) t))) (if entry (nconc entry entry2) (setq entry entry2))) (setq break (1+ break))))) ;; Search OKURI-NASI entries with prefixes. (let ((break (min (car skkdic-prefix) (- len 2))) entry-prefix entry-tail entry2) (while (> break 0) (if (and (setq entry-prefix (lookup-nested-alist vec skkdic-prefix break 0 t)) (consp (car entry-prefix)) (setq entry-tail (lookup-nested-alist vec skkdic-okuri-nasi len break t)) (consp (car entry-tail)) (setq entry2 (skkdic-merge-head-and-tail (car entry-prefix) (car entry-tail) nil))) (progn (if entry (nconc entry entry2) (setq entry entry2)))) (setq break (1- break)))) ;; Search OKURI-ARI entries. (let ((okurigana (assq (aref seq (1- len)) skkdic-okurigana-table)) orig-element entry2) (if okurigana (progn (setq orig-element (aref vec (1- len))) (aset vec (1- len) (- (cdr okurigana))) (if (and (setq entry2 (lookup-nested-alist vec skkdic-okuri-ari len 0 t)) (consp (car entry2))) (progn (setq entry2 (copy-sequence (car entry2))) (let ((l entry2) (okuri (char-to-string (aref seq (1- len))))) (while l (setcar l (concat (car l) okuri)) (setq l (cdr l))) (if entry (if prefer-noun (nconc entry entry2) (setq entry2 (nreverse entry2)) (nconc entry2 entry) (setq entry entry2)) (setq entry (nreverse entry2)))))) (aset vec (1- len) orig-element)))) entry)) ;; (provide 'ja-dic-utl) ;; Local Variables: ;; coding: iso-2022-7bit ;; End: ;; arch-tag: df2218fa-469c-40f6-bace-7f89a053f9c0 ;;; ja-dic-utl.el ends here