Commit 246049a9 authored by David Byers's avatar David Byers
Browse files

Bugfixar

parent bf6fefe6
Tue Jul 29 11:30:48 1997 David Byers <davby@ida.liu.se>
* parse.el (lyskom-parse-num): FIXADE BUGGEN!
* lyskom-rest.el (lyskom-fill-message): kom-autowrap kan vara ett
nummer.
* option-edit.el (lyskom-custom-variables): Fixade kom-autowrap.
* vars.el.in (lyskom-text-buttons): JySKom-enhancements tillter
vi utan den extra parentesen.
* filter.el (kom-super-jump): Luddig matching av mellanslag och
Re:
Fri Jul 25 09:43:04 1997 David Byers <davby@ida.liu.se>
* edit-text.el: Definiera ngra ispell-variabler vid
kompileringen.
* commands1.el (lyskom-quit): (setq lyskom-proc nil) r bttre n
ett felmeddelande.
Wed Jul 23 16:52:42 1997 David Byers <davby@ida.liu.se>
* swedish-strings.el (lyskom-button-actions): Lade till terse
omodifierat.
* lyskom-buttons.el (lyskom-button-review-noconversion): Ny
funktion.
Sat Jul 19 13:55:29 1997 David Byers <davby@ida.liu.se>
* vars.el.in (lyskom-language-history): Ny variabel.
* commands2.el (kom-change-language): Anvnd
lyskom-language-history.
* lyskom-rest.el (lyskom-read-number): Lade till history-argument.
(ja-or-nej-p): Ingen history.
* commands2.el (lyskom-send-message): Anvnd lyskom-message-history.
* lyskom-rest.el (lyskom-read-string): Lade till history-argument.
* vars.el.in (lyskom-command-history): Ny variabel.
(lyskom-expression-history): Dito.
(lyskom-message-history): Dito.
* command.el (lyskom-read-extended-command): Anvnd
lyskom-command-history.
* utilities.el (lyskom-try-require): Ny funktion.
* commands2.el (lyskom-expr-history): Ny variabel.
(kom-calculate): Ny funktion.
* english-strings.el,swedish-strings.el (lyskom-command): Lade
till kom-calculate.
(lyskom-message): Lade till need-library och calc-expression.
* vars.el.in (lyskom-commands): Lade till kom-calculate.
Fri Jul 18 13:01:15 1997 David Byers <davby@ida.liu.se>
* startup.el (lyskom): Skicka HTTP/1.0 ocks.
Thu Jul 17 09:55:37 1997 David Byers <davby@ida.liu.se>
* edit-text.el (lyskom-dispatch-edit-text): Kasta undoinformation
......
......@@ -144,7 +144,7 @@
(list 'lambda '(alternative)
(list 'lyskom-ok-command 'alternative
lyskom-is-administrator))
t nil)))
t nil 'lyskom-command-history)))
(cdr (lyskom-string-assoc name alternatives))))
(defun lyskom-start-of-command (function &optional may-interrupt)
......
......@@ -525,7 +525,9 @@ send. If DONTSHOW is non-nil, don't display the sent message."
'lyskom-send-message-minibuffer-exit-hook)
(setq lyskom-message-string
(or message
(lyskom-read-string (lyskom-get-string 'message-prompt))))
(lyskom-read-string (lyskom-get-string 'message-prompt)
nil
'lyskom-message-history)))
(setq lyskom-message-recipient (if (zerop pers-no)
nil
(blocking-do 'get-conf-stat
......@@ -1664,7 +1666,9 @@ membership info."
(lyskom-get-string 'which-language)
table
nil
t)))
t
nil
'lyskom-language-history)))
(when (lyskom-string-assoc language table)
(lyskom-set-language (cdr (lyskom-string-assoc language table))))))
......@@ -1693,3 +1697,27 @@ membership info."
tmp)))
codes)
result))
;;; ============================================================
;;; Berkna
(def-kom-command kom-calculate (&optional exprx)
"Calculate optional arg EXPRX, or prompt the user for an expression."
(interactive)
(when (lyskom-try-require 'calc
(lyskom-get-string 'need-library))
(let* ((expr (or exprx
(lyskom-with-lyskom-minibuffer
(read-from-minibuffer
(lyskom-get-string 'calc-expression)
nil nil nil 'lyskom-expression-history))))
(result (calc-eval expr)))
(cond ((stringp result)
(lyskom-format-insert-before-prompt
"%#1s = \n %#2s\n" expr result))
(t (lyskom-format-insert-before-prompt
"%#1s = \n%#2s^ %#3s\n"
expr
(make-string (car result) ?\ )
(car (cdr result))))))))
......@@ -408,6 +408,12 @@ Put this in lyskom-send-text-hook"
t)
(eval-when-compile
(defvar ispell-dictionary nil)
(defvar ispell-message-text-end nil)
(defvar ispell-message-start-skip nil)
(defvar ispell-message-end-skip nil))
(defun kom-ispell-message ()
"Check spelling of the text.
kom-ispell-dictionary is the dictionary to use to check spelling.
......
......@@ -1022,6 +1022,9 @@ On since %#8s%#9s")
(reformat-html . "(HTML)")
(reformat-enriched . "(Enriched)")
(reformat-filled . "(Filled)")
(need-library . "The \"%#1s\" package is required for this command.\n")
(calc-expression . "Expression: ")
))
......@@ -1151,6 +1154,7 @@ On since %#8s%#9s")
(kom-status-session . "Status (of a) session")
(kom-customize . "Customize LysKOM")
(kom-change-language . "Change language")
(kom-calculate . "Calculate")
))
(lyskom-language-var lyskom-language-codes en
......@@ -1664,6 +1668,7 @@ Select whether to execute command or keyboard macro.")
(off . "Off")
(yes . "Yes")
(no . "No ")
(max-text-length . "For articles shorter than: ")
(turned-off . "Turned off ")
(number-of-times . "A few times")
......@@ -2375,6 +2380,7 @@ Lists etc. : [INS] Add a line [DEL] Remove a line [*] Modify")
text-text
lyskom-button-view-text
(("View article" . lyskom-button-view-text)
("Review unconverted" . lyskom-button-review-noconversion)
("Review tree" . lyskom-button-review-tree)
("Review root article" . lyskom-button-find-root)
("Write commend" . lyskom-button-comment-text)
......
......@@ -558,7 +558,12 @@ the current text"
(lyskom-insert-string 'no-recipient)
(lyskom-add-filter
(make-filter (list (cons 'subject lyskom-current-subject)
(make-filter (list
(cons 'subject-re
(concat "\\([rR][eE]: *\\)*"
(replace-in-string
(regexp-quote lyskom-current-subject)
"[ \t]+" "[ \t]+")))
(cons 'recipient-no filter-recipient))
(list (cons 'action 'skip-tree)
(cons 'expire t))))
......
......@@ -487,6 +487,12 @@ This is a LysKOM button action."
(t (pop-to-buffer buf)
(kom-view arg))))
(defun lyskom-button-review-noconversion (buf arg text)
"In the LysKOM buffer BUF, view the text ARG without conversion.
Last argument TEXT is ignored. This is a LysKOM button action."
(cond ((not (integerp arg)) nil)
(t (pop-to-buffer buf)
(kom-review-noconversion arg))))
(defun lyskom-button-review-tree (buf arg text)
"In the LysKOM buffer BUF, view the text ARG. Last argument TEXT is ignored.
......
......@@ -1503,8 +1503,10 @@ in lyskom-messages."
(defun lyskom-fill-message (text)
"Try to reformat a message."
(if (null kom-autowrap)
text
(cond
((null kom-autowrap) text)
((and (numberp kom-autowrap) (> kom-autowrap (length text))) text)
(t
(save-excursion
(set-buffer (lyskom-get-buffer-create 'lyskom-text " lyskom-text" t))
(erase-buffer)
......@@ -1575,7 +1577,17 @@ in lyskom-messages."
wrap-paragraph 'maybe))
;;
;; We're in a paragraph, but we see indentation or a dash.
;; We're in a paragraph, but wait! This looks like
;; a LysKOM text!
;;
((looking-at (concat "^" (regexp-quote (lyskom-get-string 'subject))
".*\n----"))
(setq wrap-paragraph nil))
;;
;; We're in a paragraph, but we see indentation, a dash or
;; something that looks like the end of a LysKOM text.
;; This has to mean something...
;;
......@@ -1711,7 +1723,8 @@ in lyskom-messages."
\\|----\
\\|/\\*\
\\|\\*/\
\\|[^:]//\\)"
\\|[^:]//\
\\)"
eol-point t)
(setq wrap-paragraph nil)))
......@@ -1746,7 +1759,7 @@ in lyskom-messages."
(let ((tmp (buffer-string)))
(if (string-match "[ \t\n]+\\'" tmp)
(substring tmp 0 (match-beginning 0))
tmp)))))
tmp))))))
(defun lyskom-fill-message-line-length ()
(- (save-excursion (end-of-line)
......@@ -2363,7 +2376,7 @@ to the user."
number))
(defun lyskom-read-number (&optional prompt default)
(defun lyskom-read-number (&optional prompt default history)
"Read a number from the minibuffer. Optional arguments: PROMPT DEFAULT
If DEFAULT is non-nil, it is written within parenthesis after the prompt.
DEFAULT could also be of the type which (interactive P) generates.
......@@ -2383,7 +2396,9 @@ If quit is typed it executes lyskom-end-of-command."
(lyskom-get-string 'give-a-number))
(if numdefault
(format " (%d) " numdefault)
" ")))))
" "))
nil
history)))
(cond ((and (string= numstr "")
numdefault)
(setq number numdefault))
......@@ -2393,10 +2408,11 @@ If quit is typed it executes lyskom-end-of-command."
number))
(defun lyskom-read-string (prompt &optional initial)
(defun lyskom-read-string (prompt &optional initial history)
"Read a string from the minibuffer. Arguments: PROMPT INITIAL"
(read-string prompt
initial))
initial
history))
......@@ -2413,7 +2429,7 @@ lyskom-get-string to retrieve regexps for answer and string for repeated query."
(lyskom-message "%s" (lyskom-get-string 'yes-or-no-nag))
(sit-for 2)))
(setq answer (lyskom-read-string (concat prompt (lyskom-get-string 'yes-or-no))
initial-input))
initial-input t))
(setq nagging t))
(not (string-match (lyskom-get-string 'no-regexp) answer))))
......
......@@ -45,6 +45,8 @@
(item kom-review-comments)
(item kom-review-tree)
(item kom-find-root)
(item kom-find-root-review)
(item kom-review-clear)
(hline jump-separator)
(item kom-jump)
(item kom-super-jump)
......
......@@ -408,7 +408,9 @@ customize buffer but do not save them to the server."
:size 0)
(const (ask nil)))))
(kom-reading-puts-comments-in-pointers-last (toggle (before after)))
(kom-autowrap (toggle (on off)))
(kom-autowrap (choice ((const (on t))
(const (off nil))
(number nil :tag max-text-length))))
(kom-dashed-lines (toggle (on off)))
(kom-show-author-at-end (toggle (on off)))
(kom-print-number-of-unread-on-entrance (toggle (yes no)))
......
......@@ -112,16 +112,20 @@ first non-white character was not equal to CHAR."
Signal lyskom-parse-incomplete if the number is not followed by whitespace.
Signal lyskom-protocol-error if the next token is not a number."
(goto-char lyskom-parse-pos)
(cond
((looking-at "[ \n]*[0-9]+")
(setq lyskom-parse-pos (goto-char (match-end 0)))
(if (char-after (match-end 0))
(progn (setq lyskom-parse-pos (goto-char (match-end 0)))
(string-to-int (match-string 0)))
(signal 'lyskom-parse-incomplete nil)))
((looking-at "[ \n]*\\'")
(goto-char (point-max))
(signal 'lyskom-parse-incomplete nil))
(t (signal 'lyskom-protocol-error
(list "Expected number, got " (lyskom-string-to-parse))))))
(list "Expected number, got " (lyskom-string-to-parse)))))
)
(defun lyskom-parse-string ()
......
......@@ -138,7 +138,9 @@ See lyskom-mode for details."
proxy-port))
(lyskom-process-send-string
proc
(format "connect %s:%d\r\n\r\n"
(format "\
connect %s:%d HTTP/1.0\r\n\
\r\n"
host port)))
(t (setq proc (open-network-stream name buffer
host port)))))
......@@ -161,7 +163,8 @@ See lyskom-mode for details."
(concat "A"
(lyskom-format-objects
(concat (user-login-name)
"%" (system-name)))))
"%" (system-name)))
"\n"))
(while (eq 'lyskom-connect-filter (process-filter proc))
(accept-process-output proc))
;; Now we have got the correct response.
......
No preview for this file type
......@@ -144,6 +144,25 @@
(setq n (* 2 n)))
(apply '+ l)))
(defun lyskom-try-require (feature &optional message &rest args)
"Load the feature FEATURE using require.
If optional MESSAGE is non-nil, use it as a LysKOM format string
taking one string argument to print an error message. Remaining
arguments are used as arguments for the format string.
Returns t if the feature is loaded or can be loaded, and nil otherwise."
(or (featurep 'feature)
(condition-case nil
(progn (require feature)
t)
(error
(when message
(apply 'lyskom-format-insert-before-prompt message (symbol-name feature) args))
nil))))
(defun lyskom-emacs-version ()
(cond ((string-match "^XEmacs" (emacs-version)) 'xemacs)
(t 'emacs)))
......
......@@ -475,7 +475,8 @@ various LysKOM elements.")
"*Non-nil means use button hints for overriding default actions.")
(def-kom-var kom-autowrap t
"*Non-nil means auto wrap articles with discretion"
"*Non-nil means auto wrap articles with discretion.
A number means wrap articles shorter than the number (in bytes)."
server)
......@@ -516,9 +517,10 @@ various LysKOM elements.")
;; JySKom enhancements
("<(m[|ö]te *\\([0-9]+\\)[^0-9]*)>" conf 0 1 nil)
("<(text *\\([0-9]+\\)[^0-9]*)>" text 0 1 nil)
("<(person *\\([0-9]+\\)[^0-9]*)>" pers 0 1 nil)
("<(?m[|ö]te *\\([0-9]+\\)[^0-9]*)?>" conf 0 1 nil)
("<(?text *\\([0-9]+\\)[^0-9]*)?>" text 0 1 nil)
("<(?person *\\([0-9]+\\)[^0-9]*)?>" pers 0 1 nil)
)
"List of buttons to install in the text mass of LysKOM objects. Each element is
a list consisting of REGEXP TYPE BUTTON-MATCH BUTTON-ARG-MATCH FACE.
......@@ -1014,6 +1016,7 @@ Users are encouraged to use their best sense of humor."
kom-status-session
kom-customize
kom-change-language
kom-calculate
))
;(defconst lyskom-elisp-variables
......@@ -1841,6 +1844,17 @@ to be bold with yellow text on a red background."
)
;;; ============================================================
;;; History lists
;;;
(defvar lyskom-command-history nil)
(defvar lyskom-expression-history nil)
(defvar lyskom-message-history nil)
(defvar lyskom-language-history nil)
(provide 'lyskom-vars)
;;; vars.el ends here
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