summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Scherer <gabriel.scherer@gmail.com>2017-08-18 22:42:23 +0200
committerGitHub <noreply@github.com>2017-08-18 22:42:23 +0200
commit1f24841da699e66023e72d75cb8ca6603c7fca25 (patch)
tree14d9f770f2ad4d867f933cc8c0fc1df0b25b7c6f
parent12b20f30f5b8bf1cc9e388331563c8a6ff7a0473 (diff)
parentdd457317adf5129b2026e71f5c686a375338143a (diff)
downloadocaml-1f24841da699e66023e72d75cb8ca6603c7fca25.tar.gz
Merge pull request #1296 from Denommus/emacs-startup-warnings
Fixing some Emacs startup warnings.
-rw-r--r--emacs/caml.el36
1 files changed, 18 insertions, 18 deletions
diff --git a/emacs/caml.el b/emacs/caml.el
index e91417d2a3..2b6645ffaa 100644
--- a/emacs/caml.el
+++ b/emacs/caml.el
@@ -866,24 +866,24 @@ possible."
(if (eq major-mode 'caml-mode)
(let (skip bol beg end)
(save-excursion
- (set-buffer
- (if (boundp 'compilation-last-buffer)
- compilation-last-buffer ;Emacs 19
- "*compilation*")) ;Emacs 18
- (save-excursion
- (goto-char (window-point (get-buffer-window (current-buffer))))
- (if (looking-at caml-error-chars-regexp)
- (setq beg
- (caml-string-to-int
- (buffer-substring (match-beginning 1) (match-end 1)))
- end
- (caml-string-to-int
- (buffer-substring (match-beginning 2) (match-end 2)))))
- (next-line)
- (beginning-of-line)
- (if (and (looking-at "Warning")
- caml-next-error-skip-warnings-flag)
- (setq skip 't))))
+ (with-current-buffer
+ (if (boundp 'compilation-last-buffer)
+ compilation-last-buffer ;Emacs 19
+ "*compilation*") ;Emacs 18
+ (save-excursion
+ (goto-char (window-point (get-buffer-window (current-buffer))))
+ (if (looking-at caml-error-chars-regexp)
+ (setq beg
+ (caml-string-to-int
+ (buffer-substring (match-beginning 1) (match-end 1)))
+ end
+ (caml-string-to-int
+ (buffer-substring (match-beginning 2) (match-end 2)))))
+ (forward-line 1)
+ (beginning-of-line)
+ (if (and (looking-at "Warning")
+ caml-next-error-skip-warnings-flag)
+ (setq skip 't)))))
(cond
(skip (next-error))
(beg