r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[RAMBO] The REBOL bug and enhancement database

Anton
31-May-2007
[3036]
If it's Windows, then I expect internally rebol just does this:
>> to-local-file %user.r/
== "user.r"

stripping the final slash before accessing the file-system.
btiffin
31-May-2007
[3037x2]
I get the DocKimbel behaviour with 2.7.5.4.2 Linux.  But I see the 
point.  Something

weird in query...or make port!  on files disguised as dir specs...
Well I don't think it's weird anymore.   make port! on %file/  uses 
scheme: 'directory
make port! on %file  uses scheme: 'file
Dockimbel
4-Jun-2007
[3039x4]
The issue I wanted to point out is just that if it's an existing 
file!, I should be able to read it ! So instead of letting the user 
wrongly think that's a file, and let 'read pop an error (which sounds 
illogical to me), I'm proposition to signal in 'info? that something 
is wrong with that file! value.
In my example above, the file! value is explicit, but in cases where 
it's not, it  produces an odd and illogical bug, IMHO. See this other 
example :
specs: info? a-file
if specs/type = 'file [
	probe read a-file
]

** Access Error: Cannot open /C/Dev/REBOL/script.r/
** Near: read a-file
Anton: yes, Windows
Anton
6-Jun-2007
[3043x3]
Doc, ah yes, I think I agree because I seem to remember doing the 
above sequence myself at some time.
It is with pleasure that I can announce that there is a workaround 
to the center / right aligned text highlighting issue. I have a working 
prototype. You can change the horizontal alignment of the face on 
the fly. Give me a day or two to clean it up and make a nice demo.
(and vertical alignment too !)
Ashley
6-Jun-2007
[3046]
Good news, does it involve patching caret-to-offset and/or offset-to-caret 
(via mezz wrappers)?
Oldes
10-Jun-2007
[3047x4]
There is a bug in decode-url:
>> probe decode-url http://test/path/target?text/something
make object! [
    user: none
    pass: none
    host: "test"
    port-id: none
    path: "path/target?text/"
    target: "something"
]

the target should be: target?text/something
the bug is in the URL-parser of course... there should not be ? char 
in path-chars
Is it so difficult to remove a char from charset or I forgot something?
why this is not working?

>> remove charset "abc" "a"
** Script Error: Invalid argument: none
** Near: remove charset "abc" "a"

when in doc is:

Character sets can also be modified with the insert and remove functions, 
or combinations of sets can be created with the union and intersect 
functions.
Sunanda
10-Jun-2007
[3051]
Charsets don't always respond the way you'd expect -- or support 
all the operators they could.
One way to remove a char: use difference:
    >> (charset "ac") = (difference charset "abc" charset "b")
    == true
Oldes
10-Jun-2007
[3052]
yes.. that's what I forgot... but anyway... removing ? char is not 
enough:(
BrianH
11-Jun-2007
[3053x3]
Try this:
remove/part charset "abc" "a"
The /part is necessary when removing from a bitset,
The "Invalid argument: none" is just the default value of the second 
parameter that never gets used if you don't specify /part.
Anton
12-Jun-2007
[3056x2]
Ashley, the patching is quite heavy;

- caret-to-offset  and  offset-to-caret  replaced by mezzanines (mainly 
dependent on the TEXTINFO native)

- in ctx-text, patched 10 functions and 2 feel objects (should be 
backwards compatible)

- replaced the View rendering of the highlight and caret using several 
intermediate images (which will be slow for large faces)
I was disappointed to find that merely patching caret-to-offset and 
offset-to-caret was not enough to fix the highlight and caret rendering. 
The View system does not appear to use them. (Maybe the View system 
keeps direct references to the native functions and does not refer 
to these global words to get to the native functions ?)

This means that ctx-text and focus/unfocus have to be patched to 
prevent system/view/caret and highlight-start/end being set and thus 
rendering the highlight and caret.
Ashley
12-Jun-2007
[3058]
Could you post/email me just the caret-to-offset and offset-to-caret 
patches? That should be enough for me to get RebGUI working. Thanks.
Anton
12-Jun-2007
[3059x2]
Here's what I have so far. (Note, this code may end up in another 
file.)
http://anton.wildit.net.au/rebol/patch/caret-to-offset-patch.r
Also note, to get the caret and highlight handling / rendering working 
properly will require you to do in Rebgui the equivalent of the above 
ctx-text patching etc. That's quite a bit of work.
Gabriele
13-Jun-2007
[3061x4]
Oldes, regarding your multiple slashes ticket...
notice this behavior:
>> what-dir
== %/home/giesse/
>> read %/

== [%proc/ %initrd/ %sys/ %bin/ %initrd.img %media/ %Recycled/ %srv/ 
%usr/ %etc/ %boot/ %vmlinuz %lib/ %mnt/ %tmp/ %sbin/ %cdrom/ %...
>> read %//
== [%.directory %giesse/]
>> read %///

== [%Detective/ %.hplip.conf %.teamspeak2/ %.mythtv/ %.qt/ %.fontconfig/ 
%.clay/ %.Skype/ %.recently-used %.face.icon %.DCOPserver_...
REBOL does not ignore multiple slashes. However, this is not documented 
anywhere, so I'm not sure what the rules should be.
Oldes
13-Jun-2007
[3065x2]
so it's bug here:
>> make-dir/deep %aaa//bb/
** Access Error: Cannot open aaa//
** Near: make-dir/deep %aaa//bb/
never mind, you can delete it, I already have a solution... anyway... 
it would be nice to replace the clean-path function with the Anton's 
simple-clean-path
Chris
16-Jun-2007
[3067]
any [get/any 'no-word "Alt"]
; should this return "Alt" ?
btiffin
17-Jun-2007
[3068]
Chris;  Umm, not according to help any. It returns the first value 
that is not false or none. So I guess unset! counts.  :)  But you're 
right.  unset! should be more false than true.
Anton
19-Jun-2007
[3069x5]
I've finally done it. Here is an AREA/FIELD style which handles and 
renders the caret much better with center and right-aligned text:
First run View 2.7.5.3.1 and do this:


 site: select load-thru http://www.rebol.net/reb/index.r[folder "Anton"]
	clear find site %index.r
	load-thru/update site/patch/caret-to-offset-patch.r

Do the main demo, showing patched AREA:

	do-thru site/patch/demo-caret-to-offset-patch.r

Three patched styles; AREA, FIELD, INFO:
	
	do-thru site/gui/demo-area.r
	do-thru site/gui/demo-field.r
	do-thru site/gui/demo-info.r

The initial experimental testing script:

	do-thru site/patch/test-caret-to-offset-patch.r
Advantages:

- middle and right aligned text is now usable and works as one would 
expect, with the caret appearing in the correct position.
- you can render the caret how you like
- you can render the highlighting how you like

  (I didn't show the above options clearly in the demos yet, you must 
  still get your programming fingers dirty)
Disadvantages:
- lots of code to achieve the above

- probably slow performance with large areas, because images are 
being created on every redraw
I should have announced that in the View group, sorry.
(oh well, I guess it's one big bug workaround)
PeterD
20-Jun-2007
[3074]
Thanks Anton
Anton
20-Jun-2007
[3075x2]
Cool, let me know any problems.
To maybe fit in better with other styles, the caret colour can be 
changed. eg:

 area with [append init [named-colours: make named-colours [caret: 
 black]]]
Graham
28-Jun-2007
[3077]
rambo'd https posting bug.
btiffin
29-Jun-2007
[3078]
Can I get someone to try this before I report it.

foreach [e s] to block! {thing 'word} [compose [e (get s)]]

segfaults 1.3.2.4.2 and 2.7.5.4.2
Graham
29-Jun-2007
[3079]
linux version
btiffin
29-Jun-2007
[3080]
yep
Graham
29-Jun-2007
[3081]
crashes windows as well
Frank
29-Jun-2007
[3082]
+1  
1.3.2.4.2 and 2.7.5.4.2
Linux
Graham
29-Jun-2007
[3083]
is it recursive?
btiffin
29-Jun-2007
[3084x2]
I'll check RAMBO add if not in there then...thanks Graham...I just 
reduced it to this so far...more experimenting to come.
How about this on your end...just trying to reduce the code for the 
RAMBO report.


foreach a to block! {'word} [print get a]  - this segfaults on Linux. 
too.