Commit 4ba58ea8 authored by David Byers's avatar David Byers
Browse files

Bugfixar och annat

parent bb056fcd
Tue Jul 15 10:56:50 1997 David Byers <davby@ida.liu.se>
* vars.el.in (lyskom-line-start-chars): Stt till nil.
* lyskom-rest.el (lyskom-line-start-chars): Stt vrdet hr.
* edit-text.el (lyskom-edit-get-commented): Skicka med
edit-fnstret till thendo.
(lyskom-edit-show-commented): Bibehll valt fnster.
(lyskom-edit-insert-commented): Ta emot ett till argument.
* vars.el.in (kom-print-number-of-unread-on-entrance): rv
variabeln.
(kom-show-author-at-end): Dito.
(kom-dashed-lines): Dito.
(kom-reading-puts-comments-in-pointers-last): Dito.
Mon Jul 14 11:24:09 1997 David Byers <davby@ida.liu.se>
* lyskom-rest.el (lyskom-fill-message): Klara att fill-column inte
r ett heltal.
* command.el (lyskom-read-extended-command): Visa prefixargumentet
(om det finns.)
(kom-extended-command): Skicka prefixargument till
lyskom-read-extended-command.
* commands1.el (kom-list-clients): Anvnd
dynamic-session-info. Prefix gr att man fr osynliga anvndare.
* lyskom-rest.el (forward-text): Stt paragraph-ignore-fill-prefix
till t.
(backward-text): Dito.
* commands1.el (kom-list-clients): Skriv ut total-users istf
total-visible-users.
* lyskom-rest.el (lyskom-fill-message): Bindestreck och plus kan
ocks inleda stycken.
* vars.el.in (lyskom-line-start-chars): Definiera frn
lyskom-line-start-chars-string.
(lyskom-line-start-chars-string): Ny variabel.
(kom-dont-read-saved-variables): Ls inte lyskom-login-hook frn
servern.
* english-strings.el,swedish-strings.el (lyskom-message): Minde
whitespace efter terse hur mnga etc.
* lyskom-rest.el (lyskom-fill-message): Nu bryter vi tvradare med
nollskild konstant radlngdsskillnad.
(lyskom-minimum-triagle-size): Ny variabel.
(lyskom-fill-message): Massera fill-column lite snyggare.
* edit-text.el (lyskom-edit-send): Kr anvndarhookar efter att ha
kollat rende osv.
* swedish-strings.el,english-strings.el (lyskom-edit-mode-map):
Bind mouse-2 till kom-button-click-or-yank.
* lyskom-buttons.el (kom-button-click-or-yank): Ny funktion.
(kom-button-click): Lade till do-default-argumentet.
* option-edit.el: Lgg till kom-show-namedays.
* vars.el.in (kom-show-namedays): Stt defaultvrdet till nil och
spara i servern.
* prioritize.el (lyskom-prioritize-current-entry): Hantera att
markren inte str i brjan av raden.
(kom-prioritize-select): Flytta inte markren nr man markerar.
* swedish-strings.el,english-strings.el (lyskom-message): I
priority-q skriv ut vad prioritet noll betyder.
(lyskom-sv-prioritize-mode-map): Bind kom-next-link och
kom-previous-link.
* commands1.el (lyskom-try-add-member): Tillt att man explicit
anger prioritet noll.
Sun Jul 13 12:06:20 1997 David Byers <davby@ida.liu.se> Sun Jul 13 12:06:20 1997 David Byers <davby@ida.liu.se>
* menus.el (lyskom-do-popup-menu): Frsk inte anropa nil.
* view-mode.el: Flyttade om lite i filen s att keymappen
definieras innan moden.
(lyskom-view-base-mode): Fifflade s att det fungerar ven om
view-mode r en minor mode och det inte finns en view-major-mode.
* compatibility.el (lyskom-gnu-keysym): Fixade en typo.
(lyskom-xemacs-keysym): Dito.
(lyskom-keysym): Skrev om s den fungerar i Gnu Emacs.
* option-edit.el (kom-customize): D inte bara fr att
kom-active-face inte finns.
(lyskom-create-widget): Stt menu-tag.
(lyskom-make-menu-tag): Ny funktion.
* check-strings.el (lcs-dont-check-ending-categories): Ny
variabel.
(lcs-check-strings): Kontrollera att strngar avslutas p samma
stt. Radbrytningar, punkt, kolon, frgetecken mm skall vara lika
i alla sprk.
(lcs-match-endings): Ny variabel.
(lcs-check-string-ending): Ny funktion.
* english-strings.el,swedish-strings.el: Synkroniserade, fixade
icke-matchande avslutningar.
* Makefile, distribution-Makefile (SOURCES): Lade till
view-mode.el.
* swedish-strings.el (lyskom-message): Lade till
more-than-one-root och more-than-one-root-review.
* review.el (kom-find-root-review): Varna om det finns mer n ett
urinlgg.
(kom-find-root): Visa alla urinlgg.
* vars.el.in (kom-show-namedays): Lade till kom-show-namedays.
* commands1.el (kom-display-time): Visa namnsdagar enbart om
kom-show-nameday r satt.
* option-edit.el (lyskom-create-widget): Lgg till help-echo
(lyskom-create-widget): Dito.
(lyskom-widget-help-format-handler): Hantera nytt argsformat.
(lyskom-widget-help-action): Dito, byt ut help-echo.
(lyskom-custom-variables): Lade till help-echo p ngra variabler.
(lyskom-url-viewer-widget): Lade till help-echo
(lyskom-ding-widget): Dito
(lyskom-name): Dito.
(lyskom-command): Dito.
* macros.el: Require custom och widget fr att undvika fel pga att * macros.el: Require custom och widget fr att undvika fel pga att
man har autoloads definierade fr en massa andra man har autoloads definierade fr en massa andra
widget-funktioner. widget-funktioner.
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
CLIENTVERSION = 0.45-beta CLIENTVERSION = 0.45-beta
DOCFILES=NEWS-0.45 MIGRATION-0.44-0.45 DOCFILES=NEWS-0.45 MIGRATION-0.44-0.45
FTPDIR = /usr/ftp/pub/lyskom/elisp-client FTPDIR=/home/davby/www-pub
#FTPDIR = /usr/ftp/pub/lyskom/elisp-client
LISPDIR = /usr/gnu/share/emacs/site-lisp LISPDIR = /usr/gnu/share/emacs/site-lisp
LANGUAGES = swedish english LANGUAGES = swedish english
...@@ -66,6 +67,7 @@ SOURCES = $(LANGUAGE-EL) \ ...@@ -66,6 +67,7 @@ SOURCES = $(LANGUAGE-EL) \
command.el \ command.el \
parse.el \ parse.el \
cache.el \ cache.el \
view-mode.el \
commands1.el \ commands1.el \
commands2.el \ commands2.el \
review.el \ review.el \
...@@ -151,6 +153,7 @@ release: $(HEADER) $(SOURCES) $(DISTSRC) $(MISC) ...@@ -151,6 +153,7 @@ release: $(HEADER) $(SOURCES) $(DISTSRC) $(MISC)
for i in $(DOCFILES) ; do \ for i in $(DOCFILES) ; do \
cp ../doc/$$i lyskom-$(CLIENTVERSION)/$$i ; \ cp ../doc/$$i lyskom-$(CLIENTVERSION)/$$i ; \
done done
chmod -R u+rw,g+r,o+r lyskom-$(CLIENTVERSION)
tar cvf lyskom-$(CLIENTVERSION).tar lyskom-$(CLIENTVERSION) tar cvf lyskom-$(CLIENTVERSION).tar lyskom-$(CLIENTVERSION)
gzip -9 lyskom-$(CLIENTVERSION).tar gzip -9 lyskom-$(CLIENTVERSION).tar
cp lyskom-$(CLIENTVERSION).tar.gz $(FTPDIR) cp lyskom-$(CLIENTVERSION).tar.gz $(FTPDIR)
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
(require 'lyskom) (require 'lyskom)
(defvar lcs-dont-check-ending-categories '(lyskom-command)
"String categories where ending mismatches are OK.")
(defvar lcs-message-buffer "*LysKOM string check*") (defvar lcs-message-buffer "*LysKOM string check*")
(defun lyskom-check-strings () (defun lyskom-check-strings ()
...@@ -57,9 +61,15 @@ STRINGS is a list of (language . string)." ...@@ -57,9 +61,15 @@ STRINGS is a list of (language . string)."
(str (cdr (car strings))) (str (cdr (car strings)))
(flist (lcs-check-string category name lang str))) (flist (lcs-check-string category name lang str)))
(if (listp format-list) (if (listp format-list)
(or (lcs-check-format-string format-list flist) (progn
(lcs-message nil "(%s:%s) Format mismatch\n %S\n %S" (or (lcs-check-format-string format-list flist)
category name first-str str)) (lcs-message nil "(%s:%s) Format mismatch\n %S\n %S"
category name first-str str))
(and
(not (memq category lcs-dont-check-ending-categories))
(or (lcs-check-string-ending first-str str)
(lcs-message nil "(%s:%s) Ending mismatch\n %S\n %S"
category name first-str str))))
(setq format-list flist (setq format-list flist
first-str str)) first-str str))
...@@ -96,6 +106,26 @@ STRING is the string." ...@@ -96,6 +106,26 @@ STRING is the string."
result)) result))
(defconst lcs-match-endings
'("\\." "\\?" ":" "!" "\\.\n" "\\?\n" ":\n" "!\n" "\n" ")" ")\n"
"\\? +" ": +" "\\? +\n" ": +\n")
"String endings that should be identical in various languages.")
(defun lcs-check-string-ending (template str)
(cond ((or (not (stringp template))
(not (stringp str))) t)
(t (let ((result
(mapcar
(function
(lambda (x)
(let ((pat (concat "\\`\\(.\\|\n\\)*" x "\\'")))
(eq (string-match pat template)
(string-match pat str)))))
lcs-match-endings)))
(cond ((memq nil result) nil)
(t t))))))
(defun lcs-check-format-string (template flist) (defun lcs-check-format-string (template flist)
"Match the formatters in TEMPLATE to those in FLIST." "Match the formatters in TEMPLATE to those in FLIST."
(let* ((result t)) (let* ((result t))
...@@ -129,4 +159,4 @@ FORMAT and ARGS are as for `format'." ...@@ -129,4 +159,4 @@ FORMAT and ARGS are as for `format'."
(message msg))))) (message msg)))))
\ No newline at end of file
...@@ -100,12 +100,12 @@ ...@@ -100,12 +100,12 @@
(defun kom-extended-command () (defun kom-extended-command ()
"Read a LysKOM function name and call the function." "Read a LysKOM function name and call the function."
(interactive) (interactive)
(let ((fnc (lyskom-read-extended-command))) (let ((fnc (lyskom-read-extended-command current-prefix-arg)))
(cond (cond
(fnc (call-interactively fnc)) (fnc (call-interactively fnc))
(t (kom-next-command)))) ) (t (kom-next-command)))) )
(defun lyskom-read-extended-command () (defun lyskom-read-extended-command (&optional prefix-arg)
"Reads and returns a command" "Reads and returns a command"
(let* ((completion-ignore-case t) (let* ((completion-ignore-case t)
(minibuffer-setup-hook minibuffer-setup-hook) (minibuffer-setup-hook minibuffer-setup-hook)
...@@ -113,7 +113,20 @@ ...@@ -113,7 +113,20 @@
(cons (cdr pair) (car pair)))) (cons (cdr pair) (car pair))))
(lyskom-get-strings lyskom-commands (lyskom-get-strings lyskom-commands
'lyskom-command))) 'lyskom-command)))
(name nil)) (name nil)
(prefix-text
(cond ((eq prefix-arg '-) "- ")
((equal prefix-arg '(4)) "C-u ")
((integerp prefix-arg)
(format "%d " prefix-arg))
((and (consp prefix-arg)
(integerp (car prefix-arg)))
(format "%d " (car prefix-arg)))
(t nil)))
(prompt (if prefix-text
(concat prefix-text (lyskom-get-string 'extended-command))
(lyskom-get-string 'extended-command))))
;; (add-hook 'minibuffer-setup-hook ;; (add-hook 'minibuffer-setup-hook
;; (function ;; (function
;; (lambda () ;; (lambda ()
...@@ -122,7 +135,7 @@ ...@@ -122,7 +135,7 @@
;; (aset table ?\} 345) ;; (aset table ?\} 345)
;; (set-case-table table))))) ;; (set-case-table table)))))
(lyskom-with-lyskom-minibuffer (lyskom-with-lyskom-minibuffer
(setq name (completing-read (lyskom-get-string 'extended-command) (setq name (completing-read prompt
alternatives alternatives
;; lyskom-is-administrator is buffer-local and ;; lyskom-is-administrator is buffer-local and
;; must be evalled before the call to ;; must be evalled before the call to
......
...@@ -348,7 +348,7 @@ Returns t if it was possible, otherwise nil." ...@@ -348,7 +348,7 @@ Returns t if it was possible, otherwise nil."
(> kom-membership-default-priority 0)) (> kom-membership-default-priority 0))
kom-membership-default-priority kom-membership-default-priority
(lyskom-read-num-range (lyskom-read-num-range
1 255 (lyskom-get-string 'priority-q))))) 0 255 (lyskom-get-string 'priority-q)))))
(where (where
(if (/= lyskom-pers-no (conf-stat->conf-no pers-conf-stat)) (if (/= lyskom-pers-no (conf-stat->conf-no pers-conf-stat))
1 ; When adding someone else 1 ; When adding someone else
...@@ -1536,8 +1536,10 @@ If MARK-NO == 0, review all marked texts." ...@@ -1536,8 +1536,10 @@ If MARK-NO == 0, review all marked texts."
(time->sec time)))) (time->sec time))))
(error nil)))))) (error nil))))))
lyskom-times) lyskom-times)
;;;
;;; +++ FIXME specialhack för svenska. Borde det generaliseras? ;;; +++ FIXME specialhack för svenska. Borde det generaliseras?
(when (eq lyskom-language 'sv) ;;;
(when (and (eq lyskom-language 'sv) kom-show-namedays)
(let ((tmp (lyskom-nameday time))) (let ((tmp (lyskom-nameday time)))
(when tmp (when tmp
(lyskom-insert "\n") (lyskom-insert "\n")
...@@ -2146,19 +2148,22 @@ Uses Protocol A version 9 calls" ...@@ -2146,19 +2148,22 @@ Uses Protocol A version 9 calls"
;;; ===================================================================== ;;; =====================================================================
;;; Lista klienter - List clients ;;; Lista klienter - List clients
;;; Author: David Kågedal ;;; Author: David Kågedal
;;; Modified: Daivd Byers
(def-kom-command kom-list-clients () (def-kom-command kom-list-clients (prefix)
"Display a list of all connected users." "Display a list of all connected users."
(interactive) (interactive "P")
(let* ((who-info-list (blocking-do 'who-is-on)) (let* ((want-invisible (if prefix t nil))
(who-list (sort (listify-vector who-info-list) (who-info-list (blocking-do 'who-is-on-dynamic t want-invisible nil))
(function (lambda (who1 who2) (who-list (sort (listify-vector who-info-list)
(< (who-info->connection who1) (function
(who-info->connection who2)))))) (lambda (who1 who2)
(< (dynamic-session-info->session who1)
(dynamic-session-info->session who2))))))
(total-users (length who-list)) (total-users (length who-list))
(s-width (1+ (length (int-to-string (s-width (1+ (length (int-to-string
(who-info->connection (dynamic-session-info->session
(nth (1- total-users) who-list)))))) (nth (1- total-users) who-list))))))
(format-string (lyskom-info-line-format-string (format-string (lyskom-info-line-format-string
s-width "P" (if kom-deferred-printing "D" "s")))) s-width "P" (if kom-deferred-printing "D" "s"))))
...@@ -2171,34 +2176,36 @@ Uses Protocol A version 9 calls" ...@@ -2171,34 +2176,36 @@ Uses Protocol A version 9 calls"
(while who-list (while who-list
(let* ((who-info (car who-list)) (let* ((who-info (car who-list))
(session-no (int-to-string (who-info->connection who-info))) (session-no (int-to-string (dynamic-session-info->session who-info)))
(my-session (if (= lyskom-session-no (my-session (if (= lyskom-session-no
(who-info->connection who-info)) (dynamic-session-info->session who-info))
"*" "*"
" ")) " "))
(client (if kom-deferred-printing (client (if kom-deferred-printing
(lyskom-create-defer-info (lyskom-create-defer-info
'get-client-name 'get-client-name
(who-info->connection who-info) (dynamic-session-info->session who-info)
'lyskom-deferred-client-1 'lyskom-deferred-client-1
nil nil nil ; Filled in later nil nil nil ; Filled in later
(who-info->connection who-info)) (dynamic-session-info->session who-info))
(blocking-do-multiple (blocking-do-multiple
((name (get-client-name ((name (get-client-name
(who-info->connection who-info))) (dynamic-session-info->session who-info)))
(version (get-client-version (version (get-client-version
(who-info->connection who-info)))) (dynamic-session-info->session who-info))))
(concat name " " version))))) (concat name " " version)))))
(lyskom-format-insert (lyskom-format-insert
format-string format-string
(concat session-no my-session) (concat session-no my-session)
(who-info->pers-no who-info) (dynamic-session-info->person who-info)
client)) client))
(setq who-list (cdr who-list))) (setq who-list (cdr who-list)))
(lyskom-insert (concat (make-string (- (lyskom-window-width) 2) ?-) (lyskom-insert (concat (make-string (- (lyskom-window-width) 2) ?-)
"\n")) "\n"))
(lyskom-insert (lyskom-format 'total-visible-users total-users)))) (lyskom-insert (lyskom-format (if want-invisible
'total-users
'total-visible-users) total-users))))
(defun lyskom-deferred-client-1 (name defer-info) (defun lyskom-deferred-client-1 (name defer-info)
......
...@@ -179,13 +179,13 @@ of the lyskom-provide-* functions instead." ...@@ -179,13 +179,13 @@ of the lyskom-provide-* functions instead."
(down-mouse-3 . (button3)) (down-mouse-3 . (button3))
( . aring) ( . aring)
( . Aring) ( . Aring)
( . adiearesis) ( . adiaeresis)
( . Adiearesis))) ( . Adiaeresis)))
(defconst lyskom-gnu-keysym (defconst lyskom-gnu-keysym
'(( . ?\) '(( . ?\)
( . ?\) ( . ?\)
( . ?\) ( . ?\)
( . ?\) ( . ?\)
( . ?\) ( . ?\)
( . ?\))) ( . ?\)))
...@@ -197,10 +197,12 @@ of the lyskom-provide-* functions instead." ...@@ -197,10 +197,12 @@ of the lyskom-provide-* functions instead."
(defun lyskom-keysym (sym) (defun lyskom-keysym (sym)
"Look up the proper symbol to bind sym to" "Look up the proper symbol to bind sym to"
(or (cdr (assq sym (lyskom-xemacs-or-gnu lyskom-xemacs-keysym (lyskom-xemacs-or-gnu (or (cdr (assq sym lyskom-xemacs-keysym)) sym)
lyskom-gnu-keysym))) (or (cdr (assq sym lyskom-gnu-keysym))
sym)) (let ((name (symbol-name sym)))
(and (= (length name) 1)
(elt name 0)))
sym)))
;;; ============================================================ ;;; ============================================================
;;; Text property and extents stuff ;;; Text property and extents stuff
......
...@@ -45,7 +45,7 @@ LANGUAGES=swedish english ...@@ -45,7 +45,7 @@ LANGUAGES=swedish english
RM=/bin/rm -f RM=/bin/rm -f
SHELL=/bin/sh SHELL=/bin/sh
LANGUAGE-EL=$(LANGUAGES:%=%-strings.el) LANGUAGE-EL=$(LANGUAGES:=-strings.el)
EMACS-BATCH=$(EMACS) -batch EMACS-BATCH=$(EMACS) -batch
SOURCES = $(LANGUAGE-EL) \ SOURCES = $(LANGUAGE-EL) \
komtypes.el \ komtypes.el \
...@@ -61,6 +61,7 @@ SOURCES = $(LANGUAGE-EL) \ ...@@ -61,6 +61,7 @@ SOURCES = $(LANGUAGE-EL) \
command.el \ command.el \
parse.el \ parse.el \
cache.el \ cache.el \
view-mode.el \
commands1.el \ commands1.el \
commands2.el \ commands2.el \
review.el \ review.el \
......
...@@ -302,19 +302,13 @@ Commands: ...@@ -302,19 +302,13 @@ Commands:
(setq headers (lyskom-edit-parse-headers) (setq headers (lyskom-edit-parse-headers)
misc-list (apply 'lyskom-create-misc-list (cdr headers)) misc-list (apply 'lyskom-create-misc-list (cdr headers))
subject (car headers))) subject (car headers)))
;;
;; Run user hooks
;; ####: ++++: FIXME: We should quit more graciously.
(if (not (run-hook-with-args-until-failure
'lyskom-send-text-hook))
(signal 'lyskom-edit-text-abort nil))
;; ;;
;; Check that there is a subject ;; Check that there is a subject
;; ;;
(if (string= subject "") (if (or (null subject)
(string= subject ""))
(let ((old (point))) (let ((old (point)))
(goto-char (point-min)) (goto-char (point-min))
(re-search-forward (lyskom-get-string 'header-subject) (re-search-forward (lyskom-get-string 'header-subject)
...@@ -335,6 +329,14 @@ Commands: ...@@ -335,6 +329,14 @@ Commands:
(cdr (nconc headers (cdr (nconc headers
extra-headers)))))) extra-headers))))))
;;
;; Run user hooks
;; ####: ++++: FIXME: We should quit more graciously.
(if (not (run-hook-with-args-until-failure
'lyskom-send-text-hook))
(signal 'lyskom-edit-text-abort nil))
;; ;;
;; Transform the message text ;; Transform the message text
;; ;;
...@@ -347,6 +349,13 @@ Commands: ...@@ -347,6 +349,13 @@ Commands:
(setq mode-name "LysKOM sending") (setq mode-name "LysKOM sending")
(save-excursion (save-excursion
(let ((full-message
(cond ((and lyskom-allow-missing-subject
(null subject)
(not (string-match ".*\n" message)))
message)
(t (concat (or subject "") "\n" message)))))
(set-buffer lyskom-buffer) (set-buffer lyskom-buffer)
;; Don't change the prompt if we won't see our own text ;; Don't change the prompt if we won't see our own text
(if kom-created-texts-are-read (if kom-created-texts-are-read
...@@ -356,9 +365,9 @@ Commands: ...@@ -356,9 +365,9 @@ Commands:
(funcall send-function (funcall send-function
'sending 'sending
'lyskom-create-text-handler 'lyskom-create-text-handler
(concat subject "\n" message) full-message
misc-list misc-list
buffer))) buffer))))
(lyskom-undisplay-buffer) (lyskom-undisplay-buffer)
(goto-char (point-max)))) (goto-char (point-max))))
;; ;;
...@@ -732,6 +741,7 @@ text is a member of some recipient of this text." ...@@ -732,6 +741,7 @@ text is a member of some recipient of this text."
(let ((p (point))) (let ((p (point)))
(save-excursion (save-excursion
(let* ((buffer (current-buffer)) (let* ((buffer (current-buffer))
(window (selected-window))
(headers (condition-case nil (headers (condition-case nil
(cdr (lyskom-edit-parse-headers)) (cdr (lyskom-edit-parse-headers))
(lyskom-edit-error nil))) ; Ignore these errors (lyskom-edit-error nil))) ; Ignore these errors
...@@ -746,7 +756,7 @@ text is a member of some recipient of this text." ...@@ -746,7 +756,7 @@ text is a member of some recipient of this text."
(no (no
(goto-char p) (goto-char p)
(set-buffer lyskom-buffer) (set-buffer lyskom-buffer)
(initiate-get-text 'edit thendo no buffer) (initiate-get-text 'edit thendo no buffer window)
(set-buffer buffer))