Commit 099893c7 authored by David Byers's avatar David Byers
Browse files

Bug fixes

Improved backward compatibility in some variables
New doc strings
Various minor requested features added
parent 880006e1
No preview for this file type
...@@ -60,6 +60,8 @@ See lyskom-edit-handler.") ...@@ -60,6 +60,8 @@ See lyskom-edit-handler.")
(defvar lyskom-edit-return-to-configuration nil (defvar lyskom-edit-return-to-configuration nil
"Status variable for an edit-buffer.") "Status variable for an edit-buffer.")
(put 'abort-send 'error-conditions '(error lyskom-error lyskom-edit-error))
(defun lyskom-edit-text (proc misc-list subject body (defun lyskom-edit-text (proc misc-list subject body
&optional handler &rest data) &optional handler &rest data)
"Edit a text in a new buffer. "Edit a text in a new buffer.
...@@ -347,39 +349,53 @@ Entry to this mode runs lyskom-edit-mode-hook." ...@@ -347,39 +349,53 @@ Entry to this mode runs lyskom-edit-mode-hook."
(defun lyskom-edit-send (send-function) (defun lyskom-edit-send (send-function)
"Send the text to the server by calling SEND-FUNCTION." "Send the text to the server by calling SEND-FUNCTION."
(interactive) (interactive)
(if (or (string= mode-name lyskom-edit-mode-name) (condition-case data
(j-or-n-p (lyskom-get-string 'already-sent))) (if (or (string= mode-name lyskom-edit-mode-name)
(progn (j-or-n-p (lyskom-get-string 'already-sent)))
(let ((buffer (current-buffer)) (progn
headers misc-list subject message) (let ((buffer (current-buffer))
headers misc-list subject message)
(save-excursion
(setq headers (lyskom-edit-parse-headers) (save-excursion
misc-list (apply 'lyskom-create-misc-list (cdr headers)) (setq headers (lyskom-edit-parse-headers)
subject (car headers))) misc-list (apply 'lyskom-create-misc-list (cdr headers))
(setq message (lyskom-edit-extract-text)) subject (car headers)))
(setq mode-name "LysKOM sending") (if (string= subject "")
(save-excursion (let ((old (point)))
(set-buffer (process-buffer lyskom-proc)) (goto-char (point-min))
;; Don't change the prompt if we won't see our own text (re-search-forward (if kom-emacs-knows-iso-8859-1
(if kom-created-texts-are-read lyskom-header-subject
(setq lyskom-dont-change-prompt t)) lyskom-swascii-header-subject)
(setq lyskom-is-writing nil) nil t)
(lyskom-tell-internat 'kom-tell-send) (end-of-line)
(funcall send-function 'sending 'lyskom-create-text-handler (if (/= (point) old)
(concat subject "\n" message) misc-list (signal 'abort-send 'enter-subject-idi))))
buffer))) (setq message (lyskom-edit-extract-text))
(if kom-dont-restore-window-after-editing (setq mode-name "LysKOM sending")
(bury-buffer) (save-excursion
(save-excursion (set-buffer (process-buffer lyskom-proc))
(if (and (boundp 'lyskom-is-dedicated-edit-window) ;; Don't change the prompt if we won't see our own text
lyskom-is-dedicated-edit-window) (if kom-created-texts-are-read
(condition-case error (setq lyskom-dont-change-prompt t))
(delete-frame) (setq lyskom-is-writing nil)
(error)))) (lyskom-tell-internat 'kom-tell-send)
(set-window-configuration lyskom-edit-return-to-configuration) (funcall send-function 'sending 'lyskom-create-text-handler
(set-buffer (window-buffer (selected-window)))) (concat subject "\n" message) misc-list
(goto-char (point-max))))) buffer)))
(if kom-dont-restore-window-after-editing
(bury-buffer)
(save-excursion
(if (and (boundp 'lyskom-is-dedicated-edit-window)
lyskom-is-dedicated-edit-window)
(condition-case error
(delete-frame)
(error))))
(set-window-configuration lyskom-edit-return-to-configuration)
(set-buffer (window-buffer (selected-window))))
(goto-char (point-max))))
(lyskom-edit-error
(lyskom-beep lyskom-ding-on-no-subject)
(lyskom-message (lyskom-get-string (cdr data))))))
(defun kom-edit-quit () (defun kom-edit-quit ()
......
...@@ -539,6 +539,7 @@ Mark the envelope with \"LysKOM bug report\"\n\n") ...@@ -539,6 +539,7 @@ Mark the envelope with \"LysKOM bug report\"\n\n")
(comment-to-by . "%#1s to article %#2d%#3s.\n") (comment-to-by . "%#1s to article %#2d%#3s.\n")
(already-sent . "You have already posted this article. Post it anyway? ") (already-sent . "You have already posted this article. Post it anyway? ")
(subject . "Subject: ") (subject . "Subject: ")
(enter-subject-idi . "Enter a subject.")
(which-text-include . "Include which article: ") (which-text-include . "Include which article: ")
(added-recipient . "Recipient: ") (added-recipient . "Recipient: ")
(added-carbon-copy . "Carbon copy to conference: ") (added-carbon-copy . "Carbon copy to conference: ")
...@@ -1176,7 +1177,9 @@ Cf. paragraph-start.") ...@@ -1176,7 +1177,9 @@ Cf. paragraph-start.")
(defvar kom-ansaphone-default-reply (defvar kom-ansaphone-default-reply
"I am not reading LysKOM right not. Please write a letter instead." "I am not reading LysKOM right not. Please write a letter instead."
"*Default message to send when the ansaphone is on.") "*Default message to send when the ansaphone is on.
This variable is stored in the LysKOM server.")
;;;; ================================================================ ;;;; ================================================================
...@@ -1225,7 +1228,9 @@ The variable kom-mercial defaults to kom-tell-wait.") ...@@ -1225,7 +1228,9 @@ The variable kom-mercial defaults to kom-tell-wait.")
(defvar kom-mercial (car (cdr (assoc 'kom-tell-wait kom-tell-phrases))) (defvar kom-mercial (car (cdr (assoc 'kom-tell-wait kom-tell-phrases)))
"*When the user has seen all articles and has reached the view-time prompt, "*When the user has seen all articles and has reached the view-time prompt,
this string is used as the argument to lyskom-tell-server. this string is used as the argument to lyskom-tell-server.
Users are encouraged to use their best sense of humor.") Users are encouraged to use their best sense of humor.
This variable is stored in the LysKOM server.")
(defconst lyskom-error-texts (defconst lyskom-error-texts
......
...@@ -257,7 +257,8 @@ current buffer." ...@@ -257,7 +257,8 @@ current buffer."
(defun lyskom-format-filter-pattern (pat) (defun lyskom-format-filter-pattern (pat)
"Format and insert the filter pattern PAT into the current buffer. "Format and insert the filter pattern PAT into the current buffer.
Returns an filter-entry structure representing the entry." Returns an filter-entry structure representing the entry."
(let (start end lines) (let ((inhibit-read-only t)
start end lines)
;; ;;
;; Insert text representation ;; Insert text representation
......
...@@ -236,7 +236,7 @@ the current match-data." ...@@ -236,7 +236,7 @@ the current match-data."
(defun lyskom-button-get-face (el) (defun lyskom-button-get-face (el)
"Get the button face for button type EL from TEXT according to "Get the button face for button type EL from TEXT according to
the current match-data." the current match-data."
(or (elt el 4) 'kom-active-face)) (elt el 4))
...@@ -261,14 +261,16 @@ FACE is the default text face for the button." ...@@ -261,14 +261,16 @@ FACE is the default text face for the button."
numarg) numarg)
(list 'face (list 'face
(or face (or face
(if (eq persno numarg) 'kom-me-face 'kom-active-face)) (cond ((eq persno numarg) 'kom-me-face)
((memq numarg kom-friends) 'kom-friends-face)
(t 'kom-active-face)))
'mouse-face 'kom-highlight-face 'mouse-face 'kom-highlight-face
'lyskom-button-text text 'lyskom-button-text text
'lyskom-button-type type 'lyskom-button-type type
'lyskom-button-arg numarg 'lyskom-button-arg numarg
'lyskom-buffer lyskom-buffer)) 'lyskom-buffer lyskom-buffer))
((and (eq type 'text) numarg) ((and (eq type 'text) numarg)
(list 'face (or face 'kom-active-face) (list 'face (or face 'kom-text-no-face)
'mouse-face 'kom-highlight-face 'mouse-face 'kom-highlight-face
'lyskom-button-text text 'lyskom-button-text text
'lyskom-button-type type 'lyskom-button-type type
...@@ -350,7 +352,21 @@ This is a LysKOM button action." ...@@ -350,7 +352,21 @@ This is a LysKOM button action."
(cond ((not (integerp arg)) nil) (cond ((not (integerp arg)) nil)
(t (pop-to-buffer buf) (t (pop-to-buffer buf)
(kom-view arg)))) (kom-view arg))))
(defun lyskom-button-review-tree (buf arg text)
"In the LysKOM buffer BUF, view the text ARG. Last argument TEXT is ignored.
This is a LysKOM button action."
(cond ((not (integerp arg)) nil)
(t (pop-to-buffer buf)
(kom-review-tree arg))))
(defun lyskom-button-find-root (buf arg text)
"In the LysKOM buffer BUF, view the text ARG. Last argument TEXT is ignored.
This is a LysKOM button action."
(cond ((not (integerp arg)) nil)
(t (pop-to-buffer buf)
(kom-find-root arg))))
(defun lyskom-button-comment-text (buf arg text) (defun lyskom-button-comment-text (buf arg text)
"In the LysKOM buffer BUF, comment the text ARG. Last argument TEXT is ignored. "In the LysKOM buffer BUF, comment the text ARG. Last argument TEXT is ignored.
...@@ -566,11 +582,17 @@ MANAGER is the URL manager that started Netscape. ...@@ -566,11 +582,17 @@ MANAGER is the URL manager that started Netscape.
This function attempts to load the URL in a running Netscape, but failing This function attempts to load the URL in a running Netscape, but failing
that, starts a new one." that, starts a new one."
(let* ((proc (start-process "netscape" (let* ((proc (apply 'start-process "netscape"
nil nil
kom-netscape-command (if (listp kom-netscape-command)
"-remote" (car kom-netscape-command)
(format "openUrl(%s)" url))) kom-netscape-command)
(if (listp kom-netscape-command)
(append (cdr kom-netscape-command)
(list "-remote"
(format "openUrl(%s)" url)))
(list "-remote"
(format "openUrl(%s)" url)))))
(status 'run) (status 'run)
(exit nil)) (exit nil))
(lyskom-url-manager-starting manager) (lyskom-url-manager-starting manager)
...@@ -580,10 +602,15 @@ that, starts a new one." ...@@ -580,10 +602,15 @@ that, starts a new one."
(setq exit (process-exit-status proc)) (setq exit (process-exit-status proc))
(cond ((and (eq status 'exit) (cond ((and (eq status 'exit)
(eq exit 1)) (eq exit 1))
(start-process "netscape" (apply 'start-process "netscape"
nil nil
kom-netscape-command (if (listp kom-netscape-command)
url)) (car kom-netscape-command)
kom-netscape-command)
(if (listp kom-netscape-command)
(append (cdr kom-netscape-command)
(list url))
(list url))))
(t nil)))) (t nil))))
...@@ -607,16 +634,26 @@ existing Mosaic process. Failing that, it starts a new Mosaic." ...@@ -607,16 +634,26 @@ existing Mosaic process. Failing that, it starts a new Mosaic."
(write-region (point-min) (point-max) filename nil 'x) (write-region (point-min) (point-max) filename nil 'x)
(kill-buffer tempbuffer) (kill-buffer tempbuffer)
(if (= -1 (signal-process pid 30)) (if (= -1 (signal-process pid 30))
(start-process "mosaic" (apply 'start-process "mosaic"
(current-buffer) (current-buffer)
kom-mosaic-command (if (listp kom-mosaic-command)
url) (car kom-mosaic-command)
kom-mosaic-command )
(if (listp kom-mosaic-command)
(append (cdr kom-mosaic-command)
(list url))
(list url)))
(lyskom-url-manager-starting manager))) (lyskom-url-manager-starting manager)))
(save-excursion (save-excursion
(start-process "mosaic" (apply 'start-process "mosaic"
(current-buffer) (current-buffer)
kom-mosaic-command (if (listp kom-mosaic-command)
url) (car kom-mosaic-command)
kom-mosaic-command )
(if (listp kom-mosaic-command)
(append (cdr kom-mosaic-command)
(list url))
(list url)))
(lyskom-url-manager-starting manager))))) (lyskom-url-manager-starting manager)))))
......
No preview for this file type
...@@ -176,7 +176,7 @@ Value returned is always nil." ...@@ -176,7 +176,7 @@ Value returned is always nil."
(lyskom-use 'blocking 'lyskom-blocking-do-multiple-1) (lyskom-use 'blocking 'lyskom-blocking-do-multiple-1)
(while (and (eq lyskom-multiple-blocking-return 'not-yet-gotten) (while (and (eq lyskom-multiple-blocking-return 'not-yet-gotten)
(not lyskom-quit-flag)) (not lyskom-quit-flag))
(accept-process-output)) (accept-process-output nil lyskom-apo-timeout-s lyskom-apo-timeout-ms))
(if lyskom-quit-flag (if lyskom-quit-flag
(progn (progn
(setq lyskom-quit-flag nil) (setq lyskom-quit-flag nil)
......
...@@ -309,7 +309,7 @@ instead. In this case the text TEXT-NO is first shown." ...@@ -309,7 +309,7 @@ instead. In this case the text TEXT-NO is first shown."
(lyskom-end-of-command))) (lyskom-end-of-command)))
(defun kom-find-root () (defun kom-find-root (&optional text-no)
"Finds the root text of the tree containing the text in lyskom-current-text." "Finds the root text of the tree containing the text in lyskom-current-text."
(interactive) (interactive)
(lyskom-start-of-command 'kom-find-root) (lyskom-start-of-command 'kom-find-root)
...@@ -318,7 +318,8 @@ instead. In this case the text TEXT-NO is first shown." ...@@ -318,7 +318,8 @@ instead. In this case the text TEXT-NO is first shown."
(lyskom-tell-internat 'kom-tell-review) (lyskom-tell-internat 'kom-tell-review)
(cond (cond
(lyskom-current-text (lyskom-current-text
(let* ((ts (blocking-do 'get-text-stat lyskom-current-text)) (let* ((ts (blocking-do 'get-text-stat (or text-no
lyskom-current-text)))
(r (lyskom-find-root ts ts))) (r (lyskom-find-root ts ts)))
(if r (if r
(lyskom-view-text r) (lyskom-view-text r)
......
...@@ -693,7 +693,7 @@ or get-text-stat." ...@@ -693,7 +693,7 @@ or get-text-stat."
data) data)
(while (and (eq lyskom-blocking-return 'not-yet-gotten) (while (and (eq lyskom-blocking-return 'not-yet-gotten)
(not lyskom-quit-flag)) (not lyskom-quit-flag))
(accept-process-output)) (accept-process-output nil lyskom-apo-timeout-s lyskom-apo-timeout-ms))
(if lyskom-quit-flag (if lyskom-quit-flag
(progn (progn
(setq lyskom-quit-flag nil) (setq lyskom-quit-flag nil)
...@@ -711,7 +711,7 @@ or get-text-stat." ...@@ -711,7 +711,7 @@ or get-text-stat."
(lyskom-run queue 'blocking-return (list t)) (lyskom-run queue 'blocking-return (list t))
(while (and (eq lyskom-blocking-return 'not-yet-gotten) (while (and (eq lyskom-blocking-return 'not-yet-gotten)
(not lyskom-quit-flag)) (not lyskom-quit-flag))
(accept-process-output)) (accept-process-output nil lyskom-apo-timeout-s lyskom-apo-timeout-ms))
(if lyskom-quit-flag (if lyskom-quit-flag
(progn (progn
(lyskom-insert-before-prompt (lyskom-get-string 'interrupted)) (lyskom-insert-before-prompt (lyskom-get-string 'interrupted))
......
...@@ -563,6 +563,7 @@ M\344rk kuvertet \"LysKOM buggrapport f\366r elispklienten\".\n\n") ...@@ -563,6 +563,7 @@ M\344rk kuvertet \"LysKOM buggrapport f\366r elispklienten\".\n\n")
(comment-to-by . "%#1s till text %#2d%#3s.\n") (comment-to-by . "%#1s till text %#2d%#3s.\n")
(already-sent . "Du har redan skickat denna text en g\345ng. S\344nd \344nd\345? ") (already-sent . "Du har redan skickat denna text en g\345ng. S\344nd \344nd\345? ")
(subject . "\304rende: ") (subject . "\304rende: ")
(enter-subject-idi . "Skriv ett rende.")
(which-text-include . "Vilken text skall vi inkludera? ") (which-text-include . "Vilken text skall vi inkludera? ")
(added-recipient . "Mottagare som skall adderas: ") (added-recipient . "Mottagare som skall adderas: ")
(added-carbon-copy . "Extra kopia till m\366te: ") (added-carbon-copy . "Extra kopia till m\366te: ")
...@@ -1273,7 +1274,9 @@ Cf. paragraph-start.") ...@@ -1273,7 +1274,9 @@ Cf. paragraph-start.")
(defvar kom-ansaphone-default-reply (defvar kom-ansaphone-default-reply
"Jag l\344ser inte LysKOM just nu. Skicka grna ett brev i stllet." "Jag l\344ser inte LysKOM just nu. Skicka grna ett brev i stllet."
"*Default message to send when the ansaphone is on.") "*Default message to send when the ansaphone is on.
This variable is stored in the LysKOM server.")
;;;; ================================================================ ;;;; ================================================================
...@@ -1324,7 +1327,9 @@ Users are encouraged to change this dictionary for fun.") ...@@ -1324,7 +1327,9 @@ Users are encouraged to change this dictionary for fun.")
(defvar kom-mercial (car (cdr (assoc 'kom-tell-wait kom-tell-phrases))) (defvar kom-mercial (car (cdr (assoc 'kom-tell-wait kom-tell-phrases)))
"*When the user has seen all texts and has reached the view-time prompt, "*When the user has seen all texts and has reached the view-time prompt,
this string is used as the argument to lyskom-tell-server. this string is used as the argument to lyskom-tell-server.
Users are encouraged to use their best sense of humor.") Users are encouraged to use their best sense of humor.
This variable is stored in the LysKOM server.")
;;; ;;;
......
This diff is collapsed.
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