[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 40e73bc 123/215: Merge pull request #92 from cpitclaudel/8
From: |
Rocky Bernstein |
Subject: |
[elpa] master 40e73bc 123/215: Merge pull request #92 from cpitclaudel/82-add-safe-mode |
Date: |
Sat, 30 Jul 2016 14:48:59 +0000 (UTC) |
branch: master
commit 40e73bc005407accadfc4fa9933695358a31dc64
Merge: 75737a0 78d9901
Author: R. Bernstein <address@hidden>
Commit: R. Bernstein <address@hidden>
Merge pull request #92 from cpitclaudel/82-add-safe-mode
Add a "safe mode" setting (on by default)
---
realgud/common/cmds.el | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/realgud/common/cmds.el b/realgud/common/cmds.el
index 72eebd5..5eeb45f 100644
--- a/realgud/common/cmds.el
+++ b/realgud/common/cmds.el
@@ -31,6 +31,24 @@
(declare-function realgud:terminate 'realgud-core)
(declare-function realgud:terminate-srcbuf 'realdgud-core)
+(defcustom realgud-safe-mode t
+ "Confirm certain commands before running them.
+Similar to GDB's “set confirm”."
+ :type 'boolean
+ :group 'realgud)
+
+(defun realgud:prompt-if-prefix-or-safe-mode(message)
+ "Ask use to confirm current command if in safe mode.
+Use MESSAGE plus a space as the prompt string. Do not confirm
+when command was run from a menu."
+ (if (and realgud-safe-mode last-nonmenu-event)
+ (when (y-or-n-p (concat message " "))
+ (run-with-timer
+ 0 nil #'message
+ "Customize `realgud-safe-mode' to disable confirmation prompts.")
+ t)
+ t))
+
(defun realgud:cmd-remap(arg cmd-name default-cmd-template key
&optional no-record? frame-switch?
realgud-prompts?)
@@ -89,11 +107,14 @@ a shortcut for that key."
(defun realgud:cmd-continue(&optional arg)
"Continue execution.
-With prefix argument, prompt for argument to \"continue\"
-command."
+With prefix argument ARG, prompt for argument to \"continue\"
+command. In safe mode (or with prefix arg), confirm before
+running."
(interactive (when (consp current-prefix-arg)
(list (read-string "Continue args: " nil nil nil t))))
- (realgud:cmd-remap arg "continue" "continue" "c"))
+ (when (or arg (realgud:prompt-if-prefix-or-safe-mode
+ "Continue to next breakpoint?"))
+ (realgud:cmd-remap arg "continue" "continue" "c")))
(defun realgud:cmd-delete(&optional arg)
"Delete breakpoint by number."
- [elpa] master 5155528 105/215: Bump version, (continued)
- [elpa] master 5155528 105/215: Bump version, Rocky Bernstein, 2016/07/30
- [elpa] master 76cb0d4 108/215: Fix wrong setq call, Rocky Bernstein, 2016/07/30
- [elpa] master 1716c8a 109/215: Towards fixing up tab completion in ipdb., Rocky Bernstein, 2016/07/30
- [elpa] master e04eeb2 117/215: Improve eval: run on region if active, and fall back to prompting, Rocky Bernstein, 2016/07/30
- [elpa] master fd00428 118/215: Merge pull request #86 from cpitclaudel/83-improve-e-binding, Rocky Bernstein, 2016/07/30
- [elpa] master b275bd2 119/215: Improve behavior of delete, enable, and disable, Rocky Bernstein, 2016/07/30
- [elpa] master ca33520 120/215: Add a prefix arg to "continue" command, Rocky Bernstein, 2016/07/30
- [elpa] master 379528b 106/215: Disable ipdb until melpa is updated, Rocky Bernstein, 2016/07/30
- [elpa] master e049c12 124/215: Merge pull request #89 from cpitclaudel/87-improve-delete-command, Rocky Bernstein, 2016/07/30
- [elpa] master 91704f9 141/215: Automatically attach to a command buffer when enabling short-key-mode, Rocky Bernstein, 2016/07/30
- [elpa] master 40e73bc 123/215: Merge pull request #92 from cpitclaudel/82-add-safe-mode,
Rocky Bernstein <=
- [elpa] master f3426ed 072/215: Merge branch 'master' of github.com:rocky/emacs-dbgr, Rocky Bernstein, 2016/07/30
- [elpa] master 4e85910 088/215: Add pytest error message pattern in python debuggers, Rocky Bernstein, 2016/07/30
- [elpa] master 01617c5 100/215: ipdb: add regex test, Rocky Bernstein, 2016/07/30
- [elpa] master 5395757 091/215: More cleanup from last two commits., Rocky Bernstein, 2016/07/30
- [elpa] master 1e2fe55 098/215: Add rspec loc pattern.., Rocky Bernstein, 2016/07/30
- [elpa] master ea5dcba 094/215: ipdb: add new debugger based on pdb, Rocky Bernstein, 2016/07/30
- [elpa] master d1c1176 146/215: Simplify the implementation of realgud:cmdbuf-associate, Rocky Bernstein, 2016/07/30
- [elpa] master 95f076e 150/215: Improve IPDB completion, Rocky Bernstein, 2016/07/30
- [elpa] master d45788c 152/215: Merge pull request #106 from rocky/75-ipdb-completion, Rocky Bernstein, 2016/07/30
- [elpa] master 032ea4b 143/215: Merge branch 'master' of github.com:rocky/emacs-dbgr, Rocky Bernstein, 2016/07/30