/[cmucl]/src/hemlock/completion.lisp
ViewVC logotype

Diff of /src/hemlock/completion.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by ram, Wed May 9 13:03:21 1990 UTC revision 1.2 by ram, Fri Jul 13 15:11:25 1990 UTC
# Line 219  Line 219 
219     argument insert the character that many times."     argument insert the character that many times."
220    "Implements \"Completion Self Insert\". Calling this function is not    "Implements \"Completion Self Insert\". Calling this function is not
221     meaningful."     meaningful."
222    (let ((char (text-character *last-character-typed*)))    (let ((char (ext:key-event-char *last-key-event-typed*)))
223      (unless char (editor-error "Can't insert that character."))      (unless char (editor-error "Can't insert that character."))
224      (cond ((completion-char-p char)      (cond ((completion-char-p char)
225             ;; If start of word not already in *completion-prefix*, put it             ;; If start of word not already in *completion-prefix*, put it
# Line 328  Line 328 
328            (let* ((first (position-if #'alpha-char-p string))            (let* ((first (position-if #'alpha-char-p string))
329                   (next (if first (position-if #'alpha-char-p string                   (next (if first (position-if #'alpha-char-p string
330                                                :start (1+ first)))))                                                :start (1+ first)))))
331                ;; Often completions start with asterisks when hacking on Lisp
332                ;; code, so we look for alphabetic characters.
333              (insert-string point              (insert-string point
334                             (cond ((and first (lower-case-p (char string first)))                             ;; Leave the cascading IF's alone.
335                                    completion)                             ;; Writing this as a COND, using LOWER-CASE-P as
336                                   ((and next (lower-case-p (char string next)))                             ;; the test is not equivalent to this code since
337                                    (word-capitalize completion))                             ;; numbers (and such) are nil for LOWER-CASE-P and
338                                   (t                             ;; UPPER-CASE-P.
339                                    (string-upcase completion))))))))))                             (if (and first (upper-case-p (schar string first)))
340                                   (if (and next
341                                            (upper-case-p (schar string next)))
342                                       (string-upcase completion)
343                                       (word-capitalize completion))
344                                   completion))))))))
345    
346    
347  ;;; WORD-CAPITALIZE is like STRING-CAPITALIZE except that it treats apostrophes  ;;; WORD-CAPITALIZE is like STRING-CAPITALIZE except that it treats apostrophes

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.5