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,39 +349,53 @@ 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)
(if (or (string= mode-name lyskom-edit-mode-name)
(j-or-n-p (lyskom-get-string 'already-sent)))
(progn
(let ((buffer (current-buffer))
headers misc-list subject message)
(save-excursion
(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
(set-buffer (process-buffer lyskom-proc))
;; Don't change the prompt if we won't see our own text
(if kom-created-texts-are-read
(setq lyskom-dont-change-prompt t))
(setq lyskom-is-writing nil)
(lyskom-tell-internat 'kom-tell-send)
(funcall send-function 'sending 'lyskom-create-text-handler
(concat subject "\n" message) misc-list
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)))))
(condition-case data
(if (or (string= mode-name lyskom-edit-mode-name)
(j-or-n-p (lyskom-get-string 'already-sent)))
(progn
(let ((buffer (current-buffer))
headers misc-list subject message)
(save-excursion
(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
(set-buffer (process-buffer lyskom-proc))
;; Don't change the prompt if we won't see our own text
(if kom-created-texts-are-read
(setq lyskom-dont-change-prompt t))
(setq lyskom-is-writing nil)
(lyskom-tell-internat 'kom-tell-send)
(funcall send-function 'sending 'lyskom-create-text-handler
(concat subject "\n" message) misc-list
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 ()
......
......@@ -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
......@@ -350,7 +352,21 @@ This is a LysKOM button action."
(cond ((not (integerp arg)) nil)
(t (pop-to-buffer buf)
(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.
......@@ -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"
nil
kom-netscape-command
"-remote"
(format "openUrl(%s)" url)))
(let* ((proc (apply 'start-process "netscape"
nil
(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"
(current-buffer)
kom-mosaic-command
url)
(apply 'start-process "mosaic"
(current-buffer)
(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"
(current-buffer)
kom-mosaic-command
url)
(apply 'start-process "mosaic"
(current-buffer)
(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.")
;;;
......
......@@ -45,7 +45,9 @@
(defvar kom-emacs-knows-iso-8859-1 t
"*If non-nil then dont convert texts and other things to swascii.
This variable is not saved. It should be set in your .emacs")
This variable is not saved. It should be set in your .emacs
This variable is not saved in the LysKOM server.")
;;;; ================================================================
......@@ -59,26 +61,40 @@ This variable is not saved. It should be set in your .emacs")
'other means edit in another window. Creating that window if necessary.
A buffer or buffer name means use the first window displaying that buffer.
If no window is displaying that buffer or the buffer does not exits then it
uses the same window.")
uses the same window.
This variable is stored in the LysKOM server.")
(defvar kom-created-texts-are-read t
"*Non-nil means automatically mark texts that you create as read.")
"*Non-nil means automatically mark texts that you create as read.
This variable is stored in the LysKOM server.")
(defvar kom-dont-restore-window-after-editing nil
"*If non-nil then don't restore the window configuration after sending a text.")
"*If non-nil then don't restore the window configuration after sending a text.
This variable is not saved in the LysKOM server.")
(defvar kom-default-mark 100
"*If non-nil (must be an integer) then the user is not asked for type of mark.")
"*If non-nil (must be an integer) then the user is not asked for type of mark.
This variable is stored in the LysKOM server.")
(defvar kom-reading-puts-comments-in-pointers-last t
"*If Non-nil the texts are shown with comments references at the end.")
"*If Non-nil the texts are shown with comments references at the end.
This variable is stored in the LysKOM server.")
(defvar kom-dashed-lines t
"*If Non-nil then all texts will be surrounded by lines of dashes.")
"*If Non-nil then all texts will be surrounded by lines of dashes.
This variable is stored in the LysKOM server.")
(defvar kom-print-number-of-unread-on-entrance t
"*If Non-nil then print automatically the number of unread articles when
entering a conference.")
entering a conference.
This variable is stored in the LysKOM server.")
(defvar kom-presence-messages t
"*If non-nil, lyskom prints continuous info about what other people are doing.
......@@ -86,42 +102,60 @@ Info is printed on the message line and never in the buffer. If minibuffer is
used then no message is printed.
If you want the messages in the buffer you could set the variable
kom-presence-messages-in-buffer.")
kom-presence-messages-in-buffer.
This variable is stored in the LysKOM server.")
(defvar kom-presence-messages-in-buffer nil
"*If t, lyskom prints information about what other people are doing in buffer.
All printing is done just before the prompt.
If nil no messages are printed.
If 'presence then messages about people logging in, out and people
changing name is printed.")
changing name is printed.
This variable is stored in the LysKOM server.")
(defvar kom-show-where-and-what t
"*Non-nil means kom-who-is-on shows from which machine the user is running
and what he is doing.")
and what he is doing.
This variable is stored in the LysKOM server.")
(defvar kom-show-footnotes-immediately t
"*Non-nil means show footnotes immediately following the text.")
"*Non-nil means show footnotes immediately following the text.
This variable is stored in the LysKOM server.")
(defvar kom-who-buffer-size-when-displaying 10
"*Size of window to display the who-buffer.
This is used when executing the kom-display-who-buffer command.")
This is used when executing the kom-display-who-buffer command.
This variable is stored in the LysKOM server.")
(defvar kom-read-depth-first t
"*Non-nil means read comments and footnotes to a text before other texts.")
"*Non-nil means read comments and footnotes to a text before other texts.
This variable is stored in the LysKOM server.")
(defvar kom-higher-priority-breaks nil
"*Non-nil means allow texts from conferences with highter priority to break in.
If the value is 'express then texts are allowed to break in the middle of a
comment chain. Otherwise we dont let them in until the end of the comment
tree.")
tree.
This variable is stored in the LysKOM server.")
(defvar kom-after-load-hook nil
"Hook to run once after lyskom is loaded.")
"Hook to run once after lyskom is loaded.
This variable is not saved in the LysKOM server.")
(defvar kom-login-hook nil
"*What to do when logged in.
This is a list of commands that are executed after we have logged in but before
any command is accepted from the keyboard.")
any command is accepted from the keyboard.
This variable is stored in the LysKOM server.")
(defvar kom-do-when-done '(kom-review-all-marked-texts kom-display-time)
"*What to do when all texts are read.
......@@ -133,18 +167,24 @@ type prompt
lyskom-function from the lyskom-command-name function.
command \"Kommandot:\" name of function or definition of
lambda expression
keyboard macro \"Kommandot:\" keyboard macro definition.")
keyboard macro \"Kommandot:\" keyboard macro definition.
This variable is stored in the LysKOM server.")
(defvar kom-page-before-command nil
"*This is a list of all commands before which the screen is cleared.
If it isn't a list and isn't nil the screen is cleared before all commands.")
If it isn't a list and isn't nil the screen is cleared before all commands.
This variable is stored in the LysKOM server.")
(defvar kom-membership-default-priority 100
"*Default priority when joining a new conference.
If a valid priority then new conferences are read with this priority.
Otherwise ask the user for a priority.
Valid priorities are only the range 0-255.")
Valid priorities are only the range 0-255.
This variable is stored in the LysKOM server.")
(defvar kom-membership-default-placement 'last
"*Tells the system where to put new conferences.
......@@ -152,79 +192,120 @@ The value can be one of the following:
'first => before all other conferences.
'last => after all other conferences.
a number => at that position
otherwise => the new conf is entered after all conferences.")
otherwise => the new conf is entered after all conferences.
This variable is stored in the LysKOM server.")
(defvar lyskom-prompt-text " - "
"*Text to end the prompt.")
"*Text to end the prompt.
This variable is stored in the LysKOM server.")
(defvar lyskom-prompt-executing-default-command-text ". "
"*Text to end the prompt while the default-commands is executing.")
"*Text to end the prompt while the default-commands is executing.
This variable is stored in the LysKOM server.")
(defvar lyskom-no-prompt nil
"Tells the session that we have no prompt.")
"Tells the session that we have no prompt.
This variable is not saved in the LysKOM server.")
(defvar kom-show-personal-messages-in-buffer t
"*Buffer to show personal messages in.
If nil, discard them.
If t, insert them in the *kom* buffert.
If non-nil and non-t this should be a buffer or a name of a (possibly
nonexistent) buffer in which the message is inserted.")
nonexistent) buffer in which the message is inserted.
This variable is stored in the LysKOM server.")
(defvar kom-pop-personal-messages nil
"*Non-nil means pop up a buffer with personal messages as they arrive.
kom-show-personal-messages-in-buffer decides which buffer to pop.")
kom-show-personal-messages-in-buffer decides which buffer to pop.
This variable is stored in the LysKOM server.")
(defvar kom-ding-on-priority-break 1
"*Non-nil means ding if a higher priority text or conference breaks in.
A number means the number of times to ding. A string is an argument for the
program named by kom-audio-player.")
program named by kom-audio-player.
This variable is stored in the LysKOM server.")
(defvar kom-ding-on-common-messages 0
"*Non-nil means ding as common messages arrive. A number means the number of
A number means the number of times to ding. A string is an argument for the
program named by kom-audio-player.")
program named by kom-audio-player.
This variable is stored in the LysKOM server.")
(defvar kom-ding-on-group-messages 1
"*Non-nil means ding as group messages arrive. A number means the number of
A number means the number of times to ding. A string is an argument for the
program named by kom-audio-player.")
program named by kom-audio-player.
This variable is stored in the LysKOM server.")
(defvar kom-ding-on-personal-messages 2
"*Non-nil means ding as personal messages arrive. A number means the number
A number means the number of times to ding. A string is an argument for the
program named by kom-audio-player.")
program named by kom-audio-player.
This variable is stored in the LysKOM server")
(defvar lyskom-ding-on-no-subject 2
"How to ding if the user has not entered a subject line.
This variable is not saved in the LysKOM server.")
(defvar kom-audio-player "audioplay"
"*Program to play audio files.")
"*Program to play audio files.
This variable is not saved in the LysKOM server.")
(defvar kom-default-message-recipient 'group
"*Determines default recipient of personal messages.
everybody means the default recipient is everybody.
group means the default recipient is the group to which the last
message was sent, if it was a group message. If the last message
was a personal message or a common message, it means the same as
sender.
sender means the sender of the last message received.
group means the default recipient is the group to which the last
message was sent, if it was a group message. If the last message was a
personal message or a common message, it means the same as sender.
sender means the sender of the last message received.")
This variable is stored in the LysKOM server.")
(defvar lyskom-filter-outgoing-messages t
"t if outgoing remote-control messages and automatic replies are not
to be displayed in the buffer.")
to be displayed in the buffer.
This variable is not saved in the LysKOM server.")
(defvar kom-friends nil
"*List of people whose names should be formatted using kom-friends-face.
This variable is stored in the LysKOM server.")
(defvar kom-text-properties t
"*Non-nil means to insert text properties in the Emacs buffer for
various LysKOM elements.")
various LysKOM elements.
This variable is not saved in the LysKOM server.")
(defvar kom-use-button-hints t
"*Non-nil means use button hints for overriding default actions.")
"*Non-nil means use button hints for overriding default actions.
This variable is not saved in the LysKOM server.")
(defvar lyskom-button-actions
'((text
text-text
lyskom-button-view-text
(("Återse texten" . lyskom-button-view-text)
("Återse träd" . lyskom-button-review-tree)
("Återse urinlägget" . lyskom-button-find-root)
("Kommentera texten" . lyskom-button-comment-text)