summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog130
-rw-r--r--lisp/battery.el46
-rw-r--r--lisp/calendar/holidays.el9
-rw-r--r--lisp/cus-start.el7
-rw-r--r--lisp/eshell/eshell.el18
-rw-r--r--lisp/files.el38
-rw-r--r--lisp/ibuf-ext.el1
-rw-r--r--lisp/image.el22
-rw-r--r--lisp/info.el11
-rw-r--r--lisp/international/mule.el2
-rw-r--r--lisp/mail/rmail.el10
-rw-r--r--lisp/mail/rmailsum.el2
-rw-r--r--lisp/mh-e/ChangeLog12
-rw-r--r--lisp/mh-e/mh-compat.el27
-rw-r--r--lisp/mh-e/mh-utils.el2
-rw-r--r--lisp/net/rcirc.el28
-rw-r--r--lisp/progmodes/gdb-ui.el60
-rw-r--r--lisp/progmodes/octave-mod.el5
-rw-r--r--lisp/simple.el6
-rw-r--r--lisp/textmodes/flyspell.el5
-rw-r--r--lisp/textmodes/ispell.el18
-rw-r--r--lisp/textmodes/org.el311
-rw-r--r--lisp/tree-widget.el139
23 files changed, 597 insertions, 312 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bb70c0820a3..89a310bbeed 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,133 @@
+2006-03-13 Ryan Yeske <rcyeske@gmail.com>
+
+ * net/rcirc.el (rcirc) <defgroup>: Add link to manual.
+ (rcirc-print): Mark the start of text at the end of the prompt.
+ (rcirc-track-minor-mode): Add autoload cookie.
+ (rcirc-update-activity-string): Add space to front of mode-line
+ indicator.
+
+2006-03-13 Miles Bader <miles@gnu.org>
+
+ * net/rcirc.el (rcirc-nick-abbrevs): Variable removed.
+ (rcirc-abbrev-nick): Function removed.
+ (rcirc-format-response-string): Don't call `rcirc-abbrev-nick'.
+
+2006-03-13 David Ponce <david@dponce.com>
+
+ * tree-widget.el: Handle themes across all occurrences of the main
+ themes sub-directory found in tree-widget-themes-load-path.
+ (tree-widget-themes-directory, tree-widget-theme): Doc fix.
+ (tree-widget--locate-sub-directory): Return all occurrences.
+ (tree-widget-themes-path): New function. Replace
+ tree-widget-themes-directory, and return a list of directories.
+ (tree-widget-set-parent-theme)
+ (tree-widget-lookup-image): Use it.
+
+2006-03-13 Carsten Dominik <dominik@science.uva.nl>
+
+ * textmodes/org.el: (org-link-search): Avoid self-matching of
+ links, allow target text to be distributed over several lines.
+ (org-search-not-link): New function.
+ (org-set-regexps-and-options, org-get-current-options): New
+ startup options.
+ (org-export-as-html): Take odd-level setting from local variable.
+ (org-fontify-emphasized-text): New option.
+ (org-set-font-lock-defaults): Include emphasized text.
+ (org-follow-mhe-link): Allow folder-only links, fix folder name.
+ (org-font-lock): Customize group renamed from `org-faces'.
+
+2006-03-13 John Paul Wallington <jpw@pobox.com>
+
+ * ibuf-ext.el (ibuffer-never-show-predicates): Add `require'
+ keyword; require `ibuf-ext' feature. Thanks to Zhang Wei.
+
+2006-03-12 Luc Teirlinck <teirllm@auburn.edu>
+
+ * cus-start.el (all): Delete :version keyword for members of the
+ fringe group, since the entire group is new in 22.1.
+
+2006-03-13 Nick Roberts <nickrob@snap.net.nz>
+
+ * progmodes/gdb-ui.el (gdb-stack-list-locals-handler): Add local
+ map if value is hexadecimal (an address).
+ (gud-watch): Only search roots for existing watch expressions.
+ (gdb-speedbar-refresh): Bind speedbar-shown-directories to nil to
+ prevent caching problems with speedbar-update-directory-contents.
+
+2006-03-12 Juri Linkov <juri@jurta.org>
+
+ * battery.el (battery-linux-proc-acpi): Check `capacity' for non-nil
+ before comparing with `low' and `warn'.
+
+ * info.el (Info-dir-remove-duplicates): Move point to the
+ beginning of the current line after deleting the entries from
+ redundant heading. Use marker for `limit' and compare it with
+ point before calling `re-search-forward'.
+
+2006-03-11 Luc Teirlinck <teirllm@auburn.edu>
+
+ * simple.el (yank): Fix typo in docstring.
+
+2006-03-11 Ryan Yeske <rcyeske@gmail.com>
+
+ * mail/rmailsum.el (rmail-summary-next-msg): Skip deleted
+ messages, where "D" is the 6th character.
+
+2006-03-11 Eli Zaretskii <eliz@gnu.org>
+
+ * simple.el (yank): Fix last change.
+
+2006-03-11 David Ponce <david@dponce.com>
+
+ * ispell.el (ispell-find-aspell-dictionaries): Add aliases before
+ merging elements from the standard ispell-dictionary-alist.
+ (ispell-aspell-add-aliases): Add aliases to the passed dictionary
+ alist, and return the new alist.
+
+2006-03-11 Richard Stallman <rms@gnu.org>
+
+ * mail/rmail.el (rmail-ignored-headers): Discard DomainKey-Signature.
+
+ * eshell/eshell.el (eshell-prefer-to-shell): Variable deleted;
+ the way it is implemented is too unclean.
+
+ * simple.el (kill-region, yank): Doc fix.
+
+ * battery.el (battery-echo-area-format): Doc fix.
+ (battery-mode-line-format): Likewise.
+ (battery-linux-proc-apm, battery-linux-proc-acpi): Likewise.
+ (battery-linux-proc-acpi): Ignore batteries that say "charged".
+
+2006-03-11 Kurt Hornik <Kurt.Hornik@wu-wien.ac.at>
+
+ * progmodes/octave-mod.el (octave-indent-for-comment): Behave
+ according to do string.
+
+2006-03-11 Agustin Martin <agustin.martin@hispalinux.es>
+
+ * textmodes/ispell.el (ispell-menu-map-needed) [ispell-message]:
+ Be visible only if major mode is Mail Mode.
+
+ * textmodes/flyspell.el (flyspell-external-point-words)
+ (flyspell-process-localwords): Fix last changes.
+
+2006-03-11 Eli Zaretskii <eliz@gnu.org>
+
+ * calendar/holidays.el (list-holidays): Doc fix.
+
+ * international/mule.el (auto-coding-alist): Add .odt
+ (OpenOffice's open document) files.
+
+ * files.el (auto-mode-alist): Add .odt (OpenOffice's open
+ document) files. Mention in the doc string the need to sync with
+ auto-coding-alist.
+
+2006-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * files.el (hack-local-variables-confirm): Don't prompt for ! if
+ enable-local-variables is set to always query, or there is no
+ savable variable.
+
2006-03-10 Bill Wohler <wohler@newt.com>
* image.el (image-load-path-for-library): Merge at least three
diff --git a/lisp/battery.el b/lisp/battery.el
index fa816c585b4..34f74aa9932 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -77,7 +77,18 @@ introduced by a `%' character in a control string."
Ordinary characters in the control string are printed as-is, while
conversion specifications introduced by a `%' character in the control
string are substituted as defined by the current value of the variable
-`battery-status-function'."
+`battery-status-function'. Here are the ones generally available:
+%c Current capacity (mAh or mWh)
+%r Current rate of charge or discharge
+%B Battery status (verbose)
+%b Battery status: empty means high, `-' means low,
+ `!' means critical, and `+' means charging
+%d Temperature (in degrees Celsius)
+%L AC line status (verbose)
+%p Battery load percentage
+%m Remaining time (to charge or discharge) in minutes
+%h Remaining time (to charge or discharge) in hours
+%t Remaining time (to charge or discharge) in the form `h:min'"
:type '(choice string (const nil))
:group 'battery)
@@ -96,7 +107,18 @@ string are substituted as defined by the current value of the variable
Ordinary characters in the control string are printed as-is, while
conversion specifications introduced by a `%' character in the control
string are substituted as defined by the current value of the variable
-`battery-status-function'."
+`battery-status-function'. Here are the ones generally available:
+%c Current capacity (mAh or mWh)
+%r Current rate of charge or discharge
+%B Battery status (verbose)
+%b Battery status: empty means high, `-' means low,
+ `!' means critical, and `+' means charging
+%d Temperature (in degrees Celsius)
+%L AC line status (verbose)
+%p Battery load percentage
+%m Remaining time (to charge or discharge) in minutes
+%h Remaining time (to charge or discharge) in hours
+%t Remaining time (to charge or discharge) in the form `h:min'"
:type '(choice string (const nil))
:group 'battery)
@@ -196,10 +218,10 @@ The following %-sequences are provided:
%b Battery status, empty means high, `-' means low,
`!' means critical, and `+' means charging
%p Battery load percentage
-%s Remaining time in seconds
-%m Remaining time in minutes
-%h Remaining time in hours
-%t Remaining time in the form `h:min'"
+%s Remaining time (to charge or discharge) in seconds
+%m Remaining time (to charge or discharge) in minutes
+%h Remaining time (to charge or discharge) in hours
+%t Remaining time (to charge or discharge) in the form `h:min'"
(let (driver-version bios-version bios-interface line-status
battery-status battery-status-symbol load-percentage
seconds minutes hours remaining-time tem)
@@ -267,9 +289,9 @@ The following %-sequences are provided:
%d Temperature (in degrees Celsius)
%L AC line status (verbose)
%p Battery load percentage
-%m Remaining time in minutes
-%h Remaining time in hours
-%t Remaining time in the form `h:min'"
+%m Remaining time (to charge or discharge) in minutes
+%h Remaining time (to charge or discharge) in hours
+%t Remaining time (to charge or discharge) in the form `h:min'"
(let ((design-capacity 0)
(last-full-capacity 0)
full-capacity
@@ -287,7 +309,7 @@ The following %-sequences are provided:
(ignore-errors (insert-file-contents (expand-file-name "state" dir)))
(when (re-search-forward "present: +yes$" nil t)
(and (re-search-forward "charging state: +\\(.*\\)$" nil t)
- (member charging-state '("unknown" nil))
+ (member charging-state '("unknown" "charged" nil))
;; On most multi-battery systems, most of the time only one
;; battery is "charging"/"discharging", the others are
;; "unknown".
@@ -369,8 +391,8 @@ The following %-sequences are provided:
rate-type)) "N/A"))
(cons ?B (or charging-state "N/A"))
(cons ?b (or (and (string= charging-state "charging") "+")
- (and (< capacity low) "!")
- (and (< capacity warn) "-")
+ (and capacity (< capacity low) "!")
+ (and capacity (< capacity warn) "-")
""))
(cons ?h (or (and hours (number-to-string hours)) "N/A"))
(cons ?m (or (and minutes (number-to-string minutes)) "N/A"))
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el
index 1aaf226d21d..5a29bf8fff1 100644
--- a/lisp/calendar/holidays.el
+++ b/lisp/calendar/holidays.el
@@ -120,6 +120,15 @@ This function is suitable for execution in a .emacs file."
"Display holidays for years Y1 to Y2 (inclusive).
The optional list of holidays L defaults to `calendar-holidays'.
+If you want to control what holidays are displayed, use a
+different list. For example,
+
+ (list-holidays 2006 2006
+ (append general-holidays local-holidays other-holidays))
+
+will display holidays for the year 2006 defined in the 3
+mentioned lists, and nothing else.
+
When called interactively, this command offers a choice of
holidays, based on the variables `solar-holidays' etc. See the
documentation of `calendar-holidays' for a list of the variables
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 24c19fcb36e..d6af9e999f5 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -52,7 +52,7 @@
(ctl-arrow display boolean)
(truncate-lines display boolean)
(selective-display-ellipses display boolean)
- (indicate-empty-lines fringe boolean "21.1")
+ (indicate-empty-lines fringe boolean)
(indicate-buffer-boundaries
fringe
(choice
@@ -91,8 +91,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
(const :tag "Do not show" (down . nil))
(const :tag "On the left" (down . left))
(const :tag "On the right" (down . right))))
- (other :tag "On left, no arrows" t))
- "22.1")
+ (other :tag "On left, no arrows" t)))
(scroll-up-aggressively windows
(choice (const :tag "off" nil) number)
"21.1")
@@ -177,7 +176,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
(const :tag "always shown" t)
(other :tag "hidden by keypress" 1)))
;; fringe.c
- (overflow-newline-into-fringe fringe boolean "22.1")
+ (overflow-newline-into-fringe fringe boolean)
;; indent.c
(indent-tabs-mode fill boolean)
;; keyboard.c
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index ed9e3e56c9e..cfc2f05b931 100644
--- a/lisp/eshell/eshell.el
+++ b/lisp/eshell/eshell.el
@@ -323,24 +323,6 @@ the tasks accomplished by such tools."
(= (file-modes eshell-directory-name)
eshell-private-directory-modes)))
-(defcustom eshell-prefer-to-shell nil
- "*If non-nil, \\[shell-command] will use Eshell instead of shell-mode."
- :set (lambda (symbol value)
- ;; modifying the global keymap directly is odious, but how
- ;; else to achieve the takeover?
- (if value
- (progn
- (define-key global-map [(meta ?!)] 'eshell-command)
-;;; (define-key global-map [(meta ?|)] 'eshell-command-on-region)
- )
- (define-key global-map [(meta ?!)] 'shell-command)
-;;; (define-key global-map [(meta ?|)] 'shell-command-on-region)
- )
- (set symbol value))
- :type 'boolean
- :require 'eshell
- :group 'eshell)
-
;;;_* Running Eshell
;;
;; There are only three commands used to invoke Eshell. The first two
diff --git a/lisp/files.el b/lisp/files.el
index fc6267fd002..c093a5222b2 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1872,7 +1872,7 @@ in that case, this function acts as if `enable-local-variables' were t."
;; `auto-coding-alist' with `no-conversion' coding system.
("\\.\\(arc\\|zip\\|lzh\\|zoo\\|[jew]ar\\|xpi\\)\\'" . archive-mode)
("\\.\\(ARC\\|ZIP\\|LZH\\|ZOO\\|[JEW]AR\\|XPI\\)\\'" . archive-mode)
- ("\\.sx[dmicw]\\'" . archive-mode) ; OpenOffice.org
+ ("\\.\\(sx[dmicw]\\|odt\\)\\'" . archive-mode) ; OpenOffice.org
;; Mailer puts message to be edited in
;; /tmp/Re.... or Message
("\\`/tmp/Re" . text-mode)
@@ -1955,6 +1955,9 @@ REGEXP and search the list again for another match.
If the file name matches `inhibit-first-line-modes-regexps',
then `auto-mode-alist' is not processed.
+The extensions whose FUNCTION is `archive-mode' should also
+appear in `auto-coding-alist' with `no-conversion' coding system.
+
See also `interpreter-mode-alist', which detects executable script modes
based on the interpreters they specify to run,
and `magic-mode-alist', which determines modes based on file contents.")
@@ -2349,6 +2352,7 @@ asking you for confirmation."
(let ((name (if buffer-file-name
(file-name-nondirectory buffer-file-name)
(concat "buffer " (buffer-name))))
+ (offer-save (and (eq enable-local-variables t) unsafe-vars))
prompt char)
(save-window-excursion
(let ((buf (get-buffer-create "*Local Variables*")))
@@ -2367,9 +2371,12 @@ asking you for confirmation."
(insert "A local variables list is specified in " name ".")))
(insert "\n\nDo you want to apply it? You can type
y -- to apply the local variables list.
-n -- to ignore the local variables list.
+n -- to ignore the local variables list.")
+ (if offer-save
+ (insert "
! -- to apply the local variables list, and mark these values (*) as
safe (in the future, they can be set automatically.)\n\n")
+ (insert "\n\n"))
(dolist (elt vars)
(cond ((member elt unsafe-vars)
(insert " * "))
@@ -2381,12 +2388,17 @@ n -- to ignore the local variables list.
(insert " : ")
(princ (cdr elt) buf)
(insert "\n"))
- (if (< (line-number-at-pos) (window-body-height))
- (setq prompt "Please type y, n, or !: ")
- (goto-char (point-min))
- (setq prompt "Please type y, n, or !, or C-v to scroll: "))
+ (setq prompt
+ (format "Please type %s%s: "
+ (if offer-save "y, n, or !" "y or n")
+ (if (< (line-number-at-pos) (window-body-height))
+ ""
+ ", or C-v to scroll")))
+ (goto-char (point-min))
(let ((inhibit-quit t)
(cursor-in-echo-area t)
+ (exit-chars
+ (if offer-save '(?! ?y ?n ?\s ?\C-g) '(?y ?n ?\s ?\C-g)))
done)
(while (not done)
(message prompt)
@@ -2396,21 +2408,21 @@ n -- to ignore the local variables list.
(condition-case nil
(scroll-up)
(error (goto-char (point-min))))
- (setq done (memq (downcase char)
- '(?! ?y ?n ?\s ?\C-g))))))
+ (setq done (memq (downcase char) exit-chars)))))
(if (= char ?\C-g)
(setq quit-flag nil)))
(setq char (downcase char))
- (when (and (= char ?!) unsafe-vars)
+ (when (and offer-save (= char ?!) unsafe-vars)
(dolist (elt unsafe-vars)
(add-to-list 'safe-local-variable-values elt))
;; When this is called from desktop-restore-file-buffer,
;; coding-system-for-read may be non-nil. Reset it before
;; writing to .emacs.
- (let ((coding-system-for-read nil))
- (customize-save-variable
- 'safe-local-variable-values
- safe-local-variable-values)))
+ (if (or custom-file user-init-file)
+ (let ((coding-system-for-read nil))
+ (customize-save-variable
+ 'safe-local-variable-values
+ safe-local-variable-values))))
(kill-buffer buf)
(or (= char ?!)
(= char ?\s)
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.
If a function, it will be called with the buffer as an argument, and
should return non-nil if this buffer should not be shown."
:type '(repeat (choice regexp function))
+ :require 'ibuf-ext
:group 'ibuffer)
(defcustom ibuffer-always-show-predicates nil
diff --git a/lisp/image.el b/lisp/image.el
index 4acff8d251b..2d7aea6fa0c 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -77,7 +77,7 @@ value is used as a list of directories to search.")
(list (file-name-as-directory (expand-file-name "images" data-directory))
'data-directory 'load-path)))
-(defun image-load-path-for-library (library image &optional path)
+(defun image-load-path-for-library (library image &optional path no-error)
"Return a suitable search path for images relative to LIBRARY.
Images for LIBRARY are searched for in \"../../etc/images\" and
@@ -85,8 +85,12 @@ Images for LIBRARY are searched for in \"../../etc/images\" and
well as in `image-load-path' and `load-path'.
This function returns the value of `load-path' augmented with the
-path to IMAGE. If PATH is given, it is used instead of
-`load-path'.
+directory containing IMAGE. If PATH is given, it is used instead
+of `load-path'. If PATH is t, just return the directory that
+contains IMAGE.
+
+If NO-ERROR is non-nil, return nil if a suitable path can't be
+found rather than signaling an error.
Here is an example that uses a common idiom to provide
compatibility with versions of Emacs that lack the variable
@@ -137,11 +141,19 @@ compatibility with versions of Emacs that lack the variable
(setq img (directory-file-name parent)
dir (expand-file-name "../" dir)))
(setq image-directory dir)))))
+ (no-error
+ ;; In this case we will return nil.
+ (message "Could not find image %s for library %s" image library))
(t
(error "Could not find image %s for library %s" image library)))
- ;; Return augmented `image-load-path' or `load-path'.
- (cond ((and path (symbolp path))
+ ;; Return the directory, nil if no-error was non-nil and a
+ ;; suitable path could not be found, or an augmented
+ ;; `image-load-path' or `load-path'.
+ (cond ((or (null image-directory)
+ (eq path t))
+ image-directory)
+ ((and path (symbolp path))
(nconc (list image-directory)
(delete image-directory
(if (boundp path)
diff --git a/lisp/info.el b/lisp/info.el
index 43ee5cabcbc..a4cae949977 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1196,7 +1196,9 @@ a case-insensitive match is tried."
(point)
(if (re-search-forward "^[^* \n\t]" nil t)
(match-beginning 0)
- (or limit (point-max)))) entries))))
+ (or limit (point-max))))
+ entries)
+ (forward-line 0))))
;; Insert the entries just found.
(while (= (line-beginning-position 0) (1- (point)))
(backward-char))
@@ -1207,10 +1209,11 @@ a case-insensitive match is tried."
;; Now remove duplicate entries under the same heading.
(let ((seen nil)
- (limit (point)))
+ (limit (point-marker)))
(goto-char start)
- (while (re-search-forward "^* \\([^:\n]+:\\(:\\|[^.\n]+\\).\\)"
- limit 'move)
+ (while (and (> limit (point))
+ (re-search-forward "^* \\([^:\n]+:\\(:\\|[^.\n]+\\).\\)"
+ limit 'move))
;; Fold case straight away; `member-ignore-case' here wasteful.
(let ((x (downcase (match-string 1))))
(if (member x seen)
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index fcdbd9625ac..b57ad02842d 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1562,7 +1562,7 @@ text, and convert it in the temporary buffer. Otherwise, convert in-place."
(defcustom auto-coding-alist
'(("\\.\\(arc\\|zip\\|lzh\\|zoo\\|[jew]ar\\|xpi\\)\\'" . no-conversion)
("\\.\\(ARC\\|ZIP\\|LZH\\|ZOO\\|[JEW]AR\\|XPI\\)\\'" . no-conversion)
- ("\\.\\(sx[dmicw]\\|tar\\|tgz\\)\\'" . no-conversion)
+ ("\\.\\(sx[dmicw]\\|odt\\|tar\\|tgz\\)\\'" . no-conversion)
("\\.\\(gz\\|Z\\|bz\\|bz2\\|gpg\\)\\'" . no-conversion)
("\\.\\(jpe?g\\|png\\|gif\\|tiff?\\|p[bpgn]m\\)\\'" . no-conversion)
("/#[^/]+#\\'" . emacs-mule))
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 9cf7bccdb35..148d725ecfd 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -268,7 +268,7 @@ It is useful to set this variable in the site customization file.")
"\\|^list-id:\\|^list-unsubscribe:\\|^list-archive:"
"\\|^content-length:\\|^nntp-posting-date:\\|^user-agent"
"\\|^importance:\\|^envelope-to:\\|^delivery-date\\|^openpgp:"
- "\\|^mbox-line:\\|^cancel-lock:"
+ "\\|^mbox-line:\\|^cancel-lock:\\|^DomainKey-Signature:"
"\\|^resent-face:\\|^resent-x.*:\\|^resent-organization:\\|^resent-openpgp:"
"\\|^x-.*:")
@@ -319,8 +319,14 @@ See also `rmail-highlight-face'."
:type 'regexp
:group 'rmail-headers)
+(defface rmail-highlight
+ '((t :default highlight))
+ "Face to use for highlighting the most important header fields."
+ :group 'rmail-headers
+ :version "22.1")
+
;;;###autoload
-(defcustom rmail-highlight-face nil "\
+(defcustom rmail-highlight-face 'rmail-highlight "\
*Face used by Rmail for highlighting headers."
:type '(choice (const :tag "Default" nil)
face)
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 539a1769386..c029e6e2268 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -535,7 +535,7 @@ messages, or backward if NUMBER is negative."
(search (if (> number 0) 're-search-forward 're-search-backward))
(non-del-msg-found nil))
(while (and (> count 0) (setq non-del-msg-found
- (or (funcall search "^....[^D]" nil t)
+ (or (funcall search "^.....[^D]" nil t)
non-del-msg-found)))
(setq count (1- count))))
(beginning-of-line)
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 35a1b1495f1..eda95da386c 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,5 +1,17 @@
+2006-03-12 Bill Wohler <wohler@newt.com>
+
+ * mh-utils.el (mh-folder-list): Fix docstring (closes SF
+ #1448498).
+
2006-03-10 Bill Wohler <wohler@newt.com>
+ * mh-compat.el (mh-replace-regexp-in-string): Pass the literal
+ flag to replace-in-string. This was badly needed by
+ mh-quote-pick-expr in order to properly quote subjects when using
+ / s on XEmacs (closes SF #1447598).
+ (mh-image-load-path-for-library): Merged changes from Reiner. Add
+ no-error argument. If path t, just return directory.
+
* mh-e.el (mh-profile-component): Drop `s' from mhparam
-components for Mailutils compatibility (closes SF #1446985).
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 77e39de35f5..d6bded8726e 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -116,7 +116,7 @@ introduced in Emacs 22."
`(face-background ,face ,frame ,inherit)))
(mh-defun-compat mh-image-load-path-for-library
- image-load-path-for-library (library image &optional path)
+ image-load-path-for-library (library image &optional path no-error)
"Return a suitable search path for images relative to LIBRARY.
Images for LIBRARY are searched for in \"../../etc/images\" and
@@ -124,8 +124,12 @@ Images for LIBRARY are searched for in \"../../etc/images\" and
well as in `image-load-path' and `load-path'.
This function returns the value of `load-path' augmented with the
-path to IMAGE. If PATH is given, it is used instead of
-`load-path'.
+directory containing IMAGE. If PATH is given, it is used instead
+of `load-path'. If PATH is t, just return the directory that
+contains IMAGE.
+
+If NO-ERROR is non-nil, return nil if a suitable path can't be
+found rather than signaling an error.
Here is an example that uses a common idiom to provide
compatibility with versions of Emacs that lack the variable
@@ -179,11 +183,19 @@ This function is used by Emacs versions that don't have
(setq img (directory-file-name parent)
dir (expand-file-name "../" dir)))
(setq image-directory dir)))))
+ (no-error
+ ;; In this case we will return nil.
+ (message "Could not find image %s for library %s" image library))
(t
(error "Could not find image %s for library %s" image library)))
- ;; Return augmented `image-load-path' or `load-path'.
- (cond ((and path (symbolp path))
+ ;; Return the directory, nil if no-error was non-nil and a
+ ;; suitable path could not be found, or an augmented
+ ;; `image-load-path' or `load-path'.
+ (cond ((or (null image-directory)
+ (eq path t))
+ image-directory)
+ ((and path (symbolp path))
(nconc (list image-directory)
(delete image-directory
(if (boundp path)
@@ -232,8 +244,9 @@ The argument STRING is ignored."
"Replace REGEXP with REP everywhere in STRING and return result.
This function is used by XEmacs that lacks `replace-regexp-in-string'.
The function `replace-in-string' is used instead.
-The arguments FIXEDCASE, LITERAL, SUBEXP, and START are ignored."
- (replace-in-string string regexp rep))
+The arguments FIXEDCASE, SUBEXP, and START, used by
+`replace-in-string' are ignored."
+ (replace-in-string string regexp rep literal))
;; Copy of constant from url-util.el in Emacs 22; needed by Emacs 21.
(if (not (boundp 'url-unreserved-chars))
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index c45c214e9f0..15f71f4ee73 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -504,7 +504,7 @@ example, if your Mail directory only contains the folders +inbox,
(mh-folder-list nil)
=> (\"inbox\" \"lists\" \"lists/mh-e\" \"outbox\")
(mh-folder-list \"+lists\")
- => (\"lists/mh-e\")
+ => (\"lists\" \"lists/mh-e\")
Respects the value of `mh-recursive-folders-flag'. If this flag
is 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 @@
"Simple IRC client."
:version "22.1"
:prefix "rcirc-"
+ :link '(custom-manual "(rcirc)")
:group 'applications)
(defcustom rcirc-server "irc.freenode.net"
@@ -195,12 +196,6 @@ Use /ignore to list them, use /ignore NICK to add or remove a nick."
:type '(repeat string)
:group 'rcirc)
-(defcustom rcirc-nick-abbrevs nil
- "List of short replacements for printing nicks."
- :type '(alist :key-type (string :tag "Nick")
- :value-type (string :tag "Abbrev"))
- :group 'rcirc)
-
(defvar rcirc-ignore-list-automatic ()
"List of ignored nicks added to `rcirc-ignore-list' because of renaming.
When 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.")
(with-rcirc-process-buffer process
rcirc-nick))
-(defun rcirc-abbrev-nick (nick)
- "If NICK has an entry in `rcirc-nick-abbrevs', return its abbreviation,
-otherwise return NICK."
- (or (cdr (assoc nick rcirc-nick-abbrevs)) nick))
-
(defvar rcirc-max-message-length 450
"Messages longer than this value will be split.")
@@ -883,7 +873,7 @@ Create the buffer if it doesn't exist."
(defun rcirc-multiline-edit-submit ()
"Send the text in buffer back to parent buffer."
(interactive)
- (assert (and (eq major-mode 'rcirc-multiline-edit-mode)))
+ (assert (eq major-mode 'rcirc-multiline-edit-mode))
(assert rcirc-parent-buffer)
(untabify (point-min) (point-max))
(let ((text (buffer-substring (point-min) (point-max)))
@@ -899,7 +889,7 @@ Create the buffer if it doesn't exist."
(defun rcirc-multiline-edit-cancel ()
"Cancel the multiline edit."
(interactive)
- (assert (and (eq major-mode 'rcirc-multiline-edit-mode)))
+ (assert (eq major-mode 'rcirc-multiline-edit-mode))
(kill-buffer (current-buffer))
(set-window-configuration rcirc-window-configuration))
@@ -975,7 +965,7 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
process rcirc-server)
sender)
""
- (rcirc-abbrev-nick sender))
+ sender)
(and target (concat "," target)))))
(rcirc-facify nick
(if (eq key ?n)
@@ -1088,7 +1078,7 @@ record activity."
(set-marker text-start
(or (next-single-property-change fill-start
'rcirc-text)
- (point-max)))
+ rcirc-prompt-end-marker))
;; squeeze spaces out of text before rcirc-text
(fill-region fill-start (1- text-start))
@@ -1253,9 +1243,7 @@ if NICK is also on `rcirc-ignore-list-automatic'."
(define-key rcirc-track-minor-mode-map (kbd "C-c C-@") 'rcirc-next-active-buffer)
(define-key rcirc-track-minor-mode-map (kbd "C-c C-SPC") 'rcirc-next-active-buffer)
-;;; FIXME: the code to insert `rcirc-activity-string' into
-;;; `global-mode-string' isn't called when the mode is activated by
-;;; customize. I don't know how to set that up.
+;;;###autoload
(define-minor-mode rcirc-track-minor-mode
"Global minor mode for tracking activity in rcirc buffers."
:init-value nil
@@ -1357,7 +1345,7 @@ activity. Only run if the buffer is not visible and
(setq rcirc-activity-string
(if (not rcirc-activity)
""
- (concat " ["
+ (concat "-["
(mapconcat
(lambda (b)
(let ((s (rcirc-short-buffer-name b)))
@@ -1366,7 +1354,7 @@ activity. Only run if the buffer is not visible and
s
(rcirc-facify s 'rcirc-mode-line-nick)))))
rcirc-activity ",")
- "]"))))
+ "]-"))))
(defun rcirc-short-buffer-name (buffer)
"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..abd6add911d 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -301,12 +301,38 @@ Also display the main routine in the disassembly buffer if present."
:group 'gud
:version "22.1")
+(defcustom gdb-many-windows nil
+ "Nil means just pop up the GUD buffer unless `gdb-show-main' is t.
+In this case it starts with two windows: one displaying the GUD
+buffer and the other with the source file with the main routine
+of the inferior. Non-nil means display the layout shown for
+`gdba'."
+ :type 'boolean
+ :group 'gud
+ :version "22.1")
+
(defcustom gdb-use-separate-io-buffer nil
"Non-nil means display output from the inferior in a separate buffer."
:type 'boolean
:group 'gud
:version "22.1")
+(defun gdb-many-windows (arg)
+ "Toggle the number of windows in the basic arrangement.
+With arg, display additional buffers iff arg is positive."
+ (interactive "P")
+ (setq gdb-many-windows
+ (if (null arg)
+ (not gdb-many-windows)
+ (> (prefix-numeric-value arg) 0)))
+ (message (format "Display of other windows %sabled"
+ (if gdb-many-windows "en" "dis")))
+ (if (and gud-comint-buffer
+ (buffer-name gud-comint-buffer))
+ (condition-case nil
+ (gdb-restore-windows)
+ (error nil))))
+
(defun gdb-use-separate-io-buffer (arg)
"Toggle separate IO for inferior.
With arg, use separate IO iff arg is positive."
@@ -631,7 +657,8 @@ With arg, automatically raise speedbar iff arg is positive."
(let ((expr (tooltip-identifier-from-point (point))))
(catch 'already-watched
(dolist (var gdb-var-list)
- (if (string-equal expr (car var)) (throw 'already-watched nil)))
+ (unless (string-match "\\." (nth 1 var))
+ (if (string-equal expr (car var)) (throw 'already-watched nil))))
(set-text-properties 0 (length expr) nil expr)
(gdb-enqueue-input
(list
@@ -757,7 +784,8 @@ type=\"\\(.*?\\)\"")
(setq gdb-pending-triggers
(delq 'gdb-speedbar-refresh gdb-pending-triggers))
(with-current-buffer gud-comint-buffer
- (let ((speedbar-verbosity-level 0))
+ (let ((speedbar-verbosity-level 0)
+ (speedbar-shown-directories nil))
(save-excursion
(speedbar-refresh)))))
@@ -2671,32 +2699,6 @@ corresponding to the mode line clicked."
(gdb-set-window-buffer (gdb-breakpoints-buffer-name))
(other-window 1))
-(defcustom gdb-many-windows nil
- "Nil means just pop up the GUD buffer unless `gdb-show-main' is t.
-In this case it starts with two windows: one displaying the GUD
-buffer and the other with the source file with the main routine
-of the inferior. Non-nil means display the layout shown for
-`gdba'."
- :type 'boolean
- :group 'gud
- :version "22.1")
-
-(defun gdb-many-windows (arg)
- "Toggle the number of windows in the basic arrangement.
-With arg, display additional buffers iff arg is positive."
- (interactive "P")
- (setq gdb-many-windows
- (if (null arg)
- (not gdb-many-windows)
- (> (prefix-numeric-value arg) 0)))
- (message (format "Display of other windows %sabled"
- (if gdb-many-windows "en" "dis")))
- (if (and gud-comint-buffer
- (buffer-name gud-comint-buffer))
- (condition-case nil
- (gdb-restore-windows)
- (error nil))))
-
(defun gdb-restore-windows ()
"Restore the basic arrangement of windows used by gdba.
This arrangement depends on the value of `gdb-many-windows'."
@@ -3309,7 +3311,7 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}")
(dolist (local locals-list)
(setq name (car local))
(if (or (not (nth 2 local))
- (string-match "\\*$" (nth 1 local)))
+ (string-match "\\0x" (nth 2 local)))
(add-text-properties 0 (length name)
`(mouse-face highlight
help-echo "mouse-2: create watch expression"
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el
index 5f52e6f4d3c..57941db9691 100644
--- a/lisp/progmodes/octave-mod.el
+++ b/lisp/progmodes/octave-mod.el
@@ -732,7 +732,10 @@ If there is no comment already on this line, create a code-level comment
comment (started by one comment character) otherwise.
Point is left after the start of the comment which is properly aligned."
(interactive)
- (indent-for-comment)
+ (beginning-of-line)
+ (if (looking-at "^\\s-*$")
+ (insert octave-block-comment-start)
+ (indent-for-comment))
(indent-according-to-mode))
(defun octave-indent-line (&optional arg)
diff --git a/lisp/simple.el b/lisp/simple.el
index 40d00091a92..d3780dea012 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2506,8 +2506,8 @@ yanking point; just return the Nth kill forward."
(put 'text-read-only 'error-message "Text is read-only")
(defun kill-region (beg end &optional yank-handler)
- "Kill between point and mark.
-The text is deleted but saved in the kill ring.
+ "Kill (\"cut\") text between point and mark.
+This deletes the text from the buffer and saves it in the kill ring.
The command \\[yank] can retrieve it from there.
\(If you want to kill and then yank immediately, use \\[kill-ring-save].)
@@ -2690,7 +2690,7 @@ doc string for `insert-for-yank-1', which see."
nil)
(defun yank (&optional arg)
- "Reinsert the last stretch of killed text.
+ "Reinsert (\"paste\") the last stretch of killed text.
More precisely, reinsert the stretch of killed text most recently
killed OR yanked. Put point at end, and set mark at beginning.
With just \\[universal-argument] as argument, same but put point at beginning (and mark at end).
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 96862b9c671..54b67a258a6 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1323,7 +1323,7 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
(let (words-not-found
(ispell-otherchars (ispell-get-otherchars))
(buffer-scan-pos flyspell-large-region-beg)
- (case-fold-search nil))
+ case-fold-search)
(with-current-buffer flyspell-external-ispell-buffer
(goto-char (point-min))
;; Loop over incorrect words, in the order they were reported,
@@ -1409,8 +1409,7 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
;;* declared correct. */
;;*---------------------------------------------------------------------*/
(defun flyspell-process-localwords (misspellings-buffer)
- (let (localwords
- (case-fold-search nil)
+ (let (localwords case-fold-search
(ispell-casechars (ispell-get-casechars)))
;; Get localwords from the original buffer
(save-excursion
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index d6fdbffad74..4b14f160592 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -899,14 +899,15 @@ and added as a submenu of the \"Edit\" menu.")
(found
(delq nil
(mapcar #'ispell-aspell-find-dictionary dictionaries))))
+ ;; Ensure aspell's alias dictionary will override standard
+ ;; definitions.
+ (setq found (ispell-aspell-add-aliases found))
;; Merge into FOUND any elements from the standard ispell-dictionary-alist
;; which have no element in FOUND at all.
(dolist (dict ispell-dictionary-alist)
(unless (assoc (car dict) found)
(setq found (nconc found (list dict)))))
(setq ispell-dictionary-alist found)
-
- (ispell-aspell-add-aliases)
;; Add a default entry
(let* ((english-dict (assoc "en" ispell-dictionary-alist))
(default-dict
@@ -973,8 +974,9 @@ Assumes that value contains no whitespace."
(file-error
nil))))
-(defun ispell-aspell-add-aliases ()
- "Find aspell's dictionary aliases and add them to `ispell-dictionary-alist'."
+(defun ispell-aspell-add-aliases (alist)
+ "Find aspell's dictionary aliases and add them to dictionary ALIST.
+Return the new dictionary alist."
(let ((aliases (file-expand-wildcards
(concat (or ispell-aspell-dict-dir
(setq ispell-aspell-dict-dir
@@ -987,11 +989,12 @@ Assumes that value contains no whitespace."
(when (search-forward-regexp "^add \\([^.]+\\)\\.multi" nil t)
(let* ((aliasname (file-name-sans-extension
(file-name-nondirectory alias-file)))
- (already-exists-p (assoc aliasname ispell-dictionary-alist))
+ (already-exists-p (assoc aliasname alist))
(realname (match-string 1))
- (realdict (assoc realname ispell-dictionary-alist)))
+ (realdict (assoc realname alist)))
(when (and realdict (not already-exists-p))
- (push (cons aliasname (cdr realdict)) ispell-dictionary-alist))))))))
+ (push (cons aliasname (cdr realdict)) alist))))))
+ alist))
(defun ispell-valid-dictionary-list ()
"Returns a list of valid dictionaries.
@@ -1086,6 +1089,7 @@ The variable `ispell-library-directory' defines the library location."
:help "Spell-check text in marked region"))
(define-key ispell-menu-map [ispell-message]
'(menu-item "Spell-Check Message" ispell-message
+ :visible (eq major-mode 'mail-mode)
:help "Skip headers and included message text"))
(define-key ispell-menu-map [ispell-buffer]
'(menu-item "Spell-Check Buffer" ispell-buffer
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 @@
;; Author: Carsten Dominik <dominik at science dot uva dot nl>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
-;; Version: 4.08
+;; Version: 4.09
;;
;; This file is part of GNU Emacs.
;;
@@ -81,8 +81,14 @@
;;
;; Changes since version 4.00:
;; ---------------------------
-;; Version 4.08
+;; Version 4.09
+;; - Bug fixes.
+;; - Small improvements to font-lock support.
+;; - MHE support finalized.
;;
+;; Version 4.08
+;; - Bug fixes.
+;; - Improved MHE support
;;
;; Version 4.07
;; - Bug fixes.
@@ -139,7 +145,7 @@
;;; Customization variables
-(defvar org-version "4.08"
+(defvar org-version "4.09"
"The version number of the file org.el.")
(defun org-version ()
(interactive)
@@ -796,31 +802,15 @@ as possible."
:group 'org-structure
:type 'hook)
-(defcustom org-level-color-stars-only nil
- "Non-nil means fontify only the stars in each headline.
-When nil, the entire headline is fontified.
-Changing it requires restart of `font-lock-mode' to become effective."
- :group 'org-structure
- :type 'boolean)
-
-(defcustom org-hide-leading-stars nil
- "Non-nil means, hide the first N-1 stars in a headline.
-This works by using the face `org-hide' for these stars. This
-face is white for a light background, and black for a dark
-background. You may have to customize the face `org-hide' to
-make this work.
-Changing it requires restart of `font-lock-mode' to become effective."
- :group 'org-structure
- :type 'boolean)
-
(defcustom org-odd-levels-only nil
"Non-nil means, skip even levels and only use odd levels for the outline.
This has the effect that two stars are being added/taken away in
promotion/demotion commands. It also influences how levels are
handled by the exporters.
Changing it requires restart of `font-lock-mode' to become effective
-for fontification."
+for fontification also in regions already fontified."
:group 'org-structure
+ :group 'org-font-lock
:type 'boolean)
(defcustom org-adapt-indentation t
@@ -1710,11 +1700,44 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
:group 'org-export
:type 'string)
-(defgroup org-faces nil
- "Faces for highlighting in Org-mode."
- :tag "Org Faces"
+(defgroup org-font-lock nil
+ "Faces and settings for highlighting in Org-mode."
+ :tag "Org Font Lock"
:group 'org)
+(defcustom org-level-color-stars-only nil
+ "Non-nil means fontify only the stars in each headline.
+When nil, the entire headline is fontified.
+Changing it requires restart of `font-lock-mode' to become effective
+also in regions already fontified."
+ :group 'org-font-lock
+ :type 'boolean)
+
+(defcustom org-hide-leading-stars nil
+ "Non-nil means, hide the first N-1 stars in a headline.
+This works by using the face `org-hide' for these stars. This
+face is white for a light background, and black for a dark
+background. You may have to customize the face `org-hide' to
+make this work.
+Changing it requires restart of `font-lock-mode' to become effective
+also in regions already fontified."
+ :group 'org-font-lock
+ :type 'boolean)
+
+(defcustom org-fontify-done-headline nil
+ "Non-nil means, change the face of a headline if it is marked DONE.
+Normally, only the TODO/DONE keyword indicates the state of a headline.
+When this is non-nil, the headline after the keyword is set to the
+`org-headline-done' as an additional indication."
+ :group 'org-font-lock
+ :type 'boolean)
+
+(defcustom org-fontify-emphasized-text t
+ "Non-nil means fontify *bold*, /italic/ and _underlined_ text.
+Changing this variable requires a restart of Emacs to take effect."
+ :group 'org-font-lock
+ :type 'boolean)
+
(defface org-hide
'((((type tty) (class color)) (:foreground "blue" :weight bold))
(((class color) (background light)) (:foreground "white"))
@@ -1723,7 +1746,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
; (((class color) (background dark)) (:foreground "grey10"))
(t (:inverse-video nil)))
"Face used for level 1 headlines."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-level-1 ;; font-lock-function-name-face
'((((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].
(((class color) (background dark)) (:foreground "LightSkyBlue"))
(t (:inverse-video t :bold t)))
"Face used for level 1 headlines."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-level-2 ;; font-lock-variable-name-face
'((((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].
(((class color) (background dark)) (:foreground "LightGoldenrod"))
(t (:bold t :italic t)))
"Face used for level 2 headlines."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-level-3 ;; font-lock-keyword-face
'((((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].
(((class color) (background dark)) (:foreground "Cyan"))
(t (:bold t)))
"Face used for level 3 headlines."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-level-4 ;; font-lock-comment-face
'((((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].
(((class color) (background dark)) (:foreground "chocolate1"))
(t (:bold t :italic t)))
"Face used for level 4 headlines."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-level-5 ;; font-lock-type-face
'((((type tty) (class color)) (:foreground "green"))
@@ -1764,7 +1787,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
(((class color) (background dark)) (:foreground "PaleGreen"))
(t (:bold t :underline t)))
"Face used for level 5 headlines."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-level-6 ;; font-lock-constant-face
'((((type tty) (class color)) (:foreground "magenta"))
@@ -1772,7 +1795,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
(((class color) (background dark)) (:foreground "Aquamarine"))
(t (:bold t :underline t)))
"Face used for level 6 headlines."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-level-7 ;; font-lock-builtin-face
'((((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].
(((class color) (background dark)) (:foreground "LightSteelBlue"))
(t (:bold t)))
"Face used for level 7 headlines."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-level-8 ;; font-lock-string-face
'((((type tty) (class color)) (:foreground "green"))
@@ -1788,7 +1811,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
(((class color) (background dark)) (:foreground "LightSalmon"))
(t (:italic t)))
"Face used for level 8 headlines."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-special-keyword ;; font-lock-string-face
'((((type tty) (class color)) (:foreground "green"))
@@ -1796,7 +1819,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
(((class color) (background dark)) (:foreground "LightSalmon"))
(t (:italic t)))
"Face used for special keywords."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-warning ;; font-lock-warning-face
'((((type tty) (class color)) (:foreground "red"))
@@ -1805,15 +1828,7 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files].
; (((class color) (background dark)) (:foreground "Pink" :bold t))
(t (:inverse-video t :bold t)))
"Face for deadlines and TODO keywords."
- :group 'org-faces)
-
-(defcustom org-fontify-done-headline nil
- "Non-nil means, change the face of a headline if it is marked DONE.
-Normally, only the TODO/DONE keyword indicates the state of a headline.
-When this is non-nil, the headline after the keyword is set to the
-`org-headline-done' as an additional indication."
- :group 'org-faces
- :type 'boolean)
+ :group 'org-font-lock)
(defface org-headline-done ;; font-lock-string-face
'((((type tty) (class color)) (:foreground "green"))
@@ -1822,7 +1837,7 @@ When this is non-nil, the headline after the keyword is set to the
(t (:italic t)))
"Face used to indicate that a headline is DONE. See also the variable
`org-fontify-done-headline'."
- :group 'org-faces)
+ :group 'org-font-lock)
;; Inheritance does not yet work for xemacs. So we just copy...
@@ -1832,7 +1847,7 @@ When this is non-nil, the headline after the keyword is set to the
(((class color) (background dark)) (:foreground "LightSkyBlue"))
(t (:inverse-video t :bold t)))
"Face for upcoming deadlines."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-scheduled-today
'((((type tty) (class color)) (:foreground "green"))
@@ -1840,7 +1855,7 @@ When this is non-nil, the headline after the keyword is set to the
(((class color) (background dark)) (:foreground "PaleGreen"))
(t (:bold t :underline t)))
"Face for items scheduled for a certain day."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-scheduled-previously
'((((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
(((class color) (background dark)) (:foreground "chocolate1"))
(t (:bold t :italic t)))
"Face for items scheduled previously, and not yet done."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-formula
'((((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
(((class color) (background dark)) (:foreground "chocolate1"))
(t (:bold t :italic t)))
"Face for formulas."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-link
'((((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
(((class color) (background dark)) (:foreground "Cyan"))
(t (:bold t)))
"Face for links."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-tag
'((((type tty) (class color)) (:foreground "cyan" :weight bold))
(((class color) (background light)) (:foreground "Purple" :weight bold))
(((class color) (background dark)) (:foreground "Cyan" :weight bold))
(t (:bold t)))
- "Face for links."
- :group 'org-faces)
+ "Face for tags."
+ :group 'org-font-lock)
(defface org-done ;; font-lock-type-face
'((((type tty) (class color)) (:foreground "green"))
@@ -1882,7 +1897,7 @@ When this is non-nil, the headline after the keyword is set to the
(((class color) (background dark)) (:foreground "PaleGreen" :bold t))
(t (:bold t :underline t)))
"Face used for DONE."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-table ;; font-lock-function-name-face
'((((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
(((class color) (background dark)) (:foreground "LightSkyBlue"))
(t (:inverse-video t :bold t)))
"Face used for tables."
- :group 'org-faces)
+ :group 'org-font-lock)
(defface org-time-grid ;; font-lock-variable-name-face
'((((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
(((class color) (background dark)) (:foreground "LightGoldenrod"))
(t (:bold t :italic t)))
"Face used for time grids."
- :group 'org-faces)
+ :group 'org-font-lock)
(defvar org-level-faces
'(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
(set '(("fold" org-startup-folded t)
("nofold" org-startup-folded nil)
("content" org-startup-folded content)
+ ("hidestars" org-hide-leading-stars t)
+ ("showstars" org-hide-leading-stars nil)
+ ("odd" org-odd-levels-only t)
+ ("oddeven" org-odd-levels-only nil)
("dlcheck" org-startup-with-deadline-check t)
("nodlcheck" org-startup-with-deadline-check nil)))
l var val)
@@ -2307,44 +2326,45 @@ between words."
(defvar org-font-lock-keywords nil)
(defun org-set-font-lock-defaults ()
- (let ((org-font-lock-extra-keywords
- (list
- '("^\\(\\**\\)\\(\\*\\)\\(.*\\)" (1 (org-get-level-face 1))
- (2 (org-get-level-face 2)) (3 (org-get-level-face 3)))
- '(org-activate-links (0 'org-link t))
- '(org-activate-links2 (0 'org-link t))
- '(org-activate-target-links (0 'org-link t))
- '(org-activate-dates (0 'org-link t))
- '(org-activate-camels (0 'org-link t))
- '(org-activate-tags (1 'org-tag t))
- (list (concat "^\\*+[ \t]*" org-not-done-regexp)
- '(1 'org-warning t))
- (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t))
- (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
- (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t))
- (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
- ;; '("\\(\\s-\\|^\\)\\(\\*\\([a-zA-Z]+\\)\\*\\)\\([^a-zA-Z*]\\|$\\)"
- ;; (3 'bold))
- ;; '("\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)"
- ;; (3 'italic))
- ;; '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)"
- ;; (3 'underline))
- (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string
- "\\|" org-quote-string "\\)\\>")
- '(1 'org-special-keyword t))
- '("^#.*" (0 'font-lock-comment-face t))
- (if org-fontify-done-headline
- (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\(.*\\)\\>")
- '(1 'org-done t) '(2 'org-headline-done t))
- (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\>")
- '(1 'org-done t)))
- '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
- (1 'org-table t))
- '("^[ \t]*\\(:.*\\)" (1 'org-table t))
- '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t))
- '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t))
- )))
-
+ (let* ((em org-fontify-emphasized-text)
+ (org-font-lock-extra-keywords
+ (list
+ '("^\\(\\**\\)\\(\\*\\)\\(.*\\)" (1 (org-get-level-face 1))
+ (2 (org-get-level-face 2)) (3 (org-get-level-face 3)))
+ '(org-activate-links (0 'org-link t))
+ '(org-activate-links2 (0 'org-link t))
+ '(org-activate-target-links (0 'org-link t))
+ '(org-activate-dates (0 'org-link t))
+ '(org-activate-camels (0 'org-link t))
+ '(org-activate-tags (1 'org-tag t))
+ (list (concat "^\\*+[ \t]*" org-not-done-regexp)
+ '(1 'org-warning t))
+ (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t))
+ (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
+ (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t))
+ (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
+; (if em '("\\(\\s-\\|^\\)\\(\\*\\([a-zA-Z]+\\)\\*\\)\\([^a-zA-Z*]\\|$\\)" (3 'bold)))
+; (if em '("\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)" (3 'italic)))
+; (if em '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)" (3 'underline)))
+ (if em '("\\*[a-zA-Z]+\\*" 0 'bold))
+ (if em '("/*[a-zA-Z]+/" 0 'italic))
+ (if em '("_[a-zA-Z]+_" 0 'underline))
+ (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string
+ "\\|" org-quote-string "\\)\\>")
+ '(1 'org-special-keyword t))
+ '("^#.*" (0 'font-lock-comment-face t))
+ (if org-fontify-done-headline
+ (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\(.*\\)\\>")
+ '(1 'org-done t) '(2 'org-headline-done t))
+ (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\>")
+ '(1 'org-done t)))
+ '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
+ (1 'org-table t))
+ '("^[ \t]*\\(:.*\\)" (1 'org-table t))
+ '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t))
+ '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t))
+ )))
+ (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords))
;; Now set the full font-lock-keywords
(set (make-local-variable 'org-font-lock-keywords)
org-font-lock-extra-keywords)
@@ -6960,7 +6980,7 @@ in all files."
(s0 (mapconcat 'identity (org-split-string s "[ \t\r\n]+") " "))
(pos (point))
(pre "") (post "")
- words re0 re1 re2 re3 re4 re5 reall camel)
+ words re0 re1 re2 re3 re4 re5 re2a reall camel)
(cond ((save-excursion
(goto-char (point-min))
(and
@@ -6995,11 +7015,13 @@ in all files."
(org-split-string s "[ \n\r\t]+"))
re0 (concat "<<" (regexp-quote s0) ">>")
re2 (concat "\\<" (mapconcat 'downcase words "[ \t]+") "\\>")
+ re2a (concat "\\<" (mapconcat 'downcase words "[ \t\r\n]+") "\\>")
re4 (concat "\\<" (mapconcat 'downcase words "[^a-zA-Z_\r\n]+") "\\>")
re1 (concat pre re2 post)
re3 (concat pre re4 post)
re5 (concat pre ".*" re4)
re2 (concat pre re2)
+ re2a (concat pre re2a)
re4 (concat pre re4)
reall (concat "\\(" re0 "\\)\\|\\(" re1 "\\)\\|\\(" re2
"\\)\\|\\(" re3 "\\)\\|\\(" re4 "\\)\\|\\("
@@ -7009,12 +7031,14 @@ in all files."
((eq type 'org-occur) (org-occur reall))
((eq type 'occur) (org-do-occur (downcase reall) 'cleanup))
(t (goto-char (point-min))
- (if (or (re-search-forward re0 nil t)
- (re-search-forward re1 nil t)
- (re-search-forward re2 nil t)
- (re-search-forward re3 nil t)
- (re-search-forward re4 nil t)
- (re-search-forward re5 nil t))
+ (if (or (org-search-not-link re0 nil t)
+ (org-search-not-link re1 nil t)
+ (org-search-not-link re2 nil t)
+ (org-search-not-link re2a nil t) ;; FIXME: Right place???
+ (org-search-not-link re3 nil t)
+ (org-search-not-link re4 nil t)
+ (org-search-not-link re5 nil t)
+ )
(goto-char (match-beginning 0))
(goto-char pos)
(error "No match")))))
@@ -7026,6 +7050,21 @@ in all files."
(error "No match"))))
(and (eq major-mode 'org-mode) (org-show-hierarchy-above))))
+(defun org-search-not-link (&rest args)
+ "Execute `re-search-forward', but only accept matches that are not a link."
+ (catch 'exit
+ (let ((pos (point)) p1)
+ (while (apply 're-search-forward args)
+ (setq p1 (point))
+ (if (not (save-match-data
+ (and (re-search-backward "\\[\\[" nil t)
+ (looking-at org-bracket-link-regexp)
+ (<= (match-beginning 0) p1)
+ (>= (match-end 0) p1))))
+ (progn (goto-char (match-end 0))
+ (throw 'exit (point)))
+ (goto-char (match-end 0)))))))
+
(defun org-do-occur (regexp &optional cleanup)
"Call the Emacs command `occur'.
If CLEANUP is non-nil, remove the printout of the regular expression
@@ -7284,24 +7323,32 @@ idea..."
header-field)))
(defun org-follow-mhe-link (folder article)
- "Follow an MHE link to FOLDER and ARTICLE."
- (setq article (org-add-angle-brackets article))
+ "Follow an MHE link to FOLDER and ARTICLE.
+If ARTICLE is nil FOLDER is shown. If the configuration variable
+`org-mhe-search-all-folders' is t and `mh-searcher' is pick,
+ARTICLE is searched in all folders. Indexed searches (swish++,
+namazu, and others supported by MH-E) will always search in all
+folders."
(require 'mh-e)
(require 'mh-search)
+ (require 'mh-utils)
(mh-find-path)
- (mh-search-choose)
- (if (equal mh-searcher 'pick)
- (progn
- (mh-search folder (list "--message-id" article))
- (when (and org-mhe-search-all-folders
- (not (org-mhe-get-message-real-folder)))
- (kill-this-buffer)
- (mh-search "+" (list "--message-id" article))))
- (mh-search "+" article))
- (if (org-mhe-get-message-real-folder)
- (mh-show-msg 1)
- (kill-this-buffer)
- (error "Message not found")))
+ (if (not article)
+ (mh-visit-folder (mh-normalize-folder-name folder))
+ (setq article (org-add-angle-brackets article))
+ (mh-search-choose)
+ (if (equal mh-searcher 'pick)
+ (progn
+ (mh-search folder (list "--message-id" article))
+ (when (and org-mhe-search-all-folders
+ (not (org-mhe-get-message-real-folder)))
+ (kill-this-buffer)
+ (mh-search "+" (list "--message-id" article))))
+ (mh-search "+" article))
+ (if (org-mhe-get-message-real-folder)
+ (mh-show-msg 1)
+ (kill-this-buffer)
+ (error "Message not found"))))
(defun org-open-file (path &optional in-emacs line search)
"Open the file at PATH.
@@ -10563,7 +10610,7 @@ translations. There is currently no way for users to extend this.")
This will leave level 1 alone, convert level 2 to level 3, level 3 to
level 5 etc."
(interactive)
- (when (yes-or-no-p "Are you sure you want to globally change levels? ")
+ (when (yes-or-no-p "Are you sure you want to globally change levels to odd? ")
(let ((org-odd-levels-only nil) n)
(save-excursion
(goto-char (point-min))
@@ -10573,6 +10620,28 @@ level 5 etc."
(org-demote))
(end-of-line 1))))))
+
+(defun org-convert-to-oddeven-levels ()
+ "Convert an org-mode file with only odd levels to one with odd and even levels.
+This promotes level 3 to level 2, level 5 to level 3 etc. If the file contains a
+section with an even level, conversion would destroy the structure of the file. An error
+is signaled in this case."
+ (interactive)
+ (goto-char (point-min))
+ ;; First check if there are no even levels
+ (when (re-search-forward "^\\(\\*\\*\\)+[^*]" nil t)
+ (org-show-hierarchy-above)
+ (error "Not all levels are odd in this file. Conversion not possible."))
+ (when (yes-or-no-p "Are you sure you want to globally change levels to odd-even? ")
+ (let ((org-odd-levels-only nil) n)
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "^\\*\\*+" nil t)
+ (setq n (/ (length (match-string 0)) 2))
+ (while (>= (setq n (1- n)) 0)
+ (org-promote))
+ (end-of-line 1))))))
+
(defun org-tr-level (n)
"Make N odd if required."
(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."
#+CATEGORY: %s
#+SEQ_TODO: %s
#+TYP_TODO: %s
-#+STARTUP: %s %s
+#+STARTUP: %s %s %s %s
#+ARCHIVE: %s
"
(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."
(cdr (assoc org-startup-folded
'((nil . "nofold")(t . "fold")(content . "content"))))
(if org-startup-with-deadline-check "dlcheck" "nodlcheck")
+ (if org-odd-levels-only "odd" "oddeven")
+ (if org-hide-leading-stars "hidestars" "showstars")
org-archive-location
))
@@ -10924,6 +10995,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
(setq-default org-deadline-line-regexp org-deadline-line-regexp)
(setq-default org-done-string org-done-string)
(let* ((style org-export-html-style)
+ (odd org-odd-levels-only)
(region-p (org-region-active-p))
(region
(buffer-substring
@@ -10987,7 +11059,8 @@ headlines. The default is 3. Lower levels will become bulleted lists."
(switch-to-buffer-other-window buffer))
(erase-buffer)
(fundamental-mode)
- (let ((case-fold-search nil))
+ (let ((case-fold-search nil)
+ (org-odd-levels-only odd))
(if options (org-parse-export-options options))
(setq umax (if arg (prefix-numeric-value arg)
org-export-headline-levels))
@@ -12372,7 +12445,8 @@ See the individual commands for more information."
"--"
["Archive Subtree" org-archive-subtree t]
"--"
- ["Convert file to odd levels" org-convert-to-odd-levels t])
+ ["Convert to odd levels" org-convert-to-odd-levels t]
+ ["Convert to odd/even levels" org-convert-to-oddeven-levels t])
"--"
("TODO Lists"
["TODO/DONE/-" org-todo t]
@@ -12851,3 +12925,4 @@ Show the heading too, if it is currently invisible."
;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
;;; org.el ends here
+
diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el
index b868369fc4a..4588cc78994 100644
--- a/lisp/tree-widget.el
+++ b/lisp/tree-widget.el
@@ -154,8 +154,9 @@ XEmacs.")
(defcustom tree-widget-themes-directory "tree-widget"
"*Name of the directory where to look up for image themes.
When nil use the directory where the tree-widget library is located.
-When a relative name is specified, try to locate that sub directory in
-the locations specified in `tree-widget-themes-load-path'.
+When a relative name is specified, search in all occurrences of that
+sub directory found in the locations specified in
+`tree-widget-themes-load-path'.
The default is to use the \"tree-widget\" relative name."
:type '(choice (const :tag "Default" "tree-widget")
(const :tag "With the library" nil)
@@ -164,9 +165,9 @@ The default is to use the \"tree-widget\" relative name."
(defcustom tree-widget-theme nil
"*Name of the theme where to look up for images.
-It must be a sub directory of the directory specified in variable
+It must be a sub directory in the directories specified in variable
`tree-widget-themes-directory'. The default theme is \"default\".
-When an image is not found in a theme, it is searched in the default
+When an image is not found in a theme, it is searched in the parent
theme.
A complete theme must at least contain images with these file names
@@ -275,10 +276,15 @@ The default parent theme is the \"default\" theme."
(unless (member name (aref tree-widget--theme 0))
(aset tree-widget--theme 0
(append (aref tree-widget--theme 0) (list name)))
- ;; Load the theme setup
- (let ((default-directory (tree-widget-themes-directory)))
- (when default-directory
- (load (expand-file-name "tree-widget-theme-setup" name) t)))))
+ ;; Load the theme setup from the first directory where the theme
+ ;; is found.
+ (catch 'found
+ (dolist (dir (tree-widget-themes-path))
+ (setq dir (expand-file-name name dir))
+ (when (file-accessible-directory-p dir)
+ (throw 'found
+ (load (expand-file-name
+ "tree-widget-theme-setup" dir) t)))))))
(defun tree-widget-set-theme (&optional name)
"In the current buffer, set the theme to use for images.
@@ -304,54 +310,62 @@ Typically it should contain something like this:
(tree-widget-set-parent-theme name)
(tree-widget-set-parent-theme "default")))
-(defun tree-widget--locate-sub-directory (name path)
- "Locate the sub-directory NAME in PATH.
-Return the absolute name of the directory found, or nil if not found."
- (let (dir elt)
- (while (and (not dir) (consp path))
- (setq elt (condition-case nil (eval (car path)) (error nil))
- path (cdr path))
- (cond
- ((stringp elt)
- (setq dir (expand-file-name name elt))
- (or (file-accessible-directory-p dir)
- (setq dir nil)))
- ((and elt (not (equal elt (car path))))
- (setq dir (tree-widget--locate-sub-directory name elt)))))
- dir))
-
-(defun tree-widget-themes-directory ()
- "Locate the directory where to search for a theme.
-It is defined in variable `tree-widget-themes-directory'.
-Return the absolute name of the directory found, or nil if the
-specified directory is not accessible."
- (let ((found (aref tree-widget--theme 1)))
+(defun tree-widget--locate-sub-directory (name path &optional found)
+ "Locate all occurrences of the sub-directory NAME in PATH.
+Return a list of absolute directory names in reverse order, or nil if
+not found."
+ (condition-case err
+ (dolist (elt path)
+ (setq elt (eval elt))
+ (cond
+ ((stringp elt)
+ (and (file-accessible-directory-p
+ (setq elt (expand-file-name name elt)))
+ (push elt found)))
+ (elt
+ (setq found (tree-widget--locate-sub-directory
+ name (if (atom elt) (list elt) elt) found)))))
+ (error
+ (message "In tree-widget--locate-sub-directory: %s"
+ (error-message-string err))))
+ found)
+
+(defun tree-widget-themes-path ()
+ "Return the path where to search for a theme.
+It is specified in variable `tree-widget-themes-directory'.
+Return a list of absolute directory names, or nil when no directory
+has been found accessible."
+ (let ((path (aref tree-widget--theme 1)))
(cond
- ;; The directory was not found.
- ((eq found 'void)
- (setq found nil))
- ;; The directory is available in the cache.
- (found)
+ ;; No directory was found.
+ ((eq path 'void) nil)
+ ;; The list of directories is available in the cache.
+ (path)
;; Use the directory where this library is located.
((null tree-widget-themes-directory)
- (setq found (locate-library "tree-widget"))
- (when found
- (setq found (file-name-directory found))
- (or (file-accessible-directory-p found)
- (setq found nil))))
+ (when (setq path (locate-library "tree-widget"))
+ (setq path (file-name-directory path))
+ (setq path (and (file-accessible-directory-p path)
+ (list path)))
+ ;; Store the result in the cache for later use.
+ (aset tree-widget--theme 1 (or path 'void))
+ path))
;; Check accessibility of absolute directory name.
((file-name-absolute-p tree-widget-themes-directory)
- (setq found (expand-file-name tree-widget-themes-directory))
- (or (file-accessible-directory-p found)
- (setq found nil)))
+ (setq path (expand-file-name tree-widget-themes-directory))
+ (setq path (and (file-accessible-directory-p path)
+ (list path)))
+ ;; Store the result in the cache for later use.
+ (aset tree-widget--theme 1 (or path 'void))
+ path)
;; Locate a sub-directory in `tree-widget-themes-load-path'.
(t
- (setq found (tree-widget--locate-sub-directory
- tree-widget-themes-directory
- tree-widget-themes-load-path))))
- ;; Store the result in the cache for later use.
- (aset tree-widget--theme 1 (or found 'void))
- found))
+ (setq path (nreverse (tree-widget--locate-sub-directory
+ tree-widget-themes-directory
+ tree-widget-themes-load-path)))
+ ;; Store the result in the cache for later use.
+ (aset tree-widget--theme 1 (or path 'void))
+ path))))
(defconst tree-widget--cursors
;; Pointer shapes when the mouse pointer is over inactive
@@ -391,20 +405,19 @@ Search first in current theme, then in parent themes (see also the
function `tree-widget-set-parent-theme').
Return the first image found having a supported format, or nil if not
found."
- (let ((default-directory (tree-widget-themes-directory)) file)
- (when default-directory
- (catch 'found
- (dolist (dir (aref tree-widget--theme 0))
- (dolist (fmt (tree-widget-image-formats))
- (dolist (ext (cdr fmt))
- (setq file (expand-file-name (concat name ext) dir))
- (and (file-readable-p file)
- (file-regular-p file)
- (throw 'found
- (tree-widget-create-image
- (car fmt) file
- (tree-widget-image-properties name)))))))
- nil))))
+ (catch 'found
+ (dolist (default-directory (tree-widget-themes-path))
+ (dolist (dir (aref tree-widget--theme 0))
+ (dolist (fmt (tree-widget-image-formats))
+ (dolist (ext (cdr fmt))
+ (setq file (expand-file-name (concat name ext) dir))
+ (and (file-readable-p file)
+ (file-regular-p file)
+ (throw 'found
+ (tree-widget-create-image
+ (car fmt) file
+ (tree-widget-image-properties name))))))))
+ nil))
(defun tree-widget-find-image (name)
"Find the image with NAME in current theme.