2010-03-08

Favorite Emacs Customizations

Somebody asked me the other day what Emacs customizations use. My response was that I don't use many customizations in Emacs because it would require me to carry those customizations around with me. However, I thought I would make a list, since this will be useful in the future when I am - again - using a vanilla Emacs install and want to make all the customizations at once, at startup.

Option Configuration

column-number-mode: HIDE
scroll-bar-mode:OFF
tool-bar-mode:OFF
auto-fill-mode:ON
transient-mark-mode:ON
global-font-lock-mode:ON

Major Modes

sgml-mode
html-mode
php-mode
js-mode
css-mode

sgml / html modes are commonly installed by default, now, and I've seen a couple installs where php-mode and one or more of javascript-mode (or js-mode) and css-mode were also installed "out-of-the-box"

These modes are all defined by Elisp (.el) library files (usually compiled to .elc files). Once the library files are installed (e.g. in /usr/lib/perl/<ver>/site/ or /usr/share/emacs/site or whereever), they can be loaded using M-x 'load-library' command.

These libraries can also be loaded from your .emacs file and made to use a 'hook' function that auto-loads the appropriate mode based on the file extension cue for the source language of the file.

Links

2010-01-08

Bash code: CVS status logging

This command has the effect of checking each of the indicated files in the source tree against the CVS repository - errors should be propagated to stderr if a file in the source tree does not exist in the CVS repository - this cmd should be refined into a script which tests for error on status and tries to add source files which do not appear to be in the repository....

for fn in *.{css,js,html,php} ./xml/*.xml ./xml/services/*.xml ./js/*.js ; 
    do echo $fn ; 
    cvs status $fn; 
    echo ""; done > cvs-status.txt

Note that the command cvs status [in src dir, w/ no args] does something similar to the above command, differing in that using cvs status may not handle the cases a source file exists which has not been added to the repository.

The CVS manpage does not address this:

       status [-lRqQ] [-v] [files...]
              Requires: working directory, repository.
              Changes: nothing.
              Display a brief report on  the  current  status  of  files  with
              respect to the source repository, including any ``sticky'' tags,
              dates, or -k options.  (``Sticky''  options  will  restrict  how
              `cvs  update' operates until you reset them; see the description
              of `cvs update -A...'.)

              You can also use this command to anticipate the potential impact
              of  a  `cvs update' on your working source directory.  If you do
              not specify any files explicitly,  reports  are  shown  for  all
              files  that  cvs  has placed in your working directory.  You can
              limit the scope of this search to the current  directory  itself
              (not  its  subdirectories)  with the standard -l option flag; or
              you can explicitly request recursive status reports with the  -R
              option.

              The  -v  option  causes the symbolic tags for the RCS file to be
              displayed as well.

2009-12-29

CVS over SSH

Accessing a Remote Repository via a Network (http://www.felixgers.de/teaching/cvs/remote.html) has the following juicy tidbit [HTML3 elements replaced w/ XHTML elements -ed]: 


Connecting with rsh or ssh:

CVS uses the rsh of ssh protocol to access a remote repository.

CVS uses the contents of the CVS_RSH variable to determine the name of the remote shell command to use when starting a CVS server. If this variable is not set then ‘rsh’ is used. To use ssh set: 

 shell> export CVS_RSH=ssh

Example:  Supposing you want to access the module ’foo‘ in the repository ‘/cvsroot/’, on machine ‘gnu.org’: 

 cvs -d :ext:bach@gnu.org/cvsroot checkout foo

The ‘bach@’ can be omitted if the username is the same on both the local and remote hosts.

2009-12-17

Firebug and JIT

~robcee/ blogs about Mozilla Firefox and related topics.

In the 15 Dec post entitled Firebug and the JIT, cee talks about SpiderMonkey (the Mozilla Javascript engine built in to Firefox) and some potential performance issues with using the Firebug debugging tool addon in Firefox 3.5 & 3.6

Downloadable Web Page Fonts

The article from hacks.mozilla.org is entitled Web Open Font Format for Firefox 3.6

This article discusses using Web Open Font Format (WOFF) font files with CSS to specify fonts for use in web pages. WOFF files are stored on the web server, and downloaded to the client browser based on URL specified by the @font-family CSS rule(s).

From the article: 

This format has two main advantages over raw TrueType or OpenType fonts.
  1. It is compressed, which means that you will typically see much smaller download sizes compared with raw TrueType or OpenType fonts.
  2. It contains information that allows you to see where the font came from – without DRM or labeling for a specific domain – which means it has support from a large number of font creators and font foundries.

2009-12-07

Esspresso - Javacript Mode for Emacs

Esspresso is an Emacs eLisp library for manipulating Javascript source code.

CPP is the GNU C Preprocessor.

How sick is this (FtA):

Just configure your web server to pipe Javascript through GNU cpp:

/usr/bin/cpp -P -undef -Wundef -std=c99 -nostdinc -Wtrigraphs -fdollars-in-identifiers -C

before minifying and compressing it for transmission.

2009-12-01

XHTML Forms Processing using Javascript

http://www.javascript-coder.com/ has some fairly easy-to-understand example Javascript for doing interesting things with the HTML DOM using Javascript.

The site has a number of articles worth noting:

2009-11-21

the out-of-town advantage

When trying to get a job in the US, during this past Century (the 20th) there has existed a quantifiable advantage for individuals who are - all other things being equal - from "out of town".

This is clearly a subjective, psychological advantage assigned to persons of lesser known origins by the thought processes of the hiring agency. It is possible that the description of this situation may be constrained to the decision-making individual on the hiring side of the employment transaction.

Whether or not this bias in the system is a function of so-called "human-nature" or a derivation of "sociological precepts" is a matter that remains open for conjecture.

2009-11-18

Five Errors from Mozilla Firefox starting up under X11

Following is a copy of the stderr output from Mozilla Firefox startup [scripts] where the Firefox is running under Linux on the HP laptop, and the X11 display is running on the Sony Vaio laptop under WinXP - Cywin-X, it is.

Not having looked these up, yet, I'm reasonably certain that the first two - the nss-shared-helper errors (or information messages, depending on your POV) are coming from the Linux host configuration - that 'NSS_[...]_SHARED_DB' business harks back to ... was it Netscape 3.x under RedHat Linux?

The Pango-WARNINGs are doubtless a function of the X11 Font Configuration for the Cygwin X11 server - that would mean a problem on the WinXP host - needs the X11 font server configuration tweaked to correctly serve Pango fonts.

The last error message - the one tagged with the [NoScript] identifier is clearly a Javascript error from a Firefox Add-On (NoScript) which is probably doing something like assigning XML values to User Interface Document Object Model elements.

If you fix any of these, and record the fix in a blog, wiki, or other online media, email me (or post a comment here) and I will link to your site. Meanwhile, this will just have to wait until iut becomes a priority.

cps@catfish: ~
$firefox
*** nss-shared-helper: Shared database disabled (set NSS_USE_SHARED_DB to enable).
*** nss-shared-helper: Shared database disabled (set NSS_USE_SHARED_DB to enable).
NPP_GetValue()
NPP_GetValue()

(firefox:15593): Pango-WARNING **: Error loading GSUB table 0x6ead

(firefox:15593): Pango-WARNING **: Error loading GSUB table 0x6ead
[NoScript] TypeError: r.object.parentNode is null

This is part of a series

Setting up a secure connection for editting files on the remote host.