diff options
| author | yuzu-eva <stevenhu@web.de> | 2023-04-01 18:56:51 +0200 |
|---|---|---|
| committer | yuzu-eva <stevenhu@web.de> | 2023-04-01 18:56:51 +0200 |
| commit | 6e048ebd6e88fce44ed28aa5b8a86f33cb4bda75 (patch) | |
| tree | 02ec70233df8fe3af012d40676b5ee8f3239f462 /.emacs.d/functions.el | |
| parent | 2cac3b3aa323be115f1e444fab3bb84d3427657f (diff) | |
update for master
Diffstat (limited to '.emacs.d/functions.el')
| -rw-r--r-- | .emacs.d/functions.el | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/.emacs.d/functions.el b/.emacs.d/functions.el deleted file mode 100644 index cc86002..0000000 --- a/.emacs.d/functions.el +++ /dev/null @@ -1,49 +0,0 @@ -(defun startup/revert-file-name-handler-alist () - (setq file-name-handler-alist startup/file-name-handler-alist)) - -(defun startup/reset-gc () - (setq gc-cons-threshold 16777216 - gc-cons-percentage 0.1)) - -(defun split-and-follow-horizontally () - (interactive) - (split-window-below) - (balance-windows) - (other-window 1)) - -(defun split-and-follow-vertically () - (interactive) - (split-window-right) - (balance-windows) - (other-window 1)) - -(defun toggle-transparency() - (interactive) - (let ((alpha (frame-parameter nil 'alpha))) - (set-frame-parameter - nil 'alpha - (if (eql (cond ((numberp alpha) alpha) - ((numberp (cdr alpha)) (cdr alpha)) - ;; Also handle undocumented (<active> <inactive>) form. - ((numberp (cadr alpha)) (cadr alpha))) - 100) - '(80 . 80) '(100 . 100))))) - -(defun eshell/sudo-open (filename) - "Open a file as root in Eshell." - (let ((qual-filename (if (string-match "^/" filename) - filename - (concat (expand-file-name (eshell/pwd)) "/" filename)))) - (switch-to-buffer - (find-file-noselect - (concat "/sudo::" qual-filename))))) - -(defun eshell-other-window () - "Create or visit an eshell buffer." - (interactive) - (if (not (get-buffer "*eshell*")) - (progn - (split-window-sensibly (selected-window)) - (other-window 1) - (eshell)) - (switch-to-buffer-other-window "*eshell*"))) |
