emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: by default, point should not enter the minibuffer prompt


From: Drew Adams
Subject: RE: by default, point should not enter the minibuffer prompt
Date: Thu, 9 Oct 2008 09:03:02 -0700

> > When is `minibuffer-prompt-properties' examined? Is it too 
> > late once the minibuffer is activated and a minibuffer key is hit?
> 
> It is used when generating the prompt.

So I guess it's useless to modify it on the fly after the minibuffer is entered,
e.g. in `minibuffer-setup-hook', or after a minibuffer key is hit. Too bad.

> I would suggest you make your new command a wrapper around the normal
> command; that way you can take advantage of any special handling it
> does.
> 
> (defun move-bol-or-prev-bol (&optional arg)
>   (interactive "p")
>   (let ((orig-point (point)))
>     (move-beginning-of-line arg)
>     (when (= (point) orig-point)
>       (goto-char (line-beginning-position 0)))))

OK, thanks for the suggestion.
FWIW, I'm using this, which works for all Emacs versions:

(defun icicle-beginning-of-line+ (&optional n)
  (interactive
   (list (if current-prefix-arg
             (prefix-numeric-value current-prefix-arg)
           0)))
  (unless n (setq n  0))
  (if (and (eq this-command last-command)
           (not current-prefix-arg))
      (forward-line -1)
    (forward-line (- n)))
  (when (bobp)
    (goto-char (if (fboundp 'minibuffer-prompt-end)
                   (minibuffer-prompt-end)
                 (point-min)))))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]