On Sat, Feb 6, 2010 at 8:48 AM, Eric Martz <[email protected]> wrote:
> --- On Sat, 2/6/10, Robert Hanson <[email protected]> wrote:
>
>
> The user-configurable command alias feature was one of my favorite features
> in Protein Explorer. It was a huge time and finger saver. Not only saving
> typing, but saving you from typos like "seelct protien". I'd like to
> re-raise the idea of having such a feature in Jmol.
>
>
Eric, you're touching a sore spot with me. After years of having to learn
two-letter NMR acronym commands like em ft pk it really drives me nuts to
have any sort of shortcuts like this. Yes, I understand, if you are an
expert, then designing your own macros and shortcuts can be useful, but in
the long run it's pretty bad design. It effectively makes your code totally
unreadable to anyone else. I would say it's somewhat counter to the
open-source mentality that we have a community of users who can follow what
others are doing.
The real danger is this: You have no guarantee that someone will not create
an intrinsic Jmol "sff" command later that will break your special language.
By creating your own language you run the danger of not being able to
upgrade.
But, if you have to, just use functions:
function sp() {select protein}
function rnw() {restrict not water}
function sf() { spacefill}
function sff() {spacefill false}
function bs() {wireframe 0.14;spacefill 0.45}
Then:
sp
rnw
sf
sff
bs
all work as desired. Safer would be starting those with ~ or _.
Bob
> In Protein Explorer, you can type shortened versions of commands such as:
>
> s p # select protein
> r n w # restrict not water
> sf # spacefill
> sff # spacefill false
> bs # "ball and stick" e.g. wireframe 0.14;spacefill 0.45
> bsf # "ball and stick false" e.g. wireframe false; spacefill false;
> s an 4403 # select atomno=4403
> coh 223344 # "color hex": color [x223344]
> coe # "color by element": color cpk
> cot # color temperature
> ss # ssbonds 0.3;color ssbonds [xFFC832];set ssbonds sidechain;
> ssf # ssbonds false
> s m # "select metal": select (cadmium,calcium,copper,iron,
> magnesium,manganese,zinc)
>
> and yes, Bob,
>
> sc 1 # script 1.spt
>
> The complete list, and some details about use, are at
> http://tinyurl/pe-aliases
>
> In Protein Explorer, there is a file alias.js -- you simply edit it with a
> text editor to remove, add, or change aliases.
>
> The code is relatively simple, basically a simple expansion filter between
> command entry and command execution.
>
> -Eric
>
>
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the
> business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users