* bug#5148: Lossage in comint history @ 2009-12-07 17:27 ` Juri Linkov 2009-12-07 19:23 ` Stefan Monnier 2010-01-01 18:46 ` bug#5148: marked as done (Lossage in comint history) Emacs bug Tracking System 0 siblings, 2 replies; 4+ messages in thread From: Juri Linkov @ 2009-12-07 17:27 UTC (permalink / raw) To: bug-gnu-emacs Using M-x shell in Emacs causes lossage in .bash_history. I set HISTFILESIZE and HISTSIZE to large values in .bashrc to not truncate the history file but comint.el disregards my settings and truncates the history file used by bash. The following patch make `comint-input-ring-size' customizable. The type should be `integer' because this value is used by `make-ring' to create the history ring. The default value increased to 500 to be the same as the default value of HISTFILESIZE and HISTSIZE. Index: lisp/comint.el =================================================================== RCS file: /sources/emacs/emacs/lisp/comint.el,v retrieving revision 1.402 diff -c -r1.402 comint.el *** lisp/comint.el 1 Dec 2009 20:32:00 -0000 1.402 --- lisp/comint.el 7 Dec 2009 17:27:08 -0000 *************** *** 309,317 **** :type 'integer :group 'comint) ! ;; FIXME: this should be defcustom ! (defvar comint-input-ring-size 150 ! "Size of input history ring.") (defvar comint-input-ring-separator "\n" "Separator between commands in the history file.") --- 309,319 ---- :type 'integer :group 'comint) ! (defcustom comint-input-ring-size 500 ! "Size of input history ring." ! :type 'integer ! :group 'comint ! :version "23.2") (defvar comint-input-ring-separator "\n" "Separator between commands in the history file.") -- Juri Linkov http://www.jurta.org/emacs/ ^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#5148: Lossage in comint history 2009-12-07 17:27 ` bug#5148: Lossage in comint history Juri Linkov @ 2009-12-07 19:23 ` Stefan Monnier 2009-12-07 21:05 ` Juri Linkov 2010-01-01 18:46 ` bug#5148: marked as done (Lossage in comint history) Emacs bug Tracking System 1 sibling, 1 reply; 4+ messages in thread From: Stefan Monnier @ 2009-12-07 19:23 UTC (permalink / raw) To: Juri Linkov; +Cc: 5148 > Using M-x shell in Emacs causes lossage in .bash_history. > I set HISTFILESIZE and HISTSIZE to large values in .bashrc > to not truncate the history file but comint.el disregards > my settings and truncates the history file used by bash. That's the bug, yes, thank you. > The following patch make `comint-input-ring-size' customizable. > The type should be `integer' because this value is used by `make-ring' > to create the history ring. The default value increased to 500 > to be the same as the default value of HISTFILESIZE and HISTSIZE. Actually, to fix the bug right, comint-read-input-ring should be changed to grow the ring so as to accomodate all the saved history. This might still truncate it more than bash would have, but at least it won't make your .bash_history shorter than it was. Stefan > Index: lisp/comint.el > =================================================================== > RCS file: /sources/emacs/emacs/lisp/comint.el,v > retrieving revision 1.402 > diff -c -r1.402 comint.el > *** lisp/comint.el 1 Dec 2009 20:32:00 -0000 1.402 > --- lisp/comint.el 7 Dec 2009 17:27:08 -0000 > *************** > *** 309,317 **** > :type 'integer > :group 'comint) > ! ;; FIXME: this should be defcustom > ! (defvar comint-input-ring-size 150 > ! "Size of input history ring.") > (defvar comint-input-ring-separator "\n" > "Separator between commands in the history file.") > --- 309,319 ---- > :type 'integer > :group 'comint) > ! (defcustom comint-input-ring-size 500 > ! "Size of input history ring." > ! :type 'integer > ! :group 'comint > ! :version "23.2") > (defvar comint-input-ring-separator "\n" > "Separator between commands in the history file.") > -- > Juri Linkov > http://www.jurta.org/emacs/ ^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#5148: Lossage in comint history 2009-12-07 19:23 ` Stefan Monnier @ 2009-12-07 21:05 ` Juri Linkov 0 siblings, 0 replies; 4+ messages in thread From: Juri Linkov @ 2009-12-07 21:05 UTC (permalink / raw) To: Stefan Monnier; +Cc: 5148 >> The following patch make `comint-input-ring-size' customizable. >> The type should be `integer' because this value is used by `make-ring' >> to create the history ring. The default value increased to 500 >> to be the same as the default value of HISTFILESIZE and HISTSIZE. > > Actually, to fix the bug right, comint-read-input-ring should be changed > to grow the ring so as to accomodate all the saved history. This might > still truncate it more than bash would have, but at least it won't make > your .bash_history shorter than it was. Someone still might want to truncate the history to the length defined by `comint-input-ring-size'. So adding defcustom is useful in any case. Later we could add more options to `comint-input-ring-size' e.g. `t' like in `message-log-max'. It's easy to implement this (by reading all history in `comint-read-input-ring' and using `ring-insert+extend' while adding new elements) but I don't think this should be the default because bash users might prefer `comint-input-ring-size' to have the same value as `HISTFILESIZE'. Maybe we should add another option for `comint-input-ring-size' to set it to (getenv "HISTFILESIZE") when it is used by `M-x shell'. -- Juri Linkov http://www.jurta.org/emacs/ ^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#5148: marked as done (Lossage in comint history) 2009-12-07 17:27 ` bug#5148: Lossage in comint history Juri Linkov 2009-12-07 19:23 ` Stefan Monnier @ 2010-01-01 18:46 ` Emacs bug Tracking System 1 sibling, 0 replies; 4+ messages in thread From: Emacs bug Tracking System @ 2010-01-01 18:46 UTC (permalink / raw) To: Chong Yidong; +Cc: emacs-bug-tracker [-- Attachment #1: Type: text/plain, Size: 803 bytes --] Your message dated Fri, 01 Jan 2010 13:45:32 -0500 with message-id <87y6kh8y0j.fsf@stupidchicken.com> and subject line Re: Lossage in comint history has caused the Emacs bug report #5148, regarding Lossage in comint history to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact bug-gnu-emacs@gnu.org immediately.) -- 5148: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5148 Emacs Bug Tracking System Contact bug-gnu-emacs@gnu.org with problems [-- Attachment #2: Type: message/rfc822, Size: 3454 bytes --] From: Juri Linkov <juri@jurta.org> To: bug-gnu-emacs@gnu.org Subject: Lossage in comint history Date: Mon, 07 Dec 2009 19:27:34 +0200 Message-ID: <87iqcjeq45.fsf@mail.jurta.org> Using M-x shell in Emacs causes lossage in .bash_history. I set HISTFILESIZE and HISTSIZE to large values in .bashrc to not truncate the history file but comint.el disregards my settings and truncates the history file used by bash. The following patch make `comint-input-ring-size' customizable. The type should be `integer' because this value is used by `make-ring' to create the history ring. The default value increased to 500 to be the same as the default value of HISTFILESIZE and HISTSIZE. Index: lisp/comint.el =================================================================== RCS file: /sources/emacs/emacs/lisp/comint.el,v retrieving revision 1.402 diff -c -r1.402 comint.el *** lisp/comint.el 1 Dec 2009 20:32:00 -0000 1.402 --- lisp/comint.el 7 Dec 2009 17:27:08 -0000 *************** *** 309,317 **** :type 'integer :group 'comint) ! ;; FIXME: this should be defcustom ! (defvar comint-input-ring-size 150 ! "Size of input history ring.") (defvar comint-input-ring-separator "\n" "Separator between commands in the history file.") --- 309,319 ---- :type 'integer :group 'comint) ! (defcustom comint-input-ring-size 500 ! "Size of input history ring." ! :type 'integer ! :group 'comint ! :version "23.2") (defvar comint-input-ring-separator "\n" "Separator between commands in the history file.") -- Juri Linkov http://www.jurta.org/emacs/ [-- Attachment #3: Type: message/rfc822, Size: 2649 bytes --] From: Chong Yidong <cyd@stupidchicken.com> To: Juri Linkov <juri@jurta.org> Cc: 5148-done@debbugs.gnu.org Subject: Re: Lossage in comint history Date: Fri, 01 Jan 2010 13:45:32 -0500 Message-ID: <87y6kh8y0j.fsf@stupidchicken.com> > Using M-x shell in Emacs causes lossage in .bash_history. > > I set HISTFILESIZE and HISTSIZE to large values in .bashrc > to not truncate the history file but comint.el disregards > my settings and truncates the history file used by bash. > > The following patch make `comint-input-ring-size' customizable. The > type should be `integer' because this value is used by `make-ring' to > create the history ring. The default value increased to 500 to be the > same as the default value of HISTFILESIZE and HISTSIZE. Looks reasonable enough to me. Checked in, thanks. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-01 18:46 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <87y6kh8y0j.fsf@stupidchicken.com> 2009-12-07 17:27 ` bug#5148: Lossage in comint history Juri Linkov 2009-12-07 19:23 ` Stefan Monnier 2009-12-07 21:05 ` Juri Linkov 2010-01-01 18:46 ` bug#5148: marked as done (Lossage in comint history) Emacs bug Tracking System
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git 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 read-only IMAP folder(s) and NNTP newsgroup(s).