]> code.delx.au - gnu-emacs-elpa/blob - packages/notes-mode/notes-first.el
Fix copyright headers for ack package
[gnu-emacs-elpa] / packages / notes-mode / notes-first.el
1
2 ;;;
3 ;;; notes-first.el
4 ;;; $Id: notes-first.el,v 1.5 2006/01/14 23:11:08 johnh Exp $
5 ;;;
6 ;;; Copyright (C) 2000-2006 by John Heidemann
7 ;;; Comments to <johnh@isi.edu>.
8 ;;;
9 ;;; This file is under the Gnu Public License, version 2.
10 ;;;
11
12 ;; This whole perl5 thing is because rms insists
13 ;; that the USER specify where perl is, not that configure
14 ;; do that at emacs build time. Grumble.
15 (defvar notes-first-perl5-binary "perl"
16 "Location of the perl binary to invoke notesinit. (Must be perl v5.)")
17
18 ;;;
19 (defun notes-first-use-init ()
20 "Set up notes mode for the first time for a new user."
21 ;; note that we CAN'T assume the contents of notes-variables is loaded.
22 (if (y-or-n-p "Setup notes-mode with defaults ")
23 (notes-first-run-notes-init)
24 (error (concat "Please run " notes-utility-dir "/notesinit by hand in a shell to customize defaults."))))
25
26 ;; xxx: eventually we might do something more sophisticated here
27 ;; (like asking the user questions directly).
28 (defun notes-first-run-notes-init ()
29 "Run notesinit with defaults"
30 (let*
31 ((notes-init-cmd (concat notes-utility-dir "/notesinit")))
32 (message (concat "Running \"" notes-first-perl5-binary notes-init-cmd "\" to set up notes-mode."))
33 (call-process notes-first-perl5-binary nil nil nil notes-init-cmd "-D"))
34 ;; ok, things are setup, but we want to lead the user to what to do next
35 ;; => start up on today's note
36 (message "Notes are now set up. Run M-x notes-index-todays-link to start."))
37
38 (provide 'notes-first)
39