diff lisp/hyperbole/hypb.el @ 24:4103f0995bd7 r19-15b95

Import from CVS: tag r19-15b95
author cvs
date Mon, 13 Aug 2007 08:51:03 +0200
parents 376386a54a3c
children 441bb1e64a06
line wrap: on
line diff
--- a/lisp/hyperbole/hypb.el	Mon Aug 13 08:50:31 2007 +0200
+++ b/lisp/hyperbole/hypb.el	Mon Aug 13 08:51:03 2007 +0200
@@ -6,15 +6,15 @@
 ;; KEYWORDS:     extensions, hypermedia
 ;;
 ;; AUTHOR:       Bob Weiner
-;; ORG:          Brown U.
+;; ORG:          InfoDock Associates
 ;;
 ;; ORIG-DATE:     6-Oct-91 at 03:42:38
-;; LAST-MOD:     30-Oct-95 at 21:23:19 by Bob Weiner
+;; LAST-MOD:     19-Feb-97 at 12:18:08 by Bob Weiner
 ;;
 ;; This file is part of Hyperbole.
 ;; Available for use and distribution under the same terms as GNU Emacs.
 ;;
-;; Copyright (C) 1991-1995, Free Software Foundation, Inc.
+;; Copyright (C) 1991-1995, 1997  Free Software Foundation, Inc.
 ;; Developed with support from Motorola Inc.
 ;;
 ;; DESCRIPTION:  
@@ -82,7 +82,7 @@
     (concat "{"
 	    (if (string= keys "")
 		(concat (funcall get-keys 'execute-extended-command nil)
-			" " (symbol-name cmd-sym) " RTN")
+			" " (symbol-name cmd-sym) " RET")
 	      keys)
 	    "}"))
   (error "(hypb:cmd-key-string): Invalid cmd-sym arg: %s." cmd-sym)))
@@ -425,7 +425,7 @@
   )
 
 (defun hypb:replace-match-string (regexp str newtext &optional literal)
-  "Replaces all matches for REGEXP in STR with NEWTEXT string.
+  "Replaces all matches for REGEXP in STR with NEWTEXT string and returns the result.
 Optional LITERAL non-nil means do a literal replacement.
 Otherwise treat \\ in NEWTEXT string as special:
   \\& means substitute original matched text,
@@ -535,6 +535,53 @@
       (and (fboundp 'byte-code-function-p) (byte-code-function-p obj))))
 
 ;;; ************************************************************************
+;;; About Hyperbole Setup
+;;; ************************************************************************
+
+;;;###autoload
+(defun hypb:display-file-with-logo (&optional file)
+  "Display an optional text FILE with the InfoDock Associates logo prepended.
+Without file, logo is prepended to the current buffer."
+  ;; 
+  (if file
+      ;; This function is defined in hversion.el when needed.
+      (id-browse-file file))
+  (if (next-extent (current-buffer))
+      ;; Images have already been inserted, don't do it again.
+      nil
+    (let* ((ida-logo (make-glyph (expand-file-name "ida-logo.xpm" data-directory)))
+	   (buffer-read-only)
+	   extent)
+      (goto-char (point-min))
+      (indent-to (startup-center-spaces ida-logo))
+      (insert "\n\n")
+      (setq extent (make-extent (- (point) 3) (- (point) 2)))
+      (set-extent-end-glyph extent ida-logo)
+      (set-extent-property extent 'help-echo "Visit InfoDock Associates")
+      (set-extent-property extent 'keymap hypb:ida-logo-keymap))
+    (goto-char (point-min))
+    (skip-syntax-forward "-")
+    (set-window-start (selected-window) 1)
+    (set-buffer-modified-p nil)))
+
+(defvar hypb:ida-logo-keymap
+  (let ((map (make-sparse-keymap)))
+    (define-key map 'button1  'hypb:ida-home-page)
+    (define-key map 'button2  'hypb:ida-home-page)
+    (define-key map '(return) 'hypb:ida-home-page)
+    map)
+  "Keymap used when on the InfoDock Associates logo glyph.")
+
+(defun hypb:ida-home-page ()
+  "Visit InfoDock Associates home web page."
+  (interactive)
+  (funcall
+   (if (boundp 'highlight-headers-follow-url-function)
+       highlight-headers-follow-url-function
+     'w3-fetch)
+   "http://www.infodock.com/"))
+
+;;; ************************************************************************
 ;;; Private functions
 ;;; ************************************************************************