changeset 42554:bbfc062c0b51

(eudc-bob-can-display-inline-images) (eudc-bob-display-jpeg): Use fboundp instead of boundp. (eudc-bob-save-object): Make the buffer unibyte. (eudc-bob-generic-keymap): Add new keybinding `!' to pipe the object to external program.
author Pavel Janík <Pavel@Janik.cz>
date Sat, 05 Jan 2002 18:51:35 +0000
parents e34193f03ff3
children 83ab475df3fd
files lisp/net/eudc-bob.el
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/eudc-bob.el	Sat Jan 05 18:51:11 2002 +0000
+++ b/lisp/net/eudc-bob.el	Sat Jan 05 18:51:35 2002 +0000
@@ -1,6 +1,6 @@
 ;;; eudc-bob.el --- Binary Objects Support for EUDC
 
-;; Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@xemacs.org>
 ;; Maintainer: Oscar Figueiredo <oscar@xemacs.org>
@@ -89,7 +89,7 @@
   (if eudc-xemacs-p
       (and (memq (console-type) '(x mswindows))
 	   (fboundp 'make-glyph))
-    (and (boundp 'display-graphic-p)
+    (and (fboundp 'display-graphic-p)
 	 (display-graphic-p))))
 
 (defun eudc-bob-make-button (label keymap &optional menu plist)
@@ -131,7 +131,7 @@
 				       'start-open t
 				       'end-open t
 				       'object-data data))))
-	((boundp 'create-image)
+	((fboundp 'create-image)
 	 (let* ((image (create-image data nil t))
 		(props (list 'object-data data 'eudc-image image)))
 	   (when (and inline (image-type-available-p 'jpeg))
@@ -222,7 +222,6 @@
 	     (unless (fboundp 'play-sound)
 	       (error "Playing sounds not supported on this system"))
 	     (play-sound (list 'sound :data sound)))))))
-  
 
 (defun eudc-bob-play-sound-at-mouse (event)
   "Play the sound data contained in the button where EVENT occurred."
@@ -230,7 +229,7 @@
   (save-excursion
     (eudc-jump-to-event event)
     (eudc-bob-play-sound-at-point)))
-  
+
 
 (defun eudc-bob-save-object ()
   "Save the object data of the button at point."
@@ -241,6 +240,7 @@
       (if (fboundp 'set-buffer-file-coding-system)
 	  (set-buffer-file-coding-system 'binary))
       (set-buffer buffer)
+      (set-buffer-multibyte nil)
       (insert data)
       (save-buffer))
     (kill-buffer buffer)))
@@ -291,6 +291,7 @@
 (setq eudc-bob-generic-keymap
       (let ((map (make-sparse-keymap)))
 	(define-key map "s" 'eudc-bob-save-object)
+	(define-key map "!" 'eudc-bob-pipe-object-to-external-program)
 	(define-key map (if eudc-xemacs-p
 			    [button3]
 			  [down-mouse-3]) 'eudc-bob-popup-menu)