From bda0d616b3b94d38eebc8b34916a883206d178a5 Mon Sep 17 00:00:00 2001
From: David Byers <david.byers@liu.se>
Date: Sat, 27 Apr 2002 18:30:33 +0000
Subject: [PATCH] Fixed bug 485 (number of lines is clickable Better message
 when detecting macedit Set language globally based on first login Fixed
 problems with face schemes missing faces Added checking of face schemes to
 check-strings.el Corrected definition of black-and-tan face scheme (it might
 work now)

---
 src/ChangeLog          | 27 ++++++++++++++++++++++++++-
 src/check-strings.el   | 20 ++++++++++++++++++++
 src/edit-text.el       | 15 ++++++++++++++-
 src/english-strings.el |  2 +-
 src/header.el          | 39 ++++++++++++++++++++++++++++++++++++++-
 src/startup.el         |  2 ++
 src/swedish-strings.el |  2 +-
 src/vars.el.in         | 33 +++++++++++++++++++++++++++------
 8 files changed, 129 insertions(+), 11 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 70b4a3fe..fd2910ee 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,32 @@
+2002-04-27  David Byers  <david.byers@swipnet.se>
+
+	Fix bug 485:
+	* english-strings.el, swedish-strings.el: Number of lines in
+	view-text-first-line was formatted as a text number, not a simple
+	integer.
+
+	* header.el: Updated check for macedit to look for the library and
+	include some information on autoloads.
+
+	* startup.el (kom-start-anew): Set languages globally on the first
+	login.
+
+	* vars.el.in (lyskom-have-one-login): Nwe variable.
+
+	Fix bug 484:
+	* edit-text.el (kom-edit-next-button-or-self-insert): Don't do
+	self-insert-command, but traverse the current keymaps to figure
+	out what to do.
+
+	* check-strings.el (lcs-check-face-schemes): New function to check
+	consistency of face schemes.
+
+	* vars.el.in (lyskom-face-schemes): Added scheme black-and-tan.
+
 2002-04-27  Ulrik Haugen  <qha@lysator.liu.se>
 
 	Fix bug 458:
-	
+
 	* swedish-strings.el, english-strings.el
 	(lyskom-message): New string: who-is-friend.
 
diff --git a/src/check-strings.el b/src/check-strings.el
index afff98b8..2d788af5 100644
--- a/src/check-strings.el
+++ b/src/check-strings.el
@@ -35,6 +35,9 @@
   (or noninteractive
       (lcs-setup-message-buffer))
 
+  (lcs-message t "Checking face schemes")
+  (lcs-check-face-schemes)
+
   (lcs-message t "Checking variables")
   (lcs-check-language-vars)
   (lcs-check-lyskom-commands (mapcar 'car
@@ -56,6 +59,23 @@
   (or noninteractive
       (display-buffer lcs-message-buffer)))
 
+(defun lcs-check-face-schemes ()
+  "Check that all face schemes seem to be OK."
+  (lyskom-traverse scheme lyskom-face-schemes
+    (let ((faces (mapcar 'car (cdr scheme)))
+          (tmp nil))
+      (lyskom-traverse expected-face lyskom-faces
+        (if (setq tmp (memq expected-face faces))
+            (progn (when (memq expected-face (cdr tmp))
+                     (lcs-message nil "(%s) Duplicate face in scheme: %s"
+                                  (car scheme) expected-face))
+                   (setq faces (delq expected-face faces)))
+          (lcs-message nil "(%s) Face scheme missing face: %s"
+                       (car scheme) expected-face)))
+      (lyskom-traverse extra-face faces
+        (lcs-message nil "(%s) Face scheme contains unknown face: %s"
+                     (car scheme) extra-face)))))
+
 (defun lcs-check-language-vars ()
   "Check that all language-specific variables exist in all languages"
   (mapcar (lambda (var)
diff --git a/src/edit-text.el b/src/edit-text.el
index ef961abe..592362f1 100644
--- a/src/edit-text.el
+++ b/src/edit-text.el
@@ -1896,7 +1896,20 @@ buglist style, automating the removal of closed subjects and change-marks."
         (start (point))
         (next-pos nil))
     (if (> (point) header-end)
-        (call-interactively 'self-insert-command)
+        (unless (lyskom-traverse keymap (current-minor-mode-maps)
+                  (let ((binding (lookup-key keymap (this-command-keys))))
+                    (when (and (commandp binding)
+                               (not (eq binding
+                                        'kom-edit-next-button-or-self-insert)))
+                      (call-interactively binding)
+                      (lyskom-traverse-break t))))
+          (let ((binding (lookup-key (current-local-map) 
+                                     (this-command-keys) t)))
+            (if (and (commandp binding)
+                       (not (eq binding
+                                'kom-edit-next-button-or-self-insert)))
+                (call-interactively binding)
+              (call-interactively 'self-insert-command))))
       (while (> num 0)
         (lyskom-next-area 1 'lyskom-button)
         (if (eq start (point))
diff --git a/src/english-strings.el b/src/english-strings.el
index 02a53daf..9d69ea5c 100644
--- a/src/english-strings.el
+++ b/src/english-strings.el
@@ -879,7 +879,7 @@ Help: \\[describe-mode] ---")
     (which-conf-to-link . "Add link to conference: ")
 
     ; From view-text.el:
-    (view-text-first-line . "%#7$%#2@%#1n %#3s /%#4n line%#4?d%[%]%[s%]/ %#5P%#6?b%[%#6s%]%[%]\n")
+    (view-text-first-line . "%#7$%#2@%#1n %#3s /%#4d line%#4?d%[%]%[s%]/ %#5P%#6?b%[%#6s%]%[%]\n")
 
     (marked-by-you . "Marked by you (type: %#1s).\n")
     (marked-by-you-and-others . "Marked by you (type: %#2s) and %#1?d%[someone else%]%[%#1d others%].\n")
diff --git a/src/header.el b/src/header.el
index 47f04932..6e4de1cf 100644
--- a/src/header.el
+++ b/src/header.el
@@ -67,4 +67,41 @@
 (eval-and-compile
   (if (and (stringp (read-kbd-macro "<SPC>"))
            (string-equal (read-kbd-macro "<SPC>") "<SPC>"))
-      (error "You probably have a file named macedit.elc in Emacs' load path.\nIt is obsolete and must be removed in order for LysKOM to work.")))
+      (let ((elc-location (locate-library "macedit.elc"))
+            (el-location (locate-library "macedit.el"))
+            (elz-location (locate-library "macedit.el.gz")))
+        (cond ((or el-location elc-location)
+               (message "\
+
+You probably have a file named macedit.elc in Emacs' load path.
+
+This file is included in some versions of the calc package and
+is no longer required as the functions that it provides are
+also provided by more modern packages.
+
+You will need to remove macedit.el and all references to it
+from Emacs. These are the files you need to remove:
+
+%s
+To fully remove macedit you will also have to remove any
+autoloads that refer to it. These may be found in a file
+named auto-autoloads.elc (or auto-autoloads.el), located 
+in the same directory as macedit or in a file named
+loaddefs.el, located elsewhere.
+
+With Gnu Emacs you may be successful in removing references
+by using the command update-autoloads-from-directories.
+"
+                      (mapconcat (lambda (x) (or x "")) 
+                                 (list elc-location el-location elz-location) 
+                                 "\n"))
+               (error "Unable to run or compile due to obsolete macedit package."))
+              (t
+               (message "\
+
+Your definition of read-kbd-macro appears to be obsolete. This
+is usually caused by having a package called macedit in Emacs
+load path, but I am unable to find this package. LysKOM cannot
+run with your version of read-kbd-macro.
+")
+               (error "Unable to run or compile due to obsolete definition of read-kbd-macro."))))))
diff --git a/src/startup.el b/src/startup.el
index 7a0a662c..6a6d60d5 100644
--- a/src/startup.el
+++ b/src/startup.el
@@ -556,6 +556,8 @@ shown to other users."
 	  (progn (clear-all-caches)
                  (unless (eq lyskom-language kom-default-language)   
                    (when (lyskom-set-language kom-default-language 'local)
+                     (unless lyskom-have-one-login
+                       (lyskom-set-language kom-default-language 'global))
                      (lyskom-format-insert-before-prompt 
                       'language-set-to
                       (lyskom-language-name kom-default-language)))))
diff --git a/src/swedish-strings.el b/src/swedish-strings.el
index 189a5396..bb171ef2 100644
--- a/src/swedish-strings.el
+++ b/src/swedish-strings.el
@@ -880,7 +880,7 @@ Annat se \\[describe-mode] ---")
     (which-conf-to-link . "L�gg in l�nk till m�te: ")
 
     ;; From view-text.el:
-    (view-text-first-line . "%#7$%#2@%#1n %#3s /%#4n rad%#4?d%[%]%[er%]/ %#5P%#6?b%[%#6s%]%[%]\n")
+    (view-text-first-line . "%#7$%#2@%#1n %#3s /%#4d rad%#4?d%[%]%[er%]/ %#5P%#6?b%[%#6s%]%[%]\n")
 
     (marked-by-you . "Markerad av dig (typ: %#1s).\n")
     (marked-by-you-and-others . "Markerad av dig (typ: %#2s) och %#1?d%[n�gon annan%]%[%#1d andra%].\n")
diff --git a/src/vars.el.in b/src/vars.el.in
index 89e6771c..1af798bb 100644
--- a/src/vars.el.in
+++ b/src/vars.el.in
@@ -56,7 +56,7 @@
   "List of flags that are to be saved as booleans in the common block.
 
 Don't change these. They are defined by the protocol.")
-				  
+
 (defconst lyskom-global-non-boolean-variables '(
   kom-default-mark
 )
@@ -86,6 +86,9 @@ Don't change these. They are defined by the protocol.")
 (defvar lyskom-is-loaded nil
   "Non-nil when lyskom has been loaded.")
 
+(defvar lyskom-have-one-login nil
+  "Non-nil after the first login")
+
 
 (def-kom-var kom-dont-read-saved-variables '(kom-dont-read-saved-variables
                                              lyskom-login-hook)
@@ -2804,7 +2807,7 @@ the value of  kom-tell-phrases for fun.")
 		    kom-text-face kom-subject-face kom-text-no-face
 		    kom-friends-face kom-morons-face kom-presence-face
 		    kom-first-line-face kom-warning-face kom-mark-face
-                    kom-text-body-face kom-dashed-lines-face)
+                    kom-text-body-face kom-dashed-lines-face kom-dim-face)
   "This is a list of the faces that LysKOM uses.")
 
 (def-kom-var lyskom-face-schemes
@@ -2826,6 +2829,24 @@ the value of  kom-tell-phrases for fun.")
      (kom-dim-face default "gray" nil)
      (kom-dashed-lines-face nil nil "#e8e8ff")
      )
+    (black-and-tan
+      (kom-text-body-face nil nil "#f8f8f0")
+      (kom-active-face default "#602000" nil)
+      (kom-url-face default "#800040" nil)
+      (kom-me-face bold "#602000" "#f0f0e0")
+      (kom-highlight-face highlight nil nil)
+      (kom-text-face default nil nil)
+      (kom-subject-face default nil nil)
+      (kom-text-no-face kom-active-face nil nil)
+      (kom-friends-face default "#602000" "#f0f0e0")
+      (kom-morons-face default "#602000" "#ffffc0")
+      (kom-presence-face italic "grey" nil)
+      (kom-mark-face bold "#602000" "#f0f0e0")
+      (kom-warning-face bold "red" nil)
+      (kom-first-line-face bold nil nil)
+      (kom-dim-face default "gray" nil)
+      (kom-dashed-lines-face nil nil "#f0f0e0")
+      )
     (inverse
      (kom-text-body-face nil nil "#080808")
      (kom-active-face default "lightblue" nil)
@@ -2842,10 +2863,11 @@ the value of  kom-tell-phrases for fun.")
      (kom-warning-face bold "red" nil)
      (kom-first-line-face nil nil "black")
      (kom-dim-face default "gray" nil)
-     (kom-first-line-face nil nil "black")
+     (kom-dashed-lines-face nil nil black)
      )
     (monochrome
      (kom-text-body-face nil nil nil)
+     (kom-dashed-lines-face nil nil nil)
      (kom-active-face default nil nil)
      (kom-url-face default nil nil)
      (kom-me-face bold nil nil)
@@ -2860,7 +2882,6 @@ the value of  kom-tell-phrases for fun.")
      (kom-warning-face bold nil nil)
      (kom-first-line-face bold nil nil)
      (kom-dim-face default nil nil)
-     (kom-first-line-face bold nil nil)
      )
     (minimal
      (kom-text-body-face nil nil nil)
@@ -2877,8 +2898,8 @@ the value of  kom-tell-phrases for fun.")
      (kom-mark-face default nil "black")
      (kom-warning-face bold nil nil)
      (kom-first-line-face nil nil nil)
+     (kom-dashed-lines-face nil nil nil)
      (kom-dim-face default nil nil)
-     (kom-first-line-face nil nil nil)
      )
     (highlight
      (kom-text-body-face nil nil "#f8f8ff")
@@ -2895,8 +2916,8 @@ the value of  kom-tell-phrases for fun.")
      (kom-mark-face      bold      "darkblue"   "thistle")
      (kom-warning-face   bold      "yellow"     "red")
      (kom-first-line-face nil  nil          "lavender")
+     (kom-dashed-lines-face nil  nil          "lavender")
      (kom-dim-face       default   "gray"       nil)
-     (kom-first-line-face nil  nil          "lavender")
      ))
   "Face schemes for LysKOM.
 
-- 
GitLab