diff --git a/TODO.org b/TODO.org index 6eb2e7b93..dc04cfcd1 100644 --- a/TODO.org +++ b/TODO.org @@ -89,7 +89,7 @@ + [ ] twitter + [ ] present -** 2.0.3 [17/31] +** 2.0.3 [22/42] + [ ] Test ~package-autoremove~ + [ ] tools/upload: add ~+upload/open-remote-file~ command to open current file on the remote (with TRAMP) @@ -104,8 +104,20 @@ + [ ] Write ~describe-setting~ for ~def-setting!~ definitions. + [ ] Fix invisible buffer-info segment in modeline for terminal Emacs + [ ] 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 -+ [-] New module :: tools/regex: PCRE regex editor ++ [1/9] New module :: tools/regex (PCRE IDE) + + [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: extend ~evil-escape~ +to ~evil-multiedit-insert-state~+ + [X] feature/evil: new code folding system diff --git a/modules/app/regex/autoload/export.el b/modules/app/regex/autoload/export.el new file mode 100644 index 000000000..90fbff748 --- /dev/null +++ b/modules/app/regex/autoload/export.el @@ -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 ()) ; /.+/ diff --git a/modules/app/regex/autoload.el b/modules/app/regex/autoload/regex.el similarity index 93% rename from modules/app/regex/autoload.el rename to modules/app/regex/autoload/regex.el index 3fc6a067e..b6912802c 100644 --- a/modules/app/regex/autoload.el +++ b/modules/app/regex/autoload/regex.el @@ -1,4 +1,4 @@ -;;; app/regex/autoload.el +;;; app/regex/autoload/regex.el (defvar +regex--text-buffer nil) (defvar +regex--expr-buffer nil) @@ -7,17 +7,17 @@ ;; (defface +regex-match-0-face '((t (:foreground "Black" :background "Red" :bold t))) - "" + "TODO" :group 'doom) (defface +regex-match-1-face '((t (:foreground "Black" :background "Blue" :bold t))) - "" + "TODO" :group 'doom) (defface +regex-match-2-face '((t (:foreground "Black" :background "Green" :bold t))) - "" + "TODO" :group 'doom) (defvar +regex-faces @@ -33,6 +33,7 @@ map) "TODO") +;;;###autoload (define-minor-mode +regex-mode "TODO" :init-value nil @@ -98,15 +99,16 @@ (ignore-errors (goto-char (point-min)) (pcase +regex-default-backend - ('emacs (+regex-backend-emacs regex)) - ('perl (+regex-backend-perl regex)))))) + ('emacs (+regex-backend-emacs regex)) + ('perl (+regex-backend-generic (+regex-backend-perl regex))) + ('python (+regex-backend-generic (+regex-backend-python regex))))))) (with-current-buffer +regex--groups-buffer (goto-char (point-min)))))) ;; --- backends --------------------------- -(defun +regex--render-perl (regex sample) +(defun +regex--backend-perl (regex sample) "From " (with-temp-buffer (unless (string-match-p "^/.+/[gm]*$" regex) diff --git a/modules/app/regex/config.el b/modules/app/regex/config.el index 9b124f729..17ab21474 100644 --- a/modules/app/regex/config.el +++ b/modules/app/regex/config.el @@ -1,14 +1,28 @@ ;;; app/regex/config.el -;; Provides a Regex IDE, invoked by `=regex'. If opened with C-u, opens in a -;; separate frame with a dummy text buffer. +;; Often, I find myself writing regular expressions that could terrify seasoned +;; 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 (defvar +regex-workspace-name "*regex*" "TODO") -(defvar +regex-default-backend 'emacs +(defvar +regex-default-backend 'perl "The backend used to process regular expressions. The `emacs' backend handles regular expressions directly. The `perl' backend talks to a perl subprocess to do the handling.")