summaryrefslogtreecommitdiff
path: root/chess-file.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-28 16:09:14 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-28 16:09:14 +0000
commit80ab4cec14452a641e741d372037dafda16ee871 (patch)
tree352324dc62ffbd3c9c651a7154a2e88338144641 /chess-file.el
parent7248e5c89f6d53d3f2a4ecf511167af929241f76 (diff)
*** no comment ***
Diffstat (limited to 'chess-file.el')
-rw-r--r--chess-file.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/chess-file.el b/chess-file.el
index dfbd3b6..1f99b58 100644
--- a/chess-file.el
+++ b/chess-file.el
@@ -13,14 +13,17 @@
(cond
((eq event 'open)
(with-current-buffer (find-file-noselect (car args))
- (chess-file-handler 'rescan)
- (current-buffer)))
+ (when (or (string-match "\\.pgn\\'" (car args))
+ (save-excursion
+ (re-search-forward "^\\[Event" nil t)))
+ (chess-file-handler 'rescan)
+ (current-buffer))))
((eq event 'rescan)
(save-excursion
(goto-char (point-min))
(setq chess-file-locations nil)
- (while (search-forward "[Event " nil t)
+ (while (re-search-forward "^\\[Event " nil t)
(goto-char (match-beginning 0))
(push (point) chess-file-locations)
(forward-char 1))