diff options
| author | Richard M. Stallman | 1997-07-23 02:43:48 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-07-23 02:43:48 +0000 |
| commit | e865033e760012c4135a3e6cf2b92b8a85367e7a (patch) | |
| tree | 070252dbc9409141ffd2f352e2e4997ae9063562 | |
| parent | 43a51f7860c6ff41c13084f936ac5819542166d9 (diff) | |
| download | emacs-e865033e760012c4135a3e6cf2b92b8a85367e7a.tar.gz emacs-e865033e760012c4135a3e6cf2b92b8a85367e7a.zip | |
Various error messages fixed.
(ph-cadr, ph-cadr): New functions.
All calls to cdar and cadr changed.
| -rw-r--r-- | lisp/ph.el | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/lisp/ph.el b/lisp/ph.el index 55394e027a2..484c97bece2 100644 --- a/lisp/ph.el +++ b/lisp/ph.el | |||
| @@ -249,6 +249,12 @@ BBDB fields. SPECs are sexps which are evaluated: | |||
| 249 | (not (featurep 'ph-options-file))) | 249 | (not (featurep 'ph-options-file))) |
| 250 | (load ph-options-file)) | 250 | (load ph-options-file)) |
| 251 | 251 | ||
| 252 | (defun ph-cadr (obj) | ||
| 253 | (car (cadr obj))) | ||
| 254 | |||
| 255 | (defun ph-cdar (obj) | ||
| 256 | (cdr (car obj))) | ||
| 257 | |||
| 252 | (defun ph-mode () | 258 | (defun ph-mode () |
| 253 | "Major mode used in buffers displaying the results of PH queries. | 259 | "Major mode used in buffers displaying the results of PH queries. |
| 254 | There is no sense in calling this command from a buffer other than | 260 | There is no sense in calling this command from a buffer other than |
| @@ -433,9 +439,9 @@ Fields not in FIELDS are discarded." | |||
| 433 | (memq current-key fields)) | 439 | (memq current-key fields)) |
| 434 | (if key | 440 | (if key |
| 435 | (setq record (cons (cons key value) record)) ; New key | 441 | (setq record (cons (cons key value) record)) ; New key |
| 436 | (setcdr (car record) (if (listp (cdar record)) | 442 | (setcdr (car record) (if (listp (ph-cdar record)) |
| 437 | (append (cdar record) (list value)) | 443 | (append (ph-cdar record) (list value)) |
| 438 | (list (cdar record) value)))))))) | 444 | (list (ph-cdar record) value)))))))) |
| 439 | (and (not ignore) | 445 | (and (not ignore) |
| 440 | (or (null fields) | 446 | (or (null fields) |
| 441 | (memq 'all fields) | 447 | (memq 'all fields) |
| @@ -458,10 +464,10 @@ Fields not in FIELDS are discarded." | |||
| 458 | 464 | ||
| 459 | ;; Search for multiple records | 465 | ;; Search for multiple records |
| 460 | (while (and rec | 466 | (while (and rec |
| 461 | (not (listp (cdar rec)))) | 467 | (not (listp (ph-cdar rec)))) |
| 462 | (setq rec (cdr rec))) | 468 | (setq rec (cdr rec))) |
| 463 | 469 | ||
| 464 | (if (null (cdar rec)) | 470 | (if (null (ph-cdar rec)) |
| 465 | (list record) ; No duplicate fields in this record | 471 | (list record) ; No duplicate fields in this record |
| 466 | (mapcar (function | 472 | (mapcar (function |
| 467 | (lambda (field) | 473 | (lambda (field) |
| @@ -481,7 +487,7 @@ Fields not in FIELDS are discarded." | |||
| 481 | (ph-add-field-to-records field result))) | 487 | (ph-add-field-to-records field result))) |
| 482 | ((eq 'first method) | 488 | ((eq 'first method) |
| 483 | (setq result | 489 | (setq result |
| 484 | (ph-add-field-to-records (cons (car field) (cadr field)) result))) | 490 | (ph-add-field-to-records (cons (car field) (ph-cadr field)) result))) |
| 485 | ((eq 'concat method) | 491 | ((eq 'concat method) |
| 486 | (setq result | 492 | (setq result |
| 487 | (ph-add-field-to-records (cons (car field) | 493 | (ph-add-field-to-records (cons (car field) |
| @@ -690,7 +696,7 @@ If RECURSE is non-nil then SPEC may be a list of atomic specs" | |||
| 690 | ADDR should be an address string of no more than four lines or a | 696 | ADDR should be an address string of no more than four lines or a |
| 691 | list of lines. | 697 | list of lines. |
| 692 | The last line is searched for the zip code, city and state name. | 698 | The last line is searched for the zip code, city and state name. |
| 693 | LOCATION is used as the address location for bbdb" | 699 | LOCATION is used as the address location for bbdb." |
| 694 | (let* ((addr-components (if (listp addr) | 700 | (let* ((addr-components (if (listp addr) |
| 695 | (reverse addr) | 701 | (reverse addr) |
| 696 | (reverse (split-string addr "\n")))) | 702 | (reverse (split-string addr "\n")))) |
| @@ -728,9 +734,9 @@ LOCATION is used as the phone location for bbdb" | |||
| 728 | (condition-case err | 734 | (condition-case err |
| 729 | (setq phone-list (bbdb-parse-phone-number phone)) | 735 | (setq phone-list (bbdb-parse-phone-number phone)) |
| 730 | (error | 736 | (error |
| 731 | (if (string= "phone number unparsable." (cadr err)) | 737 | (if (string= "phone number unparsable." (ph-cadr err)) |
| 732 | (if (not (y-or-n-p (format "BBDB claims %S to be unparsable. Insert it unparsed ? " phone))) | 738 | (if (not (y-or-n-p (format "BBDB claims %S to be unparsable. Insert it unparsed ? " phone))) |
| 733 | (error "phone number unparsable.") | 739 | (error "phone number unparsable") |
| 734 | (setq phone-list (list (bbdb-string-trim phone)))) | 740 | (setq phone-list (list (bbdb-string-trim phone)))) |
| 735 | (signal (car err) (cdr err))))) | 741 | (signal (car err) (cdr err))))) |
| 736 | (if (= 3 (length phone-list)) | 742 | (if (= 3 (length phone-list)) |
| @@ -831,13 +837,13 @@ If ph-expanding-overwrites-query is t then the meaning of REPLACE is inverted." | |||
| 831 | query-format (cdr query-format))) | 837 | query-format (cdr query-format))) |
| 832 | (if words | 838 | (if words |
| 833 | (setcdr (car query-alist) | 839 | (setcdr (car query-alist) |
| 834 | (concat (cdar query-alist) " " | 840 | (concat (ph-cdar query-alist) " " |
| 835 | (mapconcat 'identity words " ")))) | 841 | (mapconcat 'identity words " ")))) |
| 836 | ;; Uniquify query-alist | 842 | ;; Uniquify query-alist |
| 837 | (setq query-alist (nreverse query-alist)) | 843 | (setq query-alist (nreverse query-alist)) |
| 838 | (while query-alist | 844 | (while query-alist |
| 839 | (setq key (caar query-alist) | 845 | (setq key (caar query-alist) |
| 840 | val (cdar query-alist) | 846 | val (ph-cdar query-alist) |
| 841 | cell (assq key query)) | 847 | cell (assq key query)) |
| 842 | (if cell | 848 | (if cell |
| 843 | (setcdr cell (concat val " " (cdr cell))) | 849 | (setcdr cell (concat val " " (cdr cell))) |
| @@ -984,7 +990,7 @@ for the existing fields and displays a corresponding form." | |||
| 984 | (if (listp sexp) | 990 | (if (listp sexp) |
| 985 | (progn | 991 | (progn |
| 986 | (if (and (eq (car sexp) 'setq) | 992 | (if (and (eq (car sexp) 'setq) |
| 987 | (eq (cadr sexp) 'ph-server-hotlist)) | 993 | (eq (ph-cadr sexp) 'ph-server-hotlist)) |
| 988 | (progn | 994 | (progn |
| 989 | (delete-region (save-excursion | 995 | (delete-region (save-excursion |
| 990 | (backward-sexp) | 996 | (backward-sexp) |
| @@ -992,7 +998,7 @@ for the existing fields and displays a corresponding form." | |||
| 992 | (point)) | 998 | (point)) |
| 993 | (setq setq-p t))) | 999 | (setq setq-p t))) |
| 994 | (if (and (eq (car sexp) 'provide) | 1000 | (if (and (eq (car sexp) 'provide) |
| 995 | (equal (cadr sexp) '(quote ph-options-file))) | 1001 | (equal (ph-cadr sexp) '(quote ph-options-file))) |
| 996 | (setq provide-p t)) | 1002 | (setq provide-p t)) |
| 997 | (if (and provide-p | 1003 | (if (and provide-p |
| 998 | setq-p) | 1004 | setq-p) |
| @@ -1016,7 +1022,7 @@ This function can only be called from a PH/QI query result buffer." | |||
| 1016 | (let ((record (and (overlays-at (point)) | 1022 | (let ((record (and (overlays-at (point)) |
| 1017 | (overlay-get (car (overlays-at (point))) 'ph-record)))) | 1023 | (overlay-get (car (overlays-at (point))) 'ph-record)))) |
| 1018 | (if (null record) | 1024 | (if (null record) |
| 1019 | (error "Point is not over a record.") | 1025 | (error "Point is not over a record") |
| 1020 | (ph-create-bbdb-record record)))) | 1026 | (ph-create-bbdb-record record)))) |
| 1021 | 1027 | ||
| 1022 | (defun ph-try-bbdb-insert () | 1028 | (defun ph-try-bbdb-insert () |