Gnus development mailing list
 help / color / mirror / Atom feed
* picons
@ 2001-12-29 19:05 Henrik Enberg
  2001-12-29 20:44 ` picons ShengHuo ZHU
  0 siblings, 1 reply; 13+ messages in thread
From: Henrik Enberg @ 2001-12-29 19:05 UTC (permalink / raw)



I'm getting the following error with todays CVS Gnus: 

gnus-treat-article: Cannot open load file: gnus-picon

That file doesn't get installed for me in Emacs 21.  To get rid of the
error i had to set gnus-treat-display-picons to nil in dotgnus.

If Emacs 21 can do picons maybe it should be installed?

Henrik
-- 
One of the common denominators I have found is that expectations rise
above that which is expected.
		-- George W. Bush



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

* Re: picons
  2001-12-29 19:05 picons Henrik Enberg
@ 2001-12-29 20:44 ` ShengHuo ZHU
  2001-12-29 21:13   ` picons Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: ShengHuo ZHU @ 2001-12-29 20:44 UTC (permalink / raw)


Henrik Enberg <henrik@enberg.org> writes:

> I'm getting the following error with todays CVS Gnus: 
>
> gnus-treat-article: Cannot open load file: gnus-picon
>
> That file doesn't get installed for me in Emacs 21.  To get rid of the
> error i had to set gnus-treat-display-picons to nil in dotgnus.
>
> If Emacs 21 can do picons maybe it should be installed?

Fixed, though there are some warnings. I guess Lars is hacking it.

ShengHuo



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

* Re: picons
  2001-12-29 20:44 ` picons ShengHuo ZHU
@ 2001-12-29 21:13   ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2001-12-29 21:13 UTC (permalink / raw)


ShengHuo ZHU <zsh@cs.rochester.edu> writes:

> Fixed, though there are some warnings. I guess Lars is hacking it.

Yeah; I didn't mean to check it in yet, but I accidentally did.

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: picons
  1999-04-20 10:00 picons David Hedbor
@ 1999-06-12  2:17 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-06-12  2:17 UTC (permalink / raw)


David Hedbor <david@hedbor.org> writes:

> If there are any matching picons, show the address with the picon
> substitution. If not, show nothing. This would be for both user and
> group, meaning that if there is no match for the group, the group name 
> alone wouldn't be shown, and the opposite.
> 
> Simple fix by adding an new option?

Well, if anybody contributes a patch to fix this, I'll apply it.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

* picons
@ 1999-04-20 10:00 David Hedbor
  1999-06-12  2:17 ` picons Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: David Hedbor @ 1999-04-20 10:00 UTC (permalink / raw)


Picons are cool. However everyone aren't in the database. I currently
show the picons below the headers and it works great. I do however
want the "view as address" option turned on, since I think that makes
things nicer. However if I use that, I always get a line that would
separate group and user. It takes up a lot of space and looks rather
ugly. What I want is:

If there are any matching picons, show the address with the picon
substitution. If not, show nothing. This would be for both user and
group, meaning that if there is no match for the group, the group name 
alone wouldn't be shown, and the opposite.

Simple fix by adding an new option?

-- 
[ Below is a random fortune, which is unrelated to the above message. ]
Schapiro's Explanation:
	The grass is always greener on the other side -- but that's
	because they use more manure.



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

* Re: Picons
  1998-02-28 18:09       ` Picons Hans de Graaff
@ 1998-03-02 16:43         ` Wes Hardaker
  0 siblings, 0 replies; 13+ messages in thread
From: Wes Hardaker @ 1998-03-02 16:43 UTC (permalink / raw)
  Cc: ding

>>>>> On 28 Feb 1998 19:09:33 +0100, Hans de Graaff <graaff@xs4all.nl> said:

Hans> I would really like to see a 'headers option. I don't display
Hans> the Newsgroups: header anyway, and the From: header is often 48
Hans> pixels anyway because X-Face: headers are shown there already.

So, uh, want to implement it?  (I'm too busy writing multiplayer tank
wars games in java in my hour a week of spare time).  A generic
piconify-region or piconify-address-at-point should be written and
then gnus-display-picons would call that function repeatedly to handle 
headers.

Then, a gnus-picons-headers-list should be used to figure out which
headers to piconify, 'all being the most pretty, colorful and wasteful
in space ;-).

-- 
"Ninjas aren't dangerous.  They're more afraid of you than you are of them."


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

* Re: Picons
  1998-02-13 16:50 Picons Lars Magne Ingebrigtsen
  1998-02-13 19:23 ` Picons Wes Hardaker
@ 1998-03-01 15:05 ` Kim-Minh Kaplan
  1 sibling, 0 replies; 13+ messages in thread
From: Kim-Minh Kaplan @ 1998-03-01 15:05 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

>>>>> On February 25, 1998, Wes Hardaker said:

>>>>> On February 13, 1998, Lars Magne Ingebrigtsen said:

>>>>> Sometimes ago Kim-Minh Kaplan said:

    Lars> Picons don't work if you have more than one article buffer
    Lars> open at the same time.  [...]  (This is with
    Lars> `gnus-single-article-buffer' set to nil.)

This should mostly fix this bug.  There is still a race condition when
`gnus-single-article-buffer' is nil and `gnus-picons-piconsearch-url'
is non-nil ; I only have intermittent Internet connection now so I
can't really work on this.

Also, I could not find the correct hook to install
`gnus-picons-kill-buffer'.  The problem is that
`gnus-summary-prepare-exit-hook' is not used when you exit the group
with `gnus-summary-exit-no-update'.  Is there another hook I should
use for that ?

    Kim-Minh> We could also remove the X-Face display functionnality
    Kim-Minh> that is already available with `gnus-article-display-xface'

    Wes> Definately.  I wrote it as a hack before the current
    Wes> implementation was done.

So Lars, is that OK for you too ?

Kim-Minh.

[-- Attachment #2: Type: text/plain, Size: 7850 bytes --]

--- gnus/lisp/ChangeLog-0.34	Sun Mar  1 15:13:49 1998
+++ gnus/lisp/ChangeLog	Sun Mar  1 15:34:11 1998
@@ -1,3 +1,23 @@
+1998-03-01  Kim-Minh Kaplan  <KimMinh.Kaplan@utopia.eunet.fr>
+
+	* gnus-win.el (gnus-window-to-buffer): change "*Picons*" to
+	`gnus-picons-buffer'.
+	(gnus-window-to-buffer-helper): Support dynamic picon buffer
+	name (i.e a symbol that names a function to be called).
+	(gnus-configure-frame): Use it.
+	(gnus-delete-windows-in-gnusey-frames): Use it.
+	(gnus-all-windows-visible-p): Use it.
+	(gnus-remove-some-windows): Use it.
+
+	* gnus-picon.el (gnus-get-buffer-name): Use it.
+	(gnus-picons-kill-buffer): New function.
+	(gnus-picons-setup-buffer): New function.
+	(gnus-picons-set-buffer): Use them.
+	(gnus-picons-display-x-face): Put back the `buf' binding: it is
+ 	needed when `gnus-picons-display-where' is not set to article.
+  	Also move the X-Face to the left, near the address.  It seems more
+ 	logical.
+
 Sat Feb 28 08:27:20 1998  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
 	* gnus.el: Quassia Gnus v0.34 is released.
--- gnus/lisp/gnus-picon.el-0.34	Sun Mar  1 13:17:31 1998
+++ gnus/lisp/gnus-picon.el	Sun Mar  1 15:27:48 1998
@@ -184,17 +184,38 @@
 
 (defun gnus-get-buffer-name (variable)
   "Returns the buffer name associated with the contents of a variable."
-  (cond ((symbolp variable) (let ((newvar (cdr (assq variable
-						     gnus-window-to-buffer))))
-			      (cond ((symbolp newvar)
-				     (symbol-value newvar))
-				    ((stringp newvar) newvar))))
-        ((stringp variable) variable)))
+  (buffer-name (get-buffer (gnus-window-to-buffer-helper variable))))
+
+(defun gnus-picons-buffer-name ()
+  (cond ((or (stringp gnus-picons-display-where)
+	     (bufferp gnus-picons-display-where))
+	 gnus-picons-display-where)
+	((eq gnus-picons-display-where 'picons)
+	 (if gnus-single-article-buffer
+	     "*Picons*"
+	   (concat "*Picons " gnus-newsgroup-name "*")))
+	(t
+	 (gnus-get-buffer-name gnus-picons-display-where))))
+
+(defun gnus-picons-kill-buffer ()
+  (let ((buf (get-buffer (gnus-picons-buffer-name))))
+    (if (buffer-live-p buf)
+	(kill-buffer buf))))
+
+(defun gnus-picons-setup-buffer ()
+  (let ((name (gnus-picons-buffer-name)))
+    (save-excursion
+      (if (get-buffer name)
+	  (set-buffer name)
+	(set-buffer (get-buffer-create name))
+	(buffer-disable-undo)
+	(setq buffer-read-only t)
+	(gnus-add-current-to-buffer-list)
+	(add-hook 'gnus-summary-prepare-exit-hook 'gnus-picons-kill-buffer))
+      (current-buffer))))
 
 (defun gnus-picons-set-buffer ()
-  (set-buffer
-   (get-buffer-create (gnus-get-buffer-name gnus-picons-display-where)))
-  (gnus-add-current-to-buffer-list)
+  (set-buffer (gnus-picons-setup-buffer))
   (goto-char (point-min))
   (if (and (eq gnus-picons-display-where 'article)
 	   gnus-picons-display-article-move-p)
@@ -242,11 +263,16 @@
   (if (featurep 'xface)
       ;; Use builtin support
       (save-excursion
-	(gnus-picons-set-buffer)
-	(gnus-picons-make-annotation
-	 (vector 'xface
-		 :data (concat "X-Face: " (buffer-substring beg end)))
-	 nil 'text))
+	;; Don't remove this binding, it is really needed: when
+	;; `gnus-picons-set-buffer' changes buffer (like when it is
+	;; set to display picons outside of the article buffer), BEG
+	;; and END still refer the buffer current now !
+	(let ((buf (current-buffer)))
+	  (gnus-picons-set-buffer)
+	  (gnus-picons-make-annotation
+	   (vector 'xface
+		   :data (concat "X-Face: " (buffer-substring beg end buf)))
+	   nil 'text nil nil nil t)))
     ;; convert the x-face header to a .xbm file
     (let* ((process-connection-type nil)
 	   (process (start-process-shell-command "gnus-x-face" nil 
--- gnus/lisp/gnus-win.el-0.34	Sun Mar  1 13:16:24 1998
+++ gnus/lisp/gnus-win.el	Sun Mar  1 15:20:34 1998
@@ -182,7 +182,7 @@
     (mail . gnus-message-buffer)
     (post-news . gnus-message-buffer)
     (faq . gnus-faq-buffer)
-    (picons . "*Picons*")
+    (picons . gnus-picons-buffer-name)
     (tree . gnus-tree-buffer)
     (score-trace . "*Score Trace*")
     (info . gnus-info-buffer)
@@ -267,6 +267,13 @@
 
 (defvar gnus-frame-list nil)
 
+(defun gnus-window-to-buffer-helper (obj)
+  (if (symbolp obj)
+      (if (boundp obj)
+	  (symbol-value obj)
+	(funcall obj))
+    obj))
+
 (defun gnus-configure-frame (split &optional window)
   "Split WINDOW according to SPLIT."
   (unless window
@@ -300,15 +307,11 @@
      ;; This is a buffer to be selected.
      ((not (memq type '(frame horizontal vertical)))
       (let ((buffer (cond ((stringp type) type)
-			  (t (cdr (assq type gnus-window-to-buffer)))))
-	    buf)
+			  (t (cdr (assq type gnus-window-to-buffer))))))
 	(unless buffer
 	  (error "Illegal buffer type: %s" type))
-	(unless (setq buf (get-buffer (if (symbolp buffer)
-					  (symbol-value buffer) buffer)))
-	  (setq buf (get-buffer-create (if (symbolp buffer)
-					   (symbol-value buffer) buffer))))
-	(switch-to-buffer buf)
+	(switch-to-buffer (get-buffer-create
+			   (gnus-window-to-buffer-helper buffer)))
 	;; We return the window if it has the `point' spec.
 	(and (memq 'point split) window)))
      ;; This is a frame split.
@@ -439,12 +442,7 @@
   (let ((buffers
 	 (mapcar
 	  (lambda (elem)
-	    (if (symbolp (cdr elem))
-		(when (and (boundp (cdr elem))
-			   (symbol-value (cdr elem)))
-		  (get-buffer (symbol-value (cdr elem))))
-	      (when (cdr elem)
-		(get-buffer (cdr elem)))))
+	    (get-buffer (gnus-window-to-buffer-helper (cdr elem))))
 	  gnus-window-to-buffer)))
     (mapcar
      (lambda (frame)
@@ -493,12 +491,9 @@
 			   (t (cdr (assq type gnus-window-to-buffer)))))
 	(unless buffer
 	  (error "Illegal buffer type: %s" type))
-	(when (setq buf (get-buffer (if (symbolp buffer)
-					(symbol-value buffer)
-				      buffer)))
-	  (setq win (get-buffer-window buf t)))
-	(if win
-	    (when (memq 'point split)
+	(if (and (setq buf (get-buffer (gnus-window-to-buffer-helper buffer)))
+		 (setq win (get-buffer-window buf t)))
+	    (if (memq 'point split)
 	      (setq all-visible win))
 	  (setq all-visible nil)))
        (t
@@ -517,10 +512,7 @@
     (save-excursion
       ;; Remove windows on all known Gnus buffers.
       (while buffers
-	(setq buf (cdar buffers))
-	(when (symbolp buf)
-	  (setq buf (and (boundp buf) (symbol-value buf))))
-	(and buf
+	(and (setq buf (gnus-window-to-buffer-helper (cdar buffers)))
 	     (get-buffer-window buf)
 	     (progn
 	       (push buf bufs)
--- gnus/texi/ChangeLog-0.34	Sun Mar  1 15:34:48 1998
+++ gnus/texi/ChangeLog	Sun Mar  1 15:37:02 1998
@@ -1,3 +1,9 @@
+1998-03-01  Kim-Minh Kaplan  <KimMinh.Kaplan@utopia.eunet.fr>
+
+	* gnus.texi (Easy Picons): Removed references to
+	`gnus-group-display-picons'.
+	(Hard Picons): Ditto.
+
 Mon Feb 23 18:05:09 1998  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
 
 	* gnus.texi: Direntry not handled by Emacs 19.34.
--- gnus/texi/gnus.texi-0.34	Sat Feb 28 14:25:29 1998
+++ gnus/texi/gnus.texi	Sun Mar  1 13:53:36 1998
@@ -14554,7 +14554,6 @@
 @lisp
 (setq gnus-use-picons t)
 (add-hook 'gnus-article-display-hook 'gnus-article-display-picons t)
-(add-hook 'gnus-summary-prepare-hook 'gnus-group-display-picons t)
 (add-hook 'gnus-article-display-hook 'gnus-picons-article-display-x-face)
 @end lisp
 
@@ -14633,13 +14632,6 @@
 Looks up and displays the picons for the author and the author's domain
 in the @code{gnus-picons-display-where} buffer.  Should be added to the
 @code{gnus-article-display-hook}.
-
-@item gnus-group-display-picons
-@findex gnus-article-display-picons
-Displays picons representing the current group.  This function should
-be added to the @code{gnus-summary-prepare-hook} or to the
-@code{gnus-article-display-hook} if @code{gnus-picons-display-where}
-is set to @code{article}.
 
 @item gnus-picons-article-display-x-face
 @findex gnus-article-display-picons

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

* Re: Picons
  1998-02-26  0:57     ` Picons Wes Hardaker
@ 1998-02-28 18:09       ` Hans de Graaff
  1998-03-02 16:43         ` Picons Wes Hardaker
  0 siblings, 1 reply; 13+ messages in thread
From: Hans de Graaff @ 1998-02-28 18:09 UTC (permalink / raw)


Wes Hardaker <wjhardaker@ucdavis.edu> writes:

> However, I still think the variable should also contain a 'headers
> possibility where it hides parts of the headers instead.  Other
> people won't like this, since it'll make the headers even taller
> (with both the Newsgroups and From lines being 48 pixels high).

I would really like to see a 'headers option. I don't display the
Newsgroups: header anyway, and the From: header is often 48 pixels
anyway because X-Face: headers are shown there already.

Hans


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

* Re: Picons
  1998-02-26  0:30   ` Picons Kim-Minh Kaplan
@ 1998-02-26  0:57     ` Wes Hardaker
  1998-02-28 18:09       ` Picons Hans de Graaff
  0 siblings, 1 reply; 13+ messages in thread
From: Wes Hardaker @ 1998-02-26  0:57 UTC (permalink / raw)
  Cc: ding


Kim-Minh> When it is `picons' (the default) then the *Picons* buffer
Kim-Minh> only shows the picons for the last loaded message.  If you'd
Kim-Minh> ask me we would just remove this variable and always use the
Kim-Minh> article buffer...

Well, no...  I was designed for maximum customiziblity.  Specifically, 
I used to put it in the picons window when I had multiple frames open
while using gnus.  I wanted to maximize the article buffer, and didn't 
want them there.  I've since changed, but I think the principal is
still the same.  (I also wanted to make them possibly vertical so you
could have a vertical buffer as well, but, well, thats a bit extreme
(it was originally Lars' idea actually)).

However, I still think the variable should also contain a 'headers
possibility where it hides parts of the headers instead.  Other people 
won't like this, since it'll make the headers even taller (with both
the Newsgroups and From lines being 48 pixels high).

Kim-Minh> We could also remove the X-Face display functionnality that
Kim-Minh> is already available with `gnus-article-display-xface'

Definately.  I wrote it as a hack before the current implementation
was done.

Glad to see someone tinkering with it again!

-- 
"Ninjas aren't dangerous.  They're more afraid of you than you are of them."


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

* Re: Picons
  1998-02-13 19:23 ` Picons Wes Hardaker
  1998-02-14 15:53   ` Picons Lars Magne Ingebrigtsen
@ 1998-02-26  0:30   ` Kim-Minh Kaplan
  1998-02-26  0:57     ` Picons Wes Hardaker
  1 sibling, 1 reply; 13+ messages in thread
From: Kim-Minh Kaplan @ 1998-02-26  0:30 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1035 bytes --]

>>>>> On 13 Feb 1998 Lars Magne Ingebrigtsen said:

    Lars> Picons don't work if you have more than one article buffer
    Lars> open at the same time.

OK, I changed them.  They now work correctly when `gnus-picons-display-where'
is `article'.

When it is `picons' (the default) then the *Picons* buffer only shows
the picons for the last loaded message.  If you'd ask me we would just
remove this variable and always use the article buffer...

We could also remove the X-Face display functionnality that is already 
available with `gnus-article-display-xface'

Note that you should also remove `gnus-group-display-picons' from the
`gnus-summary-prepare-hook' ; it is now done inside
`gnus-article-display-picons'.

>>>>> On February 13, 1998, Wes Hardaker said:

    Wes> (there is other bugs in the picons code that got inserted in
    Wes> the last few patches people sent to you as well).

This patch fixes the problem about deleted extents that you must have
seen if you are displaying picons in the article buffer.

Kim-Minh.

[-- Attachment #2: Type: text/plain, Size: 9984 bytes --]

--- /usr/local/lib/xemacs/gnus/lisp/gnus-picon.el.orig	Wed Feb 25 19:44:11 1998
+++ /usr/local/lib/xemacs/gnus/lisp/gnus-picon.el	Thu Feb 26 01:17:54 1998
@@ -90,7 +90,7 @@
   :group 'picons)
 
 (defcustom gnus-picons-x-face-file-name
-  '(format "/tmp/picon-xface.%s.xbm" (user-login-name))
+  (format "/tmp/picon-xface.%s.xbm" (user-login-name))
   "*The name of the file in which to store the converted X-face header."
   :type 'string
   :group 'picons)
@@ -159,13 +159,6 @@
   "Picons file names cache.
 List of pairs (KEY . NAME) where KEY is (USER HOST DBS) and NAME is an URL.")
 
-(defvar gnus-group-annotations nil
-  "List of annotations added/removed when selecting/exiting a group")
-(defvar gnus-article-annotations nil
-  "List of annotations added/removed when selecting an article")
-(defvar gnus-x-face-annotations nil
-  "List of annotations added/removed when selecting an article with an X-Face.")
-
 (defvar gnus-picons-jobs-alist nil
   "List of jobs that still need be done.
 This is a list of (SYM-ANN TAG ARGS...) where SYM-ANN three annotations list,
@@ -178,28 +171,16 @@
 
 ;;; Functions:
 
-(defun gnus-picons-remove (symbol)
-  "Remove all annotations in variable named SYMBOL.
-This function is careful to set it to nil before removing anything so that
-asynchronous process don't get crazy."
-  (setq gnus-picons-jobs-alist (remassq symbol gnus-picons-jobs-alist))
-  ;; notify running job that it may have been preempted
-  (if (and (listp gnus-picons-job-already-running)
-	   (eq (car gnus-picons-job-already-running) symbol))
-      (setq gnus-picons-job-already-running t))
-  ;; clear all annotations
-  (mapc (function (lambda (item)
-		    (if (annotationp item)
-			(delete-annotation item))))
-	(prog1 (symbol-value symbol)
-	  (set symbol nil))))
-
 (defun gnus-picons-remove-all ()
   "Removes all picons from the Gnus display(s)."
   (interactive)
-  (gnus-picons-remove 'gnus-article-annotations)
-  (gnus-picons-remove 'gnus-group-annotations)
-  (gnus-picons-remove 'gnus-x-face-annotations))
+  (map-extents (function (lambda (ext unused) (delete-annotation ext) nil))
+	       nil nil nil nil nil 'gnus-picon)
+  (setq gnus-picons-jobs-alist '())
+  ;; notify running job that it may have been preempted
+  (if (and (listp gnus-picons-job-already-running)
+	   gnus-picons-job-already-running)
+      (setq gnus-picons-job-already-running t)))
 
 (defun gnus-get-buffer-name (variable)
   "Returns the buffer name associated with the contents of a variable."
@@ -226,41 +207,33 @@
 		     (list (list (current-buffer)
 				 (cons nil gnus-picons-has-modeline-p)))))))
 
-(defun gnus-picons-prepare-for-annotations (annotations)
-  "Prepare picons buffer for puting annotations memorized in ANNOTATIONS.
-ANNOTATIONS should be a symbol naming a variable wich contains a list of
-annotations.  Sets buffer to `gnus-picons-display-where'."
+(defun gnus-picons-prepare-for-annotations ()
+  "Prepare picons buffer for putting annotations."
   ;; let drawing catch up
   (when gnus-picons-refresh-before-display
     (sit-for 0))
   (gnus-picons-set-buffer)
-  (gnus-picons-remove annotations))
+  (gnus-picons-remove-all))
 
-(defsubst gnus-picons-make-annotation (&rest args)
+(defun gnus-picons-make-annotation (&rest args)
   (let ((annot (apply 'make-annotation args)))
-    (set-extent-property annot 'duplicable nil)
+    (set-extent-property annot 'gnus-picon t)
+    (set-extent-property annot 'duplicable t)
     annot))
 
 (defun gnus-picons-article-display-x-face ()
   "Display the x-face header bitmap in the 'gnus-picons-display-where buffer."
-  ;; delete any old ones.
-  ;; This is needed here because gnus-picons-display-x-face will not
-  ;; be called if there is no X-Face header
-  (gnus-picons-remove 'gnus-x-face-annotations)
-  ;; display the new one.
   (let ((gnus-article-x-face-command 'gnus-picons-display-x-face))
     (gnus-article-display-x-face)))
 
 (defun gnus-picons-x-face-sentinel (process event)
-  (let* ((env (assq process gnus-picons-processes-alist))
-	 (annot (cdr env)))
+  (when (memq process gnus-picons-processes-alist)
     (setq gnus-picons-processes-alist
-	  (remassq process gnus-picons-processes-alist))
-    (when (annotationp annot)
-      (set-annotation-glyph annot
-			    (make-glyph gnus-picons-x-face-file-name))
-      (if (memq annot gnus-x-face-annotations)
-	  (delete-file gnus-picons-x-face-file-name)))))
+	  (delq process gnus-picons-processes-alist))
+    (gnus-picons-set-buffer)
+    (gnus-picons-make-annotation (make-glyph gnus-picons-x-face-file-name)
+				 nil 'text)
+    (delete-file gnus-picons-x-face-file-name)))
 
 (defun gnus-picons-display-x-face (beg end)
   "Function to display the x-face header in the picons window.
@@ -268,26 +241,17 @@
   (interactive)
   (if (featurep 'xface)
       ;; Use builtin support
-      (let ((buf (current-buffer)))
-	(save-excursion
-	  (gnus-picons-prepare-for-annotations 'gnus-x-face-annotations)
-	  (setq gnus-x-face-annotations
-		(cons (gnus-picons-make-annotation
-		       (vector 'xface
-			       :data (concat "X-Face: "
-					     (buffer-substring beg end buf)))
-				       nil 'text)
-		      gnus-x-face-annotations))))
+      (save-excursion
+	(gnus-picons-set-buffer)
+	(gnus-picons-make-annotation
+	 (vector 'xface
+		 :data (concat "X-Face: " (buffer-substring beg end buf)))
+	 nil 'text))
     ;; convert the x-face header to a .xbm file
     (let* ((process-connection-type nil)
-	   (annot (save-excursion
-		    (gnus-picons-prepare-for-annotations
-		     'gnus-x-face-annotations)
-		    (gnus-picons-make-annotation nil nil 'text)))
 	   (process (start-process-shell-command "gnus-x-face" nil 
 						 gnus-picons-convert-x-face)))
-      (push annot gnus-x-face-annotations)
-      (push (cons process annot) gnus-picons-processes-alist)
+      (push process gnus-picons-processes-alist)
       (process-kill-without-query process)
       (set-process-sentinel process 'gnus-picons-x-face-sentinel)
       (process-send-region process beg end)
@@ -312,37 +276,28 @@
 			     (message-tokenize-header gnus-local-domain "."))
 		       (message-tokenize-header (substring from (1+ at-idx))
 						"."))))
-	  (gnus-picons-prepare-for-annotations 'gnus-article-annotations)
-	  ;; if display in article buffer, the group annotations
-	  ;; wrongly placed.  Move them here
-	  (if (eq gnus-picons-display-where 'article)
-	      (dolist (ext gnus-group-annotations)
-		(when (extent-live-p ext)
-		  (set-extent-endpoints ext (point) (point)))))
+	  (gnus-picons-prepare-for-annotations)
+	  (gnus-group-display-picons)
 	  (if (null gnus-picons-piconsearch-url)
-	      (setq gnus-article-annotations
-		    (nconc gnus-article-annotations
-			   (gnus-picons-display-pairs
-			    (gnus-picons-lookup-pairs
-			     addrs gnus-picons-domain-directories)
-			    gnus-picons-display-as-address
-			    "." t)
-			   (if (and gnus-picons-display-as-address addrs)
-			       (list (gnus-picons-make-annotation
-				      [string :data "@"] nil
-				      'text nil nil nil t)))
-			   (gnus-picons-display-picon-or-name
-			    (gnus-picons-lookup-user username addrs)
-			    username t)))
+	      (progn
+		(gnus-picons-display-pairs (gnus-picons-lookup-pairs
+					    addrs
+					    gnus-picons-domain-directories)
+					   gnus-picons-display-as-address
+					   "." t)
+		(if (and gnus-picons-display-as-address addrs)
+		    (gnus-picons-make-annotation
+		     [string :data "@"] nil 'text nil nil nil t))
+		(gnus-picons-display-picon-or-name
+		 (gnus-picons-lookup-user username addrs)
+		 username t))
 	    (push (list 'gnus-article-annotations 'search username addrs
 			gnus-picons-domain-directories t)
 		  gnus-picons-jobs-alist)
-	    (gnus-picons-next-job))
-
-	  (add-hook 'gnus-summary-exit-hook 'gnus-picons-remove-all))))))
+	    (gnus-picons-next-job)))))))
 
 (defun gnus-group-display-picons ()
-  "Display icons for the group in the gnus-picons-display-where buffer."
+  "Display icons for the group in the `gnus-picons-display-where' buffer."
   (interactive)
   (when (and (featurep 'xpm)
 	     (or (not (fboundp 'device-type)) (equal (device-type) 'x))
@@ -350,16 +305,15 @@
 		 (not (string-match gnus-picons-group-excluded-groups
 				    gnus-newsgroup-name))))
     (save-excursion
-      (gnus-picons-prepare-for-annotations 'gnus-group-annotations)
+      (gnus-picons-prepare-for-annotations)
       (if (null gnus-picons-piconsearch-url)
-	  (setq gnus-group-annotations
-		(gnus-picons-display-pairs
+	  (gnus-picons-display-pairs
 		 (gnus-picons-lookup-pairs
 		  (reverse (message-tokenize-header
 			    (gnus-group-real-name gnus-newsgroup-name) 
 			    "."))
 		  gnus-picons-news-directories)
-		 t "."))
+		 t ".")
 	(push (list 'gnus-group-annotations 'search nil
 		    (message-tokenize-header 
 		     (gnus-group-real-name gnus-newsgroup-name) ".")
@@ -372,7 +326,7 @@
 
       (add-hook 'gnus-summary-exit-hook 'gnus-picons-remove-all))))
 
-(defsubst gnus-picons-lookup-internal (addrs dir)
+(defun gnus-picons-lookup-internal (addrs dir)
   (setq dir (expand-file-name dir gnus-picons-database))
   (gnus-picons-try-face (dolist (part (reverse addrs) dir)
 			  (setq dir (expand-file-name part dir)))))
@@ -601,8 +555,7 @@
 
 (defun gnus-picons-network-display-internal (sym-ann glyph part right-p)
   (gnus-picons-set-buffer)
-  (set sym-ann (nconc (symbol-value sym-ann)
-		      (gnus-picons-display-picon-or-name glyph part right-p)))
+  (gnus-picons-display-picon-or-name glyph part right-p)
   (gnus-picons-next-job-internal))
 
 (defun gnus-picons-network-display-callback (url part sym-ann right-p)
@@ -697,6 +650,7 @@
 				       (prog1 (gnus-picons-parse-filenames)
 					 (kill-buffer (current-buffer)))))
 
+;; Initiate a query on the picon database
 (defun gnus-picons-network-search (user addrs dbs sym-ann right-p)
   (let* ((host (mapconcat 'identity addrs "."))
 	 (key (list (or user "unknown") host (if user

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

* Re: Picons
  1998-02-13 19:23 ` Picons Wes Hardaker
@ 1998-02-14 15:53   ` Lars Magne Ingebrigtsen
  1998-02-26  0:30   ` Picons Kim-Minh Kaplan
  1 sibling, 0 replies; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-02-14 15:53 UTC (permalink / raw)


Wes Hardaker <wjhardaker@ucdavis.edu> writes:

> Change the way picons works to using something like
> 'piconify-email-address' and 'piconify-news-group' that takes a region 
> (or something at mark) and hides parts of it replacing it with picons
> instead.

Sounds like a good idea.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

* Re: Picons
  1998-02-13 16:50 Picons Lars Magne Ingebrigtsen
@ 1998-02-13 19:23 ` Wes Hardaker
  1998-02-14 15:53   ` Picons Lars Magne Ingebrigtsen
  1998-02-26  0:30   ` Picons Kim-Minh Kaplan
  1998-03-01 15:05 ` Picons Kim-Minh Kaplan
  1 sibling, 2 replies; 13+ messages in thread
From: Wes Hardaker @ 1998-02-13 19:23 UTC (permalink / raw)


>>>>> On 13 Feb 1998 17:50:24 +0100, Lars Magne Ingebrigtsen <larsi@gnus.org> said:

Lars> Picons don't work if you have more than one article buffer open
Lars> at the same time.  I think the relevant variables should be made
Lars> buffer-local to the article buffer, but I'm not all that
Lars> familiar with the code, so could someone who is do something
Lars> about this?

Well, what I *really* want to see happen is to do something altogether 
different:

Change the way picons works to using something like
'piconify-email-address' and 'piconify-news-group' that takes a region 
(or something at mark) and hides parts of it replacing it with picons
instead.  This way you could set the picon's location to something
like 'headers and it would munge whatever headers you had set in the
'gnus-picons-header-list' or something (the most fun setting being
'all' of course....  Pages and pages of them...).

Sadly, I've too many other projects under my sleve that are keeping me 
away from implementing it.

(there is other bugs in the picons code that got inserted in the last
few patches people sent to you as well).

-- 
"Ninjas aren't dangerous.  They're more afraid of you than you are of them."


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

* Picons
@ 1998-02-13 16:50 Lars Magne Ingebrigtsen
  1998-02-13 19:23 ` Picons Wes Hardaker
  1998-03-01 15:05 ` Picons Kim-Minh Kaplan
  0 siblings, 2 replies; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-02-13 16:50 UTC (permalink / raw)


Picons don't work if you have more than one article buffer open at the
same time.  I think the relevant variables should be made buffer-local
to the article buffer, but I'm not all that familiar with the code, so
could someone who is do something about this?

(This is with `gnus-single-article-buffer' set to nil.)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

end of thread, other threads:[~2001-12-29 21:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-29 19:05 picons Henrik Enberg
2001-12-29 20:44 ` picons ShengHuo ZHU
2001-12-29 21:13   ` picons Lars Magne Ingebrigtsen
  -- strict thread matches above, loose matches on Subject: below --
1999-04-20 10:00 picons David Hedbor
1999-06-12  2:17 ` picons Lars Magne Ingebrigtsen
1998-02-13 16:50 Picons Lars Magne Ingebrigtsen
1998-02-13 19:23 ` Picons Wes Hardaker
1998-02-14 15:53   ` Picons Lars Magne Ingebrigtsen
1998-02-26  0:30   ` Picons Kim-Minh Kaplan
1998-02-26  0:57     ` Picons Wes Hardaker
1998-02-28 18:09       ` Picons Hans de Graaff
1998-03-02 16:43         ` Picons Wes Hardaker
1998-03-01 15:05 ` Picons Kim-Minh Kaplan

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 NNTP newsgroup(s).