ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RP] Patch for extended history handling


From: Bernhard R. Link
Subject: [RP] Patch for extended history handling
Date: Mon, 16 Jun 2008 11:24:51 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Attached are some patches to improve ratpoison's history handling:

Currently all input is in the same history, handled with libhistory,
this has some disadvantages:

- history often has values that do no fit (like a shell command to
  start in a colon command and so on)
- size of the .ratpoison_history file is hard to control. While there
  was already a variable for that, it was nowhere used and could not
  be set.
- A repetitive line is only omitted if it was the last item so far.
  (42% of my .ratpoison_history are "quit" lines).

Attached patchset changes that. Some things to note, though:
- I kept the current default size of 20 lines to keep, which can be
  relatively low (with compaction not so low, though).
- Only the colon history is saved in .ratpoison_history. The shell-command
  history is recreated from that (though of course only to the full
  maximal length if all commands contain shell commands).
  Other histories (keymaps, groups, strings, ...) are not retained.
- Not everyone likes removing double items, though I made that an option
  (though it is enabled by default).
- Currently the read history is not compacted/truncated on start.
  Perhaps this could be done after .ratpoisonrc is processed (as that
  might contain an option to disable compaction or increase the size).
  On the other hand, why?
- Testing would be nice. Especially the storing of shell commands in
  the colon history might have some side effects for non-interactive
  commands that I've not yet thoroughly looked for.
- history expansion (libhistory's ! handling) is still possible when
  compiled with history, though disabled by default and implemented
  a bit ugly. (I guess more people are confused when an ! in commands
  does funny things than people wanting to use it)

Sorry for the filenames. That's what git produces and I was to lazy to
rename.

0001 to 0003 are just preparations and should be of value independently
of the rest. May I already apply those?

Hochachtungsvoll,
        Bernhard R. Link

Attachment: 0001-remove-unused-history_list_items-function.txt
Description: Text document

Attachment: 0002-Mark-command-arguments-as-arg_COMMAND.txt
Description: Text document

Attachment: 0003-make-xstrdup-argument-const-char.txt
Description: Text document

Attachment: 0004-define-different-history-types-and-use-them.txt
Description: Text document

Attachment: 0005-SHELLCMD-history-only-shows-execute-arguments-things-to-execute-are-stored-as-in-history-as-execute-commands.txt
Description: Text document

Attachment: 0006-move-all-HAVE_HISTORY-into-history.c.txt
Description: Text document

Attachment: 0007-alternate-history-implementation-when-no-libhistory-is-available.txt
Description: Text document

Attachment: 0008-add-set-historysize-and-set-historycompaction-defaulting-to-true-to-compact-history.txt
Description: Text document

Attachment: 0009-remove-libhistory-history-handling-only-feed-it-on-demand-when-doing-expansion.txt
Description: Text document

Attachment: 0010-make-history-expansion-an-option-switched-off-by-default.txt
Description: Text document

Attachment: 0011-ignore-non-existing-libhistory-unless-enable-history.txt
Description: Text document

Attachment: 0012-update-documentation.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]