SlickEdit Product Discussion > SlickEdit®

Global Edit window Setting.

(1/2) > >>

Hi All,

I'm fairly new to Slickedit (Always used some 'vi' deriverate) and I was wondering if it is possible to have the 'Special Chars' option from the view-menu and the 'Line Numbers' set globally. For every file (Don't work with projects yet) I open, I have to set this again.

Is there a way to do this?

Kind regards,



If you look in the help under tutorials for macro programming  (search for _buffer_add_ViewLineNumbers if you can't find the topic), you'll see it mentions in the section just before that, that line numbers can be enabled for each extension by choosing the Tools > Options > File Extension Setup > General > Display line numbers.

If you record a macro and turn on line numbers and special chars, you'll get the following.

_command show_line_numbers_and_special_chars() name_info(','VSARG2_MACRO|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL)

In the key bindings dialog you'll see you can bind a shortcut to view-special... and view-line... if you want a quick way to turn on/off.
If you type fp view-specialchars-toggle at the command line you'll see the code for it.

You can use this macro to get special chars shown when you open a new file  - however, this only applies when a new file is opened that wasn't already in the workspace - so if you open a project, the files that are already open in that workspace won't have special chars enabled by the following macro

void _buffer_add_View_SpecialChars()

As explained in the tutorial section in the help I mentioned before, the _buffer_add prefix has special meaning.

There's also a _switchbuf prefix

void _switchbuf_add_View_SpecialChars()

which means whenever you switch to a new buffer, any functions that begin with _switchbuf get executed.
This might turn out to be inconvenient though.  Another thing you can do is write a macro to iterate through all open buffers and turn special chars on or off

int turn_on_special_chars()
   return 0;

_command void show_special_chars_for_all_buffers() name_info(',')
   _mdi.p_child.for_each_buffer( 'turn_on_special_chars' );


Very good explanation Graeme [thumb-up] - should be merged into the manual ...
However, I'll copy it to my own 'HowTo' snippets - thx !


Thanx a million! It worked like a charm.

Happy Hacking


Hey all,

I've used SlickEdit for about 8 years now (have been using Version 6 for most of those), but have never really gotten into Macro writing... the interface has always seemed cryptic to me... I'll create a macro for "one time use" and then forget about it.  I'm trying to use the example given here, in conjunction with the "Guide" in the Help, for creating the "turn on special chars and line numbers" to learn some about Macro creation.  I cut-and-pasted the two functions (turn_on_special_chars and show_special_chars_for_all_buffers), first into my vusrmacs.e file, and then into a test file (test.e) where I created the "Hello World" macro (as described in the Guide).  It appears as though the only way I can "load" the macros and compile them is to use the command line "load" command (or does Macro... Load Module do the same thing?).

Anyway, when I tried the "load" command on my test.e file, it complained that SHOWSPECIALCHARS_ALL was not initialized.  I assumed this to be a "defined value" within SlickEdit.  I figured out, from comparing the new file to vusrmacs.e that I needed to add the include of, and successfully ran my command from the command-line.  I expected it to turn on line numbers as well (but it didn't).  I guess I could add the other text into the turn_on_special_chars function to see if that works...

The other thing that I don't quite understand is, why don't these new functions show up in the list when I select the Macro... List Macro menu?

So, to summarize my questions:
1.  Is the "load" command from the command line the only way to "compile and load" a macro?
2.  How do items show up in the "Macro List"?
3.  Is there an easy primer I can use (besides the Guide, which clearly has me confused) to give me a better understanding?




[0] Message Index

[#] Next page

Go to full version