1
0
Fork 0

refactor(emacs): remove ocamlconfig.el and pdfconfig.el

Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
Lucas Sta Maria 2024-11-03 18:57:42 -05:00
parent 515953242d
commit 54f5683b3b
No known key found for this signature in database
GPG key ID: F07FB16A826E3B47
4 changed files with 33 additions and 46 deletions

View file

@ -1,9 +0,0 @@
;;; ocamlconfig.el --- Configuration for OCaml and Tuareg
;;; Commentary:
;;; Code:
(add-hook 'tuareg-mode-hook #'flycheck-ocaml-setup)
(add-hook 'tuareg-mode-hook #'(lambda () (merlin-mode -1)))
(setq utop-command "opam exec -- dune utop . -- -emacs")
;;; ocamlconfig.el ends here

View file

@ -1,35 +0,0 @@
;;; pdfconfig.el --- configuration for working with PDF files
;;; Commentary:
;; Configuration for working with PDF files.
;;; Code:
;; PDF Tools
(pdf-tools-install)
(setq doc-view-resolution 300)
(defun pdf-download-and-view (&optional url filename)
"Download and view the PDF given by its URL as FILENAME."
(interactive)
(let* ((url (or url
(read-string "Download URL: ")))
(default-filename (or filename
(car (last (split-string url "/" t)))))
(filename (or filename
(read-string (format "Filename (%s): " default-filename)
nil
nil
default-filename)))
(file-path (concat "/tmp/" filename))
(download-buffer (url-retrieve-synchronously url)))
(set-buffer download-buffer)
(goto-char (point-min))
(re-search-forward "^$" nil 'move)
(forward-char)
(delete-region (point-min) (point))
(write-file file-path)
(find-file (expand-file-name file-path))))
(setq pdf-view-continuous t)
;;; pdfconfig.el ends here

View file

@ -4,6 +4,28 @@
;; development experience and productivity.
;;; Code:
(defun pdf-download-and-view (&optional url filename)
"Download and view the PDF given by its URL as FILENAME."
(interactive)
(let* ((url (or url
(read-string "Download URL: ")))
(default-filename (or filename
(car (last (split-string url "/" t)))))
(filename (or filename
(read-string (format "Filename (%s): " default-filename)
nil
nil
default-filename)))
(file-path (concat "/tmp/" filename))
(download-buffer (url-retrieve-synchronously url)))
(set-buffer download-buffer)
(goto-char (point-min))
(re-search-forward "^$" nil 'move)
(forward-char)
(delete-region (point-min) (point))
(write-file file-path)
(find-file (expand-file-name file-path))))
(use-package projectile :straight t
:custom
(projectile-completion-system 'auto)
@ -31,7 +53,12 @@
(use-package pdf-tools
:straight
'(pdf-tools :type git :host github
:repo "vedang/pdf-tools"))
:repo "vedang/pdf-tools")
:custom
(doc-view-resolution 300)
(pdf-view-continuous t)
:init
(pdf-tools-install))
(use-package olivetti :straight t
:hook (org-mode . olivetti-mode))

View file

@ -52,7 +52,11 @@
'(llvm-mode :type git :host github
:repo "nverno/llvm-mode"))
(use-package clojure-mode :straight t)
(use-package tuareg :straight t)
(use-package tuareg :straight t
:custom
(utop-command "opam exec -- dune utop . -- -emacs")
:hook ((tuareg-mode . flycheck-ocaml-setup)
(tuareg-mode . merlin-mode)))
(use-package utop :straight t)
(use-package dune :straight t)
(use-package flycheck-ocaml :straight t)