In interactive usage, the actual value of this variable is set up
by `grep-compute-defaults'; to change the default value, use
-\\[customize] or call the function `grep-apply-setting'."
+\\[customize] or call the function `grep-apply-setting'.
+
+Also see `grep-command-position'."
:type '(choice string
(const :tag "Not Set" nil))
:set #'grep-apply-setting)
+(defcustom grep-command-position nil
+ "Where point will be put when prompting for a grep command.
+If nil, put point at the end. If not nil, this should be the
+column number where point should be set in `grep-command'."
+ :type '(choice (const :tag "At the end" nil)
+ natnum))
+
(defcustom grep-template nil
"The default command to run for \\[lgrep].
The following place holders should be present in the string:
(progn
(grep-compute-defaults)
(let ((default (grep-default-command)))
- (list (read-shell-command "Run grep (like this): "
- (if current-prefix-arg default grep-command)
- 'grep-history
- (if current-prefix-arg nil default))))))
+ (list (read-shell-command
+ "Run grep (like this): "
+ (if current-prefix-arg
+ default
+ (if grep-command-position
+ (cons grep-command grep-command-position)
+ grep-command))
+ 'grep-history
+ (if current-prefix-arg nil default))))))
;; If called non-interactively, also compute the defaults if we
;; haven't already.
(when (eq grep-highlight-matches 'auto-detect)