Commit dbddd998 authored by David Byers's avatar David Byers
Browse files

Fixed bugs 964, 753, 831 and 927.

Detailed changes:
> 2003-01-06  David Byers  <david.byers@swipnet.se>
>
> 	Clean up :variable assignments:
> 	* compatibility.el (lyskom-make-self-evaluating): New macro. Use
> 	it to make several :symbols self-evalutaing in Emacs 19.
>
> 	Fix bug 964:
> 	* faces.el (lyskom-setup-faces-for-buffer): Catch errors cause
> 	when generating faces since running this code in a tty usually
> 	causes problems. Don't just check window-system, because the color
> 	stuff might work on some implementations.
>
> 	Fix bug 753:
> 	* flags.el (kom-copy-options): New command.
>
> 	* english-strings.el (lyskom-command): Added kom-copy-options.
>
> 	* swedish-strings.el (lyskom-command): Renamed "Spara variabler"
> 	to "Spara inställningar". Added kom-copy-options.
>
> 	Fix bug 831 as well as possible:
> 	* lyskom-rest.el (lyskom-scroll): Cleaned up for readability. Move
> 	point six chars in from the right margin when not scrolling to the
> 	end to prevent automatic hscrolling in Emacs 21.x.
>
> 	Fix bug 927:
> 	* commands1.el (lyskom-who-is-on-check-membership-9): Don't
> 	include passive members.
> 	(lyskom-who-is-on-check-membership-8): Ditto.
>
parent fe48d131
2003-01-06 David Byers <david.byers@swipnet.se>
Clean up :variable assignments:
* compatibility.el (lyskom-make-self-evaluating): New macro. Use
it to make several :symbols self-evalutaing in Emacs 19.
Fix bug 964:
* faces.el (lyskom-setup-faces-for-buffer): Catch errors cause
when generating faces since running this code in a tty usually
causes problems. Don't just check window-system, because the color
stuff might work on some implementations.
Fix bug 753:
* flags.el (kom-copy-options): New command.
* english-strings.el (lyskom-command): Added kom-copy-options.
* swedish-strings.el (lyskom-command): Renamed "Spara variabler"
to "Spara instllningar". Added kom-copy-options.
Fix bug 831 as well as possible:
* lyskom-rest.el (lyskom-scroll): Cleaned up for readability. Move
point six chars in from the right margin when not scrolling to the
end to prevent automatic hscrolling in Emacs 21.x.
Fix bug 927:
* commands1.el (lyskom-who-is-on-check-membership-9): Don't
include passive members.
(lyskom-who-is-on-check-membership-8): Ditto.
2003-01-05 David Byers <david.byers@swipnet.se> 2003-01-05 David Byers <david.byers@swipnet.se>
* I have cleaned up all over the place. There are no ChangeLog * I have cleaned up all over the place. There are no ChangeLog
......
...@@ -2542,7 +2542,7 @@ Uses Protocol A version 9 calls" ...@@ -2542,7 +2542,7 @@ Uses Protocol A version 9 calls"
(t 0)))) (t 0))))
(who-info-list (blocking-do 'who-is-on-dynamic (who-info-list (blocking-do 'who-is-on-dynamic
't wants-invisibles (* idle-hide 60))) 't wants-invisibles (* idle-hide 60)))
(who-list (sort (who-list (sort
(funcall (if show-friends-only (funcall (if show-friends-only
#'lyskom-select-friends-from-who-list #'lyskom-select-friends-from-who-list
#'identity) #'identity)
...@@ -2718,40 +2718,46 @@ Uses Protocol A version 9 calls" ...@@ -2718,40 +2718,46 @@ Uses Protocol A version 9 calls"
0 (conf-stat->no-of-members conf-stat))) 0 (conf-stat->no-of-members conf-stat)))
(len (length who-info-list)) (len (length who-info-list))
(i 0) (i 0)
(res nil)) (res nil)
(mship nil))
(while (< i len) (while (< i len)
(if (lyskom-member-list-find-member (setq mship (lyskom-member-list-find-member
(who-info->pers-no (aref who-info-list i)) (who-info->pers-no (aref who-info-list i))
members) members))
(when (and mship
(not (membership-type->passive
(member->membership-type mship))))
(setq res (cons (aref who-info-list i) res))) (setq res (cons (aref who-info-list i) res)))
(setq i (1+ i))) (setq i (1+ i)))
res)) res))
(defun lyskom-who-is-present-check-membership-8 (who-info-list conf-stat) (defun lyskom-who-is-on-check-membership-9 (who-info-list conf-stat)
"Returns a list of those in WHO-INFO-LIST which is present in CONF-STAT." "Returns a list of those in WHO-INFO-LIST which is member in CONF-STAT."
(let ((len (length who-info-list)) (let ((members (blocking-do 'get-members (conf-stat->conf-no conf-stat)
0 (conf-stat->no-of-members conf-stat)))
(len (length who-info-list))
(i 0) (i 0)
(res nil)) (res nil)
(mship nil))
(while (< i len) (while (< i len)
(if (eq (who-info->working-conf (aref who-info-list i)) (setq mship (lyskom-member-list-find-member
(conf-stat->conf-no conf-stat)) (dynamic-session-info->person (aref who-info-list i))
members))
(when (and mship
(not (membership-type->passive
(member->membership-type mship))))
(setq res (cons (aref who-info-list i) res))) (setq res (cons (aref who-info-list i) res)))
(setq i (1+ i))) (setq i (1+ i)))
res)) res))
(defun lyskom-who-is-on-check-membership-9 (who-info-list conf-stat) (defun lyskom-who-is-present-check-membership-8 (who-info-list conf-stat)
"Returns a list of those in WHO-INFO-LIST which is member in CONF-STAT." "Returns a list of those in WHO-INFO-LIST which is present in CONF-STAT."
(let ((members (blocking-do 'get-members (conf-stat->conf-no conf-stat) (let ((len (length who-info-list))
0 (conf-stat->no-of-members conf-stat)))
(len (length who-info-list))
(i 0) (i 0)
(res nil)) (res nil))
(while (< i len) (while (< i len)
(if (lyskom-member-list-find-member (if (eq (who-info->working-conf (aref who-info-list i))
(dynamic-session-info->person (aref who-info-list i)) (conf-stat->conf-no conf-stat))
members)
(setq res (cons (aref who-info-list i) res))) (setq res (cons (aref who-info-list i) res)))
(setq i (1+ i))) (setq i (1+ i)))
res)) res))
...@@ -2764,7 +2770,6 @@ Uses Protocol A version 9 calls" ...@@ -2764,7 +2770,6 @@ Uses Protocol A version 9 calls"
(while (< i len) (while (< i len)
(if (eq (dynamic-session-info->working-conference (aref who-info-list i)) (if (eq (dynamic-session-info->working-conference (aref who-info-list i))
(conf-stat->conf-no conf-stat)) (conf-stat->conf-no conf-stat))
(setq res (cons (aref who-info-list i) res))) (setq res (cons (aref who-info-list i) res)))
(setq i (1+ i))) (setq i (1+ i)))
res)) res))
......
...@@ -635,16 +635,17 @@ Otherwise treat \\ in NEWTEXT string as special: ...@@ -635,16 +635,17 @@ Otherwise treat \\ in NEWTEXT string as special:
;; Emacs 21. ;; Emacs 21.
(eval-and-compile (eval-and-compile
(condition-case nil (defmacro lyskom-make-self-evaluating (var)
(setq lyskom-dummy-variable-to-fool-the-byte-compiler `(condition-case nil
(symbol-value ':default-help-echo)) (setq lyskom-dummy-variable-to-fool-the-byte-compiler
(error (set ':default-help-echo ':default-help-echo))) (symbol-value ',var))
(condition-case nil (error (set ',var ',var))))
(setq lyskom-dummy-variable-to-fool-the-byte-compiler
(symbol-value ':group)) (lyskom-make-self-evaluating :default)
(error (set ':group ':group)))) (lyskom-make-self-evaluating :default-help-echo)
(lyskom-make-self-evaluating :group)
(lyskom-make-self-evaluating :automatic)
(lyskom-make-self-evaluating :read-only))
;;; Local Variables: ;;; Local Variables:
......
...@@ -1838,6 +1838,10 @@ environment to one that uses \"%#2s\" to encode text. ...@@ -1838,6 +1838,10 @@ environment to one that uses \"%#2s\" to encode text.
(jump-from-text . "Skip comments to which text? ") (jump-from-text . "Skip comments to which text? ")
(jumping-from-text . "Skipping comments to text %#1n.\n") (jumping-from-text . "Skipping comments to text %#1n.\n")
(jumping-from-text-review . "Skipping reviewed comments.\n") (jumping-from-text-review . "Skipping reviewed comments.\n")
(session-to-copy-options-from . "Session to copy options from: ")
(reading-settings-from . "Reeading options from %s...")
(reading-settings-from-done . "Reading options from %s...done")
)) ))
...@@ -2041,6 +2045,7 @@ environment to one that uses \"%#2s\" to encode text. ...@@ -2041,6 +2045,7 @@ environment to one that uses \"%#2s\" to encode text.
(kom-change-server-faq . "Change server FAQ") (kom-change-server-faq . "Change server FAQ")
(kom-recommend-conference . "Recommend conference") (kom-recommend-conference . "Recommend conference")
(kom-redirect-comments . "Redirect comments") (kom-redirect-comments . "Redirect comments")
(kom-copy-options . "Copy options")
)) ))
(lyskom-language-var global lyskom-language-codes en (lyskom-language-var global lyskom-language-codes en
......
...@@ -280,15 +280,24 @@ This is a LysKOM face variable." ...@@ -280,15 +280,24 @@ This is a LysKOM face variable."
(defun lyskom-setup-faces-for-buffer () (defun lyskom-setup-faces-for-buffer ()
"Set up faces for the current buffer." "Set up faces for the current buffer."
(let ((faces (lyskom-generate-faces-for-background (setq lyskom-default-text-body-face 'default)
(or (face-background 'default) (setq lyskom-default-dashed-lines-face 'default)
(frame-property (selected-frame) 'background-color) (setq lyskom-default-async-text-body-face 'default)
"#ffffff")))) (setq lyskom-default-async-dashed-lines-face 'default)
(setq lyskom-default-text-body-face (cdr (assq 'text-body faces))) (condition-case nil
(setq lyskom-default-dashed-lines-face (cdr (assq 'dashed-lines faces))) (let ((faces (lyskom-generate-faces-for-background
(setq lyskom-default-async-text-body-face (cdr (assq 'async-text-body faces))) (or (face-background 'default)
(setq lyskom-default-async-dashed-lines-face (cdr (assq 'async-dashed-lines faces))) (frame-property (selected-frame) 'background-color)
)) "#ffffff"))))
(setq lyskom-default-text-body-face
(cdr (assq 'text-body faces))
lyskom-default-dashed-lines-face
(cdr (assq 'dashed-lines faces))
lyskom-default-async-text-body-face
(cdr (assq 'async-text-body faces))
lyskom-default-async-dashed-lines-face
(cdr (assq 'async-dashed-lines faces))))
(error nil)))
;;; ================================================================ ;;; ================================================================
......
...@@ -56,6 +56,32 @@ ...@@ -56,6 +56,32 @@
(lyskom-get-string 'saving-settings-done) (lyskom-get-string 'saving-settings-done)
(lyskom-get-string 'could-not-save-options))) (lyskom-get-string 'could-not-save-options)))
(def-kom-command kom-copy-options ()
"Copy options from one setting to another."
(interactive)
(let* ((completions
(mapcar (lambda (x)
(cons (save-excursion
(set-buffer x)
(buffer-name))
x))
(delq (or lyskom-buffer (current-buffer))
(copy-sequence lyskom-buffer-list))))
(from-session (completing-read
(lyskom-get-string 'session-to-copy-options-from)
completions
nil t)))
(lyskom-message (lyskom-get-string 'reading-settings-from) from-session)
(lyskom-read-options from-session)
(lyskom-message (lyskom-get-string 'reading-settings-from-done) from-session)
;; Inline kom-save-options
(lyskom-save-options (or lyskom-buffer (current-buffer))
(lyskom-get-string 'saving-settings)
(lyskom-get-string 'saving-settings-done)
(lyskom-get-string 'could-not-save-options))
))
;;;============================================================ ;;;============================================================
;;; lyskom-save-options ;;; lyskom-save-options
......
...@@ -1015,31 +1015,23 @@ will automagically flow into your lyskom log file." ...@@ -1015,31 +1015,23 @@ will automagically flow into your lyskom log file."
The position lyskom-last-viewed will always remain visible." The position lyskom-last-viewed will always remain visible."
;; Find a window to scroll. Scroll the selected window if that shows LysKOM. ;; Find a window to scroll. Scroll the selected window if that shows LysKOM.
;; Otherwise scroll any window currently showing LysKOM. ;; Otherwise scroll any window currently showing LysKOM.
(let ((win (let ((win (cond ((eq (window-buffer (selected-window)) (current-buffer))
(cond (selected-window))
((eq (window-buffer (selected-window)) (current-buffer)) (t nil))))
(selected-window)) (when (and win (not (pos-visible-in-window-p (point-max))))
(t ;(get-buffer-window (current-buffer)) (goto-char (point-max))
nil)))) (recenter -1)
(if (and win ;Do nothing if no window showed LysKOM. (unless (pos-visible-in-window-p lyskom-last-viewed)
(not (pos-visible-in-window-p (point-max)))) (set-window-start win lyskom-last-viewed)
(progn (move-to-window-line -1)
(goto-char (point-max)) (vertical-motion 1)
(recenter -1) (when (not (pos-visible-in-window-p))
(if (not (pos-visible-in-window-p lyskom-last-viewed)) (forward-char -1)
(progn (when (> (current-column) (window-width))
(set-window-start win lyskom-last-viewed) (backward-char (+ (- (current-column) (window-width)) 6)))
(move-to-window-line -1) )))))
(vertical-motion 1)
(when (not (pos-visible-in-window-p))
(forward-char -1)
(when (> (current-column)
(window-width))
(backward-char (+ (- (current-column)
(window-width))
2)))
)))))))
;;; ;;;
;;; Thanks to the stupid danish fool who wrote the widget package, we ;;; Thanks to the stupid danish fool who wrote the widget package, we
;;; have to do it this way, because w3 uses widgets, and because ;;; have to do it this way, because w3 uses widgets, and because
...@@ -1051,7 +1043,6 @@ The position lyskom-last-viewed will always remain visible." ...@@ -1051,7 +1043,6 @@ The position lyskom-last-viewed will always remain visible."
;;; (Me, upset? Why would you think *that*?) ;;; (Me, upset? Why would you think *that*?)
;;; ;;;
(defun lyskom-do-special-inserts (start sym) (defun lyskom-do-special-inserts (start sym)
(condition-case var (condition-case var
(let ((bounds (next-text-property-bounds 1 (max (point-min) (1- start)) (let ((bounds (next-text-property-bounds 1 (max (point-min) (1- start))
......
...@@ -1873,6 +1873,10 @@ teckenkodning. ...@@ -1873,6 +1873,10 @@ teckenkodning.
(jump-from-text . "Hoppa ver kommentarer till vilken text? ") (jump-from-text . "Hoppa ver kommentarer till vilken text? ")
(jumping-from-text . "Hoppar ver kommentarer till inlgg %#1n.\n") (jumping-from-text . "Hoppar ver kommentarer till inlgg %#1n.\n")
(jumping-from-text-review . "Hoppar ver tersedda kommentarer.\n") (jumping-from-text-review . "Hoppar ver tersedda kommentarer.\n")
(session-to-copy-options-from . "Kopiera instllningar frn session: ")
(reading-settings-from . "Lser instllningar frn %s...")
(reading-settings-from-done . "Lser instllningar frn %s...klart")
)) ))
(lyskom-language-var local lyskom-month-names sv (lyskom-language-var local lyskom-month-names sv
...@@ -1995,7 +1999,7 @@ teckenkodning. ...@@ -1995,7 +1999,7 @@ teckenkodning.
(kom-unset-conf-motd . "Ta bort lapp p drren") (kom-unset-conf-motd . "Ta bort lapp p drren")
(kom-save-text . "Arkivera inlgg (till fil)") (kom-save-text . "Arkivera inlgg (till fil)")
(kom-save-text-body . "Spara inlggstext (p fil)") (kom-save-text-body . "Spara inlggstext (p fil)")
(kom-save-options . "Spara variabler") (kom-save-options . "Spara instllningar")
(kom-shutdown-server . "Stng av servern") (kom-shutdown-server . "Stng av servern")
(kom-sync-database . "Spara databasen") (kom-sync-database . "Spara databasen")
(kom-enable-adm-caps . "verg till administratrsmod") (kom-enable-adm-caps . "verg till administratrsmod")
...@@ -2075,6 +2079,8 @@ teckenkodning. ...@@ -2075,6 +2079,8 @@ teckenkodning.
(kom-recommend-conference . "Rekommendera mte") (kom-recommend-conference . "Rekommendera mte")
(kom-redirect-comments . "Dirigera om kommentarer") (kom-redirect-comments . "Dirigera om kommentarer")
(kom-move-text-tree . "Flytta trd") (kom-move-text-tree . "Flytta trd")
(kom-copy-options . "Kopiera instllningar")
)) ))
(lyskom-language-var local lyskom-language-codes sv (lyskom-language-var local lyskom-language-codes sv
......
...@@ -1887,6 +1887,7 @@ Users are encouraged to use their best sense of humor." ...@@ -1887,6 +1887,7 @@ Users are encouraged to use their best sense of humor."
kom-review-server-faq kom-review-server-faq
kom-recommend-conference kom-recommend-conference
kom-redirect-comments kom-redirect-comments
kom-copy-options
)) ))
;;; ================================================================ ;;; ================================================================
......
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