[geeks] emacs 21
Greg A. Woods
woods at weird.com
Sat Jan 12 13:49:08 CST 2002
[ On Saturday, January 12, 2002 at 13:12:01 (-0500), Joshua D Boyd wrote: ]
> Subject: Re: [geeks] emacs 21
>
> On Wed, Jan 09, 2002 at 03:34:53AM -0500, Greg A. Woods wrote:
> > ;; Gerd Moellmann says that the menu-bar and tool-bar can be controlled on
> > ;; individual frames by managing these frame-parameters: `menu-bar-lines' and
> > ;; `tool-bar-lines
> > :;
> > ;; however just blasting away the tool-bar completely seems best
> > ;;
> > ;; note the v20.* compiler will bitch about tool-bar-mode being undefined...
> > (if (elisp-file-in-loadpath-p "tool-bar")
> > (progn
> > (require 'tool-bar)
> > (if (fboundp 'tool-bar-mode)
> > (tool-bar-mode -1)))) ; major space waster!
>
> I finally got around to trying that, and it whines about
> elisp-file-in-loadpath-p being void. Any ideas?
Oh, sorry, that's another local function in my ~/.emacs.el:
;;; This could/should probably be rewritten to use mapcar
;;;
(defun elisp-file-in-loadpath-p (file-name)
"Returns t if there is an emacs lisp-library of the name FILENAME in
the load-path list. Matching is first done by looking for the file
with an .elc extension, an .el extension, and finally with no
extension at all, and returning t if any of the three are found. Nil
is returned otherwise."
(let ((extension-list (list ".elc" ".el" ""))
(file-found-p nil)
name-to-try)
(while (and (not file-found-p) (not (null extension-list)))
(setq name-to-try (concat file-name (car extension-list)))
(setq extension-list (cdr extension-list))
(setq file-found-p (file-in-loadpath-p name-to-try)))
(eval 'file-found-p)))
(defun file-in-loadpath-p (file-name)
"Returns t if the string argument FILENAME is a file name present in a
directory in the load-path list, otherwise returns nil."
(file-in-pathlist-p file-name load-path))
(defun file-in-pathlist-p (file-name path-list)
"Returns t if the string FILENAME is a file name which occurs in a
directory in the list PATHLIST, otherwise nil."
(let (try-path (file-found-in-path-p nil))
(while (not (or file-found-in-path-p (null path-list)))
(setq try-path (car path-list)
path-list (cdr path-list))
(if (file-exists-p (concat try-path "/" file-name)) ; path-separator :-)
(setq file-found-in-path-p t)))
(eval 'file-found-in-path-p)))
;; end elisp code.
The whole mess, along with all the other goodies in my environment, can
be gotten from
ftp://ftp.weird.com/~woods/dotfiles.tar.gz
> Also, why do I want all that instead of just putting the line:
> (tool-bar-mode -1)
> in my .emacs file?
In case you share your ~/.emacs[.el] with other systems (or even the
same system) running older versions of Emacs (or even Xemacs), just as
is hinted in the comment for it.... :-)
--
Greg A. Woods
+1 416 218-0098; <gwoods at acm.org>; <g.a.woods at ieee.org>; <woods at robohack.ca>
Planix, Inc. <woods at planix.com>; VE3TCP; Secrets of the Weird <woods at weird.com>
More information about the geeks
mailing list