Commit b9de6fb4 authored by Pontus Freyhult's avatar Pontus Freyhult
Browse files

Implement alternate unread mode line type.

parent 891268ed
2004-11-15 Pontus Freyhult <pont@soua.net>
Implement alternate unread mode line:
* option-edit.el (lyskom-customize-buffer-format): Added
kom-unread-mode-line-type.
(lyskom-custom-variables): Dito.
* english-strings.el, swedish-strings.el:
(lyskom-custom-strings): Added kom-unread-mode-line-type-tag
and kom-unread-mode-line-type-doc. Added simple-unread-mode-line
and explicit-unread-mode-line.
* lyskom-rest.el (lyskom-make-alternate-unread-mode-line): New
function.
(lyskom-make-lyskom-unread-mode-line): Use
lyskom-make-alternate-unread-mode-line if applicable.
* buffers.el (lyskom-update-unread-mode-line): New function.
(lyskom-clean-all-buffer-lists): Call lyskom-update-unread-mode-line.
(lyskom-remove-buffer-from-lists): Dito.
(lyskom-remove-unread-buffer): Dito.
(lyskom-add-unread-buffer): Dito.
* vars.el.in (kom-unread-mode-line-type): New global variable.
2004-11-12 Pontus Freyhult <pont@soua.net>
* commands2.el (kom-list-sessions): Use session-list-no-unread-in
......
......@@ -192,7 +192,11 @@ the children object"
(add-hook 'kill-buffer-query-functions
'lyskom-buffer-hierarchy-query-kill-function)
;;;; ======================================================================
(defun lyskom-update-unread-mode-line ()
(setq lyskom-unread-mode-line
(lyskom-make-lyskom-unread-mode-line)))
;;;; ======================================================================
;;;; ======================================================================
......@@ -205,6 +209,7 @@ the children object"
(lyskom-clean-buffer-list lyskom-sessions-with-unread-letters)
lyskom-buffer-list
(lyskom-clean-buffer-list lyskom-buffer-list))
(lyskom-update-unread-mode-line)
(lyskom-set-default 'lyskom-need-prompt-update t))
(defun lyskom-clean-buffer-list (buffers)
......@@ -226,6 +231,7 @@ If BUFFER is not specified, assume the current buffer"
(lyskom-remove-unread-buffer buffer)
(setq lyskom-buffer-list
(delq buffer lyskom-buffer-list))
(lyskom-update-unread-mode-line)
(lyskom-set-default 'lyskom-need-prompt-update t))
(defun lyskom-remove-unread-buffer (buffer &optional letters-only)
......@@ -244,6 +250,7 @@ If BUFFER is not specified, assume the current buffer"
buffer)
(setq lyskom-sessions-with-unread-letters
(delq buffer lyskom-sessions-with-unread-letters))
(lyskom-update-unread-mode-line)
(lyskom-set-default 'lyskom-need-prompt-update t))
......@@ -265,6 +272,7 @@ If BUFFER is not specified, assume the current buffer"
buffer)
(setq lyskom-sessions-with-unread-letters
(cons buffer lyskom-sessions-with-unread-letters)))
(lyskom-update-unread-mode-line)
(lyskom-set-default 'lyskom-need-prompt-update t))
(defvar lyskom-associated-buffer-list nil
......
......@@ -3090,6 +3090,9 @@ Select whether to execute command or keyboard macro.")
(automatic-session-name . "Automatic")
(given-session-name . "Use specified:")
(simple-unread-mode-line . "Simple")
(explicit-unread-mode-line . "Show all sessions with unread")
(everybody-rcpt . "Everybody ")
(group-rcpt . "The recipient of the last group message ")
(sender-rcpt . "The sender of the most recent message ")
......@@ -4082,6 +4085,19 @@ up menus.")
bar of all windows whose active buffer belongs to a LysKOM session
with unread texts. The title bar may not be updated unless the
window is open.")
(kom-unread-mode-line-type-doc . "\
This settings controls how unread texts are indicated in the mode line.
`Simple' meand there is a single indication for all active sessions that
shows if there are any unread texts or letters.
`Show all sessions with unread' means all sessions with unread texts
will be listed in the mode line. If there are unread letters in a
session it will be indicated by uppercasing the session name (e.g.
LysLys becomes LYSLYS). If the session name is upper cased already
(e.g. LYSLYS) it will be marked with asterisks (e.g. *LYSLYS*).
Note that this setting should be the same for all active LysKom
sessions. That means it's probably wise to save it in your .emacs.")
(kom-created-texts-are-saved-doc . "\
If this variable is set to a file name, all texts you write will be
saved to that file. Texts that could not be created are not saved.")
......@@ -4448,6 +4464,7 @@ up menus.")
(kom-saved-file-name-tag . "File to archive texts in:")
(kom-follow-attachments-tag . "Read imported attachments as texts:")
(kom-show-unread-in-frame-title-tag . "Show unread indicator in title bar:")
(kom-unread-mode-line-type-tag . "How unread texts are indicated in the mode line:")
(kom-created-texts-are-saved-tag . "Save created texts:")
(kom-confirm-add-recipients-tag . "Ask if comments should be sent to new recipients:")
(kom-trim-buffer-minimum-tag . "How small parts of the LysKOM buffer are trimmed:")
......
......@@ -4237,22 +4237,43 @@ One parameter - the prompt string."
(define-key lyskom-modeline-keymap [mode-line mouse-3] 'kom-modeline-select-unread-kom))))
(defun lyskom-make-alternate-unread-mode-line ()
(save-excursion
(let ((mline ())
(current nil)
(upcased nil))
(lyskom-traverse session lyskom-sessions-with-unread
(set-buffer session)
(setq current (lyskom-session-nickname))
(when (memq session lyskom-sessions-with-unread-letters)
(setq upcased (upcase current))
(setq current
(if (string= upcased current)
(concat "*" current "*")
upcased)))
(setq mline (append mline (list (concat current " ")))))
(setq mline (sort mline 'string<))
mline)))
(defun lyskom-make-lyskom-unread-mode-line ()
(lyskom-xemacs-or-gnu
(list (list 'lyskom-sessions-with-unread
(lyskom-get-string 'mode-line-unread))
(list 'lyskom-sessions-with-unread-letters
(lyskom-get-string 'mode-line-letters))
" ")
`((lyskom-sessions-with-unread
,(lyskom-format "%#1@%#2s"
(list 'local-map lyskom-modeline-keymap)
(lyskom-get-string 'mode-line-unread)))
(lyskom-sessions-with-unread-letters
,(lyskom-format "%#1@%#2s"
(list 'local-map lyskom-modeline-keymap)
(lyskom-get-string 'mode-line-letters)))
" ")))
(if kom-unread-mode-line-type
(lyskom-make-alternate-unread-mode-line)
(lyskom-xemacs-or-gnu
(list (list 'lyskom-sessions-with-unread
(lyskom-get-string 'mode-line-unread))
(list 'lyskom-sessions-with-unread-letters
(lyskom-get-string 'mode-line-letters))
" ")
`((lyskom-sessions-with-unread
,(lyskom-format "%#1@%#2s"
(list 'local-map lyskom-modeline-keymap)
(lyskom-get-string 'mode-line-unread)))
(lyskom-sessions-with-unread-letters
,(lyskom-format "%#1@%#2s"
(list 'local-map lyskom-modeline-keymap)
(lyskom-get-string 'mode-line-letters)))
" "))))
(defun lyskom-make-lyskom-unread-title-format ()
`(kom-show-unread-in-frame-title
......
......@@ -84,6 +84,7 @@
[kom-morons]
"\n"
[kom-show-unread-in-frame-title]
[kom-unread-mode-line-type]
[kom-presence-messages-in-echo-area]
[kom-presence-messages-in-buffer]
"\n"
......@@ -863,6 +864,10 @@ All key bindings:
(kom-saved-file-name (file))
(kom-follow-attachments (toggle (yes no)))
(kom-show-unread-in-frame-title (toggle (yes no)))
(kom-unread-mode-line-type (choice ((const (simple-unread-mode-line nil))
(const (explicit-unread-mode-line t)))))
(kom-confirm-add-recipients (toggle (yes no)))
(kom-trim-buffer-minimum (number))
(kom-dont-check-commented-authors (repeat (person nil
......
......@@ -3194,6 +3194,9 @@ Nuvarande r
(automatic-session-name . "Automatiskt")
(given-session-name . "Anvnd angivet:")
(simple-unread-mode-line . "Enkel")
(explicit-unread-mode-line . "Visa alla sessioner med olsta")
(everybody-rcpt . "Alla ")
(group-rcpt . "Senaste gruppmeddelandes mottagare")
(sender-rcpt . "Senaste meddelandes avsndare ")
......@@ -4192,7 +4195,22 @@ ta fram menyer.")
Om detta r pslaget s visas \"(Olsta)\" i titelraden fr de
fnster vars valda buffert hr till en LysKOM-session med olsta.
Det r inte skert att titelraden ndras om fnstret inte r ppet.")
(kom-created-texts-are-saved-doc . "\
(kom-unread-mode-line-type-doc . "\
Denna instllning bestmmer hur olsta indikeras i mode-raden. `Enkel'
betyder en gemensam indikering fr samtliga sessioner ifall du har
olsta texter eller brev.
`Visa alla sessioner med olsta' betyder att alla sessioner med olsta
texter indikeras separat. Frekomst med brev indikeras genom att
sessionsnamnet visas med stora bokstver (till exempel LYSLYS istllet
fr LysLys). Om sessionsnamnet bara innehller versaler (exempelvis
LYSLYS) visas det mellan asterisker (*LYSLYS*).
Notera att denna instllning br vara samma fr alla aktiva
LysKom-sessioner varfr det troligen r bst att spara den i
din .emacs.")
(kom-created-texts-are-saved-doc . "\
Om detta r ett filnamn s sparas alla inlgg man skriver till den
filen i ungefr samma format som de har nr man lser dem. Inlgg
som inte kan skapas sparas inte.")
......@@ -4560,6 +4578,7 @@ ta fram menyer.")
(kom-saved-file-name-tag . "Fil att arkivera inlgg i:")
(kom-follow-attachments-tag . "Ls importerade bilagor som vanligt:")
(kom-show-unread-in-frame-title-tag . "Visa olstamarkering i titelraden:")
(kom-unread-mode-line-type-tag . "Typ av olstaindikering i mode-raden:")
(kom-created-texts-are-saved-tag . "Spara frfattade inlgg:")
(kom-confirm-add-recipients-tag . "Frga om kommentarer skall sndas till nya mottagare:")
(kom-trim-buffer-minimum-tag . "Minsta storlek av LysKOM-bufferten som tas bort:")
......
......@@ -1367,6 +1367,20 @@ If you want the messages in the buffer, set the variable
Values other than those listed are reserved for future use."
server)
(def-kom-var kom-unread-mode-line-type nil
"**Controls how information about unread sessions is given in the mode line.
If this variable is `nil', there will be a single field of information
stating whatever you have unread texts or letters in any active session.
If this variable is `t', the mode line will instead include all sessions with
unread texts. Unread letters will be demonstrated by upper casing the session
name or (if the session name is in upper case already) surrounding it with
asterisks.
All other values are reserved for future use."
)
(def-kom-var kom-presence-messages-in-buffer nil
......
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