Emacs navigating {parantheses}

Writing a lot of JavaScript I want to navigate to the end of a method, object or similar. Normally I want to go from the beginning parenthesis “{” to the ending one “}”. The font-lock-mode highlights the opposite parenthesis or the region (if it’s outside the visible screen).

Navigation goes quick with C-M-n or C-M-p.

See the Emacs wiki: http://www.emacswiki.org/emacs/NavigatingParentheses

C-h k C-M-n:

C-M-n runs the command forward-list, which is an interactive compiled Lisp
function in `lisp.el’.

It is bound to C-M-n.

(forward-list &optional ARG)

Move forward across one balanced group of parentheses.
With ARG, do it that many times.
Negative arg -N means move backward across N groups of parentheses.
This command assumes point is not in a string or comment.

C-h k C-M-p:

C-M-p runs the command backward-list, which is an interactive compiled Lisp
function in `lisp.el’.

It is bound to C-M-p.

(backward-list &optional ARG)

Move backward across one balanced group of parentheses.
With ARG, do it that many times.
Negative arg -N means move forward across N groups of parentheses.
This command assumes point is not in a string or comment.

Advertisements

Esri JavaScript API: map dijit and DOJO AMD

An example how to use DOJO AMD and aspect after on the map dijit. …

HTML (on.html):

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>map dijit and dojo amd</title>
    <style type="text/css">
    @import "//serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/claro/claro.css";
    @import "//serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/esri/css/esri.css";
    </style>
    <script type="text/javascript">
    dojoConfig = {
        isDebug:true,
        async:true
    };
    </script>
    <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2"></script>
    <script type="text/javascript" src="on.js"></script>
</head>

<body class="claro">
    <div id="mapDiv" style="width:900px; height: 600px; border:1px solid #000; padding:0;"></div>
</body>

</html>​

JavaScript (on.js)

var map;

// esri/dijit/attribution: Unable to show map attribution. Did you forget to require 'esri.dijit.Attribution'?

require(["esri/Map", "dojo/parser", "dojo/on", "dojo/aspect", "esri/dijit/Attribution", "dojo/domReady!"],
    function(Map, parser, on, aspect) {
        parser.parse();
        var initExtent = new esri.geometry.Extent({
            "xmin" : -122.46,
            "ymin" : 37.73,
            "xmax" : -122.36,
            "ymax" : 37.77,
            "spatialReference" : {
                "wkid" : 4326
            }
        });
        var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
        map = new esri.Map("mapDiv", {
            extent : esri.geometry.geographicToWebMercator(initExtent)
        });
        map.addLayer(basemap);

        aspect.after(map, 'onLoad', function() {
            alert("Loaded");
        });
});