
(defconst gmhist-version "$Id: gmhist.el,v 4.19 1991/09/20 13:20:58 sk RelBeta $")

(provide (quote gmhist))

(defvar gmhist-emacs-19-p (equal (substring emacs-version 0 2) "19"))

(defvar gmhist-default-format "[%s] " "\
Format used by gmhist to indicate the presence of a default value.
Set this to \"(default %s) \" to get the standard format.")

(defvar gmhist-search-history nil "\
History of history searches.")

(defun read-with-history-in (GMHIST-SYMBOL rwhi-prompt &optional GMHIST-INITIAL GMHIST-READ) "\
Read a string, maintaining minibuffer history across calls in GMHIST-SYMBOL,
  prompting with PROMPT, with optional GMHIST-INITIAL as initial contents.
If optional fourth arg GMHIST-READ is non-nil, then interpret the
  result as a lisp object and return that object.
See variable gmhist-map for history commands available during edit.
Example:
    (defun foo-command (cmd)
      (interactive (list (read-with-history-in 'foo-history \"Foo: \" )))
      (message \"Fooing %s...\" cmd))

See function gmhist-make-magic on how to give an existing function
history.

These properties (see function put) of GMHIST-SYMBOL are supported:

cursor-end    Put cursor at end of a newly retrieved history line.
cursor-pos    A regexp to put the cursor on.
keep-dups     If t, duplicate commands are remembered, too.
initial-hist  Initial value of the history list.
hist-ignore   Regexp of commands that are not to be added to the history.
backup	      If t, backup in the history list (as if user had typed
	      M-p as first thing).  Can also be an integer to backup
	      more than one history item.
default       An empty string as input will default to the last
	      command (whether the last command was added to the
	      history or not).  The default is stored in this
	      property, thus its initial value is the first default.
dangerous     Commands matching this regexp will never be the default.
no-default    If you don't want defaults at all, set this to t.

Use the following only if you know what you are doing:

hist-function Name of a function to call instead of doing normal
              history processing.  read-with-history-in becomes
              effectively an alias for this function.

These will be flushed soon (use let-binding minibuffer-completion-table
etc. instead):

hist-map      Minibuffer key map to use instead of gmhist-map.
completion-table
completion-predicate
	      Used in completion on history strings, when the hist-map
	      property has gmhist-completion-map as value.
	      The special value `t' for the table means to use the
	      current history list.
	      Thus, to get completion on history items just do:
		(put 'foo-history 'hist-map gmhist-completion-map)
		(put 'foo-history 'completion-table t)

Hooks:
  gmhist-after-insert-hook is run after a history item is
    inserted into the minibuffer.
  gmhist-load-hook is run after this package is loaded.
  gmhist-hook is run as first thing inside read-with-history-in.
  gmhist-before-move-hook is run before history motion takes place.
    Function gmhist-remember-zero is a candidate for that hook.
" (byte-code "ÌÍ!ˆ	ÀNÎ!ƒ Ï	
%‚V Ð	!†# 		ÑNLˆ	J	ÒNÈ=ƒ; ÓÔK\"‚= )	ÕN		
Ö
	×N†S $,)‡" [hist-function GMHIST-SYMBOL rwhi-prompt GMHIST-INITIAL GMHIST-READ history minibuffer-completion-table table t minibuffer-completion-predicate minibuffer-history-symbol gmhist-map run-hooks gmhist-hook fboundp funcall boundp initial-hist completion-table mapcar list completion-predicate gmhist-new-read-from-minibuffer hist-map] 11))

(defun completing-read-with-history-in (crwhi-hist-sym &rest args) "\
Like completing-read, but with additional first arg HISTORY-SYMBOL." (byte-code "	ÃÄ
\")‡" [minibuffer-history-symbol crwhi-hist-sym args apply gmhist-completing-read] 3))

(defun gmhist-completing-read (crwhi-prompt table &optional predicate mustmatch initial) "\
Like completing-read, but see minibuffer-history-symbol." (byte-code "	Â=ƒ
 Ã‚ ÂÌ	Í	ƒ! 
‚# !#+‡" [minibuffer-completion-confirm mustmatch t nil minibuffer-completion-table table minibuffer-completion-predicate predicate crwhi-prompt initial gmhist-must-match-map gmhist-completion-map gmhist-new-read-from-minibuffer gmhist-lookup-keymap] 5))

(defun read-file-name-with-history-in (crwhi-hist-sym &rest args) "\
Like read-file-name, but with additional first arg HISTORY-SYMBOL." (byte-code "	ÃÄ
\")‡" [file-history-symbol crwhi-hist-sym args apply gmhist-read-file-name] 3))

(defvar file-history-symbol (quote file-history) "\
*If non-nil, it is the name (a symbol) of a variable on which to cons
filenames entered in the minibuffer.
You may let-bind this to another symbol around calls to read-file-name.")

(defun gmhist-read-file-name (grfn-prompt &optional dir default mustmatch initial) "\
Args: PROMPT &optional DIR DEFAULT MUSTMATCH INITIAL.
Read file name, maintaining history in file-history-symbol, prompting
  with PROMPT, with optional INITIAL input and completing in directory DIR. 
Value is not expanded!  You must call expand-file-name yourself.
Default name to arg DEFAULT if user enters a null string (or, if
  INITIAL was given, leaves it unchanged).
MUSTMATCH non-nil means require existing file's name.
 Non-nil and non-t means also require confirmation after completion.
DIR defaults to current buffer's default-directory.

This function differs from read-file-name in providing a history of
filenames bound to file-history-symbol and (for pre-Emacs 19) in
providing an argument INITIAL not present in Emacs 18's read-file-name." (byte-code "† 	
† ‰ˆ… ÒÓÅ#ˆÒÔÅ#ˆƒ- Õ!‰‚8 …8 Õ!‰ˆ	Å=ƒD Ê‚E ÅÖ×Ø	ƒ` ‚b !#;…r Ù\"†€ ?…€ ÚG!…„ 
†‹ Û!-‡" [dir default-directory default buffer-file-name file-history-symbol t initial insert-default-directory minibuffer-completion-confirm mustmatch nil minibuffer-completion-table minibuffer-completion-predicate minibuffer-history-symbol val grfn-prompt gmhist-filename-must-match-map gmhist-filename-completion-map put cursor-end no-default gmhist-unexpand-home read-file-name-internal gmhist-new-read-from-minibuffer gmhist-lookup-keymap string= zerop substitute-in-file-name] 10))

(defun gmhist-unexpand-home (file) (byte-code "ÄÅ!GG…) ;…) 
	Y…) ÆÇ	O\"…) È	SH=ƒ5 Å	ÉOP‚6 +‡" [home home-len file-len file expand-file-name "~/" string= 0 47 nil] 6))

(defun read-buffer-with-history-in (rbwhi-hist-sym &rest args) "\
Like read-buffer, but with additional first arg HISTORY-SYMBOL." (byte-code "	ÃÄ
\")‡" [buffer-history-symbol rbwhi-hist-sym args apply gmhist-read-buffer] 3))

(defvar buffer-history-symbol (quote buffer-history) "\
*If non-nil, it is the name (a symbol) of a variable on which to cons
buffer names entered in the minibuffer.")

(defun gmhist-read-buffer (grb-prompt &optional default existing) "\
Read a buffer name, maintaining history in buffer-history-symbol and return as string.
Args PROMPT &optional DEFAULT EXISTING.
Optional arg EXISTING means an existing buffer must be entered." (byte-code "Æ!… Ç!‰ˆ	… È	À#ˆ	ÉÊËÊÇÌ \"\"Í$ÎÏ\"ƒ1 ‚2 *‡" [default buffer-history-symbol minibuffer-history-symbol name grb-prompt existing bufferp buffer-name put gmhist-completing-read mapcar list buffer-list (lambda (elt) (byte-code "Á@!‡" [elt get-buffer] 2)) equal ""] 11))

(defvar minibuffer-history-symbol (quote minibuffer-history) "\
*If non-nil, it is the name (a symbol) of a variable on which to cons
the string entered in the minibuffer.
Input is stored as string, even for e.g. `read-buffer'.")

(defvar minibuffer-history nil "\
List of strings entered using the minibuffer, most recent first.")

(put (quote minibuffer-history) (quote no-default) t)

(defvar minibuffer-history-read-only nil "\
If non-nil, nothing will be stored on `minibuffer-history-symbol'.
History motions commands are still available in the minibuffer.")

(or (fboundp (quote gmhist-old-read-from-minibuffer)) (fset (quote gmhist-old-read-from-minibuffer) (symbol-function (quote read-from-minibuffer))))

(defun gmhist-new-read-from-minibuffer (gnrfm-prompt &optional initial-contents keymap read position) "\
Read a string from the minibuffer, prompting with string PROMPT.
If optional second arg INITIAL-CONTENTS is non-nil, it is a string
  to be inserted into the minibuffer before reading input.
Third arg KEYMAP is a keymap to use whilst reading;
  if omitted or nil, the default is `minibuffer-local-map'.
If fourth arg READ is non-nil, then interpret the result as a lisp object
  and return that object:
  in other words, do `(car (read-from-string INPUT-STRING))'
Fifth arg POSITION, if non-nil, is where to put point
  in the minibuffer after inserting INITIAL-CONTENTS.

The ambient value of `minibuffer-history-symbol' (q.v.) is used and set.

*** This is the gmhist version.***" (byte-code "?ƒ 	ƒ Ç
%‚ Ç
$‚% È
%‡" [minibuffer-history-symbol gmhist-emacs-19-p gnrfm-prompt initial-contents keymap read position gmhist-old-read-from-minibuffer gmhist-read-from-minibuffer] 8))

(defun gmhist-read-from-minibuffer (grfm-prompt &optional initial-contents keymap read position) (byte-code "† 	‰ˆ
† Ö!† ×NLˆØJ	†) ÈNƒ4 Ë‚7 ÊN
ÌNƒG Ë‚J ÍNƒ] Ù\"P‚_ †h ?ƒo ‚ª ØÚ!…y †} Û]G^‰ˆÜ‰!ƒ“ Ë‚ª S8	ƒ§ Ý!‚© )ËƒÀ Þ$‚Ç Þ#‰ˆ†Û ß
#‰ˆ
ƒä Ë‚Ë…àNƒö Ë‚ý á@\"†âN‰;…ãä@!\"†BL)ˆ	ƒ,å!@‚..
‡" [keymap minibuffer-local-map minibuffer-history-read-only minibuffer-history-symbol minibuffer-history-position minibuffer-initial-contents initial-contents history no-default read dangerous nil backup default the-prompt grfm-prompt gmhist-default-format the-initial backup-input command position ignore boundp initial-hist 0 format integerp 1 zerop prin1-to-string gmhist-old-read-from-minibuffer gmhist-handle-default keep-dups equal hist-ignore string-match gmhist-stringify read-from-string] 14))

(defun gmhist-handle-default (command default dangerous) (byte-code "ÄÅ\"… 	… 	‰ˆ
;… Æ
Ç!\"†\" ÈÁ#ˆ‡" [command default dangerous minibuffer-history-symbol string= "" string-match gmhist-stringify put] 7))

(or (fboundp (quote gmhist-define-keys)) (defun gmhist-define-keys (map) "Bind the standard history commands in MAP, a key map.

When gmhist is loaded, this function is only defined if you have not
already defined it, so that you can customize it without worrying
about load order." (define-key map "ð" (quote gmhist-previous)) (define-key map "î" (quote gmhist-next)) (define-key map "ò" (quote gmhist-search-backward)) (define-key map "ó" (quote gmhist-search-forward)) (define-key map "ç" (quote gmhist-toggle)) (define-key map "Ç" (quote gmhist-switch-history)) (define-key map "¿" (quote gmhist-show))))

(defun gmhist-lookup-keymap (map) (byte-code "Á!ƒ
 ‚ ÂJ!‡" [map keymapp gmhist-lookup-keymap] 3))

(defvar gmhist-map nil "\
Key map for generic minibuffer history.
\\<gmhist-map>\\[gmhist-previous], \\[gmhist-next], \\[gmhist-beginning], \\[gmhist-end] move through, \\[gmhist-search-backward] and \\[gmhist-search-forward] search,
\\[gmhist-show] displays the history:
\\{gmhist-map}")

(if gmhist-map nil (setq gmhist-map (copy-keymap minibuffer-local-map)) (gmhist-define-keys gmhist-map))

(defvar gmhist-completion-map nil "\
Key map for generic minibuffer history with completion, see gmhist-map.")

(if gmhist-completion-map nil (setq gmhist-completion-map (copy-keymap minibuffer-local-completion-map)) (gmhist-define-keys gmhist-completion-map))

(defvar gmhist-must-match-map nil "\
Key map for generic minibuffer history with completion that must match,
see gmhist-map.")

(if gmhist-must-match-map nil (setq gmhist-must-match-map (copy-keymap minibuffer-local-must-match-map)) (gmhist-define-keys gmhist-must-match-map))

(defvar gmhist-filename-completion-map (quote gmhist-completion-map) "\
A keymap (or a symbol pointing to one) to use in filename
completion that need not match.  Defaults to 'gmhist-completion-map.")

(defvar gmhist-filename-must-match-map (quote gmhist-must-match-map) "\
A keymap (or a symbol pointing to one) to use in filename
completion that must match.  Defaults to 'gmhist-must-match-map.")

(defun gmhist-goto (n) (byte-code "ÈÉ!ˆÊ ˆ	‰ˆ	ËWƒ Â‚` 	ËUƒ# †  Ì‚( 	SJ8‰ˆÍ!cˆÈÎ!ˆÏNƒ> d‚? ebˆÐN;…_ mƒY ÑÂÇ#‚_ ÒÂÇ#)‡" [minibuffer-history-position n nil elt minibuffer-initial-contents minibuffer-history-symbol pos t run-hooks gmhist-before-move-hook erase-buffer 0 "" gmhist-stringify gmhist-after-insert-hook cursor-end cursor-pos re-search-backward re-search-forward] 9))

(defun gmhist-beginning nil "\
Go to the oldest command in the history." (interactive) (byte-code "ÁˆÂJG!‡" [minibuffer-history-symbol nil gmhist-goto] 2))

(defun gmhist-end nil "\
Position before the most recent command in the history." (interactive) (byte-code "ÀˆÁÂ!‡" [nil gmhist-goto 0] 2))

(defun gmhist-toggle (&optional n) "\
If at end of history, move to beginning, else move to end.
Prefix arg is history position to go to." (interactive "P") (byte-code "Âˆƒ ÃÄ!!‚ Å	Uƒ Æ ‚ Ç ‡" [n minibuffer-history-position nil gmhist-goto prefix-numeric-value 0 gmhist-beginning gmhist-end] 5))

(defun gmhist-switch-history (new-history) "\
Switch to a different history." (interactive (byte-code "ÁÃÄÂÂÁ$C)‡" [enable-recursive-minibuffers t nil read-from-minibuffer "Switch to history: "] 5)) (byte-code "ÂˆÆ‰‡" [enable-recursive-minibuffers t nil minibuffer-history-symbol new-history minibuffer-history-position 0] 2))

(defun gmhist-next (n) "\
Go to next history position." (interactive "p") (byte-code "ÄˆÅ	
Z]JG^	Uƒ$ ÆÇÅ	Uƒ È‚ É#‚' Ê!)‡" [narg minibuffer-history-position n minibuffer-history-symbol nil 0 error "No %s item in %s" "following" "preceding" gmhist-goto] 4))

(defun gmhist-previous (n) "\
Go to previous history position." (interactive "p") (byte-code "ÁˆÂ[!‡" [n nil gmhist-next] 2))

(defun gmhist-search-backward (regexp &optional forward) "\
Search backward in the history list for REGEXP." (interactive (byte-code "ÁÂÃÄ\"C)‡" [enable-recursive-minibuffers t read-with-history-in gmhist-search-history "History search (regexp): "] 3)) (byte-code "ËˆËƒ Ì‚ Í\\JG	ƒ' ÎV‚+ 	X…< Ï
ÐS8!\"‰?…H \\‰ˆ‚ ˆ
†T ÑÒ
#ˆÓ!-‡" [enable-recursive-minibuffers t found direction forward pos minibuffer-history-position history minibuffer-history-symbol len regexp nil -1 1 0 string-match gmhist-stringify error "%s not found in %s" gmhist-goto] 6))

(defun gmhist-search-forward (regexp) "\
Search forward in the history list for REGEXP." (interactive (byte-code "ÁÂÃÄ\"C)‡" [enable-recursive-minibuffers t read-with-history-in gmhist-search-history "History search forward (regexp): "] 3)) (byte-code "ÃˆÄ
Á\"‡" [enable-recursive-minibuffers t regexp nil gmhist-search-backward] 3))

(defun gmhist-stringify (elt) (byte-code ";ƒ	 ‚ Á!‡" [elt prin1-to-string] 2))

(defun gmhist-show nil "\
Show the history list in another buffer.
Use \\[scroll-other-window] to scroll, with negative arg to scroll back." (interactive) (byte-code "ÂˆÃÄÅ	!ÄQ�ÆÇ	J\"‘)‡" [count minibuffer-history-symbol nil 0 "*" symbol-name mapcar (lambda (x) (byte-code "ÃÄÅT‰	=ƒ Æ‚ Ç
$!‡" [count minibuffer-history-position x princ format "%2s%2d: %s
" "> " "  "] 6))] 5))

(defun gmhist-remember-zero nil "\
Put this function on gmhist-before-move-hook to make gmhist
remember the initial value even after you edited it:

    (setq gmhist-before-move-hook 'gmhist-remember-zero)" (byte-code "Â!…
 Ã ‰‡" [minibuffer-history-position minibuffer-initial-contents zerop buffer-string] 4))

(defun gmhist-copy-function (fun) (byte-code "ÅÅÅK‰ˆ:ƒ6 …/ @AÆ
!ƒ& Ç
!‚' 
	B‰ˆ‚ ˆÈ	!‚M ÉÅ\"‰ˆÊËÌ	\"ÇÌH!\"ˆÍÎ	\"+‡" [old new elt fun t nil sequencep copy-sequence nreverse append setcar nthcdr 5 apply make-byte-code] 10))

(defun gmhist-check-autoload (fun) "\
If FUN is an autoload, load its definition." (byte-code "	K<… Â@=… ÃÄ8!)‡" [lis fun autoload load 1] 3))

(defun gmhist-replace-spec (fun new-spec &optional copy-first) "\
Replace the interactive specification of FUN with NEW-SPEC.
FUN must be a symbol with a function definition.
Autoload functions are taken care of by loading the appropriate file first.
If FUN is a pure storage function (one dumped into Emacs) it is first
  copied onto itself, because pure storage cannot be modified.
  Optional non-nil third arg COPY-FIRST is used internally for this.
The old spec is put on FUN's gmhist-old-interactive-spec property.  
  That property is never overwritten by this function.  It is used by
  function gmhist-remove-magic." (byte-code "Ç!ˆ	… È!MˆÉ!
:…; ÊËÌ
8!=ƒ' Ì
8‚; ÊËÍ
8!=ƒ7 Í
8‚; ÎÏ\"ƒF Ð8‚I Ñ!ÒN†U ÓÒ#ˆ	ƒƒ 
:ƒg ÔC\"‚€ Õ
Æ\"‰ˆÖ×Ø
\"\"ˆÙÚ
\"‰ˆ
M‚‡ ÛÜÝ�+‡" [fun copy-first flambda fint old-spec new-spec nil gmhist-check-autoload gmhist-copy-function gmhist-symbol-function interactive car-safe 2 3 error "%s is not interactive" 1 gmhist-spec gmhist-old-interactive-spec put setcdr append setcar nthcdr 5 apply make-byte-code err (byte-code "Â	C\"‡" [fint new-spec setcdr] 3) ((error (byte-code "Ã	Â#‡" [fun new-spec t gmhist-replace-spec] 4)))] 16))

(defun gmhist-spec (fun) "\
Get the current interactive specification for FUN (a symbol).
Signal an error if FUN is not interactive." (byte-code "Ä	!Å:ƒ# ÆÇAA\"‰ˆ
† ÈÉ	\"ˆÊ
8‚& ËH*‡" [flambda fun fint t gmhist-symbol-function nil assq interactive error "Cannot get spec of a non-interactive command: %s!" 1 5] 5))

(defun gmhist-symbol-function (fun) (byte-code "	K9ƒ Â!‚ )‡" [flambda fun gmhist-symbol-function] 2))

(defun gmhist-split (pat str &optional limit) "\
Splitting on regexp PAT, turn string STR into a list of substrings.
Optional third arg LIMIT (>= 1) is a limit to the length of the
resulting list.
Thus, if SEP is a regexp that only matches itself,

   (mapconcat 'identity (gmhist-split SEP STRING) SEP)

is always equal to STRING." (byte-code "Ç	
\"
ÈOCÉ… ÊÈ!…I Ë!?†% W…- Ç	
#…I ÌÈ!T
OBÊÈ!‰ˆ‚ ˆË!?†V W…Z …e 
ÍOB‰ˆÎ!,‡" [start pat str result count end limit string-match 0 1 match-end integerp match-beginning nil nreverse] 10))

(defun gmhist-interactive (spec hist) "\
Interpret SPEC, an interactive string, like call-interactively
would, only with minibuffer history in HIST (a symbol).

If the value of HIST is another symbol (which can never happen if
history lists are already stored on it), this symbol is taken instead
to facilitate dynamic indirections.

Currently recognized key letters are:

    a b B c C d D k m N n s S x X f F r p P v

and initial `*'.

Use it inside interactive like this

    (interactive (gmhist-interactive \"sPrompt: \\nP\" 'foo-history))

or even like this:

    (interactive
     (gmhist-interactive \"sReplace: \\nsReplace %s with: \" 'replace-history))
" (byte-code ";†	 ÑÒ\"ˆGÓV… ÔÓH=…\" Õ ˆÖÉO‰ˆ×	!…3 	J9…3 	J??…: 	J‰ˆØÙÚÛ\"\"ÉÉÉÉÉÉÜÉ
\"‰ˆ
…�
@
AÉ
@AÝÞKß!#‰ˆà=ƒ” áâ	ãÌÉ&!‰‚rä=ƒ¨ å	æ Ì$‰‚rç=ƒ¼ å	æ É$‰‚rè=ƒÎ é!ˆr‰‚rê=ƒç áâ	ëÌÉ&!‰‚rì=ƒô `‰‚rí=ƒ	î	Éï%‰‚rð=ƒî	ÉÉï%‰‚rñ=ƒ.î	\"‰‚rò=ƒJóôõ\"ƒBÉ‚D!‰‚rö=ƒ^÷ †YÑø!‰‚rù=ƒŠƒsú!‰‚‡ûü	ÉÌ$‰!?…‡Éˆ‚s‚rý=ƒ¨ûü	ÉÌ$‰!?…¥Éˆ‚‘‚rþ=ƒ¸ú!‰‚rÿ=ƒÆ‰‚r�@ =ƒÉÉ÷ †ÝÑø!`^÷ †éÑø!`]‰ˆ�A D\"Ì‰
*‚r�B =ƒü	\"‰‚r�C =ƒ*ü	ÉÌ$‰‚r�D =ƒEâ	�E ÌÉ&‰‚r�F >ƒkü	ÉÌ$‰ˆ�G =…h�H !‰‚rÑ�I \"ˆ
†}B‰ˆ‚Y ˆß!.‡" [spec hist spec-list cur-arg args-so-far elt char prompt xprompt nil special obarray t default-directory current-prefix-arg region-min region-max error "gmhist-interactive: not a string %s" 0 42 barf-if-buffer-read-only 1 boundp mapcar (lambda (x) (if (equal "" x) nil (cons (aref x 0) (substring x 1)))) gmhist-split "
" delq apply format reverse 97 intern completing-read-with-history-in fboundp 98 read-buffer-with-history-in other-buffer 66 99 message 67 commandp 100 68 read-file-name-with-history-in confirm 102 70 107 read-key-sequence equal "" 109 mark "The mark is not set now" 78 prefix-numeric-value integerp read-with-history-in 110 112 80 114 append 115 83 118 user-variable-p (120 88) 88 eval "Invalid control letter `%c' in gmhist-interactive"] 46))

(defun gmhist-new-spec (fun &optional hist no-error) "\
Return a new interactive specification for FUN, suitable for use
with setcdr in function gmhist-replace-spec.
Use symbol HIST to store the history.  HIST defaults to `FUN-history'.
The returned spec does the same as the old one, only with history in HIST.
 
If FUN is an autoload object, its file is loaded first.

See function gmhist-interactive for a list of recognized interactive
keys letters.

Unless optional third arg NO-ERROR is given, signals an error if FUN's
interactive string contains unknown key letters or has no interactive string.
With NO-ERROR, it returns nil." (byte-code "† ÅÆ	!ÇP!‰ˆÈ	!ˆÉ	!
;ƒ$ Ê
ËDE‚1 ƒ, Ä‚1 ÌÍ	
#)‡" [hist fun spec no-error nil intern symbol-name "-history" gmhist-check-autoload gmhist-spec gmhist-interactive quote error "Can't gmhistify %s's spec: %s"] 8))

(defun gmhist-make-magic (fun &optional hist) "\
Make FUN magically maintain minibuffer history in symbol HIST.
HIST defaults to `FUN-history'.
This works by modifying the interactive specification.  See also
  function gmhist-replace-spec.
The magic goes away when you call gmhist-remove-magic on FUN." (interactive "CPut gmhist magic on command: ") (byte-code "ÄˆÅ	
Ã#ƒ Æ	\"‚( ÇÈ	\"ˆÉ	!ˆÆ	Å	
\"\"ˆÇÊ	\")‡" [new-spec fun hist t nil gmhist-new-spec gmhist-replace-spec message "Another attempt to put magic on %s..." gmhist-remove-magic "Another attempt to put magic on %s...done."] 9))

(defun gmhist-remove-magic (fun) "\
Remove the magic that gmhist-make-magic put on FUN,
restoring the old interactive spec." (interactive "CRemove gmhist magic from command: ") (byte-code "ÁˆÂÃN† ÄÅ\"\"‡" [fun nil gmhist-replace-spec gmhist-old-interactive-spec error "Can't find %s's old interactive spec!"] 5))

(gmhist-make-magic (quote gmhist-make-magic) (quote gmhist-make-magic-history))

(gmhist-make-magic (quote gmhist-remove-magic) (quote gmhist-make-magic-history))

(run-hooks (quote gmhist-load-hook))
