OSDN Git Service

add French menu
[howm/howm.git] / howm-vars.el
1 ;;; howm-vars.el --- Wiki-like note-taking tool
2 ;;; Copyright (C) 2005-2018
3 ;;;   HIRAOKA Kazuyuki <khi@users.osdn.me>
4 ;;; $Id: howm-vars.el,v 1.59 2011-12-31 15:07:29 hira Exp $
5 ;;;
6 ;;; This program is free software; you can redistribute it and/or modify
7 ;;; it under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 1, or (at your option)
9 ;;; any later version.
10 ;;;
11 ;;; This program is distributed in the hope that it will be useful,
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; The GNU General Public License is available by anonymouse ftp from
17 ;;; prep.ai.mit.edu in pub/gnu/COPYING.  Alternately, you can write to
18 ;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
19 ;;; USA.
20 ;;--------------------------------------------------------------------
21
22 (require 'cl-lib)
23
24 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25 ;; Util
26
27 (defmacro howm-define-risky-command (risky orig)
28   "Define a macro RISKY which is risky-version of ORIG."
29   (let* ((gsymbol (cl-gensym))
30          (gargs (cl-gensym))
31          (docstring (format "Do `%s' and set risky-local-variable property."
32                             orig)))
33     `(defmacro ,risky
34          (,gsymbol &rest ,gargs)
35          ,docstring
36          (declare (indent 'defun))
37          (howm-define-risky-command-body ',orig ,gsymbol ,gargs))))
38
39 ;; [2011-01-13]
40 ;; I split this function from howm-define-risky-command for avoiding
41 ;; nested backquotes. Nested backquotes are byte-compiled to
42 ;; old-style-backquotes, that cause warnings when *.elc is loaded.
43 (cl-eval-when (compile load eval)
44   (defun howm-define-risky-command-body (command symbol args)
45     `(progn
46        (,command ,symbol ,@args)
47        (put ',symbol 'risky-local-variable t))))
48
49 ;; ;; This code is byte-compiled to old-style-backquotes. Sigh...
50 ;; (defmacro howm-define-risky-command (risky orig)
51 ;;   "Define a macro RISKY which is risky-version of ORIG."
52 ;;   (let* ((gsymbol (cl-gensym))
53 ;;          (gargs (cl-gensym))
54 ;;          (docstring (format "Do `%s' and set risky-local-variable property."
55 ;;                             orig)))
56 ;;     `(progn
57 ;;        (put ',risky 'lisp-indent-hook 'defun)
58 ;;        (defmacro ,risky
59 ;;          (,gsymbol &rest ,gargs)
60 ;;          ,docstring
61 ;;          (let ((command ',orig)
62 ;;                (symbol ,gsymbol)
63 ;;                (args ,gargs))
64 ;;            `(progn
65 ;;               ;; (,',orig ...) doesn't work.
66 ;;               ;; So I need to bind temporal variables outside nested backquote.
67 ;;               (,command ,symbol ,@args)
68 ;;               (put ',symbol 'risky-local-variable t)))))))
69
70 (howm-define-risky-command howm-defvar-risky defvar)
71 (howm-define-risky-command howm-defcustom-risky defcustom)
72 (howm-define-risky-command howm-defconst-risky defconst)
73
74 ;; ;; Should I use this?
75 ;; (defmacro howm-boundp-q (var)
76 ;;   `(prog1
77 ;;        (boundp ,var)
78 ;;      (howm-dont-warn-free-variable ,var)))
79 (defmacro howm-dont-warn-free-variable (var)
80   "No effect except for inhibition of warning in byte-compilation.
81 Without this trick, compiler says 'reference to free variable' even when
82 we have checked availability like (if (boundp xxx) ...)."
83   `(when (boundp (quote ,var))
84      (defvar ,var nil)))
85
86 (defmacro howm-funcall-if-defined (call &rest not-defined)
87   "Execute CALL if its car is defined as a function.
88 Otherwise, execute expressions in NOT-DEFINED.
89 This is cheat to avoid warning while byte-compilation.
90 Byte-compiler says \"not known to be defined\" even for codes like
91   (if (fboundp 'foo) (foo bar)).
92
93 \(macroexpand '(howm-funcall-if-defined (migemo-get-pattern roma) nil))
94 ==> (if (fboundp 'migemo-get-pattern)
95         (let ((howm-funcall-if-defined-f 'migemo-get-pattern))
96           (funcall howm-funcall-if-defined-f roma))
97       nil)
98 "
99   (declare (indent 1))
100   (let ((func (car call))
101         (args (cdr call)))
102     `(if (fboundp (quote ,func))
103          (let ((howm-funcall-if-defined-f (quote ,func)))
104            (funcall howm-funcall-if-defined-f ,@args))
105        ,@not-defined)))
106
107 ;; copied and modified from mule-cmds.el
108 ;; snap:///usr/share/emacs/21.2/lisp/international/mule-cmds.el#1870:(defun set-locale-environment (locale-name)
109 (defun howm-get-locale ()
110   (let ((vars '("LC_ALL" "LC_CTYPE" "LANG"))
111         (locale nil))
112     (while (and vars (not (setq locale (getenv (car vars)))))
113       (setq vars (cdr vars)))
114     (or locale "")))
115
116 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
117 ;; Top
118
119 (defgroup howm nil
120   "Wiki-like note-taking tool."
121   :group 'applications)
122
123 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
124 ;; Compatibility
125
126 (defvar howm-compatible-to-ver1dot3 nil
127   "If non-nil, compatible values to howm-1.3.* are used
128 as default of some variables; put (setq howm-compatible-to-ver1dot3 t)
129 *before* (require 'howm) if you like.")
130
131 (defgroup howm-compatibility nil
132   "Compatibility to howm-1.3.*."
133   :group 'howm)
134
135 (defmacro howm-if-ver1dot3 (oldval def)
136   (declare (indent 1))
137   (cl-destructuring-bind (command var val &rest args) def
138     `(,command ,var (if howm-compatible-to-ver1dot3 ,oldval ,val)
139                ,@args
140                :group 'howm-compatibility)))
141
142 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
143 ;; Files
144
145 (defgroup howm-files nil
146   "Names of files and directories."
147   :group 'howm)
148
149 (howm-defcustom-risky howm-directory "~/howm/"
150   "*All files under this directory are scanned recursively."
151   :type 'directory
152   :group 'howm-files)
153
154 (let ((default-format "%Y/%m/%Y-%m-%d-%H%M%S.txt"))
155   (howm-if-ver1dot3 "%Y/%m/%Y-%m-%d-%H%M%S.howm"
156     (defcustom howm-file-name-format default-format
157       "Name of new file. See `format-time-string'.
158 For example, set as \"%Y/%m/%Y-%m-%d-%H%M%S.txt\" to separate each entry
159 to its own file. You must guarantee (string< oldfile newfile)."
160       :type `(radio (const :tag "One file for one entry" ,default-format)
161                     (const :tag "One file for one day" "%Y/%m/%Y-%m-%d.txt")
162                     (const :tag "One file for one month" "%Y/%Y-%m.txt")
163                     (const :tag "One file for one year" "%Y.txt")
164                     string)
165       :group 'howm-efficiency
166       :group 'howm-files)))
167
168 (howm-defcustom-risky howm-keyword-file "~/.howm-keys"
169   "*Keywords (WikiNames) are stored in this file."
170   :type 'file
171   :group 'howm-files)
172
173 ;; inhibit warning in compilation.
174 (howm-dont-warn-free-variable image-file-name-regexps)
175 (defvar howm-image-file-name-regexps
176   (let ((exts-regexp "\\.\\(GIF\\|JP\\(?:E?G\\)\\|P\\(?:BM\\|GM\\|NG\\|PM\\)\\|TIFF?\\|X\\(?:[BP]M\\)\\|gif\\|jp\\(?:e?g\\)\\|p\\(?:bm\\|gm\\|ng\\|pm\\)\\|tiff?\\|x\\(?:[bp]m\\)\\)\\'")
177         (image-file-name-regexps (and (boundp 'image-file-name-regexps)
178                                       image-file-name-regexps)))
179     ;; copied from image-file-name-regexp.
180     (if image-file-name-regexps
181         (mapconcat 'identity
182                    (if exts-regexp
183                        (cons exts-regexp image-file-name-regexps)
184                      image-file-name-regexps)
185                    "\\|")
186       exts-regexp))
187   "Regular expression that matches image-file filenames.
188 Default value is equal to the result of `image-file-name-regexp'
189 on GNU Emacs 21.2.1.
190
191 In order to use `image-file-name-regexp' on Meadow 2.10 (ASAGAO),
192 max-specpdl-size must be increased from the default value 600.
193 Otherwise, an error occurs both in byte-compilation and in run time.
194 To avoid such troubles, this variable is prepared as a fixed string.")
195
196 (defvar howm-excluded-dirs '("RCS" "CVS" ".svn" ".git" "_darcs"))
197
198 (defvar howm-excluded-file-regexp-common-list
199   (list "[~#]$"
200         "\\.\\(bak\\|elc\\|gz\\|aux\\|toc\\|idx\\|dvi\\)$"
201         howm-image-file-name-regexps))
202 (defvar howm-excluded-file-regexp-dir-sep
203   (if (let ((case-fold-search t))
204         (string-match "windows" (symbol-name system-type)))
205       "[/\\\\]" ;; / or \ for win
206     "/")) ;; / otherwise
207
208 (let ((dir-head (concat "\\(^\\|" howm-excluded-file-regexp-dir-sep "\\)"))
209       (excluded-dirs (concat (regexp-opt howm-excluded-dirs t)
210                              howm-excluded-file-regexp-dir-sep)))
211   (let ((howm-excluded-file-regexp-dots-ok
212          (mapconcat #'identity
213                     `(,(concat dir-head excluded-dirs)
214                       "^[.][.]"
215                       ,@howm-excluded-file-regexp-common-list)
216                     "\\|"))
217         (howm-excluded-file-regexp-dots-ng
218          (mapconcat #'identity
219                     `(,(concat dir-head "\\([.]\\|" excluded-dirs "\\)")
220                       ,@howm-excluded-file-regexp-common-list)
221                     "\\|")))
222     (howm-defcustom-risky howm-excluded-file-regexp
223                           howm-excluded-file-regexp-dots-ng
224       "Regexp for excluded files.
225 It is checked for relative paths from howm-directory and howm-search-path.
226 A file is excluded iff this regexp matches with all the relative paths."
227       :type `(radio (const :tag "Don't search dot files"
228                            ,howm-excluded-file-regexp-dots-ng)
229                     (const :tag "Search dot files"
230                            ,howm-excluded-file-regexp-dots-ok)
231                     regexp)
232       :group 'howm-files
233       )))
234
235 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
236 ;; Menu
237
238 (defgroup howm-menu nil
239   "Menu."
240   :group 'howm)
241
242 (defcustom howm-menu-lang
243   (let ((lang-table '((fr "French" "^fr")
244                       (ja "Japanese" "^ja"))))
245     (let ((lang (or (and (boundp 'current-language-environment)
246                         current-language-environment)
247                    ""))
248           (locale (howm-get-locale))
249           (ret 'en))
250       (mapc (lambda (rule)
251               (if (or (string= lang (cadr rule))
252                       (string-match (caddr rule) locale))
253                   (setq ret (car rule))))
254             lang-table)
255       ret))
256   "*Language of menu."
257   :type '(radio (const en) (const fr) (const ja))
258   :group 'howm-menu)
259
260 (howm-defcustom-risky howm-menu-file nil
261   "*Specify menu file explicitly, or set as nil to search every time."
262   :type '(radio (const :tag "Search every time" nil)
263                 (const "0000-00-00-000000.txt")
264                 file)
265   :group 'howm-files
266   :group 'howm-efficiency
267   :group 'howm-menu)
268
269 (defcustom howm-menu-expiry-hours 0
270   "*Cache menu contents for this number of hours."
271   :type 'number
272   :group 'howm-efficiency
273   :group 'howm-menu)
274
275 (defcustom howm-menu-refresh-after-save t
276   "*If non-nil, refresh menu contents after you save howm note."
277   :type 'boolean
278   :group 'howm-efficiency
279   :group 'howm-menu)
280
281 (defcustom howm-menu-name-format "*howmM:%s*"
282   "*Name format of menu buffer."
283   :type '(radio (const :tag "Never show in normal buffer list" " *howmM:%s*")
284                 string)
285   :group 'howm-menu)
286
287 (defcustom howm-menu-footer nil
288   "Footer string for each menu. Nil means no footer."
289   :type '(radio (const :tag "Off" nil)
290                 string)
291   :group 'howm-menu)
292
293 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
294 ;; Reminder
295
296 (defgroup howm-reminder nil
297   "Schedule and todo list."
298   :group 'howm)
299
300 (defvar howm-reminder-old-format nil)
301
302 (defvar howm-reminder-marks
303   ;; Be careful to order of characters.
304   ;; "-" must be first so that regexp "[-+~!@.]" makes sense.
305   (if howm-reminder-old-format "-+~!@. " "-+~!@."))
306 (defvar howm-reminder-types
307   (format "[%s]" howm-reminder-marks))
308
309 (defun howm-custom-reminder-get-types (symbol)
310   (let ((reg (default-value symbol))
311         (default-types (split-string howm-reminder-marks "")))
312     ;; return list of types for standard cases
313     ;; and string itself for nonstandard cases
314     (if (not (string-match "^\\[\\(.*\\)\\]" reg))
315         reg
316       (let ((types (split-string (match-string-no-properties 1 reg) "")))
317         (if (cl-find-if-not (lambda (x) (member x default-types))
318                                  types)
319             reg
320           (cl-remove-if-not (lambda (x) (member x types))
321                                  default-types))))))
322 (defun howm-custom-reminder-set-types (symbol types)
323   (when (listp types)
324     (setq types (apply #'concat `("[" ,@types "]"))))
325   (set-default symbol types))
326 (defun howm-custom-reminder-list-types ()
327   `(radio (set ,@(mapcar (lambda (ty) (list 'const ty))
328                          (split-string howm-reminder-marks "")))
329           string))
330
331 (defcustom howm-schedule-types "[!@.]"
332   "*Regular expression of reminder types which are listed as schedule."
333   :get #'howm-custom-reminder-get-types
334   :set #'howm-custom-reminder-set-types
335   :type (howm-custom-reminder-list-types)
336   :group 'howm-efficiency
337   :group 'howm-reminder)
338
339 (defcustom howm-todo-types
340   (if howm-reminder-old-format "[-+~! .]" "[-+~!.]")
341   "*Regular expression of reminder types which are listed as todo."
342   :get #'howm-custom-reminder-get-types
343   :set #'howm-custom-reminder-set-types
344   :type (howm-custom-reminder-list-types)
345   :group 'howm-efficiency
346   :group 'howm-reminder)
347
348 (defcustom howm-congrats-format '("Finished %s tasks!")
349   "List of format strings to generate message when a reminder is finished.
350 One of elements is chosen randomly every time."
351   :type '(repeat string)
352   :group 'howm-reminder)
353
354 (howm-defcustom-risky howm-congrats-command nil
355   "*If non-nil, this command is executed when a reminder is finished.
356 Example: (\"play\" \"~/sound/fanfare.wav\") for calling the command
357 \"play ~/sound/fanfare.wav\"."
358   :type '(repeat string)
359   :group 'howm-reminder)
360
361 (defcustom howm-reminder-cancel-string "cancel"
362   "*This string is inserted automatically when a reminder is canceled."
363   :type 'string
364   :group 'howm-reminder)
365
366 (defcustom howm-action-lock-forward-save-buffer nil
367   "*Non nil if direct manipulation on reminder list should cause auto-save."
368   :type 'boolean
369   :group 'howm-reminder)
370
371 (defcustom howm-action-lock-forward-kill-buffer nil
372   "*Non nil if direct manipulation on reminder list should cause kill-buffer.
373 Be careful that you cannot undo the result of action-lock after kill-buffer."
374   :type 'boolean
375   :group 'howm-reminder)
376
377 (howm-if-ver1dot3 0
378   (defcustom howm-action-lock-forward-fuzziness 5
379     "*Maximum lines of permitted inconsistency for `howm-action-lock-forward'."
380     :type 'integer
381     :group 'howm-reminder))
382
383 (let* ((sep "- - - - - - - - - - - - - - - - - - -")
384        (reminder-default `((-1 . ,sep) (0 . ,sep) (nil . ,sep)))
385        (todo-default `((0 . ,sep) (nil . ,sep))))
386   (howm-if-ver1dot3 nil
387     (defcustom howm-menu-reminder-separators reminder-default
388       "Assoc list to specify positions and strings of separators in reminder
389 in menu. For each element, car is days from now, and cdr is separator string.
390 If car is nil, it means the border between schedule and todo.
391 This option is prepared for `howm-menu-reminder'."
392       :type `(radio (const :tag "No separators" nil)
393                     (const :tag "Default separators" ,reminder-default)
394                     (alist :key-type
395                            (radio number
396                                   (const :tag "Between schedule and todo" nil))
397                            :value-type string))
398       :group 'howm-reminder))
399   (defcustom howm-todo-separators nil
400     "Assoc list to specify positions and strings of separators in todo buffer.
401 For each element, car is priority and cdr is separator string.
402 If car is nil, it means the border between active and sleeping reminders."
403     :type `(radio (const :tag "No separators" nil)
404                   (const :tag "Default separators" ,todo-default)
405                   (alist :key-type number
406                          :value-type string))
407     :group 'howm-reminder))
408
409 (howm-if-ver1dot3 nil
410   (defcustom howm-schedule-sort-by-time t
411     "Non nil if `howm-schedule-sort-converter' should consider time part."
412     :type 'boolean
413     :group 'howm-reminder))
414
415 (defcustom howm-reminder-menu-types
416   (if howm-reminder-old-format "[-+~!@ ]" "[-+~!@]")
417   "*Regular expression of reminder types which are shown in menu."
418   :get #'howm-custom-reminder-get-types
419   :set #'howm-custom-reminder-set-types
420   :type (howm-custom-reminder-list-types)
421   :group 'howm-reminder)
422
423 ;;;
424 ;;; Menu reminder
425 ;;;
426
427 (defgroup howm-menu-reminder nil
428   "Reminders shown in menu."
429   :group 'howm-menu
430   :group 'howm-reminder)
431
432 (defcustom howm-schedule-menu-types "[!@]"
433   "*Regular expression of reminder types which are shown in menu as schedule."
434   :get #'howm-custom-reminder-get-types
435   :set #'howm-custom-reminder-set-types
436   :type (howm-custom-reminder-list-types)
437   :group 'howm-efficiency
438   :group 'howm-menu-reminder)
439
440 (defcustom howm-todo-menu-types
441   (if howm-reminder-old-format "[-+~! .]" "[-+~!.]")
442   "*Regular expression of reminder types which are shown in menu as todo."
443   :get #'howm-custom-reminder-get-types
444   :set #'howm-custom-reminder-set-types
445   :type (howm-custom-reminder-list-types)
446   :group 'howm-efficiency
447   :group 'howm-menu-reminder)
448
449 (defcustom howm-menu-schedule-days 7
450   "*Show schedule in menu until this number of days from now."
451   :type 'number
452   :group 'howm-menu-reminder)
453
454 (defcustom howm-menu-schedule-days-before 0
455   "*Show schedule in menu from this number of days ago."
456   :type 'number
457   :group 'howm-menu-reminder)
458
459 (defcustom howm-menu-todo-num 50
460   "*Maximum number of todo items shown in menu."
461   :type 'number
462   :group 'howm-menu-reminder)
463
464 (defvar howm-huge- 66666)
465 (defvar howm-huge 77777)
466 (defvar howm-huge+ 88888)
467 (defvar howm-huge++ 99999)
468
469 (defcustom howm-menu-todo-priority (- howm-huge+)
470   "*Limit priority for elimination of reminders in menu."
471   :type `(radio (const :tag "Show sleeping reminders",(- howm-huge+))
472                 (const :tag "Hide sleeping reminders" ,(- howm-huge-))
473                 number)
474   :group 'howm-menu-reminder)
475
476 (defcustom howm-todo-priority-done-bottom (- howm-huge+)
477   "*Base priority of done reminder.
478 <priority of done reminder> = <this value> + <days from specified date>"
479   :type `(radio (const :tag "Deeper than sleeping reminders" ,(- howm-huge+))
480                 (const :tag "Shallower than sleeping reminders"
481                        ,(- howm-huge-))
482                 number)
483   :group 'howm-menu-reminder)
484
485 (defcustom howm-menu-recent-num 20
486   "*Maximum number of recent items shown in menu."
487   :type 'number
488   :group 'howm-menu-reminder)
489
490 (defcustom howm-menu-recent-regexp nil
491   "Regexp which is regarded as title line in recent list in menu.
492 When it is nil, `howm-view-title-regexp' is used."
493   :type '(radio (const :tag "Default" nil)
494                 regexp)
495   :group 'howm-title
496   :group 'howm-menu-reminder)
497
498 (defcustom howm-menu-todo-priority-format nil
499   "*Format for priority display in todo list in menu, or nil for no display."
500   :type '(radio (const :tag "Off" nil)
501                 (const "(%8.1f)")
502                 string)
503   :group 'howm-devel
504   :group 'howm-menu-reminder)
505
506 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
507 ;; List
508
509 (defgroup howm-list nil
510   "Style of list view."
511   :group 'howm)
512
513 (defcustom howm-view-contents-limit nil
514   "*Max length for howm-view-contents. Nil means no limit."
515   :type '(radio (const :tag "No limit" nil)
516                 integer)
517   :group 'howm-list)
518
519 (defcustom howm-view-summary-keep-cursor t
520   "*If non-nil, keep cursor position when you open a note from summary list."
521   :type 'boolean
522   :group 'howm-list)
523
524 (defcustom howm-view-summary-omit-same-name t
525   "*If non-nil, same name is not written repeatedly in summary list."
526   :type 'boolean
527   :group 'howm-list)
528
529 (defcustom howm-list-recent-days 7
530   "*This number of days are listed by `howm-list-recent'."
531   :type 'integer
532   :group 'howm-list)
533
534 (defcustom howm-list-buffers-exclude
535   '("*Messages*" ".howm-keys" ".howm-history")
536   "*List of excluded buffer names for `howm-list-buffers'."
537   :type '(repeat string)
538   :group 'howm-list)
539
540 ;;
541 ;; Sort
542 ;;
543
544 (defgroup howm-sort nil
545   "Sorting and filtering of matched entries."
546   :group 'howm-list)
547
548 (howm-defcustom-risky howm-list-normalizer nil
549   "*Obsolete. Use `howm-normalizer' insteadly."
550   :type '(radio (const :tag "Off (strongly recommended)" nil)
551                 (function-item :tag "Sort by edit-time"
552                                howm-view-sort-by-mtime)
553                 (function-item :tag "Sort by create-time"
554                                howm-view-sort-by-reverse-date)
555                 function)
556   :group 'howm-sort)
557
558 (howm-defcustom-risky howm-normalizer 'howm-sort-items-by-mtime
559   "*Default method to list matched notes.
560 For backward compatibility, this value is overridden
561 if `howm-list-normalizer' is non-nil."
562   :type '(radio (function-item :tag "Sort by edit-time"
563                                howm-sort-items-by-mtime)
564                 (function-item :tag "Sort by create-time"
565                                howm-sort-items-by-reverse-date)
566                 function)
567   :group 'howm-sort)
568
569 (defcustom howm-list-prefer-word nil
570   "*Matches to whole word are listed first in summary buffer."
571   :type 'boolean
572   :group 'howm-sort)
573
574 (defcustom howm-list-prefer-wiki t
575   "*Matches to wiki tags are listed first in summary buffer."
576   :type 'boolean
577   :group 'howm-sort)
578
579 ;;
580 ;; Title
581 ;;
582
583 (defgroup howm-title nil
584   "Title of each entry."
585   :group 'howm-list)
586
587 ;; I don't know the way to generate this list automatically. Sigh...
588 (defvar howm-custom-command-list
589   `(set ,@(mapcar (lambda (com) (list 'const com))
590                   '(howm-list-all
591                     howm-list-recent
592                     howm-list-around
593                     howm-keyword-search
594                     howm-list-grep
595                     howm-list-grep-fixed
596                     howm-list-migemo
597                     howm-list-related
598                     howm-action-lock-date-search
599                     ))))
600
601 (howm-defcustom-risky howm-list-title
602   '(
603     howm-list-all
604     howm-list-recent
605     howm-list-around
606     ; howm-keyword-search
607     ; howm-list-grep howm-list-grep-fixed howm-list-migemo
608     ; howm-list-related
609     howm-action-lock-date-search
610     )
611   "List of commands in which titles are listed instead of matched lines.
612 T means 'always'.
613 If it is a function, the evaluated value is used instead of itself."
614   :type `(radio (const :tag "Always" t)
615                 (const :tag "Never" nil)
616                 ,howm-custom-command-list
617 ;;                 (set (const howm-list-all)
618 ;;                      (const howm-list-recent)
619 ;;                      (const howm-list-around)
620 ;;                      (const howm-keyword-search)
621 ;;                      (const howm-list-grep)
622 ;;                      (const howm-list-grep-fixed)
623 ;;                      (const howm-list-migemo)
624 ;;                      (const howm-list-related))
625                 function)
626   :group 'howm-efficiency
627   :group 'howm-title)
628
629 (defcustom howm-list-title-regexp nil
630   "Regexp which is regarded as title line in summary buffer.
631 When it is nil, `howm-view-title-regexp' is used."
632   :type '(radio (const :tag "Default" nil)
633                 regexp)
634   :group 'howm-title)
635
636 (defcustom howm-list-title-undo t
637   "*Non-nil if `howm-list-toggle-title' should toggle whether title is shown
638 or not."
639   :type 'boolean
640   :group 'howm-efficiency
641   :group 'howm-title)
642
643 ;;
644 ;; BufWin
645 ;;
646
647 (defgroup howm-list-bufwin nil
648   "Buffers and windows for listing search result."
649   :group 'howm-list)
650
651 (defcustom howm-view-summary-name "*howmS*"
652   "Format string of buffer name for summary.
653 %s is replaced with searched string. See `format'."
654   :type '(radio (const :tag "Use one common buffer" "*howmS*")
655                 (const :tag "Make new buffer for each search" "*howmS:%s*")
656                 string)
657   :group 'howm-list-bufwin)
658
659 (defcustom howm-view-contents-name "*howmC*"
660   "Format string of buffer name for contents.
661 %s is replaced with searched string. See `format'."
662   :type '(radio (const :tag "Use one common buffer" "*howmC*")
663                 (const :tag "Make new buffer for each search" "*howmC:%s*")
664                 string)
665   :group 'howm-list-bufwin)
666
667 (howm-defcustom-risky howm-view-summary-persistent t
668   "*If non-nil, keep summary buffer on howm-view-summary-open by default.
669 If it is a function, the evaluated value is used instead of itself."
670   :type 'boolean
671   :group 'howm-list-bufwin)
672
673 (howm-defcustom-risky howm-view-contents-persistent t
674   "*If non-nil, keep contents buffer on howm-view-contents-open by default.
675 If it is a function, the evaluated value is used instead of itself."
676   :type 'boolean
677   :group 'howm-list-bufwin)
678
679 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
680 ;; Search
681
682 (defgroup howm-search nil
683   "Search methods."
684   :group 'howm)
685
686 (defcustom howm-keyword-case-fold-search nil
687   "*Non-nil if searches of come-from keywords should ignore case."
688   :type 'boolean
689   :group 'howm-search)
690
691 (defcustom howm-check-word-break nil
692   "*Non-nil if come-from keywords within a word should not linked.
693 When the value is a string (regexp), word breaks are checked
694 only for matched keywords. "
695   :type '(radio (const :tag "Always" t)
696                 (const :tag "Never" nil)
697                 (const :tag "ASCII only" "^[[:ascii:]]+$")
698                 string)
699   :group 'howm-search)
700
701 (defcustom howm-view-update-search-ring nil
702   "*Non-nil if search-ring should be updated in howm search."
703   :type 'boolean
704   :group 'howm-search)
705
706 (defcustom howm-message-time nil
707   "*Non nil if search etc. should show took time."
708   :type 'boolean
709   :group 'howm-devel
710   :group 'howm-search)
711
712 (howm-defcustom-risky howm-history-file "~/.howm-history"
713   "*Search history is recorded to that file."
714   :type 'file
715   :group 'howm-files
716   :group 'howm-search)
717
718 (defcustom howm-history-limit 50
719   "*Limit number of recorded search history, or nil for no limit.
720 Set 0 to inhibit recording."
721   :type '(radio (const :tag "No limit" nil)
722                 integer)
723   :group 'howm-search)
724
725 (defcustom howm-history-unique t
726   "*If non-nil, duplicated entries are removed from search history."
727   :type 'boolean
728   :group 'howm-search)
729
730 (defcustom howm-keyword-list-alias-sep "\t"
731   "*Separator string for alias keywords in the keyword file `howm-keyword-file'.
732 If it is nil, alias of come-from keyword is disabled."
733   :type '(radio (const :tag "Disable aliases" nil)
734                 (const :tag "Tab" "\t")
735                 string)
736   :group 'howm-search)
737
738 (defcustom howm-keyword-aliases-recursive t
739   "*Non nil if aliases of come-from keywords should be expanded recursively."
740   :type 'boolean
741   :group 'howm-search)
742
743 ;;;
744 ;;; grep
745 ;;;
746
747 (defgroup howm-grep nil
748   "Use external grep command for fast search."
749   :group 'howm-efficiency
750   :group 'howm-search)
751
752 (howm-defcustom-risky howm-view-use-grep nil
753   "*If non-nil, use external grep command for search.
754 Performance must be improved greatly if you set this.
755 When the value is elisp function, it is used instead of `howm-fake-grep'."
756   :type '(radio (const :tag "On" t)
757                 (const :tag "Off" nil)
758                 function)
759   :group 'howm-grep)
760
761 ;; These variables should be renamed: howm-view-xxx ==> howm-xxx.
762 (howm-defcustom-risky howm-view-grep-command "grep"
763   "*Command name for grep."
764   :type 'string
765   :group 'howm-grep)
766 (howm-defvar-risky howm-view-fgrep-command nil
767   "*Command name for fgrep.
768 This variable is obsolete and may be removed in future.")
769 (defvar howm-view-grep-default-option
770   ;; "labels" causes a trouble in git-head emacs (d5e3922) [2015-01-31]
771   (let* ((ed (lambda (d) (concat "--exclude-dir=" d)))
772          (has-ed (condition-case nil
773                      (eq 0 (call-process howm-view-grep-command nil nil nil
774                                          (apply ed "/") "--version"))
775                      (error nil)))
776          (opts (cons "-Hnr" (and has-ed (mapcar ed howm-excluded-dirs)))))
777     (mapconcat #'identity opts " ")))
778 (howm-defcustom-risky howm-view-grep-option howm-view-grep-default-option
779   "*Common grep option for howm."
780   :type `(radio (const :tag "scan all files"
781                        ,howm-view-grep-default-option)
782                 (const :tag "scan *.howm only"
783                        ,(concat howm-view-grep-default-option
784                                 " --include=*.howm"))
785                 string)
786   :group 'howm-grep)
787 (howm-defcustom-risky howm-view-grep-extended-option "-E"
788   "*Grep option for extended regular expression."
789   :type 'string
790   :group 'howm-grep)
791 (howm-defcustom-risky howm-view-grep-fixed-option "-F"
792   "*Grep option to search fixed strings."
793   :type 'string
794   :group 'howm-grep)
795 (howm-defcustom-risky howm-view-grep-ignore-case-option "-i"
796   "*Grep option for ignoring case distinctions."
797   :type 'string
798   :group 'howm-grep)
799 (howm-defcustom-risky howm-view-grep-expr-option "-e"
800   "*Grep option for pattern."
801   :type 'string
802   :group 'howm-grep)
803 (howm-defcustom-risky howm-view-grep-file-stdin-option "-f -"
804   "*Grep option for receiving patterns from standard input.
805 If this is nil, pattern is received as command line argument."
806   :type '(radio (const :tag "Off" nil)
807                 string)
808   :group 'howm-grep)
809
810 (howm-defcustom-risky howm-command-length-limit 10000
811   "*Maximum length of command line for call-process."
812   :type 'integer
813   :group 'howm-grep)
814
815 (defcustom howm-process-coding-system nil
816   "*Default coding system for grep command in howm.
817 If the value is a symbol, it is used for both read and write.
818 If the value is a cons pair, its car and cdr are used for read and write,
819 respectively.
820
821 Example:
822  (setq howm-process-coding-system 'euc-japan-unix)
823  (setq howm-process-coding-system '(utf-8-unix . sjis-unix))"
824   :type '(radio (const :tag "Off" nil)
825                 coding-system
826                 (cons coding-system coding-system))
827   :group 'howm-grep)
828
829 (howm-if-ver1dot3 nil
830   (defcustom howm-occur-force-fake-grep t
831     "*If non-nil, force `howm-occur' to use `howm-fake-grep'
832 so that highlighting works correctly."
833     :type 'boolean
834     :group 'howm-grep))
835
836 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
837 ;; Misc
838
839 (defgroup howm-misc nil
840   "Miscellaneous customization."
841   :group 'howm)
842
843 (defvar howm-prefix "\C-c,"
844   "Howm commands are invoked by this prefix + some keys.")
845
846 (defcustom howm-random-walk-wait 2
847   "*Seconds of wait in `howm-random-walk'."
848   :type 'number
849   :group 'howm-misc)
850
851 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
852 ;; Create
853
854 (defgroup howm-create nil
855   "Create new note."
856   :group 'howm-misc)
857
858 (defcustom howm-prepend nil
859   "*Non nil if new entries should be prepended to previous entries.
860 Otherwise, they are appended."
861   :type '(radio (const :tag "Append" nil)
862                 (const :tag "Prepend" t))
863   :group 'howm-create)
864
865 (defcustom howm-content-from-region nil
866   "*When the value non-nil, selected string is inserted as default content.
867 Unless the value is t, single-line selection is inserted as title instead.
868 This variable is ignored when `transient-mark-mode' is nil."
869   :type '(radio (const :tag "Off" nil)
870                 (const :tag "Single line selection is copied as title" 1)
871                 (const :tag "Any selection is copied as content" t))
872   :group 'howm-create)
873
874 (defcustom howm-title-from-search nil
875   "*Non nil if searched keyword is inserted as default title
876 when `howm-create' is called on summary buffer."
877   :type 'boolean
878   :group 'howm-create)
879
880 (defcustom howm-create-here-just nil
881   "*Non nil if `howm-create-here' should insert new entry into cursor position
882 rather than append or prepend."
883   :type '(radio (const :tag "Append or prepend" nil)
884                 (const :tag "Just here" t))
885   :group 'howm-create)
886
887 (defcustom howm-remember-first-line-to-title nil
888   "If non-nil, the first line in `howm-remember' is set to %title
889 and the rest lines are inserted to the position at %cursor in `howm-template.
890 If nil, all the lines are simply inserted at %cursor."
891   :type 'boolean
892   :group 'howm-create)
893
894 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
895 ;; Viewer
896
897 (defgroup howm-viewer nil
898   "External viewers for images, movies, sounds, etc."
899   :group 'howm-misc)
900
901 (defun howm-try-require (feature)
902   (and (locate-library (symbol-name feature))
903        (require feature)))
904
905 ;; These variables should be renamed.
906
907 (howm-defcustom-risky howm-view-external-viewer-assoc nil
908   "List of viewer specifications.
909 Each specification must be a cons pair of type and format.
910 Type is a regular expression of file names.
911 Format is a command string in which %s is replaced with file name.
912 This setting is prior to mailcap.
913
914 This variable is marked as a risky local variable
915 because `howm-viewer-dispatchers' `howm-viewer-indicator'
916 and `howm-viewer-type' accept functions instead of format strings.
917
918 Example:
919   (setq howm-view-external-viewer-assoc
920         '(
921           (\"[.]\\(jpg\\|gif\\|png\\)$\" . \"display %s\")
922           (\"[.]dvi$\" . \"xdvi %s\")
923          ))
924 "
925   :type '(alist :key-type regexp :value-type string)
926   :group 'howm-viewer)
927
928 (defcustom howm-view-use-mailcap
929   (and (howm-try-require 'mailcap)
930        (fboundp 'mailcap-parse-mailcaps)
931        (fboundp 'mailcap-parse-mimetypes))
932   "*Non nil if external viewers should be selected according to mailcap.
933 Mailcap processing depends on gnus/mailcap, and old FLIM library may
934 cause conflicts."
935   :type 'boolean
936   :group 'howm-viewer)
937
938 (defcustom howm-view-open-by-myself '("text/.*" "application/emacs-lisp")
939   "List of regular expressions for mime types which should be opened normally."
940   :type '(repeat regexp)
941   :group 'howm-viewer)
942
943 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
944 ;; Narrow
945
946 (defgroup howm-narrow nil
947   "Narrowing to each entry."
948   :group 'howm-misc)
949
950 (defcustom howm-auto-narrow t
951   "List of commands after which the function `howm-auto-narrow' can work.
952 If the value is t, it means 'always'."
953   :type `(radio (const :tag "Never" nil)
954                 (const :tag "Always" t)
955                 ,howm-custom-command-list)
956   :group 'howm-narrow)
957
958 (mapc (lambda (hook) (custom-add-option hook 'howm-auto-narrow))
959       '(howm-view-open-hook howm-create-hook))
960
961 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
962 ;; Efficiency
963
964 (defgroup howm-efficiency nil
965   "To improve performance, use grep and turn off expensive options."
966   :group 'howm)
967
968 (defcustom howm-refresh-after-save t
969   "*Redraw links after you save howm note."
970   :type 'boolean
971   :group 'howm-efficiency)
972
973 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
974 ;; Face
975
976 (defgroup howm-faces nil
977   "Colors and fonts."
978   :group 'faces
979   :group 'howm)
980
981 (howm-defcustom-risky howm-user-font-lock-keywords nil
982   "Font lock keywords for all howm-related buffers.
983 See help of `font-lock-keywords' for details.
984 Note: `howm-menu-font-lock-rules' overrides this variable."
985   ;;   :type '(repeat (radio (cons regexp (list (const quote) face))
986   ;;                         sexp))
987   :type 'sexp
988   :group 'howm-faces)
989
990 (defcustom howm-use-color t
991   "*If non-nil, highlight tags in howm-mode verbosely."
992   :type 'boolean
993   :group 'howm-faces)
994
995 (defface howm-view-hilit-face
996   '((((class color)) (:foreground "red"))
997     (t ()))
998   "*Face for matched word."
999   :group 'howm-faces)
1000
1001 (defface howm-view-name-face
1002   '((((class color)) (:foreground "white" :background "blue"))
1003     (t ()))
1004   "*Face for file name in summary buffer."
1005   :group 'howm-faces)
1006
1007 (defface howm-view-empty-face
1008   '((((class color)) (:background "midnight blue"))
1009     (t ()))
1010   "*Face for empty field in summary buffer."
1011   :group 'howm-faces)
1012
1013 (defface howm-mode-title-face ;; =
1014   '((((class color)) (:foreground "RoyalBlue"))
1015     (t ()))
1016   "*Face for title."
1017   :group 'howm-faces)
1018 (defface howm-mode-ref-face ;; >>>
1019   '((((class color) (background light)) (:foreground "blue"))
1020     (((class color) (background dark)) (:foreground "cyan"))
1021     (t ()))
1022   "*Face for goto link."
1023   :group 'howm-faces)
1024 (defface howm-mode-keyword-face ;; <<<
1025   '((((class color)) (:foreground "white" :background "blue"))
1026     (t ()))
1027   "*Face for come-from link."
1028   :group 'howm-faces)
1029 (defface howm-mode-wiki-face ;; [[]]
1030   '((((class color) (background light)) (:foreground "blue"))
1031     (((class color) (background dark)) (:foreground "cyan"))
1032     (t ()))
1033   "*Face for wiki link."
1034   :group 'howm-faces)
1035
1036 (defface howm-reminder-normal-face
1037   '((((class color)) (:foreground "blue"))
1038     (t ()))
1039   "*Face for normal reminder."
1040   :group 'howm-faces)
1041 (defface howm-reminder-todo-face
1042   '((((class color) (background light)) (:foreground "purple"))
1043     (((class color) (background dark)) (:foreground "yellow"))
1044     (t ()))
1045   "*Face for todo."
1046   :group 'howm-faces)
1047 (defface howm-reminder-defer-face
1048   '((((class color)) (:foreground "magenta"))
1049     (t ()))
1050   "*Face for defer."
1051   :group 'howm-faces)
1052 (defface howm-reminder-deadline-face
1053   '((((class color)) (:foreground "red"))
1054     (t ()))
1055   "*Face for deadline."
1056   :group 'howm-faces)
1057 (defface howm-reminder-late-deadline-face
1058   '((((class color)) (:background "red" :foreground "black"))
1059     (t ()))
1060   "*Face for late deadline."
1061   :group 'howm-faces)
1062 (defface howm-reminder-schedule-face
1063   '((((class color) (background light)) (:foreground "dark green"))
1064     (((class color) (background dark)) (:foreground "green"))
1065     (t ()))
1066   "*Face for schedule."
1067   :group 'howm-faces)
1068 (defface howm-reminder-done-face
1069   '((((class color) (background light)) ())
1070     (((class color) (background dark)) (:foreground "gray"))
1071     (t ()))
1072   "*Face for done reminder."
1073   :group 'howm-faces)
1074 (defface howm-reminder-today-face
1075   '((((class color)) (:foreground "black" :background "orange"))
1076     (t ()))
1077   "*Face for today."
1078   :group 'howm-faces)
1079 (defface howm-reminder-tomorrow-face
1080   '((((class color)) (:foreground "black" :background "pink"))
1081     (t ()))
1082   "*Face for tommorow."
1083   :group 'howm-faces)
1084
1085 (defface howm-menu-list-face ;; item header in menu-mode list (schedule, todo)
1086   '((t ()))
1087   "*Face for list in menu."
1088   :group 'howm-faces)
1089 (defface howm-menu-key-face ;; shortcut key in menu-mode
1090   '((((class color) (background light)) (:foreground "dark red"))
1091     (((class color) (background dark)) (:foreground "orange"))
1092     (t ()))
1093   "*Face for key binding in menu."
1094   :group 'howm-faces)
1095
1096 (defvar howm-view-hilit-face 'howm-view-hilit-face
1097   "*Face for matched word.")
1098 (defvar howm-view-name-face  'howm-view-name-face
1099   "*Face for file name in summary buffer.")
1100 (defvar howm-view-empty-face 'howm-view-empty-face
1101   "*Face for empty field in summary buffer.")
1102 (defvar howm-mode-title-face   'howm-mode-title-face
1103   "*Face for title.")
1104 (defvar howm-mode-ref-face     'howm-mode-ref-face
1105   "*Face for goto link.")
1106 (defvar howm-mode-keyword-face 'howm-mode-keyword-face
1107   "*Face for come-from link.")
1108 (defvar howm-mode-wiki-face    'howm-mode-wiki-face
1109   "*Face for wiki link.")
1110 (defvar howm-reminder-normal-face   'howm-reminder-normal-face
1111   "*Face for normal reminder.")
1112 (defvar howm-reminder-todo-face     'howm-reminder-todo-face
1113   "*Face for todo.")
1114 (defvar howm-reminder-defer-face    'howm-reminder-defer-face
1115   "*Face for defer.")
1116 (defvar howm-reminder-deadline-face 'howm-reminder-deadline-face
1117   "*Face for deadline.")
1118 (defvar howm-reminder-late-deadline-face 'howm-reminder-late-deadline-face
1119   "*Face for late deadline.")
1120 (defvar howm-reminder-schedule-face 'howm-reminder-schedule-face
1121   "*Face for schedule.")
1122 (defvar howm-reminder-done-face     'howm-reminder-done-face
1123   "*Face for done reminder.")
1124 (defvar howm-reminder-today-face    'howm-reminder-today-face
1125   "*Face for today.")
1126 (defvar howm-reminder-tomorrow-face 'howm-reminder-tomorrow-face
1127   "*Face for tommorow.")
1128 (defvar howm-menu-list-face 'howm-menu-list-face
1129   "*Face for list in menu.")
1130 (defvar howm-menu-key-face  'howm-menu-key-face
1131   "*Face for key binding in menu.")
1132
1133 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1134 ;; Hook
1135
1136 (defgroup howm-hooks nil
1137   "Hooks."
1138   :group 'howm)
1139
1140 (defcustom howm-mode-hook nil
1141   "Hook run at the end of function `howm-mode'"
1142   :type 'hook
1143   :group 'howm-hooks)
1144
1145 (defcustom howm-mode-on-hook nil
1146   "Hook run when `howm-mode' is turned on."
1147   :type 'hook
1148   :group 'howm-hooks)
1149
1150 (defcustom howm-mode-off-hook nil
1151   "Hook run when `howm-mode' is turned off."
1152   :type 'hook
1153   :group 'howm-hooks)
1154
1155 (defcustom howm-view-open-hook nil
1156   "Hook run when open a note from summary/contents buffer."
1157   :type 'hook
1158   :group 'howm-narrow
1159   :group 'howm-hooks)
1160
1161 (defcustom howm-view-before-open-hook nil
1162   "Hook run before open something from summary or contents buffer."
1163   :type 'hook
1164   :group 'howm-hooks)
1165
1166 (defcustom howm-create-file-hook nil
1167   "Hook run when buffer for new note is created."
1168   :type 'hook
1169   :group 'howm-hooks)
1170
1171 (defcustom howm-create-hook nil
1172   "Hook run after new note is created and set up."
1173   :type 'hook
1174   :group 'howm-narrow
1175   :group 'howm-hooks)
1176
1177 (defcustom howm-menu-hook nil
1178   "Hook run at the end of `howm-menu-refresh'."
1179   :type 'hook
1180   :group 'howm-hooks)
1181
1182 (defcustom howm-congrats-hook nil
1183   "Hook run at the end of `howm-congrats'."
1184   :type 'hook
1185   :group 'howm-hooks)
1186
1187 (defcustom howm-after-save-hook nil
1188   "Hook run at the end of `howm-after-save'."
1189   :type 'hook
1190   :group 'howm-hooks)
1191
1192 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1193 ;; Devel
1194
1195 (defgroup howm-devel nil
1196   "Developers' diagnoses."
1197   :group 'howm)
1198
1199 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1200 ;; Experimental
1201
1202 (defgroup howm-experimental nil
1203   "Test of experimental features."
1204   :group 'howm)
1205
1206 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1207 ;; Date format (need refactoring)
1208
1209 (defvar howm-date-separator "-") ;; "-" ==> 2003-10-21
1210
1211 ;; Fix me: redundant (howm-date-* & howm-reminder-*)
1212 ;; (cf.) howm-reminder-regexp-grep-* howm-reminder-today-format
1213 (defvar howm-date-regexp-grep
1214   (concat "[1-2][0-9][0-9][0-9]" howm-date-separator
1215           "[0-1][0-9]" howm-date-separator
1216           "[0-3][0-9]"))
1217 (defvar howm-date-regexp
1218   (concat "\\([1-2][0-9][0-9][0-9]\\)" howm-date-separator
1219           "\\([0-1][0-9]\\)" howm-date-separator
1220           "\\([0-3][0-9]\\)"))
1221 (defvar howm-date-regexp-year-pos 1)
1222 (defvar howm-date-regexp-month-pos 2)
1223 (defvar howm-date-regexp-day-pos 3)
1224 (defvar howm-date-format
1225   (concat "%Y" howm-date-separator "%m" howm-date-separator "%d"))
1226 (defvar howm-dtime-body-format
1227   (concat howm-date-format " %H:%M"))
1228 (defvar howm-dtime-format
1229   (concat "[" howm-dtime-body-format "]"))
1230 (defvar howm-insert-date-format "[%s]")
1231 (defvar howm-insert-date-future nil)
1232
1233 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1234 ;; Avoid reference to free variable (need refactoring)
1235
1236 (howm-defvar-risky howm-menu-action-arg 'howm-menu-action-arg-name)
1237
1238 ;;;
1239
1240 (provide 'howm-vars)
1241
1242 ;;; howm-vars.el ends here