ymarco/auto-activating-snippets 42
Snippets for Emacs that expand as you type
Some evil oriented additions to latex document editing in emacs
tecosaur/LaTeX-auto-activating-snippets 35
An Emacs Package
(WIP) Document viewer for Emacs
My private config for Doom Emacs
dotfiles
A utility package to collect various Icon Fonts and propertize them within Emacs.
quickly create disposable yasnippets
SQL database accepting CSV files written in Java
startedymarco/auto-activating-snippets
started time in 8 days
issue openedtecosaur/LaTeX-auto-activating-snippets
Ensure entire expression is within math before expansion
I've run into this strange issue where if I write a formula in org with laas-mode enabled, and then end a sentance after the math fragment the snippet is still activated.
For example in an org-mode before enter: hello \( some-math \).. The entire latex math fragment is wrapped in resulting in \\dot{( nm = -3 \)}.
created time in 9 days
issue closedtecosaur/LaTeX-auto-activating-snippets
laas-mode overrides org-mode aas
I'm trying to bind a snippet to use in org-mode, while also using this package laas-mode.
(use-package aas
:straight t)
(use-package laas
:straight t
:hook ((org-mode . laas-mode)
(LaTeX-mode . laas-mode))
:config
(put 'aas-set-snippets 'lisp-indent-function 'defun)
(aas-set-snippets 'laas-mode
:cond #'laas-mathp
"On" "\\mathcal{O}(n)"
"O1" "\\mathcal{O}(1)"
"Olog" "\\mathcal{O}(\\log n)"
"Olon" "\\mathcal{O}(n \\log n)"
"<<" nil)
(aas-set-snippets 'org-mode
"<<" (lambda! ()
(yas-expand-snippet
(concat ",#+BEGIN_SRC $1\n"
"$0\n"
",#+END_SRC")))))
But nothing I do seems to work :?. I know laas-mode has it's own binding for << so I disabled it, but the org-mode snippet still checks laas-mathp despite me not specifiying it as a condition for aas-set-snippets.
closed time in 11 days
mohkaleissue commenttecosaur/LaTeX-auto-activating-snippets
laas-mode overrides org-mode aas
@ymarco
Works like a charm. Thank you.
comment created time in 11 days
issue commenttecosaur/LaTeX-auto-activating-snippets
Support // for empty fraction.
@ymarco
I personally already have a yasnippet with / as a key that expands to \frac{$1}{$2}$0. This is a parallel to that, requiring // instead of /<TAB> to expand the snippet.
Interesting... although I think // will be more intuitive than /<TAB> once you get used to it.
Anyway, I'd have no problem accepting this if you refactor laas-identify-adjacent-tex-object for us.
No problem. I'll look into this a little later if that's all right. Thnx.
comment created time in 11 days
issue commenttecosaur/LaTeX-auto-activating-snippets
laas-mode overrides org-mode aas
@ymarco
But I'd like snippets (this specific snippet) to expand at the start of the line? Is there a reason laas--no-backslash-before-point? was put into aas-global-condition-hook instead of included in laas-mathp? I don't imagine it's good for laas to interfere with org-mode snippets defined outside of laas.
comment created time in 11 days
PR closed tecosaur/LaTeX-auto-activating-snippets
Before if you tried to do x5 -> x_5 and then x_51 -> x_{51}
your point would be moved outside of the closing brace so if you wanted
to add more to the body of the subscript you couldn't. Now you're kept
in there and have to exit the closing brace manually.
pr closed time in 11 days
pull request commenttecosaur/LaTeX-auto-activating-snippets
(bug): Fix multi-subscript skipped over closing brace
@ymarco
Okay, I see the intention here. Truth be told I was just experimenting with laas and wondered why 2 sub digits is OK but more seem to require movement beforehand. Thinking on it this does make more sense... in so-far as I doubt I'll be subscripting into the 100s.
This can be closed. Thnx.
comment created time in 11 days
issue commenttecosaur/LaTeX-auto-activating-snippets
laas-mode overrides org-mode aas
Actually if I apply the above patch the snippet doesn't expand at all at the start of the line, even if there's no longer any error triggered.
comment created time in 11 days
issue commenttecosaur/LaTeX-auto-activating-snippets
laas-mode overrides org-mode aas
@ymarco
Yes, you're correct. Thank you.
I'm still getting an error with my binding at the start of the buffer though:
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
laas--no-backslash-before-point\?()
aas-expand-snippet-maybe("<<" (closure (t) nil (interactive) nil (yas-expand-snippet (concat "#+BEGIN_SRC $1\n" "$0\n" "#+END_SRC"))) nil)
#f(compiled-function () #<bytecode 0x207588126261>)()
aas-post-self-insert-hook()
org-self-insert-command(1)
funcall-interactively(org-self-insert-command 1)
call-interactively(org-self-insert-command nil nil)
command-execute(org-self-insert-command)
I think it's because (char-before) is nil in laas--no-backslash-before-point?.
--- /home/mohkale/.config/dotfiles/prog/editors/emacs/lisp/straight/repos/LaTeX-auto-activating-snippets/laas.el
+++ #<buffer laas.el>
@@ -384,7 +384,8 @@
(defun laas--no-backslash-before-point? ()
"Check that the char before `point' is not a backslash."
- (/= (char-before) ?\\))
+ (when-let ((ch (char-before)))
+ (/= ch ?\\)))
(apply #'aas-set-snippets 'laas-mode laas-basic-snippets)
comment created time in 11 days
issue openedtecosaur/LaTeX-auto-activating-snippets
laas-mode overrides org-mode aas
I'm trying to bind a snippet to use in org-mode, while also using this package laas-mode.
(use-package aas
:straight t)
(use-package laas
:straight t
:hook ((org-mode . laas-mode)
(LaTeX-mode . laas-mode))
:config
(put 'aas-set-snippets 'lisp-indent-function 'defun)
(aas-set-snippets 'laas-mode
:cond #'laas-mathp
"On" "\\mathcal{O}(n)"
"O1" "\\mathcal{O}(1)"
"Olog" "\\mathcal{O}(\\log n)"
"Olon" "\\mathcal{O}(n \\log n)"
"<<" nil)
(aas-set-snippets 'org-mode
"<<" (lambda! ()
(yas-expand-snippet
(concat ",#+BEGIN_SRC $1\n"
"$0\n"
",#+END_SRC")))))
But nothing I do seems to work :?. I know laas-mode has it's own binding for << so I disabled it, but the org-mode snippet still checks laas-mathp despite me not specifiying it as a condition for aas-set-snippets.
created time in 12 days
PR opened tecosaur/LaTeX-auto-activating-snippets
Before if you tried to do x5 -> x_5 and then x_51 -> x_{51}
your point would be moved outside of the closing brace so if you wanted
to add more to the body of the subscript you couldn't. Now you're kept
in there and have to exit the closing brace manually.
pr created time in 12 days
PR opened tecosaur/LaTeX-auto-activating-snippets
Closes #12
pr created time in 12 days
issue openedtecosaur/LaTeX-auto-activating-snippets
Support // for empty fraction.
The README for this package suggests binding // to an empty fraction snippet but that won't work with the current implementation because it interferes with the / snippet. I'd suggest allowing the / snippet to support // as well. Thoughts?
created time in 12 days
startedymarco/auto-activating-snippets
started time in 14 days
issue openedymarco/auto-activating-snippets
This is really minor, but every function starts with "aas", except for "ass-activate-for-major-mode". Was this intentional?
created time in 14 days
startedymarco/paper-mode
started time in 17 days
issue commenttecosaur/LaTeX-auto-activating-snippets
ok, thank you for your quick reply; I try to get familiar with it
comment created time in 24 days
issue commenttecosaur/LaTeX-auto-activating-snippets
Hmmm. That's would be nice. I can't say I'll work on this any time soon but feel free to propose something.
comment created time in 24 days
issue openedtecosaur/LaTeX-auto-activating-snippets
Hi,
very interesting snippets approach... is there some thinking about handling siunitx with the convenient approach as well?
It would be great if the units get converted like m gets converted to \m and e.g. kg to \kg... but only if it is located in the second part of the SI-environment $\SI{10}{\m}... maybe this already possible!?
Thank you in advance!
Fab
created time in 24 days
startedymarco/paper-mode
started time in a month
startedymarco/paper-mode
started time in a month
startedymarco/paper-mode
started time in a month
pull request commentiyefrat/evil-tex
Fix conflicting key bindings with evil-org
Never mind, I think I misunderstood what you meant by fall back. I can put a conditional in the evil-tex-go-{back,forward}-section for org-mode if that's what you mean.
comment created time in a month
pull request commentiyefrat/evil-tex
Fix conflicting key bindings with evil-org
So the problem with that I think is that evil-tex-mode-map is a minor mode map which overrides the bindings in the org-mode major mode map. Minor mode maps appear to be "global" and the way to have different minor mode mappings per major-mode is to use minor-mode-overriding-map-alist.
comment created time in a month
issue commentiyefrat/evil-tex
Conflicting key bindings with evil-org
We could have a check like:
(condition-case nil (evil-tex-an-env)
(error (when (and (eq major-mode 'org-mode) (fboundp 'evil-org-an-object))
(evil-org-an-object)))
This would avoid placing an explicit dependency on evil-org.
comment created time in a month