From 9b7a2369390a58f96cc96f7992bd9737d96af64a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 4 Sep 2005 01:07:27 +0000 Subject: [PATCH 01/10] (Fpropertize): Don't insist that properties be symbols. --- src/editfns.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/editfns.c b/src/editfns.c index da4533d2537..a05d2396448 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3260,10 +3260,7 @@ usage: (propertize STRING &rest PROPERTIES) */) string = Fcopy_sequence (args[0]); for (i = 1; i < nargs; i += 2) - { - CHECK_SYMBOL (args[i]); - properties = Fcons (args[i], Fcons (args[i + 1], properties)); - } + properties = Fcons (args[i], Fcons (args[i + 1], properties)); Fadd_text_properties (make_number (0), make_number (SCHARS (string)), From 71f6424d02e7b287a79d1559df0057acb278ea2a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 4 Sep 2005 01:11:43 +0000 Subject: [PATCH 02/10] (Fsort): Doc fix. --- src/fns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fns.c b/src/fns.c index 1e26ec9a392..3c23aef282e 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1894,7 +1894,7 @@ DEFUN ("sort", Fsort, Ssort, 2, 2, 0, doc: /* Sort LIST, stably, comparing elements using PREDICATE. Returns the sorted list. LIST is modified by side effects. PREDICATE is called with two elements of LIST, and should return non-nil -if the first element is "less" than the second. */) +if the first element should sort before the second. */) (list, predicate) Lisp_Object list, predicate; { From 366717cfa0ff12fc544e9ee5031478e25aecf08d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 4 Sep 2005 01:28:41 +0000 Subject: [PATCH 03/10] (redisplay_internal): Make UPDATED as long as needed. (move_it_in_display_line_to): Stop after last char on line even on a windowing terminal, if that's the specified stop position. --- src/xdisp.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index f81dfb6755a..95f5a6709bf 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -6012,6 +6012,8 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) glyphs have the same width. */ int single_glyph_width = it->pixel_width / it->nglyphs; int new_x; + int x_before_this_char = x; + int hpos_before_this_char = it->hpos; for (i = 0; i < it->nglyphs; ++i, x = new_x) { @@ -6043,8 +6045,22 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) { ++it->hpos; it->current_x = new_x; + + /* The character's last glyph just barely fits + in this row. */ if (i == it->nglyphs - 1) { + /* If this is the destination position, + return a position *before* it in this row, + now that we know it fits in this row. */ + if (BUFFER_POS_REACHED_P ()) + { + it->hpos = hpos_before_this_char; + it->current_x = x_before_this_char; + result = MOVE_POS_MATCH_OR_ZV; + break; + } + set_iterator_to_next (it, 1); #ifdef HAVE_WINDOW_SYSTEM if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) @@ -10596,9 +10612,13 @@ redisplay_internal (preserve_echo_area) if (consider_all_windows_p) { Lisp_Object tail, frame; - int i, n = 0, size = 50; - struct frame **updated - = (struct frame **) alloca (size * sizeof *updated); + int i, n = 0, size = 5; + struct frame **updated; + + FOR_EACH_FRAME (tail, frame) + size++; + + updated = (struct frame **) alloca (size * sizeof *updated); /* Recompute # windows showing selected buffer. This will be incremented each time such a window is displayed. */ From f2455bde702baba8893a7b619114242a25c36317 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 4 Sep 2005 01:31:14 +0000 Subject: [PATCH 04/10] (Search Case): Mention vars that control case-fold-search for various operations. --- man/search.texi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/man/search.texi b/man/search.texi index 0233f7ce8de..b252e9c7c8c 100644 --- a/man/search.texi +++ b/man/search.texi @@ -907,6 +907,12 @@ searches also, including those performed by the replace commands (@pxref{Replace}) and the minibuffer history matching commands (@pxref{Minibuffer History}). + Several related variables control case-sensitivity of searching and +matching for specific commands or activities. For instance, +@code{tags-case-fold-search} controls case sensitivity for +@code{find-tag}. To find these variables, do @kbd{M-x +apropos-variable @key{RET} case-fold-search @key{RET}}. + @node Replace @section Replacement Commands @cindex replacement From 0c6087a609a6042e3daea9d1fa27c140c992952c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 4 Sep 2005 01:37:17 +0000 Subject: [PATCH 05/10] (nil and t): Minor cleanup. Delete spurious mention of keyword symbols. (Evaluation Notation): Add index entry. (A Sample Function Description): Minor cleanup. (A Sample Variable Description): Not all vars can be set. --- lispref/ChangeLog | 8 ++++++++ lispref/intro.texi | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 9c19c136926..f5079dc52a6 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,11 @@ +2005-09-03 Joshua Varner (tiny change) + + * intro.texi (nil and t): Minor cleanup. + Delete spurious mention of keyword symbols. + (Evaluation Notation): Add index entry. + (A Sample Function Description): Minor cleanup. + (A Sample Variable Description): Not all vars can be set. + 2005-09-03 Thien-Thi Nguyen * text.texi (Buffer Contents): Use "\n" in examples' result strings. diff --git a/lispref/intro.texi b/lispref/intro.texi index 01ffeb3321c..8c3501c823b 100644 --- a/lispref/intro.texi +++ b/lispref/intro.texi @@ -197,7 +197,7 @@ in Lisp programs also. (not nil) ; @r{Emphasize the truth value @var{false}} @end example -@cindex @code{t} and truth +@cindex @code{t}, uses of @cindex true In contexts where a truth value is expected, any non-@code{nil} value is considered to be @var{true}. However, @code{t} is the preferred way @@ -209,14 +209,14 @@ choosing, use @code{t}. The symbol @code{t} always has the value In Emacs Lisp, @code{nil} and @code{t} are special symbols that always evaluate to themselves. This is so that you do not need to quote them to use them as constants in a program. An attempt to change their -values results in a @code{setting-constant} error. The same is true of -any symbol whose name starts with a colon (@samp{:}). @xref{Constant +values results in a @code{setting-constant} error. @xref{Constant Variables}. @node Evaluation Notation @subsection Evaluation Notation @cindex evaluation notation @cindex documentation notation +@cindex notation A Lisp expression that you can evaluate is called a @dfn{form}. Evaluating a form always produces a result, which is a Lisp object. In @@ -355,11 +355,11 @@ indicates that the subsequent arguments may be omitted (omitted arguments default to @code{nil}). Do not write @code{&optional} when you call the function. - The keyword @code{&rest} (which must be followed by a single argument -name) indicates that any number of arguments can follow. The single -following argument name will have a value, as a variable, which is a -list of all these remaining arguments. Do not write @code{&rest} when -you call the function. + The keyword @code{&rest} (which must be followed by a single +argument name) indicates that any number of arguments can follow. The +single argument name following @code{&rest} will receive, as its +value, a list of all the remaining arguments passed to the function. +Do not write @code{&rest} when you call the function. Here is a description of an imaginary function @code{foo}: @@ -450,9 +450,9 @@ from @var{body}, which includes all remaining elements of the form. @cindex variable descriptions @cindex option descriptions - A @dfn{variable} is a name that can hold a value. Although any -variable can be set by the user, certain variables that exist -specifically so that users can change them are called @dfn{user + A @dfn{variable} is a name that can hold a value. Although nearly +all variables can be set by the user, certain variables exist +specifically so that users can change them; these are called @dfn{user options}. Ordinary variables and user options are described using a format like that for functions except that there are no arguments. From f37e01634cc3ea6561fc031fd09912ed4b732820 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 4 Sep 2005 01:48:26 +0000 Subject: [PATCH 06/10] (Programming Tips): Add conventions for minibuffer questions and prompts. --- lispref/tips.texi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lispref/tips.texi b/lispref/tips.texi index 46eb887dce8..d651eb95f0e 100644 --- a/lispref/tips.texi +++ b/lispref/tips.texi @@ -373,6 +373,20 @@ or @code{beep} to report errors. An error message should start with a capital letter but should not end with a period. +@item +A question asked in the minibuffer with @code{y-or-n-p} or +@code{yes-or-no-p} should start with a capital letter and end with +@samp{? }. + +@item +When you mention a default value in a minibuffer prompt, +put it and the word @samp{default} inside parentheses. +It should look like this: + +@example +Enter the answer: (default 42) +@end example + @item In @code{interactive}, if you use a Lisp expression to produce a list of arguments, don't try to provide the ``correct'' default values for From d7ea8b71aa7b7bc119c662556c564258aadb12de Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 4 Sep 2005 01:48:58 +0000 Subject: [PATCH 07/10] *** empty log message *** --- admin/FOR-RELEASE | 6 ++---- lispref/ChangeLog | 5 +++++ man/ChangeLog | 5 +++++ src/ChangeLog | 10 ++++++++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 5375db09f69..587ec97752b 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -33,9 +33,7 @@ To be done by Andre Spiegel . ** Update Speedbar. -** Debug custom themes. - -** Get rid of the defadvice calls in org.el. +** Document custom themes. * FATAL ERRORS @@ -243,7 +241,7 @@ lispref/hash.texi "Luc Teirlinck" Chong Yidong lispref/help.texi "Luc Teirlinck" Chong Yidong lispref/hooks.texi Lute Kamstra lispref/internals.texi "Luc Teirlinck" Chong Yidong -lispref/intro.texi "Luc Teirlinck" +lispref/intro.texi "Luc Teirlinck" Josh Varner lispref/keymaps.texi "Luc Teirlinck" Chong Yidong lispref/lists.texi "Luc Teirlinck" Chong Yidong lispref/loading.texi "Luc Teirlinck" Chong Yidong diff --git a/lispref/ChangeLog b/lispref/ChangeLog index f5079dc52a6..ec8885138b5 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,8 @@ +2005-09-03 Richard M. Stallman + + * tips.texi (Programming Tips): Add conventions for minibuffer + questions and prompts. + 2005-09-03 Joshua Varner (tiny change) * intro.texi (nil and t): Minor cleanup. diff --git a/man/ChangeLog b/man/ChangeLog index ac992ec6922..97473b2aa06 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2005-09-03 Richard M. Stallman + + * search.texi (Search Case): Mention vars that control + case-fold-search for various operations. + 2005-08-30 Carsten Dominik * org.texi: Version 3.15. diff --git a/src/ChangeLog b/src/ChangeLog index 09a3ba2d825..bc76f96208a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2005-09-03 Richard M. Stallman + + * xdisp.c (redisplay_internal): Make UPDATED as long as needed. + (move_it_in_display_line_to): Stop after last char on line even + on a windowing terminal, if that's the specified stop position. + + * fns.c (Fsort): Doc fix. + + * editfns.c (Fpropertize): Don't insist that properties be symbols. + 2005-09-01 Stefan Monnier * dispnew.c (window_to_frame_hpos, update_window): From 87d737aed0986cbe49a9d4ff8253c1ebbe7880d3 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 4 Sep 2005 18:00:43 +0000 Subject: [PATCH 08/10] *** empty log message *** --- lisp/ChangeLog | 12 ++++++++++++ lisp/custom.el | 27 +++++++++++++++------------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1bcdf7628b4..1782616a1c9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2005-09-04 Chong Yidong + + * custom.el (load-theme): Renamed from require-theme. + Add interactive spec. + (enable-theme): Renamed from custom-enable-theme. + Add interactive spec. + (disable-theme): Renamed from custom-disable-theme. + Add interactive spec. + (custom-make-theme-feature): Doc fix. + (custom-theme-directory): Doc fix. + (provide-theme): Call enable-theme. + 2005-09-02 Dan Nicolaescu * term/xterm.el (terminal-init-xterm): Add eval-when-compile to diff --git a/lisp/custom.el b/lisp/custom.el index 0831535f181..c4eae52751b 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -953,7 +953,7 @@ into `features'. This allows for a file-name convention for autoloading themes: Every theme X has a property `provide-theme' whose value is \"X-theme\". -\(require-theme X) then attempts to load the file `X-theme.el'." +\(load-theme X) then attempts to load the file `X-theme.el'." (intern (concat (symbol-name theme) "-theme"))) ;;; Loading themes. @@ -996,7 +996,7 @@ Every theme X has a property `provide-theme' whose value is \"X-theme\". "~/_emacs.d/" "~/.emacs.d/") "Directory in which Custom theme files should be written. -`require-theme' searches this directory in addition to load-path. +`load-theme' searches this directory in addition to load-path. The command `customize-create-theme' writes the files it produces into this directory." :type 'string @@ -1031,11 +1031,11 @@ by `custom-make-theme-feature'." ;; `user' must always be the highest-precedence enabled theme. ;; Make that remain true. (This has the effect of making user settings ;; override the ones just loaded, too.) - (custom-enable-theme 'user)) + (enable-theme 'user)) -(defun require-theme (theme) +(defun load-theme (theme) "Try to load a theme's settings from its file. -This also enables the theme; use `custom-disable-theme' to disable it." +This also enables the theme; use `disable-theme' to disable it." ;; THEME's feature is stored in THEME's `theme-feature' property. ;; Usually the `theme-feature' property contains a symbol created @@ -1043,6 +1043,7 @@ This also enables the theme; use `custom-disable-theme' to disable it." ;; Note we do no check for validity of the theme here. ;; This allows to pull in themes by a file-name convention + (interactive "SCustom theme name: ") (let ((load-path (if (file-directory-p custom-theme-directory) (cons custom-theme-directory load-path) load-path))) @@ -1070,12 +1071,12 @@ All the themes loaded for BY-THEME are recorded in BY-THEME's property (let ((themes-loaded (get by-theme 'theme-loads-themes))) (dolist (theme body) (cond ((and (consp theme) (eq (car theme) 'reset)) - (custom-disable-theme (cadr theme))) + (disable-theme (cadr theme))) ((and (consp theme) (eq (car theme) 'hidden)) - (require-theme (cadr theme)) - (custom-disable-theme (cadr theme))) + (load-theme (cadr theme)) + (disable-theme (cadr theme))) (t - (require-theme theme))) + (load-theme theme))) (push theme themes-loaded)) (put by-theme 'theme-loads-themes themes-loaded))) @@ -1087,10 +1088,11 @@ See `custom-theme-load-themes' for more information on BODY." ;;; Enabling and disabling loaded themes. -(defun custom-enable-theme (theme) +(defun enable-theme (theme) "Reenable all variable and face settings defined by THEME. The newly enabled theme gets the highest precedence (after `user'). If it is already enabled, just give it highest precedence (after `user')." + (interactive "SEnable Custom theme: ") (let ((settings (get theme 'theme-settings))) (dolist (s settings) (let* ((prop (car s)) @@ -1104,11 +1106,12 @@ If it is already enabled, just give it highest precedence (after `user')." (cons theme (delq theme custom-enabled-themes))) ;; `user' must always be the highest-precedence enabled theme. (unless (eq theme 'user) - (custom-enable-theme 'user))) + (enable-theme 'user))) -(defun custom-disable-theme (theme) +(defun disable-theme (theme) "Disable all variable and face settings defined by THEME. See `custom-known-themes' for a list of known themes." + (interactive "SDisable Custom theme: ") (let ((settings (get theme 'theme-settings))) (dolist (s settings) (let* ((prop (car s)) From 4242b8d6d1e8d8bf6338a085d9c691921a44be18 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 5 Sep 2005 11:52:21 +0000 Subject: [PATCH 09/10] Document custom themes. --- man/ChangeLog | 4 ++++ man/custom.texi | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/man/ChangeLog b/man/ChangeLog index 97473b2aa06..3f956c71625 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2005-09-05 Chong Yidong + + * custom.texi (Custom Themes): New node. + 2005-09-03 Richard M. Stallman * search.texi (Search Case): Mention vars that control diff --git a/man/custom.texi b/man/custom.texi index d531d92eb0f..87722f63b69 100644 --- a/man/custom.texi +++ b/man/custom.texi @@ -199,6 +199,8 @@ the active fields and other features. * Face Customization:: How to edit the attributes of a face. * Specific Customization:: Making a customization buffer for specific variables, faces, or groups. +* Custom Themes:: How to define collections of customized options + that can be loaded and unloaded together. @end menu @node Customization Groups @@ -652,6 +654,60 @@ changes. Use @kbd{M-x customize-saved} to look at the options that you have saved. Use @kbd{M-x customize-customized} to look at the options that you have set but not saved. +@node Custom Themes +@subsection Customization Themes +@cindex custom themes + +@dfn{Custom themes} are collections of customized options that can be +enabled or disabled as a unit. You can use Custom themes to switch +quickly and easily between various collections of settings, and to +transfer such collections from one computer to another. + +@findex customize-create-theme +To define a Custom theme, use the command +@kbd{M-x customize-create-theme}, which brings up a buffer named +@samp{*New Custom Theme*}. At the top of the buffer is an editable +field where you can specify the name of the theme. To add a +customization option to the theme, click on the @samp{INS} button to +open up a field where you can insert the name of the option. The +current value of that option is applied to the theme. After adding as +many options as you like, click on @samp{Done} to save the Custom +theme. + +@vindex custom-theme-directory +Saving a Custom theme named @var{foo} writes its definition into the +file @file{@var{foo}-theme.el}, in the directory @file{~/.emacs.d/} +(you can specify the directory by setting +@code{custom-theme-directory}). + +@findex load-theme +@findex enable-theme +@findex disable-theme +You can load the themes you've previously defined with the command +@code{load-theme}. It prompts for a theme name in the minibuffer, +then loads that theme if it isn't already loaded. It also +@dfn{enables} the theme, which means putting its settings into effect. +An enabled theme can be @dfn{disabled} with the command +@kbd{M-x disable-theme}; this returns the options specified in the +theme to their original values. To re-enable the theme, use the +command @kbd{M-x enable-theme}. + +To enable a Custom theme named @var{foo} whenever Emacs is started up, +add the line @code{(load-theme '@var{foo})} to your @file{.emacs} file +(@pxref{Init File}). + +Enabling a custom theme does not disable the themes already enabled; +instead, they are all enabled together. If two enabled Custom themes +specify different values for an option, the last theme to be enabled +takes effect. + +The options that you set in the ordinary customization buffer +(@pxref{Easy Customization}) are also considered part of a Custom +theme, called @samp{user}. The @samp{user} theme is always enabled, +and always takes precedence over all other enabled Custom themes. +Additionally, the @samp{user} theme is recorded in your @file{.emacs} +file, rather than a @file{user-theme.el} file. + @node Variables @section Variables @cindex variable From 656f8fc5fd872e6b4d5ca65ec95e205e21a5bf13 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 5 Sep 2005 11:56:47 +0000 Subject: [PATCH 10/10] Custom themes documented. --- admin/FOR-RELEASE | 4 ---- 1 file changed, 4 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 587ec97752b..d41dcec061b 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -33,8 +33,6 @@ To be done by Andre Spiegel . ** Update Speedbar. -** Document custom themes. - * FATAL ERRORS ** Investigate reported crashes in compact_small_strings. @@ -113,8 +111,6 @@ The class A seems to be missing. * DOCUMENTATION -** Document Custom Themes. - ** Update man/info.texi. ** Add missing years in copyright notices of all files.