diff options
| author | Chong Yidong | 2011-03-01 22:48:01 -0500 |
|---|---|---|
| committer | Chong Yidong | 2011-03-01 22:48:01 -0500 |
| commit | d77aaf6f83896eef355c71b5596c6806528f595e (patch) | |
| tree | d695feb3cb7bcc5dde0f70de24ea5efd55a587cd | |
| parent | 771fc75ee915ce4cbf6f257a82e22ea49462df72 (diff) | |
| download | emacs-d77aaf6f83896eef355c71b5596c6806528f595e.tar.gz emacs-d77aaf6f83896eef355c71b5596c6806528f595e.zip | |
Add a menu-bar entry for Artist mode.
* lisp/textmodes/artist.el (artist-curr-go): Default to pen-line.
(artist-select-op-pen-line): New function.
(artist-menu-map): New variable.
(artist-mode-map): Add a menu to the menu-bar.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/textmodes/artist.el | 50 |
2 files changed, 56 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index be17986ddf8..a75520f08b7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-03-02 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * textmodes/artist.el (artist-curr-go): Default to pen-line. | ||
| 4 | (artist-select-op-pen-line): New function. | ||
| 5 | (artist-menu-map): New variable. | ||
| 6 | (artist-mode-map): Add a menu to the menu-bar. | ||
| 7 | |||
| 1 | 2011-03-02 Jay Belanger <jay.p.belanger@gmail.com> | 8 | 2011-03-02 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 9 | ||
| 3 | * calc/calc-math.el (calcFunc-log10): Check for symbolic mode | 10 | * calc/calc-math.el (calcFunc-log10): Check for symbolic mode |
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index f1e73dcf480..5fbc8a643d8 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el | |||
| @@ -422,7 +422,7 @@ be in `artist-spray-chars', or spraying will behave strangely.") | |||
| 422 | (defvar artist-mode-name " Artist" | 422 | (defvar artist-mode-name " Artist" |
| 423 | "Name of Artist mode beginning with a space (appears in the mode-line).") | 423 | "Name of Artist mode beginning with a space (appears in the mode-line).") |
| 424 | 424 | ||
| 425 | (defvar artist-curr-go 'pen-char | 425 | (defvar artist-curr-go 'pen-line |
| 426 | "Current selected graphics operation.") | 426 | "Current selected graphics operation.") |
| 427 | (make-variable-buffer-local 'artist-curr-go) | 427 | (make-variable-buffer-local 'artist-curr-go) |
| 428 | 428 | ||
| @@ -502,6 +502,49 @@ This variable is initialized by the `artist-make-prev-next-op-alist' function.") | |||
| 502 | (defvar artist-arrow-point-1 nil) | 502 | (defvar artist-arrow-point-1 nil) |
| 503 | (defvar artist-arrow-point-2 nil) | 503 | (defvar artist-arrow-point-2 nil) |
| 504 | 504 | ||
| 505 | (defvar artist-menu-map | ||
| 506 | (let ((map (make-sparse-keymap))) | ||
| 507 | (define-key map [spray-chars] | ||
| 508 | '(menu-item "Characters for Spray" artist-select-spray-chars | ||
| 509 | :help "Choose characters for sprayed by the spray-can")) | ||
| 510 | (define-key map [borders] | ||
| 511 | '(menu-item "Draw Shape Borders" artist-toggle-borderless-shapes | ||
| 512 | :help "Toggle whether shapes are drawn with borders" | ||
| 513 | :button (:toggle . (not artist-borderless-shapes)))) | ||
| 514 | (define-key map [trimming] | ||
| 515 | '(menu-item "Trim Line Endings" artist-toggle-trim-line-endings | ||
| 516 | :help "Toggle trimming of line-endings" | ||
| 517 | :button (:toggle . artist-trim-line-endings))) | ||
| 518 | (define-key map [rubber-band] | ||
| 519 | '(menu-item "Rubber-banding" artist-toggle-rubber-banding | ||
| 520 | :help "Toggle rubber-banding" | ||
| 521 | :button (:toggle . artist-rubber-banding))) | ||
| 522 | (define-key map [set-erase] | ||
| 523 | '(menu-item "Character to Erase..." artist-select-erase-char | ||
| 524 | :help "Choose a specific character to erase")) | ||
| 525 | (define-key map [set-line] | ||
| 526 | '(menu-item "Character for Line..." artist-select-line-char | ||
| 527 | :help "Choose the character to insert when drawing lines")) | ||
| 528 | (define-key map [set-fill] | ||
| 529 | '(menu-item "Character for Fill..." artist-select-fill-char | ||
| 530 | :help "Choose the character to insert when filling in shapes")) | ||
| 531 | (define-key map [artist-separator] '(menu-item "--")) | ||
| 532 | (dolist (op '(("Vaporize" artist-select-op-vaporize-lines vaporize-lines) | ||
| 533 | ("Erase" artist-select-op-erase-rectangle erase-rect) | ||
| 534 | ("Spray-can" artist-select-op-spray-set-size spray-get-size) | ||
| 535 | ("Text" artist-select-op-text-overwrite text-ovwrt) | ||
| 536 | ("Ellipse" artist-select-op-circle circle) | ||
| 537 | ("Poly-line" artist-select-op-straight-poly-line spolyline) | ||
| 538 | ("Rectangle" artist-select-op-square square) | ||
| 539 | ("Line" artist-select-op-straight-line s-line) | ||
| 540 | ("Pen" artist-select-op-pen-line pen-line))) | ||
| 541 | (define-key map (vector (nth 2 op)) | ||
| 542 | `(menu-item ,(nth 0 op) | ||
| 543 | ,(nth 1 op) | ||
| 544 | :help ,(format "Draw using the %s style" (nth 0 op)) | ||
| 545 | :button (:radio . (eq artist-curr-go ',(nth 2 op)))))) | ||
| 546 | map)) | ||
| 547 | |||
| 505 | (defvar artist-mode-map | 548 | (defvar artist-mode-map |
| 506 | (let ((map (make-sparse-keymap))) | 549 | (let ((map (make-sparse-keymap))) |
| 507 | (setq artist-mode-map (make-sparse-keymap)) | 550 | (setq artist-mode-map (make-sparse-keymap)) |
| @@ -554,6 +597,7 @@ This variable is initialized by the `artist-make-prev-next-op-alist' function.") | |||
| 554 | (define-key map "\C-c\C-a\C-y" 'artist-select-op-paste) | 597 | (define-key map "\C-c\C-a\C-y" 'artist-select-op-paste) |
| 555 | (define-key map "\C-c\C-af" 'artist-select-op-flood-fill) | 598 | (define-key map "\C-c\C-af" 'artist-select-op-flood-fill) |
| 556 | (define-key map "\C-c\C-a\C-b" 'artist-submit-bug-report) | 599 | (define-key map "\C-c\C-a\C-b" 'artist-submit-bug-report) |
| 600 | (define-key map [menu-bar artist] (cons "Artist" artist-menu-map)) | ||
| 557 | map) | 601 | map) |
| 558 | "Keymap for `artist-minor-mode'.") | 602 | "Keymap for `artist-minor-mode'.") |
| 559 | 603 | ||
| @@ -4601,6 +4645,10 @@ If optional argument STATE is positive, turn borders on." | |||
| 4601 | 4645 | ||
| 4602 | (artist-arrow-point-set-state artist-arrow-point-2 new-state))))) | 4646 | (artist-arrow-point-set-state artist-arrow-point-2 new-state))))) |
| 4603 | 4647 | ||
| 4648 | (defun artist-select-op-pen-line () | ||
| 4649 | "Select drawing pen lines." | ||
| 4650 | (interactive) | ||
| 4651 | (artist-select-operation "Pen Line")) | ||
| 4604 | 4652 | ||
| 4605 | (defun artist-select-op-line () | 4653 | (defun artist-select-op-line () |
| 4606 | "Select drawing lines." | 4654 | "Select drawing lines." |