Q: Is there a way to create one cache that consists of one cons cell and two hash tables? If so, how, please. If not, what is the best way to handle this scenario?
Background:
I'm working on a new feature for speedbar that creates a cache for:
nth 0: a cons cell -- i.e., (cons speedbar-shown-directories (buffer-string))
nth 1: a hash table [use line number to find absolute file name]
nth 2: a hash table [use absolute file name to find line number].
The cache is speedbar-full-text-cache
. I thought it would be handy to create a list of three elements -- the regular last open directory is saved in its entirety for ultra-fast switching for the first element (i.e., nth 0), and then I wanted to add two hash tables. So the thought was to create something like:
STEP 1:
(setq speedbar-full-text-cache
(list (cons speedbar-shown-directories (buffer-string))))
STEP 2: Try to append two hash tables.
(setq speedbar-full-text-cache
(append speedbar-full-text-cache
speedbar-line-to-node-table speedbar-node-to-line-table))
RESULT: Debugger entered--Lisp error: (wrong-type-argument sequencep #s(hash-table size 97 test eql rehash-size 1.5 rehash-threshold 0.8 data . . .