Author Topic: list of escape sequences  (Read 7476 times)

doid

  • Community Member
  • Posts: 6
  • Hero Points: 0
list of escape sequences
« on: October 16, 2009, 03:05:10 pm »
Where might I find a comprehensive list of escape sequences and their
meanings?  The user guide mentions some of them, but many (most?)
aren't described at all; e.g., %i and %xup.

Thanks,

Randal

chrisant

  • Senior Community Member
  • Posts: 1413
  • Hero Points: 131
Re: list of escape sequences
« Reply #1 on: October 16, 2009, 06:33:51 pm »
Escape sequences for what context?
There are various sets, for various different contexts.

doid

  • Community Member
  • Posts: 6
  • Hero Points: 0
Re: list of escape sequences
« Reply #2 on: October 16, 2009, 06:37:27 pm »
All contexts.  I'm looking for a list of all possible escape sequences.

Thanks,

Randal

Graeme

  • Senior Community Member
  • Posts: 2091
  • Hero Points: 252
Re: list of escape sequences
« Reply #3 on: October 16, 2009, 11:33:24 pm »
All contexts.  I'm looking for a list of all possible escape sequences.

You can find a list of alias escape sequences in the chm help file.

How did you find out about %xup.  I assume you're using this in the project properties dialog.  There isn't a proper list of these anywhere obvious, but if you search the chm help for xup, you'll find _parse_project_command which has a list, including xup.  I think slickedit relies on the lists that appear in the dialog itself, but as you say, xup is missing (and also %m).  The chm help won't let you search for % but in the slick docs folder, there is a pdf user guide and acrobat or foxit let you search for %.  Unfortunately, searching for xup in the pdf won't find anything because the macro function docs aren't in the pdf.

If you type fp _parse_project_command on the slick command line you'll be taken to the code which you can inspect to see the escape sequences.

Graeme
« Last Edit: October 18, 2009, 08:43:50 am by Graeme »

chrisant

  • Senior Community Member
  • Posts: 1413
  • Hero Points: 131
Re: list of escape sequences
« Reply #4 on: October 17, 2009, 12:20:03 am »
Hm.  Well, I'd be willing to help point out escape sequences to help solve a particular issue, but saying "all contexts ... all possible escape sequences" is very broad and represents an open ended time sink.  It's difficult to be helpful to that extreme degree, especially without knowing what it's needed for.

Any chance you can say what you're doing, what scenario you need to escape sequences for?

doid

  • Community Member
  • Posts: 6
  • Hero Points: 0
Re: list of escape sequences
« Reply #5 on: October 19, 2009, 05:41:46 pm »
> You can find a list of alias escape sequences in the chm help file.

Thanks Graeme.  That helps.  I hadn't found it before because the
Linux-side help doc doesn't have a global search capability.  I see
now that slickedit/help/WebHelp/ch16.htm ("API Documentation") has the
sort of info I'm looking for.  Apparently it's generated from
Slick-C code, so I can drill into that too when necessary.

> How did you find out about %xup.

I saw it used in a .vpj file.

> I assume you're using this in the
> project properties dialog. 

Not necessarily.  Might use it anywhere needing a backslash to forward
slash conversion.

> There isn't a proper list of these
> anywhere obvious, but if you search the chm help for xup, you'll find
> _parse_project_command which has a list, including xup. 

That fills in a lot of gaps too.

> I think slickedit relies on the lists that appear in the dialog
> itself, but as you say, xup is missing (and also %m).  The chm help
> won't let you search for % but in the slick docs folder, there is a
> pdf user guide and acrobat or foxit let you search for %.

Good to know.

> Unfortunately, searching for xup in the pdf won't find anything
> because the macro function docs aren't in the pdf.

Hmmm, yeah, I see that.

> If you type fp _parse_project_command on the slick command line you'll
> be taken to the code which you can inspect to see the escape
> sequences.

Awwh, also good to know.  Double thanks.  You've given me enough to
cobble together my own escape sequence list, plus some good insight
into SlickEdit organization.

I gotta wonder though ...  why the heck don't SlickEdit docs include a
comprehensive list, so rooting around like this isn't necessary?

Randal

doid

  • Community Member
  • Posts: 6
  • Hero Points: 0
Re: list of escape sequences
« Reply #6 on: October 19, 2009, 05:43:03 pm »
> Hm.  Well, I'd be willing to help point out escape sequences to help
> solve a particular issue, but saying "all contexts ... all possible
> escape sequences" is very broad and represents an open ended time
> sink.  It's difficult to be helpful to that extreme degree, especially
> without knowing what it's needed for.

Thanks chrisant. I do appreciate your willingness to help.  I didn't
mean to ask anyone to assemble a list for me ... only wondered if such
a list already exists.  I'd have thought SlickEdit (Inc.) would
provide one as a matter of course.

> Any chance you can say what you're doing, what scenario you need to
> escape sequences for?

I'm writing .vpj files and I wondered what I might be able to express
with escape sequences.  Evidently the .vpj format isn't documented
either.  As it stands, I'm having to figure out the meanings of markup
tags from pre-existing .vpj files.  The tag meanings are fairly easy
to infer, but the escape sequences are cryptic.

Randal

Scott H

  • Senior Community Member
  • Posts: 240
  • Hero Points: 9
Re: list of escape sequences
« Reply #7 on: October 19, 2009, 07:08:50 pm »
You're right, the project file escape sequences aren't listed in the documentation and probably should be.  Not all escape sequences will work in all contexts, and I think that the ones you're looking for are the ones found on the "Project Properties" dialog (Project > Project Properties...).  Usually on a dialog like this, a button with a right facing triangle will expand to show you options for escape sequences.  In the attached picture, I showed how when you click it, you get a list of insertable escape sequences.  The alias dialog has a button like this too, but for escape sequences that worn in the context of aliases.  The escape sequences shown in the attached picture should work for you in your project file.  Hope this helps.


doid

  • Community Member
  • Posts: 6
  • Hero Points: 0
Re: list of escape sequences
« Reply #8 on: October 19, 2009, 07:51:21 pm »
> The escape sequences shown in the attached picture should
> work for you in your project file.  Hope this helps.

Scott, I was aware of the pop-out lists in the GUI, but was looking
for a complete list.  Confirmation that there is no such list is
actually helpful though, since now I don't have to wonder if I'm
overlooking something.  Thanks for the picture and clear explanation.

Randal

Scott H

  • Senior Community Member
  • Posts: 240
  • Hero Points: 9
Re: list of escape sequences
« Reply #9 on: October 19, 2009, 08:02:48 pm »
Here's another list that I think may be what you're looking for.  On the command line type "help _parse_project_command" (don't include the quotes), and you get a full list of escape sequences for building compile commands.  I'm including the list here, but I wanted to let you know how to get to it...

%B : Configuration
%BD : Configuration build directory
%BN : Configuration name. Same as %B option except for Visual C++ configuration names where configuration names are of the form CFG="[ConfigName]" or [ConfigName]|[Platform].
%C : Current word
%CP : Java class path including -classpath.
%E : File extension with dot
%F : Absolute filename
%I : Absolute include directories including -I
%IR : Include directories relative to project including -I
%JBD : Java build directory including -d.
%LIBS : Libraries space delimited.
%N : Filename without extension or path
%O : Output filename. Currently only GNU projects have an output filename on the Link Tab.
%OE : Output extension with dot
%ON : Output filename with no extension or path
%OP : Output path
%P : Path of current file
%R : Absolute project name
%RE : Project extension
%RN : Project filename without extension or path
%RP : Project path
%RV : (Windows only) Project drive with :
%RW : Project working directory
%T : Project configuration target
%V : (Windows Only) Drive of current file with :
%W : Absolute workspace filename
%WE : Workspace extension with dot
%WN : Workspace filename with no extension or path
%WP : Workspace path
%WV : Workspace drive with :
%XUP : Translate all back slashes that follow to forward slashes (UNIX file separator)
%XWP : Translate all forward slashes to back slashes (Windows file separator)
%(envvar) : Value of environment variable envvar
%[regkey] : Value of Windows registry entry. example: %[HKLM:\Software\Microsoft\Communicator@InstallationDirectory]
%% : Percent character

doid

  • Community Member
  • Posts: 6
  • Hero Points: 0
Re: list of escape sequences
« Reply #10 on: October 19, 2009, 10:18:05 pm »
> Here's another list that I think may be what you're looking for.

Cool.  Thanks for that too Scott.  I saw that list in the
_parse_project_command API doc, but it's good to know I can also get
it from the command line.  Graeme mentioned "fp parse_project_command"
as well, for inspecting the source code.  A quick look reveals
that these undocumented escape sequences are also recognized by the
function:

    %Q
    %D
    %M
    %RM
    %-
    %WD
    %WX
    %IN
    %OB
    %LF
    %H
    %<digit>
    %{

I might not have those quite right, but clearly the function's header
comment hasn't kept pace with the function code.  Perhaps the comment
could be updated, so the additional sequences show up in the command
line and API docs?

Randal

Scott H

  • Senior Community Member
  • Posts: 240
  • Hero Points: 9
Re: list of escape sequences
« Reply #11 on: October 21, 2009, 05:02:34 pm »
Here are the meanings for the undocumented escape sequences:

%DEFD : Configuration defines with dashes.  Example: %DEFD, project def = 'test' produces '"-Dtest"
%DEFS : Configuration defines with slashes.  Example: %DEFS, project def = 'test' produces '"/Dtest"
%DM : The file name only of the current buffer.
%H : (Java only) Builds a temp HTML file to run the compiled applet, %H is replaced by the temp HTML file name.
%IN : Include directories absolute paths (individually listed) including '-i '.  Example: '-i c:\folder1 -i c:\folder2'
%LF : Current buffer name.
%M : Calls a macro function.  Any return value is included in the build command. Must be terminated by a matching %. Example: %Mmy_function%, where my_function() is a macro function.
%OBJS : Project objects (including libraries).
%Q# : The current file's path (no file name) starting with the folder item indicated by #.  Example: %Q2, current file = 'c:\a\b\c\d\test.txt' produces '\b\c\d\'.
%RM : Project display name (for associated workspaces).
%WD : Same as %WV.
%WX : The workspace folder name only. Example: %WX, workspace = 'c:\a\b\c\workspace.vpw' produces 'c'.
%-# : Removes the previous # characters.
%# : The # item in argline (items are seperated by spaces).
%{*.*} : A list of project files matching the pattern in braces.

These and the other escape sequences will be added to the main documentation as well.  Thanks for the feedback on the help docs!
« Last Edit: October 21, 2009, 05:07:18 pm by Scott H »

Scott H

  • Senior Community Member
  • Posts: 240
  • Hero Points: 9
Re: list of escape sequences
« Reply #12 on: October 21, 2009, 05:03:20 pm »
One other thing...  %DQ, %DS and %DF are OS390 only.
« Last Edit: October 21, 2009, 05:23:45 pm by Scott H »

Scott H

  • Senior Community Member
  • Posts: 240
  • Hero Points: 9
Re: list of escape sequences
« Reply #13 on: October 21, 2009, 05:13:36 pm »
Here's a handy macro you can use to test an escape sequence too:

Code: [Select]
_command void test_esc_sequences()
{
   _str result = _parse_project_command('Test = "%WP"', p_buf_name, _project_get_filename(), 'current word', 'arg1 arg2 arg3 arg4 arg5', 'tool name', 'classpath');
   say(result);
}

The output goes to the vsapi.dll window and you can replace %WP with whatever escape sequence you want to test.