diff options
| author | Didier Rémy <Didier.Remy@inria.fr> | 2010-04-28 11:11:07 +0000 |
|---|---|---|
| committer | Didier Rémy <Didier.Remy@inria.fr> | 2010-04-28 11:11:07 +0000 |
| commit | 34c0efcc4e42aa6a63bcba50d894c2852d326959 (patch) | |
| tree | 05b78b1ef0df2a78cb45a2c5be870f4b6d145bb8 /emacs | |
| parent | ffb6aee83e50014f41f8751db19ce80aa99e7d98 (diff) | |
| download | ocaml-34c0efcc4e42aa6a63bcba50d894c2852d326959.tar.gz | |
Added save-excursion to ocaml-link-activate.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10323 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'emacs')
| -rw-r--r-- | emacs/caml-help.el | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/emacs/caml-help.el b/emacs/caml-help.el index e6517185a9..2adba6752f 100644 --- a/emacs/caml-help.el +++ b/emacs/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)) + )) + ))))) |
