doomemacs/modules/app/regex/config.el
Henrik Lissner 91357a3e5d
💥 Replace core-popup with new feature/popup module
This is a breaking change! Update your :popup settings. Old ones will
throw errors!

Doom's new popup management system casts off its shackles (hur hur) and
replaces them with the monster that is `display-buffer-alist`, and
window parameters.

However, this is highly experimental! Expect edge cases.  Particularly
with org-mode and magit (or anything that does its own window
management).

Relevant to #261, #263, #325
2018-01-06 02:17:43 -05:00

52 lines
1.9 KiB
EmacsLisp

;;; app/regex/config.el
;; 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 '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.")
(defvar +regex-dummy-text
"Welcome to DOOM Emacs, proudly hosted by the demons of hell!
Edit the Expression & Text to see matches. Roll over matches or the expression
for details. Undo mistakes with ctrl-z. Save Favorites & Share expressions with
friends or the Community. Explore your results with Tools. A full Reference &
Help is available in the Library, or watch the video Tutorial.
Sample text for testing:
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789 _+-.,!@#$%^&*();\/|<>\"'
12345 -98.7 3.141 .6180 9,000 +42
555.123.4567 +1-(800)-555-2468
foo@demo.net bar.ba@test.co.uk
www.demo.com http://foo.co.uk/
http://regexr.com/foo.html?q=bar
https://mediatemple.net"
"TODO")
(set! :popup "^\\*doom-regex\\*$" '((size . 4)) '((escape-quit)))
(set! :popup "^\\*doom-regex-groups" '((side . left)) '((select) (escape-quit)))