The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Padre - Perl Application Development and Refactoring Environment

SYNOPSIS

You should be able to just type in

 padre

and get the editor working.

While I am using this editor myself there are still lots of missing features so I would consider this application to be in pre-alpha state.

I do so mainly becasue everything is in a constant flux. Menus, shortcuts and the way they work will change from version to version.

You should also know that I am mostly working on Linux and I have been using vi for many years now. This means that I am not that familiar with the expectations of people using Windows.

DESCRIPTION

The application maintains its configuration information in a directory called .padre

On Strawberry Perl you can associate .pl file extension with c:\strawberry\perl\bin\wxperl and then you can start double clicking on the application. It should work.

Run This (F5) - run the current buffer (usually you want this on scripts only)

Run (CtrlF5) - will first prompt you to a command line that you have to type in such as

 perl /full/path/to/my/script.pl

then it will execute this every time you press Ctrl-F5 or the menu option.

You can edit the command line using the Run/Setup menu item.

 Ctr-B  matching brace
 Alt-N  Select Nth tab

 Ctr-1 .. Ctrl-9 can set markers
 Ctr-Shift-1 .. Ctrl-Shift-9 jump to marker

 Ctr-M Ctr-Shift-M  comment/uncomment selected lines of code

Command line options

 --index   will go over the @INC and list all the available modules in the database
 
 a list of filenames can be given to be opened

BUGS

For now any bug report, please send directly to Gabor Szabo <szabgab@gmail.com>

TODO

Send your wish list to Gabor Szabo <szabgab@gmail.com>

Editor

  Add unit tests that launch the GUI and generate events.

  Run an application from within the editor:
  Default: If the files is .pl save automatically and run it with
     the current perl.
  Any other file, don't run for now, just display a message.
  When running a script disable the Run menu and show a stop menu point.
    (try with a sleeping process)
  Make sure both STDOUT and STDERR are displayed along with all of their newlines.
  Allow for STDIN to be redirected to the external process.

  Always save full path in opened-files history.
  I think the relative pathes were saved when opening files on the
  command line.

  Fix the remaining short-cut key that don't work on Windows (F3)

  Tool for refactoring code: 
  locate and replace all occurances of a method name within a project.

  When opening a new file if there is an empty unsaved file then replace it.
  Maybe this should only work on the first such buffer?

  Run an application from within the editor:
  Simple running works but there are several options here

  - When developing a script we would like to
    run the current file (the one we currently watch) with some predefined options
    we should save these options before runs
  - When developing a larger application with several modules and a script we
    would like to run a predefined script with some predefind options
  - Both of the above should be either directly or using a debugger
  - STDERR and STDOUT should be captured - for simple command line script we might
    want to have a full command line emulation?
  - For now we can focus on GUI applications (e.g. written in Wx) where
    the important part is the STDERR and the debugger.
  - Run the unit tests assuming Makefile.PL or Build.PL


  Project Management:

  We need to assume that the current working directory of the editor can be anywhere.
  For Perl project management we will assume a directory layout similar to what we have
  in most CPAN distributions. That is

  lib/    holding the modules
  bin/    holding the executable scripts
  t/      holding the test files

  There should be a Makefile.PL or a Build.PL
  Select a project is basically select a directory.
  It will try to guess the prefered installation system Build.PL or Makefile.PL
  Then one should have all the standard steps ready in the menu
      Project Build.PL, Build, Build test, Build testcover, Build dist Build testdist

  Create a new project will create the directory and the standar files
  Select a project == select a directory assuming the files are already there
    or
  Select a project that was already selected once

    Later we can integrate with various version control system so a new project might start by 
    pointing to the repository (e.g. svn repo) and checking it out to some local place etc...

  How to keep the path of projects on a stick?
  Their path can be different in different machines.


  Debugger from within the editor

  Menu option: Save All

  TAB jump N spaces, clever TAB (real tab in the beginning, spaces after???)

  Mark the buffer that is unsaved with a star.

  Add remote editing capability via ftp and ssh.

  Define API to add more menu options and plugins

  Plugin idea:
  Based on file type (extension) have a pre-save hook that will include
  a timestamp in the saved file. E.g. our $TIMESTAMP = DDDDDDDDDD;
  where DDDDD is the result of time()
  It could be also a DD.DD.DD number that is automatically increased on every save.
  With both the main issue is that it is not working if someone 
  uses a different editor.

  When closing the application and there are still unsaved buffers provide better options:
  Show the list of the unsaved buffers and the following buttons:
    Close without saving
    Cancel  (which will stop the closing)
    Save  (save those that have filenames, provide save-as option to those that have no filenames)
    Maybe provide a window with checkboxes for each unsaved buffer so the user can select which one
    s/he wants to save and which one not.

  Mark a section and comment out all of them at the same time - or remove the # from the beginning
  of all the lines at once. This works with #, make this work with other comment characters for
  other languages.
 

Podviewer

  Enabled indexing from widthin application or run the indexer when installing
  the application?

  If a file exists but no pod in there, don't show just a white page.

  When displaying pod allow for clicking on names of other modules to be displayed.

  Indexing the words of all the pod files? (Search engine?)
  Indexing the function names only?

Learning WxWidgets

http://wxperl.sourceforge.net/tutorial/tutorial.html of Mattia Barbon

http://www.perl.com/pub/a/2001/09/12/wxtutorial1.html by Jouke Visser

Documentation of Wx::StyledTextCtrl is here: http://www.yellowbrain.com/stc/index.html

stock items in wx:

http://docs.wxwidgets.org/2.8.6/wx_stockitems.html#stockitems

http://www.perlmonks.org/?node_id=122227 by boo_radley

http://www.perlmonks.org/?node_id=112297

http://www.perlmonks.org/?node_id=152323

http://www.perlmonks.org/?node_id=153366

http://www.perlmonks.org/?node_id=184685

http://www.perlmonks.org/?node_id=194611

http://www.perlmonks.org/?node_id=199840

http://www.perlmonks.org/?node_id=164341

http://www.perlmonks.org/?node_id=287396

http://www.perlmonks.org/?node_id=290475

http://www.perlmonks.org/?node_id=219778

Code layout:

Padre is the main module that reads/writes the configuration files There is an SQLite database and a yml file to keep various pices of information The SQLite database holds the list of modules available on the system. It will also contain indexing of the documentation Looking at the entries of modules List of functions

The yml file contains individual configuration options

Padre::App is the Wx::App subclass

Padre::Frame is the main frame, most of the code is currently there.

Padre::Panel holds an editor window instance (one for each buffer)

Padre::Pod::* are there to index and show documentation written in pod.

SUPPORT

I hope the http://www.perlmonks.org/ will be ready to take upon themself supporting this application.

COPYRIGHT

(c) 2008 Gabor Szabo http://www.szabgab.com/

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.

WARRANTY

There is no warranty whatsoever. If you lose data or your hair because of this program, that's your problem.

CREDITS and THANKS

To Mattia Barbon for providing WxPerl. Part of the code was copied from his Wx::Demo application.