Mercurial > emacs
comparison lisp/textmodes/org.el @ 69482:a305f07816a9
(org-insert-centered): Use `string-width' to make
underlining work for wide characters.
(org-goto-map, org-agenda-mode-map, org-mode-map): Explicitly bind
TAB to `org-cycle', to make sure that no binding in
`outline-mode-map' can supercede it.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Wed, 15 Mar 2006 07:11:19 +0000 |
parents | d60237bf3ccc |
children | b1e915361a06 |
comparison
equal
deleted
inserted
replaced
69481:be6a0491d438 | 69482:a305f07816a9 |
---|---|
3 ;; Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. | 3 ;; Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. |
4 ;; | 4 ;; |
5 ;; Author: Carsten Dominik <dominik at science dot uva dot nl> | 5 ;; Author: Carsten Dominik <dominik at science dot uva dot nl> |
6 ;; Keywords: outlines, hypermedia, calendar, wp | 6 ;; Keywords: outlines, hypermedia, calendar, wp |
7 ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ | 7 ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ |
8 ;; Version: 4.09 | 8 ;; Version: 4.10 |
9 ;; | 9 ;; |
10 ;; This file is part of GNU Emacs. | 10 ;; This file is part of GNU Emacs. |
11 ;; | 11 ;; |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | 12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
13 ;; it under the terms of the GNU General Public License as published by | 13 ;; it under the terms of the GNU General Public License as published by |
79 ;; excellent reference card made by Philip Rooke. This card can be found | 79 ;; excellent reference card made by Philip Rooke. This card can be found |
80 ;; in the etc/ directory of Emacs 22. | 80 ;; in the etc/ directory of Emacs 22. |
81 ;; | 81 ;; |
82 ;; Changes since version 4.00: | 82 ;; Changes since version 4.00: |
83 ;; --------------------------- | 83 ;; --------------------------- |
84 ;; Version 4.10 | |
85 ;; - Bug fixes. | |
86 ;; | |
84 ;; Version 4.09 | 87 ;; Version 4.09 |
85 ;; - Bug fixes. | 88 ;; - Bug fixes. |
86 ;; - Small improvements to font-lock support. | 89 ;; - Small improvements to font-lock support. |
87 ;; - MHE support finalized. | 90 ;; - MHE support finalized. |
88 ;; | 91 ;; |
143 (defvar calc-embedded-open-formula) | 146 (defvar calc-embedded-open-formula) |
144 (defvar font-lock-unfontify-region-function) | 147 (defvar font-lock-unfontify-region-function) |
145 | 148 |
146 ;;; Customization variables | 149 ;;; Customization variables |
147 | 150 |
148 (defvar org-version "4.09" | 151 (defvar org-version "4.10" |
149 "The version number of the file org.el.") | 152 "The version number of the file org.el.") |
150 (defun org-version () | 153 (defun org-version () |
151 (interactive) | 154 (interactive) |
152 (message "Org-mode version %s" org-version)) | 155 (message "Org-mode version %s" org-version)) |
153 | 156 |
1737 Changing this variable requires a restart of Emacs to take effect." | 1740 Changing this variable requires a restart of Emacs to take effect." |
1738 :group 'org-font-lock | 1741 :group 'org-font-lock |
1739 :type 'boolean) | 1742 :type 'boolean) |
1740 | 1743 |
1741 (defface org-hide | 1744 (defface org-hide |
1742 '((((type tty) (class color)) (:foreground "blue" :weight bold)) | 1745 '( |
1746 (((type tty) (class color)) (:foreground "white")) | |
1743 (((class color) (background light)) (:foreground "white")) | 1747 (((class color) (background light)) (:foreground "white")) |
1744 (((class color) (background dark)) (:foreground "black")) | 1748 (((class color) (background dark)) (:foreground "black")) |
1745 ; (((class color) (background light)) (:foreground "grey90")) | 1749 ; (((class color) (backgro6und light)) (:foreground "grey90")) |
1746 ; (((class color) (background dark)) (:foreground "grey10")) | 1750 ; (((class color) (background dark)) (:foreground "grey10")) |
1747 (t (:inverse-video nil))) | 1751 (t (:inverse-video nil))) |
1748 "Face used for level 1 headlines." | 1752 "Face used for level 1 headlines." |
1749 :group 'org-font-lock) | 1753 :group 'org-font-lock) |
1750 | 1754 |
2587 (define-key org-goto-map [(left)] 'org-goto-left) | 2591 (define-key org-goto-map [(left)] 'org-goto-left) |
2588 (define-key org-goto-map [(right)] 'org-goto-right) | 2592 (define-key org-goto-map [(right)] 'org-goto-right) |
2589 (define-key org-goto-map [(?q)] 'org-goto-quit) | 2593 (define-key org-goto-map [(?q)] 'org-goto-quit) |
2590 (define-key org-goto-map [(control ?g)] 'org-goto-quit) | 2594 (define-key org-goto-map [(control ?g)] 'org-goto-quit) |
2591 (define-key org-goto-map "\C-i" 'org-cycle) | 2595 (define-key org-goto-map "\C-i" 'org-cycle) |
2596 (define-key org-goto-map [(tab)] 'org-cycle) | |
2592 (define-key org-goto-map [(down)] 'outline-next-visible-heading) | 2597 (define-key org-goto-map [(down)] 'outline-next-visible-heading) |
2593 (define-key org-goto-map [(up)] 'outline-previous-visible-heading) | 2598 (define-key org-goto-map [(up)] 'outline-previous-visible-heading) |
2594 (define-key org-goto-map "n" 'outline-next-visible-heading) | 2599 (define-key org-goto-map "n" 'outline-next-visible-heading) |
2595 (define-key org-goto-map "p" 'outline-previous-visible-heading) | 2600 (define-key org-goto-map "p" 'outline-previous-visible-heading) |
2596 (define-key org-goto-map "f" 'outline-forward-same-level) | 2601 (define-key org-goto-map "f" 'outline-forward-same-level) |
4375 (apply | 4380 (apply |
4376 (if (fboundp 'run-mode-hooks) 'run-mode-hooks 'run-hooks) | 4381 (if (fboundp 'run-mode-hooks) 'run-mode-hooks 'run-hooks) |
4377 (list 'org-agenda-mode-hook))) | 4382 (list 'org-agenda-mode-hook))) |
4378 | 4383 |
4379 (define-key org-agenda-mode-map "\C-i" 'org-agenda-goto) | 4384 (define-key org-agenda-mode-map "\C-i" 'org-agenda-goto) |
4385 (define-key org-agenda-mode-map [(tab)] 'org-agenda-goto) | |
4380 (define-key org-agenda-mode-map "\C-m" 'org-agenda-switch-to) | 4386 (define-key org-agenda-mode-map "\C-m" 'org-agenda-switch-to) |
4381 (define-key org-agenda-mode-map " " 'org-agenda-show) | 4387 (define-key org-agenda-mode-map " " 'org-agenda-show) |
4382 (define-key org-agenda-mode-map "\C-c\C-t" 'org-agenda-todo) | 4388 (define-key org-agenda-mode-map "\C-c\C-t" 'org-agenda-todo) |
4383 (define-key org-agenda-mode-map "o" 'delete-other-windows) | 4389 (define-key org-agenda-mode-map "o" 'delete-other-windows) |
4384 (define-key org-agenda-mode-map "L" 'org-agenda-recenter) | 4390 (define-key org-agenda-mode-map "L" 'org-agenda-recenter) |
10799 (setq line (replace-match "" nil nil line)))) | 10805 (setq line (replace-match "" nil nil line)))) |
10800 line) | 10806 line) |
10801 | 10807 |
10802 (defun org-insert-centered (s &optional underline) | 10808 (defun org-insert-centered (s &optional underline) |
10803 "Insert the string S centered and underline it with character UNDERLINE." | 10809 "Insert the string S centered and underline it with character UNDERLINE." |
10804 (let ((ind (max (/ (- 80 (length s)) 2) 0))) | 10810 (let ((ind (max (/ (- 80 (string-width s)) 2) 0))) |
10805 (insert (make-string ind ?\ ) s "\n") | 10811 (insert (make-string ind ?\ ) s "\n") |
10806 (if underline | 10812 (if underline |
10807 (insert (make-string ind ?\ ) | 10813 (insert (make-string ind ?\ ) |
10808 (make-string (length s) underline) | 10814 (make-string (string-width s) underline) |
10809 "\n")))) | 10815 "\n")))) |
10810 | 10816 |
10811 (defun org-ascii-level-start (level title umax) | 10817 (defun org-ascii-level-start (level title umax) |
10812 "Insert a new level in ASCII export." | 10818 "Insert a new level in ASCII export." |
10813 (let (char) | 10819 (let (char) |
11913 ;; Make `C-c C-x' a prefix key | 11919 ;; Make `C-c C-x' a prefix key |
11914 (define-key org-mode-map "\C-c\C-x" (make-sparse-keymap)) | 11920 (define-key org-mode-map "\C-c\C-x" (make-sparse-keymap)) |
11915 | 11921 |
11916 ;; TAB key with modifiers | 11922 ;; TAB key with modifiers |
11917 (define-key org-mode-map "\C-i" 'org-cycle) | 11923 (define-key org-mode-map "\C-i" 'org-cycle) |
11924 (define-key org-mode-map [(tab)] 'org-cycle) | |
11918 (define-key org-mode-map [(meta tab)] 'org-complete) | 11925 (define-key org-mode-map [(meta tab)] 'org-complete) |
11919 (define-key org-mode-map "\M-\C-i" 'org-complete) ; for tty emacs | 11926 (define-key org-mode-map "\M-\C-i" 'org-complete) ; for tty emacs |
11920 ;; The following line is necessary under Suse GNU/Linux | 11927 ;; The following line is necessary under Suse GNU/Linux |
11921 (unless org-xemacs-p | 11928 (unless org-xemacs-p |
11922 (define-key org-mode-map [S-iso-lefttab] 'org-shifttab)) | 11929 (define-key org-mode-map [S-iso-lefttab] 'org-shifttab)) |
12923 | 12930 |
12924 (run-hooks 'org-load-hook) | 12931 (run-hooks 'org-load-hook) |
12925 | 12932 |
12926 ;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd | 12933 ;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd |
12927 ;;; org.el ends here | 12934 ;;; org.el ends here |
12928 |