unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bug references in newsticker's docstrings
@ 2006-11-27 11:18 Juanma Barranquero
  2007-02-03 17:36 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Juanma Barranquero @ 2006-11-27 11:18 UTC (permalink / raw)


net/newsticker.el contains some bits from its pre-CVS past that should
be updated:

  (defun newsticker--insert-image (img string)
   "Insert IMG with STRING at point.
 This is a work-around for a strange behavior of Emacs versions before
 21.3.50.  Images inserted with `insert-image' vanished after doing
 `fill-region'."
   ;; This should work:
   ;;(insert-image img string)
   ;; but it does not. Therefore we do this, which should be equivalent!
   (let ((pos (point)))
     ;;(insert string)
     (insert ":-)")
     (add-text-properties pos (point) (list 'display img))))

  (defun newsticker--buffer-redraw ()
   "Sometimes (CVS) Emacs forgets to update the window..."
   (if (fboundp 'force-window-update)
       (force-window-update (current-buffer))
     (redraw-frame (selected-frame)))
   (run-hooks 'newsticker-buffer-change-hook)
   (sit-for 0))

At the very least, the docstrings should be changed IMO. But the
question is: are they still relevant, i.e., do they refer to real
bugs, or it is now cargo cult and should be fixed?

AFAICS, the comment in `newsticker--insert-image' is not true anymore
(at least, no image has vanished in my tests).

`newsticker--buffer-redraw' is used mostly after calling
`add-to-visibility-spec' and `remove-from-visibility-spec', and in two
cases after adding or removing text properties. Should
`force-window-update' (or even `redraw-frame') be necessary after
that? (If so, `force-window-update' can be directly called, as it is
always going to be defined anyway.)

                    /L/e/k/t/u

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug references in newsticker's docstrings
  2006-11-27 11:18 Bug references in newsticker's docstrings Juanma Barranquero
@ 2007-02-03 17:36 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2007-02-03 17:36 UTC (permalink / raw)
  To: emacs-devel

Since no one responded, I went ahead and made the suggested changes.

> net/newsticker.el contains some bits from its pre-CVS past that should
> be updated:
>
>  (defun newsticker--insert-image (img string)
>   "Insert IMG with STRING at point.
> This is a work-around for a strange behavior of Emacs versions before
> 21.3.50.  Images inserted with `insert-image' vanished after doing
> `fill-region'."
>   ;; This should work:
>   ;;(insert-image img string)
>   ;; but it does not. Therefore we do this, which should be equivalent!
>   (let ((pos (point)))
>     ;;(insert string)
>     (insert ":-)")
>     (add-text-properties pos (point) (list 'display img))))
>
>  (defun newsticker--buffer-redraw ()
>   "Sometimes (CVS) Emacs forgets to update the window..."
>   (if (fboundp 'force-window-update)
>       (force-window-update (current-buffer))
>     (redraw-frame (selected-frame)))
>   (run-hooks 'newsticker-buffer-change-hook)
>   (sit-for 0))
>
> At the very least, the docstrings should be changed IMO. But the
> question is: are they still relevant, i.e., do they refer to real
> bugs, or it is now cargo cult and should be fixed?
>
> AFAICS, the comment in `newsticker--insert-image' is not true anymore
> (at least, no image has vanished in my tests).
>
> `newsticker--buffer-redraw' is used mostly after calling
> `add-to-visibility-spec' and `remove-from-visibility-spec', and in two
> cases after adding or removing text properties. Should
> `force-window-update' (or even `redraw-frame') be necessary after
> that? (If so, `force-window-update' can be directly called, as it is
> always going to be defined anyway.)
>
>                    /L/e/k/t/u

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-03 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-27 11:18 Bug references in newsticker's docstrings Juanma Barranquero
2007-02-03 17:36 ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).