Don't use old-style backquote in doc/ptexinfmt.el.
[riece] / lisp / riece-mini.el
index 3d714d8..da62089 100644 (file)
@@ -18,8 +18,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -58,8 +58,6 @@
 (defvar riece-mini-backlog-history nil)
 (defvar riece-mini-backlog-shown nil)
 
-(defvar riece-mini-enabled nil)
-
 (defconst riece-mini-description
   "Use Riece only on the minibuffer.")
 
@@ -84,7 +82,7 @@
            (cdr riece-mini-backlog-history)))
     (setq riece-mini-backlog-history
          (reverse (cons string (reverse riece-mini-backlog-history))))
-    (when (and riece-mini-enabled
+    (when (and (get 'riece-mini 'riece-addon-enabled)
               (not (or (eq (window-buffer (selected-window))
                            (get-buffer riece-command-buffer))
                        (riece-message-own-p message)
@@ -106,7 +104,8 @@ If twice (C-u C-u), then ask the channel."
             "Channel/User: " riece-current-channels nil t))
           (arg (or riece-mini-last-channel riece-current-channel))
           (t riece-current-channel)))
-        (message (read-string (format "Message to %s: " target))))
+        (message (read-string (format "Message to %s: "
+                                      (riece-format-identity target)))))
     (unless (equal message "")
       (riece-switch-to-channel target)
       (riece-send-string
@@ -124,13 +123,13 @@ If twice (C-u C-u), then ask the channel."
     (let ((height (1+ riece-mini-backlog-size)))
       (mapc #'(lambda (string)
                (setq height (+ height
-                               (/ (length string) (window-width)))))
+                               (/ (string-width string) (window-width)))))
            riece-mini-backlog-history)
       (let ((max-mini-window-height height)
            (resize-mini-windows t))
        (setq riece-mini-backlog-shown t)
        (when (and (memq 'riece-biff riece-addons)
-                  riece-biff-enabled)
+                  (get 'riece-biff 'riece-addon-enabled))
          (riece-biff-clear))
        (riece-mini-message-no-log
         "%s" (mapconcat #'identity riece-mini-backlog-history "\n"))))))
@@ -155,12 +154,6 @@ If twice (C-u C-u), then ask the channel."
               'riece-mini-display-message-function)
   (remove-hook 'pre-command-hook 'riece-mini-pre-command))
 
-(defun riece-mini-enable ()
-  (setq riece-mini-enabled t))
-
-(defun riece-mini-disable ()
-  (setq riece-mini-enabled nil))
-
 (provide 'riece-mini)
 
 ;;; riece-mini.el ends here