PSPad usage - Who uses PSPad?

Discuss features, issues, about Editors for AHK
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: PSPad usage - Who uses PSPad?

06 Apr 2015, 21:37

Thanks Lexikos for clarification.

Since Label, Hwnd, g, v and c are only prefixes of a string, I do not think that they are "keywords", are they?
In most cases they will not get a syntax highlight in most editors, I assume. Should they still be mentioned in keywords.txt?
ciao
toralf
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: PSPad usage - Who uses PSPad?

07 Apr 2015, 14:00

Dear ahk7,

I now have a GitHub account, but I'm not able to use GitHub from work. Thus I just add other findings to this post:

Code: Select all

;missing in Master files:
ObjRawSet()
OnExit()
OnClipboardChange()
ObjBindMethod()
Exception()

missing object methods:
Bind()
Call()
Delete()
InsertAt()
Length()
Pop()
Push()
RemoveAt()
toralf wrote:Dear ahk7,

I do not have a GitHub account, so I'll just post my findings here. Maybe you find the time to add/correct these in the GitHub?

Code: Select all

;different case
And               (upper A)
Or                (upper O)
SetCapsLockState  (upper L)
SetNumLockState   (upper L)

;are these real keywords?
Label             (in master files)
Repeat            (in my file, might be AutoIt)

;missing in Master files:
FloatFast
IntegerFast
WheelLeft
WheelRight
wp
hp
REG_SZ
REG_EXPAND_SZ
REG_MULTI_SZ
REG_DWORD
REG_QWORD
REG_BINARY
REG_LINK
REG_RESOURCE_LIST
REG_FULL_RESOURCE_DESCRIPTOR
REG_RESOURCE_REQUIREMENTS_LIST
REG_DWORD_BIG_ENDIAN 
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_CURRENT_USER
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
ciao
toralf
ahk7
Posts: 574
Joined: 06 Nov 2013, 16:35

Re: PSPad usage - Who uses PSPad?

07 Apr 2015, 14:19

You can sign in to GH and edit files directly in the browser - if you look at a file https://github.com/ahkscript/AutoHotkey ... ctives.txt there is a pen (edit) icon.
ahk7
Posts: 574
Joined: 06 Nov 2013, 16:35

Re: PSPad usage - Who uses PSPad?

07 Apr 2015, 14:22

The reason I haven't added some these as some should already be there (onexit in commands.txt) as it is now also a function I'm not sure to "double" it as a function as well?

For the new Object "commands" - I'm not sure where to add these either - possibly under "; objects/classes" in https://github.com/ahkscript/AutoHotkey ... ctions.txt
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: PSPad usage - Who uses PSPad?

07 Apr 2015, 16:27

Thanks I will look into editing them directly.

As for the object methods, meta functions and properties. I'm also not sure where to put them. But I guess it would be best to put them in a new file. e.g. ObjectMethods.txt
ciao
toralf
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: PSPad usage - Who uses PSPad?

08 Apr 2015, 03:04

toralf wrote:Since Label, Hwnd, g, v and c are only prefixes of a string, I do not think that they are "keywords", are they?
Define "keywords". I would rather not highlight any "keywords" of commands like Gui, since it's very likely that the editor doesn't understand the proper context where they are meaningful, and some are often used as variable names. Keywords that are fairly unique, like ahk_class, could be exceptions. I certainly wouldn't consider "g", "v" and "c" to be keywords, and would only want them to be highlighted if they were restricted to the GUI command (and supported suffixes).

Some highlighters allow "prefix" keywords, so Label and LabelSomething could both be highlighted. I don't know about PSPad.

Options without a suffix are often valid; for instance, +g and -g both remove the g-label. -Label doesn't do anything.

If you use the keyword lists for auto-complete, as I do, it's useful to have words like Label even if they're always used with a suffix.
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: PSPad usage - Who uses PSPad?

08 Apr 2015, 04:36

Thank you for your input.

May I ask what software you use for auto-complete?

I agree with you about Label and Hwnd being in auto-complete list but not highlight list.

PSPad doesn't understand context, thus the chances of false positives in regards to highlight are large.

Regardless, I personally like to have all the words that AHK uses for something to be highlighted because it allows me to quickly see spelling mistakes. I can live with the false positives pretty well. That might be the case because I try to use unique var names so that the false positives nearly only show up in unquoted text, e.g. Control text or continuation sections.

And at the end if someone doesn't like a certain word to be highlighted he can simply remove the few from the highlight list. Much easier then adding missing once.
ciao
toralf
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: PSPad usage - Who uses PSPad?

08 Apr 2015, 23:26

Hmmm, thanks, but sadly it's 'only' a lua script. Don't know if I could translate it into AHK, because it seems to need deep connection into the editor, e.g. to detect the syntax highlighting.
ciao
toralf
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: PSPad usage - Who uses PSPad?

10 Apr 2015, 21:32

Dear ahk7 and Lexikos

In the Github repository I found a list of functions that are not documented in the AHK.chm file:

Code: Select all

_AddRef()
_Clone()
_GetAddress()
_GetCapacity()
_HasKey()
_Insert()
_MaxIndex()
_MinIndex()
_Release()
_Remove()
_SetCapacity()
are these deprecated?
ciao
toralf
ahk7
Posts: 574
Joined: 06 Nov 2013, 16:35

Re: PSPad usage - Who uses PSPad?

11 Apr 2015, 01:23

I don't recall exactly how I got these. Searching my files I did find an older ahk.api (from s4ahk) where these are listed as _HasKey (key) \n[AutoHotkey_L] but I don't know for sure if that they are there as an error from my part .HasKey() is valid of course _HasKey() isn't afaik. So I could have made a mistake somewhere while preparing these files by inadvertently replacing . with _
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: PSPad usage - Who uses PSPad?

11 Apr 2015, 18:38

Yes, they're deprecated. All of the methods originally had an underscore so that they were accessible if the user defined their own methods with those names (without underscore). Then the ObjMethodName functions were added and the underscore was made optional.

The latest additions - InsertAt, Push, Delete, RemoveAt, Pop and Length - do not support the underscore prefix. It should not be used in new scripts for the other methods either (except for _NewEnum).
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: PSPad usage - Who uses PSPad?

11 Apr 2015, 21:48

Based on combination of several sources and cross checking with the latest help file, I updated my PSPad files, see attached zip file.
It contains two files in the subfolders, please extract them with their folder into your PSPad installation directory %PSPad Path%\Context\Autohotkey.DEF and %PSPad Path%\Syntax\Autohotkey.INI.

My PSPad.INI has a section for AutoHotkey that looks like this:
You will have to alter <Path to AHK>, to your own setup to get it work correctly

Code: Select all

[AutoHotkey]
Filter=AutoHotkey (*.ahk)|*.ahk
HLTabWidth=0
IndentChar= 
UnIndentChar= 
DocComment=???
CurrentLine=0
CurrentLineBack=65535
Comment=00FF000000FFFFFF010
Identifier=0000000000FFFFFF000
Key=1FFFFFFF00FFFFFF100
Key words 2=004080FF00FFFFFF100
Key words 3=000000FF00FFFFFF100
Label=000000FF00FFFFFF000
Number=0080000000FFFFFF000
Preprocessor=0080800000FFFFFF010
Reserved Word=0000008000FFFFFF100
Space=0080800000FFFFFF000
String=0000800000FFFFFF000
Symbol=000000FF00FFFFFF100
Compilator File=<Path to AHK>\AutoHotkey\AutoHotkey.exe
Compilator Param=/ErrorStdOut |%File%| > |%Temp%\PSPad_run.log|
Compilator LOG=%Temp%\PSPad_run.log
Compilator Run=
Compilator Help=<Path to AHK>\AutoHotkey\AutoHotkey.chm
Compilator SaveAll=1
Compilator ParsLog=%F (%L) : ==>
Compilator Capture=1
Compilator HideOutput=1
Compilator ProgSaveAll=1
Compilator ProgRunSelection=0
Compilator DefaultDir=%Dir%
Compilator LogType=0
Prog0=Compile with log,|C:\WINDOWS\system32\cmd.exe| /c ||<Path to AHK>\AutoHotkey\Compiler\Ahk2Exe.exe| /in |%File%| /out |%Dir%%Name%.exe| > |%Temp%\PSPad_compile.log||§%Temp%\PSPad_compile.log
Prog1=Debug with XDC,|C:\WINDOWS\system32\cmd.exe| /c ||<Path to AHK>\AutoHotkey\AutoHotkey.exe| /Debug |%File%| > |%Temp%\PSPad_debug.log||§%Temp%\PSPad_debug.log
I put execution of a script (run) as compiler, because it offers to parse the LOG, double click on the LOG line jumps to the line with error.
Therefore I have used an "external program" to compile a script. And another "external program" to debug a script with XDC.

Thanks a lot to everyone that provided is files.
I will ask Jan to include the attached files in the official PSPad installation.
As well I will try to improve the Code explorer with him.
He has already promised to allow to specify a custom escape character, default is \. When that new version is available we will be able to specify `.
Attachments
PSPad.zip
Files for PSPad for AHK syntax highlight, auto complete and clips
(24.89 KiB) Downloaded 492 times
ciao
toralf
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: PSPad usage - Who uses PSPad?

11 Apr 2015, 21:56

Other ideas I will try to pursue in the next weeks (in case I find the time)
  • Look at auto-complete scripts that work well with PSPad and maybe combine or customize
    • Hint on commands/functions and their parameters
    • complete implemented commands/functions
    • complete reserved words
    • complete functions and vars of current script
    • complete functions and vars within all scripts in current project
  • Look for a script that offers to run a script from CLI with different AHK versions
    • Selection of available AHK executables
    • Option to Debug
    • Option to Compile (with selection of bin file)
    • Pass through the CL Output back to PSPad
  • Look for a script that allows to debug within PSPad or at least help with XDC
    • specify breakpoints in PSPad
    • Inspect objects
    • List all vars
    • specify breakpoints in included files
If you have scripts available that offer these functions or want to help to write a script, let me know.

I assume I will first look at TypingAid, IntelliSense, Scite4AHK and AHK Studio how they do the AutoComplete.
I guess the script to select the right AHK version needs to be written from scratch.
For the debug script I'll look at Scite4AHK and AHK Studio. But I fear that due to the different level of possible interaction it will not be easy to reuse their code.
ciao
toralf
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: PSPad usage - Who uses PSPad?

11 Apr 2015, 23:08

If you want stripped-down examples of how debugging works, see dbgp_console.ahk and dbgp_test.ahk, which require DBGP.ahk (a version of which is used by SciTE4AutoHotkey).

Edit: Oops, they're quite out of date. See GitHub/Lexikos/dbgp instead.
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: PSPad usage - Who uses PSPad?

13 Apr 2015, 13:44

PSPad is available in a new version: 4.6.0 (2658). It has several improvements over the old versions specially for AHK.

It now has improved DEF and INI files, basically the files I attached above, but you might have to adjust the User Highlighter Settings to your likings, they will be in a next release according to the above attached files. (currently the values for Un/IndentChar ={/}, TabWidth=2, KeywordChars=_ and DocComment=??? are different)

The escape character is now a backtick by default and can be adjusted if needed.

Indented functions are now detected and shown in the code explorer.
classes, methods, meta-functions and nested classes (all indented or unindented) are now detected and shown in the code explorer.

Still there are some limitations to the code explorer, but that will not be solved quickly (or at all) because the parser is line by line based, thus can't react on multi line code:
a) function calls like LV_Add() (instead of Row := LV_Add()) will show up as false positives. The only way around it would be to limit AHK to OTB, which will not likely happen.
b) multi line parameter definitions in function or method will not be detected and thus do not show up in the code explorer, e.g.

Code: Select all

MultilineFuncDef(Param1      ;this function will not show up in code explorer
             , Param2
             , Byref Param3){
}
ciao
toralf
Tengo_Dos

Re: PSPad usage - Who uses PSPad?

26 Apr 2016, 01:19

Code: Select all


If you miss PSPad macros to retrieve / contents of a variable (^+R), etc, you can download here an augmented version of autohotkey.def. Rename it to this after preserving your old autohotkey.def, if desired: 

[url]https://drive.google.com/open?id=0B1RX09woM_mpZjFvTVVaSFhuWTg[/url]

Return to “Editors”

Who is online

Users browsing this forum: No registered users and 33 guests