Changeset 12887
- Timestamp:
- Sep 28, 2009, 2:01:36 PM (10 years ago)
- Location:
- branches/watchpoints
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/watchpoints/cocoa-ide/cocoa-editor.lisp
r12859 r12887 1491 1491 (> (#/clickCount event) 1)))))) 1492 1492 (let* ((cache (hemlock-buffer-string-cache (#/hemlockString textstorage))) 1493 (buffer (if cache (buffer-cache-buffer cache)))) 1494 (when (and buffer (string= (hi::buffer-major-mode buffer) "Lisp")) 1495 (let* ((hi::*current-buffer* buffer)) 1496 (hi::with-mark ((m1 (hi::buffer-point buffer))) 1497 (setq index (hi:mark-absolute-position m1)) 1498 (hemlock::pre-command-parse-check m1) 1499 (when (hemlock::valid-spot m1 nil) 1500 (cond ((eql (hi::next-character m1) #\() 1501 (hi::with-mark ((m2 m1)) 1502 (when (hemlock::list-offset m2 1) 1503 (ns:init-ns-range r index (- (hi:mark-absolute-position m2) index)) 1504 (return-from HANDLED r)))) 1505 ((eql (hi::previous-character m1) #\)) 1506 (hi::with-mark ((m2 m1)) 1507 (when (hemlock::list-offset m2 -1) 1508 (ns:init-ns-range r (hi:mark-absolute-position m2) (- index (hi:mark-absolute-position m2))) 1509 (return-from HANDLED r)))))))))))) 1510 (call-next-method proposed g) 1511 #+debug 1512 (#_NSLog #@"range = %@, proposed = %@, granularity = %d" 1513 :address (#_NSStringFromRange r) 1514 :address (#_NSStringFromRange proposed) 1515 :<NSS>election<G>ranularity g)))) 1516 1517 1493 (buffer (buffer-cache-buffer cache)) 1494 (hi::*current-buffer* buffer) 1495 (point (hi::buffer-point buffer))) 1496 (hi::with-mark ((mark point)) 1497 (move-hemlock-mark-to-absolute-position mark cache index) 1498 (when (selection-offset-for-double-click buffer mark) 1499 ;; Act as if we started the selection at the other end, so the heuristic 1500 ;; in #/selectionRangeForProposedRange does the right thing. ref bug #565. 1501 (hi::move-mark point mark) 1502 (let ((start index) 1503 (end (hi::mark-absolute-position mark))) 1504 (when (< end start) (rotatef start end)) 1505 (ns:init-ns-range r start (- end start))) 1506 #+debug 1507 (#_NSLog #@"range = %@, proposed = %@, granularity = %d" 1508 :address (#_NSStringFromRange r) 1509 :address (#_NSStringFromRange proposed) 1510 :<NSS>election<G>ranularity g) 1511 (return-from HANDLED r)))))) 1512 (prog1 1513 (call-next-method proposed g) 1514 #+debug 1515 (#_NSLog #@"range = %@, proposed = %@, granularity = %d" 1516 :address (#_NSStringFromRange r) 1517 :address (#_NSStringFromRange proposed) 1518 :<NSS>election<G>ranularity g))))) 1519 1520 ;; Return nil to use the default Cocoa selection, which will be word for double-click, line for triple. 1521 ;; TODO: make this consistent with "current sexp". 1522 (defun selection-offset-for-double-click (buffer mark) 1523 (when (string= (hi::buffer-major-mode buffer) "Lisp") ;; gag 1524 (hemlock::pre-command-parse-check mark) 1525 (when (hemlock::valid-spot mark nil) 1526 (cond ((eql (hi::next-character mark) #\() 1527 (hemlock::list-offset mark 1)) 1528 ((eql (hi::previous-character mark) #\)) 1529 (hemlock::list-offset mark -1)))))) 1518 1530 1519 1531 (defun append-output (view string) … … 1534 1546 (affinity :<NSS>election<A>ffinity) 1535 1547 (still-selecting :<BOOL>)) 1536 #+debug 1537 (#_NSLog #@"Set selected range called: location = %d, length = %d, affinity = %d, still-selecting = %d" 1538 :int (pref r :<NSR>ange.location) 1539 :int (pref r :<NSR>ange.length) 1548 #+debug 1549 (#_NSLog #@"Set selected range called: range = %@, affinity = %d, still-selecting = %d" 1550 :address (#_NSStringFromRange r) 1540 1551 :<NSS>election<A>ffinity affinity 1541 1552 :<BOOL> (if still-selecting #$YES #$NO)) -
branches/watchpoints/cocoa-ide/hemlock/src/edit-defs.lisp
r12651 r12887 93 93 (error (c) (editor-error (format nil "~a" c))))))) 94 94 95 96 #|97 ;;; "Edit Command Definition" is a hack due to creeping evolution in98 ;;; GO-TO-DEFINITION. We specify :function type and a name with "-COMMAND"99 ;;; instead of :command type and the real command name because this causes100 ;;; the right pattern to be created for searching. We could either specify101 ;;; that you always edit command definitions with this command (breaking102 ;;; "Go to Definition" for commands called as functions), fixing the code,103 ;;; or we can hack this command so everything works.104 ;;;105 95 (defcommand "Edit Command Definition" (p) 106 "Prompts for command definition name and goes to it for editing."107 96 "Prompts for command definition name and goes to it for editing." 108 97 (multiple-value-bind … … 116 105 (prompt-for-keyword :tables (list *command-names*) 117 106 :prompt "Command to edit: ")) 118 (go-to-definition (fun-defined-from-pathname (command-function command)) 119 :function 120 (concatenate 'simple-string name "-COMMAND")))) 121 107 (declare (ignore name)) 108 (handler-case (edit-definition (command-function command)) 109 (error (c) (editor-error (format nil "~a" c)))))) 110 111 #| 122 112 ;;; FUN-DEFINED-FROM-PATHNAME takes a symbol or function object. It 123 113 ;;; returns a pathname for the file the function was defined in. If it was -
branches/watchpoints/cocoa-ide/hemlock/src/listener.lisp
r12859 r12887 601 601 602 602 (defcommand "Editor Evaluate Defun" (p) 603 "Evaluates the current or next top-level form in the editor Lisp.603 "Evaluates the current or next top-level form. 604 604 If the current region is active, this evaluates the region." 605 "Evaluates the current or next top-level form in the editor Lisp."606 605 (declare (ignore p)) 607 606 (if (region-active-p) … … 610 609 611 610 (defcommand "Editor Evaluate Region" (p) 612 "Evaluates lisp forms between the point and the mark in the editor Lisp." 613 "Evaluates lisp forms between the point and the mark in the editor Lisp." 611 "Evaluates lisp forms between the point and the mark" 614 612 (declare (ignore p)) 615 613 (if (region-active-p) … … 634 632 (defcommand "Editor Re-evaluate Defvar" (p) 635 633 "Evaluate the current or next top-level form if it is a DEFVAR. Treat the 636 form as if the variable is not bound. This occurs in the editor Lisp." 637 "Evaluate the current or next top-level form if it is a DEFVAR. Treat the 638 form as if the variable is not bound. This occurs in the editor Lisp." 634 form as if the variable is not bound." 639 635 (declare (ignore p)) 640 636 (with-input-from-region (stream (defun-region (current-point))) -
branches/watchpoints/level-1/l1-streams.lisp
r12842 r12887 3426 3426 3427 3427 (defmethod stream-external-format ((s character-stream)) 3428 (make-external-format :character-encoding #+big-endian-target :utf 32-be #+little-endian-target :utf32-le :line-termination :unix))3428 (make-external-format :character-encoding #+big-endian-target :utf-32be #+little-endian-target :utf-32le :line-termination :unix)) 3429 3429 3430 3430 -
branches/watchpoints/tools/advice-profiler/profiler.lisp
r11463 r12887 121 121 (ccl:rlet ((ts :mach_timespec)) 122 122 (unless (zerop (#_clock_get_time (%get-ptr clock-port) ts)) 123 (error "error reading clock ~A: ~A~%" id(ccl::%strerror (ccl::%get-errno))))123 (error "error reading Mach clock: ~A~%" (ccl::%strerror (ccl::%get-errno)))) 124 124 (mach-timespec->nanoseconds ts)))) 125 125
Note: See TracChangeset
for help on using the changeset viewer.