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> Thu Jul 17 09:55:37 1997 David Byers <davby@ida.liu.se>
* edit-text.el (lyskom-dispatch-edit-text): Kasta undoinformation * edit-text.el (lyskom-dispatch-edit-text): Kasta undoinformation
......
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
(list 'lambda '(alternative) (list 'lambda '(alternative)
(list 'lyskom-ok-command 'alternative (list 'lyskom-ok-command 'alternative
lyskom-is-administrator)) lyskom-is-administrator))
t nil))) t nil 'lyskom-command-history)))
(cdr (lyskom-string-assoc name alternatives)))) (cdr (lyskom-string-assoc name alternatives))))
(defun lyskom-start-of-command (function &optional may-interrupt) (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." ...@@ -525,7 +525,9 @@ send. If DONTSHOW is non-nil, don't display the sent message."
'lyskom-send-message-minibuffer-exit-hook) 'lyskom-send-message-minibuffer-exit-hook)
(setq lyskom-message-string (setq lyskom-message-string
(or message (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) (setq lyskom-message-recipient (if (zerop pers-no)
nil nil
(blocking-do 'get-conf-stat (blocking-do 'get-conf-stat
...@@ -1664,7 +1666,9 @@ membership info." ...@@ -1664,7 +1666,9 @@ membership info."
(lyskom-get-string 'which-language) (lyskom-get-string 'which-language)
table table
nil nil
t))) t
nil
'lyskom-language-history)))
(when (lyskom-string-assoc language table) (when (lyskom-string-assoc language table)
(lyskom-set-language (cdr (lyskom-string-assoc language table)))))) (lyskom-set-language (cdr (lyskom-string-assoc language table))))))
...@@ -1693,3 +1697,27 @@ membership info." ...@@ -1693,3 +1697,27 @@ membership info."
tmp))) tmp)))
codes) codes)
result)) 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" ...@@ -408,6 +408,12 @@ Put this in lyskom-send-text-hook"
t) 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 () (defun kom-ispell-message ()
"Check spelling of the text. "Check spelling of the text.
kom-ispell-dictionary is the dictionary to use to check spelling. kom-ispell-dictionary is the dictionary to use to check spelling.
......
...@@ -1022,6 +1022,9 @@ On since %#8s%#9s") ...@@ -1022,6 +1022,9 @@ On since %#8s%#9s")
(reformat-html . "(HTML)") (reformat-html . "(HTML)")
(reformat-enriched . "(Enriched)") (reformat-enriched . "(Enriched)")
(reformat-filled . "(Filled)") (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") ...@@ -1151,6 +1154,7 @@ On since %#8s%#9s")
(kom-status-session . "Status (of a) session") (kom-status-session . "Status (of a) session")
(kom-customize . "Customize LysKOM") (kom-customize . "Customize LysKOM")
(kom-change-language . "Change language") (kom-change-language . "Change language")
(kom-calculate . "Calculate")
)) ))
(lyskom-language-var lyskom-language-codes en (lyskom-language-var lyskom-language-codes en
...@@ -1664,6 +1668,7 @@ Select whether to execute command or keyboard macro.") ...@@ -1664,6 +1668,7 @@ Select whether to execute command or keyboard macro.")
(off . "Off") (off . "Off")
(yes . "Yes") (yes . "Yes")
(no . "No ") (no . "No ")
(max-text-length . "For articles shorter than: ")
(turned-off . "Turned off ") (turned-off . "Turned off ")
(number-of-times . "A few times") (number-of-times . "A few times")
...@@ -2375,6 +2380,7 @@ Lists etc. : [INS] Add a line [DEL] Remove a line [*] Modify") ...@@ -2375,6 +2380,7 @@ Lists etc. : [INS] Add a line [DEL] Remove a line [*] Modify")
text-text text-text
lyskom-button-view-text lyskom-button-view-text
(("View article" . lyskom-button-view-text) (("View article" . lyskom-button-view-text)
("Review unconverted" . lyskom-button-review-noconversion)
("Review tree" . lyskom-button-review-tree) ("Review tree" . lyskom-button-review-tree)
("Review root article" . lyskom-button-find-root) ("Review root article" . lyskom-button-find-root)
("Write commend" . lyskom-button-comment-text) ("Write commend" . lyskom-button-comment-text)
......
...@@ -558,8 +558,13 @@ the current text" ...@@ -558,8 +558,13 @@ the current text"
(lyskom-insert-string 'no-recipient) (lyskom-insert-string 'no-recipient)
(lyskom-add-filter (lyskom-add-filter
(make-filter (list (cons 'subject lyskom-current-subject) (make-filter (list
(cons 'recipient-no filter-recipient)) (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) (list (cons 'action 'skip-tree)
(cons 'expire t)))) (cons 'expire t))))
(lyskom-format-insert 'super-jump (lyskom-format-insert 'super-jump
......
...@@ -487,6 +487,12 @@ This is a LysKOM button action." ...@@ -487,6 +487,12 @@ This is a LysKOM button action."
(t (pop-to-buffer buf) (t (pop-to-buffer buf)
(kom-view arg)))) (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) (defun lyskom-button-review-tree (buf arg text)
"In the LysKOM buffer BUF, view the text ARG. Last argument TEXT is ignored. "In the LysKOM buffer BUF, view the text ARG. Last argument TEXT is ignored.
......
...@@ -1503,8 +1503,10 @@ in lyskom-messages." ...@@ -1503,8 +1503,10 @@ in lyskom-messages."
(defun lyskom-fill-message (text) (defun lyskom-fill-message (text)
"Try to reformat a message." "Try to reformat a message."
(if (null kom-autowrap) (cond
text ((null kom-autowrap) text)
((and (numberp kom-autowrap) (> kom-autowrap (length text))) text)
(t
(save-excursion (save-excursion
(set-buffer (lyskom-get-buffer-create 'lyskom-text " lyskom-text" t)) (set-buffer (lyskom-get-buffer-create 'lyskom-text " lyskom-text" t))
(erase-buffer) (erase-buffer)
...@@ -1575,7 +1577,17 @@ in lyskom-messages." ...@@ -1575,7 +1577,17 @@ in lyskom-messages."
wrap-paragraph 'maybe)) 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... ;; This has to mean something...
;; ;;
...@@ -1711,7 +1723,8 @@ in lyskom-messages." ...@@ -1711,7 +1723,8 @@ in lyskom-messages."
\\|----\ \\|----\
\\|/\\*\ \\|/\\*\
\\|\\*/\ \\|\\*/\
\\|[^:]//\\)" \\|[^:]//\
\\)"
eol-point t) eol-point t)
(setq wrap-paragraph nil))) (setq wrap-paragraph nil)))
...@@ -1746,7 +1759,7 @@ in lyskom-messages." ...@@ -1746,7 +1759,7 @@ in lyskom-messages."
(let ((tmp (buffer-string))) (let ((tmp (buffer-string)))
(if (string-match "[ \t\n]+\\'" tmp) (if (string-match "[ \t\n]+\\'" tmp)
(substring tmp 0 (match-beginning 0)) (substring tmp 0 (match-beginning 0))
tmp))))) tmp))))))
(defun lyskom-fill-message-line-length () (defun lyskom-fill-message-line-length ()
(- (save-excursion (end-of-line) (- (save-excursion (end-of-line)
...@@ -2363,7 +2376,7 @@ to the user." ...@@ -2363,7 +2376,7 @@ to the user."
number)) 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 "Read a number from the minibuffer. Optional arguments: PROMPT DEFAULT
If DEFAULT is non-nil, it is written within parenthesis after the prompt. If DEFAULT is non-nil, it is written within parenthesis after the prompt.
DEFAULT could also be of the type which (interactive P) generates. 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." ...@@ -2383,7 +2396,9 @@ If quit is typed it executes lyskom-end-of-command."
(lyskom-get-string 'give-a-number)) (lyskom-get-string 'give-a-number))
(if numdefault (if numdefault
(format " (%d) " numdefault) (format " (%d) " numdefault)
" "))))) " "))
nil
history)))
(cond ((and (string= numstr "") (cond ((and (string= numstr "")
numdefault) numdefault)
(setq number numdefault)) (setq number numdefault))
...@@ -2393,10 +2408,11 @@ If quit is typed it executes lyskom-end-of-command." ...@@ -2393,10 +2408,11 @@ If quit is typed it executes lyskom-end-of-command."
number)) 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 a string from the minibuffer. Arguments: PROMPT INITIAL"
(read-string prompt (read-string prompt
initial)) initial
history))
...@@ -2413,7 +2429,7 @@ lyskom-get-string to retrieve regexps for answer and string for repeated query." ...@@ -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)) (lyskom-message "%s" (lyskom-get-string 'yes-or-no-nag))
(sit-for 2))) (sit-for 2)))
(setq answer (lyskom-read-string (concat prompt (lyskom-get-string 'yes-or-no)) (setq answer (lyskom-read-string (concat prompt (lyskom-get-string 'yes-or-no))
initial-input)) initial-input t))
(setq nagging t)) (setq nagging t))
(not (string-match (lyskom-get-string 'no-regexp) answer)))) (not (string-match (lyskom-get-string 'no-regexp) answer))))
......
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
(item kom-review-comments) (item kom-review-comments)
(item kom-review-tree) (item kom-review-tree)
(item kom-find-root) (item kom-find-root)
(item kom-find-root-review)
(item kom-review-clear)
(hline jump-separator) (hline jump-separator)
(item kom-jump) (item kom-jump)
(item kom-super-jump) (item kom-super-jump)
......
...@@ -408,7 +408,9 @@ customize buffer but do not save them to the server." ...@@ -408,7 +408,9 @@ customize buffer but do not save them to the server."
:size 0) :size 0)
(const (ask nil))))) (const (ask nil)))))
(kom-reading-puts-comments-in-pointers-last (toggle (before after))) (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-dashed-lines (toggle (on off)))
(kom-show-author-at-end (toggle (on off))) (kom-show-author-at-end (toggle (on off)))
(kom-print-number-of-unread-on-entrance (toggle (yes no))) (kom-print-number-of-unread-on-entrance (toggle (yes no)))
......
...@@ -112,16 +112,20 @@ first non-white character was not equal to CHAR." ...@@ -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-parse-incomplete if the number is not followed by whitespace.
Signal lyskom-protocol-error if the next token is not a number." Signal lyskom-protocol-error if the next token is not a number."
(goto-char lyskom-parse-pos) (goto-char lyskom-parse-pos)
(cond
((looking-at "[ \n]*[0-9]+")
(setq lyskom-parse-pos (goto-char (match-end 0)))
(string-to-int (match-string 0)))
((looking-at "[ \n]*\\'") (cond
(goto-char (point-max)) ((looking-at "[ \n]*[0-9]+")
(signal 'lyskom-parse-incomplete nil)) (if (char-after (match-end 0))
(t (signal 'lyskom-protocol-error (progn (setq lyskom-parse-pos (goto-char (match-end 0)))
(list "Expected number, got " (lyskom-string-to-parse)))))) (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)))))
)
(defun lyskom-parse-string () (defun lyskom-parse-string ()
......
...@@ -138,7 +138,9 @@ See lyskom-mode for details." ...@@ -138,7 +138,9 @@ See lyskom-mode for details."
proxy-port)) proxy-port))
(lyskom-process-send-string (lyskom-process-send-string
proc proc
(format "connect %s:%d\r\n\r\n" (format "\
connect %s:%d HTTP/1.0\r\n\
\r\n"
host port))) host port)))
(t (setq proc (open-network-stream name buffer (t (setq proc (open-network-stream name buffer
host port))))) host port)))))
...@@ -161,7 +163,8 @@ See lyskom-mode for details." ...@@ -161,7 +163,8 @@ See lyskom-mode for details."
(concat "A" (concat "A"
(lyskom-format-objects (lyskom-format-objects
(concat (user-login-name) (concat (user-login-name)
"%" (system-name))))) "%" (system-name)))
"\n"))
(while (eq 'lyskom-connect-filter (process-filter proc)) (while (eq 'lyskom-connect-filter (process-filter proc))
(accept-process-output proc)) (accept-process-output proc))
;; Now we have got the correct response. ;; Now we have got the correct response.
......
No preview for this file type
...@@ -144,6 +144,25 @@ ...@@ -144,6 +144,25 @@
(setq n (* 2 n))) (setq n (* 2 n)))
(apply '+ l))) (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 () (defun lyskom-emacs-version ()
(cond ((string-match "^XEmacs" (emacs-version)) 'xemacs) (cond ((string-match "^XEmacs" (emacs-version)) 'xemacs)
(t 'emacs))) (t 'emacs)))
......
...@@ -475,7 +475,8 @@ various LysKOM elements.") ...@@ -475,7 +475,8 @@ various LysKOM elements.")
"*Non-nil means use button hints for overriding default actions.") "*Non-nil means use button hints for overriding default actions.")
(def-kom-var kom-autowrap t (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) server)
...@@ -516,9 +517,10 @@ various LysKOM elements.") ...@@ -516,9 +517,10 @@ various LysKOM elements.")
;; JySKom enhancements ;; JySKom enhancements
("<(m[|ö]te *\\([0-9]+\\)[^0-9]*)>" conf 0 1 nil) ("<(?m[|ö]te *\\([0-9]+\\)[^0-9]*)?>" conf 0 1 nil)
("<(text *\\([0-9]+\\)[^0-9]*)>" text 0 1 nil) ("<(?text *\\([0-9]+\\)[^0-9]*)?>" text 0 1 nil)
("<(person *\\([0-9]+\\)[^0-9]*)>" pers 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 "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. 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." ...@@ -1014,6 +1016,7 @@ Users are encouraged to use their best sense of humor."
kom-status-session kom-status-session
kom-customize kom-customize
kom-change-language kom-change-language
kom-calculate
)) ))
;(defconst lyskom-elisp-variables ;(defconst lyskom-elisp-variables
...@@ -1841,6 +1844,17 @@ to be bold with yellow text on a red background." ...@@ -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) (provide 'lyskom-vars)
;;; vars.el ends here ;;; 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