comparison lisp/prim/minibuf.el @ 74:54cc21c15cbb r20-0b32

Import from CVS: tag r20-0b32
author cvs
date Mon, 13 Aug 2007 09:04:33 +0200
parents 131b0175ea99
children dbb370e3c29e
comparison
equal deleted inserted replaced
73:e2d7a37b7c8d 74:54cc21c15cbb
155 (define-key map "\t" 'comint-dynamic-complete) 155 (define-key map "\t" 'comint-dynamic-complete)
156 (define-key map "\M-\t" 'comint-dynamic-complete) 156 (define-key map "\M-\t" 'comint-dynamic-complete)
157 (define-key map "\M-?" 'comint-dynamic-list-completions) 157 (define-key map "\M-?" 'comint-dynamic-list-completions)
158 map) 158 map)
159 "Minibuffer keymap used by shell-command and related commands.") 159 "Minibuffer keymap used by shell-command and related commands.")
160
161 (defvar should-use-dialog-box t
162 "Variable controlling usage of the dialog box. If nil, the dialog box
163 will never be used, even in response to mouse events.")
160 164
161 (defvar minibuffer-electric-file-name-behavior t 165 (defvar minibuffer-electric-file-name-behavior t
162 "If non-nil, slash and tilde in certain places cause immediate deletion. 166 "If non-nil, slash and tilde in certain places cause immediate deletion.
163 These are the same places where this behavior would occur later on anyway, 167 These are the same places where this behavior would occur later on anyway,
164 in `substitute-in-file-name'.") 168 in `substitute-in-file-name'.")
838 t) 842 t)
839 nil) 843 nil)
840 (error nil)))) 844 (error nil))))
841 (char last-command-char)) 845 (char last-command-char))
842 ;; Try to complete by adding a word-delimiter 846 ;; Try to complete by adding a word-delimiter
843 (or (and (integerp char) (> char 0) 847 (or (and (characterp char) (> char 0)
844 (funcall foo (char-to-string char))) 848 (funcall foo (char-to-string char)))
845 (and (not (eq char ?\ )) 849 (and (not (eq char ?\ ))
846 (funcall foo " ")) 850 (funcall foo " "))
847 (and (not (eq char ?\-)) 851 (and (not (eq char ?\-))
848 (funcall foo "-")) 852 (funcall foo "-"))
1205 (erase-buffer) 1209 (erase-buffer)
1206 (setq minibuffer-history-position narg) 1210 (setq minibuffer-history-position narg)
1207 (let ((elt (nth (1- minibuffer-history-position) 1211 (let ((elt (nth (1- minibuffer-history-position)
1208 (symbol-value minibuffer-history-variable)))) 1212 (symbol-value minibuffer-history-variable))))
1209 (insert 1213 (insert
1210 (if (and minibuffer-history-sexp-flag 1214 (if (not (stringp elt))
1211 ;; total kludge
1212 (not (stringp elt)))
1213 (let ((print-level nil)) 1215 (let ((print-level nil))
1214 (condition-case nil 1216 (condition-case nil
1215 (let ((print-readably t) 1217 (let ((print-readably t)
1216 (print-escape-newlines t)) 1218 (print-escape-newlines t))
1217 (prin1-to-string elt)) 1219 (prin1-to-string elt))
2001 ;; even when dialog boxes are not present. 2003 ;; even when dialog boxes are not present.
2002 (defun should-use-dialog-box-p () 2004 (defun should-use-dialog-box-p ()
2003 "If non-nil, questions should be asked with a dialog box instead of the 2005 "If non-nil, questions should be asked with a dialog box instead of the
2004 minibuffer. This looks at `last-command-event' to see if it was a mouse 2006 minibuffer. This looks at `last-command-event' to see if it was a mouse
2005 event, and checks whether dialog-support exists and the current device 2007 event, and checks whether dialog-support exists and the current device
2006 supports dialog boxes." 2008 supports dialog boxes.
2009
2010 The dialog box is totally disabled if the variable `should-use-dialog-box'
2011 is set to nil."
2007 (and (featurep 'dialog) 2012 (and (featurep 'dialog)
2008 (device-on-window-system-p) 2013 (device-on-window-system-p)
2014 should-use-dialog-box
2009 (or force-dialog-box-use 2015 (or force-dialog-box-use
2010 (button-press-event-p last-command-event) 2016 (button-press-event-p last-command-event)
2011 (button-release-event-p last-command-event) 2017 (button-release-event-p last-command-event)
2012 (misc-user-event-p last-command-event)))) 2018 (misc-user-event-p last-command-event))))
2019
2020 ;;; minibuf.el ends here