Commit a87c1daf authored by Stefan Monnier's avatar Stefan Monnier

* obsolete/bg-mouse.el, obsolete/float.el, obsolete/hilit19.el,

* obsolete/lselect.el, obsolete/mlsupport.el, obsolete/ooutline.el,
* obsolete/profile.el, obsolete/rsz-mini.el, obsolete/uncompress.el,
* obsolete/auto-show.el, obsolete/hscroll.el:
Remove packages that were obsolete in Emacs-20, or that were obsolete
in Emacs-21 and do not contain any more code.
parent 8d27bcdf
2008-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
* obsolete/bg-mouse.el, obsolete/float.el, obsolete/hilit19.el,
* obsolete/lselect.el, obsolete/mlsupport.el, obsolete/ooutline.el,
* obsolete/profile.el, obsolete/rsz-mini.el, obsolete/uncompress.el,
* obsolete/auto-show.el, obsolete/hscroll.el:
Remove packages that were obsolete in Emacs-20, or that were obsolete
in Emacs-21 and do not contain any more code.
* vc-dispatcher.el (vc-dir-menu-map-filter): Don't fail if
vc-client-mode is not set.
......
;;; auto-show.el --- perform automatic horizontal scrolling as point moves
;;; This file is in the public domain.
;; This file is part of GNU Emacs.
;; Keywords: scroll display convenience
;; Author: Pete Ware <ware@cis.ohio-state.edu>
;; Maintainer: FSF
;;; Commentary:
;; This file has been obsolete since Emacs 21.1.
;; This file contains dummy variables and functions only because Emacs
;; does hscrolling automatically, now.
;;; Code:
(defgroup auto-show nil
"This customization group is kept for compatibility only.
Emacs now does hscrolling automatically. Please remove references
to auto-show from your init file and code."
:group 'editing)
;;;###autoload
(defcustom auto-show-mode nil
"Obsolete."
:version "20.4"
:type 'boolean
:group 'auto-show)
(defcustom auto-show-shift-amount 8
"*Obsolete."
:type 'integer
:group 'auto-show)
(defcustom auto-show-show-left-margin-threshold 50
"*Obsolete."
:type 'integer
:group 'auto-show)
;;;###autoload
(defun auto-show-mode (arg)
"This command is obsolete."
(interactive "P"))
(defun auto-show-make-point-visible (&optional ignore-arg)
"This command is obsolete."
(interactive))
(provide 'auto-show)
;; arch-tag: 49587cbf-95cc-4061-b564-274aaec37469
;;; auto-show.el ends here
;;; bg-mouse.el --- GNU Emacs code for BBN Bitgraph mouse
;; Copyright (C) 2001, 2002, 2003, 2004, 2005,
;; 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: John Robinson <jr@bbn-unix.arpa>
;; Stephen Gildea <gildea@bbn.com>
;; Maintainer: FSF
;; Keywords: hardware
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This file has been obsolete since Emacs 22.1.
;;; Code:
;;; Original version by John Robinson (jr@bbn-unix.arpa, bbncca!jr), Oct 1985
;;; Modularized and enhanced by gildea@bbn.com Nov 1987
;;; Time stamp <89/03/21 14:27:08 gildea>
;;; User customization option:
(defvar bg-mouse-fast-select-window nil
"*Non-nil for mouse hits to select new window, then execute; else just select.")
;;; These numbers are summed to make the index into the mouse-map.
;;; The low three bits correspond to what the mouse actually sends.
(defconst bg-button-r 1)
(defconst bg-button-m 2)
(defconst bg-button-c 2)
(defconst bg-button-l 4)
(defconst bg-in-modeline 8)
(defconst bg-in-scrollbar 16)
(defconst bg-in-minibuf 24)
;;; semicolon screws up indenting, so use this instead
(defconst semicolon ?\;)
(defvar bg-mouse-x)
(defvar bg-mouse-y)
(defvar bg-cursor-window)
;; This variable does not exist since 1991, so it's a safe bet
;; this package is not really used anymore. Still...
(defvar mouse-map)
;;; Defuns:
(defun bg-mouse-report (prefix-arg)
"Read, parse, and execute a BBN BitGraph mouse click.
L-- move point | These apply for mouse click in a window.
--R set mark | If bg-mouse-fast-select-window is nil,
L-R kill region | these commands on a nonselected window
-C- move point and yank | just select that window.
LC- yank-pop |
-CR or LCR undo | \"Scroll bar\" is right-hand window column.
on modeline: on \"scroll bar\": in minibuffer:
L-- scroll-up line to top execute-extended-command
--R scroll-down line to bottom eval-expression
-C- proportional goto-char line to middle suspend-emacs
To reinitialize the mouse if the terminal is reset, type ESC : RET"
(interactive "P")
(bg-get-tty-num semicolon)
(let*
((screen-mouse-x (min (1- (frame-width)) ;don't hit column 86!
(/ (bg-get-tty-num semicolon) 9)))
(screen-mouse-y (- (1- (frame-height)) ;assume default font size.
(/ (bg-get-tty-num semicolon) 16)))
(bg-mouse-buttons (% (bg-get-tty-num ?c) 8))
(bg-mouse-window (bg-window-from-x-y screen-mouse-x screen-mouse-y))
(bg-cursor-window (selected-window))
(edges (window-edges bg-mouse-window))
(minibuf-p (= screen-mouse-y (1- (frame-height))))
(in-modeline-p (and (not minibuf-p)
(= screen-mouse-y (1- (nth 3 edges)))))
(in-scrollbar-p (and (not minibuf-p) (not in-modeline-p)
(>= screen-mouse-x (1- (nth 2 edges)))))
(same-window-p (eq bg-mouse-window bg-cursor-window))
(in-minibuf-p (and minibuf-p
(not bg-mouse-window))) ;minibuf must be inactive
(bg-mode-bits (+ (if in-minibuf-p bg-in-minibuf 0)
(if in-modeline-p bg-in-modeline 0)
(if in-scrollbar-p bg-in-scrollbar 0)))
(bg-command
(lookup-key mouse-map
(char-to-string (+ bg-mode-bits bg-mouse-buttons))))
(bg-mouse-x (- screen-mouse-x (nth 0 edges)))
(bg-mouse-y (- screen-mouse-y (nth 1 edges))))
(cond ((or in-modeline-p in-scrollbar-p)
(select-window bg-mouse-window)
(bg-command-execute bg-command)
(select-window bg-cursor-window))
((or same-window-p in-minibuf-p)
(bg-command-execute bg-command))
(t ;in another window
(select-window bg-mouse-window)
(if bg-mouse-fast-select-window
(bg-command-execute bg-command)))
)))
;;; Library of commands:
(defun bg-set-point ()
"Move point to location of BitGraph mouse."
(interactive)
(bg-move-point-to-x-y bg-mouse-x bg-mouse-y)
(setq this-command 'next-line) ;make subsequent line moves work
(setq temporary-goal-column bg-mouse-x))
(defun bg-set-mark ()
"Set mark at location of BitGraph mouse."
(interactive)
(push-mark)
(bg-move-point-to-x-y bg-mouse-x bg-mouse-y)
(exchange-point-and-mark))
(defun bg-yank ()
"Move point to location of BitGraph mouse and yank."
(interactive "*")
(bg-move-point-to-x-y bg-mouse-x bg-mouse-y)
(setq this-command 'yank)
(yank))
(defun yank-pop-1 ()
(interactive "*")
(yank-pop 1))
(defun bg-yank-or-pop ()
"Move point to location of BitGraph mouse and yank. If last command
was a yank, do a yank-pop."
(interactive "*")
(if (eq last-command 'yank)
(yank-pop 1)
(bg-yank)))
;;; In 18.51, Emacs Lisp doesn't provide most-positive-fixnum
(defconst bg-most-positive-fixnum 8388607)
(defun bg-move-by-percentage ()
"Go to location in buffer that is the same percentage of the way
through the buffer as the BitGraph mouse's X position in the window."
(interactive)
;; check carefully for overflow in intermediate calculations
(goto-char
(cond ((zerop bg-mouse-x)
0)
((< (buffer-size) (/ bg-most-positive-fixnum bg-mouse-x))
;; no danger of overflow: compute it exactly
(/ (* bg-mouse-x (buffer-size))
(1- (window-width))))
(t
;; overflow possible: approximate
(* (/ (buffer-size) (1- (window-width)))
bg-mouse-x))))
(beginning-of-line)
(what-cursor-position))
(defun bg-mouse-line-to-top ()
"Scroll the line pointed to by the BitGraph mouse to the top of the window."
(interactive)
(scroll-up bg-mouse-y))
(defun bg-mouse-line-to-center ()
"Scroll the line pointed to by the BitGraph mouse to the center
of the window"
(interactive)
(scroll-up (/ (+ 2 bg-mouse-y bg-mouse-y (- (window-height))) 2)))
(defun bg-mouse-line-to-bottom ()
"Scroll the line pointed to by the mouse to the bottom of the window."
(interactive)
(scroll-up (+ bg-mouse-y (- 2 (window-height)))))
(defun bg-kill-region ()
(interactive "*")
(kill-region (region-beginning) (region-end)))
(defun bg-insert-moused-sexp ()
"Insert a copy of the word (actually sexp) that the mouse is pointing at.
Sexp is inserted into the buffer at point (where the text cursor is)."
(interactive)
(let ((moused-text
(save-excursion
(bg-move-point-to-x-y bg-mouse-x bg-mouse-y)
(if (looking-at "\\s)")
(forward-char 1)
(forward-sexp 1))
(buffer-substring (save-excursion (backward-sexp 1) (point))
(point)))))
(select-window bg-cursor-window)
(delete-horizontal-space)
(cond
((bolp)
(indent-according-to-mode))
;; In Lisp assume double-quote is closing; in Text assume opening.
;; Why? Because it does the right thing most often.
((save-excursion (forward-char -1)
(and (not (looking-at "\\s\""))
(looking-at "[`'\"\\]\\|\\s(")))
nil)
(t
(insert " ")))
(insert moused-text)
(or (eolp)
(looking-at "\\s.\\|\\s)")
(and (looking-at "'") (looking-at "\\sw")) ;hack for text mode
(save-excursion (insert " ")))))
;;; Utility functions:
(defun bg-get-tty-num (term-char)
"Read from terminal until TERM-CHAR is read, and return intervening number.
If non-numeric not matching TERM-CHAR, reprogram the mouse and signal an error."
(let
((num 0)
(char (- (read-char) 48)))
(while (and (>= char 0)
(<= char 9))
(setq num (+ (* num 10) char))
(setq char (- (read-char) 48)))
(or (eq term-char (+ char 48))
(progn
(bg-program-mouse)
(error
"Invalid data format in bg-mouse command: mouse reinitialized.")))
num))
;;; Note that this fails in the minibuf because move-to-column doesn't
;;; allow for the width of the prompt.
(defun bg-move-point-to-x-y (x y)
"Position cursor in window coordinates.
X and Y are 0-based character positions in the window."
(move-to-window-line y)
;; if not on a wrapped line, zero-column will be 0
(let ((zero-column (current-column))
(scroll-offset (window-hscroll)))
;; scrolling takes up column 0 to display the $
(if (> scroll-offset 0)
(setq scroll-offset (1- scroll-offset)))
(move-to-column (+ zero-column scroll-offset x))
))
;;; Returns the window that screen position (x, y) is in or nil if none,
;;; meaning we are in the echo area with a non-active minibuffer.
(defun bg-window-from-x-y (x y)
"Find window corresponding to screen coordinates.
X and Y are 0-based character positions on the screen."
(get-window-with-predicate (lambda (w)
(coordinates-in-window-p (cons x y) w))))
(defun bg-command-execute (bg-command)
(if (commandp bg-command)
(command-execute bg-command)
(ding)))
(defun bg-program-mouse ()
(send-string-to-terminal "\e:0;7;;;360;512;9;16;9;16c"))
;;; Note that the doc string for mouse-map (as defined in subr.el)
;;; says it is for the X-window mouse. This is wrong; that keymap
;;; should be used for your mouse no matter what terminal you have.
(or (keymapp mouse-map)
(setq mouse-map (make-keymap)))
(defun bind-bg-mouse-click (click-code function)
"Bind bg-mouse CLICK-CODE to run FUNCTION."
(define-key mouse-map (char-to-string click-code) function))
(bind-bg-mouse-click bg-button-l 'bg-set-point)
(bind-bg-mouse-click bg-button-m 'bg-yank)
(bind-bg-mouse-click bg-button-r 'bg-set-mark)
(bind-bg-mouse-click (+ bg-button-l bg-button-m) 'yank-pop-1)
(bind-bg-mouse-click (+ bg-button-l bg-button-r) 'bg-kill-region)
(bind-bg-mouse-click (+ bg-button-m bg-button-r) 'undo)
(bind-bg-mouse-click (+ bg-button-l bg-button-m bg-button-r) 'undo)
(bind-bg-mouse-click (+ bg-in-modeline bg-button-l) 'scroll-up)
(bind-bg-mouse-click (+ bg-in-modeline bg-button-m) 'bg-move-by-percentage)
(bind-bg-mouse-click (+ bg-in-modeline bg-button-r) 'scroll-down)
(bind-bg-mouse-click (+ bg-in-scrollbar bg-button-l) 'bg-mouse-line-to-top)
(bind-bg-mouse-click (+ bg-in-scrollbar bg-button-m) 'bg-mouse-line-to-center)
(bind-bg-mouse-click (+ bg-in-scrollbar bg-button-r) 'bg-mouse-line-to-bottom)
(bind-bg-mouse-click (+ bg-in-minibuf bg-button-l) 'execute-extended-command)
(bind-bg-mouse-click (+ bg-in-minibuf bg-button-m) 'suspend-emacs)
(bind-bg-mouse-click (+ bg-in-minibuf bg-button-r) 'eval-expression)
(provide 'bg-mouse)
;; arch-tag: b3d06605-2971-44b1-be2c-e49c24e1a8d3
;;; bg-mouse.el ends here
;;; float.el --- obsolete floating point arithmetic package
;; Copyright (C) 1986, 2001, 2002, 2003, 2004, 2005,
;; 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Bill Rosenblatt
;; Maintainer: FSF
;; Keywords: extensions
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This file has been obsolete since Emacs 22.1.
;; Floating point numbers are represented by dot-pairs (mant . exp)
;; where mant is the 24-bit signed integral mantissa and exp is the
;; base 2 exponent.
;;
;; Emacs LISP supports a 24-bit signed integer data type, which has a
;; range of -(2**23) to +(2**23)-1, or -8388608 to 8388607 decimal.
;; This gives six significant decimal digit accuracy. Exponents can
;; be anything in the range -(2**23) to +(2**23)-1.
;;
;; User interface:
;; function f converts from integer to floating point
;; function string-to-float converts from string to floating point
;; function fint converts a floating point to integer (with truncation)
;; function float-to-string converts from floating point to string
;;
;; Caveats:
;; - Exponents outside of the range of +/-100 or so will cause certain
;; functions (especially conversion routines) to take forever.
;; - Very little checking is done for fixed point overflow/underflow.
;; - No checking is done for over/underflow of the exponent
;; (hardly necessary when exponent can be 2**23).
;;
;;
;; Bill Rosenblatt
;; June 20, 1986
;;
;;; Code:
;; fundamental implementation constants
(defconst exp-base 2
"Base of exponent in this floating point representation.")
(defconst mantissa-bits 24
"Number of significant bits in this floating point representation.")
(defconst decimal-digits 6
"Number of decimal digits expected to be accurate.")
(defconst expt-digits 2
"Maximum permitted digits in a scientific notation exponent.")
;; other constants
(defconst maxbit (1- mantissa-bits)
"Number of highest bit")
(defconst mantissa-maxval (1- (ash 1 maxbit))
"Maximum permissible value of mantissa")
(defconst mantissa-minval (ash 1 maxbit)
"Minimum permissible value of mantissa")
(defconst floating-point-regexp
"^[ \t]*\\(-?\\)\\([0-9]*\\)\
\\(\\.\\([0-9]*\\)\\|\\)\
\\(\\(\\([Ee]\\)\\(-?\\)\\([0-9][0-9]*\\)\\)\\|\\)[ \t]*$"
"Regular expression to match floating point numbers. Extract matches:
1 - minus sign
2 - integer part
4 - fractional part
8 - minus sign for power of ten
9 - power of ten
")
(defconst high-bit-mask (ash 1 maxbit)
"Masks all bits except the high-order (sign) bit.")
(defconst second-bit-mask (ash 1 (1- maxbit))
"Masks all bits except the highest-order magnitude bit")
;; various useful floating point constants
(defconst _f0 '(0 . 1))
(defconst _f1/2 '(4194304 . -23))
(defconst _f1 '(4194304 . -22))
(defconst _f10 '(5242880 . -19))
;; support for decimal conversion routines
(defvar powers-of-10 (make-vector (1+ decimal-digits) _f1))
(aset powers-of-10 1 _f10)
(aset powers-of-10 2 '(6553600 . -16))
(aset powers-of-10 3 '(8192000 . -13))
(aset powers-of-10 4 '(5120000 . -9))
(aset powers-of-10 5 '(6400000 . -6))
(aset powers-of-10 6 '(8000000 . -3))
(defconst all-decimal-digs-minval (aref powers-of-10 (1- decimal-digits)))
(defconst highest-power-of-10 (aref powers-of-10 decimal-digits))
(defun fashl (fnum) ; floating-point arithmetic shift left
(cons (ash (car fnum) 1) (1- (cdr fnum))))
(defun fashr (fnum) ; floating point arithmetic shift right
(cons (ash (car fnum) -1) (1+ (cdr fnum))))
(defun normalize (fnum)
(if (> (car fnum) 0) ; make sure next-to-highest bit is set
(while (zerop (logand (car fnum) second-bit-mask))
(setq fnum (fashl fnum)))
(if (< (car fnum) 0) ; make sure highest bit is set
(while (zerop (logand (car fnum) high-bit-mask))
(setq fnum (fashl fnum)))
(setq fnum _f0))) ; "standard 0"
fnum)
(defun abs (n) ; integer absolute value
(if (>= n 0) n (- n)))
(defun fabs (fnum) ; re-normalize after taking abs value
(normalize (cons (abs (car fnum)) (cdr fnum))))
(defun xor (a b) ; logical exclusive or
(and (or a b) (not (and a b))))
(defun same-sign (a b) ; two f-p numbers have same sign?
(not (xor (natnump (car a)) (natnump (car b)))))
(defun extract-match (str i) ; used after string-match
(condition-case ()
(substring str (match-beginning i) (match-end i))
(error "")))
;; support for the multiplication function
(defconst halfword-bits (/ mantissa-bits 2)) ; bits in a halfword
(defconst masklo (1- (ash 1 halfword-bits))) ; isolate the lower halfword
(defconst maskhi (lognot masklo)) ; isolate the upper halfword
(defconst round-limit (ash 1 (/ halfword-bits 2)))
(defun hihalf (n) ; return high halfword, shifted down
(ash (logand n maskhi) (- halfword-bits)))
(defun lohalf (n) ; return low halfword
(logand n masklo))
;; Visible functions
;; Arithmetic functions
(defun f+ (a1 a2)
"Returns the sum of two floating point numbers."
(let ((f1 (fmax a1 a2))
(f2 (fmin a1 a2)))
(if (same-sign a1 a2)
(setq f1 (fashr f1) ; shift right to avoid overflow
f2 (fashr f2)))
(normalize
(cons (+ (car f1) (ash (car f2) (- (cdr f2) (cdr f1))))
(cdr f1)))))
(defun f- (a1 &optional a2) ; unary or binary minus
"Returns the difference of two floating point numbers."
(if a2
(f+ a1 (f- a2))
(normalize (cons (- (car a1)) (cdr a1)))))
(defun f* (a1 a2) ; multiply in halfword chunks
"Returns the product of two floating point numbers."
(let* ((i1 (car (fabs a1)))
(i2 (car (fabs a2)))
(sign (not (same-sign a1 a2)))
(prodlo (+ (hihalf (* (lohalf i1) (lohalf i2)))
(lohalf (* (hihalf i1) (lohalf i2)))
(lohalf (* (lohalf i1) (hihalf i2)))))
(prodhi (+ (* (hihalf i1) (hihalf i2))
(hihalf (* (hihalf i1) (lohalf i2)))
(hihalf (* (lohalf i1) (hihalf i2)))
(hihalf prodlo))))
(if (> (lohalf prodlo) round-limit)
(setq prodhi (1+ prodhi))) ; round off truncated bits
(normalize
(cons (if sign (- prodhi) prodhi)
(+ (cdr (fabs a1)) (cdr (fabs a2)) mantissa-bits)))))
(defun f/ (a1 a2) ; SLOW subtract-and-shift algorithm
"Returns the quotient of two floating point numbers."
(if (zerop (car a2)) ; if divide by 0
(signal 'arith-error (list "attempt to divide by zero" a1 a2))
(let ((bits (1- maxbit))
(quotient 0)
(dividend (car (fabs a1)))
(divisor (car (fabs a2)))
(sign (not (same-sign a1 a2))))
(while (natnump bits)
(if (< (- dividend divisor) 0)
(setq quotient (ash quotient 1))
(setq quotient (1+ (ash quotient 1))
dividend (- dividend divisor)))
(setq dividend (ash dividend 1)
bits (1- bits)))
(normalize
(cons (if sign (- quotient) quotient)
(- (cdr (fabs a1)) (cdr (fabs a2)) (1- maxbit)))))))
(defun f% (a1 a2)
"Returns the remainder of first floating point number divided by second."
(f- a1 (f* (ftrunc (f/ a1 a2)) a2)))
;; Comparison functions
(defun f= (a1 a2)
"Returns t if two floating point numbers are equal, nil otherwise."
(equal a1 a2))
(defun f> (a1 a2)
"Returns t if first floating point number is greater than second,
nil otherwise."
(cond ((and (natnump (car a1)) (< (car a2) 0))
t) ; a1 nonnegative, a2 negative
((and (> (car a1) 0) (<= (car a2) 0))
t) ; a1 positive, a2 nonpositive
((and (<= (car a1) 0) (natnump (car a2)))
nil) ; a1 nonpos, a2 nonneg
((/= (cdr a1) (cdr a2)) ; same signs. exponents differ
(> (cdr a1) (cdr a2))) ; compare the mantissas.
(t
(> (car a1) (car a2))))) ; same exponents.
(defun f>= (a1 a2)
"Returns t if first floating point number is greater than or equal to
second, nil otherwise."
(or (f> a1 a2) (f= a1 a2)))
(defun f< (a1 a2)