[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/caml 347ceba 108/197: PR#3767 features 1 and 2: displ
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/caml 347ceba 108/197: PR#3767 features 1 and 2: display full location of events instead of one position |
Date: |
Sat, 21 Nov 2020 01:19:48 -0500 (EST) |
branch: externals/caml
commit 347ceba768c3f915a9050f4b4aac18218fd0697c
Author: Damien Doligez <damien.doligez-inria.fr>
Commit: Damien Doligez <damien.doligez-inria.fr>
PR#3767 features 1 and 2: display full location of events instead of one
position
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7031
f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
---
camldebug.el | 63 +++++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 39 insertions(+), 24 deletions(-)
diff --git a/camldebug.el b/camldebug.el
index 32846bb..b911983 100644
--- a/camldebug.el
+++ b/camldebug.el
@@ -248,10 +248,15 @@ representation is simply concatenated with the COMMAND."
;accumulate onto previous output
(setq camldebug-filter-accumulator
(concat camldebug-filter-accumulator string))
- (if (not (string-match (concat "\\(\n\\|\\`\\)[ \t]*\\([0-9]+\\)[ \t]+"
- camldebug-goto-position
- "[ \t]*\\(before\\|after\\)\n")
- camldebug-filter-accumulator)) nil
+ (if (not (or (string-match (concat "\\(\n\\|\\`\\)[ \t]*\\([0-9]+\\)[ \t]+"
+ camldebug-goto-position
+ "-[0-9]+[ \t]*\\(before\\).*\n")
+ camldebug-filter-accumulator)
+ (string-match (concat "\\(\n\\|\\`\\)[ \t]*\\([0-9]+\\)[
\t]+[0-9]+-"
+ camldebug-goto-position
+ "[ \t]*\\(after\\).*\n")
+ camldebug-filter-accumulator)))
+ nil
(setq camldebug-goto-output
(match-string 2 camldebug-filter-accumulator))
(setq camldebug-filter-accumulator
@@ -516,17 +521,24 @@ the camldebug commands `cd DIR' and `directory'."
;; Process all the complete markers in this chunk.
(while (setq begin
(string-match
- "\032\032\\(H\\|M\\(.+\\):\\(.+\\):\\(before\\|after\\)\\)\n"
+
"\032\032\\(H\\|M\\(.+\\):\\(.+\\):\\(.+\\):\\(before\\|after\\)\\)\n"
camldebug-filter-accumulator))
(setq camldebug-last-frame
(if (char-equal ?H (aref camldebug-filter-accumulator
(1+ (1+ begin)))) nil
- (list (match-string 2 camldebug-filter-accumulator)
- (string-to-int
- (match-string 3 camldebug-filter-accumulator))
- (string= "before"
- (match-string 4
- camldebug-filter-accumulator))))
+ (let ((isbefore
+ (string= "before"
+ (match-string 5 camldebug-filter-accumulator)))
+ (startpos (string-to-int
+ (match-string 3 camldebug-filter-accumulator)))
+ (endpos (string-to-int
+ (match-string 4 camldebug-filter-accumulator))))
+ (list (match-string 2 camldebug-filter-accumulator)
+ (if isbefore startpos endpos)
+ isbefore
+ startpos
+ endpos
+ )))
output (concat output
(substring camldebug-filter-accumulator
0 begin))
@@ -627,33 +639,36 @@ the camldebug commands `cd DIR' and `directory'."
(defun camldebug-display-frame ()
"Find, obey and delete the last filename-and-line marker from CDB.
-The marker looks like \\032\\032FILENAME:CHARACTER\\n.
+The marker looks like \\032\\032Mfilename:startchar:endchar:beforeflag\\n.
Obeying it means displaying in another window the specified file and line."
(interactive)
(camldebug-set-buffer)
(if (not camldebug-last-frame)
(camldebug-remove-current-event)
- (camldebug-display-line (car camldebug-last-frame)
- (car (cdr camldebug-last-frame))
- (car (cdr (cdr camldebug-last-frame)))))
+ (camldebug-display-line (nth 0 camldebug-last-frame)
+ (nth 3 camldebug-last-frame)
+ (nth 4 camldebug-last-frame)
+ (nth 2 camldebug-last-frame)))
(setq camldebug-last-frame-displayed-p t))
;; Make sure the file named TRUE-FILE is in a buffer that appears on the screen
;; and that its character CHARACTER is visible.
;; Put the mark on this character in that buffer.
-(defun camldebug-display-line (true-file character kind)
+(defun camldebug-display-line (true-file schar echar kind)
(let* ((pre-display-buffer-function nil) ; screw it, put it all in one screen
(pop-up-windows t)
(buffer (find-file-noselect true-file))
(window (display-buffer buffer t))
- (pos))
+ (spos) (epos) (pos))
(save-excursion
(set-buffer buffer)
(save-restriction
(widen)
- (setq pos (+ (point-min) character))
- (camldebug-set-current-event pos (current-buffer) kind))
+ (setq spos (+ (point-min) schar))
+ (setq epos (+ (point-min) echar))
+ (setq pos (if kind spos epos))
+ (camldebug-set-current-event spos epos (current-buffer) kind))
(cond ((or (< pos (point-min)) (> pos (point-max)))
(widen)
(goto-char pos))))
@@ -668,15 +683,15 @@ Obeying it means displaying in another window the
specified file and line."
(delete-overlay camldebug-overlay-under))
(setq overlay-arrow-position nil)))
-(defun camldebug-set-current-event (pos buffer before)
+(defun camldebug-set-current-event (spos epos buffer before)
(if window-system
(if before
(progn
- (move-overlay camldebug-overlay-event pos (1+ pos) buffer)
+ (move-overlay camldebug-overlay-event spos (1+ spos) buffer)
(move-overlay camldebug-overlay-under
- (+ pos 1) (+ pos 3) buffer))
- (move-overlay camldebug-overlay-event (1- pos) pos buffer)
- (move-overlay camldebug-overlay-under (- pos 3) (- pos 1) buffer))
+ (+ spos 1) epos buffer))
+ (move-overlay camldebug-overlay-event (1- epos) epos buffer)
+ (move-overlay camldebug-overlay-under spos (- epos 1) buffer))
(save-excursion
(set-buffer buffer)
(goto-char pos)
- [nongnu] externals/caml 850c621 048/197: Made run-caml autoload in caml.el, (continued)
- [nongnu] externals/caml 850c621 048/197: Made run-caml autoload in caml.el, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 778e3cf 079/197: utilisation d'un arbre, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 38c4de4 082/197: bricoles, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 432e972 081/197: duh, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 285775f 080/197: plus rapide, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml e1a8649 084/197: - added file caml-xemacs.el for XEmacs compatibility., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml a94bd19 083/197: hash-table des annotations, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d7bde19 088/197: Modified `caml-types-explore' so that all well-typed subexpressions of the, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 570c595 089/197: installer caml-emacs.el, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml ab2d4cc 107/197: fusion des modifs de 3.08.4, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 347ceba 108/197: PR#3767 features 1 and 2: display full location of events instead of one position,
Stefan Monnier <=
- [nongnu] externals/caml 4238e85 110/197: fusion des changements 3.09.3 -> release309_merge310, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 074d219 106/197: fusion des changements jusqu'a 3.08.3, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 8fc9a47 117/197: amelioration des annotations, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml bcceb79 122/197: fixes bug 0005016, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 55b8c79 124/197: fixes bug 0004997, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d213e6d 076/197: integration de caml-types a caml.el, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml d287472 095/197: petits bugs, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml eddf5e0 099/197: camldebug-command-name should be user-settable, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 901e8dd 103/197: Fusion des modifs de la branche release308 entre 3.08.0 et 3.08.1, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml afff6d2 040/197: Adding file caml-help.el, Stefan Monnier, 2020/11/21