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 ()
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).
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 ...
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.
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.
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 ()
(let ((abbrev-mode nil))
(newline nil t)))
(global-set-key (kbd "RET") #'my-self-insert-no-abbrev-RET)