jj-open-shell opens a new xterm in the directory of my current buffer
[emacs.git] / .emacs.d / elisp / local / ganneff.el
index eafbf9f..a28c112 100644 (file)
@@ -206,6 +206,28 @@ Doesn't mess with special buffers."
 ;(setq org-icalendar-verify-function 'org-mycal-export-limit)
 ;(org-export-icalendar-combine-agenda-files)
 
+
+;;;###autoload
+(defun font-lock-comment-annotations ()
+  "Highlight a bunch of well known comment annotations.
+
+This functions should be added to the hooks of major modes for programming."
+  (font-lock-add-keywords
+   nil '(("\\<\\(FIX\\(ME\\)?\\|TODO\\|OPTIMIZE\\|HACK\\|REFACTOR\\):"
+          1 font-lock-warning-face t))))
+
+;;;###autoload
+(defun jj-open-shell ()
+  "Open a shell in the directory of the current buffer file"
+
+  (interactive)
+  (when buffer-file-name
+    (setenv "ZSTARTDIR" (file-truename buffer-file-name)))
+  (when dired-directory
+    (message dired-directory)
+    (setenv "ZSTARTDIR" (concat (file-truename dired-directory) "/dired")))
+  (start-process "yay" nil "/usr/bin/x-terminal-emulator"))
+
 (provide 'ganneff)
 
 ;;; ganneff.el ends here