Remove f.el references

This commit is contained in:
Henrik Lissner 2017-02-25 02:11:24 -05:00
parent 7ed243a398
commit a0305418ae
6 changed files with 15 additions and 14 deletions

View file

@ -31,7 +31,7 @@
;; Write download paths relative to current file
(advice-add 'org-download--dir-2 :override 'ignore)
(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)
;; Add another drag-and-drop handler that will handle anything but image files

View file

@ -1,7 +1,7 @@
;;; lang/org/autoload/attach.el
(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" ?)
("pdf" ?)
("ppt" ?) ("pptx" ?)

View file

@ -17,7 +17,7 @@
(user-error "Not in an org-mode buffer"))
(if 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)))
(cond ((string-match-p (concat "^" (regexp-opt '("http" "https" "nfs" "ftp" "file")) ":/") uri)
(url-copy-file uri new-path))
@ -33,8 +33,8 @@
(format "[[./%s]] " rel-path)
(format "%s [[./%s][%s]] "
(doom--org-attach-icon rel-path)
rel-path (f-filename rel-path)))))
(when (string-match-p (regexp-opt '("jpg" "jpeg" "gif" "png")) (f-ext rel-path))
rel-path (file-name-nondirectory (directory-file-name rel-path))))))
(when (string-match-p (regexp-opt '("jpg" "jpeg" "gif" "png")) (file-name-extension rel-path))
(org-redisplay-inline-images)))
(let ((default-directory ".attach/"))
(if (file-exists-p default-directory)

View file

@ -16,9 +16,9 @@
;; (lambda (&rest _)
;; (let* ((project-path (doom-project-root))
;; (hash (gethash project-path bower-conf))
;; (package-file (f-expand "bower.json" project-path))
;; (package-file (expand-file-name "bower.json" project-path))
;; 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)))
;; (puthash project-path it bower-conf)))
;; t))

View file

@ -4,7 +4,8 @@
(defun +macos-open-with (&optional app-name path)
"Send PATH to APP-NAME on OSX."
(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)

View file

@ -194,7 +194,7 @@ whose dimensions may not be fully initialized by the time this is run."
"tools"
: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)
(when last-session-p