OSDN Git Service

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