bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18059: 24.3.92; defvar and special variables


From: Drew Adams
Subject: bug#18059: 24.3.92; defvar and special variables
Date: Wed, 21 Feb 2018 09:11:33 -0800 (PST)

> > (when (> emacs-major-version 24)
> >   (defvar foo 42 "The answer."))
> >
> > (when (fboundp 'fooness)
> >   (let ((the_answer  (fooness)))
> >     (defvar foo the_answer "The answer.")))
> 
> I meant real life examples.

Do these count?

(when (> emacs-major-version 24)
  (defvar bmkp-eww-history () "History for EWW bookmarks."))

(when (< emacs-major-version 23)
  (defvar bookmark-make-record-function 'bookmark-make-record-default
    "Function called with no arguments, to create a bookmark record.
...")

(when (or (featurep 'bookmark+-lit)
          (and (fboundp 'diredp-highlight-autofiles-mode)
               (featurep 'highlight)))
  (defvar bmkp-bmenu-highlight-menu (make-sparse-keymap "Highlight")
    "`Highlight' submenu for menu-bar `Bookmark+' menu.")
  ...)

(when (< emacs-major-version 21)
  (defvar custom-raised-buttons nil))

(when (fboundp 'dired-hide-details-mode) ; Emacs 24.4+
  (defvar diredp-hide-details-last-state
          diredp-hide-details-initially-flag
    "Last `dired-hide-details-mode' value. ...")

  (defvar diredp-hide-details-toggled nil
    "Non-nil means you have already ...")
  ...)

(when (fboundp 'epa-dired-do-encrypt)   ; Emacs 23+
  (defvar diredp-single-encryption-menu
          (make-sparse-keymap "Encryption")))

(when (require 'bookmark+ nil t)
  (defvar diredp-single-bookmarks-menu
          (make-sparse-keymap "Bookmark")))

(when (boundp 'Info-virtual-files)      ; Emacs 23.2+
  (defvar Info-indexed-file "*Indexed*"
    "Info file for virtual manual from ....")

  (defvar Info-indexed-nodes ()
    "Alist of cached nodes with matching index entries.))

(defun icicle-cmd2-after-load-hexrgb ()
  "..."
  (defvar icicle-named-colors () "Named colors.")
  ...)

;; The name changed during development of Emacs 23.
;; They aliased it for 23.1, but removed it for 23.2.
;; Use the new name and alias the old, but don't declare
;; old obsolete (let Emacs 23 do that.)
;;
(when (and (boundp 'minibuffer-local-must-match-filename-map)  
           (fboundp 'defvaralias)) ; Emacs 22
  (defvar minibuffer-local-filename-must-match-map
          minibuffer-local-must-match-filename-map
    "Local keymap for ....")
  (defvaralias 'minibuffer-local-must-match-filename-map
               'minibuffer-local-filename-must-match-map))

(eval-after-load "crm"
  '(progn
    ...
    (defvar icicle-ORIG-crm-local-completion-map
            crm-local-completion-map
      "Original CRM completion map.")
    ...))

(defun icicle-define-icicle-maps () "..."
  ...
  (unless icicle-menu-map
    ...
    (cond ((not icicle-touche-pas-aux-menus-flag)
           (defvar icicle-options-menu-map (make-sparse-keymap)
             "`Options' > `Icicles' submenu.")
           ...)
          (t
           (defvar icicle-options-menu-map (make-sparse-keymap)
             "`Icicles' > `Icicles Options' submenu.")
           ...))
    ...
    (defvar icicle-options-toggle-menu-map (make-sparse-keymap)
      "`Toggle' submenu of Icicles options menu.")
    ...
    (defvar icicle-options-choose-menu-map (make-sparse-keymap)
      "`Choose' submenu of Icicles options menu.")

    ... ; LOTS more
    ))

(when (> emacs-major-version 23)
  (defvar icicle-file-name-completion-table
    (completion-table-in-turn
      #'icicle-completion--embedded-envvar-table
      #'completion-file-name-table)
    "Completion table used for file-name completion."))

(when (require 'kmacro nil t) ; Emacs 22+
  (defvar icicle-kmacro-alist nil "Alist with elements ....")
  ...)

(when (and (fboundp 'read-char-by-name) ; Emacs 23-25
           (< emacs-major-version 26))
  (defvar icicle-read-char-history () "..."))

(when (require 'kmacro nil t); Emacs 22+
  (defvar icicle-saved-kmacro-ring-max kmacro-ring-max
    "Saved ...."))

(when (> emacs-major-version 23)        ; Emacs 24+
  (unless (boundp 'isearch-lax-whitespace) ; Emacs 24.1, 24.2.
    (defvar isearch-lax-whitespace t "...")
    (defvar isearch-regexp-lax-whitespace nil "..."))
    ...)
  ...)

(when (< emacs-major-version 24)
  (defvar isearch-face 'isearch "Face used to ...."))

(when (or (> emacs-major-version 24) ; Emacs 24.4+
          (and (= emacs-major-version 24)
               (> emacs-minor-version 3)))
  ...
  (defvar isearchp-lazy-regexp-level-overlays nil
    "Overlays used to ....")
  ...
  (defvar isearchp-filter-map nil "Keymap ....")
  ...
  (defvar isearchp-regexp-level-overlays nil
    "Overlays used to ....")

  (defvar isearchp-ffap-max-region-size 1024 ; See bug #25243.
    "Max size of active region used to ....")

  ... ; Plenty more
  )

(unless (boundp 'isearch-update-post-hook)
  (defvar isearch-update-post-hook () "Function(s) ...."))

(when (boundp 'isearch-lazy-highlight)  ; Emacs 22+
  (defvar isearchp-lazy-highlight-face 'lazy-highlight
    "Face ....")
  ...)

(when (or (featurep 'doremi-frm) (featurep 'doremi-cmd))
  (defvar menu-bar-doremi-menu (make-sparse-keymap "Do Re Mi"))
  ...)

(when (or (featurep 'frame-cmds) (featurep 'fit-frame))
  (defvar menu-bar-frames-menu (make-sparse-keymap "Frames"))
  ...)

(unless (< emacs-major-version 22)
  (defvar menu-bar-i-search-menu
    (make-sparse-keymap "Incremental Search"))
  ...)

(when (boundp 'pre-redisplay-function)  ; Emacs 24.4+
  ...
  (defvar mlw-pre-redisplay-selected-window nil
    "Window selected before redisplay.")
  ...
  (defvar mlw-orig-mode-line-buf-id
          (default-value 'mode-line-buffer-identification)
    "Original default value of ....")
  ...)

(when (featurep 'xemacs)
  ;; XEmacs which has no built-in minibuffer history truncation.
  (defvar history-length 100))

And plenty, plenty more.

Not to mention lots of vacuous defvars to quiet the byte-compiler:

(unless (> emacs-major-version 22)
  (defvar display-buffer-reuse-frames))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]