mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Optimize lang/org: lexical-binding = t; cl-case => pcase
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/+agenda.el
|
;;; lang/org/+agenda.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(after! org-agenda
|
(after! org-agenda
|
||||||
(setq-default
|
(setq-default
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/+attach.el
|
;;; lang/org/+attach.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; FIXME Needs to be rewritten
|
;; FIXME Needs to be rewritten
|
||||||
;;
|
;;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/+babel.el
|
;;; lang/org/+babel.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(add-hook '+org-init-hook #'+org|init-babel t)
|
(add-hook '+org-init-hook #'+org|init-babel t)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/+capture.el
|
;;; lang/org/+capture.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Sets up two `org-capture' workflows that I like:
|
;; Sets up two `org-capture' workflows that I like:
|
||||||
;;
|
;;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/+export.el
|
;;; lang/org/+export.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; My own, centralized exporting system as well.
|
;; My own, centralized exporting system as well.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/+notebook.el
|
;;; lang/org/+notebook.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; While I program, write or plan, I want easy access to notes of various kinds,
|
;; While I program, write or plan, I want easy access to notes of various kinds,
|
||||||
;; such as major-mode/language specific notes, or project-specific notes. They
|
;; such as major-mode/language specific notes, or project-specific notes. They
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/autoload/attach.el
|
;;; lang/org/autoload/attach.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defun +org--attach-icon (path)
|
(defun +org--attach-icon (path)
|
||||||
(char-to-string (pcase (downcase (file-name-extension path))
|
(char-to-string (pcase (downcase (file-name-extension path))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/autoload/babel.el
|
;;; lang/org/autoload/babel.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org/edit-special-same-window ()
|
(defun +org/edit-special-same-window ()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/autoload/capture.el
|
;;; lang/org/autoload/capture.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org/capture (&optional key string)
|
(defun +org/capture (&optional key string)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/autoload/evil.el
|
;;; lang/org/autoload/evil.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;;###autoload (autoload '+org:capture "lang/org/autoload/evil" nil t)
|
;;;###autoload (autoload '+org:capture "lang/org/autoload/evil" nil t)
|
||||||
(evil-define-operator +org:capture (&optional beg end bang)
|
(evil-define-operator +org:capture (&optional beg end bang)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/autoload/notebook.el
|
;;; lang/org/autoload/notebook.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-mode-notes-dir ()
|
(defun +org-mode-notes-dir ()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/autoload/org.el
|
;;; lang/org/autoload/org.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org/indent ()
|
(defun +org/indent ()
|
||||||
@ -86,7 +86,7 @@ wrong places)."
|
|||||||
(insert "[ ] ")))
|
(insert "[ ] ")))
|
||||||
|
|
||||||
((memq type '(table table-row))
|
((memq type '(table table-row))
|
||||||
(cl-case direction
|
(pcase direction
|
||||||
('below (org-table-insert-row t))
|
('below (org-table-insert-row t))
|
||||||
('above (+org/table-prepend-row-or-shift-up))))
|
('above (+org/table-prepend-row-or-shift-up))))
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ wrong places)."
|
|||||||
(if (eq (org-element-type subcontext) 'headline)
|
(if (eq (org-element-type subcontext) 'headline)
|
||||||
subcontext
|
subcontext
|
||||||
1)))))
|
1)))))
|
||||||
(cl-case direction
|
(pcase direction
|
||||||
('below
|
('below
|
||||||
(let ((at-eol (= (point) (1- (line-end-position)))))
|
(let ((at-eol (= (point) (1- (line-end-position)))))
|
||||||
(goto-char (line-end-position))
|
(goto-char (line-end-position))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/autoload/tables.el
|
;;; lang/org/autoload/tables.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org/table-next-row ()
|
(defun +org/table-next-row ()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/autoload/util.el
|
;;; lang/org/autoload/util.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-get-property (name &optional file)
|
(defun +org-get-property (name &optional file)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
;;; lang/org/config.el
|
;;; lang/org/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; A few things you can expect
|
;; A few things you can expect
|
||||||
;; + `org-capture' in a popup frame (can be invoked from outside emacs too)
|
;; + `org-capture' in a popup frame (can be invoked from outside emacs too)
|
||||||
|
Reference in New Issue
Block a user