branch: externals/hyperbole commit 89104f0a20e2d2915b18a39d38c081cc877b5dae Author: Stefan Monnier <monn...@iro.umontreal.ca> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
Drop support for (X)Emacs-19 * hload-path.el (hyperb:emacs-p): Remove. When used as a boolean, equivalent to (not (featurep 'xemacs)), so replace all uses with it. (hyperb:kotl-p): Remove. Always non-nil, so replace with t. * hlvar.el (hack-local-variables): Assume emacs-version is not 19. * hmouse-sh.el (hmouse-get-bindings, hmouse-get-unshifted-bindings): Avoid unneeded use of `eval'. (hmouse-shifted-setup, hmouse-unshifted-setup): Remove dead code. * hyperbole.el (hkey-set-bindings): Use dolist. --- hibtypes.el | 7 +- hinit.el | 7 +- hload-path.el | 37 +------ hlvar.el | 34 +++---- hmouse-key.el | 30 +----- hmouse-sh.el | 297 +++++++++++++++++++++--------------------------------- hmouse-tag.el | 7 +- hsettings.el | 11 +- hui-em-but.el | 7 +- hui-menu.el | 51 +++++----- hui-mini.el | 84 ++++++++------- hui-select.el | 4 +- hui-window.el | 18 ++-- hui-xe-but.el | 7 +- hversion.el | 8 +- hypb.el | 18 +--- hyperbole.el | 36 ++----- hyrolo-menu.el | 8 +- hyrolo.el | 4 +- kotl/kmenu.el | 8 +- kotl/kotl-mode.el | 2 +- kotl/kproperty.el | 6 +- kotl/kview.el | 2 +- 23 files changed, 262 insertions(+), 431 deletions(-) diff --git a/hibtypes.el b/hibtypes.el index c908cc5..fbaaa22 100644 --- a/hibtypes.el +++ b/hibtypes.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 19-Sep-91 at 20:45:31 ;; -;; Copyright (C) 1991-2016 Free Software Foundation, Inc. +;; Copyright (C) 1991-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -604,7 +604,10 @@ Requires the Emacs builtin Tramp library for ftp file retrievals." ;;; Follows links to Hyperbole Koutliner cells. ;;; ======================================================================== -(if hyperb:kotl-p (require 'klink)) +;; FIXME: Not sure if it's important to avoid loading `klink' during +;; bytecompilation, but that was the behavior when the condition was more +;; complex, so I kept the `if' even though it's now trivial. +(if t (require 'klink)) ;;; ======================================================================== ;;; Jumps to source line associated with grep or compilation error messages. diff --git a/hinit.el b/hinit.el index dd3acd2..6f54d65 100644 --- a/hinit.el +++ b/hinit.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 1-Oct-91 at 02:32:51 ;; -;; Copyright (C) 1991-2016 Free Software Foundation, Inc. +;; Copyright (C) 1991-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -43,7 +43,8 @@ (interactive) (unless (featurep 'infodock) ;; Initialize now since Emacs startup has finished. - (if (and (or hyperb:emacs-p (and (boundp 'current-menubar) current-menubar)) + (if (and (or (not (featurep 'xemacs)) + (and (boundp 'current-menubar) current-menubar)) after-init-time) (hyperbole-menubar-menu) ;; Defer initialization until after Emacs startup. This really is needed. @@ -58,7 +59,7 @@ ;;;###autoload (defmacro hui-menu-remove (menu-sym &optional keymap) "Remove MENU-SYM menu from any menubars generated by optional KEYMAP or the global-map." - `(prog1 (cond (hyperb:emacs-p + `(prog1 (cond ((not (featurep 'xemacs)) (if (null ,keymap) (setq keymap global-map)) (define-key (or ,keymap global-map) [menu-bar ,menu-sym] nil)) ;; XEmacs diff --git a/hload-path.el b/hload-path.el index 8650d41..1f185ab 100644 --- a/hload-path.el +++ b/hload-path.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 29-Jun-16 at 14:39:33 ;; -;; Copyright (C) 1992-2016 Free Software Foundation, Inc. +;; Copyright (C) 1992-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -13,31 +13,6 @@ ;;; Code: ;;; ************************************************************************ -;;; Public variables -;;; ************************************************************************ - -;;; Support mouse handling and Koutlines under GNU Emacs V19 or higher. -;;; -;;;###autoload -(defconst hyperb:emacs-p - (and (not (featurep 'xemacs)) - ;; Version 19 and above, the only ones supported. - (string-lessp "19" emacs-version) - emacs-version) - "Version string under GNU Emacs 19 or higher, or nil") - -;;; Koutlines work only with specific versions of Emacs and XEmacs. -;;;###autoload -(defconst hyperb:kotl-p - (if (featurep 'xemacs) - ;; Only works for XEmacs 19.9 and above. - (or (string-match "^19\\.9 \\|^19\\.[1-9][0-9]" emacs-version) - ;; Version 20 and above. - (string-lessp "20" emacs-version)) - hyperb:emacs-p) - "Non-nil iff this Emacs version supports the Hyperbole Koutliner.") - -;;; ************************************************************************ ;;; Hyperbole Directory Setting (dynamically computed) ;;; ************************************************************************ @@ -69,12 +44,10 @@ It must end with a directory separator character.") ;; If the Koutliner is supported by this emacs version, perform ;; initializations. -(if hyperb:kotl-p - (progn (add-to-list 'load-path (expand-file-name "kotl/" hyperb:dir)) - ;; Invoke kotl-mode for files ending in ".kotl". Also - ;; allow ".kot" for DOS and Windows users. - (setq auto-mode-alist (cons '("\\.kotl$\\|\\.kot$" . kotl-mode) - auto-mode-alist)))) +(add-to-list 'load-path (expand-file-name "kotl/" hyperb:dir)) +;; Invoke kotl-mode for files ending in ".kotl". Also +;; allow ".kot" for DOS and Windows users. +(add-to-list 'auto-mode-alist '("\\.kotl?\\'" . kotl-mode)) (provide 'hload-path) diff --git a/hlvar.el b/hlvar.el index a6d2eed..809519a 100644 --- a/hlvar.el +++ b/hlvar.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 4-Nov-91 at 00:26:06 ;; -;; Copyright (C) 1995-2016 Free Software Foundation, Inc. +;; Copyright (C) 1995-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -30,6 +30,8 @@ ;;; ************************************************************************ (defun hack-local-variables (&optional force) + ;; FIXME: *Major* compatibility problem! Have you submitted a feature + ;; request via `report-emacs-bug'? --Stef "Parse, and bind or evaluate as appropriate, any local variables for current buffer." (if (fboundp 'hack-local-variables-prop-line) @@ -39,28 +41,20 @@ for current buffer." (goto-char (point-max)) (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move) (let (local-start) - (if (let ((case-fold-search t) - (ignore nil)) + (if (let ((case-fold-search t)) (and (search-forward "Local Variables:" nil t) (setq local-start (match-beginning 0)) - (or (and (not (string-match "^19\\." emacs-version)) - (not (inhibit-local-variables-p))) + (or (not (inhibit-local-variables-p)) force - (if (string-match "^19\\." emacs-version) - (cond ((eq enable-local-variables t) t) - ((eq enable-local-variables nil) - (setq ignore t)))) - (if ignore - nil - (save-window-excursion - (switch-to-buffer (current-buffer)) - (save-excursion - (beginning-of-line) - (set-window-start (selected-window) (point))) - (y-or-n-p - (format "Set local variables as specified at end of %s? " - (file-name-nondirectory - buffer-file-name)))))))) + (save-window-excursion + (switch-to-buffer (current-buffer)) + (save-excursion + (beginning-of-line) + (set-window-start (selected-window) (point))) + (y-or-n-p + (format "Set local variables as specified at end of %s? " + (file-name-nondirectory + buffer-file-name))))))) (let ((continue t) prefix prefixlen suffix beg (enable-local-eval diff --git a/hmouse-key.el b/hmouse-key.el index 48a4ccc..81e0fd8 100644 --- a/hmouse-key.el +++ b/hmouse-key.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 30-May-94 at 00:11:57 ;; -;; Copyright (C) 1994-2016 Free Software Foundation, Inc. +;; Copyright (C) 1994-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -29,18 +29,6 @@ (eval-and-compile (mapc #'require '(hsettings hmouse-drv hmouse-sh))) ;;; ************************************************************************ -;;; Public variables -;;; ************************************************************************ - -(unless (or (featurep 'xemacs) hyperb:emacs-p) - ;; XEmacs and Emacs pre-load their mouse libraries, so - ;; we shouldn't have to require them here. - (eval (cdr (assoc (hyperb:window-system) - '(("xterm" . (require 'x-mouse)) ; X - ("next" . (load "eterm-fns" t)) ; NEXTSTEP - ))))) - -;;; ************************************************************************ ;;; Public functions ;;; ************************************************************************ @@ -70,24 +58,10 @@ bindings after Smart Key setup." (noninteractive) ;; ;; GNU Emacs, XEmacs or InfoDock - ((or (featurep 'xemacs) hyperb:emacs-p) + (t (mapcar (lambda (key-and-binding) (global-set-key (car key-and-binding) (cdr key-and-binding))) - key-binding-list)) - ;; - ;; X - ((equal (hyperb:window-system) "xterm") - (mapcar - (lambda (key-and-binding) - (define-key mouse-map (car key-and-binding) (cdr key-and-binding))) - key-binding-list)) - ;; - ;; NeXT - ((equal (hyperb:window-system) "next") - (mapcar - (lambda (key-and-binding) - (global-set-mouse (car key-and-binding) (cdr key-and-binding))) key-binding-list)))) (defun hmouse-install (&optional arg) diff --git a/hmouse-sh.el b/hmouse-sh.el index 64fceee..ac3cfc6 100644 --- a/hmouse-sh.el +++ b/hmouse-sh.el @@ -257,164 +257,124 @@ Use nil as CMD value to unbind the key. Works under GNU Emacs only." )))) (defun hmouse-get-bindings (hmouse-middle-flag) - "Returns the list of current bindings of mouse keys used by Hyperbole. + "Return the list of current bindings of mouse keys used by Hyperbole. If HMOUSE-MIDDLE-FLAG is non-nil, includes the middle mouse key binding as well. These may be the bindings prior to initializing Hyperbole or the Hyperbole bindings." ;; Do nothing when running in batch mode. (unless noninteractive (nconc (if hmouse-middle-flag (hmouse-get-unshifted-bindings)) - (eval - (cdr (assoc - ;; Get mouse bindings under Emacs or XEmacs, even if not under a - ;; window system since they can have frames on ttys and windowed - ;; displays at the same time. - (or (and (featurep 'xemacs) "xemacs") - (and hyperb:emacs-p "emacs") - (hyperb:window-system)) - '(("emacs" . - (mapcar (lambda (key) (cons key (global-key-binding key))) - (if (eq window-system 'dps) - ;; NEXTSTEP offers only 2 shift-mouse buttons which we use - ;; as the Smart Keys. - '([S-down-mouse-1] [S-drag-mouse-1] [S-mouse-1] - [S-down-mouse-2] [S-drag-mouse-2] [S-mouse-2] - [S-double-mouse-1] [S-triple-mouse-1] - [S-double-mouse-2] [S-triple-mouse-2] - [header-line S-down-mouse-1] [header-line S-drag-mouse-1] - [header-line S-mouse-1] - [header-line S-down-mouse-2] [header-line S-drag-mouse-2] - [header-line S-mouse-2] - [left-fringe S-down-mouse-1] [left-fringe S-drag-mouse-1] - [left-fringe S-mouse-1] - [left-fringe S-down-mouse-2] [left-fringe S-drag-mouse-2] - [left-fringe S-mouse-2] - [right-fringe S-down-mouse-1] [right-fringe S-drag-mouse-1] - [right-fringe S-mouse-1] - [right-fringe S-down-mouse-2] [right-fringe S-drag-mouse-2] - [right-fringe S-mouse-2] - [vertical-line S-down-mouse-1] [vertical-line S-drag-mouse-1] - [vertical-line S-mouse-1] - [vertical-line S-down-mouse-2] [vertical-line S-drag-mouse-2] - [vertical-line S-mouse-2] - [mode-line S-down-mouse-1] [mode-line S-drag-mouse-1] - [mode-line S-mouse-1] - [mode-line S-down-mouse-2] [mode-line S-drag-mouse-2] - [mode-line S-mouse-2] - ) - ;; X, macOS or MS Windows - '([S-down-mouse-2] [S-drag-mouse-2] [S-mouse-2] - [S-down-mouse-3] [S-drag-mouse-3] [S-mouse-3] - [S-double-mouse-2] [S-triple-mouse-2] - [S-double-mouse-3] [S-triple-mouse-3] - [header-line S-down-mouse-2] [header-line S-drag-mouse-2] - [header-line S-mouse-2] - [header-line S-down-mouse-3] [header-line S-drag-mouse-3] - [header-line S-mouse-3] - [left-fringe S-down-mouse-2] [left-fringe S-drag-mouse-2] - [left-fringe S-mouse-2] - [left-fringe S-down-mouse-3] [left-fringe S-drag-mouse-3] - [left-fringe S-mouse-3] - [right-fringe S-down-mouse-2] [right-fringe S-drag-mouse-2] - [right-fringe S-mouse-2] - [right-fringe S-down-mouse-3] [right-fringe S-drag-mouse-3] - [right-fringe S-mouse-3] - [vertical-line S-down-mouse-2] [vertical-line S-drag-mouse-2] - [vertical-line S-mouse-2] - [vertical-line S-down-mouse-3] [vertical-line S-drag-mouse-3] - [vertical-line S-mouse-3] - [mode-line S-down-mouse-2] [mode-line S-drag-mouse-2] - [mode-line S-mouse-2] - [mode-line S-down-mouse-3] [mode-line S-drag-mouse-3] - [mode-line S-mouse-3] - )))) - ("xemacs" . - (nconc - (mapcar (lambda (key) - (cons key (global-key-binding key))) - '([(shift button2)] [(shift button2up)] - [(shift button3)] [(shift button3up)])) - (if (boundp 'mode-line-map) - (mapcar (lambda (key) - (cons key (lookup-key mode-line-map key))) - '([(shift button3)] [(shift button3up)]))))) - ("xterm" . - (mapcar (lambda (key) (cons key (lookup-key mouse-map key))) - (list x-button-s-middle x-button-s-middle-up - x-button-s-right x-button-s-right-up))) - ("next" . - (mapcar (lambda (key) - (cons key (mousemap-get - (mouse-list-to-mouse-code key) - current-global-mousemap))) - (apply 'nconc - (mapcar (lambda (region) - (mapcar (function - (lambda (key) - (cons region key))) - '((shift left) (shift up left) - (shift right) (shift up right) - ))) - '(text scrollbar modeline minibuffer))) - ))))))))) + ;; Get mouse bindings under Emacs or XEmacs, even if not under a + ;; window system since they can have frames on ttys and windowed + ;; displays at the same time. + (if (not (featurep 'xemacs)) + (mapcar (lambda (key) (cons key (global-key-binding key))) + (if (eq window-system 'dps) + ;; NEXTSTEP offers only 2 shift-mouse buttons which we use + ;; as the Smart Keys. + '([S-down-mouse-1] [S-drag-mouse-1] [S-mouse-1] + [S-down-mouse-2] [S-drag-mouse-2] [S-mouse-2] + [S-double-mouse-1] [S-triple-mouse-1] + [S-double-mouse-2] [S-triple-mouse-2] + [header-line S-down-mouse-1] [header-line S-drag-mouse-1] + [header-line S-mouse-1] + [header-line S-down-mouse-2] [header-line S-drag-mouse-2] + [header-line S-mouse-2] + [left-fringe S-down-mouse-1] [left-fringe S-drag-mouse-1] + [left-fringe S-mouse-1] + [left-fringe S-down-mouse-2] [left-fringe S-drag-mouse-2] + [left-fringe S-mouse-2] + [right-fringe S-down-mouse-1] [right-fringe S-drag-mouse-1] + [right-fringe S-mouse-1] + [right-fringe S-down-mouse-2] [right-fringe S-drag-mouse-2] + [right-fringe S-mouse-2] + [vertical-line S-down-mouse-1] [vertical-line S-drag-mouse-1] + [vertical-line S-mouse-1] + [vertical-line S-down-mouse-2] [vertical-line S-drag-mouse-2] + [vertical-line S-mouse-2] + [mode-line S-down-mouse-1] [mode-line S-drag-mouse-1] + [mode-line S-mouse-1] + [mode-line S-down-mouse-2] [mode-line S-drag-mouse-2] + [mode-line S-mouse-2] + ) + ;; X, macOS or MS Windows + '([S-down-mouse-2] [S-drag-mouse-2] [S-mouse-2] + [S-down-mouse-3] [S-drag-mouse-3] [S-mouse-3] + [S-double-mouse-2] [S-triple-mouse-2] + [S-double-mouse-3] [S-triple-mouse-3] + [header-line S-down-mouse-2] [header-line S-drag-mouse-2] + [header-line S-mouse-2] + [header-line S-down-mouse-3] [header-line S-drag-mouse-3] + [header-line S-mouse-3] + [left-fringe S-down-mouse-2] [left-fringe S-drag-mouse-2] + [left-fringe S-mouse-2] + [left-fringe S-down-mouse-3] [left-fringe S-drag-mouse-3] + [left-fringe S-mouse-3] + [right-fringe S-down-mouse-2] [right-fringe S-drag-mouse-2] + [right-fringe S-mouse-2] + [right-fringe S-down-mouse-3] [right-fringe S-drag-mouse-3] + [right-fringe S-mouse-3] + [vertical-line S-down-mouse-2] [vertical-line S-drag-mouse-2] + [vertical-line S-mouse-2] + [vertical-line S-down-mouse-3] [vertical-line S-drag-mouse-3] + [vertical-line S-mouse-3] + [mode-line S-down-mouse-2] [mode-line S-drag-mouse-2] + [mode-line S-mouse-2] + [mode-line S-down-mouse-3] [mode-line S-drag-mouse-3] + [mode-line S-mouse-3] + ))) + (nconc + (mapcar (lambda (key) + (cons key (global-key-binding key))) + '([(shift button2)] [(shift button2up)] + [(shift button3)] [(shift button3up)])) + (if (boundp 'mode-line-map) + (mapcar (lambda (key) + (cons key (lookup-key mode-line-map key))) + '([(shift button3)] [(shift button3up)])))))))) (defun hmouse-get-unshifted-bindings () - "Returns the list of middle mouse key bindings prior to their use as Smart Keys." + "Return the list of middle mouse key bindings prior to their use as Smart Keys." ;; Do nothing when running in batch mode. - (eval - (cdr (assoc - ;; Get mouse bindings under Emacs or XEmacs, even if not under a - ;; window system since they can have frames on ttys and windowed - ;; displays at the same time. - (or (and (featurep 'xemacs) "xemacs") - (and hyperb:emacs-p "emacs") - (hyperb:window-system)) - '(("emacs" . - (mapcar (lambda (key) (cons key (global-key-binding key))) - (if (not (eq window-system 'dps)) - ;; X, macOS or MS Windows - '([down-mouse-2] [drag-mouse-2] [mouse-2] - [down-mouse-3] [drag-mouse-3] [mouse-3] - [double-mouse-2] [triple-mouse-2] - [double-mouse-3] [triple-mouse-3] - [header-line down-mouse-2] [header-line drag-mouse-2] - [header-line mouse-2] - [left-fringe down-mouse-2] [left-fringe drag-mouse-2] - [left-fringe mouse-2] - [right-fringe down-mouse-2] [right-fringe drag-mouse-2] - [right-fringe mouse-2] - [vertical-line down-mouse-2] [vertical-line drag-mouse-2] - [vertical-line mouse-2] - [left-fringe down-mouse-3] [left-fringe drag-mouse-3] - [left-fringe mouse-3] - [right-fringe down-mouse-3] [right-fringe drag-mouse-3] - [right-fringe mouse-3] - [vertical-line down-mouse-3] [vertical-line drag-mouse-3] - [vertical-line mouse-3] - [mode-line down-mouse-2] [mode-line drag-mouse-2] - [mode-line mouse-2] - [mode-line down-mouse-3] [mode-line drag-mouse-3] - [mode-line mouse-3] - )))) - ("xemacs" . - (nconc - (mapcar (lambda (key) - (cons key (global-key-binding key))) - '([button2] [button2up] - [button3] [button3up] - )) - (if (boundp 'mode-line-map) - (mapcar (function - (lambda (key) - (cons key (lookup-key mode-line-map key)))) - '([button3] [button3up]))) - )) - ("xterm" . - (mapcar (lambda (key) (cons key (lookup-key mouse-map key))) - (list x-button-middle x-button-middle-up - x-button-right x-button-right-up - ))) - ))))) + (if (not (featurep 'xemacs)) + (mapcar (lambda (key) (cons key (global-key-binding key))) + (if (not (eq window-system 'dps)) + ;; X, macOS or MS Windows + '([down-mouse-2] [drag-mouse-2] [mouse-2] + [down-mouse-3] [drag-mouse-3] [mouse-3] + [double-mouse-2] [triple-mouse-2] + [double-mouse-3] [triple-mouse-3] + [header-line down-mouse-2] [header-line drag-mouse-2] + [header-line mouse-2] + [left-fringe down-mouse-2] [left-fringe drag-mouse-2] + [left-fringe mouse-2] + [right-fringe down-mouse-2] [right-fringe drag-mouse-2] + [right-fringe mouse-2] + [vertical-line down-mouse-2] [vertical-line drag-mouse-2] + [vertical-line mouse-2] + [left-fringe down-mouse-3] [left-fringe drag-mouse-3] + [left-fringe mouse-3] + [right-fringe down-mouse-3] [right-fringe drag-mouse-3] + [right-fringe mouse-3] + [vertical-line down-mouse-3] [vertical-line drag-mouse-3] + [vertical-line mouse-3] + [mode-line down-mouse-2] [mode-line drag-mouse-2] + [mode-line mouse-2] + [mode-line down-mouse-3] [mode-line drag-mouse-3] + [mode-line mouse-3] + ))) + (nconc + (mapcar (lambda (key) + (cons key (global-key-binding key))) + '([button2] [button2up] + [button3] [button3up] + )) + (if (boundp 'mode-line-map) + (mapcar (function + (lambda (key) + (cons key (lookup-key mode-line-map key)))) + '([button3] [button3up]))) + ))) ;; Based on a function from Emacs mouse.el. (defun hmouse-posn-set-point (position) @@ -499,7 +459,7 @@ point determined by `mouse-select-region-move-to-beginning'." ;; (cond ;; GNU Emacs - (hyperb:emacs-p + ((not (featurep 'xemacs)) (setq hmouse-set-point-command 'hmouse-move-point-emacs) (if (eq window-system 'dps) ;; NEXTSTEP offers only 2 shift-mouse buttons which we use as the Smart Keys. @@ -527,30 +487,7 @@ point determined by `mouse-select-region-move-to-beginning'." 'assist-mouse-key) )) (global-set-key '(shift button3) 'assist-key-depress) - (global-set-key '(shift button3up) 'assist-mouse-key))) - ;; - ;; X - ((equal (hyperb:window-system) "xterm") - (setq hmouse-set-point-command 'x-mouse-set-point) - (define-key mouse-map x-button-s-middle 'action-key-depress) - (define-key mouse-map x-button-s-middle-up 'action-mouse-key) - (define-key mouse-map x-button-s-right 'assist-key-depress) - (define-key mouse-map x-button-s-right-up 'assist-mouse-key) - ) - ;; - ;; NeXT - ((equal (hyperb:window-system) "next") - (setq hmouse-set-point-command 'hmouse-move-point-eterm) - ;; NEXTSTEP offers only 2 shift-mouse buttons which we use as the Smart Keys. - (mapc - (lambda (region) - (global-set-mouse (cons region '(shift left)) 'action-key-depress) - (global-set-mouse (cons region '(shift up left)) 'action-mouse-key) - (global-set-mouse (cons region '(shift right)) 'assist-key-depress) - (global-set-mouse (cons region '(shift up right)) 'assist-mouse-key) - ) - '(text scrollbar modeline minibuffer)) - )) + (global-set-key '(shift button3up) 'assist-mouse-key)))) (setq hmouse-bindings (hmouse-get-bindings hmouse-middle-flag) hmouse-bindings-flag t))) @@ -559,7 +496,7 @@ point determined by `mouse-select-region-move-to-beginning'." With optional MIDDLE-KEY-ONLY-FLAG non-nil, binds only the middle mouse key." (interactive) (cond ;; GNU Emacs - (hyperb:emacs-p + ((not (featurep 'xemacs)) ;; Unbind Emacs push-button mouse keys since Hyperbole handles them. (define-key button-map [mouse-2] nil) (define-key button-map [mode-line mouse-2] nil) @@ -608,15 +545,7 @@ With optional MIDDLE-KEY-ONLY-FLAG non-nil, binds only the middle mouse key." (define-key mode-line-map 'button3 'assist-key-depress) (define-key mode-line-map 'button3up 'assist-mouse-key)) (global-set-key 'button3 'assist-key-depress) - (global-set-key 'button3up 'assist-mouse-key))) - ;; - ;; X - ((equal (hyperb:window-system) "xterm") - (define-key mouse-map x-button-middle 'action-key-depress) - (define-key mouse-map x-button-middle-up 'action-mouse-key) - (unless middle-key-only-flag - (define-key mouse-map x-button-right 'assist-key-depress) - (define-key mouse-map x-button-right-up 'assist-mouse-key))))) + (global-set-key 'button3up 'assist-mouse-key))))) (provide 'hmouse-sh) diff --git a/hmouse-tag.el b/hmouse-tag.el index 5ab5e57..f818236 100644 --- a/hmouse-tag.el +++ b/hmouse-tag.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 24-Aug-91 ;; -;; Copyright (C) 1991-2016 Free Software Foundation, Inc. +;; Copyright (C) 1991-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -20,13 +20,12 @@ (mapc #'require '(find-func hpath hui-select)) (cond ((or (featurep 'etags) (featurep 'tags)) nil) - ((or (featurep 'xemacs) hyperb:emacs-p) + (t ;; Force use of .elc file here since otherwise the bin/etags ;; executable might be found in a user's load-path by the load ;; command. (or (load "etags.elc" t nil t) - (load "tags-fix" t))) - ((load "tags" t)))) + (load "tags-fix" t))))) ;; If etags utilizes the new xref.el library, define some helper ;; functions to simplify programming. diff --git a/hsettings.el b/hsettings.el index 4200046..cd886b4 100644 --- a/hsettings.el +++ b/hsettings.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 15-Apr-91 at 00:48:49 ;; -;; Copyright (C) 1991-2016 Free Software Foundation, Inc. +;; Copyright (C) 1991-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -191,7 +191,7 @@ obtained search string." ;; No-op unless set by one of the conditionals below. (defun hui:but-flash ()) -(cond ((and hyperb:emacs-p (not noninteractive)) +(cond ((and (not (featurep 'xemacs)) (not noninteractive)) (require 'hui-em-but) ;; Highlight explicit buttons whenever a file is read in. (add-hook 'find-file-hook #'hproperty:but-create t) @@ -216,11 +216,8 @@ obtained search string." ((and (featurep 'xemacs) (not noninteractive)) (require 'hui-xe-but) ;; - ;; If running XEmacs 19.8 or below, don't highlight explicit buttons - ;; whenever a file is read in since this can cause a sporadic crash - ;; when find-files are done. - (if hyperb:kotl-p (add-hook 'find-file-hook #'hproperty:but-create t)) - (defalias 'hui:but-flash 'hproperty:but-flash) + (add-hook 'find-file-hook #'hproperty:but-create t) + (defalias 'hui:but-flash #'hproperty:but-flash) ;; ;; Substitute for the nil argument below a valid X color name with ;; which to highlight buttons if the default highlighting does not diff --git a/hui-em-but.el b/hui-em-but.el index 6ccf25c..8d463d9 100644 --- a/hui-em-but.el +++ b/hui-em-but.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 21-Aug-92 ;; -;; Copyright (C) 1992-2016 Free Software Foundation, Inc. +;; Copyright (C) 1992-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -16,8 +16,9 @@ ;;; Code: -(unless (and hyperb:emacs-p (not noninteractive)) - (error "(hui-em-but.el): Load only when running GNU Emacs interactively.")) +(when (or (featurep 'xemacs) noninteractive) + ;; FIXME: Loading a file should always be harmless! + (error "(hui-em-but.el): Load only when running GNU Emacs interactively")) ;;; ************************************************************************ ;;; Other required Elisp libraries diff --git a/hui-menu.el b/hui-menu.el index bf179b4..d0f163e 100644 --- a/hui-menu.el +++ b/hui-menu.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 28-Oct-94 at 10:59:44 ;; -;; Copyright (C) 1994-2016 Free Software Foundation, Inc. +;; Copyright (C) 1994-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -186,7 +186,7 @@ Return t if cutoff, else nil." ;; setting. Invoking this item should then make it ;; visible. (hyperb:init-menubar)) - ((cond (hyperb:emacs-p + ((cond ((not (featurep 'xemacs)) (global-key-binding [menu-bar Hyperbole])) ((boundp 'current-menubar) (car (find-menu-item current-menubar '("Hyperbole"))))) @@ -198,7 +198,7 @@ Return t if cutoff, else nil." :selected (cond ((boundp 'menubar-configuration) (memq 'Hyperbole menubar-configuration)) - (hyperb:emacs-p + ((not (featurep 'xemacs)) (and (global-key-binding [menu-bar Hyperbole]) t)) ((boundp 'current-menubar) (car (find-menu-item current-menubar '("Hyperbole")))))] @@ -415,29 +415,28 @@ REBUILD-FLAG is non-nil, in which case the menu is rebuilt." ["Help" hui:hbut-help t] ["Types" (hui:htype-help 'ibtypes 'no-sort) t] ) - (if hyperb:kotl-p - '("Koutliner" - ["Manual" (id-info "(hyperbole)Koutliner") t] - ["Example" kotl-mode:example t] - "----" - ["Create-File" kfile:find t] - ["View-File" kfile:view t] - "----" - ["Collapse-Tree" (progn (kotl-mode:is-p) - (kotl-mode:hide-tree - (kcell-view:label))) - (eq major-mode 'kotl-mode)] - ["Create-Link" klink:create - (eq major-mode 'kotl-mode)] - ["Expand-All-Trees" kotl-mode:show-all - (eq major-mode 'kotl-mode)] - ["Expand-Tree" (progn (kotl-mode:is-p) - (kotl-mode:show-tree - (kcell-view:label))) - (eq major-mode 'kotl-mode)] - ["Show-Top-Level-Only" kotl-mode:hide-body - (eq major-mode 'kotl-mode)] - )) + '("Koutliner" + ["Manual" (id-info "(hyperbole)Koutliner") t] + ["Example" kotl-mode:example t] + "----" + ["Create-File" kfile:find t] + ["View-File" kfile:view t] + "----" + ["Collapse-Tree" (progn (kotl-mode:is-p) + (kotl-mode:hide-tree + (kcell-view:label))) + (eq major-mode 'kotl-mode)] + ["Create-Link" klink:create + (eq major-mode 'kotl-mode)] + ["Expand-All-Trees" kotl-mode:show-all + (eq major-mode 'kotl-mode)] + ["Expand-Tree" (progn (kotl-mode:is-p) + (kotl-mode:show-tree + (kcell-view:label))) + (eq major-mode 'kotl-mode)] + ["Show-Top-Level-Only" kotl-mode:hide-body + (eq major-mode 'kotl-mode)] + ) '("Mail-Lists" ["Manual" (id-info "(hyperbole)Suggestion or Bug Reporting") t] diff --git a/hui-mini.el b/hui-mini.el index fb6734e..dfa3693 100644 --- a/hui-mini.el +++ b/hui-mini.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 15-Oct-91 at 20:13:17 ;; -;; Copyright (C) 1991-2016 Free Software Foundation, Inc. +;; Copyright (C) 1991-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -149,7 +149,7 @@ With optional HELP-STRING-FLAG, instead returns the one line help string for the "Uses CHAR-STR or last input character as minibuffer argument." (interactive) (let ((input (or char-str (aref (recent-keys) (1- (length (recent-keys))))))) - (cond (hyperb:emacs-p + (cond ((not (featurep 'xemacs)) (and (not (integerp input)) (eventp input) (setq input (event-basic-type input)))) @@ -210,7 +210,7 @@ MENU defaults to 'hyperbole and MENU-LIST to `hui:menus'. See `hui:menus' definition for the format of the menu list structure." (mapcar (lambda (entry) - (or (consp entry) + (or (consp entry) (error "(hui:menu-xemacs): Invalid menu entry: %s" entry)) (let ((label (car entry)) (content (car (cdr entry)))) @@ -429,9 +429,8 @@ constructs. If not given, the top-level Hyperbole menu is used." "Jumps back to location prior to last Hyperbole button follow.") '("Ibut/" (menu . ibut) "Implicit button and button type commands.") - (if hyperb:kotl-p - '("Kotl/" (menu . otl) - "Autonumbered outlining and hyperlink capabilities.")) + '("Kotl/" (menu . otl) + "Autonumbered outlining and hyperlink capabilities.") '("Msg/" (menu . msg) "Mail and News messaging capabilities.") '("Rolo/" (menu . hyrolo) @@ -447,7 +446,7 @@ constructs. If not given, the top-level Hyperbole menu is used." "Edits directory-specific button file.") ("Info" (id-info "(hyperbole)Button Files") - "Displays manual section on button files.") + "Displays manual section on button files.") ("PersonalFile" (find-file (expand-file-name hbmap:filename hbmap:dir-user)) "Edits user-specific button file.") @@ -491,7 +490,7 @@ constructs. If not given, the top-level Hyperbole menu is used." ("MarkThing" (hui:bind-key #'hui-select-thing)) ;; {C-c RET} ("SmartHelp" (hui:bind-key #'hkey-help)) ;; {C-h A} ("WinControl" (hui:bind-key #'hycontrol-enable-windows-mode)) ;; {C-c \} - )) + )) '(cust-referents . (("Ref Display>") ("Any-Frame" (setq hpath:display-where 'other-frame)) @@ -590,17 +589,17 @@ constructs. If not given, the top-level Hyperbole menu is used." )) '(gbut . (("GButton>") - ("Act" gbut:act "Activates global button by name.") + ("Act" gbut:act "Activates global button by name.") ("Create" hui:gbut-create "Adds a global button to gbut:file.") ("Edit" hui:gbut-modify "Modifies global button attributes.") - ("Help" gbut:help "Reports on a global button by name.") + ("Help" gbut:help "Reports on a global button by name.") ("Info" (id-info "(hyperbole)Global Buttons") "Displays manual section on global buttons.") ("Modify" hui:gbut-modify "Modifies global button attributes.") )) '(ibut . (("IButton>") - ("Act" hui:hbut-current-act "Activates implicit button at point.") + ("Act" hui:hbut-current-act "Activates implicit button at point.") ("DeleteIButType" (hui:htype-delete 'ibtypes) "Deletes specified button type.") ("Help" hui:hbut-help "Reports on button's attributes.") @@ -634,37 +633,36 @@ constructs. If not given, the top-level Hyperbole menu is used." "Just send the message; subject and body are ignored.") "Unsubscribe from the Hyperbole bug reporting list.") )) - (if hyperb:kotl-p - '(otl - . (("Kotl>") - ("All" kotl-mode:show-all "Expand all collapsed cells.") - ("Blanks" kvspec:toggle-blank-lines - "Toggle blank lines between cells on or off.") - ("Create" kfile:find "Create or edit an outline file.") - ("Downto" kotl-mode:hide-sublevels - "Hide all cells in outline deeper than a particular level.") - ("Examp" kotl-mode:example - "Display a self-descriptive example outline file.") - ("Hide" (progn (kotl-mode:is-p) - (kotl-mode:hide-tree (kcell-view:label))) - "Collapse tree rooted at point.") - ("Info" - (id-info "(hyperbole)Koutliner") - "Display manual section on Hyperbole Koutliner.") - ("Kill" kotl-mode:kill-tree - "Kill ARG following trees starting from point.") - ("Link" klink:create - "Create and insert an implicit link at point.") - ("Overvw" kotl-mode:overview - "Show first line of each cell.") - ("Show" (progn (kotl-mode:is-p) - (kotl-mode:show-tree (kcell-view:label))) - "Expand tree rooted at point.") - ("Top" kotl-mode:top-cells - "Hide all but top-level cells.") - ("Vspec" kvspec:activate - "Prompt for and activate a view specifiction.") - ))) + '(otl + . (("Kotl>") + ("All" kotl-mode:show-all "Expand all collapsed cells.") + ("Blanks" kvspec:toggle-blank-lines + "Toggle blank lines between cells on or off.") + ("Create" kfile:find "Create or edit an outline file.") + ("Downto" kotl-mode:hide-sublevels + "Hide all cells in outline deeper than a particular level.") + ("Examp" kotl-mode:example + "Display a self-descriptive example outline file.") + ("Hide" (progn (kotl-mode:is-p) + (kotl-mode:hide-tree (kcell-view:label))) + "Collapse tree rooted at point.") + ("Info" + (id-info "(hyperbole)Koutliner") + "Display manual section on Hyperbole Koutliner.") + ("Kill" kotl-mode:kill-tree + "Kill ARG following trees starting from point.") + ("Link" klink:create + "Create and insert an implicit link at point.") + ("Overvw" kotl-mode:overview + "Show first line of each cell.") + ("Show" (progn (kotl-mode:is-p) + (kotl-mode:show-tree (kcell-view:label))) + "Expand tree rooted at point.") + ("Top" kotl-mode:top-cells + "Hide all but top-level cells.") + ("Vspec" kvspec:activate + "Prompt for and activate a view specifiction.") + )) '(hyrolo . (("Rolo>") ("Add" hyrolo-add "Add a new rolo entry.") @@ -715,7 +713,7 @@ constructs. If not given, the top-level Hyperbole menu is used." (hui:menu-web-search) )))) -;; Always rebuild the Hyperbole minibuffer menu when this file is loaded. +;; Always rebuild the Hyperbole minibuffer menu when this file is loaded. (hyperbole-minibuffer-menu) (provide 'hui-mini) diff --git a/hui-select.el b/hui-select.el index 6474acf..596bb25 100644 --- a/hui-select.el +++ b/hui-select.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 19-Oct-96 at 02:25:27 ;; -;; Copyright (C) 1996-2016 Free Software Foundation, Inc. +;; Copyright (C) 1996-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -247,7 +247,7 @@ Also, add language-specific syntax setups to aid in thing selection." (unless (boundp 'hyperbole-loading) (require 'hyperbole)) (if hkey-init - (cond (hyperb:emacs-p + (cond ((not (featurep 'xemacs)) (transient-mark-mode 1) (hkey-global-set-key [double-down-mouse-1] nil) (hkey-global-set-key [double-mouse-1] 'hui-select-thing-with-mouse) diff --git a/hui-window.el b/hui-window.el index 1d3cbf4..d58e602 100644 --- a/hui-window.el +++ b/hui-window.el @@ -145,10 +145,10 @@ drag release window.") :group 'hyperbole-keys) ;; Mats Lidell says this should be 10 characters for GNU Emacs. -(defvar hmouse-edge-sensitivity (if hyperb:emacs-p 10 3) +(defvar hmouse-edge-sensitivity (if (featurep 'xemacs) 3 10) "*Number of characters from window edges within which a click is considered at an edge.") -(defvar hmouse-side-sensitivity (if hyperb:emacs-p 5 1) +(defvar hmouse-side-sensitivity (if (featurep 'xemacs) 1 5) "*Characters in either direction from window side within which a click is considered on the side.") (defvar hmouse-x-drag-sensitivity 5 @@ -263,8 +263,7 @@ appropriate Smart Menu for the context at point. (Smart Menus are a part of InfoDock and not a part of Hyperbole)." (interactive) (if (and (fboundp 'smart-menu) - (or (null window-system) - (not (or hyperb:emacs-p (featurep 'xemacs))))) + (null window-system)) (smart-menu) (let ((wind (get-buffer-window "*Buffer List*")) owind) @@ -283,8 +282,7 @@ appropriate Smart Menu for the context at point. (Smart Menus are a part of InfoDock and not a part of Hyperbole)." (interactive) (if (and (fboundp 'smart-menu) - (or (null window-system) - (not (or hyperb:emacs-p (featurep 'xemacs))))) + (null window-system)) (smart-menu) (let ((wind (get-buffer-window "*Ibuffer*")) owind) @@ -688,7 +686,7 @@ Beeps and prints message if the window cannot be split further." (defun smart-coords-in-window-p (coords window) "Tests if COORDS are in WINDOW. Returns WINDOW if they are, nil otherwise." (cond ((null coords) nil) - ((and hyperb:emacs-p (eventp coords)) + ((and (not (featurep 'xemacs)) (eventp coords)) (let ((w-or-f (posn-window (event-start coords)))) (if (framep w-or-f) (setq w-or-f (frame-selected-window w-or-f))) (eq w-or-f window))) @@ -713,7 +711,7 @@ Beeps and prints message if the window cannot be split further." Ignores minibuffer window." (cond ((markerp coords) (marker-position coords)) - ((and hyperb:emacs-p (eventp coords)) + ((and (not (featurep 'xemacs)) (eventp coords)) (posn-point (event-start coords))) ((and (featurep 'xemacs) (eventp coords)) (event-point coords)))) @@ -723,7 +721,7 @@ Ignores minibuffer window." Ignores minibuffer window." (cond ((markerp coords) (get-buffer-window (marker-buffer coords))) - ((and hyperb:emacs-p (eventp coords)) + ((and (not (featurep 'xemacs)) (eventp coords)) (let ((w-or-f (posn-window (event-start coords)))) (if (framep w-or-f) (setq w-or-f (frame-selected-window w-or-f))) w-or-f)) @@ -1003,7 +1001,7 @@ If free variable `assist-flag' is non-nil, uses Assist Key." (defun hmouse-emacs-at-modeline-buffer-id-p () "GNU Emacs: Return t if mouse position is within the buffer name field of the current window's mode-line, else nil." - (when hyperb:emacs-p + (unless (featurep 'xemacs) (let* ((coords (hmouse-window-coordinates)) ;; in characters (x-coord (caadr coords)) (mode-line-string (and (integerp x-coord) (>= x-coord 0) (format-mode-line mode-line-format))) diff --git a/hui-xe-but.el b/hui-xe-but.el index 7e216ac..4ce0a77 100644 --- a/hui-xe-but.el +++ b/hui-xe-but.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 21-Aug-92 ;; -;; Copyright (C) 1992-2016 Free Software Foundation, Inc. +;; Copyright (C) 1992-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -27,11 +27,6 @@ (require 'custom) ;; For defface. (require 'hbut) -;;; XEmacs 19.12 renamed x-color-display-p to x-display-color-p. -(if (and (fboundp 'x-color-display-p) - (not (fboundp 'x-display-color-p))) - (defalias 'x-display-color-p 'x-color-display-p)) - (defun hproperty:background () "Returns default background color for selected frame." (face-background (get-face 'default))) diff --git a/hversion.el b/hversion.el index d9dc4d2..1d42648 100644 --- a/hversion.el +++ b/hversion.el @@ -5,7 +5,7 @@ ;; ;; Orig-Date: 1-Jan-94 ;; -;; Copyright (C) 1994-2016 Free Software Foundation, Inc. +;; Copyright (C) 1994-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -33,7 +33,7 @@ ;;;###autoload (defvar hyperb:mouse-buttons (if (or (and hyperb:microcruft-os-p (not (memq window-system '(w32 w64 x)))) - (and hyperb:emacs-p (memq window-system '(ns dps)))) + (and (not (featurep 'xemacs)) (memq window-system '(ns dps)))) 2 3) "Number of live buttons available on the mouse. Override this if the system-computed default is incorrect for your specific mouse.") @@ -127,9 +127,7 @@ Where a part in the term-type is delimited by a `-' or an `_'." ;; then there is a window system to support. (display-mouse-p)) ;; X11, macOS, NEXTSTEP (DPS), or OS/2 Presentation Manager (PM) - (cond (hyperb:emacs-p "emacs") - ((featurep 'xemacs) "xemacs") - (t "xterm"))) + (if (featurep 'xemacs) "xemacs" "emacs")) ((or (featurep 'eterm-fns) (equal (getenv "TERM") "NeXT") (equal (getenv "TERM") "eterm")) diff --git a/hypb.el b/hypb.el index 0076de6..a584a3f 100644 --- a/hypb.el +++ b/hypb.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 6-Oct-91 at 03:42:38 ;; -;; Copyright (C) 1991-2016 Free Software Foundation, Inc. +;; Copyright (C) 1991-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -453,15 +453,7 @@ then `locate-post-command-hook'." current-prefix-arg)) (locate search-string filter arg)) -(if (or (featurep 'xemacs) hyperb:emacs-p) - (defalias 'hypb:mark 'mark) - (defun hypb:mark (inactive-p) - "Return this buffer's mark value as integer, or nil if no mark. -INACTIVE-P non-nil means return value of mark even if region is not active -under Emacs version 19. -If you are using this in an editing command, you are most likely making -a mistake; see the documentation of `set-mark'." - (mark))) +(defalias 'hypb:mark #'mark) (if (featurep 'xemacs) (defalias 'hypb:mark-marker 'mark-marker) @@ -678,7 +670,7 @@ nor nil it means to not count the minibuffer window even if it is active." (defvar hypb:hyperbole-banner-keymap (let ((map (make-sparse-keymap))) - (cond (hyperb:emacs-p + (cond ((not (featurep 'xemacs)) (define-key map [mouse-1] 'hypb:browse-home-page) (define-key map [mouse-2] 'hypb:browse-home-page) (define-key map "\C-m" 'hypb:browse-home-page)) @@ -696,7 +688,7 @@ Without file, the banner is prepended to the current buffer." (if file ;; A stub for this function is defined in hversion.el when not running in InfoDock. (id-browse-file file)) - (if hyperb:emacs-p + (if (not (featurep 'xemacs)) (hypb:display-file-with-logo-emacs file) (hypb:display-file-with-logo-xemacs file)) (goto-char (point-min)) @@ -814,7 +806,7 @@ Without file, the banner is prepended to the current buffer." ;;; Private variables ;;; ************************************************************************ -(if hyperb:emacs-p (define-button-type 'hyperbole-banner)) +(if (not (featurep 'xemacs)) (define-button-type 'hyperbole-banner)) (provide 'hypb) diff --git a/hyperbole.el b/hyperbole.el index d8b4fbb..74a7831 100644 --- a/hyperbole.el +++ b/hyperbole.el @@ -109,7 +109,7 @@ features (delq 'hversion features))) ;; Defines hyperb:path-being-loaded, hyperb:stack-frame, - ;; (hyperb:window-system), hyperb:dir and hyperb:kotl-p, which are used later in + ;; (hyperb:window-system), and hyperb:dir, which are used later in ;; this file. Also adds Hyperbole to the load-path if need be. ;; ;; This handles the case when the Hyperbole package directory is not yet in load-path. @@ -147,11 +147,9 @@ disables/inhibits support." (message "Hyperbole messaging button support is %s" (if inhibit-hyperbole-messaging "disabled" "enabled")))) -;; This must come after "hversion" is loaded for hyperb:kotl-p definition. -(if hyperb:kotl-p - (defgroup hyperbole-koutliner nil - "Hyperbole multi-level autonumbered outliner customizations." - :group 'hyperbole)) +(defgroup hyperbole-koutliner nil + "Hyperbole multi-level autonumbered outliner customizations." + :group 'hyperbole) ;;; ************************************************************************ ;;; Other required Elisp libraries @@ -323,32 +321,12 @@ which prevents automatic removal of any local bindings to the same key." (hkey-global-set-key key command))) (defun hkey-set-bindings (key-binding-list) - "Sets keys bound by Hyperbole to those in KEY-BINDING-LIST. + "Set keys bound by Hyperbole to those in KEY-BINDING-LIST. KEY-BINDING-LIST is the value of either `hkey-previous-bindings' \(key bindings prior to Hyperbole load) or `hkey-bindings' (Hyperbole bindings after load)." - (cond - ;; - ;; GNU Emacs, XEmacs or InfoDock - ((or (featurep 'xemacs) hyperb:emacs-p) - (mapcar - (lambda (key-and-binding) - (global-set-key (cadr key-and-binding) (car (cddr key-and-binding)))) - key-binding-list)) - ;; - ;; X - ((equal (hyperb:window-system) "xterm") - (mapcar - (lambda (key-and-binding) - (define-key mouse-map (cadr key-and-binding) (car (cddr key-and-binding)))) - key-binding-list)) - ;; - ;; NeXT - ((equal (hyperb:window-system) "next") - (mapcar - (lambda (key-and-binding) - (global-set-mouse (cadr key-and-binding) (car (cddr key-and-binding)))) - key-binding-list)))) + (dolist (key-and-binding key-binding-list) + (global-set-key (cadr key-and-binding) (car (cddr key-and-binding))))) (defun hyperbole-toggle-bindings () "Toggles between Hyperbole mouse and keyboard keys and their prior bindings." diff --git a/hyrolo-menu.el b/hyrolo-menu.el index 0b59a1e..72b1fac 100644 --- a/hyrolo-menu.el +++ b/hyrolo-menu.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 28-Oct-94 at 10:59:44 ;; -;; Copyright (C) 1994-2016 Free Software Foundation, Inc. +;; Copyright (C) 1994-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -119,10 +119,10 @@ (setq mode-popup-menu id-popup-hyrolo-menu)) ((featurep 'xemacs) (define-key hyrolo-mode-map 'button3 'hyrolo-popup-menu)) - (t ;; hyperb:emacs-p + (t ;; (not (featurep 'xemacs)) (define-key hyrolo-mode-map [down-mouse-3] 'hyrolo-popup-menu) (define-key hyrolo-mode-map [mouse-3] nil))) - (unless (cond (hyperb:emacs-p + (unless (cond ((not (featurep 'xemacs)) (global-key-binding [menu-bar Rolo])) ((boundp 'current-menubar) (car (find-menu-item current-menubar '("Rolo"))))) @@ -142,7 +142,7 @@ ;; InfoDock under a window system (require 'id-menubars) (id-menubar-set 'hyrolo-mode 'id-menubar-hyrolo)) - ((or hyperb:emacs-p (featurep 'xemacs)) + (t ;; Emacs or XEmacs under a window system (add-hook 'hyrolo-mode-hook #'hyrolo-menubar-menu))) diff --git a/hyrolo.el b/hyrolo.el index 00e3f39..b5fbb92 100644 --- a/hyrolo.el +++ b/hyrolo.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 7-Jun-89 at 22:08:29 ;; -;; Copyright (C) 1991-2016 Free Software Foundation, Inc. +;; Copyright (C) 1991-2017 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -112,7 +112,7 @@ A hyrolo-file consists of: :group 'hyperbole-rolo) (unless hyrolo-highlight-face (setq hyrolo-highlight-face - (cond (hyperb:emacs-p + (cond ((not (featurep 'xemacs)) (if (fboundp 'defface) (defface hyrolo-highlight-face nil "*Face used to highlight rolo search matches." diff --git a/kotl/kmenu.el b/kotl/kmenu.el index 180ac00..c1d6c33 100644 --- a/kotl/kmenu.el +++ b/kotl/kmenu.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 28-Mar-94 at 11:22:09 ;; -;; Copyright (C) 1994-2016 Free Software Foundation, Inc. +;; Copyright (C) 1994-2017 Free Software Foundation, Inc. ;; See the "../HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -195,10 +195,10 @@ (setq mode-popup-menu id-popup-kotl-menu)) ((featurep 'xemacs) (define-key kotl-mode-map 'button3 'kotl-popup-menu)) - (t ;; hyperb:emacs-p + (t ;; (not (featurep 'xemacs)) (define-key kotl-mode-map [down-mouse-3] 'kotl-popup-menu) (define-key kotl-mode-map [mouse-3] nil))) - (unless (cond (hyperb:emacs-p + (unless (cond ((not (featurep 'xemacs)) (global-key-binding [menu-bar Koutline])) ((boundp 'current-menubar) (car (find-menu-item current-menubar '("Koutline"))))) @@ -218,7 +218,7 @@ ;; InfoDock under a window system (require 'id-menubars) (id-menubar-set 'kotl-mode 'id-menubar-kotl)) - ((or hyperb:emacs-p (featurep 'xemacs)) + (t ;; Emacs or XEmacs under a window system (add-hook 'kotl-mode-hook #'kotl-menubar-menu))) diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el index 7f1b766..6426bcd 100644 --- a/kotl/kotl-mode.el +++ b/kotl/kotl-mode.el @@ -219,7 +219,7 @@ Direction is determined from the value of `delete-key-deletes-forward' or whether the Backspace key exists on the keyboard. If there is no Backspace key, the delete key should always delete backward one character." (interactive "*p") - (if hyperb:emacs-p + (if (not (featurep 'xemacs)) (kotl-mode:delete-char (if normal-erase-is-backspace arg (- arg)) nil) ;; XEmacs (kotl-mode:delete-char (if (delete-forward-p) arg (- arg)) nil))) diff --git a/kotl/kproperty.el b/kotl/kproperty.el index 4ae6463..9b1e0e5 100644 --- a/kotl/kproperty.el +++ b/kotl/kproperty.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 7/27/93 ;; -;; Copyright (C) 1993-2016 Free Software Foundation, Inc. +;; Copyright (C) 1993-2017 Free Software Foundation, Inc. ;; See the "../HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -19,7 +19,9 @@ ;; Ensures kotl/ is in load-path. (require 'hyperbole) -(load (if hyperb:emacs-p "kprop-em" "kprop-xe")) +;; FIXME: Loading an Elisp file should always be harmless, so Emacs should be +;; able to load *both* files and still work right! +(load (if (not (featurep 'xemacs)) "kprop-em" "kprop-xe")) (provide 'kproperty) diff --git a/kotl/kview.el b/kotl/kview.el index d5e7164..3c108b5 100644 --- a/kotl/kview.el +++ b/kotl/kview.el @@ -673,7 +673,7 @@ the lines displayed, since it has hidden branches." (save-excursion (and (kcell-view:next nil label-sep-len) (kcell-view:invisible-p (point) label-sep-len)))) -(cond (hyperb:emacs-p +(cond ((not (featurep 'xemacs)) (defun kview:goto-cell-id (id-string) "Move point to start of cell with idstamp ID-STRING and return t, else nil." (let ((cell-id (string-to-number id-string))