Hello Drew, Drew Adams writes: > The request (and thus the change that RMS asked to be > made) was this: > Any chance that the number of keystrokes displayed > by `view-lossage', currently hard-coded at 100, > could be made a user option? > ^^^^^^^^^^^ > Since then, the hard-coded limit was upped to 300. > But there still is no user option, is there? Could > we please add an option for this now? The code is > in C - it's not simple for a user to change the > value without a Lisp variable for it. I took this task as a goal in my first attempt to write code to Emacs C core. What I could get for now is in the patch attached. It seems to work fine for ‘num-recent-keys’[1] strictly positive, but it segfaults promptly for other values (understandably). What I did was to replace the C macro constant ‘NUM_RECENT_KEYS’ , with the Lisp-visible variable ‘num-recent-keys’, defined using ‘DEFVAR_INT’, and then define a C function called ‘ensure_recent_keys_size’ to keep the size of the vector ‘recent-keys’ truthful to that; shrinking or enlarging the vector.[2] The problem is, I had to place calls to ‘ensure_recent_keys_size’ scattered throughout the source --- strategically before references to ‘num_recent_keys’. This is clearly not the right approach. What is needed is a way to intercept changes to that variable and do the job once, before anything else happens. I think this would fix my fragile hack. Furthermore, that interception routine could prevent values smaller than 1 --- set from the Lisp world --- to be rejected (not only non-integers), hopefully preventing the crashes I’m experiencing now. In the Lisp reference documentation, I was unable to find a way to do that. I thought that if that mechanism existed it’d be important enough to be documented. I couldn’t find it in a quick look around the code neither. How is the interception of change of variables from the Lisp world canonically handled by Emacs C source code? Footnotes: [1] This is the requested user option. [2] Actually creating another vector of the right size and copying the data over as needed.