zsh-workers
 help / color / mirror / code / Atom feed
* UNDO_LIMIT_NO and its documentation
@ 2015-08-18  7:09 Bart Schaefer
  2015-08-18  8:26 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2015-08-18  7:09 UTC (permalink / raw)
  To: zsh-workers

The doc says:

     A typical use of this variable in a widget function is as follows:

          integer save_limit=$UNDO_LIMIT_NO
          UNDO_LIMIT_NO=$UNDO_CHANGE_NO
          {
            # Perform some form of recursive edit.
          } always {
            UNDO_LIMIT_NO=save_limit
          }

Firstly, why not just

	local UNDO_LIMIT_NO=$UNDO_CHANGE_NO

and allow function scoping to restore it?  It's not a special.

Secondly, declaring "integer save_limit" means that save_limit will have
a default of zero, but UNDO_LIMIT_NO has a default of unset.  So when the
assignment back to UNDO_LIMIT_NO is done, it'll change state from unset
to zero.  Does that matter?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-18  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-18  7:09 UNDO_LIMIT_NO and its documentation Bart Schaefer
2015-08-18  8:26 ` Peter Stephenson
2015-08-18  9:17   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).