Mercurial > emacs
comparison lisp/emulation/ws-mode.el @ 104993:403125cdfb24
Replace empty `let's with `progn'.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sun, 13 Sep 2009 02:14:25 +0000 |
parents | a9dc0e7c3f2b |
children | 1d1d5d9bd884 |
comparison
equal
deleted
inserted
replaced
104992:d5da691bfe56 | 104993:403125cdfb24 |
---|---|
1 ;;; ws-mode.el --- WordStar emulation mode for GNU Emacs | 1 ;;; ws-mode.el --- WordStar emulation mode for GNU Emacs |
2 | 2 |
3 ;; Copyright (C) 1991, 2001, 2002, 2003, 2004, 2005, | 3 ;; Copyright (C) 1991, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
4 ;; 2006, 2007, 2008, 2009 Free Software Foundation, Inc. | 4 ;; 2009 Free Software Foundation, Inc. |
5 | 5 |
6 ;; Author: Juergen Nickelsen <nickel@cs.tu-berlin.de> | 6 ;; Author: Juergen Nickelsen <nickel@cs.tu-berlin.de> |
7 ;; Version: 0.7 | 7 ;; Version: 0.7 |
8 ;; Keywords: emulations | 8 ;; Keywords: emulations |
9 | 9 |
455 "In WordStar mode: Show block markers." | 455 "In WordStar mode: Show block markers." |
456 (interactive) | 456 (interactive) |
457 (if (or ws-block-begin-marker ws-block-end-marker) | 457 (if (or ws-block-begin-marker ws-block-end-marker) |
458 (save-excursion | 458 (save-excursion |
459 (if ws-block-begin-marker | 459 (if ws-block-begin-marker |
460 (let () | 460 (progn |
461 (goto-char ws-block-begin-marker) | 461 (goto-char ws-block-begin-marker) |
462 (message "Block begin marker") | 462 (message "Block begin marker") |
463 (sit-for 2)) | 463 (sit-for 2)) |
464 (message "Block begin marker not set") | 464 (message "Block begin marker not set") |
465 (sit-for 2)) | 465 (sit-for 2)) |
466 (if ws-block-end-marker | 466 (if ws-block-end-marker |
467 (let () | 467 (progn |
468 (goto-char ws-block-end-marker) | 468 (goto-char ws-block-end-marker) |
469 (message "Block end marker") | 469 (message "Block end marker") |
470 (sit-for 2)) | 470 (sit-for 2)) |
471 (message "Block end marker not set")) | 471 (message "Block end marker not set")) |
472 (message "")) | 472 (message "")) |
507 | 507 |
508 (defun ws-move-block () | 508 (defun ws-move-block () |
509 "In WordStar mode: Move block to current cursor position." | 509 "In WordStar mode: Move block to current cursor position." |
510 (interactive) | 510 (interactive) |
511 (if (and ws-block-begin-marker ws-block-end-marker) | 511 (if (and ws-block-begin-marker ws-block-end-marker) |
512 (let () | 512 (progn |
513 (kill-region ws-block-begin-marker ws-block-end-marker) | 513 (kill-region ws-block-begin-marker ws-block-end-marker) |
514 (yank) | 514 (yank) |
515 (save-excursion | 515 (save-excursion |
516 (goto-char (region-beginning)) | 516 (goto-char (region-beginning)) |
517 (setq ws-block-begin-marker (point-marker)) | 517 (setq ws-block-begin-marker (point-marker)) |
534 | 534 |
535 (defun ws-delete-block () | 535 (defun ws-delete-block () |
536 "In WordStar mode: Delete block." | 536 "In WordStar mode: Delete block." |
537 (interactive) | 537 (interactive) |
538 (if (and ws-block-begin-marker ws-block-end-marker) | 538 (if (and ws-block-begin-marker ws-block-end-marker) |
539 (let () | 539 (progn |
540 (kill-region ws-block-begin-marker ws-block-end-marker) | 540 (kill-region ws-block-begin-marker ws-block-end-marker) |
541 (setq ws-block-end-marker nil) | 541 (setq ws-block-end-marker nil) |
542 (setq ws-block-begin-marker nil)) | 542 (setq ws-block-begin-marker nil)) |
543 (ws-error (cond (ws-block-begin-marker "Block end marker not set") | 543 (ws-error (cond (ws-block-begin-marker "Block end marker not set") |
544 (ws-block-end-marker "Block begin marker not set") | 544 (ws-block-end-marker "Block begin marker not set") |
546 | 546 |
547 (defun ws-find-marker-0 () | 547 (defun ws-find-marker-0 () |
548 "In WordStar mode: Go to marker 0." | 548 "In WordStar mode: Go to marker 0." |
549 (interactive) | 549 (interactive) |
550 (if ws-marker-0 | 550 (if ws-marker-0 |
551 (let () | 551 (progn |
552 (setq ws-last-cursorposition (point-marker)) | 552 (setq ws-last-cursorposition (point-marker)) |
553 (goto-char ws-marker-0)) | 553 (goto-char ws-marker-0)) |
554 (ws-error "Marker 0 not set"))) | 554 (ws-error "Marker 0 not set"))) |
555 | 555 |
556 (defun ws-find-marker-1 () | 556 (defun ws-find-marker-1 () |
557 "In WordStar mode: Go to marker 1." | 557 "In WordStar mode: Go to marker 1." |
558 (interactive) | 558 (interactive) |
559 (if ws-marker-1 | 559 (if ws-marker-1 |
560 (let () | 560 (progn |
561 (setq ws-last-cursorposition (point-marker)) | 561 (setq ws-last-cursorposition (point-marker)) |
562 (goto-char ws-marker-1)) | 562 (goto-char ws-marker-1)) |
563 (ws-error "Marker 1 not set"))) | 563 (ws-error "Marker 1 not set"))) |
564 | 564 |
565 (defun ws-find-marker-2 () | 565 (defun ws-find-marker-2 () |
566 "In WordStar mode: Go to marker 2." | 566 "In WordStar mode: Go to marker 2." |
567 (interactive) | 567 (interactive) |
568 (if ws-marker-2 | 568 (if ws-marker-2 |
569 (let () | 569 (progn |
570 (setq ws-last-cursorposition (point-marker)) | 570 (setq ws-last-cursorposition (point-marker)) |
571 (goto-char ws-marker-2)) | 571 (goto-char ws-marker-2)) |
572 (ws-error "Marker 2 not set"))) | 572 (ws-error "Marker 2 not set"))) |
573 | 573 |
574 (defun ws-find-marker-3 () | 574 (defun ws-find-marker-3 () |
575 "In WordStar mode: Go to marker 3." | 575 "In WordStar mode: Go to marker 3." |
576 (interactive) | 576 (interactive) |
577 (if ws-marker-3 | 577 (if ws-marker-3 |
578 (let () | 578 (progn |
579 (setq ws-last-cursorposition (point-marker)) | 579 (setq ws-last-cursorposition (point-marker)) |
580 (goto-char ws-marker-3)) | 580 (goto-char ws-marker-3)) |
581 (ws-error "Marker 3 not set"))) | 581 (ws-error "Marker 3 not set"))) |
582 | 582 |
583 (defun ws-find-marker-4 () | 583 (defun ws-find-marker-4 () |
584 "In WordStar mode: Go to marker 4." | 584 "In WordStar mode: Go to marker 4." |
585 (interactive) | 585 (interactive) |
586 (if ws-marker-4 | 586 (if ws-marker-4 |
587 (let () | 587 (progn |
588 (setq ws-last-cursorposition (point-marker)) | 588 (setq ws-last-cursorposition (point-marker)) |
589 (goto-char ws-marker-4)) | 589 (goto-char ws-marker-4)) |
590 (ws-error "Marker 4 not set"))) | 590 (ws-error "Marker 4 not set"))) |
591 | 591 |
592 (defun ws-find-marker-5 () | 592 (defun ws-find-marker-5 () |
593 "In WordStar mode: Go to marker 5." | 593 "In WordStar mode: Go to marker 5." |
594 (interactive) | 594 (interactive) |
595 (if ws-marker-5 | 595 (if ws-marker-5 |
596 (let () | 596 (progn |
597 (setq ws-last-cursorposition (point-marker)) | 597 (setq ws-last-cursorposition (point-marker)) |
598 (goto-char ws-marker-5)) | 598 (goto-char ws-marker-5)) |
599 (ws-error "Marker 5 not set"))) | 599 (ws-error "Marker 5 not set"))) |
600 | 600 |
601 (defun ws-find-marker-6 () | 601 (defun ws-find-marker-6 () |
602 "In WordStar mode: Go to marker 6." | 602 "In WordStar mode: Go to marker 6." |
603 (interactive) | 603 (interactive) |
604 (if ws-marker-6 | 604 (if ws-marker-6 |
605 (let () | 605 (progn |
606 (setq ws-last-cursorposition (point-marker)) | 606 (setq ws-last-cursorposition (point-marker)) |
607 (goto-char ws-marker-6)) | 607 (goto-char ws-marker-6)) |
608 (ws-error "Marker 6 not set"))) | 608 (ws-error "Marker 6 not set"))) |
609 | 609 |
610 (defun ws-find-marker-7 () | 610 (defun ws-find-marker-7 () |
611 "In WordStar mode: Go to marker 7." | 611 "In WordStar mode: Go to marker 7." |
612 (interactive) | 612 (interactive) |
613 (if ws-marker-7 | 613 (if ws-marker-7 |
614 (let () | 614 (progn |
615 (setq ws-last-cursorposition (point-marker)) | 615 (setq ws-last-cursorposition (point-marker)) |
616 (goto-char ws-marker-7)) | 616 (goto-char ws-marker-7)) |
617 (ws-error "Marker 7 not set"))) | 617 (ws-error "Marker 7 not set"))) |
618 | 618 |
619 (defun ws-find-marker-8 () | 619 (defun ws-find-marker-8 () |
620 "In WordStar mode: Go to marker 8." | 620 "In WordStar mode: Go to marker 8." |
621 (interactive) | 621 (interactive) |
622 (if ws-marker-8 | 622 (if ws-marker-8 |
623 (let () | 623 (progn |
624 (setq ws-last-cursorposition (point-marker)) | 624 (setq ws-last-cursorposition (point-marker)) |
625 (goto-char ws-marker-8)) | 625 (goto-char ws-marker-8)) |
626 (ws-error "Marker 8 not set"))) | 626 (ws-error "Marker 8 not set"))) |
627 | 627 |
628 (defun ws-find-marker-9 () | 628 (defun ws-find-marker-9 () |
629 "In WordStar mode: Go to marker 9." | 629 "In WordStar mode: Go to marker 9." |
630 (interactive) | 630 (interactive) |
631 (if ws-marker-9 | 631 (if ws-marker-9 |
632 (let () | 632 (progn |
633 (setq ws-last-cursorposition (point-marker)) | 633 (setq ws-last-cursorposition (point-marker)) |
634 (goto-char ws-marker-9)) | 634 (goto-char ws-marker-9)) |
635 (ws-error "Marker 9 not set"))) | 635 (ws-error "Marker 9 not set"))) |
636 | 636 |
637 (defun ws-goto-block-begin () | 637 (defun ws-goto-block-begin () |
638 "In WordStar mode: Go to block begin marker." | 638 "In WordStar mode: Go to block begin marker." |
639 (interactive) | 639 (interactive) |
640 (if ws-block-begin-marker | 640 (if ws-block-begin-marker |
641 (let () | 641 (progn |
642 (setq ws-last-cursorposition (point-marker)) | 642 (setq ws-last-cursorposition (point-marker)) |
643 (goto-char ws-block-begin-marker)) | 643 (goto-char ws-block-begin-marker)) |
644 (ws-error "Block begin marker not set"))) | 644 (ws-error "Block begin marker not set"))) |
645 | 645 |
646 (defun ws-search (string) | 646 (defun ws-search (string) |
663 | 663 |
664 (defun ws-goto-block-end () | 664 (defun ws-goto-block-end () |
665 "In WordStar mode: Go to block end marker." | 665 "In WordStar mode: Go to block end marker." |
666 (interactive) | 666 (interactive) |
667 (if ws-block-end-marker | 667 (if ws-block-end-marker |
668 (let () | 668 (progn |
669 (setq ws-last-cursorposition (point-marker)) | 669 (setq ws-last-cursorposition (point-marker)) |
670 (goto-char ws-block-end-marker)) | 670 (goto-char ws-block-end-marker)) |
671 (ws-error "Block end marker not set"))) | 671 (ws-error "Block end marker not set"))) |
672 | 672 |
673 (defun ws-undo () | 673 (defun ws-undo () |
678 | 678 |
679 (defun ws-goto-last-cursorposition () | 679 (defun ws-goto-last-cursorposition () |
680 "In WordStar mode: " | 680 "In WordStar mode: " |
681 (interactive) | 681 (interactive) |
682 (if ws-last-cursorposition | 682 (if ws-last-cursorposition |
683 (let () | 683 (progn |
684 (setq ws-last-cursorposition (point-marker)) | 684 (setq ws-last-cursorposition (point-marker)) |
685 (goto-char ws-last-cursorposition)) | 685 (goto-char ws-last-cursorposition)) |
686 (ws-error "No last cursor position available."))) | 686 (ws-error "No last cursor position available."))) |
687 | 687 |
688 (defun ws-last-error () | 688 (defun ws-last-error () |
738 | 738 |
739 (defun ws-copy-block () | 739 (defun ws-copy-block () |
740 "In WordStar mode: Copy block to current cursor position." | 740 "In WordStar mode: Copy block to current cursor position." |
741 (interactive) | 741 (interactive) |
742 (if (and ws-block-begin-marker ws-block-end-marker) | 742 (if (and ws-block-begin-marker ws-block-end-marker) |
743 (let () | 743 (progn |
744 (copy-region-as-kill ws-block-begin-marker ws-block-end-marker) | 744 (copy-region-as-kill ws-block-begin-marker ws-block-end-marker) |
745 (yank) | 745 (yank) |
746 (save-excursion | 746 (save-excursion |
747 (goto-char (region-beginning)) | 747 (goto-char (region-beginning)) |
748 (setq ws-block-begin-marker (point-marker)) | 748 (setq ws-block-begin-marker (point-marker)) |