Skip to main content
added 67 characters in body
Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

Yes, use interactive with a Lisp sexp, not a literal string. You can't specify particular defaulting with a literal string arg.

You can use read-from-minibuffer, read-string, or completing-read.

Provide the value returned by (thing-at-point 'word) as the DEFAULT-VALUE argument to one of those functions, not the INITIAL-CONTENTS argument.

(You can use the initial-contents/input arg if you like, but Emacs convention prefers that you use the default-value arg nowadays.)

As for the input history list: you can provide your own history variable, or you can just use the default history list, minibuffer-history. If you use your own then the only entries on it will be previous inputs to minibuffer-input reads that use your own history variable. That can mean less noise interactively, but it can also be handy to not be so specific. It's up to you.

Yes, use interactive with a Lisp sexp, not a literal string.

You can use read-from-minibuffer, read-string, or completing-read.

Provide the value returned by (thing-at-point 'word) as the DEFAULT-VALUE argument to one of those functions, not the INITIAL-CONTENTS argument.

(You can use the initial-contents/input arg if you like, but Emacs convention prefers that you use the default-value arg nowadays.)

As for the input history list: you can provide your own history variable, or you can just use the default history list, minibuffer-history. If you use your own then the only entries on it will be previous inputs to minibuffer-input reads that use your own history variable. That can mean less noise interactively, but it can also be handy to not be so specific. It's up to you.

Yes, use interactive with a Lisp sexp, not a literal string. You can't specify particular defaulting with a literal string arg.

You can use read-from-minibuffer, read-string, or completing-read.

Provide the value returned by (thing-at-point 'word) as the DEFAULT-VALUE argument to one of those functions, not the INITIAL-CONTENTS argument.

(You can use the initial-contents/input arg if you like, but Emacs convention prefers that you use the default-value arg nowadays.)

As for the input history list: you can provide your own history variable, or you can just use the default history list, minibuffer-history. If you use your own then the only entries on it will be previous inputs to minibuffer-input reads that use your own history variable. That can mean less noise interactively, but it can also be handy to not be so specific. It's up to you.

Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

Yes, use interactive with a Lisp sexp, not a literal string.

You can use read-from-minibuffer, read-string, or completing-read.

Provide the value returned by (thing-at-point 'word) as the DEFAULT-VALUE argument to one of those functions, not the INITIAL-CONTENTS argument.

(You can use the initial-contents/input arg if you like, but Emacs convention prefers that you use the default-value arg nowadays.)

As for the input history list: you can provide your own history variable, or you can just use the default history list, minibuffer-history. If you use your own then the only entries on it will be previous inputs to minibuffer-input reads that use your own history variable. That can mean less noise interactively, but it can also be handy to not be so specific. It's up to you.