unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alexander Shukaev <emacs@Alexander.Shukaev.name>
To: 25188@debbugs.gnu.org
Subject: bug#25188: Initialization of `global-edebug-map' is not safe
Date: Tue, 13 Dec 2016 00:45:07 +0100	[thread overview]
Message-ID: <4f637d8d-29c0-d6cb-6e7e-824bdb173601@Alexander.Shukaev.name> (raw)

Hi,

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.

Consider

(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)
     map)
   "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.

Regards,
Alexander





             reply	other threads:[~2016-12-12 23:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-12 23:45 Alexander Shukaev [this message]
2019-10-09  7:27 ` bug#25188: Initialization of `global-edebug-map' is not safe Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f637d8d-29c0-d6cb-6e7e-824bdb173601@Alexander.Shukaev.name \
    --to=emacs@alexander.shukaev.name \
    --cc=25188@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).