aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2006-03-15 17:22:12 +0000
committerKaroly Lorentey2006-03-15 17:22:12 +0000
commitb336ee388ed5300440e7bab24bf9eec9f250911a (patch)
tree62c9058bd403d158d7d18d1cbd4ead3abf36a7aa /lisp
parent47f3c6b4dbed851762dca99273d78642c3794188 (diff)
parent4034b0e259dd59eda180bd0683876c9d0110f719 (diff)
downloademacs-b336ee388ed5300440e7bab24bf9eec9f250911a.tar.gz
emacs-b336ee388ed5300440e7bab24bf9eec9f250911a.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-153 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-154 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-155 Remove nick-abbrevs stuff from rcirc.el * emacs@sv.gnu.org/emacs--devo--0--patch-156 rcirc.el update from Ryan Yeske * emacs@sv.gnu.org/emacs--devo--0--patch-157 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-158 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-159 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-532
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog125
-rw-r--r--lisp/allout.el220
-rw-r--r--lisp/cus-start.el7
-rw-r--r--lisp/font-core.el28
-rw-r--r--lisp/font-lock.el17
-rw-r--r--lisp/ibuf-ext.el1
-rw-r--r--lisp/image.el52
-rw-r--r--lisp/jit-lock.el68
-rw-r--r--lisp/mh-e/ChangeLog23
-rw-r--r--lisp/mh-e/mh-compat.el51
-rw-r--r--lisp/mh-e/mh-e.el3
-rw-r--r--lisp/mh-e/mh-folder.el5
-rw-r--r--lisp/mh-e/mh-letter.el5
-rw-r--r--lisp/mh-e/mh-utils.el7
-rw-r--r--lisp/net/rcirc.el28
-rw-r--r--lisp/progmodes/gdb-ui.el217
-rw-r--r--lisp/progmodes/gud.el11
-rw-r--r--lisp/textmodes/org.el311
-rw-r--r--lisp/tree-widget.el155
19 files changed, 821 insertions, 513 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 50aa28d3b4a..f58a240c3ec 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,128 @@
12006-03-14 Ken Manheimer <ken.manheimer@gmail.com>
2
3 * allout.el: Increment version to 2.2.1 in file commentary.
4
5 (allout-version): Increment to 2.2.1.
6
7 (allout-default-layout): New customization variable, used when the
8 file lacks a specific allout-layout. Uses allout-layout-type for
9 recursively nested definition.
10
11 (allout-layout-type): Widget defining allout layouts, necessary for
12 self-recursive definition.
13
14 (allout-mode): Incorporate allout-default-layout as fallback for
15 allout-layout.
16
17 (allout-layout): Mark as 'safe-local-variable', and refer mention
18 fallback to `allout-default-layout' in absence of a specified value.
19 (allout-passphrase-verifier-string)
20 (allout-passphrase-hint-string): Mark as 'safe-local-variable'.
21
22 (allout-file-passphrase-verifier-string): Obsolete variable, removed.
23
24 (allout-get-encryption-passphrase-verifier): Use correct name of
25 passphrase verifier in docstring.
26
272006-03-15 Nick Roberts <nickrob@snap.net.nz>
28
29 * progmodes/gdb-ui.el (gdb-var-list): Change order of first two
30 elements.
31 (gdb-find-watch-expression): Make it work for arrays too. Follow
32 change to gdb-var-list.
33 (gud-watch): Allow the user to enter variable name with a prexix
34 arg. Create keybindings.
35 (gdb-var-create-handler, gdb-var-evaluate-expression-handler)
36 (gdb-var-list-children-handler, gdb-var-update-handler)
37 (gdb-var-delete, gdb-edit-value, gdb-speedbar-expand-node)
38 (gdb-var-list-children-handler-1, gdb-var-update-handler-1):
39 Follow change to gdb-var-list.
40 (gdb-starting): Don't show the overlay arrows when program is
41 running.
42
43 * progmodes/gud.el (gud-speedbar-buttons): Follow change to
44 gdb-var-list.
45
462006-03-14 Bill Wohler <wohler@newt.com>
47
48 * image.el (image-load-path-for-library): Pass value of path
49 rather than symbol. Always return list of directories. Guarantee
50 that image directory comes first.
51
522006-03-14 Alan Mackenzie <acm@muc.de>
53
54 * font-core.el: New function/variable
55 font-lock-extend-region\(-function\)?.
56
57 * font-lock.el (font-lock-after-change-function): Call
58 font-lock-extend-region. Obey font-lock-lines-before.
59 (font-lock-default-fontify-region): Remove reference to
60 font-lock-lines-before.
61
62 * jit-lock.el (jit-lock-after-change): Call
63 font-lock-extend-region. Obey font-lock-lines-before.
64
652006-03-14 David Ponce <david@dponce.com>
66
67 * tree-widget.el (tree-widget-themes-load-path)
68 (tree-widget-themes-directory, tree-widget-theme): Doc fix.
69
702006-03-13 Ryan Yeske <rcyeske@gmail.com>
71
72 * net/rcirc.el (rcirc) <defgroup>: Add link to manual.
73 (rcirc-print): Mark the start of text at the end of the prompt.
74 (rcirc-track-minor-mode): Add autoload cookie.
75 (rcirc-update-activity-string): Add space to front of mode-line
76 indicator.
77
782006-03-13 Miles Bader <miles@gnu.org>
79
80 * net/rcirc.el (rcirc-nick-abbrevs): Remove variable.
81 (rcirc-abbrev-nick): Remove function.
82 (rcirc-format-response-string): Don't call `rcirc-abbrev-nick'.
83
842006-03-13 David Ponce <david@dponce.com>
85
86 * tree-widget.el: Handle themes across all occurrences of the main
87 themes sub-directory found in tree-widget-themes-load-path.
88 (tree-widget-themes-directory, tree-widget-theme): Doc fix.
89 (tree-widget--locate-sub-directory): Return all occurrences.
90 (tree-widget-themes-path): New function. Replace
91 tree-widget-themes-directory, and return a list of directories.
92 (tree-widget-set-parent-theme)
93 (tree-widget-lookup-image): Use it.
94
952006-03-13 Carsten Dominik <dominik@science.uva.nl>
96
97 * textmodes/org.el: (org-link-search): Avoid self-matching of
98 links, allow target text to be distributed over several lines.
99 (org-search-not-link): New function.
100 (org-set-regexps-and-options, org-get-current-options): New
101 startup options.
102 (org-export-as-html): Take odd-level setting from local variable.
103 (org-fontify-emphasized-text): New option.
104 (org-set-font-lock-defaults): Include emphasized text.
105 (org-follow-mhe-link): Allow folder-only links, fix folder name.
106 (org-font-lock): Customize group renamed from `org-faces'.
107
1082006-03-13 John Paul Wallington <jpw@pobox.com>
109
110 * ibuf-ext.el (ibuffer-never-show-predicates): Add `require'
111 keyword; require `ibuf-ext' feature. Thanks to Zhang Wei.
112
1132006-03-12 Luc Teirlinck <teirllm@auburn.edu>
114
115 * cus-start.el (all): Delete :version keyword for members of the
116 fringe group, since the entire group is new in 22.1.
117
1182006-03-13 Nick Roberts <nickrob@snap.net.nz>
119
120 * progmodes/gdb-ui.el (gdb-stack-list-locals-handler): Add local
121 map if value is hexadecimal (an address).
122 (gud-watch): Only search roots for existing watch expressions.
123 (gdb-speedbar-refresh): Bind speedbar-shown-directories to nil to
124 prevent caching problems with speedbar-update-directory-contents.
125
12006-03-12 Juri Linkov <juri@jurta.org> 1262006-03-12 Juri Linkov <juri@jurta.org>
2 127
3 * battery.el (battery-linux-proc-acpi): Check `capacity' for non-nil 128 * battery.el (battery-linux-proc-acpi): Check `capacity' for non-nil
diff --git a/lisp/allout.el b/lisp/allout.el
index 6690456123e..31ed3a791ea 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -6,7 +6,7 @@
6;; Author: Ken Manheimer <ken dot manheimer at gmail dot com> 6;; Author: Ken Manheimer <ken dot manheimer at gmail dot com>
7;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com> 7;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com>
8;; Created: Dec 1991 - first release to usenet 8;; Created: Dec 1991 - first release to usenet
9;; Version: 2.2 9;; Version: 2.2.1
10;; Keywords: outlines wp languages 10;; Keywords: outlines wp languages
11 11
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
@@ -126,38 +126,72 @@ this variable."
126 (const :tag "Mode only" "activate") 126 (const :tag "Mode only" "activate")
127 (const :tag "Off" nil)) 127 (const :tag "Off" nil))
128 :group 'allout) 128 :group 'allout)
129;;;_ = allout-layout 129;;;_ = allout-default-layout
130(defvar allout-layout nil 130(defcustom allout-default-layout '(-2 : 0)
131 "*Layout specification and provisional mode trigger for allout outlines. 131 "*Default allout outline layout specification.
132
133This setting specifies the outline exposure to use when
134`allout-layout' has the local value `t'. This docstring describes the
135layout specifications.
136
137A list value specifies a default layout for the current buffer,
138to be applied upon activation of `allout-mode'. Any non-nil
139value will automatically trigger `allout-mode', provided
140`allout-init' has been called to enable this behavior.
141
142The types of elements in the layout specification are:
143
144 integer - dictate the relative depth to open the corresponding topic(s),
145 where:
146 - negative numbers force the topic to be closed before opening
147 to the absolute value of the number, so all siblings are open
148 only to that level.
149 - positive numbers open to the relative depth indicated by the
150 number, but do not force already opened subtopics to be closed.
151 - 0 means to close topic - hide all subitems.
152 : - repeat spec - apply the preceeding element to all siblings at
153 current level, *up to* those siblings that would be covered by specs
154 following the `:' on the list. Ie, apply to all topics at level but
155 trailing ones accounted for by trailing specs. \(Only the first of
156 multiple colons at the same level is honored - later ones are ignored.)
157 * - completely exposes the topic, including bodies
158 + - exposes all subtopics, but not the bodies
159 - - exposes the body of the corresponding topic, but not subtopics
160 list - a nested layout spec, to be applied intricately to its
161 corresponding item(s)
132 162
133Buffer-specific. 163Examples:
134 164 '(-2 : 0)
135A list value specifies a default layout for the current buffer, to be 165 Collapse the top-level topics to show their children and
136applied upon activation of `allout-mode'. Any non-nil value will 166 grandchildren, but completely collapse the final top-level topic.
137automatically trigger `allout-mode' \(provided `allout-init' has been called 167 '(-1 () : 1 0)
138to enable this behavior). 168 Close the first topic so only the immediate subtopics are shown,
139 169 leave the subsequent topics exposed as they are until the second
140See the docstring for `allout-init' for details on setting up for 170 second to last topic, which is exposed at least one level, and
141auto-mode-activation, and for `allout-expose-topic' for the format of 171 completely close the last topic.
142the layout specification. 172 '(-2 : -1 *)
143 173 Expose children and grandchildren of all topics at current
144You can associate a particular outline layout with a file by setting 174 level except the last two; expose children of the second to
145this var via the file's local variables. For example, the following 175 last and completely expose the last one, including its subtopics.
146lines at the bottom of an Emacs Lisp file:
147
148;;;Local variables:
149;;;allout-layout: \(0 : -1 -1 0)
150;;;End:
151 176
152will, modulo the above-mentioned conditions, cause the mode to be 177See `allout-expose-topic' for more about the exposure process.
153activated when the file is visited, followed by the equivalent of
154`\(allout-expose-topic 0 : -1 -1 0)'. \(This is the layout used for
155the allout.el source file.)
156 178
157Also, allout's mode-specific provisions will make topic prefixes default 179Also, allout's mode-specific provisions will make topic prefixes default
158to the comment-start string, if any, of the language of the file. This 180to the comment-start string, if any, of the language of the file. This
159is modulo the setting of `allout-use-mode-specific-leader', which see.") 181is modulo the setting of `allout-use-mode-specific-leader', which see."
160(make-variable-buffer-local 'allout-layout) 182 :type 'allout-layout-type
183 :group 'allout)
184;;;_ : allout-layout-type
185(define-widget 'allout-layout-type 'lazy
186 "Allout layout format customization basic building blocks."
187 :type '(repeat
188 (choice (integer :tag "integer (<= zero is strict)")
189 (const :tag ": (repeat prior)" :)
190 (const :tag "* (completely expose)" *)
191 (const :tag "+ (expose all offspring, headlines only)" +)
192 (const :tag "- (expose topic body but not offspring)" -)
193 (allout-layout-type :tag "<Nested layout>"))))
194
161;;;_ = allout-show-bodies 195;;;_ = allout-show-bodies
162(defcustom allout-show-bodies nil 196(defcustom allout-show-bodies nil
163 "*If non-nil, show entire body when exposing a topic, rather than 197 "*If non-nil, show entire body when exposing a topic, rather than
@@ -590,7 +624,7 @@ For details, see `allout-toggle-current-subtree-encryption's docstring."
590;;;_ #1 Internal Outline Formatting and Configuration 624;;;_ #1 Internal Outline Formatting and Configuration
591;;;_ : Version 625;;;_ : Version
592;;;_ = allout-version 626;;;_ = allout-version
593(defvar allout-version "2.2" 627(defvar allout-version "2.2.1"
594 "Version of currently loaded outline package. \(allout.el)") 628 "Version of currently loaded outline package. \(allout.el)")
595;;;_ > allout-version 629;;;_ > allout-version
596(defun allout-version (&optional here) 630(defun allout-version (&optional here)
@@ -604,6 +638,36 @@ For details, see `allout-toggle-current-subtree-encryption's docstring."
604;;;_ = allout-mode 638;;;_ = allout-mode
605(defvar allout-mode nil "Allout outline mode minor-mode flag.") 639(defvar allout-mode nil "Allout outline mode minor-mode flag.")
606(make-variable-buffer-local 'allout-mode) 640(make-variable-buffer-local 'allout-mode)
641;;;_ = allout-layout nil
642(defvar allout-layout nil ; LEAVE GLOBAL VALUE NIL - see docstring.
643 "Buffer-specific setting for allout layout.
644
645In buffers where this is non-nil \(and if `allout-init' has been run, to
646enable this behavior), `allout-mode' will be automatically activated. The
647layout dictated by the value will be used to set the initial exposure when
648`allout-mode' is activated.
649
650\*You should not setq-default this variable non-nil unless you want every
651visited file to be treated as an allout file.*
652
653The value would typically be set by a file local variable. For
654example, the following lines at the bottom of an Emacs Lisp file:
655
656;;;Local variables:
657;;;allout-layout: \(0 : -1 -1 0)
658;;;End:
659
660dictate activation of `allout-mode' mode when the file is visited
661\(presuming allout-init was already run), followed by the
662equivalent of `\(allout-expose-topic 0 : -1 -1 0)'. \(This is
663the layout used for the allout.el source file.)
664
665`allout-default-layout' describes the specification format.
666`allout-layout' can additionally have the value `t', in which
667case the value of `allout-default-layout' is used.")
668(make-variable-buffer-local 'allout-layout)
669(put 'allout-layout 'safe-local-variable t)
670
607;;;_ : Topic header format 671;;;_ : Topic header format
608;;;_ = allout-regexp 672;;;_ = allout-regexp
609(defvar allout-regexp "" 673(defvar allout-regexp ""
@@ -973,11 +1037,6 @@ wrapped within allout's automatic fill-prefix setting.")
973 "Horrible hack used to prevent invalid multiple triggering of outline 1037 "Horrible hack used to prevent invalid multiple triggering of outline
974mode from prop-line file-var activation. Used by `allout-mode' function 1038mode from prop-line file-var activation. Used by `allout-mode' function
975to track repeats.") 1039to track repeats.")
976;;;_ = allout-file-passphrase-verifier-string
977(defvar allout-file-passphrase-verifier-string nil
978 "Name for use as a file variable for verifying encryption passphrase
979across sessions.")
980(make-variable-buffer-local 'allout-file-passphrase-verifier-string)
981;;;_ = allout-passphrase-verifier-string 1040;;;_ = allout-passphrase-verifier-string
982(defvar allout-passphrase-verifier-string nil 1041(defvar allout-passphrase-verifier-string nil
983 "Setting used to test solicited encryption passphrases against the one 1042 "Setting used to test solicited encryption passphrases against the one
@@ -993,6 +1052,7 @@ The verifier string is retained as an Emacs file variable, as well as in
993the emacs buffer state, if file variable adjustments are enabled. See 1052the emacs buffer state, if file variable adjustments are enabled. See
994`allout-enable-file-variable-adjustment' for details about that.") 1053`allout-enable-file-variable-adjustment' for details about that.")
995(make-variable-buffer-local 'allout-passphrase-verifier-string) 1054(make-variable-buffer-local 'allout-passphrase-verifier-string)
1055(put 'allout-passphrase-verifier-string 'safe-local-variable t)
996;;;_ = allout-passphrase-hint-string 1056;;;_ = allout-passphrase-hint-string
997(defvar allout-passphrase-hint-string "" 1057(defvar allout-passphrase-hint-string ""
998 "Variable used to retain reminder string for file's encryption passphrase. 1058 "Variable used to retain reminder string for file's encryption passphrase.
@@ -1004,6 +1064,7 @@ The hint is retained as an Emacs file variable, as well as in the emacs buffer
1004state, if file variable adjustments are enabled. See 1064state, if file variable adjustments are enabled. See
1005`allout-enable-file-variable-adjustment' for details about that.") 1065`allout-enable-file-variable-adjustment' for details about that.")
1006(make-variable-buffer-local 'allout-passphrase-hint-string) 1066(make-variable-buffer-local 'allout-passphrase-hint-string)
1067(put 'allout-passphrase-hint-string 'safe-local-variable t)
1007(setq-default allout-passphrase-hint-string "") 1068(setq-default allout-passphrase-hint-string "")
1008;;;_ = allout-after-save-decrypt 1069;;;_ = allout-after-save-decrypt
1009(defvar allout-after-save-decrypt nil 1070(defvar allout-after-save-decrypt nil
@@ -1578,30 +1639,33 @@ OPEN: A topic that is not closed, though its offspring or body may be."
1578 (allout-infer-body-reindent)) 1639 (allout-infer-body-reindent))
1579 ) ; cond 1640 ) ; cond
1580 1641
1581 (if (and do-layout 1642 (let ((use-layout (if (listp allout-layout)
1582 allout-auto-activation 1643 allout-layout
1583 (listp allout-layout) 1644 allout-default-layout)))
1584 (and (not (eq allout-auto-activation 'activate)) 1645 (if (and do-layout
1585 (if (eq allout-auto-activation 'ask) 1646 allout-auto-activation
1586 (if (y-or-n-p (format "Expose %s with layout '%s'? " 1647 use-layout
1587 (buffer-name) 1648 (and (not (eq allout-auto-activation 'activate))
1588 allout-layout)) 1649 (if (eq allout-auto-activation 'ask)
1589 t 1650 (if (y-or-n-p (format "Expose %s with layout '%s'? "
1590 (message "Skipped %s layout." (buffer-name)) 1651 (buffer-name)
1591 nil) 1652 use-layout))
1592 t))) 1653 t
1593 (save-excursion 1654 (message "Skipped %s layout." (buffer-name))
1594 (message "Adjusting '%s' exposure..." (buffer-name)) 1655 nil)
1595 (goto-char 0) 1656 t)))
1596 (allout-this-or-next-heading) 1657 (save-excursion
1597 (condition-case err 1658 (message "Adjusting '%s' exposure..." (buffer-name))
1598 (progn 1659 (goto-char 0)
1599 (apply 'allout-expose-topic (list allout-layout)) 1660 (allout-this-or-next-heading)
1600 (message "Adjusting '%s' exposure... done." (buffer-name))) 1661 (condition-case err
1601 ;; Problem applying exposure - notify user, but don't 1662 (progn
1602 ;; interrupt, eg, file visit: 1663 (apply 'allout-expose-topic (list use-layout))
1603 (error (message "%s" (car (cdr err))) 1664 (message "Adjusting '%s' exposure... done." (buffer-name)))
1604 (sit-for 1))))) 1665 ;; Problem applying exposure - notify user, but don't
1666 ;; interrupt, eg, file visit:
1667 (error (message "%s" (car (cdr err)))
1668 (sit-for 1))))))
1605 allout-mode 1669 allout-mode
1606 ) ; let* 1670 ) ; let*
1607 ) ; defun 1671 ) ; defun
@@ -1660,7 +1724,7 @@ internal functions use this feature cohesively bunch changes."
1660 (if (not 1724 (if (not
1661 (yes-or-no-p 1725 (yes-or-no-p
1662 (substitute-command-keys 1726 (substitute-command-keys
1663 (concat "Modify this concealed text? (\"no\" aborts," 1727 (concat "Modify concealed text? (\"no\" just aborts,"
1664 " \\[keyboard-quit] also reconceals) ")))) 1728 " \\[keyboard-quit] also reconceals) "))))
1665 (progn (goto-char start) 1729 (progn (goto-char start)
1666 (error "Concealed-text change refused."))) 1730 (error "Concealed-text change refused.")))
@@ -1676,7 +1740,7 @@ See allout-overlay-interior-modification-handler for details.
1676 1740
1677This before-change handler is used only where modification-hooks 1741This before-change handler is used only where modification-hooks
1678overlay property is not supported." 1742overlay property is not supported."
1679 (if (not allout-mode) 1743 (if (not (allout-mode-p))
1680 nil 1744 nil
1681 (allout-overlay-interior-modification-handler nil nil beg end nil))) 1745 (allout-overlay-interior-modification-handler nil nil beg end nil)))
1682;;;_ > allout-isearch-end-handler (&optional overlay) 1746;;;_ > allout-isearch-end-handler (&optional overlay)
@@ -2561,7 +2625,6 @@ command/keystrokes to relocate the cursor off of a bullet character to
2561return to regular interpretation of self-insert characters." 2625return to regular interpretation of self-insert characters."
2562 2626
2563 (if (not (allout-mode-p)) 2627 (if (not (allout-mode-p))
2564 ;; Shouldn't be invoked if not in allout-mode, but just in case:
2565 nil 2628 nil
2566 ;; Hot-spot navigation provisions: 2629 ;; Hot-spot navigation provisions:
2567 (if (and (eq this-command 'self-insert-command) 2630 (if (and (eq this-command 'self-insert-command)
@@ -2595,7 +2658,7 @@ return to regular interpretation of self-insert characters."
2595 this-command mapped-binding))))))) 2658 this-command mapped-binding)))))))
2596;;;_ > allout-find-file-hook () 2659;;;_ > allout-find-file-hook ()
2597(defun allout-find-file-hook () 2660(defun allout-find-file-hook ()
2598 "Activate `allout-mode' when `allout-auto-activation', `allout-layout' non-nil. 2661 "Activate `allout-mode' on non-nil `allout-auto-activation', `allout-layout'.
2599 2662
2600See `allout-init' for setup instructions." 2663See `allout-init' for setup instructions."
2601 (if (and allout-auto-activation 2664 (if (and allout-auto-activation
@@ -3415,7 +3478,7 @@ depth, however."
3415 (if (or (not (allout-mode-p)) 3478 (if (or (not (allout-mode-p))
3416 (not (bolp)) 3479 (not (bolp))
3417 (not (looking-at allout-regexp))) 3480 (not (looking-at allout-regexp)))
3418 ;; Above conditions do not obtain - just do a regular kill: 3481 ;; Just do a regular kill:
3419 (kill-line arg) 3482 (kill-line arg)
3420 ;; Ah, have to watch out for adjustments: 3483 ;; Ah, have to watch out for adjustments:
3421 (let* ((beg (point)) 3484 (let* ((beg (point))
@@ -3889,7 +3952,7 @@ If optional INCLUDE-SINGLE-LINERS is true, then include single-line
3889topics \(which intrinsically can be considered both collapsed and 3952topics \(which intrinsically can be considered both collapsed and
3890not\), as collapsed. Otherwise they are considered uncollapsed." 3953not\), as collapsed. Otherwise they are considered uncollapsed."
3891 (save-excursion 3954 (save-excursion
3892 (and 3955 (and
3893 (= (progn (allout-back-to-current-heading) 3956 (= (progn (allout-back-to-current-heading)
3894 (move-end-of-line 1) 3957 (move-end-of-line 1)
3895 (point)) 3958 (point))
@@ -5068,7 +5131,7 @@ Returns the resulting string, or nil if the transformation fails."
5068 ) 5131 )
5069;;;_ > allout-obtain-passphrase (for-key cache-id prompt-id key-type 5132;;;_ > allout-obtain-passphrase (for-key cache-id prompt-id key-type
5070;;; allout-buffer retried fetch-pass) 5133;;; allout-buffer retried fetch-pass)
5071(defun allout-obtain-passphrase (for-key cache-id prompt-id key-type 5134(defun allout-obtain-passphrase (for-key cache-id prompt-id key-type
5072 allout-buffer retried fetch-pass) 5135 allout-buffer retried fetch-pass)
5073 "Obtain passphrase for a key from the cache or else from the user. 5136 "Obtain passphrase for a key from the cache or else from the user.
5074 5137
@@ -5242,7 +5305,7 @@ An error is raised if the text is not encrypted."
5242 nil nil 0 passphrase)) 5305 nil nil 0 passphrase))
5243 ) 5306 )
5244;;;_ > allout-update-passphrase-mnemonic-aids (for-key passphrase 5307;;;_ > allout-update-passphrase-mnemonic-aids (for-key passphrase
5245;;; outline-buffer) 5308;;; outline-buffer)
5246(defun allout-update-passphrase-mnemonic-aids (for-key passphrase 5309(defun allout-update-passphrase-mnemonic-aids (for-key passphrase
5247 outline-buffer) 5310 outline-buffer)
5248 "Update passphrase verifier and hint strings if necessary. 5311 "Update passphrase verifier and hint strings if necessary.
@@ -5298,7 +5361,7 @@ are preserved on Emacs local file variables,
5298(defun allout-get-encryption-passphrase-verifier () 5361(defun allout-get-encryption-passphrase-verifier ()
5299 "Return text of the encrypt passphrase verifier, unmassaged, or nil if none. 5362 "Return text of the encrypt passphrase verifier, unmassaged, or nil if none.
5300 5363
5301Derived from value of `allout-file-passphrase-verifier-string'." 5364Derived from value of `allout-passphrase-verifier-string'."
5302 5365
5303 (let ((verifier-string (and (boundp 'allout-passphrase-verifier-string) 5366 (let ((verifier-string (and (boundp 'allout-passphrase-verifier-string)
5304 allout-passphrase-verifier-string))) 5367 allout-passphrase-verifier-string)))
@@ -5457,7 +5520,7 @@ setup for auto-startup."
5457 (insert (concat "Dummy outline topic header - see" 5520 (insert (concat "Dummy outline topic header - see"
5458 "`allout-mode' docstring: `^Hm'.")) 5521 "`allout-mode' docstring: `^Hm'."))
5459 (allout-adjust-file-variable 5522 (allout-adjust-file-variable
5460 "allout-layout" (format "%s" (or allout-layout '(-1 : 0))))))) 5523 "allout-layout" (or allout-layout '(-1 : 0))))))
5461;;;_ > allout-file-vars-section-data () 5524;;;_ > allout-file-vars-section-data ()
5462(defun allout-file-vars-section-data () 5525(defun allout-file-vars-section-data ()
5463 "Return data identifying the file-vars section, or nil if none. 5526 "Return data identifying the file-vars section, or nil if none.
@@ -5708,13 +5771,7 @@ which are part of the text that an image rests on.)
5708 5771
5709With argument ARG not nil or 1, move forward ARG - 1 lines first. 5772With argument ARG not nil or 1, move forward ARG - 1 lines first.
5710If point reaches the beginning or end of buffer, it stops there. 5773If point reaches the beginning or end of buffer, it stops there.
5711To ignore intangibility, bind `inhibit-point-motion-hooks' to t. 5774To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
5712
5713This function does not move point across a field boundary unless that
5714would move point to a different line than the original, unconstrained
5715result. If N is nil or 1, and a front-sticky field starts at point,
5716the point does not move. To ignore field boundaries bind
5717`inhibit-field-text-motion' to t."
5718 (interactive "p") 5775 (interactive "p")
5719 (or arg (setq arg 1)) 5776 (or arg (setq arg 1))
5720 (if (/= arg 1) 5777 (if (/= arg 1)
@@ -5730,7 +5787,7 @@ the point does not move. To ignore field boundaries bind
5730 (skip-chars-backward "^\n")) 5787 (skip-chars-backward "^\n"))
5731 (vertical-motion 0) 5788 (vertical-motion 0)
5732 (if (/= orig (point)) 5789 (if (/= orig (point))
5733 (goto-char (constrain-to-field (point) orig (/= arg 1) t nil))))) 5790 (goto-char orig))))
5734) 5791)
5735;;;_ > move-end-of-line if necessary - older emacs, xemacs 5792;;;_ > move-end-of-line if necessary - older emacs, xemacs
5736(if (not (fboundp 'move-end-of-line)) 5793(if (not (fboundp 'move-end-of-line))
@@ -5741,13 +5798,7 @@ which are part of the text that an image rests on.)
5741 5798
5742With argument ARG not nil or 1, move forward ARG - 1 lines first. 5799With argument ARG not nil or 1, move forward ARG - 1 lines first.
5743If point reaches the beginning or end of buffer, it stops there. 5800If point reaches the beginning or end of buffer, it stops there.
5744To ignore intangibility, bind `inhibit-point-motion-hooks' to t. 5801To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
5745
5746This function does not move point across a field boundary unless that
5747would move point to a different line than the original, unconstrained
5748result. If N is nil or 1, and a rear-sticky field ends at point,
5749the point does not move. To ignore field boundaries bind
5750`inhibit-field-text-motion' to t."
5751 (interactive "p") 5802 (interactive "p")
5752 (or arg (setq arg 1)) 5803 (or arg (setq arg 1))
5753 (let ((orig (point)) 5804 (let ((orig (point))
@@ -5777,8 +5828,7 @@ the point does not move. To ignore field boundaries bind
5777 (setq arg 1) 5828 (setq arg 1)
5778 (setq done t))))) 5829 (setq done t)))))
5779 (if (/= orig (point)) 5830 (if (/= orig (point))
5780 (goto-char (constrain-to-field (point) orig (/= arg 1) t 5831 (goto-char orig))))
5781 nil)))))
5782 ) 5832 )
5783;;;_ > line-move-invisible-p if necessary 5833;;;_ > line-move-invisible-p if necessary
5784(if (not (fboundp 'line-move-invisible-p)) 5834(if (not (fboundp 'line-move-invisible-p))
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 5b4686754f0..f15dc3f7a4c 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -52,7 +52,7 @@
52 (ctl-arrow display boolean) 52 (ctl-arrow display boolean)
53 (truncate-lines display boolean) 53 (truncate-lines display boolean)
54 (selective-display-ellipses display boolean) 54 (selective-display-ellipses display boolean)
55 (indicate-empty-lines fringe boolean "21.1") 55 (indicate-empty-lines fringe boolean)
56 (indicate-buffer-boundaries 56 (indicate-buffer-boundaries
57 fringe 57 fringe
58 (choice 58 (choice
@@ -91,8 +91,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
91 (const :tag "Do not show" (down . nil)) 91 (const :tag "Do not show" (down . nil))
92 (const :tag "On the left" (down . left)) 92 (const :tag "On the left" (down . left))
93 (const :tag "On the right" (down . right)))) 93 (const :tag "On the right" (down . right))))
94 (other :tag "On left, no arrows" t)) 94 (other :tag "On left, no arrows" t)))
95 "22.1")
96 (scroll-up-aggressively windows 95 (scroll-up-aggressively windows
97 (choice (const :tag "off" nil) number) 96 (choice (const :tag "off" nil) number)
98 "21.1") 97 "21.1")
@@ -174,7 +173,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
174 (const :tag "always shown" t) 173 (const :tag "always shown" t)
175 (other :tag "hidden by keypress" 1))) 174 (other :tag "hidden by keypress" 1)))
176 ;; fringe.c 175 ;; fringe.c
177 (overflow-newline-into-fringe fringe boolean "22.1") 176 (overflow-newline-into-fringe fringe boolean)
178 ;; indent.c 177 ;; indent.c
179 (indent-tabs-mode fill boolean) 178 (indent-tabs-mode fill boolean)
180 ;; keyboard.c 179 ;; keyboard.c
diff --git a/lisp/font-core.el b/lisp/font-core.el
index 85bbf60f0d9..d2cb8dccd10 100644
--- a/lisp/font-core.el
+++ b/lisp/font-core.el
@@ -83,6 +83,34 @@ where MAJOR-MODE is a symbol and FONT-LOCK-DEFAULTS is a list of default
83settings. See the variable `font-lock-defaults', which takes precedence.") 83settings. See the variable `font-lock-defaults', which takes precedence.")
84(make-obsolete-variable 'font-lock-defaults-alist 'font-lock-defaults) 84(make-obsolete-variable 'font-lock-defaults-alist 'font-lock-defaults)
85 85
86(defvar font-lock-extend-region-function nil
87 "A function that determines the region to fontify after a change.
88
89This buffer-local variable is either nil, or is a function that determines the
90region to fontify. It is usually set by the major mode. The currently active
91font-lock after-change function calls this function after each buffer change.
92
93The function is given three parameters, the standard BEG, END, and OLD-LEN
94from after-change-functions. It should return either a cons of the beginning
95and end buffer positions \(in that order) of the region to fontify, or nil
96\(which directs the caller to fontify a default region). This function need
97not preserve point or the match-data, but must preserve the current
98restriction. The region it returns may start or end in the middle of a
99line.")
100(make-variable-buffer-local 'font-lock-extend-region-function)
101
102(defun font-lock-extend-region (beg end old-len)
103 "Determine the region to fontify after a buffer change.
104
105BEG END and OLD-LEN are the standard parameters from after-change-functions.
106The return value is either nil \(which directs the caller to chose the region
107itself), or a cons of the beginning and end \(in that order) of the region.
108The region returned may start or end in the middle of a line."
109 (if font-lock-extend-region-function
110 (save-match-data
111 (save-excursion
112 (funcall font-lock-extend-region-function beg end old-len)))))
113
86(defvar font-lock-function 'font-lock-default-function 114(defvar font-lock-function 'font-lock-default-function
87 "A function which is called when `font-lock-mode' is toggled. 115 "A function which is called when `font-lock-mode' is toggled.
88It will be passed one argument, which is the current value of 116It will be passed one argument, which is the current value of
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index a2dd58d5c92..1b4e79a0c87 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1039,7 +1039,7 @@ a very meaningful entity to highlight.")
1039 (when font-lock-syntax-table 1039 (when font-lock-syntax-table
1040 (set-syntax-table font-lock-syntax-table)) 1040 (set-syntax-table font-lock-syntax-table))
1041 (goto-char beg) 1041 (goto-char beg)
1042 (setq beg (line-beginning-position (- 1 font-lock-lines-before))) 1042 (setq beg (line-beginning-position))
1043 ;; check to see if we should expand the beg/end area for 1043 ;; check to see if we should expand the beg/end area for
1044 ;; proper multiline matches 1044 ;; proper multiline matches
1045 (when (and (> beg (point-min)) 1045 (when (and (> beg (point-min))
@@ -1090,13 +1090,18 @@ what properties to clear before refontifying a region.")
1090;; Called when any modification is made to buffer text. 1090;; Called when any modification is made to buffer text.
1091(defun font-lock-after-change-function (beg end old-len) 1091(defun font-lock-after-change-function (beg end old-len)
1092 (let ((inhibit-point-motion-hooks t) 1092 (let ((inhibit-point-motion-hooks t)
1093 (inhibit-quit t)) 1093 (inhibit-quit t)
1094 (region (font-lock-extend-region beg end old-len)))
1094 (save-excursion 1095 (save-excursion
1095 (save-match-data 1096 (save-match-data
1096 ;; Rescan between start of lines enclosing the region. 1097 (if region
1097 (font-lock-fontify-region 1098 ;; Fontify the region the major mode has specified.
1098 (progn (goto-char beg) (forward-line 0) (point)) 1099 (setq beg (car region) end (cdr region))
1099 (progn (goto-char end) (forward-line 1) (point))))))) 1100 ;; Fontify the whole lines which enclose the region.
1101 (setq beg (progn (goto-char beg)
1102 (forward-line (- font-lock-lines-before)))
1103 end (progn (goto-char end) (forward-line 1) (point))))
1104 (font-lock-fontify-region beg end)))))
1100 1105
1101(defun font-lock-fontify-block (&optional arg) 1106(defun font-lock-fontify-block (&optional arg)
1102 "Fontify some lines the way `font-lock-fontify-buffer' would. 1107 "Fontify some lines the way `font-lock-fontify-buffer' would.
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index e5820d066e2..183da83816d 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -74,6 +74,7 @@ If a regexp, then it will be matched against the buffer's name.
74If a function, it will be called with the buffer as an argument, and 74If a function, it will be called with the buffer as an argument, and
75should return non-nil if this buffer should not be shown." 75should return non-nil if this buffer should not be shown."
76 :type '(repeat (choice regexp function)) 76 :type '(repeat (choice regexp function))
77 :require 'ibuf-ext
77 :group 'ibuffer) 78 :group 'ibuffer)
78 79
79(defcustom ibuffer-always-show-predicates nil 80(defcustom ibuffer-always-show-predicates nil
diff --git a/lisp/image.el b/lisp/image.el
index 2d7aea6fa0c..6938dba05cb 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -77,30 +77,34 @@ value is used as a list of directories to search.")
77 (list (file-name-as-directory (expand-file-name "images" data-directory)) 77 (list (file-name-as-directory (expand-file-name "images" data-directory))
78 'data-directory 'load-path))) 78 'data-directory 'load-path)))
79 79
80
80(defun image-load-path-for-library (library image &optional path no-error) 81(defun image-load-path-for-library (library image &optional path no-error)
81 "Return a suitable search path for images relative to LIBRARY. 82 "Return a suitable search path for images relative to LIBRARY.
82 83
83Images for LIBRARY are searched for in \"../../etc/images\" and 84First it searches for IMAGE in a path suitable for LIBRARY, which
84\"../etc/images\" relative to the files in \"lisp/LIBRARY\" as 85includes \"../../etc/images\" and \"../etc/images\" relative to
85well as in `image-load-path' and `load-path'. 86the library file itself, followed by `image-load-path' and
87`load-path'.
86 88
87This function returns the value of `load-path' augmented with the 89Then this function returns a list of directories which contains
88directory containing IMAGE. If PATH is given, it is used instead 90first the directory in which IMAGE was found, followed by the
89of `load-path'. If PATH is t, just return the directory that 91value of `load-path'. If PATH is given, it is used instead of
90contains IMAGE. 92`load-path'.
91 93
92If NO-ERROR is non-nil, return nil if a suitable path can't be 94If NO-ERROR is non-nil and a suitable path can't be found, don't
93found rather than signaling an error. 95signal an error. Instead, return a list of directories as before,
96except that nil appears in place of the image directory.
94 97
95Here is an example that uses a common idiom to provide 98Here is an example that uses a common idiom to provide
96compatibility with versions of Emacs that lack the variable 99compatibility with versions of Emacs that lack the variable
97`image-load-path': 100`image-load-path':
98 101
99 (let ((load-path 102 ;; Avoid errors on Emacsen without `image-load-path'.
100 (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\")) 103 (if (not (boundp 'image-load-path)) (defvar image-load-path nil))
101 (image-load-path 104
102 (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\" 'image-load-path))) 105 (let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
103 (mh-tool-bar-folder-buttons-init))" 106 (image-load-path (cons (car load-path) image-load-path)))
107 (mh-tool-bar-folder-buttons-init))"
104 (unless library (error "No library specified")) 108 (unless library (error "No library specified"))
105 (unless image (error "No image specified")) 109 (unless image (error "No image specified"))
106 (let ((image-directory)) 110 (let ((image-directory))
@@ -142,26 +146,14 @@ compatibility with versions of Emacs that lack the variable
142 dir (expand-file-name "../" dir))) 146 dir (expand-file-name "../" dir)))
143 (setq image-directory dir))))) 147 (setq image-directory dir)))))
144 (no-error 148 (no-error
145 ;; In this case we will return nil.
146 (message "Could not find image %s for library %s" image library)) 149 (message "Could not find image %s for library %s" image library))
147 (t 150 (t
148 (error "Could not find image %s for library %s" image library))) 151 (error "Could not find image %s for library %s" image library)))
149 152
150 ;; Return the directory, nil if no-error was non-nil and a 153 ;; Return an augmented `path' or `load-path'.
151 ;; suitable path could not be found, or an augmented 154 (nconc (list image-directory)
152 ;; `image-load-path' or `load-path'. 155 (delete image-directory (copy-sequence (or path load-path))))))
153 (cond ((or (null image-directory) 156
154 (eq path t))
155 image-directory)
156 ((and path (symbolp path))
157 (nconc (list image-directory)
158 (delete image-directory
159 (if (boundp path)
160 (copy-sequence (symbol-value path))
161 nil))))
162 (t
163 (nconc (list image-directory)
164 (delete image-directory (copy-sequence load-path)))))))
165 157
166(defun image-jpeg-p (data) 158(defun image-jpeg-p (data)
167 "Value is non-nil if DATA, a string, consists of JFIF image data. 159 "Value is non-nil if DATA, a string, consists of JFIF image data.
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 09870310584..f82ead462f0 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -557,36 +557,44 @@ This function ensures that lines following the change will be refontified
557in case the syntax of those lines has changed. Refontification 557in case the syntax of those lines has changed. Refontification
558will take place when text is fontified stealthily." 558will take place when text is fontified stealthily."
559 (when (and jit-lock-mode (not memory-full)) 559 (when (and jit-lock-mode (not memory-full))
560 (save-excursion 560 (let ((region (font-lock-extend-region start end old-len)))
561 (with-buffer-prepared-for-jit-lock 561 (save-excursion
562 ;; It's important that the `fontified' property be set from the 562 (with-buffer-prepared-for-jit-lock
563 ;; beginning of the line, else font-lock will properly change the 563 ;; It's important that the `fontified' property be set from the
564 ;; text's face, but the display will have been done already and will 564 ;; beginning of the line, else font-lock will properly change the
565 ;; be inconsistent with the buffer's content. 565 ;; text's face, but the display will have been done already and will
566 (goto-char start) 566 ;; be inconsistent with the buffer's content.
567 (setq start (line-beginning-position)) 567 ;;
568 568 ;; FIXME!!! (Alan Mackenzie, 2006-03-14): If start isn't at a BOL,
569 ;; If we're in text that matches a multi-line font-lock pattern, 569 ;; expanding the region to BOL might mis-fontify, should the BOL not
570 ;; make sure the whole text will be redisplayed. 570 ;; be at a "safe" position.
571 ;; I'm not sure this is ever necessary and/or sufficient. -stef 571 (setq start (if region
572 (when (get-text-property start 'font-lock-multiline) 572 (car region)
573 (setq start (or (previous-single-property-change 573 (goto-char start)
574 start 'font-lock-multiline) 574 (line-beginning-position (- 1 font-lock-lines-before))))
575 (point-min)))) 575
576 576 ;; If we're in text that matches a multi-line font-lock pattern,
577 ;; Make sure we change at least one char (in case of deletions). 577 ;; make sure the whole text will be redisplayed.
578 (setq end (min (max end (1+ start)) (point-max))) 578 ;; I'm not sure this is ever necessary and/or sufficient. -stef
579 ;; Request refontification. 579 (when (get-text-property start 'font-lock-multiline)
580 (put-text-property start end 'fontified nil)) 580 (setq start (or (previous-single-property-change
581 ;; Mark the change for deferred contextual refontification. 581 start 'font-lock-multiline)
582 (when jit-lock-context-unfontify-pos 582 (point-min))))
583 (setq jit-lock-context-unfontify-pos 583
584 ;; Here we use `start' because nothing guarantees that the 584 (if region (setq end (cdr region)))
585 ;; text between start and end will be otherwise refontified: 585 ;; Make sure we change at least one char (in case of deletions).
586 ;; usually it will be refontified by virtue of being 586 (setq end (min (max end (1+ start)) (point-max)))
587 ;; displayed, but if it's outside of any displayed area in the 587 ;; Request refontification.
588 ;; buffer, only jit-lock-context-* will re-fontify it. 588 (put-text-property start end 'fontified nil))
589 (min jit-lock-context-unfontify-pos start)))))) 589 ;; Mark the change for deferred contextual refontification.
590 (when jit-lock-context-unfontify-pos
591 (setq jit-lock-context-unfontify-pos
592 ;; Here we use `start' because nothing guarantees that the
593 ;; text between start and end will be otherwise refontified:
594 ;; usually it will be refontified by virtue of being
595 ;; displayed, but if it's outside of any displayed area in the
596 ;; buffer, only jit-lock-context-* will re-fontify it.
597 (min jit-lock-context-unfontify-pos start)))))))
590 598
591(provide 'jit-lock) 599(provide 'jit-lock)
592 600
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index ffb73d5425d..ecdf207d252 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,26 @@
12006-03-14 Bill Wohler <wohler@newt.com>
2
3 * mh-compat.el (mh-image-load-path-for-library): Incorporate
4 changes from image-load-path-for-library, which are:
5 (image-load-path-for-library): Pass value of path rather than
6 symbol. Always return list of directories. Guarantee that image
7 directory comes first.
8
9 * mh-e.el (image-load-path): Define on those Emacsen that lack it
10 to avoid compile and run-time errors.
11
12 * mh-folder.el (mh-folder-mode): Use new idiom for setting
13 image-load-path.
14
15 * mh-letter.el (mh-letter-mode): Ditto.
16
17 * mh-utils.el (mh-logo-display): Ditto.
18
192006-03-12 Bill Wohler <wohler@newt.com>
20
21 * mh-utils.el (mh-folder-list): Fix docstring (closes SF
22 #1448498).
23
12006-03-10 Bill Wohler <wohler@newt.com> 242006-03-10 Bill Wohler <wohler@newt.com>
2 25
3 * mh-compat.el (mh-replace-regexp-in-string): Pass the literal 26 * mh-compat.el (mh-replace-regexp-in-string): Pass the literal
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index d6bded8726e..50542d67f4e 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -119,30 +119,30 @@ introduced in Emacs 22."
119 image-load-path-for-library (library image &optional path no-error) 119 image-load-path-for-library (library image &optional path no-error)
120 "Return a suitable search path for images relative to LIBRARY. 120 "Return a suitable search path for images relative to LIBRARY.
121 121
122Images for LIBRARY are searched for in \"../../etc/images\" and 122First it searches for IMAGE in a path suitable for LIBRARY, which
123\"../etc/images\" relative to the files in \"lisp/LIBRARY\" as 123includes \"../../etc/images\" and \"../etc/images\" relative to
124well as in `image-load-path' and `load-path'. 124the library file itself, followed by `image-load-path' and
125`load-path'.
125 126
126This function returns the value of `load-path' augmented with the 127Then this function returns a list of directories which contains
127directory containing IMAGE. If PATH is given, it is used instead 128first the directory in which IMAGE was found, followed by the
128of `load-path'. If PATH is t, just return the directory that 129value of `load-path'. If PATH is given, it is used instead of
129contains IMAGE. 130`load-path'.
130 131
131If NO-ERROR is non-nil, return nil if a suitable path can't be 132If NO-ERROR is non-nil and a suitable path can't be found, don't
132found rather than signaling an error. 133signal an error. Instead, return a list of directories as before,
134except that nil appears in place of the image directory.
133 135
134Here is an example that uses a common idiom to provide 136Here is an example that uses a common idiom to provide
135compatibility with versions of Emacs that lack the variable 137compatibility with versions of Emacs that lack the variable
136`image-load-path': 138`image-load-path':
137 139
138 (let ((load-path 140 ;; Avoid errors on Emacsen without `image-load-path'.
139 (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\")) 141 (if (not (boundp 'image-load-path)) (defvar image-load-path nil))
140 (image-load-path
141 (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\" 'image-load-path)))
142 (mh-tool-bar-folder-buttons-init))
143 142
144This function is used by Emacs versions that don't have 143 (let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
145`image-load-path-for-library'." 144 (image-load-path (cons (car load-path) image-load-path)))
145 (mh-tool-bar-folder-buttons-init))"
146 (unless library (error "No library specified")) 146 (unless library (error "No library specified"))
147 (unless image (error "No image specified")) 147 (unless image (error "No image specified"))
148 (let ((image-directory)) 148 (let ((image-directory))
@@ -184,26 +184,13 @@ This function is used by Emacs versions that don't have
184 dir (expand-file-name "../" dir))) 184 dir (expand-file-name "../" dir)))
185 (setq image-directory dir))))) 185 (setq image-directory dir)))))
186 (no-error 186 (no-error
187 ;; In this case we will return nil.
188 (message "Could not find image %s for library %s" image library)) 187 (message "Could not find image %s for library %s" image library))
189 (t 188 (t
190 (error "Could not find image %s for library %s" image library))) 189 (error "Could not find image %s for library %s" image library)))
191 190
192 ;; Return the directory, nil if no-error was non-nil and a 191 ;; Return an augmented `path' or `load-path'.
193 ;; suitable path could not be found, or an augmented 192 (nconc (list image-directory)
194 ;; `image-load-path' or `load-path'. 193 (delete image-directory (copy-sequence (or path load-path))))))
195 (cond ((or (null image-directory)
196 (eq path t))
197 image-directory)
198 ((and path (symbolp path))
199 (nconc (list image-directory)
200 (delete image-directory
201 (if (boundp path)
202 (copy-sequence (symbol-value path))
203 nil))))
204 (t
205 (nconc (list image-directory)
206 (delete image-directory (copy-sequence load-path)))))))
207 194
208(mh-defun-compat mh-image-search-load-path 195(mh-defun-compat mh-image-search-load-path
209 image-search-load-path (file &optional path) 196 image-search-load-path (file &optional path)
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 0b8961470a7..2f29a678f13 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -325,6 +325,9 @@ Name of the Previous sequence.")
325 325
326;; Etc. (alphabetical) 326;; Etc. (alphabetical)
327 327
328;; Avoid errors on Emacsen without image-load-path.
329(if (not (boundp 'image-load-path)) (defvar image-load-path nil))
330
328(defvar mh-flists-present-flag nil 331(defvar mh-flists-present-flag nil
329 "Non-nil means that we have \"flists\".") 332 "Non-nil means that we have \"flists\".")
330 333
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index f8e37a93cf8..2c32d1433f1 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -591,9 +591,8 @@ perform the operation on all messages in that region.
591\\{mh-folder-mode-map}" 591\\{mh-folder-mode-map}"
592 (mh-do-in-gnu-emacs 592 (mh-do-in-gnu-emacs
593 (unless mh-folder-buttons-init-flag 593 (unless mh-folder-buttons-init-flag
594 (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm")) 594 (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
595 (image-load-path (mh-image-load-path-for-library 595 (image-load-path (cons (car load-path) image-load-path)))
596 "mh-e" "mh-logo.xpm" 'image-load-path)))
597 (mh-tool-bar-folder-buttons-init) 596 (mh-tool-bar-folder-buttons-init)
598 (setq mh-folder-buttons-init-flag t))) 597 (setq mh-folder-buttons-init-flag t)))
599 (set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map)) 598 (set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map))
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index 9d28ee4ec95..a7290cf5ae9 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -313,9 +313,8 @@ order).
313 (make-local-variable 'mh-sent-from-msg) 313 (make-local-variable 'mh-sent-from-msg)
314 (mh-do-in-gnu-emacs 314 (mh-do-in-gnu-emacs
315 (unless mh-letter-buttons-init-flag 315 (unless mh-letter-buttons-init-flag
316 (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm")) 316 (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
317 (image-load-path (mh-image-load-path-for-library 317 (image-load-path (cons (car load-path) image-load-path)))
318 "mh-e" "mh-logo.xpm" 'image-load-path)))
319 (mh-tool-bar-letter-buttons-init) 318 (mh-tool-bar-letter-buttons-init)
320 (setq mh-letter-buttons-init-flag t))) 319 (setq mh-letter-buttons-init-flag t)))
321 (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map)) 320 (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map))
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index c45c214e9f0..44e15f3cb19 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -131,9 +131,8 @@ Ignores case when searching for OLD."
131(defun mh-logo-display () 131(defun mh-logo-display ()
132 "Modify mode line to display MH-E logo." 132 "Modify mode line to display MH-E logo."
133 (mh-do-in-gnu-emacs 133 (mh-do-in-gnu-emacs
134 (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm")) 134 (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
135 (image-load-path (mh-image-load-path-for-library 135 (image-load-path (cons (car load-path) image-load-path)))
136 "mh-e" "mh-logo.xpm" 'image-load-path)))
137 (add-text-properties 136 (add-text-properties
138 0 2 137 0 2
139 `(display ,(or mh-logo-cache 138 `(display ,(or mh-logo-cache
@@ -504,7 +503,7 @@ example, if your Mail directory only contains the folders +inbox,
504 (mh-folder-list nil) 503 (mh-folder-list nil)
505 => (\"inbox\" \"lists\" \"lists/mh-e\" \"outbox\") 504 => (\"inbox\" \"lists\" \"lists/mh-e\" \"outbox\")
506 (mh-folder-list \"+lists\") 505 (mh-folder-list \"+lists\")
507 => (\"lists/mh-e\") 506 => (\"lists\" \"lists/mh-e\")
508 507
509Respects the value of `mh-recursive-folders-flag'. If this flag 508Respects the value of `mh-recursive-folders-flag'. If this flag
510is nil, and the sub-folders have not been explicitly viewed, then 509is nil, and the sub-folders have not been explicitly viewed, then
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index f5cf1ecb7e0..19fc89f4293 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -50,6 +50,7 @@
50 "Simple IRC client." 50 "Simple IRC client."
51 :version "22.1" 51 :version "22.1"
52 :prefix "rcirc-" 52 :prefix "rcirc-"
53 :link '(custom-manual "(rcirc)")
53 :group 'applications) 54 :group 'applications)
54 55
55(defcustom rcirc-server "irc.freenode.net" 56(defcustom rcirc-server "irc.freenode.net"
@@ -195,12 +196,6 @@ Use /ignore to list them, use /ignore NICK to add or remove a nick."
195 :type '(repeat string) 196 :type '(repeat string)
196 :group 'rcirc) 197 :group 'rcirc)
197 198
198(defcustom rcirc-nick-abbrevs nil
199 "List of short replacements for printing nicks."
200 :type '(alist :key-type (string :tag "Nick")
201 :value-type (string :tag "Abbrev"))
202 :group 'rcirc)
203
204(defvar rcirc-ignore-list-automatic () 199(defvar rcirc-ignore-list-automatic ()
205 "List of ignored nicks added to `rcirc-ignore-list' because of renaming. 200 "List of ignored nicks added to `rcirc-ignore-list' because of renaming.
206When an ignored person renames, their nick is added to both lists. 201When an ignored person renames, their nick is added to both lists.
@@ -493,11 +488,6 @@ Function is called with PROCESS, COMMAND, SENDER, ARGS and LINE.")
493 (with-rcirc-process-buffer process 488 (with-rcirc-process-buffer process
494 rcirc-nick)) 489 rcirc-nick))
495 490
496(defun rcirc-abbrev-nick (nick)
497 "If NICK has an entry in `rcirc-nick-abbrevs', return its abbreviation,
498otherwise return NICK."
499 (or (cdr (assoc nick rcirc-nick-abbrevs)) nick))
500
501(defvar rcirc-max-message-length 450 491(defvar rcirc-max-message-length 450
502 "Messages longer than this value will be split.") 492 "Messages longer than this value will be split.")
503 493
@@ -883,7 +873,7 @@ Create the buffer if it doesn't exist."
883(defun rcirc-multiline-edit-submit () 873(defun rcirc-multiline-edit-submit ()
884 "Send the text in buffer back to parent buffer." 874 "Send the text in buffer back to parent buffer."
885 (interactive) 875 (interactive)
886 (assert (and (eq major-mode 'rcirc-multiline-edit-mode))) 876 (assert (eq major-mode 'rcirc-multiline-edit-mode))
887 (assert rcirc-parent-buffer) 877 (assert rcirc-parent-buffer)
888 (untabify (point-min) (point-max)) 878 (untabify (point-min) (point-max))
889 (let ((text (buffer-substring (point-min) (point-max))) 879 (let ((text (buffer-substring (point-min) (point-max)))
@@ -899,7 +889,7 @@ Create the buffer if it doesn't exist."
899(defun rcirc-multiline-edit-cancel () 889(defun rcirc-multiline-edit-cancel ()
900 "Cancel the multiline edit." 890 "Cancel the multiline edit."
901 (interactive) 891 (interactive)
902 (assert (and (eq major-mode 'rcirc-multiline-edit-mode))) 892 (assert (eq major-mode 'rcirc-multiline-edit-mode))
903 (kill-buffer (current-buffer)) 893 (kill-buffer (current-buffer))
904 (set-window-configuration rcirc-window-configuration)) 894 (set-window-configuration rcirc-window-configuration))
905 895
@@ -975,7 +965,7 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
975 process rcirc-server) 965 process rcirc-server)
976 sender) 966 sender)
977 "" 967 ""
978 (rcirc-abbrev-nick sender)) 968 sender)
979 (and target (concat "," target))))) 969 (and target (concat "," target)))))
980 (rcirc-facify nick 970 (rcirc-facify nick
981 (if (eq key ?n) 971 (if (eq key ?n)
@@ -1088,7 +1078,7 @@ record activity."
1088 (set-marker text-start 1078 (set-marker text-start
1089 (or (next-single-property-change fill-start 1079 (or (next-single-property-change fill-start
1090 'rcirc-text) 1080 'rcirc-text)
1091 (point-max))) 1081 rcirc-prompt-end-marker))
1092 ;; squeeze spaces out of text before rcirc-text 1082 ;; squeeze spaces out of text before rcirc-text
1093 (fill-region fill-start (1- text-start)) 1083 (fill-region fill-start (1- text-start))
1094 1084
@@ -1253,9 +1243,7 @@ if NICK is also on `rcirc-ignore-list-automatic'."
1253(define-key rcirc-track-minor-mode-map (kbd "C-c C-@") 'rcirc-next-active-buffer) 1243(define-key rcirc-track-minor-mode-map (kbd "C-c C-@") 'rcirc-next-active-buffer)
1254(define-key rcirc-track-minor-mode-map (kbd "C-c C-SPC") 'rcirc-next-active-buffer) 1244(define-key rcirc-track-minor-mode-map (kbd "C-c C-SPC") 'rcirc-next-active-buffer)
1255 1245
1256;;; FIXME: the code to insert `rcirc-activity-string' into 1246;;;###autoload
1257;;; `global-mode-string' isn't called when the mode is activated by
1258;;; customize. I don't know how to set that up.
1259(define-minor-mode rcirc-track-minor-mode 1247(define-minor-mode rcirc-track-minor-mode
1260 "Global minor mode for tracking activity in rcirc buffers." 1248 "Global minor mode for tracking activity in rcirc buffers."
1261 :init-value nil 1249 :init-value nil
@@ -1357,7 +1345,7 @@ activity. Only run if the buffer is not visible and
1357 (setq rcirc-activity-string 1345 (setq rcirc-activity-string
1358 (if (not rcirc-activity) 1346 (if (not rcirc-activity)
1359 "" 1347 ""
1360 (concat " [" 1348 (concat "-["
1361 (mapconcat 1349 (mapconcat
1362 (lambda (b) 1350 (lambda (b)
1363 (let ((s (rcirc-short-buffer-name b))) 1351 (let ((s (rcirc-short-buffer-name b)))
@@ -1366,7 +1354,7 @@ activity. Only run if the buffer is not visible and
1366 s 1354 s
1367 (rcirc-facify s 'rcirc-mode-line-nick))))) 1355 (rcirc-facify s 'rcirc-mode-line-nick)))))
1368 rcirc-activity ",") 1356 rcirc-activity ",")
1369 "]")))) 1357 "]-"))))
1370 1358
1371(defun rcirc-short-buffer-name (buffer) 1359(defun rcirc-short-buffer-name (buffer)
1372 "Return a short name for BUFFER to use in the modeline indicator." 1360 "Return a short name for BUFFER to use in the modeline indicator."
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index e3e2e2f23c1..db704985f2a 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -81,7 +81,7 @@
81 81
82;; 1) They go out of scope when the inferior is re-run. 82;; 1) They go out of scope when the inferior is re-run.
83;; 2) -stack-list-locals has a type field but also prints type in values field. 83;; 2) -stack-list-locals has a type field but also prints type in values field.
84;; 3) VARNUM increments even when vairable object is not created (maybe trivial). 84;; 3) VARNUM increments even when variable object is not created (maybe trivial).
85 85
86;;; TODO: 86;;; TODO:
87 87
@@ -107,7 +107,7 @@
107(defvar gdb-current-language nil) 107(defvar gdb-current-language nil)
108(defvar gdb-var-list nil 108(defvar gdb-var-list nil
109 "List of variables in watch window. 109 "List of variables in watch window.
110Each element has the form (EXPRESSION VARNUM NUMCHILD TYPE VALUE STATUS) where 110Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS) where
111STATUS is nil (unchanged), `changed' or `out-of-scope'.") 111STATUS is nil (unchanged), `changed' or `out-of-scope'.")
112(defvar gdb-force-update t 112(defvar gdb-force-update t
113 "Non-nil means that view of watch expressions will be updated in the speedbar.") 113 "Non-nil means that view of watch expressions will be updated in the speedbar.")
@@ -301,12 +301,38 @@ Also display the main routine in the disassembly buffer if present."
301 :group 'gud 301 :group 'gud
302 :version "22.1") 302 :version "22.1")
303 303
304(defcustom gdb-many-windows nil
305 "Nil means just pop up the GUD buffer unless `gdb-show-main' is t.
306In this case it starts with two windows: one displaying the GUD
307buffer and the other with the source file with the main routine
308of the inferior. Non-nil means display the layout shown for
309`gdba'."
310 :type 'boolean
311 :group 'gud
312 :version "22.1")
313
304(defcustom gdb-use-separate-io-buffer nil 314(defcustom gdb-use-separate-io-buffer nil
305 "Non-nil means display output from the inferior in a separate buffer." 315 "Non-nil means display output from the inferior in a separate buffer."
306 :type 'boolean 316 :type 'boolean
307 :group 'gud 317 :group 'gud
308 :version "22.1") 318 :version "22.1")
309 319
320(defun gdb-many-windows (arg)
321 "Toggle the number of windows in the basic arrangement.
322With arg, display additional buffers iff arg is positive."
323 (interactive "P")
324 (setq gdb-many-windows
325 (if (null arg)
326 (not gdb-many-windows)
327 (> (prefix-numeric-value arg) 0)))
328 (message (format "Display of other windows %sabled"
329 (if gdb-many-windows "en" "dis")))
330 (if (and gud-comint-buffer
331 (buffer-name gud-comint-buffer))
332 (condition-case nil
333 (gdb-restore-windows)
334 (error nil))))
335
310(defun gdb-use-separate-io-buffer (arg) 336(defun gdb-use-separate-io-buffer (arg)
311 "Toggle separate IO for inferior. 337 "Toggle separate IO for inferior.
312With arg, use separate IO iff arg is positive." 338With arg, use separate IO iff arg is positive."
@@ -391,12 +417,20 @@ With arg, use separate IO iff arg is positive."
391 417
392(defun gdb-find-watch-expression () 418(defun gdb-find-watch-expression ()
393 (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list)) 419 (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list))
394 (varno (nth 1 var)) (expr)) 420 (varnum (car var)) expr array)
395 (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varno) 421 (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varnum)
396 (dolist (var1 gdb-var-list) 422 (let ((var1 (assoc (match-string 1 varnum) gdb-var-list)) var2 varnumlet
397 (if (string-equal (nth 1 var1) (match-string 1 varno)) 423 (component-list (split-string (match-string 2 varnum) "\\." t)))
398 (setq expr (concat (car var1) "." (match-string 2 varno))))) 424 (setq expr (nth 1 var1))
399 expr)) 425 (setq varnumlet (car var1))
426 (dolist (component component-list)
427 (setq var2 (assoc varnumlet gdb-var-list))
428 (setq expr (concat expr
429 (if (string-match ".*\\[[0-9]+\\]$" (nth 3 var2))
430 (concat "[" component "]")
431 (concat "." component))))
432 (setq varnumlet (concat varnumlet "." component)))
433 expr)))
400 434
401(defun gdb-init-1 () 435(defun gdb-init-1 ()
402 (set (make-local-variable 'gud-minor-mode) 'gdba) 436 (set (make-local-variable 'gud-minor-mode) 'gdba)
@@ -622,23 +656,36 @@ With arg, automatically raise speedbar iff arg is positive."
622 :group 'gud 656 :group 'gud
623 :version "22.1") 657 :version "22.1")
624 658
625(defun gud-watch (&optional event) 659(define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch)
626 "Watch expression at point." 660(define-key global-map (concat gud-key-prefix "\C-w") 'gud-watch)
627 (interactive (list last-input-event)) 661
628 (if event (posn-set-point (event-end event))) 662(defun gud-watch (&optional arg event)
629 (require 'tooltip) 663 "Watch expression at point.
630 (save-selected-window 664With arg, enter name of variable to be watched in the minibuffer."
631 (let ((expr (tooltip-identifier-from-point (point)))) 665 (interactive (list current-prefix-arg last-input-event))
632 (catch 'already-watched 666 (let ((minor-mode (buffer-local-value 'gud-minor-mode gud-comint-buffer)))
633 (dolist (var gdb-var-list) 667 (if (memq minor-mode '(gdbmi gdba))
634 (if (string-equal expr (car var)) (throw 'already-watched nil))) 668 (progn
635 (set-text-properties 0 (length expr) nil expr) 669 (if event (posn-set-point (event-end event)))
636 (gdb-enqueue-input 670 (require 'tooltip)
637 (list 671 (save-selected-window
638 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) 672 (let ((expr (if arg
639 (concat "server interpreter mi \"-var-create - * " expr "\"\n") 673 (read-string "Name of variable: ")
640 (concat"-var-create - * " expr "\n")) 674 (tooltip-identifier-from-point (point)))))
641 `(lambda () (gdb-var-create-handler ,expr)))))))) 675 (catch 'already-watched
676 (dolist (var gdb-var-list)
677 (unless (string-match "\\." (car var))
678 (if (string-equal expr (nth 1 var))
679 (throw 'already-watched nil))))
680 (set-text-properties 0 (length expr) nil expr)
681 (gdb-enqueue-input
682 (list
683 (if (eq minor-mode 'gdba)
684 (concat
685 "server interpreter mi \"-var-create - * " expr "\"\n")
686 (concat"-var-create - * " expr "\n"))
687 `(lambda () (gdb-var-create-handler ,expr))))))))
688 (message "gud-watch is a no-op in this mode."))))
642 689
643(defconst gdb-var-create-regexp 690(defconst gdb-var-create-regexp
644 "name=\"\\(.*?\\)\",numchild=\"\\(.*?\\)\",type=\"\\(.*?\\)\"") 691 "name=\"\\(.*?\\)\",numchild=\"\\(.*?\\)\",type=\"\\(.*?\\)\"")
@@ -647,11 +694,11 @@ With arg, automatically raise speedbar iff arg is positive."
647 (goto-char (point-min)) 694 (goto-char (point-min))
648 (if (re-search-forward gdb-var-create-regexp nil t) 695 (if (re-search-forward gdb-var-create-regexp nil t)
649 (let ((var (list 696 (let ((var (list
697 (match-string 1)
650 (if (and (string-equal gdb-current-language "c") 698 (if (and (string-equal gdb-current-language "c")
651 gdb-use-colon-colon-notation gdb-selected-frame) 699 gdb-use-colon-colon-notation gdb-selected-frame)
652 (setq expr (concat gdb-selected-frame "::" expr)) 700 (setq expr (concat gdb-selected-frame "::" expr))
653 expr) 701 expr)
654 (match-string 1)
655 (match-string 2) 702 (match-string 2)
656 (match-string 3) 703 (match-string 3)
657 nil nil))) 704 nil nil)))
@@ -664,10 +711,10 @@ With arg, automatically raise speedbar iff arg is positive."
664 (list 711 (list
665 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) 712 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
666 (concat "server interpreter mi \"-var-evaluate-expression " 713 (concat "server interpreter mi \"-var-evaluate-expression "
667 (nth 1 var) "\"\n") 714 (car var) "\"\n")
668 (concat "-var-evaluate-expression " (nth 1 var) "\n")) 715 (concat "-var-evaluate-expression " (car var) "\n"))
669 `(lambda () (gdb-var-evaluate-expression-handler 716 `(lambda () (gdb-var-evaluate-expression-handler
670 ,(nth 1 var) nil))))) 717 ,(car var) nil)))))
671 (if (search-forward "Undefined command" nil t) 718 (if (search-forward "Undefined command" nil t)
672 (message-box "Watching expressions requires gdb 6.0 onwards") 719 (message-box "Watching expressions requires gdb 6.0 onwards")
673 (message-box "No symbol \"%s\" in current context." expr)))) 720 (message-box "No symbol \"%s\" in current context." expr))))
@@ -675,12 +722,10 @@ With arg, automatically raise speedbar iff arg is positive."
675(defun gdb-var-evaluate-expression-handler (varnum changed) 722(defun gdb-var-evaluate-expression-handler (varnum changed)
676 (goto-char (point-min)) 723 (goto-char (point-min))
677 (re-search-forward ".*value=\\(\".*\"\\)" nil t) 724 (re-search-forward ".*value=\\(\".*\"\\)" nil t)
678 (catch 'var-found 725 (let ((var (assoc varnum gdb-var-list)))
679 (dolist (var gdb-var-list) 726 (when var
680 (when (string-equal varnum (cadr var)) 727 (if changed (setcar (nthcdr 5 var) 'changed))
681 (if changed (setcar (nthcdr 5 var) 'changed)) 728 (setcar (nthcdr 4 var) (read (match-string 1))))))
682 (setcar (nthcdr 4 var) (read (match-string 1)))
683 (throw 'var-found nil)))))
684 729
685(defun gdb-var-list-children (varnum) 730(defun gdb-var-list-children (varnum)
686 (gdb-enqueue-input 731 (gdb-enqueue-input
@@ -696,26 +741,25 @@ type=\"\\(.*?\\)\"")
696 (let ((var-list nil)) 741 (let ((var-list nil))
697 (catch 'child-already-watched 742 (catch 'child-already-watched
698 (dolist (var gdb-var-list) 743 (dolist (var gdb-var-list)
699 (if (string-equal varnum (cadr var)) 744 (if (string-equal varnum (car var))
700 (progn 745 (progn
701 (push var var-list) 746 (push var var-list)
702 (while (re-search-forward gdb-var-list-children-regexp nil t) 747 (while (re-search-forward gdb-var-list-children-regexp nil t)
703 (let ((varchild (list (match-string 2) 748 (let ((varchild (list (match-string 1)
704 (match-string 1) 749 (match-string 2)
705 (match-string 3) 750 (match-string 3)
706 (match-string 4) 751 (match-string 4)
707 nil nil))) 752 nil nil)))
708 (dolist (var1 gdb-var-list) 753 (if (assoc (car varchild) gdb-var-list)
709 (if (string-equal (cadr var1) (cadr varchild)) 754 (throw 'child-already-watched nil))
710 (throw 'child-already-watched nil)))
711 (push varchild var-list) 755 (push varchild var-list)
712 (gdb-enqueue-input 756 (gdb-enqueue-input
713 (list 757 (list
714 (concat 758 (concat
715 "server interpreter mi \"-var-evaluate-expression " 759 "server interpreter mi \"-var-evaluate-expression "
716 (nth 1 varchild) "\"\n") 760 (car varchild) "\"\n")
717 `(lambda () (gdb-var-evaluate-expression-handler 761 `(lambda () (gdb-var-evaluate-expression-handler
718 ,(nth 1 varchild) nil))))))) 762 ,(car varchild) nil)))))))
719 (push var var-list))) 763 (push var var-list)))
720 (setq gdb-var-list (nreverse var-list))))) 764 (setq gdb-var-list (nreverse var-list)))))
721 765
@@ -735,11 +779,8 @@ type=\"\\(.*?\\)\"")
735 (while (re-search-forward gdb-var-update-regexp nil t) 779 (while (re-search-forward gdb-var-update-regexp nil t)
736 (let ((varnum (match-string 1))) 780 (let ((varnum (match-string 1)))
737 (if (string-equal (match-string 2) "false") 781 (if (string-equal (match-string 2) "false")
738 (catch 'var-found 782 (let ((var (assoc varnum gdb-var-list)))
739 (dolist (var gdb-var-list) 783 (if var (setcar (nthcdr 5 var) 'out-of-scope)))
740 (when (string-equal varnum (cadr var))
741 (setcar (nthcdr 5 var) 'out-of-scope)
742 (throw 'var-found nil))))
743 (gdb-enqueue-input 784 (gdb-enqueue-input
744 (list 785 (list
745 (concat "server interpreter mi \"-var-evaluate-expression " 786 (concat "server interpreter mi \"-var-evaluate-expression "
@@ -757,7 +798,8 @@ type=\"\\(.*?\\)\"")
757 (setq gdb-pending-triggers 798 (setq gdb-pending-triggers
758 (delq 'gdb-speedbar-refresh gdb-pending-triggers)) 799 (delq 'gdb-speedbar-refresh gdb-pending-triggers))
759 (with-current-buffer gud-comint-buffer 800 (with-current-buffer gud-comint-buffer
760 (let ((speedbar-verbosity-level 0)) 801 (let ((speedbar-verbosity-level 0)
802 (speedbar-shown-directories nil))
761 (save-excursion 803 (save-excursion
762 (speedbar-refresh))))) 804 (speedbar-refresh)))))
763 805
@@ -768,10 +810,14 @@ type=\"\\(.*?\\)\"")
768 '(gdbmi gdba)) 810 '(gdbmi gdba))
769 (let ((text (speedbar-line-text))) 811 (let ((text (speedbar-line-text)))
770 (string-match "\\(\\S-+\\)" text) 812 (string-match "\\(\\S-+\\)" text)
771 (let* ((expr (match-string 1 text)) 813 (let ((expr (match-string 1 text)) var varnum)
772 (var (assoc expr gdb-var-list)) 814 (catch 'expr-found
773 (varnum (cadr var))) 815 (dolist (var1 gdb-var-list)
774 (unless (string-match "\\." varnum) 816 (when (string-equal expr (nth 1 var1))
817 (setq var var1)
818 (setq varnum (car var1))
819 (throw 'expr-found nil))))
820 (unless (string-match "\\." (car var))
775 (gdb-enqueue-input 821 (gdb-enqueue-input
776 (list 822 (list
777 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 823 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
@@ -781,13 +827,13 @@ type=\"\\(.*?\\)\"")
781 'ignore)) 827 'ignore))
782 (setq gdb-var-list (delq var gdb-var-list)) 828 (setq gdb-var-list (delq var gdb-var-list))
783 (dolist (varchild gdb-var-list) 829 (dolist (varchild gdb-var-list)
784 (if (string-match (concat (nth 1 var) "\\.") (nth 1 varchild)) 830 (if (string-match (concat (car var) "\\.") (car varchild))
785 (setq gdb-var-list (delq varchild gdb-var-list))))))))) 831 (setq gdb-var-list (delq varchild gdb-var-list)))))))))
786 832
787(defun gdb-edit-value (text token indent) 833(defun gdb-edit-value (text token indent)
788 "Assign a value to a variable displayed in the speedbar." 834 "Assign a value to a variable displayed in the speedbar."
789 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) 835 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
790 (varnum (cadr var)) (value)) 836 (varnum (car var)) (value))
791 (setq value (read-string "New value: ")) 837 (setq value (read-string "New value: "))
792 (gdb-enqueue-input 838 (gdb-enqueue-input
793 (list 839 (list
@@ -823,7 +869,7 @@ INDENT is the current indentation depth."
823 (gdb-var-list-children-1 token))) 869 (gdb-var-list-children-1 token)))
824 ((string-match "-" text) ;contract this node 870 ((string-match "-" text) ;contract this node
825 (dolist (var gdb-var-list) 871 (dolist (var gdb-var-list)
826 (if (string-match (concat token "\\.") (nth 1 var)) 872 (if (string-match (concat token "\\.") (car var))
827 (setq gdb-var-list (delq var gdb-var-list)))) 873 (setq gdb-var-list (delq var gdb-var-list))))
828 (speedbar-change-expand-button-char ?+) 874 (speedbar-change-expand-button-char ?+)
829 (speedbar-delete-subblock indent)) 875 (speedbar-delete-subblock indent))
@@ -1193,6 +1239,8 @@ not GDB."
1193 (progn 1239 (progn
1194 (setq gud-running t) 1240 (setq gud-running t)
1195 (gdb-remove-text-properties) 1241 (gdb-remove-text-properties)
1242 (setq gud-overlay-arrow-position nil)
1243 (setq gdb-overlay-arrow-position nil)
1196 (if gdb-use-separate-io-buffer 1244 (if gdb-use-separate-io-buffer
1197 (setq gdb-output-sink 'inferior)))) 1245 (setq gdb-output-sink 'inferior))))
1198 (t 1246 (t
@@ -2671,32 +2719,6 @@ corresponding to the mode line clicked."
2671 (gdb-set-window-buffer (gdb-breakpoints-buffer-name)) 2719 (gdb-set-window-buffer (gdb-breakpoints-buffer-name))
2672 (other-window 1)) 2720 (other-window 1))
2673 2721
2674(defcustom gdb-many-windows nil
2675 "Nil means just pop up the GUD buffer unless `gdb-show-main' is t.
2676In this case it starts with two windows: one displaying the GUD
2677buffer and the other with the source file with the main routine
2678of the inferior. Non-nil means display the layout shown for
2679`gdba'."
2680 :type 'boolean
2681 :group 'gud
2682 :version "22.1")
2683
2684(defun gdb-many-windows (arg)
2685 "Toggle the number of windows in the basic arrangement.
2686With arg, display additional buffers iff arg is positive."
2687 (interactive "P")
2688 (setq gdb-many-windows
2689 (if (null arg)
2690 (not gdb-many-windows)
2691 (> (prefix-numeric-value arg) 0)))
2692 (message (format "Display of other windows %sabled"
2693 (if gdb-many-windows "en" "dis")))
2694 (if (and gud-comint-buffer
2695 (buffer-name gud-comint-buffer))
2696 (condition-case nil
2697 (gdb-restore-windows)
2698 (error nil))))
2699
2700(defun gdb-restore-windows () 2722(defun gdb-restore-windows ()
2701 "Restore the basic arrangement of windows used by gdba. 2723 "Restore the basic arrangement of windows used by gdba.
2702This arrangement depends on the value of `gdb-many-windows'." 2724This arrangement depends on the value of `gdb-many-windows'."
@@ -3115,19 +3137,18 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}")
3115 (let ((var-list nil)) 3137 (let ((var-list nil))
3116 (catch 'child-already-watched 3138 (catch 'child-already-watched
3117 (dolist (var gdb-var-list) 3139 (dolist (var gdb-var-list)
3118 (if (string-equal varnum (cadr var)) 3140 (if (string-equal varnum (car var))
3119 (progn 3141 (progn
3120 (push var var-list) 3142 (push var var-list)
3121 (while (re-search-forward gdb-var-list-children-regexp-1 nil t) 3143 (while (re-search-forward gdb-var-list-children-regexp-1 nil t)
3122 (let ((varchild (list (match-string 2) 3144 (let ((varchild (list (match-string 1)
3123 (match-string 1) 3145 (match-string 2)
3124 (match-string 3) 3146 (match-string 3)
3125 (match-string 5) 3147 (match-string 5)
3126 (read (match-string 4)) 3148 (read (match-string 4))
3127 nil))) 3149 nil)))
3128 (dolist (var1 gdb-var-list) 3150 (if (assoc (car varchild) gdb-var-list)
3129 (if (string-equal (cadr var1) (cadr varchild)) 3151 (throw 'child-already-watched nil))
3130 (throw 'child-already-watched nil)))
3131 (push varchild var-list)))) 3152 (push varchild var-list))))
3132 (push var var-list))) 3153 (push var var-list)))
3133 (setq gdb-var-list (nreverse var-list))))) 3154 (setq gdb-var-list (nreverse var-list)))))
@@ -3152,16 +3173,14 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}")
3152 (setcar (nthcdr 5 var) nil)) 3173 (setcar (nthcdr 5 var) nil))
3153 (goto-char (point-min)) 3174 (goto-char (point-min))
3154 (while (re-search-forward gdb-var-update-regexp-1 nil t) 3175 (while (re-search-forward gdb-var-update-regexp-1 nil t)
3155 (let ((varnum (match-string 1))) 3176 (let* ((varnum (match-string 1))
3156 (catch 'var-found 3177 (var (assoc varnum gdb-var-list)))
3157 (dolist (var gdb-var-list) 3178 (when var
3158 (when (string-equal varnum (cadr var)) 3179 (if (string-equal (match-string 3) "false")
3159 (if (string-equal (match-string 3) "false") 3180 (setcar (nthcdr 5 var) 'out-of-scope)
3160 (setcar (nthcdr 5 var) 'out-of-scope) 3181 (setcar (nthcdr 5 var) 'changed)
3161 (setcar (nthcdr 5 var) 'changed) 3182 (setcar (nthcdr 4 var)
3162 (setcar (nthcdr 4 var) 3183 (read (match-string 2)))))))
3163 (read (match-string 2))))
3164 (throw 'var-found nil))))))
3165 (setq gdb-pending-triggers 3184 (setq gdb-pending-triggers
3166 (delq 'gdb-var-update gdb-pending-triggers)) 3185 (delq 'gdb-var-update gdb-pending-triggers))
3167 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) 3186 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
@@ -3309,7 +3328,7 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}")
3309 (dolist (local locals-list) 3328 (dolist (local locals-list)
3310 (setq name (car local)) 3329 (setq name (car local))
3311 (if (or (not (nth 2 local)) 3330 (if (or (not (nth 2 local))
3312 (string-match "\\*$" (nth 1 local))) 3331 (string-match "\\0x" (nth 2 local)))
3313 (add-text-properties 0 (length name) 3332 (add-text-properties 0 (length name)
3314 `(mouse-face highlight 3333 `(mouse-face highlight
3315 help-echo "mouse-2: create watch expression" 3334 help-echo "mouse-2: create watch expression"
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 41bb24f9e61..f98ee3540d8 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -174,7 +174,7 @@ Used to grey out relevant togolbar icons.")
174 :enable (and (not gud-running) 174 :enable (and (not gud-running)
175 (memq gud-minor-mode 175 (memq gud-minor-mode
176 '(gdbmi gdba gdb dbx xdb jdb pdb bashdb)))) 176 '(gdbmi gdba gdb dbx xdb jdb pdb bashdb))))
177 ([pp] menu-item "Print the emacs s-expression" gud-pp 177 ([pp] menu-item "Print S-expression" gud-pp
178 :enable (and (not gud-running) 178 :enable (and (not gud-running)
179 gdb-active-process) 179 gdb-active-process)
180 :visible (and (string-equal 180 :visible (and (string-equal
@@ -234,9 +234,6 @@ Used to grey out relevant togolbar icons.")
234 (gud-run . "gud/run") 234 (gud-run . "gud/run")
235 (gud-go . "gud/go") 235 (gud-go . "gud/go")
236 (gud-stop-subjob . "gud/stop") 236 (gud-stop-subjob . "gud/stop")
237 ;; gud-s, gud-si etc. instead of gud-step,
238 ;; gud-stepi, to avoid file-name clashes on DOS
239 ;; 8+3 filesystems.
240 (gud-cont . "gud/cont") 237 (gud-cont . "gud/cont")
241 (gud-until . "gud/until") 238 (gud-until . "gud/until")
242 (gud-next . "gud/next") 239 (gud-next . "gud/next")
@@ -455,7 +452,7 @@ required by the caller."
455 (let ((var-list gdb-var-list) parent) 452 (let ((var-list gdb-var-list) parent)
456 (while var-list 453 (while var-list
457 (let* (char (depth 0) (start 0) (var (car var-list)) 454 (let* (char (depth 0) (start 0) (var (car var-list))
458 (expr (car var)) (varnum (nth 1 var)) 455 (varnum (car var)) (expr (nth 1 var))
459 (type (nth 3 var)) (value (nth 4 var)) 456 (type (nth 3 var)) (value (nth 4 var))
460 (status (nth 5 var))) 457 (status (nth 5 var)))
461 (put-text-property 458 (put-text-property
@@ -483,9 +480,9 @@ required by the caller."
483 t) 480 t)
484 depth) 481 depth)
485 (if (eq status 'out-of-scope) (setq parent 'shadow)) 482 (if (eq status 'out-of-scope) (setq parent 'shadow))
486 (if (and (cadr var-list) 483 (if (and (nth 1 var-list)
487 (string-match (concat varnum "\\.") 484 (string-match (concat varnum "\\.")
488 (cadr (cadr var-list)))) 485 (car (nth 1 var-list))))
489 (setq char ?-) 486 (setq char ?-)
490 (setq char ?+)) 487 (setq char ?+))
491 (if (string-match "\\*$" type) 488 (if (string-match "\\*$" type)
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 717455edc61..3c77560a9cc 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -5,7 +5,7 @@
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.08 8;; Version: 4.09
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -81,8 +81,14 @@
81;; 81;;
82;; Changes since version 4.00: 82;; Changes since version 4.00:
83;; --------------------------- 83;; ---------------------------
84;; Version 4.08 84;; Version 4.09
85;; - Bug fixes.
86;; - Small improvements to font-lock support.
87;; - MHE support finalized.
85;; 88;;
89;; Version 4.08
90;; - Bug fixes.
91;; - Improved MHE support
86;; 92;;
87;; Version 4.07 93;; Version 4.07
88;; - Bug fixes. 94;; - Bug fixes.
@@ -139,7 +145,7 @@
139 145
140;;; Customization variables 146;;; Customization variables
141 147
142(defvar org-version "4.08" 148(defvar org-version "4.09"
143 "The version number of the file org.el.") 149 "The version number of the file org.el.")
144(defun org-version () 150(defun org-version ()
145 (interactive) 151 (interactive)
@@ -796,31 +802,15 @@ as possible."
796 :group 'org-structure 802 :group 'org-structure
797 :type 'hook) 803 :type 'hook)
798 804
799(defcustom org-level-color-stars-only nil
800 "Non-nil means fontify only the stars in each headline.
801When nil, the entire headline is fontified.
802Changing it requires restart of `font-lock-mode' to become effective."
803 :group 'org-structure
804 :type 'boolean)
805
806(defcustom org-hide-leading-stars nil
807 "Non-nil means, hide the first N-1 stars in a headline.
808This works by using the face `org-hide' for these stars. This
809face is white for a light background, and black for a dark
810background. You may have to customize the face `org-hide' to
811make this work.
812Changing it requires restart of `font-lock-mode' to become effective."
813 :group 'org-structure
814 :type 'boolean)
815
816(defcustom org-odd-levels-only nil 805(defcustom org-odd-levels-only nil
817 "Non-nil means, skip even levels and only use odd levels for the outline. 806 "Non-nil means, skip even levels and only use odd levels for the outline.
818This has the effect that two stars are being added/taken away in 807This has the effect that two stars are being added/taken away in
819promotion/demotion commands. It also influences how levels are 808promotion/demotion commands. It also influences how levels are
820handled by the exporters. 809handled by the exporters.
821Changing it requires restart of `font-lock-mode' to become effective 810Changing it requires restart of `font-lock-mode' to become effective
822for fontification." 811for fontification also in regions already fontified."
823 :group 'org-structure 812 :group 'org-structure
813 :group 'org-font-lock
824 :type 'boolean) 814 :type 'boolean)
825 815
826(defcustom org-adapt-indentation t 816(defcustom org-adapt-indentation t
@@ -1710,11 +1700,44 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1710 :group 'org-export 1700 :group 'org-export
1711 :type 'string) 1701 :type 'string)
1712 1702
1713(defgroup org-faces nil 1703(defgroup org-font-lock nil
1714 "Faces for highlighting in Org-mode." 1704 "Faces and settings for highlighting in Org-mode."
1715 :tag "Org Faces" 1705 :tag "Org Font Lock"
1716 :group 'org) 1706 :group 'org)
1717 1707
1708(defcustom org-level-color-stars-only nil
1709 "Non-nil means fontify only the stars in each headline.
1710When nil, the entire headline is fontified.
1711Changing it requires restart of `font-lock-mode' to become effective
1712also in regions already fontified."
1713 :group 'org-font-lock
1714 :type 'boolean)
1715
1716(defcustom org-hide-leading-stars nil
1717 "Non-nil means, hide the first N-1 stars in a headline.
1718This works by using the face `org-hide' for these stars. This
1719face is white for a light background, and black for a dark
1720background. You may have to customize the face `org-hide' to
1721make this work.
1722Changing it requires restart of `font-lock-mode' to become effective
1723also in regions already fontified."
1724 :group 'org-font-lock
1725 :type 'boolean)
1726
1727(defcustom org-fontify-done-headline nil
1728 "Non-nil means, change the face of a headline if it is marked DONE.
1729Normally, only the TODO/DONE keyword indicates the state of a headline.
1730When this is non-nil, the headline after the keyword is set to the
1731`org-headline-done' as an additional indication."
1732 :group 'org-font-lock
1733 :type 'boolean)
1734
1735(defcustom org-fontify-emphasized-text t
1736 "Non-nil means fontify *bold*, /italic/ and _underlined_ text.
1737Changing this variable requires a restart of Emacs to take effect."
1738 :group 'org-font-lock
1739 :type 'boolean)
1740
1718(defface org-hide 1741(defface org-hide
1719 '((((type tty) (class color)) (:foreground "blue" :weight bold)) 1742 '((((type tty) (class color)) (:foreground "blue" :weight bold))
1720 (((class color) (background light)) (:foreground "white")) 1743 (((class color) (background light)) (:foreground "white"))
@@ -1723,7 +1746,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1723; (((class color) (background dark)) (:foreground "grey10")) 1746; (((class color) (background dark)) (:foreground "grey10"))
1724 (t (:inverse-video nil))) 1747 (t (:inverse-video nil)))
1725 "Face used for level 1 headlines." 1748 "Face used for level 1 headlines."
1726 :group 'org-faces) 1749 :group 'org-font-lock)
1727 1750
1728(defface org-level-1 ;; font-lock-function-name-face 1751(defface org-level-1 ;; font-lock-function-name-face
1729 '((((type tty) (class color)) (:foreground "blue" :weight bold)) 1752 '((((type tty) (class color)) (:foreground "blue" :weight bold))
@@ -1731,7 +1754,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1731 (((class color) (background dark)) (:foreground "LightSkyBlue")) 1754 (((class color) (background dark)) (:foreground "LightSkyBlue"))
1732 (t (:inverse-video t :bold t))) 1755 (t (:inverse-video t :bold t)))
1733 "Face used for level 1 headlines." 1756 "Face used for level 1 headlines."
1734 :group 'org-faces) 1757 :group 'org-font-lock)
1735 1758
1736(defface org-level-2 ;; font-lock-variable-name-face 1759(defface org-level-2 ;; font-lock-variable-name-face
1737 '((((type tty) (class color)) (:foreground "yellow" :weight light)) 1760 '((((type tty) (class color)) (:foreground "yellow" :weight light))
@@ -1739,7 +1762,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1739 (((class color) (background dark)) (:foreground "LightGoldenrod")) 1762 (((class color) (background dark)) (:foreground "LightGoldenrod"))
1740 (t (:bold t :italic t))) 1763 (t (:bold t :italic t)))
1741 "Face used for level 2 headlines." 1764 "Face used for level 2 headlines."
1742 :group 'org-faces) 1765 :group 'org-font-lock)
1743 1766
1744(defface org-level-3 ;; font-lock-keyword-face 1767(defface org-level-3 ;; font-lock-keyword-face
1745 '((((type tty) (class color)) (:foreground "cyan" :weight bold)) 1768 '((((type tty) (class color)) (:foreground "cyan" :weight bold))
@@ -1747,7 +1770,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1747 (((class color) (background dark)) (:foreground "Cyan")) 1770 (((class color) (background dark)) (:foreground "Cyan"))
1748 (t (:bold t))) 1771 (t (:bold t)))
1749 "Face used for level 3 headlines." 1772 "Face used for level 3 headlines."
1750 :group 'org-faces) 1773 :group 'org-font-lock)
1751 1774
1752(defface org-level-4 ;; font-lock-comment-face 1775(defface org-level-4 ;; font-lock-comment-face
1753 '((((type tty pc) (class color) (background light)) (:foreground "red")) 1776 '((((type tty pc) (class color) (background light)) (:foreground "red"))
@@ -1756,7 +1779,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1756 (((class color) (background dark)) (:foreground "chocolate1")) 1779 (((class color) (background dark)) (:foreground "chocolate1"))
1757 (t (:bold t :italic t))) 1780 (t (:bold t :italic t)))
1758 "Face used for level 4 headlines." 1781 "Face used for level 4 headlines."
1759 :group 'org-faces) 1782 :group 'org-font-lock)
1760 1783
1761(defface org-level-5 ;; font-lock-type-face 1784(defface org-level-5 ;; font-lock-type-face
1762 '((((type tty) (class color)) (:foreground "green")) 1785 '((((type tty) (class color)) (:foreground "green"))
@@ -1764,7 +1787,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1764 (((class color) (background dark)) (:foreground "PaleGreen")) 1787 (((class color) (background dark)) (:foreground "PaleGreen"))
1765 (t (:bold t :underline t))) 1788 (t (:bold t :underline t)))
1766 "Face used for level 5 headlines." 1789 "Face used for level 5 headlines."
1767 :group 'org-faces) 1790 :group 'org-font-lock)
1768 1791
1769(defface org-level-6 ;; font-lock-constant-face 1792(defface org-level-6 ;; font-lock-constant-face
1770 '((((type tty) (class color)) (:foreground "magenta")) 1793 '((((type tty) (class color)) (:foreground "magenta"))
@@ -1772,7 +1795,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1772 (((class color) (background dark)) (:foreground "Aquamarine")) 1795 (((class color) (background dark)) (:foreground "Aquamarine"))
1773 (t (:bold t :underline t))) 1796 (t (:bold t :underline t)))
1774 "Face used for level 6 headlines." 1797 "Face used for level 6 headlines."
1775 :group 'org-faces) 1798 :group 'org-font-lock)
1776 1799
1777(defface org-level-7 ;; font-lock-builtin-face 1800(defface org-level-7 ;; font-lock-builtin-face
1778 '((((type tty) (class color)) (:foreground "blue" :weight light)) 1801 '((((type tty) (class color)) (:foreground "blue" :weight light))
@@ -1780,7 +1803,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1780 (((class color) (background dark)) (:foreground "LightSteelBlue")) 1803 (((class color) (background dark)) (:foreground "LightSteelBlue"))
1781 (t (:bold t))) 1804 (t (:bold t)))
1782 "Face used for level 7 headlines." 1805 "Face used for level 7 headlines."
1783 :group 'org-faces) 1806 :group 'org-font-lock)
1784 1807
1785(defface org-level-8 ;; font-lock-string-face 1808(defface org-level-8 ;; font-lock-string-face
1786 '((((type tty) (class color)) (:foreground "green")) 1809 '((((type tty) (class color)) (:foreground "green"))
@@ -1788,7 +1811,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1788 (((class color) (background dark)) (:foreground "LightSalmon")) 1811 (((class color) (background dark)) (:foreground "LightSalmon"))
1789 (t (:italic t))) 1812 (t (:italic t)))
1790 "Face used for level 8 headlines." 1813 "Face used for level 8 headlines."
1791 :group 'org-faces) 1814 :group 'org-font-lock)
1792 1815
1793(defface org-special-keyword ;; font-lock-string-face 1816(defface org-special-keyword ;; font-lock-string-face
1794 '((((type tty) (class color)) (:foreground "green")) 1817 '((((type tty) (class color)) (:foreground "green"))
@@ -1796,7 +1819,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1796 (((class color) (background dark)) (:foreground "LightSalmon")) 1819 (((class color) (background dark)) (:foreground "LightSalmon"))
1797 (t (:italic t))) 1820 (t (:italic t)))
1798 "Face used for special keywords." 1821 "Face used for special keywords."
1799 :group 'org-faces) 1822 :group 'org-font-lock)
1800 1823
1801(defface org-warning ;; font-lock-warning-face 1824(defface org-warning ;; font-lock-warning-face
1802 '((((type tty) (class color)) (:foreground "red")) 1825 '((((type tty) (class color)) (:foreground "red"))
@@ -1805,15 +1828,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
1805; (((class color) (background dark)) (:foreground "Pink" :bold t)) 1828; (((class color) (background dark)) (:foreground "Pink" :bold t))
1806 (t (:inverse-video t :bold t))) 1829 (t (:inverse-video t :bold t)))
1807 "Face for deadlines and TODO keywords." 1830 "Face for deadlines and TODO keywords."
1808 :group 'org-faces) 1831 :group 'org-font-lock)
1809
1810(defcustom org-fontify-done-headline nil
1811 "Non-nil means, change the face of a headline if it is marked DONE.
1812Normally, only the TODO/DONE keyword indicates the state of a headline.
1813When this is non-nil, the headline after the keyword is set to the
1814`org-headline-done' as an additional indication."
1815 :group 'org-faces
1816 :type 'boolean)
1817 1832
1818(defface org-headline-done ;; font-lock-string-face 1833(defface org-headline-done ;; font-lock-string-face
1819 '((((type tty) (class color)) (:foreground "green")) 1834 '((((type tty) (class color)) (:foreground "green"))
@@ -1822,7 +1837,7 @@ When this is non-nil, the headline after the keyword is set to the
1822 (t (:italic t))) 1837 (t (:italic t)))
1823 "Face used to indicate that a headline is DONE. See also the variable 1838 "Face used to indicate that a headline is DONE. See also the variable
1824`org-fontify-done-headline'." 1839`org-fontify-done-headline'."
1825 :group 'org-faces) 1840 :group 'org-font-lock)
1826 1841
1827;; Inheritance does not yet work for xemacs. So we just copy... 1842;; Inheritance does not yet work for xemacs. So we just copy...
1828 1843
@@ -1832,7 +1847,7 @@ When this is non-nil, the headline after the keyword is set to the
1832 (((class color) (background dark)) (:foreground "LightSkyBlue")) 1847 (((class color) (background dark)) (:foreground "LightSkyBlue"))
1833 (t (:inverse-video t :bold t))) 1848 (t (:inverse-video t :bold t)))
1834 "Face for upcoming deadlines." 1849 "Face for upcoming deadlines."
1835 :group 'org-faces) 1850 :group 'org-font-lock)
1836 1851
1837(defface org-scheduled-today 1852(defface org-scheduled-today
1838 '((((type tty) (class color)) (:foreground "green")) 1853 '((((type tty) (class color)) (:foreground "green"))
@@ -1840,7 +1855,7 @@ When this is non-nil, the headline after the keyword is set to the
1840 (((class color) (background dark)) (:foreground "PaleGreen")) 1855 (((class color) (background dark)) (:foreground "PaleGreen"))
1841 (t (:bold t :underline t))) 1856 (t (:bold t :underline t)))
1842 "Face for items scheduled for a certain day." 1857 "Face for items scheduled for a certain day."
1843 :group 'org-faces) 1858 :group 'org-font-lock)
1844 1859
1845(defface org-scheduled-previously 1860(defface org-scheduled-previously
1846 '((((type tty pc) (class color) (background light)) (:foreground "red")) 1861 '((((type tty pc) (class color) (background light)) (:foreground "red"))
@@ -1849,7 +1864,7 @@ When this is non-nil, the headline after the keyword is set to the
1849 (((class color) (background dark)) (:foreground "chocolate1")) 1864 (((class color) (background dark)) (:foreground "chocolate1"))
1850 (t (:bold t :italic t))) 1865 (t (:bold t :italic t)))
1851 "Face for items scheduled previously, and not yet done." 1866 "Face for items scheduled previously, and not yet done."
1852 :group 'org-faces) 1867 :group 'org-font-lock)
1853 1868
1854(defface org-formula 1869(defface org-formula
1855 '((((type tty pc) (class color) (background light)) (:foreground "red")) 1870 '((((type tty pc) (class color) (background light)) (:foreground "red"))
@@ -1858,7 +1873,7 @@ When this is non-nil, the headline after the keyword is set to the
1858 (((class color) (background dark)) (:foreground "chocolate1")) 1873 (((class color) (background dark)) (:foreground "chocolate1"))
1859 (t (:bold t :italic t))) 1874 (t (:bold t :italic t)))
1860 "Face for formulas." 1875 "Face for formulas."
1861 :group 'org-faces) 1876 :group 'org-font-lock)
1862 1877
1863(defface org-link 1878(defface org-link
1864 '((((type tty) (class color)) (:foreground "cyan" :weight bold)) 1879 '((((type tty) (class color)) (:foreground "cyan" :weight bold))
@@ -1866,15 +1881,15 @@ When this is non-nil, the headline after the keyword is set to the
1866 (((class color) (background dark)) (:foreground "Cyan")) 1881 (((class color) (background dark)) (:foreground "Cyan"))
1867 (t (:bold t))) 1882 (t (:bold t)))
1868 "Face for links." 1883 "Face for links."
1869 :group 'org-faces) 1884 :group 'org-font-lock)
1870 1885
1871(defface org-tag 1886(defface org-tag
1872 '((((type tty) (class color)) (:foreground "cyan" :weight bold)) 1887 '((((type tty) (class color)) (:foreground "cyan" :weight bold))
1873 (((class color) (background light)) (:foreground "Purple" :weight bold)) 1888 (((class color) (background light)) (:foreground "Purple" :weight bold))
1874 (((class color) (background dark)) (:foreground "Cyan" :weight bold)) 1889 (((class color) (background dark)) (:foreground "Cyan" :weight bold))
1875 (t (:bold t))) 1890 (t (:bold t)))
1876 "Face for links." 1891 "Face for tags."
1877 :group 'org-faces) 1892 :group 'org-font-lock)
1878 1893
1879(defface org-done ;; font-lock-type-face 1894(defface org-done ;; font-lock-type-face
1880 '((((type tty) (class color)) (:foreground "green")) 1895 '((((type tty) (class color)) (:foreground "green"))
@@ -1882,7 +1897,7 @@ When this is non-nil, the headline after the keyword is set to the
1882 (((class color) (background dark)) (:foreground "PaleGreen" :bold t)) 1897 (((class color) (background dark)) (:foreground "PaleGreen" :bold t))
1883 (t (:bold t :underline t))) 1898 (t (:bold t :underline t)))
1884 "Face used for DONE." 1899 "Face used for DONE."
1885 :group 'org-faces) 1900 :group 'org-font-lock)
1886 1901
1887(defface org-table ;; font-lock-function-name-face 1902(defface org-table ;; font-lock-function-name-face
1888 '((((type tty) (class color)) (:foreground "blue" :weight bold)) 1903 '((((type tty) (class color)) (:foreground "blue" :weight bold))
@@ -1890,7 +1905,7 @@ When this is non-nil, the headline after the keyword is set to the
1890 (((class color) (background dark)) (:foreground "LightSkyBlue")) 1905 (((class color) (background dark)) (:foreground "LightSkyBlue"))
1891 (t (:inverse-video t :bold t))) 1906 (t (:inverse-video t :bold t)))
1892 "Face used for tables." 1907 "Face used for tables."
1893 :group 'org-faces) 1908 :group 'org-font-lock)
1894 1909
1895(defface org-time-grid ;; font-lock-variable-name-face 1910(defface org-time-grid ;; font-lock-variable-name-face
1896 '((((type tty) (class color)) (:foreground "yellow" :weight light)) 1911 '((((type tty) (class color)) (:foreground "yellow" :weight light))
@@ -1898,7 +1913,7 @@ When this is non-nil, the headline after the keyword is set to the
1898 (((class color) (background dark)) (:foreground "LightGoldenrod")) 1913 (((class color) (background dark)) (:foreground "LightGoldenrod"))
1899 (t (:bold t :italic t))) 1914 (t (:bold t :italic t)))
1900 "Face used for time grids." 1915 "Face used for time grids."
1901 :group 'org-faces) 1916 :group 'org-font-lock)
1902 1917
1903(defvar org-level-faces 1918(defvar org-level-faces
1904 '(org-level-1 org-level-2 org-level-3 org-level-4 1919 '(org-level-1 org-level-2 org-level-3 org-level-4
@@ -1939,6 +1954,10 @@ When this is non-nil, the headline after the keyword is set to the
1939 (set '(("fold" org-startup-folded t) 1954 (set '(("fold" org-startup-folded t)
1940 ("nofold" org-startup-folded nil) 1955 ("nofold" org-startup-folded nil)
1941 ("content" org-startup-folded content) 1956 ("content" org-startup-folded content)
1957 ("hidestars" org-hide-leading-stars t)
1958 ("showstars" org-hide-leading-stars nil)
1959 ("odd" org-odd-levels-only t)
1960 ("oddeven" org-odd-levels-only nil)
1942 ("dlcheck" org-startup-with-deadline-check t) 1961 ("dlcheck" org-startup-with-deadline-check t)
1943 ("nodlcheck" org-startup-with-deadline-check nil))) 1962 ("nodlcheck" org-startup-with-deadline-check nil)))
1944 l var val) 1963 l var val)
@@ -2307,44 +2326,45 @@ between words."
2307(defvar org-font-lock-keywords nil) 2326(defvar org-font-lock-keywords nil)
2308 2327
2309(defun org-set-font-lock-defaults () 2328(defun org-set-font-lock-defaults ()
2310 (let ((org-font-lock-extra-keywords 2329 (let* ((em org-fontify-emphasized-text)
2311 (list 2330 (org-font-lock-extra-keywords
2312 '("^\\(\\**\\)\\(\\*\\)\\(.*\\)" (1 (org-get-level-face 1)) 2331 (list
2313 (2 (org-get-level-face 2)) (3 (org-get-level-face 3))) 2332 '("^\\(\\**\\)\\(\\*\\)\\(.*\\)" (1 (org-get-level-face 1))
2314 '(org-activate-links (0 'org-link t)) 2333 (2 (org-get-level-face 2)) (3 (org-get-level-face 3)))
2315 '(org-activate-links2 (0 'org-link t)) 2334 '(org-activate-links (0 'org-link t))
2316 '(org-activate-target-links (0 'org-link t)) 2335 '(org-activate-links2 (0 'org-link t))
2317 '(org-activate-dates (0 'org-link t)) 2336 '(org-activate-target-links (0 'org-link t))
2318 '(org-activate-camels (0 'org-link t)) 2337 '(org-activate-dates (0 'org-link t))
2319 '(org-activate-tags (1 'org-tag t)) 2338 '(org-activate-camels (0 'org-link t))
2320 (list (concat "^\\*+[ \t]*" org-not-done-regexp) 2339 '(org-activate-tags (1 'org-tag t))
2321 '(1 'org-warning t)) 2340 (list (concat "^\\*+[ \t]*" org-not-done-regexp)
2322 (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t)) 2341 '(1 'org-warning t))
2323 (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t)) 2342 (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t))
2324 (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t)) 2343 (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
2325 (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t)) 2344 (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t))
2326 ;; '("\\(\\s-\\|^\\)\\(\\*\\([a-zA-Z]+\\)\\*\\)\\([^a-zA-Z*]\\|$\\)" 2345 (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
2327 ;; (3 'bold)) 2346; (if em '("\\(\\s-\\|^\\)\\(\\*\\([a-zA-Z]+\\)\\*\\)\\([^a-zA-Z*]\\|$\\)" (3 'bold)))
2328 ;; '("\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)" 2347; (if em '("\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)" (3 'italic)))
2329 ;; (3 'italic)) 2348; (if em '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)" (3 'underline)))
2330 ;; '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)" 2349 (if em '("\\*[a-zA-Z]+\\*" 0 'bold))
2331 ;; (3 'underline)) 2350 (if em '("/*[a-zA-Z]+/" 0 'italic))
2332 (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string 2351 (if em '("_[a-zA-Z]+_" 0 'underline))
2333 "\\|" org-quote-string "\\)\\>") 2352 (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string
2334 '(1 'org-special-keyword t)) 2353 "\\|" org-quote-string "\\)\\>")
2335 '("^#.*" (0 'font-lock-comment-face t)) 2354 '(1 'org-special-keyword t))
2336 (if org-fontify-done-headline 2355 '("^#.*" (0 'font-lock-comment-face t))
2337 (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\(.*\\)\\>") 2356 (if org-fontify-done-headline
2338 '(1 'org-done t) '(2 'org-headline-done t)) 2357 (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\(.*\\)\\>")
2339 (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\>") 2358 '(1 'org-done t) '(2 'org-headline-done t))
2340 '(1 'org-done t))) 2359 (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\>")
2341 '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)" 2360 '(1 'org-done t)))
2342 (1 'org-table t)) 2361 '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
2343 '("^[ \t]*\\(:.*\\)" (1 'org-table t)) 2362 (1 'org-table t))
2344 '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t)) 2363 '("^[ \t]*\\(:.*\\)" (1 'org-table t))
2345 '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t)) 2364 '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t))
2346 ))) 2365 '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t))
2347 2366 )))
2367 (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords))
2348 ;; Now set the full font-lock-keywords 2368 ;; Now set the full font-lock-keywords
2349 (set (make-local-variable 'org-font-lock-keywords) 2369 (set (make-local-variable 'org-font-lock-keywords)
2350 org-font-lock-extra-keywords) 2370 org-font-lock-extra-keywords)
@@ -6960,7 +6980,7 @@ in all files."
6960 (s0 (mapconcat 'identity (org-split-string s "[ \t\r\n]+") " ")) 6980 (s0 (mapconcat 'identity (org-split-string s "[ \t\r\n]+") " "))
6961 (pos (point)) 6981 (pos (point))
6962 (pre "") (post "") 6982 (pre "") (post "")
6963 words re0 re1 re2 re3 re4 re5 reall camel) 6983 words re0 re1 re2 re3 re4 re5 re2a reall camel)
6964 (cond ((save-excursion 6984 (cond ((save-excursion
6965 (goto-char (point-min)) 6985 (goto-char (point-min))
6966 (and 6986 (and
@@ -6995,11 +7015,13 @@ in all files."
6995 (org-split-string s "[ \n\r\t]+")) 7015 (org-split-string s "[ \n\r\t]+"))
6996 re0 (concat "<<" (regexp-quote s0) ">>") 7016 re0 (concat "<<" (regexp-quote s0) ">>")
6997 re2 (concat "\\<" (mapconcat 'downcase words "[ \t]+") "\\>") 7017 re2 (concat "\\<" (mapconcat 'downcase words "[ \t]+") "\\>")
7018 re2a (concat "\\<" (mapconcat 'downcase words "[ \t\r\n]+") "\\>")
6998 re4 (concat "\\<" (mapconcat 'downcase words "[^a-zA-Z_\r\n]+") "\\>") 7019 re4 (concat "\\<" (mapconcat 'downcase words "[^a-zA-Z_\r\n]+") "\\>")
6999 re1 (concat pre re2 post) 7020 re1 (concat pre re2 post)
7000 re3 (concat pre re4 post) 7021 re3 (concat pre re4 post)
7001 re5 (concat pre ".*" re4) 7022 re5 (concat pre ".*" re4)
7002 re2 (concat pre re2) 7023 re2 (concat pre re2)
7024 re2a (concat pre re2a)
7003 re4 (concat pre re4) 7025 re4 (concat pre re4)
7004 reall (concat "\\(" re0 "\\)\\|\\(" re1 "\\)\\|\\(" re2 7026 reall (concat "\\(" re0 "\\)\\|\\(" re1 "\\)\\|\\(" re2
7005 "\\)\\|\\(" re3 "\\)\\|\\(" re4 "\\)\\|\\(" 7027 "\\)\\|\\(" re3 "\\)\\|\\(" re4 "\\)\\|\\("
@@ -7009,12 +7031,14 @@ in all files."
7009 ((eq type 'org-occur) (org-occur reall)) 7031 ((eq type 'org-occur) (org-occur reall))
7010 ((eq type 'occur) (org-do-occur (downcase reall) 'cleanup)) 7032 ((eq type 'occur) (org-do-occur (downcase reall) 'cleanup))
7011 (t (goto-char (point-min)) 7033 (t (goto-char (point-min))
7012 (if (or (re-search-forward re0 nil t) 7034 (if (or (org-search-not-link re0 nil t)
7013 (re-search-forward re1 nil t) 7035 (org-search-not-link re1 nil t)
7014 (re-search-forward re2 nil t) 7036 (org-search-not-link re2 nil t)
7015 (re-search-forward re3 nil t) 7037 (org-search-not-link re2a nil t) ;; FIXME: Right place???
7016 (re-search-forward re4 nil t) 7038 (org-search-not-link re3 nil t)
7017 (re-search-forward re5 nil t)) 7039 (org-search-not-link re4 nil t)
7040 (org-search-not-link re5 nil t)
7041 )
7018 (goto-char (match-beginning 0)) 7042 (goto-char (match-beginning 0))
7019 (goto-char pos) 7043 (goto-char pos)
7020 (error "No match"))))) 7044 (error "No match")))))
@@ -7026,6 +7050,21 @@ in all files."
7026 (error "No match")))) 7050 (error "No match"))))
7027 (and (eq major-mode 'org-mode) (org-show-hierarchy-above)))) 7051 (and (eq major-mode 'org-mode) (org-show-hierarchy-above))))
7028 7052
7053(defun org-search-not-link (&rest args)
7054 "Execute `re-search-forward', but only accept matches that are not a link."
7055 (catch 'exit
7056 (let ((pos (point)) p1)
7057 (while (apply 're-search-forward args)
7058 (setq p1 (point))
7059 (if (not (save-match-data
7060 (and (re-search-backward "\\[\\[" nil t)
7061 (looking-at org-bracket-link-regexp)
7062 (<= (match-beginning 0) p1)
7063 (>= (match-end 0) p1))))
7064 (progn (goto-char (match-end 0))
7065 (throw 'exit (point)))
7066 (goto-char (match-end 0)))))))
7067
7029(defun org-do-occur (regexp &optional cleanup) 7068(defun org-do-occur (regexp &optional cleanup)
7030 "Call the Emacs command `occur'. 7069 "Call the Emacs command `occur'.
7031If CLEANUP is non-nil, remove the printout of the regular expression 7070If CLEANUP is non-nil, remove the printout of the regular expression
@@ -7284,24 +7323,32 @@ idea..."
7284 header-field))) 7323 header-field)))
7285 7324
7286(defun org-follow-mhe-link (folder article) 7325(defun org-follow-mhe-link (folder article)
7287 "Follow an MHE link to FOLDER and ARTICLE." 7326 "Follow an MHE link to FOLDER and ARTICLE.
7288 (setq article (org-add-angle-brackets article)) 7327If ARTICLE is nil FOLDER is shown. If the configuration variable
7328`org-mhe-search-all-folders' is t and `mh-searcher' is pick,
7329ARTICLE is searched in all folders. Indexed searches (swish++,
7330namazu, and others supported by MH-E) will always search in all
7331folders."
7289 (require 'mh-e) 7332 (require 'mh-e)
7290 (require 'mh-search) 7333 (require 'mh-search)
7334 (require 'mh-utils)
7291 (mh-find-path) 7335 (mh-find-path)
7292 (mh-search-choose) 7336 (if (not article)
7293 (if (equal mh-searcher 'pick) 7337 (mh-visit-folder (mh-normalize-folder-name folder))
7294 (progn 7338 (setq article (org-add-angle-brackets article))
7295 (mh-search folder (list "--message-id" article)) 7339 (mh-search-choose)
7296 (when (and org-mhe-search-all-folders 7340 (if (equal mh-searcher 'pick)
7297 (not (org-mhe-get-message-real-folder))) 7341 (progn
7298 (kill-this-buffer) 7342 (mh-search folder (list "--message-id" article))
7299 (mh-search "+" (list "--message-id" article)))) 7343 (when (and org-mhe-search-all-folders
7300 (mh-search "+" article)) 7344 (not (org-mhe-get-message-real-folder)))
7301 (if (org-mhe-get-message-real-folder) 7345 (kill-this-buffer)
7302 (mh-show-msg 1) 7346 (mh-search "+" (list "--message-id" article))))
7303 (kill-this-buffer) 7347 (mh-search "+" article))
7304 (error "Message not found"))) 7348 (if (org-mhe-get-message-real-folder)
7349 (mh-show-msg 1)
7350 (kill-this-buffer)
7351 (error "Message not found"))))
7305 7352
7306(defun org-open-file (path &optional in-emacs line search) 7353(defun org-open-file (path &optional in-emacs line search)
7307 "Open the file at PATH. 7354 "Open the file at PATH.
@@ -10563,7 +10610,7 @@ translations. There is currently no way for users to extend this.")
10563This will leave level 1 alone, convert level 2 to level 3, level 3 to 10610This will leave level 1 alone, convert level 2 to level 3, level 3 to
10564level 5 etc." 10611level 5 etc."
10565 (interactive) 10612 (interactive)
10566 (when (yes-or-no-p "Are you sure you want to globally change levels? ") 10613 (when (yes-or-no-p "Are you sure you want to globally change levels to odd? ")
10567 (let ((org-odd-levels-only nil) n) 10614 (let ((org-odd-levels-only nil) n)
10568 (save-excursion 10615 (save-excursion
10569 (goto-char (point-min)) 10616 (goto-char (point-min))
@@ -10573,6 +10620,28 @@ level 5 etc."
10573 (org-demote)) 10620 (org-demote))
10574 (end-of-line 1)))))) 10621 (end-of-line 1))))))
10575 10622
10623
10624(defun org-convert-to-oddeven-levels ()
10625 "Convert an org-mode file with only odd levels to one with odd and even levels.
10626This promotes level 3 to level 2, level 5 to level 3 etc. If the file contains a
10627section with an even level, conversion would destroy the structure of the file. An error
10628is signaled in this case."
10629 (interactive)
10630 (goto-char (point-min))
10631 ;; First check if there are no even levels
10632 (when (re-search-forward "^\\(\\*\\*\\)+[^*]" nil t)
10633 (org-show-hierarchy-above)
10634 (error "Not all levels are odd in this file. Conversion not possible."))
10635 (when (yes-or-no-p "Are you sure you want to globally change levels to odd-even? ")
10636 (let ((org-odd-levels-only nil) n)
10637 (save-excursion
10638 (goto-char (point-min))
10639 (while (re-search-forward "^\\*\\*+" nil t)
10640 (setq n (/ (length (match-string 0)) 2))
10641 (while (>= (setq n (1- n)) 0)
10642 (org-promote))
10643 (end-of-line 1))))))
10644
10576(defun org-tr-level (n) 10645(defun org-tr-level (n)
10577 "Make N odd if required." 10646 "Make N odd if required."
10578 (if org-odd-levels-only (1+ (/ n 2)) n)) 10647 (if org-odd-levels-only (1+ (/ n 2)) n))
@@ -10817,7 +10886,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
10817#+CATEGORY: %s 10886#+CATEGORY: %s
10818#+SEQ_TODO: %s 10887#+SEQ_TODO: %s
10819#+TYP_TODO: %s 10888#+TYP_TODO: %s
10820#+STARTUP: %s %s 10889#+STARTUP: %s %s %s %s
10821#+ARCHIVE: %s 10890#+ARCHIVE: %s
10822" 10891"
10823 (buffer-name) (user-full-name) user-mail-address org-export-default-language 10892 (buffer-name) (user-full-name) user-mail-address org-export-default-language
@@ -10841,6 +10910,8 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
10841 (cdr (assoc org-startup-folded 10910 (cdr (assoc org-startup-folded
10842 '((nil . "nofold")(t . "fold")(content . "content")))) 10911 '((nil . "nofold")(t . "fold")(content . "content"))))
10843 (if org-startup-with-deadline-check "dlcheck" "nodlcheck") 10912 (if org-startup-with-deadline-check "dlcheck" "nodlcheck")
10913 (if org-odd-levels-only "odd" "oddeven")
10914 (if org-hide-leading-stars "hidestars" "showstars")
10844 org-archive-location 10915 org-archive-location
10845 )) 10916 ))
10846 10917
@@ -10924,6 +10995,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
10924 (setq-default org-deadline-line-regexp org-deadline-line-regexp) 10995 (setq-default org-deadline-line-regexp org-deadline-line-regexp)
10925 (setq-default org-done-string org-done-string) 10996 (setq-default org-done-string org-done-string)
10926 (let* ((style org-export-html-style) 10997 (let* ((style org-export-html-style)
10998 (odd org-odd-levels-only)
10927 (region-p (org-region-active-p)) 10999 (region-p (org-region-active-p))
10928 (region 11000 (region
10929 (buffer-substring 11001 (buffer-substring
@@ -10987,7 +11059,8 @@ headlines. The default is 3. Lower levels will become bulleted lists."
10987 (switch-to-buffer-other-window buffer)) 11059 (switch-to-buffer-other-window buffer))
10988 (erase-buffer) 11060 (erase-buffer)
10989 (fundamental-mode) 11061 (fundamental-mode)
10990 (let ((case-fold-search nil)) 11062 (let ((case-fold-search nil)
11063 (org-odd-levels-only odd))
10991 (if options (org-parse-export-options options)) 11064 (if options (org-parse-export-options options))
10992 (setq umax (if arg (prefix-numeric-value arg) 11065 (setq umax (if arg (prefix-numeric-value arg)
10993 org-export-headline-levels)) 11066 org-export-headline-levels))
@@ -12372,7 +12445,8 @@ See the individual commands for more information."
12372 "--" 12445 "--"
12373 ["Archive Subtree" org-archive-subtree t] 12446 ["Archive Subtree" org-archive-subtree t]
12374 "--" 12447 "--"
12375 ["Convert file to odd levels" org-convert-to-odd-levels t]) 12448 ["Convert to odd levels" org-convert-to-odd-levels t]
12449 ["Convert to odd/even levels" org-convert-to-oddeven-levels t])
12376 "--" 12450 "--"
12377 ("TODO Lists" 12451 ("TODO Lists"
12378 ["TODO/DONE/-" org-todo t] 12452 ["TODO/DONE/-" org-todo t]
@@ -12851,3 +12925,4 @@ Show the heading too, if it is currently invisible."
12851 12925
12852;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd 12926;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
12853;;; org.el ends here 12927;;; org.el ends here
12928
diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el
index b868369fc4a..5fcb2dc8bf1 100644
--- a/lisp/tree-widget.el
+++ b/lisp/tree-widget.el
@@ -140,10 +140,9 @@
140 data-directory))) 140 data-directory)))
141 (and dir (list dir (expand-file-name "images" dir)))) 141 (and dir (list dir (expand-file-name "images" dir))))
142 ) 142 )
143 "List of locations where to search for the themes sub-directory. 143 "List of locations in which to search for the themes sub-directory.
144Each element is an expression that will be evaluated to return a 144Each element is an expression that will be recursively evaluated until
145single directory or a list of directories to search. 145it returns a single directory or a list of directories.
146
147The default is to search in the `load-path' first, then in the 146The default is to search in the `load-path' first, then in the
148\"images\" sub directory in the data directory, then in the data 147\"images\" sub directory in the data directory, then in the data
149directory. 148directory.
@@ -152,22 +151,22 @@ Emacs, and what `(locate-data-directory \"tree-widget\")' returns on
152XEmacs.") 151XEmacs.")
153 152
154(defcustom tree-widget-themes-directory "tree-widget" 153(defcustom tree-widget-themes-directory "tree-widget"
155 "*Name of the directory where to look up for image themes. 154 "*Name of the directory in which to look for an image theme.
156When nil use the directory where the tree-widget library is located. 155When nil use the directory where the tree-widget library is located.
157When a relative name is specified, try to locate that sub directory in 156When it is a relative name, search in all occurrences of that sub
158the locations specified in `tree-widget-themes-load-path'. 157directory in the path specified by `tree-widget-themes-load-path'.
159The default is to use the \"tree-widget\" relative name." 158The default is to use the \"tree-widget\" relative name."
160 :type '(choice (const :tag "Default" "tree-widget") 159 :type '(choice (const :tag "Default" "tree-widget")
161 (const :tag "With the library" nil) 160 (const :tag "Where is this library" nil)
162 (directory :format "%{%t%}:\n%v")) 161 (directory :format "%{%t%}:\n%v"))
163 :group 'tree-widget) 162 :group 'tree-widget)
164 163
165(defcustom tree-widget-theme nil 164(defcustom tree-widget-theme nil
166 "*Name of the theme where to look up for images. 165 "*Name of the theme in which to look for images.
167It must be a sub directory of the directory specified in variable 166This is a sub directory of the themes directory specified by the
168`tree-widget-themes-directory'. The default theme is \"default\". 167`tree-widget-themes-directory' option.
169When an image is not found in a theme, it is searched in the default 168The default theme is \"default\". When an image is not found in a
170theme. 169theme, it is searched in its parent theme.
171 170
172A complete theme must at least contain images with these file names 171A complete theme must at least contain images with these file names
173with a supported extension (see also `tree-widget-image-formats'): 172with a supported extension (see also `tree-widget-image-formats'):
@@ -275,10 +274,15 @@ The default parent theme is the \"default\" theme."
275 (unless (member name (aref tree-widget--theme 0)) 274 (unless (member name (aref tree-widget--theme 0))
276 (aset tree-widget--theme 0 275 (aset tree-widget--theme 0
277 (append (aref tree-widget--theme 0) (list name))) 276 (append (aref tree-widget--theme 0) (list name)))
278 ;; Load the theme setup 277 ;; Load the theme setup from the first directory where the theme
279 (let ((default-directory (tree-widget-themes-directory))) 278 ;; is found.
280 (when default-directory 279 (catch 'found
281 (load (expand-file-name "tree-widget-theme-setup" name) t))))) 280 (dolist (dir (tree-widget-themes-path))
281 (setq dir (expand-file-name name dir))
282 (when (file-accessible-directory-p dir)
283 (throw 'found
284 (load (expand-file-name
285 "tree-widget-theme-setup" dir) t)))))))
282 286
283(defun tree-widget-set-theme (&optional name) 287(defun tree-widget-set-theme (&optional name)
284 "In the current buffer, set the theme to use for images. 288 "In the current buffer, set the theme to use for images.
@@ -304,54 +308,62 @@ Typically it should contain something like this:
304 (tree-widget-set-parent-theme name) 308 (tree-widget-set-parent-theme name)
305 (tree-widget-set-parent-theme "default"))) 309 (tree-widget-set-parent-theme "default")))
306 310
307(defun tree-widget--locate-sub-directory (name path) 311(defun tree-widget--locate-sub-directory (name path &optional found)
308 "Locate the sub-directory NAME in PATH. 312 "Locate all occurrences of the sub-directory NAME in PATH.
309Return the absolute name of the directory found, or nil if not found." 313Return a list of absolute directory names in reverse order, or nil if
310 (let (dir elt) 314not found."
311 (while (and (not dir) (consp path)) 315 (condition-case err
312 (setq elt (condition-case nil (eval (car path)) (error nil)) 316 (dolist (elt path)
313 path (cdr path)) 317 (setq elt (eval elt))
314 (cond 318 (cond
315 ((stringp elt) 319 ((stringp elt)
316 (setq dir (expand-file-name name elt)) 320 (and (file-accessible-directory-p
317 (or (file-accessible-directory-p dir) 321 (setq elt (expand-file-name name elt)))
318 (setq dir nil))) 322 (push elt found)))
319 ((and elt (not (equal elt (car path)))) 323 (elt
320 (setq dir (tree-widget--locate-sub-directory name elt))))) 324 (setq found (tree-widget--locate-sub-directory
321 dir)) 325 name (if (atom elt) (list elt) elt) found)))))
322 326 (error
323(defun tree-widget-themes-directory () 327 (message "In tree-widget--locate-sub-directory: %s"
324 "Locate the directory where to search for a theme. 328 (error-message-string err))))
325It is defined in variable `tree-widget-themes-directory'. 329 found)
326Return the absolute name of the directory found, or nil if the 330
327specified directory is not accessible." 331(defun tree-widget-themes-path ()
328 (let ((found (aref tree-widget--theme 1))) 332 "Return the path where to search for a theme.
333It is specified in variable `tree-widget-themes-directory'.
334Return a list of absolute directory names, or nil when no directory
335has been found accessible."
336 (let ((path (aref tree-widget--theme 1)))
329 (cond 337 (cond
330 ;; The directory was not found. 338 ;; No directory was found.
331 ((eq found 'void) 339 ((eq path 'void) nil)
332 (setq found nil)) 340 ;; The list of directories is available in the cache.
333 ;; The directory is available in the cache. 341 (path)
334 (found)
335 ;; Use the directory where this library is located. 342 ;; Use the directory where this library is located.
336 ((null tree-widget-themes-directory) 343 ((null tree-widget-themes-directory)
337 (setq found (locate-library "tree-widget")) 344 (when (setq path (locate-library "tree-widget"))
338 (when found 345 (setq path (file-name-directory path))
339 (setq found (file-name-directory found)) 346 (setq path (and (file-accessible-directory-p path)
340 (or (file-accessible-directory-p found) 347 (list path)))
341 (setq found nil)))) 348 ;; Store the result in the cache for later use.
349 (aset tree-widget--theme 1 (or path 'void))
350 path))
342 ;; Check accessibility of absolute directory name. 351 ;; Check accessibility of absolute directory name.
343 ((file-name-absolute-p tree-widget-themes-directory) 352 ((file-name-absolute-p tree-widget-themes-directory)
344 (setq found (expand-file-name tree-widget-themes-directory)) 353 (setq path (expand-file-name tree-widget-themes-directory))
345 (or (file-accessible-directory-p found) 354 (setq path (and (file-accessible-directory-p path)
346 (setq found nil))) 355 (list path)))
356 ;; Store the result in the cache for later use.
357 (aset tree-widget--theme 1 (or path 'void))
358 path)
347 ;; Locate a sub-directory in `tree-widget-themes-load-path'. 359 ;; Locate a sub-directory in `tree-widget-themes-load-path'.
348 (t 360 (t
349 (setq found (tree-widget--locate-sub-directory 361 (setq path (nreverse (tree-widget--locate-sub-directory
350 tree-widget-themes-directory 362 tree-widget-themes-directory
351 tree-widget-themes-load-path)))) 363 tree-widget-themes-load-path)))
352 ;; Store the result in the cache for later use. 364 ;; Store the result in the cache for later use.
353 (aset tree-widget--theme 1 (or found 'void)) 365 (aset tree-widget--theme 1 (or path 'void))
354 found)) 366 path))))
355 367
356(defconst tree-widget--cursors 368(defconst tree-widget--cursors
357 ;; Pointer shapes when the mouse pointer is over inactive 369 ;; Pointer shapes when the mouse pointer is over inactive
@@ -391,20 +403,19 @@ Search first in current theme, then in parent themes (see also the
391function `tree-widget-set-parent-theme'). 403function `tree-widget-set-parent-theme').
392Return the first image found having a supported format, or nil if not 404Return the first image found having a supported format, or nil if not
393found." 405found."
394 (let ((default-directory (tree-widget-themes-directory)) file) 406 (catch 'found
395 (when default-directory 407 (dolist (default-directory (tree-widget-themes-path))
396 (catch 'found 408 (dolist (dir (aref tree-widget--theme 0))
397 (dolist (dir (aref tree-widget--theme 0)) 409 (dolist (fmt (tree-widget-image-formats))
398 (dolist (fmt (tree-widget-image-formats)) 410 (dolist (ext (cdr fmt))
399 (dolist (ext (cdr fmt)) 411 (setq file (expand-file-name (concat name ext) dir))
400 (setq file (expand-file-name (concat name ext) dir)) 412 (and (file-readable-p file)
401 (and (file-readable-p file) 413 (file-regular-p file)
402 (file-regular-p file) 414 (throw 'found
403 (throw 'found 415 (tree-widget-create-image
404 (tree-widget-create-image 416 (car fmt) file
405 (car fmt) file 417 (tree-widget-image-properties name))))))))
406 (tree-widget-image-properties name))))))) 418 nil))
407 nil))))
408 419
409(defun tree-widget-find-image (name) 420(defun tree-widget-find-image (name)
410 "Find the image with NAME in current theme. 421 "Find the image with NAME in current theme.