Commit 1854f39e authored by Pontus Freyhult's avatar Pontus Freyhult

Use lyskom-session-nickname to determine session name everywhere

applicable.
parent 6e760e69
2004-11-12 Pontus Freyhult <pont@soua.net>
* commands2.el (kom-modeline-select-unread-kom): Use
lyskom-session-nickname.
(kom-status-server): Dito.
* lyskom-rest.el (lyskom-session-nickname): Take additional argument
if the nick name is to be put in the mode line.
(lyskom-mode-name-from-host): Pass mode-line arg.
* async.el (lyskom-show-logged-in-person): Use lyskom-session-nickname.
(lyskom-show-logged-out-person): Dito.
* utilities.el (lyskom-get-server-alias): Deleted (almost) unused
function.
(lyskom-nag-about-presentation): Use lyskom-session-nickname instead.
* vars.el.in (lyskom-commands): Added kom-list-sessions.
* menus.el (lyskom-menu-template): Added kom-list-sessions.
......
......@@ -403,11 +403,7 @@ according to the value of FLAG."
(defun lyskom-show-logged-in-person (conf-stat)
"Visa p} kommandoraden vem som loggat in."
(let ((server (or (cdr (lyskom-string-assoc
lyskom-server-name
(append kom-server-aliases
kom-builtin-server-aliases)))
lyskom-server-name)))
(let ((server (lyskom-session-nickname)))
(cond
((lyskom-is-in-minibuffer))
((lyskom-show-presence (conf-stat->conf-no conf-stat)
......@@ -437,11 +433,7 @@ according to the value of FLAG."
(defun lyskom-show-logged-out-person (conf-stat session-no)
"Visa p} kommandoraden vem som loggat ut."
(let ((server (or (cdr (lyskom-string-assoc
lyskom-server-name
(append kom-server-aliases
kom-builtin-server-aliases)))
lyskom-server-name)))
(let ((server (lyskom-session-nickname)))
(cond
((lyskom-is-in-minibuffer))
((lyskom-show-presence (conf-stat->conf-no conf-stat)
......
......@@ -1728,11 +1728,7 @@ See `kom-next-kom' and `kom-previous-kom' for related commands."
(vector
(lyskom-format "%#1P, %#2s%#3?b%[ (%#4s)%]%[%]"
lyskom-pers-no
(or (cdr (assoc
lyskom-server-name
(append kom-server-aliases
kom-builtin-server-aliases)))
lyskom-server-name)
(lyskom-session-nickname)
(memq buffer lyskom-sessions-with-unread-letters)
(lyskom-get-string 'unread-letters))
(list 'lyskom-switch-to-kom-buffer buffer)
......@@ -2803,15 +2799,10 @@ properly in the client."
;; ----------------------------------------
;; Print header
(let ((lyskom-both-server-aliases (append kom-server-aliases
kom-builtin-server-aliases)))
(lyskom-format-insert 'server-status-header
(cond ((cdr (lyskom-string-assoc lyskom-server-name lyskom-both-server-aliases)))
((cdr (lyskom-string-rassoc lyskom-server-name lyskom-both-server-aliases)))
(t lyskom-server-name))
(cond ((car (lyskom-string-rassoc lyskom-server-name lyskom-both-server-aliases)))
(t lyskom-server-name))
lyskom-server-port))
(lyskom-format-insert 'server-status-header
(lyskom-session-nickname)
lyskom-server-name
lyskom-server-port)
;; ----------------------------------------
;; Print software name and version
......
......@@ -3188,11 +3188,7 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
lyskom-current-conf)))
((eq format-letter ?S) lyskom-server-name)
((eq format-letter ?s)
(or (cdr (assoc
lyskom-server-name
(append kom-server-aliases
kom-builtin-server-aliases)))
lyskom-server-name))
(lyskom-session-nickname))
((eq format-letter ?p)
(or (conf-stat->name
(cache-get-conf-stat lyskom-pers-no))
......@@ -4211,7 +4207,7 @@ One parameter - the prompt string."
input-string))
(defun lyskom-session-nickname ()
(defun lyskom-session-nickname (&optional in-modeline)
"Return the nickname to use for this LysKOM session."
(if kom-session-nickname
kom-session-nickname
......@@ -4219,14 +4215,16 @@ One parameter - the prompt string."
(or (cdr (assoc server
(append kom-server-aliases
kom-builtin-server-aliases)))
(format "LysKOM(%s)" server)))))
(if in-modeline
(format "LysKOM(%s)" server)
server)))))
;;; This really is a strange thing to do but...
;;
(defun lyskom-mode-name-from-host ()
"Calculate what to identify the buffer with."
(setq mode-line-server-name
(lyskom-session-nickname)))
(lyskom-session-nickname t)))
(defvar lyskom-modeline-keymap nil)
(if lyskom-modeline-keymap
......
......@@ -1903,17 +1903,6 @@ Any whitespace and newlines in TEXT will be ignored."
(or (string-match "^\\(file://\\|ftp://\\|gopher://\\|http://\\|https://\\|news:\\|wais://\\|mailto:\\|telnet:\\|rtsp:\\)[^\t \012\014\"<>|\\]*[^][\t \012\014\"<>|.,!(){}?'`:;]$" text)
(string-match "^\\(www\\|ftp\\|home\\)\\.[^\t \012\014\"<>|\\]*[^][\t \012\014\"<>|.,!(){}?'`:;]$" text)))))
(defun lyskom-get-server-alias (&optional name)
"Return the alias for server NAME."
(let ((lyskom-both-server-aliases (append kom-server-aliases
kom-builtin-server-aliases)))
(or (cdr (lyskom-string-assoc (or name lyskom-server-name)
lyskom-both-server-aliases))
name
lyskom-server-name)))
(defun lyskom-nag-about-presentation (&optional harder)
(unless kom-dont-complain-about-missing-presentation
(blocking-do-multiple
......@@ -1933,7 +1922,7 @@ Any whitespace and newlines in TEXT will be ignored."
(lyskom-format-insert 'why-you-got-no-presentation
`(face ,kom-warning-face)
(pers-stat->no-of-created-texts pers-stat)
(lyskom-get-server-alias)
(lyskom-session-nickname)
72)
(sit-for (if harder 0 1))))))
......
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