Permalink
Browse files

* 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.

	* 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...
1 parent c107a2b commit 497da025c3d6a5dba4b35714002fde8d322360fd sharik committed Aug 3, 2008
Showing with 517 additions and 232 deletions.
  1. +12 −0 ChangeLog
  2. +72 −0 THOUGHTS
  3. +2 −2 emacs-interaction.scm
  4. +40 −16 fud.el
  5. +377 −168 fud.scm
  6. +14 −46 gimp-mode.el
View
@@ -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
View
@@ -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.
View
@@ -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
@@ -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")))
View
56 fud.el
@@ -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
@@ -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 ")"))
@@ -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))
@@ -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\")"))
Oops, something went wrong.

0 comments on commit 497da02

Please sign in to comment.