Mercurial > emacs
comparison lisp/apropos.el @ 13621:57b72553e78d
(apropos-print): Put the item property
on the whole printed symbol.
(apropos-follow): Look for the item property only adjacent to point.
Signal an error if there is none.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 21 Nov 1995 21:12:08 +0000 |
parents | 22697186f960 |
children | b5b44ae33653 |
comparison
equal
deleted
inserted
replaced
13620:e5b36a1526dd | 13621:57b72553e78d |
---|---|
460 'key-description) | 460 'key-description) |
461 item ", ") | 461 item ", ") |
462 "(not bound to any keys)"))) | 462 "(not bound to any keys)"))) |
463 (terpri) | 463 (terpri) |
464 ;; only now so we don't propagate text attributes all over | 464 ;; only now so we don't propagate text attributes all over |
465 (put-text-property point1 (1+ point1) 'item | 465 (put-text-property point1 point2 'item |
466 (if (eval `(or ,@(cdr apropos-item))) | 466 (if (eval `(or ,@(cdr apropos-item))) |
467 (car apropos-item) | 467 (car apropos-item) |
468 apropos-item)) | 468 apropos-item)) |
469 (if apropos-symbol-face | 469 (if apropos-symbol-face |
470 (put-text-property point1 point2 'face apropos-symbol-face)) | 470 (put-text-property point1 point2 'face apropos-symbol-face)) |
522 | 522 |
523 | 523 |
524 (defun apropos-follow (&optional other) | 524 (defun apropos-follow (&optional other) |
525 (interactive) | 525 (interactive) |
526 (let ((point (point)) | 526 (let ((point (point)) |
527 (item (get-text-property (point) 'item)) | 527 (item |
528 (or (and (not (eobp)) (get-text-property (point) 'item)) | |
529 (and (not (bobp)) (get-text-property (1- (point)) 'item)))) | |
528 action action-point) | 530 action action-point) |
529 (or item | 531 (if (null item) |
530 (setq item (if (bobp) | 532 (error "There is nothing to follow here")) |
531 () | |
532 (previous-single-property-change (point) 'item)) | |
533 item (get-text-property | |
534 (1- (goto-char | |
535 (if item | |
536 item | |
537 (1+ (next-single-property-change (point) 'item))))) | |
538 'item))) | |
539 (if (consp item) | 533 (if (consp item) |
540 (error "%s is just a lonely symbol" (car item))) | 534 (error "There is nothing to follow in `%s'" (car item))) |
541 (while (if (setq action-point | 535 (while (if (setq action-point |
542 (next-single-property-change (point) 'action)) | 536 (next-single-property-change (point) 'action)) |
543 (<= action-point point)) | 537 (<= action-point point)) |
544 (goto-char (1+ action-point)) | 538 (goto-char (1+ action-point)) |
545 (setq action action-point)) | 539 (setq action action-point)) |