From 8214c831a3ec1b096defb97037d9855f4a5a788d Mon Sep 17 00:00:00 2001 From: Miranda Marquez Date: Sat, 25 May 2024 21:05:33 -0800 Subject: [PATCH] move unused code into obsolete.el --- init.el | 62 -------------------------------------------- lisp/obsolete.el | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 62 deletions(-) diff --git a/init.el b/init.el index 046da9d..c353bb6 100644 --- a/init.el +++ b/init.el @@ -1079,14 +1079,6 @@ Return nil if DIR is not in a hugo project at all." :git (:host github :repo "georgek/magit-pretty-graph") :after magit :commands magit-pg-repo) -;; (use-package transient-posframe -;; ;; :after magit -;; :if (display-graphic-p) -;; :config -;; (transient-posframe-mode) -;; ;; (add-to-list 'display-buffer-alist -;; ;; '(" *transient*" . transient-posframe--show-buffer)) -;; ) (use-package hyperbole :git (:files ("*.el" @@ -1116,15 +1108,6 @@ Return nil if DIR is not in a hugo project at all." :custom (inferior-lisp-program "sbcl") :config (load (expand-file-name "~/quicklisp/slime-helper.el"))) -;; Java never looked so useful... -;; (use-package clojure-mode -;; :mode "\\.cljs\\'") -;; (use-package inf-clojure -;; :after clojure-mode) -;; or an okay language -;; (use-package cider -;; :after clojure-mode) - (use-package dwim-shell-command :git (dwim-shell-command :files (:defaults "dwim-shell-commands.el")) @@ -1211,51 +1194,6 @@ Taken from https://howardism.org/Technical/Emacs/eshell-why.html" :git (:repo "https://codeberg.org/akib/emacs-cube") :commands 'cube) -;; Emacs App Framework. Definitely pretty broken but it worked once -;; (unless (eq system-type 'windows-nt) -;; (use-package eaf -;; :git (:host github :repo "emacs-eaf/emacs-application-framework" -;; :files ("*.el" "*.py" "core" "app" "*.json") -;; :pre-build (("python" "install-eaf.py" -;; "--install" "pdf-viewer" "browser" -;; "--ignore-sys-deps"))) -;; :commands (eaf-open-browser eaf-open-url-at-point) -;; :config (add-to-list 'load-path (expand-file-name "app/" eaf-source-dir)) -;; (if (and (string= (getenv "XDG_CURRENT_DESKTOP") "Hyprland") -;; (featurep 'hypop)) -;; (defun eaf--get-frame-coordinate () -;; "We need fetch Emacs coordinate to adjust coordinate of EAF if it running on system not support cross-process reparent technology. - -;; Such as, wayland native, macOS etc. - -;; This is redefined for use with `hypop' library because multiple Emacs frames may be open." -;; (cond ((string-equal (getenv "XDG_CURRENT_DESKTOP") "sway") -;; (eaf--split-number (shell-command-to-string (concat eaf-build-dir "swaymsg-treefetch/swaymsg-rectfetcher.sh emacs")))) -;; ((string-equal (getenv "XDG_CURRENT_DESKTOP") "Hyprland") -;; (let ((clients (json-parse-string (shell-command-to-string "hyprctl -j clients"))) -;; (coordinate)) -;; (dotimes (i (length clients)) -;; (when (and (equal (gethash "pid" (aref clients i)) (emacs-pid)) -;; (not (string= (gethash "title" (aref clients i)) hypop--frame-name))) -;; (setq coordinate (gethash "at" (aref clients i))))) -;; (list (aref coordinate 0) (aref coordinate 1)))) -;; ((eaf-emacs-running-in-wayland-native) -;; (require 'dbus) -;; (let* ((coordinate (eaf--split-number -;; (dbus-call-method :session "org.gnome.Shell" "/org/eaf/wayland" "org.eaf.wayland" "get_emacs_window_coordinate" :timeout 1000) -;; ",")) -;; ;; HiDPI need except by `frame-scale-factor'. -;; (frame-x (truncate (/ (car coordinate) (frame-scale-factor)))) -;; (frame-y (truncate (/ (cadr coordinate) (frame-scale-factor))))) -;; (list frame-x frame-y))) -;; (t (list 0 0))))) -;; (use-package eaf-browser -;; :git nil -;; :after eaf -;; :custom -;; (eaf-browser-continue-where-left-off t) -;; (eaf-browser-enable-adblocker t)))) - (use-package dtache :git (:repo "https://gitlab.com/niklaseklund/dtache") :hook (after-init . dtache-setup)) diff --git a/lisp/obsolete.el b/lisp/obsolete.el index a65764c..6c61ebe 100644 --- a/lisp/obsolete.el +++ b/lisp/obsolete.el @@ -26,6 +26,73 @@ ;;; Code: (error "Please don't load `obsolete.el', it's obsolete.") + +;; Emacs App Framework. Definitely pretty broken but it worked once +(unless (eq system-type 'windows-nt) + (use-package eaf + :git (:host github :repo "emacs-eaf/emacs-application-framework" + :files ("*.el" "*.py" "core" "app" "*.json") + :pre-build (("python" "install-eaf.py" + "--install" "pdf-viewer" "browser" + "--ignore-sys-deps"))) + :commands (eaf-open-browser eaf-open-url-at-point) + :config (add-to-list 'load-path (expand-file-name "app/" eaf-source-dir)) + (if (and (string= (getenv "XDG_CURRENT_DESKTOP") "Hyprland") + (featurep 'hypop)) + (defun eaf--get-frame-coordinate () + "We need fetch Emacs coordinate to adjust coordinate of EAF if it running on system not support cross-process reparent technology. + +Such as, wayland native, macOS etc. + +This is redefined for use with `hypop' library because multiple Emacs frames may be open." + (cond ((string-equal (getenv "XDG_CURRENT_DESKTOP") "sway") + (eaf--split-number (shell-command-to-string (concat eaf-build-dir "swaymsg-treefetch/swaymsg-rectfetcher.sh emacs")))) + ((string-equal (getenv "XDG_CURRENT_DESKTOP") "Hyprland") + (let ((clients (json-parse-string (shell-command-to-string "hyprctl -j clients"))) + (coordinate)) + (dotimes (i (length clients)) + (when (and (equal (gethash "pid" (aref clients i)) (emacs-pid)) + (not (string= (gethash "title" (aref clients i)) hypop--frame-name))) + (setq coordinate (gethash "at" (aref clients i))))) + (list (aref coordinate 0) (aref coordinate 1)))) + ((eaf-emacs-running-in-wayland-native) + (require 'dbus) + (let* ((coordinate (eaf--split-number + (dbus-call-method :session "org.gnome.Shell" "/org/eaf/wayland" "org.eaf.wayland" "get_emacs_window_coordinate" :timeout 1000) + ",")) + ;; HiDPI need except by `frame-scale-factor'. + (frame-x (truncate (/ (car coordinate) (frame-scale-factor)))) + (frame-y (truncate (/ (cadr coordinate) (frame-scale-factor))))) + (list frame-x frame-y))) + (t (list 0 0))))) + (use-package eaf-browser + :git nil + :after eaf + :custom + (eaf-browser-continue-where-left-off t) + (eaf-browser-enable-adblocker t)))) + + +;;; clojure - probably okay just not using it +;; Java never looked so useful... +(use-package clojure-mode + :mode "\\.cljs\\'") +(use-package inf-clojure + :after clojure-mode) +;; or an okay language +(use-package cider + :after clojure-mode) + + +;; transient posframes cant get it working, broken +(use-package transient-posframe + ;; :after magit + :if (display-graphic-p) + :config + (transient-posframe-mode) + ;; (add-to-list 'display-buffer-alist + ;; '(" *transient*" . transient-posframe--show-buffer)) + ) ;; elpaca eldoc stuff, probably not good anymore ;; see https://www.reddit.com/r/emacs/comments/1937vaz/emacs_291_on_windows_install_magit_requires_seq/?rdt=48529 ;; seq version workaround