On 2011-04-04 22:29 +0800, Stefan Monnier wrote: > Please capitalize your comments and add a closing ".". > Why "memeory"? ;-) Fixed. >> +(defvar register-hash-table (make-hash-table)) > > Why change it to a hash-table? It is simpler to work with. No need to check if a register named ?a is defined or not, just override it whenever making a new register. > Remove `extra': it's unused, undocumented, and doesn't seem to be any > use (there's already `value'). Done. >> +VALUE may be a string, number, marker or list. > > IIUC this is not true any more, it can be any value. It can be any value but all the user commands may not be able to deal with it. This patch removes this limit (for the major user commands). >> +(define-obsolete-function-alias 'set-register 'register-make "24.1") >> +(make-obsolete 'get-register "use `register-find' and `register-value'." "24.1") > > A more backward-compatible change would be to not use register-structs > for pre-existing cases (i.e. markers, strings, lists of string, and > win-confs). I.e. only add register structs as a new accepted kind > of value (and move `name' out of the struct). > > The patch would most likely be a lot smaller. The original register.el is very inflexible and does its work mostly by guess because it misses the best moment to decide how to jump/insert/print a register i.e. at the time of creating it. So we will have to make almost all values a struct anyway to fix bugs like this: the original insert-register checks a value is a cons cell and called insert-rectangle on it, which fails for file-query registers and possible other values too. As I said in another post, subsequent to this patch I will break down jump-to-register, describe-register-1, insert-register to take advantage of this new implementation. > Stefan