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.")
(defvar lyskom-edit-return-to-configuration nil
"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
&optional handler &rest data)
"Edit a text in a new buffer.
......@@ -347,6 +349,7 @@ Entry to this mode runs lyskom-edit-mode-hook."
(defun lyskom-edit-send (send-function)
"Send the text to the server by calling SEND-FUNCTION."
(interactive)
(condition-case data
(if (or (string= mode-name lyskom-edit-mode-name)
(j-or-n-p (lyskom-get-string 'already-sent)))
(progn
......@@ -357,6 +360,16 @@ Entry to this mode runs lyskom-edit-mode-hook."
(setq headers (lyskom-edit-parse-headers)
misc-list (apply 'lyskom-create-misc-list (cdr headers))
subject (car headers)))
(if (string= subject "")
(let ((old (point)))
(goto-char (point-min))
(re-search-forward (if kom-emacs-knows-iso-8859-1
lyskom-header-subject
lyskom-swascii-header-subject)
nil t)
(end-of-line)
(if (/= (point) old)
(signal 'abort-send 'enter-subject-idi))))
(setq message (lyskom-edit-extract-text))
(setq mode-name "LysKOM sending")
(save-excursion
......@@ -379,7 +392,10 @@ Entry to this mode runs lyskom-edit-mode-hook."
(error))))
(set-window-configuration lyskom-edit-return-to-configuration)
(set-buffer (window-buffer (selected-window))))
(goto-char (point-max)))))
(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 ()
......
......@@ -539,6 +539,7 @@ Mark the envelope with \"LysKOM bug report\"\n\n")
(comment-to-by . "%#1s to article %#2d%#3s.\n")
(already-sent . "You have already posted this article. Post it anyway? ")
(subject . "Subject: ")
(enter-subject-idi . "Enter a subject.")
(which-text-include . "Include which article: ")
(added-recipient . "Recipient: ")
(added-carbon-copy . "Carbon copy to conference: ")
......@@ -1176,7 +1177,9 @@ Cf. paragraph-start.")
(defvar kom-ansaphone-default-reply
"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.")
(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,
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
......
......@@ -257,7 +257,8 @@ current buffer."
(defun lyskom-format-filter-pattern (pat)
"Format and insert the filter pattern PAT into the current buffer.
Returns an filter-entry structure representing the entry."
(let (start end lines)
(let ((inhibit-read-only t)
start end lines)
;;
;; Insert text representation
......
......@@ -236,7 +236,7 @@ the current match-data."
(defun lyskom-button-get-face (el)
"Get the button face for button type EL from TEXT according to
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."
numarg)
(list '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
'lyskom-button-text text
'lyskom-button-type type
'lyskom-button-arg numarg
'lyskom-buffer lyskom-buffer))
((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
'lyskom-button-text text
'lyskom-button-type type
......@@ -352,6 +354,20 @@ This is a LysKOM button action."
(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)
"In the LysKOM buffer BUF, comment the text ARG. Last argument TEXT is ignored.
This is a LysKOM button action."
......@@ -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
that, starts a new one."
(let* ((proc (start-process "netscape"
(let* ((proc (apply 'start-process "netscape"
nil
kom-netscape-command
"-remote"
(if (listp kom-netscape-command)
(car kom-netscape-command)
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)
(exit nil))
(lyskom-url-manager-starting manager)
......@@ -580,10 +602,15 @@ that, starts a new one."
(setq exit (process-exit-status proc))
(cond ((and (eq status 'exit)
(eq exit 1))
(start-process "netscape"
(apply 'start-process "netscape"
nil
kom-netscape-command
url))
(if (listp kom-netscape-command)
(car kom-netscape-command)
kom-netscape-command)
(if (listp kom-netscape-command)
(append (cdr kom-netscape-command)
(list url))
(list url))))
(t nil))))
......@@ -607,16 +634,26 @@ existing Mosaic process. Failing that, it starts a new Mosaic."
(write-region (point-min) (point-max) filename nil 'x)
(kill-buffer tempbuffer)
(if (= -1 (signal-process pid 30))
(start-process "mosaic"
(apply 'start-process "mosaic"
(current-buffer)
kom-mosaic-command
url)
(if (listp kom-mosaic-command)
(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)))
(save-excursion
(start-process "mosaic"
(apply 'start-process "mosaic"
(current-buffer)
kom-mosaic-command
url)
(if (listp kom-mosaic-command)
(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)))))
......
No preview for this file type
......@@ -176,7 +176,7 @@ Value returned is always nil."
(lyskom-use 'blocking 'lyskom-blocking-do-multiple-1)
(while (and (eq lyskom-multiple-blocking-return 'not-yet-gotten)
(not lyskom-quit-flag))
(accept-process-output))
(accept-process-output nil lyskom-apo-timeout-s lyskom-apo-timeout-ms))
(if lyskom-quit-flag
(progn
(setq lyskom-quit-flag nil)
......
......@@ -309,7 +309,7 @@ instead. In this case the text TEXT-NO is first shown."
(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."
(interactive)
(lyskom-start-of-command 'kom-find-root)
......@@ -318,7 +318,8 @@ instead. In this case the text TEXT-NO is first shown."
(lyskom-tell-internat 'kom-tell-review)
(cond
(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)))
(if r
(lyskom-view-text r)
......
......@@ -693,7 +693,7 @@ or get-text-stat."
data)
(while (and (eq lyskom-blocking-return 'not-yet-gotten)
(not lyskom-quit-flag))
(accept-process-output))
(accept-process-output nil lyskom-apo-timeout-s lyskom-apo-timeout-ms))
(if lyskom-quit-flag
(progn
(setq lyskom-quit-flag nil)
......@@ -711,7 +711,7 @@ or get-text-stat."
(lyskom-run queue 'blocking-return (list t))
(while (and (eq lyskom-blocking-return 'not-yet-gotten)
(not lyskom-quit-flag))
(accept-process-output))
(accept-process-output nil lyskom-apo-timeout-s lyskom-apo-timeout-ms))
(if lyskom-quit-flag
(progn
(lyskom-insert-before-prompt (lyskom-get-string 'interrupted))
......
......@@ -563,6 +563,7 @@ M\344rk kuvertet \"LysKOM buggrapport f\366r elispklienten\".\n\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? ")
(subject . "\304rende: ")
(enter-subject-idi . "Skriv ett rende.")
(which-text-include . "Vilken text skall vi inkludera? ")
(added-recipient . "Mottagare som skall adderas: ")
(added-carbon-copy . "Extra kopia till m\366te: ")
......@@ -1273,7 +1274,9 @@ Cf. paragraph-start.")
(defvar kom-ansaphone-default-reply
"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.")
(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,
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