Merge branch 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile
[profile] / dot-emacs.el
index 09c1415..0599106 100644 (file)
@@ -128,6 +128,19 @@ symbols `sunday', `monday', etc. (or a mixture).  If the date stored in
 
 ;;;----- Utility functions --------------------------------------------------
 
+(defun line-number-at-pos (&optional pos)
+  "Print the current buffer line number and narrowed line number of point."
+  (let ((opoint (or pos (point))) start)
+    (save-excursion
+      (save-restriction
+       (goto-char (point-min))
+       (widen)
+       (forward-line 0)
+       (setq start (point))
+       (goto-char opoint)
+       (forward-line 0)
+       (1+ (count-lines 1 (point)))))))
+
 ;; --- mdw-uniquify-alist ---
 
 (defun mdw-uniquify-alist (&rest alists)
@@ -641,8 +654,6 @@ doesn't cope with anything approximating a complicated case."
   (setq c-hanging-comment-ender-p nil)
   (setq c-backslash-column 72)
   (setq c-label-minimum-indentation 0)
-  (setq comment-start "/* ")
-  (setq comment-end " */")
   (setq mdw-fill-prefix
        `((,(concat "\\([ \t]*/?\\)"
                    "\\([\*/][ \t]*\\)"
@@ -655,12 +666,12 @@ doesn't cope with anything approximating a complicated case."
   (make-local-variable 'font-lock-keywords)
   (let ((c-keywords
         (make-regexp '(
-                       ;; "and"        ;C++
-                       ;; "and_eq"     ;C++
+                       "and"           ;C++
+                       "and_eq"        ;C++
                        "asm"           ;K&R, GCC
                        "auto"          ;K&R, C89
-                       ;; "bitand"     ;C++
-                       ;; "bitor"      ;C++
+                       "bitand"        ;C++
+                       "bitor"         ;C++
                        "bool"          ;C++, C9X macro
                        "break"         ;K&R, C89
                        "case"          ;K&R, C89
@@ -668,7 +679,7 @@ doesn't cope with anything approximating a complicated case."
                        "char"          ;K&R, C89
                        "class"         ;C++
                        "complex"       ;C9X macro, C++ template type
-                       ;; "compl"      ;C++
+                       "compl"         ;C++
                        "const"         ;C89
                        "const_cast"    ;C++
                        "continue"      ;K&R, C89
@@ -682,12 +693,12 @@ doesn't cope with anything approximating a complicated case."
                        ;; "entry"      ;K&R -- never used
                        "enum"          ;C89
                        "explicit"      ;C++
-                       ;; "export"     ;C++
+                       "export"        ;C++
                        "extern"        ;K&R, C89
                        "false"         ;C++, C9X macro
                        "float"         ;K&R, C89
                        "for"           ;K&R, C89
-                       "fortran"       ;K&R
+                       ;; "fortran"    ;K&R
                        "friend"        ;C++
                        "goto"          ;K&R, C89
                        "if"            ;K&R, C89
@@ -699,8 +710,8 @@ doesn't cope with anything approximating a complicated case."
                        "namespace"     ;C++
                        "new"           ;C++
                        "operator"      ;C++
-                       ;; "or"         ;C++
-                       ;; "or_eq"      ;C++
+                       "or"            ;C++
+                       "or_eq"         ;C++
                        "private"       ;C++
                        "protected"     ;C++
                        "public"        ;C++
@@ -733,8 +744,8 @@ doesn't cope with anything approximating a complicated case."
                        "volatile"      ;C89
                        "wchar_t"       ;C++, C89 library type
                        "while"         ;K&R, C89
-                       ;; "xor"        ;C++
-                       ;; "xor_eq"     ;C++
+                       "xor"           ;C++
+                       "xor_eq"        ;C++
                        "_Bool"         ;C9X
                        "_Complex"      ;C9X
                        "_Imaginary"    ;C9X