emacs-devel
[Top][All Lists]
Advanced

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

momentary-string-display


From: Juanma Barranquero
Subject: momentary-string-display
Date: Wed, 27 Dec 2006 02:18:29 +0100

`momentary-string-display' is a little weird function, or at least it
*acts* a little weird in my tests:

 1) It does not check that POS is valid.

 2) It does not check whether POS satisfies any restriction, nor uses
`widen' and `save-restriction' to circumvent it.

 3) Its docstring says: "Momentarily display STRING in the buffer at
POS.", which could be taken as this being valid:

 (momentary-string-display "test"
                           (with-current-buffer MY-BUFFER
                             (point-marker)))

  which isn't; the buffer temporarily modified is (current-buffer),
not MY-BUFFER.

 4) From its docstring, it seems as if STRING should always be
displayed, which isn't true (STRING is only shown when POS and point
both can be simultaneously displayed on the window).

Worse yet, in cases 1) to 3), `momentary-string-display' can err out
after displaying STRING, leaving the buffer modified and with
`buffer-file-name' set to nil.

                   /L/e/k/t/u




reply via email to

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