diff options
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/init/ycp-basic.el | 2 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-complete.el | 2 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-editing.el | 7 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-emms.el | 3 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-gnus.el | 9 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-help.el | 2 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-prog.el | 4 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-emms.el | 12 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-prog.el | 20 | ||||
-rw-r--r-- | emacs/.emacs.d/tempel-templates | 7 |
10 files changed, 53 insertions, 15 deletions
diff --git a/emacs/.emacs.d/init/ycp-basic.el b/emacs/.emacs.d/init/ycp-basic.el index b03d0d4..12c21d1 100644 --- a/emacs/.emacs.d/init/ycp-basic.el +++ b/emacs/.emacs.d/init/ycp-basic.el @@ -49,6 +49,8 @@ (setq attempt-stack-overflow-recovery nil) (setq confirm-kill-processes nil) (setq attempt-orderly-shutdown-on-fatal-signal nil) + ;; Use visible bell instead of beeping + (setq visible-bell t) ) (my-package my-utils diff --git a/emacs/.emacs.d/init/ycp-complete.el b/emacs/.emacs.d/init/ycp-complete.el index bd3b3ca..16ddbfe 100644 --- a/emacs/.emacs.d/init/ycp-complete.el +++ b/emacs/.emacs.d/init/ycp-complete.el @@ -155,7 +155,7 @@ #'my-corfu-enable-always-in-minibuffer 1) ;;; corfu does not work well in gud as it "flushes" completion ;;; suggestions to the buffer - (setq corfu-exclude-modes '(gud-mode)) + (setq global-corfu-modes '((not gud-mode) t)) ) ;;; We still need company mode because corfu does not work well in diff --git a/emacs/.emacs.d/init/ycp-editing.el b/emacs/.emacs.d/init/ycp-editing.el index 203b185..81a46b1 100644 --- a/emacs/.emacs.d/init/ycp-editing.el +++ b/emacs/.emacs.d/init/ycp-editing.el @@ -38,9 +38,10 @@ (setq window-divider-default-bottom-width 1) (setq line-number-display-limit-width 9999) (setq window-divider-default-places 'bottom-only) -;; don't interpret C-m as RET -(define-key input-decode-map [?\C-m] [C-m]) -(define-key input-decode-map [?\C-i] [C-i]) +;; If run in gui, don't interpret C-m as RET +(when (display-graphic-p) + (define-key input-decode-map [?\C-m] [C-m]) + (define-key input-decode-map [?\C-i] [C-i])) ;; fixme: the line below does not work ;; (define-key input-decode-map [?\C-M-m] [C-M-m]) (setq save-place-file (locate-user-emacs-file "saveplace")) diff --git a/emacs/.emacs.d/init/ycp-emms.el b/emacs/.emacs.d/init/ycp-emms.el index d83b53b..a3a4604 100644 --- a/emacs/.emacs.d/init/ycp-emms.el +++ b/emacs/.emacs.d/init/ycp-emms.el @@ -40,7 +40,7 @@ (setq emms-source-playlist-default-format 'native) (setq emms-repeat-playlist t) (my-keybind emms-playlist-mode-map "C-x C-f" #'emms-play-playlist) - (setq emms-player-list '(emms-player-mpv)) + (setq emms-player-list '(emms-player-mpv emms-player-vlc)) (setq emms-player-vlc-parameters '("--intf=qt" "--extraintf=rc")) (setq emms-playlist-buffer-name "*EMMS Playlist*") (setq emms-source-file-directory-tree-function @@ -91,6 +91,7 @@ (add-hook 'emms-playlist-selection-changed-hook 'my-emms-output-current-track-to-i3bar-file) (setq emms-player-next-function 'my-emms-next-track-or-random-album) + (setq emms-players-preference-f 'my-emms-players-preference) (my-keybind dired-mode-map "e" #'my-dired-add-to-emms) (my-override emms-track-simple-description) (my-emms-add-all) diff --git a/emacs/.emacs.d/init/ycp-gnus.el b/emacs/.emacs.d/init/ycp-gnus.el index 90a2c5a..305225f 100644 --- a/emacs/.emacs.d/init/ycp-gnus.el +++ b/emacs/.emacs.d/init/ycp-gnus.el @@ -97,6 +97,15 @@ "C-c n u" #'gnus-group-get-new-news) (my-server-timer my-gnus-new-news-timer nil 300 'my-gnus-group-get-new-news-quietly) + ;; https://superuser.com/questions/519685/gnus-get-rid-of-mail-and-news-folders + ;; this also fixes issues with presumably nonexisting + ;; nndraft-directory causing + ;; (wrong-type-argument stringp nndraft-directory) + ;; which may require a restart of gnus to fix + (setq message-directory "~/.emacs.d/mail/") + (setq gnus-directory "~/.emacs.d/news/") + (setq nnfolder-directory "~/.emacs.d/mail/archive") + (setq nndraft-directory "~/.emacs.d/mail/drafts/") ) (my-configure diff --git a/emacs/.emacs.d/init/ycp-help.el b/emacs/.emacs.d/init/ycp-help.el index 3503a6d..5cbbed0 100644 --- a/emacs/.emacs.d/init/ycp-help.el +++ b/emacs/.emacs.d/init/ycp-help.el @@ -81,7 +81,7 @@ (my-package my-help (:delay 10) (my-keybind global-map - "C-h M" #'my-woman-man + "C-h M" #'man "C-h i" #'my-info-display-manual "C-h ." #'my-describe-symbol-at-point "\C-h!" #'my-external-command-open-source) diff --git a/emacs/.emacs.d/init/ycp-prog.el b/emacs/.emacs.d/init/ycp-prog.el index e2d7451..f77a8bd 100644 --- a/emacs/.emacs.d/init/ycp-prog.el +++ b/emacs/.emacs.d/init/ycp-prog.el @@ -81,6 +81,7 @@ (setq gdb-many-windows t) (setq gdb-default-window-configuration-file (locate-user-emacs-file "gdb-window-conf")) + (setq gdb-debuginfod-enable-setting t) (require 'my-prog) (my-keybind global-map "C-c d q" 'my-gdb-quit @@ -108,6 +109,9 @@ "C-c C-n" 'comint-next-prompt) (add-hook 'gud-mode-hook 'my-gud-comint-set-prompt-regexp) (add-hook 'gud-mode-hook 'company-mode) + ;; Don't make this a general comint-mode hook, as it will overwrite + ;; bash history rather than append to it. + (add-hook 'gud-mode-hook 'my-comint-add-write-history-hook) ) (my-package my-prog diff --git a/emacs/.emacs.d/lisp/my/my-emms.el b/emacs/.emacs.d/lisp/my/my-emms.el index fa0ae17..ffb6bc0 100644 --- a/emacs/.emacs.d/lisp/my/my-emms.el +++ b/emacs/.emacs.d/lisp/my/my-emms.el @@ -139,7 +139,7 @@ (mapc 'my-emms-load-from-native my-emms-native-playlists) (emms-metaplaylist-mode-go)) -(defun my-emms-deduplicate () +(defun my-emms-playlist-deduplicate () (interactive) (emms-mark-regexp ".* ([0-9])\\.[a-zA-Z0-9]+" nil) (emms-mark-delete-marked-tracks)) @@ -159,6 +159,16 @@ either 'audio or 'video (alist-get type my-extension-types))) (with-current-buffer to (emms-sort)))) +(defun my-emms-players-preference (track players) + "If audio, use first player, otherwise second." + (let ((name (emms-track-name track))) + (if (and (length> players 1) + (string-prefix-p "file://" name) + (member (file-name-extension name) + '("mkv" "mp4" "ogv" "avi" "webm"))) + 'emms-player-vlc + 'emms-player-mpv))) + (defvar my-emms-playlist-alist nil "alist controlling playlists, where the cdr of each item is an also an alist, with possible keys 'source and 'type. diff --git a/emacs/.emacs.d/lisp/my/my-prog.el b/emacs/.emacs.d/lisp/my/my-prog.el index 9d6a778..9c75a22 100644 --- a/emacs/.emacs.d/lisp/my/my-prog.el +++ b/emacs/.emacs.d/lisp/my/my-prog.el @@ -54,6 +54,13 @@ (sleep-for .1) (my-comint-revive)) +(defun my-comint-add-write-history-hook () + "Add `comint-write-input-ring' to `kill-buffer-hook'. + +To use as a hook to comint mode, so that history is updated on +buffer kill." + (add-hook 'kill-buffer-hook 'comint-write-input-ring 0 t)) + (defvar my-comint-revive-commands '((shell-mode . my-shell-revive) (inferior-emacs-lisp-mode . ielm)) @@ -329,12 +336,9 @@ left and the source buffer on the right. (defun my-gdb-quit () (interactive) - (let ((old-window (selected-window))) - (select-window (get-buffer-window gud-comint-buffer)) - (goto-char (point-max)) - (gdb-delchar-or-quit 0) - (my-toggle-lock-current-window-to-buffer) - (when (window-live-p old-window) (select-window old-window)))) + (let ((kill-buffer-query-functions nil)) + (kill-buffer gud-comint-buffer)) + ) (defun my-gdb-frames-add-breakpoint () (interactive) @@ -394,8 +398,8 @@ left and the source buffer on the right. record)) ;;; bison-mode -(require 'bison-mode) (defun my-bison-imenu-create-index () + (require 'bison-mode) (let ((end)) (beginning-of-buffer) (re-search-forward "^%%") @@ -409,8 +413,8 @@ left and the source buffer on the right. 'my-bison-imenu-create-index)) ;;; json-mode -(require 'json-mode) (defun my-json-mode-path () + (require 'json-mode) (string-join (mapcar 'prin1-to-string (plist-get (json-path-to-position (point)) :path)) "/")) diff --git a/emacs/.emacs.d/tempel-templates b/emacs/.emacs.d/tempel-templates index 2b421cc..ab35739 100644 --- a/emacs/.emacs.d/tempel-templates +++ b/emacs/.emacs.d/tempel-templates @@ -217,6 +217,13 @@ org-mode (inlsrc "src_" p "{" q "}") (title "#+title: " p n "#+author: " (user-full-name) n "#+language: en") +c++-mode + +(ifdef "#ifdef " (p "" sym) " +" + r + " +#endif /* " sym " */" ) ;; Local Variables: ;; mode: lisp-data |