[Top][All Lists]

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

bug#25188: Initialization of `global-edebug-map' is not safe

From: Alexander Shukaev
Subject: bug#25188: Initialization of `global-edebug-map' is not safe
Date: Tue, 13 Dec 2016 00:45:07 +0100


first of all, in 'edebug.el', the

;; If you wish to change the default edebug global command prefix, change:
;; (setq edebug-global-prefix "\C-xX")

is invalid because the name of the variable is actually `global-edebug-prefix'. But that's just a minor point.


(defvar global-edebug-map
  (let ((map (make-sparse-keymap)))

    (define-key map " " 'edebug-step-mode)
    (define-key map "g" 'edebug-go-mode)
    (define-key map "G" 'edebug-Go-nonstop-mode)
    (define-key map "t" 'edebug-trace-mode)
    (define-key map "T" 'edebug-Trace-fast-mode)
    (define-key map "c" 'edebug-continue-mode)
    (define-key map "C" 'edebug-Continue-fast-mode)

    ;; breakpoints
    (define-key map "b" 'edebug-set-breakpoint)
    (define-key map "u" 'edebug-unset-breakpoint)
    (define-key map "x" 'edebug-set-conditional-breakpoint)
    (define-key map "X" 'edebug-set-global-break-condition)

    ;; views
    (define-key map "w" 'edebug-where)
    (define-key map "W" 'edebug-toggle-save-windows)

    ;; quitting
    (define-key map "q" 'top-level)
    (define-key map "Q" 'edebug-top-level-nonstop)
    (define-key map "a" 'abort-recursive-edit)

    ;; statistics
    (define-key map "=" 'edebug-display-freq-count)
  "Global map of edebug commands, available from any buffer.")

(global-unset-key global-edebug-prefix)
(global-set-key global-edebug-prefix global-edebug-map)

and imagine that somebody has customized `global-map' in such a way that it has no "\C-x" prefix command at all. Then of course the above code will fail. Furthermore, if one does not want to pollute the `global-map' with `global-edebug-map', one cannot simply set `global-edebug-prefix' to nil because this would also fail. I believe `global-edebug-map' should support the nil value which would mean that the above code is disabled completely.

Looking forward to fix.


reply via email to

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