branch: externals/caml
commit d1fc793a99c050d5328fbb07842ad5822d0c3a77
Author: Didier Rémy <[email protected]>
Commit: Didier Rémy <[email protected]>
Added save-excursion to ocaml-link-activate.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10323
f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
---
caml-help.el | 47 +++++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 22 deletions(-)
diff --git a/caml-help.el b/caml-help.el
index e651718..2adba67 100644
--- a/caml-help.el
+++ b/caml-help.el
@@ -497,7 +497,8 @@ This uses info files produced by HeVeA.
(message "Scanning info files in %s" dir)
(save-window-excursion
(set-buffer (get-buffer-create "*caml-help*"))
- (or (shell-command command (current-buffer)) (error "HERE"))
+ (or (shell-command command (current-buffer))
+ (error "Could not run:%s" command))
(goto-char (point-min))
(while (re-search-forward module-regexp (point-max) t)
(if (equal (char-after (match-end 1)) 127)
@@ -624,7 +625,8 @@ current buffer using \\[ocaml-qualified-identifier]."
(progn
(message "Help for entry %s not found in module %s"
entry module)
- (goto-char here)))))
+ (goto-char here)))
+ ))
(ocaml-link-activate (cdr info-section))
(if (window-live-p window) (select-window window))
))
@@ -778,26 +780,27 @@ buffer positions."
(mapconcat 'car links "\\|")
"\\)[^A-Za-z0-9'_]"))
(case-fold-search nil))
- (goto-char (point-min))
- (let ((buffer-read-only nil)
- ;; use of dynamic scoping, need not be restored!
- (modified-p (buffer-modified-p)))
- (unwind-protect
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward regexp (point-max) t)
- (put-text-property (match-beginning 1) (match-end 1)
- 'mouse-face 'highlight)
- (put-text-property (match-beginning 1) (match-end 1)
- 'local-map ocaml-link-map)
- (if (x-display-color-p)
- (put-text-property (match-beginning 1) (match-end 1)
- 'face 'ocaml-link-face)))
- )
- ;; need to restore flag if buffer was unmodified.
- (unless modified-p (set-buffer-modified-p nil))
- ))
- ))))
+ (save-excursion
+ (goto-char (point-min))
+ (let ((buffer-read-only nil)
+ ;; use of dynamic scoping, need not be restored!
+ (modified-p (buffer-modified-p)))
+ (unwind-protect
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward regexp (point-max) t)
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'mouse-face 'highlight)
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'local-map ocaml-link-map)
+ (if (x-display-color-p)
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'face 'ocaml-link-face)))
+ )
+ ;; need to restore flag if buffer was unmodified.
+ (unless modified-p (set-buffer-modified-p nil))
+ ))
+ )))))