zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: history improvements for 3.1.5-pws-17 and 3.0.6-pre-2
@ 1999-05-08  2:50 Wayne Davison
  1999-05-08 14:01 ` Peter Stephenson
  0 siblings, 1 reply; 7+ messages in thread
From: Wayne Davison @ 1999-05-08  2:50 UTC (permalink / raw)
  To: zsh-workers

Appended is the history improvements for pws-17 that I mentioned in
zsh-workers 6218.  I've gzipped and uuencoded the patch to make it
smaller.  You can also grab it and a version of the patch for
3.0.6-pre-2 via the web:

  http://www.clari.net/~wayne/history_patch_for_zsh-3.1.5-pws-17.txt
  http://www.clari.net/~wayne/history_patch_for_zsh-3.0.6-pre-2.txt

The pws-17 version has documentation changes in the yoda source
(though I don't have yoda to see if the changes worked out OK),
but the 3.0.6-pre-2 version does not have any doc changes at the
moment (since I'm assuming that this won't make it into 3.0.6).

One previously unmentioned improvement is that you can use "fc -RI"
to manually import just the commands that aren't already in your
history buffer (as opposed to have it done automatically via the
SHARE_HISTORY option).

The 3.0.6-pre-2 version includes a number of fixes to the history
code that I brought over from 3.1.5, though.  I'm mainly using the
3.0.6 version right now (especially since I can't seem to get my
gcc/gdb setup to show me the debugging info for the pws-17 build),
but the pws-17 version seems to be working fine so far as well.
I'm assuming there will be some (hopefully minor) bugs that are
still left to squash, but I've been running most of the code for
a few days now, and it seems stable.

I hope you enjoy it!

..wayne..

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
begin 644 history_patch_for_zsh-3.1.5-pws-17.gz
M'XL("*6A,S<  VAI<W1O<GE?<&%T8VA?9F]R7WIS:"TS+C$N-2UP=W,M,3< 
M[%S_4]M(LO_9_BN&W%60L)38!@R$D"R;D(WK"*2 O=V[5,XKY#%6(4M>28:0
MN[R__?67&6G&EL'9O+QZ]>Y226Q)/3,]_>73W3,C]Y.A_/1,O$[#IW_/QT\O
M9U%<1$G^Y"YM_O"#\#<[NUZG+5KTN2E^^*$IBL(9A<(_<T4F@V$NBK$4XR@O
MTNQ.C+)T0C>NHAN9B%$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W&%3.3"IZ ]4$WA<R%.')AY 'D!J739'"D6Y7 UK]G(U;?XUK!I9&A4V
M(J.JY^-L@&AEZ!3Y<PQ&=N!2M40@37 FCQ,(0SIIFZ,$*N%HP:6QZ[IQB6QX
M,4YM&L)<'P0<FUGFKV" 5!05/-8\2++T7W.R-K:=<3I$.[%OJ "SV>[8MJU4
M_Z-.?XT2)91&Z&(D4A#2?4;=BT$:V(O=0?811N\U BZAKI6F;@62/J+9\_MV
MYR-%N>(F*EX3SOL^&,XO2"R!A -EHOT\Z&%(K?EH8*:<Y-KRYM2\\YPJ"^:T
M^5?F9*[+KH4=W8)UXS'C289MH'F(&+DFV"[2-M.HZV94(J01Q0XSV\& B^B$
M-"16]*_/P8;>'/"0S2_W5FSLDZ21?XE1KQ"-ZGS8GYMM@!L"@]@"_;SM0_1=
M2WCE/H7!(2GS?5?.__YX/C30HS"XF)02]A>T9FYGY]!CLKZ^GJ!0"G\Q A/%
M)]ENH[ZU46UL>)RJ#;%^T3HTE9/-R"N,OIXD.R"TLR^5X7*)8-T(W[(%"+]N
MQEZ#>(3?;\;>>XNY$Y8 DQ.JW:B'[Y0\W)38,=59F7[7OY]PT8Z@3:1_&7)&
MD^GX@[D4("<"C,0P1=I(I;^C;=(--44YM-D0J24>.$XB6>4G@<!1/09Q8I4/
MJKRT4+UQPD#UT)/UJ5:=*"_W$"5UZJD2Q'E/4=*FGFA!FAJ!DY.ILB0)DP>O
MS_F;%EEYCUIGS[G)(H&3%'<BH/P3$0KQ&ROD81E/XQ%*PQN-W1W%6SOY#5?3
C<AGO$4A>>)1:LL)E BF)?0J"#_N#11K5>_\+^*ES*6S^  "-
 
end
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---


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

* Re: PATCH: history improvements for 3.1.5-pws-17 and 3.0.6-pre-2
  1999-05-08  2:50 PATCH: history improvements for 3.1.5-pws-17 and 3.0.6-pre-2 Wayne Davison
@ 1999-05-08 14:01 ` Peter Stephenson
  1999-05-08 23:43   ` Wayne Davison
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 1999-05-08 14:01 UTC (permalink / raw)
  To: zsh-workers

Wayne Davison wrote:
> Appended is the history improvements for pws-17 that I mentioned in
> zsh-workers 6218.

Thanks, this will appear in pws-18.

One addition in the patch below:  share_history is set in ksh emulation.

Some comments on share_history (which is the one I've played about with
most): actually, it doesn't emulate ksh at the moment, because only a few
commands cause the history from any other instance of the shell to be used.
I know this is how it's documented, but I find the behaviour a bit
confusing, since after I've typed something in one shell, and hit return in
another shell, I expect to be able just to use up-line-or-history to get to
what's in the other shell --- otherwise I might just as well use an
explicit fc -RI and the option's not much use, or so I've been finding on
rather limited experience so far.

I presume that the real problem is numbering of bang-history references,
and I agree it's correct to be careful in that case.  However, I'd like to
suggest that any zle reference to the history (apart from expansion of
lines like !*, of course, but that's done internally via the lexer so
shouldn't cause problems as an exception) causes the newly imported stuff
to be visible.  I don't think this is likely to cause confusion, since you
always see the line before doing anything with it --- in fact, in my case
it would definitely help eliminate confusion, and also it would make the
behaviour more ksh-like.

Next point --- there is another slight confusion, partly at least as a
knock on effect of this.  If I type something in shell 1, I know it won't
be imported until after the next line in shell 2 is finished, and won't
show up until after the next history reference.  So I type `history'. As
explained above, I find this a bit clumsy anyway, but the point here is
that for some reason due to the internal handling it's not enough to make
what I just typed in shell 1 appear (even if I unset histnostore, which I
thought might have had an effect).  It only happens after I've typed a new
command in shell 2, which can't be a history command or a blank line, and
then after that I have to do something to get the commands to show up.

Ideally for sharing history, I'd like to be able just to hit return (to do
the reading) then up (to allow the new commands to show up) to get what I
just typed in the other shell, just as happens in ksh.  Hope that's
possible.

--- Src/options.c.newhist	Sat May  8 14:31:51 1999
+++ Src/options.c	Sat May  8 15:27:16 1999
@@ -181,7 +181,7 @@
 {NULL, "restricted",	      OPT_SPECIAL,		 RESTRICTED},
 {NULL, "rmstarsilent",	      OPT_BOURNE,		 RMSTARSILENT},
 {NULL, "rmstarwait",	      0,			 RMSTARWAIT},
-{NULL, "sharehistory",	      0,			 SHAREHISTORY},
+{NULL, "sharehistory",	      OPT_KSH,			 SHAREHISTORY},
 {NULL, "shfileexpansion",     OPT_EMULATE|OPT_BOURNE,	 SHFILEEXPANSION},
 {NULL, "shglob",	      OPT_EMULATE|OPT_BOURNE,	 SHGLOB},
 {NULL, "shinstdin",	      OPT_SPECIAL,		 SHINSTDIN},

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

* Re: PATCH: history improvements for 3.1.5-pws-17 and 3.0.6-pre-2
  1999-05-08 14:01 ` Peter Stephenson
@ 1999-05-08 23:43   ` Wayne Davison
  1999-05-10  7:53     ` Peter Stephenson
  0 siblings, 1 reply; 7+ messages in thread
From: Wayne Davison @ 1999-05-08 23:43 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

Peter Stephenson writes:
> after I've typed something in one shell, and hit return in another
> shell, I expect to be able just to use up-line-or-history to get to
> what's in the other shell

I'm torn on the issue, because sometimes I want to up-arrow through
the total history, and sometimes I just want to press ^P and run the
last command that I ran in this window, no exceptions.  If you'd
like to change the current behavior for the up/down commands, apply
this patch:

Index: Src/Zle/zle_hist.c
@@ -461,7 +461,7 @@
 int
 zle_goto_hist(int ev, int n)
 {
-    Histent he = movehistent(quietgethist(ev), n, HIST_FOREIGN);
+    Histent he = movehistent(quietgethist(ev), n, 0);
     if (!he)
 	return 0;
     zle_setline(he);

Note that this change doesn't affect ! references, so !! would
still run the last command that was run in the current shell.

I'd be interested in suggestions for how we can let the user choose
between local-history and full-history movement.  Perhaps a toggle
command?  Or a bindable prefix (so I can have ^P ignore shared
history, and Up-Arrow include it)?  I like this idea.

> I'd like to suggest that any zle reference to the history [...]
> causes the newly imported stuff to be visible.

I think that some zle commands, such as accept_and_infer_next_
history, should remain unaffected by foreign commands.

> for some reason due to the internal handling it's not enough to
> make what I just typed in shell 1 appear [...] It only happens
> after I've typed a new command in shell 2, which can't be a
> history command or a blank line

I think you've misinterpreted what's going on.  The current code
waits until the command _finishes_ before adding it to the history
file.  I did this because the extended_history format contains the
finish time of the command.  I also don't like this delay in adding
the command, though, so I think we add the command after it is typed,
and just live with the fact that all the finish times will be the
same as the start times when using incremental_append_history (which
is used by shared_history).

Here's the change to append the history in hend() rather than
hbegin():

Index: Src/hist.c
@@ -671,8 +671,6 @@
     if (hist_ring && !hist_ring->ftim)
 	hist_ring->ftim = time(NULL);
     if (interact && isset(SHINSTDIN) && !strin) {
-	if (isset(SHAREHISTORY) || isset(INCREMENTALAPPENDHISTORY))
-	    savehistfile(NULL, 1, HFILE_USE_OPTIONS | HFILE_FAST);
 	histactive = HA_ACTIVE;
 	attachtty(mypgrp);
 	if (!hist_ring)
@@ -962,6 +960,8 @@
     zfree(chwords, chwordlen*sizeof(short));
     chline = NULL;
     histactive = 0;
+    if (isset(SHAREHISTORY) || isset(INCREMENTALAPPENDHISTORY))
+	savehistfile(NULL, 1, HFILE_USE_OPTIONS | HFILE_FAST);
     return !(flag & HISTFLAG_NOEXEC || errflag);
 }
 
Thanks for the feedback -- I appreciate it!

..wayne..


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

* Re: PATCH: history improvements for 3.1.5-pws-17 and 3.0.6-pre-2
  1999-05-08 23:43   ` Wayne Davison
@ 1999-05-10  7:53     ` Peter Stephenson
  1999-05-11  9:39       ` PATCH: history improvements for 3.1.5-pws-17 Wayne Davison
  1999-05-29  7:08       ` PATCH: history improvements for 3.1.5-pws-17 and 3.0.6-pre-2 Bart Schaefer
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Stephenson @ 1999-05-10  7:53 UTC (permalink / raw)
  To: Zsh hackers list

I've applied both the other history patches, and it does exactly what I was
hoping, thanks.

Wayne Davison wrote:
> I'm torn on the issue, because sometimes I want to up-arrow through
> the total history, and sometimes I just want to press ^P and run the
> last command that I ran in this window, no exceptions.

You can setopt histverify and edit the line produced by !!, of course, but
I don't claim that's a perfect solution.

> I'd be interested in suggestions for how we can let the user choose
> between local-history and full-history movement.  Perhaps a toggle
> command?  Or a bindable prefix (so I can have ^P ignore shared
> history, and Up-Arrow include it)?  I like this idea.

You mean something like a toggle, either for the next command only or
permanently?  That might work.  You could then have a zle widget

up-line-or-local-history {
  zle toggle-local-history
  zle up-line-or-history
}

if it works on the next command, or

up-line-or-local-history {
  integer savnum=$NUMERIC
  NUMERIC=1
  zle toggle-local-history
  NUMERIC=$savnum
  zle up-line-or-history
  NUMERIC=0
  zle toggle-local-history
}

if it was a permanent state change.  Hmmm, it might be a good idea to
make `zle widget num' override the value of $NUMERIC with num when calling
a widget.

> > I'd like to suggest that any zle reference to the history [...]
> > causes the newly imported stuff to be visible.
> 
> I think that some zle commands, such as accept_and_infer_next_
> history, should remain unaffected by foreign commands.

OK, I hadn't thought about that one, it was really only up/down commands
that crossed my mind.

> I think you've misinterpreted what's going on.  The current code
> waits until the command _finishes_ before adding it to the history
> file.  I did this because the extended_history format contains the
> finish time of the command.  I also don't like this delay in adding
> the command, though, so I think we add the command after it is typed,
> and just live with the fact that all the finish times will be the
> same as the start times when using incremental_append_history (which
> is used by shared_history).

I don't quite understand how that was making the difference.  The command
was finishing in one window; all my comments about how the history list got
retrieved in the other window presupposed I hadn't done anything else in
the first window, i.e. its command was definitely saved.  Is the point
that reading the foreign history happened at the same time as writing the
local one, so that the line saved from the first window was getting read
later than I expected in the second?  though I don't quite believe that,
looking at the old code.

Perhaps on the question of incremental_append_history/append_history it
would be a good idea to ask on the users list if they like the idea of the
existing option being altered.  The effect is different, even if you aren't
using shared history, however.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

* Re: PATCH: history improvements for 3.1.5-pws-17
  1999-05-10  7:53     ` Peter Stephenson
@ 1999-05-11  9:39       ` Wayne Davison
  1999-05-29  7:26         ` Bart Schaefer
  1999-05-29  7:08       ` PATCH: history improvements for 3.1.5-pws-17 and 3.0.6-pre-2 Bart Schaefer
  1 sibling, 1 reply; 7+ messages in thread
From: Wayne Davison @ 1999-05-11  9:39 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hackers list

Peter Stephenson writes:
> I've applied both the other history patches, and it does exactly
> what I was hoping, thanks.

Unfortunately there's a problem with how the relocated
savehistfile() call interacts with remhist() in that 2-file tweak.
Fortunately, it's easy to fix.

> Hmmm, it might be a good idea to make `zle widget num' override the
> value of $NUMERIC with num when calling a widget.

I like this -- it makes writing an up-line-or-local-history function
much simpler.

Appended is a patch with the following changes (apply it over the
top of my previous 2-file tweak):

 + Added the zle command: set-local-history.  If called with a
   non-zero numeric argument, it enables the browsing of local-only
   history.  If called with a zero argument, it turns off local-only
   history.  If called with no argument, it toggles the current
   setting.  I didn't add a keybinding for this, but I've got it
   bound to Esc-/ in my .zshrc for the moment.

 + Made the history-browsing commands honor the setting of the set-
   local-history toggle (including the history up/down commands, and
   searching commands, but not ! references -- should they change
   too?)

 + Foreign lines no longer get UNmarked as foreign at any time.

 + The history command displays a '*' next to the history number of
   foreign lines.

 + You can now call "zle WIDGET NUM" to temporarily set the "zmult"
   value for that widget (the old value gets restored after the
   widget runs).  If you supply a non-numeric argument, the widget
   is called without the MOD_MULT flag set (which typically results
   in a zmult of '1', but there are other commands that have a
   different default).

 + Commands that call remhist() (like "history") once again remove
   the right line (this was broken in my 2-file tweak).

 + The sequence of load/save events is now:  load the shared history
   right before we store the current line, and then we write it out.
   This means that most of the time up-history will access the
   previous command even when a foreign-history command shows up.
   (Of course, if you enter an empty command then there's not current
   command to save, so the imported command(s) will be first when you
   press up-arrow.)

 + If you don't have hist_ignore_all_dups set, we import all shared
   history lines into the buffer, even lines that we already have.

 + The histfilelock() code waits a little longer before breaking a
   stale lock file (10 seconds rather than 5).  Is that long enough?

I didn't change any option names -- I figure I'll let you decide to
shorten them if you'd like to.

I'm currently using the following code to make Ctrl-P avoid foreign
history, while up-arrow (and other commands) include it:

up-line-or-local-history() {
    zle set-local-history 1
    zle up-line-or-history
    zle set-local-history 0
}
zle -N up-line-or-local-history

down-line-or-local-history() {
    zle set-local-history 1
    zle down-line-or-history
    zle set-local-history 0
}
zle -N down-line-or-local-history

..wayne..

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: Doc/Zsh/options.yo
@@ -831,21 +831,20 @@
 cindex(share history)
 cindex(history, sharing)
 item(tt(SHARE_HISTORY))(
-This option both imports new commands from the history file (ones
-that are not already in your history list), and also causes your
-typed commands to be appended to the history file (like specifiying
-tt(INCREMENTAL_APPEND_HISTORY)).  The history lines are also output
-with timestamps (see tt(EXTENDED_HISTORY)) to make it easier to
-find where we were in the file after the file gets re-written.
 
-In an attempt to avoid confusing the user, most history commands
-avoid these "foreign" commands.  They can be found by using an
-incremental or line-prefix history search (not including `tt(^)' or
-`tt(!)').  You can also make them visible to all commands by using a
-command that shows the history (such as `history' or `fc -l') or
-a command that explicitly imports history lines (`fc -RI').
+This option both imports new commands from the history file, and also
+causes your typed commands to be appended to the history file (like
+specifiying tt(INCREMENTAL_APPEND_HISTORY)).  The history lines are also
+output with timestamps ala tt(EXTENDED_HISTORY) (which makes it easier to
+find the spot where we left off reading the file after it gets re-written).
 
-If you find that you want more control over when foreign commands
+By default, history movement commands visit the imported lines as well as
+the local lines, but you can toggle this on and off with the
+set-local-history zle binding.  It is also possible to create a zle
+widget that will make some commands ignore imported commands, and some
+include them.
+
+If you find that you want more control over when commands
 get imported, you may wish to turn tt(SHARE_HISTORY) off,
 tt(INCREMENTAL_APPEND_HISTORY) on, and then manually import
 commands whenever you need them using `fc -RI'.
Index: Src/Zle/iwidgets.list
@@ -91,6 +91,7 @@
 "send-break", sendbreak, 0
 "set-mark-command", setmarkcommand, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
 "spell-word", spellword, 0
+"set-local-history", setlocalhistory, 0
 "transpose-chars", transposechars, 0
 "transpose-words", transposewords, 0
 "undefined-key", undefinedkey, 0
Index: Src/Zle/zle_hist.c
@@ -297,7 +297,8 @@
 	srch_str = zalloc(histpos);
 	memcpy(srch_str, line, histpos);
     }
-    for (he = up_histent(quietgethist(histline)); he; he = up_histent(he)) {
+    he = quietgethist(histline);
+    while ((he = movehistent(he, -1, hist_skip_flags))) {
 	if (isset(HISTFINDNODUPS) && he->flags & HIST_DUP)
 	    continue;
 	s = ZLETEXT(he);
@@ -337,7 +338,8 @@
 	srch_str = zalloc(histpos);
 	memcpy(srch_str, line, histpos);
     }
-    for (he=down_histent(quietgethist(histline)); he; he=down_histent(he)) {
+    he = quietgethist(histline);
+    while ((he = movehistent(he, 1, hist_skip_flags))) {
 	if (isset(HISTFINDNODUPS) && he->flags & HIST_DUP)
 	    continue;
 	s = ZLETEXT(he);
@@ -452,16 +454,27 @@
     mkundoent();
     histline = he->histnum;
     setline(ZLETEXT(he));
-    /*he->flags &= ~HIST_FOREIGN;*/
     setlastline();
     clearlist = 1;
 }
 
 /**/
+void
+setlocalhistory(void)
+{
+    if (zmod.flags & MOD_MULT) {
+	hist_skip_flags = zmult? HIST_FOREIGN : 0;
+    }
+    else {
+	hist_skip_flags ^= HIST_FOREIGN;
+    }
+}
+
+/**/
 int
 zle_goto_hist(int ev, int n)
 {
-    Histent he = movehistent(quietgethist(ev), n, 0);
+    Histent he = movehistent(quietgethist(ev), n, hist_skip_flags);
     if (!he)
 	return 0;
     zle_setline(he);
@@ -682,7 +695,7 @@
 		    statusline = ibuf + NORM_PROMPT_POS;
 		    break;
 		}
-		if (!(he = dir > 0? down_histent(he) : up_histent(he))) {
+		if (!(he = movehistent(he, dir, hist_skip_flags))) {
 		    if (sbptr == (int)isrch_spots[top_spot-1].len
 		     && (isrch_spots[top_spot-1].flags & ISS_FAILING))
 			top_spot--;
@@ -1024,7 +1037,7 @@
     }
     t0 = strlen(visrchstr);
     he = quietgethist(histline);
-    while ((he = (visrchsense < 0? up_histent(he) : down_histent(he)))) {
+    while ((he = movehistent(he, visrchsense, hist_skip_flags))) {
 	if (isset(HISTFINDNODUPS) && he->flags & HIST_DUP)
 	    continue;
 	s = ZLETEXT(he);
@@ -1068,7 +1081,8 @@
 	zmult = n;
 	return;
     }
-    for (he = up_histent(quietgethist(histline)); he; he = up_histent(he)) {
+    he = quietgethist(histline);
+    while ((he = movehistent(he, -1, hist_skip_flags))) {
 	if (isset(HISTFINDNODUPS) && he->flags & HIST_DUP)
 	    continue;
 	s = ZLETEXT(he);
@@ -1102,7 +1116,8 @@
 	zmult = n;
 	return;
     }
-    for (he=down_histent(quietgethist(histline)); he; he=down_histent(he)) {
+    he = quietgethist(histline);
+    while ((he = movehistent(he, 1, hist_skip_flags))) {
 	if (isset(HISTFINDNODUPS) && he->flags & HIST_DUP)
 	    continue;
 	s = ZLETEXT(he);
Index: Src/Zle/zle_thingy.c
@@ -357,7 +357,7 @@
 
     /* check number of arguments */
     for(n = 0; args[n]; n++) ;
-    if(!op->o && n != 1) {
+    if(!op->o && n != 1 && n != 2) {
 	zerrnam(name, "wrong number of arguments", NULL, 0);
 	return 1;
     }
@@ -516,17 +516,31 @@
 bin_zle_call(char *name, char **args, char *ops, char func)
 {
     Thingy t;
+    struct modifier modsave;
 
     if(!zleactive || incompctlfunc || incompfunc) {
 	zerrnam(name, "widgets can only be called when ZLE is active",
 	    NULL, 0);
 	return 1;
     }
+    if (args[1]) {
+	modsave = zmod;
+	if (isdigit(*args[1])) {
+	    zmod.mult = atoi(args[1]);
+	    zmod.flags |= MOD_MULT;
+	}
+	else {
+	    zmod.mult = 1;
+	    zmod.flags &= ~MOD_MULT;
+	}
+    }
     t = rthingy(args[0]);
     PERMALLOC {
       execzlefunc(t);
     } LASTALLOC;
     unrefthingy(t);
+    if (args[1])
+	zmod = modsave;
     return 0;
 }
 
Index: Src/builtin.c
@@ -1353,7 +1353,6 @@
     }
 
     for (;;) {
-	ent->flags &= ~HIST_FOREIGN;
 	s = dupstring(ent->text);
 	/* this if does the pattern matching, if required */
 	if (!com || domatch(s, com, 0)) {
@@ -1361,8 +1360,10 @@
 	    fclistdone |= fcsubs(&s, subs);
 
 	    /* do numbering */
-	    if (n)
-		fprintf(f, "%5d  ", ent->histnum);
+	    if (n) {
+		fprintf(f, "%5d%c ", ent->histnum,
+			ent->flags & HIST_FOREIGN? '*' : ' ');
+	    }
 	    /* output actual time (and possibly date) of execution of the
 	    command, if required */
 	    if (d) {
Index: Src/hashtable.c
@@ -1323,9 +1323,8 @@
     HashNode oldnode = addhashnode2(ht, nam, nodeptr);
     Histent he = (Histent)nodeptr;
     if (oldnode && oldnode != nodeptr) {
-	if (he->flags & HIST_MAKEUNIQUE) {
-	    if (!(he->flags & HIST_FOREIGN))
-		oldnode->flags &= ~HIST_FOREIGN;
+	if (he->flags & HIST_MAKEUNIQUE
+	 || (he->flags & HIST_FOREIGN && (Histent)oldnode == he->up)) {
 	    he->flags |= HIST_DUP;
 	    addhashnode(ht, oldnode->nam, oldnode); /* Remove the new dup */
 	}
Index: Src/hist.c
@@ -96,9 +96,17 @@
 /**/
 int histactive;
 
+/* Current setting of the associated option, but sometimes also includes
+ * the setting of the HIST_SAVE_NO_DUPS option. */
+
 /**/
 int hist_ignore_all_dups;
 
+/* What flags (if any) we should skip when moving through the history */
+
+/**/
+int hist_skip_flags;
+
 /* Bits of histactive variable */
 #define HA_ACTIVE	(1<<0)	/* History mechanism is active */
 #define HA_NOSTORE	(1<<1)	/* Don't store the line when finished */
@@ -854,6 +862,7 @@
 hend(void)
 {
     int flag, save = 1;
+    char *hf = getsparam("HISTFILE");
 
     DPUTS(!chline, "BUG: chline is NULL in hend()");
     if (histdone & HISTFLAG_SETTY)
@@ -879,6 +888,9 @@
     if (hist_ignore_all_dups != isset(HISTIGNOREALLDUPS)
      && (hist_ignore_all_dups = isset(HISTIGNOREALLDUPS)) != 0)
 	histremovedups();
+    /* For history sharing, lock history file once for both read and write */
+    if (isset(SHAREHISTORY) && lockhistfile(hf, 0))
+	readhistfile(hf, 0, HFILE_USE_OPTIONS | HFILE_FAST);
     flag = histdone;
     histdone = 0;
     if (hptr < chline + 1)
@@ -916,7 +928,7 @@
 	Histent he;
 	int keepflags;
 
-	for (he = hist_ring; he && he->flags & HIST_FOREIGN;
+	for (he = hist_ring; he && he->flags & hist_skip_flags;
 	     he = up_histent(he)) ;
 #ifdef DEBUG
 	/* debugging only */
@@ -961,7 +973,8 @@
     chline = NULL;
     histactive = 0;
     if (isset(SHAREHISTORY) || isset(INCREMENTALAPPENDHISTORY))
-	savehistfile(NULL, 1, HFILE_USE_OPTIONS | HFILE_FAST);
+	savehistfile(hf, 1, HFILE_USE_OPTIONS | HFILE_FAST);
+    unlockhistfile(hf); /* It's OK to call this even if we aren't locked */
     return !(flag & HISTFLAG_NOEXEC || errflag);
 }
 
@@ -973,9 +986,7 @@
 {
     if (!(histactive & HA_ACTIVE)) {
 	if (!(histactive & HA_JUNKED)) {
-	    /* make sure this doesn't show up when we do firsthist() */
-	    if (hist_ring->histnum == curhist)
-		freehistnode((HashNode)hist_ring);
+	    freehistnode((HashNode)hist_ring);
 	    histactive |= HA_JUNKED;
 	    /* curhist-- is delayed until the next hbegin() */
 	}
@@ -1589,7 +1600,6 @@
 	    return;
 	lasthist.fsiz = sb.st_size;
 	lasthist.mtim = sb.st_mtime;
-	readflags |= HFILE_SKIPOLD;
     }
     else if (!lockhistfile(fn, 1))
 	return;
@@ -1614,7 +1624,8 @@
 	newflags = HIST_OLD | HIST_READ;
 	if (readflags & HFILE_FAST)
 	    newflags |= HIST_FOREIGN;
-	if (readflags & HFILE_SKIPOLD)
+	if (readflags & HFILE_SKIPOLD
+	 || (hist_ignore_all_dups && newflags & hist_skip_flags))
 	    newflags |= HIST_MAKEUNIQUE;
 	while (fpos = ftell(in), fgets(buf, bufsiz, in)) {
 	    int l = strlen(buf);
@@ -1756,13 +1767,7 @@
 	    lasthist.next_write_ev = he->histnum + 1;
 	    he = down_histent(he);
 	}
-	/* If we have something to write, lock before the (potential)
-	 * read so that we don't lock twice. */
-	if (he && !lockhistfile(fn, 0))
-	    return;
-	if (isset(SHAREHISTORY))
-	    readhistfile(fn, 0, HFILE_USE_OPTIONS | HFILE_FAST);
-	if (!he)
+	if (!he || !lockhistfile(fn, 0))
 	    return;
 	if (histfile_linect > savehist + savehist / 5)
 	    writeflags &= ~HFILE_FAST;
@@ -1890,7 +1895,7 @@
 			continue;
 		}
 		else if (keep_trying) {
-		    if (time(NULL) - sb.st_mtime < 5)
+		    if (time(NULL) - sb.st_mtime < 10)
 			sleep(1);
 		    else
 			unlink(lockfile);
@@ -1906,6 +1911,10 @@
     }
     return ct != lockhistct;
 }
+
+/* Unlock the history file if this corresponds to the last nested lock
+ * request.  If we don't have the file locked, just return.
+ */
 
 /**/
 void
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---


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

* Re: PATCH: history improvements for 3.1.5-pws-17 and 3.0.6-pre-2
  1999-05-10  7:53     ` Peter Stephenson
  1999-05-11  9:39       ` PATCH: history improvements for 3.1.5-pws-17 Wayne Davison
@ 1999-05-29  7:08       ` Bart Schaefer
  1 sibling, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 1999-05-29  7:08 UTC (permalink / raw)
  To: Zsh hackers list

Another message I wish I could have replied to sooner.

On May 10,  9:53am, Peter Stephenson wrote:
} Subject: Re: PATCH: history improvements for 3.1.5-pws-17 and 3.0.6-pre-2
}
} Wayne Davison wrote:
} > I'd be interested in suggestions for how we can let the user choose
} > between local-history and full-history movement.  Perhaps a toggle
} > command?  Or a bindable prefix (so I can have ^P ignore shared
} > history, and Up-Arrow include it)?  I like this idea.
} 
} You mean something like a toggle, either for the next command only or
} permanently?  That might work.  You could then have a zle widget
} 
} up-line-or-local-history {
}   zle toggle-local-history
}   zle up-line-or-history
} }

Ugh.  I hate toggles.  You can't ask what state you're starting in, and
thus you can't know what state you should end up in.  What if I'm already
using local history when I invoke up-line-or-local-history?

If we're going to have any more toggles (overwrite-mode is the only one
we have so far, I think) then let's establish some kind of convention for
the behavior of numeric prefixes; such as, a negative prefix always turns
the toggled behavior off, a positive prefix always turns it on, and no
prefix switches between off and on.

And then somebody please fix "zle digit-argument", see zsh-workers/4099.
(Probably applies to universal-argument and neg-argument as well.)

} > I think that some zle commands, such as accept_and_infer_next_
} > history, should remain unaffected by foreign commands.

Oh, definitely.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

* Re: PATCH: history improvements for 3.1.5-pws-17
  1999-05-11  9:39       ` PATCH: history improvements for 3.1.5-pws-17 Wayne Davison
@ 1999-05-29  7:26         ` Bart Schaefer
  0 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 1999-05-29  7:26 UTC (permalink / raw)
  To: Wayne Davison; +Cc: Zsh hackers list

Man, I hate getting this far behind.

On May 11,  2:39am, Wayne Davison wrote:
} Subject: Re: PATCH: history improvements for 3.1.5-pws-17
}
} > Hmmm, it might be a good idea to make `zle widget num' override the
} > value of $NUMERIC with num when calling a widget.
} 
} I like this -- it makes writing an up-line-or-local-history function
} much simpler.

Way back in zsh-workers/4103 I griped:

    ... right now it's completely impossible for a user-defined
    widget to initiate a history search; "zle history-search-backward"
    just causes the shell to prompt the user for input, but the
    widget may already have a string it wants to search for.
    "history-search-backward string" is the natural way to perform
    that action.

If we're implementing this, why are we limiting it to *numeric* arguments?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

end of thread, other threads:[~1999-05-29  7:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-08  2:50 PATCH: history improvements for 3.1.5-pws-17 and 3.0.6-pre-2 Wayne Davison
1999-05-08 14:01 ` Peter Stephenson
1999-05-08 23:43   ` Wayne Davison
1999-05-10  7:53     ` Peter Stephenson
1999-05-11  9:39       ` PATCH: history improvements for 3.1.5-pws-17 Wayne Davison
1999-05-29  7:26         ` Bart Schaefer
1999-05-29  7:08       ` PATCH: history improvements for 3.1.5-pws-17 and 3.0.6-pre-2 Bart Schaefer

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).