Remove f.el references
This commit is contained in:
parent
7ed243a398
commit
a0305418ae
6 changed files with 15 additions and 14 deletions
|
@ -31,7 +31,7 @@
|
||||||
;; Write download paths relative to current file
|
;; Write download paths relative to current file
|
||||||
(advice-add 'org-download--dir-2 :override 'ignore)
|
(advice-add 'org-download--dir-2 :override 'ignore)
|
||||||
(defun +org*download-fullname (path)
|
(defun +org*download-fullname (path)
|
||||||
(file-relative-name path (f-dirname (buffer-file-name))))
|
(file-relative-name path (file-name-directory (buffer-file-name))))
|
||||||
(advice-add 'org-download--fullname :filter-return '+org*download-fullname)
|
(advice-add 'org-download--fullname :filter-return '+org*download-fullname)
|
||||||
|
|
||||||
;; Add another drag-and-drop handler that will handle anything but image files
|
;; Add another drag-and-drop handler that will handle anything but image files
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;;; lang/org/autoload/attach.el
|
;;; lang/org/autoload/attach.el
|
||||||
|
|
||||||
(defun doom--org-attach-icon (path)
|
(defun doom--org-attach-icon (path)
|
||||||
(char-to-string (pcase (downcase (f-ext path))
|
(char-to-string (pcase (downcase (file-name-extension path))
|
||||||
("jpg" ?) ("jpeg" ?) ("png" ?) ("gif" ?)
|
("jpg" ?) ("jpeg" ?) ("png" ?) ("gif" ?)
|
||||||
("pdf" ?)
|
("pdf" ?)
|
||||||
("ppt" ?) ("pptx" ?)
|
("ppt" ?) ("pptx" ?)
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
(user-error "Not in an org-mode buffer"))
|
(user-error "Not in an org-mode buffer"))
|
||||||
(if uri
|
(if uri
|
||||||
(let* ((rel-path (org-download--fullname uri))
|
(let* ((rel-path (org-download--fullname uri))
|
||||||
(new-path (f-expand rel-path))
|
(new-path (expand-file-name rel-path))
|
||||||
(image-p (image-type-from-file-name uri)))
|
(image-p (image-type-from-file-name uri)))
|
||||||
(cond ((string-match-p (concat "^" (regexp-opt '("http" "https" "nfs" "ftp" "file")) ":/") uri)
|
(cond ((string-match-p (concat "^" (regexp-opt '("http" "https" "nfs" "ftp" "file")) ":/") uri)
|
||||||
(url-copy-file uri new-path))
|
(url-copy-file uri new-path))
|
||||||
|
@ -33,8 +33,8 @@
|
||||||
(format "[[./%s]] " rel-path)
|
(format "[[./%s]] " rel-path)
|
||||||
(format "%s [[./%s][%s]] "
|
(format "%s [[./%s][%s]] "
|
||||||
(doom--org-attach-icon rel-path)
|
(doom--org-attach-icon rel-path)
|
||||||
rel-path (f-filename rel-path)))))
|
rel-path (file-name-nondirectory (directory-file-name rel-path))))))
|
||||||
(when (string-match-p (regexp-opt '("jpg" "jpeg" "gif" "png")) (f-ext rel-path))
|
(when (string-match-p (regexp-opt '("jpg" "jpeg" "gif" "png")) (file-name-extension rel-path))
|
||||||
(org-redisplay-inline-images)))
|
(org-redisplay-inline-images)))
|
||||||
(let ((default-directory ".attach/"))
|
(let ((default-directory ".attach/"))
|
||||||
(if (file-exists-p default-directory)
|
(if (file-exists-p default-directory)
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
;; (lambda (&rest _)
|
;; (lambda (&rest _)
|
||||||
;; (let* ((project-path (doom-project-root))
|
;; (let* ((project-path (doom-project-root))
|
||||||
;; (hash (gethash project-path bower-conf))
|
;; (hash (gethash project-path bower-conf))
|
||||||
;; (package-file (f-expand "bower.json" project-path))
|
;; (package-file (expand-file-name "bower.json" project-path))
|
||||||
;; deps)
|
;; deps)
|
||||||
;; (awhen (and (not hash) (f-exists? package-file)
|
;; (awhen (and (not hash) (file-exists-p package-file)
|
||||||
;; (ignore-errors (json-read-file package-file)))
|
;; (ignore-errors (json-read-file package-file)))
|
||||||
;; (puthash project-path it bower-conf)))
|
;; (puthash project-path it bower-conf)))
|
||||||
;; t))
|
;; t))
|
||||||
|
|
|
@ -4,12 +4,13 @@
|
||||||
(defun +macos-open-with (&optional app-name path)
|
(defun +macos-open-with (&optional app-name path)
|
||||||
"Send PATH to APP-NAME on OSX."
|
"Send PATH to APP-NAME on OSX."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let* ((path (f-full (replace-regexp-in-string
|
(let* ((path (expand-file-name
|
||||||
"'" "\\'"
|
(replace-regexp-in-string
|
||||||
(or path (if (eq major-mode 'dired-mode)
|
"'" "\\'"
|
||||||
(dired-get-file-for-visit)
|
(or path (if (eq major-mode 'dired-mode)
|
||||||
(buffer-file-name)))
|
(dired-get-file-for-visit)
|
||||||
nil t)))
|
(buffer-file-name)))
|
||||||
|
nil t)))
|
||||||
(command (format "open %s"
|
(command (format "open %s"
|
||||||
(if app-name
|
(if app-name
|
||||||
(format "-a %s '%s'" (shell-quote-argument app-name) path)
|
(format "-a %s '%s'" (shell-quote-argument app-name) path)
|
||||||
|
|
|
@ -194,7 +194,7 @@ whose dimensions may not be fully initialized by the time this is run."
|
||||||
"tools"
|
"tools"
|
||||||
:face 'font-lock-keyword-face)
|
:face 'font-lock-keyword-face)
|
||||||
(propertize " Edit emacs.d" 'face 'font-lock-keyword-face))
|
(propertize " Edit emacs.d" 'face 'font-lock-keyword-face))
|
||||||
'action '(lambda (_) (find-file (f-expand "init.el" doom-emacs-dir)))
|
'action '(lambda (_) (find-file (expand-file-name "init.el" doom-emacs-dir)))
|
||||||
'follow-link t)
|
'follow-link t)
|
||||||
|
|
||||||
(when last-session-p
|
(when last-session-p
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue