------------------------------------------------------------ revno: 115689 committer: Paul Eggert branch nick: trunk timestamp: Sat 2013-12-21 23:23:49 -0800 message: Spelling fix. diff: === modified file 'src/xfont.c' --- src/xfont.c 2013-12-16 07:45:33 +0000 +++ src/xfont.c 2013-12-22 07:23:49 +0000 @@ -895,7 +895,7 @@ struct xfont_info *xfi = (struct xfont_info *) font; /* This function may be called from GC when X connection is gone - (Bug#16093), and an attempt to free font resourses on invalid + (Bug#16093), and an attempt to free font resources on invalid display may lead to X protocol errors or segfaults. */ if (xfi->xfont && x_display_info_for_display (xfi->display)) { ------------------------------------------------------------ revno: 115688 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 15:11:05 +0800 message: Document new bool-vector set operation functions. * doc/lispref/sequences.texi (Bool-Vectors): Document new bool-vector set operation functions. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-12-22 06:25:57 +0000 +++ doc/lispref/ChangeLog 2013-12-22 07:11:05 +0000 @@ -1,5 +1,7 @@ 2013-12-22 Xue Fuqiao + * sequences.texi (Bool-Vectors): Document new bool-vector set operation functions. + * text.texi (Examining Properties): Document `get-pos-property'. * variables.texi (Directory Local Variables): Document `enable-dir-local-variables'. === modified file 'doc/lispref/sequences.texi' --- doc/lispref/sequences.texi 2013-09-28 22:26:29 +0000 +++ doc/lispref/sequences.texi 2013-12-22 07:11:05 +0000 @@ -713,6 +713,54 @@ and @code{nil} otherwise. @end defun +There are also some bool-vector set operation functions, described below: + +@defun bool-vector-exclusive-or a b &optional c +Return @dfn{bitwise exclusive or} of bool vectors @var{a} and @var{b}. +If optional argument @var{c} is given, the result of this operation is +stored into @var{c}. All arguments should be bool vectors of the same length. +@end defun + +@defun bool-vector-union a b &optional c +Return @dfn{bitwise or} of bool vectors @var{a} and @var{b}. If +optional argument @var{c} is given, the result of this operation is +stored into @var{c}. All arguments should be bool vectors of the same length. +@end defun + +@defun bool-vector-intersection a b &optional c +Return @dfn{bitwise and} of bool vectors @var{a} and @var{b}. If +optional argument @var{c} is given, the result of this operation is +stored into @var{c}. All arguments should be bool vectors of the same length. +@end defun + +@defun bool-vector-set-difference a b &optional c +Return @dfn{set difference} of bool vectors @var{a} and @var{b}. If +optional argument @var{c} is given, the result of this operation is +stored into @var{c}. All arguments should be bool vectors of the same length. +@end defun + +@defun bool-vector-not a &optional b +Return @dfn{set complement} of bool vector @var{a}. If optional +argument @var{b} is given, the result of this operation is stored into +@var{b}. All arguments should be bool vectors of the same length. +@end defun + +@defun bool-vector-subsetp a b +Return @code{t} if every @code{t} value in @var{a} is also t in +@var{b}, nil otherwise. All arguments should be bool vectors of the +same length. +@end defun + +@defun bool-vector-count-consecutive a b i +Return the number of consecutive elements in @var{a} equal @var{b} +starting at @var{i}. @code{a} is a bool vector, @var{b} is @code{t} +or @code{nil}, and @var{i} is an index into @code{a}. +@end defun + +@defun bool-vector-count-population a +Return the number of elements that are @code{t} in bool vector @var{a}. +@end defun + Here is an example of creating, examining, and updating a bool-vector. Note that the printed form represents up to 8 boolean values as a single character. === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 06:25:57 +0000 +++ etc/NEWS 2013-12-22 07:11:05 +0000 @@ -923,6 +923,7 @@ display or frame whenever a mouse is supported on that display or frame. ++++ ** New bool-vector set operation functions: *** `bool-vector-exclusive-or' *** `bool-vector-union' ------------------------------------------------------------ revno: 115687 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 14:25:57 +0800 message: Document `get-pos-property'. * doc/lispref/text.texi (Examining Properties): Document `get-pos-property'. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-12-22 06:15:17 +0000 +++ doc/lispref/ChangeLog 2013-12-22 06:25:57 +0000 @@ -1,5 +1,7 @@ 2013-12-22 Xue Fuqiao + * text.texi (Examining Properties): Document `get-pos-property'. + * variables.texi (Directory Local Variables): Document `enable-dir-local-variables'. * debugging.texi (Debugger Commands): Document `debugger-toggle-locals'. === modified file 'doc/lispref/text.texi' --- doc/lispref/text.texi 2013-12-21 08:37:08 +0000 +++ doc/lispref/text.texi 2013-12-22 06:25:57 +0000 @@ -2679,6 +2679,13 @@ text properties are considered, since strings never have overlays. @end defun +@defun get-pos-property position prop &optional object +This function is like @code{get-char-property}, except that it pays +attention to properties' stickiness and overlays' advancement settings +instead of the property of the character at (i.e. right after) +@var{position}. +@end defun + @defun get-char-property-and-overlay position prop &optional object This is like @code{get-char-property}, but gives extra information about the overlay that the property value comes from. === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 06:15:17 +0000 +++ etc/NEWS 2013-12-22 06:25:57 +0000 @@ -891,6 +891,7 @@ Generic commands are interactive functions whose implementation can be selected among several alternatives, as a matter of user preference. ++++ ** New function `get-pos-property'. ** Minibuffer changes ------------------------------------------------------------ revno: 115686 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 14:15:17 +0800 message: Document `enable-dir-local-variables'. * doc/lispref/variables.texi (Directory Local Variables): Document `enable-dir-local-variables'. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-12-22 03:36:04 +0000 +++ doc/lispref/ChangeLog 2013-12-22 06:15:17 +0000 @@ -1,5 +1,7 @@ 2013-12-22 Xue Fuqiao + * variables.texi (Directory Local Variables): Document `enable-dir-local-variables'. + * debugging.texi (Debugger Commands): Document `debugger-toggle-locals'. 2013-12-21 Chong Yidong === modified file 'doc/lispref/variables.texi' --- doc/lispref/variables.texi 2013-08-26 15:28:24 +0000 +++ doc/lispref/variables.texi 2013-12-22 06:15:17 +0000 @@ -1834,6 +1834,12 @@ updates this list. @end defvar +@defvar enable-dir-local-variables +If @code{nil}, directory-local variables are ignored. This variable +may be useful for modes that want to ignore directory-locals while +still respecting file-local variables (@pxref{File Local Variables}). +@end defvar + @node Variable Aliases @section Variable Aliases @cindex variable aliases === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 05:57:32 +0000 +++ etc/NEWS 2013-12-22 06:15:17 +0000 @@ -660,13 +660,13 @@ whether it is safe to use Bash's --noediting option. These days --noediting is ubiquitous; it was introduced in 1996 in Bash version 2. -*** The SMIE indentation engine is now used by default. - ** Shell Script mode *** `sh-mode' now has the mode own `add-log-current-defun-function'. You can pick the name of the function and the variables with `C-x 4 a'. +*** The SMIE indentation engine is now used by default. + ** SMIE indentation can be customized via `smie-config'. The customization can be guessed by Emacs by providing a sample indented file and letting SMIE learn from it. @@ -745,6 +745,7 @@ under current version control system. When called with a prefix argument, you can remove a file from the ignored file list. +--- *** `cvs-append-to-ignore' has been renamed to `vc-cvs-append-to-ignore' because it is moved to vc-cvs.el. @@ -823,6 +824,7 @@ ** The syntax of ?» and ?« is now punctuation instead of matched parens. Some languages match those as »...« and others as «...» so better stay neutral. +--- ** In compiled Lisp files, the header no longer includes a timestamp. ** The default file coding for Emacs Lisp files is now utf-8. @@ -879,6 +881,7 @@ * Lisp Changes in Emacs 24.4 ++++ ** New variable `enable-dir-local-variables'. Directory-local variables are ignored if this is set to nil. This may be useful for modes that want to ignore directory-locals while still ------------------------------------------------------------ revno: 115685 committer: Dmitry Gutov branch nick: trunk timestamp: Sun 2013-12-22 08:04:40 +0200 message: * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t after `{'. We need it after block openers, and it doesn't seem to hurt after hash openers. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-22 04:57:00 +0000 +++ lisp/ChangeLog 2013-12-22 06:04:40 +0000 @@ -1,5 +1,11 @@ 2013-12-22 Dmitry Gutov + * progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t + after `{'. We need it after block openers, and it doesn't seem + to hurt after hash openers. + +2013-12-22 Dmitry Gutov + * progmodes/ruby-mode.el (ruby--at-indentation-p): New function, extracted from `ruby-smie-rules'. (ruby--electric-indent-chars): New variable. === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-12-22 04:57:00 +0000 +++ lisp/progmodes/ruby-mode.el 2013-12-22 06:04:40 +0000 @@ -402,7 +402,7 @@ (skip-chars-backward " \t") (not (or (bolp) (and (memq (char-before) - '(?\; ?- ?+ ?* ?/ ?: ?. ?, ?\[ ?\( ?\{ ?\\ ?& ?> ?< ?% + '(?\; ?- ?+ ?* ?/ ?: ?. ?, ?\[ ?\( ?\\ ?& ?> ?< ?% ?~ ?^)) ;; Not the end of a regexp or a percent literal. (not (memq (car (syntax-after (1- (point)))) '(7 15)))) === modified file 'test/indent/ruby.rb' --- test/indent/ruby.rb 2013-12-22 02:31:21 +0000 +++ test/indent/ruby.rb 2013-12-22 06:04:40 +0000 @@ -228,6 +228,7 @@ it("is too!") { bar + .qux } and_this_one(has) { |block, parameters| ------------------------------------------------------------ revno: 115684 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 13:57:32 +0800 message: Document negative argument of replacement commands. * doc/emacs/search.texi (Special Isearch): (Query Replace): Document negative argument of replacement commands. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-12-22 05:36:29 +0000 +++ doc/emacs/ChangeLog 2013-12-22 05:57:32 +0000 @@ -1,6 +1,8 @@ 2013-12-22 Xue Fuqiao - * search.texi (Symbol Search): Document `isearch-forward-symbol-at-point'. + * search.texi (Special Isearch): + (Query Replace): Document negative argument of replacement commands. + (Symbol Search): Document `isearch-forward-symbol-at-point'. * files.texi (File Conveniences): Document `image-next-file' and `image-previous-file'. === modified file 'doc/emacs/search.texi' --- doc/emacs/search.texi 2013-12-22 05:36:29 +0000 +++ doc/emacs/search.texi 2013-12-22 05:57:32 +0000 @@ -272,8 +272,8 @@ @kindex M-% @r{(Incremental search)} Typing @kbd{M-%} in incremental search invokes @code{query-replace} or @code{query-replace-regexp} (depending on search mode) with the -current search string used as the string to replace. @xref{Query -Replace}. +current search string used as the string to replace. A negative +prefix argument means to replace backward. @xref{Query Replace}. @kindex M-TAB @r{(Incremental search)} Typing @kbd{M-@key{TAB}} in incremental search invokes @@ -1243,7 +1243,8 @@ (@pxref{Unconditional Replace}). In particular, it preserves case provided @code{case-replace} is non-@code{nil}, as it normally is (@pxref{Replacement and Case}). A numeric argument means to consider -only occurrences that are bounded by word-delimiter characters. +only occurrences that are bounded by word-delimiter characters. A +negative prefix argument replaces backward. @kindex C-M-% @findex query-replace-regexp === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 05:36:29 +0000 +++ etc/NEWS 2013-12-22 05:57:32 +0000 @@ -627,6 +627,7 @@ *** `query-replace' skips invisible text when `search-invisible' is nil, and opens overlays with hidden text when `search-invisible' is `open'. ++++ *** A negative prefix arg of replacement commands replaces backward. `M-- M-%' replaces a string backward, `M-- C-M-%' replaces a regexp backward, `M-s w words M-- M-%' replaces a sequence of words backward. ------------------------------------------------------------ revno: 115683 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 13:36:29 +0800 message: Document `isearch-forward-symbol-at-point'. * doc/emacs/search.texi (Symbol Search): Document `isearch-forward-symbol-at-point'. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-12-22 05:20:03 +0000 +++ doc/emacs/ChangeLog 2013-12-22 05:36:29 +0000 @@ -1,5 +1,7 @@ 2013-12-22 Xue Fuqiao + * search.texi (Symbol Search): Document `isearch-forward-symbol-at-point'. + * files.texi (File Conveniences): Document `image-next-file' and `image-previous-file'. * display.texi (Optional Mode Line): Fix an index. === modified file 'doc/emacs/search.texi' --- doc/emacs/search.texi 2013-10-23 17:20:09 +0000 +++ doc/emacs/search.texi 2013-12-22 05:36:29 +0000 @@ -506,6 +506,9 @@ If incremental search is active, toggle symbol search mode (@code{isearch-toggle-symbol}); otherwise, begin an incremental forward symbol search (@code{isearch-forward-symbol}). +@item M-s . +Start a symbol incremental search forward with the symbol found near +point added to the search string initially. @item M-s _ @key{RET} @var{symbol} @key{RET} Search forward for @var{symbol}, nonincrementally. @item M-s _ C-r @key{RET} @var{symbol} @key{RET} @@ -513,9 +516,12 @@ @end table @kindex M-s _ +@kindex M-s . @findex isearch-forward-symbol - To begin a forward incremental symbol search, type @kbd{M-s _}. If -incremental search is not already active, this runs the command +@findex isearch-forward-symbol-at-point + To begin a forward incremental symbol search, type @kbd{M-s _} (or +@kbd{M-s .} if the symbol to search is near point). If incremental +search is not already active, this runs the command @code{isearch-forward-symbol}. If incremental search is already active, @kbd{M-s _} switches to a symbol search, preserving the direction of the search and the current search string; you can disable === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 05:20:03 +0000 +++ etc/NEWS 2013-12-22 05:36:29 +0000 @@ -612,6 +612,7 @@ ** Search and Replace ++++ *** New global command `M-s .' (`isearch-forward-symbol-at-point') starts a symbol (identifier) incremental search forward with the symbol found near point added to the search string initially. ------------------------------------------------------------ revno: 115682 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 13:20:03 +0800 message: Document image-{next, previous}-file, plus some minor tweak. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-12-22 04:55:31 +0000 +++ doc/emacs/ChangeLog 2013-12-22 05:20:03 +0000 @@ -1,5 +1,7 @@ 2013-12-22 Xue Fuqiao + * files.texi (File Conveniences): Document `image-next-file' and `image-previous-file'. + * display.texi (Optional Mode Line): Fix an index. * regs.texi (File Registers): Document `kmacro-to-register'. === modified file 'doc/emacs/files.texi' --- doc/emacs/files.texi 2013-10-23 17:20:09 +0000 +++ doc/emacs/files.texi 2013-12-22 05:20:03 +0000 @@ -1944,6 +1944,8 @@ @findex image-mode @findex image-toggle-display @findex image-toggle-animation +@findex image-next-file +@findex image-previous-file @cindex images, viewing @cindex image animation @cindex animated images @@ -1955,7 +1957,11 @@ support for displaying such images. If the displayed image is wider or taller than the frame, the usual point motion keys (@kbd{C-f}, @kbd{C-p}, and so forth) cause different parts of the image to be -displayed. If the image can be animated, the command @kbd{RET} +displayed. You can press @kbd{n} (@code{image-next-file}) and @kbd{p} +(@code{image-previous-file}) to visit the next image file and the +previous image file in the same directory, respectively. + +If the image can be animated, the command @kbd{RET} (@code{image-toggle-animation}) starts or stops the animation. Animation plays once, unless the option @code{image-animate-loop} is non-@code{nil}. === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 04:57:00 +0000 +++ etc/NEWS 2013-12-22 05:20:03 +0000 @@ -321,6 +321,7 @@ ** Calendar and Diary +--- *** New faces `calendar-weekday-header', `calendar-weekend-header', and `calendar-month-header'. @@ -377,7 +378,7 @@ ** cl-lib -*** New macro cl-tagbody. +*** New macro `cl-tagbody'. +++ *** letf is now just an alias for cl-letf. @@ -464,20 +465,28 @@ *** New option `f90-smart-end-names'. ** Icomplete is a bit more like Ido. + *** key bindings to navigate through and select the completions. + *** The icomplete-separator is customizable, and its default has changed. + *** Removed icomplete-show-key-bindings. + *** Icomplete-mode by defaults applies to all forms of minibuffer completion. (setq icomplete-with-completion-tables '(internal-complete-buffer)) will revert to the old behavior. ** Ido + *** Ido has a manual now. + *** `ido-use-virtual-buffers' takes a new value 'auto. + *** `ido-decorations' has been slightly extended to give a bit more control. ** Image mode ++++ *** New commands `n' (`image-next-file') and `p' (`image-previous-file') visit the next image file and the previous image file in the same directory, respectively. ------------------------------------------------------------ revno: 115681 committer: Dmitry Gutov branch nick: trunk timestamp: Sun 2013-12-22 06:57:00 +0200 message: Integrate ruby-mode with electric-indent-mode better * lisp/progmodes/ruby-mode.el (ruby--at-indentation-p): New function, extracted from `ruby-smie-rules'. (ruby--electric-indent-chars): New variable. (ruby--electric-indent-p): New function. (ruby-mode): Use `electric-indent-functions' instead of `electric-indent-chars'. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 04:55:31 +0000 +++ etc/NEWS 2013-12-22 04:57:00 +0000 @@ -599,6 +599,8 @@ *** New option `ruby-align-to-stmt-keywords'. +*** New `electric-indent-mode' integration. + ** Search and Replace *** New global command `M-s .' (`isearch-forward-symbol-at-point') === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-22 02:31:21 +0000 +++ lisp/ChangeLog 2013-12-22 04:57:00 +0000 @@ -1,5 +1,14 @@ 2013-12-22 Dmitry Gutov + * progmodes/ruby-mode.el (ruby--at-indentation-p): New function, + extracted from `ruby-smie-rules'. + (ruby--electric-indent-chars): New variable. + (ruby--electric-indent-p): New function. + (ruby-mode): Use `electric-indent-functions' instead of + `electric-indent-chars'. + +2013-12-22 Dmitry Gutov + * progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): Tweak the docstring. (ruby-smie-rules): Indent plus one level after `=>'. === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-12-22 02:31:21 +0000 +++ lisp/progmodes/ruby-mode.el 2013-12-22 04:57:00 +0000 @@ -631,12 +631,19 @@ ruby-indent-level)) (`(:after . ,(or "?" ":")) ruby-indent-level) (`(:before . ,(or "if" "while" "unless" "until" "begin" "case" "for")) - (when (not (save-excursion (skip-chars-backward " \t") (bolp))) + (when (not (ruby--at-indentation-p)) (if (ruby-smie--indent-to-stmt-p token) (ruby-smie--indent-to-stmt) (cons 'column (current-column))))) )) +(defun ruby--at-indentation-p (&optional point) + (save-excursion + (unless point (setq point (point))) + (forward-line 0) + (skip-chars-forward " \t") + (eq (point) point))) + (defun ruby-imenu-create-index-in-block (prefix beg end) "Create an imenu index of methods inside a block." (let ((index-alist '()) (case-fold-search nil) @@ -767,6 +774,29 @@ (when (buffer-modified-p) (basic-save-buffer-1))))))) +(defvar ruby--electric-indent-chars '(?. ?\) ?} ?\])) + +(defun ruby--electric-indent-p (char) + (cond + ((memq char ruby--electric-indent-chars) + ;; Outdent after typing a closing paren. + (ruby--at-indentation-p (1- (point)))) + ((memq (char-after) ruby--electric-indent-chars) + ;; Reindent after inserting something before a closing paren. + (ruby--at-indentation-p (1- (point)))) + ((or (memq (char-syntax char) '(?w ?_))) + (let ((pt (point))) + (save-excursion + (skip-syntax-backward "w_") + (and (ruby--at-indentation-p) + (looking-at (regexp-opt (cons "end" ruby-block-mid-keywords))) + ;; Outdent after typing a keyword. + (or (eq (match-end 0) pt) + ;; Reindent if it wasn't a keyword after all. + (eq (match-end 0) (1- pt))))))))) + +;; FIXME: Remove this? It's unused here, but some redefinitions of +;; `ruby-calculate-indent' in user init files still call it. (defun ruby-current-indentation () "Return the indentation level of current line." (save-excursion @@ -2081,8 +2111,7 @@ (setq-local end-of-defun-function 'ruby-end-of-defun) (add-hook 'after-save-hook 'ruby-mode-set-encoding nil 'local) - - (setq-local electric-indent-chars (append '(?\{ ?\}) electric-indent-chars)) + (add-hook 'electric-indent-functions 'ruby--electric-indent-p nil 'local) (setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil)) (setq-local font-lock-keywords ruby-font-lock-keywords) ------------------------------------------------------------ revno: 115680 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 12:55:31 +0800 message: Another NEWS mark. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-12-22 02:55:43 +0000 +++ doc/emacs/ChangeLog 2013-12-22 04:55:31 +0000 @@ -1,5 +1,7 @@ 2013-12-22 Xue Fuqiao + * display.texi (Optional Mode Line): Fix an index. + * regs.texi (File Registers): Document `kmacro-to-register'. * indent.texi (Tab Stops): Mention recent changes about `tab-stop-list'. === modified file 'doc/emacs/display.texi' --- doc/emacs/display.texi 2013-12-20 16:03:12 +0000 +++ doc/emacs/display.texi 2013-12-22 04:55:31 +0000 @@ -1325,7 +1325,7 @@ for incoming mail (any nonempty regular file in the directory is considered as ``newly arrived mail''). -@cindex mail (on mode line) +@cindex battery status (on mode line) @findex display-battery-mode @vindex display-battery-mode @vindex battery-mode-line-format === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 03:36:04 +0000 +++ etc/NEWS 2013-12-22 04:55:31 +0000 @@ -312,6 +312,7 @@ ** Battery +--- *** Battery information via the BSD `apm' utility is now supported. ** Buffer Menu ------------------------------------------------------------ revno: 115679 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 11:36:04 +0800 message: Document `debugger-toggle-locals'. * doc/lispref/debugging.texi (Debugger Commands): Document `debugger-toggle-locals'. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-12-21 08:37:08 +0000 +++ doc/lispref/ChangeLog 2013-12-22 03:36:04 +0000 @@ -1,3 +1,7 @@ +2013-12-22 Xue Fuqiao + + * debugging.texi (Debugger Commands): Document `debugger-toggle-locals'. + 2013-12-21 Chong Yidong * text.texi (Region Indent): Note the new interactive behavior of === modified file 'doc/lispref/debugging.texi' --- doc/lispref/debugging.texi 2013-07-03 03:03:47 +0000 +++ doc/lispref/debugging.texi 2013-12-22 03:36:04 +0000 @@ -388,6 +388,7 @@ type @kbd{C-M-x} on its definition.) You cannot use the Lisp debugger to step through a primitive function. +@c FIXME: Add @findex for the following commands? --xfq Here is a list of Debugger mode commands: @table @kbd @@ -462,6 +463,10 @@ @code{debug-on-entry}. @strong{Warning:} if you redefine such a function and thus cancel the effect of @code{debug-on-entry}, it may erroneously show up in this list. + +@item v +Display local variables (@pxref{Local Variables}) of the current stack +frame. Press @kbd{e} again to hide them. @end table @node Invoking the Debugger === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 02:55:43 +0000 +++ etc/NEWS 2013-12-22 03:36:04 +0000 @@ -304,7 +304,8 @@ when evaluating the code in the context at point. Hence, it now lets you access lexical variables. -*** New command `v' (`debuger-toggle-locals) displays local vars. ++++ +*** New command `v' (`debugger-toggle-locals') displays local vars. *** New minor mode `jit-lock-debug-mode' lets you use the debuggers on code run via JIT Lock. ------------------------------------------------------------ revno: 115678 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 10:55:43 +0800 message: * doc/emacs/regs.texi (File Registers): Document `kmacro-to-register'. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-12-22 01:56:52 +0000 +++ doc/emacs/ChangeLog 2013-12-22 02:55:43 +0000 @@ -1,5 +1,7 @@ 2013-12-22 Xue Fuqiao + * regs.texi (File Registers): Document `kmacro-to-register'. + * indent.texi (Tab Stops): Mention recent changes about `tab-stop-list'. * frames.texi (Scroll Bars): Document `scroll-bar-adjust-thumb-portion'. === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2013-12-12 03:37:38 +0000 +++ doc/emacs/emacs.texi 2013-12-22 02:55:43 +0000 @@ -345,13 +345,14 @@ Registers -* Position Registers:: Saving positions in registers. -* Text Registers:: Saving text in registers. -* Rectangle Registers:: Saving rectangles in registers. -* Configuration Registers:: Saving window configurations in registers. -* Number Registers:: Numbers in registers. -* File Registers:: File names in registers. -* Bookmarks:: Bookmarks are like registers, but persistent. +* Position Registers:: Saving positions in registers. +* Text Registers:: Saving text in registers. +* Rectangle Registers:: Saving rectangles in registers. +* Configuration Registers:: Saving window configurations in registers. +* Number Registers:: Numbers in registers. +* File Registers:: File names in registers. +* Keyboard Macro Registers:: Keyboard macros in registers. +* Bookmarks:: Bookmarks are like registers, but persistent. Controlling the Display === modified file 'doc/emacs/regs.texi' --- doc/emacs/regs.texi 2013-01-01 09:11:05 +0000 +++ doc/emacs/regs.texi 2013-12-22 02:55:43 +0000 @@ -41,6 +41,7 @@ * Configuration Registers:: Saving window configurations in registers. * Number Registers:: Numbers in registers. * File Registers:: File names in registers. +* Keyboard Macro Registers:: Keyboard macros in registers. * Bookmarks:: Bookmarks are like registers, but persistent. @end menu @@ -251,6 +252,23 @@ @var{r}}. (This is the same command used to jump to a position or restore a frame configuration.) +@node Keyboard Macro Registers +@section Keyboard Macro Registers +@cindex saving keyboard macro in a register +@cindex keyboard macros, in registers + +@kindex C-x C-k x +@findex kmacro-to-register + If you execute certain keyboard macros (@pxref{Keyboard Macros}) +frequently, you can execute them more conveniently if putting them in +registers or save them (@pxref{Save Keyboard Macro}). @kbd{C-x C-k x +@var{r}} (@code{kmacro-to-register}) stores the last keyboard macro in +register @var{r}. + + To execute the keyboard macro in register @var{r}, type @kbd{C-x r j +@var{r}}. (This is the same command used to jump to a position or +restore a frameset.) + @node Bookmarks @section Bookmarks @cindex bookmarks === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 01:45:13 +0000 +++ etc/NEWS 2013-12-22 02:55:43 +0000 @@ -260,7 +260,9 @@ *** All register commands can now show help with preview. -*** New command `kmacro-to-register' stores keyboard macros in registers. ++++ +*** New command `C-x C-k x' (`kmacro-to-register') stores keyboard +macros in registers. *** New command `C-x r f' (`frameset-to-register'). See Changes in Emacs 24.4, above. ------------------------------------------------------------ revno: 115677 committer: Dmitry Gutov branch nick: trunk timestamp: Sun 2013-12-22 04:31:21 +0200 message: * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): Tweak the docstring. (ruby-smie-rules): Indent plus one level after `=>'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-21 22:55:59 +0000 +++ lisp/ChangeLog 2013-12-22 02:31:21 +0000 @@ -1,3 +1,9 @@ +2013-12-22 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): Tweak the + docstring. + (ruby-smie-rules): Indent plus one level after `=>'. + 2013-12-21 Richard Stallman * simple.el (newline): Doc fix. === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-12-20 05:20:33 +0000 +++ lisp/progmodes/ruby-mode.el 2013-12-22 02:31:21 +0000 @@ -227,7 +227,8 @@ :safe 'integerp) (defcustom ruby-align-to-stmt-keywords nil - "Keywords to align their expression body to statement. + "Keywords after which we align the expression body to statement. + When nil, an expression that begins with one these keywords is indented to the column of the keyword. Example: @@ -614,6 +615,7 @@ (cons 'column (current-column))))) (`(:before . "do") (ruby-smie--indent-to-stmt)) (`(:before . ".") ruby-indent-level) + (`(:after . "=>") ruby-indent-level) (`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure")) (smie-rule-parent)) (`(:before . "when") === modified file 'test/indent/ruby.rb' --- test/indent/ruby.rb 2013-12-20 05:20:33 +0000 +++ test/indent/ruby.rb 2013-12-22 02:31:21 +0000 @@ -344,3 +344,9 @@ zoo .lose( q, p) + +foo(bar: + tee) + +foo(:bar => + tee) ------------------------------------------------------------ revno: 115676 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 09:56:52 +0800 message: Doc fix for `tab-stop-list'. * doc/emacs/indent.texi (Tab Stops): Mention recent changes about `tab-stop-list'. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-12-22 01:45:13 +0000 +++ doc/emacs/ChangeLog 2013-12-22 01:56:52 +0000 @@ -1,5 +1,7 @@ 2013-12-22 Xue Fuqiao + * indent.texi (Tab Stops): Mention recent changes about `tab-stop-list'. + * frames.texi (Scroll Bars): Document `scroll-bar-adjust-thumb-portion'. 2013-12-21 Chong Yidong === modified file 'doc/emacs/indent.texi' --- doc/emacs/indent.texi 2013-12-21 08:37:08 +0000 +++ doc/emacs/indent.texi 2013-12-22 01:56:52 +0000 @@ -178,7 +178,8 @@ @noindent The first line contains a colon at each tab stop. The numbers on the -next two lines are present just to indicate where the colons are. +next two lines are present just to indicate where the colons are. It +is implicitly extended to infinity by repeating the last step. You can edit this buffer to specify different tab stops by placing colons on the desired columns. The buffer uses Overwrite mode ------------------------------------------------------------ revno: 115675 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 09:45:13 +0800 message: Document `scroll-bar-adjust-thumb-portion'. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-12-21 08:37:08 +0000 +++ doc/emacs/ChangeLog 2013-12-22 01:45:13 +0000 @@ -1,3 +1,7 @@ +2013-12-22 Xue Fuqiao + + * frames.texi (Scroll Bars): Document `scroll-bar-adjust-thumb-portion'. + 2013-12-21 Chong Yidong * indent.texi (Indentation Commands): Document C-x TAB changes. === modified file 'doc/emacs/frames.texi' --- doc/emacs/frames.texi 2013-12-20 15:35:53 +0000 +++ doc/emacs/frames.texi 2013-12-22 01:45:13 +0000 @@ -930,6 +930,17 @@ bar width, change the @code{scroll-bar-width} frame parameter (@pxref{Frame Parameters,,, elisp, The Emacs Lisp Reference Manual}). +@vindex scroll-bar-adjust-thumb-portion +@cindex overscrolling +If you're using Emacs on X (with GTK+ or Motif), you can customize the +variable @code{scroll-bar-adjust-thumb-portion} to control +@dfn{overscrolling} of the scroll bar, i.e. dragging the thumb down even +when the end of the buffer is visible. If its value is +non-@code{nil}, the scroll bar can be dragged downwards even if the +end of the buffer is shown; if @code{nil}, the thumb will be at the +bottom when the end of the buffer is shown. You can not over-scroll +when the entire buffer is visible. + @node Drag and Drop @section Drag and Drop @cindex drag and drop === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 01:17:48 +0000 +++ etc/NEWS 2013-12-22 01:45:13 +0000 @@ -179,6 +179,7 @@ and as such superfluous. After being reimplemented in Lisp, its interactive form was mistakenly retained. ++++ *** New option `scroll-bar-adjust-thumb-portion'. Available only on X, this option allows to control over-scrolling using the scroll bar (i.e. dragging the thumb down even when the end ------------------------------------------------------------ revno: 115674 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 09:17:48 +0800 message: Add NEWS marks for focus-{in, out}-hook. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-12-22 01:07:22 +0000 +++ etc/NEWS 2013-12-22 01:17:48 +0000 @@ -169,6 +169,7 @@ plus enhancements like the ability to restore deleted frames. The command `frame-configuration-to-register' still exists, but is unbound. ++++ *** New hooks `focus-in-hook', `focus-out-hook'. These are normal hooks run when an Emacs frame gains or loses input focus. ------------------------------------------------------------ revno: 115673 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 09:07:22 +0800 message: Add NEWS marks for VC. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-12-21 16:11:55 +0000 +++ etc/NEWS 2013-12-22 01:07:22 +0000 @@ -709,15 +709,19 @@ ** VC and related modes ++++ *** In VC directory mode, `D' displays diffs between VC-controlled whole tree revisions. ++++ *** In VC directory mode, `L' lists the change log for the current VC controlled tree in a window. ++++ *** In VC directory mode, `I' shows a log of changes that will be received with a pull operation. ++++ *** `C-x v G' (globally) and `G' (in VC directory mode) ignores a file under current version control system. When called with a prefix argument, you can remove a file from the ignored file list. ------------------------------------------------------------ revno: 115672 committer: Xue Fuqiao branch nick: trunk timestamp: Sun 2013-12-22 08:52:26 +0800 message: * src/lread.c (syms_of_lread) : Doc fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-21 16:12:52 +0000 +++ src/ChangeLog 2013-12-22 00:52:26 +0000 @@ -1,3 +1,7 @@ +2013-12-22 Xue Fuqiao + + * lread.c (syms_of_lread) : Doc fix. + 2013-12-21 Jan Djärv * nsterm.h: Declare EmacsColor category. === modified file 'src/lread.c' --- src/lread.c 2013-12-18 22:35:17 +0000 +++ src/lread.c 2013-12-22 00:52:26 +0000 @@ -4679,8 +4679,9 @@ This applies when a filename suffix is not explicitly specified and `load' is trying various possible suffixes (see `load-suffixes' and `load-file-rep-suffixes'). Normally, it stops at the first file -that exists. If this option is non-nil, it checks all suffixes and -uses whichever file is newest. +that exists unless you explicitly specify one or the other. If this +option is non-nil, it checks all suffixes and uses whichever file is +newest. Note that if you customize this, obviously it will not affect files that are loaded before your customizations are read! */); load_prefer_newer = 0; ------------------------------------------------------------ revno: 115671 author: Richard Stallman committer: Richard Stallman branch nick: trunk timestamp: Sat 2013-12-21 17:55:59 -0500 message: Document how to make RET not indent. * simple.el (newline): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-21 20:50:02 +0000 +++ lisp/ChangeLog 2013-12-21 22:55:59 +0000 @@ -1,3 +1,7 @@ +2013-12-21 Richard Stallman + + * simple.el (newline): Doc fix. + 2013-12-21 Kenjiro NAKAYAMA * net/eww.el (eww-list-histories, eww-list-histories) === modified file 'lisp/simple.el' --- lisp/simple.el 2013-12-19 21:02:46 +0000 +++ lisp/simple.el 2013-12-21 22:55:59 +0000 @@ -382,10 +382,13 @@ If option `use-hard-newlines' is non-nil, the newline is marked with the text-property `hard'. With ARG, insert that many newlines. -Call `auto-fill-function' if the current column number is greater + +To turn off indentation by this command, disable Electric Indent mode +\(see \\[electric-indent-mode]). + +Calls `auto-fill-function' if the current column number is greater than the value of `fill-column' and ARG is nil. -A non-nil INTERACTIVE argument means to run the `post-self-insert-hook', -which by default will also indent the line (see `electric-indent-mode')." +A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'." (interactive "*P\np") (barf-if-buffer-read-only) ;; Call self-insert so that auto-fill, abbrev expansion etc. happens. ------------------------------------------------------------ revno: 115670 author: Kenjiro NAKAYAMA committer: Ted Zlatanov branch nick: quickfixes timestamp: Sat 2013-12-21 15:50:02 -0500 message: eww: fix wrong key binding * net/eww.el (eww-checkbox-map): Fix wrong key bind to `eww-toggle-checkbox'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-21 20:42:23 +0000 +++ lisp/ChangeLog 2013-12-21 20:50:02 +0000 @@ -6,6 +6,7 @@ functions to list browser histories. (eww-form-text): Support text form with disabled and readonly attributes. + (eww-checkbox-map): Fix wrong key bind to `eww-toggle-checkbox'. 2013-12-21 Rüdiger Sonderfeld === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-12-21 20:42:23 +0000 +++ lisp/net/eww.el 2013-12-21 20:50:02 +0000 @@ -565,7 +565,7 @@ (defvar eww-checkbox-map (let ((map (make-sparse-keymap))) - (define-key map [space] 'eww-toggle-checkbox) + (define-key map " " 'eww-toggle-checkbox) (define-key map "\r" 'eww-toggle-checkbox) (define-key map [(control c) (control c)] 'eww-submit) map)) ------------------------------------------------------------ revno: 115669 author: Kenjiro NAKAYAMA committer: Ted Zlatanov branch nick: quickfixes timestamp: Sat 2013-12-21 15:42:23 -0500 message: eww: support disabled and readonly text * net/eww.el (eww-form-text): Support text form with disabled and readonly attributes. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-21 20:33:44 +0000 +++ lisp/ChangeLog 2013-12-21 20:42:23 +0000 @@ -4,6 +4,8 @@ (eww-history-browse, eww-history-quit, eww-history-kill) (eww-history-mode-map, eww-history-mode): New command and functions to list browser histories. + (eww-form-text): Support text form with disabled + and readonly attributes. 2013-12-21 Rüdiger Sonderfeld === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-12-21 20:33:44 +0000 +++ lisp/net/eww.el 2013-12-21 20:42:23 +0000 @@ -680,18 +680,22 @@ (value (or (cdr (assq :value cont)) "")) (width (string-to-number (or (cdr (assq :size cont)) - "40")))) + "40"))) + (readonly-property (if (or (cdr (assq :disabled cont)) + (cdr (assq :readonly cont))) + 'read-only + 'inhibit-read-only))) (insert value) (when (< (length value) width) (insert (make-string (- width (length value)) ? ))) (put-text-property start (point) 'face 'eww-form-text) (put-text-property start (point) 'local-map eww-text-map) - (put-text-property start (point) 'inhibit-read-only t) + (put-text-property start (point) readonly-property t) (put-text-property start (point) 'eww-form - (list :eww-form eww-form - :value value - :type type - :name (cdr (assq :name cont)))) + (list :eww-form eww-form + :value value + :type type + :name (cdr (assq :name cont)))) (insert " "))) (defconst eww-text-input-types '("text" "password" "textarea" ------------------------------------------------------------ revno: 115668 committer: Ted Zlatanov branch nick: quickfixes timestamp: Sat 2013-12-21 15:33:44 -0500 message: eww: machinery to list browser history * net/eww.el (eww-list-histories, eww-list-histories) (eww-history-browse, eww-history-quit, eww-history-kill) (eww-history-mode-map, eww-history-mode): New command and functions to list browser histories. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-21 20:13:09 +0000 +++ lisp/ChangeLog 2013-12-21 20:33:44 +0000 @@ -1,3 +1,10 @@ +2013-12-21 Kenjiro NAKAYAMA + + * net/eww.el (eww-list-histories, eww-list-histories) + (eww-history-browse, eww-history-quit, eww-history-kill) + (eww-history-mode-map, eww-history-mode): New command and + functions to list browser histories. + 2013-12-21 Rüdiger Sonderfeld * net/eww.el (eww-back-url, eww-forward-url, eww-next-url) === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-12-21 20:13:09 +0000 +++ lisp/net/eww.el 2013-12-21 20:33:44 +0000 @@ -414,6 +414,7 @@ (define-key map "w" 'eww-copy-page-url) (define-key map "C" 'url-cookie-list) (define-key map "v" 'eww-view-source) + (define-key map "H" 'eww-list-histories) (define-key map "b" 'eww-add-bookmark) (define-key map "B" 'eww-list-bookmarks) @@ -433,6 +434,7 @@ ["Download" eww-download t] ["View page source" eww-view-source] ["Copy page URL" eww-copy-page-url t] + ["List histories" eww-list-histories t] ["Add bookmark" eww-add-bookmark t] ["List bookmarks" eww-list-bookmarks t] ["List cookies" url-cookie-list t])) @@ -471,15 +473,6 @@ ;;(setq buffer-read-only t) ) -(defun eww-save-history () - (push (list :url eww-current-url - :title eww-current-title - :point (point) - :dom eww-current-dom - :source eww-current-source - :text (buffer-string)) - eww-history)) - ;;;###autoload (defun eww-browse-url (url &optional _new-window) (when (and (equal major-mode 'eww-mode) @@ -1262,6 +1255,98 @@ (setq buffer-read-only t truncate-lines t)) +;;; History code + +(defun eww-save-history () + (push (list :url eww-current-url + :title eww-current-title + :point (point) + :dom eww-current-dom + :source eww-current-source + :text (buffer-string)) + eww-history)) + +(defun eww-list-histories () + "List the eww-histories." + (interactive) + (when (null eww-history) + (error "No eww-histories are defined")) + (set-buffer (get-buffer-create "*eww history*")) + (eww-history-mode) + (let ((inhibit-read-only t) + (domain-length 0) + (title-length 0) + url title format start) + (erase-buffer) + (dolist (history eww-history) + (setq start (point)) + (setq domain-length (max domain-length (length (plist-get history :url)))) + (setq title-length (max title-length (length (plist-get history :title)))) + ) + (setq format (format "%%-%ds %%-%ds" title-length domain-length) + header-line-format + (concat " " (format format "Title" "URL"))) + + (dolist (history eww-history) + (setq url (plist-get history :url)) + (setq title (plist-get history :title)) + (insert (format format title url)) + (insert "\n") + (put-text-property start (point) 'eww-history history) + ) + (goto-char (point-min))) + (pop-to-buffer "*eww history*") + ) + +(defun eww-history-browse () + "Browse the history under point in eww." + (interactive) + (let ((history (get-text-property (line-beginning-position) 'eww-history))) + (unless history + (error "No history on the current line")) + (eww-history-quit) + (pop-to-buffer "*eww*") + (eww-browse-url (plist-get history :url)))) + +(defun eww-history-quit () + "Kill the current buffer." + (interactive) + (kill-buffer (current-buffer))) + +(defvar eww-history-kill-ring nil) + +(defun eww-history-kill () + "Kill the current history." + (interactive) + (let* ((start (line-beginning-position)) + (history (get-text-property start 'eww-history)) + (inhibit-read-only t)) + (unless history + (error "No history on the current line")) + (forward-line 1) + (push (buffer-substring start (point)) eww-history-kill-ring) + (delete-region start (point)) + (setq eww-history (delq history eww-history)) + )) + +(defvar eww-history-mode-map + (let ((map (make-sparse-keymap))) + (suppress-keymap map) + (define-key map "q" 'eww-history-quit) + (define-key map [(control k)] 'eww-history-kill) + (define-key map "\r" 'eww-history-browse) + (define-key map "n" 'next-error-no-select) + (define-key map "p" 'previous-error-no-select) + map)) + +(define-derived-mode eww-history-mode nil "eww history" + "Mode for listing eww-histories. + +\\{eww-history-mode-map}" + (buffer-disable-undo) + (setq buffer-read-only t + truncate-lines t)) + (provide 'eww) ;;; eww.el ends here ------------------------------------------------------------ revno: 115667 author: Rüdiger Sonderfeld committer: Ted Zlatanov branch nick: quickfixes timestamp: Sat 2013-12-21 15:13:09 -0500 message: eww: minor code fixes and toolbar support * net/eww.el (eww-back-url, eww-forward-url, eww-next-url) (eww-previous-url, eww-up-url, eww-top-url, eww-add-bookmark) (eww-bookmark-prepare, eww-bookmark-kill, eww-bookmark-yank) (eww-bookmark-browse, eww-next-bookmark, eww-previous-bookmark): Use `user-error'. (eww-bookmark-mode-map): Add menu. (eww-render, eww-mode): Use `setq-local'. (eww-tool-bar-map): New variable. (eww-mode): Set `tool-bar-map'. (eww-view-source): Check for `html-mode' with `fboundp'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-21 17:54:16 +0000 +++ lisp/ChangeLog 2013-12-21 20:13:09 +0000 @@ -1,3 +1,16 @@ +2013-12-21 Rüdiger Sonderfeld + + * net/eww.el (eww-back-url, eww-forward-url, eww-next-url) + (eww-previous-url, eww-up-url, eww-top-url, eww-add-bookmark) + (eww-bookmark-prepare, eww-bookmark-kill, eww-bookmark-yank) + (eww-bookmark-browse, eww-next-bookmark, eww-previous-bookmark): + Use `user-error'. + (eww-bookmark-mode-map): Add menu. + (eww-render, eww-mode): Use `setq-local'. + (eww-tool-bar-map): New variable. + (eww-mode): Set `tool-bar-map'. + (eww-view-source): Check for `html-mode' with `fboundp'. + 2013-12-21 Lars Magne Ingebrigtsen * net/shr.el (shr--extract-best-source): Don't bug out on audio === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-12-19 16:25:25 +0000 +++ lisp/net/eww.el 2013-12-21 20:13:09 +0000 @@ -171,12 +171,12 @@ (let ((redirect (plist-get status :redirect))) (when redirect (setq url redirect))) - (set (make-local-variable 'eww-next-url) nil) - (set (make-local-variable 'eww-previous-url) nil) - (set (make-local-variable 'eww-up-url) nil) - (set (make-local-variable 'eww-home-url) nil) - (set (make-local-variable 'eww-start-url) nil) - (set (make-local-variable 'eww-contents-url) nil) + (setq-local eww-next-url nil) + (setq-local eww-previous-url nil) + (setq-local eww-up-url nil) + (setq-local eww-home-url nil) + (setq-local eww-start-url nil) + (setq-local eww-contents-url nil) (let* ((headers (eww-parse-headers)) (content-type (mail-header-parse-content-type @@ -388,7 +388,7 @@ (delete-region (point-min) (point-max)) (insert (or eww-current-source "no source")) (goto-char (point-min)) - (when (featurep 'html-mode) + (when (fboundp 'html-mode) (html-mode))) (view-buffer buf))) @@ -438,18 +438,35 @@ ["List cookies" url-cookie-list t])) map)) +(defvar eww-tool-bar-map + (let ((map (make-sparse-keymap))) + (dolist (tool-bar-item + '((eww-quit . "close") + (eww-reload . "refresh") + (eww-back-url . "left-arrow") + (eww-forward-url . "right-arrow") + (eww-view-source . "show") + (eww-copy-page-url . "copy") + (eww-add-bookmark . "bookmark_add"))) ;; ... + (tool-bar-local-item-from-menu + (car tool-bar-item) (cdr tool-bar-item) map eww-mode-map)) + map) + "Tool bar for `eww-mode'.") + (define-derived-mode eww-mode nil "eww" "Mode for browsing the web. \\{eww-mode-map}" ;; FIXME? This seems a strange default. - (set (make-local-variable 'eww-current-url) 'author) - (set (make-local-variable 'eww-current-dom) nil) - (set (make-local-variable 'eww-current-source) nil) - (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url) - (set (make-local-variable 'after-change-functions) 'eww-process-text-input) - (set (make-local-variable 'eww-history) nil) - (set (make-local-variable 'eww-history-position) 0) + (setq-local eww-current-url 'author) + (setq-local eww-current-dom nil) + (setq-local eww-current-source nil) + (setq-local browse-url-browser-function 'eww-browse-url) + (setq-local after-change-functions 'eww-process-text-input) + (setq-local eww-history nil) + (setq-local eww-history-position 0) + (when (boundp 'tool-bar-map) + (setq-local tool-bar-map eww-tool-bar-map)) (buffer-disable-undo) ;;(setq buffer-read-only t) ) @@ -474,7 +491,7 @@ "Go to the previously displayed page." (interactive) (when (>= eww-history-position (length eww-history)) - (error "No previous page")) + (user-error "No previous page")) (eww-save-history) (setq eww-history-position (+ eww-history-position 2)) (eww-restore-history (elt eww-history (1- eww-history-position)))) @@ -483,7 +500,7 @@ "Go to the next displayed page." (interactive) (when (zerop eww-history-position) - (error "No next page")) + (user-error "No next page")) (eww-save-history) (eww-restore-history (elt eww-history (1- eww-history-position)))) @@ -505,7 +522,7 @@ (interactive) (if eww-next-url (eww-browse-url (shr-expand-url eww-next-url eww-current-url)) - (error "No `next' on this page"))) + (user-error "No `next' on this page"))) (defun eww-previous-url () "Go to the page marked `previous'. @@ -514,7 +531,7 @@ (interactive) (if eww-previous-url (eww-browse-url (shr-expand-url eww-previous-url eww-current-url)) - (error "No `previous' on this page"))) + (user-error "No `previous' on this page"))) (defun eww-up-url () "Go to the page marked `up'. @@ -523,7 +540,7 @@ (interactive) (if eww-up-url (eww-browse-url (shr-expand-url eww-up-url eww-current-url)) - (error "No `up' on this page"))) + (user-error "No `up' on this page"))) (defun eww-top-url () "Go to the page marked `top'. @@ -535,7 +552,7 @@ eww-home-url))) (if best-url (eww-browse-url (shr-expand-url best-url eww-current-url)) - (error "No `top' for this page")))) + (user-error "No `top' for this page")))) (defun eww-reload () "Reload the current page." @@ -1073,7 +1090,7 @@ (dolist (bookmark eww-bookmarks) (when (equal eww-current-url (plist-get bookmark :url)) - (error "Already bookmarked"))) + (user-error "Already bookmarked"))) (if (y-or-n-p "bookmark this page? ") (progn (let ((title (replace-regexp-in-string "[\n\t\r]" " " eww-current-title))) @@ -1106,8 +1123,8 @@ (defun eww-bookmark-prepare () (eww-read-bookmarks) - (when (null eww-bookmarks) - (error "No bookmarks are defined")) + (unless eww-bookmarks + (user-error "No bookmarks are defined")) (set-buffer (get-buffer-create "*eww bookmarks*")) (eww-bookmark-mode) (let ((format "%-40s %s") @@ -1135,7 +1152,7 @@ (bookmark (get-text-property start 'eww-bookmark)) (inhibit-read-only t)) (unless bookmark - (error "No bookmark on the current line")) + (user-error "No bookmark on the current line")) (forward-line 1) (push (buffer-substring start (point)) eww-bookmark-kill-ring) (delete-region start (point)) @@ -1146,7 +1163,7 @@ "Yank a previously killed bookmark to the current line." (interactive) (unless eww-bookmark-kill-ring - (error "No previously killed bookmark")) + (user-error "No previously killed bookmark")) (beginning-of-line) (let ((inhibit-read-only t) (start (point)) @@ -1170,7 +1187,7 @@ (interactive) (let ((bookmark (get-text-property (line-beginning-position) 'eww-bookmark))) (unless bookmark - (error "No bookmark on the current line")) + (user-error "No bookmark on the current line")) ;; We wish to leave this window, but if it's the only window here, ;; just let it remain. (ignore-errors @@ -1192,7 +1209,7 @@ (setq bookmark (get-text-property (line-beginning-position) 'eww-bookmark)) (unless bookmark - (error "No next bookmark"))) + (user-error "No next bookmark"))) (eww-browse-url (plist-get bookmark :url)))) (defun eww-previous-bookmark () @@ -1211,7 +1228,7 @@ (when (eolp) (forward-line -1)) (if (bobp) - (error "No previous bookmark") + (user-error "No previous bookmark") (forward-line -1)) (setq bookmark (get-text-property (line-beginning-position) 'eww-bookmark))) @@ -1224,6 +1241,17 @@ (define-key map [(control k)] 'eww-bookmark-kill) (define-key map [(control y)] 'eww-bookmark-yank) (define-key map "\r" 'eww-bookmark-browse) + + (easy-menu-define nil map + "Menu for `eww-bookmark-mode-map'." + '("Eww Bookmark" + ["Exit" eww-bookmark-quit t] + ["Browse" eww-bookmark-browse + :active (get-text-property (line-beginning-position) 'eww-bookmark)] + ["Kill" eww-bookmark-kill + :active (get-text-property (line-beginning-position) 'eww-bookmark)] + ["Yank" eww-bookmark-yank + :active eww-bookmark-kill-ring])) map)) (define-derived-mode eww-bookmark-mode nil "eww bookmarks" ------------------------------------------------------------ revno: 115666 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Sat 2013-12-21 18:54:16 +0100 message: * net/shr.el (shr--extract-best-source): Don't bug out on audio elements That have text inside. Also remove debugging. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-21 16:11:55 +0000 +++ lisp/ChangeLog 2013-12-21 17:54:16 +0000 @@ -1,3 +1,8 @@ +2013-12-21 Lars Magne Ingebrigtsen + + * net/shr.el (shr--extract-best-source): Don't bug out on audio + elements with text inside. Also remove debugging. + 2013-12-21 Jan Djärv * cus-start.el (all): Add ns-use-srgb-colorspace. === modified file 'lisp/net/shr.el' --- lisp/net/shr.el 2013-12-20 04:29:08 +0000 +++ lisp/net/shr.el 2013-12-21 17:54:16 +0000 @@ -1136,21 +1136,16 @@ (setq pref (or pref -1.0)) (let (new-pref) (dolist (elem cont) - (when (and (listp elem) - (not (keywordp (car elem)))) ;; skip attributes - (when (and (eq (car elem) 'source) - (< pref - (setq new-pref - (shr--get-media-pref elem)))) - (setq pref new-pref - url (cdr (assq :src elem))) - (message "new %s %s" url pref)) + (when (and (eq (car elem) 'source) + (< pref + (setq new-pref + (shr--get-media-pref elem)))) + (setq pref new-pref + url (cdr (assq :src elem))) ;; libxml's html parser isn't HTML5 compliant and non terminated ;; source tags might end up as children. So recursion it is... (dolist (child (cdr elem)) - (when (and (listp child) - (not (keywordp (car child))) ;; skip attributes - (eq (car child) 'source)) + (when (eq (car child) 'source) (let ((ret (shr--extract-best-source (list child) url pref))) (when (< pref (cdr ret)) (setq url (car ret) ------------------------------------------------------------ revno: 115665 committer: Jan D. branch nick: trunk timestamp: Sat 2013-12-21 17:12:52 +0100 message: Changelog for previous checkin, missed to mark. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-21 09:09:48 +0000 +++ src/ChangeLog 2013-12-21 16:12:52 +0000 @@ -1,3 +1,13 @@ +2013-12-21 Jan Djärv + + * nsterm.h: Declare EmacsColor category. + + * nsterm.m (NSColor): Implement EmacsColor category. + (ns_get_color): Use colorUsingDefaultColorSpace. + (ns_get_color, ns_term_init): Use colorForEmacsRed. + + * nsfns.m (Fxw_color_values): Use colorUsingDefaultColorSpace. + 2013-12-21 Eli Zaretskii * image.c (fn_png_longjmp) [WINDOWSNT]: Mark the function as ------------------------------------------------------------ revno: 115664 committer: Jan D. branch nick: trunk timestamp: Sat 2013-12-21 17:11:55 +0100 message: Customize ns-use-srgb-colorspace on OSX >= 10.7 to use sRGB. * etc/NEWS: Mention ns-use-srgb-colorspace. * lisp/cus-start.el (all): Add ns-use-srgb-colorspace. * src/nsfns.m (Fxw_color_values): Use colorUsingDefaultColorSpace. * src/nsterm.h: Declare EmacsColor category. * src/nsterm.m (NSColor): Implement EmacsColor category. (ns_get_color): Use colorUsingDefaultColorSpace. (ns_get_color, ns_term_init): Use colorForEmacsRed. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-12-21 13:43:11 +0000 +++ etc/ChangeLog 2013-12-21 16:11:55 +0000 @@ -1,3 +1,7 @@ +2013-12-21 Jan Djärv + + * NEWS: Mention ns-use-srgb-colorspace. + 2013-12-21 Chong Yidong * themes/tango-dark-theme.el: Minor color tweak. === modified file 'etc/NEWS' --- etc/NEWS 2013-12-21 08:34:49 +0000 +++ etc/NEWS 2013-12-21 16:11:55 +0000 @@ -1174,6 +1174,10 @@ Customize `ns-use-native-fullscreen' to change style. For >= 10.7 native is the default. +** OSX >= 10.7 can use sRGB colorspace. +Customize `ns-use-srgb-colorspace' to change style. nil is the default. +Note: This does not apply to images. + * Installation Changes in Emacs 24.3 === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-21 15:31:09 +0000 +++ lisp/ChangeLog 2013-12-21 16:11:55 +0000 @@ -1,3 +1,7 @@ +2013-12-21 Jan Djärv + + * cus-start.el (all): Add ns-use-srgb-colorspace. + 2013-12-21 Chong Yidong * custom.el (custom-theme-recalc-face): Do nothing if the face is === modified file 'lisp/cus-start.el' --- lisp/cus-start.el 2013-12-18 03:21:48 +0000 +++ lisp/cus-start.el 2013-12-21 16:11:55 +0000 @@ -402,6 +402,7 @@ (ns-antialias-text ns boolean "23.1") (ns-auto-hide-menu-bar ns boolean "24.0") (ns-use-native-fullscreen ns boolean "24.4") + (ns-use-srgb-colorspace ns boolean "24.4") ;; process.c (delete-exited-processes processes-basics boolean) ;; syntax.c === modified file 'src/nsfns.m' --- src/nsfns.m 2013-12-07 14:21:53 +0000 +++ src/nsfns.m 2013-12-21 16:11:55 +0000 @@ -2289,7 +2289,7 @@ if (ns_lisp_to_color (color, &col)) return Qnil; - [[col colorUsingColorSpaceName: NSCalibratedRGBColorSpace] + [[col colorUsingDefaultColorSpace] getRed: &red green: &green blue: &blue alpha: &alpha]; return list3i (lrint (red * 65280), lrint (green * 65280), lrint (blue * 65280)); === modified file 'src/nsterm.h' --- src/nsterm.h 2013-12-19 10:25:48 +0000 +++ src/nsterm.h 2013-12-21 16:11:55 +0000 @@ -78,6 +78,18 @@ /* ========================================================================== + NSColor, EmacsColor category. + + ========================================================================== */ +@interface NSColor (EmacsColor) ++ (NSColor *)colorForEmacsRed:(CGFloat)red green:(CGFloat)green + blue:(CGFloat)blue alpha:(CGFloat)alpha; +- (NSColor *)colorUsingDefaultColorSpace; + +@end + +/* ========================================================================== + The Emacs application ========================================================================== */ === modified file 'src/nsterm.m' --- src/nsterm.m 2013-12-20 10:48:36 +0000 +++ src/nsterm.m 2013-12-21 16:11:55 +0000 @@ -105,6 +105,43 @@ /* ========================================================================== + NSColor, EmacsColor category. + + ========================================================================== */ +@implementation NSColor (EmacsColor) ++ (NSColor *)colorForEmacsRed:(CGFloat)red green:(CGFloat)green + blue:(CGFloat)blue alpha:(CGFloat)alpha +{ +#ifdef NS_IMPL_COCOA +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if (ns_use_srgb_colorspace) + return [NSColor colorWithSRGBRed: red + green: green + blue: blue + alpha: alpha]; +#endif +#endif + return [NSColor colorWithCalibratedRed: red + green: green + blue: blue + alpha: alpha]; +} + +- (NSColor *)colorUsingDefaultColorSpace +{ +#ifdef NS_IMPL_COCOA +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if (ns_use_srgb_colorspace) + return [self colorUsingColorSpace: [NSColorSpace sRGBColorSpace]]; +#endif +#endif + return [self colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; +} + +@end + +/* ========================================================================== + Local declarations ========================================================================== */ @@ -1509,7 +1546,7 @@ #endif if ((new = [NSColor selectedTextBackgroundColor]) != nil) { - *col = [new colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + *col = [new colorUsingDefaultColorSpace]; unblock_input (); return 0; } @@ -1525,7 +1562,7 @@ */ if ((new = [NSColor selectedTextColor]) != nil) { - *col = [new colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + *col = [new colorUsingDefaultColorSpace]; unblock_input (); return 0; } @@ -1572,7 +1609,7 @@ if (r >= 0.0F) { - *col = [NSColor colorWithCalibratedRed: r green: g blue: b alpha: 1.0]; + *col = [NSColor colorForEmacsRed: r green: g blue: b alpha: 1.0]; unblock_input (); return 0; } @@ -1604,7 +1641,7 @@ } if (new) - *col = [new colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + *col = [new colorUsingDefaultColorSpace]; unblock_input (); return new ? 0 : 1; } @@ -1645,9 +1682,9 @@ return build_string ((char *)str); } - [[col colorUsingColorSpaceName: NSCalibratedRGBColorSpace] + [[col colorUsingDefaultColorSpace] getRed: &red green: &green blue: &blue alpha: &alpha]; - if (red ==green && red ==blue) + if (red == green && red == blue) { [[col colorUsingColorSpaceName: NSCalibratedWhiteColorSpace] getWhite: &gray alpha: &alpha]; @@ -4273,10 +4310,10 @@ name = SSDATA (XCAR (color)); c = XINT (XCDR (color)); [cl setColor: - [NSColor colorWithCalibratedRed: RED_FROM_ULONG (c) / 255.0 - green: GREEN_FROM_ULONG (c) / 255.0 - blue: BLUE_FROM_ULONG (c) / 255.0 - alpha: 1.0] + [NSColor colorForEmacsRed: RED_FROM_ULONG (c) / 255.0 + green: GREEN_FROM_ULONG (c) / 255.0 + blue: BLUE_FROM_ULONG (c) / 255.0 + alpha: 1.0] forKey: [NSString stringWithUTF8String: name]]; } [cl writeToFile: nil]; @@ -7607,6 +7644,12 @@ #endif ns_last_use_native_fullscreen = ns_use_native_fullscreen; + DEFVAR_BOOL ("ns-use-srgb-colorspace", ns_use_srgb_colorspace, + doc: /*Non-nil means to use sRGB colorspace on OSX >= 10.7. +Note that this does not apply to images. +This variable is ignored on OSX < 10.7 and GNUStep. Default is nil. */); + ns_use_srgb_colorspace = NO; + /* TODO: move to common code */ DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars, doc: /* Which toolkit scroll bars Emacs uses, if any. ------------------------------------------------------------ revno: 115663 committer: Chong Yidong branch nick: trunk timestamp: Sat 2013-12-21 23:31:09 +0800 message: Don't make faces when loading Custom themes. * custom.el (custom-theme-recalc-face): Do nothing if the face is undefined. Thus, theme settings for undefined faces do not take effect until the faces are defined with defface, the same as with theme variables. * faces.el (face-spec-set): Use face-spec-recalc in all cases. (face-spec-reset-face): Don't assign extra properties in temacs. (face-spec-recalc): Apply X resources too. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-21 13:44:20 +0000 +++ lisp/ChangeLog 2013-12-21 15:31:09 +0000 @@ -1,11 +1,20 @@ 2013-12-21 Chong Yidong + * custom.el (custom-theme-recalc-face): Do nothing if the face is + undefined. Thus, theme settings for undefined faces do not take + effect until the faces are defined with defface, the same as with + theme variables. + + * faces.el (face-spec-set): Use face-spec-recalc in all cases. + (face-spec-reset-face): Don't assign extra properties in temacs. + (face-spec-recalc): Apply X resources too. + +2013-12-21 Chong Yidong + * faces.el (face-spec-set): * cus-face.el (custom-theme-set-faces, custom-set-faces): * custom.el (defface): Doc fixes (Bug#16203). -2013-12-21 Chong Yidong - * indent.el (indent-rigidly-map): Add docstring, and move commands into named functions. (indent-rigidly-left, indent-rigidly-right) === modified file 'lisp/custom.el' --- lisp/custom.el 2013-12-21 13:44:20 +0000 +++ lisp/custom.el 2013-12-21 15:31:09 +0000 @@ -1459,12 +1459,15 @@ (eval (car valspec)))))) (defun custom-theme-recalc-face (face) - "Set FACE according to currently enabled custom themes." + "Set FACE according to currently enabled custom themes. +If FACE is not initialized as a face, do nothing; otherwise call +`face-spec-recalc' to recalculate the face on all frames." (if (get face 'face-alias) (setq face (get face 'face-alias))) - ;; Reset the faces for each frame. - (dolist (frame (frame-list)) - (face-spec-recalc face frame))) + (if (facep face) + ;; Reset the faces for each frame. + (dolist (frame (frame-list)) + (face-spec-recalc face frame)))) ;;; XEmacs compatibility functions === modified file 'lisp/faces.el' --- lisp/faces.el 2013-12-21 13:44:20 +0000 +++ lisp/faces.el 2013-12-21 15:31:09 +0000 @@ -1555,16 +1555,16 @@ :box nil :inverse-video nil :stipple nil :inherit nil) ;; `display-graphic-p' is unavailable when running ;; temacs, prior to loading frame.el. - (unless (and (fboundp 'display-graphic-p) - (display-graphic-p frame)) - `(:family "default" :foundry "default" :width normal - :height 1 :weight normal :slant normal - :foreground ,(if (frame-parameter nil 'reverse) - "unspecified-bg" - "unspecified-fg") - :background ,(if (frame-parameter nil 'reverse) - "unspecified-fg" - "unspecified-bg")))) + (when (fboundp 'display-graphic-p) + (unless (display-graphic-p frame) + `(:family "default" :foundry "default" :width normal + :height 1 :weight normal :slant normal + :foreground ,(if (frame-parameter nil 'reverse) + "unspecified-bg" + "unspecified-fg") + :background ,(if (frame-parameter nil 'reverse) + "unspecified-fg" + "unspecified-bg"))))) ;; For all other faces, unspecify all attributes. (apply 'append (mapcar (lambda (x) (list (car x) 'unspecified)) @@ -1574,13 +1574,13 @@ "Set the face spec SPEC for FACE. See `defface' for the format of SPEC. -The appearance of each face is controlled by its spec, and by the -internal face attributes (which can be frame-specific and can be -set via `set-face-attribute'). This function sets the former. +The appearance of each face is controlled by its specs (set via +this function), and by the internal frame-specific face +attributes (set via `set-face-attribute'). -In addition to setting the face spec, this function defines FACE -as a valid face name if it is not already one, and (re)calculates -the face's attributes on existing frames. +This function also defines FACE as a valid face name if it is not +already one, and (re)calculates its attributes on existing +frames. The argument SPEC-TYPE determines which spec to set: nil or `face-override-spec' means the override spec (which is @@ -1612,20 +1612,10 @@ ;; as far as Custom is concerned. (unless (eq face 'face-override-spec) (put face 'face-modified nil)) - (if (facep face) - ;; If the face already exists, recalculate it. - (dolist (frame (frame-list)) - (face-spec-recalc face frame)) - ;; Otherwise, initialize it on all frames. - (make-empty-face face) - (let ((value (face-user-default-spec face)) - (have-window-system (memq initial-window-system '(x w32 ns)))) - (dolist (frame (frame-list)) - (face-spec-set-2 face frame value) - (when (memq (window-system frame) '(x w32 ns)) - (setq have-window-system t))) - (if have-window-system - (make-face-x-resource-internal face))))) + ;; Initialize the face if it does not exist, then recalculate. + (make-empty-face face) + (dolist (frame (frame-list)) + (face-spec-recalc face frame))) (defun face-spec-recalc (face frame) "Reset the face attributes of FACE on FRAME according to its specs. @@ -1642,7 +1632,8 @@ (dolist (spec (reverse theme-faces)) (face-spec-set-2 face frame (cadr spec))) (face-spec-set-2 face frame (face-default-spec face)))) - (face-spec-set-2 face frame (get face 'face-override-spec))) + (face-spec-set-2 face frame (get face 'face-override-spec)) + (make-face-x-resource-internal face frame)) (defun face-spec-set-2 (face frame spec) "Set the face attributes of FACE on FRAME according to SPEC." ------------------------------------------------------------ revno: 115662 fixes bug: http://debbugs.gnu.org/16203 committer: Chong Yidong branch nick: trunk timestamp: Sat 2013-12-21 21:44:20 +0800 message: Doc fixes for face functions. * faces.el (face-spec-set): * cus-face.el (custom-theme-set-faces, custom-set-faces): * custom.el (defface): Doc fixes. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-21 08:37:08 +0000 +++ lisp/ChangeLog 2013-12-21 13:44:20 +0000 @@ -1,5 +1,11 @@ 2013-12-21 Chong Yidong + * faces.el (face-spec-set): + * cus-face.el (custom-theme-set-faces, custom-set-faces): + * custom.el (defface): Doc fixes (Bug#16203). + +2013-12-21 Chong Yidong + * indent.el (indent-rigidly-map): Add docstring, and move commands into named functions. (indent-rigidly-left, indent-rigidly-right) === modified file 'lisp/cus-face.el' --- lisp/cus-face.el 2013-01-02 16:13:04 +0000 +++ lisp/cus-face.el 2013-12-21 13:44:20 +0000 @@ -285,47 +285,48 @@ ;;; Initializing. (defun custom-set-faces (&rest args) - "Initialize faces according to user preferences. -This associates the settings with the `user' theme. + "Apply a list of face specs for user customizations. +This works by calling `custom-theme-set-faces' for the `user' +theme, a special theme referring to settings made via Customize. The arguments should be a list where each entry has the form: (FACE SPEC [NOW [COMMENT]]) -SPEC is stored as the saved value for FACE, as well as the value for the -`user' theme. The `user' theme is one of the default themes known to Emacs. -See `custom-known-themes' for more information on the known themes. -See `custom-theme-set-faces' for more information on the interplay -between themes and faces. -See `defface' for the format of SPEC. - -If NOW is present and non-nil, FACE is created now, according to SPEC. -COMMENT is a string comment about FACE." +See the documentation of `custom-theme-set-faces' for details." (apply 'custom-theme-set-faces 'user args)) (defun custom-theme-set-faces (theme &rest args) - "Initialize faces for theme THEME. -The arguments should be a list where each entry has the form: + "Apply a list of face specs associated with theme THEME. +THEME should be a theme name (a symbol). The special theme named +`user' refers to user settings applied via Customize. + +The remaining ARGS should be a list where each entry is a list of +the form: (FACE SPEC [NOW [COMMENT]]) -SPEC is stored as the saved value for FACE, as well as the value for the -`user' theme. The `user' theme is one of the default themes known to Emacs. -See `custom-known-themes' for more information on the known themes. -See `custom-theme-set-faces' for more information on the interplay -between themes and faces. -See `defface' for the format of SPEC. - -If NOW is present and non-nil, FACE is created now, according to SPEC. +FACE should be a face name (a symbol). If FACE is a face alias, +the setting refers to the parent face. + +SPEC should be a face spec. For details, see `defface'. + +NOW, if present and non-nil, forces the face settings to take +immediate effect in the Emacs display; in particular, FACE is +initialized as a face if it is not yet one. If NOW is omitted or +nil, the caller is responsible for making the settings take +effect later, by calling `custom-theme-recalc-face' or +`face-spec-recalc'. + COMMENT is a string comment about FACE. -Several properties of THEME and FACE are used in the process: - -If THEME property `theme-immediate' is non-nil, this is equivalent of -providing the NOW argument to all faces in the argument list: FACE is -created now. - -SPEC itself is saved in FACE property `saved-face' and it is stored in -FACE's list property `theme-face' \(using `custom-push-theme')." +This function works by calling `custom-push-theme' to record each +SPEC in each FACE's `theme-face' property, and in THEME's +`theme-settings' property. If FACE has not already been +customized, it also stores SPEC in the `saved-face' property. + +If THEME has a non-nil `theme-immediate' property, this is +equivalent to providing the NOW argument to all faces in the +argument list." (custom-check-theme theme) (let ((immediate (get theme 'theme-immediate))) (dolist (entry args) === modified file 'lisp/custom.el' --- lisp/custom.el 2013-12-18 14:54:24 +0000 +++ lisp/custom.el 2013-12-21 13:44:20 +0000 @@ -353,7 +353,7 @@ Third argument DOC is the face documentation. -If FACE has been set with `custom-set-faces', set the face +If FACE has been set with `custom-theme-set-faces', set the face attributes as specified by that function, otherwise set the face attributes according to SPEC. @@ -361,7 +361,7 @@ For a list of valid keywords, see the common keywords listed in `defcustom'. -SPEC should be an alist of the form +SPEC should be a \"face spec\", i.e., an alist of the form ((DISPLAY . ATTS)...) === modified file 'lisp/faces.el' --- lisp/faces.el 2013-12-20 23:06:17 +0000 +++ lisp/faces.el 2013-12-21 13:44:20 +0000 @@ -1576,7 +1576,11 @@ The appearance of each face is controlled by its spec, and by the internal face attributes (which can be frame-specific and can be -set via `set-face-attribute'). +set via `set-face-attribute'). This function sets the former. + +In addition to setting the face spec, this function defines FACE +as a valid face name if it is not already one, and (re)calculates +the face's attributes on existing frames. The argument SPEC-TYPE determines which spec to set: nil or `face-override-spec' means the override spec (which is @@ -1589,11 +1593,7 @@ `reset' means to ignore SPEC, but clear the `customized-face' and `face-override-spec' specs; Any other value means not to set any spec, but to run the -function for its other effects. - -In addition to setting the face spec, this function defines FACE -as a valid face name if it is not already one, and (re)calculates -the face's attributes on existing frames." +function for its other effects." (if (get face 'face-alias) (setq face (get face 'face-alias))) ;; Save SPEC to the relevant symbol property. ------------------------------------------------------------ revno: 115661 committer: Chong Yidong branch nick: trunk timestamp: Sat 2013-12-21 21:43:11 +0800 message: * themes/tango-dark-theme.el: Minor color tweak. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-12-13 21:41:35 +0000 +++ etc/ChangeLog 2013-12-21 13:43:11 +0000 @@ -1,3 +1,7 @@ +2013-12-21 Chong Yidong + + * themes/tango-dark-theme.el: Minor color tweak. + 2013-12-13 David Engster * NEWS: Add sections for CEDET and EIEIO. === modified file 'etc/themes/tango-dark-theme.el' --- etc/themes/tango-dark-theme.el 2013-01-01 09:11:05 +0000 +++ etc/themes/tango-dark-theme.el 2013-12-21 13:43:11 +0000 @@ -39,12 +39,12 @@ (choc-1 "#e9b96e") (choc-2 "#c17d11") (choc-3 "#8f5902") (cham-1 "#8ae234") (cham-2 "#73d216") (cham-3 "#4e9a06") (blue-1 "#729fcf") (blue-2 "#3465a4") (blue-3 "#204a87") - (plum-1 "#ad7fa8") (plum-2 "#75507b") (plum-3 "#5c3566") + (plum-1 "#e090d7") (plum-2 "#75507b") (plum-3 "#5c3566") (red-1 "#ef2929") (red-2 "#cc0000") (red-3 "#a40000") (alum-1 "#eeeeec") (alum-2 "#d3d7cf") (alum-3 "#babdb6") (alum-4 "#888a85") (alum-5 "#555753") (alum-6 "#2e3436") ;; Not in Tango palette; used for better contrast. - (cham-0 "#b4fa70") (blue-0 "#8cc4ff") (plum-0 "#e6a8df") + (cham-0 "#b4fa70") (blue-0 "#8cc4ff") (plum-0 "#e9b2e3") (red-0 "#ff4b4b") (alum-5.5 "#41423f") (alum-7 "#212526")) (custom-theme-set-faces ------------------------------------------------------------ revno: 115660 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2013-12-21 11:09:48 +0200 message: Fix compilation warning on MS-Windows in my_png_error. src/image.c (fn_png_longjmp) [WINDOWSNT]: Mark the function as having the PNG_NORETURN attribute, to avoid compiler warning in my_png_error. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-21 07:04:07 +0000 +++ src/ChangeLog 2013-12-21 09:09:48 +0000 @@ -1,3 +1,9 @@ +2013-12-21 Eli Zaretskii + + * image.c (fn_png_longjmp) [WINDOWSNT]: Mark the function as + having the PNG_NORETURN attribute, to avoid compiler warning in + my_png_error. + 2013-12-21 YAMAMOTO Mitsuharu * w32term.h (struct scroll_bar): Remove member `fringe_extended_p'. === modified file 'src/image.c' --- src/image.c 2013-12-18 20:36:50 +0000 +++ src/image.c 2013-12-21 09:09:48 +0000 @@ -5536,7 +5536,7 @@ DEF_IMGLIB_FN (void, png_error, (png_structp, png_const_charp)); #if (PNG_LIBPNG_VER >= 10500) -DEF_IMGLIB_FN (void, png_longjmp, (png_structp, int)); +DEF_IMGLIB_FN (void, png_longjmp, (png_structp, int)) PNG_NORETURN; DEF_IMGLIB_FN (jmp_buf *, png_set_longjmp_fn, (png_structp, png_longjmp_ptr, size_t)); #endif /* libpng version >= 1.5 */