aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2024-11-05 11:52:13 +1100
committerYuchen Pei <id@ypei.org>2024-11-05 11:52:13 +1100
commit90b0da4820632a040975ce825c69322e7d7d0d7f (patch)
tree3d4c6cec96f18d6f4a49c6a155a2caed6b09c7c8
parent6f7d2224f66f0c8442780955e467ca600bb91ebf (diff)
[emacs][gdb] minor changesHEADmaster
* emacs/.emacs.d/init/ycp-org.el: disable read-only in org edit special buffer * emacs/.emacs.d/lisp/my/my-org.el: ^ * misc/.gdbinit: a break-and-continue convenience function
-rw-r--r--emacs/.emacs.d/init/ycp-org.el1
-rw-r--r--emacs/.emacs.d/lisp/my/my-org.el6
-rw-r--r--misc/.gdbinit4
3 files changed, 11 insertions, 0 deletions
diff --git a/emacs/.emacs.d/init/ycp-org.el b/emacs/.emacs.d/init/ycp-org.el
index 430335a..eb5a63d 100644
--- a/emacs/.emacs.d/init/ycp-org.el
+++ b/emacs/.emacs.d/init/ycp-org.el
@@ -498,6 +498,7 @@
(advice-add 'org-insert-structure-template :after 'my-org-edit-special)
(advice-add 'org-edit-src-exit :before 'my-org-edit-src-before-exit)
(advice-add 'org-edit-src-exit :after 'my-org-edit-src-after-exit)
+ (advice-add 'org-edit-special :after 'my-org-edit-special-after)
(my-setq-from-local my-org-task-categories))
(my-package my-org
diff --git a/emacs/.emacs.d/lisp/my/my-org.el b/emacs/.emacs.d/lisp/my/my-org.el
index 4fea460..698b0d3 100644
--- a/emacs/.emacs.d/lisp/my/my-org.el
+++ b/emacs/.emacs.d/lisp/my/my-org.el
@@ -1364,6 +1364,12 @@ With a prefix arg, yank and exit immediately."
(yank))
(org-edit-src-exit))))
+;; used to add an :after advice to `org-edit-special'.
+(defun my-org-edit-special-after (_)
+ ;; some modes (e.g. diff mode) are read-only by default, which
+ ;; does not make sense when the intention is to edit
+ (read-only-mode 0))
+
(defun my-link-to-line-number-in-prog-mode ()
"When in prog-mode, use line number as search item."
(when (derived-mode-p 'prog-mode)
diff --git a/misc/.gdbinit b/misc/.gdbinit
index b2c8a1f..b84dbef 100644
--- a/misc/.gdbinit
+++ b/misc/.gdbinit
@@ -19,6 +19,10 @@ alias wl = watch -l
alias awl = awatch -l
alias rwl = rwatch -l
alias rt = restart
+define bc
+ b $arg0
+ c
+end
# Print backtrace of all threads
alias abt = thread apply all bt
set history save on