Skip to content

?> as a valid help request

13 messages · Timothy Bates, Marc Schwartz, Berend Hasselman +3 more

#
Hi all,
I wonder if there could be a way to allow querys like the following to succeed by changes to the gui command line?

?>
?%*%
Error: unexpected SPECIAL in "?%*%"

cheers,
tim
#
On May 25, 2011, at 11:14 AM, Timothy Bates wrote:

            
Just surround the topic with quotes:

?">"

and 

?"%in%"


This is covered in ?help:

"Some topics need to be quoted (by backticks) or given as a character string. There include those which cannot syntactically appear on their own such as unary and binary operators, function and control-flow reserved words (including if, elsefor, in, repeat, while, break and next. The other reserved words can be used as if they were names, for example TRUE, NA and Inf."

HTH.

Marc Schwartz
#
On 25 May 2011, at 5:20 PM, Marc Schwartz wrote:
Thanks Mark and Ian,
Glad it?s a straightforward and memorable workaround. And this is easy in the new GUI (which adds quotes around a selection. Still wish that the error told me that was a likely cause: I just assumed it was impossible to search on.

Followup GUI query: Is there a was to go to the beginning of the command line directly? My method is to cmd-right select the line, then use right arrow to fall off the end of the selection leaving the cursor at the start (ready to type a ?)

This fails: The right arrow just does nothing?

As cmd-shift-? opens help, a lovely enhancement would be for cmd-cntrl-? to execute ?rGUISelection

Then help would be just a matter of select and keystroke, with no need to delete the? or pollute the history.

EnjoyR,
tim
#
On May 25, 2011, at 12:32 PM, Timothy Bates wrote:

            
cntrl-a works for me on the GUI and I suspect on a terminal console  
session as well, since I have been told that it is a UNIX convention.
#
On 25-05-2011, at 18:32, Timothy Bates wrote:

            
Command-left arrow
Ctrl-A

And you can create a DefaultKeyBinding.dict in the directory ~/Library/Keybindings with  a mapping of the Home to the Cocoa cursor command "moveToBeginningOfLine:".
See http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html

For example, if you have a DefaultKeyBinding.dict file containing

{
    /* home  Shift+home*/
    "\UF729"  = "moveToBeginningOfLine:";
    "$\UF729" = "moveToBeginningOfLineAndModifySelection:";

    /* end  Shift+end*/
    "\UF72B"  = "moveToEndOfLine:";
    "$\UF72B" = "moveToEndOfLineAndModifySelection:";
}

Home will move the cursor to the start of a line
End  will move the cursor to the end of a line

Combined with a  shift key, these will select from the current cursor position to the start/end of line.


Berend
#
On 25 May 2011, at 5:50 PM, Berend Hasselman wrote:
Again, thanks for the help: I think it is a bug that left-arrow does not deselect the selection and leave the cursor immediately to the left of the old selection. having hte left-arrow move left is completely standard on mac applications., where as control-A is Unix only.

thanks again for the replies,
t
PS: not keys I have unfortunately :-(
#
On 25-05-2011, at 19:03, Timothy Bates wrote:

            
If this is because you have an Apple laptop,  Fn left-arrow and Fn right-arrow are Home and End respectively.

Berend
#
On May 25, 2011, at 12:50 PM, Berend Hasselman wrote:

            
Not on my machine in the GUI. Goes to top or bottom of the console  
window.
#
On 25-05-2011, at 19:10, David Winsemius wrote:

            
To get the behaviour I described you have to have a DefaultKeyBinding.dict with the appropriate key definitions.
Otherwise indeed Home/End go to top/end of text/window.

Berend
#
On 25 May 2011, at 18:14, Timothy Bates wrote:

            
Hi Tim,

did you try to simply select the pattern (here > ) and press CTRL+H or right-click for content menu and select "Show Help for current Function"?

Cheers,
--Hans
#
On May 25, 2011, at 1:10 PM, David Winsemius wrote:

            
What Berend meant is that if you want to re-define the behavior to be non-standard with the modifications he listed (which you cut out), you can have it behave that way. It is not the default or intended behavior, though. (Windows users may be more used to it which is presumably why he mentioned it).

Just to re-iterate, the standard Mac way to go to the beginning of the line is <Cmd><Left>. The standard Mac way to move up a paragraph is <Alt><Up> (which is equivalent to going to the beginning of a paragraph except when you are already there). There is an emacs equivalent <Ctrl><A> which goes to the beginning of the paragraph.

Now, in fact he GUI behaves slightly differently, but no one noticed ;). Due to the special treatment of the prompt, the commands concerning the beginnings of things have special work-arounds, so for example beginning of the line equals beginning of the paragraph in the GUI. However, this is what people most commonly want, so I'm not sure it's abad thing. I'll see if I can make the behavior consistent, though.

Cheers,
Simon
#
Hans said:
fantastic Hans!
PS: I looked in the help menu and saw nothing like ?help on selection cntrl-H? ?. that would help with newbie discovery (like me :-) )

Simon said:
Would be great: it is unusual not to be able to left-arrow out of a selection. Maybe I can get used to Cmd?left-arrow to go to beginning of line: I think I use the shift key to highlight so I can attend the new location of the cursor more easily.

t
#
On May 25, 2011, at 1:41 PM, Timothy Bates wrote:

            
Now fixed.

Cheers,
Simon