Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 102260. ------------------------------------------------------------ revno: 102260 committer: Sam Steingold branch nick: trunk timestamp: Fri 2010-11-05 15:30:18 -0400 message: chapter, part, section are all DocBook elements diff: === modified file 'etc/schema/schemas.xml' --- etc/schema/schemas.xml 2010-11-04 18:17:38 +0000 +++ etc/schema/schemas.xml 2010-11-05 19:30:18 +0000 @@ -39,7 +39,10 @@ + + + ------------------------------------------------------------ revno: 102259 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-11-05 19:52:06 +0200 message: term.c (append_glyphless_glyph, produce_glyphless_glyph): Remove unused variables. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-05 10:35:36 +0000 +++ src/ChangeLog 2010-11-05 17:52:06 +0000 @@ -1,3 +1,8 @@ +2010-11-05 Eli Zaretskii + + * term.c (append_glyphless_glyph, produce_glyphless_glyph): Remove + unused variables. + 2010-11-05 Adrian Robert * nsterm.m (EmacsView-mouseExited:): Correct error in conditional === modified file 'src/term.c' --- src/term.c 2010-11-01 04:09:26 +0000 +++ src/term.c 2010-11-05 17:52:06 +0000 @@ -1872,8 +1872,6 @@ append_glyphless_glyph (struct it *it, int face_id, char *str) { struct glyph *glyph, *end; - bidi_type_t bidi_type; - int resolved_level; int i; xassert (it->glyph_row); @@ -1951,7 +1949,6 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym) { int face_id; - struct face *face; int width, len; char buf[9], *str = " "; @@ -1989,8 +1986,6 @@ { if (it->glyphless_method == GLYPHLESS_DISPLAY_ACRONYM) { - int i; - if (! STRINGP (acronym) && CHAR_TABLE_P (Vglyphless_char_display)) acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c); buf[0] = '['; ------------------------------------------------------------ revno: 102258 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Fri 2010-11-05 15:17:46 +0100 message: Decode utf-8 strings in mixed environments by default. Done via the new `erc-coding-system-precedence' variable. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-11-03 19:53:47 +0000 +++ etc/NEWS 2010-11-05 14:17:46 +0000 @@ -303,6 +303,11 @@ seconds. The default value, 'ident, means to autojoin immediately after connecting. +*** New variable `erc-coding-system-precedence': If we use `undecided' +as the server coding system, this variable will then be consulted. +The default is to decode strings that can be decoded as utf-8 as +utf-8, and do the normal `undecided' decoding for the rest. + ** In ido-mode, C-v is no longer bound to ido-toggle-vc. The reason is that this interferes with cua-mode. === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2010-10-25 00:04:44 +0000 +++ lisp/erc/ChangeLog 2010-11-05 14:17:46 +0000 @@ -1,3 +1,8 @@ +2010-11-05 Lars Magne Ingebrigtsen + + * erc-backend.el (erc-coding-system-precedence): New variable. + (erc-decode-string-from-target): Use it. + 2010-10-24 Julien Danjou * erc-backend.el (erc-server-JOIN): Set the correct target list on join. === modified file 'lisp/erc/erc-backend.el' --- lisp/erc/erc-backend.el 2010-10-24 21:36:09 +0000 +++ lisp/erc/erc-backend.el 2010-11-05 14:17:46 +0000 @@ -324,6 +324,13 @@ :type 'integer :group 'erc-server) +(defcustom erc-coding-system-precedence '(utf-8 undecided) + "List of coding systems to be preferred when receiving a string from the server. +This will only be consulted if the coding system in +`erc-server-coding-system' is `undecided'." + :group 'erc-server + :type '(repeat coding-system)) + (defcustom erc-server-coding-system (if (and (fboundp 'coding-system-p) (coding-system-p 'undecided) (coding-system-p 'utf-8)) @@ -334,7 +341,9 @@ If a cons, the encoding system for outgoing text is in the car and the decoding system for incoming text is in the cdr. The most -interesting use for this is to put `undecided' in the cdr. +interesting use for this is to put `undecided' in the cdr. This +means that `erc-coding-system-precedence' will be consulted, and the +first match there will be used. If a function, it is called with the argument `target' and should return a coding system or a cons as described above. @@ -705,6 +714,14 @@ (let ((coding (erc-coding-system-for-target target))) (when (consp coding) (setq coding (cdr coding))) + (when (eq coding 'undecided) + (let ((codings (detect-coding-string str)) + (precedence erc-coding-system-precedence)) + (while (and precedence + (not (memq (car precedence) codings))) + (pop precedence)) + (when precedence + (setq coding (car precedence))))) (erc-decode-coding-string str coding))) ;; proposed name, not used by anything yet ------------------------------------------------------------ revno: 102257 committer: Jan D. branch nick: trunk timestamp: Fri 2010-11-05 13:11:12 +0100 message: * mouse.el (mouse-yank-primary): Update comment (Bug#6802). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-05 08:16:55 +0000 +++ lisp/ChangeLog 2010-11-05 12:11:12 +0000 @@ -1,3 +1,7 @@ +2010-11-05 Jan Djärv + + * mouse.el (mouse-yank-primary): Update comment (Bug#6802). + 2010-11-05 Glenn Morris * woman.el (woman0-roff-buffer, woman1-roff-buffer) === modified file 'lisp/mouse.el' --- lisp/mouse.el 2010-10-02 02:46:13 +0000 +++ lisp/mouse.el 2010-11-05 12:11:12 +0000 @@ -1280,7 +1280,7 @@ (or mouse-yank-at-point (mouse-set-point click)) (let ((primary (cond - ((fboundp 'x-get-selection-value) ; MS-DOS and MS-Windows + ((fboundp 'x-get-selection-value) ; MS-DOS, MS-Windows and X. (or (x-get-selection-value) (x-get-selection 'PRIMARY))) ;; FIXME: What about xterm-mouse-mode etc.? ------------------------------------------------------------ revno: 102256 committer: Adrian Robert branch nick: trunk timestamp: Fri 2010-11-05 12:35:36 +0200 message: * nsterm.m (EmacsView-mouseExited:): Correct error in conditional logic pointed out by Eli Zaretskii. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-05 00:01:59 +0000 +++ src/ChangeLog 2010-11-05 10:35:36 +0000 @@ -1,15 +1,26 @@ +2010-11-05 Adrian Robert + + * nsterm.m (EmacsView-mouseExited:): Correct error in conditional + logic pointed out by Eli Zaretskii. + 2010-11-04 Lars Magne Ingebrigtsen * coding.c (coding-category-list): Refer to set-coding-system-priority instead of the obsolete set-coding-priority in the doc string. + 2010-11-04 Adrian Robert - Ismail Donmez (tiny change) + + * nsfont.m (nsfont_draw): Correct previous patch to return + correct value. + * nsimage.m (EmacsImage-setXBMColor:): Correct previous patch: + don't change the method signature, change the return. + +2010-11-04 Ismail Donmez (tiny change) * nsfont.m (nsfont_draw) * nsimage.m (EmacsImage-setXBMColor:) - * nsterm.m (EmacsView-performDragOperation:): Correct empty return - statements. + * nsterm.m (EmacsView-performDragOperation:): Correct empty return. 2010-11-03 Julien Danjou === modified file 'src/nsterm.m' --- src/nsterm.m 2010-11-04 18:10:50 +0000 +++ src/nsterm.m 2010-11-05 10:35:36 +0000 @@ -5313,7 +5313,7 @@ NSTRACE (mouseExited); - if (dpyinfo || !emacsframe) + if (!dpyinfo) return; last_mouse_movement_time = EV_TIMESTAMP (theEvent); ------------------------------------------------------------ revno: 102255 committer: Glenn Morris branch nick: trunk timestamp: Fri 2010-11-05 01:16:55 -0700 message: Quiet, woman. (Sorry...). * lisp/woman.el (woman0-roff-buffer, woman1-roff-buffer) (woman2-roff-buffer): Give local variable `request' a prefix. (woman0-macro): Rename argument `request' in the same way. (woman-request): New name for `request' dynamic variable. (woman-unquote, woman-forward-arg): Update for above name change. (woman1-roff-buffer): Give local variable `unquote' a prefix. (woman1-unquote): New name for `unquote' dynamic variable. (woman1-B-or-I, woman1-alt-fonts): Update for above name change. (woman-translations): Rename from `translations'. No longer global. (woman2-tr, woman-translate): Update for above name change. (woman-translate): Check for bound variable. (woman2-roff-buffer): Give local variable `translations' a prefix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-05 07:41:47 +0000 +++ lisp/ChangeLog 2010-11-05 08:16:55 +0000 @@ -1,5 +1,18 @@ 2010-11-05 Glenn Morris + * woman.el (woman0-roff-buffer, woman1-roff-buffer) + (woman2-roff-buffer): Give local variable `request' a prefix. + (woman0-macro): Rename argument `request' in the same way. + (woman-request): New name for `request' dynamic variable. + (woman-unquote, woman-forward-arg): Update for above name change. + (woman1-roff-buffer): Give local variable `unquote' a prefix. + (woman1-unquote): New name for `unquote' dynamic variable. + (woman1-B-or-I, woman1-alt-fonts): Update for above name change. + (woman-translations): Rename from `translations'. No longer global. + (woman2-tr, woman-translate): Update for above name change. + (woman-translate): Check for bound variable. + (woman2-roff-buffer): Give local variable `translations' a prefix. + * play/doctor.el: Give all local variables a prefix. Update callers. (doc$, doctor-put-meaning): Use backquote. === modified file 'lisp/woman.el' --- lisp/woman.el 2010-10-24 21:36:09 +0000 +++ lisp/woman.el 2010-11-05 08:16:55 +0000 @@ -2475,23 +2475,23 @@ Start at FROM and re-scan new text as appropriate." (goto-char from) (let ((woman0-if-to (make-marker)) - request woman0-macro-alist + woman-request woman0-macro-alist (woman0-search-regex-start woman0-search-regex-start) (woman0-search-regex (concat woman0-search-regex-start woman0-search-regex-end)) woman0-rename-alist) (set-marker-insertion-type woman0-if-to t) (while (re-search-forward woman0-search-regex nil t) - (setq request (match-string 1)) - (cond ((string= request "ig") (woman0-ig)) - ((string= request "if") (woman0-if "if")) - ((string= request "ie") (woman0-if "ie")) - ((string= request "el") (woman0-el)) - ((string= request "so") (woman0-so)) - ((string= request "rn") (woman0-rn)) - ((string= request "de") (woman0-de)) - ((string= request "am") (woman0-de 'append)) - (t (woman0-macro request)))) + (setq woman-request (match-string 1)) + (cond ((string= woman-request "ig") (woman0-ig)) + ((string= woman-request "if") (woman0-if "if")) + ((string= woman-request "ie") (woman0-if "ie")) + ((string= woman-request "el") (woman0-el)) + ((string= woman-request "so") (woman0-so)) + ((string= woman-request "rn") (woman0-rn)) + ((string= woman-request "de") (woman0-de)) + ((string= woman-request "am") (woman0-de 'append)) + (t (woman0-macro woman-request)))) (set-marker woman0-if-to nil) (woman0-rename) ;; Should now re-run `woman0-roff-buffer' if any renaming was @@ -2522,6 +2522,7 @@ (goto-char from) ; necessary! (woman2-process-escapes to 'numeric)) +;; request does not appear to be used dynamically by any callees. (defun woman0-if (request) ".if/ie c anything -- Discard unless c evaluates to true. Remember condition for use by a subsequent `.el'. @@ -2573,6 +2574,7 @@ (woman-if-ignore woman0-if-to request) ; ERROR! (woman-if-body request woman0-if-to (eq c negated))))) +;; request is not used dynamically by any callees. (defun woman-if-body (request to delete) ; should be reversed as `accept'? "Process if-body, including \\{ ... \\}. REQUEST is the invoking directive without the leading dot. @@ -2629,6 +2631,7 @@ (if (looking-at "[ \t]*\\{") (search-forward "\\}")) (forward-line 1)))) +;; request is not used dynamically by any callees. (defun woman-if-ignore (to request) "Ignore but warn about an if request ending at TO, named REQUEST." (WoMan-warn-ignored request "ignored -- condition not handled!") @@ -2760,15 +2763,17 @@ (beginning-of-line) ; delete .de/am line (woman-delete-line 1)) -(defun woman0-macro (request) - "Process the macro call named REQUEST." +;; request may be used dynamically (woman-interpolate-macro calls +;; woman-forward-arg). +(defun woman0-macro (woman-request) + "Process the macro call named WOMAN-REQUEST." ;; Leaves point at start of new text. - (let ((macro (assoc request woman0-macro-alist))) + (let ((macro (assoc woman-request woman0-macro-alist))) (if macro (woman-interpolate-macro (cdr macro)) ;; SHOULD DELETE THE UNINTERPRETED REQUEST!!!!! ;; Output this message once only per call (cf. strings)? - (WoMan-warn "Undefined macro %s not interpolated!" request)))) + (WoMan-warn "Undefined macro %s not interpolated!" woman-request)))) (defun woman-interpolate-macro (macro) "Interpolate (.de) or append (.am) expansion of MACRO into the buffer." @@ -2985,8 +2990,10 @@ ;;; Formatting macros that do not cause a break: -(defvar request) ; Bound locally by woman1-roff-buffer -(defvar unquote) ; Bound locally by woman1-roff-buffer +;; Bound locally by woman[012]-roff-buffer, and also, annoyingly and +;; confusingly, as a function argument. Use dynamically in +;; woman-unquote and woman-forward-arg. +(defvar woman-request) (defun woman-unquote (to) "Delete any double-quote characters between point and TO. @@ -3001,7 +3008,7 @@ (setq in-quote (not in-quote)) )) (if in-quote - (WoMan-warn "Unpaired \" in .%s arguments." request)))) + (WoMan-warn "Unpaired \" in .%s arguments." woman-request)))) (defsubst woman-unquote-args () "Delete any double-quote characters up to the end of the line." @@ -3010,7 +3017,7 @@ (defun woman1-roff-buffer () "Process non-breaking requests." (let ((case-fold-search t) - request fn unquote) + woman-request fn woman1-unquote) (while ;; Find next control line: (re-search-forward woman-request-regexp nil t) @@ -3018,14 +3025,14 @@ ;; Construct woman function to call: ((setq fn (intern-soft (concat "woman1-" - (setq request (match-string 1))))) + (setq woman-request (match-string 1))))) (if (get fn 'notfont) ; not a font-change request (funcall fn) ;; Delete request or macro name: (woman-delete-match 0) ;; If no args then apply to next line else unquote args - ;; (unquote is used by called function): - (setq unquote (not (eolp))) + ;; (woman1-unquote is used by called function): + (setq woman1-unquote (not (eolp))) (if (eolp) (delete-char 1)) ; ;; Hide leading control character in unquoted argument: ; (cond ((memq (following-char) '(?. ?')) @@ -3034,7 +3041,7 @@ ;; Call the appropriate function: (funcall fn) ;; Hide leading control character in quoted argument (only): - (if (and unquote (memq (following-char) '(?. ?'))) + (if (and woman1-unquote (memq (following-char) '(?. ?'))) (insert "\\&")))))))) ;;; Font-changing macros: @@ -3047,6 +3054,8 @@ ".I -- Set words of current line in italic font." (woman1-B-or-I ".ft I\n")) +(defvar woman1-unquote) ; bound locally by woman1-roff-buffer + (defun woman1-B-or-I (B-or-I) ".B/I -- Set words of current line in bold/italic font. B-OR-I is the appropriate complete control line." @@ -3055,7 +3064,7 @@ ;; Return to bol to process .SM/.B, .B/.if etc. ;; or start of first arg to hide leading control char. (save-excursion - (if unquote + (if woman1-unquote (woman-unquote-args) (while (looking-at "^[.']") (forward-line)) (end-of-line) @@ -3102,11 +3111,12 @@ ;; Return to start of first arg to hide leading control char: (save-excursion (setq fonts (cdr fonts)) - (woman-forward-arg unquote 'concat) ; unquote is bound above + ;; woman1-unquote is bound in woman1-roff-buffer. + (woman-forward-arg woman1-unquote 'concat) (while (not (eolp)) (insert (car fonts)) (setq fonts (cdr fonts)) - (woman-forward-arg unquote 'concat)) ; unquote is bound above + (woman-forward-arg woman1-unquote 'concat)) (insert "\\fR"))) (defun woman-forward-arg (&optional unquote concat) @@ -3123,7 +3133,7 @@ (re-search-forward "\"\\|$")) (if (eq (preceding-char) ?\") (if unquote (delete-char -1)) - (WoMan-warn "Unpaired \" in .%s arguments." request))) + (WoMan-warn "Unpaired \" in .%s arguments." woman-request))) ;; (re-search-forward "[^\\\n] \\|$") ; inconsistent (skip-syntax-forward "^ ")) (cond ((null concat) (skip-chars-forward " \t")) ; don't skip eol! @@ -3338,7 +3348,12 @@ ;;; Output translation: -(defvar translations nil) ; Also bound locally by woman2-roff-buffer +;; This is only set by woman2-tr. It is bound locally in woman2-roff-buffer. +;; It is also used by woman-translate. woman-translate may be called +;; outside the scope of woman2-roff-buffer (by experiment). Therefore +;; this used to be globally bound to nil, to avoid an error. Instead +;; we can use bound-and-true-p in woman-translate. +(defvar woman-translations) ;; A list of the form (\"[ace]\" (a . b) (c . d) (e . ?\ )) or nil. (defun woman-get-next-char () @@ -3358,8 +3373,8 @@ ;; This should be an update, but consing onto the front of the alist ;; has the same effect and match duplicates should not matter. ;; Initialize translation data structures: - (let ((matches (car translations)) - (alist (cdr translations)) + (let ((matches (car woman-translations)) + (alist (cdr woman-translations)) a b) ;; `matches' must be a string: (setq matches @@ -3381,15 +3396,15 @@ (if (= (string-to-char matches) ?\]) (substring matches 3) (concat "[" matches)) - translations (cons matches alist)) + woman-translations (cons matches alist)) ;; Format any following text: (woman2-format-paragraphs to))) (defsubst woman-translate (to) "Translate up to marker TO. Do this last of all transformations." - (if translations - (let ((matches (car translations)) - (alist (cdr translations)) + (if (bound-and-true-p woman-translations) + (let ((matches (car woman-translations)) + (alist (cdr woman-translations)) ;; Translations are case-sensitive, eg ".tr ab" does not ;; affect "A" (bug#6849). (case-fold-search nil)) @@ -3633,7 +3648,7 @@ (insert-and-inherit (symbol-function 'insert-and-inherit)) (set-text-properties (symbol-function 'set-text-properties)) (woman-registers woman-registers) - fn request translations + fn woman-request woman-translations tab-stop-list) (set-marker-insertion-type to t) ;; ?roff does not squeeze multiple spaces, but does fill, so... @@ -3649,13 +3664,13 @@ ;; Construct woman function to call: ((setq fn (intern-soft (concat "woman2-" - (setq request (match-string 1))))) + (setq woman-request (match-string 1))))) ;; Delete request or macro name: (woman-delete-match 0)) ;; Unrecognised request: ((prog1 nil - ;; (WoMan-warn ".%s request ignored!" request) - (WoMan-warn-ignored request "ignored!") + ;; (WoMan-warn ".%s request ignored!" woman-request) + (WoMan-warn-ignored woman-request "ignored!") ;; (setq fn 'woman2-LP) ;; AVOID LEAVING A BLANK LINE! ;; (setq fn 'woman2-format-paragraphs) @@ -4486,6 +4501,7 @@ (setq format (apply 'format format args)) (WoMan-log-1 (concat "** " format))) +;; request is not used dynamically by any callees. (defun WoMan-warn-ignored (request ignored) "Log a warning message about ignored directive REQUEST. IGNORED is a string appended to the log message." @@ -4557,5 +4573,4 @@ (provide 'woman) -;; arch-tag: eea35e90-552f-4712-a94b-d9ffd3db7651 ;;; woman.el ends here ------------------------------------------------------------ revno: 102254 committer: Glenn Morris branch nick: trunk timestamp: Fri 2010-11-05 00:41:47 -0700 message: Silence doctor.el compilation. * lisp/play/doctor.el: Give all local variables a prefix. Update callers. (doc$, doctor-put-meaning): Use backquote. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-05 07:34:45 +0000 +++ lisp/ChangeLog 2010-11-05 07:41:47 +0000 @@ -1,5 +1,8 @@ 2010-11-05 Glenn Morris + * play/doctor.el: Give all local variables a prefix. Update callers. + (doc$, doctor-put-meaning): Use backquote. + * emacs-lisp/cl-macs.el (loop): Give local variable args a prefix. (cl-parse-loop-clause, cl-loop-handle-accum): Update for above change. === modified file 'lisp/play/doctor.el' --- lisp/play/doctor.el 2010-01-13 08:35:10 +0000 +++ lisp/play/doctor.el 2010-11-05 07:41:47 +0000 @@ -29,40 +29,94 @@ ;;; Code: -(defvar **mad**) (defvar *debug*) (defvar *print-space*) -(defvar *print-upcase*) (defvar abuselst) (defvar abusewords) -(defvar account) (defvar afraidof) (defvar arerelated) -(defvar areyou) (defvar bak) (defvar beclst) -(defvar bother) (defvar bye) (defvar canyou) -(defvar chatlst) (defvar continue) (defvar deathlst) -(defvar describe) (defvar drnk) (defvar drugs) -(defvar eliza-flag) (defvar elizalst) (defvar famlst) -(defvar feared) (defvar fears) (defvar feelings-about) -(defvar foullst) (defvar found) (defvar hello) -(defvar history) (defvar howareyoulst) (defvar howdyflag) -(defvar huhlst) (defvar ibelieve) (defvar improve) -(defvar inter) (defvar isee) (defvar isrelated) -(defvar lincount) (defvar longhuhlst) (defvar lover) -(defvar machlst) (defvar mathlst) (defvar maybe) -(defvar moods) (defvar neglst) (defvar obj) -(defvar object) (defvar owner) (defvar please) -(defvar problems) (defvar qlist) (defvar random-adjective) -(defvar relation) (defvar remlst) (defvar repetitive-shortness) -(defvar replist) (defvar rms-flag) (defvar schoollst) -(defvar sent) (defvar sexlst) (defvar shortbeclst) -(defvar shortlst) (defvar something) (defvar sportslst) -(defvar stallmanlst) (defvar states) (defvar subj) -(defvar suicide-flag) (defvar sure) (defvar thing) -(defvar things) (defvar thlst) (defvar toklst) -(defvar typos) (defvar verb) (defvar want) -(defvar whatwhen) (defvar whereoutp) (defvar whysay) -(defvar whywant) (defvar zippy-flag) (defvar zippylst) +(defvar doctor--**mad**) +(defvar doctor--*print-space*) +(defvar doctor--*print-upcase*) +(defvar doctor--abuselst) +(defvar doctor--abusewords) +(defvar doctor--afraidof) +(defvar doctor--arerelated) +(defvar doctor--areyou) +(defvar doctor--bak) +(defvar doctor--beclst) +(defvar doctor--bother) +(defvar doctor--bye) +(defvar doctor--canyou) ; unused? +(defvar doctor--chatlst) +(defvar doctor--continue) +(defvar doctor--deathlst) +(defvar doctor--describe) +(defvar doctor--drnk) +(defvar doctor--drugs) +(defvar doctor--eliza-flag) +(defvar doctor--elizalst) +(defvar doctor--famlst) +(defvar doctor--feared) +(defvar doctor--fears) +(defvar doctor--feelings-about) +(defvar doctor--foullst) +(defvar doctor-found) +(defvar doctor--hello) +(defvar doctor--history) +(defvar doctor--howareyoulst) +(defvar doctor--howdyflag) +(defvar doctor--huhlst) +(defvar doctor--ibelieve) +(defvar doctor--improve) +(defvar doctor--inter) +(defvar doctor--isee) +(defvar doctor--isrelated) +(defvar doctor--lincount) +(defvar doctor--longhuhlst) +(defvar doctor--lover) +(defvar doctor--machlst) +(defvar doctor--mathlst) +(defvar doctor--maybe) +(defvar doctor--moods) +(defvar doctor--neglst) +(defvar doctor-obj) +(defvar doctor-object) +(defvar doctor-owner) +(defvar doctor--please) +(defvar doctor--problems) +(defvar doctor--qlist) +(defvar doctor--random-adjective) +(defvar doctor--relation) +(defvar doctor--remlst) +(defvar doctor--repetitive-shortness) +(defvar doctor--replist) +(defvar doctor--rms-flag) +(defvar doctor--schoollst) +(defvar doctor-sent) +(defvar doctor--sexlst) +(defvar doctor--shortbeclst) +(defvar doctor--shortlst) +(defvar doctor--something) +(defvar doctor--sportslst) +(defvar doctor--stallmanlst) +(defvar doctor--states) +(defvar doctor-subj) +(defvar doctor--suicide-flag) +(defvar doctor--sure) +(defvar doctor--thing) +(defvar doctor--things) +(defvar doctor--thlst) +(defvar doctor--toklst) +(defvar doctor--typos) +(defvar doctor-verb) +(defvar doctor--want) +(defvar doctor--whatwhen) +(defvar doctor--whereoutp) +(defvar doctor--whysay) +(defvar doctor--whywant) +(defvar doctor--zippy-flag) +(defvar doctor--zippylst) (defun doc// (x) x) (defmacro doc$ (what) "quoted arg form of doctor-$" - (list 'doctor-$ (list 'quote what))) + `(doctor-$ ',what)) (defun doctor-$ (what) "Return the car of a list, rotating the list each time" @@ -86,484 +140,411 @@ (make-doctor-variables) (turn-on-auto-fill) (doctor-type '(i am the psychotherapist \. - (doc$ please) (doc$ describe) your (doc$ problems) \. + (doc$ doctor--please) (doc$ doctor--describe) your (doc$ doctor--problems) \. each time you are finished talking, type \R\E\T twice \.)) (insert "\n")) (defun make-doctor-variables () - (make-local-variable 'typos) - (setq typos - (mapcar (function (lambda (x) - (put (car x) 'doctor-correction (cadr x)) - (put (cadr x) 'doctor-expansion (car (cddr x))) - (car x))) - '((theyll they\'ll (they will)) - (theyre they\'re (they are)) - (hes he\'s (he is)) - (he7s he\'s (he is)) - (im i\'m (you are)) - (i7m i\'m (you are)) - (isa is\ a (is a)) - (thier their (their)) - (dont don\'t (do not)) - (don7t don\'t (do not)) - (you7re you\'re (i am)) - (you7ve you\'ve (i have)) - (you7ll you\'ll (i will))))) - (make-local-variable 'found) - (setq found nil) - (make-local-variable 'owner) - (setq owner nil) - (make-local-variable 'history) - (setq history nil) - (make-local-variable '*debug*) - (setq *debug* nil) - (make-local-variable 'inter) - (setq inter - '((well\,) - (hmmm \.\.\.\ so\,) - (so) - (\.\.\.and) - (then))) - (make-local-variable 'continue) - (setq continue - '((continue) - (proceed) - (go on) - (keep going) )) - (make-local-variable 'relation) - (setq relation - '((your relationship with) - (something you remember about) - (your feelings toward) - (some experiences you have had with) - (how you feel about))) - (make-local-variable 'fears) - (setq fears '( ((doc$ whysay) you are (doc$ afraidof) (doc// feared) \?) - (you seem terrified by (doc// feared) \.) - (when did you first feel (doc$ afraidof) (doc// feared) \?) )) - (make-local-variable 'sure) - (setq sure '((sure)(positive)(certain)(absolutely sure))) - (make-local-variable 'afraidof) - (setq afraidof '( (afraid of) (frightened by) (scared of) )) - (make-local-variable 'areyou) - (setq areyou '( (are you)(have you been)(have you been) )) - (make-local-variable 'isrelated) - (setq isrelated '( (has something to do with)(is related to) - (could be the reason for) (is caused by)(is because of))) - (make-local-variable 'arerelated) - (setq arerelated '((have something to do with)(are related to) - (could have caused)(could be the reason for) (are caused by) - (are because of))) - (make-local-variable 'moods) - (setq moods '( ((doc$ areyou)(doc// found) often \?) - (what causes you to be (doc// found) \?) - ((doc$ whysay) you are (doc// found) \?) )) - (make-local-variable 'maybe) - (setq maybe - '((maybe) - (perhaps) - (possibly))) - (make-local-variable 'whatwhen) - (setq whatwhen - '((what happened when) - (what would happen if))) - (make-local-variable 'hello) - (setq hello - '((how do you do \?) (hello \.) (howdy!) (hello \.) (hi \.) (hi there \.))) - (make-local-variable 'drnk) - (setq drnk - '((do you drink a lot of (doc// found) \?) - (do you get drunk often \?) - ((doc$ describe) your drinking habits \.) )) - (make-local-variable 'drugs) - (setq drugs '( (do you use (doc// found) often \?)((doc$ areyou) - addicted to (doc// found) \?)(do you realize that drugs can - be very harmful \?)((doc$ maybe) you should try to quit using (doc// found) - \.))) - (make-local-variable 'whywant) - (setq whywant '( ((doc$ whysay) (doc// subj) might (doc$ want) (doc// obj) \?) - (how does it feel to want \?) - (why should (doc// subj) get (doc// obj) \?) - (when did (doc// subj) first (doc$ want) (doc// obj) \?) - ((doc$ areyou) obsessed with (doc// obj) \?) - (why should i give (doc// obj) to (doc// subj) \?) - (have you ever gotten (doc// obj) \?) )) - (make-local-variable 'canyou) - (setq canyou '((of course i can \.) - (why should i \?) - (what makes you think i would even want to \?) - (i am the doctor\, i can do anything i damn please \.) - (not really\, it\'s not up to me \.) - (depends\, how important is it \?) - (i could\, but i don\'t think it would be a wise thing to do \.) - (can you \?) - (maybe i can\, maybe i can\'t \.\.\.) - (i don\'t think i should do that \.))) - (make-local-variable 'want) - (setq want '( (want) (desire) (wish) (want) (hope) )) - (make-local-variable 'shortlst) - (setq shortlst - '((can you elaborate on that \?) - ((doc$ please) continue \.) - (go on\, don\'t be afraid \.) - (i need a little more detail please \.) - (you\'re being a bit brief\, (doc$ please) go into detail \.) - (can you be more explicit \?) - (and \?) - ((doc$ please) go into more detail \?) - (you aren\'t being very talkative today\!) - (is that all there is to it \?) - (why must you respond so briefly \?))) - - (make-local-variable 'famlst) - (setq famlst - '((tell me (doc$ something) about (doc// owner) family \.) - (you seem to dwell on (doc// owner) family \.) - ((doc$ areyou) hung up on (doc// owner) family \?))) - (make-local-variable 'huhlst) - (setq huhlst - '(((doc$ whysay)(doc// sent) \?) - (is it because of (doc$ things) that you say (doc// sent) \?) )) - (make-local-variable 'longhuhlst) - (setq longhuhlst - '(((doc$ whysay) that \?) - (i don\'t understand \.) - ((doc$ thlst)) - ((doc$ areyou) (doc$ afraidof) that \?))) - (make-local-variable 'feelings-about) - (setq feelings-about - '((feelings about) - (apprehensions toward) - (thoughts on) - (emotions toward))) - (make-local-variable 'random-adjective) - (setq random-adjective - '((vivid) - (emotionally stimulating) - (exciting) - (boring) - (interesting) - (recent) - (random) ;How can we omit this? - (unusual) - (shocking) - (embarrassing))) - (make-local-variable 'whysay) - (setq whysay - '((why do you say) - (what makes you believe) - (are you sure that) - (do you really think) - (what makes you think) )) - (make-local-variable 'isee) - (setq isee - '((i see \.\.\.) - (yes\,) - (i understand \.) - (oh \.) )) - (make-local-variable 'please) - (setq please - '((please\,) - (i would appreciate it if you would) - (perhaps you could) - (please\,) - (would you please) - (why don\'t you) - (could you))) - (make-local-variable 'bye) - (setq bye - '((my secretary will send you a bill \.) - (bye bye \.) - (see ya \.) - (ok\, talk to you some other time \.) - (talk to you later \.) - (ok\, have fun \.) - (ciao \.))) - (make-local-variable 'something) - (setq something - '((something) - (more) - (how you feel))) - (make-local-variable 'thing) - (setq thing - '((your life) - (your sex life))) - (make-local-variable 'things) - (setq things - '((your plans) - (the people you hang around with) - (problems at school) - (any hobbies you have) - (hangups you have) - (your inhibitions) - (some problems in your childhood) - (some problems at home))) - (make-local-variable 'describe) - (setq describe - '((describe) - (tell me about) - (talk about) - (discuss) - (tell me more about) - (elaborate on))) - (make-local-variable 'ibelieve) - (setq ibelieve - '((i believe) (i think) (i have a feeling) (it seems to me that) - (it looks like))) - (make-local-variable 'problems) - (setq problems '( (problems) - (inhibitions) - (hangups) - (difficulties) - (anxieties) - (frustrations) )) - (make-local-variable 'bother) - (setq bother - '((does it bother you that) - (are you annoyed that) - (did you ever regret) - (are you sorry) - (are you satisfied with the fact that))) - (make-local-variable 'machlst) - (setq machlst - '((you have your mind on (doc// found) \, it seems \.) - (you think too much about (doc// found) \.) - (you should try taking your mind off of (doc// found)\.) - (are you a computer hacker \?))) - (make-local-variable 'qlist) - (setq qlist - '((what do you think \?) - (i\'ll ask the questions\, if you don\'t mind!) - (i could ask the same thing myself \.) - ((doc$ please) allow me to do the questioning \.) - (i have asked myself that question many times \.) - ((doc$ please) try to answer that question yourself \.))) - (make-local-variable 'foullst) - (setq foullst - '(((doc$ please) watch your tongue!) - ((doc$ please) avoid such unwholesome thoughts \.) - ((doc$ please) get your mind out of the gutter \.) - (such lewdness is not appreciated \.))) - (make-local-variable 'deathlst) - (setq deathlst - '((this is not a healthy way of thinking \.) - ((doc$ bother) you\, too\, may die someday \?) - (i am worried by your obsession with this topic!) - (did you watch a lot of crime and violence on television as a child \?)) - ) - (make-local-variable 'sexlst) - (setq sexlst - '(((doc$ areyou) (doc$ afraidof) sex \?) - ((doc$ describe)(doc$ something) about your sexual history \.) - ((doc$ please)(doc$ describe) your sex life \.\.\.) - ((doc$ describe) your (doc$ feelings-about) your sexual partner \.) - ((doc$ describe) your most (doc$ random-adjective) sexual experience \.) - ((doc$ areyou) satisfied with (doc// lover) \.\.\. \?))) - (make-local-variable 'neglst) - (setq neglst - '((why not \?) - ((doc$ bother) i ask that \?) - (why not \?) - (why not \?) - (how come \?) - ((doc$ bother) i ask that \?))) - (make-local-variable 'beclst) - (setq beclst '( - (is it because (doc// sent) that you came to me \?) - ((doc$ bother)(doc// sent) \?) - (when did you first know that (doc// sent) \?) - (is the fact that (doc// sent) the real reason \?) - (does the fact that (doc// sent) explain anything else \?) - ((doc$ areyou)(doc$ sure)(doc// sent) \? ) )) - (make-local-variable 'shortbeclst) - (setq shortbeclst '( - ((doc$ bother) i ask you that \?) - (that\'s not much of an answer!) - ((doc$ inter) why won\'t you talk about it \?) - (speak up!) - ((doc$ areyou) (doc$ afraidof) talking about it \?) - (don\'t be (doc$ afraidof) elaborating \.) - ((doc$ please) go into more detail \.))) - (make-local-variable 'thlst) - (setq thlst '( - ((doc$ maybe)(doc$ thing)(doc$ isrelated) this \.) - ((doc$ maybe)(doc$ things)(doc$ arerelated) this \.) - (is it because of (doc$ things) that you are going through all this \?) - (how do you reconcile (doc$ things) \? ) - ((doc$ maybe) this (doc$ isrelated)(doc$ things) \?) )) - (make-local-variable 'remlst) - (setq remlst '( (earlier you said (doc$ history) \?) - (you mentioned that (doc$ history) \?) - ((doc$ whysay)(doc$ history) \? ) )) - (make-local-variable 'toklst) - (setq toklst - '((is this how you relax \?) - (how long have you been smoking grass \?) - ((doc$ areyou) (doc$ afraidof) of being drawn to using harder stuff \?))) - (make-local-variable 'states) - (setq states - '((do you get (doc// found) often \?) - (do you enjoy being (doc// found) \?) - (what makes you (doc// found) \?) - (how often (doc$ areyou)(doc// found) \?) - (when were you last (doc// found) \?))) - (make-local-variable 'replist) - (setq replist - '((i . (you)) - (my . (your)) - (me . (you)) - (you . (me)) - (your . (my)) - (mine . (yours)) - (yours . (mine)) - (our . (your)) - (ours . (yours)) - (we . (you)) - (dunno . (do not know)) -;; (yes . ()) - (no\, . ()) - (yes\, . ()) - (ya . (i)) - (aint . (am not)) - (wanna . (want to)) - (gimme . (give me)) - (gotta . (have to)) - (gonna . (going to)) - (never . (not ever)) - (doesn\'t . (does not)) - (don\'t . (do not)) - (aren\'t . (are not)) - (isn\'t . (is not)) - (won\'t . (will not)) - (can\'t . (cannot)) - (haven\'t . (have not)) - (i\'m . (you are)) - (ourselves . (yourselves)) - (myself . (yourself)) - (yourself . (myself)) - (you\'re . (i am)) - (you\'ve . (i have)) - (i\'ve . (you have)) - (i\'ll . (you will)) - (you\'ll . (i shall)) - (i\'d . (you would)) - (you\'d . (i would)) - (here . (there)) - (please . ()) - (eh\, . ()) - (eh . ()) - (oh\, . ()) - (oh . ()) - (shouldn\'t . (should not)) - (wouldn\'t . (would not)) - (won\'t . (will not)) - (hasn\'t . (has not)))) - (make-local-variable 'stallmanlst) - (setq stallmanlst '( - ((doc$ describe) your (doc$ feelings-about) him \.) - ((doc$ areyou) a friend of Stallman \?) - ((doc$ bother) Stallman is (doc$ random-adjective) \?) - ((doc$ ibelieve) you are (doc$ afraidof) him \.))) - (make-local-variable 'schoollst) - (setq schoollst '( - ((doc$ describe) your (doc// found) \.) - ((doc$ bother) your grades could (doc$ improve) \?) - ((doc$ areyou) (doc$ afraidof) (doc// found) \?) - ((doc$ maybe) this (doc$ isrelated) to your attitude \.) - ((doc$ areyou) absent often \?) - ((doc$ maybe) you should study (doc$ something) \.))) - (make-local-variable 'improve) - (setq improve '((improve) (be better) (be improved) (be higher))) - (make-local-variable 'elizalst) - (setq elizalst '( - ((doc$ areyou) (doc$ sure) \?) - ((doc$ ibelieve) you have (doc$ problems) with (doc// found) \.) - ((doc$ whysay) (doc// sent) \?))) - (make-local-variable 'sportslst) - (setq sportslst '( - (tell me (doc$ something) about (doc// found) \.) - ((doc$ describe) (doc$ relation) (doc// found) \.) - (do you find (doc// found) (doc$ random-adjective) \?))) - (make-local-variable 'mathlst) - (setq mathlst '( - ((doc$ describe) (doc$ something) about math \.) - ((doc$ maybe) your (doc$ problems) (doc$ arerelated) (doc// found) \.) - (i don\'t know much (doc// found) \, but (doc$ continue) - anyway \.))) - (make-local-variable 'zippylst) - (setq zippylst '( - ((doc$ areyou) Zippy \?) - ((doc$ ibelieve) you have some serious (doc$ problems) \.) - ((doc$ bother) you are a pinhead \?))) - (make-local-variable 'chatlst) - (setq chatlst '( - ((doc$ maybe) we could chat \.) - ((doc$ please) (doc$ describe) (doc$ something) about chat mode \.) - ((doc$ bother) our discussion is so (doc$ random-adjective) \?))) - (make-local-variable 'abuselst) - (setq abuselst '( - ((doc$ please) try to be less abusive \.) - ((doc$ describe) why you call me (doc// found) \.) - (i\'ve had enough of you!))) - (make-local-variable 'abusewords) - (setq abusewords '(boring bozo clown clumsy cretin dumb dummy - fool foolish gnerd gnurd idiot jerk - lose loser louse lousy luse luser - moron nerd nurd oaf oafish reek - stink stupid tool toolish twit)) - (make-local-variable 'howareyoulst) - (setq howareyoulst '((how are you) (hows it going) (hows it going eh) - (how\'s it going) (how\'s it going eh) (how goes it) - (whats up) (whats new) (what\'s up) (what\'s new) - (howre you) (how\'re you) (how\'s everything) - (how is everything) (how do you do) - (how\'s it hanging) (que pasa) - (how are you doing) (what do you say))) - (make-local-variable 'whereoutp) - (setq whereoutp '( huh remem rthing ) ) - (make-local-variable 'subj) - (setq subj nil) - (make-local-variable 'verb) - (setq verb nil) - (make-local-variable 'obj) - (setq obj nil) - (make-local-variable 'feared) - (setq feared nil) - (make-local-variable 'repetitive-shortness) - (setq repetitive-shortness '(0 . 0)) - (make-local-variable '**mad**) - (setq **mad** nil) - (make-local-variable 'rms-flag) - (setq rms-flag nil) - (make-local-variable 'eliza-flag) - (setq eliza-flag nil) - (make-local-variable 'zippy-flag) - (setq zippy-flag nil) - (make-local-variable 'suicide-flag) - (setq suicide-flag nil) - (make-local-variable 'lover) - (setq lover '(your partner)) - (make-local-variable 'bak) - (setq bak nil) - (make-local-variable 'lincount) - (setq lincount 0) - (make-local-variable '*print-upcase*) - (setq *print-upcase* nil) - (make-local-variable '*print-space*) - (setq *print-space* nil) - (make-local-variable 'howdyflag) - (setq howdyflag nil) - (make-local-variable 'object) - (setq object nil)) + (set (make-local-variable 'doctor--typos) + (mapcar (lambda (x) + (put (car x) 'doctor-correction (cadr x)) + (put (cadr x) 'doctor-expansion (car (cddr x))) + (car x)) + '((theyll they\'ll (they will)) + (theyre they\'re (they are)) + (hes he\'s (he is)) + (he7s he\'s (he is)) + (im i\'m (you are)) + (i7m i\'m (you are)) + (isa is\ a (is a)) + (thier their (their)) + (dont don\'t (do not)) + (don7t don\'t (do not)) + (you7re you\'re (i am)) + (you7ve you\'ve (i have)) + (you7ll you\'ll (i will))))) + (set (make-local-variable 'doctor-found) nil) + (set (make-local-variable 'doctor-owner) nil) + (set (make-local-variable 'doctor--history) nil) + (set (make-local-variable 'doctor--inter) '((well\,) + (hmmm \.\.\.\ so\,) + (so) + (\.\.\.and) + (then))) + (set (make-local-variable 'doctor--continue) '((continue) + (proceed) + (go on) + (keep going))) + (set (make-local-variable 'doctor--relation) + '((your relationship with) + (something you remember about) + (your feelings toward) + (some experiences you have had with) + (how you feel about))) + (set (make-local-variable 'doctor--fears) + '(((doc$ doctor--whysay) you are (doc$ doctor--afraidof) (doc// doctor--feared) \?) + (you seem terrified by (doc// doctor--feared) \.) + (when did you first feel (doc$ doctor--afraidof) (doc// doctor--feared) \?))) + (set (make-local-variable 'doctor--sure) '((sure) + (positive) + (certain) + (absolutely sure))) + (set (make-local-variable 'doctor--afraidof) '((afraid of) + (frightened by) + (scared of))) + (set (make-local-variable 'doctor--areyou) '((are you) + (have you been) + (have you been))) + (set (make-local-variable 'doctor--isrelated) + '((has something to do with) + (is related to) + (could be the reason for) + (is caused by) + (is because of))) + (set (make-local-variable 'doctor--arerelated) '((have something to do with) + (are related to) + (could have caused) + (could be the reason for) + (are caused by) + (are because of))) + (set (make-local-variable 'doctor--moods) + '(((doc$ doctor--areyou) (doc// doctor-found) often \?) + (what causes you to be (doc// doctor-found) \?) + ((doc$ doctor--whysay) you are (doc// doctor-found) \?))) + (set (make-local-variable 'doctor--maybe) '((maybe) + (perhaps) + (possibly))) + (set (make-local-variable 'doctor--whatwhen) '((what happened when) + (what would happen if))) + (set (make-local-variable 'doctor--hello) '((how do you do \?) + (hello \.) + (howdy!) + (hello \.) + (hi \.) + (hi there \.))) + (set (make-local-variable 'doctor--drnk) + '((do you drink a lot of (doc// doctor-found) \?) + (do you get drunk often \?) + ((doc$ doctor--describe) your drinking habits \.))) + (set (make-local-variable 'doctor--drugs) + '((do you use (doc// doctor-found) often \?) + ((doc$ doctor--areyou) addicted to (doc// doctor-found) \?) + (do you realize that drugs can be very harmful \?) + ((doc$ doctor--maybe) you should try to quit using (doc// doctor-found) \.))) + (set (make-local-variable 'doctor--whywant) + '(((doc$ doctor--whysay) (doc// doctor-subj) might (doc$ doctor--want) (doc// doctor-obj) \?) + (how does it feel to want \?) + (why should (doc// doctor-subj) get (doc// doctor-obj) \?) + (when did (doc// doctor-subj) first (doc$ doctor--want) (doc// doctor-obj) \?) + ((doc$ doctor--areyou) obsessed with (doc// doctor-obj) \?) + (why should i give (doc// doctor-obj) to (doc// doctor-subj) \?) + (have you ever gotten (doc// doctor-obj) \?))) + (set (make-local-variable 'doctor--canyou) + '((of course i can \.) + (why should i \?) + (what makes you think i would even want to \?) + (i am the doctor\, i can do anything i damn please \.) + (not really\, it\'s not up to me \.) + (depends\, how important is it \?) + (i could\, but i don\'t think it would be a wise thing to do \.) + (can you \?) + (maybe i can\, maybe i can\'t \.\.\.) + (i don\'t think i should do that \.))) + (set (make-local-variable 'doctor--want) '((want) (desire) (wish) (want) (hope))) + (set (make-local-variable 'doctor--shortlst) + '((can you elaborate on that \?) + ((doc$ doctor--please) continue \.) + (go on\, don\'t be afraid \.) + (i need a little more detail please \.) + (you\'re being a bit brief\, (doc$ doctor--please) go into detail \.) + (can you be more explicit \?) + (and \?) + ((doc$ doctor--please) go into more detail \?) + (you aren\'t being very talkative today\!) + (is that all there is to it \?) + (why must you respond so briefly \?))) + (set (make-local-variable 'doctor--famlst) + '((tell me (doc$ doctor--something) about (doc// doctor-owner) family \.) + (you seem to dwell on (doc// doctor-owner) family \.) + ((doc$ doctor--areyou) hung up on (doc// doctor-owner) family \?))) + (set (make-local-variable 'doctor--huhlst) + '(((doc$ doctor--whysay)(doc// doctor-sent) \?) + (is it because of (doc$ doctor--things) that you say (doc// doctor-sent) \?))) + (set (make-local-variable 'doctor--longhuhlst) + '(((doc$ doctor--whysay) that \?) + (i don\'t understand \.) + ((doc$ doctor--thlst)) + ((doc$ doctor--areyou) (doc$ doctor--afraidof) that \?))) + (set (make-local-variable 'doctor--feelings-about) '((feelings about) + (apprehensions toward) + (thoughts on) + (emotions toward))) + (set (make-local-variable 'doctor--random-adjective) + '((vivid) + (emotionally stimulating) + (exciting) + (boring) + (interesting) + (recent) + (random) ; how can we omit this? + (unusual) + (shocking) + (embarrassing))) + (set (make-local-variable 'doctor--whysay) '((why do you say) + (what makes you believe) + (are you sure that) + (do you really think) + (what makes you think))) + (set (make-local-variable 'doctor--isee) '((i see \.\.\.) + (yes\,) + (i understand \.) + (oh \.) )) + (set (make-local-variable 'doctor--please) '((please\,) + (i would appreciate it if you would) + (perhaps you could) + (please\,) + (would you please) + (why don\'t you) + (could you))) + (set (make-local-variable 'doctor--bye) + '((my secretary will send you a bill \.) + (bye bye \.) + (see ya \.) + (ok\, talk to you some other time \.) + (talk to you later \.) + (ok\, have fun \.) + (ciao \.))) + (set (make-local-variable 'doctor--something) '((something) + (more) + (how you feel))) + (set (make-local-variable 'doctor--thing) '((your life) + (your sex life))) + (set (make-local-variable 'doctor--things) '((your plans) + (the people you hang around with) + (problems at school) + (any hobbies you have) + (hangups you have) + (your inhibitions) + (some problems in your childhood) + (some problems at home))) + (set (make-local-variable 'doctor--describe) '((describe) + (tell me about) + (talk about) + (discuss) + (tell me more about) + (elaborate on))) + (set (make-local-variable 'doctor--ibelieve) + '((i believe) (i think) (i have a feeling) (it seems to me that) + (it looks like))) + (set (make-local-variable 'doctor--problems) '((problems) + (inhibitions) + (hangups) + (difficulties) + (anxieties) + (frustrations))) + (set (make-local-variable 'doctor--bother) '((does it bother you that) + (are you annoyed that) + (did you ever regret) + (are you sorry) + (are you satisfied with the fact that))) + (set (make-local-variable 'doctor--machlst) + '((you have your mind on (doc// doctor-found) \, it seems \.) + (you think too much about (doc// doctor-found) \.) + (you should try taking your mind off of (doc// doctor-found)\.) + (are you a computer hacker \?))) + (set (make-local-variable 'doctor--qlist) + '((what do you think \?) + (i\'ll ask the questions\, if you don\'t mind!) + (i could ask the same thing myself \.) + ((doc$ doctor--please) allow me to do the questioning \.) + (i have asked myself that question many times \.) + ((doc$ doctor--please) try to answer that question yourself \.))) + (set (make-local-variable 'doctor--foullst) + '(((doc$ doctor--please) watch your tongue!) + ((doc$ doctor--please) avoid such unwholesome thoughts \.) + ((doc$ doctor--please) get your mind out of the gutter \.) + (such lewdness is not appreciated \.))) + (set (make-local-variable 'doctor--deathlst) + '((this is not a healthy way of thinking \.) + ((doc$ doctor--bother) you\, too\, may die someday \?) + (i am worried by your obsession with this topic!) + (did you watch a lot of crime and violence on television as a child \?))) + (set (make-local-variable 'doctor--sexlst) + '(((doc$ doctor--areyou) (doc$ doctor--afraidof) sex \?) + ((doc$ doctor--describe)(doc$ doctor--something) about your sexual history \.) + ((doc$ doctor--please)(doc$ doctor--describe) your sex life \.\.\.) + ((doc$ doctor--describe) your (doc$ doctor--feelings-about) your sexual partner \.) + ((doc$ doctor--describe) your most (doc$ doctor--random-adjective) sexual experience \.) + ((doc$ doctor--areyou) satisfied with (doc// doctor--lover) \.\.\. \?))) + (set (make-local-variable 'doctor--neglst) '((why not \?) + ((doc$ doctor--bother) i ask that \?) + (why not \?) + (why not \?) + (how come \?) + ((doc$ doctor--bother) i ask that \?))) + (set (make-local-variable 'doctor--beclst) + '((is it because (doc// doctor-sent) that you came to me \?) + ((doc$ doctor--bother)(doc// doctor-sent) \?) + (when did you first know that (doc// doctor-sent) \?) + (is the fact that (doc// doctor-sent) the real reason \?) + (does the fact that (doc// doctor-sent) explain anything else \?) + ((doc$ doctor--areyou)(doc$ doctor--sure)(doc// doctor-sent) \? ))) + (set (make-local-variable 'doctor--shortbeclst) + '(((doc$ doctor--bother) i ask you that \?) + (that\'s not much of an answer!) + ((doc$ doctor--inter) why won\'t you talk about it \?) + (speak up!) + ((doc$ doctor--areyou) (doc$ doctor--afraidof) talking about it \?) + (don\'t be (doc$ doctor--afraidof) elaborating \.) + ((doc$ doctor--please) go into more detail \.))) + (set (make-local-variable 'doctor--thlst) + '(((doc$ doctor--maybe)(doc$ doctor--thing)(doc$ doctor--isrelated) this \.) + ((doc$ doctor--maybe)(doc$ doctor--things)(doc$ doctor--arerelated) this \.) + (is it because of (doc$ doctor--things) that you are going through all this \?) + (how do you reconcile (doc$ doctor--things) \? ) + ((doc$ doctor--maybe) this (doc$ doctor--isrelated)(doc$ doctor--things) \?))) + (set (make-local-variable 'doctor--remlst) + '((earlier you said (doc$ doctor--history) \?) + (you mentioned that (doc$ doctor--history) \?) + ((doc$ doctor--whysay)(doc$ doctor--history) \? ))) + (set (make-local-variable 'doctor--toklst) + '((is this how you relax \?) + (how long have you been smoking grass \?) + ((doc$ doctor--areyou) (doc$ doctor--afraidof) of being drawn to using harder stuff \?))) + (set (make-local-variable 'doctor--states) + '((do you get (doc// doctor-found) often \?) + (do you enjoy being (doc// doctor-found) \?) + (what makes you (doc// doctor-found) \?) + (how often (doc$ doctor--areyou)(doc// doctor-found) \?) + (when were you last (doc// doctor-found) \?))) + (set (make-local-variable 'doctor--replist) '((i . (you)) + (my . (your)) + (me . (you)) + (you . (me)) + (your . (my)) + (mine . (yours)) + (yours . (mine)) + (our . (your)) + (ours . (yours)) + (we . (you)) + (dunno . (do not know)) + ;; (yes . ()) + (no\, . ()) + (yes\, . ()) + (ya . (i)) + (aint . (am not)) + (wanna . (want to)) + (gimme . (give me)) + (gotta . (have to)) + (gonna . (going to)) + (never . (not ever)) + (doesn\'t . (does not)) + (don\'t . (do not)) + (aren\'t . (are not)) + (isn\'t . (is not)) + (won\'t . (will not)) + (can\'t . (cannot)) + (haven\'t . (have not)) + (i\'m . (you are)) + (ourselves . (yourselves)) + (myself . (yourself)) + (yourself . (myself)) + (you\'re . (i am)) + (you\'ve . (i have)) + (i\'ve . (you have)) + (i\'ll . (you will)) + (you\'ll . (i shall)) + (i\'d . (you would)) + (you\'d . (i would)) + (here . (there)) + (please . ()) + (eh\, . ()) + (eh . ()) + (oh\, . ()) + (oh . ()) + (shouldn\'t . (should not)) + (wouldn\'t . (would not)) + (won\'t . (will not)) + (hasn\'t . (has not)))) + (set (make-local-variable 'doctor--stallmanlst) + '(((doc$ doctor--describe) your (doc$ doctor--feelings-about) him \.) + ((doc$ doctor--areyou) a friend of Stallman \?) + ((doc$ doctor--bother) Stallman is (doc$ doctor--random-adjective) \?) + ((doc$ doctor--ibelieve) you are (doc$ doctor--afraidof) him \.))) + (set (make-local-variable 'doctor--schoollst) + '(((doc$ doctor--describe) your (doc// doctor-found) \.) + ((doc$ doctor--bother) your grades could (doc$ doctor--improve) \?) + ((doc$ doctor--areyou) (doc$ doctor--afraidof) (doc// doctor-found) \?) + ((doc$ doctor--maybe) this (doc$ doctor--isrelated) to your attitude \.) + ((doc$ doctor--areyou) absent often \?) + ((doc$ doctor--maybe) you should study (doc$ doctor--something) \.))) + (set (make-local-variable 'doctor--improve) + '((improve) (be better) (be improved) (be higher))) + (set (make-local-variable 'doctor--elizalst) + '(((doc$ doctor--areyou) (doc$ doctor--sure) \?) + ((doc$ doctor--ibelieve) you have (doc$ doctor--problems) with (doc// doctor-found) \.) + ((doc$ doctor--whysay) (doc// doctor-sent) \?))) + (set (make-local-variable 'doctor--sportslst) + '((tell me (doc$ doctor--something) about (doc// doctor-found) \.) + ((doc$ doctor--describe) (doc$ doctor--relation) (doc// doctor-found) \.) + (do you find (doc// doctor-found) (doc$ doctor--random-adjective) \?))) + (set (make-local-variable 'doctor--mathlst) + '(((doc$ doctor--describe) (doc$ doctor--something) about math \.) + ((doc$ doctor--maybe) your (doc$ doctor--problems) (doc$ doctor--arerelated) (doc// doctor-found) \.) + (i don\'t know much (doc// doctor-found) \, but (doc$ doctor--continue) + anyway \.))) + (set (make-local-variable 'doctor--zippylst) + '(((doc$ doctor--areyou) Zippy \?) + ((doc$ doctor--ibelieve) you have some serious (doc$ doctor--problems) \.) + ((doc$ doctor--bother) you are a pinhead \?))) + (set (make-local-variable 'doctor--chatlst) + '(((doc$ doctor--maybe) we could chat \.) + ((doc$ doctor--please) (doc$ doctor--describe) (doc$ doctor--something) about chat mode \.) + ((doc$ doctor--bother) our discussion is so (doc$ doctor--random-adjective) \?))) + (set (make-local-variable 'doctor--abuselst) + '(((doc$ doctor--please) try to be less abusive \.) + ((doc$ doctor--describe) why you call me (doc// doctor-found) \.) + (i\'ve had enough of you!))) + (set (make-local-variable 'doctor--abusewords) + '(boring bozo clown clumsy cretin dumb dummy + fool foolish gnerd gnurd idiot jerk + lose loser louse lousy luse luser + moron nerd nurd oaf oafish reek + stink stupid tool toolish twit)) + (set (make-local-variable 'doctor--howareyoulst) + '((how are you) (hows it going) (hows it going eh) + (how\'s it going) (how\'s it going eh) (how goes it) + (whats up) (whats new) (what\'s up) (what\'s new) + (howre you) (how\'re you) (how\'s everything) + (how is everything) (how do you do) + (how\'s it hanging) (que pasa) + (how are you doing) (what do you say))) + (set (make-local-variable 'doctor--whereoutp) '(huh remem rthing)) + (set (make-local-variable 'doctor-subj) nil) + (set (make-local-variable 'doctor-verb) nil) + (set (make-local-variable 'doctor-obj) nil) + (set (make-local-variable 'doctor--feared) nil) + (set (make-local-variable 'doctor--repetitive-shortness) '(0 . 0)) + (set (make-local-variable 'doctor--**mad**) nil) + (set (make-local-variable 'doctor--rms-flag) nil) + (set (make-local-variable 'doctor--eliza-flag) nil) + (set (make-local-variable 'doctor--zippy-flag) nil) + (set (make-local-variable 'doctor--suicide-flag) nil) + (set (make-local-variable 'doctor--lover) '(your partner)) + (set (make-local-variable 'doctor--bak) nil) + (set (make-local-variable 'doctor--lincount) 0) + (set (make-local-variable 'doctor--*print-upcase*) nil) + (set (make-local-variable 'doctor--*print-space*) nil) + (set (make-local-variable 'doctor--howdyflag) nil) + (set (make-local-variable 'doctor-object) nil)) ;; Define equivalence classes of words that get treated alike. (defun doctor-meaning (x) (get x 'doctor-meaning)) (defmacro doctor-put-meaning (symb val) - "Store the base meaning of a word on the property list." - (list 'put (list 'quote symb) ''doctor-meaning val)) + "Store the base meaning of a word on the property list." + `(put ',symb 'doctor-meaning ,val)) (doctor-put-meaning howdy 'howdy) (doctor-put-meaning hi 'howdy) @@ -855,10 +836,10 @@ (interactive) (let ((sent (doctor-readin))) (insert "\n") - (setq lincount (1+ lincount)) + (setq doctor--lincount (1+ doctor--lincount)) (doctor-doc sent) (insert "\n") - (setq bak sent))) + (setq doctor--bak sent))) (defun doctor-readin nil "Read a sentence. Return it as a list of words." @@ -878,70 +859,70 @@ ;; Main processing function for sentences that have been read. -(defun doctor-doc (sent) +(defun doctor-doc (doctor-sent) (cond - ((equal sent '(foo)) - (doctor-type '(bar! (doc$ please)(doc$ continue) \.))) - ((member sent howareyoulst) - (doctor-type '(i\'m ok \. (doc$ describe) yourself \.))) - ((or (member sent '((good bye) (see you later) (i quit) (so long) + ((equal doctor-sent '(foo)) + (doctor-type '(bar! (doc$ doctor--please)(doc$ doctor--continue) \.))) + ((member doctor-sent doctor--howareyoulst) + (doctor-type '(i\'m ok \. (doc$ doctor--describe) yourself \.))) + ((or (member doctor-sent '((good bye) (see you later) (i quit) (so long) (go away) (get lost))) - (memq (car sent) + (memq (car doctor-sent) '(bye halt break quit done exit goodbye bye\, stop pause goodbye\, stop pause))) - (doctor-type (doc$ bye))) - ((and (eq (car sent) 'you) - (memq (cadr sent) abusewords)) - (setq found (cadr sent)) - (doctor-type (doc$ abuselst))) - ((eq (car sent) 'whatmeans) - (doctor-def (cadr sent))) - ((equal sent '(parse)) - (doctor-type (list 'subj '= subj ", " - 'verb '= verb "\n" - 'object 'phrase '= obj "," - 'noun 'form '= object "\n" - 'current 'keyword 'is found + (doctor-type (doc$ doctor--bye))) + ((and (eq (car doctor-sent) 'you) + (memq (cadr doctor-sent) doctor--abusewords)) + (setq doctor-found (cadr doctor-sent)) + (doctor-type (doc$ doctor--abuselst))) + ((eq (car doctor-sent) 'whatmeans) + (doctor-def (cadr doctor-sent))) + ((equal doctor-sent '(parse)) + (doctor-type (list 'subj '= doctor-subj ", " + 'verb '= doctor-verb "\n" + 'object 'phrase '= doctor-obj "," + 'noun 'form '= doctor-object "\n" + 'current 'keyword 'is doctor-found ", " 'most 'recent 'possessive - 'is owner "\n" + 'is doctor-owner "\n" 'sentence 'used 'was "..." - '(doc// bak)))) - ((memq (car sent) '(are is do has have how when where who why)) - (doctor-type (doc$ qlist))) - ;; ((eq (car sent) 'forget) - ;; (set (cadr sent) nil) - ;; (doctor-type '((doc$ isee)(doc$ please) - ;; (doc$ continue)\.))) + '(doc// doctor--bak)))) + ((memq (car doctor-sent) '(are is do has have how when where who why)) + (doctor-type (doc$ doctor--qlist))) + ;; ((eq (car doctor-sent) 'forget) + ;; (set (cadr doctor-sent) nil) + ;; (doctor-type '((doc$ doctor--isee)(doc$ doctor--please) + ;; (doc$ doctor--continue)\.))) (t - (if (doctor-defq sent) (doctor-define sent found)) - (if (> (length sent) 12)(setq sent (doctor-shorten sent))) - (setq sent (doctor-correct-spelling (doctor-replace sent replist))) - (cond ((and (not (memq 'me sent))(not (memq 'i sent)) - (memq 'am sent)) - (setq sent (doctor-replace sent '((am . (are))))))) - (cond ((equal (car sent) 'yow) (doctor-zippy)) - ((< (length sent) 2) - (cond ((eq (doctor-meaning (car sent)) 'howdy) + (if (doctor-defq doctor-sent) (doctor-define doctor-sent doctor-found)) + (if (> (length doctor-sent) 12)(setq doctor-sent (doctor-shorten doctor-sent))) + (setq doctor-sent (doctor-correct-spelling (doctor-replace doctor-sent doctor--replist))) + (cond ((and (not (memq 'me doctor-sent))(not (memq 'i doctor-sent)) + (memq 'am doctor-sent)) + (setq doctor-sent (doctor-replace doctor-sent '((am . (are))))))) + (cond ((equal (car doctor-sent) 'yow) (doctor-zippy)) + ((< (length doctor-sent) 2) + (cond ((eq (doctor-meaning (car doctor-sent)) 'howdy) (doctor-howdy)) (t (doctor-short)))) (t - (if (memq 'am sent) - (setq sent (doctor-replace sent '((me . (i)))))) - (setq sent (doctor-fixup sent)) - (if (and (eq (car sent) 'do) (eq (cadr sent) 'not)) + (if (memq 'am doctor-sent) + (setq doctor-sent (doctor-replace doctor-sent '((me . (i)))))) + (setq doctor-sent (doctor-fixup doctor-sent)) + (if (and (eq (car doctor-sent) 'do) (eq (cadr doctor-sent) 'not)) (cond ((zerop (random 3)) - (doctor-type '(are you (doc$ afraidof) that \?))) + (doctor-type '(are you (doc$ doctor--afraidof) that \?))) ((zerop (random 2)) (doctor-type '(don\'t tell me what to do \. i am the doctor here!)) (doctor-rthing)) (t - (doctor-type '((doc$ whysay) that i shouldn\'t - (cddr sent) + (doctor-type '((doc$ doctor--whysay) that i shouldn\'t + (cddr doctor-sent) \?)))) - (doctor-go (doctor-wherego sent)))))))) + (doctor-go (doctor-wherego doctor-sent)))))))) ;; Things done to process sentences once read. @@ -949,8 +930,9 @@ "Correct the spelling and expand each word in sentence." (if sent (apply 'append (mapcar (lambda (word) - (if (memq word typos) - (get (get word 'doctor-correction) 'doctor-expansion) + (if (memq word doctor--typos) + (get (get word 'doctor-correction) + 'doctor-expansion) (list word))) sent)))) @@ -972,33 +954,32 @@ (defun doctor-define (sent found) (doctor-svo sent found 1 nil) (and - (doctor-nounp subj) - (not (doctor-pronounp subj)) - subj - (doctor-meaning object) - (put subj 'doctor-meaning (doctor-meaning object)) + (doctor-nounp doctor-subj) + (not (doctor-pronounp doctor-subj)) + doctor-subj + (doctor-meaning doctor-object) + (put doctor-subj 'doctor-meaning (doctor-meaning doctor-object)) t)) (defun doctor-defq (sent) - "Set global var FOUND to first keyword found in sentence SENT." - (setq found nil) + "Set global var DOCTOR-FOUND to first keyword found in sentence SENT." + (setq doctor-found nil) (let ((temp '(means applies mean refers refer related similar defined associated linked like same))) (while temp (if (memq (car temp) sent) - (setq found (car temp) + (setq doctor-found (car temp) temp nil) (setq temp (cdr temp))))) - found) + doctor-found) (defun doctor-def (x) - (progn - (doctor-type (list 'the 'word x 'means (doctor-meaning x) 'to 'me)) - nil)) + (doctor-type (list 'the 'word x 'means (doctor-meaning x) 'to 'me)) + nil) (defun doctor-forget () "Delete the last element of the history list." - (setq history (reverse (cdr (reverse history))))) + (setq doctor--history (reverse (cdr (reverse doctor--history))))) (defun doctor-query (x) "Prompt for a line of input from the minibuffer until a noun or verb is seen. @@ -1026,16 +1007,16 @@ (defun doctor-subjsearch (sent key type) "Search for the subject of a sentence SENT, looking for the noun closest -to and preceding KEY by at least TYPE words. Set global variable subj to +to and preceding KEY by at least TYPE words. Set global variable doctor-subj to the subject noun, and return the portion of the sentence following it." (let ((i (- (length sent) (length (memq key sent)) type))) (while (and (> i -1) (not (doctor-nounp (nth i sent)))) (setq i (1- i))) (cond ((> i -1) - (setq subj (nth i sent)) + (setq doctor-subj (nth i sent)) (nthcdr (1+ i) sent)) (t - (setq subj 'you) + (setq doctor-subj 'you) nil)))) (defun doctor-nounp (x) @@ -1149,12 +1130,12 @@ (t 'something)))) (defun doctor-getnoun (x) - (cond ((null x)(setq object 'something)) - ((atom x)(setq object x)) + (cond ((null x)(setq doctor-object 'something)) + ((atom x)(setq doctor-object x)) ((eq (length x) 1) - (setq object (cond - ((doctor-nounp (setq object (car x))) object) - (t (doctor-query object))))) + (setq doctor-object (cond + ((doctor-nounp (setq doctor-object (car x))) doctor-object) + (t (doctor-query doctor-object))))) ((eq (car x) 'to) (doctor-build 'to\ (doctor-getnoun (cdr x)))) ((doctor-prepp (car x)) @@ -1170,7 +1151,7 @@ (car x) (car x)))))) " ") (doctor-getnoun (cdr x)))) - (t (setq object (car x)) + (t (setq doctor-object (car x)) (doctor-build (doctor-build (car x) " ") (doctor-getnoun (cdr x)))) )) @@ -1238,9 +1219,9 @@ under underneath with without))) (defun doctor-remember (thing) - (cond ((null history) - (setq history (list thing))) - (t (setq history (append history (list thing)))))) + (cond ((null doctor--history) + (setq doctor--history (list thing))) + (t (setq doctor--history (append doctor--history (list thing)))))) (defun doctor-type (x) (setq x (doctor-fix-2 x)) @@ -1317,57 +1298,58 @@ element pair in RLIST." (apply 'append (mapcar - (function (lambda (x) (cdr (or (assq x rlist) ; either find a replacement - (list x x))))) ; or fake an identity mapping - sent))) + (list x x)))) ; or fake an identity mapping + sent))) (defun doctor-wherego (sent) - (cond ((null sent)(doc$ whereoutp)) + (cond ((null sent)(doc$ doctor--whereoutp)) ((null (doctor-meaning (car sent))) (doctor-wherego (cond ((zerop (random 2)) (reverse (cdr sent))) (t (cdr sent))))) (t - (setq found (car sent)) + (setq doctor-found (car sent)) (doctor-meaning (car sent))))) (defun doctor-svo (sent key type mem) "Find subject, verb and object in sentence SENT with focus on word KEY. TYPE is number of words preceding KEY to start looking for subject. MEM is t if results are to be put on Doctor's memory stack. -Return in the global variables SUBJ, VERB and OBJECT." +Return in the global variables DOCTOR-SUBJ, DOCTOR-VERB, DOCTOR-OBJECT, +and DOCTOR-OBJ." (let ((foo (doctor-subjsearch sent key type))) (or foo (setq foo sent mem nil)) (while (and (null (doctor-verbp (car foo))) (cdr foo)) (setq foo (cdr foo))) - (setq verb (car foo)) - (setq obj (doctor-getnoun (cdr foo))) - (cond ((eq object 'i)(setq object 'me)) - ((eq subj 'me)(setq subj 'i))) - (cond (mem (doctor-remember (list subj verb obj)))))) + (setq doctor-verb (car foo)) + (setq doctor-obj (doctor-getnoun (cdr foo))) + (cond ((eq doctor-object 'i)(setq doctor-object 'me)) + ((eq doctor-subj 'me)(setq doctor-subj 'i))) + (cond (mem (doctor-remember (list doctor-subj doctor-verb doctor-obj)))))) (defun doctor-possess (sent key) "Set possessive in SENT for keyword KEY. -Hack on previous word, setting global variable OWNER to correct result." +Hack on previous word, setting global variable DOCTOR-OWNER to correct result." (let* ((i (- (length sent) (length (memq key sent)) 1)) (prev (if (< i 0) 'your (nth i sent)))) - (setq owner (if (or (doctor-possessivepronounp prev) - (string-equal "s" - (substring (doctor-make-string prev) - -1))) - prev - 'your)))) + (setq doctor-owner + (if (or (doctor-possessivepronounp prev) + (string-equal "s" + (substring (doctor-make-string prev) + -1))) + prev + 'your)))) ;; Output of replies. (defun doctor-txtype (ans) "Output to buffer a list of symbols or strings as a sentence." - (setq *print-upcase* t *print-space* nil) + (setq doctor--*print-upcase* t doctor--*print-space* nil) (mapc 'doctor-type-symbol ans) (insert "\n")) @@ -1375,20 +1357,18 @@ "Output a symbol to the buffer with some fancy case and spacing hacks." (setq word (doctor-make-string word)) (if (string-equal word "i") (setq word "I")) - (if *print-upcase* - (progn - (setq word (capitalize word)) - (if *print-space* - (insert " ")))) + (when doctor--*print-upcase* + (setq word (capitalize word)) + (if doctor--*print-space* (insert " "))) (cond ((or (string-match "^[.,;:?! ]" word) - (not *print-space*)) + (not doctor--*print-space*)) (insert word)) (t (insert ?\s word))) (and auto-fill-function (> (current-column) fill-column) (apply auto-fill-function nil)) - (setq *print-upcase* (string-match "[.?!]$" word) - *print-space* t)) + (setq doctor--*print-upcase* (string-match "[.?!]$" word) + doctor--*print-space* t)) (defun doctor-build (str1 str2) "Make a symbol out of the concatenation of the two non-list arguments." @@ -1426,220 +1406,219 @@ (funcall (intern (concat "doctor-" (doctor-make-string destination))))) (defun doctor-desire1 () - (doctor-go (doc$ whereoutp))) + (doctor-go (doc$ doctor--whereoutp))) (defun doctor-huh () - (cond ((< (length sent) 9) (doctor-type (doc$ huhlst))) - (t (doctor-type (doc$ longhuhlst))))) - -(defun doctor-rthing () (doctor-type (doc$ thlst))) - -(defun doctor-remem () (cond ((null history)(doctor-huh)) - ((doctor-type (doc$ remlst))))) + (cond ((< (length doctor-sent) 9) (doctor-type (doc$ doctor--huhlst))) + (t (doctor-type (doc$ doctor--longhuhlst))))) + +(defun doctor-rthing () (doctor-type (doc$ doctor--thlst))) + +(defun doctor-remem () (cond ((null doctor--history)(doctor-huh)) + ((doctor-type (doc$ doctor--remlst))))) (defun doctor-howdy () - (cond ((not howdyflag) - (doctor-type '((doc$ hello) what brings you to see me \?)) - (setq howdyflag t)) + (cond ((not doctor--howdyflag) + (doctor-type '((doc$ doctor--hello) what brings you to see me \?)) + (setq doctor--howdyflag t)) (t - (doctor-type '((doc$ ibelieve) we\'ve introduced ourselves already \.)) - (doctor-type '((doc$ please) (doc$ describe) (doc$ things) \.))))) + (doctor-type '((doc$ doctor--ibelieve) we\'ve introduced ourselves already \.)) + (doctor-type '((doc$ doctor--please) (doc$ doctor--describe) (doc$ doctor--things) \.))))) (defun doctor-when () - (cond ((< (length (memq found sent)) 3)(doctor-short)) + (cond ((< (length (memq doctor-found doctor-sent)) 3)(doctor-short)) (t - (setq sent (cdr (memq found sent))) - (setq sent (doctor-fixup sent)) - (doctor-type '((doc$ whatwhen)(doc// sent) \?))))) + (setq doctor-sent (cdr (memq doctor-found doctor-sent))) + (setq doctor-sent (doctor-fixup doctor-sent)) + (doctor-type '((doc$ doctor--whatwhen)(doc// doctor-sent) \?))))) (defun doctor-conj () - (cond ((< (length (memq found sent)) 4)(doctor-short)) + (cond ((< (length (memq doctor-found doctor-sent)) 4)(doctor-short)) (t - (setq sent (cdr (memq found sent))) - (setq sent (doctor-fixup sent)) - (cond ((eq (car sent) 'of) - (doctor-type '(are you (doc$ sure) that is the real reason \?)) - (setq things (cons (cdr sent) things))) + (setq doctor-sent (cdr (memq doctor-found doctor-sent))) + (setq doctor-sent (doctor-fixup doctor-sent)) + (cond ((eq (car doctor-sent) 'of) + (doctor-type '(are you (doc$ doctor--sure) that is the real reason \?)) + (setq doctor--things (cons (cdr doctor-sent) doctor--things))) (t - (doctor-remember sent) - (doctor-type (doc$ beclst))))))) + (doctor-remember doctor-sent) + (doctor-type (doc$ doctor--beclst))))))) (defun doctor-short () - (cond ((= (car repetitive-shortness) (1- lincount)) - (rplacd repetitive-shortness - (1+ (cdr repetitive-shortness)))) + (cond ((= (car doctor--repetitive-shortness) (1- doctor--lincount)) + (rplacd doctor--repetitive-shortness + (1+ (cdr doctor--repetitive-shortness)))) (t - (rplacd repetitive-shortness 1))) - (rplaca repetitive-shortness lincount) - (cond ((> (cdr repetitive-shortness) 6) - (cond ((not **mad**) - (doctor-type '((doc$ areyou) + (rplacd doctor--repetitive-shortness 1))) + (rplaca doctor--repetitive-shortness doctor--lincount) + (cond ((> (cdr doctor--repetitive-shortness) 6) + (cond ((not doctor--**mad**) + (doctor-type '((doc$ doctor--areyou) just trying to see what kind of things i have in my vocabulary \? please try to carry on a reasonable conversation!)) - (setq **mad** t)) + (setq doctor--**mad** t)) (t (doctor-type '(i give up \. you need a lesson in creative writing \.\.\.)) ))) (t - (cond ((equal sent (doctor-assm '(yes))) - (doctor-type '((doc$ isee) (doc$ inter) (doc$ whysay) this is so \?))) - ((equal sent (doctor-assm '(because))) - (doctor-type (doc$ shortbeclst))) - ((equal sent (doctor-assm '(no))) - (doctor-type (doc$ neglst))) - (t (doctor-type (doc$ shortlst))))))) + (cond ((equal doctor-sent (doctor-assm '(yes))) + (doctor-type '((doc$ doctor--isee) (doc$ doctor--inter) (doc$ doctor--whysay) this is so \?))) + ((equal doctor-sent (doctor-assm '(because))) + (doctor-type (doc$ doctor--shortbeclst))) + ((equal doctor-sent (doctor-assm '(no))) + (doctor-type (doc$ doctor--neglst))) + (t (doctor-type (doc$ doctor--shortlst))))))) -(defun doctor-alcohol () (doctor-type (doc$ drnk))) +(defun doctor-alcohol () (doctor-type (doc$ doctor--drnk))) (defun doctor-desire () - (let ((foo (memq found sent))) + (let ((foo (memq doctor-found doctor-sent))) (cond ((< (length foo) 2) - (doctor-go (doctor-build (doctor-meaning found) 1))) + (doctor-go (doctor-build (doctor-meaning doctor-found) 1))) ((memq (cadr foo) '(a an)) (rplacd foo (append '(to have) (cdr foo))) - (doctor-svo sent found 1 nil) - (doctor-remember (list subj 'would 'like obj)) - (doctor-type (doc$ whywant))) + (doctor-svo doctor-sent doctor-found 1 nil) + (doctor-remember (list doctor-subj 'would 'like doctor-obj)) + (doctor-type (doc$ doctor--whywant))) ((not (eq (cadr foo) 'to)) - (doctor-go (doctor-build (doctor-meaning found) 1))) + (doctor-go (doctor-build (doctor-meaning doctor-found) 1))) (t - (doctor-svo sent found 1 nil) - (doctor-remember (list subj 'would 'like obj)) - (doctor-type (doc$ whywant)))))) + (doctor-svo doctor-sent doctor-found 1 nil) + (doctor-remember (list doctor-subj 'would 'like doctor-obj)) + (doctor-type (doc$ doctor--whywant)))))) (defun doctor-drug () - (doctor-type (doc$ drugs)) - (doctor-remember (list 'you 'used found))) + (doctor-type (doc$ doctor--drugs)) + (doctor-remember (list 'you 'used doctor-found))) (defun doctor-toke () - (doctor-type (doc$ toklst))) + (doctor-type (doc$ doctor--toklst))) (defun doctor-state () - (doctor-type (doc$ states))(doctor-remember (list 'you 'were found))) + (doctor-type (doc$ doctor--states))(doctor-remember (list 'you 'were doctor-found))) (defun doctor-mood () - (doctor-type (doc$ moods))(doctor-remember (list 'you 'felt found))) + (doctor-type (doc$ doctor--moods))(doctor-remember (list 'you 'felt doctor-found))) (defun doctor-fear () - (setq feared (doctor-setprep sent found)) - (doctor-type (doc$ fears)) - (doctor-remember (list 'you 'were 'afraid 'of feared))) + (setq doctor--feared (doctor-setprep doctor-sent doctor-found)) + (doctor-type (doc$ doctor--fears)) + (doctor-remember (list 'you 'were 'afraid 'of doctor--feared))) (defun doctor-hate () - (doctor-svo sent found 1 t) - (cond ((memq 'not sent) (doctor-forget) (doctor-huh)) - ((equal subj 'you) - (doctor-type '(why do you (doc// verb)(doc// obj) \?))) - (t (doctor-type '((doc$ whysay)(list subj verb obj)))))) + (doctor-svo doctor-sent doctor-found 1 t) + (cond ((memq 'not doctor-sent) (doctor-forget) (doctor-huh)) + ((equal doctor-subj 'you) + (doctor-type '(why do you (doc// doctor-verb)(doc// doctor-obj) \?))) + (t (doctor-type '((doc$ doctor--whysay)(list doctor-subj doctor-verb doctor-obj)))))) (defun doctor-symptoms () - (doctor-type '((doc$ maybe) you should consult a medical doctor\; + (doctor-type '((doc$ doctor--maybe) you should consult a medical doctor\; i am a psychotherapist. \.))) (defun doctor-hates () - (doctor-svo sent found 1 t) + (doctor-svo doctor-sent doctor-found 1 t) (doctor-hates1)) (defun doctor-hates1 () - (doctor-type '((doc$ whysay)(list subj verb obj) \?))) + (doctor-type '((doc$ doctor--whysay)(list doctor-subj doctor-verb doctor-obj) \?))) (defun doctor-loves () - (doctor-svo sent found 1 t) + (doctor-svo doctor-sent doctor-found 1 t) (doctor-qloves)) (defun doctor-qloves () - (doctor-type '((doc$ bother)(list subj verb obj) \?))) + (doctor-type '((doc$ doctor--bother)(list doctor-subj doctor-verb doctor-obj) \?))) (defun doctor-love () - (doctor-svo sent found 1 t) - (cond ((memq 'not sent) (doctor-forget) (doctor-huh)) - ((memq 'to sent) (doctor-hates1)) + (doctor-svo doctor-sent doctor-found 1 t) + (cond ((memq 'not doctor-sent) (doctor-forget) (doctor-huh)) + ((memq 'to doctor-sent) (doctor-hates1)) (t - (cond ((equal object 'something) - (setq object '(this person you love)))) - (cond ((equal subj 'you) - (setq lover obj) - (cond ((equal lover '(this person you love)) - (setq lover '(your partner)) + (cond ((equal doctor-object 'something) + (setq doctor-object '(this person you love)))) + (cond ((equal doctor-subj 'you) + (setq doctor--lover doctor-obj) + (cond ((equal doctor--lover '(this person you love)) + (setq doctor--lover '(your partner)) (doctor-forget) (doctor-type '(with whom are you in love \?))) - ((doctor-type '((doc$ please) - (doc$ describe) - (doc$ relation) - (doc// lover) + ((doctor-type '((doc$ doctor--please) + (doc$ doctor--describe) + (doc$ doctor--relation) + (doc// doctor--lover) \.))))) - ((equal subj 'i) + ((equal doctor-subj 'i) (doctor-txtype '(we were discussing you!))) (t (doctor-forget) - (setq obj 'someone) - (setq verb (doctor-build verb 's)) + (setq doctor-obj 'someone) + (setq doctor-verb (doctor-build doctor-verb 's)) (doctor-qloves)))))) (defun doctor-mach () - (setq found (doctor-plural found)) - (doctor-type (doc$ machlst))) + (setq doctor-found (doctor-plural doctor-found)) + (doctor-type (doc$ doctor--machlst))) (defun doctor-sexnoun () (doctor-sexverb)) (defun doctor-sexverb () - (if (or (memq 'me sent)(memq 'myself sent)(memq 'i sent)) + (if (or (memq 'me doctor-sent)(memq 'myself doctor-sent)(memq 'i doctor-sent)) (doctor-foul) - (doctor-type (doc$ sexlst)))) + (doctor-type (doc$ doctor--sexlst)))) (defun doctor-death () - (cond (suicide-flag (doctor-type (doc$ deathlst))) - ((or (equal found 'suicide) - (and (or (equal found 'kill) - (equal found 'killing)) - (memq 'yourself sent))) - (setq suicide-flag t) + (cond (doctor--suicide-flag (doctor-type (doc$ doctor--deathlst))) + ((or (equal doctor-found 'suicide) + (and (or (equal doctor-found 'kill) + (equal doctor-found 'killing)) + (memq 'yourself doctor-sent))) + (setq doctor--suicide-flag t) (doctor-type '(If you are really suicidal, you might want to contact the Samaritans via E-mail: jo@samaritans.org or, at your option, anonymous E-mail: samaritans@anon.twwells.com\ \. or find a Befrienders crisis center at http://www.befrienders.org/\ \. - (doc$ please) (doc$ continue) \.))) - (t (doctor-type (doc$ deathlst))))) + (doc$ doctor--please) (doc$ doctor--continue) \.))) + (t (doctor-type (doc$ doctor--deathlst))))) (defun doctor-foul () - (doctor-type (doc$ foullst))) + (doctor-type (doc$ doctor--foullst))) (defun doctor-family () - (doctor-possess sent found) - (doctor-type (doc$ famlst))) + (doctor-possess doctor-sent doctor-found) + (doctor-type (doc$ doctor--famlst))) ;; I did not add this -- rms. ;; But he might have removed it. I put it back. --roland (defun doctor-rms () - (cond (rms-flag (doctor-type (doc$ stallmanlst))) - (t (setq rms-flag t) (doctor-type '(do you know Stallman \?))))) + (cond (doctor--rms-flag (doctor-type (doc$ doctor--stallmanlst))) + (t (setq doctor--rms-flag t) (doctor-type '(do you know Stallman \?))))) -(defun doctor-school nil (doctor-type (doc$ schoollst))) +(defun doctor-school nil (doctor-type (doc$ doctor--schoollst))) (defun doctor-eliza () - (cond (eliza-flag (doctor-type (doc$ elizalst))) - (t (setq eliza-flag t) - (doctor-type '((doc// found) \? hah ! - (doc$ please) (doc$ continue) \.))))) - -(defun doctor-sports () (doctor-type (doc$ sportslst))) - -(defun doctor-math () (doctor-type (doc$ mathlst))) + (cond (doctor--eliza-flag (doctor-type (doc$ doctor--elizalst))) + (t (setq doctor--eliza-flag t) + (doctor-type '((doc// doctor-found) \? hah ! + (doc$ doctor--please) (doc$ doctor--continue) \.))))) + +(defun doctor-sports () (doctor-type (doc$ doctor--sportslst))) + +(defun doctor-math () (doctor-type (doc$ doctor--mathlst))) (defun doctor-zippy () - (cond (zippy-flag (doctor-type (doc$ zippylst))) - (t (setq zippy-flag t) + (cond (doctor--zippy-flag (doctor-type (doc$ doctor--zippylst))) + (t (setq doctor--zippy-flag t) (doctor-type '(yow! are we interactive yet \?))))) -(defun doctor-chat () (doctor-type (doc$ chatlst))) +(defun doctor-chat () (doctor-type (doc$ doctor--chatlst))) (random t) (provide 'doctor) -;; arch-tag: 579380f6-4902-4ea5-bccb-6339e30e1257 ;;; doctor.el ends here ------------------------------------------------------------ revno: 102253 committer: Glenn Morris branch nick: trunk timestamp: Fri 2010-11-05 00:34:45 -0700 message: Silence cl-macs.el compilation. * lisp/emacs-lisp/cl-macs.el (loop): Give local variable args a prefix. (cl-parse-loop-clause, cl-loop-handle-accum): Update for above change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-05 07:32:16 +0000 +++ lisp/ChangeLog 2010-11-05 07:34:45 +0000 @@ -1,5 +1,8 @@ 2010-11-05 Glenn Morris + * emacs-lisp/cl-macs.el (loop): Give local variable args a prefix. + (cl-parse-loop-clause, cl-loop-handle-accum): Update for above change. + * emacs-lisp/byte-opt.el (byte-decompile-bytecode-1): Give local variables bytes, ptr, op a prefix. (disassemble-offset): Update for above change. === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2010-09-02 09:47:08 +0000 +++ lisp/emacs-lisp/cl-macs.el 2010-11-05 07:34:45 +0000 @@ -639,7 +639,7 @@ ;;; The "loop" macro. -(defvar args) (defvar loop-accum-var) (defvar loop-accum-vars) +(defvar loop-args) (defvar loop-accum-var) (defvar loop-accum-vars) (defvar loop-bindings) (defvar loop-body) (defvar loop-destr-temps) (defvar loop-finally) (defvar loop-finish-flag) (defvar loop-first-flag) (defvar loop-initially) (defvar loop-map-form) (defvar loop-name) @@ -647,7 +647,7 @@ (defvar loop-result-var) (defvar loop-steps) (defvar loop-symbol-macs) ;;;###autoload -(defmacro loop (&rest args) +(defmacro loop (&rest loop-args) "The Common Lisp `loop' macro. Valid clauses are: for VAR from/upfrom/downfrom NUM to/upto/downto/above/below NUM by NUM, @@ -662,8 +662,8 @@ finally return EXPR, named NAME. \(fn CLAUSE...)" - (if (not (memq t (mapcar 'symbolp (delq nil (delq t (copy-list args)))))) - (list 'block nil (list* 'while t args)) + (if (not (memq t (mapcar 'symbolp (delq nil (delq t (copy-list loop-args)))))) + (list 'block nil (list* 'while t loop-args)) (let ((loop-name nil) (loop-bindings nil) (loop-body nil) (loop-steps nil) (loop-result nil) (loop-result-explicit nil) @@ -672,8 +672,8 @@ (loop-initially nil) (loop-finally nil) (loop-map-form nil) (loop-first-flag nil) (loop-destr-temps nil) (loop-symbol-macs nil)) - (setq args (append args '(cl-end-loop))) - (while (not (eq (car args) 'cl-end-loop)) (cl-parse-loop-clause)) + (setq loop-args (append loop-args '(cl-end-loop))) + (while (not (eq (car loop-args) 'cl-end-loop)) (cl-parse-loop-clause)) (if loop-finish-flag (push `((,loop-finish-flag t)) loop-bindings)) (if loop-first-flag @@ -713,34 +713,34 @@ (setq body (list (list* 'symbol-macrolet loop-symbol-macs body)))) (list* 'block loop-name body))))) -(defun cl-parse-loop-clause () ; uses args, loop-* - (let ((word (pop args)) +(defun cl-parse-loop-clause () ; uses loop-* + (let ((word (pop loop-args)) (hash-types '(hash-key hash-keys hash-value hash-values)) (key-types '(key-code key-codes key-seq key-seqs key-binding key-bindings))) (cond - ((null args) + ((null loop-args) (error "Malformed `loop' macro")) ((eq word 'named) - (setq loop-name (pop args))) + (setq loop-name (pop loop-args))) ((eq word 'initially) - (if (memq (car args) '(do doing)) (pop args)) - (or (consp (car args)) (error "Syntax error on `initially' clause")) - (while (consp (car args)) - (push (pop args) loop-initially))) + (if (memq (car loop-args) '(do doing)) (pop loop-args)) + (or (consp (car loop-args)) (error "Syntax error on `initially' clause")) + (while (consp (car loop-args)) + (push (pop loop-args) loop-initially))) ((eq word 'finally) - (if (eq (car args) 'return) - (setq loop-result-explicit (or (cl-pop2 args) '(quote nil))) - (if (memq (car args) '(do doing)) (pop args)) - (or (consp (car args)) (error "Syntax error on `finally' clause")) - (if (and (eq (caar args) 'return) (null loop-name)) - (setq loop-result-explicit (or (nth 1 (pop args)) '(quote nil))) - (while (consp (car args)) - (push (pop args) loop-finally))))) + (if (eq (car loop-args) 'return) + (setq loop-result-explicit (or (cl-pop2 loop-args) '(quote nil))) + (if (memq (car loop-args) '(do doing)) (pop loop-args)) + (or (consp (car loop-args)) (error "Syntax error on `finally' clause")) + (if (and (eq (caar loop-args) 'return) (null loop-name)) + (setq loop-result-explicit (or (nth 1 (pop loop-args)) '(quote nil))) + (while (consp (car loop-args)) + (push (pop loop-args) loop-finally))))) ((memq word '(for as)) (let ((loop-for-bindings nil) (loop-for-sets nil) (loop-for-steps nil) @@ -749,29 +749,29 @@ ;; Use `gensym' rather than `make-symbol'. It's important that ;; (not (eq (symbol-name var1) (symbol-name var2))) because ;; these vars get added to the cl-macro-environment. - (let ((var (or (pop args) (gensym "--cl-var--")))) - (setq word (pop args)) - (if (eq word 'being) (setq word (pop args))) - (if (memq word '(the each)) (setq word (pop args))) + (let ((var (or (pop loop-args) (gensym "--cl-var--")))) + (setq word (pop loop-args)) + (if (eq word 'being) (setq word (pop loop-args))) + (if (memq word '(the each)) (setq word (pop loop-args))) (if (memq word '(buffer buffers)) - (setq word 'in args (cons '(buffer-list) args))) + (setq word 'in loop-args (cons '(buffer-list) loop-args))) (cond ((memq word '(from downfrom upfrom to downto upto above below by)) - (push word args) - (if (memq (car args) '(downto above)) + (push word loop-args) + (if (memq (car loop-args) '(downto above)) (error "Must specify `from' value for downward loop")) - (let* ((down (or (eq (car args) 'downfrom) - (memq (caddr args) '(downto above)))) - (excl (or (memq (car args) '(above below)) - (memq (caddr args) '(above below)))) - (start (and (memq (car args) '(from upfrom downfrom)) - (cl-pop2 args))) - (end (and (memq (car args) + (let* ((down (or (eq (car loop-args) 'downfrom) + (memq (caddr loop-args) '(downto above)))) + (excl (or (memq (car loop-args) '(above below)) + (memq (caddr loop-args) '(above below)))) + (start (and (memq (car loop-args) '(from upfrom downfrom)) + (cl-pop2 loop-args))) + (end (and (memq (car loop-args) '(to upto downto above below)) - (cl-pop2 args))) - (step (and (eq (car args) 'by) (cl-pop2 args))) + (cl-pop2 loop-args))) + (step (and (eq (car loop-args) 'by) (cl-pop2 loop-args))) (end-var (and (not (cl-const-expr-p end)) (make-symbol "--cl-var--"))) (step-var (and (not (cl-const-expr-p step)) @@ -794,7 +794,7 @@ (let* ((on (eq word 'on)) (temp (if (and on (symbolp var)) var (make-symbol "--cl-var--")))) - (push (list temp (pop args)) loop-for-bindings) + (push (list temp (pop loop-args)) loop-for-bindings) (push (list 'consp temp) loop-body) (if (eq word 'in-ref) (push (list var (list 'car temp)) loop-symbol-macs) @@ -804,8 +804,8 @@ (push (list var (if on temp (list 'car temp))) loop-for-sets)))) (push (list temp - (if (eq (car args) 'by) - (let ((step (cl-pop2 args))) + (if (eq (car loop-args) 'by) + (let ((step (cl-pop2 loop-args))) (if (and (memq (car-safe step) '(quote function function*)) @@ -816,10 +816,10 @@ loop-for-steps))) ((eq word '=) - (let* ((start (pop args)) - (then (if (eq (car args) 'then) (cl-pop2 args) start))) + (let* ((start (pop loop-args)) + (then (if (eq (car loop-args) 'then) (cl-pop2 loop-args) start))) (push (list var nil) loop-for-bindings) - (if (or ands (eq (car args) 'and)) + (if (or ands (eq (car loop-args) 'and)) (progn (push `(,var (if ,(or loop-first-flag @@ -839,7 +839,7 @@ ((memq word '(across across-ref)) (let ((temp-vec (make-symbol "--cl-vec--")) (temp-idx (make-symbol "--cl-idx--"))) - (push (list temp-vec (pop args)) loop-for-bindings) + (push (list temp-vec (pop loop-args)) loop-for-bindings) (push (list temp-idx -1) loop-for-bindings) (push (list '< (list 'setq temp-idx (list '1+ temp-idx)) (list 'length temp-vec)) loop-body) @@ -851,15 +851,15 @@ loop-for-sets)))) ((memq word '(element elements)) - (let ((ref (or (memq (car args) '(in-ref of-ref)) - (and (not (memq (car args) '(in of))) + (let ((ref (or (memq (car loop-args) '(in-ref of-ref)) + (and (not (memq (car loop-args) '(in of))) (error "Expected `of'")))) - (seq (cl-pop2 args)) + (seq (cl-pop2 loop-args)) (temp-seq (make-symbol "--cl-seq--")) - (temp-idx (if (eq (car args) 'using) - (if (and (= (length (cadr args)) 2) - (eq (caadr args) 'index)) - (cadr (cl-pop2 args)) + (temp-idx (if (eq (car loop-args) 'using) + (if (and (= (length (cadr loop-args)) 2) + (eq (caadr loop-args) 'index)) + (cadr (cl-pop2 loop-args)) (error "Bad `using' clause")) (make-symbol "--cl-idx--")))) (push (list temp-seq seq) loop-for-bindings) @@ -885,13 +885,13 @@ loop-for-steps))) ((memq word hash-types) - (or (memq (car args) '(in of)) (error "Expected `of'")) - (let* ((table (cl-pop2 args)) - (other (if (eq (car args) 'using) - (if (and (= (length (cadr args)) 2) - (memq (caadr args) hash-types) - (not (eq (caadr args) word))) - (cadr (cl-pop2 args)) + (or (memq (car loop-args) '(in of)) (error "Expected `of'")) + (let* ((table (cl-pop2 loop-args)) + (other (if (eq (car loop-args) 'using) + (if (and (= (length (cadr loop-args)) 2) + (memq (caadr loop-args) hash-types) + (not (eq (caadr loop-args) word))) + (cadr (cl-pop2 loop-args)) (error "Bad `using' clause")) (make-symbol "--cl-var--")))) (if (memq word '(hash-value hash-values)) @@ -901,16 +901,16 @@ ((memq word '(symbol present-symbol external-symbol symbols present-symbols external-symbols)) - (let ((ob (and (memq (car args) '(in of)) (cl-pop2 args)))) + (let ((ob (and (memq (car loop-args) '(in of)) (cl-pop2 loop-args)))) (setq loop-map-form `(mapatoms (lambda (,var) . --cl-map) ,ob)))) ((memq word '(overlay overlays extent extents)) (let ((buf nil) (from nil) (to nil)) - (while (memq (car args) '(in of from to)) - (cond ((eq (car args) 'from) (setq from (cl-pop2 args))) - ((eq (car args) 'to) (setq to (cl-pop2 args))) - (t (setq buf (cl-pop2 args))))) + (while (memq (car loop-args) '(in of from to)) + (cond ((eq (car loop-args) 'from) (setq from (cl-pop2 loop-args))) + ((eq (car loop-args) 'to) (setq to (cl-pop2 loop-args))) + (t (setq buf (cl-pop2 loop-args))))) (setq loop-map-form `(cl-map-extents (lambda (,var ,(make-symbol "--cl-var--")) @@ -921,12 +921,12 @@ (let ((buf nil) (prop nil) (from nil) (to nil) (var1 (make-symbol "--cl-var1--")) (var2 (make-symbol "--cl-var2--"))) - (while (memq (car args) '(in of property from to)) - (cond ((eq (car args) 'from) (setq from (cl-pop2 args))) - ((eq (car args) 'to) (setq to (cl-pop2 args))) - ((eq (car args) 'property) - (setq prop (cl-pop2 args))) - (t (setq buf (cl-pop2 args))))) + (while (memq (car loop-args) '(in of property from to)) + (cond ((eq (car loop-args) 'from) (setq from (cl-pop2 loop-args))) + ((eq (car loop-args) 'to) (setq to (cl-pop2 loop-args))) + ((eq (car loop-args) 'property) + (setq prop (cl-pop2 loop-args))) + (t (setq buf (cl-pop2 loop-args))))) (if (and (consp var) (symbolp (car var)) (symbolp (cdr var))) (setq var1 (car var) var2 (cdr var)) (push (list var (list 'cons var1 var2)) loop-for-sets)) @@ -936,13 +936,13 @@ ,buf ,prop ,from ,to)))) ((memq word key-types) - (or (memq (car args) '(in of)) (error "Expected `of'")) - (let ((map (cl-pop2 args)) - (other (if (eq (car args) 'using) - (if (and (= (length (cadr args)) 2) - (memq (caadr args) key-types) - (not (eq (caadr args) word))) - (cadr (cl-pop2 args)) + (or (memq (car loop-args) '(in of)) (error "Expected `of'")) + (let ((map (cl-pop2 loop-args)) + (other (if (eq (car loop-args) 'using) + (if (and (= (length (cadr loop-args)) 2) + (memq (caadr loop-args) key-types) + (not (eq (caadr loop-args) word))) + (cadr (cl-pop2 loop-args)) (error "Bad `using' clause")) (make-symbol "--cl-var--")))) (if (memq word '(key-binding key-bindings)) @@ -964,7 +964,7 @@ loop-for-steps))) ((memq word '(window windows)) - (let ((scr (and (memq (car args) '(in of)) (cl-pop2 args))) + (let ((scr (and (memq (car loop-args) '(in of)) (cl-pop2 loop-args))) (temp (make-symbol "--cl-var--"))) (push (list var (if scr (list 'frame-selected-window scr) @@ -982,9 +982,9 @@ (if handler (funcall handler var) (error "Expected a `for' preposition, found %s" word))))) - (eq (car args) 'and)) + (eq (car loop-args) 'and)) (setq ands t) - (pop args)) + (pop loop-args)) (if (and ands loop-for-bindings) (push (nreverse loop-for-bindings) loop-bindings) (setq loop-bindings (nconc (mapcar 'list loop-for-bindings) @@ -1000,11 +1000,11 @@ ((eq word 'repeat) (let ((temp (make-symbol "--cl-var--"))) - (push (list (list temp (pop args))) loop-bindings) + (push (list (list temp (pop loop-args))) loop-bindings) (push (list '>= (list 'setq temp (list '1- temp)) 0) loop-body))) ((memq word '(collect collecting)) - (let ((what (pop args)) + (let ((what (pop loop-args)) (var (cl-loop-handle-accum nil 'nreverse))) (if (eq var loop-accum-var) (push (list 'progn (list 'push what var) t) loop-body) @@ -1013,7 +1013,7 @@ t) loop-body)))) ((memq word '(nconc nconcing append appending)) - (let ((what (pop args)) + (let ((what (pop loop-args)) (var (cl-loop-handle-accum nil 'nreverse))) (push (list 'progn (list 'setq var @@ -1028,27 +1028,27 @@ var what))) t) loop-body))) ((memq word '(concat concating)) - (let ((what (pop args)) + (let ((what (pop loop-args)) (var (cl-loop-handle-accum ""))) (push (list 'progn (list 'callf 'concat var what) t) loop-body))) ((memq word '(vconcat vconcating)) - (let ((what (pop args)) + (let ((what (pop loop-args)) (var (cl-loop-handle-accum []))) (push (list 'progn (list 'callf 'vconcat var what) t) loop-body))) ((memq word '(sum summing)) - (let ((what (pop args)) + (let ((what (pop loop-args)) (var (cl-loop-handle-accum 0))) (push (list 'progn (list 'incf var what) t) loop-body))) ((memq word '(count counting)) - (let ((what (pop args)) + (let ((what (pop loop-args)) (var (cl-loop-handle-accum 0))) (push (list 'progn (list 'if what (list 'incf var)) t) loop-body))) ((memq word '(minimize minimizing maximize maximizing)) - (let* ((what (pop args)) + (let* ((what (pop loop-args)) (temp (if (cl-simple-expr-p what) what (make-symbol "--cl-var--"))) (var (cl-loop-handle-accum nil)) (func (intern (substring (symbol-name word) 0 3))) @@ -1059,27 +1059,27 @@ ((eq word 'with) (let ((bindings nil)) - (while (progn (push (list (pop args) - (and (eq (car args) '=) (cl-pop2 args))) + (while (progn (push (list (pop loop-args) + (and (eq (car loop-args) '=) (cl-pop2 loop-args))) bindings) - (eq (car args) 'and)) - (pop args)) + (eq (car loop-args) 'and)) + (pop loop-args)) (push (nreverse bindings) loop-bindings))) ((eq word 'while) - (push (pop args) loop-body)) + (push (pop loop-args) loop-body)) ((eq word 'until) - (push (list 'not (pop args)) loop-body)) + (push (list 'not (pop loop-args)) loop-body)) ((eq word 'always) (or loop-finish-flag (setq loop-finish-flag (make-symbol "--cl-flag--"))) - (push (list 'setq loop-finish-flag (pop args)) loop-body) + (push (list 'setq loop-finish-flag (pop loop-args)) loop-body) (setq loop-result t)) ((eq word 'never) (or loop-finish-flag (setq loop-finish-flag (make-symbol "--cl-flag--"))) - (push (list 'setq loop-finish-flag (list 'not (pop args))) + (push (list 'setq loop-finish-flag (list 'not (pop loop-args))) loop-body) (setq loop-result t)) @@ -1087,20 +1087,20 @@ (or loop-finish-flag (setq loop-finish-flag (make-symbol "--cl-flag--"))) (or loop-result-var (setq loop-result-var (make-symbol "--cl-var--"))) (push (list 'setq loop-finish-flag - (list 'not (list 'setq loop-result-var (pop args)))) + (list 'not (list 'setq loop-result-var (pop loop-args)))) loop-body)) ((memq word '(if when unless)) - (let* ((cond (pop args)) + (let* ((cond (pop loop-args)) (then (let ((loop-body nil)) (cl-parse-loop-clause) (cl-loop-build-ands (nreverse loop-body)))) (else (let ((loop-body nil)) - (if (eq (car args) 'else) - (progn (pop args) (cl-parse-loop-clause))) + (if (eq (car loop-args) 'else) + (progn (pop loop-args) (cl-parse-loop-clause))) (cl-loop-build-ands (nreverse loop-body)))) (simple (and (eq (car then) t) (eq (car else) t)))) - (if (eq (car args) 'end) (pop args)) + (if (eq (car loop-args) 'end) (pop loop-args)) (if (eq word 'unless) (setq then (prog1 else (setq else then)))) (let ((form (cons (if simple (cons 'progn (nth 1 then)) (nth 2 then)) (if simple (nth 1 else) (list (nth 2 else)))))) @@ -1114,22 +1114,22 @@ ((memq word '(do doing)) (let ((body nil)) - (or (consp (car args)) (error "Syntax error on `do' clause")) - (while (consp (car args)) (push (pop args) body)) + (or (consp (car loop-args)) (error "Syntax error on `do' clause")) + (while (consp (car loop-args)) (push (pop loop-args) body)) (push (cons 'progn (nreverse (cons t body))) loop-body))) ((eq word 'return) (or loop-finish-flag (setq loop-finish-flag (make-symbol "--cl-var--"))) (or loop-result-var (setq loop-result-var (make-symbol "--cl-var--"))) - (push (list 'setq loop-result-var (pop args) + (push (list 'setq loop-result-var (pop loop-args) loop-finish-flag nil) loop-body)) (t (let ((handler (and (symbolp word) (get word 'cl-loop-handler)))) (or handler (error "Expected a loop keyword, found %s" word)) (funcall handler)))) - (if (eq (car args) 'and) - (progn (pop args) (cl-parse-loop-clause))))) + (if (eq (car loop-args) 'and) + (progn (pop loop-args) (cl-parse-loop-clause))))) (defun cl-loop-let (specs body par) ; uses loop-* (let ((p specs) (temps nil) (new nil)) @@ -1165,9 +1165,9 @@ (list* (if par 'let 'let*) (nconc (nreverse temps) (nreverse new)) body)))) -(defun cl-loop-handle-accum (def &optional func) ; uses args, loop-* - (if (eq (car args) 'into) - (let ((var (cl-pop2 args))) +(defun cl-loop-handle-accum (def &optional func) ; uses loop-* + (if (eq (car loop-args) 'into) + (let ((var (cl-pop2 loop-args))) (or (memq var loop-accum-vars) (progn (push (list (list var def)) loop-bindings) (push var loop-accum-vars))) @@ -2791,5 +2791,4 @@ ;; generated-autoload-file: "cl-loaddefs.el" ;; End: -;; arch-tag: afd947a6-b553-4df1-bba5-000be6388f46 ;;; cl-macs.el ends here ------------------------------------------------------------ revno: 102252 committer: Glenn Morris branch nick: trunk timestamp: Fri 2010-11-05 00:32:16 -0700 message: Silence byte-opt.el compilation. * lisp/emacs-lisp/byte-opt.el (byte-decompile-bytecode-1): Give local variables bytes, ptr, op a prefix. (disassemble-offset): Update for above change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-03 23:21:51 +0000 +++ lisp/ChangeLog 2010-11-05 07:32:16 +0000 @@ -1,3 +1,9 @@ +2010-11-05 Glenn Morris + + * emacs-lisp/byte-opt.el (byte-decompile-bytecode-1): Give local + variables bytes, ptr, op a prefix. + (disassemble-offset): Update for above change. + 2010-11-03 Chong Yidong * emacs-lisp/package.el (package-unpack): Remove no-op. === modified file 'lisp/emacs-lisp/byte-opt.el' --- lisp/emacs-lisp/byte-opt.el 2010-10-14 14:32:27 +0000 +++ lisp/emacs-lisp/byte-opt.el 2010-11-05 07:32:16 +0000 @@ -1316,35 +1316,38 @@ "Don't call this!" ;; fetch and return the offset for the current opcode. ;; return nil if this opcode has no offset - ;; OP, PTR and BYTES are used and set dynamically - (defvar op) - (defvar ptr) - (defvar bytes) - (cond ((< op byte-nth) - (let ((tem (logand op 7))) - (setq op (logand op 248)) + ;; Used and set dynamically in byte-decompile-bytecode-1. + (defvar bytedecomp-op) + (defvar bytedecomp-ptr) + (defvar bytedecomp-bytes) + (cond ((< bytedecomp-op byte-nth) + (let ((tem (logand bytedecomp-op 7))) + (setq bytedecomp-op (logand bytedecomp-op 248)) (cond ((eq tem 6) - (setq ptr (1+ ptr)) ;offset in next byte - (aref bytes ptr)) + ;; Offset in next byte. + (setq bytedecomp-ptr (1+ bytedecomp-ptr)) + (aref bytedecomp-bytes bytedecomp-ptr)) ((eq tem 7) - (setq ptr (1+ ptr)) ;offset in next 2 bytes - (+ (aref bytes ptr) - (progn (setq ptr (1+ ptr)) - (lsh (aref bytes ptr) 8)))) + ;; Offset in next 2 bytes. + (setq bytedecomp-ptr (1+ bytedecomp-ptr)) + (+ (aref bytedecomp-bytes bytedecomp-ptr) + (progn (setq bytedecomp-ptr (1+ bytedecomp-ptr)) + (lsh (aref bytedecomp-bytes bytedecomp-ptr) 8)))) (t tem)))) ;offset was in opcode - ((>= op byte-constant) - (prog1 (- op byte-constant) ;offset in opcode - (setq op byte-constant))) - ((and (>= op byte-constant2) - (<= op byte-goto-if-not-nil-else-pop)) - (setq ptr (1+ ptr)) ;offset in next 2 bytes - (+ (aref bytes ptr) - (progn (setq ptr (1+ ptr)) - (lsh (aref bytes ptr) 8)))) - ((and (>= op byte-listN) - (<= op byte-insertN)) - (setq ptr (1+ ptr)) ;offset in next byte - (aref bytes ptr)))) + ((>= bytedecomp-op byte-constant) + (prog1 (- bytedecomp-op byte-constant) ;offset in opcode + (setq bytedecomp-op byte-constant))) + ((and (>= bytedecomp-op byte-constant2) + (<= bytedecomp-op byte-goto-if-not-nil-else-pop)) + ;; Offset in next 2 bytes. + (setq bytedecomp-ptr (1+ bytedecomp-ptr)) + (+ (aref bytedecomp-bytes bytedecomp-ptr) + (progn (setq bytedecomp-ptr (1+ bytedecomp-ptr)) + (lsh (aref bytedecomp-bytes bytedecomp-ptr) 8)))) + ((and (>= bytedecomp-op byte-listN) + (<= bytedecomp-op byte-insertN)) + (setq bytedecomp-ptr (1+ bytedecomp-ptr)) ;offset in next byte + (aref bytedecomp-bytes bytedecomp-ptr)))) ;; This de-compiler is used for inline expansion of compiled functions, @@ -1367,19 +1370,20 @@ ;; If MAKE-SPLICEABLE is nil, we are being called for the disassembler. ;; In that case, we put a pc value into the list ;; before each insn (or its label). -(defun byte-decompile-bytecode-1 (bytes constvec &optional make-spliceable) - (let ((length (length bytes)) - (ptr 0) optr tags op offset +(defun byte-decompile-bytecode-1 (bytedecomp-bytes constvec + &optional make-spliceable) + (let ((length (length bytedecomp-bytes)) + (bytedecomp-ptr 0) optr tags bytedecomp-op offset lap tmp endtag) - (while (not (= ptr length)) + (while (not (= bytedecomp-ptr length)) (or make-spliceable - (setq lap (cons ptr lap))) - (setq op (aref bytes ptr) - optr ptr + (setq lap (cons bytedecomp-ptr lap))) + (setq bytedecomp-op (aref bytedecomp-bytes bytedecomp-ptr) + optr bytedecomp-ptr offset (disassemble-offset)) ; this does dynamic-scope magic - (setq op (aref byte-code-vector op)) - (cond ((memq op byte-goto-ops) + (setq bytedecomp-op (aref byte-code-vector bytedecomp-op)) + (cond ((memq bytedecomp-op byte-goto-ops) ;; it's a pc (setq offset (cdr (or (assq offset tags) @@ -1387,27 +1391,28 @@ (cons (cons offset (byte-compile-make-tag)) tags))))))) - ((cond ((eq op 'byte-constant2) (setq op 'byte-constant) t) - ((memq op byte-constref-ops))) + ((cond ((eq bytedecomp-op 'byte-constant2) + (setq bytedecomp-op 'byte-constant) t) + ((memq bytedecomp-op byte-constref-ops))) (setq tmp (if (>= offset (length constvec)) (list 'out-of-range offset) (aref constvec offset)) - offset (if (eq op 'byte-constant) + offset (if (eq bytedecomp-op 'byte-constant) (byte-compile-get-constant tmp) (or (assq tmp byte-compile-variables) (car (setq byte-compile-variables (cons (list tmp) byte-compile-variables))))))) ((and make-spliceable - (eq op 'byte-return)) - (if (= ptr (1- length)) - (setq op nil) + (eq bytedecomp-op 'byte-return)) + (if (= bytedecomp-ptr (1- length)) + (setq bytedecomp-op nil) (setq offset (or endtag (setq endtag (byte-compile-make-tag))) - op 'byte-goto)))) + bytedecomp-op 'byte-goto)))) ;; lap = ( [ (pc . (op . arg)) ]* ) - (setq lap (cons (cons optr (cons op (or offset 0))) + (setq lap (cons (cons optr (cons bytedecomp-op (or offset 0))) lap)) - (setq ptr (1+ ptr))) + (setq bytedecomp-ptr (1+ bytedecomp-ptr))) ;; take off the dummy nil op that we replaced a trailing "return" with. (let ((rest lap)) (while rest @@ -2036,5 +2041,4 @@ byte-optimize-lapcode)))) nil) -;; arch-tag: 0f14076b-737e-4bef-aae6-908826ec1ff1 ;;; byte-opt.el ends here ------------------------------------------------------------ revno: 102251 committer: Glenn Morris branch nick: trunk timestamp: Thu 2010-11-04 17:01:59 -0700 message: ChangeLog fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-04 22:37:06 +0000 +++ src/ChangeLog 2010-11-05 00:01:59 +0000 @@ -1,7 +1,7 @@ 2010-11-04 Lars Magne Ingebrigtsen - * Refer to set-coding-system-priority instead of the obsolete - set-coding-priority in the doc string. + * coding.c (coding-category-list): Refer to set-coding-system-priority + instead of the obsolete set-coding-priority in the doc string. 2010-11-04 Adrian Robert Ismail Donmez (tiny change)