AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Some patches for AP 4.7.9 I found useful

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
tmsg



Joined: 21 Aug 2012
Posts: 34
Location: UK

PostPosted: Wed Oct 03, 2012 10:44 am    Post subject: Some patches for AP 4.7.9 I found useful Reply with quote

AP is a great editor though there are a few rough edges. So I looked into changing/adding some of the things I'd like to see, mostly patches to modify AP's command line options and add some INI file options.

I hope my changes are sensible and don't break any vital bits. However, given that the AP source code is quite substantial and that I really have looked only into them for a short while, there's every possibility that I do something pretty stupid or that there are undiscovered bugs (there must be some;-)).

Here's a concise list of the changes:
    command line: wildcard filenames like "*.h" or "a??.c" are supported (a wildcard pattern terminated by a "+" triggers a recursive load, ie "AkelPad win*.h+" loads win*.h files in the current directory and all subdirectories) [1]
    command line: @FILELIST loads all files listed (one per line) in file FILELIST [2]
    command line: /LINE[:COLUMN] following a filename goes to line:column in that file
    command line: /IniName=ININAME loads ININAME.ini from the AP executable directory. Default (if this switch is not used) remains AkelPad.ini. [3]

    ini file: window positions for Find/Replace/Goto dialogs are remembered
    ini file: manual parameter "MainClassName" sets AP main window's class name [4]
    ini file: manual parameter "PluginIniPrefix" sets a prefix for plugin ini filenames [3][5]
    ini file: "%w" in StatusUserFormat shows word wrap status (either "on" or "off")


Notes:
[1] This feature requires that the script plugin is installed and that script openWildcard.js (included in zip) is installed in the scripts directory.
[2] This feature requires that the script plugin is installed and that script openFileList.js (included in zip) is installed in the scripts directory.
[3] If options are loaded from the registry, this switch/parameter has no effect (in other words, there's only one set of registry-based options). It is certainly possible to change this but as I don't use the registry, I haven't looked into this.
[4] This is useful if you use two or more ini files and AP is restricted to a single instance (see "Options/Don't open a program twice"). By assigning specific class names in the ini files, you can direct further invocations or commands to a specific instance. If you don't see the point of this feature, you probably don't need it.
[5] The PluginIniPrefix string is exactly that: a textual prefix added to the inifile name. A PluginIniPrefix value of "AkelTest-" means that, say, the Coder plugin will store its ini values in file AkelTest-Coder.ini in directory .\AkelFiles\Plugs\. On the other hand, a PluginIniPrefix value of "AkelTest\" will store ini values in file Coder.ini in subdirectory .\AkelFiles\Plugs\AkelTest\. Attention: such subdirectories must be created manually, they are not created automatically!

The zip file only contains the changed source files (based on AP 4.7.9) and the two required JS scripts. All source code changes should be marked with "// TM!!!" (if I forgot something, just drop me a note).

Hopefully some of these changes will find their way into a future version of AP.

TM
Back to top
View user's profile Send private message
Fr0sT



Joined: 24 Jul 2007
Posts: 876

PostPosted: Wed Oct 03, 2012 11:16 am    Post subject: Reply with quote

Command-line options which require 1) Certain plugin installed and 2) Certain script present? I don't think so. Moreover, you can achieve the same functionality via calling the script directly with parameters.

"manual parameter "MainClassName"" - would be better if AP detected its instances smarter, also using the path from where it had been started.

"PluginIniPrefix" - you could vote for AP profiles here
Back to top
View user's profile Send private message
tmsg



Joined: 21 Aug 2012
Posts: 34
Location: UK

PostPosted: Wed Oct 03, 2012 12:06 pm    Post subject: Reply with quote

Fr0sT wrote:
Command-line options which require 1) Certain plugin installed and 2) Certain script present? I don't think so. Moreover, you can achieve the same functionality via calling the script directly with parameters.

Well, I simply needed this functionality (and I wanted it without having to remember/type complex command lines) so I implemented it in the simplest and fastest way I could find.

If you don't need/like it, fair enough. Indeed, I'd be the first to agree that this method isn't viable for general distribution. However, it works well for me and someone else might have a use for it. That's why I've shared it. YMMV.

TM
Back to top
View user's profile Send private message
Fr0sT



Joined: 24 Jul 2007
Posts: 876

PostPosted: Wed Oct 03, 2012 1:51 pm    Post subject: Reply with quote

tmsg
of course it's up to you but you could create some helper batches launching AP with appropriate parameters. It would be much simpler than modifying sources.

>AkelWild.bat *.cpp

AkelWild.bat:
@call AkelPad /Call("Scripts::Main", 1, "openWildcard.js", "%1%")
Back to top
View user's profile Send private message
tmsg



Joined: 21 Aug 2012
Posts: 34
Location: UK

PostPosted: Wed Oct 03, 2012 2:35 pm    Post subject: Reply with quote

Fr0sT wrote:

of course it's up to you but you could create some helper batches launching AP with appropriate parameters.

I certainly tried that first, but with the different options I wanted to support (for instance multiple wildcard arguments) the batch simply grew too complicated for my liking.
Fr0sT wrote:
It would be much simpler than modifying sources.

That specific feature needed just four lines in C.

TM
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group