/[emacs]/emacs/lisp/net/zone-mode.el
ViewVC logotype

Diff of /emacs/lisp/net/zone-mode.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by pj, Mon Jul 16 12:22:59 2001 UTC revision 1.3 by pj, Tue Dec 11 06:50:22 2001 UTC
# Line 52  Line 52 
52               (new-seq               (new-seq
53                (cond                (cond
54                 ((not (string= old-date cur-date))                 ((not (string= old-date cur-date))
55                  "00") ;; reset sequeence number                  "00") ;; reset sequence number
56                 ((>= old-seq-num 99)                 ((>= old-seq-num 99)
57                  (error "Serial number's sequenece cannot increment beyond 99"))                  (error "Serial number's sequence cannot increment beyond 99"))
58                 (t                 (t
59                  (format "%02d" (1+ old-seq-num)))))                  (format "%02d" (1+ old-seq-num)))))
60               (old-serial (concat old-date old-seq))               (old-serial (concat old-date old-seq))
61               (new-serial (concat cur-date new-seq)))               (new-serial (concat cur-date new-seq)))
62          (if (string-lessp new-serial old-serial)          (if (string-lessp new-serial old-serial)
63              (error (format "Serial numbers want to move backwards from %s to %s!" old-serial new-serial))              (error (format "Serial numbers want to move backwards from %s to %s" old-serial new-serial))
64            (replace-match (concat cur-date new-seq old-flag) t t))))))            (replace-match (concat cur-date new-seq old-flag) t t))))))
65        
66  ;;;###autoload  ;;;###autoload
67  (defun zone-mode-update-serial-hook ()  (defun zone-mode-update-serial-hook ()
68    "Update the serial number in a zone if the file was modified"    "Update the serial number in a zone if the file was modified."
69    (interactive)    (interactive)
70    (if (buffer-modified-p (current-buffer))    (if (buffer-modified-p (current-buffer))
71        (zone-mode-update-serial))        (zone-mode-update-serial))
# Line 76  Line 76 
76    "Zone-mode's syntax table.")    "Zone-mode's syntax table.")
77    
78  (defun zone-mode-load-time-setup ()  (defun zone-mode-load-time-setup ()
79    "init zone-mode stuff"    "Initialise `zone-mode' stuff."
80    (setq zone-mode-syntax-table (make-syntax-table))    (setq zone-mode-syntax-table (make-syntax-table))
81    (modify-syntax-entry ?\; "<" zone-mode-syntax-table)    (modify-syntax-entry ?\; "<" zone-mode-syntax-table)
82    (modify-syntax-entry ?\n ">" zone-mode-syntax-table))    (modify-syntax-entry ?\n ">" zone-mode-syntax-table))
# Line 92  Zone-mode does two things: Line 92  Zone-mode does two things:
92    
93          - fontification"          - fontification"
94    
   (make-local-hook 'write-file-hooks)  
95    (add-hook 'write-file-hooks 'zone-mode-update-serial-hook)    (add-hook 'write-file-hooks 'zone-mode-update-serial-hook)
96    
97    (if (null zone-mode-syntax-table)    (if (null zone-mode-syntax-table)

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26