From 8433d47026bc042ed7e792d032469a6ea4f6d622 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 17 May 2006 10:38:15 +0000 Subject: [PATCH 01/46] (ewoc-map, ewoc-invalidate): Compute PP before looping. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/ewoc.el | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 85e397cbe29..cd8a9c6f5c7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,8 @@ * emacs-lisp/ewoc.el (ewoc-data): Add docstring. (ewoc-nth): Doc fix. + (ewoc-map, ewoc-invalidate): Compute PP before looping. + 2006-05-16 Eli Zaretskii * international/mule.el (auto-coding-alist): Add .lha to files diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el index fa85ce21fb0..dbfae49233a 100644 --- a/lisp/emacs-lisp/ewoc.el +++ b/lisp/emacs-lisp/ewoc.el @@ -352,11 +352,12 @@ If more than two arguments are given, the remaining arguments will be passed to MAP-FUNCTION." (ewoc--set-buffer-bind-dll-let* ewoc ((footer (ewoc--footer ewoc)) + (pp (ewoc--pretty-printer ewoc)) (node (ewoc--node-nth dll 1))) (save-excursion (while (not (eq node footer)) (if (apply map-function (ewoc--node-data node) args) - (ewoc--refresh-node (ewoc--pretty-printer ewoc) node)) + (ewoc--refresh-node pp node)) (setq node (ewoc--node-next dll node)))))) (defun ewoc-filter (ewoc predicate &rest args) @@ -465,10 +466,11 @@ If the EWOC is empty, nil is returned." (defun ewoc-invalidate (ewoc &rest nodes) "Call EWOC's pretty-printer for each element in NODES. Delete current text first, thus effecting a \"refresh\"." - (ewoc--set-buffer-bind-dll ewoc + (ewoc--set-buffer-bind-dll-let* ewoc + ((pp (ewoc--pretty-printer ewoc))) (save-excursion (dolist (node nodes) - (ewoc--refresh-node (ewoc--pretty-printer ewoc) node))))) + (ewoc--refresh-node pp node))))) (defun ewoc-goto-prev (ewoc arg) "Move point to the ARGth previous element in EWOC. From fb58b23a98a342a2be9c510fcc33d93e1466b29e Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 17 May 2006 21:25:47 +0000 Subject: [PATCH 02/46] *** empty log message *** --- lisp/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cd8a9c6f5c7..1a53519e840 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-05-17 Kim F. Storm + + * ido.el (ido-read-internal): Use only nondirectory part of default item. + 2006-05-17 Thien-Thi Nguyen * emacs-lisp/ewoc.el (ewoc-data): Add docstring. From 2d38f869f6f2aafd1fc3ddc605d79eda2fa207ae Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 17 May 2006 21:25:59 +0000 Subject: [PATCH 03/46] (ido-read-internal): Use only nondirectory part of default item. --- lisp/ido.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/ido.el b/lisp/ido.el index a622a7e6275..d03c002d597 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1778,7 +1778,7 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise." "Perform the `ido-read-buffer' and `ido-read-file-name' functions. Return the name of a buffer or file selected. PROMPT is the prompt to give to the user. -DEFAULT if given is the default directory to start with. +DEFAULT if given is the default item to start with. If REQUIRE-MATCH is non-nil, an existing file must be selected. If INITIAL is non-nil, it specifies the initial input string." (let @@ -1822,7 +1822,10 @@ If INITIAL is non-nil, it specifies the initial input string." (cond ((eq item 'buffer) (if (bufferp default) (buffer-name default) default)) - ((stringp default) default) + ((stringp default) + (if (memq item '(file dir)) + (file-name-nondirectory default) + default)) ((eq item 'file) (and ido-enable-last-directory-history (let ((d (assoc ido-current-directory ido-last-directory-list))) From 05327ca9724287cc3da4c625f180da5ab11be998 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 17 May 2006 21:57:25 +0000 Subject: [PATCH 04/46] (shell-dirtrack-mode): Make it into a proper minor mode, so we can explicitly enable/disable rather than toggle. (shell-mode): Use it. (shell-cd): Don't try to reproduce what `cd' does. --- lisp/ChangeLog | 10 ++- lisp/shell.el | 161 ++++++++++++++++++++++++------------------------- 2 files changed, 88 insertions(+), 83 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1a53519e840..64a78b0c2bc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,14 @@ +2006-05-17 Stefan Monnier + + * shell.el (shell-dirtrack-mode): Make it into a proper minor mode, so + we can explicitly enable/disable rather than toggle. + (shell-mode): Use it. + (shell-cd): Don't try to reproduce what `cd' does. + 2006-05-17 Kim F. Storm - * ido.el (ido-read-internal): Use only nondirectory part of default item. + * ido.el (ido-read-internal): Use only nondirectory part of + default item. 2006-05-17 Thien-Thi Nguyen diff --git a/lisp/shell.el b/lisp/shell.el index 71b5862feb6..bfa9565e8d4 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -150,7 +150,7 @@ This is a fine thing to set in your `.emacs' file." :group 'shell) (defcustom shell-completion-fignore nil - "*List of suffixes to be disregarded during file/command completion. + "List of suffixes to be disregarded during file/command completion. This variable is used to initialize `comint-completion-fignore' in the shell buffer. The default is nil, for compatibility with most shells. Some people like (\"~\" \"#\" \"%\"). @@ -199,19 +199,19 @@ shell buffer. This is a fine thing to set in your `.emacs' file.") (defcustom shell-command-regexp "[^;&|\n]+" - "*Regexp to match a single command within a pipeline. + "Regexp to match a single command within a pipeline. This is used for directory tracking and does not do a perfect job." :type 'regexp :group 'shell) (defcustom shell-command-separator-regexp "[;&|\n \t]*" - "*Regexp to match a single command within a pipeline. + "Regexp to match a single command within a pipeline. This is used for directory tracking and does not do a perfect job." :type 'regexp :group 'shell) (defcustom shell-completion-execonly t - "*If non-nil, use executable files only for completion candidates. + "If non-nil, use executable files only for completion candidates. This mirrors the optional behavior of tcsh. Detecting executability of files may slow command completion considerably." @@ -219,35 +219,35 @@ Detecting executability of files may slow command completion considerably." :group 'shell) (defcustom shell-popd-regexp "popd" - "*Regexp to match subshell commands equivalent to popd." + "Regexp to match subshell commands equivalent to popd." :type 'regexp :group 'shell-directories) (defcustom shell-pushd-regexp "pushd" - "*Regexp to match subshell commands equivalent to pushd." + "Regexp to match subshell commands equivalent to pushd." :type 'regexp :group 'shell-directories) (defcustom shell-pushd-tohome nil - "*If non-nil, make pushd with no arg behave as \"pushd ~\" (like cd). + "If non-nil, make pushd with no arg behave as \"pushd ~\" (like cd). This mirrors the optional behavior of tcsh." :type 'boolean :group 'shell-directories) (defcustom shell-pushd-dextract nil - "*If non-nil, make \"pushd +n\" pop the nth dir to the stack top. + "If non-nil, make \"pushd +n\" pop the nth dir to the stack top. This mirrors the optional behavior of tcsh." :type 'boolean :group 'shell-directories) (defcustom shell-pushd-dunique nil - "*If non-nil, make pushd only add unique directories to the stack. + "If non-nil, make pushd only add unique directories to the stack. This mirrors the optional behavior of tcsh." :type 'boolean :group 'shell-directories) (defcustom shell-cd-regexp "cd" - "*Regexp to match subshell commands equivalent to cd." + "Regexp to match subshell commands equivalent to cd." :type 'regexp :group 'shell-directories) @@ -256,19 +256,19 @@ This mirrors the optional behavior of tcsh." ; NetWare allows the five chars between upper and lower alphabetics. "[]a-zA-Z^_`\\[\\\\]:" nil) - "*If non-nil, is regexp used to track drive changes." + "If non-nil, is regexp used to track drive changes." :type '(choice regexp (const nil)) :group 'shell-directories) (defcustom shell-dirtrack-verbose t - "*If non-nil, show the directory stack following directory change. + "If non-nil, show the directory stack following directory change. This is effective only if directory tracking is enabled." :type 'boolean :group 'shell-directories) (defcustom explicit-shell-file-name nil - "*If non-nil, is file name to use for explicitly requested inferior shell." + "If non-nil, is file name to use for explicitly requested inferior shell." :type '(choice (const :tag "None" nil) file) :group 'shell) @@ -278,7 +278,7 @@ This is effective only if directory tracking is enabled." ;; than us about what terminal modes to use. '("-i" "-T") '("-i")) - "*Args passed to inferior shell by M-x shell, if the shell is csh. + "Args passed to inferior shell by \\[shell], if the shell is csh. Value is a list of strings, which may be nil." :type '(repeat (string :tag "Argument")) :group 'shell) @@ -296,13 +296,13 @@ Value is a list of strings, which may be nil." (shell-command-to-string (concat prog " --noediting")))) '("-i") '("--noediting" "-i"))) - "*Args passed to inferior shell by M-x shell, if the shell is bash. + "Args passed to inferior shell by \\[shell], if the shell is bash. Value is a list of strings, which may be nil." :type '(repeat (string :tag "Argument")) :group 'shell) (defcustom shell-input-autoexpand 'history - "*If non-nil, expand input command history references on completion. + "If non-nil, expand input command history references on completion. This mirrors the optional behavior of tcsh (its autoexpand and histlit). If the value is `input', then the expansion is seen on input. @@ -433,9 +433,7 @@ buffer." (setq shell-dirstack nil) (make-local-variable 'shell-last-dir) (setq shell-last-dir nil) - (make-local-variable 'shell-dirtrackp) - (setq shell-dirtrackp t) - (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t) + (shell-dirtrack-mode 1) (setq comint-input-autoexpand shell-input-autoexpand) ;; This is not really correct, since the shell buffer does not really ;; edit this directory. But it is useful in the buffer list and menus. @@ -558,48 +556,48 @@ Otherwise, one argument `-i' is passed to the shell. (shell-mode))) buffer) -;;; Don't do this when shell.el is loaded, only while dumping. +;; Don't do this when shell.el is loaded, only while dumping. ;;;###autoload (add-hook 'same-window-buffer-names "*shell*") ;;; Directory tracking -;;; -;;; This code provides the shell mode input sentinel -;;; SHELL-DIRECTORY-TRACKER -;;; that tracks cd, pushd, and popd commands issued to the shell, and -;;; changes the current directory of the shell buffer accordingly. -;;; -;;; This is basically a fragile hack, although it's more accurate than -;;; the version in Emacs 18's shell.el. It has the following failings: -;;; 1. It doesn't know about the cdpath shell variable. -;;; 2. It cannot infallibly deal with command sequences, though it does well -;;; with these and with ignoring commands forked in another shell with ()s. -;;; 3. More generally, any complex command is going to throw it. Otherwise, -;;; you'd have to build an entire shell interpreter in Emacs Lisp. Failing -;;; that, there's no way to catch shell commands where cd's are buried -;;; inside conditional expressions, aliases, and so forth. -;;; -;;; The whole approach is a crock. Shell aliases mess it up. File sourcing -;;; messes it up. You run other processes under the shell; these each have -;;; separate working directories, and some have commands for manipulating -;;; their w.d.'s (e.g., the lcd command in ftp). Some of these programs have -;;; commands that do *not* affect the current w.d. at all, but look like they -;;; do (e.g., the cd command in ftp). In shells that allow you job -;;; control, you can switch between jobs, all having different w.d.'s. So -;;; simply saying %3 can shift your w.d.. -;;; -;;; The solution is to relax, not stress out about it, and settle for -;;; a hack that works pretty well in typical circumstances. Remember -;;; that a half-assed solution is more in keeping with the spirit of Unix, -;;; anyway. Blech. -;;; -;;; One good hack not implemented here for users of programmable shells -;;; is to program up the shell w.d. manipulation commands to output -;;; a coded command sequence to the tty. Something like -;;; ESC | | -;;; where is the new current working directory. Then trash the -;;; directory tracking machinery currently used in this package, and -;;; replace it with a process filter that watches for and strips out -;;; these messages. +;; +;; This code provides the shell mode input sentinel +;; SHELL-DIRECTORY-TRACKER +;; that tracks cd, pushd, and popd commands issued to the shell, and +;; changes the current directory of the shell buffer accordingly. +;; +;; This is basically a fragile hack, although it's more accurate than +;; the version in Emacs 18's shell.el. It has the following failings: +;; 1. It doesn't know about the cdpath shell variable. +;; 2. It cannot infallibly deal with command sequences, though it does well +;; with these and with ignoring commands forked in another shell with ()s. +;; 3. More generally, any complex command is going to throw it. Otherwise, +;; you'd have to build an entire shell interpreter in Emacs Lisp. Failing +;; that, there's no way to catch shell commands where cd's are buried +;; inside conditional expressions, aliases, and so forth. +;; +;; The whole approach is a crock. Shell aliases mess it up. File sourcing +;; messes it up. You run other processes under the shell; these each have +;; separate working directories, and some have commands for manipulating +;; their w.d.'s (e.g., the lcd command in ftp). Some of these programs have +;; commands that do *not* affect the current w.d. at all, but look like they +;; do (e.g., the cd command in ftp). In shells that allow you job +;; control, you can switch between jobs, all having different w.d.'s. So +;; simply saying %3 can shift your w.d.. +;; +;; The solution is to relax, not stress out about it, and settle for +;; a hack that works pretty well in typical circumstances. Remember +;; that a half-assed solution is more in keeping with the spirit of Unix, +;; anyway. Blech. +;; +;; One good hack not implemented here for users of programmable shells +;; is to program up the shell w.d. manipulation commands to output +;; a coded command sequence to the tty. Something like +;; ESC | | +;; where is the new current working directory. Then trash the +;; directory tracking machinery currently used in this package, and +;; replace it with a process filter that watches for and strips out +;; these messages. (defun shell-directory-tracker (str) "Tracks cd, pushd and popd commands issued to the shell. @@ -607,8 +605,8 @@ This function is called on each input passed to the shell. It watches for cd, pushd and popd commands and sets the buffer's default directory to track these commands. -You may toggle this tracking on and off with M-x dirtrack-mode. -If Emacs gets confused, you can resync with the shell with M-x dirs. +You may toggle this tracking on and off with \\[dirtrack-mode]. +If Emacs gets confused, you can resync with the shell with \\[dirs]. See variables `shell-cd-regexp', `shell-chdrive-regexp', `shell-pushd-regexp', and `shell-popd-regexp', while `shell-pushd-tohome', `shell-pushd-dextract', @@ -677,7 +675,7 @@ Environment variables are expanded, see function `substitute-in-file-name'." (setq string (replace-match "" nil nil string))))) string))) -;;; popd [+n] +;; popd [+n] (defun shell-process-popd (arg) (let ((num (or (shell-extract-num arg) 0))) (cond ((and num (= num 0) shell-dirstack) @@ -703,7 +701,7 @@ Environment variables are expanded, see function `substitute-in-file-name'." ;; For relative name we assume default-directory already has the prefix. (expand-file-name dir)))) -;;; cd [dir] +;; cd [dir] (defun shell-process-cd (arg) (let ((new-dir (cond ((zerop (length arg)) (concat comint-file-name-prefix "~")) @@ -713,7 +711,7 @@ Environment variables are expanded, see function `substitute-in-file-name'." (shell-cd new-dir) (shell-dirstack-message))) -;;; pushd [+n | dir] +;; pushd [+n | dir] (defun shell-process-pushd (arg) (let ((num (shell-extract-num arg))) (cond ((zerop (length arg)) @@ -762,26 +760,25 @@ Environment variables are expanded, see function `substitute-in-file-name'." (and (string-match "^\\+[1-9][0-9]*$" str) (string-to-number str))) - -(defun shell-dirtrack-mode () +(defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) +(define-minor-mode shell-dirtrack-mode "Turn directory tracking on and off in a shell buffer." - (interactive) - (if (setq shell-dirtrackp (not shell-dirtrackp)) - (setq list-buffers-directory default-directory) - (setq list-buffers-directory nil)) - (message "Directory tracking %s" (if shell-dirtrackp "ON" "OFF"))) + nil nil nil + (setq list-buffers-directory (if shell-dirtrack-mode default-directory)) + (if shell-dirtrack-mode + (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t) + (remove-hook 'comint-input-filter-functions 'shell-directory-tracker t))) -;;; For your typing convenience: -(defalias 'shell-dirtrack-toggle 'shell-dirtrack-mode) +;; For your typing convenience: +(defalias 'shell-dirtrack-toggle 'shell-dirtrack-mode) ;??Convenience?? (defalias 'dirtrack-toggle 'shell-dirtrack-mode) (defalias 'dirtrack-mode 'shell-dirtrack-mode) (defun shell-cd (dir) "Do normal `cd' to DIR, and set `list-buffers-directory'." + (cd dir) (if shell-dirtrackp - (setq list-buffers-directory (file-name-as-directory - (expand-file-name dir)))) - (cd dir)) + (setq list-buffers-directory default-directory))) (defun shell-resync-dirs () "Resync the buffer's idea of the current directory stack. @@ -841,15 +838,15 @@ command again." (shell-dirstack-message)) (error (message "Couldn't cd"))))))) -;;; For your typing convenience: +;; For your typing convenience: (defalias 'dirs 'shell-resync-dirs) -;;; Show the current dirstack on the message line. -;;; Pretty up dirs a bit by changing "/usr/jqr/foo" to "~/foo". -;;; (This isn't necessary if the dirlisting is generated with a simple "dirs".) -;;; All the commands that mung the buffer's dirstack finish by calling -;;; this guy. +;; Show the current dirstack on the message line. +;; Pretty up dirs a bit by changing "/usr/jqr/foo" to "~/foo". +;; (This isn't necessary if the dirlisting is generated with a simple "dirs".) +;; All the commands that mung the buffer's dirstack finish by calling +;; this guy. (defun shell-dirstack-message () (when shell-dirtrack-verbose (let* ((msg "") @@ -1076,5 +1073,5 @@ Returns t if successful." (provide 'shell) -;;; arch-tag: bcb5f12a-c1f4-4aea-a809-2504bd5bd797 +;; arch-tag: bcb5f12a-c1f4-4aea-a809-2504bd5bd797 ;;; shell.el ends here From bc023640a335ed2c8b7ddc239bc9489f78601c74 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 17 May 2006 22:17:09 +0000 Subject: [PATCH 05/46] (Regexp Special): Clarify nested regexp warning. --- lispref/searching.texi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lispref/searching.texi b/lispref/searching.texi index 644376f5cdd..505122fdd16 100644 --- a/lispref/searching.texi +++ b/lispref/searching.texi @@ -306,9 +306,10 @@ matching @samp{ca*ar} against the string @samp{caaar}, the @samp{a*} first tries to match all three @samp{a}s; but the rest of the pattern is @samp{ar} and there is only @samp{r} left to match, so this try fails. The next alternative is for @samp{a*} to match only two @samp{a}s. With -this choice, the rest of the regexp matches successfully.@refill +this choice, the rest of the regexp matches successfully. -Nested repetition operators take a long time, or even forever, if they +@strong{Warning:} Nested repetition operators take a long time, +or even forever, if they lead to ambiguous matching. For example, trying to match the regular expression @samp{\(x+y*\)*a} against the string @samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz} could take hours before it @@ -316,7 +317,8 @@ ultimately fails. Emacs must try each way of grouping the 35 @samp{x}s before concluding that none of them can work. Even worse, @samp{\(x*\)*} can match the null string in infinitely many ways, so it causes an infinite loop. To avoid these problems, check nested -repetitions carefully. +repetitions carefully, to make sure that they do not cause combinatorial +explosions in backtracking. @item @samp{+} @cindex @samp{+} in regexp From f5ecbceeee0087bcf9b8d94ddf371716fccd05f5 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 17 May 2006 22:22:29 +0000 Subject: [PATCH 06/46] *** empty log message *** --- src/ChangeLog | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1a58d0b5905..dd8feb509b1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2006-05-18 Kim F. Storm + + * xdisp.c (display_tool_bar_line): Restore entire tool-bar geometry when + backtracking in case last image doesn't fit on line. + +2006-05-18 MIYOSHI Masanori (tiny change) + + * xdisp.c (display_tool_bar_line): Don't adjust tool-bar height by more than + height of one frame default line. + 2006-05-16 Kim F. Storm * xterm.c (handle_one_xevent): Check that f is not NULL before @@ -17012,8 +17022,7 @@ (Fapropos_internal): Initialize them and clear them out. Don't GCPRO them. - * buffer.c (syms_of_buffer) : - Doc fixes. + * buffer.c (syms_of_buffer) : Doc fixes. * lisp.h: New misc type Lisp_Save_Value. (enum Lisp_Misc_Type): Add Lisp_Misc_Save_Value. From e410360421363eff50dafe5397b26af0e1b42a2c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 17 May 2006 22:23:17 +0000 Subject: [PATCH 07/46] (Minibuffer History): Clarify. --- lispref/minibuf.texi | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi index 73cc0817d9b..f69cf03deac 100644 --- a/lispref/minibuf.texi +++ b/lispref/minibuf.texi @@ -450,19 +450,17 @@ history list symbol. The variable @code{history-delete-duplicates} specifies whether to delete duplicates in history. @defun add-to-history history-var newelt &optional maxelt keep-all -This function adds a new element @var{newelt}, if non-empty, to the -history list stored in the variable @var{history-var}, and returns the -updated history list. By default, the list length is limited by the -value specified by @code{history-length} (described below), but the -optional argument @var{maxelt} overrides that. The possible values of -@var{maxelt} have the same meaning as the values of -@code{history-length}. +This function adds a new element @var{newelt}, if it isn't the empty +string, to the history list stored in the variable @var{history-var}, +and returns the updated history list. It limits the list length to +the value of @var{maxelt} (if non-@code{nil}) or @code{history-length} +(described below). The possible values of @var{maxelt} have the same +meaning as the values of @code{history-length}. -Duplicate members are removed from the history list, if -@code{history-delete-duplicates} is non-@code{nil}. - -If @var{keep-all} is non-@code{nil}, even an empty or duplicate -@var{newelt} element is added to the history list. +Normally, @code{add-to-history} removes duplicate members from the +history list if @code{history-delete-duplicates} is non-@code{nil}. +However, if @var{keep-all} is non-@code{nil}, that says not to remove +duplicates, and to add @var{newelt} to the list even if it is empty. @end defun @defvar history-length From 914dee7a62684fad3fe2b543373d750f27ee69eb Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 17 May 2006 22:24:13 +0000 Subject: [PATCH 08/46] (display_tool_bar_line): Restore entire tool-bar geometry when backtracking in case last image doesn't fit on line. (display_tool_bar_line): Don't adjust tool-bar height by more than height of one frame default line. From: MIYOSHI Masanori. --- src/xdisp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index c0caaf4daf2..87764e5ecb6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9492,6 +9492,7 @@ display_tool_bar_line (it, height) while (it->current_x < max_x) { int x_before, x, n_glyphs_before, i, nglyphs; + struct it it_before; /* Get the next display element. */ if (!get_next_display_element (it)) @@ -9505,9 +9506,10 @@ display_tool_bar_line (it, height) /* Produce glyphs. */ x_before = it->current_x; n_glyphs_before = it->glyph_row->used[TEXT_AREA]; + it_before = *it; PRODUCE_GLYPHS (it); - nglyphs = it->glyph_row->used[TEXT_AREA] - n_glyphs_before; + nglyphs = row->used[TEXT_AREA] - n_glyphs_before; i = 0; x = x_before; while (i < nglyphs) @@ -9516,9 +9518,9 @@ display_tool_bar_line (it, height) if (x + glyph->pixel_width > max_x) { - /* Glyph doesn't fit on line. */ - it->glyph_row->used[TEXT_AREA] = n_glyphs_before + i; - it->current_x = x; + /* Glyph doesn't fit on line. Backtrack. */ + row->used[TEXT_AREA] = n_glyphs_before; + *it = it_before; goto out; } @@ -9549,6 +9551,8 @@ display_tool_bar_line (it, height) /* Make line the desired height and center it vertically. */ if ((height -= it->max_ascent + it->max_descent) > 0) { + /* Don't add more than one line height. */ + height %= FRAME_LINE_HEIGHT (it->f); it->max_ascent += height / 2; it->max_descent += (height + 1) / 2; } From 59767336096a79c54b7c034dc22539c45c8d638d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 17 May 2006 22:24:59 +0000 Subject: [PATCH 09/46] (Diff Mode): Mention C-x `. --- man/files.texi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/man/files.texi b/man/files.texi index 6f38f18b1cb..65edbc22e36 100644 --- a/man/files.texi +++ b/man/files.texi @@ -2333,8 +2333,10 @@ diff-mode}. One general feature of Diff mode is that manual edits to the patch automatically correct line numbers, including those in the hunk header, so that you can actually apply the edited patch. Diff mode -also provides the following commands to navigate, manipulate and apply -parts of patches: +treats each hunk location as an ``error message'', so that you can use +commands such as @kbd{C-x '} to visit the corresponding source +locations. It also provides the following commands to navigate, +manipulate and apply parts of patches: @table @kbd @item M-n From 624d2678584bd7b1d42b25ab1c617757b74a7c8e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 17 May 2006 22:26:51 +0000 Subject: [PATCH 10/46] (Fprevious_overlay_change, Fnext_overlay_change): Doc fixes. --- src/buffer.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index 5ed9043fd0a..c03c58a39f3 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2465,10 +2465,10 @@ swap_out_buffer_local_variables (b) Return the number found, and store them in a vector in *VEC_PTR. Store in *LEN_PTR the size allocated for the vector. Store in *NEXT_PTR the next position after POS where an overlay starts, - or ZV if there are no more overlays. + or ZV if there are no more overlays between POS and ZV. Store in *PREV_PTR the previous position before POS where an overlay ends, or where an overlay starts which ends at or after POS; - or BEGV if there are no such overlays. + or BEGV if there are no such overlays from BEGV to POS. NEXT_PTR and/or PREV_PTR may be 0, meaning don't store that info. *VEC_PTR and *LEN_PTR should contain a valid vector and size @@ -3939,7 +3939,8 @@ or between BEG and END. */) DEFUN ("next-overlay-change", Fnext_overlay_change, Snext_overlay_change, 1, 1, 0, doc: /* Return the next position after POS where an overlay starts or ends. -If there are no more overlay boundaries after POS, return (point-max). */) +If there are no overlay boundaries from POS to (point-max), +the value is (point-max). */) (pos) Lisp_Object pos; { @@ -3980,7 +3981,8 @@ If there are no more overlay boundaries after POS, return (point-max). */) DEFUN ("previous-overlay-change", Fprevious_overlay_change, Sprevious_overlay_change, 1, 1, 0, doc: /* Return the previous position before POS where an overlay starts or ends. -If there are no more overlay boundaries before POS, return (point-min). */) +If there are no overlay boundaries from (point-min) to POS, +the value is (point-min). */) (pos) Lisp_Object pos; { From 59367bff6b65cb1992c43e1b57fdd9d4592b0a24 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 17 May 2006 22:37:25 +0000 Subject: [PATCH 11/46] (display_tool_bar_line): Eliminate x_before variable. --- src/xdisp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 87764e5ecb6..d74b6d04aa5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9491,7 +9491,7 @@ display_tool_bar_line (it, height) while (it->current_x < max_x) { - int x_before, x, n_glyphs_before, i, nglyphs; + int x, n_glyphs_before, i, nglyphs; struct it it_before; /* Get the next display element. */ @@ -9504,14 +9504,14 @@ display_tool_bar_line (it, height) } /* Produce glyphs. */ - x_before = it->current_x; - n_glyphs_before = it->glyph_row->used[TEXT_AREA]; + n_glyphs_before = row->used[TEXT_AREA]; it_before = *it; + PRODUCE_GLYPHS (it); nglyphs = row->used[TEXT_AREA] - n_glyphs_before; i = 0; - x = x_before; + x = it_before.current_x; while (i < nglyphs) { struct glyph *glyph = row->glyphs[TEXT_AREA] + n_glyphs_before + i; From 6c1195abb7d1644c9d1b971dbf0fb80af3e97860 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 17 May 2006 22:51:07 +0000 Subject: [PATCH 12/46] (better_font_p): Any font beats no font. (best_matching_font): Simplify based on above change. --- src/xfaces.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/xfaces.c b/src/xfaces.c index a5c5a21f585..b65efa7961e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6383,6 +6383,12 @@ better_font_p (values, font1, font2, compare_pt_p, avgwidth) { int i; + /* Any font is better than no font. */ + if (! font1) + return 0; + if (! font2) + return 1; + for (i = 0; i < DIM (font_sort_order); ++i) { int xlfd_idx = font_sort_order[i]; @@ -6627,29 +6633,19 @@ best_matching_font (f, attrs, fonts, nfonts, width_ratio, needs_overstrike) if (needs_overstrike) *needs_overstrike = 0; - /* Start with the first non-scalable font in the list. */ - for (i = 0; i < nfonts; ++i) - if (!font_scalable_p (fonts + i)) - break; + best = NULL; /* Find the best match among the non-scalable fonts. */ - if (i < nfonts) - { - best = fonts + i; + for (i = 1; i < nfonts; ++i) + if (!font_scalable_p (fonts + i) + && better_font_p (specified, fonts + i, best, 1, avgwidth)) + { + best = fonts + i; - for (i = 1; i < nfonts; ++i) - if (!font_scalable_p (fonts + i) - && better_font_p (specified, fonts + i, best, 1, avgwidth)) - { - best = fonts + i; - - exact_p = exact_face_match_p (specified, best, avgwidth); - if (exact_p) - break; - } - } - else - best = NULL; + exact_p = exact_face_match_p (specified, best, avgwidth); + if (exact_p) + break; + } /* Unless we found an exact match among non-scalable fonts, see if we can find a better match among scalable fonts. */ @@ -6673,8 +6669,7 @@ best_matching_font (f, attrs, fonts, nfonts, width_ratio, needs_overstrike) for (i = 0; i < nfonts; ++i) if (font_scalable_p (fonts + i)) { - if (best == NULL - || better_font_p (specified, fonts + i, best, 0, 0) + if (better_font_p (specified, fonts + i, best, 0, 0) || (!non_scalable_has_exact_height_p && !better_font_p (specified, best, fonts + i, 0, 0))) { @@ -6702,6 +6697,10 @@ best_matching_font (f, attrs, fonts, nfonts, width_ratio, needs_overstrike) } } + /* We should have found SOME font. */ + if (best == NULL) + abort (); + if (font_scalable_p (best)) font_name = build_scalable_font_name (f, best, pt); else From 92daa8486fa0512c1a95e2c251a6432e1421ab36 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 17 May 2006 22:53:23 +0000 Subject: [PATCH 13/46] Comment change. --- src/xterm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index bd0d6db9524..e034e5aa469 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6084,6 +6084,8 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) f = x_any_window_to_frame (dpyinfo, event.xkey.window); + /* If mouse-highlight is an integer, input clears out + mouse highlighting. */ if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) && (f == 0 || !EQ (f->tool_bar_window, dpyinfo->mouse_face_window))) From 32483280976d345b9042ddcf89866e36ac4c0908 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 17 May 2006 22:54:35 +0000 Subject: [PATCH 14/46] (file-name-extension): Doc fix. --- lisp/files.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/files.el b/lisp/files.el index 16df2661fcf..2eaeae5ac86 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3062,6 +3062,7 @@ except that a leading `.', if any, doesn't count." (defun file-name-extension (filename &optional period) "Return FILENAME's final \"extension\". The extension, in a file name, is the part that follows the last `.', +excluding version numbers and backup suffixes, except that a leading `.', if any, doesn't count. Return nil for extensionless file names such as `foo'. Return the empty string for file names such as `foo.'. From 0bcf87358ccef1934800153eb9692df1195486b1 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 17 May 2006 22:54:44 +0000 Subject: [PATCH 15/46] *** empty log message *** --- lisp/ChangeLog | 4 ++++ lispref/ChangeLog | 6 ++++++ man/ChangeLog | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 64a78b0c2bc..b4d3b0d4c62 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-05-17 Richard Stallman + + * files.el (file-name-extension): Doc fix. + 2006-05-17 Stefan Monnier * shell.el (shell-dirtrack-mode): Make it into a proper minor mode, so diff --git a/lispref/ChangeLog b/lispref/ChangeLog index caf04b086a7..39bf92c54d1 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,9 @@ +2006-05-17 Richard Stallman + + * minibuf.texi (Minibuffer History): Clarify. + + * searching.texi (Regexp Special): Clarify nested regexp warning. + 2006-05-16 Kim F. Storm * minibuf.texi (Minibuffer History): Update add-to-history. diff --git a/man/ChangeLog b/man/ChangeLog index 90f3f8a0a27..5641f133277 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,11 @@ +2006-05-17 Richard Stallman + + * files.texi (Diff Mode): Mention C-x `. + +2006-05-08 Richard Stallman + + * custom.texi (Disabling): Textual cleanups. + 2006-05-12 Reiner Steib * message.texi (Interface): Add tool bar customization. From ad598c8b58dd85c94b23918b55091e0ea7f027bc Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 18 May 2006 02:17:39 +0000 Subject: [PATCH 16/46] (CODING_ASCII_INCOMPATIBLE_MASK): New macro. --- src/coding.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/coding.h b/src/coding.h index 9ace4d1e074..54553a071fa 100644 --- a/src/coding.h +++ b/src/coding.h @@ -443,10 +443,12 @@ struct coding_system Lisp_Object translation_table_for_encode; }; -#define CODING_REQUIRE_FLUSHING_MASK 1 -#define CODING_REQUIRE_DECODING_MASK 2 -#define CODING_REQUIRE_ENCODING_MASK 4 -#define CODING_REQUIRE_DETECTION_MASK 8 +/* Mask bits for (struct coding_system *)->common_flags. */ +#define CODING_REQUIRE_FLUSHING_MASK 0x01 +#define CODING_REQUIRE_DECODING_MASK 0x02 +#define CODING_REQUIRE_ENCODING_MASK 0x04 +#define CODING_REQUIRE_DETECTION_MASK 0x08 +#define CODING_ASCII_INCOMPATIBLE_MASK 0x10 /* Return 1 if the coding system CODING requires specific code to be attached at the tail of converted text. */ From 0c2660c849293d23296f758c4a50f6e40432cf2e Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 18 May 2006 02:19:01 +0000 Subject: [PATCH 17/46] (Qascii_incompatible): New variable. (syms_of_coding): Setup Qascii_incompatible. (setup_coding_system): Be sure to initialize coding->common_flags. Check `ascii-incompatible' property of the coding system. --- src/coding.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/coding.c b/src/coding.c index 155da568007..478e119c003 100644 --- a/src/coding.c +++ b/src/coding.c @@ -363,6 +363,7 @@ Lisp_Object Qno_conversion, Qundecided; Lisp_Object Qcoding_system_history; Lisp_Object Qsafe_chars; Lisp_Object Qvalid_codes; +Lisp_Object Qascii_incompatible; extern Lisp_Object Qinsert_file_contents, Qwrite_region; Lisp_Object Qcall_process, Qcall_process_region; @@ -3625,7 +3626,10 @@ setup_coding_system (coding_system, coding) = CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK; } else - coding->eol_type = CODING_EOL_LF; + { + coding->common_flags = 0; + coding->eol_type = CODING_EOL_LF; + } coding_type = XVECTOR (coding_spec)->contents[0]; /* Try short cut. */ @@ -3685,6 +3689,12 @@ setup_coding_system (coding_system, coding) if (!NILP (val)) coding->composing = COMPOSITION_NO; + /* If the coding system is ascii-incompatible, record it in + common_flags. */ + val = Fplist_get (plist, Qascii_incompatible); + if (! NILP (val)) + coding->common_flags |= CODING_ASCII_INCOMPATIBLE_MASK; + switch (XFASTINT (coding_type)) { case 0: @@ -7814,6 +7824,9 @@ syms_of_coding () Qvalid_codes = intern ("valid-codes"); staticpro (&Qvalid_codes); + Qascii_incompatible = intern ("ascii-incompatible"); + staticpro (&Qascii_incompatible); + Qemacs_mule = intern ("emacs-mule"); staticpro (&Qemacs_mule); From 8acb7dad7a13f83bec14cb2c6cbe729ece5271ef Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 18 May 2006 02:20:39 +0000 Subject: [PATCH 18/46] (Fcall_process): Reject encoding arguments by ascii-incompatible coding systems (e.g. utf-16). --- src/ChangeLog | 12 ++++++++++++ src/callproc.c | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index dd8feb509b1..3c527e22dd8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2006-05-18 Kenichi Handa + + * callproc.c (Fcall_process): Reject encoding arguments by + ascii-incompatible coding systems (e.g. utf-16). + + * coding.c (Qascii_incompatible): New variable. + (syms_of_coding): Setup Qascii_incompatible. + (setup_coding_system): Be sure to initialize coding->common_flags. + Check `ascii-incompatible' property of the coding system. + + * coding.h (CODING_ASCII_INCOMPATIBLE_MASK): New macro. + 2006-05-18 Kim F. Storm * xdisp.c (display_tool_bar_line): Restore entire tool-bar geometry when diff --git a/src/callproc.c b/src/callproc.c index 8cf261c646f..f23996253f1 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -295,6 +295,8 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) val = Qnil; } setup_coding_system (Fcheck_coding_system (val), &argument_coding); + if (argument_coding.common_flags & CODING_ASCII_INCOMPATIBLE_MASK) + setup_coding_system (Qraw_text, &argument_coding); if (argument_coding.eol_type == CODING_EOL_UNDECIDED) argument_coding.eol_type = system_eol_type; } From 60eae434e8f376b4ac6a8c3553711c4eb73db930 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 18 May 2006 12:04:40 +0000 Subject: [PATCH 19/46] (ewoc--adjust): New func. (ewoc--insert-new-node): Don't insert trailing newline. Instead, adjust succesor nodes' start markers. (ewoc--refresh-node): Delete all text from current node's start marker to the next one's; adjust successor nodes' start markers. (ewoc--create): Doc fixes. (ewoc--refresh): Don't insert newline. (ewoc--set-hf): Use `ewoc--set-buffer-bind-dll-let*'. --- lisp/emacs-lisp/ewoc.el | 59 +++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el index dbfae49233a..7742de944cb 100644 --- a/lisp/emacs-lisp/ewoc.el +++ b/lisp/emacs-lisp/ewoc.el @@ -205,6 +205,22 @@ BUT if it is the header or the footer in EWOC return nil instead." (eq node (ewoc--footer ewoc))) node)) +(defun ewoc--adjust (beg end node) + ;; "Manually reseat" markers for NODE and its successors (including footer + ;; and dll), in the case where they originally shared start position with + ;; BEG, to END. BEG and END are buffer positions describing NODE's left + ;; neighbor. This operation is functionally equivalent to temporarily + ;; setting these nodes' markers' insertion type to t around the pretty-print + ;; call that precedes the call to `ewoc-adjust', and then changing them back + ;; to nil. + (when (< beg end) + (let (m) + (while (and (= beg (setq m (ewoc--node-start-marker node))) + (progn + (set-marker m end) + (not (eq dll node)))) + (setq node (ewoc--node-right node)))))) + (defun ewoc--insert-new-node (node data pretty-printer) "Insert before NODE a new node for DATA, displayed by PRETTY-PRINTER. Call PRETTY-PRINTER with point at NODE's start, thus pushing back @@ -215,29 +231,26 @@ NODE and leaving the new node's start there. Return the new node." (pos (marker-position m)) (elemnode (ewoc--node-create m data))) (goto-char pos) - ;; Insert the trailing newline using insert-before-markers - ;; so that the start position for the next element is updated. - (insert-before-markers ?\n) - ;; Move back, and call the pretty-printer. - (backward-char 1) (funcall pretty-printer data) (setf (marker-position m) pos (ewoc--node-left elemnode) (ewoc--node-left node) (ewoc--node-right elemnode) node (ewoc--node-right (ewoc--node-left node)) elemnode (ewoc--node-left node) elemnode) + (ewoc--adjust pos (point) node) elemnode))) (defun ewoc--refresh-node (pp node) "Redisplay the element represented by NODE using the pretty-printer PP." - (let ((inhibit-read-only t)) + (let ((inhibit-read-only t) + (m (ewoc--node-start-marker node)) + (R (ewoc--node-right node))) ;; First, remove the string from the buffer: - (delete-region (ewoc--node-start-marker node) - (1- (marker-position - (ewoc--node-start-marker (ewoc--node-right node))))) + (delete-region m (ewoc--node-start-marker R)) ;; Calculate and insert the string. - (goto-char (ewoc--node-start-marker node)) - (funcall pp (ewoc--node-data node)))) + (goto-char m) + (funcall pp (ewoc--node-data node)) + (ewoc--adjust m (point) R))) ;;; =========================================================================== ;;; Public members of the Ewoc package @@ -251,14 +264,12 @@ The ewoc will be inserted in the current buffer at the current position. PRETTY-PRINTER should be a function that takes one argument, an element, and inserts a string representing it in the buffer (at point). The string PRETTY-PRINTER inserts may be empty or span -several lines. A trailing newline will always be inserted -automatically. The PRETTY-PRINTER should use `insert', and not +several lines. The PRETTY-PRINTER should use `insert', and not `insert-before-markers'. -Optional second argument HEADER is a string that will always be -present at the top of the ewoc. HEADER should end with a -newline. Optional third argument FOOTER is similar, and will -be inserted at the bottom of the ewoc." +Optional second and third arguments HEADER and FOOTER are strings, +possibly empty, that will always be present at the top and bottom, +respectively, of the ewoc." (let* ((dummy-node (ewoc--node-create 'DL-LIST 'DL-LIST)) (dll (progn (setf (ewoc--node-right dummy-node) dummy-node) (setf (ewoc--node-left dummy-node) dummy-node) @@ -527,7 +538,6 @@ number of elements needs to be refreshed." (while (not (eq node footer)) (set-marker (ewoc--node-start-marker node) (point)) (funcall pp (ewoc--node-data node)) - (insert "\n") (setq node (ewoc--node-next dll node))))) (set-marker (ewoc--node-start-marker footer) (point)))) @@ -566,11 +576,14 @@ Return nil if the buffer has been deleted." (defun ewoc-set-hf (ewoc header footer) "Set the HEADER and FOOTER of EWOC." - (setf (ewoc--node-data (ewoc--header ewoc)) header) - (setf (ewoc--node-data (ewoc--footer ewoc)) footer) - (save-excursion - (ewoc--refresh-node 'insert (ewoc--header ewoc)) - (ewoc--refresh-node 'insert (ewoc--footer ewoc)))) + (ewoc--set-buffer-bind-dll-let* ewoc + ((head (ewoc--header ewoc)) + (foot (ewoc--footer ewoc))) + (setf (ewoc--node-data head) header + (ewoc--node-data foot) footer) + (save-excursion + (ewoc--refresh-node 'insert head) + (ewoc--refresh-node 'insert foot)))) (provide 'ewoc) From c93a67c54c52f8bf21fa837b6dc84ac132992578 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 18 May 2006 12:07:10 +0000 Subject: [PATCH 20/46] (cvs-make-cvs-buffer): Specify extra newline for ewoc's header and footer. (cvs-update-header): Update initial header recognition. Append newline to final header and footer values. --- lisp/pcvs.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/pcvs.el b/lisp/pcvs.el index b9d04522181..7209c135e52 100644 --- a/lisp/pcvs.el +++ b/lisp/pcvs.el @@ -467,7 +467,7 @@ If non-nil, NEW means to create a new buffer no matter what." (cvs-mode) (set (make-local-variable 'list-buffers-directory) buffer-name) ;;(set (make-local-variable 'cvs-temp-buffer) (cvs-temp-buffer)) - (let ((cookies (ewoc-create 'cvs-fileinfo-pp "\n" ""))) + (let ((cookies (ewoc-create 'cvs-fileinfo-pp "\n\n" "\n"))) (set (make-local-variable 'cvs-cookies) cookies) (add-hook 'kill-buffer-hook (lambda () @@ -618,7 +618,7 @@ If non-nil, NEW means to create a new buffer no matter what." (str (car hf)) (done "") (tin (ewoc-nth cvs-cookies 0))) - (if (eq (length str) 1) (setq str "")) + (if (eq (length str) 2) (setq str "")) ;; look for the first *real* fileinfo (to determine emptyness) (while (and tin @@ -633,6 +633,7 @@ If non-nil, NEW means to create a new buffer no matter what." (setq str (replace-match "" t t str)) (if (zerop (length str)) (setq str "\n")) (setq done (concat "-- last cmd: " cmd " --")))) + (setq str (concat str "\n") done (concat done "\n")) ;; set the new header and footer (ewoc-set-hf cvs-cookies str (concat "\n--------------------- " From 438dd27db31c84723aeac7fe3cd8b06fb84c63a6 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 18 May 2006 12:09:16 +0000 Subject: [PATCH 21/46] (cvs-fileinfo-pp): Insert trailing newline. --- lisp/ChangeLog | 16 ++++++++++++++++ lisp/pcvs-info.el | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b4d3b0d4c62..0955a5da684 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2006-05-18 Thien-Thi Nguyen + + * emacs-lisp/ewoc.el (ewoc--adjust): New func. + (ewoc--insert-new-node): Don't insert trailing newline. + Instead, adjust succesor nodes' start markers. + (ewoc--refresh-node): Delete all text from current node's start + marker to the next one's; adjust successor nodes' start markers. + (ewoc--create): Doc fixes. + (ewoc--refresh): Don't insert newline. + (ewoc--set-hf): Use `ewoc--set-buffer-bind-dll-let*'. + * pcvs.el (cvs-make-cvs-buffer): Specify + extra newline for ewoc's header and footer. + (cvs-update-header): Update initial header recognition. + Append newline to final header and footer values. + * pcvs-info.el (cvs-fileinfo-pp): Insert trailing newline. + 2006-05-17 Richard Stallman * files.el (file-name-extension): Doc fix. diff --git a/lisp/pcvs-info.el b/lisp/pcvs-info.el index 4aaa5add58d..085f294e6fb 100644 --- a/lisp/pcvs-info.el +++ b/lisp/pcvs-info.el @@ -379,7 +379,8 @@ For use by the cookie package." ;; or nothing ""))) (format "%-11s %s %-11s %-11s %s" - side status type base file))))))) + side status type base file)))) + "\n"))) (defun cvs-fileinfo-update (fi fi-new) From a0fa505b419ef7256d7c6f499e7cd09b5383751b Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 18 May 2006 14:38:57 +0000 Subject: [PATCH 22/46] *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0955a5da684..31efe51b263 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-05-18 Kim F. Storm + + * progmodes/grep.el (grep-find): Don't check grep-find-command + before running command (breaks non-interactive usage). + 2006-05-18 Thien-Thi Nguyen * emacs-lisp/ewoc.el (ewoc--adjust): New func. From a34f7eb16500950ad2d328c7718268f4e54f4966 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 18 May 2006 14:39:09 +0000 Subject: [PATCH 23/46] (grep-find): Don't check grep-find-command before running command (breaks non-interactive usage). --- lisp/progmodes/grep.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 410a973d1b4..d207094cafe 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -553,7 +553,7 @@ easily repeat a find command." (read-string "compile.el: No `grep-find-command' command available. Press RET.") (list nil)))) - (when (and grep-find-command command-args) + (when command-args (let ((null-device nil)) ; see grep (grep command-args)))) From 2eec8691173131614036efc7fddc913e3faf8f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 18 May 2006 16:58:16 +0000 Subject: [PATCH 24/46] * configure.in: Add check for ALSA. --- configure.in | 130 +++++++++++++++++++++++++++++---------------------- 1 file changed, 74 insertions(+), 56 deletions(-) diff --git a/configure.in b/configure.in index 31aebae1a1b..e47e6ec94c7 100644 --- a/configure.in +++ b/configure.in @@ -1480,12 +1480,83 @@ AC_CONFIG_LIBOBJ_DIR(src) dnl Do this early because it can frob feature test macros for Unix-98 &c. AC_SYS_LARGEFILE + +dnl This function defintion taken from Gnome 2.0 +dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) +dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page +dnl also defines GSTUFF_PKG_ERRORS on error +AC_DEFUN([PKG_CHECK_MODULES], [ + succeeded=no + + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + + if test "$PKG_CONFIG" = "no" ; then + ifelse([$4], , [AC_MSG_ERROR([ + *** The pkg-config script could not be found. Make sure it is in your path, or give the full path to pkg-config with the PKG_CONFIG environment variable or --with-pkg-config-prog. Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config.])], [$4]) + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + AC_MSG_CHECKING(for $2) + + if $PKG_CONFIG --exists "$2" ; then + AC_MSG_RESULT(yes) + succeeded=yes + + AC_MSG_CHECKING($1_CFLAGS) + $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` + AC_MSG_RESULT($$1_CFLAGS) + + AC_MSG_CHECKING($1_LIBS) + $1_LIBS=`$PKG_CONFIG --libs "$2"` + AC_MSG_RESULT($$1_LIBS) + else + AC_MSG_RESULT(no) + $1_CFLAGS="" + $1_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + ifelse([$4], ,echo $$1_PKG_ERRORS,) + fi + + AC_SUBST($1_CFLAGS) + AC_SUBST($1_LIBS) + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + ifelse([$3], , :, [$3]) + else + ifelse([$4], , [AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.])], [$4]) + fi +]) + + if test "${with_sound}" != "no"; then # Sound support for GNU/Linux and the free BSDs. AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h) # Emulation library used on NetBSD. AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=) AC_SUBST(LIBSOUND) + + ALSA_REQUIRED=1.0.0 + ALSA_MODULES="alsa >= $ALSA_REQUIRED" + dnl Check if --with-pkg-config-prog has been given. + if test "X${with_pkg_config_prog}" != X; then + PKG_CONFIG="${with_pkg_config_prog}" + fi + PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no) + if test $HAVE_ALSA = yes; then + LIBSOUND="$LIBSOUND $ALSA_LIBS" + CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS" + AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.]) + fi + AC_SUBST(CFLAGS_SOUND) fi dnl checks for header files @@ -1943,62 +2014,6 @@ fail; fi fi -dnl This function defintion taken from Gnome 2.0 -dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -AC_DEFUN([PKG_CHECK_MODULES], [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or give the full path to pkg-config with" - echo "*** the PKG_CONFIG environment variable or --with-pkg-config-prog." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , [AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.])], [$4]) - fi -]) - HAVE_GTK=no if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then if test "$USE_X_TOOLKIT" != "none" && test "$USE_X_TOOLKIT" != "maybe"; then @@ -2917,6 +2932,9 @@ AH_BOTTOM([ #ifdef HAVE_SOUNDCARD_H #define HAVE_SOUND 1 #endif +#ifdef HAVE_ALSA +#define HAVE_SOUND 1 +#endif #endif /* __FreeBSD__ || __NetBSD__ || __linux__ */ /* If using GNU, then support inline function declarations. */ From 439f58eeae9b6956db778cd4e461a9827a5962e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 18 May 2006 16:58:44 +0000 Subject: [PATCH 25/46] * configure: Regenerate. --- configure | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 128 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 6a7e3cc9db3..d72790133d7 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # -# Copyright (C) 2003, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -310,7 +310,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LN_S INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB INSTALL_INFO GZIP_PROG LIBSOUND SET_MAKE PKG_CONFIG GTK_CFLAGS GTK_LIBS ALLOCA liblockfile LIBOBJS NEED_SETGID KMEM_GROUP GETLOADAVG_LIBS GETOPT_H GETOPTOBJS version configuration canonical srcdir lispdir locallisppath lisppath x_default_search_path etcdir archlibdir docdir bitmapdir gamedir gameuser c_switch_system c_switch_machine LD_SWITCH_X_SITE LD_SWITCH_X_SITE_AUX C_SWITCH_X_SITE X_TOOLKIT_TYPE machfile opsysfile carbon_appdir LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LN_S INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB INSTALL_INFO GZIP_PROG LIBSOUND PKG_CONFIG ALSA_CFLAGS ALSA_LIBS CFLAGS_SOUND SET_MAKE GTK_CFLAGS GTK_LIBS ALLOCA liblockfile LIBOBJS NEED_SETGID KMEM_GROUP GETLOADAVG_LIBS GETOPT_H GETOPTOBJS version configuration canonical srcdir lispdir locallisppath lisppath x_default_search_path etcdir archlibdir docdir bitmapdir gamedir gameuser c_switch_system c_switch_machine LD_SWITCH_X_SITE LD_SWITCH_X_SITE_AUX C_SWITCH_X_SITE X_TOOLKIT_TYPE machfile opsysfile carbon_appdir LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -5165,6 +5165,10 @@ rm -f conftest* fi + + + + if test "${with_sound}" != "no"; then # Sound support for GNU/Linux and the free BSDs. echo "$as_me:$LINENO: checking for ANSI C header files" >&5 @@ -5629,6 +5633,117 @@ else fi + + ALSA_REQUIRED=1.0.0 + ALSA_MODULES="alsa >= $ALSA_REQUIRED" + if test "X${with_pkg_config_prog}" != X; then + PKG_CONFIG="${with_pkg_config_prog}" + fi + + succeeded=no + + if test -z "$PKG_CONFIG"; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + fi + + if test "$PKG_CONFIG" = "no" ; then + HAVE_ALSA=no + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo "$as_me:$LINENO: checking for $ALSA_MODULES" >&5 +echo $ECHO_N "checking for $ALSA_MODULES... $ECHO_C" >&6 + + if $PKG_CONFIG --exists "$ALSA_MODULES" ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + succeeded=yes + + echo "$as_me:$LINENO: checking ALSA_CFLAGS" >&5 +echo $ECHO_N "checking ALSA_CFLAGS... $ECHO_C" >&6 + ALSA_CFLAGS=`$PKG_CONFIG --cflags "$ALSA_MODULES"` + echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5 +echo "${ECHO_T}$ALSA_CFLAGS" >&6 + + echo "$as_me:$LINENO: checking ALSA_LIBS" >&5 +echo $ECHO_N "checking ALSA_LIBS... $ECHO_C" >&6 + ALSA_LIBS=`$PKG_CONFIG --libs "$ALSA_MODULES"` + echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5 +echo "${ECHO_T}$ALSA_LIBS" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ALSA_CFLAGS="" + ALSA_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + ALSA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$ALSA_MODULES"` + + fi + + + + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + HAVE_ALSA=yes + else + HAVE_ALSA=no + fi + + if test $HAVE_ALSA = yes; then + LIBSOUND="$LIBSOUND $ALSA_LIBS" + CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALSA 1 +_ACEOF + + fi + fi @@ -10195,8 +10310,6 @@ echo "${ECHO_T}before 5" >&6 fi fi - - HAVE_GTK=no if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then if test "$USE_X_TOOLKIT" != "none" && test "$USE_X_TOOLKIT" != "maybe"; then @@ -10258,10 +10371,11 @@ fi fi if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or give the full path to pkg-config with" - echo "*** the PKG_CONFIG environment variable or --with-pkg-config-prog." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." + { { echo "$as_me:$LINENO: error: + *** The pkg-config script could not be found. Make sure it is in your path, or give the full path to pkg-config with the PKG_CONFIG environment variable or --with-pkg-config-prog. Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." >&5 +echo "$as_me: error: + *** The pkg-config script could not be found. Make sure it is in your path, or give the full path to pkg-config with the PKG_CONFIG environment variable or --with-pkg-config-prog. Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." >&2;} + { (exit 1); exit 1; }; } else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then @@ -10285,6 +10399,8 @@ echo $ECHO_N "checking GTK_LIBS... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $GTK_LIBS" >&5 echo "${ECHO_T}$GTK_LIBS" >&6 else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 GTK_CFLAGS="" GTK_LIBS="" ## If we have a custom action on failure, don't print errors, but @@ -23653,8 +23769,11 @@ s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@INSTALL_INFO@,$INSTALL_INFO,;t t s,@GZIP_PROG@,$GZIP_PROG,;t t s,@LIBSOUND@,$LIBSOUND,;t t -s,@SET_MAKE@,$SET_MAKE,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ALSA_CFLAGS@,$ALSA_CFLAGS,;t t +s,@ALSA_LIBS@,$ALSA_LIBS,;t t +s,@CFLAGS_SOUND@,$CFLAGS_SOUND,;t t +s,@SET_MAKE@,$SET_MAKE,;t t s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t s,@GTK_LIBS@,$GTK_LIBS,;t t s,@ALLOCA@,$ALLOCA,;t t From 88fab15ba901ff507dd0b14ef6f084b1785e5ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 18 May 2006 16:59:12 +0000 Subject: [PATCH 26/46] * configure.in: Add check for ALSA. * configure: Regenerate. --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index e2f103f8169..a434af8ca49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-05-18 Jan Dj,Ad(Brv + + * configure.in: Add check for ALSA. + * configure: Regenerate. + 2006-05-06 Eli Zaretskii * Makefile.in (INFO_FILES): Remove emacs-xtra. From 51d139915eab710f75bdc99783b955117bef053e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 18 May 2006 17:04:59 +0000 Subject: [PATCH 27/46] * config.in: Regenerated (HAVE_ALSA). --- src/config.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/config.in b/src/config.in index 2bc4ba56e79..09f7be65b3b 100644 --- a/src/config.in +++ b/src/config.in @@ -87,6 +87,9 @@ Boston, MA 02110-1301, USA. */ */ #undef HAVE_ALLOCA_H +/* Define to 1 if ALSA is available. */ +#undef HAVE_ALSA + /* Define to 1 if you have the `bcmp' function. */ #undef HAVE_BCMP @@ -943,6 +946,9 @@ Boston, MA 02110-1301, USA. */ #ifdef HAVE_SOUNDCARD_H #define HAVE_SOUND 1 #endif +#ifdef HAVE_ALSA +#define HAVE_SOUND 1 +#endif #endif /* __FreeBSD__ || __NetBSD__ || __linux__ */ /* If using GNU, then support inline function declarations. */ From 4900d996ca5fc5e4123fe74b55f7ca4feb1cebc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 18 May 2006 17:05:36 +0000 Subject: [PATCH 28/46] * Makefile.in (CFLAGS_SOUND): New flags for ALSA (ALL_CFLAGS): Add CFLAGS_SOUND --- src/Makefile.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Makefile.in b/src/Makefile.in index ba539b07f90..4b6599dc26d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -280,7 +280,7 @@ TOOLKIT_DEFINES = /* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM since it may have -I options that should override those two. */ -ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAGS) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_SYSTEM_TEMACS ${CFLAGS} +ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAGS) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_SYSTEM_TEMACS ${CFLAGS_SOUND} ${CFLAGS} .c.o: $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< @@ -453,6 +453,7 @@ LIBX= $(LIBXMENU) LD_SWITCH_X_SITE -lX10 LIBX10_MACHINE LIBX10_SYSTEM #endif /* not HAVE_X_WINDOWS */ LIBSOUND= @LIBSOUND@ +CFLAGS_SOUND= @CFLAGS_SOUND@ #ifndef ORDINARY_LINK /* Fix linking if compiled with GCC. */ From 2d2643f6535ee6160abbf2d6adfe5898ebdc2a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 18 May 2006 17:06:01 +0000 Subject: [PATCH 29/46] * sound.c (alsa_sound_perror, alsa_open, alsa_period_size) (alsa_configure, alsa_close, alsa_choose_format, alsa_write) (snd_error_quiet, alsa_init): New functions. (vox_init): Return 0 if unable to open device. (Fplay_sound_internal): Test for alsa first and use vox (oss) as a fallback. (struct sound_device): Add period_size. (wav_play, au_play): Use period_size if set. --- src/sound.c | 401 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 392 insertions(+), 9 deletions(-) diff --git a/src/sound.c b/src/sound.c index 0fbeceb4b9e..2ceefd3bce3 100644 --- a/src/sound.c +++ b/src/sound.c @@ -73,6 +73,10 @@ Boston, MA 02110-1301, USA. */ #ifdef HAVE_SOUNDCARD_H #include #endif +#ifdef HAVE_ALSA +#include +#endif + /* END: Non Windows Includes */ #else /* WINDOWSNT */ @@ -121,6 +125,9 @@ static int parse_sound P_ ((Lisp_Object, Lisp_Object *)); #ifndef DEFAULT_SOUND_DEVICE #define DEFAULT_SOUND_DEVICE "/dev/dsp" #endif +#ifndef DEFAULT_ALSA_SOUND_DEVICE +#define DEFAULT_ALSA_SOUND_DEVICE "default" +#endif /* Structure forward declarations. */ @@ -227,6 +234,10 @@ struct sound_device void (* choose_format) P_ ((struct sound_device *sd, struct sound *s)); + /* Return a preferred data size in bytes to be sent to write (below) + each time. 2048 is used if this is NULL. */ + int (* period_size) P_ ((struct sound_device *sd)); + /* Write NYBTES bytes from BUFFER to device SD. */ void (* write) P_ ((struct sound_device *sd, const char *buffer, int nbytes)); @@ -280,7 +291,7 @@ static void vox_open P_ ((struct sound_device *)); static void vox_configure P_ ((struct sound_device *)); static void vox_close P_ ((struct sound_device *sd)); static void vox_choose_format P_ ((struct sound_device *, struct sound *)); -static void vox_init P_ ((struct sound_device *)); +static int vox_init P_ ((struct sound_device *)); static void vox_write P_ ((struct sound_device *, const char *, int)); static void find_sound_type P_ ((struct sound *)); static u_int32_t le2hl P_ ((u_int32_t)); @@ -604,7 +615,7 @@ wav_play (s, sd) { char *buffer; int nbytes; - int blksize = 2048; + int blksize = sd->period_size ? sd->period_size (sd) : 2048; buffer = (char *) alloca (blksize); lseek (s->fd, sizeof *header, SEEK_SET); @@ -633,7 +644,8 @@ enum au_encoding AU_ENCODING_32, AU_ENCODING_IEEE32, AU_ENCODING_IEEE64, - AU_COMPRESSED = 23 + AU_COMPRESSED = 23, + AU_ENCODING_ALAW_8 = 27 }; @@ -689,7 +701,7 @@ au_play (s, sd) SBYTES (s->data) - header->data_offset); else { - int blksize = 2048; + int blksize = sd->period_size ? sd->period_size (sd) : 2048; char *buffer; int nbytes; @@ -868,16 +880,33 @@ vox_choose_format (sd, s) /* Initialize device SD. Set up the interface functions in the device structure. */ -static void +static int vox_init (sd) struct sound_device *sd; { + char *file; + int fd; + + /* Open the sound device. Default is /dev/dsp. */ + if (sd->file) + file = sd->file; + else + file = DEFAULT_SOUND_DEVICE; + fd = emacs_open (file, O_WRONLY, 0); + if (fd >= 0) + emacs_close (fd); + else + return 0; + sd->fd = -1; sd->open = vox_open; sd->close = vox_close; sd->configure = vox_configure; sd->choose_format = vox_choose_format; sd->write = vox_write; + sd->period_size = NULL; + + return 1; } /* Write NBYTES bytes from BUFFER to device SD. */ @@ -893,6 +922,359 @@ vox_write (sd, buffer, nbytes) sound_perror ("Error writing to sound device"); } +#ifdef HAVE_ALSA +/*********************************************************************** + ALSA Driver Interface + ***********************************************************************/ + +/* This driver is available on GNU/Linux. */ + +static void +alsa_sound_perror (msg, err) + char *msg; + int err; +{ + error ("%s: %s", msg, snd_strerror (err)); +} + +struct alsa_params +{ + snd_pcm_t *handle; + snd_pcm_hw_params_t *hwparams; + snd_pcm_sw_params_t *swparams; + snd_pcm_uframes_t period_size; +}; + +/* Open device SD. If SD->file is non-null, open that device, + otherwise use a default device name. */ + +static void +alsa_open (sd) + struct sound_device *sd; +{ + char *file; + struct alsa_params *p; + int err; + + /* Open the sound device. Default is "default". */ + if (sd->file) + file = sd->file; + else + file = DEFAULT_ALSA_SOUND_DEVICE; + + p = xmalloc (sizeof (*p)); + p->handle = NULL; + p->hwparams = NULL; + p->swparams = NULL; + + sd->fd = -1; + sd->data = p; + + + if ((err = snd_pcm_open (&p->handle, file, SND_PCM_STREAM_PLAYBACK, 0)) < 0) + alsa_sound_perror (file, err); +} + +static int +alsa_period_size (sd) + struct sound_device *sd; +{ + struct alsa_params *p = (struct alsa_params *) sd->data; + return p->period_size; +} + +static void +alsa_configure (sd) + struct sound_device *sd; +{ + int val, err, dir; + struct alsa_params *p = (struct alsa_params *) sd->data; + snd_pcm_uframes_t buffer_size; + + xassert (p->handle != 0); + + if ((err = snd_pcm_hw_params_malloc (&p->hwparams)) < 0) + alsa_sound_perror ("Could not allocate hardware parameter structure", err); + + if ((err = snd_pcm_sw_params_malloc (&p->swparams)) < 0) + alsa_sound_perror ("Could not allocate software parameter structure", err); + + if ((err = snd_pcm_hw_params_any (p->handle, p->hwparams)) < 0) + alsa_sound_perror ("Could not initialize hardware parameter structure", err); + + if ((err = snd_pcm_hw_params_set_access (p->handle, p->hwparams, + SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) + alsa_sound_perror ("Could not set access type", err); + + val = sd->format; + if ((err = snd_pcm_hw_params_set_format (p->handle, p->hwparams, val)) < 0) + alsa_sound_perror ("Could not set sound format", err); + + val = sd->sample_rate; + if ((err = snd_pcm_hw_params_set_rate_near (p->handle, p->hwparams, &val, 0)) + < 0) + alsa_sound_perror ("Could not set sample rate", err); + + val = sd->channels; + if ((err = snd_pcm_hw_params_set_channels (p->handle, p->hwparams, val)) < 0) + alsa_sound_perror ("Could not set channel count", err); + + + err = snd_pcm_hw_params_get_period_size (p->hwparams, &p->period_size, &dir); + if (err < 0) + alsa_sound_perror ("Unable to get period size for playback", err); + + err = snd_pcm_hw_params_get_buffer_size (p->hwparams, &buffer_size); + if (err < 0) + alsa_sound_perror("Unable to get buffer size for playback", err); + + if ((err = snd_pcm_hw_params (p->handle, p->hwparams)) < 0) + alsa_sound_perror ("Could not set parameters", err); + + err = snd_pcm_sw_params_current (p->handle, p->swparams); + if (err < 0) + alsa_sound_perror ("Unable to determine current swparams for playback", + err); + + /* Start the transfer when the buffer is almost full */ + err = snd_pcm_sw_params_set_start_threshold (p->handle, p->swparams, + (buffer_size / p->period_size) + * p->period_size); + if (err < 0) + alsa_sound_perror ("Unable to set start threshold mode for playback", err); + + /* Allow the transfer when at least period_size samples can be processed */ + err = snd_pcm_sw_params_set_avail_min (p->handle, p->swparams, p->period_size); + if (err < 0) + alsa_sound_perror ("Unable to set avail min for playback", err); + + /* Align all transfers to 1 period */ + err = snd_pcm_sw_params_set_xfer_align (p->handle, p->swparams, + p->period_size); + if (err < 0) + alsa_sound_perror ("Unable to set transfer align for playback", err); + + err = snd_pcm_sw_params (p->handle, p->swparams); + if (err < 0) + alsa_sound_perror ("Unable to set sw params for playback\n", err); + + snd_pcm_hw_params_free (p->hwparams); + p->hwparams = NULL; + snd_pcm_sw_params_free (p->swparams); + p->swparams = NULL; + + if ((err = snd_pcm_prepare (p->handle)) < 0) + alsa_sound_perror ("Could not prepare audio interface for use", err); + + if (sd->volume > 0) + { + int chn; + snd_mixer_t *handle; + snd_mixer_elem_t *e; + char *file = sd->file ? sd->file : DEFAULT_ALSA_SOUND_DEVICE; + + if (snd_mixer_open (&handle, 0) >= 0) + { + if (snd_mixer_attach (handle, file) >= 0 + && snd_mixer_load (handle) >= 0 + && snd_mixer_selem_register (handle, NULL, NULL) >= 0) + for (e = snd_mixer_first_elem (handle); + e; + e = snd_mixer_elem_next (e)) + { + if (snd_mixer_selem_has_playback_volume (e)) + { + long pmin, pmax; + snd_mixer_selem_get_playback_volume_range (e, &pmin, &pmax); + long vol = pmin + (sd->volume * (pmax - pmin)) / 100; + + for (chn = 0; chn <= SND_MIXER_SCHN_LAST; chn++) + snd_mixer_selem_set_playback_volume (e, chn, vol); + } + } + snd_mixer_close(handle); + } + } +} + + +/* Close device SD if it is open. */ + +static void +alsa_close (sd) + struct sound_device *sd; +{ + struct alsa_params *p = (struct alsa_params *) sd->data; + if (p) + { + if (p->hwparams) + snd_pcm_hw_params_free (p->hwparams); + if (p->swparams) + snd_pcm_sw_params_free (p->swparams); + if (p->handle) + { + snd_pcm_drain(p->handle); + snd_pcm_close (p->handle); + } + free (p); + } +} + +/* Choose device-dependent format for device SD from sound file S. */ + +static void +alsa_choose_format (sd, s) + struct sound_device *sd; + struct sound *s; +{ + struct alsa_params *p = (struct alsa_params *) sd->data; + if (s->type == RIFF) + { + struct wav_header *h = (struct wav_header *) s->header; + if (h->precision == 8) + sd->format = SND_PCM_FORMAT_U8; + else if (h->precision == 16) + sd->format = SND_PCM_FORMAT_S16_LE; + else + error ("Unsupported WAV file format"); + } + else if (s->type == SUN_AUDIO) + { + struct au_header *header = (struct au_header *) s->header; + switch (header->encoding) + { + case AU_ENCODING_ULAW_8: + sd->format = SND_PCM_FORMAT_MU_LAW; + break; + case AU_ENCODING_ALAW_8: + sd->format = SND_PCM_FORMAT_A_LAW; + break; + case AU_ENCODING_IEEE32: + sd->format = SND_PCM_FORMAT_FLOAT_BE; + break; + case AU_ENCODING_IEEE64: + sd->format = SND_PCM_FORMAT_FLOAT64_BE; + break; + case AU_ENCODING_8: + sd->format = SND_PCM_FORMAT_S8; + break; + case AU_ENCODING_16: + sd->format = SND_PCM_FORMAT_S16_BE; + break; + case AU_ENCODING_24: + sd->format = SND_PCM_FORMAT_S24_BE; + break; + case AU_ENCODING_32: + sd->format = SND_PCM_FORMAT_S32_BE; + break; + + default: + error ("Unsupported AU file format"); + } + } + else + abort (); +} + + +/* Write NBYTES bytes from BUFFER to device SD. */ + +static void +alsa_write (sd, buffer, nbytes) + struct sound_device *sd; + const char *buffer; + int nbytes; +{ + struct alsa_params *p = (struct alsa_params *) sd->data; + + /* The the third parameter to snd_pcm_writei is frames, not bytes. */ + int fact = snd_pcm_format_size (sd->format, 1) * sd->channels; + int nwritten = 0; + int err; + + while (nwritten < nbytes) + { + if ((err = snd_pcm_writei (p->handle, + buffer + nwritten, + (nbytes - nwritten)/fact)) < 0) + { + fprintf(stderr, "Err %d/%s\n", err, snd_strerror(err)); + if (err == -EPIPE) + { /* under-run */ + err = snd_pcm_prepare (p->handle); + if (err < 0) + alsa_sound_perror ("Can't recover from underrun, prepare failed", + err); + } + else if (err == -ESTRPIPE) + { + while ((err = snd_pcm_resume (p->handle)) == -EAGAIN) + sleep(1); /* wait until the suspend flag is released */ + if (err < 0) + { + err = snd_pcm_prepare (p->handle); + if (err < 0) + alsa_sound_perror ("Can't recover from suspend, " + "prepare failed", + err); + } + } + else + alsa_sound_perror ("Error writing to sound device", err); + + } + else + nwritten += err * fact; + } +} + +static void +snd_error_quiet (file, line, function, err, fmt) + const char *file; + int line; + const char *function; + int err; + const char *fmt; +{ +} + +/* Initialize device SD. Set up the interface functions in the device + structure. */ + +static int +alsa_init (sd) + struct sound_device *sd; +{ + char *file; + snd_pcm_t *handle; + int err; + + /* Open the sound device. Default is "default". */ + if (sd->file) + file = sd->file; + else + file = DEFAULT_ALSA_SOUND_DEVICE; + + snd_lib_error_set_handler ((snd_lib_error_handler_t) snd_error_quiet); + err = snd_pcm_open (&handle, file, SND_PCM_STREAM_PLAYBACK, 0); + snd_lib_error_set_handler (NULL); + if (err < 0) + return 0; + + sd->fd = -1; + sd->open = alsa_open; + sd->close = alsa_close; + sd->configure = alsa_configure; + sd->choose_format = alsa_choose_format; + sd->write = alsa_write; + sd->period_size = alsa_period_size; + + return 1; +} + +#endif /* HAVE_ALSA */ + + /* END: Non Windows functions */ #else /* WINDOWSNT */ @@ -1056,10 +1438,11 @@ Internal use only, use `play-sound' instead.\n */) args[1] = sound; Frun_hook_with_args (2, args); - /* There is only one type of device we currently support, the VOX - sound driver. Set up the device interface functions for that - device. */ - vox_init (current_sound_device); +#ifdef HAVE_ALSA + if (!alsa_init (current_sound_device)) +#endif + if (!vox_init (current_sound_device)) + error ("No usable sound device driver found"); /* Open the device. */ current_sound_device->open (current_sound_device); From a940e2c652c2d9bec1f088a1c801403fb9378e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 18 May 2006 17:06:55 +0000 Subject: [PATCH 30/46] * config.in: Regenerated (HAVE_ALSA). * sound.c (alsa_sound_perror, alsa_open, alsa_period_size) (alsa_configure, alsa_close, alsa_choose_format, alsa_write) (snd_error_quiet, alsa_init): New functions. (vox_init): Return 0 if unable to open device. (Fplay_sound_internal): Test for alsa first and use vox (oss) as a fallback. (struct sound_device): Add period_size. (wav_play, au_play): Use period_size if set. * Makefile.in (CFLAGS_SOUND): New flags for ALSA (ALL_CFLAGS): Add CFLAGS_SOUND --- src/ChangeLog | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 3c527e22dd8..e0f844b284e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +2006-05-18 Jan Dj,Ad(Brv + + * config.in: Regenerated (HAVE_ALSA). + + * sound.c (alsa_sound_perror, alsa_open, alsa_period_size) + (alsa_configure, alsa_close, alsa_choose_format, alsa_write) + (snd_error_quiet, alsa_init): New functions. + (vox_init): Return 0 if unable to open device. + (Fplay_sound_internal): Test for alsa first and use vox (oss) as + a fallback. + (struct sound_device): Add period_size. + (wav_play, au_play): Use period_size if set. + + * Makefile.in (CFLAGS_SOUND): New flags for ALSA + (ALL_CFLAGS): Add CFLAGS_SOUND + 2006-05-18 Kenichi Handa * callproc.c (Fcall_process): Reject encoding arguments by From d7ba2a0133de877bb573cabbadb48983c69ba6fb Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Thu, 18 May 2006 17:50:53 +0000 Subject: [PATCH 31/46] (wid-edit): Require. (defun-gmm): Renamed from `gmm-defun-compat'. (gmm-image-search-load-path): Use it. (gmm-image-load-path-for-library): Use it. Sync with `mh-compat.el'. --- lisp/gnus/ChangeLog | 8 ++++++++ lisp/gnus/gmm-utils.el | 22 ++++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 7f0f248c7cf..3cba77d4b21 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,10 @@ +2006-05-18 Reiner Steib + + * gmm-utils.el (wid-edit): Require. + (defun-gmm): Renamed from `gmm-defun-compat'. + (gmm-image-search-load-path): Use it. + (gmm-image-load-path-for-library): Use it. Sync with `mh-compat.el'. + 2006-05-04 Stefan Monnier * mm-decode.el (mm-dissect-buffer): Remove spurious double assignment. @@ -4112,6 +4119,7 @@ See ChangeLog.2 for earlier changes. ;; Local Variables: ;; coding: iso-2022-7bit +;; fill-column: 79 ;; End: ;;; arch-tag: 3f33a3e7-090d-492b-bedd-02a1417d32b4 diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index 4db811053ec..f314d0e81d7 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el @@ -30,7 +30,7 @@ ;;; Code: -;; (require 'wid-edit) +(require 'wid-edit) (defgroup gmm nil "Utility functions for Gnus, Message and MML" @@ -279,11 +279,7 @@ DEFAULT-MAP specifies the default key map for ICON-LIST." icon-list)) tool-bar-map)) -;; WARNING: The following is subject to change. Don't rely on it yet. - -;; From MH-E without modifications: - -(defmacro gmm-defun-compat (name function arg-list &rest body) +(defmacro defun-gmm (name function arg-list &rest body) "Create function NAME. If FUNCTION exists, then NAME becomes an alias for FUNCTION. Otherwise, create function NAME with ARG-LIST and BODY." @@ -292,21 +288,19 @@ Otherwise, create function NAME with ARG-LIST and BODY." `(defalias ',name ',function) `(defun ,name ,arg-list ,@body)))) -(gmm-defun-compat gmm-image-search-load-path +(defun-gmm gmm-image-search-load-path image-search-load-path (file &optional path) "Emacs 21 and XEmacs don't have `image-search-load-path'. This function returns nil on those systems." nil) -;; From MH-E with modifications: +;; Cf. `mh-image-load-path-for-library' in `mh-compat.el'. -;; Don't use `gmm-defun-compat' until API changes in -;; `image-load-path-for-library' in Emacs CVS are completed. +(defun-gmm gmm-image-load-path-for-library + image-load-path-for-library (library image &optional path no-error) + "Return a suitable search path for images used by LIBRARY. -(defun gmm-image-load-path-for-library (library image &optional path no-error) - "Return a suitable search path for images relative to LIBRARY. - -First it searches for IMAGE in `image-load-path' (excluding +It searches for IMAGE in `image-load-path' (excluding \"`data-directory'/images\") and `load-path', followed by a path suitable for LIBRARY, which includes \"../../etc/images\" and \"../etc/images\" relative to the library file itself, and then From f18df03d4a0494455b1cfc9540c725b2081fce65 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 18 May 2006 23:59:14 +0000 Subject: [PATCH 32/46] Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 102) - Update from CVS Revision: emacs@sv.gnu.org/emacs--devo--0--patch-287 --- lisp/gnus/ChangeLog | 3 +++ lisp/gnus/gnus-sum.el | 4 ++-- man/ChangeLog | 5 +++++ man/gnus.texi | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 3cba77d4b21..1e5bfa23ed3 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,8 @@ 2006-05-18 Reiner Steib + * gnus-sum.el (gnus-summary-save-article-mail): Clarify doc string. + (gnus-summary-expire-articles-now): Shorten prompt. + * gmm-utils.el (wid-edit): Require. (defun-gmm): Renamed from `gmm-defun-compat'. (gmm-image-search-load-path): Use it. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index daecb1701cd..5208ae27eb9 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9507,7 +9507,7 @@ deleted forever, right now." (interactive) (or gnus-expert-user (gnus-yes-or-no-p - "Are you really, really, really sure you want to delete all these messages? ") + "Are you really, really sure you want to delete all expirable messages? ") (error "Phew!")) (gnus-summary-expire-articles t)) @@ -11043,7 +11043,7 @@ If HEADERS (the symbolic prefix), include the headers, too." (gnus-configure-windows 'pipe)))) (defun gnus-summary-save-article-mail (&optional arg) - "Append the current article to an mail file. + "Append the current article to a Unix mail box file. If N is a positive number, save the N next articles. If N is a negative number, save the N previous articles. If N is nil and any articles have been marked with the process mark, diff --git a/man/ChangeLog b/man/ChangeLog index 5641f133277..1f716090c73 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2006-05-18 Reiner Steib + + * gnus.texi (Saving Articles): Clarify gnus-summary-save-article-mail. + 2006-05-17 Richard Stallman * files.texi (Diff Mode): Mention C-x `. @@ -6230,6 +6234,7 @@ ;; Local Variables: ;; coding: iso-2022-7bit +;; fill-column: 79 ;; End: Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, diff --git a/man/gnus.texi b/man/gnus.texi index 9623bc468d9..b1654b8302f 100644 --- a/man/gnus.texi +++ b/man/gnus.texi @@ -7377,7 +7377,7 @@ Save the current article using the default article saver @item O m @kindex O m (Summary) @findex gnus-summary-save-article-mail -Save the current article in mail format +Save the current article in a Unix mail box (mbox) file (@code{gnus-summary-save-article-mail}). @item O r From a37288ad91ae681f5239ea3eb5c7d975341c3f70 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 19 May 2006 03:31:44 +0000 Subject: [PATCH 33/46] *** empty log message *** --- etc/TODO | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/TODO b/etc/TODO index d210ecb7d6d..757e040562a 100644 --- a/etc/TODO +++ b/etc/TODO @@ -135,6 +135,8 @@ to the FSF. * Other features we would like: +** Remove the default toggling behavior of minor modes when called from elisp +rather than interactively. This a trivial one-liner in easy-mode.el. ** Create a category of errors called `user-error' for errors which are typically due to pilot errors and should thus be in debug-ignored-errors. From a161b46d27b3b9deb0aa218a108ff53af0ecca7f Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 19 May 2006 04:25:54 +0000 Subject: [PATCH 34/46] (mik): Table corrected. --- lisp/ChangeLog | 4 ++++ lisp/international/code-pages.el | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 31efe51b263..8d6dfbba75a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-05-19 Alexander Shopov (tiny change) + + * international/code-pages.el (mik): Table corrected. + 2006-05-18 Kim F. Storm * progmodes/grep.el (grep-find): Don't check grep-find-command diff --git a/lisp/international/code-pages.el b/lisp/international/code-pages.el index 359773ac346..13181268b36 100644 --- a/lisp/international/code-pages.el +++ b/lisp/international/code-pages.el @@ -4489,7 +4489,7 @@ Return an updated `non-iso-charset-alist'." ;; Suggested by Anton Zinoviev : Bulgarian DOS ;; codepage. Table at -;; . +;; . ;;;###autoload(autoload-coding-system 'mik '(require 'code-pages)) (cp-make-coding-system mik @@ -4497,7 +4497,7 @@ Return an updated `non-iso-charset-alist'." ?Ч ?Ш ?Щ ?Ъ ?Ы ?Ь ?Э ?Ю ?Я ?а ?б ?в ?г ?д ?е ?ж ?з ?и ?й ?к ?л ?м ?н ?о ?п ?р ?с ?т ?у ?ф ?х ?ц ?ч ?ш ?щ ?ъ ?ы ?ь ?э ?ю ?я ?└ ?┴ ?┬ ?├ ?─ ?┼ ?╣ ?║ ?╚ ?╔ ?╩ ?╦ ?╠ ?═ ?╬ ?┐ ?░ ?▒ ?▓ ?│ ?┤ ?№ ?§ ?╗ ?╝ ?┘ ?┌ ?█ - ?▄ ?▌ ?▐ ?▀ ?α ?β ?Γ ?π ?Σ ?σ ?μ ?τ ?Φ ?Θ ?Ω ?δ ?∞ ?∅ ?∈ ?∩ ?≡ ?± ?≥ + ?▄ ?▌ ?▐ ?▀ ?α ?ß ?Γ ?π ?Σ ?σ ?µ ?τ ?Φ ?Θ ?Ω ?δ ?∞ ?φ ?ε ?∩ ?≡ ?± ?≥ ?≤ ?⌠ ?⌡ ?÷ ?≈ ?° ?∙ ?· ?√ ?ⁿ ?² ?■ ? ]) (coding-system-put 'mik 'mime-charset nil) From 04c34eb88e1965927221b04716f679e01b126cc8 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 19 May 2006 05:57:07 +0000 Subject: [PATCH 35/46] (Digression concerning error): Fix typo. --- lispintro/ChangeLog | 4 ++++ lispintro/emacs-lisp-intro.texi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lispintro/ChangeLog b/lispintro/ChangeLog index 753aec71d80..731e734f78c 100644 --- a/lispintro/ChangeLog +++ b/lispintro/ChangeLog @@ -1,3 +1,7 @@ +2006-05-19 Thien-Thi Nguyen + + * emacs-lisp-intro.texi (Digression concerning error): Fix typo. + 2005-09-16 Romain Francoise * emacs-lisp-intro.texi (GNU Free Documentation License): diff --git a/lispintro/emacs-lisp-intro.texi b/lispintro/emacs-lisp-intro.texi index c7fef17061f..f941f3e44ba 100644 --- a/lispintro/emacs-lisp-intro.texi +++ b/lispintro/emacs-lisp-intro.texi @@ -18278,7 +18278,7 @@ But a human expects to attempt this sort of thing, if only to find out whether the kill ring is full or empty. This is an act of exploration. -(From the human point of view, the act of exploration and discovery is +From the human point of view, the act of exploration and discovery is not necessarily an error, and therefore should not be labelled as one, even in the bowels of a computer. As it is, the code in Emacs implies that a human who is acting virtuously, by exploring his or her From e6b71a8f0aea6e968d3d014eb5f3b9137ffe9bbc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 19 May 2006 08:24:21 +0000 Subject: [PATCH 36/46] *** empty log message *** --- lisp/ChangeLog | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8d6dfbba75a..3f351d5fbaa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,28 @@ +2006-05-19 Glenn Morris + + * calendar/diary-lib.el (diary-bahai-date) + (list-bahai-diary-entries, mark-bahai-diary-entries) + (mark-bahai-calendar-date-pattern): Not interactive. + (add-to-diary-list): New optional arg LITERAL. Doc fix. + (diary-entries-list): Change format of 4th element in each entry. + (diary-list-entries): Use add-to-diary-list. + (diary-goto-entry): Handle the case where the buffer visiting the + diary has been killed. + (fancy-diary-display): Add 'locator to button rather than 'marker. + Only generate temp-face when there are marks to apply. + (list-sexp-diary-entries): Pass literal to add-to-diary-list. + (diary-fancy-date-pattern): New variable. + (diary-time-regexp): Doc fix. + (diary-anniversary, diary-time): New faces. + (fancy-diary-font-lock-keywords): Use diary-fancy-date-pattern and + diary-time-regexp. Add font-lock-multiline property where needed. + Use new faces diary-anniversary and diary-time. + (diary-fancy-font-lock-fontify-region-function): New function, to + handle multiline font-lock pattern in fancy diary. + (fancy-diary-display-mode): Set font-lock-fontify-region-function. + (diary-font-lock-keywords): Tweak time regexp. Use new face + diary-time. + 2006-05-19 Alexander Shopov (tiny change) * international/code-pages.el (mik): Table corrected. From e652c999deb85c535f3beedbc22d4075947670fb Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 19 May 2006 08:24:51 +0000 Subject: [PATCH 37/46] (diary-bahai-date) (list-bahai-diary-entries, mark-bahai-diary-entries) (mark-bahai-calendar-date-pattern): Not interactive. (add-to-diary-list): New optional arg LITERAL. Doc fix. (diary-entries-list): Change format of 4th element in each entry. (diary-list-entries): Use add-to-diary-list. (diary-goto-entry): Handle the case where the buffer visiting the diary has been killed. (fancy-diary-display): Add 'locator to button rather than 'marker. Only generate temp-face when there are marks to apply. (list-sexp-diary-entries): Pass literal to add-to-diary-list. (diary-fancy-date-pattern): New variable. (diary-time-regexp): Doc fix. (diary-anniversary, diary-time): New faces. (fancy-diary-font-lock-keywords): Use diary-fancy-date-pattern and diary-time-regexp. Add font-lock-multiline property where needed. Use new faces diary-anniversary and diary-time. (diary-fancy-font-lock-fontify-region-function): New function, to handle multiline font-lock pattern in fancy diary. (fancy-diary-display-mode): Set font-lock-fontify-region-function. (diary-font-lock-keywords): Tweak time regexp. Use new face diary-time. --- lisp/calendar/diary-lib.el | 301 +++++++++++++++++++++++-------------- 1 file changed, 189 insertions(+), 112 deletions(-) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index c27939b8075..947de0f2136 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -121,20 +121,16 @@ The holidays are those in the list `calendar-holidays'.") "Mark dates in calendar window that conform to Islamic date MONTH/DAY/YEAR.") (autoload 'diary-bahai-date "cal-bahai" - "Baha'i calendar equivalent of date diary entry." - t) + "Baha'i calendar equivalent of date diary entry.") (autoload 'list-bahai-diary-entries "cal-bahai" - "Add any Baha'i date entries from the diary file to `diary-entries-list'." - t) + "Add any Baha'i date entries from the diary file to `diary-entries-list'.") (autoload 'mark-bahai-diary-entries "cal-bahai" - "Mark days in the calendar window that have Baha'i date diary entries." - t) + "Mark days in the calendar window that have Baha'i date diary entries.") (autoload 'mark-bahai-calendar-date-pattern "cal-bahai" - "Mark dates in calendar window that conform to Baha'i date MONTH/DAY/YEAR." - t) + "Mark dates in calendar window that conform to Baha'i date MONTH/DAY/YEAR.") (autoload 'diary-hebrew-date "cal-hebrew" "Hebrew calendar equivalent of date diary entry.") @@ -323,6 +319,42 @@ number of days of diary entries displayed." (integer :tag "Saturday"))) :group 'diary) + +(defvar diary-modify-entry-list-string-function nil + "Function applied to entry string before putting it into the entries list. +Can be used by programs integrating a diary list into other buffers (e.g. +org.el and planner.el) to modify the string or add properties to it. +The function takes a string argument and must return a string.") + +(defun add-to-diary-list (date string specifier &optional marker + globcolor literal) + "Add an entry to `diary-entries-list'. +Do nothing if DATE or STRING is nil. DATE is the (MONTH DAY +YEAR) for which the entry applies; STRING is the text of the +entry as it will appear in the diary (i.e. with any format +strings such as \%d\" expanded); SPECIFIER is the date part of +the entry as it appears in the diary-file; LITERAL is the entry +as it appears in the diary-file (i.e. before expansion). If +LITERAL is nil, it is taken to be the same as STRING. + +The entry is added to the list as (DATE STRING SPECIFIER LOCATOR +GLOBCOLOR), where LOCATOR has the form (MARKER FILENAME LITERAL), +FILENAME being the file containing the diary entry." + (when (and date string) + (if diary-file-name-prefix + (let ((prefix (funcall diary-file-name-prefix-function + (buffer-file-name)))) + (or (string= prefix "") + (setq string (format "[%s] %s" prefix string))))) + (and diary-modify-entry-list-string-function + (setq string (funcall diary-modify-entry-list-string-function + string))) + (setq diary-entries-list + (append diary-entries-list + (list (list date string specifier + (list marker (buffer-file-name) literal) + globcolor)))))) + (define-obsolete-function-alias 'list-diary-entries 'diary-list-entries) (defun diary-list-entries (date number &optional list-only) "Create and display a buffer containing the relevant lines in `diary-file'. @@ -468,9 +500,7 @@ If LIST-ONLY is non-nil don't modify or display the buffer, only return a list." (copy-marker entry-start) (nth 1 temp))))))) (or entry-found (not diary-list-include-blanks) - (setq diary-entries-list - (append diary-entries-list - (list (list date "" "" "" ""))))) + (add-to-diary-list date "" "" "" "")) (setq date (calendar-gregorian-from-absolute (1+ (calendar-absolute-from-gregorian date)))) @@ -577,10 +607,27 @@ changing the variable `diary-include-string'." 'face 'diary-button) (defun diary-goto-entry (button) - (let ((marker (button-get button 'marker))) - (when marker - (pop-to-buffer (marker-buffer marker)) - (goto-char (marker-position marker))))) + (let* ((locator (button-get button 'locator)) + (marker (car locator)) + markbuf file) + ;; If marker pointing to diary location is valid, use that. + (if (and marker (setq markbuf (marker-buffer marker))) + (progn + (pop-to-buffer markbuf) + (goto-char (marker-position marker))) + ;; Marker is invalid (eg buffer has been killed). + (or (and (setq file (cadr locator)) + (file-exists-p file) + (find-file-other-window file) + (progn + (when (eq major-mode default-major-mode) (diary-mode)) + (goto-char (point-min)) + (if (re-search-forward (format "%s.*\\(%s\\)" + (regexp-quote (nth 2 locator)) + (regexp-quote (nth 3 locator))) + nil t) + (goto-char (match-beginning 1))))) + (message "Unable to locate this diary entry"))))) (defun fancy-diary-display () "Prepare a diary buffer with relevant entries in a fancy, noneditable form. @@ -666,37 +713,45 @@ This function is provided for optional use as the `diary-display-hook'." (setq entry (car (cdr (car entry-list)))) (if (< 0 (length entry)) - (progn - (if (nth 3 (car entry-list)) + (let ((this-entry (car entry-list)) + this-loc) + (if (setq this-loc (nth 3 this-entry)) (insert-button (concat entry "\n") - 'marker (nth 3 (car entry-list)) + ;; (MARKER FILENAME SPECIFIER LITERAL) + 'locator (list (car this-loc) + (cadr this-loc) + (nth 2 this-entry) + (or (nth 2 this-loc) + (nth 1 this-entry))) :type 'diary-entry) (insert entry ?\n)) (save-excursion - (let* ((marks (nth 4 (car entry-list))) - (temp-face (make-symbol - (apply - 'concat "temp-face-" - (mapcar (lambda (sym) - (if (stringp sym) - sym - (symbol-name sym))) - marks)))) - (faceinfo marks)) - (make-face temp-face) - ;; Remove :face info from the marks, - ;; copy the face info into temp-face - (while (setq faceinfo (memq :face faceinfo)) - (copy-face (read (nth 1 faceinfo)) temp-face) - (setcar faceinfo nil) - (setcar (cdr faceinfo) nil)) - (setq marks (delq nil marks)) - ;; Apply the font aspects. - (apply 'set-face-attribute temp-face nil marks) - (search-backward entry) - (overlay-put - (make-overlay (match-beginning 0) (match-end 0)) - 'face temp-face))))) + (let* ((marks (nth 4 this-entry)) + (faceinfo marks) + temp-face) + (when marks + (setq temp-face (make-symbol + (apply + 'concat "temp-face-" + (mapcar (lambda (sym) + (if (stringp sym) + sym + (symbol-name sym))) + marks)))) + (make-face temp-face) + ;; Remove :face info from the marks, + ;; copy the face info into temp-face + (while (setq faceinfo (memq :face faceinfo)) + (copy-face (read (nth 1 faceinfo)) temp-face) + (setcar faceinfo nil) + (setcar (cdr faceinfo) nil)) + (setq marks (delq nil marks)) + ;; Apply the font aspects. + (apply 'set-face-attribute temp-face nil marks) + (search-backward entry) + (overlay-put + (make-overlay (match-beginning 0) (match-end 0)) + 'face temp-face)))))) (setq entry-list (cdr entry-list)))) (set-buffer-modified-p nil) (goto-char (point-min)) @@ -1350,7 +1405,7 @@ best if they are nonmarking." (setq line-start (point))) (setq specifier (buffer-substring-no-properties (1+ line-start) (point)) - entry-start (1+ line-start)) + entry-start (1+ line-start)) (forward-char 1) (if (and (or (char-equal (preceding-char) ?\^M) (char-equal (preceding-char) ?\n)) @@ -1367,24 +1422,26 @@ best if they are nonmarking." (while (string-match "[\^M]" entry) (aset entry (match-beginning 0) ?\n ))) (let ((diary-entry (diary-sexp-entry sexp entry date)) - temp) - (setq entry (if (consp diary-entry) - (cdr diary-entry) - diary-entry)) + temp literal) + (setq literal entry ; before evaluation + entry (if (consp diary-entry) + (cdr diary-entry) + diary-entry)) (if diary-entry - (progn + (progn (remove-overlays line-start (point) 'invisible 'diary) - (if (< 0 (length entry)) - (setq temp (diary-pull-attrs entry file-glob-attrs) - entry (nth 0 temp) - marks (nth 1 temp))))) - (add-to-diary-list date - entry - specifier - (if entry-start (copy-marker entry-start) - nil) - marks) - (setq entry-found (or entry-found diary-entry))))) + (if (< 0 (length entry)) + (setq temp (diary-pull-attrs entry file-glob-attrs) + entry (nth 0 temp) + marks (nth 1 temp))))) + (add-to-diary-list date + entry + specifier + (if entry-start (copy-marker entry-start) + nil) + marks + literal) + (setq entry-found (or entry-found diary-entry))))) entry-found)) (defun diary-sexp-entry (sexp entry date) @@ -1636,28 +1693,6 @@ marked on the calendar." (or (diary-remind sexp (car days) marking) (diary-remind sexp (cdr days) marking)))))) -(defvar diary-modify-entry-list-string-function nil - "Function applied to entry string before putting it into the entries list. -Can be used by programs integrating a diary list into other buffers (e.g. -org.el and planner.el) to modify the string or add properties to it. -The function takes a string argument and must return a string.") - -(defun add-to-diary-list (date string specifier &optional marker globcolor) - "Add the entry (DATE STRING SPECIFIER MARKER GLOBCOLOR) to `diary-entries-list'. -Do nothing if DATE or STRING is nil." - (when (and date string) - (if diary-file-name-prefix - (let ((prefix (funcall diary-file-name-prefix-function - (buffer-file-name)))) - (or (string= prefix "") - (setq string (format "[%s] %s" prefix string))))) - (and diary-modify-entry-list-string-function - (setq string (funcall diary-modify-entry-list-string-function - string))) - (setq diary-entries-list - (append diary-entries-list - (list (list date string specifier marker globcolor)))))) - (defun diary-redraw-calendar () "If `calendar-buffer' is live and diary entries are marked, redraw it." (and mark-diary-entries-in-calendar @@ -1796,36 +1831,86 @@ Prefix arg will make the entry nonmarking." (if diary-header-line-flag (setq header-line-format diary-header-line-format))) -(define-derived-mode fancy-diary-display-mode fundamental-mode - "Diary" - "Major mode used while displaying diary entries using Fancy Display." - (set (make-local-variable 'font-lock-defaults) - '(fancy-diary-font-lock-keywords t)) - (local-set-key "q" 'quit-window)) +(defvar diary-fancy-date-pattern + (concat + (let ((dayname (diary-name-pattern calendar-day-name-array nil t)) + (monthname (diary-name-pattern calendar-month-name-array nil t)) + (day "[0-9]+") + (month "[0-9]+") + (year "-?[0-9]+")) + (mapconcat 'eval calendar-date-display-form "")) + ;; Optional ": holiday name" after the date. + "\\(: .*\\)?") + "Regular expression matching a date header in Fancy Diary.") + +(defconst diary-time-regexp + ;; Accepted formats: 10:00 10.00 10h00 10h 10am 10:00am 10.00am + ;; Use of "." as a separator annoyingly matches numbers, eg "123.45". + ;; Hence often prefix this with "\\(^\\|\\s-\\)." + (concat "[0-9]?[0-9]\\([AaPp][mM]\\|\\(" + "[Hh]\\([0-9][0-9]\\)?\\|[:.][0-9][0-9]" + "\\)\\([AaPp][Mm]\\)?\\)") + "Regular expression matching a time of day.") + +(defface diary-anniversary '((t :inherit font-lock-keyword-face)) + "Face used for anniversaries in the diary." + :version "22.1" + :group 'diary) + +(defface diary-time '((t :inherit font-lock-variable-name-face)) + "Face used for times of day in the diary." + :version "22.1" + :group 'diary) (defvar fancy-diary-font-lock-keywords (list - (cons - (concat - (let ((dayname (diary-name-pattern calendar-day-name-array nil t)) - (monthname (diary-name-pattern calendar-month-name-array nil t)) - (day "[0-9]+") - (month "[0-9]+") - (year "-?[0-9]+")) - (mapconcat 'eval calendar-date-display-form "")) - "\\(\\(: .*\\)\\|\\(\n +.*\\)\\)*\n=+$") - 'diary-face) - '("^.*anniversary.*$" . font-lock-keyword-face) - '("^.*birthday.*$" . font-lock-keyword-face) + (list + ;; Any number of " other holiday name" lines, followed by "==" line. + (concat diary-fancy-date-pattern "\\(\n +.*\\)*\n=+$") + '(0 (progn (put-text-property (match-beginning 0) (match-end 0) + 'font-lock-multiline t) + diary-face))) + '("^.*\\([aA]nniversary\\|[bB]irthday\\).*$" . 'diary-anniversary) '("^.*Yahrzeit.*$" . font-lock-reference-face) '("^\\(Erev \\)?Rosh Hodesh.*" . font-lock-function-name-face) '("^Day.*omer.*$" . font-lock-builtin-face) '("^Parashat.*$" . font-lock-comment-face) - '("^[ \t]*[0-9]?[0-9]\\([:.]?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)?\\(-[0-9]?[0-9]\\([:.]?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)?\\)?" - . font-lock-variable-name-face)) + `(,(format "\\(^\\|\\s-\\)%s\\(-%s\\)?" diary-time-regexp + diary-time-regexp) . 'diary-time)) "Keywords to highlight in fancy diary display") +;; If region looks like it might start or end in the middle of a +;; multiline pattern, extend the region to encompass the whole pattern. +(defun diary-fancy-font-lock-fontify-region-function (beg end &optional verbose) + "Function to use for `font-lock-fontify-region-function' in Fancy Diary. +Needed to handle multiline keyword in `fancy-diary-font-lock-keywords'." + (goto-char beg) + (forward-line 0) + (if (looking-at "=+$") (forward-line -1)) + (while (and (looking-at " +[^ ]") + (zerop (forward-line -1)))) + ;; This check not essential. + (if (looking-at diary-fancy-date-pattern) + (setq beg (line-beginning-position))) + (goto-char end) + (forward-line 0) + (while (and (looking-at " +[^ ]") + (zerop (forward-line 1)))) + (if (looking-at "=+$") + (setq end (line-beginning-position 2))) + (font-lock-default-fontify-region beg end verbose)) + +(define-derived-mode fancy-diary-display-mode fundamental-mode + "Diary" + "Major mode used while displaying diary entries using Fancy Display." + (set (make-local-variable 'font-lock-defaults) + '(fancy-diary-font-lock-keywords + t nil nil nil + (font-lock-fontify-region-function + . diary-fancy-font-lock-fontify-region-function))) + (local-set-key "q" 'quit-window)) + (defun diary-font-lock-sexps (limit) "Recognize sexp diary entry for font-locking." @@ -1877,13 +1962,6 @@ names." (eval-when-compile (require 'cal-hebrew) (require 'cal-islam)) -(defconst diary-time-regexp - ;; Formats that should be accepted: - ;; 10:00 10.00 10h00 10h 10am 10:00am 10.00am - (concat "[0-9]?[0-9]\\([AaPp][mM]\\|\\(" - "[Hh]\\([0-9][0-9]\\)?\\|[:.][0-9][0-9]" - "\\)\\([AaPp][Mm]\\)?\\)")) - (defvar diary-font-lock-keywords (append (diary-font-lock-date-forms calendar-month-name-array @@ -1924,10 +2002,9 @@ names." "?\\(" (regexp-quote islamic-diary-entry-symbol) "\\)") '(1 font-lock-reference-face)) '(diary-font-lock-sexps . font-lock-keyword-face) - (cons - (concat ;; "^[ \t]+" - diary-time-regexp "\\(-" diary-time-regexp "\\)?") - 'font-lock-function-name-face))) + `(,(concat "\\(^\\|\\s-\\)" + diary-time-regexp "\\(-" diary-time-regexp "\\)?") + . 'diary-time))) "Forms to highlight in `diary-mode'.") From 45380d4259f266d79674c1586e7ff09a167c0b02 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 19 May 2006 08:42:50 +0000 Subject: [PATCH 38/46] (add-to-diary-list): Fix typo in previous doc fix. --- lisp/calendar/diary-lib.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 947de0f2136..95588fccd92 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -332,9 +332,9 @@ The function takes a string argument and must return a string.") Do nothing if DATE or STRING is nil. DATE is the (MONTH DAY YEAR) for which the entry applies; STRING is the text of the entry as it will appear in the diary (i.e. with any format -strings such as \%d\" expanded); SPECIFIER is the date part of +strings such as \"%d\" expanded); SPECIFIER is the date part of the entry as it appears in the diary-file; LITERAL is the entry -as it appears in the diary-file (i.e. before expansion). If +as it appears in the diary-file (i.e. before expansion). If LITERAL is nil, it is taken to be the same as STRING. The entry is added to the list as (DATE STRING SPECIFIER LOCATOR From 7b39356d19367ebfa56b5de3f466542c72124890 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 19 May 2006 09:09:37 +0000 Subject: [PATCH 39/46] (mac-bytes-to-digits): Remove function. (mac-handle-toolbar-switch-mode): Use coercion instead of it. --- lisp/term/mac-win.el | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index 6adbdd11274..77a1533ef9a 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el @@ -1585,17 +1585,6 @@ in `selection-converter-alist', which see." (ash (lsh result extended-sign-len) (- extended-sign-len)) result))) -(defun mac-bytes-to-digits (bytes &optional from to) - (or from (setq from 0)) - (or to (setq to (length bytes))) - (let ((len (- to from)) - (val 0.0)) - (dotimes (i len) - (setq val (+ (* val 256.0) - (aref bytes (+ from (if (eq (byteorder) ?B) i - (- len i 1))))))) - (format "%.0f" val))) - (defun mac-ae-selection-range (ae) ;; #pragma options align=mac68k ;; typedef struct SelectionRange { @@ -1693,7 +1682,8 @@ modifiers, it changes global tool-bar visibility setting." (if (and modifiers (not (string= modifiers "\000\000\000\000"))) ;; Globally toggle tool-bar-mode if some modifier key is pressed. (tool-bar-mode) - (let ((window-id (mac-bytes-to-digits (cdr (mac-ae-parameter ae)))) + (let ((window-id + (mac-coerce-ae-data "long" (cdr (mac-ae-parameter ae)) "TEXT")) (rest (frame-list)) frame) (while (and (null frame) rest) From 380bff67284e9162a6ba006cc4cbc5dbe2063641 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 19 May 2006 09:10:48 +0000 Subject: [PATCH 40/46] (SOME_MACHINE_LISP): Add fringe.elc. --- mac/makefile.MPW | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mac/makefile.MPW b/mac/makefile.MPW index 4d0986ea60f..18866c2979d 100644 --- a/mac/makefile.MPW +++ b/mac/makefile.MPW @@ -1100,8 +1100,8 @@ SOME_MACHINE_LISP = {Lisp}mouse.elc {Lisp}w32-fns.elc {Lisp}dos-w32.elc {Lisp}disp-table.elc {Lisp}dos-vars.elc {Lisp}tooltip.elc {Lisp}image.elc - {Lisp}dnd.elc {Lisp}mwheel.elc - {Lisp}tool-bar.elc + {Lisp}fringe.elc {Lisp}dnd.elc + {Lisp}mwheel.elc {Lisp}tool-bar.elc {Lisp}x-dnd.elc {Lisp}international:ccl.elc {Lisp}international:codepage.elc From f3e86bf2b6d8eca30779881622b22285787f6262 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 19 May 2006 09:11:14 +0000 Subject: [PATCH 41/46] (x_set_border_width): Remove #ifndef MAC_OS. --- src/frame.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/frame.c b/src/frame.c index 1c3a30c9e1c..6e2a1a21e55 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3139,10 +3139,8 @@ x_set_border_width (f, arg, oldval) if (XINT (arg) == f->border_width) return; -#ifndef MAC_OS if (FRAME_X_WINDOW (f) != 0) error ("Cannot change the border width of a frame"); -#endif /* MAC_TODO */ f->border_width = XINT (arg); } From a73c40d183efae0ff48133a80b5fd50359aaeb11 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 19 May 2006 09:11:30 +0000 Subject: [PATCH 42/46] (gif_load): Allocate Lisp string first. --- src/image.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/image.c b/src/image.c index f309a401139..c317418326f 100644 --- a/src/image.c +++ b/src/image.c @@ -8067,18 +8067,18 @@ gif_load (f, img) /* Save GIF image extension data for `image-extension-data'. Format is (count IMAGES 0xf9 GRAPHIC_CONTROL_EXTENSION_BLOCK). */ { - unsigned char gce[4]; + Lisp_Object gce = make_uninit_string (4); int centisec = ((float)duration / time_scale) * 100.0f + 0.5f; /* Fill the delay time field. */ - gce[1] = centisec & 0xff; - gce[2] = (centisec >> 8) & 0xff; + SSET (gce, 1, centisec & 0xff); + SSET (gce, 2, (centisec >> 8) & 0xff); /* We don't know about other fields. */ - gce[0] = gce[3] = 0; + SSET (gce, 0, 0); + SSET (gce, 3, 0); img->data.lisp_val = list4 (Qcount, make_number (nsamples), - make_number (0xf9), - make_unibyte_string (gce, 4)); + make_number (0xf9), gce); } /* Maybe fill in the background field while we have ximg handy. */ From 91c889526a413b94bce5b407beee2d2b3b9fb485 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 19 May 2006 09:11:47 +0000 Subject: [PATCH 43/46] (Fx_focus_frame): Don't check dpyinfo->x_focus_frame. --- src/macfns.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/macfns.c b/src/macfns.c index 95356e5edf4..7b8c261f1f0 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -2829,26 +2829,22 @@ FRAME nil means use the selected frame. */) Lisp_Object frame; { struct frame *f = check_x_frame (frame); - struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); - if (dpyinfo->x_focus_frame != f) - { - BLOCK_INPUT; + BLOCK_INPUT; #ifdef MAC_OSX - ActivateWindow (ActiveNonFloatingWindow (), false); - ActivateWindow (FRAME_MAC_WINDOW (f), true); + ActivateWindow (ActiveNonFloatingWindow (), false); + ActivateWindow (FRAME_MAC_WINDOW (f), true); #else #if !TARGET_API_MAC_CARBON - /* SelectWindow (Non-Carbon) does not issue deactivate events if - the possibly inactive window that is to be selected is - already the frontmost one. */ - SendBehind (FRAME_MAC_WINDOW (f), NULL); + /* SelectWindow (Non-Carbon) does not issue deactivate events if the + possibly inactive window that is to be selected is already the + frontmost one. */ + SendBehind (FRAME_MAC_WINDOW (f), NULL); #endif - /* This brings the window to the front. */ - SelectWindow (FRAME_MAC_WINDOW (f)); + /* This brings the window to the front. */ + SelectWindow (FRAME_MAC_WINDOW (f)); #endif - UNBLOCK_INPUT; - } + UNBLOCK_INPUT; return Qnil; } From 2abb0fde834c3ddd2ffb2187c4e661734fdf0e77 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 19 May 2006 09:12:04 +0000 Subject: [PATCH 44/46] (XTread_socket) [TARGET_API_MAC_CARBON && MAC_OSX]: Forward keyUp events to toolbox_dispatcher. --- src/macterm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/macterm.c b/src/macterm.c index 5ea083894a4..7b20e8b9427 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -10333,6 +10333,7 @@ XTread_socket (sd, expected, hold_quit) break; case keyDown: + case keyUp: case autoKey: { int keycode = (er.message & keyCodeMask) >> 8; @@ -10354,6 +10355,8 @@ XTread_socket (sd, expected, hold_quit) != eventNotHandledErr) break; #endif + if (er.what == keyUp) + break; #if 0 if (dpyinfo->x_focus_frame == NULL) From 76fb556f5255f6447bf855ad2925b17a85107e67 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 19 May 2006 09:12:26 +0000 Subject: [PATCH 45/46] (foreach_window): Check WINDOWP (FRAME_ROOT_WINDOW (f)). --- src/window.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/window.c b/src/window.c index 2663b8d0d90..772ee18b08c 100644 --- a/src/window.c +++ b/src/window.c @@ -6796,7 +6796,9 @@ foreach_window (f, fn, user_data) int (* fn) P_ ((struct window *, void *)); void *user_data; { - foreach_window_1 (XWINDOW (FRAME_ROOT_WINDOW (f)), fn, user_data); + /* Fdelete_frame may set FRAME_ROOT_WINDOW (f) to Qnil. */ + if (WINDOWP (FRAME_ROOT_WINDOW (f))) + foreach_window_1 (XWINDOW (FRAME_ROOT_WINDOW (f)), fn, user_data); } From 689840b9224725a0beae741aaaa325d7edb2244c Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 19 May 2006 09:12:55 +0000 Subject: [PATCH 46/46] *** empty log message *** --- lisp/ChangeLog | 5 +++++ mac/ChangeLog | 4 ++++ src/ChangeLog | 13 +++++++++++++ 3 files changed, 22 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3f351d5fbaa..7732edb6b24 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-05-19 YAMAMOTO Mitsuharu + + * term/mac-win.el (mac-bytes-to-digits): Remove function. + (mac-handle-toolbar-switch-mode): Use coercion instead of it. + 2006-05-19 Glenn Morris * calendar/diary-lib.el (diary-bahai-date) diff --git a/mac/ChangeLog b/mac/ChangeLog index 80e30045dda..a17f456ae6f 100644 --- a/mac/ChangeLog +++ b/mac/ChangeLog @@ -1,3 +1,7 @@ +2006-05-19 YAMAMOTO Mitsuharu + + * makefile.MPW (SOME_MACHINE_LISP): Add fringe.elc. + 2006-04-12 YAMAMOTO Mitsuharu * inc/config.h (pid_t): Define to int. diff --git a/src/ChangeLog b/src/ChangeLog index e0f844b284e..5acc6313bbb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2006-05-19 YAMAMOTO Mitsuharu + + * frame.c (x_set_border_width): Remove #ifndef MAC_OS. + + * image.c [MAC_OS] (gif_load): Allocate Lisp string first. + + * macfns.c (Fx_focus_frame): Don't check dpyinfo->x_focus_frame. + + * macterm.c (XTread_socket) [TARGET_API_MAC_CARBON && MAC_OSX]: + Forward keyUp events to toolbox_dispatcher. + + * window.c (foreach_window): Check WINDOWP (FRAME_ROOT_WINDOW (f)). + 2006-05-18 Jan Dj,Ad(Brv * config.in: Regenerated (HAVE_ALSA).