Commit 2da67aeb authored by David Byers's avatar David Byers
Browse files

Improved handling of initial input when reading conference names.

Detailed changes:
> 2003-08-15  David Byers  <byers@lysator.liu.se>
>
> 	* completing-read.el (lyskom-read-conf): Don't call
> 	lyskom-with-lyskom-minibuffer since it's integrated in
> 	lyskom-completing-read now.
> 	(lyskom-read-session-resolve-ambiguity): Same here.
>
> 	* lyskom-rest.el (lyskom-verified-read-from-minibuffer): Don't
> 	call lyskom-with-lyskom-minibuffer since it's integrated in
> 	lyskom-read-from-minibuffer now.
>
> 	* commands2.el (kom-calculate): Don't call
> 	lyskom-with-lyskom-minibuffer since it's integrated in
> 	lyskom-read-from-minibuffer now.
> 	(kom-set-personal-label): Same here.
>
> 	* command.el (lyskom-read-extended-command): Don't use
> 	lyskom-with-lyskom-minibuffer since it's integrated in
> 	lyskom-completing-read now.
>
> 	* utilities.el (lyskom-completing-read): Moved here from
> 	compatibility.el and turned into a regular function. Integrate
> 	lyskom-with-lyskom-minibuffer and lyskom-with-magic-minibuffer.
> 	(lyskom-read-from-minibuffer): Ditto.
>
> 	* commands1.el (kom-sub-self): Undo previous change. The new
> 	configuration mechanism takes care of things.
> 	(kom-go-to-conf): Same here.
>
> 	Even better defaults for initial conference:
> 	* compatibility.el (lyskom-completing-read): Use defsubst in Gnu
> 	Emacs so we can advise it.
>
> 	* vars.el.in (lyskom-default-conference-strategy): New variable.
>
> 	Rewrote magic minibuffer handling:
> 	* utilities.el (lyskom-magic-minibuffer-pre-command): New
> 	function.
> 	(lyskom-magic-minibuffer-before-change): New function.
> 	(lyskom-magic-minibuffer-post-command): New function.
> 	(lyskom-magic-minibuffer-cancel): New function.
> 	(lyskom-magic-minibuffer-mangle-initial): New function.
> 	(read-from-minibuffer): New advice.
> 	(completing-read): New advice.
> 	(lyskom-magic-minibuffer-add-advice): New function.
> 	(lyskom-magic-minibuffer-cancel-advice): New function.
> 	(lyskom-with-magic-minibuffer): New macro.
>
parent 9046fb8b
2003-08-15 David Byers <byers@lysator.liu.se>
* completing-read.el (lyskom-read-conf): Don't call
lyskom-with-lyskom-minibuffer since it's integrated in
lyskom-completing-read now.
(lyskom-read-session-resolve-ambiguity): Same here.
* lyskom-rest.el (lyskom-verified-read-from-minibuffer): Don't
call lyskom-with-lyskom-minibuffer since it's integrated in
lyskom-read-from-minibuffer now.
* commands2.el (kom-calculate): Don't call
lyskom-with-lyskom-minibuffer since it's integrated in
lyskom-read-from-minibuffer now.
(kom-set-personal-label): Same here.
* command.el (lyskom-read-extended-command): Don't use
lyskom-with-lyskom-minibuffer since it's integrated in
lyskom-completing-read now.
* utilities.el (lyskom-completing-read): Moved here from
compatibility.el and turned into a regular function. Integrate
lyskom-with-lyskom-minibuffer and lyskom-with-magic-minibuffer.
(lyskom-read-from-minibuffer): Ditto.
* commands1.el (kom-sub-self): Undo previous change. The new
configuration mechanism takes care of things.
(kom-go-to-conf): Same here.
Even better defaults for initial conference:
* compatibility.el (lyskom-completing-read): Use defsubst in Gnu
Emacs so we can advise it.
* vars.el.in (lyskom-default-conference-strategy): New variable.
Rewrote magic minibuffer handling:
* utilities.el (lyskom-magic-minibuffer-pre-command): New
function.
(lyskom-magic-minibuffer-before-change): New function.
(lyskom-magic-minibuffer-post-command): New function.
(lyskom-magic-minibuffer-cancel): New function.
(lyskom-magic-minibuffer-mangle-initial): New function.
(read-from-minibuffer): New advice.
(completing-read): New advice.
(lyskom-magic-minibuffer-add-advice): New function.
(lyskom-magic-minibuffer-cancel-advice): New function.
(lyskom-with-magic-minibuffer): New macro.
2003-08-15 Ulrik Haugen <qha@lysator.liu.se>
* english-strings.el (local): Changed "what conference" -> "which
......
......@@ -247,19 +247,18 @@
lyskom-command-minibuffer-local-must-match-map))
(while (or (null name)
(string= "" name))
(lyskom-with-lyskom-minibuffer
(setq name (lyskom-completing-read prompt
'lyskom-complete-command
;; lyskom-is-administrator is buffer-local and
;; must be evalled before the call to
;; completing-read
;; Yes, this is not beautiful
(list 'lambda '(alternative) ;
(list 'lyskom-ok-command 'alternative
lyskom-is-administrator))
t
nil
'lyskom-command-history)))))
(setq name (lyskom-completing-read prompt
'lyskom-complete-command
;; lyskom-is-administrator is buffer-local and
;; must be evalled before the call to
;; completing-read
;; Yes, this is not beautiful
(list 'lambda '(alternative) ;
(list 'lyskom-ok-command 'alternative
lyskom-is-administrator))
t
nil
'lyskom-command-history))))
(cdr (lyskom-string-assoc name alternatives))))
......
......@@ -899,13 +899,8 @@ See `kom-unsubscribe-makes-passive'."
(interactive)
(let* ((me (blocking-do 'get-conf-stat lyskom-pers-no))
(conf (if conf-no (blocking-do 'get-conf-stat conf-no)
(let ((default (lyskom-read-conf-guess-initial '(membership)))
(mailbox (conf-stat->name me)))
(if (equal default mailbox)
(setq default ""))
(lyskom-read-conf-stat
(lyskom-get-string 'leave-what-conf)
'(membership) nil default t)))))
(lyskom-read-conf-stat (lyskom-get-string 'leave-what-conf)
'(membership) nil nil t))))
(lyskom-sub-member me conf)))
(defun lyskom-sub-member (pers conf &optional have-message)
......@@ -1710,16 +1705,8 @@ Changing conferences runs `kom-change-conf-hook' and
(interactive)
(let ((conf (if conf-no
(blocking-do 'get-conf-stat conf-no)
(let ((default (lyskom-read-conf-guess-initial '(all)))
(current (uconf-stat->name
(blocking-do 'get-uconf-stat
lyskom-current-conf))))
(if (or (null current)
(equal default current))
(setq default ""))
(lyskom-read-conf-stat
(lyskom-get-string 'go-to-conf-p)
'(all) nil default t)))))
(lyskom-read-conf-stat (lyskom-get-string 'go-to-conf-p)
'(all) nil nil t))))
(when (lyskom-check-go-to-conf conf)
(lyskom-go-to-conf conf))))
......
......@@ -2248,10 +2248,9 @@ really only a simple interface to the basic functionality of calc."
(when (lyskom-try-require 'calc
(lyskom-get-string 'need-library))
(let* ((expr (or exprx
(lyskom-with-lyskom-minibuffer
(lyskom-read-from-minibuffer
(lyskom-get-string 'calc-expression)
nil nil nil 'lyskom-expression-history))))
(lyskom-read-from-minibuffer
(lyskom-get-string 'calc-expression)
nil nil nil 'lyskom-expression-history)))
(result (calc-eval expr)))
(cond ((stringp result)
(lyskom-format-insert-before-prompt
......@@ -2293,9 +2292,8 @@ Sets a personal label on an object of some kind."
(setq secret (not (lyskom-j-or-n-p
(lyskom-get-string 'label-secret))))
(setq label
(lyskom-with-lyskom-minibuffer
(lyskom-read-from-minibuffer
(lyskom-get-string 'label-what-label))))
(lyskom-get-string 'label-what-label)))
(blocking-do
'modify-text-info
objno
......@@ -2322,9 +2320,8 @@ Sets a personal label on an object of some kind."
(setq secret (not (lyskom-j-or-n-p
(lyskom-get-string 'label-secret))))
(setq label
(lyskom-with-lyskom-minibuffer
(lyskom-read-from-minibuffer
(lyskom-get-string 'label-what-label))))
(lyskom-read-from-minibuffer
(lyskom-get-string 'label-what-label)))
(blocking-do
'modify-conf-info
objno
......
......@@ -384,46 +384,6 @@ string to search in."
(t (string-width str))))))
(eval-and-compile
(cond ((eval-when-compile (string-match "XEmacs" (emacs-version)))
(defun lyskom-completing-read (prompt
table
&optional predicate require-match
init hist def inherit-input-method)
(completing-read prompt table predicate require-match init hist)))
((eval-when-compile (> emacs-major-version 19))
(fset 'lyskom-completing-read (symbol-function 'completing-read)))
(t
(defun lyskom-completing-read (prompt
table
&optional predicate require-match
init hist def inherit-input-method)
(completing-read prompt table predicate require-match init hist)))))
(eval-and-compile
(cond ((eval-when-compile (string-match "XEmacs" (emacs-version)))
(defun lyskom-read-from-minibuffer (prompt
&optional initial-contents
keymap read hist default-value
inherit-input-method)
(read-from-minibuffer prompt
initial-contents
keymap
read
hist)))
((eval-when-compile (> emacs-major-version 19))
(fset 'lyskom-read-from-minibuffer
(symbol-function 'read-from-minibuffer)))
(t (defun lyskom-read-from-minibuffer (prompt
&optional initial-contents
keymap read hist default-value
inherit-input-method)
(read-from-minibuffer prompt
initial-contents
keymap
read
hist)))))
(if (fboundp 'minibuffer-contents)
(defalias 'lyskom-minibuffer-contents 'minibuffer-contents)
(defalias 'lyskom-minibuffer-contents 'buffer-string))
......
......@@ -115,35 +115,6 @@ but first checks a cache."
map)
"Keymap used for reading LysKOM names.")
(defvar lyskom-minibuffer-point)
(defun lyskom-read-from-minibuffer-clear-initial (&rest args)
(condition-case nil
(let ((ranges nil)
(tmp nil)
(start (point-min)))
(while (setq tmp (lyskom-next-property-bounds
start (point-max) 'lyskom-initial-mbc))
(setq ranges (cons tmp ranges)
start (cdr tmp)))
(lyskom-traverse range ranges
(delete-region (car range) (cdr range)))
(when ranges
(lyskom-read-from-minibuffer-cancel-magic)))
(error nil)))
(defun lyskom-read-from-minibuffer-cancel-magic ()
(setq pre-command-hook (delq 'lyskom-read-from-minibuffer-pre-command pre-command-hook)
post-command-hook (delq 'lyskom-read-from-minibuffer-post-command post-command-hook)
before-change-functions (delq 'lyskom-read-from-minibuffer-clear-initial before-change-functions)))
(defun lyskom-read-from-minibuffer-pre-command (&rest args)
(setq lyskom-minibuffer-point (point)))
(defun lyskom-read-from-minibuffer-post-command (&rest args)
(unless (or (null lyskom-minibuffer-point)
(eq lyskom-minibuffer-point (point)))
(lyskom-read-from-minibuffer-cancel-magic)))
(defsubst lyskom-completing-match-string-regexp (string)
......@@ -212,21 +183,54 @@ See lyskom-read-conf for a description of the parameters."
(t (conf-z-info->name conf-z-info)))))
;;; ================================================================
;;; Code to guess defaults for initial input
;;;
(defun lyskom-default-conference-at-point ()
(let* ((pos (or lyskom-command-point (point)))
(type (and pos (get-text-property pos 'lyskom-button-type))))
(and (memq type '(conf pers))
(list (get-text-property pos 'lyskom-button-arg)))))
(defun lyskom-default-conference-current ()
(list lyskom-current-conf))
(defun lyskom-default-conference-self ()
(list lyskom-pers-no))
(defun lyskom-default-conference-not-self (uc)
(not (eq (uconf-stat->conf-no uc) lyskom-pers-no)))
(defun lyskom-default-conference-not-current (uc)
(not (eq (uconf-stat->conf-no uc) lyskom-current-conf)))
(defun lyskom-get-initial-conf-strategy ()
(or (cdr (assq lyskom-current-command lyskom-default-conference-strategy))
(cdr (assq t lyskom-default-conference-strategy))))
(defun lyskom-read-conf-guess-initial (predicate)
"Return a guess for the initial value for lyskom-read-conf."
(let* ((pos (or lyskom-command-point (point)))
(type (and pos (get-text-property pos 'lyskom-button-type)))
(conf-nos (delq nil
(list (and (memq type '(conf pers))
(get-text-property pos 'lyskom-button-arg))
lyskom-current-conf
lyskom-pers-no))))
(lyskom-traverse conf-no conf-nos
(let ((uc (blocking-do 'get-uconf-stat conf-no)))
(when (lyskom-read-conf-internal-verify-type
conf-no (uconf-stat->conf-type uc)
predicate nil nil)
(lyskom-traverse-break (uconf-stat->name uc)))))))
(let* ((strategy (lyskom-get-initial-conf-strategy))
(default (cdr (assq 'default strategy)))
(filter (cdr (assq 'filter strategy))))
(uconf-stat->name
(car (filter-list (lambda (uconf-stat)
(and uconf-stat
(not (memq nil (mapcar (lambda (fn)
(funcall fn uconf-stat))
filter)))
(lyskom-read-conf-internal-verify-type
(uconf-stat->conf-no uconf-stat)
(uconf-stat->conf-type uconf-stat)
predicate nil nil)))
(mapcar (lambda (conf-no)
(blocking-do 'get-uconf-stat conf-no))
(apply 'append (mapcar 'funcall default))))))))
(defun lyskom-read-conf (prompt type &optional empty initial mustmatch)
"Completing read a conference or person from the minibuffer.
......@@ -268,22 +272,8 @@ A string: A name that matched nothing in the database."
(conf-z-info->name initial))
((consp initial) initial)
((lyskom-read-conf-guess-initial type))
((and lyskom-current-conf
(not (eq lyskom-current-conf 0)))
(uconf-stat->name
(blocking-do 'get-uconf-stat lyskom-current-conf)))
(t nil)))
(cond ((stringp initial)
(setq initial (copy-sequence initial))
(add-text-properties 0 (length initial)
'(lyskom-initial-mbc t) initial))
(initial
(setq initial (cons (copy-sequence (car initial)) (cdr initial)))
(add-text-properties 0 (length (car initial))
'(lyskom-initial-mbc t) (car initial))))
(let* ((completion-ignore-case t)
(minibuffer-local-completion-map
lyskom-minibuffer-local-completion-map)
......@@ -294,33 +284,16 @@ A string: A name that matched nothing in the database."
(keep-going t))
(while keep-going
(lyskom-with-lyskom-minibuffer
(let ((before-change-functions before-change-functions)
(pre-command-hook pre-command-hook)
(post-command-hook post-command-hook)
(lyskom-minibuffer-point nil)
(minibuffer-setup-hook
(cons (lambda ()
(setq before-change-functions
(cons 'lyskom-read-from-minibuffer-clear-initial
before-change-functions)
pre-command-hook (cons 'lyskom-read-from-minibuffer-pre-command pre-command-hook)
post-command-hook (cons 'lyskom-read-from-minibuffer-post-command post-command-hook)))
minibuffer-setup-hook))
(minibuffer-exit-hook
(cons 'lyskom-read-from-minibuffer-cancel-magic
minibuffer-exit-hook)))
(setq read-string (completing-read (cond ((stringp prompt) prompt)
((symbolp prompt) (lyskom-get-string prompt))
(t (lyskom-get-string 'conf-prompt)))
'lyskom-read-conf-internal
type
mustmatch
(if (listp initial)
initial
(cons initial 0))
'lyskom-name-hist))))
(setq read-string (lyskom-completing-read (cond ((stringp prompt) prompt)
((symbolp prompt) (lyskom-get-string prompt))
(t (lyskom-get-string 'conf-prompt)))
'lyskom-read-conf-internal
type
mustmatch
(if (listp initial)
initial
(cons initial 0))
'lyskom-name-hist))
(setq result
(cond ((null read-string) nil)
((string= "" read-string) nil)
......@@ -1114,15 +1087,14 @@ the LysKOM rules of string matching."
(lyskom-insert (lyskom-format 'total-users-sans-date (length who-info)))
(lyskom-scroll)
(while (string= ""
(lyskom-with-lyskom-minibuffer
(setq result (lyskom-completing-read
(setq result (lyskom-completing-read
(lyskom-get-string 'resolve-session)
(lyskom-maybe-frob-completion-table
who-info)
nil
t
(car (car who-info))
nil)))))
nil))))
(list (session-info->connection (cdr (assoc result who-info)))))))
......
......@@ -439,7 +439,7 @@ If NEWLINE is non-nil, insert a newline after the header."
(1- (length filter-edit-currently-edited-filter-entry-list)))))
(insert "\n"))
(goto-char filter-edit-list-end))
(setq action (lyskom-completing-read (lyskom-get-string 'filter-edit-filter-how)
(lyskom-maybe-frob-completion-table
rev-actions)
......
......@@ -3489,8 +3489,7 @@ PRED is a predicate to check entered data. It should return nil or a string. If
it returns a string, the data is not valid and the string is used as an error
message."
(let ((lyskom-verified-read-predicate pred))
(lyskom-with-lyskom-minibuffer
(lyskom-read-from-minibuffer prompt initial lyskom-verified-read-map))))
(lyskom-read-from-minibuffer prompt initial lyskom-verified-read-map)))
(defun lyskom-read-num-range-or-date (low high prompt &optional initial empty default)
......
......@@ -2075,3 +2075,180 @@ reflects an override of the value by the value of TAG."
(cdr (assq tag kom-extended-status-information)))
(t kom-extended-status-information)))
;;; ============================================================
;;; Magic that allows us to clear the initial value in the
;;; minibuffer when the user types a character.
;;;
;;; We can't alter the buffer contents in before-change-functions
;;; since this can crash Gnu Emacs 20.7 (it computes positions
;;; internally before calling before-change-functions, and if
;;; those positions are invalid afterwards all sorts of things
;;; can happen).
;;;
;;; Theory of operation:
;;;
;;; In the pre-command-hook, record the position of point and
;;; the contents of the minibuffer.
;;;
;;; In before-change-functions, check if there is initial
;;; input in the buffer yet -- if not we're not yet ready
;;; to erase anything.
;;;
;;; In the post-command-hook, if the buffer contents have changed
;;; since there was inital input in the buffer, erase the initial
;;; input. If the position of point has moved, disable all the
;;; magic (both can happen at the same time).
;;;
;;; We set up advice on read-from-minibuffer and completing-read
;;; that mangles the initial input appropriately.
;;;
(defvar lyskom-minibuffer-point)
(defvar lyskom-minibuffer-string)
(defvar lyskom-minibuffer-do-change)
(defun lyskom-magic-minibuffer-pre-command (&rest args)
"Save current status of the minibuffer for later magic."
(setq lyskom-minibuffer-point (point)
lyskom-minibuffer-string (buffer-string)))
(defun lyskom-magic-minibuffer-before-change (&rest args)
"Check if the initial input has been placed in the minibuffer.
This function is called at least once before the initial input
has been placed in the minibuffer by Emacs. Most magic needs to
be disabled until the input has been deposited."
(setq lyskom-minibuffer-do-change
(lyskom-next-property-bounds (point-min)
(point-max) 'lyskom-initial-mbc)))
(defun lyskom-magic-minibuffer-post-command (&rest args)
"Function for use as post-command-hook in magic minibuffer.
If the contents of the minibuffer have changed since initial input
has been placed in the minibuffer, erase the initial input. This
happens when the user enters something in the minibuffer.
If point has moved, disable magic. This happens either after we
delete the initial contents (which is OK) or after the user moves
point without altering the buffer contents."
(when (and lyskom-minibuffer-do-change
(not (equal (buffer-string) lyskom-minibuffer-string)))
(let ((ranges nil)
(tmp nil)
(start (point-min)))
(while (setq tmp (lyskom-next-property-bounds
start (point-max) 'lyskom-initial-mbc))
(setq ranges (cons tmp ranges)
start (cdr tmp)))
(lyskom-traverse range ranges
(delete-region (car range) (cdr range)))
(when ranges
(lyskom-magic-minibuffer-cancel))))
(unless (or (null lyskom-minibuffer-point)
(eq lyskom-minibuffer-point (point)))
(lyskom-magic-minibuffer-cancel)))
(defun lyskom-magic-minibuffer-cancel ()
"Remove hooks used to make the minibuffer magic."
(remove-hook 'pre-command-hook 'lyskom-magic-minibuffer-pre-command)
(remove-hook 'post-command-hook 'lyskom-magic-minibuffer-post-command)
(remove-hook 'before-change-functions 'lyskom-magic-minibuffer-before-change))
(defun lyskom-magic-minibuffer-mangle-initial (initial)
"Add text properties to INITIAL (a string or cons) so it is
suitable for use as initial input in a magic minibuffer."
(cond ((null initial) nil)
((stringp initial)
(let ((tmp (copy-sequence initial)))
(add-text-properties 0 (length tmp) '(lyskom-initial-mbc t rear-nonsticky t end-open t) tmp)
tmp))
((consp initial)
(let ((tmp (copy-sequence (car initial))))
(add-text-properties 0 (length tmp) '(lyskom-initial-mbc t rear-nonsticky t end-open t) tmp)
(cons tmp (cdr initial))))
(t initial)))
;;; ------------------------------------------------------------
;;; Gnu Emacs and XEmacs have different names for parameters.
;;; This is stupid and makes the code below a lot uglier.
(defadvice read-from-minibuffer (around lyskom-magic-minibuffer-read-from-minibuffer nil disable)
(let* ((initial-input (and (boundp 'initial-input) (lyskom-magic-minibuffer-mangle-initial (symbol-value 'initial-input))))
(initial-contents (and (boundp 'initial-contents) (lyskom-magic-minibuffer-mangle-initial (symbol-value 'initial-contents))))
(initial (and (boundp 'initial) (lyskom-magic-minibuffer-mangle-initial (symbol-value 'initial))))
(init (and (boundp 'init) (lyskom-magic-minibuffer-mangle-initial (symbol-value 'init))))
(result ad-do-it))
(when (stringp result)
(remove-text-properties 0 (length result) '(end-open nil rear-nonsticky nil lyskom-initial-mbc nil) result)
(unless (or (text-properties-at 0 result)
(next-property-change 0 result))
(set-text-properties 0 (length result) nil result)))
result))
(defadvice completing-read (around lyskom-magic-minibuffer-completing-read nil disable)
(let* ((initial-input (and (boundp 'initial-input) (lyskom-magic-minibuffer-mangle-initial (symbol-value 'initial-input))))
(initial-contents (and (boundp 'initial-contents) (lyskom-magic-minibuffer-mangle-initial (symbol-value 'initial-contents))))
(initial (and (boundp 'initial) (lyskom-magic-minibuffer-mangle-initial (symbol-value 'initial))))
(init (and (boundp 'init) (lyskom-magic-minibuffer-mangle-initial (symbol-value 'init))))
(result ad-do-it))
(when (stringp result)
(remove-text-properties 0 (length result) '(end-open nil rear-nonsticky nil lyskom-initial-mbc nil) result)
(unless (or (text-properties-at 0 result)
(next-property-change 0 result))
(set-text-properties 0 (length result) nil result)))
result))
(defun lyskom-magic-minibuffer-add-advice ()
(ad-enable-advice 'read-from-minibuffer 'around 'lyskom-magic-minibuffer-read-from-minibuffer)
(ad-enable-advice 'completing-read 'around 'lyskom-magic-minibuffer-completing-read)
(ad-activate 'read-from-minibuffer)
(ad-activate 'completing-read)
)
(defun lyskom-magic-minibuffer-cancel-advice ()
(ad-disable-advice 'read-from-minibuffer 'around 'lyskom-magic-minibuffer-read-from-minibuffer)
(ad-disable-advice 'completing-read 'around 'lyskom-magic-minibuffer-completing-read)
)
(defmacro lyskom-with-magic-minibuffer (&rest forms)
`(let ((lyskom-minibuffer-point nil)
(lyskom-minibuffer-string nil)
(lyskom-minibuffer-do-change nil)
(pre-command-hook pre-command-hook)
(post-command-hook post-command-hook)
(before-change-functions before-change-functions))
(add-hook 'pre-command-hook 'lyskom-magic-minibuffer-pre-command)
(add-hook 'post-command-hook 'lyskom-magic-minibuffer-post-command)
(add-hook 'before-change-functions 'lyskom-magic-minibuffer-before-change)
(unwind-protect
(progn (lyskom-magic-minibuffer-add-advice)
,@forms)
(lyskom-magic-minibuffer-cancel-advice))))
(defun lyskom-completing-read (prompt table &optional predicate
require-match init hist def)
(lyskom-ignore def)
(lyskom-with-lyskom-minibuffer
(lyskom-with-magic-minibuffer
(or (completing-read prompt table predicate require-match init hist) def))))
(defun lyskom-read-from-minibuffer (prompt
&optional initial-contents
keymap read hist def)
(lyskom-ignore def)
(lyskom-with-lyskom-minibuffer
(lyskom-with-magic-minibuffer
(or (read-from-minibuffer prompt initial-contents keymap read hist) def))))
(put 'lyskom-with-magic-minibuffer 'edebug-form-spec '(body))
......@@ -198,6 +198,21 @@ the priority among links that match the same text is undefined."
server)
(def-kom-var lyskom-default-conference-strategy
'((kom-sub-self . ((default . (lyskom-default-conference-at-point
lyskom-default-conference-current))
(filter . (lyskom-default-conference-not-self))))
(kom-go-to-conf . ((default . (lyskom-default-conference-at-point
lyskom-default-conference-self))
(filter . (lyskom-default-conference-not-current))))
(t . ((default . (lyskom-default-conference-at-point
lyskom-default-conference-current
lyskom-default-conference-self)))))
"Strategy for the initial value for conference defaults.
The meaning and format of this variable will probably change in the future.")
(defconst kom-old-farts-text-prompt-strategy