Optimize lang/org: lexical-binding = t; cl-case => pcase

This commit is contained in:
Henrik Lissner 2017-06-10 01:52:44 +02:00
parent 14968380ff
commit eff937432e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
15 changed files with 17 additions and 17 deletions

View file

@ -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

View file

@ -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
;; ;;

View file

@ -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)

View file

@ -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:
;; ;;

View file

@ -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.

View file

@ -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

View file

@ -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))

View file

@ -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 ()

View file

@ -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)

View file

@ -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)

View file

@ -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 ()

View file

@ -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))

View file

@ -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 ()

View file

@ -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)

View 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)