Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
lyskom-elisp-client
lyskom-elisp-client
Commits
8c1d7a9f
Commit
8c1d7a9f
authored
Oct 08, 1996
by
Niels Möller
Browse files
Ny hantering av språk
parent
57172957
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/language.el
0 → 100644
View file @
8c1d7a9f
(
defconst
lyskom-category-properties
'
((
command
.
lyskom-command
)
(
menu
.
lyskom-menu
)
(
message
.
lyskom-message
))
"Property names for saving different categories."
)
(
defun
lyskom-define-language
(
category
language
alist
)
"Associates names to symbols.
CATEGORY and LANGUAGE determines what kind of association to
create. ALIST is a mapping from symbols to strings."
(
let
((
property
(
cdr
(
assq
category
lyskom-category-properties
))))
(
mapcar
(
function
(
lambda
(
pair
)
(
let*
((
symbol
(
car
pair
))
(
string
(
cdr
pair
))
(
llist
(
get
symbol
property
))
(
entry
(
assq
language
llist
)))
(
if
entry
(
setcdr
entry
string
)
(
put
symbol
property
(
cons
(
cons
language
string
)
llist
))))))
alist
)))
(
put
'lyskom-define-language
'lisp-indent-function
2
)
(
defun
lyskom-get-string
(
symbol
&optional
category
)
"Returns string assiciated with SYMBOL"
(
if
(
not
category
)
(
setq
category
'message
))
(
let
((
prop
(
cond
((
eq
category
'command
)
(
get
symbol
'lyskom-command
))
((
eq
category
'menu
)
(
or
(
get
symbol
'lyskom-menu
)
(
get
symbol
'lyskom-command
)))
((
eq
category
'message
)
(
get
symbol
'lyskom-message
))
(
t
nil
))))
(
or
(
cdr
(
assq
lyskom-language
prop
))
(
signal
'lyskom-internal-error
(
list
'lyskom-get-string
(
list
symbol
category
": string not found"
))))))
(
defun
lyskom-get-strings
(
symbols
&optional
category
)
"Returns an alist of (symbol . string) pairs
according to CATEGORY and lyskom-language. Sort of inverse to
lyskom-define-language."
(
mapcar
(
function
(
lambda
(
symbol
)
(
cons
symbol
(
lyskom-get-string
symbol
category
))))
symbols
))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment