[comp.emacs] summary of X stuff that I promised...

gaynor@topaz.rutgers.edu (Silver) (01/14/88)

It's summary time, like I promised.  Not much of a turn out, I'm
afraid.  Anyway, here it is, starting with the simple stuff and not
getting much more complicated.

I discovered AFTER posting that I should have been typing "man
gnuemacs" instead of "man emacs".  For those of you who don't know
what X options are available, I provide a list below.  They're pretty
self-explanatory.  [Thanks to fad@think.com for prying open my
stubborn eyes...]

This is straight from the man page.

Flags               .Xdefaults

-font <font-name>   BodyFont     <font-name>
-r     		    ReverseVideo (on|off)
-i		    BitMapIcon   on -> use kitchen-sink icon
-b <pixels>	    BorderWidth  <pixels>
-ib <pixels>        (InternalBorderWidth <pixels> ?)
-fg		    Foreground   (color - see /usr/lib/rgb.txt)
-bg		    Background   (color)
-bd		    Border       (color)
-cr		    Cursor       (color)
-ms		    Mouse        (color)
-d <display-name>
-w =<window-geometry>

Default Mouse Bindings

left		      set mark
middle		      set cursor
right		      select (Emacs) window
SHIFT-middle	      put text into X cut buffer (cut text)
SHIFT-right	      paste text
CTRL-middle	      cut text and kill	it
CTRL-right	      select this window, then split it	into
		      two windows
CTRL-SHIFT-left	      X	buffer menu--hold the buttons and keys
		      down, wait for menu to appear, select
		      buffer, and release.  Move mouse out of
		      menu and release to cancel.
CTRL-SHIFT-middle     X help menu--pop up index	card menu for
		      Emacs help.
CTRL-SHIFT-right      Select window with mouse,	and delete all
		      other windows.  Same as typing
		      CTRL-x 1.

Also, look at .../lisp/term/x-win.el to check out bunches of variables
and functions that are defined.

----------

jr@bbn.com informs me that he spends most of his time typing at his
emacs.  I sympathise...  :-)  But now we can spend time clicking, and
resizing, and iconifying, and moveopaque'ing, and, well, *everything*!

----------

Emacs was written by Richard Stallman and the Free
Software Foundation.  Joachim Martillo and Robert
Krawitz added the X features. 

I *like* emacs.  Thanks.

----------

Here's some fun code...  I ran it once, then let it lie.  When he says
Warning, it's a sure thing.  Thanks, Steve.

;;
;; Stupid waste of time trying to find a use for x-popup-menu..
;;
;; Use: (find-elisp-file) or M-x find-file-using-menu or something..
;;
;; Steven Grady
;; grady@postgres.berkeley.edu
;; ...!ucbvax!grady
;;

(defun find-elisp-file ()
  "Find some elisp file.  Warning - Slow!"
  (interactive)
  (find-file-using-menu "/usr/new/lib/emacs/lisp" ".el$"))

(defun find-file-using-menu (directory &optional match)
  "Find file from DIRECTORY, with optional MATCH regexp."
  (interactive "DFrom directory? 
sRegexp match? ")
  (let ((menu (make-file-menu directory match)))
    (message "Creating menu...")
    (setq choice (car (x-popup-menu '(20 20) menu)))
    (if choice
	(find-file (expand-file-name choice directory)))))

(defun make-file-menu (directory &optional match)
  (let
      ((files (directory-files directory nil match))
       (split-files)
       (one-list)
       (pane)
       (menu '("Files")))
    (setq split-files (split-big-list files 10))
    (while (not (null split-files))
      (setq one-list (car split-files))
      (setq pane (list (make-pane-name one-list)))
      (while (not (null one-list))
	(setq pane (append pane (list (list (car one-list) (car one-list)))))
	(setq one-list (cdr one-list)))
      (setq split-files (cdr split-files))
      (setq menu (append menu (list pane))))
    menu))

(defun make-pane-name (l)
  (concat (car l) "..."))

(defun split-big-list (l n)
  (cond
   ((null l) l)
   (t (let
       ((i 0)
	(s nil))
       (while (< i n)
	 (setq i (+ 1 i))
	 (setq s (append s (list (car l))))
	 (setq l (cdr l))
	 (if (null l) (setq i (+ n 1))))
       (append (list s) (split-big-list l n))))))

----------

And that's all I could muster.

Thanks for your responses,
[Ag]

LOOKING FOR ENTRY-LEVELISH C/LISP PROGRAMMING, SOFTWARE ENGINEERING
Andy Gaynor   201-545-0458   81 Hassart St, New Brunswick, NJ 08901
  gaynor@topaz.rutgers.edu   ...!rutgers!topaz.rutgers.edu!gaynor
     "There is no Editor but Emacs, and Lisp is its Prophet."