0

I have a large set of abbreviations I defined inside an abbrev-table. Take one of them:

(define-abbrev-table 'latex-mode-abbrev-table 
  '(("ff" "my abbreviation!" 0 nil)))

If I run a predefined function that calls things through skeleton-read is there a way to expand abbreviations within that query? In other words if I define a function,

   (define-skeleton myfunc  ""  "" (setq v1 (skeleton-read "put something ")))

and call it with M-x then within the bottom bar where I type in the value can I use my abbreviation (by typing ff and then hitting the space bar) while typing there (nothing happens by default)?

1
+50

skeleton-read will read from the minibuffer, which is a separate buffer that's not using latex-mode, which is why your abbrev isn't working there.

You could put your abbrev in global-abbrev-table so it's also available in the minibuffers, you could do:

(define-skeleton myfunc
 ""  ""
 (setq v1 (minibuffer-with-setup-hook
              (lambda () (setq local-abbrev-table latex-mode-abbrev-table))
            (skeleton-read "put something "))))

to make latex-mode abbrevs available in this specific minibuffer.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.