Files
org_roam/Emacs/20250326002128-emacs_stuff_elisp.org
2026-03-27 15:39:35 +00:00

1.7 KiB
Raw Blame History

Emacs ELISP

use `<s` followed by `TAB`

  (defun my-echo-input ()
    "Prompt the user for input and echo it back."
    (interactive)
    (message "hello"))
my-echo-input
(shell-command "thunar ~/Documents/ &")
(run-at-time "1 sec" nil #'delete-other-windows)
[nil 26600 20298 876807 nil delete-other-windows nil nil 917000 nil]
  (defun open-current-dir()
    (interactive)
    (cond ((string-equal system-type "gnu/linux")
	   (shell-command (concat "thunar " ".")))
	  ((string-equal system-type "darwin")
	   (shell-command (concat "open " "."))))
  )
open-current-dir
  (defun test()
    (interactive)
    (cond ((string-equal system-type "gnu/linux")
  	 (message "linux"))
  	((string-equal system-type "darwin")
  	 (message "mac"))
  )
    )

(defun kill-other-buffers-startup ()
  "Kill all buffers except the current one."
  (interactive)
  (mapc (lambda (buffer)
          (unless (eq buffer (current-buffer))
            (kill-buffer buffer)))
        (buffer-list)))


;(add-hook 'emacs-startup-hook #'kill-other-buffers-startup)
      (defun create-weekly-entry ()
        (interactive)
        (let* ((current-date-time-format "[%Y-week-%V]")
               (timestamp (format-time-string current-date-time-format))
               (entry (concat "* Weekly Entry: " timestamp "\n"
  			    "** Tasks:\n"
  			    "** Notes:\n"
  			    
  )))
          (write-region entry nil "~/master-folder/org_files/todo/master-tl.org" 'append)))
test