diff options
author | Case Duckworth | 2022-10-17 21:27:59 -0500 |
---|---|---|
committer | Case Duckworth | 2022-10-17 21:27:59 -0500 |
commit | 3e78d1f8ca5b100f39577790614433398bc6a422 (patch) | |
tree | f65f3164ac143c81da877375adce7f1f1492a01f /lisp/+emacs.el | |
parent | bleh (diff) | |
download | emacs-3e78d1f8ca5b100f39577790614433398bc6a422.tar.gz emacs-3e78d1f8ca5b100f39577790614433398bc6a422.zip |
asoi
Diffstat (limited to 'lisp/+emacs.el')
-rw-r--r-- | lisp/+emacs.el | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/+emacs.el b/lisp/+emacs.el index b69d1a0..9158b62 100644 --- a/lisp/+emacs.el +++ b/lisp/+emacs.el | |||
@@ -316,8 +316,9 @@ ARG is passed to `backward-kill-word'." | |||
316 | 316 | ||
317 | (defun +save-some-buffers-p () | 317 | (defun +save-some-buffers-p () |
318 | "Predicate for `save-some-buffers-default-predicate'. | 318 | "Predicate for `save-some-buffers-default-predicate'. |
319 | It returns nil with remote files." | 319 | It returns nil with remote files and those without attached files." |
320 | (not (file-remote-p (buffer-file-name)))) | 320 | (and (buffer-file-name) |
321 | (not (file-remote-p (buffer-file-name))))) | ||
321 | 322 | ||
322 | ;; https://www.wwwtech.de/articles/2013/may/emacs:-jump-to-matching-paren-beginning-of-block | 323 | ;; https://www.wwwtech.de/articles/2013/may/emacs:-jump-to-matching-paren-beginning-of-block |
323 | (defun +goto-matching-paren (&optional arg) | 324 | (defun +goto-matching-paren (&optional arg) |
@@ -333,6 +334,14 @@ It returns nil with remote files." | |||
333 | ((looking-back "[\[\(\{]" 1) (backward-char) (forward-sexp arg)) | 334 | ((looking-back "[\[\(\{]" 1) (backward-char) (forward-sexp arg)) |
334 | (t (up-list arg t t)))) | 335 | (t (up-list arg t t)))) |
335 | 336 | ||
337 | (defun +delete-window-or-bury-buffer () | ||
338 | "Delete the current window, or bury the current buffer. | ||
339 | If the current window is the only window, bury the buffer." | ||
340 | (interactive) | ||
341 | (condition-case e | ||
342 | (delete-window) | ||
343 | (t (bury-buffer)))) | ||
344 | |||
336 | 345 | ||
337 | ;;; Bindings | 346 | ;;; Bindings |
338 | 347 | ||
@@ -348,6 +357,7 @@ It returns nil with remote files." | |||
348 | (global-set-key (kbd "C-x 4 n") #'clone-buffer) | 357 | (global-set-key (kbd "C-x 4 n") #'clone-buffer) |
349 | ;; https://christiantietze.de/posts/2022/07/shift-click-in-emacs-to-select/ | 358 | ;; https://christiantietze.de/posts/2022/07/shift-click-in-emacs-to-select/ |
350 | (global-set-key (kbd "S-<down-mouse-1>") #'mouse-set-mark) | 359 | (global-set-key (kbd "S-<down-mouse-1>") #'mouse-set-mark) |
360 | (global-set-key (kbd "C-x 0") #'+delete-window-or-bury-buffer) | ||
351 | 361 | ||
352 | 362 | ||
353 | ;;; Required libraries | 363 | ;;; Required libraries |