Commit d22f3d77 authored by David Byers's avatar David Byers
Browse files

Support long dashed lines in many places

parent 93aa84cc
1999-06-22 David Byers <davby@ida.liu.se>
Support long dashed lines in a variety of places.
* language.el (lyskom-get-string-sol): New function.
* vars.el.in (kom-text-header-dash-length): New variable.
(kom-text-footer-dash-length): New variable.
(kom-long-lines): New variable.
* view-text.el (lyskom-format-text-footer): Use
kom-text-footer-dash-length to specify total footer size.
(lyskom-print-text): Use kom-text-header-dash-length to specify
total length of dashed line before text.
(lyskom-format-text-footer): Print the format-flags string as part
of the dashed lines, not after the dashed line.
Tue Jun 22 15:59:15 1999 David Byers <davby@sen2.ida.liu.se>
* Release av 0.46-BETA-3
......
......@@ -62,7 +62,7 @@
(lyskom-get-string 'ansaphone-new-message))))
(lyskom-last-text-format-flags nil))
(setq kom-ansaphone-default-reply message)
(lyskom-format-insert (lyskom-get-string 'ansaphone-message)
(lyskom-format-insert (lyskom-get-string-sol 'ansaphone-message)
kom-ansaphone-default-reply)))
......@@ -77,7 +77,7 @@
(if kom-ansaphone-on
(progn
(setq lyskom-ansaphone-when-set (current-time-string))
(lyskom-format-insert (lyskom-get-string 'ansaphone-message)
(lyskom-format-insert (lyskom-get-string-sol 'ansaphone-message)
kom-ansaphone-default-reply))))
......
......@@ -167,13 +167,13 @@ this function shall be with current-buffer the BUFFER."
((eq msg-no 11)
(lyskom-save-excursion
(set-buffer buffer)
(lyskom-insert-before-prompt (lyskom-get-string 'lyskom-is-full))
(lyskom-insert-before-prompt (lyskom-get-string-sol 'lyskom-is-full))
;;; (if (and (eq major-mode 'lyskom-mode)
;;; (not (listp lyskom-time-last-command))
;;; kom-auto-quit-when-idle)
;;; (progn
;;; (lyskom-insert-before-prompt
;;; (lyskom-get-string 'session-auto-ended))
;;; (lyskom-get-string-sol 'session-auto-ended))
;;; (kom-quit 1)
))
......@@ -460,7 +460,7 @@ Non-nil NOBEEP means don't beep."
; /davidk
(eq recipient 0)) ; Public message
(if (not nobeep) (lyskom-beep kom-ding-on-common-messages))
(lyskom-format 'message-broadcast
(lyskom-format (lyskom-get-string-sol 'message-broadcast)
(cond
((stringp sender) sender)
(sender sender)
......@@ -469,7 +469,7 @@ Non-nil NOBEEP means don't beep."
when))
((= (conf-stat->conf-no recipient) lyskom-pers-no) ; Private
(if (not nobeep) (lyskom-beep kom-ding-on-personal-messages))
(lyskom-format 'message-from
(lyskom-format (lyskom-get-string-sol 'message-from)
(cond
((stringp sender) sender)
(sender sender)
......@@ -478,7 +478,7 @@ Non-nil NOBEEP means don't beep."
when))
(t ; Group message
(if (not nobeep) (lyskom-beep kom-ding-on-group-messages))
(lyskom-format 'message-from-to
(lyskom-format (lyskom-get-string-sol 'message-from-to)
message
(cond
((stringp sender) sender)
......
......@@ -1026,7 +1026,7 @@ Don't ask for confirmation."
(delq lyskom-buffer lyskom-sessions-with-unread-letters))
(set-process-sentinel lyskom-proc nil)
(delete-process lyskom-proc)
(lyskom-insert-string 'session-ended)
(lyskom-insert-string (lyskom-get-string-sol 'session-ended))
(lyskom-scroll)
(setq mode-line-process (lyskom-get-string 'mode-line-down))
(run-hooks 'kom-quit-hook))
......
......@@ -597,10 +597,12 @@ send. If DONTSHOW is non-nil, don't display the sent message."
(if (not dontshow)
(lyskom-handle-as-personal-message
(if lyskom-message-recipient
(lyskom-format 'message-sent-to-user
(lyskom-format (lyskom-get-string-sol
'message-sent-to-user)
lyskom-message-string
lyskom-message-recipient)
(lyskom-format 'message-sent-to-all
(lyskom-format (lyskom-get-string-sol
'message-sent-to-all)
lyskom-message-string))
lyskom-pers-no
lyskom-filter-outgoing-messages))
......
......@@ -177,12 +177,25 @@ assoc list."
(list function (list symbol category ": string not found"))))
(defun lyskom-get-string (symbol &optional category)
"Returns string assiciated with SYMBOL"
"Returns string associated with SYMBOL"
(or (lyskom-get-string-internal symbol (or category 'lyskom-message))
(lyskom-get-string-error 'lyskom-get-string
symbol
(or category 'lyskom-message))))
(defun lyskom-get-string-sol (symbol &optional category)
"Returns string associated with SYMBOL
If kom-long-lines is set, return the long form of the string, if it exists."
(or (and kom-long-lines
(lyskom-get-string-internal (intern (concat (symbol-name symbol)
"-long"))
(or category 'lyskom-message)))
(lyskom-get-string-internal symbol
(or category 'lyskom-message))
(lyskom-get-string-error 'lyskom-get-string
symbol
(or category 'lyskom-message))))
(defun lyskom-get-strings (symbols &optional category)
"Returns an alist of (symbol . string) pairs
......
......@@ -236,7 +236,7 @@ Handler to implement remote control of the ansaphone."
'ansaphone-new-message)
arg))
(lyskom-insert-before-prompt
(lyskom-format (lyskom-get-string 'remote-set-message)
(lyskom-format (lyskom-get-string-sol 'remote-set-message)
sender
(current-time-string)
arg))
......
......@@ -283,6 +283,17 @@ Lyskom-sessionen
Kopplar ned frn LysKOM eftersom LysKOM r fullt och
du har lst klart allting. Kom tillbaks senare.
===========================================================\n\n")
(session-ended-long . "
*******************************************************************************
Lyskom-sessionen r avslutad.
*******************************************************************************
")
(session-auto-ended-long . "
===============================================================================
Kopplar ned frn LysKOM eftersom LysKOM r fullt och
du har lst klart allting. Kom tillbaks senare.
===============================================================================
\n")
(what-to-change-pres-you . "Vilket mte/person vill du ndra presentationen fr (dig sjlv): ")
(who-to-put-motd-for . "Vilket mte/person vill du stta lapp p drr fr (dig sjlv): ")
......@@ -527,21 +538,34 @@ i svensk datorhistoria. L
(send-empty-message-p . "Meddelandet r tomt. Vill du nd skicka det? ")
(his-total-unread . "\n%#1M har totalt %#2d olsta.\n")
(message-prompt . "Meddelande: ")
(message-sent-to-user
. "================================================================
(message-sent-to-user . "\
================================================================
Ditt meddelande till %#2M:
%#1t
----------------------------------------------------------------
")
(message-sent-to-all
. "================================================================
(message-sent-to-all . "\
================================================================
Ditt alarmmeddelande ld:
%#1t
----------------------------------------------------------------
")
(message-use-alarm-instead . "Anvnd kommandot %#1s fr att skicka alarmmeddelanden.\n")
(message-sent-to-user-long . "\
===============================================================================
Ditt meddelande till %#2M:
%#1t
-------------------------------------------------------------------------------
")
(message-sent-to-all-long . "\
===============================================================================
Ditt alarmmeddelande ld:
%#1t
-------------------------------------------------------------------------------
") (message-use-alarm-instead . "Anvnd kommandot %#1s fr att skicka alarmmeddelanden.\n")
(message-all-info . "Snd alarmmeddelande\n")
(message-recipient-info . "Snd meddelande till %#1M\n")
(message-nope
......@@ -794,6 +818,13 @@ Meddelande fr
men misslyckades eftersom alla tillgngliga frbindelser r
upptagna. Logga ut och kom tillbaks senare om du vntar nu.
===========================================================\n")
(lyskom-is-full-long . "\
===============================================================================
Meddelande frn LysKOM-systemet: Ngon frskte koppla upp,
men misslyckades eftersom alla tillgngliga frbindelser r
upptagna. Logga ut och kom tillbaks senare om du vntar nu.
===============================================================================
")
(has-entered . "Nu har %#1:P gtt in i %#2s.")
(has-entered-r . "%#2@Nu har %#1P gtt in i %#3s.\n")
(has-left . "Nu har %#1:P gtt ur %#2s.")
......@@ -806,26 +837,47 @@ upptagna. Logga ut och kom tillbaks senare om du v
(have-become-member . "Du har blivit medlem i %#1M\n")
(message-broadcast .
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(message-broadcast . "\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alarmmeddelande frn %#1P (%#3s):
%#2t
----------------------------------------------------------------
")
(message-from .
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(message-from . "\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Personligt meddelande frn %#1P (%#3s):
%#2t
----------------------------------------------------------------
")
(message-from-to .
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(message-from-to . "\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Gruppmeddelande till %#3M\nfrn %#2P (%#4s):
%#1t
----------------------------------------------------------------
")
(message-broadcast-long . "\
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alarmmeddelande frn %#1P (%#3s):
%#2t
-------------------------------------------------------------------------------
")
(message-from-long . "\
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Personligt meddelande frn %#1P (%#3s):
%#2t
-------------------------------------------------------------------------------
")
(message-from-to-long . "\
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Gruppmeddelande till %#3M\nfrn %#2P (%#4s):
%#1t
-------------------------------------------------------------------------------
")
(text-is-created . "Text %#1n r skapad!")
......@@ -859,7 +911,7 @@ Gruppmeddelande till %#3M\nfr
(prioritize-help .
"u,n Flytta mte, SPC markera, p prioritera markerade, q avsluta, C-h m hjlp")
(your-priorities . " Prioritet Mtesnamn
----------------------------------------------------------------------------
-------------------------------------------------------------------------------
")
(your-membship . "Ditt medlemsskap i olika KOM-mten:
Prio Mtesnr Mtesnamn\n")
......@@ -1026,6 +1078,11 @@ Felmeddelande: %#1s**************************************************")
----------------------------------------------------------------------
%#1t
----------------------------------------------------------------------
")
(ansaphone-message-long . "Svarsmeddelande:
-------------------------------------------------------------------------------
%#1t
-------------------------------------------------------------------------------
")
(ansaphone-state . "Automatsvar r nu %#1s.")
(ansaphone-state-r . "Automatsvar r nu %#1s.\n")
......@@ -1041,7 +1098,11 @@ Felmeddelande: %#1s**************************************************")
%#3t
----------------------------------------------------------------------
")
(remote-set-ansaphone . "Fjrrstyrning (%#1P %#2s): Automatsvar r nu %#3s\n")
(remote-set-message-long . "Fjrrstyrning (%#1P %#2s): Svarsmeddelande:
-------------------------------------------------------------------------------
%#3t
-------------------------------------------------------------------------------
") (remote-set-ansaphone . "Fjrrstyrning (%#1P %#2s): Automatsvar r nu %#3s\n")
(remote-list-messages . "Fjrrstyrning (%#1P %#2s): Meddelanden listade\n")
(remote-quit . "Fjrrstyrning(%#1P %#2s): Avsluta\n")
......@@ -1882,7 +1943,7 @@ Du m
(lyskom-language-var lyskom-prioritize-header sv
" Prio Mte
-----------------------------------------------------------------------------
-------------------------------------------------------------------------------
")
......
......@@ -214,6 +214,28 @@ enabled mode."
server
inherited)
(def-kom-var kom-long-lines nil
"*If non-nil, then some lines and borders will be made longer."
server
inherited)
(def-kom-var kom-text-footer-dash-length 52
"*If non-nil, the total length of the text footer, when dashes are in use.
Note that the footer may end up longer than this if one or more elements
together are longer than this length.
This length is currently ignored when kom-text-footer-format is used."
server
inherited)
(def-kom-var kom-text-header-dash-length 60
"*If non-nil, the total length of the dashes before a text body.
If kom-dashed-lines is non-nil, this is ignored."
server
inherited)
(def-kom-var kom-text-footer-format nil
"*If non-nil, this specifies the format of a text footer.
......
......@@ -480,37 +480,49 @@ blocking-do."
(kom-deferred-printing nil)
(have-author (and format (string-match "%=?[0-9]*P" format))))
;; No user-specified format, so output dashes and stuff
(if (null format)
(lyskom-format
(cond ((and kom-dashed-lines kom-show-author-at-end)
"(%#1n) /%#2P/%#3s%#4s")
(kom-dashed-lines
"(%#1n) %#3s%#4s")
(kom-show-author-at-end
"(%#1n) /%#2P/")
(t
"(%#1n)"))
text
(or author author-name)
(if kom-show-author-at-end
(if (> (length author-name) 42)
""
(make-string (- 42 (length author-name)) ?-))
"------------------------------------------")
(if (and format-flags (listp format-flags))
(let ((first-flag t))
(concat
"("
(mapconcat (function
(lambda (str)
(cond
(first-flag
(setq first-flag nil)
(upcase-initials (lyskom-get-string str)))
(t (lyskom-get-string str)))))
format-flags ", ")
")"))
""))
(let* ((format-flag-string
(if (and format-flags (listp format-flags))
(let ((first-flag t))
(concat
"("
(mapconcat (function
(lambda (str)
(cond
(first-flag
(setq first-flag nil)
(upcase-initials (lyskom-get-string str)))
(t (lyskom-get-string str)))))
format-flags ", ")
")"))
""))
(end-dash-chars
(- kom-text-footer-dash-length
(length (int-to-string (text-stat->text-no text)))
3 ; Parens and space
(if kom-show-author-at-end
(+ (length author-name) 2)
0)
(length format-flag-string)))
(end-dash (if (> end-dash-chars 0)
(make-string end-dash-chars ?-)
"")))
(lyskom-format
(cond ((and kom-dashed-lines kom-show-author-at-end)
"(%#1n) /%#2P/%#3s%#4s")
(kom-dashed-lines
"(%#1n) %#3s%#4s")
(kom-show-author-at-end
"(%#1n) /%#2P/")
(t
"(%#1n)"))
text
(or author author-name)
end-dash
format-flag-string))
(while (string-match "%\\(=?-?[0-9]+\\)?\\([-nPpf% ]\\)" format start)
(setq result (concat result (substring format start
......@@ -610,10 +622,11 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO FLAT-REVIEW."
(let ((lyskom-current-function-phase 'subject))
(lyskom-format-insert "%#1r\n"
(copy-sequence lyskom-current-subject)))
(if kom-dashed-lines
(when kom-dashed-lines
(lyskom-insert
"------------------------------------------------------------\n")
(lyskom-insert "\n"))
(make-string kom-text-header-dash-length ?-)))
(lyskom-insert "\n")
;; (setq t1 (point-max))
;; Truncate body if flat-review and long text
......
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