Changeset 8464


Ignore:
Timestamp:
Feb 11, 2008, 3:51:39 PM (12 years ago)
Author:
gz
Message:

Fix ticket #237: keep line's ignored-region within the line

Move double-%-in to cocoa-utils, use it in log-debug

user buffer-package fn in edit definition

Fix the last compiler warning...

Location:
trunk/source/cocoa-ide
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/cocoa-editor.lisp

    r8454 r8464  
    18101810      (hemlock-view pane))))
    18111811
    1812 (defun double-%-in (string)
    1813   ;; Replace any % characters in string with %%, to keep them from
    1814   ;; being treated as printf directives.
    1815   (let* ((%pos (position #\% string)))
    1816     (if %pos
    1817       (concatenate 'string (subseq string 0 %pos) "%%" (double-%-in (subseq string (1+ %pos))))
    1818       string)))
    1819 
    1820 (defun nsstring-for-lisp-condition (cond)
    1821   (%make-nsstring (double-%-in (or (ignore-errors (princ-to-string cond))
    1822                                    "#<error printing error message>"))))
    1823 
    18241812(objc:defmethod (#/runErrorSheet: :void) ((self hemlock-frame) message)
    18251813  #+debug (#_NSLog #@"runErrorSheet: signal = %@" :id signal)
  • trunk/source/cocoa-ide/cocoa-utils.lisp

    r8455 r8464  
    236236;; debugging
    237237
     238(defun double-%-in (string)
     239  ;; Replace any % characters in string with %%, to keep them from
     240  ;; being treated as printf directives.
     241  (let* ((%pos (position #\% string)))
     242    (if %pos
     243      (concatenate 'string (subseq string 0 %pos) "%%" (double-%-in (subseq string (1+ %pos))))
     244      string)))
     245
    238246(defun log-debug (format-string &rest args)
    239   (#_NSLog (ccl::%make-nsstring (apply #'format nil format-string args))))
     247  (let ((string (apply #'format nil format-string args)))
     248    (#_NSLog (ccl::%make-nsstring (double-%-in string)))))
    240249
    241250(defun nslog-condition (c)
     
    245254        (#_NSLog #@"Error in event loop: %@" :address nsstr)))))
    246255
     256(defun nsstring-for-lisp-condition (cond)
     257  (%make-nsstring (double-%-in (or (ignore-errors (princ-to-string cond))
     258                                   "#<error printing error message>"))))
     259
    247260
    248261
  • trunk/source/cocoa-ide/hemlock/src/edit-defs.lisp

    r8428 r8464  
    7777(defcommand "Edit Definition" (p)
    7878  "Prompts for function/macro's definition name and goes to it for editing."
    79   "Prompts for function/macro's definition name and goes to it for editing."
    8079  (declare (ignore p))
    8180  (let ((fun-name (prompt-for-string
     
    8382                   :help "Symbol name of function.")))
    8483    (get-def-info-and-go-to-it fun-name (or
    85                                              (find-package
    86                                               (variable-value 'current-package :buffer (current-buffer)))
    87                                              *package*))))
     84                                         (buffer-package (current-buffer))
     85                                         *package*))))
    8886
    8987(defun get-def-info-and-go-to-it (string package)
  • trunk/source/cocoa-ide/hemlock/src/lispmode.lisp

    r8428 r8464  
    460460          (t
    461461           (push-range (cons (mark-charpos mark)
    462                              (1+ (line-length (mark-line mark))))
     462                             (line-length (mark-line mark)))
    463463                       info-struct)
    464464           ;; The Ending is marked as still being quoted.
Note: See TracChangeset for help on using the changeset viewer.