]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/idlw-toolbar.el
* lisp/simple.el (shell-command): Add save-match-data comment
[gnu-emacs] / lisp / progmodes / idlw-toolbar.el
index 2d143a3ddaafd578ea9b241693f0753c36064648..d857bfd88c33ea47bd537d1b73fd84186ddfc1d0 100644 (file)
@@ -1,19 +1,18 @@
 ;;; idlw-toolbar.el --- a debugging toolbar for IDLWAVE
 
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@astro.uva.nl>
 ;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
-;; Version: 6.1_em22
 ;; Keywords: processes
+;; Package: idlwave
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,9 +20,7 @@
 ;; GNU General Public License for more details.
 
 ;; 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., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -32,7 +29,7 @@
 
 ;; New versions of IDLWAVE, documentation, and more information
 ;; available from:
-;;                 http://idlwave.org
+;;                 http://github.com/jdtsmith/idlwave
 
 \f
 ;;; Code:
@@ -442,7 +439,7 @@ static char * file[] = {
 \"                            \",
 \"                            \",
 \"                            \"};")
-  "The Cont icon.")      
+  "The Cont icon.")
 
 (defvar idlwave-toolbar-to-here-icon
   (idlwave-toolbar-make-button
@@ -808,7 +805,7 @@ static char * file[] = {
      "Goto Next Error"]
     [idlwave-toolbar-stop-at-icon
      idlwave-shell-break-here
-     (eq major-mode 'idlwave-mode)
+     (derived-mode-p 'idlwave-mode)
      "Set Breakpoint at selected position"]
     [idlwave-toolbar-clear-at-icon
      idlwave-shell-clear-current-bp
@@ -820,7 +817,7 @@ static char * file[] = {
      "Clear all Breakpoints"]
     [idlwave-toolbar-stop-beginning-icon
      idlwave-shell-break-this-module
-     (eq major-mode 'idlwave-mode)
+     (derived-mode-p 'idlwave-mode)
      "Stop at beginning of enclosing Routine"]
     [idlwave-toolbar-stop-in-icon
      idlwave-shell-break-in
@@ -840,7 +837,7 @@ static char * file[] = {
      "Continue Current Program"]
     [idlwave-toolbar-to-here-icon
      idlwave-shell-to-here
-     (eq major-mode 'idlwave-mode)
+     (derived-mode-p 'idlwave-mode)
      "Continue to Here (cursor position)"]
     [idlwave-toolbar-step-over-icon
      idlwave-shell-stepover
@@ -872,7 +869,7 @@ static char * file[] = {
      "Reset IDL (RETALL & CLOSE,/ALL and more)"]
     [idlwave-toolbar-electric-debug-icon
      idlwave-shell-electric-debug-mode
-     (eq major-mode 'idlwave-mode)
+     (derived-mode-p 'idlwave-mode)
      "Toggle Electric Debug Mode"]
     ))
 
@@ -885,8 +882,7 @@ static char * file[] = {
   "Add the IDLWAVE toolbar if appropriate."
   (if (and (featurep 'xemacs)    ; This is a noop on Emacs
           (boundp 'idlwave-toolbar-is-possible)
-          (or (eq major-mode 'idlwave-mode)
-              (eq major-mode 'idlwave-shell-mode)))
+          (derived-mode-p 'idlwave-mode 'idlwave-shell-mode))
       (set-specifier default-toolbar (cons (current-buffer)
                                           idlwave-toolbar))))
 
@@ -894,8 +890,7 @@ static char * file[] = {
   "Add the IDLWAVE toolbar if appropriate."
   (if (and (featurep 'xemacs)    ; This is a noop on Emacs
           (boundp 'idlwave-toolbar-is-possible)
-          (or (eq major-mode 'idlwave-mode)
-              (eq major-mode 'idlwave-shell-mode)))
+           (derived-mode-p 'idlwave-mode 'idlwave-shell-mode))
       (remove-specifier default-toolbar (current-buffer))))
 
 (defvar idlwave-shell-mode-map)
@@ -916,21 +911,21 @@ static char * file[] = {
                    (idlwave-toolbar-add))
                  (buffer-list)))
       ;; For Emacs, add the key definitions to the mode maps
-      (mapcar (lambda (x)
-               (let* ((icon (aref x 0))
-                      (func (aref x 1))
-                      (show (aref x 2))
-                      (help (aref x 3))
-                      (key (vector 'tool-bar func))
-                      (def (list 'menu-item
-                                 "a"
-                                 func
-                                 :image (symbol-value icon)
-                                 :visible show
-                                 :help help)))
-                 (define-key idlwave-mode-map key def)
-                 (define-key idlwave-shell-mode-map key def)))
-             (reverse idlwave-toolbar)))
+      (mapc (lambda (x)
+             (let* ((icon (aref x 0))
+                    (func (aref x 1))
+                    (show (aref x 2))
+                    (help (aref x 3))
+                    (key (vector 'tool-bar func))
+                    (def (list 'menu-item
+                               ""
+                               func
+                               :image (symbol-value icon)
+                               :visible show
+                               :help help)))
+               (define-key idlwave-mode-map key def)
+               (define-key idlwave-shell-mode-map key def)))
+           (reverse idlwave-toolbar)))
     (setq idlwave-toolbar-visible t)))
 
 (defun idlwave-toolbar-remove-everywhere ()
@@ -947,15 +942,15 @@ static char * file[] = {
                    (idlwave-toolbar-remove))
                  (buffer-list)))
       ;; For Emacs, remove the key definitions from the mode maps
-      (mapcar (lambda (x)
-               (let* (;;(icon (aref x 0))
-                      (func (aref x 1))
-                      ;;(show (aref x 2))
-                      ;;(help (aref x 3))
-                      (key (vector 'tool-bar func)))
-                 (define-key idlwave-mode-map key nil)
-                 (define-key idlwave-shell-mode-map key nil)))
-             idlwave-toolbar))
+      (mapc (lambda (x)
+             (let* (;;(icon (aref x 0))
+                    (func (aref x 1))
+                    ;;(show (aref x 2))
+                    ;;(help (aref x 3))
+                    (key (vector 'tool-bar func)))
+               (define-key idlwave-mode-map key nil)
+               (define-key idlwave-shell-mode-map key nil)))
+           idlwave-toolbar))
     (setq idlwave-toolbar-visible nil)))
 
 (defun idlwave-toolbar-toggle (&optional force-on)
@@ -967,10 +962,9 @@ static char * file[] = {
   (if (featurep 'xemacs)
       nil ; no action necessary, toolbar gets updated automatically
     ;; On Emacs, redraw the frame to make sure the Toolbar is updated.
-    (redraw-frame (selected-frame))))
+    (redraw-frame)))
 
 (provide 'idlw-toolbar)
 (provide 'idlwave-toolbar)
 
-;; arch-tag: ec9a3717-c44c-4716-9bda-cdacbe5ddb62
 ;;; idlw-toolbar.el ends here