Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
lyskom-elisp-client
lyskom-elisp-client
Commits
e7ce545c
Commit
e7ce545c
authored
Jul 12, 1997
by
David Byers
Browse files
Fixade ombrytning av inlägg.
parent
bf5825b5
Changes
16
Hide whitespace changes
Inline
Side-by-side
src/ChangeLog
View file @
e7ce545c
Sat Jul 12 12:46:46 1997 David Byers <davby@ida.liu.se>
* english-strings.el,swedish-strings.el (lyskom-custom-strings):
Lade till dokumentation och tag fr kom-autowrap.
* edit-text.el: Zappa lite varningar.
* option-edit.el: Dito.
* menus.el: Dito.
* lyskom-buttons.el: Dito.
* commands1.el (kom-display-time): Bind
lyskom-last-text-format-flags.
* remote-control.el (lyskom-remote-set-message): Dito.
* ansaphone.el (kom-change-auto-reply): Dito.
* async.el (lyskom-format-as-personal-message): Dito.
* commands2.el (lyskom-send-message): Dito.
* view-text.el (lyskom-print-text): Skriv ut om texten r
omformatterad.
(lyskom-deferred-insert-footer): Dito.
(lyskom-view-text): Bind lyskom-last-text-format-flags.
* english-strings.el, swedish-strings.el (lyskom-message): Lade
till reformat-*
* lyskom-rest.el (lyskom-fill-message): Ny funktion.
(lyskom-format-text-body): Anropa lyskom-fill-message.
(lyskom-signal-reformatted-text): Ny funktion.
* vars.el.in (kom-autowrap): Ny variabel.
(lyskom-line-start-chars): Ny variabel.
* review.el (kom-review-noconversion): Sl av massor av
formattering.
* swedish-strings.el (lyskom-sv-edit-mode-map): Bind [] mfl ven
i XEmacs, men bind *dessutom* aring och liknande.
(lyskom-sv-mode-map): Dito.
Fri Jul 11 09:17:28 1997 David Byers <davby@ida.liu.se>
* compatibility.el: Tog bort popup-menu eftersom vissa Gnu Emacs
...
...
src/ansaphone.el
View file @
e7ce545c
...
...
@@ -58,7 +58,8 @@
(
interactive
)
(
let
((
message
(
or
message
(
read-from-minibuffer
(
lyskom-get-string
'ansaphone-new-message
)))))
(
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
)
kom-ansaphone-default-reply
)))
...
...
src/async.el
View file @
e7ce545c
...
...
@@ -343,7 +343,7 @@ MESSAGE is a string containing the message.
WHEN, if given, is the time when the message arrived. It must be of the same
format at (current-time-string)
Non-nil NOBEEP means don't beep."
(
progn
(
let
((
lyskom-last-text-format-flags
nil
))
(
if
(
null
when
)
(
setq
when
(
current-time-string
)))
(
if
(
not
(
string=
(
substring
when
0
10
)
...
...
src/commands1.el
View file @
e7ce545c
...
...
@@ -1493,7 +1493,8 @@ If MARK-NO == 0, review all marked texts."
(
def-kom-command
kom-display-time
()
"Ask server about time and date."
(
interactive
)
(
let
((
time
(
blocking-do
'get-time
)))
(
let
((
time
(
blocking-do
'get-time
))
(
lyskom-last-text-format-flags
nil
))
(
lyskom-format-insert
'time-is
(
lyskom-format-time
time
)
;; Kult:
...
...
src/commands2.el
View file @
e7ce545c
...
...
@@ -516,7 +516,8 @@ means send the message to everybody. MESSAGE is the message to
send. If DONTSHOW is non-nil, don't display the sent message."
(
let*
((
lyskom-message-string
nil
)
(
reply
nil
)
(
lyskom-message-recipient
nil
))
(
lyskom-message-recipient
nil
)
(
lyskom-last-text-format-flags
nil
))
(
add-hook
'minibuffer-setup-hook
'lyskom-send-message-minibuffer-setup-hook
)
...
...
src/edit-text.el
View file @
e7ce545c
...
...
@@ -385,28 +385,10 @@ Commands:
(
lyskom-message
"%s"
(
lyskom-get-string
(
car
(
cdr
err
)))))))
(
eval-when-compile
(
defvar
ispell-dictionary
nil
))
(
eval-when-compile
(
defvar
ispell-message-text-end
nil
))
(
eval-when-compile
(
defvar
ispell-message-start-skip
nil
))
(
eval-when-compile
(
defvar
ispell-message-end-skip
nil
))
(
defun
lyskom-ispell-text
()
"Check spelling of the text body.
kom-ispell-dictionary is the dictionary to use to check spelling."
(
let
((
start
(
save-excursion
(
goto-char
(
point-min
))
(
search-forward
(
substitute-command-keys
(
lyskom-get-string
'header-separator
)))
(
forward-line
1
)
(
beginning-of-line
)
(
point
))))
(
let
((
ispell-dictionary
kom-ispell-dictionary
)
(
new-ispell
(
or
(
not
(
boundp
'ispell-dictionary
))
(
not
(
string=
kom-ispell-dictionary
ispell-dictionary
)))))
(
if
new-ispell
(
ispell-kill-ispell
t
))
(
prog1
(
ispell-region
start
(
point-max
))
(
if
new-ispell
(
ispell-kill-ispell
t
))))))
(
defun
lyskom-ispell-text
()
"Check spelling of the text body.
...
...
src/english-strings.el
View file @
e7ce545c
...
...
@@ -1013,6 +1013,10 @@ On since %#8s%#9s")
(send-formatted . "
Send
as
formatted
text?
")
(changing-language-to . "
Changing
to
%#1s.\n
")
(language-not-loaded . "
%#1s
is
unavailable.\n
")
(reformat-html . "
(
HTML
)
")
(reformat-enriched . "
(
Enriched
)
")
(reformat-filled . "
(
Filled
)
")
))
...
...
@@ -1938,6 +1942,11 @@ Lists etc. : [INS] Add a line [DEL] Remove a line [*] Modify")
Most
people
have
this
turned
on.
")
(kom-autowrap-doc . "
\
With
this
setting
turned
on,
LysKOM
will
attempt
to
fill
any
paragraphs
containing
lines
that
are
wider
than
the
screen.
Paragraphs
that
appear
to
have
been
preformatted
by
the
author
are
exempt
from
this
treatment.
")
(kom-show-author-at-end-doc . "
\
When
this
is
turned
on
the
name
of
the
author
will
be
shown
at
the
end
of
the
article
text.
The
name
is
also
shown
before
the
text
as
usual.
...
...
@@ -2228,6 +2237,8 @@ Lists etc. : [INS] Add a line [DEL] Remove a line [*] Modify")
"
Default
priority
for
new
memberships:
")
(kom-dashed-lines-tag .
"
Dashed
lines
around
the
article
body:
")
(kom-autowrap-tag .
"
Fill
wide
paragraphs
before
displaying:
")
(kom-show-author-at-end-tag .
"
Show
the
name
of
the
author
after
the
body:
")
...
...
src/lyskom-buttons.el
View file @
e7ce545c
...
...
@@ -650,6 +650,8 @@ This is a LysKOM button action."
(
elt
manager
2
))))
(
eval-when-compile
(
defvar
browse-url-browser-function
nil
))
(
defun
lyskom-view-url-browse-url
(
url
manager
)
(
require
'browse-url
)
(
funcall
browse-url-browser-function
url
))
...
...
src/lyskom-rest.el
View file @
e7ce545c
...
...
@@ -1370,8 +1370,16 @@ Note that it is not allowed to use deferred insertions in the text."
(
formatted
(
and
fn
(
funcall
fn
text
))))
(
cond
(
formatted
formatted
)
(
kom-text-properties
(
lyskom-button-transform-text
text
))
(
t
text
))))
(
kom-text-properties
(
lyskom-button-transform-text
(
lyskom-fill-message
text
)))
(
t
(
lyskom-fill-message
text
)))))
(
defun
lyskom-signal-reformatted-text
(
how
)
"Signal that the last text was reformatted HOW, which should be a string
in lyskom-messages."
(
setq
lyskom-last-text-format-flags
how
))
(
defun
lyskom-w3-region
(
start
end
)
(
w3-region
start
end
)
...
...
@@ -1380,6 +1388,7 @@ Note that it is not allowed to use deferred insertions in the text."
(
defun
lyskom-format-html
(
text
)
(
condition-case
e
(
require
'w3
)
(
error
nil
))
(
add-text-properties
0
(
length
text
)
'
(
special-insert
lyskom-w3-region
)
text
)
(
lyskom-signal-reformatted-text
'reformat-html
)
(
substring
text
5
))
;;;(defun lyskom-format-html (text)
...
...
@@ -1417,12 +1426,163 @@ Note that it is not allowed to use deferred insertions in the text."
(
set-buffer
tmpbuf
)
(
insert
(
substring
text
10
))
(
format-decode-buffer
)
(
lyskom-signal-reformatted-text
'reformat-enriched
)
(
lyskom-button-transform-text
(
buffer-string
))
;; (substring (buffer-string) 0 -1) ; Remove the \n
)
(
kill-buffer
tmpbuf
)))))
;;; ============================================================
;;; lyskom-fill-message
;;; Author: David Byers
;;;
;;; Wrap the lines of a message with long lines so they're a little easier
;;; to read. Try to ignore what looks like preformatted text.
;;;
;;; A paragraph consisting only of short lines is not wrapped
;;; A paragraph with at least one line that starts with some odd
;;; character is not wrapped. Whitespace is considered odd if
;;; if occurs on any line but the first.
;;; A paragraph is not wrapped if it is more than one line long and the
;;; difference between line lengths is constant.
;;;
(
defun
lyskom-fill-message
(
text
)
"Try to reformat a message."
(
if
(
null
kom-autowrap
)
text
(
save-excursion
(
set-buffer
(
lyskom-get-buffer-create
'lyskom-text
" lyskom-text"
t
))
(
erase-buffer
)
(
insert
text
)
(
goto-char
(
point-min
))
(
let
((
start
(
point
))
(
in-paragraph
nil
)
(
wrap-paragraph
'maybe
)
(
length-difference
nil
)
(
constant-length
nil
)
(
current-line-length
nil
)
(
last-line-length
nil
)
(
paragraph-length
0
)
(
fill-column
(
1-
(
window-width
))))
;;
;; Scan each line
;;
(
while
(
not
(
eobp
))
(
setq
current-line-length
(
lyskom-fill-message-line-length
))
;;
;; Do some work on checking for constant differences
;;
(
cond
((
null
length-difference
)
(
when
(
and
current-line-length
last-line-length
)
(
setq
length-difference
(
-
current-line-length
last-line-length
))))
((
eq
constant-length
'maybe-not
)
(
setq
constant-length
nil
))
(
constant-length
(
unless
(
=
(
-
current-line-length
last-line-length
)
length-difference
)
(
setq
constant-length
'maybe-not
))))
(
cond
;;
;; An empty line signifies a new paragraph. If we were scanning
;; a paragraph and it was to be filled, fill it.
;;
((
looking-at
"^\\s-*$"
)
(
when
(
and
in-paragraph
(
eq
wrap-paragraph
t
)
(
or
(
eq
paragraph-length
1
)
(
null
constant-length
)))
(
fill-region
start
(
match-beginning
0
)
nil
t
)
(
lyskom-signal-reformatted-text
'reformat-filled
))
(
setq
start
(
match-end
0
)
in-paragraph
nil
wrap-paragraph
'maybe
))
;;
;; Not in a paragraph, but here comes some text. Let's start
;; a paragraph, shall we?
;;
((
and
(
not
in-paragraph
)
(
looking-at
"\\s-*\\(\\S-\\)"
))
(
setq
in-paragraph
t
paragraph-length
0
constant-length
t
length-difference
nil
last-line-length
nil
start
(
match-beginning
0
))
(
cond
((
not
(
aref
lyskom-line-start-chars
(
char-to-int
(
char-after
(
match-beginning
1
)))))
(
setq
wrap-paragraph
nil
))
((
>
current-line-length
fill-column
)
(
setq
wrap-paragraph
t
))
(
t
(
setq
wrap-paragraph
'maybe
))))
;;
;; Scanning a paragraph, we see a line that starts with something
;; not usually part of plain text. Don't wrap the paragraph.
;;
((
and
in-paragraph
(
not
(
aref
lyskom-line-start-chars
(
char-to-int
(
char-after
(
point
))))))
(
setq
wrap-paragraph
nil
))
;;
;; We're in a paragraph, the line looks OK, but is long. That
;; means we should probably be filling the paragraph later
;;
((
and
in-paragraph
wrap-paragraph
(
>
current-line-length
fill-column
))
(
setq
wrap-paragraph
t
)))
(
setq
last-line-length
current-line-length
)
(
end-of-line
)
(
setq
paragraph-length
(
1+
paragraph-length
))
(
unless
(
eobp
)
(
forward-line
1
)
(
beginning-of-line
)))
;;
;; We've seen the end of buffer. Fill any unfilled junk.
;;
(
when
(
and
in-paragraph
(
eq
wrap-paragraph
t
)
(
or
(
eq
paragraph-length
1
)
(
null
constant-length
)))
(
fill-region
start
(
point
)
nil
t
)
(
lyskom-signal-reformatted-text
'reformat-filled
)))
;;
;; Kill off unwanted whitespace at the end of the message
;;
(
let
((
tmp
(
buffer-string
)))
(
if
(
string-match
"[ \t\n]+\\'"
tmp
)
(
substring
tmp
0
(
match-beginning
0
))
tmp
)))))
(
defun
lyskom-fill-message-line-length
()
(
-
(
save-excursion
(
end-of-line
)
(
point
))
(
point
)))
;;; ============================================================
;;; Beeping and feeping
;;; Faces and colors
...
...
src/menus.el
View file @
e7ce545c
...
...
@@ -227,6 +227,8 @@
(
setq
lyskom-current-menu-category
(
list
menu-category
))
(
add-to-list
'lyskom-current-menu-category
menu-category
)))
(
eval-when-compile
(
defvar
default-menubar
nil
))
(
defun
lyskom-set-menus-xemacs
(
menu-category
)
"Update the menus"
(
make-local-variable
'current-menubar
)
...
...
src/option-edit.el
View file @
e7ce545c
...
...
@@ -117,6 +117,7 @@
[kom-membership-default-priority]
"\n"
[kom-print-number-of-unread-on-entrance]
[kom-autowrap]
[kom-dashed-lines]
[kom-show-author-at-end]
...
...
@@ -193,6 +194,8 @@ customize buffer but do not save them to the server."
(
widget-value
(
cdr
(
car
tmp
))))
(
setq
tmp
(
cdr
tmp
))))))
(
eval-when-compile
(
defvar
save-options-init-file
nil
))
(
defun
lyskom-customize-send
()
"Save variables to the server"
(
save-excursion
...
...
@@ -403,6 +406,7 @@ customize buffer but do not save them to the server."
:size
0
)
(
const
(
ask
nil
)))))
(
kom-reading-puts-comments-in-pointers-last
(
toggle
(
before
after
)))
(
kom-autowrap
(
toggle
(
on
off
)))
(
kom-dashed-lines
(
toggle
(
on
off
)))
(
kom-show-author-at-end
(
toggle
(
on
off
)))
(
kom-print-number-of-unread-on-entrance
(
toggle
(
yes
no
)))
...
...
src/remote-control.el
View file @
e7ce545c
...
...
@@ -223,7 +223,7 @@ Handler to implement remote control of the ansaphone."
(
defun
lyskom-remote-set-message
(
arg
sender
recipient
text
)
(
if
arg
(
progn
(
let
((
lyskom-last-text-format-flags
nil
))
(
setq
kom-ansaphone-default-reply
arg
)
(
setq
lyskom-ansaphone-when-set
(
current-time-string
))
(
lyskom-ansaphone-send-message
sender
...
...
src/review.el
View file @
e7ce545c
...
...
@@ -1112,7 +1112,9 @@ text is shown and a REVIEW list is built to shown the other ones."
(
t
(
signal
'lyskom-internal-error
'
(
kom-review-noconversion
))))))
(
lyskom-start-of-command
'kom-review-noconversion
)
(
let
((
kom-emacs-knows-iso-8859-1
t
))
(
let
((
kom-emacs-knows-iso-8859-1
t
)
(
lyskom-format-special
nil
)
(
kom-autowrap
nil
))
(
ignore
kom-emacs-knows-iso-8859-1
)
(
lyskom-view-text
text-no
))
(
lyskom-end-of-command
))
...
...
src/swedish-strings.el
View file @
e7ce545c
No preview for this file type
src/vars.el.in
View file @
e7ce545c
...
...
@@ -471,6 +471,10 @@ various LysKOM elements.")
(
def-kom-var
kom-use-button-hints
t
"*Non-nil means use button hints for overriding default actions."
)
(
def-kom-var
kom-autowrap
t
"*Non-nil means auto wrap articles with discretion"
server
)
;;;
;;; lyskom-button-actions has been moved to swedish-strings.el on account
...
...
@@ -1626,6 +1630,25 @@ texts that is to be sent to the server.")
"Saved value of buffer-read-only when in slow mode."
local
)
(
def-kom-var
lyskom-line-start-chars
[nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
t
nil
t
nil
t
t
t
t
t
t
nil
t
t
t
t
t
t
t
t
t
t
t
t
t
nil
nil
t
nil
nil
nil
nil
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
nil
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
t
nil
t
t
t
nil
t
nil
t
t
t
t
t
t
nil
nil
t
t
t
nil
t
t
nil
nil
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
nil
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
nil
t
t
t
t
t
t
t
t]
"Vector defining which ISO-8859-1 characters can be expected to start
lines of text."
)
(
def-kom-var
lyskom-last-text-format-flags
nil
"List of flags specifying how the last text was reformatted. This variable
should be dynamically bound whenever it needs to be used."
)
;;; ======================================================================
;;; Event hooks
;;;
...
...
src/view-text.el
View file @
e7ce545c
...
...
@@ -57,7 +57,8 @@ Note that this function must not be called asynchronously."
(
lyskom-filter-text-p
text-no
)))
(
start
nil
)
(
end
nil
)
(
todo
nil
))
(
todo
nil
)
(
lyskom-last-text-format-flags
nil
))
(
cond
((
eq
filter
'skip-text
)
(
lyskom-filter-prompt
text-no
'filter-text
)
(
setq
todo
'next-text
)
(
lyskom-mark-as-read
(
blocking-do
'get-text-stat
text-no
))
...
...
@@ -409,11 +410,15 @@ the user is a member of. Uses blocking-do. Returns t if TEXT-STAT is nil."
(
dashes
(
if
(
>
42
(
length
name
))
(
make-string
(
-
42
(
length
name
))
?-
)
""
))
(
text
(
lyskom-format
"/%[%#3@%#1P%]/%#2s"
(
text
(
lyskom-format
"/%[%#3@%#1P%]/%#2s
%#4s
"
(
or
conf-stat
name
)
dashes
(
text-properties-at
(
defer-info->pos
defer-info
)))))
(
defer-info->pos
defer-info
))
(
if
(
defer-info->data
defer-info
)
(
lyskom-get-string
(
defer-info->data
defer-info
))
""
))))
(
lyskom-replace-deferred
defer-info
text
)))
(
defun
lyskom-print-text
(
text-stat
text
mark-as-read
text-no
)
...
...
@@ -463,7 +468,12 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO."
(
cond
(
kom-dashed-lines
(
lyskom-format-insert
"\n(%#1n) "
(
text->text-no
text
))
(
if
(
not
kom-show-author-at-end
)
(
lyskom-insert
"-----------------------------------\n"
)
(
progn
(
lyskom-format-insert
"-----------------------------------%#1s\n"
(
if
lyskom-last-text-format-flags
(
lyskom-get-string
lyskom-last-text-format-flags
)
""
)))
(
if
kom-deferred-printing
(
progn
(
lyskom-format-insert
"%#1s\n"
lyskom-defer-indicator
)
...
...
@@ -478,7 +488,8 @@ Args: TEXT-STAT TEXT MARK-AS-READ TEXT-NO."
(
length
lyskom-defer-indicator
)
1
))
(
length
lyskom-defer-indicator
)
"%#1s"
)))
"%#1s"
lyskom-last-text-format-flags
)))
(
let*
((
conf-stat
(
blocking-do
'get-conf-stat
(
text-stat->author
text-stat
)))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment