Commit 097c5226 authored by David Kågedal's avatar David Kågedal
Browse files

Lite fixar (bland annat för den engelska versionen), och lite arbete

på inloggningsfasen
parent 80336941
LISTFNS
TODO-dk
comments.dk
english-lyskom.el
lyskom.el
makealfa
makealfa.c
......
No preview for this file type
......@@ -82,6 +82,9 @@ vars.el: vars.el.in Makefile
sed 's/@@CLIENTVERSION@@/$(CLIENTVERSION)/' < vars.el.in > vars.el
chmod 444 vars.el
lyskom.el: $(HEADER-EL) $(SWEDISH-EL) $(PARTS-EL)
cat $(HEADER-EL) $(SWEDISH-EL) $(PARTS-EL) > lyskom.el
lyskom.elc: lyskom.el
$(EMACS-BATCH) -f batch-byte-compile lyskom.el
......@@ -90,11 +93,12 @@ lyskom.elc: lyskom.el
fast: $(HEADER-ELC) $(SWEDISH-ELC) $(PARTS-ELC)
cat $(HEADER-ELC) $(SWEDISH-ELC) $(PARTS-ELC) > lyskom.elc
english-lyskom.elc: $(HEADER-ELC) $(ENGLISH-ELC) $(PARTS-ELC)
cat $(HEADER-ELC) $(ENGLISH-ELC) $(PARTS-ELC) > english-lyskom.elc
# English version
english-lyskom.el: $(HEADER-EL) $(ENGLISH-EL) $(PARTS-EL)
cat $(HEADER-EL) $(ENGLISH-EL) $(PARTS-EL) > english-lyskom.el
lyskom.el: $(HEADER-EL) $(SWEDISH-EL) $(PARTS-EL)
cat $(HEADER-EL) $(SWEDISH-EL) $(PARTS-EL) > lyskom.el
english-lyskom.elc: english-lyskom.el
$(EMACS-BATCH) -f batch-byte-compile english-lyskom.el
$(SRC-ELC) $(SWEDISH-ELC) $(ENGLISH-ELC): macros.elc
......
......@@ -369,7 +369,7 @@ Returns t if it was possible, otherwise nil."
(if (null answer)
(progn
(lyskom-insert-string 'nope)
(if (conf-type->rd_prot conf-conf-stat)
(if (conf-type->rd_prot (conf-stat->conf-type conf-conf-stat))
;; The conference is protected. Tell the user to contact
(let ((supervisorconf (blocking-do
'get-conf-stat
......
......@@ -528,7 +528,8 @@ means send the message to everybody."
(if (null conf-stat) ;+++ annan errorhantering
(lyskom-insert "Error!\n") ;+++ Hrrrmmmmffff????
(let* ((narg (prefix-numeric-value arg))
(n (if (and (<= 0 narg)
(n (if (and arg
(<= 0 narg)
(<= narg (conf-stat->no-of-texts conf-stat)))
narg
(lyskom-read-num-range
......@@ -557,11 +558,12 @@ means send the message to everybody."
lyskom-prefetch-all-confs."
(interactive "P")
(lyskom-start-of-command 'kom-list-news)
(lyskom-prefetch-all-confs (cond
((numberp num) num)
((and (listp num)
(numberp (car num))) (car num))
(t nil)) 'lyskom-list-news))
(lyskom-prefetch-all-confs)
(lyskom-list-news (cond
((numberp num) num)
((and (listp num)
(numberp (car num))) (car num))
(t nil))))
(defvar lyskom-special-conf-name "\\`Inl.gg .t mig\\'"
......@@ -687,7 +689,7 @@ on one line."
(read-list->nth lyskom-reading-list r))))))
; Then starts fetching all text-stats and text to list them.
(lyskom-insert (format "%-7s%-6s%5s%s%s\n"
(lyskom-insert (format "%-8s%-6s%5s%s%s\n"
(lyskom-get-string 'Texts)
(lyskom-get-string 'Date)
(lyskom-get-string 'Lines)
......
......@@ -90,7 +90,7 @@ Does lyskom-end-of-command."
(condition-case emacs-18\.55
(process-kill-without-query (get-buffer-process (current-buffer)) t)
(error
;; You loose some...
;; You lose some...
(message "Old emacs! Upgrade!")
(process-kill-without-query (get-buffer-process (current-buffer)))))
(cond
......@@ -349,11 +349,12 @@ Entry to this mode runs lyskom-edit-mode-hook."
(j-or-n-p (lyskom-get-string 'already-sent)))
(progn
(let ((buffer (current-buffer))
misc-list subject message)
headers misc-list subject message)
(save-excursion
(setq misc-list (lyskom-edit-read-misc-list)
subject (lyskom-edit-extract-subject)))
(setq headers (lyskom-edit-parse-headers)
misc-list (apply 'lyskom-create-misc-list (cdr headers))
subject (car headers)))
(setq message (lyskom-edit-extract-text))
(setq mode-name "LysKOM sending")
(save-excursion
......@@ -532,62 +533,116 @@ Entry to this mode runs lyskom-edit-mode-hook."
;;; in lyskom-edit-mode.
(defun lyskom-edit-read-misc-list ()
"Read misc-list from buffer."
; +++ Should use lyskom-create-misc-list.
(defun lyskom-looking-at-header (header angled)
"Check if point is at the beginning of a header of type HEADER.
Return the corresponding number (conf no etc.). If ANGLED is non-nil,
only match a number inside <>."
(if (looking-at
(concat (downcase (substring (lyskom-get-string header)
0 4))
(if angled
".*<\\([0-9]+\\)>"
".*[^0-9]\\([0-9]+\\)")))
(string-to-int (buffer-substring (match-beginning 1)
(match-end 1)))
nil))
(defun lyskom-edit-parse-headers ()
"Parse the headers of an article.
They are returned as a list where the first element is the subject,
and the rest is a list (HEADER DATA HEADER DATA ...), where HEADER is
either 'recpt, 'cc-recpt, 'comm-to or 'footn-to. This is to make it
easy to use the result in a call to `lyskom-create-misc-list'."
(goto-char (point-min))
(let ((result (cons 'MISC-LIST nil)))
(while (and (< (point) (point-max))
(not (or (equal (char-to-string
(elt
(if kom-emacs-knows-iso-8859-1
lyskom-header-subject
lyskom-swascii-header-subject)
0))
(buffer-substring (point) (1+ (point))))
(equal (char-to-string
(elt
(if kom-emacs-knows-iso-8859-1
lyskom-swascii-header-subject
lyskom-header-subject)
0))
(buffer-substring (point) (1+ (point)))))))
(let ((char (string-to-char
(upcase (buffer-substring (point) (1+ (point)))))))
(nconc
result
(cons
(let ((result (cons "" nil))) ; The car will be replaced by
; the real subject
(save-restriction
;; Narrow to headers
(search-forward (if kom-emacs-knows-iso-8859-1
lyskom-header-separator
lyskom-swascii-header-separator))
(beginning-of-line)
(narrow-to-region (point-min) (point))
(goto-char (point-min))
(while (< (point) (point-max))
(let ((case-fold-search t)
n)
(cond
((eq char (elt (lyskom-get-string 'recipient) 0)) ;recpt
(re-search-forward "<\\([0-9]+\\)>")
(cons 'recpt (string-to-int (buffer-substring
(match-beginning 1)
(match-end 1)))))
((eq char (elt (lyskom-get-string 'carbon-copy) 0)) ;cc-recpt
(re-search-forward "<\\([0-9]+\\)>")
(cons 'cc-recpt (string-to-int (buffer-substring
(match-beginning 1)
(match-end 1)))))
((eq char (elt (lyskom-get-string 'comment) 0)) ;comm-to
(re-search-forward "\\([0-9]+\\)")
(cons 'comm-to (string-to-int (buffer-substring
(match-beginning 1)
(match-end 1)))))
((eq char (elt (lyskom-get-string 'footnote) 0)) ;footn-to
(re-search-forward "\\([0-9]+\\)")
(cons 'footn-to (string-to-int (buffer-substring
(match-beginning 1)
(match-end 1)))))
(t
(signal 'lyskom-internal-error
(list "Unknown header line: "
(buffer-substring (point)
(progn
(end-of-line)
(point)))))))
nil)))
(beginning-of-line 2))
result))
((setq n (lyskom-looking-at-header 'recipient t))
(nconc result (list 'recpt n)))
((setq n (lyskom-looking-at-header 'carbon-copy t))
(nconc result (list 'cc-recpt n)))
((setq n (lyskom-looking-at-header 'comment nil))
(nconc result (list 'comm-to n)))
((setq n (lyskom-looking-at-header 'footnote nil))
(nconc result (list 'footn-to n)))
((looking-at (if kom-emacs-knows-iso-8859-1
lyskom-header-subject
lyskom-swascii-header-subject))
(setcar result (lyskom-edit-extract-subject)))))
(forward-line 1)))
result))
;;; OBSOLETE!!!
;;(defun lyskom-edit-read-misc-list ()
;; "Read misc-list from buffer."
;; ; +++ Should use lyskom-create-misc-list.
;; (goto-char (point-min))
;; (let ((result (cons 'MISC-LIST nil)))
;; (while (and (< (point) (point-max))
;; (not (or (equal (char-to-string
;; (elt
;; (if kom-emacs-knows-iso-8859-1
;; lyskom-header-subject
;; lyskom-swascii-header-subject)
;; 0))
;; (buffer-substring (point) (1+ (point))))
;; (equal (char-to-string
;; (elt
;; (if kom-emacs-knows-iso-8859-1
;; lyskom-swascii-header-subject
;; lyskom-header-subject)
;; 0))
;; (buffer-substring (point) (1+ (point)))))))
;; (let ((char (string-to-char
;; (upcase (buffer-substring (point) (1+ (point)))))))
;; (nconc
;; result
;; (cons
;; (cond
;; ((eq char (elt (lyskom-get-string 'recipient) 0)) ;recpt
;; (re-search-forward "<\\([0-9]+\\)>")
;; (cons 'recpt (string-to-int (buffer-substring
;; (match-beginning 1)
;; (match-end 1)))))
;; ((eq char (elt (lyskom-get-string 'carbon-copy) 0)) ;cc-recpt
;; (re-search-forward "<\\([0-9]+\\)>")
;; (cons 'cc-recpt (string-to-int (buffer-substring
;; (match-beginning 1)
;; (match-end 1)))))
;; ((eq char (elt (lyskom-get-string 'comment) 0)) ;comm-to
;; (re-search-forward "\\([0-9]+\\)")
;; (cons 'comm-to (string-to-int (buffer-substring
;; (match-beginning 1)
;; (match-end 1)))))
;; ((eq char (elt (lyskom-get-string 'footnote) 0)) ;footn-to
;; (re-search-forward "\\([0-9]+\\)")
;; (cons 'footn-to (string-to-int (buffer-substring
;; (match-beginning 1)
;; (match-end 1)))))
;; (t
;; (signal 'lyskom-internal-error
;; (list "Unknown header line: "
;; (buffer-substring (point)
;; (progn
;; (end-of-line)
;; (point)))))))
;; nil)))
;; (beginning-of-line 2))
;; result))
(defun lyskom-edit-extract-subject ()
......
......@@ -251,7 +251,7 @@ and you have finished reading. Please come back later.
(who-to-remove-motd-for . "Remove note from the door of who/what: ")
(conf-all-read . "%#1s - no unread articles.\n")
(conf-all-read . "%#1M - no unread articles.\n")
(no-in-conf . "You are not present in any conference.\n")
(search-for-pers . "Enter search key (RETURN for all users) ")
......@@ -301,7 +301,7 @@ and you have finished reading. Please come back later.
(not-supervisor-for . "You are not the supervisor of %#1s.\n")
(not-supervisor-for . "You are not the supervisor of %#1s.\n")
(go-to-conf . "Go to conference %#1s.\n")
(go-to-conf . "Go to conference %#1M.\n")
(cant-go-to-his-mailbox . "You are not allowed to go to %#1s's mailbox.\n")
(not-member-of-conf . "You are not subscribed to %#1s.\n")
(about-to-change-name-from . "%#1s\n")
......@@ -321,10 +321,10 @@ and you have finished reading. Please come back later.
(who-to-add-copy-q . "Add which conference/user as recipient of a carbon copy: ")
(who-to-sub-q . "Remove who/what as a recipient: ")
(adding-name-as-recipient . "Adding %#1s as recipient of article %#2d...")
(adding-name-as-copy . "%#1s will receive a carbon copy of article %#2d...")
(adding-name-as-recipient . "Adding %#1M as recipient of article %#2n...")
(adding-name-as-copy . "%#1M will receive a carbon copy of article %#2n...")
(remove-name-as-recipient .
"Removing %#1s as recipient of article %#2d...")
"Removing %#1M as recipient of article %#2n...")
(text-to-add-q . "Add which article as a comment: ")
(text-to-remove-q . "Remove which article as a comment: ")
(add-comment-to . "Adding article %#1d as a comment to text %#2d...")
......@@ -393,29 +393,29 @@ and you have finished reading. Please come back later.
(message-prompt . "Message: ")
(message-sent-to-user .
"================================================================
Your message for %#2s:
Your message for %#2M:
%#1s
%#1t
----------------------------------------------------------------
")
(message-sent-to-all .
"================================================================
Your public message:
%#1s
%#1t
----------------------------------------------------------------
")
(message-nope .
"Unable to send the message. Perhaps the recipient isn't logged on.
The message you were sending to %#1s was:
%#2s\n")
(only-last . "Last (0 - %#1d) articles by %#2s: ")
(only-last . "Last (0 - %#1d) articles in %#2s: ")
(only-error . "Something went wrong. Sorry.\n")
(you-have-unreads . "You have %#1d unread articles in %#2s\n")
(you-have-an-unread . "You have 1 unread article in %#1s\n")
(you-have-unreads-special . "You have %#1d uncommented articles in %#2s\n")
(you-have-an-unread-special . "You have 1 uncommented article in %#1s\n")
(you-have-unreads . "You have %#1d unread articles in %#2M\n")
(you-have-an-unread . "You have 1 unread article in %#1M\n")
(you-have-unreads-special . "You have %#1d uncommented articles in %#2M\n")
(you-have-an-unread-special . "You have 1 uncommented article in %#1M\n")
(you-have-read-everything . "No news (is bad news).\n")
(total-unreads . "\nYou have %#1d unread articles.\n")
(total-unread . "\nYou have 1 unread article.\n")
......@@ -560,9 +560,9 @@ Mark the envelope with \"LysKOM bug report\"\n\n")
(recieved-at . " Received: %#1s\n")
(written-by . "by %#1s")
(comment-to-text-by . "Comment to article %#1n by %#2P\n")
(footnote-to-text-by . "Footnote to article %#1d %#2s\n")
(footnote-to-text-by . "Footnote to article %#1d %#2P\n")
(comment-in-text-by . "Comment in article %#1n by %#2P\n")
(footnote-in-text-by . "Footnote in article %#1d %#2s\n")
(footnote-in-text-by . "Footnote in article %#1d %#2P\n")
; From async.el:
......@@ -581,7 +581,7 @@ for an article.
(has-entered . "%#1:P has entered LysKOM.")
(has-entered-r . "%#1P has entered LysKOM.\n")
(has-left . "%#1:P has left LysKOM.")
(has-left-r . "%#1:P has left LysKOM.\n")
(has-left-r . "%#1P has left LysKOM.\n")
(unknown . "unknown")
(message-broadcast .
......@@ -953,7 +953,7 @@ Cf. paragraph-start.")
(define-key lyskom-mode-map "U" 'kom-unmark-text)
(define-key lyskom-mode-map "na" 'kom-view-next-new-text)
(define-key lyskom-mode-map "nc" 'kom-go-to-next-conf)
(define-key lyskom-mode-map "nl" 'kom-bext-kom)
(define-key lyskom-mode-map "nl" 'kom-next-kom)
(define-key lyskom-mode-map "q" 'kom-quit)
(define-key lyskom-mode-map "z" 'kom-bury)
(define-key lyskom-mode-map "R" 'kom-recover)
......
......@@ -25,7 +25,7 @@
;;;; ================================================================
;;;; ================================================================
;;;;
;;;; File: ignore.el
;;;; File: filter.el
;;;;
;;;; Contains the support functions for text filtering.
;;;;
......@@ -400,12 +400,13 @@ Returns nil if no such attribute is present."
(substring (text->text-mass text)
0
(match-beginning 0))
""))
(text->text-mass text)))
(lyskom-format-insert prompt
text-stat
subject
(or conf-stat
(text-stat->author text-stat))))))))
(text-stat->author text-stat)))
(lyskom-scroll))))))
(setq lyskom-filter-hack nil))
......
No preview for this file type
......@@ -271,29 +271,29 @@ he gets a y-or-n-p question for all recipients.")
("kom.csd.uu.se" . "CSD-KOM"))
"An alist mapping server names to shorter identification strings")
(defconst lyskom-elisp-variables '(
kom-do-when-done
kom-login-hook
kom-mercial
kom-higher-priority-breaks
kom-membership-default-placement
kom-membership-default-priority
kom-page-before-command
kom-presence-messages-in-buffer
kom-show-where-and-what
kom-who-buffer-size-when-displaying
kom-write-texts-in-window
kom-quit-hook
kom-permanent-filter-list
lyskom-fetch-map-nos
lyskom-new-text-hook
lyskom-prefetch-conf-tresh
lyskom-prefetch-confs
lyskom-prefetch-texts
lyskom-who-info-has-changed-hook
lyskom-prompt-text
lyskom-prompt-executing-default-command-text
)
(defconst lyskom-elisp-variables
'(kom-ding-on-personal-messages
kom-do-when-done
kom-higher-priority-breaks
kom-login-hook
kom-membership-default-placement
kom-membership-default-priority
kom-mercial
kom-page-before-command
kom-permanent-filter-list
kom-presence-messages-in-buffer
kom-quit-hook
kom-show-where-and-what
kom-who-buffer-size-when-displaying
kom-write-texts-in-window
lyskom-fetch-map-nos
lyskom-new-text-hook
lyskom-prefetch-conf-tresh
lyskom-prefetch-confs
lyskom-prefetch-texts
lyskom-prompt-executing-default-command-text
lyskom-prompt-text
lyskom-who-info-has-changed-hook)
"Tells the client what flags and hooks that are to be saved in the server.
These are the flags that are saved in the elisp-client part of the server.")
......
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