- State “TODO” from [2018-12-10 Mon 03:38]
API design should follow consistent criteria.
- State “TODO” from [2018-12-10 Mon 03:38]
- State “TODO” from [2018-11-21 Wed 01:42]
- #\char
- #H() from cl21
- #!?[-+]sym
- #(1 2 3)
- #2A((1) (2))
- #123#
- #| |#
- #.(foo)
- State “TODO” from [2018-11-21 Wed 01:42]
- [X] “#\” -> ” ?”, a half assed char conversion
- [X] “#[^ (]+(” -> “(“, for cl21 hash
- [X] “#p"” -> “"”, pathname
- [X] “#\+” -> ” ”
- [X] “#|foo|#” -> ”* *”
- State “TODO” from [2018-12-05 Wed 03:50]
- State “TODO” from [2018-12-21 Fri 14:07]
Known problematic cases:
- #2A((1) (2))
- #.(foo)
Do they break nth-chop-off?
- State “TODO” from [2018-12-23 Sun 14:45]
- To properly highlight the following declaration:
(defun foo (&key (quote #'bar) (function ’baz)))
The keywords order should be:
#'baz
and&key
, by non-pospcase keywords- parameter-group, (including masked and ignored heading-keyword
&key
) quote
andfunction
, lisp keywords that can be both macro and symbol
- State “TODO” from [2018-12-24 Mon 10:35]
Actually, current design makes sense too.
- If submatcher is specified with cons cell:
(name . submatcher)
Without submatcher:
name
not
(name) or (name . nil)
Maybe optionally allow this notation?
- And faces are specified with list:
(font-lock-variable-name-face font-lock-type-face)
and requires parenthesis even when single element:
(font-lock-variable-name-face)
Because some faces are decided dynamically like:
((pospcase-font-lock-variable-face-form (match 1)))
So mandatory parenthesis makes sense.
- State “TODO” from [2019-01-13 Sun 02:44]
(defmethod #+foo-1.0 old-func
#+foo-2.0 new-func
:before
((bar baz) (qux quux))
body)
Supporting this idiom is very difficult for multiple reasons:
#+foo
sexp is invalid in elisp, so elispify hack is involved.- Number of feature cases are arbitrary.
So, very involved extension to both pospcase-read
and pcase
are
required.
Even worse, what if a user want to pattern match against #+foo
? In
that case some kind of global toggle switch is needed too.
- State “TODO” from [2019-06-30 Sun 08:11]
- State “TODO” from [2018-11-19 Mon 12:27]
- State “TODO” from [2018-11-19 Mon 13:34]
- Something like:
(pospcase-font-lock ’lisp-mode '(`(defun ,name ,args)) '((name . font-lock-function-name-face) ((args . (`(,arg ,type) `,arg))) ((arg . font-lock-function-name-face) (type . font-lock-type-face))))
and it calls
(goto-char (car args)) (pospcase-font-lock-submatcher (`(,arg ,type) `,arg))
- State “TODO” from [2018-11-23 Fri 11:11]
(let ((limit (point-max)) (keyword "defun")) (when (search-forward keyword limit t) (let ((kw-begin (match-beginning 0)) (kw-end (match-end 0)) begin end) (and (looking-at "[ \t\n;]") (setq end (match-end 0)) (search-backward "(" nil t) (setq begin (match-beginning 0)) (progn (goto-char (match-end 0)) (forward-comment most-positive-fixnum) (= (point) kw-begin)) (set-match-data (list begin end kw-begin kw-end))))) (match-string 1)) ;;; bar ( ;;; foo defun foo (bar) baz)
- State “TODO” from [2018-11-23 Fri 14:13]
- Example: `((or labels cl-labels) ,name ,args . ,__)
- State “TODO” from [2018-12-04 Tue 11:07]
- State “TODO” from [2018-12-20 Thu 14:12]
- State “TODO” from [2018-12-23 Sun 14:50]
- State “TODO” from [2019-01-11 Fri 05:29]
I can’t think any use case, but heading-keyword requirement can be lifted by searching the first quoted symbol in the pattern:
`(,name ,(and 'bizarre-syntax-keyword heading-keyword) ,args . ,_)
or the first non-comma symbol:
`(,name bizarre-syntax-keyword ,args . ,_)
- State “NOTE” from [2018-12-02 Sun 04:10]
(let ((read-with-symbol-positions t))
(read "(foo (foo))")
read-symbol-positions-list)
- State “NOTE” from [2018-11-22 Thu 10:32]
- Generic functions like
pospcase
,pospcase-at
,pospcase-read
shouldn’t silently discard errors likescan-error
for unmatched parenthesis,invalid-read-syntax
for unparsable buffer segment even after elispification. - Externally exposed font-lock functions (submatchers, preform, postform, etc.) and macros should discard errors silently.
- How about internal font-lock functions (iterator, etc)?
- State “TODO” from [2018-11-29 Thu 11:24]
- use push
(cl-loop with result do (setq result (append result (walk))))
should be
(cl-loop with result do (push (walk) result))
- State “TODO” from [2018-11-30 Fri 09:37]
- State “TODO” from [2018-11-30 Fri 09:43]
- State “TODO” from [2018-12-04 Tue 17:16]
- State “TODO” from [2018-12-27 Thu 18:51]
(setf (foo bar) baz)
Should the keyword setf
be highlighted here?