Commit 1d056c0c authored by David Byers's avatar David Byers
Browse files

Improved word completion for commands.

Still not perfect, but better.
parent a8d930ce
......@@ -205,7 +205,7 @@
(defvar lyskom-command-minibuffer-local-completion-map
(let ((map (copy-keymap minibuffer-local-completion-map)))
(define-key map " " 'lyskom-complete-command-word)
(define-key map " " 'lyskom-command-complete-word)
map)
"Keymap used for reading LysKOM names.")
......@@ -412,16 +412,47 @@ and back of the string."
(progn (minibuffer-completion-help) nil)
(delete-region (- (point-max) (length string))
(point-max))
(insert completion)
;; Now we have the suggested completion
;; Expand what's in the buffer by one real word.
(let* ((count (lyskom-command-complete-count-words string))
(result (lyskom-command-complete-word-truncate
completion count)))
(when (string= result string)
(setq result (lyskom-command-complete-word-truncate
completion (1+ count))))
(insert result))
t)))))))
(defvar lyskom-command-complete-regexp
"\\(([^\)]*)\\s-+\\)*\\S-+\\(\\s-*([^\)]*)\\)*\\(\\s-+\\|\\'\\)")
(defun lyskom-command-complete-word-truncate (completion count)
"Truncate completion COMPLETION to COUNT words."
(let ((start 0))
(while (and (> count 0)
(string-match lyskom-command-complete-regexp completion start))
(setq start (match-end 0)
count (1- count)))
(substring completion 0 start)))
(defun lyskom-command-complete-count-words (string)
"Count number of real words in command name or completion STRING."
(let ((start 0)
(count 0))
(while (string-match lyskom-command-complete-regexp string start)
(setq start (match-end 0)
count (1+ count)))
count))
;;; The code below is an alternative implementation of
;;; lyskom-command-complete-word that mucks with the
;;; contents of the minibuffer and then calls the regular
;;; minibuffer functions.
;;;
;;;(defvar lyskom-command-complete-regexp "\\(([^)]*)\\s-*\\)*\\S-+\\(\\s-*([^)]*)\\)*\\(\\s-+\\|\\'\\)")
;;;
;;;(defun lyskom-command-complete-word-count-words (string)
;;; (let ((count 0)
......
......@@ -13,7 +13,7 @@
on LysKOM, see <URL:http://www.lysator.liu.se/lyskom/>.
The latest version of the Emacs Lisp client for LysKOM is available
from <URL:ftp://ftp.lysator.liu.se/pub/lyskom/elisp-client/>.
from <URL:http://www.lysator.liu.se/lyskom/klienter/emacslisp/>.
LysKOM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
......@@ -38,22 +38,18 @@
1. REQUIREMENTS
You need an Emacs. The client appears to work with the following
versions of Emacs:
You need an Emacs. The client appears to work completely with the
following versions of Emacs:
* XEmacs version 20.4, 21.1 and newer
* Gnu Emacs version 19.34 [1]
* Gnu Emacs version 20.7 and newer [2]
* XEmacs version 21.4 and newer
* Gnu Emacs version 20.7 and newer
[1] You'll have to replace the included custom package, and if you
use Gnus, you may have to update that as well.
The client may work with earlier versions of Emacs and XEmacs. To
compile in Emacs 19.34 you will have to replace the included
custom package, and if you use Gnus you may have to update that as
well (see below).
[2] It should be possible to run the client in Gnu Emacs 20.2 and
later, but you may experience some additional problems. Column
alignment is known to fail in version 20.2.
There are also some requirements on supplemental elisp packages:
There are some requirements on supplemental elisp packages:
* custom
......@@ -75,14 +71,16 @@
package, it's time to upgrade. The latest version of Gnus is
available from <URL:http://www.gnus.org/>.
* You must NOT HAVE macedit.el
* You should NOT HAVE macedit.el
Make sure you do not have a file called macedit.el early in your
load path. This file redefines a function that the client relies
heavily on. The redefinition is buggy. You can recognize this
problem if your Emacs says something like this: "Key sequence <
m o u s e - 2 > uses invalid prefix characters" when you load or
compile the elisp client.
heavily on. The redefinition is buggy. The client will attempt
to detect this situation and fix it by loading edmacro. If you
have macedit but not edmacro, you will experience problems. You
can recognize this situation if your Emacs says something like
this: "Key sequence < m o u s e - 2 > uses invalid prefix
characters" when you load or compile the elisp client.
* w3 4.0 or later (optional)
......
......@@ -4,7 +4,7 @@
1. Set up autoloading by adding the following line to your .emacs
or any other file that Emacs loads at startup (such as
site-start.el or default.el):
~/.emacs, site-start.el or default.el):
(autoload 'lyskom "lyskom" "Start LysKOM" t)
......@@ -30,7 +30,8 @@
Before reporting a bug, please check that it is not one of the
known issues below. Please report bugs by posting them to the
bugzilla at http://bugzilla.lysator.liu.se/. You can also e-mail
bug reports to bug-lyskom@lysator.liu.se.
bug reports to bug-lyskom@lysator.liu.se if you are unable or
unwilling to use bugzilla.
To evaluate your bug report we need the following information:
......@@ -58,8 +59,40 @@
4. Known issues
Issue: I see \201 before Swedish characters in the string showing
what some other user is doing (e.g. L\201äser).
Issue: Cannot enter conference names containing international
characters.
Reason: You may be using a different character coding from the
server, and conversion to the server's coding is not
working. For example, many versions of Emacs are unable to
convert from iso-8859-15 (latin-9) to iso-8859-1 (latin-1)
even though most characters are the same.
Switching to the character coding used by the server by
using set-language-environment (probably to Latin-1) will
fix this problem. If you are unwilling to do this, you can
try loading the ucs-tables Emacs library (a version of this
file is available from <URL:http://www.lysator.liu.se/
lyskom/klienter/emacslisp/>).
Issue: Problems displaying many normal-looking texts.
Reason: Recent versions of some Linux distributions encourage users
to use the latin9 language environment, which results in
texts coded using iso-8859-15. If you do not have fonts
suitable for displaying this character coding you may
experience some problems with such texts. To fix this
problem, install fonts suitable for displaying iso-8859-15
characters. You may also be able to fix it by loading
either the ucs-tables or the latin-unity Emacs library
(a version of ucs-tables is available from <URL:http://www.
lysator.liu.se/lyskom/klienter/emacslisp/> and latin-unity
is available from the XEmacs package system).
Issue: I see \201 before international characters in the string
showing what some other user is doing (e.g. L\201äser).
Reason: The user is probably using an old version of the client in
a new version of Emacs. You can confirm this by using the
......@@ -87,7 +120,8 @@
Reason: If Swedish characters show up as blanks your font probably
does not support them. If they show up as question marks or
numbers your language environment does not support them.
numbers your language environment does not support them or
you are lacking the fonts to display them.
Make sure that your language environment is set correctly
with set-language-environment. Just setting the environment
......
......@@ -8,9 +8,9 @@
give the path to the lyskom-@@FLAVOUR@@-@@CLIENTVERSION@@.el contained
in the archive in which you found this README file.
You may see some warnings when you compile. Most of these can
be ignored. When compilation is done you should have a new file
named lyskom-@@FLAVOUR@@-@@CLIENTVERSION@@.elc located in the same
You may see some warnings when you compile. These can usually be
ignored. When compilation is done you should have a new file named
lyskom-@@FLAVOUR@@-@@CLIENTVERSION@@.elc located in the same
directory as lyskom-@@FLAVOUR@@-@@CLIENTVERSION@@.el.
2. Copy lyskom-@@FLAVOUR@@-@@CLIENTVERSION@@.elc to where you want to
......@@ -21,9 +21,4 @@
Check the value of load-path (C-h v l o a d - p a t h RET) to
see possible locations.
More thorough instructions (written in Swedish) for installation
on Windows is available here:
http://www.lysator.liu.se/lyskom/klienter/emacslisp/win2k.html
Markdown is supported
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