173
173
(defcustom rime-popup-properties
174
174
(list :margin 1 )
175
175
" Properties for popup."
176
- :type 'list
176
+ :type '(plist)
177
177
:group 'rime )
178
178
179
179
(defcustom rime-popup-style 'horizontal
182
182
`simple' , preedit and candidate list in a single line.
183
183
`horizontal' , list candidates in a single line.'
184
184
`vertical' , display candidates in multiple lines."
185
- :type 'symbol
186
- :options '(simple horizontal vertical)
185
+ :type '(choice (const simple)
186
+ (const horizontal)
187
+ (const vertical))
187
188
:group 'rime )
188
189
189
190
(defcustom rime-posframe-properties
190
191
(list :internal-border-width 10 )
191
192
" Properties for posframe.
192
193
193
194
Background and default foreground can be set in face `rime-default-face' ."
194
- :type 'list
195
+ :type '(plist)
195
196
:group 'rime )
196
197
197
198
(defcustom rime-posframe-style 'horizontal
@@ -200,8 +201,9 @@ Background and default foreground can be set in face `rime-default-face'."
200
201
`simple' , preedit and candidate list in a single line.
201
202
`horizontal' , list candidates in a single line.'
202
203
`vertical' , display candidates in multiple lines."
203
- :type 'symbol
204
- :options '(simple horizontal vertical)
204
+ :type '(choice (const simple)
205
+ (const horizontal)
206
+ (const vertical))
205
207
:group 'rime )
206
208
207
209
(defcustom rime-sidewindow-keep-window nil
@@ -213,8 +215,10 @@ Background and default foreground can be set in face `rime-default-face'."
213
215
" Side for sidewindow.
214
216
215
217
One of `top' , `bottom' , `left' , `right' ."
216
- :type 'symbol
217
- :options '(top bottom left right)
218
+ :type '(choice (const top)
219
+ (const bottom)
220
+ (const left)
221
+ (const right))
218
222
:group 'rime )
219
223
220
224
(defcustom rime-sidewindow-style 'horizontal
@@ -223,8 +227,9 @@ One of `top', `bottom', `left', `right'."
223
227
`simple' , preedit and candidate list in a single line.
224
228
`horizontal' , list candidates in a single line.'
225
229
`vertical' , display candidates in multiple lines."
226
- :type 'symbol
227
- :options '(simple horizontal vertical)
230
+ :type '(choice (const simple)
231
+ (const horizontal)
232
+ (const vertical))
228
233
:group 'rime )
229
234
230
235
(defface rime-default-face
@@ -272,8 +277,9 @@ Options:
272
277
t, display in candidate menu, default behavior.
273
278
inline, display in inline text, replacing commit text preview.
274
279
nil, don't display."
275
- :type 'symbol
276
- :options '(t inline nil )
280
+ :type '(const (const :tag " Display in candidate menu" t )
281
+ (const :tag " Display in inline text" inline)
282
+ (const :tag " Don't display" nil ))
277
283
:group 'rime )
278
284
279
285
(defcustom rime-return-insert-raw t
@@ -285,15 +291,15 @@ If nil, hitting return commits the selected candicate instead."
285
291
286
292
(defcustom rime-posframe-fixed-position nil
287
293
" Use a fixed position for posframe candidate."
288
- :type : boolean
294
+ :type ' boolean
289
295
:group 'rime )
290
296
291
297
(defcustom rime-librime-root nil
292
298
" The path to the directory of librime.
293
299
294
300
Leave it nil if you have librime's lib and header files in the standard path.
295
301
Otherwise you should set this to where you put librime."
296
- :type 'string
302
+ :type 'directory
297
303
:group 'rime )
298
304
299
305
(defun rime--guess-emacs-module-header-root ()
@@ -311,8 +317,8 @@ Otherwise you should set this to where you put librime."
311
317
" The path to the directory of Emacs module header file.
312
318
313
319
Leave it nil if you using Emacs shipped with your system.
314
- Otherwise you should set this to the directory contains ' emacs-module.h'."
315
- :type 'string
320
+ Otherwise you should set this to the directory contains ` emacs-module.h' ."
321
+ :type 'directory
316
322
:group 'rime )
317
323
318
324
; ;; We need these variables to be buffer local.
@@ -339,14 +345,14 @@ Will be reset to nil when symbol `rime-active-mode' is disabled.")
339
345
340
346
When one of functions in `rime-disable-predicates' return t, and
341
347
one of these functions return t, the input-method will toggle to inline mode."
342
- :type 'list
348
+ :type 'hook
343
349
:group 'rime )
344
350
345
351
(defcustom rime-disable-predicates nil
346
352
" A list of predicate functions, each receive no argument.
347
353
348
354
If one of these functions return t, the input-method will fallback to ascii mode."
349
- :type 'list
355
+ :type 'hook
350
356
:group 'rime )
351
357
352
358
(defcustom rime-show-candidate 'minibuffer
@@ -359,15 +365,18 @@ nil means don't display candidate at all.
359
365
replacement for `minibuffer' if you use minibuffer as the mode-line.
360
366
`posframe' , display candidate in posframe, will fallback to popup in TUI.
361
367
`sidewindow' , display in sidewindow."
362
- :type 'symbol
363
- :options '(minibuffer message popup posframe sidewindow)
368
+ :type '(choice (const minibuffer)
369
+ (const popup)
370
+ (const message)
371
+ (const posframe)
372
+ (const sidewindow))
364
373
:group 'rime )
365
374
366
375
(defcustom rime-user-data-dir (locate-user-emacs-file " rime/" )
367
376
" Rime user data directory.
368
377
369
378
Defaults to `user-emacs-directory' /rime/"
370
- :type 'string
379
+ :type 'directory
371
380
:group 'rime )
372
381
373
382
(defcustom rime-share-data-dir
@@ -388,7 +397,7 @@ Defaults to `user-emacs-directory'/rime/"
388
397
(if (getenv " LIBRIME_ROOT" )
389
398
(expand-file-name (concat (getenv " LIBRIME_ROOT" ) " /share/rime-data" ))))))
390
399
" Rime share data directory."
391
- :type 'string
400
+ :type 'directory
392
401
:group 'rime )
393
402
394
403
(defvar rime--root (file-name-directory (or load-file-name buffer-file-name))
@@ -402,13 +411,17 @@ Defaults to `user-emacs-directory'/rime/"
402
411
" A character that used to hold the inline ascii mode.
403
412
404
413
When inline ascii is triggered, this characeter will be inserted as the beginning of composition, the origin character follows. Then this character will be deleted."
405
- :type 'char
414
+ :type 'character
406
415
:group 'rime )
407
416
408
417
(defcustom rime-inline-ascii-trigger 'shift-l
409
418
" How to trigger into inline ascii mode."
410
- :type 'symbol
411
- :options '(shift-l shift-r control-l control-r alt-l alt-r)
419
+ :type '(choice (const shift-l)
420
+ (const shift-r)
421
+ (const control-l)
422
+ (const control-r)
423
+ (const alt-l)
424
+ (const alt-r))
412
425
:group 'rime )
413
426
414
427
(defcustom rime-cursor " |"
@@ -954,7 +967,10 @@ By default the input-method will not handle DEL, so we need this command."
954
967
(insert commit)
955
968
(rime--clear-state))))
956
969
957
- (defcustom rime-commit1-forall nil " Non-nil to auto commit the 1st item before any command unrelated to rime." )
970
+ (defcustom rime-commit1-forall nil
971
+ " Non-nil to auto commit the 1st item before any command unrelated to
972
+ rime."
973
+ :type 'boolean )
958
974
959
975
(defun rime--commit1-before-unrelated-command ()
960
976
" Commit the 1st item if this command is unrelated to rime."
0 commit comments