Browse Source

Added escape sequence fontlock & added titles for all the variables.

master
Josh Wolfe 3 years ago
parent
commit
1acfb7e345
1 changed files with 65 additions and 1 deletions
  1. 65
    1
      emacs/.emacs.d/README.org

+ 65
- 1
emacs/.emacs.d/README.org View File

@@ -28,26 +28,36 @@ I'm using, [[https://raw.githubusercontent.com/WolfeCub/dotfiles/master/emacs/.e
Variables come at the beginning so that they're consistently available.
If you don't care about these [[Startup][click here to skip over them]].

** Config Name

#+BEGIN_SRC emacs-lisp :tangle yes
(defvar wolfe/literate-config-name "README.org"
"The name of my literate config")
#+END_SRC

** Init File

#+BEGIN_SRC emacs-lisp :tangle yes
(defvar wolfe/init-file (concat user-emacs-directory wolfe/literate-config-name)
"The path to my literate config file")
#+END_SRC

** Linux Check

#+BEGIN_SRC emacs-lisp :tangle yes
(defvar wolfe/linux? (eq system-type 'gnu/linux)
"Are we on linux?")
#+END_SRC

** Windows Check

#+BEGIN_SRC emacs-lisp :tangle yes
(defvar wolfe/windows? (eq system-type 'windows-nt)
"Are we on windows?")
#+END_SRC

** Org Ellipsis

#+BEGIN_SRC emacs-lisp :tangle yes
(defvar wolfe/org-ellipsis
(if (display-graphic-p)
@@ -56,6 +66,8 @@ If you don't care about these [[Startup][click here to skip over them]].
"The indicates if an `org-mode' tree can be expanded")
#+END_SRC

** Project Path

#+BEGIN_SRC emacs-lisp :tangle yes
(defvar wolfe/project-path
(cond
@@ -65,6 +77,8 @@ If you don't care about these [[Startup][click here to skip over them]].
"Path to my projects directory")
#+END_SRC

** Dropbox Path

#+BEGIN_SRC emacs-lisp :tangle yes
(defvar wolfe/org-dropbox-path
(cond
@@ -76,16 +90,30 @@ If you don't care about these [[Startup][click here to skip over them]].
"Path to my org files inside dropbox")
#+END_SRC

** Light Check

#+BEGIN_SRC emacs-lisp :tangle yes
(defvar wolfe/using-light nil
"Indicates whether we're using my light theme")
#+END_SRC

** Lisp Path Location

#+BEGIN_SRC emacs-lisp :tangle yes
(defvar wolfe/lisp-dir-path "~/.emacs.d/lisp/"
"Path to my custom lisp files")
#+END_SRC

** Highlight Escapes Modes

#+BEGIN_SRC emacs-lisp :tangle yes
(defvar wolfe/highlight-escapes-mode-list '(python-mode
c-mode
c++-mode
web-mode)
"List of modes to highlight escape characters in")
#+END_SRC

* Startup

My graphical settings change depending on whether I'm in terminal
@@ -267,6 +295,43 @@ Make sure that UTF-8 is used everywhere.
'(column-marker-1 ((t (:background "dim gray"))))))
#+END_SRC

*** Highlight Escape Characters

This defines 4 new faces and the appropriate =regexps= that highlight
them and maps them to all the modes in =[[Highlight Escapes Modes][wolfe/highlight-escapes-mode-list]]=.

#+BEGIN_SRC emacs-lisp :tangle yes
(defface wolfe/backslash-escape-backslash-face
'((t :inherit font-lock-regexp-grouping-backslash))
"Face for the back-slash component of a back-slash escape."
:group 'font-lock-faces)

(defface wolfe/backslash-escape-char-face
'((t :inherit font-lock-regexp-grouping-construct))
"Face for the charcter component of a back-slash escape."
:group 'font-lock-faces)

(defface wolfe/format-code-format-face
'((t :inherit font-lock-regexp-grouping-backslash))
"Face for the % component of a printf format code."
:group 'font-lock-faces)

(defface wolfe/format-code-directive-face
'((t :inherit font-lock-regexp-grouping-construct))
"Face for the directive component of a printf format code."
:group 'font-lock-faces)

(mapc
(lambda (mode)
(font-lock-add-keywords
mode
'(("\\(\\\\\\)." 1 'wolfe/backslash-escape-backslash-face prepend)
("\\\\\\(.\\)" 1 'wolfe/backslash-escape-char-face prepend)
("\\(%\\)." 1 'wolfe/format-code-format-face prepend)
("%\\(.\\)" 1 'wolfe/format-code-directive-face prepend))))
wolfe/highlight-escapes-mode-list)
#+END_SRC

** Personal Defaults

Nothing to crazy here just the type of behaviour I personally
@@ -1468,4 +1533,3 @@ Stores all backups and temp files in =~/.bak.emacs/=
(reverse comments)))
#+END_SRC



Loading…
Cancel
Save