I'm trying to use the list-register command out of register.el.
I set some registers to contain values:
(set-register ?a "register a" )
(set-register ?b "register b" )
(set-register ?c "register c" )
(set-register ?d "register d" )
evaling each with C-x C-e after the close paren on that line.
I can verify that the values are correct this way:
(view-register ?a )
(view-register ?b )
(view-register ?c )
(view-register ?d )
But when I run the command (list-registers) I get various errors:
wrong argument type: number-char-or-marker-p, "a"
But I didn't give it the string "a", I gave it char a ?a.
so what type is it expecting?
or
it gives me a buffer *output* with the words: Register a contains
then the following error in the minibuffer:
Invalid regexp: "Invalid content of \\{\\}"
putting debug on error on, from the menu, gives this backtrace:
Debugger entered--Lisp error: (invalid-regexp "Invalid content of \\{\\}")
string-match("[^ \n].\\{,20\\}" "register a")
describe-register-1(?a)
(progn (describe-register-1 (car elt)) (terpri))
(if (get-register (car elt)) (progn (describe-register-1 ...) (terpri)))
(while #:G34812 (setq elt (car #:G34812)) (if (get-register ...)
(progn ... ...)) (setq #:G34812 (cdr #:G34812)))
(let ((#:G34812 list) elt) (while #:G34812 (setq elt ...) (if ...
...) (setq #:G34812 ...)))
(catch (quote #:nil) (let (... elt) (while #:G34812 ... ... ...)))
(block nil (let (... elt) (while #:G34812 ... ... ...)))
(dolist (elt list) (when (get-register ...) (describe-register-1 ...)
(terpri)))
(with-output-to-temp-buffer "*Output*" (dolist (elt list) (when ...
... ...)))
(let ((list ...)) (setq list (sort* list ... :key ...))
(with-output-to-temp-buffer "*Output*" (dolist ... ...)))
list-registers()
eval((list-registers))
eval-interactive((list-registers))
eval-last-sexp(nil)
call-interactively(eval-last-sexp)
(dispatch-event "[internal]")
I assume the string-match is where it is failing
and that is part either of the sort* (when the error was wrong type)
or part of the describe-register function (when the error is invalid
regex).
the code for list-registers is short:
---from /usr/src/xemacs-21.5.32/lisp/register.el
(defun list-registers ()
"Display a list of nonempty registers saying briefly what they contain."
(interactive)
(let ((list (copy-sequence register-alist)))
(setq list (sort* list #'< :key #'car))
(with-output-to-temp-buffer "*Output*"
(dolist (elt list)
(when (get-register (car elt))
(describe-register-1 (car elt))
(terpri))))))
I looked up the sort* function, and understand the list that will be
sorted in place,
and the :key is to tell what field to base the sort on, the car of each
list item, so
sorting by register name here, I think,
but do not comprehend the predicate in the middle: #'<
Does the less than mean do an ascending or descending sort?
I haven't found a list in the manuals of what is allowed for the
predicate of sort*.
Any ideas?
Steve M.
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta