From 43bd6a3c9093bf91f5fcb23709fc7b3cd30d8098 Mon Sep 17 00:00:00 2001 From: ueno Date: Wed, 20 Sep 2000 21:57:33 +0000 Subject: [PATCH] Synch up with `liece-1_4_4-5'. --- lisp/ChangeLog | 15 ++++ lisp/liece-commands.el | 9 --- lisp/liece-compat.el | 5 +- lisp/liece-emacs.el | 189 ++++++++++++++++++++++-------------------------- lisp/liece-inlines.el | 6 +- lisp/liece-menu.el | 1 - lisp/liece.el | 4 +- sample.dot.emacs.in | 2 +- 8 files changed, 107 insertions(+), 124 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4f5c785..048e115 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,11 +1,26 @@ 2000-09-20 Daiki Ueno + * liece-compat.el: Require `wid-edit'. + + * liece-inlines.el (liece-locate-icon-file): Don't check existence + of the file. + + * liece-emacs.el: Don't require `static' and `wid-edit'. + (liece-splash-image): Set default to nil. + (liece-emacs-splash-function): New variable. + (liece-emacs-splash-with-image): New function splitted from + `liece-emacs-splash'; use `image-size'; hide cursor. + (liece-emacs-splash-with-stipple): New function. + +2000-09-20 Daiki Ueno + * liece-commands.el (liece-command-toggle-away): Rename from `liece-command-away'. (liece-command-toggle-freeze): Rename from `liece-command-freeze'. (liece-command-toggle-own-freeze): Rename from `liece-command-own-freeze'. (liece-command-toggle-beep): Rename from `liece-command-beep'. + (liece-command-load-vars): Abolish. * liece.el (liece-dialogue-beep): Abolish. (liece-dialogue-freeze): Abolish. diff --git a/lisp/liece-commands.el b/lisp/liece-commands.el index c491216..a8e120e 100644 --- a/lisp/liece-commands.el +++ b/lisp/liece-commands.el @@ -839,15 +839,6 @@ Prefix argument ARG is regarded as distance from yank pointer." all (all-completions candidate alist)) (liece-minibuffer-finalize-completion completion candidate all))) -(defun liece-command-load-vars () - "Load configuration from liece-variables-file." - (interactive) - (let ((nick liece-real-nickname)) - (unwind-protect - (liece-read-variables-files) - (setq liece-real-nickname nick) - (liece-command-reconfigure-windows)))) - (defun liece-command-save-vars () "Save current settings to `liece-variables-file'." (interactive) diff --git a/lisp/liece-compat.el b/lisp/liece-compat.el index 96afb99..3a01cf0 100644 --- a/lisp/liece-compat.el +++ b/lisp/liece-compat.el @@ -32,10 +32,7 @@ (eval-when-compile (require 'cl)) (require 'pcustom) - -(eval-when-compile (require 'wid-edit)) - -(eval-and-compile (autoload 'widget-convert-button "wid-edit")) +(require 'wid-edit) (defalias 'liece-widget-convert-button 'widget-convert-button) (defalias 'liece-widget-button-click 'widget-button-click) diff --git a/lisp/liece-emacs.el b/lisp/liece-emacs.el index dbd82a1..92b2c9d 100644 --- a/lisp/liece-emacs.el +++ b/lisp/liece-emacs.el @@ -29,7 +29,6 @@ ;;; Code: (eval-when-compile - (require 'static) (require 'liece-compat) (require 'liece-vars)) @@ -46,7 +45,6 @@ (defvar liece-widget-keymap nil) (unless liece-widget-keymap - (require 'wid-edit) (setq liece-widget-keymap (copy-keymap widget-keymap)) (substitute-key-definition 'widget-button-click 'liece-widget-button-click @@ -90,117 +88,96 @@ ;;; @ startup splash ;;; -(defconst liece-splash-image +(defvar liece-splash-image (eval-when-compile - (cond - ((and (fboundp 'image-type-available-p) - (image-type-available-p 'xpm)) - (let ((file (expand-file-name "liece.xpm" default-directory))) - (if (file-exists-p file) - (list 'image - :type 'xpm - :data (with-temp-buffer - (insert-file-contents-as-binary file) - (buffer-string)))))) - ((fboundp 'set-face-stipple) - (let ((file (expand-file-name "liece.xbm" default-directory))) - (if (file-exists-p file) - (bitmap-stipple-xbm-file-to-stipple file))))))) + (let ((file (expand-file-name "liece.xpm" default-directory))) + (if (file-exists-p file) + (with-temp-buffer + (insert-file-contents-as-binary file) + (buffer-string)))))) + +(defun liece-emacs-splash-with-image () + (or (eq (car-safe liece-splash-image) 'image) + (setq liece-splash-image + (create-image liece-splash-image 'xpm 'data))) + (setq cursor-type nil) + (when liece-splash-image + (let ((image-size (image-size liece-splash-image))) + (insert (make-string (max 0 (/ (- (window-height) + (floor (cdr image-size))) + 2)) + ?\n)) + (make-string (max 0 (/ (- (window-width) + (floor (car image-size))) + 2)) + ?\ ) + (insert-image liece-splash-image)))) + +(defun liece-emacs-splash-with-stipple () + (bitmap-stipple-insert-pixmap + (eval-when-compile + (let ((file (expand-file-name "liece.xbm" default-directory))) + (if (file-exists-p file) + (bitmap-stipple-xbm-file-to-stipple file)))) + 'center)) + +(defvar liece-splash-buffer nil) + +(defvar liece-emacs-splash-function nil) (defun liece-emacs-splash (&optional arg) (interactive "P") - (let* ((font (cdr (assq 'font (frame-parameters)))) - (liece-insert-environment-version nil) - config buffer pixel-width pixel-height) - (unwind-protect - (progn - (setq config (current-window-configuration)) - (save-excursion - (setq buffer (generate-new-buffer - (concat (if arg "*" " *") - (liece-version) "*"))) - (switch-to-buffer buffer) - (erase-buffer) - (static-cond - ((and (fboundp 'image-type-available-p) - (image-type-available-p 'xpm)) - (with-temp-buffer - (insert (plist-get (cdr liece-splash-image) :data)) - (goto-char (point-min)) - (skip-syntax-forward "^\"") - (when (looking-at "\"[ \t]*\\([0-9]+\\)[ \t]*\\([0-9]+\\)") - (setq pixel-width (string-to-int (match-string 1)) - pixel-height (string-to-int (match-string 2))))) - (insert (make-string (max 0 (/ (- (frame-height) - (/ pixel-height - (frame-char-height))) - 2)) - ?\n) - (make-string (max 0 (/ (- (frame-width) - (/ pixel-width - (frame-char-width))) - 2)) - ?\ )) - (static-if (condition-case nil - (progn (insert-image '(image)) nil) - (wrong-number-of-arguments t)) - (insert-image liece-splash-image "x") - (insert-image liece-splash-image)) - (insert "\n")) - (t - (bitmap-stipple-insert-pixmap liece-splash-image 'center))) - (insert "\n") - (insert-char ?\ (max 0 (/ (- (window-width) - (length (liece-version))) - 2))) - (put-text-property (point) (prog2 (insert (liece-version))(point) - (insert "\n")) - 'face 'underline)) - (or arg (sit-for 2))) - (unless arg - (kill-buffer buffer) - (set-window-configuration config))))) + (unless (and liece-splash-buffer (buffer-live-p liece-splash-buffer)) + (let ((liece-insert-environment-version nil)) + (save-excursion + (setq liece-splash-buffer (generate-new-buffer + (concat (if arg "*" " *") + (liece-version) "*"))) + (push liece-splash-buffer liece-buffer-list) + (set-buffer liece-splash-buffer) + (erase-buffer) + (funcall liece-emacs-splash-function) + (insert-char ?\ (max 0 (/ (- (window-width) + (length (liece-version))) + 2))) + (put-text-property (point) (prog2 (insert (liece-version))(point) + (insert "\n")) + 'face 'underline)))) + (if arg + (switch-to-buffer liece-splash-buffer) + (save-window-excursion + (switch-to-buffer liece-splash-buffer) + (sit-for 2)))) ;;; @ modeline decoration ;;; -(defconst liece-mode-line-image nil) +(defvar liece-mode-line-image nil) (defun liece-emacs-create-mode-line-image () - (static-when (fboundp 'image-type-available-p) - (let ((file (liece-locate-icon-file - (static-cond - ((image-type-available-p 'xpm) - "liece-pointer.xpm") - ((image-type-available-p 'xbm) - "liece-pointer.xbm"))))) - (and file (file-exists-p file) - (create-image file nil nil :ascent 99))))) + (let ((file (liece-locate-icon-file "liece-pointer.xpm"))) + (if (file-exists-p file) + (create-image file nil nil :ascent 99)))) (defun liece-emacs-mode-line-buffer-identification (line) (let ((id (copy-sequence (car line))) image) - (if (and (stringp id) (string-match "^Liece:" id) - (setq liece-mode-line-image - (liece-emacs-create-mode-line-image))) - (progn - (add-text-properties 0 (length id) - (list 'display - liece-mode-line-image - 'rear-nonsticky (list 'display)) - id) - (setcar line id))) - line)) - -(fset 'liece-mode-line-buffer-identification - 'liece-emacs-mode-line-buffer-identification) + (or liece-mode-line-image + (setq liece-mode-line-image (liece-emacs-create-mode-line-image))) + (when (and liece-mode-line-image + (stringp id) (string-match "^Liece:" id)) + (add-text-properties 0 (length id) + (list 'display + liece-mode-line-image + 'rear-nonsticky (list 'display)) + id) + (setcar line id)) + line)) ;;; @ nick buffer decoration ;;; (defun liece-emacs-create-nick-image (file) - (static-when (and (fboundp 'image-type-available-p) - (image-type-available-p 'xpm)) - (let ((file (liece-locate-icon-file file))) - (and file (file-exists-p file) - (create-image file nil nil :ascent 99))))) + (let ((file (liece-locate-icon-file file))) + (if (file-exists-p file) + (create-image file nil nil :ascent 99)))) (defun liece-emacs-nick-image-region (start end) (save-excursion @@ -260,11 +237,19 @@ (dolist (chnl liece-channel-unread-list) (liece-emacs-unread-mark chnl)))) -(add-hook 'liece-nick-insert-hook 'liece-emacs-nick-image-region) -(add-hook 'liece-nick-replace-hook 'liece-emacs-nick-image-region) - -(when (and (not liece-inhibit-startup-message) - liece-splash-image window-system) +(if (and (fboundp 'image-type-available-p) + (and (display-color-p) + (image-type-available-p 'xpm))) + (progn + (fset 'liece-mode-line-buffer-identification + 'liece-emacs-mode-line-buffer-identification) + (setq liece-emacs-splash-function #'liece-emacs-splash-with-image) + (add-hook 'liece-nick-insert-hook 'liece-emacs-nick-image-region) + (add-hook 'liece-nick-replace-hook 'liece-emacs-nick-image-region)) + (fset 'liece-mode-line-buffer-identification 'identity) + (setq liece-emacs-splash-function #'liece-emacs-splash-with-stipple)) + +(when (and (not liece-inhibit-startup-message) window-system) (liece-emacs-splash)) (fset 'liece-redisplay-unread-mark 'liece-emacs-redisplay-unread-mark) diff --git a/lisp/liece-inlines.el b/lisp/liece-inlines.el index c73a7f4..e8a283e 100644 --- a/lisp/liece-inlines.el +++ b/lisp/liece-inlines.el @@ -170,11 +170,9 @@ (concat dir subdir))))) (defun liece-locate-icon-file (filename) - (if (null liece-icon-directory) + (or liece-icon-directory (setq liece-icon-directory (liece-locate-path "icons"))) - (setq filename (expand-file-name filename liece-icon-directory)) - (if (and filename (file-exists-p filename)) - filename)) + (expand-file-name filename liece-icon-directory)) (defmacro liece-next-line (arg) `(let ((i 0)) diff --git a/lisp/liece-menu.el b/lisp/liece-menu.el index a46969e..7608f0f 100644 --- a/lisp/liece-menu.el +++ b/lisp/liece-menu.el @@ -159,7 +159,6 @@ (defvar liece-menu-IRC-menu '("IRC" - ["Load variables file" liece-command-load-vars t] ["Save variables file" liece-command-save-vars t] "----" ["Change window style" liece-command-set-window-style t] diff --git a/lisp/liece.el b/lisp/liece.el index 6c215a5..d8a5244 100644 --- a/lisp/liece.el +++ b/lisp/liece.el @@ -204,7 +204,7 @@ If optional argument SAFE is nil, overwrite previous definitions." "<" beginning-of-buffer "|" liece-command-show-last-kill "\C-ta" liece-command-toggle-away - "b" liece-command-submit-bug-report + "\C-b" liece-command-submit-bug-report "\C-tb" liece-command-toggle-beep "c" liece-command-point-back-to-command-buffer "f" liece-command-finger @@ -215,7 +215,6 @@ If optional argument SAFE is nil, overwrite previous definitions." "k" liece-command-kill "\C-k" liece-command-kick "l" liece-command-list - "L" liece-command-load-vars "S" liece-command-save-vars "m" liece-dialogue-enter-message "M" liece-command-modec @@ -277,7 +276,6 @@ If optional argument SAFE is nil, overwrite previous definitions." "\C-n" liece-command-names "\C-u" liece-command-unread-channel "l" liece-command-list - "L" liece-command-load-vars "\C-m" liece-command-modec "o" liece-command-set-operators "O" liece-command-toggle-nick-buffer-mode diff --git a/sample.dot.emacs.in b/sample.dot.emacs.in index 991cc7e..817453d 100644 --- a/sample.dot.emacs.in +++ b/sample.dot.emacs.in @@ -2,4 +2,4 @@ (setq liece-intl-catalogue-directory "@pkgdatadir@/po" liece-window-style-directory "@pkgdatadir@/styles" - liece-window-style-directory "@pkgdatadir@/icons") + liece-icon-directory "@pkgdatadir@/icons") -- 1.7.10.4