9front - general discussion about 9front
 help / color / mirror / Atom feed
* Re: [9front] plumb rules for page
@ 2018-01-19 17:14 mycroftiv
  2018-01-20 21:59 ` hiro
  0 siblings, 1 reply; 6+ messages in thread
From: mycroftiv @ 2018-01-19 17:14 UTC (permalink / raw)
  To: 9front

I'm convinced by sl's reasoning, consider the previous suggestion withdrawn. That raises the inverse issue - should we change the rule for images to also always open a new page, and not 'take over' an existing instace? As it is, plumbing an image file will 'take over' a running page showing a /sys/doc (or whatever) ps/pdf file. Perhaps that should be changed to match the ps/pdf behavior, rather than the initial change I suggested?

The use case I have for the 'take over' behavior is sharing a single plumber between multiple systems, where only the message-passing function of plumber works, not launching new applications. This is not the common way plumber is used, so I don't think the defaults should be adjusted to favor it, I can always customize my own plumb rules for my own purposes.

-mycroftiv


^ permalink raw reply	[flat|nested] 6+ messages in thread
* plumb rules for page
@ 2018-01-19  4:50 mycroftiv
  2018-01-19 15:53 ` [9front] " Steve Simon
  0 siblings, 1 reply; 6+ messages in thread
From: mycroftiv @ 2018-01-19  4:50 UTC (permalink / raw)
  To: 9front

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 1673 bytes --]

I was playing around with sharing plumber between different machines
and found something I don't understand in the default 'basic' plumber
ruleset as it relates to 'page'.  Relevant excerpt from
/sys/lib/plumb/basic follows:

# image files go to page
type is text
data matches '[a-zA-Z¡-￿0-9_\-.,/]+'
data matches '([a-zA-Z¡-￿0-9_\-.,/]+)\.(jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|PPM|bit|BIT|png|PNG|pgm|PGM|bmp|BMP|yuv|YUV)'
arg isfile	$0
plumb to image
plumb client page -wi

# page bookmarks
type is text
data matches '(([a-zA-Z¡-￿0-9_\-.,/]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI|doc|DOC|epub|EPUB|cb[tz]|CB[TZ]))!(.+)'
arg isfile	$1
data set	$file
attr add	addr=$4
plumb to image
plumb start page -wij $0 $file

# postscript/pdf/dvi/doc go to page but not over the a plumb port
# the port is here for reference but is unused
type is text
data matches '[a-zA-Z¡-￿0-9_\-.,/]+'
data matches '([a-zA-Z¡-￿0-9_\-.,/]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI|doc|DOC|epub|EPUB|cb[tz]|CB[TZ])'
arg isfile	$0
plumb to postscript
plumb start page -w $file

My question is, why do we send image files to a running page over the
plumb port, but not ps/pdf type files?  We send page bookmarks to
running page via the plumb port, but not standard files.  It is clear
from the comments that this is a delibrate decision, is there a good
reason for it?  From my perspective, the "plumb to postscript" in the
final ruleset shown here should be "plumb to image" to make all the
behavior consistent.

It's obviously a trivial point and easy to change if you want to, but
if there isn't a justification for this divergence in behavior,
perhaps we should just standardize it?

-mycroftiv


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

end of thread, other threads:[~2018-01-21 16:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19 17:14 [9front] plumb rules for page mycroftiv
2018-01-20 21:59 ` hiro
  -- strict thread matches above, loose matches on Subject: below --
2018-01-19  4:50 mycroftiv
2018-01-19 15:53 ` [9front] " Steve Simon
2018-01-19 16:39   ` Stanley Lieber
2018-01-21 14:36   ` Ethan Grammatikidis
2018-01-21 16:28     ` Ethan Grammatikidis

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).