------------------------------------------------------------ revno: 117704 committer: Jan Nieuwenhuizen branch nick: trunk timestamp: Wed 2014-08-13 21:17:21 +0200 message: Support Guile backtraces in compilation mode. * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Add Guile regexpses. * etc/compilation.txt (file): Add Guile backtrace example. * test/automated/compile-tests.el (compile--test-error-line): Grok FILE being nil. Allows for Guile tests to pass. (compile-tests--test-regexps-data): Add Guile tests. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-08-09 16:12:33 +0000 +++ etc/ChangeLog 2014-08-13 19:17:21 +0000 @@ -1,3 +1,7 @@ +2014-08-08 Jan Nieuwenhuizen + + * compilation.txt (file): Add Guile backtrace example. + 2014-08-09 Reuben Thomas * PROBLEMS: Remove msdos/is_exec.c and sigaction.c. === modified file 'etc/compilation.txt' --- etc/compilation.txt 2014-01-01 07:43:34 +0000 +++ etc/compilation.txt 2014-08-13 19:17:21 +0000 @@ -261,6 +261,26 @@ {standard input}:27041: Warning: end of file not at end of a line; newline inserted +* Guile backtrace, 2.0.11 + +symbols: guile-file, guile-line + +Backtrace: +In ice-9/boot-9.scm: + 157: 6 [catch #t # ...] +In unknown file: + ?: 5 [apply-smob/1 #] +In ice-9/boot-9.scm: + 63: 4 [call-with-prompt prompt0 ...] +In ice-9/eval.scm: + 432: 3 [eval # #] +In unknown file: + ?: 2 [eval (main (command-line)) #] +In /home/janneke/vc/guile/examples/gud-break.scm: +1038: 1 [main ("gud-break.scm")] +1033: 0 [stderr "~a:hello world\n" (# # #)] + + * Lucid Compiler, lcc 3.x symbol: lcc === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-13 19:15:28 +0000 +++ lisp/ChangeLog 2014-08-13 19:17:21 +0000 @@ -1,5 +1,10 @@ 2014-08-13 Jan Nieuwenhuizen + * progmodes/compile.el (compilation-error-regexp-alist-alist): + Add Guile regexpses. + +2014-08-13 Jan Nieuwenhuizen + * progmodes/gud.el (guiler): New function. Starts the Guile REPL; add Guile debugger support for GUD. === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2014-05-29 03:45:29 +0000 +++ lisp/progmodes/compile.el 2014-08-13 19:17:21 +0000 @@ -477,6 +477,8 @@ ;; "^\\([^ \t\r\n(]+\\) (\\([0-9]+\\):\\([0-9]+\\)) " 1 2 3) + (guile-file "^In \\(.+\\):\n" 1) + (guile-line "^ *\\([0-9]+\\): *\\([0-9]+\\)" nil 1 2) ) "Alist of values for `compilation-error-regexp-alist'.") === modified file 'test/ChangeLog' --- test/ChangeLog 2014-08-11 00:59:34 +0000 +++ test/ChangeLog 2014-08-13 19:17:21 +0000 @@ -1,3 +1,9 @@ +2014-08-13 Jan Nieuwenhuizen + + * automated/compile-tests.el (compile--test-error-line): Grok FILE + being nil. Allows for Guile tests to pass. + (compile-tests--test-regexps-data): Add Guile tests. + 2014-08-11 Glenn Morris * automated/data/files-bug18141.el.gz: New file. === modified file 'test/automated/compile-tests.el' --- test/automated/compile-tests.el 2014-01-01 07:43:34 +0000 +++ test/automated/compile-tests.el 2014-08-13 19:17:21 +0000 @@ -190,6 +190,10 @@ 1 nil 54 "G:/cygwin/dev/build-myproj.xml") ("{standard input}:27041: Warning: end of file not at end of a line; newline inserted" 1 nil 27041 "{standard input}") + ;; Guile + ("In foo.scm:\n" 1 nil nil "foo.scm") + (" 63:4 [call-with-prompt prompt0 ...]" 1 4 63 nil) + ("1038: 1 [main (\"gud-break.scm\")]" 1 1 1038 nil) ;; lcc ("E, file.cc(35,52) Illegal operation on pointers" 1 52 35 "file.cc") ("W, file.cc(36,52) blah blah" 1 52 36 "file.cc") @@ -338,7 +342,8 @@ (setq end-line (cdr line) line (car line))) (and (equal (compilation--loc->col loc) col) (equal (compilation--loc->line loc) line) - (equal (caar (compilation--loc->file-struct loc)) file) + (or (not file) + (equal (caar (compilation--loc->file-struct loc)) file)) (or (null end-col) (equal (car (cadr (nth 2 (compilation--loc->file-struct loc)))) end-col)) ------------------------------------------------------------ revno: 117703 committer: Jan Nieuwenhuizen branch nick: trunk timestamp: Wed 2014-08-13 21:15:28 +0200 message: Initial Guile REPL (guiler) debugger support for GUD. * progmodes/gud.el (guiler): New function. Starts the Guile REPL; add Guile debugger support for GUD. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-13 18:10:15 +0000 +++ lisp/ChangeLog 2014-08-13 19:15:28 +0000 @@ -1,3 +1,8 @@ +2014-08-13 Jan Nieuwenhuizen + + * progmodes/gud.el (guiler): New function. Starts the Guile REPL; + add Guile debugger support for GUD. + 2014-08-13 Stefan Monnier * obsolete/mouse-sel.el (mouse-sel-mode): Use add/remove-function. === modified file 'lisp/progmodes/gud.el' --- lisp/progmodes/gud.el 2014-02-10 01:34:22 +0000 +++ lisp/progmodes/gud.el 2014-08-13 19:15:28 +0000 @@ -34,7 +34,8 @@ ;; and added a menu. Brian D. Carlstrom combined the IRIX ;; kluge with the gud-xdb-directories hack producing gud-dbx-directories. ;; Derek L. Davies added support for jdb (Java -;; debugger.) +;; debugger.) Jan Nieuwenhuizen added support for the Guile REPL (Guile +;; debugger). ;;; Code: @@ -140,7 +141,7 @@ (display-graphic-p) (fboundp 'x-show-tip)) :visible (memq gud-minor-mode - '(gdbmi dbx sdb xdb pdb)) + '(gdbmi guiler dbx sdb xdb pdb)) :button (:toggle . gud-tooltip-mode)) ([refresh] "Refresh" . gud-refresh) ([run] menu-item "Run" gud-run @@ -170,11 +171,11 @@ ([up] menu-item "Up Stack" gud-up :enable (not gud-running) :visible (memq gud-minor-mode - '(gdbmi gdb dbx xdb jdb pdb))) + '(gdbmi gdb guiler dbx xdb jdb pdb))) ([down] menu-item "Down Stack" gud-down :enable (not gud-running) :visible (memq gud-minor-mode - '(gdbmi gdb dbx xdb jdb pdb))) + '(gdbmi gdb guiler dbx xdb jdb pdb))) ([pp] menu-item "Print S-expression" gud-pp :enable (and (not gud-running) (bound-and-true-p gdb-active-process)) @@ -195,7 +196,7 @@ ([finish] menu-item "Finish Function" gud-finish :enable (not gud-running) :visible (memq gud-minor-mode - '(gdbmi gdb xdb jdb pdb))) + '(gdbmi gdb guiler xdb jdb pdb))) ([stepi] menu-item "Step Instruction" gud-stepi :enable (not gud-running) :visible (memq gud-minor-mode '(gdbmi gdb dbx))) @@ -1704,6 +1705,83 @@ (run-hooks 'pdb-mode-hook)) ;; ====================================================================== +;; Guile REPL (guiler) functions + +;; History of argument lists passed to guiler. +(defvar gud-guiler-history nil) + +(defvar gud-guiler-lastfile nil) + +(defun gud-guiler-marker-filter (string) + (setq gud-marker-acc (if gud-marker-acc (concat gud-marker-acc string) string)) + + (let ((start 0)) + (while + (cond + ((string-match "^In \\(.*\\):" gud-marker-acc start) + (setq gud-guiler-lastfile (match-string 1 gud-marker-acc))) + ((string-match "^\\([^:\n]+\\):\\([0-9]+\\):\\([0-9]+\\):[^\n]*" + gud-marker-acc start) + (setq gud-guiler-lastfile (match-string 1 gud-marker-acc)) + (setq gud-last-frame + (cons gud-guiler-lastfile + (string-to-number (match-string 2 gud-marker-acc))))) + ((string-match "^[ ]*\\([0-9]+\\):\\([0-9]+\\) [^\n]*" + gud-marker-acc start) + (if gud-guiler-lastfile + (setq gud-last-frame + (cons gud-guiler-lastfile + (string-to-number (match-string 1 gud-marker-acc)))))) + ((string-match comint-prompt-regexp gud-marker-acc start) t) + ((string= (substring gud-marker-acc start) "") nil) + (t nil)) + (setq start (match-end 0))) + + ;; Search for the last incomplete line in this chunk + (while (string-match "\n" gud-marker-acc start) + (setq start (match-end 0))) + + ;; If we have an incomplete line, store it in gud-marker-acc. + (setq gud-marker-acc (substring gud-marker-acc (or start 0)))) + string) + + +(defcustom gud-guiler-command-name "guile" + "File name for executing the Guile debugger. +This should be an executable on your path, or an absolute file name." + :type 'string + :group 'gud) + +;;;###autoload +(defun guiler (command-line) + "Run guiler on program FILE in buffer `*gud-FILE*'. +The directory containing FILE becomes the initial working directory +and source-file directory for your debugger." + (interactive + (list (gud-query-cmdline 'guiler))) + + (gud-common-init command-line nil 'gud-guiler-marker-filter) + (setq-local gud-minor-mode 'guiler) + +;; FIXME: absolute file-names are not grokked yet by Guile's ,break-at-source +;; and relative file names only when relative to %load-path. +;; (gud-def gud-break ",break-at-source %d%f %l" "\C-b" "Set breakpoint at current line.") + (gud-def gud-break ",break-at-source %f %l" "\C-b" "Set breakpoint at current line.") +;; FIXME: remove breakpoint with file-line not yet supported by Guile +;; (gud-def gud-remove ",delete ---> %d%f:%l" "\C-d" "Remove breakpoint at current line") + (gud-def gud-step ",step" "\C-s" "Step one source line with display.") + (gud-def gud-next ",next" "\C-n" "Step one line (skip functions).") +;; (gud-def gud-cont "continue" "\C-r" "Continue with display.") + (gud-def gud-finish ",finish" "\C-f" "Finish executing current function.") + (gud-def gud-up ",up" "<" "Up one stack frame.") + (gud-def gud-down ",down" ">" "Down one stack frame.") + (gud-def gud-print "%e" "\C-p" "Evaluate Guile expression at point.") + + (setq comint-prompt-regexp "^scheme@([^>]+> ") + (setq paragraph-start comint-prompt-regexp) + (run-hooks 'guiler-mode-hook)) + +;; ====================================================================== ;; ;; JDB support. ;; @@ -3450,6 +3528,7 @@ "Return a suitable command to print the expression EXPR." (pcase gud-minor-mode (`gdbmi (concat "-data-evaluate-expression \"" expr "\"")) + (`guiler expr) (`dbx (concat "print " expr)) ((or `xdb `pdb) (concat "p " expr)) (`sdb (concat expr "/")))) ------------------------------------------------------------ revno: 117702 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-08-13 21:10:15 +0300 message: lisp/ChangeLog: Fix a recent log entry. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-13 14:16:48 +0000 +++ lisp/ChangeLog 2014-08-13 18:10:15 +0000 @@ -8,12 +8,11 @@ 2014-08-13 Eric S. Raymond - * vc/vc.git.el: (vc-git-find-file-hook): New function. - Adds support for calling smerge on a conflicted file, and calling git - add when there are no longer conflict markers in a saved file. + * vc/vc.git.el (vc-git-find-file-hook): New function. + Adds support for calling smerge on a conflicted file, and calling + "git add" when there are no longer conflict markers in a saved file. This is a completed version of Rüdiger Sonderfeld's proposal. - - * vc/vc-git.el (vc-git-conflicted-files): New function. + (vc-git-conflicted-files): New function. Integrate Rüdiger Sonderfeld's code for detecting conflicted files using a status listing. Useful in itself and a step towards better smerge support. ------------------------------------------------------------ revno: 117701 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2014-08-13 10:16:48 -0400 message: Forgotten ChangeLog changes diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-13 08:42:33 +0000 +++ lisp/ChangeLog 2014-08-13 14:16:48 +0000 @@ -1,14 +1,22 @@ +2014-08-13 Stefan Monnier + + * obsolete/mouse-sel.el (mouse-sel-mode): Use add/remove-function. + (mouse-sel--ignore): New function. + (mouse-sel-has-been-enabled, mouse-sel-original-bindings) + (mouse-sel-original-interprogram-cut-function) + (mouse-sel-original-interprogram-paste-function): Remove. + 2014-08-13 Eric S. Raymond - * vc/vc.git.el: (vc-git-find-file-hook): New function. Adds - support for calling smerge on a conflicted file, and calling git + * vc/vc.git.el: (vc-git-find-file-hook): New function. + Adds support for calling smerge on a conflicted file, and calling git add when there are no longer conflict markers in a saved file. This is a completed version of Rüdiger Sonderfeld's proposal. - * vc/vc-git.el (vc-git-conflicted-files): New function. Integrate - Rüdiger Sonderfeld's code for detecting conflicted files using a - status listing. Useful in itself and a step towards better smerge - support. + * vc/vc-git.el (vc-git-conflicted-files): New function. + Integrate Rüdiger Sonderfeld's code for detecting conflicted files + using a status listing. Useful in itself and a step towards better + smerge support. 2014-08-12 Stefan Monnier === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-08-12 02:47:36 +0000 +++ lisp/gnus/ChangeLog 2014-08-13 14:16:48 +0000 @@ -416,7 +416,7 @@ * gnus-setup.el (gnus-use-sendmail): We never use sendmail for mail reading. -2014-01-09 Ken Olum (tiny change) +2014-01-09 Ken Olum * message.el (message-bury): Call bury-buffer with no argument in the message-return-action case too. ------------------------------------------------------------ revno: 117700 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2014-08-13 10:15:54 -0400 message: * lisp/obsolete/mouse-sel.el (mouse-sel-mode): Use add/remove-function. (mouse-sel--ignore): New function. (mouse-sel-has-been-enabled, mouse-sel-original-bindings) (mouse-sel-original-interprogram-cut-function) (mouse-sel-original-interprogram-paste-function): Remove. diff: === modified file 'lisp/obsolete/mouse-sel.el' --- lisp/obsolete/mouse-sel.el 2014-01-01 07:43:34 +0000 +++ lisp/obsolete/mouse-sel.el 2014-08-13 14:15:54 +0000 @@ -190,12 +190,9 @@ ;;=== User Command ======================================================== -(defvar mouse-sel-has-been-enabled nil - "Non-nil if Mouse Sel mode has been enabled at least once.") - (defvar mouse-sel-original-bindings nil) -(defvar mouse-sel-original-interprogram-cut-function nil) -(defvar mouse-sel-original-interprogram-paste-function nil) + +(defalias 'mouse-sel--ignore #'ignore) ;;;###autoload (define-minor-mode mouse-sel-mode @@ -242,14 +239,11 @@ (global-set-key event (cdr binding))))) mouse-sel-bound-events)) ;; Update interprogram functions. - (setq mouse-sel-original-interprogram-cut-function - interprogram-cut-function - mouse-sel-original-interprogram-paste-function - interprogram-paste-function - mouse-sel-has-been-enabled t) (unless (eq mouse-sel-default-bindings 'interprogram-cut-paste) - (setq interprogram-cut-function nil - interprogram-paste-function nil)))) + (add-function :override interprogram-cut-function + #'mouse-sel--ignore) + (add-function :override interprogram-paste-function + #'mouse-sel--ignore)))) ;; Restore original bindings (remove-hook 'x-lost-selection-functions 'mouse-sel-lost-selection-hook) @@ -257,11 +251,8 @@ (global-set-key (car binding) (cdr binding))) ;; Restore the old values of these variables, ;; only if they were actually saved previously. - (if mouse-sel-has-been-enabled - (setq interprogram-cut-function - mouse-sel-original-interprogram-cut-function - interprogram-paste-function - mouse-sel-original-interprogram-paste-function)))) + (remove-function interprogram-cut-function #'mouse-sel--ignore) + (remove-function interprogram-paste-function #'mouse-sel--ignore))) (make-obsolete 'mouse-sel-mode "use the normal mouse modes" "24.3") ------------------------------------------------------------ revno: 117699 committer: Kelvin White branch nick: trunk timestamp: Wed 2014-08-13 09:14:43 -0400 message: * erc.el Disable display commands in current buffer, fix case where buffer name is already set diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2014-08-12 02:56:28 +0000 +++ lisp/erc/ChangeLog 2014-08-13 13:14:43 +0000 @@ -1,3 +1,8 @@ +2014-08-13 Kelvin White + + * erc.el (erc-send-input): Disable display commands in current buffer + (erc-format-target-and/or-network): Fix cases when buffer name is set + 2014-08-12 Stefan Monnier * erc-stamp.el (erc-timestamp-intangible): Disable by default because === modified file 'lisp/erc/erc.el' --- lisp/erc/erc.el 2014-08-07 16:44:19 +0000 +++ lisp/erc/erc.el 2014-08-13 13:14:43 +0000 @@ -5376,9 +5376,7 @@ (null erc-flood-protect) t)) (or (and erc-flood-protect (erc-split-line line)) (list line)))) - (split-string str "\n")) - ;; Insert the prompt along with the command. - (erc-display-command str) + (split-string str "\n")) (erc-process-input-line (concat str "\n") t nil)) t))))) @@ -6234,7 +6232,7 @@ (concat (erc-string-no-properties (erc-default-target)) "@" network-name)) ((and network-name - (not (string-equal network-name (buffer-name)))) + (not (get-buffer network-name))) (rename-buffer network-name) network-name) (t (buffer-name (current-buffer)))))) ------------------------------------------------------------ revno: 117698 committer: Eric S. Raymond branch nick: trunk timestamp: Wed 2014-08-13 04:42:33 -0400 message: Add smerge support to the git back end. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-13 08:05:45 +0000 +++ lisp/ChangeLog 2014-08-13 08:42:33 +0000 @@ -1,8 +1,13 @@ 2014-08-13 Eric S. Raymond - * vc/vc-git.el (vc-git-conflicted-files): Integrate Rüdiger - Sonderfeld's code for detecting conflicted files using a status - listing. Useful in itself and a step towards better smerge + * vc/vc.git.el: (vc-git-find-file-hook): New function. Adds + support for calling smerge on a conflicted file, and calling git + add when there are no longer conflict markers in a saved file. + This is a completed version of Rüdiger Sonderfeld's proposal. + + * vc/vc-git.el (vc-git-conflicted-files): New function. Integrate + Rüdiger Sonderfeld's code for detecting conflicted files using a + status listing. Useful in itself and a step towards better smerge support. 2014-08-12 Stefan Monnier === modified file 'lisp/vc/vc-git.el' --- lisp/vc/vc-git.el 2014-08-13 08:05:45 +0000 +++ lisp/vc/vc-git.el 2014-08-13 08:42:33 +0000 @@ -101,7 +101,7 @@ ;; - clear-headers () NOT NEEDED ;; - delete-file (file) OK ;; - rename-file (old new) OK -;; - find-file-hook () NOT NEEDED +;; - find-file-hook () OK ;; - conflicted-files OK ;;; Code: @@ -786,6 +786,26 @@ "DU" "AA" "UU")) (push file files))))))) +(defun vc-git-resolve-when-done () + "Call \"git add\" if the conflict markers have been removed." + (save-excursion + (goto-char (point-min)) + (unless (re-search-forward "^<<<<<<< " nil t) + (vc-git-command nil 0 buffer-file-name "add") + ;; Remove the hook so that it is not called multiple times. + (remove-hook 'after-save-hook 'vc-git-resolve-when-done t)))) + +(defun vc-git-find-file-hook () + "Activate `smerge-mode' if there is a conflict." + (when (and buffer-file-name + (vc-git-conflicted-files buffer-file-name) + (save-excursion + (goto-char (point-min)) + (re-search-forward "^<<<<<<< " nil 'noerror))) + (vc-file-setprop buffer-file-name 'vc-state 'conflict) + (smerge-start-session) + (add-hook 'after-save-hook 'vc-git-resolve-when-done nil 'local) + (message "There are unresolved conflicts in this file"))) ;;; HISTORY FUNCTIONS ------------------------------------------------------------ revno: 117697 committer: Eric S. Raymond branch nick: trunk timestamp: Wed 2014-08-13 04:05:45 -0400 message: Integrate R?diger Sonderfeld's code for detecting conflicted files under git. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-12 16:16:00 +0000 +++ lisp/ChangeLog 2014-08-13 08:05:45 +0000 @@ -1,3 +1,10 @@ +2014-08-13 Eric S. Raymond + + * vc/vc-git.el (vc-git-conflicted-files): Integrate Rüdiger + Sonderfeld's code for detecting conflicted files using a status + listing. Useful in itself and a step towards better smerge + support. + 2014-08-12 Stefan Monnier * mpc.el (mpc-reorder): Don't bother splitting the "active"s elements === modified file 'lisp/vc/vc-git.el' --- lisp/vc/vc-git.el 2014-06-29 20:48:55 +0000 +++ lisp/vc/vc-git.el 2014-08-13 08:05:45 +0000 @@ -102,6 +102,7 @@ ;; - delete-file (file) OK ;; - rename-file (old new) OK ;; - find-file-hook () NOT NEEDED +;; - conflicted-files OK ;;; Code: @@ -769,6 +770,23 @@ (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git))) (vc-set-async-update buffer))) +(defun vc-git-conflicted-files (directory) + "Return the list of files with conflicts in DIRECTORY." + (let* ((status + (vc-git--run-command-string directory "status" "--porcelain" "--")) + (lines (split-string status "\n" 'omit-nulls)) + files) + (dolist (line lines files) + (when (string-match "\\([ MADRCU?!][ MADRCU?!]\\) \\(.+\\)\\(?: -> \\(.+\\)\\)?" + line) + (let ((state (match-string 1 line)) + (file (match-string 2 line))) + ;; See git-status(1). + (when (member state '("AU" "UD" "UA" ;; "DD" + "DU" "AA" "UU")) + (push file files))))))) + + ;;; HISTORY FUNCTIONS (autoload 'vc-setup-buffer "vc-dispatcher")