From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: ChristopherMBalz@StanfordAlumni.org Newsgroups: gmane.emacs.help Subject: w3m no longer works on update to latest. Date: 24 Dec 2004 01:40:33 -0800 Organization: http://groups.google.com Message-ID: <1103881233.025140.298900@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1103881513 17128 80.91.229.6 (24 Dec 2004 09:45:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 24 Dec 2004 09:45:13 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 24 10:45:00 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Chm0H-0004Tg-00 for ; Fri, 24 Dec 2004 10:44:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1ChmAt-0007m6-LV for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Dec 2004 04:55:55 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 907 Original-NNTP-Posting-Host: 68.164.83.248 Original-X-Trace: posting.google.com 1103881238 5907 127.0.0.1 (24 Dec 2004 09:40:38 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 24 Dec 2004 09:40:38 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: z14g2000cwz.googlegroups.com; posting-host=68.164.83.248; posting-account=vuULPQwAAACC6U0oTIeYncV2pdCE-Ru0 Original-Xref: shelby.stanford.edu gnu.emacs.help:127502 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:22959 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:22959 Using: Emacs version: GNU Emacs 21.3.1 emacs-w3m-1.4.3 w3m version w3m/0.5.1 w3m configured, built, and installed fine, and works fine from a plain, standalone Cygwin shell (with the notable exception that these characters: '=E2"?=E2"?=E2' seem to show up in odd places -- any suggestions?). However, it does not actually display any HTML pages from the command, w3m-browse-url. Before I updated, my w3m worked fine inside Emacs, except that it would not browse javadoc from the JDE (although Internet Explorer would). Actually, that particular fault led me to upgrade (with the predictable results!) My dot-emacs file is below. Any suggestions as to how to get w3m working well inside of Emacs would be great. Here is my dot-emacs file: ;; This is a web programmer's .emacs file for GNU Emacs. ;; It has been tested on GNU Emacs version 21.3.1 on Windows XP, ;; Service Pack 2. ;; ;; The GNU Emacs Homepage is located at: ;; http://www.gnu.org/directory/GNU/emacs.html ;; ;; This Document Last Modified: 08/09/2004. ;; ;; Portability: It would take minimal or no changes to port it to run on Unix; ;; the one major change definitely needed would be to remove the "cygwin"-related ;; code, since that is only for putting the BASH shell on Windows. ;; ;; @author: Christopher M. Balz. ;; Feel free to e-mail me regarding this file at any of the addresses below: ;; ChristopherBalz@yahoo.com ;; ChristopherMBalz@StanfordAlumni.org ;; General Notes: It is often said that a new Emacs user should stay away from old, crusty ;; '.emacs' files from others. However, the only way that I ever was able ;; to get a reasonable return on the investment of my time put into setting ;; up my Emacs configurations was by borrowing code snippets from others. ;; It is true that no '.emacs' file should be used uncritically, by newbie or ;; by others. ;; ;; However, for the best user base, new users should be able to ;; fairly easily clip out sections of '.emacs' files that interest them and put ;; them to use right away in their own '.emacs' files. To this end, I have ;; attempted to effectively segment the various independent components of this ;; '.emacs' file and have documented what I have done as clearly as possible. ;; It's very exciting how Emacs modes related to software engineering for the ;; web are maturing. ;; ;; ------------ Invocation of Gnu Emacs on Windows: ;; ;; ;; First, set user-specific 'HOME' environment variable to 'C:/cygwin/home/Christopher Balz/' ;; (substituting whatever your home directory is), which is ;; the directory in which your '.emacs' file is located. Do this by going to the 'Control Panel', ;; then to 'System', then to 'Advanced', then to 'Environment Variables', the to 'Variables ;; for '. ;; ;; Next, run the 'addpm.exe' program to install Emacs on Windows. You don't have to do this, ;; and can do the necessary tasks to run Emacs on Windows manually, but this is the best way to go. ;; ;; If you experience temporary "blanking out" of the screen when you select one of the two Emacs windows ;; (meaning specifically the Windows command line), select 'Properties' on the Emacs short cut, ;; select the 'Options' tab, select the 'Window' radio button, and then select 'Ok' and 'Save ;; for future sessions.' If you run Windows command programs from Emacs, such as Cygwin, you ;; may also get "blanking out" of the screen unless you run "Command" from the Windows "Run" option ;; on the "Start" menu, right-click on the window title bar, select 'Default', ;; and perform the same property change just described, selecting "Window" instead of "Full Screen". ;; ;; ------------ Commense lisping: ;; Add the site directory (the site directory is used to contain non-core Emacs Lisp packages) ;; to the Emacs load-path. The Emacs load-path is ;; the list of directories where Emacs searches for packages that you require. ;; This must be at the head of your .emacs file. This code prepends the site directory to the load path: ;; Standard emacs lisp access (for non-byte-compiled access): (add-to-list 'load-path (expand-file-name "C:/Program Files/emacs/emacs-21.3/site-lisp/")) (add-to-list 'load-path (expand-file-name "C:/Program Files/emacs/emacs-21.3/site/lisp/progmodes/")) ;; System-wide emacs customizations: (add-to-list 'load-path (expand-file-name "C:/Program Files/emacs/site/")) (add-to-list 'load-path (expand-file-name "C:/Program Files/emacs/site/snippets/")) ;; Personal emacs/site: (add-to-list 'load-path (expand-file-name "~/emacs/site/")) ;; So that Emacs can find the home directory files (desktop, etc.): (add-to-list 'load-path (expand-file-name "~/")) ;; Specific Packages: ;; These packages are now included in the 'cedet' package (below), ;; from 'http://cedet.sourceforge.net': ;; (add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site/eieio-0.17/")) ;; (add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site/semantic-1.4.4/")) ;; (add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site/speedbar-0.14beta4/")) ;; Load CEDET (Needed by the Java Development Environment for Emacs, and must be actively 'loaded'): (add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site/cedet-1.0beta3b/common/")) (load-file "c:/Program Files/emacs/site/cedet-1.0beta3b/common/cedet.elc") ;; Enabling SEMANTIC minor modes. See semantic/INSTALL for more ideas. (semantic-load-enable-code-helpers) (add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site/elib-1.0/")) (add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site/psgml-1.2.5/")) ;; For Emacs JDE (from http://sunsite.dk/jde/): ;;(add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site/jde-2.3.2/lisp/")) (add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site/jde-2.3.5/lisp/")) (add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site/jmaker-2.1/")) ;; For the Emacs Web Browser: (add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site/emacs-w3m-1.4.3/")) (add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site-lisp/w3m/")) ;; For CSP, a formal notation for _c_ommunicating _s_equential _p_rocesss (add-to-list 'load-path (expand-file-name "c:/Program Files/emacs/site/csp-mode-1.0.1/")) ;; On Windows 2000, it is sufficient to set the user-specific 'HOME' environment ;; variable (see above) to the path to your .emacs file. For example, mine goes to: ;; 'C:/cygwin/home/Christopher Balz'. Most other systems should have a ;; reasonably sane approach to doing this. These approaches are best. ;; However, if on some other system you have ;; trouble saving your customizations (meaning, the customizations possible ;; through the command ESC-x customize-group, and meaning, the error message ;; 'saving settings from 'emacs -q' would overwrite customizations'), ;; explicitly assigning the 'user-init-file' variable is a sure-fire way ;; to avoid the problem: ;; (setq user-init-file (expand-file-name "~/.emacs") ;; custom-file (expand-file-name "~/.emacs")) ;; For use of Bash shell via Cygwin on Windows 2000 (or NT), available from: ;; http://www.cygwin.com/ ;; (if you do not have Cygwin installed, comment all of this section out). ;; This assumes that Cygwin is installed in C:\cygwin (the ;; default) and that C:\cygwin\bin is not already in your ;; Windows Path (it generally should not be). ;; (setq exec-path (cons "C:/cygwin/bin" exec-path)) (setenv "PATH" (concat "C:\\cygwin\\bin;" (getenv "PATH"))) ;; ;; NT-emacs assumes a Windows command shell, which you change ;; here. ;; (setq process-coding-system-alist '(("bash" . undecided-unix))) (setq w32-quote-process-args ?\") (setq shell-file-name "bash") (setenv "SHELL" shell-file-name) (setq explicit-shell-file-name shell-file-name) ;; End of bash shell use via Cygwin section. ;; This removes unsightly ^M characters that would otherwise ;; appear in the output of java applications. ;; (add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m) ;; Set start-up directory with cygwin nomenclature ;; (your configuration files _must_ be in this directory): (setq startup-directory "~/") ;; generic-x.el is a standard package with Emacs 21. It contains some ;; very neat little modes, such as a JavaScript mode (but said mode ;; is not yet as good as c-mode for JavaScript, for it does not ;; recognize /*-style comments. ;; All modes supported by generic-x.el are automatically applied ;; unless overridden below (for example, JavaScript mode is overridden ;; below). (require 'generic-x) ;; -------- JDE is the Java IDE for Emacs. (require 'jde) ;; Use no tabs when editing Java for cross-editor indentation compatibility. (defun my-jde-indent-setup () (setq indent-tabs-mode nil) (setq jde-basic-offset 4)) ;; ;; Add the above hook to the jde-mode. (add-hook 'jde-mode-hook 'my-jde-indent-setup) ;; --------- Begin CSP Section (require 'csp-mode) (setq auto-mode-alist (cons '("\\.csp$" . csp-mode) auto-mode-alist)) (setq csp-validate-command "c:/Windows/System32/cmd.exe e:off /c 'C:\\Program Files\\probe-1.30-windows\\probe-1.30-windows\\probe.exe'" ) ;; --------- Begin w3m Section (HTML browser) ;;;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ;;; w3m browser mode: ;;;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ;;; This integrates the external program w3m with emacs. (setq w3m-command (concat "c:/Program Files/emacs/site/w3m-0.5.1/w3m.exe" "")) ;; (setq w3m-browse-url (concat "c:/Program Files/emacs/site/w3m-0.5.1/w3m.exe" "")) ;; (setq w3m-find-file (concat "c:/Program Files/emacs/site/w3m-0.5.1/w3m.exe" "")) (require 'w3m-load) ;;; Need to load the search to change the search-engine-alist without ;;; using customize, since there appears to be no hook into the ;;; w3m-search function to activate (load-library "w3m-search") ;;; Use programs contributed with the w3m distribution (autoload 'w3m-find-file "w3m" "w3m interface function for local file." t) (autoload 'w3m-search "w3m-search" "Search QUERY using SEARCH-ENGINE." t) (autoload 'w3m-weather "w3m-weather" "Display weather report." t) (autoload 'w3m-antenna "w3m-antenna" "Report change of WEB sites." t) (autoload 'w3m-namazu "w3m-namazu" "Search files with Namazu." t) ;;; Allow browsing of local files: (setq w3m-dirlist-cgi-program "C:/Program Files/emacs/site/w3m-0.5.1/scripts/dirlist.cgi") ;;; causes the return key to submit a form (setq w3m-use-form t) ;;; for a list of available engines, or to add a search engine, see ;;; the variable 'w3m-search-engine-alist' defined in w3m-search.el. ;;; It's set in the customization section at the end of this file (add-to-list 'w3m-search-engine-alist '("google" "http://www.google.com/search?num=3D30&q=3D%s" nil)) (add-to-list 'w3m-search-engine-alist '("google-groups" "http://groups.google.com/groups?num=3D30&q=3D%s" nil)) (add-to-list 'w3m-search-engine-alist '("teo" "http://www.teoma.com/search.asp?t=3D%s" nil)) ;;; set the default search engine (setq w3m-search-default-engine "google") ;;; external browser in which to view pages/graphics (if (eq window-system 'w32) (setq w3m-content-type-alist '(("text/plain" "\\.\\(txt\\|tex\\|el\\)" nil) ("text/html" "\\.s?html?$" w32-shellex-on-object file) ("image/jpeg" "\\.jpe?g$" w32-shellex-on-object file) ("image/png" "\\.png$" w32-shellex-on-object file) ("image/gif" "\\.gif$" w32-shellex-on-object file) ("image/tiff" "\\.tif?f$" w32-shellex-on-object file) ("image/x-xwd" "\\.xwd$" w32-shellex-on-object file) ("image/x-xbm" "\\.xbm$" w32-shellex-on-object file) ("image/x-xpm" "\\.xpm$" w32-shellex-on-object file) ("image/x-bmp" "\\.bmp$" w32-shellex-on-object file) ("video/mpeg" "\\.mpe?g$" w32-shellex-on-object file) ("video/quicktime" "\\.mov$" w32-shellex-on-object file file) ("application/postscript" "\\.\\(ps\\|eps\\)$" w32-shellex-on-object file) ("application/pdf" "\\.pdf$" w32-shellex-on-object file)) )) ;; -------- End w3m Section (HTML browser) ;; -------- Begin JavaScript editing section. -------- ;; This is my way of loading c-mode and hooking .js files to it, ;; not superseded by the JavaScript mode in generic-x.el (see above). (autoload 'c-mode "cc-mode.el") (setq auto-mode-alist (cons '("\\.js$" . c-mode) auto-mode-alist)) ;; This is the container for my custom js editing mode ;; It uses no tabs for cross-editor compatibility. (defun my-js-indent-setup () (setq indent-tabs-mode nil) (setq c-basic-offset 4)) ;; ;; Add the above hook to the c-mode. (add-hook 'c-mode-hook 'my-js-indent-setup) ;; -------- End JavaScript editing section. -------- ;; -------- Begin XML and SGML Editing Section -------- ;; ;; -> Note: this handles HTML also but ;; a formal DTD declaration is needed for that. Instead, I use ;; html-helper-mode, which handles embedded scripts as well. ;; -> From: http://www.lysator.liu.se/~lenst/about_psgml/ ;; -> Environment Variable Must be set for dtd feature to work: ;; PSGML needs to know where to find the SGML catalog files. There are a couple ;; of ways to accomplish this, as described in the PSGML documentation. I use the method ;; that makes use of the environment variable SGML_CATALOG_FILES because it is ;; also used by the SGML parser (patience, I come to it in the next section of this article). ;; So, now that you have a set of DTDs and a catalog file, create the afore-mentioned ;; environment variable and set it to include the path to your xhtml1.soc file, for ;; example d:\DTDs\xhtml1\xhtml1.soc. If you have more that one catalog file, ;; you can include them all, separating them with a path delimiter (";" on Windows, ;; ":" on UNIX-based systems). ;; Here is my value: c:\Program Files\dtds\xhtml1\xhtml1.soc;c:\Program Files\dtds\hodmacro\hodmacro.soc (require 'sgml-mode "psgml.el" "Major mode to edit SGML files.") (autoload 'xml-mode "psgml.el" "Major mode to edit XML." t) (setq auto-mode-alist (append '( ("\\.sgml$" . sgml-mode) ("\\.idd$" . sgml-mode) ("\\.ide$" . sgml-mode) ("\\.xml$" . xml-mode) ("\\.xsl$" . xml-mode) ("\\.fo$" . xml-mode) ) auto-mode-alist ) ) ; Auto-activate parsing the DTD when a document is loaded. ; If this isn't enabled, syntax coloring won't take affect until ; you manually invoke "DTD->Parse DTD" (setq sgml-auto-activate-dtd t) ;;; Set up my "DTD->Insert DTD" menu. (setq sgml-custom-dtd ' ( ( "DITA concept" "\n" ) ( "DITA task" "\n" ) ( "DITA reftopic" "\n" ) ( "DITA APIdesc" "\n" ) ( "DITA topic" "\n" ) ( "HOD Script" "\n" ) ( "XHTML 1.0 Strict" "\n" ) ( "XHTML 1.0 Transitional" "\n" ) ( "XHTML 1.0 Frameset" "\n" ) ( "HTML 4.01 Transitional" "" ) ( "HTML 4.01 Strict" "" ) ( "HTML 4.01 Frameset" "" ) ( "IBMIDDoc" "") ( "DOCBOOK XML 4.1.2" "\n") ) ) (define-key sgml-mode-map "\C-i" 'sgml-insert-element) ; override default validate command to utilize OpenSP's onsgmls executable (setq sgml-validate-command "onsgmls -s %s %s") ; override default xml-mode validate command to utilize OpenSP's onsgmls ; executable by using a mode-hook, since there appears to be no other means ; to accomplish it. (defun my-psgml-xml-hook () (setq sgml-validate-command "onsgmls -s %s %s") (setq sgml-declaration "C:\Program Files\openjade-1.3.1\pubtext\xml.dcl") ) (add-hook 'xml-mode-hook 'my-psgml-xml-hook) ;; -- End psgml / xml section -------- ;; --- Begin HTML editing section: ;; I require html helper mode because the hhm-config.el code seems to ;; cause an error if I have both autoloaded. (require 'html-helper-mode "html-helper-mode.el") (autoload 'html-helper-mode "hhm-config.el") (setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.asp$" . html-helper-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.phtml$" . html-helper-mode) auto-mode-alist)) ;; --- End HTML editing section. ;; ------ JSP Mode (note: this must come after html-helper-mode is loaded (as it is loaded above)): (require 'jsp-html-helper-mode "jsp-html-helper-mode.el") (setq auto-mode-alist (cons '("\\.jsp$" . jsp-html-helper-mode) auto-mode-alist)) ;; ----- CSS mode. ;; This is for the css-mode (will not be necessary in later versions; it should ;; be in the css-mode code itself): (require 'apropos) ;; For css-mode: (from http://synthcode.com/emacs/lang/css-mode.el ) ;; Note: I've had crashing in this mode when I use an M-x indent-region ;; command. (autoload 'css-mode "css-mode.el") (setq auto-mode-alist (cons '("\\.css$" . css-mode) auto-mode-alist)) ;; ----- End CSS mode. ;; Make sure that .emacs file is edited in lisp mode: (setq auto-mode-alist (cons '("\.emacs" . lisp-mode) auto-mode-alist)) ;; ----- Diary and Appointment Notification Section. ;; There are also some variables set via the Emacs Customization Utility. ;; See the end of the file for those. ;; Read the diary: (diary) ;; Fancy display for Calendar ;; Here is some code to make your calendar and diary display fancier: (setq view-diary-entries-initially t mark-diary-entries-in-calendar t number-of-diary-entries 7) (add-hook 'diary-display-hook 'fancy-diary-display) (add-hook 'today-visible-calendar-hook 'calendar-mark-today) ;; Show column number on mode line. (column-number-mode t) ;; Show time on mode line, and set appointment notification. ;; (day-and-date) (display-time) (add-hook 'diary-hook 'appt-make-list) (diary 0) ;; Special function to make appointments work: (defun update-my-calendar () (let ((diary-buffer (get-file-buffer diary-file)) (number-of-diary-entries 30)) (if diary-buffer (progn (set-buffer diary-buffer) (revert-buffer t t))) (calendar))) ;; Enable syntax coloring. (global-font-lock-mode t) (setq-default transient-mark-mode t) ;; Global key maps: (global-set-key "\C-xU" 'browse-url-of-file) (global-set-key "\e`" 'search-forward-regexp) (global-set-key "\e/" 'replace-regexp) (global-set-key "\C-xtl" 'goto-line) (global-set-key "\e[" 'enlarge-window) (global-set-key "\e]" 'shrink-window) (global-set-key "\e=3D" 'eval-current-buffer) ;; These two key bindings are for up and down scrolling by a either single line at a time ;; or by N lines at a time (default is scroll by one single line at a time). This is ;; very useful when working with narrow horizontal windows. ;~) ;; To enter the desired N, hold down \C and type the number and then hit z or q, all the ;; while holding down \C. ;; From the "Writing GNU Emacs Extensions" book, by Bob Glickstein. (defun scroll-n-lines-up (&optional n) "Scroll up N lines (1 line by default)." (interactive "P") (scroll-up (prefix-numeric-value n))) (defun scroll-n-lines-down (&optional n) "Scroll down N lines (1 line by default)." (interactive "P") (scroll-down (prefix-numeric-value n))) (global-set-key "\C-q" 'scroll-n-lines-up) (global-set-key "\C-z" 'scroll-n-lines-down) ;; These two bindings make it easier to find a mismatched parenthesis: (global-set-key "\e'" 'forward-sexp) (global-set-key "\e;" 'backward-sexp) ;;; Bracket/brace/parentheses highlighting: ;; The following is the command for Emacs 20.1 and later: (show-paren-mode 1) ;; * Here is some Emacs Lisp that will make the % key show the matching ;; parenthesis, like in vi. In addition, if the cursor isn't over a ;; parenthesis, it simply inserts a % like normal. (`Parenthesis' actually ;; includes and character with `open' or `close' syntax, which usually means ;; "()[]{}".) ;; By an unknown contributor (global-set-key "%" 'match-paren) (defun match-paren (arg) "Go to the matching parenthesis if on parenthesis otherwise insert %." (interactive "p") (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) (t (self-insert-command (or arg 1))))) ;; The following functions enable on-the-fly switching between the bash shell and DOS: (defun set-shell-bash() (interactive) ;; (setq binary-process-input t) (setq shell-file-name "bash") (setq shell-command-switch "-c") (setq explicit-shell-file-name "bash") (setenv "SHELL" explicit-shell-file-name) (setq explicit-sh-args '("-login" "-i")) (setq w32-quote-process-args ?\") (setq mswindows-quote-process-args t) ) (defun set-shell-cmdproxy() (interactive) (setq shell-file-name "cmdproxy") (setq explicit-shell-file-name "cmdproxy") (setenv "SHELL" explicit-shell-file-name) (setq explicit-sh-args nil) (setq w32-quote-process-args nil) ) (global-set-key "\C-xg" 'set-shell-bash) ;; g for Gnu (\C-xb is used for buffer switch command). (global-set-key "\C-xd" 'set-shell-cmdproxy) ;; End shell-switch on-the-fly. ;; Begin move-to-window block: ;; This code is from the O'Reilly "GNU Emacs Extensions" book. ;; The purpose of it is to make a reasonable way to move to the next OR previous window. ;; Change from C-x o to C-x n, so that we have Next and Previous. (global-set-key "\C-xn" 'other-window) ;; We must make our own function to go to the previous window (but it's simple): (defun other-window-backward () "Select the previous window." (interactive) (other-window -1)) ;; Now we can bind to this function: (global-set-key "\C-xp" 'other-window-backward) ;; End move to window block. ;; This turns on the buffer select list in the minibuffer to make it easy to ;; edit any buffer in a given window or frame (C-r and C-s move backwards and forwards, respectively, ;; through the buffer select list). (require 'iswitchb) (iswitchb-default-keybindings) ;; old: (setq show-paren-mode t) ;; old: (setq show-paren-style 'parenthesis) ;; Set a high recursion limit for parsing the long java files: (setq max-specpdl-size 1000) (put 'upcase-region 'disabled nil) (put 'downcase-region 'disabled nil) ;; Adjust the colors and fonts to preference: (set-default-font "Fixedsys") (set-cursor-color "Deep Pink") (set-face-foreground 'highlight "blue") (set-face-background 'highlight "red") (set-foreground-color "Green") (set-background-color "Gray10") (set-face-foreground 'custom-group-tag-face "Yellow") (set-face-foreground 'custom-variable-tag-face "Magenta") (set-face-foreground 'custom-state-face "Yellow") (set-face-foreground 'font-lock-type-face "Goldenrod") (set-face-foreground 'font-lock-comment-face "OrangeRed") (set-face-foreground 'font-lock-function-name-face "Turquoise") (set-face-foreground 'font-lock-keyword-face "Yellow") (set-face-foreground 'font-lock-string-face "Magenta") (set-face-foreground 'font-lock-variable-name-face "Coral") (set-face-foreground 'modeline "yellow") (set-face-background 'modeline "purple4") (set-face-background 'region "MidnightBlue") (set-face-background 'secondary-selection "dodger blue") (set-face-foreground 'diary-face "Yellow") (set-face-background 'holiday-face "Pink") (set-face-foreground 'holiday-face "Red") (set-face-foreground 'widget-field-face "Sienna") (set-face-foreground 'widget-single-line-field-face "Firebrick") (set-face-foreground 'widget-inactive-face "White") (set-face-foreground 'widget-documentation-face "Coral") (set-mouse-color "yellow") ;; The following settings pertain to features that you may not have installed on your GNU Emacs: ;; Begin speedbar section (Values set via Emac's 'Customize' interface are found at the ;; bottom of the file, and hence if there is a 'conflict' they override these values). (set-face-foreground 'speedbar-directory-face "Green") (set-face-background 'speedbar-directory-face "Black") (set-face-foreground 'speedbar-highlight-face "DarkSlateGray") (set-face-background 'speedbar-highlight-face "Gold") (set-face-background 'speedbar-file-face "MidnightBlue") (set-face-foreground 'speedbar-file-face "Gold") (set-face-foreground 'speedbar-tag-face "Orange") ;; Set the speedbar pop-up window properties: Note that if the speedbar height is too ;; great, the windowing-system's title bar for the ;; speedbar window (at least on Windows2000) will not show completely. (setq speedbar-frame-parameters '((width . 30) (height . 45) (foreground-color . "green") (background-color . "black"))) ;; End speedbar section. ;; You may not want the following line if you do not have paren-matching running: (set-face-foreground 'show-paren-match-face "Red") ;; The following line is only if you have semantic installed: ;; doesn't work for semantic-1.4beta5 (set-face-foreground 'semantic-intangible-face "Gold") ;; The following line is only if you have the JDE installed: (set-face-foreground 'jde-java-font-lock-link-face "Gold") ;; --------- This is SGML colorizing with the psgml package, loaded above. ;;; Set up and enable syntax coloring. ; Create faces to assign markup categories. (make-face 'sgml-doctype-face) (make-face 'sgml-pi-face) (make-face 'sgml-comment-face) (make-face 'sgml-sgml-face) (make-face 'sgml-start-tag-face) (make-face 'sgml-end-tag-face) (make-face 'sgml-entity-face) (make-face 'sgml-attribute-face) ; Assign attributes to faces. (set-face-foreground 'sgml-doctype-face "yellow") (set-face-foreground 'sgml-sgml-face "cyan1") (set-face-foreground 'sgml-pi-face "magenta") (set-face-foreground 'sgml-comment-face "purple") (set-face-foreground 'sgml-start-tag-face "deep sky blue") (set-face-foreground 'sgml-end-tag-face "white") (set-face-foreground 'sgml-entity-face "orange") ; Assign faces to markup categories. (setq sgml-markup-faces '((doctype . sgml-doctype-face) (pi . sgml-pi-face) (comment . sgml-comment-face) (sgml . sgml-sgml-face) (comment . sgml-comment-face) (start-tag . sgml-start-tag-face) (end-tag . sgml-end-tag-face) (entity . sgml-entity-face))) ; PSGML - enable face settings (setq sgml-set-face t) ;; ---- End psgml highlighting section. ;; Gnus: using only for mail. (setq gnus-select-method '(nntp "news.statesoftware.com")) (add-hook 'nntp-server-opened-hook 'nntp-send-authinfo) ;; This checks to see if you've set the variable startup-directory and checks to ;; see if you've set it to a real directory. If so, it will switch there. (let ((working-directory (or startup-directory nil))) (if (and (and working-directory) (file-directory-p working-directory)) (cd working-directory))) ;; Make sure that tabs are being used (default behavior, but doesn't hurt in case something got changed): ;; (setq indent-tabs-mode t) ;; Make sure that no tab characters are used: (setq indent-tabs-mode nil) ;; Set the variable default-tab-width. (setq default-tab-width 4) ;; Define an easy way to move up in a dired directory, ;; To instantly view a file in the web browser (IE or whatever) (this needs a current directory argument to work better): ;; **NOTE: These bindings must be in a mode-hook, since dired isn't automatically ;; loaded on startup and so it's keymap is void until you go into dired. (add-hook `dired-mode-hook `(lambda () (define-key dired-mode-map "\C-w" 'dired-up-directory) (define-key dired-mode-map "\C-b" 'browse-url))) ;; ---------- BEGIN BUG WORKAROUNDS SECTION: ;; This prevents dired from displaying itself in warning-face when the ;; default-tab-width is set to 2. (defadvice dired-readin (around ecm-dired-indent activate) "Prevent indentation in dired from using tabs." (let ((indent-tabs-mode nil)) ad-do-it)) ;; ----- SMTP section: (load-library "smtpmail") (setq smtpmail-smtp-server "smtp.earthlink.net") (setq send-mail-function 'smtpmail-send-it) (setq smtpmail-smtp-service "smtp") (setq smtpmail-local-domain "LocalDomain") (setq smtpmail-debug-info t) ;(setq smtpmail-debug-info 'nil) ;; if no debug info needed (setq smtpmail-code-conv-from nil) ;; ---------- END BUG WORKAROUNDS SECTION: ;; This enables saving the current desktop on shutdown. The ESC-x desktop-save ;; command must be given once for this to work in perpetuity. (desktop-load-default) (desktop-read) ;; --------- ** My custom hand-entered additions end here. ** ;; --------- ** Begin Auto-written Emacs Customization Section ** ;; The following has been automatically written by the Emacs customization utility: (custom-set-variables ;; custom-set-variables was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(appt-message-warning-time 60) '(browse-url-browser-function (quote browse-url-default-windows-browser)) '(browse-url-generic-program "mozilla") '(calculator-number-digits 10) '(case-fold-search t) '(current-language-environment "Latin-1") '(default-input-method "latin-1-prefix") '(frame-background-mode nil) '(global-font-lock-mode t nil (font-lock)) '(jde-auto-parse-max-buffer-size 0) '(jde-bug-jdk-directory "c:/j2sdk1.4.0/") '(jde-bug-vm-includes-jpda-p t) '(jde-compile-option-verbose t) '(jde-db-debugger (quote ("JDEbug" "" . "Executable")) t) '(jde-db-source-directories (quote ("c:/Program Files/jakarta-tomcat-3.2.4/webapps/dynasurv/WEB-INF/classes/com/treelogic_s= we/frameworks/dynaquery" "c:/Program Files/jakarta-tomcat-3.2.4/webapps/dynasurv/WEB-INF/classes/com/treelogic_s= we/frameworks/dynaform" "c:/Program Files/jakarta-tomcat-3.2.4/webapps/dynasurv/WEB-INF/classes/com/treelogic_s= we/frameworks/dynafrontend"))) '(jde-debugger (quote ("JDEbug"))) '(jde-global-classpath (quote ("$CLASSPATH"))) '(jde-help-browser-function "browse-url") '(jde-help-docsets (quote (("JDK API" "$JAVA/Javadoc/j2sdk-1_4_2-doc/docs/api" nil) ("User (javadoc)" "$STRUTS/Javadoc/struts.apache.org/api" nil) ("User (javadoc)" "$J2EE_HOME/docs/api" nil)))) '(jde-javadoc-describe-field-template "\"* \" (jde-javadoc-field-type modifiers) \" \" (jde-javadoc-code name) \" .\"") '(jde-javadoc-describe-method-template "\"* The \" (jde-javadoc-code name) \" method .\"") '(jde-jdk-doc-url "$JAVA/Javadoc/j2sdk-1_4_2-doc/docs/api") '(jde-jdk-registry (quote (("1.4.2_05" . "$J2EE_HOME/jdk")))) '(jde-run-option-classpath (quote ("runner.jar;servlet.jar;org.apache.tomcat.shell.Startup"))) '(jde-run-option-verbose (quote (t nil nil))) '(jde-run-option-vm-args (quote ("-Xdebug -Xnoagent -Xrunjdwp:transport=3Ddt_socket,address=3D6001,server=3Dy,suspend=3Dn"))) '(jde-setnu-mode-threshold 200000) '(jde-sourcepath (quote ("$CATALINA_HOME/webapps" "$CATALINA_HOME/webapps/struts-hello_world" "$JAVA/lib"))) '(mail-host-address "") '(midnight-delay 34200) '(midnight-hook (quote (update-my-calendar))) '(midnight-mode t nil (midnight)) '(printer-name "USB001" t) '(show-paren-mode t nil (paren)) '(smtpmail-default-smtp-server "smtp.earthlink.net") '(speedbar-show-unknown-files t) '(speedbar-use-images t) '(transient-mark-mode t) '(uniquify-buffer-name-style nil nil (uniquify)) '(user-full-name "Christopher M. Balz") '(user-mail-address "cbalz@andrew.cmu.edu")) (custom-set-faces ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(speedbar-button-face ((t (:background "black" :foreground "deep sky blue")))) '(speedbar-file-face ((t (:background "black" :foreground "yellow1")))) '(speedbar-selected-face ((((class color) (background dark)) (:background "black" :foreground "red" :underline t)))) '(speedbar-tag-face ((t (:background "black" :foreground "Orange")))))