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

Bug fixes.

parent c46e2ea5
2000-03-11 David Byers <davby@ida.liu.se>
* menus.el (lyskom-define-menu-xemacs): Encode menu item strings
to avoid the 201s showing up in menus.
* lyskom-buttons.el (lyskom-make-button-menu): Encode menu item
strings to avoid the 201s showing up in popup menus.
* mship-edit.el: Tweaked various motion commands.
2000-03-10 David Byers <davby@ida.liu.se>
* mship-edit.el (lp--format-entry-expansion): New function.
(lp--format-entry): Split off formatting the second line. Do
lyskom-replace-deferred here.
(lp--format-insert-entry-2): Removed.
(lp--format-insert-entry): Call lp--format-entry do replace
deferred on the first line and lp--format-entry-expansion for the
second line, if needed. Check if the second line needs to be
formatted here rather than in lp--format-entry.
2000-03-07 David Byers <davby@ida.liu.se>
* option-edit.el (lyskom-ispell-dictionary-widget): Fixed bug that
caused no dictionary names to be listed if ispell was installed.
* swedish-strings.el (lyskom-sv-customize-map): Bound button2 and
button3 to kom-mouse-null.
* english-strings.el (lyskom-en-customize-map): Fixed definition
of lyskom-sv-customize-map.
2000-03-06 David Byers <davby@ida.liu.se>
* lyskom-buttons.el (lyskom-view-url-netscape): Quote parens in
URLs sent to Netscape.
2000-03-03 David Byers <davby@ida.liu.se>
* lyskom-rest.el (lyskom-w3-region): Save restriction, make start
......
......@@ -2006,14 +2006,23 @@ You must become an active member of the conference to enter it.\n")
(if lyskom-en-customize-map
nil
(setq lyskom-en-customize-map (make-sparse-keymap))
(define-key lyskom-en-customize-map "\t" 'widget-forward)
(define-key lyskom-en-customize-map "\M-\t" 'widget-backward)
(define-key lyskom-en-customize-map "\C-m" 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd "TAB") 'widget-forward)
(define-key lyskom-sv-customize-map (kbd "M-TAB") 'widget-backward)
(define-key lyskom-sv-customize-map (kbd "C-i") 'widget-forward)
(define-key lyskom-sv-customize-map (kbd "M-C-i") 'widget-backward)
(define-key lyskom-sv-customize-map (kbd "C-m") 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd "C-j") 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd "<RET>") 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd "<LFD>") 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd (lyskom-keys 'button2)) 'kom-mouse-null)
(define-key lyskom-sv-customize-map (kbd (lyskom-keys 'button3)) 'kom-mouse-null)
(define-key lyskom-en-customize-map (kbd (lyskom-keys 'button2up)) 'widget-button-click)
(define-key lyskom-en-customize-map "\C-c\C-c" 'lyskom-customize-save-and-quit)
(define-key lyskom-en-customize-map "\C-c\C-k" 'lyskom-customize-quit)
(define-key lyskom-en-customize-map "\C-c\C-s" 'lyskom-customize-save)
(define-key lyskom-en-customize-map "\C-c\C-a" 'lyskom-customize-apply)
(define-key lyskom-sv-customize-map (kbd (lyskom-keys 'button3up)) 'lyskom-widget-click)
(define-key lyskom-sv-customize-map (kbd "C-c C-c") 'lyskom-customize-save-and-quit)
(define-key lyskom-sv-customize-map (kbd "C-c C-k") 'lyskom-customize-quit)
(define-key lyskom-sv-customize-map (kbd "C-c C-s") 'lyskom-customize-save)
(define-key lyskom-sv-customize-map (kbd "C-c C-a") 'lyskom-customize-apply)
(define-key lyskom-sv-customize-map (kbd "?") 'lyskom-customize-help)
)
(lyskom-language-strings lyskom-custom-strings en
......
......@@ -214,9 +214,11 @@ lyskom-define-language."
Looks for the 'lyskom-menu category, or 'lyskom-command
if 'lyskom-menu is not found."
(encode-coding-string
(or (lyskom-get-string-internal symbol 'lyskom-menu)
(lyskom-get-string-internal symbol 'lyskom-command)
(lyskom-get-string-error 'lyskom-get-menu-string symbol 'lyskom-menu)))
(lyskom-get-string-error 'lyskom-get-menu-string symbol 'lyskom-menu))
'iso-8859-1))
(defun lyskom-string-check-category (category)
"Returns list of names for the category, and their supported languages"
......
......@@ -165,7 +165,8 @@ If there is no active area, then do something else."
(cons title
(mapcar (function
(lambda (entry)
(vector (car entry)
(vector (encode-coding-string
(car entry) 'iso-8859-1)
(list (cdr entry)
buf
(if (listp arg)
......@@ -175,12 +176,16 @@ If there is no active area, then do something else."
':active t)))
entries)))
(t (append (list 'keymap title)
(mapcar '(lambda (entry)
(cons (` ((, (cdr entry))
(, buf)
(, arg)
(, text)))
(copy-tree entry)))
(mapcar (function (lambda (entry)
(let ((tmp (copy-tree entry)))
(setcar tmp (encode-coding-string
(car tmp)
'iso-8859-1))
(cons (` ((, (cdr entry))
(, buf)
(, arg)
(, text)))
tmp))))
entries)))))
......@@ -852,6 +857,8 @@ MANAGER is the URL manager that started Netscape.
This function attempts to load the URL in a running Netscape, but failing
that, starts a new one."
(setq url (replace-in-string url "," "%2C"))
(setq url (replace-in-string url "(" "%28"))
(setq url (replace-in-string url ")" "%29"))
(let* ((url-string (if (or (eq window-system 'win32)
(eq window-system 'mswindows)
(eq window-system 'w32))
......
......@@ -75,6 +75,8 @@
;;; Commentary:
;;
(require 'advice)
;;; Code:
(def-komtype lp--entry
start-marker ; Where the entry is in the buffer
......@@ -179,75 +181,100 @@ only recomputed if the window width changes."
(lyskom-format-insert-at-point
"%#1D"
(lyskom-create-defer-info 'get-conf-stat
(membership->conf-no
(lp--entry->membership entry))
'lp--format-insert-entry-2
(membership->conf-no (lp--entry->membership entry))
'lp--format-entry
(point-marker)
(length lyskom-defer-indicator)
"%#1s"
entry)))
(defun lp--format-insert-entry-2 (conf-stat defer-info)
"Format ENTRY for insertion in a buffer.
Returns a string suitable for insertion in a membership list."
(lyskom-replace-deferred
defer-info
(lp--format-entry conf-stat (defer-info->data defer-info))))
(defun lp--format-entry (conf-stat entry)
(let* ((un (lyskom-find-unread (membership->conf-no
entry))
(when (or (eq (lp--entry->state entry) 'expanded)
(and (not (eq (membership->created-by (lp--entry->membership entry))
lyskom-pers-no))
(not (eq (membership->created-by (lp--entry->membership entry)) 0))
(not (eq (lp--entry->state entry) 'contracted))))
(lyskom-insert-at-point "\n ")
(lyskom-format-insert-at-point
"%#1D"
(lyskom-create-defer-info 'get-conf-stat
(membership->created-by (lp--entry->membership entry))
'lp--format-entry-expansion
(point-marker)
(length lyskom-defer-indicator)
"%#1s"
entry))))
(defun lp--format-entry (conf-stat defer-info)
(let* ((entry (defer-info->data defer-info))
(un (lyskom-find-unread (membership->conf-no
(lp--entry->membership entry)))))
(concat
(lyskom-format
(lp--compute-format-string)
(if (lp--entry->selected entry) ?* ?\ )
(if (zerop (membership->priority
(lp--entry->membership entry)))
"-"
(int-to-string (membership->priority
(lp--entry->membership entry))))
conf-stat
(lyskom-return-date-and-time
(membership->last-time-read (lp--entry->membership entry))
'time-yyyy-mm-dd)
(if un (int-to-string un) "")
(lyskom-replace-deferred
defer-info
(lyskom-format
(lp--compute-format-string)
(if (lp--entry->selected entry) ?* ?\ )
(if (zerop (membership->priority
(lp--entry->membership entry)))
"-"
(int-to-string (membership->priority
(lp--entry->membership entry))))
(if (null conf-stat)
(lyskom-format 'conference-does-not-exist
(membership->conf-no
(lp--entry->membership entry)))
conf-stat)
(lyskom-return-date-and-time
(membership->last-time-read (lp--entry->membership entry))
'time-yyyy-mm-dd)
(if un (int-to-string un) "")
(if (membership-type->invitation (membership->type (lp--entry->membership entry))) ?I ?.)
(if (membership-type->secret (membership->type (lp--entry->membership entry))) ?H ?.)
(if (membership-type->passive (membership->type (lp--entry->membership entry))) ?P ?.)
(if (and conf-stat (eq lyskom-pers-no (conf-stat->supervisor conf-stat))) ?O ?\ )
(lyskom-default-button 'prioritize-flag-menu
(list entry 'invitation)
(list "%#1s (%=#2M)"
"Inbjuden"
(membership->conf-no
(lp--entry->membership entry))))
(lyskom-default-button 'prioritize-flag-menu
(list entry 'secret)
(list "%#1s (%=#2M)"
"Hemlig"
(membership->conf-no
(lp--entry->membership entry))))
(lyskom-default-button 'prioritize-flag-menu
(list entry 'passive)
(list "%#1s (%=#2M)"
"Passiv"
(membership->conf-no
(lp--entry->membership entry))))
'(lp--unread t))
(when (or (eq (lp--entry->state entry) 'expanded)
(and (not (eq (membership->created-by (lp--entry->membership entry))
lyskom-pers-no))
(not (eq (membership->created-by (lp--entry->membership entry)) 0))
(not (eq (lp--entry->state entry) 'contracted))))
(lyskom-format-insert-at-point "\n %#1s %#2s av %#3P"
(if (membership-type->invitation (membership->type (lp--entry->membership entry)))
"Inbjuden" "Adderad")
(lyskom-return-date-and-time
(membership->created-at (lp--entry->membership entry)))
(if (membership-type->invitation (membership->type (lp--entry->membership entry))) ?I ?.)
(if (membership-type->secret (membership->type (lp--entry->membership entry))) ?H ?.)
(if (membership-type->passive (membership->type (lp--entry->membership entry))) ?P ?.)
(if (and conf-stat (eq lyskom-pers-no (conf-stat->supervisor conf-stat))) ?O ?\ )
(lyskom-default-button 'prioritize-flag-menu
(list entry 'invitation)
(list "%#1s (%=#2M)"
(lyskom-get-string 'Invitation-mt-type)
(membership->conf-no
(lp--entry->membership entry))))
(lyskom-default-button 'prioritize-flag-menu
(list entry 'secret)
(list "%#1s (%=#2M)"
(lyskom-get-string 'Secret-mt-type)
(membership->conf-no
(lp--entry->membership entry))))
(lyskom-default-button 'prioritize-flag-menu
(list entry 'passive)
(list "%#1s (%=#2M)"
(lyskom-get-string 'Passive-mt-type)
(membership->conf-no
(lp--entry->membership entry))))
'(lp--unread t)))))
(defun lp--format-entry-expansion (conf-stat defer-info)
(let* ((entry (defer-info->data defer-info))
(membership (lp--entry->membership entry)))
(lyskom-replace-deferred
defer-info
(if (and (null conf-stat)
(eq 0 (time->sec (membership->created-at membership)))
(eq 0 (time->min (membership->created-at membership)))
(eq 0 (time->mon (membership->created-at membership)))
(eq 1 (time->mday (membership->created-at membership)))
(eq 70 (time->year (membership->created-at membership))))
(lyskom-format "Ingen information om när medlemskapet skapades")
(lyskom-format "%#1s %#2s av %#3P"
(if (membership-type->invitation (membership->type (lp--entry->membership entry)))
"Inbjuden" "Adderad")
(lyskom-return-date-and-time
(membership->created-at (lp--entry->membership entry)))
(if (null conf-stat)
(lyskom-format 'person-does-not-exist
(membership->created-by (lp--entry->membership entry)))
))))
conf-stat))))))
(defun lp--print-entry (entry)
......@@ -385,6 +412,10 @@ entry priority"
result))
(defun lp--get-last-entry ()
"Return the last entry in the list."
(lp--get-entry (1- (length (lp--all-entries)))))
(defun lp--get-entry (pos)
"Return the entry at position POS in the list."
(elt lp--entry-list pos))
......@@ -945,21 +976,39 @@ possible in the list."
;;; ============================================================
;; Motion commands
(defmacro lp--save-column (&rest body)
`(let ((lp--saved-column (current-column)))
,@body
(end-of-line)
(if (> (current-column) lp--saved-column)
(progn (beginning-of-line)
(forward-char lp--saved-column)))))
(defun lp--previous-entry (count)
"Move the cursor up COUNT lines.
The cursor will always move to the start of the target entry."
(interactive "p")
(let* ((entry (lp--entry-at (point)))
(pos (max 0 (- (lp--entry-position entry) count))))
(goto-char (lp--entry->start-marker (lp--get-entry pos)))))
(pos (cond ((and (null entry) (< (point) (lp--entry->start-marker (lp--get-entry 0))))
0)
((and (null entry) (> (point) (lp--entry->end-marker (lp--get-last-entry))))
(1- (length (lp--all-entries))))
(t (max 0 (- (lp--entry-position entry) count))))))
(condition-case nil
(goto-char (lp--entry->start-marker (lp--get-entry pos)))
(error nil))))
(defun lp--next-entry (count)
"Move the cursor down COUNT lines.
The cursor will always move to the start of the target entry."
(interactive "p")
(let* ((entry (lp--entry-at (point)))
(pos (min (1- (length (lp--all-entries)))
(+ (lp--entry-position entry) count))))
(pos (cond ((and (null entry) (< (point) (lp--entry->start-marker (lp--get-entry 0))))
0)
((and (null entry) (> (point) (lp--entry->end-marker (lp--get-last-entry))))
(1- (length (lp--all-entries))))
(t (min (1- (length (lp--all-entries)))
(+ (lp--entry-position entry) count))))))
(condition-case nil
(goto-char (lp--entry->start-marker (lp--get-entry pos)))
(error nil))))
......@@ -976,7 +1025,7 @@ The cursor will always move to the start of the target entry."
(interactive)
(condition-case nil
(goto-char
(lp--entry->start-marker (lp--get-entry (1- (length (lp--all-entries))))))
(lp--entry->start-marker (lp--get-last-entry)))
(error nil)))
(defun lp--goto-priority (priority)
......@@ -1022,6 +1071,32 @@ entry with an adjacent priority."
(defun lp--scroll-advice (fn)
(let ((cur (current-column)))
(funcall fn)
(when (and (boundp 'lyskom-buffer-category)
lyskom-buffer-category 'prioritize)
(cond ((> (point) (lp--entry->end-marker (lp--get-last-entry)))
(goto-char (lp--entry->end-marker (lp--get-last-entry)))
(when (> (current-column) cur)
(beginning-of-line)
(forward-char cur)))
((< (point) (lp--entry->start-marker (lp--get-entry 0)))
(goto-char (lp--entry->start-marker (lp--get-entry 0)))
(end-of-line)
(when (> (current-column) cur)
(beginning-of-line)
(forward-char cur)))))))
(defadvice scroll-up-command (around lp--scroll-up-advice activate)
(lp--scroll-advice (lambda () ad-do-it)))
(defadvice scroll-down-command (around lp--scroll-up-advice activate)
(lp--scroll-advice (lambda () ad-do-it)))
(defvar lp--mode-map nil
......
......@@ -829,8 +829,8 @@ customize buffer but do not save them to the server."
(defun lyskom-ispell-dictionary-widget (type &optional args propl)
(let ((tmp-dictionary-alist nil))
(condition-case nil
(require 'ispell)
(setq tmp-dictionary-alist ispell-dictionary-alist)
(progn (require 'ispell)
(setq tmp-dictionary-alist ispell-dictionary-alist))
(error (if (null ispell-dictionary-alist)
(setq tmp-dictionary-alist '("american" "brasiliano"
"british" "castellano"
......
......@@ -1365,6 +1365,10 @@ Du m
(passive-mt-type . "passiv")
(secret-mt-type . "hemlig")
(Invitation-mt-type . "inbjuden")
(Passive-mt-type . "passiv")
(Secret-mt-type . "hemlig")
(not-author-try-anyway-p . "Du r inte frfattare till inlgget. Vill du frska nd? ")
(what-no-comments-no . "Vilken text vill du inte ha kommentarer till: ")
(adding-no-comments . "Begr att inte f kommentarer till inlgg %#1n...")
......@@ -2065,6 +2069,8 @@ Du m
(define-key lyskom-sv-customize-map (kbd "C-j") 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd "<RET>") 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd "<LFD>") 'widget-button-press)
(define-key lyskom-sv-customize-map (kbd (lyskom-keys 'button2)) 'kom-mouse-null)
(define-key lyskom-sv-customize-map (kbd (lyskom-keys 'button3)) 'kom-mouse-null)
(define-key lyskom-sv-customize-map (kbd (lyskom-keys 'button2up)) 'widget-button-click)
(define-key lyskom-sv-customize-map (kbd (lyskom-keys 'button3up)) 'lyskom-widget-click)
(define-key lyskom-sv-customize-map (kbd "C-c C-c") 'lyskom-customize-save-and-quit)
......
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