Hi,
following up on the discussion about the strike-out vs.
change-font-size shortcuts:
I do use the strike out shortcut frequently to finish lines in my ToDo
workspace. I would be fine with the font size shortcuts, though, if
there were another easy way to apply the strike out emphasis.
We have a perceived dozen of ways that allow you to change something
about the look of text, accessible via different kinds of interactions
with the world:
- menu item "set font" in tools (allows to change font family and
size), has cmd-k as a shortcut
- menu item "set style" in tools (provides a choice of a subset of
families plus some generic styles like DefaultTextStyle, but I do not
really know how it works), cmd-K
- menu item "set alignment" in tools (choice between leftFlush,
centered, justified, rightFlush, which reads rather technical in the
camel case, doesn't it?), cmd-u
- Morph menu item "text properties..." currently signals a
MessageNotUnderstood: UndefinedObject>>bounds in Morph>>openNear:in:
(world is nil)
- a halo icon indicating "font size" that opens the "set font" dialog from above
- a halo icon indicating "font family" that opens the "set style"
dialog from above
- a halo icon indicating "text style/emphasis" that opens a textual
choice of text styles, including struckOut, and text justification
again (also again in technically looking camel case), have not found a
menu command for this.
- cmd-6 allows you to change the color, add Do Its and links in the
text. Have not found a way to do that from a menu.
- cmd-9 adjusts the kerning (makes the text narrower) and I can not
find the shortcut to make it wider. No menu that I know of does this.
- cmd-0 removes some kinds of text attributes. No menu item.
The third mentioned halo icon works for me to strike out text, but I
have to get the halo of the text morph inside the workspace. And first
I had to find out that the halo icon exists at all because it does not
appear for all kinds of morphs (which is reasonable). I would rather
like to access that from the context menu (or via a shortcut...).
Do we really need a set of different dialogs for all of this? Wouldn't
it be nicer to merge these into one dialog and make the choices read
less technical? Shouldn't all options be accessible in a consistent
way instead of some via menus, some via the halo, some only via the
keyboard?
Is this something we should rather improve instead of disagreeing
about the keyboard shortcuts? Maybe not in 5.2, but later...
I do not see a problem of rededicating shortcut keys per se. If there
is no agreement on whether this is a regression or progress, there is
still the more complex option of making the global shortcuts
configurable or introducing all kinds of preferences for deviations
from the traditional behavior, and adding built-in preference sets
that make your Squeak behave like a legacy version ("Squeak 3.2
compatibility mode"). I would not be a fan of this, though.
Best regards
Jakob
Am 02.07.2018 09:14 schrieb "Tobias Pape" <Das.Linux(a)gmx.de>:
>> On 02.07.2018, at 01:54, Chris Muller <asqueaker(a)gmail.com> wrote:
>>
>> Hi Tobias,
>>
>> All I did was restore the original shortcut keys that had been in
>> Squeak since its earliest days. I suppose I'm curious why you didn't
>> pose this question to the one who killed underline and strikeout
>> formatting but, for whatever reason, you seem to only "object" to MY
>> improvements. But whatever, instead of questioning my friendliness,
>> how about talking about what's good for Squeak and the IDE?
>>
>> Hot keys are for functions that are used *frequently*. In a web
>> browser, zoom-in and out makes sense when every web page uses
>> different font sizes. That's not the case for Squeak. Setting
>> themes, colors, preferences and fonts is all part of initial
>> _configuration_, something typically done only once in the lifespan of
>> an image. Most wares mature enough to worry about font sizes have
>> since developed their own configuration script which sets everything.
>> Nevertheless, it's now on the World menu, which can be activated by
>> mouse OR keyboard.
>>
>> This provides desktop keys for the font size but do you really think
>> this is useful? I can't think of any case where I'd want to be
>> frequently flipping back and forth between global font sizes once
>> they're set up. We should spare hot keys for future USEFUL things, so
>> I vote we do NOT move it to trunk.
>
> Well I frequently change between laptop screen, 24" monitor and projectors of > different resolutions.
> Changing font sizes is much more frequent for me than that text change. I see how that can be useful sometimes but I so not see how this is so universally useful. IMHO, something like Emacs M-x in the vein of "apply this string method to the selection" would be more versatile and at the same time cater for thing that are useful but relatively infrequent.
>
> Best regards
>
> -Tobias
>
>
>>
>> Best,
>> Chris
>>
>>
>> On Sun, Jul 1, 2018 at 6:21 PM, Tobias Pape <Das.Linux(a)gmx.de> wrote:
>>> Do I parse that correctly that you just killed font size handling via shortcuts and introduced a new one?
>>>
>>> While this could all be justified, wouldn't it be friendlier to first talk about that?
>>> Eg, via inbox or so?
>>>
>>> Best regards
>>> -Tobias
>>>
>>> On Sun, Jul 1, 2018 at 6:35 PM, <commits(a)source.squeak.org> wrote:
>>>> Chris Muller uploaded a new version of Tools to project The Inbox:
>>>> http://source.squeak.org/inbox/Tools-cmm.826.mcz
>>>>
>>>> ==================== Summary ====================
>>>>
>>>> Name: Tools-cmm.826
>>>> Author: cmm
>>>> Time: 1 July 2018, 6:35:14.376257 pm
>>>> UUID: e7b1e100-7da9-48e8-b544-7a5035c0693e
>>>> Ancestors: Tools-cmm.825
>>>>
>>>> Command++ and Command+- hot keys for increasing/decreasing the sizes of all fonts.
>>>> [...]
Hi,
I was messing around with SmallDictionary when I suddenly realised that
I can't find a single reason to use it over a normal Dictionary. While
its name and class comment imply that it is somehow an optimised
Dictionary, I don't see any measurement where that actually holds up.
The following was run in a Pharo 7 image on a recent VM (see below):
| d |
d := SmallDictionary new.
d sizeInMemory. "24"
[100000 timesRepeat: [
1 to: 100 do: [ :i | d at:i put: i] ] ] timeToRun. "0:00:00:05.226"
[100000 timesRepeat: [
d at: 48 ifAbsent: [] ] ] timeToRun. "0:00:00:00.041"
| d |
d := Dictionary new.
d sizeInMemory. "16"
[100000 timesRepeat: [
1 to: 100 do: [ :i | d at:i put: i] ] ] timeToRun. "0:00:00:00.385"
[100000 timesRepeat: [
d at: 48 ifAbsent: [] ] ] timeToRun. "0:00:00:00.006"
As you can see, SmallDictionary is 8 bytes larger per instance and
significantly faster while reading and writing (I know that this isn't a
good benchmark but it suffices to make my point).
Is anyone aware of a reason for hanging on to SmallDictionary? I'm also
curious to know how SmallDictionary came to be. There must have been
some advantage over Dictionary at some point in the past.
Cheers,
Max
Image version: Pharo 7.0
Build information:
Pharo-7.0+alpha.build.961.sha.a69e72a97136bc3f93831584b6efa2b1703deb84
(32 Bit)
VM version: CoInterpreter VMMaker.oscog- nice.2281 uuid:
4beeaee7-567e-1a4b-b0fb-bd95ce302516 Nov 27 2017
StackToRegisterMappingCogit VMMaker.oscog-nice.2283 uuid:
2d20324d-a2ab-48d6-b0f6-9fc3d66899da Nov 27 2017
VM: 201711262336 https://github.com/OpenSmalltalk/opensmalltalk-vm.git $
Date: Mon Nov 27 00:36:29 2017 +0100 $ Plugins: 201711262336
https://github.com/OpenSmalltalk/opensmalltalk-vm.git $
OS: macOS 10.13.5
Machine: MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.1458.mcz
==================== Summary ====================
Name: Morphic-cmm.1458
Author: cmm
Time: 1 July 2018, 7:08:29.055704 pm
UUID: 4c35981c-7629-4346-973b-408ca3f2e045
Ancestors: Morphic-cmm.1457
Recover Levente's change to use #sort: instead of asSortedCollection:, which had been done prior to my change to #findWindow:. Sorry Levente!
=============== Diff against Morphic-cmm.1457 ===============
Item was changed:
----- Method: PasteUpMorph>>findWindow: (in category 'world menu') -----
findWindow: evt
"Present a menu names of windows and naked morphs, and activate the one that gets chosen. Collapsed windows appear below line, expand if chosen; naked morphs appear below second line; if any of them has been given an explicit name, that is what's shown, else the class-name of the morph shows; if a naked morph is chosen, bring it to front and have it don a halo."
| menu expanded collapsed nakedMorphs |
menu := MenuMorph new.
expanded := SystemWindow windowsIn: self satisfying: [:w | w isCollapsed not].
collapsed := SystemWindow windowsIn: self satisfying: [:w | w isCollapsed].
nakedMorphs := self submorphsSatisfying:
[:m | (m isSystemWindow not and: [(m isStickySketchMorph) not]) and:
[(m isFlapTab) not]].
(expanded isEmpty & (collapsed isEmpty & nakedMorphs isEmpty)) ifTrue: [^ Beeper beep].
+ (expanded sort: [:w1 :w2 | w1 label caseInsensitiveLessOrEqual: w2 label]) do:
- (expanded asSortedCollection: [:w1 :w2 | w1 label caseInsensitiveLessOrEqual: w2 label]) do:
[:w | menu add: (w label contractTo: 80) target: w action: #beKeyWindow.
w model canDiscardEdits ifFalse: [menu lastItem color: Color red]].
(expanded isEmpty | (collapsed isEmpty & nakedMorphs isEmpty)) ifFalse: [menu addLine].
+ (collapsed sort: [:w1 :w2 | w1 label caseInsensitiveLessOrEqual: w2 label]) do:
- (collapsed asSortedCollection: [:w1 :w2 | w1 label caseInsensitiveLessOrEqual: w2 label]) do:
[:w | menu add: (w label contractTo: 80) target: w action: #collapseOrExpand.
w model canDiscardEdits ifFalse: [menu lastItem color: Color red]].
nakedMorphs isEmpty ifFalse: [menu addLine].
+ (nakedMorphs sort: [:w1 :w2 | w1 nameForFindWindowFeature caseInsensitiveLessOrEqual: w2 nameForFindWindowFeature]) do:
- (nakedMorphs asSortedCollection: [:w1 :w2 | w1 nameForFindWindowFeature caseInsensitiveLessOrEqual: w2 nameForFindWindowFeature]) do:
[:w | menu add: (w nameForFindWindowFeature contractTo: 80) target: w action: #comeToFrontAndAddHalo].
menu addTitle: 'find window' translated.
menu popUpEvent: evt in: self.!
Chris Muller uploaded a new version of Help-Squeak-Project to project The Trunk:
http://source.squeak.org/trunk/Help-Squeak-Project-cmm.58.mcz
==================== Summary ====================
Name: Help-Squeak-Project-cmm.58
Author: cmm
Time: 1 July 2018, 6:26:15.595718 pm
UUID: c228822e-add8-4297-a6aa-2ebc50fd177d
Ancestors: Help-Squeak-Project-tpr.57
Command-key help page updates.
=============== Diff against Help-Squeak-Project-tpr.57 ===============
Item was changed:
----- Method: SqueakTutorialsCommandKey class>>commandKeyMappings (in category 'as yet unclassified') -----
commandKeyMappings
"This method was automatically generated. Edit it using:"
"SqueakTutorialsCommandKey edit: #commandKeyMappings"
+ ^(HelpTopic
- ^HelpTopic
title: 'Command Key Mappings'
contents:
'Lower-case command keys
(use with Cmd key on Mac and Alt key on other platforms)
a Select all
b Browse it (selection is a class name or cursor is over a class-list or message-list)
c Copy selection
d Do it (selection is a valid expression)
e Exchange selection with prior selection
f Find text with a dialog
g Find the current selection again
j Repeat the last selection replacement
i Inspect it
k Set font
l Cancel text edit
m Implementors of it
n Senders of it
o Spawn current method
p Print it (selection is a valid expression)
q Query symbol (toggle all possible completion for a given prefix)
s Save (i.e. accept)
t Finds a Transcript (when cursor is over the desktop)
u Toggle alignment
v Paste
w Select/Delete preceding word (over text); Close-window (over morphic desktop)
x Cut selection
y Swap characters
z Undo
Note: for Do it, Senders of it, etc., a null selection will be expanded to a word or to the current line in an attempt to do what you want. Also note that Senders/Implementors of it will find the outermost keyword selector in a large selection, as when you have selected a bracketed expression or an entire line. Finally note that the same cmd-m and cmd-n (and cmd-v for versions) work in the message pane of most browsers.
Upper-case command keys
(use with Shift-Cmd, or Ctrl on Mac
or Shift-Alt on other platforms; sometimes Ctrl works too)
A Advance argument
B Browse it in this same browser (in System browsers only)
C Compare the selected text to the clipboard contents
D Debug-It
E Method strings containing it
F Insert ''ifFalse:''
G fileIn from it (a file name)
H Move cursor to top/home of text
I Inspect via Object Explorer
J Again many (apply the previous text command repeatedly until the end of the text)
K Set style
L Opens a FileList, bringing forward on that already exists if appropriate
M Select current type-in
N References to it (selection is a class name, or cursor is over a class-list or message-list)
O Open single-message browser (in message lists)
P Make project link
R opens a Recent Submissions browser
S Pretty-print a method in the current browser
T Insert ''ifTrue:''
U Convert linefeeds to carriage returns in selection
V Paste author''s initials
W Selectors containing it (in text); show-world-menu (when issued with cursor over desktop)
X Force selection to lowercase
Y Force selection to uppercase
Z Redo
Other special keys
Backspace Backward delete character
Shift-Bksp Backward select or delete word
Del Forward delete character
Shift-Del Forward delete word
Esc Pop up the context menu
Shift+Esc Pop up the World Menu
Cmd+Esc Close the active window
Ctrl+Esc Present a list of open windows
Cmd+\ Send the active window to the back
Tab Insert a tab char in a single-line selection or insert a tab at the beginning of each line in a multi-line selection
Shift-Tab Remove a tab from the beginning of each line in the selection
+ Shift-Cmd-_ (underscore) condense selection into one line
Cursor keys
left, right,
up, down Move cursor left, right, up or down
Ctrl-left Move cursor left one word
Ctrl-right Move cursor right one word
Home Move cursor to begin of line or begin of text
End Move cursor to end of line or end of text
PgUp, Ctrl-up Move cursor up one page
PgDown, Ctrl-Dn Move cursor down one page
Note all these keys can be used together with Shift to define or enlarge the selection. You cannot however shrink that selection again, as in some other systems.
Other Cmd-key combinations (not available on all platforms)
Return Insert return followed by as many tabs as the previous line
(with a further adjustment for additional brackets in that line)
Space Select the current word as with double clicking
Enclose the selection in a kind of bracket. Each is a toggle.
(not available on all platforms)
Ctrl-( Toggle enclosure within parentheses
Cmd-[ Toggle enclosure within brackets
Crtl-{ Toggle enclosure within curly braces
Ctrl-'' Toggle enclosure within double-quotes
Cmd-'' Toggle enclosure within single-quotes
Note also that you can double-click just inside any of the above delimiters, or at the beginning or end of a line, to select the text enclosed.
Text Emphasis
(not available on all platforms)
Cmd-1 type the first method argument
Cmd-2 type the second method argument
Cmd-3 type the third method argument
Cmd-4 type the fourth method argument
Cmd-5 for future use
Cmd-6 color, action-on-click, link to class comment, link to method, url
Brings up a menu. To remove these properties, select
more than the active part and then use command-0.
Cmd-7 bold
Cmd-8 italic
+ Cmd-9 negative kern (letters 1 pixel closer)
+ Cmd-0 make plain (removes all emphasis and kerning)
+ Cmd-- underlined
+ Cmd-= struck out
- Cmd-9 narrow (same as negative kern)
- Cmd-0 plain text (resets all emphasis)
- Cmd-- underlined (toggles it)
- Cmd-= struck out (toggles it)
- Shift-Cmd-- (aka :=) negative kern (letters 1 pixel closer)
- Shift-Cmd-+ positive kern (letters 1 pixel larger spread)
-
Docking Bar
Ctrl-<n> opens the n-th (where n is between 0 and 7) menu if such exists, otherwise it moves the keyboard focus to the Search Bar. Currently this means:
Ctrl-0 Activates Search Bar or Scratch Pad
Ctrl-1 Squeak menu
Ctrl-2 Projects menu
Ctrl-3 Tools menu
Ctrl-4 Apps menu
Ctrl-5 Extras menu
Ctrl-6 Windows menu
Ctrl-7 Help menu
+ !!' readStream nextChunkText)
+ key: #commandKeyMappings!
- !!' readStream nextChunkText!
Chris Muller uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cmm.797.mcz
==================== Summary ====================
Name: Collections-cmm.797
Author: cmm
Time: 1 July 2018, 6:04:20.270181 pm
UUID: 00fa2143-c85b-4a5c-9615-2c45ae597af6
Ancestors: Collections-ul.796
Added String>>#condensedIntoOneLine to support new editing hot key.
=============== Diff against Collections-ul.796 ===============
Item was added:
+ ----- Method: String>>condensedIntoOneLine (in category 'converting') -----
+ condensedIntoOneLine
+ "Return a copy of the receiver with all separators converted to spaces, and with no consecutive spaces. A formatting tool."
+ ^ String streamContents:
+ [ : stream | | prior |
+ prior := $X. "any non-blank"
+ self withBlanksTrimmed do:
+ [ : char | char isSeparator ifTrue: [ prior isSeparator ifFalse: [stream space]] ifFalse: [ stream nextPut: char ].
+ prior := char ] ]!
One imagines there has been bloodshed in standards meetings over things like this.
For example, IEEE 754 has both positive and negative zeros.
For those of you who don't feel that life is pedantic enough there are many fascinating articles. You can start with:
[https://hackernoon.com/negative-zero-bbd5fd790af3](https://hackernoon.com/n…
and if you have way way too much time on your hands on a Sunday a C++ wg21 proposal edit from Apple. Probably from someone who thought "Life is not complex enough, I'll volunteer for the CLANG team. Oh, and then I'll join the standards committee as well."
[http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0907r0.html](http:…
cheers
bruce
> I was just found a bug in my code because I had written it assuming
> that the number 0 (zero) is neither positive nor negative. It failed
> because:
>
> 0 positive "true"
>
> Really?
>
> Ah, okay, there's #strictlyPositive, I'll use that.
>
> But it seems like #nonNegative might be a better name then!