OSDN Git Service

6795d088fc7120cd227731aa7254a7fa9d51ff5c
[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   (if (or (and (boundp 'current-language-environment)
244                (string= current-language-environment "Japanese"))
245           (string-match "^ja" (howm-get-locale)))
246       'ja
247     'en)
248   "*Language of menu."
249   :type '(radio (const en) (const ja))
250   :group 'howm-menu)
251
252 (howm-defcustom-risky howm-menu-file nil
253   "*Specify menu file explicitly, or set as nil to search every time."
254   :type '(radio (const :tag "Search every time" nil)
255                 (const "0000-00-00-000000.txt")
256                 file)
257   :group 'howm-files
258   :group 'howm-efficiency
259   :group 'howm-menu)
260
261 (defcustom howm-menu-expiry-hours 0
262   "*Cache menu contents for this number of hours."
263   :type 'number
264   :group 'howm-efficiency
265   :group 'howm-menu)
266
267 (defcustom howm-menu-refresh-after-save t
268   "*If non-nil, refresh menu contents after you save howm note."
269   :type 'boolean
270   :group 'howm-efficiency
271   :group 'howm-menu)
272
273 (defcustom howm-menu-name-format "*howmM:%s*"
274   "*Name format of menu buffer."
275   :type '(radio (const :tag "Never show in normal buffer list" " *howmM:%s*")
276                 string)
277   :group 'howm-menu)
278
279 (defcustom howm-menu-footer nil
280   "Footer string for each menu. Nil means no footer."
281   :type '(radio (const :tag "Off" nil)
282                 string)
283   :group 'howm-menu)
284
285 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
286 ;; Reminder
287
288 (defgroup howm-reminder nil
289   "Schedule and todo list."
290   :group 'howm)
291
292 (defvar howm-reminder-old-format nil)
293
294 (defvar howm-reminder-marks
295   ;; Be careful to order of characters.
296   ;; "-" must be first so that regexp "[-+~!@.]" makes sense.
297   (if howm-reminder-old-format "-+~!@. " "-+~!@."))
298 (defvar howm-reminder-types
299   (format "[%s]" howm-reminder-marks))
300
301 (defun howm-custom-reminder-get-types (symbol)
302   (let ((reg (default-value symbol))
303         (default-types (split-string howm-reminder-marks "")))
304     ;; return list of types for standard cases
305     ;; and string itself for nonstandard cases
306     (if (not (string-match "^\\[\\(.*\\)\\]" reg))
307         reg
308       (let ((types (split-string (match-string-no-properties 1 reg) "")))
309         (if (cl-find-if-not (lambda (x) (member x default-types))
310                                  types)
311             reg
312           (cl-remove-if-not (lambda (x) (member x types))
313                                  default-types))))))
314 (defun howm-custom-reminder-set-types (symbol types)
315   (when (listp types)
316     (setq types (apply #'concat `("[" ,@types "]"))))
317   (set-default symbol types))
318 (defun howm-custom-reminder-list-types ()
319   `(radio (set ,@(mapcar (lambda (ty) (list 'const ty))
320                          (split-string howm-reminder-marks "")))
321           string))
322
323 (defcustom howm-schedule-types "[!@.]"
324   "*Regular expression of reminder types which are listed as schedule."
325   :get #'howm-custom-reminder-get-types
326   :set #'howm-custom-reminder-set-types
327   :type (howm-custom-reminder-list-types)
328   :group 'howm-efficiency
329   :group 'howm-reminder)
330
331 (defcustom howm-todo-types
332   (if howm-reminder-old-format "[-+~! .]" "[-+~!.]")
333   "*Regular expression of reminder types which are listed as todo."
334   :get #'howm-custom-reminder-get-types
335   :set #'howm-custom-reminder-set-types
336   :type (howm-custom-reminder-list-types)
337   :group 'howm-efficiency
338   :group 'howm-reminder)
339
340 (defcustom howm-congrats-format '("Finished %s tasks!")
341   "List of format strings to generate message when a reminder is finished.
342 One of elements is chosen randomly every time."
343   :type '(repeat string)
344   :group 'howm-reminder)
345
346 (howm-defcustom-risky howm-congrats-command nil
347   "*If non-nil, this command is executed when a reminder is finished.
348 Example: (\"play\" \"~/sound/fanfare.wav\") for calling the command
349 \"play ~/sound/fanfare.wav\"."
350   :type '(repeat string)
351   :group 'howm-reminder)
352
353 (defcustom howm-reminder-cancel-string "cancel"
354   "*This string is inserted automatically when a reminder is canceled."
355   :type 'string
356   :group 'howm-reminder)
357
358 (defcustom howm-action-lock-forward-save-buffer nil
359   "*Non nil if direct manipulation on reminder list should cause auto-save."
360   :type 'boolean
361   :group 'howm-reminder)
362
363 (defcustom howm-action-lock-forward-kill-buffer nil
364   "*Non nil if direct manipulation on reminder list should cause kill-buffer.
365 Be careful that you cannot undo the result of action-lock after kill-buffer."
366   :type 'boolean
367   :group 'howm-reminder)
368
369 (howm-if-ver1dot3 0
370   (defcustom howm-action-lock-forward-fuzziness 5
371     "*Maximum lines of permitted inconsistency for `howm-action-lock-forward'."
372     :type 'integer
373     :group 'howm-reminder))
374
375 (let* ((sep "- - - - - - - - - - - - - - - - - - -")
376        (reminder-default `((-1 . ,sep) (0 . ,sep) (nil . ,sep)))
377        (todo-default `((0 . ,sep) (nil . ,sep))))
378   (howm-if-ver1dot3 nil
379     (defcustom howm-menu-reminder-separators reminder-default
380       "Assoc list to specify positions and strings of separators in reminder
381 in menu. For each element, car is days from now, and cdr is separator string.
382 If car is nil, it means the border between schedule and todo.
383 This option is prepared for `howm-menu-reminder'."
384       :type `(radio (const :tag "No separators" nil)
385                     (const :tag "Default separators" ,reminder-default)
386                     (alist :key-type
387                            (radio number
388                                   (const :tag "Between schedule and todo" nil))
389                            :value-type string))
390       :group 'howm-reminder))
391   (defcustom howm-todo-separators nil
392     "Assoc list to specify positions and strings of separators in todo buffer.
393 For each element, car is priority and cdr is separator string.
394 If car is nil, it means the border between active and sleeping reminders."
395     :type `(radio (const :tag "No separators" nil)
396                   (const :tag "Default separators" ,todo-default)
397                   (alist :key-type number
398                          :value-type string))
399     :group 'howm-reminder))
400
401 (howm-if-ver1dot3 nil
402   (defcustom howm-schedule-sort-by-time t
403     "Non nil if `howm-schedule-sort-converter' should consider time part."
404     :type 'boolean
405     :group 'howm-reminder))
406
407 (defcustom howm-reminder-menu-types
408   (if howm-reminder-old-format "[-+~!@ ]" "[-+~!@]")
409   "*Regular expression of reminder types which are shown in menu."
410   :get #'howm-custom-reminder-get-types
411   :set #'howm-custom-reminder-set-types
412   :type (howm-custom-reminder-list-types)
413   :group 'howm-reminder)
414
415 ;;;
416 ;;; Menu reminder
417 ;;;
418
419 (defgroup howm-menu-reminder nil
420   "Reminders shown in menu."
421   :group 'howm-menu
422   :group 'howm-reminder)
423
424 (defcustom howm-schedule-menu-types "[!@]"
425   "*Regular expression of reminder types which are shown in menu as schedule."
426   :get #'howm-custom-reminder-get-types
427   :set #'howm-custom-reminder-set-types
428   :type (howm-custom-reminder-list-types)
429   :group 'howm-efficiency
430   :group 'howm-menu-reminder)
431
432 (defcustom howm-todo-menu-types
433   (if howm-reminder-old-format "[-+~! .]" "[-+~!.]")
434   "*Regular expression of reminder types which are shown in menu as todo."
435   :get #'howm-custom-reminder-get-types
436   :set #'howm-custom-reminder-set-types
437   :type (howm-custom-reminder-list-types)
438   :group 'howm-efficiency
439   :group 'howm-menu-reminder)
440
441 (defcustom howm-menu-schedule-days 7
442   "*Show schedule in menu until this number of days from now."
443   :type 'number
444   :group 'howm-menu-reminder)
445
446 (defcustom howm-menu-schedule-days-before 0
447   "*Show schedule in menu from this number of days ago."
448   :type 'number
449   :group 'howm-menu-reminder)
450
451 (defcustom howm-menu-todo-num 50
452   "*Maximum number of todo items shown in menu."
453   :type 'number
454   :group 'howm-menu-reminder)
455
456 (defvar howm-huge- 66666)
457 (defvar howm-huge 77777)
458 (defvar howm-huge+ 88888)
459 (defvar howm-huge++ 99999)
460
461 (defcustom howm-menu-todo-priority (- howm-huge+)
462   "*Limit priority for elimination of reminders in menu."
463   :type `(radio (const :tag "Show sleeping reminders",(- howm-huge+))
464                 (const :tag "Hide sleeping reminders" ,(- howm-huge-))
465                 number)
466   :group 'howm-menu-reminder)
467
468 (defcustom howm-todo-priority-done-bottom (- howm-huge+)
469   "*Base priority of done reminder.
470 <priority of done reminder> = <this value> + <days from specified date>"
471   :type `(radio (const :tag "Deeper than sleeping reminders" ,(- howm-huge+))
472                 (const :tag "Shallower than sleeping reminders"
473                        ,(- howm-huge-))
474                 number)
475   :group 'howm-menu-reminder)
476
477 (defcustom howm-menu-recent-num 20
478   "*Maximum number of recent items shown in menu."
479   :type 'number
480   :group 'howm-menu-reminder)
481
482 (defcustom howm-menu-recent-regexp nil
483   "Regexp which is regarded as title line in recent list in menu.
484 When it is nil, `howm-view-title-regexp' is used."
485   :type '(radio (const :tag "Default" nil)
486                 regexp)
487   :group 'howm-title
488   :group 'howm-menu-reminder)
489
490 (defcustom howm-menu-todo-priority-format nil
491   "*Format for priority display in todo list in menu, or nil for no display."
492   :type '(radio (const :tag "Off" nil)
493                 (const "(%8.1f)")
494                 string)
495   :group 'howm-devel
496   :group 'howm-menu-reminder)
497
498 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
499 ;; List
500
501 (defgroup howm-list nil
502   "Style of list view."
503   :group 'howm)
504
505 (defcustom howm-view-contents-limit nil
506   "*Max length for howm-view-contents. Nil means no limit."
507   :type '(radio (const :tag "No limit" nil)
508                 integer)
509   :group 'howm-list)
510
511 (defcustom howm-view-summary-keep-cursor t
512   "*If non-nil, keep cursor position when you open a note from summary list."
513   :type 'boolean
514   :group 'howm-list)
515
516 (defcustom howm-view-summary-omit-same-name t
517   "*If non-nil, same name is not written repeatedly in summary list."
518   :type 'boolean
519   :group 'howm-list)
520
521 (defcustom howm-list-recent-days 7
522   "*This number of days are listed by `howm-list-recent'."
523   :type 'integer
524   :group 'howm-list)
525
526 (defcustom howm-list-buffers-exclude
527   '("*Messages*" ".howm-keys" ".howm-history")
528   "*List of excluded buffer names for `howm-list-buffers'."
529   :type '(repeat string)
530   :group 'howm-list)
531
532 ;;
533 ;; Sort
534 ;;
535
536 (defgroup howm-sort nil
537   "Sorting and filtering of matched entries."
538   :group 'howm-list)
539
540 (howm-defcustom-risky howm-list-normalizer nil
541   "*Obsolete. Use `howm-normalizer' insteadly."
542   :type '(radio (const :tag "Off (strongly recommended)" nil)
543                 (function-item :tag "Sort by edit-time"
544                                howm-view-sort-by-mtime)
545                 (function-item :tag "Sort by create-time"
546                                howm-view-sort-by-reverse-date)
547                 function)
548   :group 'howm-sort)
549
550 (howm-defcustom-risky howm-normalizer 'howm-sort-items-by-mtime
551   "*Default method to list matched notes.
552 For backward compatibility, this value is overridden
553 if `howm-list-normalizer' is non-nil."
554   :type '(radio (function-item :tag "Sort by edit-time"
555                                howm-sort-items-by-mtime)
556                 (function-item :tag "Sort by create-time"
557                                howm-sort-items-by-reverse-date)
558                 function)
559   :group 'howm-sort)
560
561 (defcustom howm-list-prefer-word nil
562   "*Matches to whole word are listed first in summary buffer."
563   :type 'boolean
564   :group 'howm-sort)
565
566 (defcustom howm-list-prefer-wiki t
567   "*Matches to wiki tags are listed first in summary buffer."
568   :type 'boolean
569   :group 'howm-sort)
570
571 ;;
572 ;; Title
573 ;;
574
575 (defgroup howm-title nil
576   "Title of each entry."
577   :group 'howm-list)
578
579 ;; I don't know the way to generate this list automatically. Sigh...
580 (defvar howm-custom-command-list
581   `(set ,@(mapcar (lambda (com) (list 'const com))
582                   '(howm-list-all
583                     howm-list-recent
584                     howm-list-around
585                     howm-keyword-search
586                     howm-list-grep
587                     howm-list-grep-fixed
588                     howm-list-migemo
589                     howm-list-related
590                     howm-action-lock-date-search
591                     ))))
592
593 (howm-defcustom-risky howm-list-title
594   '(
595     howm-list-all
596     howm-list-recent
597     howm-list-around
598     ; howm-keyword-search
599     ; howm-list-grep howm-list-grep-fixed howm-list-migemo
600     ; howm-list-related
601     howm-action-lock-date-search
602     )
603   "List of commands in which titles are listed instead of matched lines.
604 T means 'always'.
605 If it is a function, the evaluated value is used instead of itself."
606   :type `(radio (const :tag "Always" t)
607                 (const :tag "Never" nil)
608                 ,howm-custom-command-list
609 ;;                 (set (const howm-list-all)
610 ;;                      (const howm-list-recent)
611 ;;                      (const howm-list-around)
612 ;;                      (const howm-keyword-search)
613 ;;                      (const howm-list-grep)
614 ;;                      (const howm-list-grep-fixed)
615 ;;                      (const howm-list-migemo)
616 ;;                      (const howm-list-related))
617                 function)
618   :group 'howm-efficiency
619   :group 'howm-title)
620
621 (defcustom howm-list-title-regexp nil
622   "Regexp which is regarded as title line in summary buffer.
623 When it is nil, `howm-view-title-regexp' is used."
624   :type '(radio (const :tag "Default" nil)
625                 regexp)
626   :group 'howm-title)
627
628 (defcustom howm-list-title-undo t
629   "*Non-nil if `howm-list-toggle-title' should toggle whether title is shown
630 or not."
631   :type 'boolean
632   :group 'howm-efficiency
633   :group 'howm-title)
634
635 ;;
636 ;; BufWin
637 ;;
638
639 (defgroup howm-list-bufwin nil
640   "Buffers and windows for listing search result."
641   :group 'howm-list)
642
643 (defcustom howm-view-summary-name "*howmS*"
644   "Format string of buffer name for summary.
645 %s is replaced with searched string. See `format'."
646   :type '(radio (const :tag "Use one common buffer" "*howmS*")
647                 (const :tag "Make new buffer for each search" "*howmS:%s*")
648                 string)
649   :group 'howm-list-bufwin)
650
651 (defcustom howm-view-contents-name "*howmC*"
652   "Format string of buffer name for contents.
653 %s is replaced with searched string. See `format'."
654   :type '(radio (const :tag "Use one common buffer" "*howmC*")
655                 (const :tag "Make new buffer for each search" "*howmC:%s*")
656                 string)
657   :group 'howm-list-bufwin)
658
659 (howm-defcustom-risky howm-view-summary-persistent t
660   "*If non-nil, keep summary buffer on howm-view-summary-open by default.
661 If it is a function, the evaluated value is used instead of itself."
662   :type 'boolean
663   :group 'howm-list-bufwin)
664
665 (howm-defcustom-risky howm-view-contents-persistent t
666   "*If non-nil, keep contents buffer on howm-view-contents-open by default.
667 If it is a function, the evaluated value is used instead of itself."
668   :type 'boolean
669   :group 'howm-list-bufwin)
670
671 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
672 ;; Search
673
674 (defgroup howm-search nil
675   "Search methods."
676   :group 'howm)
677
678 (defcustom howm-keyword-case-fold-search nil
679   "*Non-nil if searches of come-from keywords should ignore case."
680   :type 'boolean
681   :group 'howm-search)
682
683 (defcustom howm-check-word-break nil
684   "*Non-nil if come-from keywords within a word should not linked.
685 When the value is a string (regexp), word breaks are checked
686 only for matched keywords. "
687   :type '(radio (const :tag "Always" t)
688                 (const :tag "Never" nil)
689                 (const :tag "ASCII only" "^[[:ascii:]]+$")
690                 string)
691   :group 'howm-search)
692
693 (defcustom howm-view-update-search-ring nil
694   "*Non-nil if search-ring should be updated in howm search."
695   :type 'boolean
696   :group 'howm-search)
697
698 (defcustom howm-message-time nil
699   "*Non nil if search etc. should show took time."
700   :type 'boolean
701   :group 'howm-devel
702   :group 'howm-search)
703
704 (howm-defcustom-risky howm-history-file "~/.howm-history"
705   "*Search history is recorded to that file."
706   :type 'file
707   :group 'howm-files
708   :group 'howm-search)
709
710 (defcustom howm-history-limit 50
711   "*Limit number of recorded search history, or nil for no limit.
712 Set 0 to inhibit recording."
713   :type '(radio (const :tag "No limit" nil)
714                 integer)
715   :group 'howm-search)
716
717 (defcustom howm-history-unique t
718   "*If non-nil, duplicated entries are removed from search history."
719   :type 'boolean
720   :group 'howm-search)
721
722 (defcustom howm-keyword-list-alias-sep "\t"
723   "*Separator string for alias keywords in the keyword file `howm-keyword-file'.
724 If it is nil, alias of come-from keyword is disabled."
725   :type '(radio (const :tag "Disable aliases" nil)
726                 (const :tag "Tab" "\t")
727                 string)
728   :group 'howm-search)
729
730 (defcustom howm-keyword-aliases-recursive t
731   "*Non nil if aliases of come-from keywords should be expanded recursively."
732   :type 'boolean
733   :group 'howm-search)
734
735 ;;;
736 ;;; grep
737 ;;;
738
739 (defgroup howm-grep nil
740   "Use external grep command for fast search."
741   :group 'howm-efficiency
742   :group 'howm-search)
743
744 (howm-defcustom-risky howm-view-use-grep nil
745   "*If non-nil, use external grep command for search.
746 Performance must be improved greatly if you set this.
747 When the value is elisp function, it is used instead of `howm-fake-grep'."
748   :type '(radio (const :tag "On" t)
749                 (const :tag "Off" nil)
750                 function)
751   :group 'howm-grep)
752
753 ;; These variables should be renamed: howm-view-xxx ==> howm-xxx.
754 (howm-defcustom-risky howm-view-grep-command "grep"
755   "*Command name for grep."
756   :type 'string
757   :group 'howm-grep)
758 (howm-defvar-risky howm-view-fgrep-command nil
759   "*Command name for fgrep.
760 This variable is obsolete and may be removed in future.")
761 (defvar howm-view-grep-default-option
762   ;; "labels" causes a trouble in git-head emacs (d5e3922) [2015-01-31]
763   (let* ((ed (lambda (d) (concat "--exclude-dir=" d)))
764          (has-ed (condition-case nil
765                      (eq 0 (call-process howm-view-grep-command nil nil nil
766                                          (apply ed "/") "--version"))
767                      (error nil)))
768          (opts (cons "-Hnr" (and has-ed (mapcar ed howm-excluded-dirs)))))
769     (mapconcat #'identity opts " ")))
770 (howm-defcustom-risky howm-view-grep-option howm-view-grep-default-option
771   "*Common grep option for howm."
772   :type `(radio (const :tag "scan all files"
773                        ,howm-view-grep-default-option)
774                 (const :tag "scan *.howm only"
775                        ,(concat howm-view-grep-default-option
776                                 " --include=*.howm"))
777                 string)
778   :group 'howm-grep)
779 (howm-defcustom-risky howm-view-grep-extended-option "-E"
780   "*Grep option for extended regular expression."
781   :type 'string
782   :group 'howm-grep)
783 (howm-defcustom-risky howm-view-grep-fixed-option "-F"
784   "*Grep option to search fixed strings."
785   :type 'string
786   :group 'howm-grep)
787 (howm-defcustom-risky howm-view-grep-ignore-case-option "-i"
788   "*Grep option for ignoring case distinctions."
789   :type 'string
790   :group 'howm-grep)
791 (howm-defcustom-risky howm-view-grep-expr-option "-e"
792   "*Grep option for pattern."
793   :type 'string
794   :group 'howm-grep)
795 (howm-defcustom-risky howm-view-grep-file-stdin-option "-f -"
796   "*Grep option for receiving patterns from standard input.
797 If this is nil, pattern is received as command line argument."
798   :type '(radio (const :tag "Off" nil)
799                 string)
800   :group 'howm-grep)
801
802 (howm-defcustom-risky howm-command-length-limit 10000
803   "*Maximum length of command line for call-process."
804   :type 'integer
805   :group 'howm-grep)
806
807 (defcustom howm-process-coding-system nil
808   "*Default coding system for grep command in howm.
809 If the value is a symbol, it is used for both read and write.
810 If the value is a cons pair, its car and cdr are used for read and write,
811 respectively.
812
813 Example:
814  (setq howm-process-coding-system 'euc-japan-unix)
815  (setq howm-process-coding-system '(utf-8-unix . sjis-unix))"
816   :type '(radio (const :tag "Off" nil)
817                 coding-system
818                 (cons coding-system coding-system))
819   :group 'howm-grep)
820
821 (howm-if-ver1dot3 nil
822   (defcustom howm-occur-force-fake-grep t
823     "*If non-nil, force `howm-occur' to use `howm-fake-grep'
824 so that highlighting works correctly."
825     :type 'boolean
826     :group 'howm-grep))
827
828 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
829 ;; Misc
830
831 (defgroup howm-misc nil
832   "Miscellaneous customization."
833   :group 'howm)
834
835 (defvar howm-prefix "\C-c,"
836   "Howm commands are invoked by this prefix + some keys.")
837
838 (defcustom howm-random-walk-wait 2
839   "*Seconds of wait in `howm-random-walk'."
840   :type 'number
841   :group 'howm-misc)
842
843 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
844 ;; Create
845
846 (defgroup howm-create nil
847   "Create new note."
848   :group 'howm-misc)
849
850 (defcustom howm-prepend nil
851   "*Non nil if new entries should be prepended to previous entries.
852 Otherwise, they are appended."
853   :type '(radio (const :tag "Append" nil)
854                 (const :tag "Prepend" t))
855   :group 'howm-create)
856
857 (defcustom howm-content-from-region nil
858   "*When the value non-nil, selected string is inserted as default content.
859 Unless the value is t, single-line selection is inserted as title instead.
860 This variable is ignored when `transient-mark-mode' is nil."
861   :type '(radio (const :tag "Off" nil)
862                 (const :tag "Single line selection is copied as title" 1)
863                 (const :tag "Any selection is copied as content" t))
864   :group 'howm-create)
865
866 (defcustom howm-title-from-search nil
867   "*Non nil if searched keyword is inserted as default title
868 when `howm-create' is called on summary buffer."
869   :type 'boolean
870   :group 'howm-create)
871
872 (defcustom howm-create-here-just nil
873   "*Non nil if `howm-create-here' should insert new entry into cursor position
874 rather than append or prepend."
875   :type '(radio (const :tag "Append or prepend" nil)
876                 (const :tag "Just here" t))
877   :group 'howm-create)
878
879 (defcustom howm-remember-first-line-to-title nil
880   "If non-nil, the first line in `howm-remember' is set to %title
881 and the rest lines are inserted to the position at %cursor in `howm-template.
882 If nil, all the lines are simply inserted at %cursor."
883   :type 'boolean
884   :group 'howm-create)
885
886 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
887 ;; Viewer
888
889 (defgroup howm-viewer nil
890   "External viewers for images, movies, sounds, etc."
891   :group 'howm-misc)
892
893 (defun howm-try-require (feature)
894   (and (locate-library (symbol-name feature))
895        (require feature)))
896
897 ;; These variables should be renamed.
898
899 (howm-defcustom-risky howm-view-external-viewer-assoc nil
900   "List of viewer specifications.
901 Each specification must be a cons pair of type and format.
902 Type is a regular expression of file names.
903 Format is a command string in which %s is replaced with file name.
904 This setting is prior to mailcap.
905
906 This variable is marked as a risky local variable
907 because `howm-viewer-dispatchers' `howm-viewer-indicator'
908 and `howm-viewer-type' accept functions instead of format strings.
909
910 Example:
911   (setq howm-view-external-viewer-assoc
912         '(
913           (\"[.]\\(jpg\\|gif\\|png\\)$\" . \"display %s\")
914           (\"[.]dvi$\" . \"xdvi %s\")
915          ))
916 "
917   :type '(alist :key-type regexp :value-type string)
918   :group 'howm-viewer)
919
920 (defcustom howm-view-use-mailcap
921   (and (howm-try-require 'mailcap)
922        (fboundp 'mailcap-parse-mailcaps)
923        (fboundp 'mailcap-parse-mimetypes))
924   "*Non nil if external viewers should be selected according to mailcap.
925 Mailcap processing depends on gnus/mailcap, and old FLIM library may
926 cause conflicts."
927   :type 'boolean
928   :group 'howm-viewer)
929
930 (defcustom howm-view-open-by-myself '("text/.*" "application/emacs-lisp")
931   "List of regular expressions for mime types which should be opened normally."
932   :type '(repeat regexp)
933   :group 'howm-viewer)
934
935 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
936 ;; Narrow
937
938 (defgroup howm-narrow nil
939   "Narrowing to each entry."
940   :group 'howm-misc)
941
942 (defcustom howm-auto-narrow t
943   "List of commands after which the function `howm-auto-narrow' can work.
944 If the value is t, it means 'always'."
945   :type `(radio (const :tag "Never" nil)
946                 (const :tag "Always" t)
947                 ,howm-custom-command-list)
948   :group 'howm-narrow)
949
950 (mapc (lambda (hook) (custom-add-option hook 'howm-auto-narrow))
951       '(howm-view-open-hook howm-create-hook))
952
953 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
954 ;; Efficiency
955
956 (defgroup howm-efficiency nil
957   "To improve performance, use grep and turn off expensive options."
958   :group 'howm)
959
960 (defcustom howm-refresh-after-save t
961   "*Redraw links after you save howm note."
962   :type 'boolean
963   :group 'howm-efficiency)
964
965 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
966 ;; Face
967
968 (defgroup howm-faces nil
969   "Colors and fonts."
970   :group 'faces
971   :group 'howm)
972
973 (howm-defcustom-risky howm-user-font-lock-keywords nil
974   "Font lock keywords for all howm-related buffers.
975 See help of `font-lock-keywords' for details.
976 Note: `howm-menu-font-lock-rules' overrides this variable."
977   ;;   :type '(repeat (radio (cons regexp (list (const quote) face))
978   ;;                         sexp))
979   :type 'sexp
980   :group 'howm-faces)
981
982 (defcustom howm-use-color t
983   "*If non-nil, highlight tags in howm-mode verbosely."
984   :type 'boolean
985   :group 'howm-faces)
986
987 (defface howm-view-hilit-face
988   '((((class color)) (:foreground "red"))
989     (t ()))
990   "*Face for matched word."
991   :group 'howm-faces)
992
993 (defface howm-view-name-face
994   '((((class color)) (:foreground "white" :background "blue"))
995     (t ()))
996   "*Face for file name in summary buffer."
997   :group 'howm-faces)
998
999 (defface howm-view-empty-face
1000   '((((class color)) (:background "midnight blue"))
1001     (t ()))
1002   "*Face for empty field in summary buffer."
1003   :group 'howm-faces)
1004
1005 (defface howm-mode-title-face ;; =
1006   '((((class color)) (:foreground "RoyalBlue"))
1007     (t ()))
1008   "*Face for title."
1009   :group 'howm-faces)
1010 (defface howm-mode-ref-face ;; >>>
1011   '((((class color) (background light)) (:foreground "blue"))
1012     (((class color) (background dark)) (:foreground "cyan"))
1013     (t ()))
1014   "*Face for goto link."
1015   :group 'howm-faces)
1016 (defface howm-mode-keyword-face ;; <<<
1017   '((((class color)) (:foreground "white" :background "blue"))
1018     (t ()))
1019   "*Face for come-from link."
1020   :group 'howm-faces)
1021 (defface howm-mode-wiki-face ;; [[]]
1022   '((((class color) (background light)) (:foreground "blue"))
1023     (((class color) (background dark)) (:foreground "cyan"))
1024     (t ()))
1025   "*Face for wiki link."
1026   :group 'howm-faces)
1027
1028 (defface howm-reminder-normal-face
1029   '((((class color)) (:foreground "blue"))
1030     (t ()))
1031   "*Face for normal reminder."
1032   :group 'howm-faces)
1033 (defface howm-reminder-todo-face
1034   '((((class color) (background light)) (:foreground "purple"))
1035     (((class color) (background dark)) (:foreground "yellow"))
1036     (t ()))
1037   "*Face for todo."
1038   :group 'howm-faces)
1039 (defface howm-reminder-defer-face
1040   '((((class color)) (:foreground "magenta"))
1041     (t ()))
1042   "*Face for defer."
1043   :group 'howm-faces)
1044 (defface howm-reminder-deadline-face
1045   '((((class color)) (:foreground "red"))
1046     (t ()))
1047   "*Face for deadline."
1048   :group 'howm-faces)
1049 (defface howm-reminder-late-deadline-face
1050   '((((class color)) (:background "red" :foreground "black"))
1051     (t ()))
1052   "*Face for late deadline."
1053   :group 'howm-faces)
1054 (defface howm-reminder-schedule-face
1055   '((((class color) (background light)) (:foreground "dark green"))
1056     (((class color) (background dark)) (:foreground "green"))
1057     (t ()))
1058   "*Face for schedule."
1059   :group 'howm-faces)
1060 (defface howm-reminder-done-face
1061   '((((class color) (background light)) ())
1062     (((class color) (background dark)) (:foreground "gray"))
1063     (t ()))
1064   "*Face for done reminder."
1065   :group 'howm-faces)
1066 (defface howm-reminder-today-face
1067   '((((class color)) (:foreground "black" :background "orange"))
1068     (t ()))
1069   "*Face for today."
1070   :group 'howm-faces)
1071 (defface howm-reminder-tomorrow-face
1072   '((((class color)) (:foreground "black" :background "pink"))
1073     (t ()))
1074   "*Face for tommorow."
1075   :group 'howm-faces)
1076
1077 (defface howm-menu-list-face ;; item header in menu-mode list (schedule, todo)
1078   '((t ()))
1079   "*Face for list in menu."
1080   :group 'howm-faces)
1081 (defface howm-menu-key-face ;; shortcut key in menu-mode
1082   '((((class color) (background light)) (:foreground "dark red"))
1083     (((class color) (background dark)) (:foreground "orange"))
1084     (t ()))
1085   "*Face for key binding in menu."
1086   :group 'howm-faces)
1087
1088 (defvar howm-view-hilit-face 'howm-view-hilit-face
1089   "*Face for matched word.")
1090 (defvar howm-view-name-face  'howm-view-name-face
1091   "*Face for file name in summary buffer.")
1092 (defvar howm-view-empty-face 'howm-view-empty-face
1093   "*Face for empty field in summary buffer.")
1094 (defvar howm-mode-title-face   'howm-mode-title-face
1095   "*Face for title.")
1096 (defvar howm-mode-ref-face     'howm-mode-ref-face
1097   "*Face for goto link.")
1098 (defvar howm-mode-keyword-face 'howm-mode-keyword-face
1099   "*Face for come-from link.")
1100 (defvar howm-mode-wiki-face    'howm-mode-wiki-face
1101   "*Face for wiki link.")
1102 (defvar howm-reminder-normal-face   'howm-reminder-normal-face
1103   "*Face for normal reminder.")
1104 (defvar howm-reminder-todo-face     'howm-reminder-todo-face
1105   "*Face for todo.")
1106 (defvar howm-reminder-defer-face    'howm-reminder-defer-face
1107   "*Face for defer.")
1108 (defvar howm-reminder-deadline-face 'howm-reminder-deadline-face
1109   "*Face for deadline.")
1110 (defvar howm-reminder-late-deadline-face 'howm-reminder-late-deadline-face
1111   "*Face for late deadline.")
1112 (defvar howm-reminder-schedule-face 'howm-reminder-schedule-face
1113   "*Face for schedule.")
1114 (defvar howm-reminder-done-face     'howm-reminder-done-face
1115   "*Face for done reminder.")
1116 (defvar howm-reminder-today-face    'howm-reminder-today-face
1117   "*Face for today.")
1118 (defvar howm-reminder-tomorrow-face 'howm-reminder-tomorrow-face
1119   "*Face for tommorow.")
1120 (defvar howm-menu-list-face 'howm-menu-list-face
1121   "*Face for list in menu.")
1122 (defvar howm-menu-key-face  'howm-menu-key-face
1123   "*Face for key binding in menu.")
1124
1125 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1126 ;; Hook
1127
1128 (defgroup howm-hooks nil
1129   "Hooks."
1130   :group 'howm)
1131
1132 (defcustom howm-mode-hook nil
1133   "Hook run at the end of function `howm-mode'"
1134   :type 'hook
1135   :group 'howm-hooks)
1136
1137 (defcustom howm-mode-on-hook nil
1138   "Hook run when `howm-mode' is turned on."
1139   :type 'hook
1140   :group 'howm-hooks)
1141
1142 (defcustom howm-mode-off-hook nil
1143   "Hook run when `howm-mode' is turned off."
1144   :type 'hook
1145   :group 'howm-hooks)
1146
1147 (defcustom howm-view-open-hook nil
1148   "Hook run when open a note from summary/contents buffer."
1149   :type 'hook
1150   :group 'howm-narrow
1151   :group 'howm-hooks)
1152
1153 (defcustom howm-view-before-open-hook nil
1154   "Hook run before open something from summary or contents buffer."
1155   :type 'hook
1156   :group 'howm-hooks)
1157
1158 (defcustom howm-create-file-hook nil
1159   "Hook run when buffer for new note is created."
1160   :type 'hook
1161   :group 'howm-hooks)
1162
1163 (defcustom howm-create-hook nil
1164   "Hook run after new note is created and set up."
1165   :type 'hook
1166   :group 'howm-narrow
1167   :group 'howm-hooks)
1168
1169 (defcustom howm-menu-hook nil
1170   "Hook run at the end of `howm-menu-refresh'."
1171   :type 'hook
1172   :group 'howm-hooks)
1173
1174 (defcustom howm-congrats-hook nil
1175   "Hook run at the end of `howm-congrats'."
1176   :type 'hook
1177   :group 'howm-hooks)
1178
1179 (defcustom howm-after-save-hook nil
1180   "Hook run at the end of `howm-after-save'."
1181   :type 'hook
1182   :group 'howm-hooks)
1183
1184 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1185 ;; Devel
1186
1187 (defgroup howm-devel nil
1188   "Developers' diagnoses."
1189   :group 'howm)
1190
1191 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1192 ;; Experimental
1193
1194 (defgroup howm-experimental nil
1195   "Test of experimental features."
1196   :group 'howm)
1197
1198 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1199 ;; Date format (need refactoring)
1200
1201 (defvar howm-date-separator "-") ;; "-" ==> 2003-10-21
1202
1203 ;; Fix me: redundant (howm-date-* & howm-reminder-*)
1204 ;; (cf.) howm-reminder-regexp-grep-* howm-reminder-today-format
1205 (defvar howm-date-regexp-grep
1206   (concat "[1-2][0-9][0-9][0-9]" howm-date-separator
1207           "[0-1][0-9]" howm-date-separator
1208           "[0-3][0-9]"))
1209 (defvar howm-date-regexp
1210   (concat "\\([1-2][0-9][0-9][0-9]\\)" howm-date-separator
1211           "\\([0-1][0-9]\\)" howm-date-separator
1212           "\\([0-3][0-9]\\)"))
1213 (defvar howm-date-regexp-year-pos 1)
1214 (defvar howm-date-regexp-month-pos 2)
1215 (defvar howm-date-regexp-day-pos 3)
1216 (defvar howm-date-format
1217   (concat "%Y" howm-date-separator "%m" howm-date-separator "%d"))
1218 (defvar howm-dtime-body-format
1219   (concat howm-date-format " %H:%M"))
1220 (defvar howm-dtime-format
1221   (concat "[" howm-dtime-body-format "]"))
1222 (defvar howm-insert-date-format "[%s]")
1223 (defvar howm-insert-date-future nil)
1224
1225 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1226 ;; Avoid reference to free variable (need refactoring)
1227
1228 (howm-defvar-risky howm-menu-action-arg 'howm-menu-action-arg-name)
1229
1230 ;;;
1231
1232 (provide 'howm-vars)
1233
1234 ;;; howm-vars.el ends here