emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100449: * lisp/emulation/edt.el (edt


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100449: * lisp/emulation/edt.el (edt-load-keys): Use locate-library.
Date: Tue, 25 May 2010 21:06:09 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100449
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Tue 2010-05-25 21:06:09 -0700
message:
  * lisp/emulation/edt.el (edt-load-keys): Use locate-library.
  This simplifies the code, and handles compressed .el.gz files, which
  the previous version did not.
modified:
  lisp/ChangeLog
  lisp/emulation/edt.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-05-25 22:50:56 +0000
+++ b/lisp/ChangeLog    2010-05-26 04:06:09 +0000
@@ -1,3 +1,7 @@
+2010-05-26  Glenn Morris  <address@hidden>
+
+       * emulation/edt.el (edt-load-keys): Use locate-library.
+
 2010-05-25  Chong Yidong  <address@hidden>
 
        * log-edit.el (log-edit-strip-single-file-name): Default to nil.

=== modified file 'lisp/emulation/edt.el'
--- a/lisp/emulation/edt.el     2010-05-05 04:27:16 +0000
+++ b/lisp/emulation/edt.el     2010-05-26 04:06:09 +0000
@@ -1,7 +1,8 @@
 ;;; edt.el --- enhanced EDT keypad mode emulation for GNU Emacs 19
 
 ;; Copyright (C) 1986, 1992, 1993, 1994, 1995, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Author: Kevin Gallagher <address@hidden>
 ;; Maintainer: Kevin Gallagher <address@hidden>
@@ -2056,40 +2057,32 @@
 
      Ack!!  You're running the Enhanced EDT Emulation without loading an
      EDT key mapping file.  To create an EDT key mapping file, run the
-     edt-mapper.el program.  It is safest to run it from an Emacs loaded
+     edt-mapper program.  It is safest to run it from an Emacs loaded
      without any of your own customizations found in your .emacs file, etc.
      The reason for this is that some user customizations confuse edt-mapper.
      You can do this by quitting Emacs and then invoking Emacs again as
      follows:
 
-          emacs -q -l edt-mapper.el
+          emacs -q -l edt-mapper
 
      [NOTE:  If you do nothing out of the ordinary in your .emacs file, and
-     the search for edt-mapper.el is successful, you can try running it now.]
+     the search for edt-mapper is successful, you can try running it now.]
 
-     The file edt-mapper.el includes these same directions on how to
+     The library edt-mapper includes these same directions on how to
      use it!  Perhaps it's lying around here someplace. \n     ")
-        (let ((file "edt-mapper.el")
-              (found nil)
-              (path nil)
-              (search-list (append (list (expand-file-name ".")) load-path)))
-          (while (and (not found) search-list)
-            (setq path (concat (car search-list)
-                               (if (string-match "/$" (car search-list)) "" 
"/")
-                               file))
-            (if (and (file-exists-p path) (not (file-directory-p path)))
-                (setq found t))
-            (setq search-list (cdr search-list)))
-          (cond (found
-                 (insert (format
-                          "Ah yes, there it is, in \n\n       %s \n\n" path))
-                 (if (edt-y-or-n-p "Do you want to run it now? ")
-                     (load-file path)
-                   (error "EDT Emulation not configured")))
-                (t
-                 (insert "Nope, I can't seem to find it.  :-(\n\n")
-                 (sit-for 20)
-                 (error "EDT Emulation not configured")))))))
+         (let ((path (locate-library
+                      "edt-mapper"
+                      nil (append (list (expand-file-name ".")) load-path))))
+           (if path
+               (progn
+                 (insert (format
+                          "Ah yes, there it is, in \n\n       %s \n\n" path))
+                 (if (edt-y-or-n-p "Do you want to run it now? ")
+                     (load-file path)
+                   (error "EDT Emulation not configured")))
+             (insert "Nope, I can't seem to find it.  :-(\n\n")
+             (sit-for 20)
+             (error "EDT Emulation not configured"))))))
 
 ;;;
 ;;;  Turning the EDT Emulation on and off.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]