Commit 65405576 authored by Ulrik Haugen's avatar Ulrik Haugen
Browse files

Added a lyskom-button text property to the prompt containing the time of

prompt creation.
parent d71c2d13
2001-10-13 Ulrik Haugen <qha@lysator.liu.se>
* swedish-strings.el, english-strings.el (lyskom-message,
lyskom-message): timestamp-button strings.
* lyskom-buttons.el (lyskom-default-button): add a timestamp-button
property to the prompt.
(lyskom-button-copy-timestamp): new function.
* lyskom-rest.el (lyskom-modify-prompt): add a timestamp-button
property to the prompt.
* vars.el.in (lyskom-current-prompt-timestamp): new variable.
(lyskom-button-actions): added button-type: timestamp.
2001-10-09 Joel Rosdahl <joel@rosdahl.net>
* swedish-strings.el (lyskom-sv-edit-mode-map): Make C-c TAB an
......
......@@ -1254,6 +1254,7 @@ Text:
(pers-popup-title . "User %#1s")
(url-popup-title . "URL %#1s")
(aux-popup-title . "Extra information")
(timestamp-popup-title . "Timestamp %#1s")
(generic-popup-title . "%#1s")
(who-i-am-not-present . "%#1P (not in any conference) \n")
......@@ -1564,6 +1565,7 @@ You must become an active member of the conference to enter it.\n")
(lyskom-button-copy-email-action . "Copy")
(lyskom-button-info-aux-action . "Information")
(lyskom-button-delete-aux-action . "Delete")
(lyskom-button-copy-timestamp-action . "Copy")
(lyskom-edit-toggle-secret-aux-action . "Toggle \"secret\"")
(lyskom-edit-toggle-anonymous-aux-action . "Toggle \"anonymous\"")
(lyskom-edit-toggle-inherit-aux-action . "Toggle \"inherited\"")
......
......@@ -472,7 +472,7 @@ information."
(defun lyskom-default-button (type arg &optional menu-title)
"Generate a button of type TYPE from data in ARG. ARG can be almost any
type of data and is converted to the proper argument type for buttons of
type TYPE before being send to lyskom-generate-button. Optional argument
type TYPE before being sent to lyskom-generate-button. Optional argument
MENU-TITLE is a list consisting of a format string or symbol and arguments
for the format string. The arguments are not when the menu is popped
up."
......@@ -506,7 +506,8 @@ up."
text (conf-stat->name arg)))
((lyskom-uconf-stat-p arg)
(setq xarg (uconf-stat->conf-no arg)
text (uconf-stat->name arg))) ((lyskom-pers-stat-p arg)
text (uconf-stat->name arg)))
((lyskom-pers-stat-p arg)
(setq xarg (pers-stat->pers-no arg)
text
(or (conf-stat->name
......@@ -539,6 +540,13 @@ up."
(cond ((stringp arg) (setq xarg nil text arg))
(t (setq xarg nil text ""))))
((eq type 'timestamp)
(setq face 'kom-text-face)
(cond ((null arg) (setq xarg (current-time)
text (format-time-string "%Y-%m-%d %H:%M")))
(t (setq xarg arg
text (format-time-string "%Y-%m-%d %H:%M" arg)))))
(t (setq xarg arg text "")))
(lyskom-generate-button type xarg text face menu-title))))
......@@ -753,7 +761,16 @@ This is a LysKOM button action."
(setq arg (replace-in-string arg "\n" " " t))
(setq arg (replace-in-string arg " +" " " t))
(Info-goto-node arg))
;;;
;;; Timestamp button
;;;
(defun lyskom-button-copy-timestamp (but arg text)
"In the LysKOM buffer BUF, ignore TEXT and copy ARG to the kill ring
after formating it as time. This is a LysKOM button action."
(kill-new (format-time-string "%Y-%m-%d %H:%M" arg)))
;;;
;;; LysKOM URL Management
......
......@@ -2518,7 +2518,7 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
(goto-char (point-max))
(beginning-of-line)
(add-text-properties 0 (length prompt-text)
'(read-only t rear-nonsticky t)
'(read-only t rear-nonsticky t)
prompt-text)
(insert-string prompt-text)
;; Delete the old prompt
......@@ -2549,7 +2549,16 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
kom-user-prompt-format-executing
kom-user-prompt-format)))
s)))
(add-text-properties 0 (length text) '(lyskom-prompt t) text)
(add-text-properties 0 (length text)
(append
(lyskom-default-button
'timestamp lyskom-current-prompt-timestamp
(list 'timestamp-popup-title
(format-time-string "%Y-%m-%d %H:%M"
lyskom-current-prompt-timestamp)))
'(lyskom-prompt t))
text)
(when executing (setq lyskom-current-prompt-timestamp (current-time)))
text))
......
......@@ -1253,6 +1253,7 @@ Text:
(pers-popup-title . "Person %#1s")
(url-popup-title . "URL %#1s")
(aux-popup-title . "Tillggsinformation")
(timestamp-popup-title . "Tidsstmpel %#1s")
(generic-popup-title . "%#1s")
(who-i-am-not-present . "%#1P r inte nrvarande i ngot mte\n")
......@@ -1563,6 +1564,7 @@ Du m
(lyskom-button-copy-email-action . "Kopiera")
(lyskom-button-info-aux-action . "Information")
(lyskom-button-delete-aux-action . "Radera")
(lyskom-button-copy-timestamp-action . "Kopiera")
(lyskom-edit-toggle-secret-aux-action . "Vxla \"hemlig\"")
(lyskom-edit-toggle-anonymous-aux-action . "Vxla \"anonym\"")
(lyskom-edit-toggle-inherit-aux-action . "Vxla \"rvd\"")
......
......@@ -581,10 +581,15 @@ a string indicating the prompt shown in the LysKOM buffer."
local)
(def-kom-var lyskom-current-prompt-args nil
"The current prompt arguments
"The current prompt arguments.
These are arguments used to format the current prompt."
local)
(def-kom-var lyskom-current-prompt-timestamp nil
"The creationtime of the current prompt.
This is used when updating the prompt and on lyskom-start-of-command."
local)
(def-kom-var lyskom-need-prompt-update nil
"Non-nil if all prompts need to be updated."
local)
......@@ -1229,6 +1234,11 @@ each time ."
lyskom-button-apply
nil
nil)
(timestamp
timestamp-popup-title
(lambda (buffer argument text) nil)
((lyskom-button-copy-timestamp-action . lyskom-button-copy-timestamp))
nil)
)
"This variable defines valid button types in LysKOM. Each element is a
list consisting of (TYPE LABEL DEFAULT ACTIONS HINTS).
......
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