Skip to content

Commit

Permalink
* gimp-mode.el (gimp-comint-filter): add prettification to output
Browse files Browse the repository at this point in the history
of the GIMP.

* fud.scm: add stepping inside and function instruction.

* fud.el: add fud-bullet bitmap to show breakpoints.

* gimp-mode.el (gimp-open-image): changed order so that message is
not put in the *GIMP* buffer.

	* gimp-mode.el (gimp-completion-rules): enhance rule for palettes
	(gimp-shortcuts): gimp-clear (,clear from REPL) was added, to
	clear the REPL screen.
	(gimp-fnsym-in-current-sexp): fix for list beginning with a
	number (that bugged `gimp-echo' higher up the stack): now returns
	nil when the symbol begins with a number.
	(gimp-echo): change cache-resp into response, as we're (a long
	time..) not using caches anymore to save the echoing.
  • Loading branch information
sharik committed Aug 3, 2008
1 parent c107a2b commit 497da02
Show file tree
Hide file tree
Showing 6 changed files with 517 additions and 232 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
@@ -1,3 +1,15 @@
2008-08-03 Niels Giesen <niels.giesen@gmail.com>

* gimp-mode.el (gimp-comint-filter): add prettification to output
of the GIMP.

* fud.scm: add stepping inside and function instruction.

* fud.el: add fud-bullet bitmap to show breakpoints.

* gimp-mode.el (gimp-open-image): changed order so that message is
not put in the *GIMP* buffer.

2008-08-01 Niels Giesen <sharik@localhost>

* gimp-mode.el (gimp-completion-rules): enhance rule for palettes
Expand Down
72 changes: 72 additions & 0 deletions THOUGHTS
Expand Up @@ -60,5 +60,77 @@ dolist
(db-recurse body*)))


Actually, I do not think instructing beforehand is good, better do it
lazily: let fud-break give you the option to step inside, upon which
all immediate subforms that can handle it are instructed with a
fud-break spec.

So, on fud-break + step-inside:

(fud-break ""
(let ((behold 1))
1 (mapcar (lambda () ..) '(129 304)))) =>

(let ((behold (fud-break "" 1)))
(fud-break 1)
(fud-break (mapcar (lambda () ..) '(129 304)))) ;lazy

(define (fud-instruct sxp)
(mapcar
(lambda (sxp)
)))


thus:

(let ((in-let #f))
(mapcar (lambda (th)
(cond ((memq th '(let))
(begin
(set! in-let #t)
th))
(in-let
(if (symbol? th) th
(begin
(set! in-let #f)
(mapcar (lambda (th)
(list (car th)
(fud-breakify (cadr th)))) th))))
(else
(fud-breakify th))))
'(let loop ((behold 4))
1
(mapcar (lambda (b) (+ n 19)) '(129 304)))))

(define (fud-instruct-1 thunk)
(let ((in-let #f)
(in-lambda #f)
(num 0))
(mapcar (lambda (th)
(set! num (+ 1 num))
(cond ((and (= num 1)
(memq th '(let)))
(set! in-let #t)
th)
(in-let ;special let rule
(if (symbol? th) th
(begin
(set! in-let #f)
(mapcar (lambda (th)
(list (car th)
(fud-breakify (cadr th)))) th))))
((and (= num 1)
(memq th '(lambda)))
(set! in-lambda #t)
'lambda)
(in-lambda ;simple lambda rule
(set! in-lambda #f)
th)
(else
(fud-breakify th))))
thunk)))

ranking system for completions according to number of times chosen/being part of the
language.


4 changes: 2 additions & 2 deletions emacs-interaction.scm
@@ -1,5 +1,5 @@
;; -*- mode: Gimp; -*-
;;; emacs-interaction.scm --- $Id: emacs-interaction.scm,v 1.21 2008-07-24 09:05:14 sharik Exp $
;;; emacs-interaction.scm --- $Id: emacs-interaction.scm,v 1.22 2008-08-03 16:03:49 sharik Exp $
;; Copyright (C) 2008 Niels Giesen.

;; Author: Niels Giesen <nielsforkgiesen@gmailspooncom, but please
Expand Down Expand Up @@ -98,7 +98,7 @@
(with-output-to-emacs-file ;dump oblist
"emacs-gimp-oblist-cache"
(write (if (= only-bound? TRUE)
(emacs-flatten-and-filter-bound (oblist))
(emacs-flatten-and-filter-bound (oblist))
(emacs-flatten (oblist)))))
(gimp-procedural-db-dump ;dump the dump
(string-append gimp-dir "/dump.db")))
Expand Down
56 changes: 40 additions & 16 deletions fud.el
Expand Up @@ -25,6 +25,19 @@
;; FUD stands for FU Unified Debugger

;;; Code:
(define-fringe-bitmap 'fud-bullet
[0 60 126 -1 -1 -1 126 60 0])

(set-fringe-bitmap-face 'fud-bullet 'gimp-red-face)

(defun fud-show-breakpoint-bullet (&optional pos)
(put-text-property
(or pos (point))
(+ 1
(or pos (point)))
'display
'(left-fringe fud-bullet)))

(defun fud-toplevel (&optional arg)
(interactive "p")
(while
Expand Down Expand Up @@ -62,13 +75,21 @@
m))

(defun fud-breakpoint-begin ()
(fud-field
(format
"(fud-break \"%d.%d [[ file:%s ]]\""
(line-number-at-pos)
(- (point)
(point-at-bol))
(buffer-file-name))))
(save-excursion
; (fud-show-breakpoint-bullet)
(fud-field
(concat
"("
(propertize
(format
"fud-break \"%d.%d [[ file:%s ]]\""
(line-number-at-pos)
(- (point)
(point-at-bol))
(buffer-file-name))
'display
'(left-fringe fud-bullet))))))


(defun fud-breakpoint-end ()
(fud-field ")"))
Expand Down Expand Up @@ -158,6 +179,15 @@ If not found, return nil."
(forward-sexp -1))
(other-window 1))))

(defun fud-prettify-code (str)
(with-temp-buffer
(insert str)
(scheme-mode)
(pp-buffer)
(indent-region (point-min)
(point-max))
(buffer-string)))

(defun fud-echo-value (str)
(if (string-match "^[[:space:]]*[IO]:.*$" str)
(progn (message (match-string 0 str))
Expand All @@ -179,17 +209,11 @@ If not found, return nil."
(defun fud-run-tests ()
(interactive)
(assert
(fud-reference-in-string "Break O<- 241.58 [[ file:/home/sharik/.emacs.d/gimp/fud.scm ]]")
t
"FAILED fud-reference-in-string in step-out string")
(fud-reference-in-string "Break O<- 241.58 [[ file:/home/sharik/.emacs.d/gimp/fud.scm ]]"))
(assert
(not (null (nth 3 (fud-reference-in-string "Break O<- 241.58 [[ file:/home/sharik/.emacs.d/gimp/fud.scm ]]"))))
t
"fud-reference-in-string FAILED to specify t for break-out string")
(not (null (nth 3 (fud-reference-in-string "Break O<- 241.58 [[ file:/home/sharik/.emacs.d/gimp/fud.scm ]]")))))
(assert
(fud-reference-in-string "Break I-> 241.58 [[ file:/home/sharik/.emacs.d/gimp/fud.scm ]]")
t
"FAILED fud-reference-in-string in step in-string")
(fud-reference-in-string "Break I-> 241.58 [[ file:/home/sharik/.emacs.d/gimp/fud.scm ]]"))
(assert
(fud-reference-in-string "Break I-> 241.58 [[ file:nil ]]"))
(assert (fud-echo-value " I: (spaces->underscores \"13091q wekjq wejkoiqp wejqwe qwek op123\")"))
Expand Down

0 comments on commit 497da02

Please sign in to comment.