jed-users mailing list

[2017 Date Index] [2017 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [jed-users] entab/detab


Roland Hughes <roland@xxxxxxxxxxxxxxxxxxxx> wrote:
> You know, I tried to play with this today. I even read through the 
> documentation. What I cannot find and will certainly create a blog post 
> about is just how one provides a "prefix" argument to the untab() 
> function from the S-Lang command line. This appears to be a piece of the 
> lore "just assumed."

This concept is part of the emacs emulation.  Basically it means that
you would press `ESC n` prior to calling the function.  Here n
represents 1 or more digits that specify the value of the prefix
argument.  So, `ESC 1234` creates a prefix argument whose value is
1234.

In this case, you would do the following:

  A.  Mark the region
  B.  ESC 1 ESC x       % Assumes emacs-emulation to
  C.  Enter untab at the M-x prompt

Programmatically, you would use the `set_prefix_argument' function
prior to calling `untab`, i.e.,

       .
       .
    set_prefix_argument (1);
    untab ();

> I looked at the code here: https://searchcode.com/codesearch/view/19435302/
>
> I also couldn't get untab_convert_to_tabs() to function. It went all the 
> way to bottom of buffer, but didn't insert any tabs. Does this function 
> not work if tabs are disabled in .jedrc?

No, it requires both the USE_TABS and the buffer's TAB value to be
non-zero.  Perhaps the untab_convert_to_tabs function should be
modified as follows:

   define untab_convert_to_tabs ()
   {
      variable c, tab = TAB, use_tabs = USE_TABS;
      EXIT_BLOCK {
         TAB = tab;
	 USE_TABS = use_tabs;
      }
      USE_TABS = 1;
      if (tab == 0) TAB = 8;

      while (fsearch (....))
        .
	.
    }

Hopefully this clarifies things somewhat.

Thanks,
--John
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.


[2017 date index] [2017 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]