Loading ...
Sorry, an error occurred while loading the content.
 

RE: [jasspa] Re: Why do restyle-region/restyle-buffer indent the whole block/buffer ?

Expand Messages
  • Phillips, Steven
    Yes and no, simplistically this will work but unfortunately pesky users do stupid things like changing their mind half way through and aborting the restyle. If
    Message 1 of 14 , Jan 13, 2004
      Yes and no, simplistically this will work but unfortunately pesky users do stupid things like changing their mind half way through and aborting the restyle. If this happens then the macro will abort somewhere in the !while loop and the $system variable will not be restored.

      Fixing this gets a little more tricky, I suggest you use this fix for now (and bare in mind the consequences of your actions!), I looking at handling this case for the need release,

      Steve

      > -----Original Message-----
      > From: azynheira [mailto:pmmg@...]
      > Sent: 13 January 2004 15:06
      > To: jasspa@yahoogroups.com
      > Subject: [jasspa] Re: Why do restyle-region/restyle-buffer indent the
      > whole block/buffer ?
      >
      >
      > Hello,
      >
      > After a quick inspection I believe that the following change corrects
      > the problem:
      >
      > 0 define-macro restyle-region-int
      > set-variable #l0 $window-line
      > set-alpha-mark "t"
      > exchange-point-and-mark
      > !if &gre $window-line #l0
      > set-variable #l0 $window-line
      > set-alpha-mark "t"
      > exchange-point-and-mark
      > !endif
      > !if &or &bmod "cmode" $buffer-indent
      > ; First save the system configuration
      > set-variable #l2 $system
      > ; Temporarly reset the <TAB> configuration
      > set-variable $system &bor $system 0x1000
      > !while &les $window-line #l0
      > beginning-of-line
      > tab
      > forward-line
      > !done
      > beginning-of-line
      > ; Restore configuration
      > set-variable $system #l2
      > !else
      > !if &seq $buffer-fhook "fhook-nroff"
      > set-variable #l1 "1 nroff-para"
      > !elif &seq $buffer-fhook "fhook-latex"
      > set-variable #l1 "1 latex-para"
      > !else
      > set-variable #l1 "1 ifill-paragraph"
      > !endif
      > !while &les $window-line #l0
      > execute-line #l1
      > set-mark
      > goto-alpha-mark "t"
      > set-variable #l0 $window-line
      > exchange-point-and-mark
      > !done
      > !endif
      > !emacro
      >
      > Does this do the trick ?
      >
      > Pedro
      > --- In jasspa@yahoogroups.com, "Phillips, Steven" <sphillips@p...>
      > wrote:
      > > Pedro,
      > >
      > > Good find, this change does mean that when the <TAB> key is pressed
      > a tab char (or # spaces) should be inserted. However when calling
      > restyle-region/buffer the command should not simply indent 4
      > spaces at
      > the beginning of each line. So this is a bug, thanks for finding it
      > and I'm glad we got to the bottom of it!
      > >
      > > I will fix this for the next macro release,
      > >
      > > Steve
      > >
      > > > -----Original Message-----
      > > > From: azynheira [mailto:pmmg@n...]
      > > > Sent: 13 January 2004 14:08
      > > > To: jasspa@yahoogroups.com
      > > > Subject: [jasspa] Re: Why do restyle-region/restyle-buffer indent
      > the
      > > > whole block/buffer ?
      > > >
      > > >
      > > > Hello,
      > > >
      > > > I have found the affecting code:
      > > > ---
      > > > ; Enable the <TAB> character in modes
      > > > ;set-variable $system &band $system &bnot 0x1000
      > > > ----
      > > >
      > > > This will provoke the behaviour I described. Is this supposed to
      > > > happen ?
      > > >
      > > > Pedro
      > > >
      > > > --- In jasspa@yahoogroups.com, Jon Green <jnaught@s...> wrote:
      > > > > azynheira wrote:
      > > > >
      > > > > > Hello,
      > > > > >
      > > > > > No, it never works. Everytime having it (display-white-chars)
      > on
      > > > or
      > > > > > off it always indents the whole block by 4 spaces. Does it
      > work
      > > > for
      > > > > > you ?
      > > > > >
      > > > > > Pedro
      > > > > >
      > > > >
      > > > > Pedro,
      > > > > Can you confirm that it is not one one of
      > > > > your macros that is a problem. Move your
      > > > > User start up directory out of the way or
      > > > > Log into your system as different user
      > > > > so that it runs ONLY the macros that we
      > > > > have released. Then try your test again -
      > > > > does it still happen ?
      > > > >
      > > > > Thanks
      > > > > Jon
      > > > >
      > > > >
      > > > >
      > > > >
      > > >
      > **********************************************************************
      > > > *******
      > > > > The information contained in this email and in any attachments
      > > > > may be privileged and confidential.
      > > > > The information is designated solely for the attention and use
      > of
      > > > > the intended recipient(s).
      > > > > If you are not the intended recipient(s), please be aware that
      > any
      > > > > disclosure, copying, distribution or use of the
      > contents of this
      > > > > information is prohibited.
      > > > > If you have received this email in error, please notify the
      > sender
      > > > > by telephone or email immediately.
      > > > >
      > > >
      > **********************************************************************
      > > > *******
      > > >
      > > >
      > > > ______________________________________________________________
      > > > ____________
      > > >
      > > > This is an unmoderated list. JASSPA is not responsible for
      > > > the content of
      > > > any material posted to this list.
      > > >
      > > > To unsubscribe, send a mail message to
      > > >
      > > > mailto:jasspa-unsubscribe@yahoogroups.com
      > > >
      > > > or visit http://groups.yahoo.com/group/jasspa and
      > > > modify your account settings manually.
      > > >
      > > >
      > > >
      > > >
      > > > ------------------------ Yahoo! Groups Sponsor
      > > > ---------------------~-->
      > > > Upgrade to 128-bit SSL Security!
      > > > http://us.click.yahoo.com/qZ0LdD/yjVHAA/TtwFAA/89EolB/TM
      > > > --------------------------------------------------------------
      > > > -------~->
      > > >
      > > > Yahoo! Groups Links
      > > >
      > > > To visit your group on the web, go to:
      > > > http://groups.yahoo.com/group/jasspa/
      > > >
      > > > To unsubscribe from this group, send an email to:
      > > > jasspa-unsubscribe@yahoogroups.com
      > > >
      > > > Your use of Yahoo! Groups is subject to:
      > > > http://docs.yahoo.com/info/terms/
      > > >
      > > >
      > > >
      >
      >
      > ______________________________________________________________
      > ____________
      >
      > This is an unmoderated list. JASSPA is not responsible for
      > the content of
      > any material posted to this list.
      >
      > To unsubscribe, send a mail message to
      >
      > mailto:jasspa-unsubscribe@yahoogroups.com
      >
      > or visit http://groups.yahoo.com/group/jasspa and
      > modify your account settings manually.
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      > To visit your group on the web, go to:
      > http://groups.yahoo.com/group/jasspa/
      >
      > To unsubscribe from this group, send an email to:
      > jasspa-unsubscribe@yahoogroups.com
      >
      > Your use of Yahoo! Groups is subject to:
      > http://docs.yahoo.com/info/terms/
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.