Commit 4322a9d5 authored by David Byers's avatar David Byers
Browse files

More Magic Modelines

parent 42900931
1999-11-17 David Byers <davby@ida.liu.se>
* lyskom-rest.el (lyskom-is-loaded): In XEmacs, set an extent on
the "unread" text in the mode line with some basic key bindings.
* commands2.el (kom-modeline-next-unread-kom): New function.
(kom-modeline-select-unread-kom): New function.
(lyskom-switch-to-kom-buffer): New function.
(lyskom-next-kom): Use it.
1999-11-11 David Byers <davby@ida.liu.se>
* swedish-strings.el (lyskom-message): Added who-to-add-bcc-q.
......
......@@ -1710,12 +1710,7 @@ Return-value: 'no-session if there is no suitable session to switch to
(if (eq (current-buffer) (car buffer-list))
(setq result 'same-session)
;; Possibly bury the current buffer
(when (and kom-bury-buffers (eq current (current-buffer)))
(kom-bury))
;; Switch to the new buffer
(switch-to-buffer (car buffer-list))
(lyskom-switch-to-kom-buffer (car buffer-list) current)
(setq result nil)))
result))
......@@ -1762,6 +1757,52 @@ Return-value: 'no-session if there is no suitable session to switch to
(error (lyskom-get-string 'no-lyskom-session))))
(t nil))))
(defun kom-modeline-next-unread-kom ()
"Pop up the previous unread lyskom session, if there is one"
(interactive)
(lyskom-xemacs-or-gnu
(lyskom-next-kom 'lyskom-sessions-with-unread 'forward)
nil))
(defun kom-modeline-select-unread-kom (event)
"Pop up a menu of sessions with unreads"
(interactive "@e")
(lyskom-xemacs-or-gnu
(when lyskom-sessions-with-unread
(let ((unreads
(mapcar (lambda (buffer)
(save-excursion
(set-buffer buffer)
(vector
(lyskom-format "%#1P, %#2s%#3?b%[ (%#4s)%]%[%]"
lyskom-pers-no
(or (cdr (assoc lyskom-server-name
kom-server-aliases))
lyskom-server-name)
(memq buffer lyskom-sessions-with-unread-letters)
(lyskom-get-string 'unread-letters))
(list 'lyskom-switch-to-kom-buffer buffer)
:active t)))
lyskom-sessions-with-unread)))
(popup-menu
(cons (lyskom-get-string 'sessions-with-unreads) unreads)
event)))
nil))
(defun lyskom-switch-to-kom-buffer (buffer &optional current)
(when buffer
(when (and kom-bury-buffers (eq current (current-buffer)))
(kom-bury))
;; Switch to the new buffer
(switch-to-buffer buffer)))
;;; ============================================================
;;; Var finns kommandot (kom-where-is)
......
......@@ -424,7 +424,8 @@ Read all about it at http://www.lysator.liu.se/history/")
(total-visible-active-users
. " A total of %#1d visible active user%#1?d%[%]%[s%] (%#2s.)\n")
(who-to-add-q . "Add who/what as a recipient? ")
(who-to-add-copy-q . "Add which conference/user as recipient of a carbon copy? ")
(who-to-add-copy-q . "Add which conference/user as carbon copy recipient? ")
(who-to-add-bcc-q . "Add which conference/user as blind carbon copy recipient? ")
(who-to-sub-q . "Remove who/what as a recipient? ")
(who-to-move-from-q . "Move from where? ")
(who-to-move-to-q . "Move to where? ")
......@@ -957,6 +958,8 @@ Send a bug report.\n")
(mode-line-unread . " Unread ")
(mode-line-letters . "letters ")
(sessions-with-unreads . "Sessions with unread texts")
(unread-letters . "unread letters")
(bad-text-no-prefix . "Unable to translate prefix `%s' to a text number")
(error-code . "Error code %#2d: %#1s.\n")
......
......@@ -3334,14 +3334,28 @@ One parameter - the prompt string."
(format "LysKOM(%s)" server))))
(defvar lyskom-modeline-keymap nil)
(if lyskom-modeline-keymap
nil
(setq lyskom-modeline-keymap (make-sparse-keymap))
(define-key lyskom-modeline-keymap (kbd (lyskom-keys 'button2)) 'kom-modeline-next-unread-kom)
(define-key lyskom-modeline-keymap (kbd (lyskom-keys 'button3)) 'kom-modeline-select-unread-kom))
(if lyskom-is-loaded
nil
(lyskom-set-language lyskom-language)
(or (memq 'lyskom-unread-mode-line global-mode-string)
(setq global-mode-string
(append '("" lyskom-unread-mode-line) global-mode-string)))
(unless (or (memq 'lyskom-unread-mode-line global-mode-string)
(rassq 'lyskom-unread-mode-line global-mode-string))
(lyskom-xemacs-or-gnu
(let ((extent (make-extent nil nil nil)))
(set-extent-keymap extent lyskom-modeline-keymap)
(setq global-mode-string
(append (list "" (cons extent lyskom-unread-mode-line))
global-mode-string)))
(setq global-mode-string
(append '("" lyskom-unread-mode-line) global-mode-string))))
(setq lyskom-unread-mode-line
(list (list 'lyskom-sessions-with-unread
(lyskom-get-string 'mode-line-unread))
......
......@@ -967,6 +967,8 @@ Skicka en bugrapport.\n")
(mode-line-unread . " Olsta ")
(mode-line-letters . "brev ")
(sessions-with-unreads . "Sessioner med olsta")
(unread-letters . "olsta brev")
(bad-text-no-prefix . "Kan inte verstta prefix `%s' till inlggsnummer")
(error-code . "Felkod %#2d: %#1s.\n")
......
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