Update app/regex + TODO

This commit is contained in:
Henrik Lissner 2017-05-16 18:18:22 +02:00
parent e071545d36
commit 84a73b3d38
4 changed files with 55 additions and 13 deletions

View file

@ -89,7 +89,7 @@
+ [ ] twitter + [ ] twitter
+ [ ] present + [ ] present
** 2.0.3 [17/31] ** 2.0.3 [22/42]
+ [ ] Test ~package-autoremove~ + [ ] Test ~package-autoremove~
+ [ ] tools/upload: add ~+upload/open-remote-file~ command to open current file + [ ] tools/upload: add ~+upload/open-remote-file~ command to open current file
on the remote (with TRAMP) on the remote (with TRAMP)
@ -104,8 +104,20 @@
+ [ ] Write ~describe-setting~ for ~def-setting!~ definitions. + [ ] Write ~describe-setting~ for ~def-setting!~ definitions.
+ [ ] Fix invisible buffer-info segment in modeline for terminal Emacs + [ ] Fix invisible buffer-info segment in modeline for terminal Emacs
+ [ ] ui/doom-modeline: fix ~0/0~ display in modeline (leftover anzu state) + [ ] ui/doom-modeline: fix ~0/0~ display in modeline (leftover anzu state)
+ [-] ui/doom: fix nav-flash on evil-multiedit or in eshell/term buffers + [1/9] New module :: tools/regex (PCRE IDE)
+ [-] New module :: tools/regex: PCRE regex editor + [X] perl backend
+ [ ] replace support
+ [ ] export to code support
+ [ ] python exporter (use ~re~ or ~regex~)
+ [ ] php exporter (~preg_(match(_all)?|replace)~)
+ [ ] ruby backend (~%r[.+]~)
+ [ ] javascript (node) backend (~/.+/~)
+ [ ] syntax highlighter for ~+regex-mode~ (plus make it a major mode)
+ [ ] README.org
+ [X] ui/doom: fix nav-flash on evil-multiedit or in eshell/term buffers
+ [X] core-os: don't use GTK tooltips (ugly!)
+ [X] ui/doom-modeline: reduce excess whitespace on right of flycheck segment
+ [X] ui/doom-modeline: slightly darker color for git segment (when clean)
+ [X] feature/evil: fix stringp error caused by unintialized state in hideshow + [X] feature/evil: fix stringp error caused by unintialized state in hideshow
+ [X] feature/evil: extend ~evil-escape~ +to ~evil-multiedit-insert-state~+ + [X] feature/evil: extend ~evil-escape~ +to ~evil-multiedit-insert-state~+
+ [X] feature/evil: new code folding system + [X] feature/evil: new code folding system

View file

@ -0,0 +1,14 @@
;;; app/regex/autoload/export.el
;;;###autoload
(defun +regex/export () (interactive)) ; TODO +regex/export
;;
(defun +regex-export-python ()) ; import (re|regex)
(defun +regex-export-php ()) ; preg_(match(_all)?|replace)
(defun +regex-export-ruby ()) ; %r[.+]
(defun +regex-export-js ()) ; /.+/

View file

@ -1,4 +1,4 @@
;;; app/regex/autoload.el ;;; app/regex/autoload/regex.el
(defvar +regex--text-buffer nil) (defvar +regex--text-buffer nil)
(defvar +regex--expr-buffer nil) (defvar +regex--expr-buffer nil)
@ -7,17 +7,17 @@
;; ;;
(defface +regex-match-0-face (defface +regex-match-0-face
'((t (:foreground "Black" :background "Red" :bold t))) '((t (:foreground "Black" :background "Red" :bold t)))
"" "TODO"
:group 'doom) :group 'doom)
(defface +regex-match-1-face (defface +regex-match-1-face
'((t (:foreground "Black" :background "Blue" :bold t))) '((t (:foreground "Black" :background "Blue" :bold t)))
"" "TODO"
:group 'doom) :group 'doom)
(defface +regex-match-2-face (defface +regex-match-2-face
'((t (:foreground "Black" :background "Green" :bold t))) '((t (:foreground "Black" :background "Green" :bold t)))
"" "TODO"
:group 'doom) :group 'doom)
(defvar +regex-faces (defvar +regex-faces
@ -33,6 +33,7 @@
map) map)
"TODO") "TODO")
;;;###autoload
(define-minor-mode +regex-mode (define-minor-mode +regex-mode
"TODO" "TODO"
:init-value nil :init-value nil
@ -99,14 +100,15 @@
(goto-char (point-min)) (goto-char (point-min))
(pcase +regex-default-backend (pcase +regex-default-backend
('emacs (+regex-backend-emacs regex)) ('emacs (+regex-backend-emacs regex))
('perl (+regex-backend-perl regex)))))) ('perl (+regex-backend-generic (+regex-backend-perl regex)))
('python (+regex-backend-generic (+regex-backend-python regex)))))))
(with-current-buffer +regex--groups-buffer (with-current-buffer +regex--groups-buffer
(goto-char (point-min)))))) (goto-char (point-min))))))
;; --- backends --------------------------- ;; --- backends ---------------------------
(defun +regex--render-perl (regex sample) (defun +regex--backend-perl (regex sample)
"From <https://github.com/jwiegley/regex-tool>" "From <https://github.com/jwiegley/regex-tool>"
(with-temp-buffer (with-temp-buffer
(unless (string-match-p "^/.+/[gm]*$" regex) (unless (string-match-p "^/.+/[gm]*$" regex)

View file

@ -1,14 +1,28 @@
;;; app/regex/config.el ;;; app/regex/config.el
;; Provides a Regex IDE, invoked by `=regex'. If opened with C-u, opens in a ;; Often, I find myself writing regular expressions that could terrify seasoned
;; separate frame with a dummy text buffer. ;; programmers (or little children). To hone my regex fu, I need a regex
;; playground. Sure, there's regexr.com, but don't be silly, that's not Emacs.
;;
;; Sadly, the Emacs' regex syntax is niche and lacks support for a few
;; questionably useful features, like lookaround assertions, conditionals, case
;; modifiers or backreferences, among others. No, I want PCRE. I am going to
;; have my cake and eat it too, damn it!
;;
;; Workflow:
;; + Invoke `=regex' (if opened with C-u, opens in separate workspace with a
;; dummy text buffer).
;; + A regex window will popup up. Any matches will be highlighted in the
;; original buffer.
;; + C-c C-k to close it
;; + TODO C-c C-e to export to various langauges
;; ;;
;; WARNING: THIS IS A WORK IN PROGRESS ;; WARNING: THIS IS A WORK IN PROGRESS
(defvar +regex-workspace-name "*regex*" (defvar +regex-workspace-name "*regex*"
"TODO") "TODO")
(defvar +regex-default-backend 'emacs (defvar +regex-default-backend 'perl
"The backend used to process regular expressions. "The backend used to process regular expressions.
The `emacs' backend handles regular expressions directly. The `emacs' backend handles regular expressions directly.
The `perl' backend talks to a perl subprocess to do the handling.") The `perl' backend talks to a perl subprocess to do the handling.")