Changeset 8055


Ignore:
Timestamp:
Jan 11, 2008, 8:48:15 PM (12 years ago)
Author:
gz
Message:

Minor tweaks to completion mode. It's still mostly bogus, but at least don't call undefined functions, and don't override non-mode bindings

Location:
branches/event-ide/ccl/cocoa-ide/hemlock/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/event-ide/ccl/cocoa-ide/hemlock/src/bindings.lisp

    r8029 r8055  
    928928(bind-key "Completion Self Insert" #k"linefeed" :mode "Completion")
    929929
    930 (bind-key "Completion Complete Word" #k"end")
    931 (bind-key "Completion Rotate Completions" #k"meta-end")
    932 
    933 
     930(bind-key "Completion Complete Word" #k"end" :mode "Completion")
     931(bind-key "Completion Rotate Completions" #k"meta-end" :mode "Completion")
    934932
    935933
  • branches/event-ide/ccl/cocoa-ide/hemlock/src/completion.lisp

    r7833 r8055  
    195195  "Toggles Completion Mode in the current buffer."
    196196  (declare (ignore p))
    197   (setf (buffer-minor-mode (current-buffer) "Completion")
    198         (not (buffer-minor-mode (current-buffer) "Completion"))))
     197  (let ((buffer (current-buffer)))
     198    (setf (buffer-minor-mode buffer "Completion")
     199          (not (buffer-minor-mode buffer "Completion")))
     200    (let ((fields (buffer-modeline-fields buffer)))
     201      (if (buffer-minor-mode buffer "Completion")
     202        (unless (member *completion-modeline-field* fields)
     203          (hi::set-buffer-modeline-fields buffer
     204                                          (append fields
     205                                                  (list *completion-modeline-field*))))
     206        (when (member *completion-modeline-field* fields)
     207          (hi::set-buffer-modeline-fields buffer
     208                                          (remove *completion-modeline-field*
     209                                                  fields)))))))
    199210
    200211
     
    502513          (or (find-completion prefix prefix-length) ""))
    503514    (unless (eq old *completion-mode-possibility*)
    504       (update-modeline-field *echo-area-buffer* *echo-area-window*
    505                              *completion-modeline-field*))))
     515      (hi::note-modeline-change (current-buffer)))))
    506516
    507517(defun clear-completion-display ()
    508518  (unless (= (length (the simple-string *completion-mode-possibility*)) 0)
    509519    (setq *completion-mode-possibility* "")
    510     (update-modeline-field *echo-area-buffer* *echo-area-window*
    511                            *completion-modeline-field*)))
    512 
    513 
     520    (hi::note-modeline-change (current-buffer))))
     521
     522#|
    514523;;; COMPLETION-REDISPLAY-FUN erases any completion displayed in the status line.
    515524;;;
     
    518527  (unless (eq (last-command-type) :completion-self-insert)
    519528    (clear-completion-display)))
    520 ;;;
    521529(add-hook redisplay-hook #'completion-redisplay-fun)
     530|#
  • branches/event-ide/ccl/cocoa-ide/hemlock/src/main.lisp

    r7995 r8055  
    101101;;; Completion.Lisp, but it is compiled and loaded after this file.
    102102;;;
    103 (declaim (special hemlock::*completion-mode-possibility*))
    104 ;;; Hack for now until completion mode is added.
    105 (defvar hemlock::*completion-mode-possibility* "")
    106 ;;;
    107103(make-modeline-field
    108104 :name :completion :width 40
    109105 :function #'(lambda (buffer)
     106               (declare (special hemlock::*completion-mode-possibility*))
    110107               (declare (ignore buffer))
    111108               hemlock::*completion-mode-possibility*))
Note: See TracChangeset for help on using the changeset viewer.