Hot answers tagged

3

One way might be like this, where expansion only occurs conditionally. Put this statement in an init file, or in an org-mode hook function and you should not get expansion in src-blocks. (setq abbrev-expand-function (lambda () (unless (org-in-src-block-p) (abbrev--default-expand))))


3

As you've seen, abbrev normally requires the abbreviation to contain only word-constituent characters, and that doesn't normally include `. You could make that character word-constituent by changing its syntax for the mode in question, but I believe it would be better to adapt abbrev (only) to your requirement (as lots of things are affected by syntax). You ...


2

The problem is probably the use of forward-symbol if ` is not a symbol-constituent character (much as the problem in the prior question was that this character was not word-constituent). A character is symbol-constituent if it has either word or symbol syntax (i.e. symbol syntax is for the additional chars that aren't already word-constituent). As before you ...


2

Yes, you can do this: (define-abbrev global-abbrev-table "h4" "hope for") if you really want an h4, you just "undo" (for me that is C-/, but you may have it bound to something else.) You can also limit the scope to a specific mode, e.g. org-mode-abbrev-table or so.


1

One way is modes based on prescient The last few candidates you selected are displayed first, followed by the most frequently selected ones, and then the remaining candidates are sorted by length. If you don't like the algorithm used for filtering, you can choose a different one by customizing prescient-filter-method.


1

It seems this has been addressed after all in similar post here that I found after the fact. The solution I settled on was as follows: (defun my-self-insert-no-abbrev-RET () (interactive) (let ((abbrev-mode nil)) (newline nil t))) (global-set-key (kbd "RET") #'my-self-insert-no-abbrev-RET)


1

An abbrev file contains regular Lisp code and is evaluated using load. Therefore all you need to do is to add (load B) (with B being the full path to file B) to your init file wherever appropriate.


Only top voted, non community-wiki answers of a minimum length are eligible