From xemacs-m  Thu Jan 30 09:58:21 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
          by xemacs.org (8.8.4/8.8.4) with ESMTP
	  id JAA12352 for <xemacs-beta@xemacs.org>; Thu, 30 Jan 1997 09:58:13 -0600 (CST)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id QAA06451; Thu, 30 Jan 1997 16:58:06 +0100 (MET)
Sender: hniksic@public.srce.hr
To: xemacs-beta@xemacs.org
Subject: toolbar functions
X-URL: ftp://gnjilux.cc.fer.hr/pub/unix/util/wget/
X-Attribution: Hrv
X-Face: &}4JQk=L;e.~x+|eo]#DGk@x3~ed!.~lZ}YQcYb7f[WL9L'Z*+OyA\nAEL1M(".[qvI#a2E
 6WYI5>>e7'@_)3Ol9p|Nn2wNa/;~06jL*B%tTcn/XvhAu7qeES0\|MF%$;sI#yn1+y"
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 30 Jan 1997 16:58:04 +0100
Message-ID: <kigbua788ab.fsf@jagor.srce.hr>
Lines: 104

People often want to redefine the way the *default* toolbar behaves.
Since this is lisp, I think redefining the toolbar-* functions is a
good way to do it.  This is why I provide a patch to change all the
functions in the default toolbar to toolbar-something,
e.g. `toolbar-open', `toolbar-save', `toolbar-dired', etc.

Here is the patch to x11-toolbar.el; it's against 20.0-beta91, but it
should work on any 20.0 and 19.15 too.

*** x-toolbar.el.old    Thu Jan 30 16:43:14 1997
--- x-toolbar.el        Thu Jan 30 16:50:04 1997
***************
*** 21,26 ****
--- 21,67 ----
  ;; Boston, MA 02111-1307, USA.
  
  ;;
+ ;; Miscellaneous toolbar functions, useful for users to redefine, in
+ ;; order to get different behaviour.
+ ;;
+ 
+ (defun toolbar-open ()
+   (interactive)
+   (call-interactively 'find-file))
+ 
+ (defun toolbar-dired ()
+   (interactive)
+   (call-interactively 'dired))
+ 
+ (defun toolbar-save ()
+   (interactive)
+   (call-interactively 'save-buffer))
+ 
+ (defun toolbar-print ()
+   (interactive)
+   (call-interactively 'lpr-buffer))
+ 
+ (defun toolbar-cut ()
+   (interactive)
+   (call-interactively 'x-kill-primary-selection))
+ 
+ (defun toolbar-copy ()
+   (interactive)
+   (call-interactively 'x-copy-primary-selection))
+ 
+ (defun toolbar-paste ()
+   (interactive)
+   (call-interactively 'x-yank-clipboard-selection))
+ 
+ (defun toolbar-undo ()
+   (interactive)
+   (call-interactively 'undo))
+ 
+ (defun toolbar-replace ()
+   (interactive)
+   (call-interactively 'query-replace))
+ 
+ ;;
  ;; toolbar ispell variables and defuns
  ;;
  
***************
*** 221,237 ****
      ;;        'window-config-unpop-stack) t "Undo \"Most recent window config\""]
      ;; #### Illicit knowledge?
      
!     [toolbar-file-icon                find-file       t       "Open a file"  ]
!     [toolbar-folder-icon      dired           t       "View directory"]
!     [toolbar-disk-icon                save-buffer     t       "Save buffer"  ]
!     [toolbar-printer-icon     lpr-buffer      t       "Print buffer"  ]
!     [toolbar-cut-icon         x-kill-primary-selection t "Kill region"]
!     [toolbar-copy-icon                x-copy-primary-selection t "Copy region"]
!     [toolbar-paste-icon               x-yank-clipboard-selection t
!                               "Paste from clipboard"]
!     [toolbar-undo-icon                undo            t       "Undo edit"    ]
      [toolbar-spell-icon               toolbar-ispell  t       "Spellcheck"   ]
!     [toolbar-replace-icon     query-replace   t       "Replace text"  ]
      [toolbar-mail-icon                toolbar-mail    t       "Mail"         ]
      [toolbar-info-icon                toolbar-info    t       "Information"  ]
      [toolbar-compile-icon     toolbar-compile t       "Compile"       ]
--- 262,277 ----
      ;;        'window-config-unpop-stack) t "Undo \"Most recent window config\""]
      ;; #### Illicit knowledge?
      
!     [toolbar-file-icon                toolbar-open    t       "Open a file"  ]
!     [toolbar-folder-icon      toolbar-dired   t       "View directory"]
!     [toolbar-disk-icon                toolbar-save    t       "Save buffer"  ]
!     [toolbar-printer-icon     toolbar-print   t       "Print buffer"  ]
!     [toolbar-cut-icon         toolbar-cut     t       "Kill region"]
!     [toolbar-copy-icon                toolbar-copy    t       "Copy region"]
!     [toolbar-paste-icon               toolbar-paste   t       "Paste from clipboard"]
!     [toolbar-undo-icon                toolbar-undo    t       "Undo edit"    ]
      [toolbar-spell-icon               toolbar-ispell  t       "Spellcheck"   ]
!     [toolbar-replace-icon     toolbar-replace t       "Replace text"  ]
      [toolbar-mail-icon                toolbar-mail    t       "Mail"         ]
      [toolbar-info-icon                toolbar-info    t       "Information"  ]
      [toolbar-compile-icon     toolbar-compile t       "Compile"       ]


-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Contrary to popular belief, Unix is user friendly.  
It just happens to be selective about who it makes friends with.

