Commit 75f38fe8 authored by David Byers's avatar David Byers
Browse files

Fix problems with english key bindings.

Fix problems with slow mode.
Sync swedish keybindings with english ones.
parent 2dcaf4fb
2000-09-14 David Byers <davby@sen2.ida.liu.se>
* english-strings.el: We tried to bind things in the *swedish*
keymaps. Bad idea. Fixed.
2000-09-13 David Byers <davby@sen2.ida.liu.se>
* english-strings.el: Bind C-c C-y in edit mode. Bind keys in
lyskom-en-customize-map (used to say lyskom-sv-customize-map).
2000-09-14 Joel Rosdahl <joel@lysator.liu.se>
* vars.el.in: Proof-read variable descriptions.
2000-09-09 David Byers <davby@sen2.ida.liu.se>
Fix problems with slow commands:
* slow.el (lyskom-expand-slow-command): Return the command when
there is an exact match.
(kom-parse-command-and-execute): Use lyskom-expand-slow-command
instead of kom-expand-slow-command.
* Release av 0.46.1-BETA-1
* swedish-strings.el: Changed ".)" to ")." where appropriate.
......
......@@ -36,8 +36,8 @@
# makefile too!
#
CLIENTVERSION = 0.46.1-BETA-1
DOCFILES=NEWS-0.46
CLIENTVERSION = 0.46.1-BETA-2
DOCFILES=NEWS-0.46 NEWS-0.46.1
DEBIANCLIENTVERSION = $(shell echo $(CLIENTVERSION) | tr - .)
REDHATCLIENTVERSION = $(shell echo $(CLIENTVERSION) | tr - .)
......
......@@ -284,8 +284,60 @@ and back of the string."
(setq string (substring string 0 (match-beginning 0))))
string)
;;; FIXME HARDER: Completion of single SPC should
;;; be "" or possibly nil.
;;; FIXME: Below is an idea on how to do command completion more right.
;;;
;;; Precompute lists of words in all commands. Include the optional words
;;; and mark them as optional. Possibly allow sublists in the list, and
;;; make lists of words into sublists and mark the entire sublist as
;;; optional.
;;;
;;; When matching, divide the input into a list of words. Start matchin
;;; prefixes against the list of words for a command. It goes something
;;; like this:
;;;
;;; C = 0, I = 0
;;; while there are more words in the input and command
;;; A = word I of the input
;;; B = word C of the command
;;; if B is an optional word then
;;; N = index of word following optional group that B is part of
;;; push N,I onto backtracking stack
;;; if A is a prefix of B then
;;; I = I + 1
;;; C = C + 1
;;; next iteration of the loop
;;; if the backtracking stack is empty then
;;; return mismatch
;;; pop X,Y from the backtracking stack
;;; C = X
;;; I = Y
;;; next iteration of the loop
;;; end while
;;; if there are left-over words in C then
;;; return a mismatch
;;; else
;;; return a match (I,C)
;;;
;;; When doing a word completion we can let the completion function do the
;;; actual work. It computes the longest possible completion we can have
;;; (i.e. one full word more than what we've got) and hands that over to
;;; lyskom-complete-string. Computing the longest possible completion
;;; goes something like this:
;;;
;;; W = nil
;;; Store I,C for all matches
;;; for all matches M = 1 .. N do
;;; do something useful
;;;
;;; The idea is to get the last word that matches the input by storing
;;; the results of the match computation and then looking at the
;;; following word in all possible completions. If the following word
;;; is a word in an optional group that is the same in all possible
;;; completions, then that plus the first C words of any of the
;;; possible completions is the maximum possible. If the next word is
;;; a word of an optional group that does *not* match in all
;;; possibles, then ignore the optional group and look at the next
;;; word instead.
(defun lyskom-complete-command (string predicate all)
"Completion function for LysKOM commands."
......
......@@ -111,7 +111,7 @@ install: lyskom-@@CLIENTVERSION@@.elc
cp lyskom-@@CLIENTVERSION@@.el lyskom-@@CLIENTVERSION@@.elc $(LISPDIR)
rm -f $(LISPDIR)/lyskom.el
ln -s $(LISPDIR)/lyskom-@@CLIENTVERSION@@.el $(LISPDIR)/lyskom.el
ln -s $(LISPDIR)/lyskom.elc
rm -s $(LISPDIR)/lyskom.elc
ln -s $(LISPDIR)/lyskom-@@CLIENTVERSION@@.elc $(LISPDIR)/lyskom.elc
clean:
......
......@@ -88,8 +88,9 @@
(define-key lyskom-en-edit-prefix (kbd "C-r C-c") 'kom-edit-show-commented)
(define-key lyskom-en-edit-prefix (kbd "C-i ?") 'lyskom-help)
(define-key lyskom-en-edit-prefix (kbd "C-i C-c") 'kom-edit-insert-commented)
(define-key lyskom-en-edit-prefix (kbd "C-y") 'kom-edit-insert-commented)
(define-key lyskom-en-edit-prefix (kbd "C-i C-y") 'kom-edit-insert-commented)
(define-key lyskom-sv-edit-prefix (kbd "C-b") 'kom-edit-insert-buglist)
(define-key lyskom-en-edit-prefix (kbd "C-b") 'kom-edit-insert-buglist)
(define-key lyskom-en-edit-prefix (kbd "C-i 1") 'kom-edit-insert-digit-text)
(define-key lyskom-en-edit-prefix (kbd "C-i 2") 'kom-edit-insert-digit-text)
(define-key lyskom-en-edit-prefix (kbd "C-i 3") 'kom-edit-insert-digit-text)
......@@ -99,7 +100,7 @@
(define-key lyskom-en-edit-prefix (kbd "C-i 7") 'kom-edit-insert-digit-text)
(define-key lyskom-en-edit-prefix (kbd "C-i 8") 'kom-edit-insert-digit-text)
(define-key lyskom-en-edit-prefix (kbd "C-i 9") 'kom-edit-insert-digit-text)
(define-key lyskom-en-edit-prefix (kbd "C-i ") 'kom-edit-insert-text)
(define-key lyskom-en-edit-prefix (kbd "C-i SPC") 'kom-edit-insert-text)
(define-key lyskom-en-edit-prefix (kbd "C-a") 'lyskom-en-edit-add-prefix)
(define-key lyskom-en-edit-prefix (kbd "C-a C-r") 'kom-edit-add-recipient)
(define-key lyskom-en-edit-prefix (kbd "C-a C-c") 'kom-edit-add-copy)
......@@ -2031,8 +2032,8 @@ You must become an active member of the conference to enter it.\n")
(define-key lyskom-en-mode-map (kbd "M-p") 'backward-text)
(define-key lyskom-en-mode-map (kbd "M-n") 'forward-text)
(define-key lyskom-sv-mode-map (kbd "C-M-p") 'kom-prev-prompt)
(define-key lyskom-sv-mode-map (kbd "C-M-n") 'kom-next-prompt)
(define-key lyskom-en-mode-map (kbd "C-M-p") 'kom-prev-prompt)
(define-key lyskom-en-mode-map (kbd "C-M-n") 'kom-next-prompt)
(define-key lyskom-en-mode-map (kbd "s a") 'kom-save-text)
(define-key lyskom-en-mode-map (kbd "C-?") 'scroll-down)
......@@ -2052,7 +2053,7 @@ You must become an active member of the conference to enter it.\n")
(setq lyskom-en-filter-edit-map (make-keymap))
(suppress-keymap lyskom-en-filter-edit-map)
(define-prefix-command 'lyskom-en-filter-edit-prefix)
(define-key lyskom-sv-filter-edit-map (kbd "C-c") 'lyskom-en-filter-edit-prefix)
(define-key lyskom-en-filter-edit-map (kbd "C-c") 'lyskom-en-filter-edit-prefix)
(define-key lyskom-en-filter-edit-map (kbd "p") 'lyskom-filter-edit-prev-pattern)
(define-key lyskom-en-filter-edit-map (kbd "P") 'lyskom-filter-edit-prev-entry)
(define-key lyskom-en-filter-edit-map (kbd "n") 'lyskom-filter-edit-next-pattern)
......@@ -2075,7 +2076,7 @@ You must become an active member of the conference to enter it.\n")
(define-key lyskom-en-filter-edit-map (kbd "M-<") 'lyskom-filter-edit-beginning-of-list)
(define-key lyskom-en-filter-edit-map (kbd "M->") 'lyskom-filter-edit-end-of-list)
(define-key lyskom-en-filter-edit-map (kbd "q") 'lyskom-filter-edit-quit)
(define-key lyskom-sv-filter-edit-map (kbd "C-c C-c") 'lyskom-filter-edit-quit)
(define-key lyskom-en-filter-edit-map (kbd "C-c C-c") 'lyskom-filter-edit-quit)
(define-key lyskom-en-filter-edit-map (kbd "x") 'lyskom-filter-edit-expunge)
(define-key lyskom-en-filter-edit-map (kbd "s") 'lyskom-filter-edit-save)
(define-key lyskom-en-filter-edit-map (kbd "g") 'lyskom-filter-edit-revert)
......@@ -2165,23 +2166,23 @@ You must become an active member of the conference to enter it.\n")
(if lyskom-en-customize-map
nil
(setq lyskom-en-customize-map (make-sparse-keymap))
(define-key lyskom-sv-customize-map (kbd "TAB") 'widget-forward)
(define-key lyskom-sv-customize-map (kbd "M-TAB") 'widget-backward)
(define-key lyskom-sv-customize-map (kbd "C-i") 'widget-forward)
(define-key lyskom-sv-customize-map (kbd "M-C-i") 'widget-backward)
(define-key lyskom-sv-customize-map (kbd "C-m") 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd "C-j") 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd "<RET>") 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd "<LFD>") 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd (lyskom-keys 'button2)) 'kom-mouse-null)
(define-key lyskom-sv-customize-map (kbd (lyskom-keys 'button3)) 'kom-mouse-null)
(define-key lyskom-en-customize-map (kbd "TAB") 'widget-forward)
(define-key lyskom-en-customize-map (kbd "M-TAB") 'widget-backward)
(define-key lyskom-en-customize-map (kbd "C-i") 'widget-forward)
(define-key lyskom-en-customize-map (kbd "M-C-i") 'widget-backward)
(define-key lyskom-en-customize-map (kbd "C-m") 'widget-button-press)
(define-key lyskom-en-customize-map (kbd "C-j") 'widget-button-press)
(define-key lyskom-en-customize-map (kbd "<RET>") 'widget-button-press)
(define-key lyskom-en-customize-map (kbd "<LFD>") 'widget-button-press)
(define-key lyskom-en-customize-map (kbd (lyskom-keys 'button2)) 'kom-mouse-null)
(define-key lyskom-en-customize-map (kbd (lyskom-keys 'button3)) 'kom-mouse-null)
(define-key lyskom-en-customize-map (kbd (lyskom-keys 'button2up)) 'widget-button-click)
(define-key lyskom-sv-customize-map (kbd (lyskom-keys 'button3up)) 'lyskom-widget-click)
(define-key lyskom-sv-customize-map (kbd "C-c C-c") 'lyskom-customize-save-and-quit)
(define-key lyskom-sv-customize-map (kbd "C-c C-k") 'lyskom-customize-quit)
(define-key lyskom-sv-customize-map (kbd "C-c C-s") 'lyskom-customize-save)
(define-key lyskom-sv-customize-map (kbd "C-c C-a") 'lyskom-customize-apply)
(define-key lyskom-sv-customize-map (kbd "?") 'lyskom-customize-help)
(define-key lyskom-en-customize-map (kbd (lyskom-keys 'button3up)) 'lyskom-widget-click)
(define-key lyskom-en-customize-map (kbd "C-c C-c") 'lyskom-customize-save-and-quit)
(define-key lyskom-en-customize-map (kbd "C-c C-k") 'lyskom-customize-quit)
(define-key lyskom-en-customize-map (kbd "C-c C-s") 'lyskom-customize-save)
(define-key lyskom-en-customize-map (kbd "C-c C-a") 'lyskom-customize-apply)
(define-key lyskom-en-customize-map (kbd "?") 'lyskom-customize-help)
)
(lyskom-language-strings lyskom-custom-strings en
......
......@@ -127,15 +127,17 @@ Currently the prompt is assumed to be on the last line of the buffer."
(command nil))
(cond
((null text)
(lyskom-beep t))
(lyskom-beep t)
nil)
((null completes)
(goto-char saved-point)
(lyskom-insert-before-prompt (lyskom-get-string 'no-such-command))
(lyskom-beep t))
(lyskom-beep t)
nil)
(exact
(setq command (cons (lyskom-lookup-command-by-name text) (point))))
(setq command (cons (lyskom-lookup-command-by-name (elt exact 0)) (point))))
((= (length completes) 1)
(setq command (cons (lyskom-lookup-command-by-name text) (point)))
(setq command (cons (lyskom-lookup-command-by-name (car completes)) (point)))
(delete-region (point) (point-max))
(insert (car completes)))
((> (length completes) 1)
......@@ -199,7 +201,7 @@ If the completion was not exact it returns nil."
"Reads a command from the last line in the buffer and executes it."
(interactive)
(let* ((text (lyskom-get-entered-slow-command))
(command (and text (kom-expand-slow-command t))))
(command (and text (lyskom-expand-slow-command t nil))))
(buffer-disable-undo)
(cond
((null text)
......
......@@ -96,6 +96,7 @@
(define-key lyskom-sv-edit-prefix (kbd "C-i ?") 'lyskom-help)
(define-key lyskom-sv-edit-prefix (kbd "C-i C-k") 'kom-edit-insert-commented)
(define-key lyskom-sv-edit-prefix (kbd "C-y") 'kom-edit-insert-commented)
(define-key lyskom-sv-edit-prefix (kbd "C-i C-y") 'kom-edit-insert-commented)
(define-key lyskom-sv-edit-prefix (kbd "C-b") 'kom-edit-insert-buglist)
(define-key lyskom-sv-edit-prefix (kbd "C-i 1") 'kom-edit-insert-digit-text)
(define-key lyskom-sv-edit-prefix (kbd "C-i 2") 'kom-edit-insert-digit-text)
......
......@@ -796,7 +796,7 @@ to some URL viewers."
lyskom-view-url-w3)
("windows"
".*"
"web brower"
"web browser"
lyskom-view-url-windows)
("netscape"
".*"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment