Commit 681d640a authored by Ulrik Haugen's avatar Ulrik Haugen

removed parameter quittable from j-or-n-p and lyskom-j-or-n-p

parent b9584630
2000-12-29 Ulrik Haugen <qha@lysator.liu.se>
* lyskom-rest.el (j-or-n-p lyskom-j-or-n-p): Rmoved the parameter
quittable and rewrote the functions as if it were always
t. Callers changed (in aux-items.el, commands1.el, commands2.el,
edit-text.el, filter-edit.el and startup.el).
2000-12-17 Ulrik Haugen <qha@lysator.liu.se>
* utilities.el: applied patch from Per Starbck, device-class
......
......@@ -675,13 +675,13 @@ of the person."
(let* ((conf-name (or name
(lyskom-read-string
(lyskom-get-string 'name-of-conf))))
(open (j-or-n-p (lyskom-get-string 'anyone-member) t))
(open (j-or-n-p (lyskom-get-string 'anyone-member)))
(secret (if (not open)
(j-or-n-p (lyskom-get-string 'secret-conf) t)))
(orig (j-or-n-p (lyskom-get-string 'comments-allowed) t))
(anarchy (j-or-n-p (lyskom-get-string 'anonymous-allowed) t))
(j-or-n-p (lyskom-get-string 'secret-conf))))
(orig (j-or-n-p (lyskom-get-string 'comments-allowed)))
(anarchy (j-or-n-p (lyskom-get-string 'anonymous-allowed)))
(secmem (and (lyskom-have-feature long-conf-types)
(not (lyskom-j-or-n-p (lyskom-get-string 'secret-members-allowed) t))))
(not (lyskom-j-or-n-p (lyskom-get-string 'secret-members-allowed)))))
(conf-no (blocking-do 'create-conf
conf-name
(lyskom-create-conf-type (not open)
......
......@@ -1878,13 +1878,13 @@ Return-value: 'no-session if there is no suitable session to switch to
(and ano (lyskom-get-string 'allow-anon))
(and ope (lyskom-get-string 'allow-secret))))
", "))
(let* ((open (lyskom-j-or-n-p (lyskom-get-string 'anyone-member) t))
(let* ((open (lyskom-j-or-n-p (lyskom-get-string 'anyone-member)))
(secret (if (not open)
(lyskom-j-or-n-p (lyskom-get-string 'secret-conf) t)))
(orig (lyskom-j-or-n-p (lyskom-get-string 'comments-allowed) t))
(anarchy (lyskom-j-or-n-p (lyskom-get-string 'anonymous-allowed) t))
(lyskom-j-or-n-p (lyskom-get-string 'secret-conf))))
(orig (lyskom-j-or-n-p (lyskom-get-string 'comments-allowed)))
(anarchy (lyskom-j-or-n-p (lyskom-get-string 'anonymous-allowed)))
(secmem (and (lyskom-have-feature long-conf-types)
(not (lyskom-j-or-n-p (lyskom-get-string 'secret-members-allowed) t)))))
(not (lyskom-j-or-n-p (lyskom-get-string 'secret-members-allowed))))))
(cache-del-conf-stat (uconf-stat->conf-no uconf-stat))
(cache-del-uconf-stat (uconf-stat->conf-no uconf-stat))
(if (not (blocking-do
......@@ -2236,7 +2236,7 @@ Return-value: 'no-session if there is no suitable session to switch to
;; user wants to try anyway (it might work...)
(if (or (eq (text-stat->author text-stat) lyskom-pers-no)
(lyskom-j-or-n-p 'not-author-try-anyway-p t))
(lyskom-j-or-n-p 'not-author-try-anyway-p))
(progn (lyskom-format-insert 'adding-no-comments
text-no)
(lyskom-report-command-answer
......@@ -2277,7 +2277,7 @@ Return-value: 'no-session if there is no suitable session to switch to
;; user wants to try anyway (it might work...)
(if (or (eq (text-stat->author text-stat) lyskom-pers-no)
(lyskom-j-or-n-p 'not-author-try-anyway-p t))
(lyskom-j-or-n-p 'not-author-try-anyway-p))
(progn (lyskom-format-insert 'adding-private-answer
text-no)
(lyskom-report-command-answer
......@@ -2318,7 +2318,7 @@ Return-value: 'no-session if there is no suitable session to switch to
;; user wants to try anyway (it might work...)
(if (or (eq (text-stat->author text-stat) lyskom-pers-no)
(lyskom-j-or-n-p 'not-author-try-anyway-p t))
(lyskom-j-or-n-p 'not-author-try-anyway-p))
(progn (lyskom-format-insert 'adding-request-confirm
text-no)
(lyskom-report-command-answer
......
......@@ -478,7 +478,7 @@ so it's not as clean as it ought to be."
"Send the text to the server."
(interactive)
(if (and (lyskom-default-value 'lyskom-is-anonymous)
(lyskom-j-or-n-p 'do-send-anonymous t))
(lyskom-j-or-n-p 'do-send-anonymous))
(lyskom-edit-send 'initiate-create-anonymous-text t)
(lyskom-edit-send 'initiate-create-text nil)))
......@@ -880,7 +880,7 @@ Cannot be called from a callback."
(goto-char (point-min))
(if (not
(lyskom-j-or-n-p
(lyskom-format 'comment-all-relevant-p) t))
(lyskom-format 'comment-all-relevant-p)))
(signal 'lyskom-edit-text-abort
(list "%s"
(lyskom-get-string
......@@ -963,14 +963,12 @@ Cannot be called from a callback."
(lyskom-j-or-n-p
(lyskom-format
'add-recipient-p
author-number)
t))
author-number)))
(setq extra-headers
(nconc (list (if (lyskom-j-or-n-p
(lyskom-format
'really-add-as-recpt-q
author-number)
t)
author-number))
'recpt
'cc-recpt)
author-number)
......@@ -997,7 +995,7 @@ Cannot be called from a callback."
(save-excursion
(set-buffer lyskom-buffer)
(lyskom-j-or-n-p
(lyskom-get-string 'send-formatted) t)))
(lyskom-get-string 'send-formatted))))
(concat "enriched:\n" (buffer-string))
message))
(kill-buffer buf)))
......@@ -1276,7 +1274,7 @@ RECPT-TYPE is the type of recipient to add."
(eq recpt-type 'recpt)
(not (lyskom-j-or-n-p (lyskom-format
'really-add-as-recpt-q
conf-stat) t)))
conf-stat))))
(setq recpt-type 'cc-recpt))
(if what-to-do
......
......@@ -484,7 +484,7 @@ If NEWLINE is non-nil, insert a newline after the header."
nil
t))
(setq permanent
(lyskom-j-or-n-p (lyskom-get-string 'filter-permanent) t))
(lyskom-j-or-n-p (lyskom-get-string 'filter-permanent)))
(setq filter (make-filter nil
(list (cons 'action
(cdr (assoc action rev-actions)))
......@@ -724,7 +724,7 @@ If NOERROR is non-nil, return nil instead of signaling an error."
(let ((save nil))
(if filter-edit-change-flag
(setq save (lyskom-j-or-n-p
(lyskom-get-string 'filter-edit-save-p) t)))
(lyskom-get-string 'filter-edit-save-p))))
(if save
(lyskom-filter-edit-save))
(set-window-configuration lyskom-edit-return-to-configuration)))
......@@ -757,7 +757,7 @@ If NOERROR is non-nil, return nil instead of signaling an error."
(if (and
(lyskom-filter-empty-patterns-p)
(lyskom-j-or-n-p
(lyskom-get-string 'filter-edit-remove-empty) t))
(lyskom-get-string 'filter-edit-remove-empty)))
(lyskom-filter-edit-expunge))
(let ((e filter-edit-currently-edited-filter-entry-list)
......@@ -797,7 +797,7 @@ If NOERROR is non-nil, return nil instead of signaling an error."
(interactive)
(if (or (not filter-edit-change-flag)
(and filter-edit-change-flag
(lyskom-j-or-n-p (lyskom-get-string 'filter-edit-restart-p) t)))
(lyskom-j-or-n-p (lyskom-get-string 'filter-edit-restart-p))))
(let ((inhibit-read-only t))
(setq filter-edit-currently-edited-filter-entry-list nil)
(delete-region filter-edit-list-start filter-edit-list-end)
......
......@@ -2270,8 +2270,7 @@ A list of pairs means OPTARG will be used as a key to look up the real
(if (or (not (file-exists-p filename))
(prog1
(lyskom-j-or-n-p
(lyskom-format 'save-text-confirm filename)
t)
(lyskom-format 'save-text-confirm filename))
(lyskom-message "")))
(let ((buf (lyskom-get-buffer-create 'temp " *kom*-text" t))
(str (text->decoded-text-mass text text-stat)))
......@@ -3053,12 +3052,11 @@ lyskom-get-string to retrieve regexps for answer and string for repeated query."
;;;
;;; j-or-n-p is similar to y-or-n-p. If optional argument QUITTABLE is
;;; non-nil C-g will abort.
;;; j-or-n-p is similar to y-or-n-p.
;;;
(defun j-or-n-p (prompt &optional quittable)
(defun j-or-n-p (prompt)
"Same as y-or-n-p but language-dependent.
Uses lyskom-message, lyskom-read-string to do interaction and
lyskom-get-string to retrieve regexps for answer and string for repeated query."
......@@ -3070,12 +3068,11 @@ lyskom-get-string to retrieve regexps for answer and string for repeated query."
(while (and (not (char-in-string input-char
(lyskom-get-string 'y-or-n-instring)))
(not (and (or (eq input-char ?\C-g)
(not (or (eq input-char ?\C-g)
(eq 'keyboard-quit
(lyskom-lookup-key (current-local-map)
input-char
t)))
quittable)))
t)))))
(lyskom-message "%s" (concat (if nagging
(lyskom-get-string 'j-or-n-nag)
"")
......@@ -3103,11 +3100,10 @@ lyskom-get-string to retrieve regexps for answer and string for repeated query."
(setq nagging nil)
(setq nagging t)))
(when (and (or (eq input-char ?\C-g)
(eq 'keyboard-quit (lyskom-lookup-key (current-local-map)
input-char
t)))
quittable)
(when (or (eq input-char ?\C-g)
(eq 'keyboard-quit (lyskom-lookup-key (current-local-map)
input-char
t)))
(signal 'quit nil))
(lyskom-message "%s" (concat prompt
......@@ -3122,10 +3118,10 @@ lyskom-get-string to retrieve regexps for answer and string for repeated query."
;;; These versions no longer perform lyskom-end-of-command
;; Author: Linus Tolke
(defun lyskom-j-or-n-p (prompt &optional quittable)
(defun lyskom-j-or-n-p (prompt)
"Same as j-or-n-p but performs lyskom-end-of-command if quit."
(condition-case nil
(j-or-n-p prompt quittable)
(j-or-n-p prompt)
(quit (signal 'quit nil))))
......@@ -3607,8 +3603,8 @@ One parameter - the prompt string."
`(kom-show-unread-in-frame-title
(lyskom-session-has-unreads
(" ("
((lyskom-session-has-unreads ,(lyskom-maybe-recode-string (lyskom-get-string 'frame-title-unread) 'iso-8859-1))
(lyskom-session-has-unread-letters ,(lyskom-maybe-recode-string (lyskom-get-string 'frame-title-letters) 'iso-8859-1)))
((lyskom-session-has-unreads ,(lyskom-maybe-recode-string (lyskom-get-string 'frame-title-unread) 'iso-8859-1 t))
(lyskom-session-has-unread-letters ,(lyskom-maybe-recode-string (lyskom-get-string 'frame-title-letters) 'iso-8859-1 t)))
")"))))
(add-hook 'kill-buffer-hook 'lyskom-remove-buffer-from-lists)
......
......@@ -116,8 +116,7 @@ See lyskom-mode for details."
(if (and (lyskom-buffer-p buffer nil)
(not (prog1
(j-or-n-p (lyskom-get-string
'start-new-session-same-server)
t)
'start-new-session-same-server))
(message ""))))
(progn
(switch-to-buffer buffer)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment