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
4ba58ea8
Commit
4ba58ea8
authored
Jul 15, 1997
by
David Byers
Browse files
Bugfixar och annat
parent
bb056fcd
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
src/ChangeLog
View file @
4ba58ea8
Tue Jul 15 10:56:50 1997 David Byers <davby@ida.liu.se>
* vars.el.in (lyskom-line-start-chars): Stt till nil.
* lyskom-rest.el (lyskom-line-start-chars): Stt vrdet hr.
* edit-text.el (lyskom-edit-get-commented): Skicka med
edit-fnstret till thendo.
(lyskom-edit-show-commented): Bibehll valt fnster.
(lyskom-edit-insert-commented): Ta emot ett till argument.
* vars.el.in (kom-print-number-of-unread-on-entrance): rv
variabeln.
(kom-show-author-at-end): Dito.
(kom-dashed-lines): Dito.
(kom-reading-puts-comments-in-pointers-last): Dito.
Mon Jul 14 11:24:09 1997 David Byers <davby@ida.liu.se>
* lyskom-rest.el (lyskom-fill-message): Klara att fill-column inte
r ett heltal.
* command.el (lyskom-read-extended-command): Visa prefixargumentet
(om det finns.)
(kom-extended-command): Skicka prefixargument till
lyskom-read-extended-command.
* commands1.el (kom-list-clients): Anvnd
dynamic-session-info. Prefix gr att man fr osynliga anvndare.
* lyskom-rest.el (forward-text): Stt paragraph-ignore-fill-prefix
till t.
(backward-text): Dito.
* commands1.el (kom-list-clients): Skriv ut total-users istf
total-visible-users.
* lyskom-rest.el (lyskom-fill-message): Bindestreck och plus kan
ocks inleda stycken.
* vars.el.in (lyskom-line-start-chars): Definiera frn
lyskom-line-start-chars-string.
(lyskom-line-start-chars-string): Ny variabel.
(kom-dont-read-saved-variables): Ls inte lyskom-login-hook frn
servern.
* english-strings.el,swedish-strings.el (lyskom-message): Minde
whitespace efter terse hur mnga etc.
* lyskom-rest.el (lyskom-fill-message): Nu bryter vi tvradare med
nollskild konstant radlngdsskillnad.
(lyskom-minimum-triagle-size): Ny variabel.
(lyskom-fill-message): Massera fill-column lite snyggare.
* edit-text.el (lyskom-edit-send): Kr anvndarhookar efter att ha
kollat rende osv.
* swedish-strings.el,english-strings.el (lyskom-edit-mode-map):
Bind mouse-2 till kom-button-click-or-yank.
* lyskom-buttons.el (kom-button-click-or-yank): Ny funktion.
(kom-button-click): Lade till do-default-argumentet.
* option-edit.el: Lgg till kom-show-namedays.
* vars.el.in (kom-show-namedays): Stt defaultvrdet till nil och
spara i servern.
* prioritize.el (lyskom-prioritize-current-entry): Hantera att
markren inte str i brjan av raden.
(kom-prioritize-select): Flytta inte markren nr man markerar.
* swedish-strings.el,english-strings.el (lyskom-message): I
priority-q skriv ut vad prioritet noll betyder.
(lyskom-sv-prioritize-mode-map): Bind kom-next-link och
kom-previous-link.
* commands1.el (lyskom-try-add-member): Tillt att man explicit
anger prioritet noll.
Sun Jul 13 12:06:20 1997 David Byers <davby@ida.liu.se>
* menus.el (lyskom-do-popup-menu): Frsk inte anropa nil.
* view-mode.el: Flyttade om lite i filen s att keymappen
definieras innan moden.
(lyskom-view-base-mode): Fifflade s att det fungerar ven om
view-mode r en minor mode och det inte finns en view-major-mode.
* compatibility.el (lyskom-gnu-keysym): Fixade en typo.
(lyskom-xemacs-keysym): Dito.
(lyskom-keysym): Skrev om s den fungerar i Gnu Emacs.
* option-edit.el (kom-customize): D inte bara fr att
kom-active-face inte finns.
(lyskom-create-widget): Stt menu-tag.
(lyskom-make-menu-tag): Ny funktion.
* check-strings.el (lcs-dont-check-ending-categories): Ny
variabel.
(lcs-check-strings): Kontrollera att strngar avslutas p samma
stt. Radbrytningar, punkt, kolon, frgetecken mm skall vara lika
i alla sprk.
(lcs-match-endings): Ny variabel.
(lcs-check-string-ending): Ny funktion.
* english-strings.el,swedish-strings.el: Synkroniserade, fixade
icke-matchande avslutningar.
* Makefile, distribution-Makefile (SOURCES): Lade till
view-mode.el.
* swedish-strings.el (lyskom-message): Lade till
more-than-one-root och more-than-one-root-review.
* review.el (kom-find-root-review): Varna om det finns mer n ett
urinlgg.
(kom-find-root): Visa alla urinlgg.
* vars.el.in (kom-show-namedays): Lade till kom-show-namedays.
* commands1.el (kom-display-time): Visa namnsdagar enbart om
kom-show-nameday r satt.
* option-edit.el (lyskom-create-widget): Lgg till help-echo
(lyskom-create-widget): Dito.
(lyskom-widget-help-format-handler): Hantera nytt argsformat.
(lyskom-widget-help-action): Dito, byt ut help-echo.
(lyskom-custom-variables): Lade till help-echo p ngra variabler.
(lyskom-url-viewer-widget): Lade till help-echo
(lyskom-ding-widget): Dito
(lyskom-name): Dito.
(lyskom-command): Dito.
* macros.el: Require custom och widget fr att undvika fel pga att
man har autoloads definierade fr en massa andra
widget-funktioner.
...
...
src/Makefile
View file @
4ba58ea8
...
...
@@ -39,7 +39,8 @@
CLIENTVERSION
=
0.45-beta
DOCFILES
=
NEWS-0.45 MIGRATION-0.44-0.45
FTPDIR
=
/usr/ftp/pub/lyskom/elisp-client
FTPDIR
=
/home/davby/www-pub
#FTPDIR = /usr/ftp/pub/lyskom/elisp-client
LISPDIR
=
/usr/gnu/share/emacs/site-lisp
LANGUAGES
=
swedish english
...
...
@@ -66,6 +67,7 @@ SOURCES = $(LANGUAGE-EL) \
command.el
\
parse.el
\
cache.el
\
view-mode.el
\
commands1.el
\
commands2.el
\
review.el
\
...
...
@@ -151,6 +153,7 @@ release: $(HEADER) $(SOURCES) $(DISTSRC) $(MISC)
for
i
in
$(DOCFILES)
;
do
\
cp
../doc/
$$
i lyskom-
$(CLIENTVERSION)
/
$$
i
;
\
done
chmod
-R
u+rw,g+r,o+r lyskom-
$(CLIENTVERSION)
tar
cvf lyskom-
$(CLIENTVERSION)
.tar lyskom-
$(CLIENTVERSION)
gzip
-9
lyskom-
$(CLIENTVERSION)
.tar
cp
lyskom-
$(CLIENTVERSION)
.tar.gz
$(FTPDIR)
...
...
src/check-strings.el
View file @
4ba58ea8
...
...
@@ -14,6 +14,10 @@
(
require
'lyskom
)
(
defvar
lcs-dont-check-ending-categories
'
(
lyskom-command
)
"String categories where ending mismatches are OK."
)
(
defvar
lcs-message-buffer
"*LysKOM string check*"
)
(
defun
lyskom-check-strings
()
...
...
@@ -57,9 +61,15 @@ STRINGS is a list of (language . string)."
(
str
(
cdr
(
car
strings
)))
(
flist
(
lcs-check-string
category
name
lang
str
)))
(
if
(
listp
format-list
)
(
or
(
lcs-check-format-string
format-list
flist
)
(
lcs-message
nil
"(%s:%s) Format mismatch\n %S\n %S"
category
name
first-str
str
))
(
progn
(
or
(
lcs-check-format-string
format-list
flist
)
(
lcs-message
nil
"(%s:%s) Format mismatch\n %S\n %S"
category
name
first-str
str
))
(
and
(
not
(
memq
category
lcs-dont-check-ending-categories
))
(
or
(
lcs-check-string-ending
first-str
str
)
(
lcs-message
nil
"(%s:%s) Ending mismatch\n %S\n %S"
category
name
first-str
str
))))
(
setq
format-list
flist
first-str
str
))
...
...
@@ -96,6 +106,26 @@ STRING is the string."
result
))
(
defconst
lcs-match-endings
'
(
"\\."
"\\?"
":"
"!"
"\\.\n"
"\\?\n"
":\n"
"!\n"
"\n"
")"
")\n"
"\\? +"
": +"
"\\? +\n"
": +\n"
)
"String endings that should be identical in various languages."
)
(
defun
lcs-check-string-ending
(
template
str
)
(
cond
((
or
(
not
(
stringp
template
))
(
not
(
stringp
str
)))
t
)
(
t
(
let
((
result
(
mapcar
(
function
(
lambda
(
x
)
(
let
((
pat
(
concat
"\\`\\(.\\|\n\\)*"
x
"\\'"
)))
(
eq
(
string-match
pat
template
)
(
string-match
pat
str
)))))
lcs-match-endings
)))
(
cond
((
memq
nil
result
)
nil
)
(
t
t
))))))
(
defun
lcs-check-format-string
(
template
flist
)
"Match the formatters in TEMPLATE to those in FLIST."
(
let*
((
result
t
))
...
...
@@ -129,4 +159,4 @@ FORMAT and ARGS are as for `format'."
(
message
msg
)))))
\ No newline at end of file
src/command.el
View file @
4ba58ea8
...
...
@@ -100,12 +100,12 @@
(
defun
kom-extended-command
()
"Read a LysKOM function name and call the function."
(
interactive
)
(
let
((
fnc
(
lyskom-read-extended-command
)))
(
let
((
fnc
(
lyskom-read-extended-command
current-prefix-arg
)))
(
cond
(
fnc
(
call-interactively
fnc
))
(
t
(
kom-next-command
))))
)
(
defun
lyskom-read-extended-command
()
(
defun
lyskom-read-extended-command
(
&optional
prefix-arg
)
"Reads and returns a command"
(
let*
((
completion-ignore-case
t
)
(
minibuffer-setup-hook
minibuffer-setup-hook
)
...
...
@@ -113,7 +113,20 @@
(
cons
(
cdr
pair
)
(
car
pair
))))
(
lyskom-get-strings
lyskom-commands
'lyskom-command
)))
(
name
nil
))
(
name
nil
)
(
prefix-text
(
cond
((
eq
prefix-arg
'-
)
"- "
)
((
equal
prefix-arg
'
(
4
))
"C-u "
)
((
integerp
prefix-arg
)
(
format
"%d "
prefix-arg
))
((
and
(
consp
prefix-arg
)
(
integerp
(
car
prefix-arg
)))
(
format
"%d "
(
car
prefix-arg
)))
(
t
nil
)))
(
prompt
(
if
prefix-text
(
concat
prefix-text
(
lyskom-get-string
'extended-command
))
(
lyskom-get-string
'extended-command
))))
;; (add-hook 'minibuffer-setup-hook
;; (function
;; (lambda ()
...
...
@@ -122,7 +135,7 @@
;; (aset table ?\} 345)
;; (set-case-table table)))))
(
lyskom-with-lyskom-minibuffer
(
setq
name
(
completing-read
(
lyskom-get-string
'extended-command
)
(
setq
name
(
completing-read
prompt
alternatives
;; lyskom-is-administrator is buffer-local and
;; must be evalled before the call to
...
...
src/commands1.el
View file @
4ba58ea8
...
...
@@ -348,7 +348,7 @@ Returns t if it was possible, otherwise nil."
(
>
kom-membership-default-priority
0
))
kom-membership-default-priority
(
lyskom-read-num-range
1
255
(
lyskom-get-string
'priority-q
)))))
0
255
(
lyskom-get-string
'priority-q
)))))
(
where
(
if
(
/=
lyskom-pers-no
(
conf-stat->conf-no
pers-conf-stat
))
1
; When adding someone else
...
...
@@ -1536,8 +1536,10 @@ If MARK-NO == 0, review all marked texts."
(
time->sec
time
))))
(
error
nil
))))))
lyskom-times
)
;;;
;;; +++ FIXME specialhack för svenska. Borde det generaliseras?
(
when
(
eq
lyskom-language
'sv
)
;;;
(
when
(
and
(
eq
lyskom-language
'sv
)
kom-show-namedays
)
(
let
((
tmp
(
lyskom-nameday
time
)))
(
when
tmp
(
lyskom-insert
"\n"
)
...
...
@@ -2146,19 +2148,22 @@ Uses Protocol A version 9 calls"
;;; =====================================================================
;;; Lista klienter - List clients
;;; Author: David Kågedal
;;; Modified: Daivd Byers
(
def-kom-command
kom-list-clients
()
(
def-kom-command
kom-list-clients
(
prefix
)
"Display a list of all connected users."
(
interactive
)
(
let*
((
who-info-list
(
blocking-do
'who-is-on
))
(
who-list
(
sort
(
listify-vector
who-info-list
)
(
function
(
lambda
(
who1
who2
)
(
<
(
who-info->connection
who1
)
(
who-info->connection
who2
))))))
(
interactive
"P"
)
(
let*
((
want-invisible
(
if
prefix
t
nil
))
(
who-info-list
(
blocking-do
'who-is-on-dynamic
t
want-invisible
nil
))
(
who-list
(
sort
(
listify-vector
who-info-list
)
(
function
(
lambda
(
who1
who2
)
(
<
(
dynamic-session-info->session
who1
)
(
dynamic-session-info->session
who2
))))))
(
total-users
(
length
who-list
))
(
s-width
(
1+
(
length
(
int-to-string
(
who-info->connect
ion
(
dynamic-session-info->sess
ion
(
nth
(
1-
total-users
)
who-list
))))))
(
format-string
(
lyskom-info-line-format-string
s-width
"P"
(
if
kom-deferred-printing
"D"
"s"
))))
...
...
@@ -2171,34 +2176,36 @@ Uses Protocol A version 9 calls"
(
while
who-list
(
let*
((
who-info
(
car
who-list
))
(
session-no
(
int-to-string
(
who-info->connect
ion
who-info
)))
(
session-no
(
int-to-string
(
dynamic-session-info->sess
ion
who-info
)))
(
my-session
(
if
(
=
lyskom-session-no
(
who-info->connect
ion
who-info
))
(
dynamic-session-info->sess
ion
who-info
))
"*"
" "
))
(
client
(
if
kom-deferred-printing
(
lyskom-create-defer-info
'get-client-name
(
who-info->connect
ion
who-info
)
(
dynamic-session-info->sess
ion
who-info
)
'lyskom-deferred-client-1
nil
nil
nil
; Filled in later
(
who-info->connect
ion
who-info
))
(
dynamic-session-info->sess
ion
who-info
))
(
blocking-do-multiple
((
name
(
get-client-name
(
who-info->connect
ion
who-info
)))
(
dynamic-session-info->sess
ion
who-info
)))
(
version
(
get-client-version
(
who-info->connect
ion
who-info
))))
(
dynamic-session-info->sess
ion
who-info
))))
(
concat
name
" "
version
)))))
(
lyskom-format-insert
format-string
(
concat
session-no
my-session
)
(
who
-info->pers
-n
o
who-info
)
(
dynamic-session
-info->perso
n
who-info
)
client
))
(
setq
who-list
(
cdr
who-list
)))
(
lyskom-insert
(
concat
(
make-string
(
-
(
lyskom-window-width
)
2
)
?-
)
"\n"
))
(
lyskom-insert
(
lyskom-format
'total-visible-users
total-users
))))
(
lyskom-insert
(
lyskom-format
(
if
want-invisible
'total-users
'total-visible-users
)
total-users
))))
(
defun
lyskom-deferred-client-1
(
name
defer-info
)
...
...
src/compatibility.el
View file @
4ba58ea8
...
...
@@ -179,13 +179,13 @@ of the lyskom-provide-* functions instead."
(
down-mouse-3
.
(
button3
))
(
.
aring
)
(
.
Aring
)
(
.
adi
e
aresis
)
(
.
Adi
e
aresis
)))
(
.
adia
e
resis
)
(
.
Adia
e
resis
)))
(
defconst
lyskom-gnu-keysym
'
((
.
?\)
(
.
?\)
(
.
?\)
(
.
?\)
(
.
?\)
(
.
?\)
(
.
?\)
))
...
...
@@ -197,10 +197,12 @@ of the lyskom-provide-* functions instead."
(
defun
lyskom-keysym
(
sym
)
"Look up the proper symbol to bind sym to"
(
or
(
cdr
(
assq
sym
(
lyskom-xemacs-or-gnu
lyskom-xemacs-keysym
lyskom-gnu-keysym
)))
sym
))
(
lyskom-xemacs-or-gnu
(
or
(
cdr
(
assq
sym
lyskom-xemacs-keysym
))
sym
)
(
or
(
cdr
(
assq
sym
lyskom-gnu-keysym
))
(
let
((
name
(
symbol-name
sym
)))
(
and
(
=
(
length
name
)
1
)
(
elt
name
0
)))
sym
)))
;;; ============================================================
;;; Text property and extents stuff
...
...
src/distribution-Makefile
View file @
4ba58ea8
...
...
@@ -45,7 +45,7 @@ LANGUAGES=swedish english
RM=/bin/rm -f
SHELL=/bin/sh
LANGUAGE-EL=$(LANGUAGES:
%=%
-strings.el)
LANGUAGE-EL=$(LANGUAGES:
=
-strings.el)
EMACS-BATCH=$(EMACS) -batch
SOURCES = $(LANGUAGE-EL) \
komtypes.el \
...
...
@@ -61,6 +61,7 @@ SOURCES = $(LANGUAGE-EL) \
command.el \
parse.el \
cache.el \
view-mode.el \
commands1.el \
commands2.el \
review.el \
...
...
src/edit-text.el
View file @
4ba58ea8
...
...
@@ -302,19 +302,13 @@ Commands:
(
setq
headers
(
lyskom-edit-parse-headers
)
misc-list
(
apply
'lyskom-create-misc-list
(
cdr
headers
))
subject
(
car
headers
)))
;;
;; Run user hooks
;; ####: ++++: FIXME: We should quit more graciously.
(
if
(
not
(
run-hook-with-args-until-failure
'lyskom-send-text-hook
))
(
signal
'lyskom-edit-text-abort
nil
))
;;
;; Check that there is a subject
;;
(
if
(
string=
subject
""
)
(
if
(
or
(
null
subject
)
(
string=
subject
""
))
(
let
((
old
(
point
)))
(
goto-char
(
point-min
))
(
re-search-forward
(
lyskom-get-string
'header-subject
)
...
...
@@ -335,6 +329,14 @@ Commands:
(
cdr
(
nconc
headers
extra-headers
))))))
;;
;; Run user hooks
;; ####: ++++: FIXME: We should quit more graciously.
(
if
(
not
(
run-hook-with-args-until-failure
'lyskom-send-text-hook
))
(
signal
'lyskom-edit-text-abort
nil
))
;;
;; Transform the message text
;;
...
...
@@ -347,6 +349,13 @@ Commands:
(
setq
mode-name
"LysKOM sending"
)
(
save-excursion
(
let
((
full-message
(
cond
((
and
lyskom-allow-missing-subject
(
null
subject
)
(
not
(
string-match
".*\n"
message
)))
message
)
(
t
(
concat
(
or
subject
""
)
"\n"
message
)))))
(
set-buffer
lyskom-buffer
)
;; Don't change the prompt if we won't see our own text
(
if
kom-created-texts-are-read
...
...
@@ -356,9 +365,9 @@ Commands:
(
funcall
send-function
'sending
'lyskom-create-text-handler
(
concat
subject
"\n"
message
)
full-
message
misc-list
buffer
)))
buffer
)))
)
(
lyskom-undisplay-buffer
)
(
goto-char
(
point-max
))))
;;
...
...
@@ -732,6 +741,7 @@ text is a member of some recipient of this text."
(
let
((
p
(
point
)))
(
save-excursion
(
let*
((
buffer
(
current-buffer
))
(
window
(
selected-window
))
(
headers
(
condition-case
nil
(
cdr
(
lyskom-edit-parse-headers
))
(
lyskom-edit-error
nil
)))
; Ignore these errors
...
...
@@ -746,7 +756,7 @@ text is a member of some recipient of this text."
(
no
(
goto-char
p
)
(
set-buffer
lyskom-buffer
)
(
initiate-get-text
'edit
thendo
no
buffer
)
(
initiate-get-text
'edit
thendo
no
buffer
window
)
(
set-buffer
buffer
))
(
t
(
lyskom-message
"%s"
(
lyskom-get-string
'no-such-text-m
))))))
...
...
@@ -834,7 +844,7 @@ and the rest is a list (HEADER DATA HEADER DATA ...), where HEADER is
either 'recpt, 'cc-recpt, 'comm-to or 'footn-to. This is to make it
easy to use the result in a call to `lyskom-create-misc-list'."
(
goto-char
(
point-min
))
(
let
((
result
(
cons
""
nil
)))
; The car will be replaced by
(
let
((
result
(
cons
nil
nil
)))
; The car will be replaced by
; the real subject
(
save-restriction
;; Narrow to headers
...
...
@@ -952,7 +962,7 @@ Point must be located on the line where the subject is."
(
kill-buffer
edit-buffer
))))
(
defun
lyskom-edit-show-commented
(
text
editing-buffer
)
(
defun
lyskom-edit-show-commented
(
text
editing-buffer
window
)
"Handles the TEXT from the return of the call of the text.
The EDITING-BUFFER is the buffer the editing is done in. If this buffer is
not displayed nothing is done. If displayed then this buffer is chosen then
...
...
@@ -960,18 +970,20 @@ the with-output-to-temp-buffer command is issued to make them both apear."
(
and
text
(
get-buffer-window
editing-buffer
)
(
progn
(
set-buffer
editing-buffer
)
(
set-buffer
editing-buffer
)
(
select-window
window
)
(
let
((
buf
(
lyskom-get-buffer-create
'view-commented
"*Commented*"
))
(
kom-deferred-printing
nil
))
(
lyskom-display-buffer
buf
)
(
save-excursion
(
set-buffer
buf
)
(
erase-buffer
)
(
lyskom-view-text
(
text->text-no
text
))
(
set-buffer-modified-p
nil
)
(
lyskom-view-mode
))))))
(
save-selected-window
(
lyskom-display-buffer
buf
)
(
save-excursion
(
set-buffer
buf
)
(
erase-buffer
)
(
lyskom-view-text
(
text->text-no
text
))
(
set-buffer-modified-p
nil
)
(
lyskom-view-mode
)))))))
(
defun
lyskom-edit-insert-commented
(
text
editing-buffer
)
(
defun
lyskom-edit-insert-commented
(
text
editing-buffer
window
)
"Handles the TEXT from the return of the call of the text.
The text is inserted in the buffer with '>' first on each line."
(
if
text
...
...
src/english-strings.el
View file @
4ba58ea8
This diff is collapsed.
Click to expand it.
src/envcheck.el
View file @
4ba58ea8
...
...
@@ -164,6 +164,7 @@ library from http://www.dina.kvl.dk/~abraham/custom/")
(catch 'terminate
(if have-w3
(load-library "
w3
")
(unless (fboundp 'w3-region)
(message "
---
Antique
version
of
w3
detected
(
WARNING
)
...
...
src/lyskom-buttons.el
View file @
4ba58ea8
...
...
@@ -105,8 +105,10 @@ on such functions see the documentation for lyskom-add-button-action."
(
interactive
)
(
lyskom-button-press
(
point
)))
(
defun
kom-button-click
(
event
)
"Execute the default action of the active area under the mouse."
(
defun
kom-button-click
(
event
&optional
do-default
)
"Execute the default action of the active area under the mouse.
If optional argument do-default is non-nil, call the default binding of
this-command-keys."
(
interactive
"@e"
)
(
let*
((
pos
(
event-point
event
))
(
glyph
(
event-glyph
event
))
...
...
@@ -119,8 +121,20 @@ on such functions see the documentation for lyskom-add-button-action."
(
and
widget
(
widget-get
widget
'href
))
(
and
parent
(
widget-get
parent
'href
)))))
(
cond
(
href
(
w3-widget-button-click
event
))
((
and
do-default
(
or
(
null
pos
)
(
null
(
get-text-property
pos
'lyskom-button-type
))))
(
let
((
fn
(
lookup-key
global-map
(
this-command-keys
))))
(
when
(
commandp
fn
)
(
call-interactively
fn
))))
(
t
(
lyskom-button-press
pos
)))))
(
defun
kom-button-click-or-yank
(
event
)
"Execute the default action of the active area under the mouse.
If there is no active area, then do something else."
(
interactive
"@e"
)
(
kom-button-click
event
t
))
(
defun
kom-popup-menu
(
event
)
"Pop up a menu of actions to be taken at the active area under the mouse."
(
interactive
"@e"
)
...
...
@@ -206,24 +220,25 @@ on such functions see the documentation for lyskom-add-button-action."
(
defun
lyskom-button-press
(
pos
)
"Execute the default action of the active area at POS if any."
(
let*
((
type
(
get-text-property
pos
'lyskom-button-type
))
(
arg
(
get-text-property
pos
'lyskom-button-arg
))
(
text
(
get-text-property
pos
'lyskom-button-text
))
(
buf
(
get-text-property
pos
'lyskom-buffer
))
(
hint
(
get-text-property
pos
'lyskom-button-hint
))
(
data
(
assq
type
lyskom-button-actions
))
(
act
(
or
(
and
kom-use-button-hints
hint
)
(
and
data
(
elt
data
2
)))))
(
when
pos
(
let*
((
type
(
get-text-property
pos
'lyskom-button-type
))
(
arg
(
get-text-property
pos
'lyskom-button-arg
))
(
text
(
get-text-property
pos
'lyskom-button-text
))
(
buf
(
get-text-property
pos
'lyskom-buffer
))
(
hint
(
get-text-property
pos
'lyskom-button-hint
))
(
data
(
assq
type
lyskom-button-actions
))
(
act
(
or
(
and
kom-use-button-hints
hint
)
(
and
data
(
elt
data
2
)))))
(
cond
((
null
act
)
(
goto-char
pos
))
((
null
buf
)
(
goto-char
pos
))
((
and
buf
(
null
(
get-buffer
buf
)))
(
lyskom-message
"%s"
(
lyskom-get-string
'no-such-buffer
)))
(
t
(
and
buf
(
set-buffer
buf
))
(
funcall
act
buf
arg
text
)))))
(
cond
((
null
act
)
(
goto-char
pos
))
((
null
buf
)
(
goto-char
pos
))
((
and
buf
(
null
(
get-buffer
buf
)))
(
lyskom-message
"%s"
(
lyskom-get-string
'no-such-buffer
)))
(
t
(
and
buf
(
set-buffer
buf
))
(
funcall
act
buf
arg
text
)))))
)
(
defun
lyskom-fix-pseudo-url
(
url
)
...
...
src/lyskom-rest.el
View file @
4ba58ea8
...
...
@@ -1450,6 +1450,8 @@ in lyskom-messages."