Peter Szilagyi committed 9ec0614

removed legacy jane-mode, made paths version-specific paths, and fixed ocp-indent file-not-found

Comments (0)

Files changed (5)

+- dropped a legacy compatibility definition of "jane-home"; delete a
+  reference to it from custom-set-variables in your ~/.emacs if you
+  encounter a corresponding "undefined variable" error at startup
 - unbound "C-c C-c" in edit-server (Google Chrome Edit with Emacs) to
   focus attention on the emacsclient-compatible "C-x #" binding
 - integrated new ocp-indent Emacs Lisp bindings and latest updates
 bug fixes
+- used "file-truename" strategically on "load-path" entries so already
+  running Emacsen can survive upgrades by continuing to run matching,
+  start-time versions of Elisp, OMake Server, ocp-indent, etc.
+- added end-of-line whitespace-removal to jane-tuareg-hook
 2012-12-31 Rolled rev 0a2ef19b7002 to test


 ;; Set site lisp dir for everyone and add load paths                          ;;
-(defvar jane-jane-lisp                  ; this directory
-  (if load-file-name (directory-file-name (file-name-directory load-file-name))))
+(defconst jane-jane-lisp
+  (file-truename (expand-file-name "."
+                                   (file-name-directory (or load-file-name
+                                                            "."))))
+  "The absolute name of this elisp/jane directory, with symlinks resolved.
+Symlinks are resolved in order to fix the version of the Jane
+Elisp code for the life of this Emacs.  The Jane Elisp code is
+usually installed in a date-stamped location and symlinked from
+an official name for the latest version.
+For example, a user typically has this in ~/.emacs:
+    (load \"/j/office/app/emacs/prod/jane-elisp/elisp/jane/jane-defaults\")
+The \"jane-elisp\" component is typically a symlink, like this:
+    jane-elisp -> .sink-2012-12-03_22-11-48.277942/jane-elisp
+By expanding paths to use the long, ugly, versioned directory
+name, already running Emacsen will continue to work after
+jane-elisp upgrades, using their start-time version.  Even when
+an upgrade moves the OMake Server executable or increments its
+protocol version, users won't have to restart immediately.")
 (defvar jane-contrib-lisp (expand-file-name "../contrib" jane-jane-lisp)
   "The location of Emacs libraries")
 (defconst jane-home (expand-file-name "../.." jane-jane-lisp))
-;; CR pszilagyi: The following can be removed after we've eradicated
-;; these settings from users' ~/.emacs files, which were set by the
-;; old jane-common.el and saved by Custom:
-;;     (custom-set-variables
-;;      '(Omake\.Server\.program
-;;        (case jane-mode
-;;         ((quote prod) "/mnt/global/base/bin/omake_server.exe")
-;;         ((quote test) "/mnt/global/base/bin/omake_server_test.exe")
-;;         ((quote local) (expand-file-name "ocaml/omake/omake_server.exe" jane-home))))
-;;      )
-;; The above fragment is evaluated by Custom and references
-;; `jane-mode'.  One way to get rid of this is for the user to Erase
-;; Customizations in the Customize buffer.
-(defconst jane-mode 'local)
 (defconst jane-dirs
-  '("ocp-indent"
-    "elisp/jane"
+  '("elisp/jane"
     "elisp/contrib"                     ; incl. ert 2012
 (dolist (dir jane-dirs)
   (add-to-list 'load-path (expand-file-name dir jane-home)))
-(require 'ocp-indent)
-;; Ocp.indent-program defaults to ../../ocp-indent/ocp-indent-stdin,
-;; which runs ocp-indent from $PATH.  If the user or site doesn't have
+;; If the user or site doesn't have
 ;; their own ocp-indent, find the one included with jane-elisp.
 (let ((bin (expand-file-name "../../bin" jane-jane-lisp)))
   (add-to-list 'exec-path bin 'append)


 ;; Reasonable defaults for new emacs users
-;; This is repeated in jane-common and jane-defaults.  Either can be
-;; loaded from a user's ~/.emacs.
-(when load-file-name
-  (add-to-list 'load-path (directory-file-name (file-name-directory load-file-name))))
-(require 'jane-common)
+;; Either jane-common or jane-defaults can be loaded from a user's
+;; ~/.emacs.
+(load (expand-file-name "jane-common"
+                        (file-name-directory (or load-file-name "."))))
 ;; Micro-features


 ;; ocp-indent-line and ocp-indent-region
 (load (expand-file-name "../../ocaml/contrib/ocp-indent/emacs.el"
-                        (and load-file-name
-                             (file-name-directory load-file-name))))
+                        (file-name-directory (or load-file-name "."))))
 (remove-hook 'tuareg-mode-hook 'ocp-setup-indent)
 (defun jane-tuareg-mode-hook ()


 (defcustom Omake.Server.program
   (expand-file-name "../../ocaml/omake/exe/omake_server.exe"
-                    (file-name-directory load-file-name))
+                    (file-name-directory (or load-file-name ".")))
   "location of the executable program to find the next error"
   :group 'omake
   :type 'string)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.