From 25f0fe5d68ebec67f3a1ca2f24c4a0bc8e49381f Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 5 Apr 2024 09:12:32 +1100 Subject: [emacs][urxvt] bunch of small changes - add org clock string to frame title - add ansi color to compilation buffer - look for project source dir from build dir - fix my-kill-sexp-or-comment - more lines in urxvt --- emacs/.emacs.d/lisp/my/my-editing.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'emacs/.emacs.d/lisp/my/my-editing.el') diff --git a/emacs/.emacs.d/lisp/my/my-editing.el b/emacs/.emacs.d/lisp/my/my-editing.el index 2c1abfb..aa65ba1 100644 --- a/emacs/.emacs.d/lisp/my/my-editing.el +++ b/emacs/.emacs.d/lisp/my/my-editing.el @@ -493,9 +493,12 @@ With an prefix-arg, copy the file name relative to project root." (defun my-kill-sexp-or-comment (&optional n) "Kill the next n sexp. On failure, call `comment-kill' instead." (interactive) - (condition-case _ - (kill-sexp n) - (scan-error (comment-kill (or n 1))))) + (let ((old-max (point-max)) + (old-point (point))) + (comment-kill (or n 1)) + (when (= old-max (point-max)) + (goto-char old-point) + (kill-sexp n)))) (defun my-mark-sexp-or-comment () "Mark the next sexp or comment." -- cgit v1.2.3