Source

ecb / ecb-examples.el

Diff from to

ecb-examples.el

-;;; ecb-examples.el --- examples for using ECB with elisp
+;;; ecb-examples.el --- examples for using ECB with Elisp
 
-;; Copyright (C) 2002 Jesper Nordenberg
-;; Copyright (C) 2002 Free Software Foundation, Inc.
-;; Copyright (C) 2002 Klaus Berndl <klaus.berndl@sdm.de>
+;; Copyright (C) 2000 - 2003 Jesper Nordenberg,
+;;                           Klaus Berndl,
+;;                           Kevin A. Burton,
+;;                           Free Software Foundation, Inc.
 
-;; Author: Klaus Berndl <klaus.berndl@sdm.de>
+;; Author: Jesper Nordenberg <mayhem@home.se>
+;;         Klaus Berndl <klaus.berndl@sdm.de>
+;;         Kevin A. Burton <burton@openprivacy.org>
 ;; Maintainer: Klaus Berndl <klaus.berndl@sdm.de>
-;; Keywords: java, class, browser
+;;             Kevin A. Burton <burton@openprivacy.org>
+;; Keywords: browser, code, programming, tools
+;; Created: 2002
 
-;; This program 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 2, or (at your option) any later
-;; version.
+;; This program 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 2, or (at your option) any later version.
 
 ;; This program is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-;; more details.
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+;; FOR A PARTICULAR PURPOSE.  See the 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
+;; 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.
 
+;; $Id$
+
 ;;; Commentary:
 ;;
 ;; Contains the code for some examples mentioned in the online-help.
 ;; This is a full working layout-example to demonstrate how to program
-;; complete new special windows/buffers, add them to a layout and syncronize
+;; complete new special windows/buffers, add them to a layout and synchronize
 ;; it with the edit-window of ECB.
 ;;
 ;; To test this example just do:
 ;; history of the ECB-package see the file NEWS.
 
 
-;; $Id$
-
 ;;; Code
 
 ;; ---------------------------------------------------------------------------
 
 ;; The main synchronizing function which is added to
 ;; `ecb-current-buffer-sync-hook' for autom. evaluation by
-;; `ecb-current-buffer-sync' which runs dependend on the values of
+;; `ecb-current-buffer-sync' which runs dependent on the values of
 ;; `ecb-window-sync' and `ecb-window-sync-delay'.
 
 (defun ecb-examples-bufferinfo-sync ()
-  "Synchronizes the buffer `ecb-examples-bufferinfo-buffer-name' with current
-buffer of the edit-window if that buffer has changed.
+  "Synchronizes the buffer-info buffer with current source if changed.
 Can be called interactively but normally this should not be necessary because
 it will be called autom. with `ecb-current-buffer-sync-hook'."
   (interactive)
 
 
 
-;; Two helper functions for creating a readonly buffer with a special local
-;; keymap.
+;; Two helper functions for creating a read-only buffer with a special local
+;; key-map.
 
 (defun ecb-examples-insert-text-in-action-buffer (text)
   "Insert TEXT at point and make it highlight-able for mouse-movement over the
       (let ((nop (function (lambda() (interactive)))))
         (set-buffer (get-buffer-create ecb-examples-action-buffer-name))
 
-        ;; we setup a local keymap
+        ;; we setup a local key-map
         
         (make-local-variable 'ecb-examples-action-buffer-keymap)
         (setq ecb-examples-action-buffer-keymap (make-sparse-keymap))
         
         (use-local-map ecb-examples-action-buffer-keymap)
 
-        ;; insert the action buttons [prior] und [next] and make it read-only
+        ;; insert the action buttons [prior] and [next] and make it read-only
 
         (ecb-with-readonly-buffer (current-buffer)
          (erase-buffer)
 ;; The function which performs the actions in the action-buffer
 
 (defun ecb-examples-action-buffer-clicked (e)
-  "Perform the right action for the mouse-click. If the user clicks onto
-\[prior] the buffer in the edit-window is scrolled up, if clickes onto \[next]
-the buffer in the edit-window is scrolled down. Otherwise nothing will be
-done."
+  "Perform the right action for the mouse-click.
+If the user clicks onto \[prior] the buffer in the edit-window is scrolled up,
+if clicks onto \[next] the buffer in the edit-window is scrolled down.
+Otherwise nothing will be done."
   (interactive "e")
   (mouse-set-point e)
   (let ((line (buffer-substring (ecb-line-beginning-pos) (ecb-line-end-pos))))
       (switch-to-buffer (buffer-name (ecb-examples-action-buffer-create))))))
 
 ;; ---------------------------------------------------------------------------
-;; --- The layout definiton with a bufferinfo- and a action-buffer -----------
+;; --- The layout definition with a bufferinfo- and a action-buffer -----------
 ;; ---------------------------------------------------------------------------
 
 
 ;; of 0.2 instead of 6 hard lines, just try it!
 
 (defun ecb-examples-activate ()
-  "Activate the new layout \"example-layout1\". Add
-`ecb-examples-bufferinfo-sync' to `ecb-current-buffer-sync-hook', set
+  "Activate the new layout \"example-layout1\".
+Add `ecb-examples-bufferinfo-sync' to `ecb-current-buffer-sync-hook', set
 `ecb-compile-window-height' to 5 and `ecb-windows-height' to 6. The
-preactivation-state is saved and will be restored by `ecb-examples-deactivate'."
+preactivation-state is saved and will be restored by
+`ecb-examples-deactivate'."
   (interactive)
 
   (assert (featurep 'ecb) nil
 ;; Deactivation of the example
 
 (defun ecb-examples-deactivate ()
-  "Deactivate the new layout \"example-layout1\". Remove
-`ecb-examples-bufferinfo-sync' from `ecb-current-buffer-sync-hook' and restore
-the state as before activation."
+  "Deactivate the new layout \"example-layout1\".
+Remove `ecb-examples-bufferinfo-sync' from `ecb-current-buffer-sync-hook' and
+restore the state as before activation."
   (interactive)
 
   (assert (featurep 'ecb) nil
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.