Changeset f1e629d for variable.c


Ignore:
Timestamp:
Jul 6, 2003, 6:42:06 PM (17 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
5d9c664
Parents:
675ce49
Message:
	New API for perl message formatting functions.
	        Legacy variables are still supported for owl::format_msg
		and owl::receive_msg, but these functions are now also
		passed an owl::Message object which contains methods
		for accessing the contents of the message.  See perlwrap.pm
		(and docs TBD) for the available methods.
		*** WARNING:  The exact API for owl::Message has
		*** not yet stabilized.
	Added "style" command for creating new styles.
	        Usage:  style <name> perl <function_name>
	Added support for "show styles".  Changed global style table
	        from list to dictionary.
	Changed AIM password prompt from "Password:" to "AIM Password:".
	Messages are reformatted after a window resize to allow styles
	        to take into account the width of the window.
	When perl throws an error, the message is put in the msgwin
	        if possible.
	Added perl functions for:
	        owl::getcurmsg() -- returns an owl::Message object for
		                    the active message
		                    in the current view.
	        owl::getnumcols() -- returns the column width of the window
		owl::zephyr_getrealm() -- returns the zephyr realm
	        owl::zephyr_getsender() -- returns the zephyr sender
	Made owl::COMMAND("foo"); be syntactic sugar for
	        owl::command("COMMAND foo");
		*** Is this a good or bad idea?
		*** This feature may be taken out before release.
	Added perlwrap.pm to contain perl code to be compiled into
	        the binary.  This is transformed into perlwrap.c by
		encapsulate.pl.
	Renamed readconfig.c to perlconfig.c and changed variables accordingly.
	Minor bugfixes in cmd.c and commands.c
File:
1 edited

Legend:

Unmodified
Added
Removed
  • variable.c

    r09489b89 rf1e629d  
    204204  OWLVAR_STRING( "default_style" /* %OwlVarStub */, "default",
    205205                 "name of the default formatting style",
    206                  "This sets the default message formatting style. Possbile\n"
    207                  "values include 'default' 'basic' 'oneline' and if\n"
    208                  "available, 'perl'\n" ),
     206                 "This sets the default message formatting style.\n"
     207                 "Styles may be created with the 'style' command.\n"
     208                 "Some built-in styles include:\n"
     209                 "   default  - the default owl formatting\n"
     210                 "   basic    - simple formatting\n"
     211                 "   oneline  - one line per-message\n"
     212                 "   perl     - legacy perl interface\n"
     213                 "\nSEE ALSO: style, show styles, view -s <style>\n"
     214                 ),
     215
    209216
    210217  OWLVAR_INT(    "edit:maxfillcols" /* %OwlVarStub:edit_maxfillcols */, 70,
     
    356363  owl_zephyr_set_locationinfo(owl_global_get_hostname(&g), newval);
    357364  return(owl_variable_string_set_default(v, newval));
    358 }
    359 
    360 int owl_variable_style_set(owl_variable *v, void *newval) {
    361   /* Invalidate all message formats first */
    362   int ret;
    363   owl_style *s;
    364 
    365   s=owl_global_get_style_by_name(&g, newval);
    366   if (!s) {
    367     /* this message won't get seen, we'll need to deal with that later */
    368     owl_function_makemsg("No style named '%s' exists.", newval);
    369     return(0);
    370   }
    371  
    372   owl_messagelist_invalidate_formats(owl_global_get_msglist(&g));
    373   ret=owl_variable_string_set_default(v, newval);
    374   owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS);
    375   owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    376   return(ret);
    377365}
    378366
Note: See TracChangeset for help on using the changeset viewer.