commit 39577d07124ee16895b9c6aab7e2c6e7d41cc715 (HEAD, refs/remotes/origin/master) Merge: 77557ce ad250f2 Author: Paul Eggert Date: Wed Mar 23 11:27:22 2016 -0700 Merge from origin/emacs-25 ad250f2 Sync with gnulib c0165ea Resurrect GNUS-NEWS autogeneration # Conflicts: # etc/GNUS-NEWS # lisp/Makefile.in commit 77557ce8ca903d5358808d34c9d80fc4be8e1759 Merge: 16e4bd5 1e5327c Author: Paul Eggert Date: Wed Mar 23 11:24:28 2016 -0700 ; Merge from origin/emacs-25 The following commit was skipped: 1e5327c ; Backport ChangeLog.2 fixes from master commit 16e4bd52e3119d4905de02d33f1cc134498cb0b6 Merge: 70c7a51 e643977 Author: Paul Eggert Date: Wed Mar 23 11:24:28 2016 -0700 Merge from origin/emacs-25 e643977 Make `toggle-frame-maximized' respect the dock on OS X (bug#2... 38a43f1 Fix bug in displaying header line with a box face commit 70c7a51d1410f446fd7e9a49aa370ecbed7941bb Author: Paul Eggert Date: Wed Mar 23 11:22:57 2016 -0700 * etc/NEWS: Use straight quotes. diff --git a/etc/NEWS b/etc/NEWS index 2ffb11e..0bc6130 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -136,7 +136,7 @@ different group ID. ** CSS mode --- -*** Support for completing attribute values using the `completion-at-point' +*** Support for completing attribute values using the 'completion-at-point' command. commit ad250f2b673f3ca9d1e22c01ae4d0e83fabb4520 Author: Paul Eggert Date: Wed Mar 23 11:17:37 2016 -0700 Sync with gnulib This incorporates: 2016-03-22 gitlog-to-changelog: suppress ignored chatter 2016-03-21 sys_select: port to new Cygwin * build-aux/gitlog-to-changelog, doc/misc/texinfo.tex: * lib/sys_select.in.h: Copy from gnulib. diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index a2513d0..83bafdf 100755 --- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' if 0; # Convert git log output to ChangeLog format. -my $VERSION = '2016-01-12 23:09'; # UTC +my $VERSION = '2016-03-22 21:49'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook @@ -298,9 +298,7 @@ sub git_dir_option($) { if ($sha =~ /^$_/) { - $skipflag = 1; - ## Perhaps only warn if a pattern matches more than once? - warn "$ME: warning: skipping $sha due to $_\n"; + $skipflag = $_; last; } } @@ -386,8 +384,17 @@ sub git_dir_option($) } # Ignore commits that match the --ignore-matching pattern, if specified. - if (! ($skipflag || (defined $ignore_matching - && @line && $line[0] =~ /$ignore_matching/))) + if (defined $ignore_matching && @line && $line[0] =~ /$ignore_matching/) + { + $skipflag = 1; + } + elsif ($skipflag) + { + ## Perhaps only warn if a pattern matches more than once? + warn "$ME: warning: skipping $sha due to $skipflag\n"; + } + + if (! $skipflag) { if (defined $ignore_line && @line) { diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index d04e2dd..9437a4d 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2016-03-06.18} +\def\texinfoversion{2016-03-22.15} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -1513,10 +1513,27 @@ \fi % \ifx\pdfoutput % -% PDF outline support for XeTeX +% For XeTeX % +\newif\iftxiuseunicodedestname \ifx\XeTeXrevision\thisisundefined \else + % + % XeTeX version check + % + \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99995}>-1 + % XeTeX 0.99995+ contains xdvipdfmx 20160307+. + % It can handle Unicode destination name for PDF. + \txiuseunicodedestnametrue + \else + % XeTeX < 0.99995 can not handle Unicode destination name for PDF + % because xdvipdfmx 20150315 has UTF-16 convert issue. + % It fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). + \txiuseunicodedestnamefalse + \fi + % + % PDF outline support + % \pdfmakepagedesttrue \relax % Emulate the primitive of pdfTeX \def\pdfdest name#1 xyz{% @@ -1525,15 +1542,25 @@ \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. - \indexnofonts % For avoiding UTF-16 convert issue of xdvipdfmx 20150315. + \indexnofonts + \iftxiuseunicodedestname + \def\pdfdestname{#1}% Pass through Unicode characters. + \else + \edef\pdfdestname{#1}% Replace Unicode characters to ASCII. + \fi + \turnoffactive \makevalueexpandable % In the case of XeTeX, xdvipdfmx converts strings to UTF-16. % Therefore \txiescapepdf is not necessary. - \safewhatsit{\pdfdest name{#1} xyz}% + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % \def\dopdfoutline#1#2#3#4{% - \edef\pdfoutlinedest{#3}% + \iftxiuseunicodedestname + \def\pdfoutlinedest{#3}% Pass through Unicode characters. + \else + \edef\pdfoutlinedest{#3}% Replace Unicode characters to ASCII. + \fi \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}% \fi @@ -1574,7 +1601,7 @@ % In the case of XeTeX, xdvipdfmx converts strings to UTF-16. % Therefore, the encoding and the language may not be considered. % - \indexnofonts % For avoiding UTF-16 convert issue of xdvipdfmx 20150315. + \indexnofonts \setupdatafile % We can have normal brace characters in the PDF outlines, unlike % Texinfo index files. So set that up. @@ -1596,14 +1623,31 @@ % However, due to UTF-16 convert issue of xdvipdfmx 20150315, % ``\special{pdf:dest ...}'' can not handle non-ASCII strings. % It fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). -\fi - % -% @image support for XeTeX + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % + \leavevmode\setcolor{\urlcolor}% + \special{pdf:bann << /Border [0 0 0] + /Subtype /Link /A << /S /URI /URI (#1) >> >>}% + \endgroup} + \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} % -\newif\ifxeteximgpdf -\ifx\XeTeXrevision\thisisundefined -\else + % + % @image support % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\doxeteximage#1#2#3{% @@ -1615,7 +1659,6 @@ % someone has a scalable image, presumably better to use that than a % bitmap. \let\xeteximgext=\empty - \xeteximgpdffalse \begingroup \openin 1 #1.pdf \ifeof 1 \openin 1 #1.PDF \ifeof 1 @@ -1632,17 +1675,23 @@ \fi \else \gdef\xeteximgext{png}% \fi - \else \gdef\xeteximgext{PDF} \global\xeteximgpdftrue% + \else \gdef\xeteximgext{PDF}% \fi - \else \gdef\xeteximgext{pdf} \global\xeteximgpdftrue% + \else \gdef\xeteximgext{pdf}% \fi \closein 1 \endgroup % - \ifxeteximgpdf + \def\xetexpdfext{pdf}% + \ifx\xeteximgext\xetexpdfext \XeTeXpdffile "#1".\xeteximgext "" \else - \XeTeXpicfile "#1".\xeteximgext "" + \def\xetexpdfext{PDF}% + \ifx\xeteximgext\xetexpdfext + \XeTeXpdffile "#1".\xeteximgext "" + \else + \XeTeXpicfile "#1".\xeteximgext "" + \fi \fi \ifdim \wd0 >0pt width \xeteximagewidth \fi \ifdim \wd2 >0pt height \xeteximageheight \fi \relax @@ -7804,7 +7853,7 @@ % Process the macro body under the current catcode regime. \scantokens{#1\texinfoc}\aftermacro% % - % The \c is to remove the \newlinechar added by \scantokens, and + % The \texinfoc is to remove the \newlinechar added by \scantokens, and % can be noticed by \parsearg. % The \aftermacro allows a \comment at the end of the macro definition % to duplicate itself past the final \newlinechar added by \scantokens: @@ -7817,15 +7866,7 @@ % Used for copying and captions \def\scanexp#1{% - \bgroup - % Undo catcode changes of \startcontents and \printindex - % When called from @insertcopying or (short)caption, we need active - % backslash to get it printed correctly. - % FIXME: This may not be needed. - %\catcode`\@=0 \catcode`\\=\active \escapechar=`\@ - \edef\temp{\noexpand\scanmacro{#1}}% - \temp - \egroup + \expandafter\scanmacro\expandafter{#1}% } \newcount\paramno % Count of parameters @@ -9371,7 +9412,7 @@ % \ifx\thiscaption\empty \else \ifx\floatident\empty \else - \appendtomacro\captionline{: }% had ident, so need a colon between + \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. @@ -9398,30 +9439,17 @@ \requireauxfile \atdummies % - % since we read the caption text in the macro world, where ^^M - % is turned into a normal character, we have to scan it back, so - % we don't write the literal three characters "^^M" into the aux file. - \scanexp{% - \xdef\noexpand\gtemp{% - \ifx\thisshortcaption\empty - \thiscaption - \else - \thisshortcaption - \fi - }% - }% + \ifx\thisshortcaption\empty + \def\gtemp{\thiscaption}% + \else + \def\gtemp{\thisshortcaption}% + \fi \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident - \ifx\gtemp\empty \else : \gtemp \fi}}% + \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % - % place the captured inserts - % - % BEWARE: when the floats start floating, we have to issue warning - % whenever an insert appears inside a float which could possibly - % float. --kasal, 26may04 - % \checkinserts } @@ -10865,6 +10893,10 @@ \unicodechardefs } +% Whether the active definitions of non-ASCII characters expand to +% non-active tokens with the same character code. This is used to +% write characters literally, instead of using active definitions for +% printing the correct glyphs. \newif\ifpassthroughchars \passthroughcharsfalse @@ -10917,13 +10949,6 @@ \relax } -% Whether the active definitions of non-ASCII characters expand to -% non-active tokens with the same character code. This is used to -% write characters literally, instead of using active definitions for -% printing the correct glyphs. -\newif\ifpassthroughchars -\passthroughcharsfalse - % define all the unicode characters we know about, for the sake of @U. \iftxinativeunicodecapable \nativeunicodechardefsatu diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index a557e04..9a2622f 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -81,8 +81,9 @@ of 'struct timeval', and no definition of this type. Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select() in . - But avoid namespace pollution on glibc systems. */ -# ifndef __GLIBC__ + But avoid namespace pollution on glibc systems and "unknown type + name" problems on Cygwin. */ +# if !(defined __GLIBC__ || defined __CYGWIN__) # include # endif @@ -100,10 +101,11 @@ #endif /* Get definition of 'sigset_t'. - But avoid namespace pollution on glibc systems. + But avoid namespace pollution on glibc systems and "unknown type + name" problems on Cygwin. Do this after the include_next (for the sake of OpenBSD 5.0) but before the split double-inclusion guard (for the sake of Solaris). */ -#if !(defined __GLIBC__ && !defined __UCLIBC__) +#if !((defined __GLIBC__ || defined __CYGWIN__) && !defined __UCLIBC__) # include #endif commit 269d5631ab6ae7a5a792d0139b9421bddac8870c Author: Simen Heggestøyl Date: Wed Mar 23 19:03:47 2016 +0100 Support completion of attribute values in CSS mode * lisp/textmodes/css-mode.el (css-property-alist): New defconst holding CSS identifiers and the values they can have. (css-property-ids): Compute dynamically from `css-property-alist'. (css-value-class-alist): New defconst holding property value classes and their values. (css--property-value-cache): New variable providing a cache for `css--property-values'. (css--value-class-lookup): New function for computing a list of values in a value class. (css--property-values): New function for computing a list of possible values for a CSS property. (css--complete-property-value): New function for completing a property value. (css-completion-at-point): Add support for completing property values. * test/lisp/textmodes/css-mode-tests.el: New file. diff --git a/etc/NEWS b/etc/NEWS index 427835a..2ffb11e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -133,6 +133,12 @@ different group ID. --- ** 'auto-revert-use-notify' is set back to t in 'global-auto-revert-mode'. +** CSS mode + +--- +*** Support for completing attribute values using the `completion-at-point' +command. + * New Modes and Packages in Emacs 25.2 diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 93a8dce..fd3459e 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -29,11 +29,13 @@ ;; - electric ; and } ;; - filling code with auto-fill-mode -;; - attribute value completion ;; - fix font-lock errors with multi-line selectors ;;; Code: +(require 'seq) +(require 'smie) + (defgroup css nil "Cascading Style Sheets (CSS) editing mode." :group 'languages) @@ -74,124 +76,465 @@ "visual") "Identifiers for types of media.") -(defconst css-property-ids - '(;; CSS 2.1 properties (http://www.w3.org/TR/CSS21/propidx.html). - ;; - ;; Properties duplicated by any of the CSS3 modules below have - ;; been removed. - "azimuth" "border-collapse" "border-spacing" "bottom" - "caption-side" "clear" "clip" "content" "counter-increment" - "counter-reset" "cue" "cue-after" "cue-before" "direction" "display" - "elevation" "empty-cells" "float" "height" "left" "line-height" - "list-style" "list-style-image" "list-style-position" - "list-style-type" "margin" "margin-bottom" "margin-left" - "margin-right" "margin-top" "max-height" "max-width" "min-height" - "min-width" "padding" "padding-bottom" "padding-left" - "padding-right" "padding-top" "page-break-after" - "page-break-before" "page-break-inside" "pause" "pause-after" - "pause-before" "pitch" "pitch-range" "play-during" "position" - "quotes" "richness" "right" "speak" "speak-header" "speak-numeral" - "speak-punctuation" "speech-rate" "stress" "table-layout" "top" - "unicode-bidi" "vertical-align" "visibility" "voice-family" "volume" - "width" "z-index" +(defconst css-property-alist + ;; CSS 2.1 properties (http://www.w3.org/TR/CSS21/propidx.html). + ;; + ;; Properties duplicated by any of the CSS3 modules below have been + ;; removed. + '(("azimuth" angle "left-side" "far-left" "left" "center-left" + "center" "center-right" "right" "far-right" "right-side" "behind" + "leftwards" "rightwards") + ("border-collapse" "collapse" "separate") + ("border-spacing" length) + ("bottom" length percentage "auto") + ("caption-side" "top" "bottom") + ("clear" "none" "left" "right" "both") + ("clip" shape "auto") + ("content" "normal" "none" string uri counter "attr()" + "open-quote" "close-quote" "no-open-quote" "no-close-quote") + ("counter-increment" identifier integer "none") + ("counter-reset" identifier integer "none") + ("cue" cue-before cue-after) + ("cue-after" uri "none") + ("cue-before" uri "none") + ("direction" "ltr" "rtl") + ("display" "inline" "block" "list-item" "inline-block" "table" + "inline-table" "table-row-group" "table-header-group" + "table-footer-group" "table-row" "table-column-group" + "table-column" "table-cell" "table-caption" "none" + ;; CSS Flexible Box Layout Module Level 1 + ;; (https://www.w3.org/TR/css3-flexbox/#valdef-display-flex) + "flex" "inline-flex") + ("elevation" angle "below" "level" "above" "higher" "lower") + ("empty-cells" "show" "hide") + ("float" "left" "right" "none") + ("height" length percentage "auto") + ("left" length percentage "auto") + ("line-height" "normal" number length percentage) + ("list-style" list-style-type list-style-position + list-style-image) + ("list-style-image" uri "none") + ("list-style-position" "inside" "outside") + ("list-style-type" "disc" "circle" "square" "decimal" + "decimal-leading-zero" "lower-roman" "upper-roman" "lower-greek" + "lower-latin" "upper-latin" "armenian" "georgian" "lower-alpha" + "upper-alpha" "none") + ("margin" margin-width) + ("margin-bottom" margin-width) + ("margin-left" margin-width) + ("margin-right" margin-width) + ("margin-top" margin-width) + ("max-height" length percentage "none") + ("max-width" length percentage "none") + ("min-height" length percentage) + ("min-width" length percentage) + ("padding" padding-width) + ("padding-bottom" padding-width) + ("padding-left" padding-width) + ("padding-right" padding-width) + ("padding-top" padding-width) + ("page-break-after" "auto" "always" "avoid" "left" "right") + ("page-break-before" "auto" "always" "avoid" "left" "right") + ("page-break-inside" "avoid" "auto") + ("pause" time percentage) + ("pause-after" time percentage) + ("pause-before" time percentage) + ("pitch" frequency "x-low" "low" "medium" "high" "x-high") + ("pitch-range" number) + ("play-during" uri "mix" "repeat" "auto" "none") + ("position" "static" "relative" "absolute" "fixed") + ("quotes" string "none") + ("richness" number) + ("right" length percentage "auto") + ("speak" "normal" "none" "spell-out") + ("speak-header" "once" "always") + ("speak-numeral" "digits" "continuous") + ("speak-punctuation" "code" "none") + ("speech-rate" number "x-slow" "slow" "medium" "fast" "x-fast" + "faster" "slower") + ("stress" number) + ("table-layout" "auto" "fixed") + ("top" length percentage "auto") + ("unicode-bidi" "normal" "embed" "bidi-override") + ("vertical-align" "baseline" "sub" "super" "top" "text-top" + "middle" "bottom" "text-bottom" percentage length) + ("visibility" "visible" "hidden" "collapse") + ("voice-family" specific-voice generic-voice specific-voice + generic-voice) + ("volume" number percentage "silent" "x-soft" "soft" "medium" + "loud" "x-loud") + ("width" length percentage "auto") + ("z-index" "auto" integer) ;; CSS Animations ;; (http://www.w3.org/TR/css3-animations/#property-index) - "animation" "animation-delay" "animation-direction" - "animation-duration" "animation-fill-mode" - "animation-iteration-count" "animation-name" - "animation-play-state" "animation-timing-function" + ("animation" single-animation-name time single-timing-function + single-animation-iteration-count single-animation-direction + single-animation-fill-mode single-animation-play-state) + ("animation-delay" time) + ("animation-direction" single-animation-direction) + ("animation-duration" time) + ("animation-fill-mode" single-animation-fill-mode) + ("animation-iteration-count" single-animation-iteration-count) + ("animation-name" single-animation-name) + ("animation-play-state" single-animation-play-state) + ("animation-timing-function" single-timing-function) ;; CSS Backgrounds and Borders Module Level 3 ;; (http://www.w3.org/TR/css3-background/#property-index) - "background" "background-attachment" "background-clip" - "background-color" "background-image" "background-origin" - "background-position" "background-repeat" "background-size" - "border" "border-bottom" "border-bottom-color" - "border-bottom-left-radius" "border-bottom-right-radius" - "border-bottom-style" "border-bottom-width" "border-color" - "border-image" "border-image-outset" "border-image-repeat" - "border-image-slice" "border-image-source" "border-image-width" - "border-left" "border-left-color" "border-left-style" - "border-left-width" "border-radius" "border-right" - "border-right-color" "border-right-style" "border-right-width" - "border-style" "border-top" "border-top-color" - "border-top-left-radius" "border-top-right-radius" - "border-top-style" "border-top-width" "border-width" "box-shadow" + ("background" bg-layer final-bg-layer) + ("background-attachment" attachment) + ("background-clip" box) + ("background-color" color) + ("background-image" bg-image) + ("background-origin" box) + ("background-position" position) + ("background-repeat" repeat-style) + ("background-size" bg-size) + ("border" line-width line-style color) + ("border-bottom" line-width line-style color) + ("border-bottom-color" color) + ("border-bottom-left-radius" length percentage) + ("border-bottom-right-radius" length percentage) + ("border-bottom-style" line-style) + ("border-bottom-width" line-width) + ("border-color" color) + ("border-image" border-image-source border-image-slice + border-image-width border-image-outset border-image-repeat) + ("border-image-outset" length number) + ("border-image-repeat" "stretch" "repeat" "round" "space") + ("border-image-slice" number percentage "fill") + ("border-image-source" "none" image) + ("border-image-width" length percentage number "auto") + ("border-left" line-width line-style color) + ("border-left-color" color) + ("border-left-style" line-style) + ("border-left-width" line-width) + ("border-radius" length percentage) + ("border-right" line-width line-style color) + ("border-right-color" color) + ("border-right-style" line-style) + ("border-right-width" line-width) + ("border-style" line-style) + ("border-top" line-width line-style color) + ("border-top-color" color) + ("border-top-left-radius" length percentage) + ("border-top-right-radius" length percentage) + ("border-top-style" line-style) + ("border-top-width" line-width) + ("border-width" line-width) + ("box-shadow" "none" shadow) ;; CSS Basic User Interface Module Level 3 (CSS3 UI) ;; (http://www.w3.org/TR/css3-ui/#property-index) - "box-sizing" "caret-color" "cursor" "nav-down" "nav-left" - "nav-right" "nav-up" "outline" "outline-color" "outline-offset" - "outline-style" "outline-width" "resize" "text-overflow" + ("box-sizing" "content-box" "border-box") + ("caret-color" "auto" color) + ("cursor" uri x y "auto" "default" "none" "context-menu" "help" + "pointer" "progress" "wait" "cell" "crosshair" "text" + "vertical-text" "alias" "copy" "move" "no-drop" "not-allowed" + "grab" "grabbing" "e-resize" "n-resize" "ne-resize" "nw-resize" + "s-resize" "se-resize" "sw-resize" "w-resize" "ew-resize" + "ns-resize" "nesw-resize" "nwse-resize" "col-resize" "row-resize" + "all-scroll" "zoom-in" "zoom-out") + ("nav-down" "auto" id "current" "root" target-name) + ("nav-left" "auto" id "current" "root" target-name) + ("nav-right" "auto" id "current" "root" target-name) + ("nav-up" "auto" id "current" "root" target-name) + ("outline" outline-color outline-style outline-width) + ("outline-color" color "invert") + ("outline-offset" length) + ("outline-style" "auto" border-style) + ("outline-width" border-width) + ("resize" "none" "both" "horizontal" "vertical") + ("text-overflow" "clip" "ellipsis" string) ;; CSS Color Module Level 3 ;; (http://www.w3.org/TR/css3-color/#property) - "color" "opacity" + ("color" color) + ("opacity" alphavalue) ;; CSS Flexible Box Layout Module Level 1 ;; (http://www.w3.org/TR/css-flexbox-1/#property-index) - "align-content" "align-items" "align-self" "flex" "flex-basis" - "flex-direction" "flex-flow" "flex-grow" "flex-shrink" "flex-wrap" - "justify-content" "order" + ("align-content" "flex-start" "flex-end" "center" "space-between" + "space-around" "stretch") + ("align-items" "flex-start" "flex-end" "center" "baseline" + "stretch") + ("align-self" "auto" "flex-start" "flex-end" "center" "baseline" + "stretch") + ("flex" "none" flex-grow flex-shrink flex-basis) + ("flex-basis" "auto" "content" width) + ("flex-direction" "row" "row-reverse" "column" "column-reverse") + ("flex-flow" flex-direction flex-wrap) + ("flex-grow" number) + ("flex-shrink" number) + ("flex-wrap" "nowrap" "wrap" "wrap-reverse") + ("justify-content" "flex-start" "flex-end" "center" + "space-between" "space-around") + ("order" integer) ;; CSS Fonts Module Level 3 ;; (http://www.w3.org/TR/css3-fonts/#property-index) - "font" "font-family" "font-feature-settings" "font-kerning" - "font-language-override" "font-size" "font-size-adjust" - "font-stretch" "font-style" "font-synthesis" "font-variant" - "font-variant-alternates" "font-variant-caps" - "font-variant-east-asian" "font-variant-ligatures" - "font-variant-numeric" "font-variant-position" "font-weight" + ("font" font-style font-variant-css21 font-weight font-stretch + font-size line-height font-family "caption" "icon" "menu" + "message-box" "small-caption" "status-bar") + ("font-family" family-name generic-family) + ("font-feature-settings" "normal" feature-tag-value) + ("font-kerning" "auto" "normal" "none") + ("font-language-override" "normal" string) + ("font-size" absolute-size relative-size length percentage) + ("font-size-adjust" "none" number) + ("font-stretch" "normal" "ultra-condensed" "extra-condensed" + "condensed" "semi-condensed" "semi-expanded" "expanded" + "extra-expanded" "ultra-expanded") + ("font-style" "normal" "italic" "oblique") + ("font-synthesis" "none" "weight" "style") + ("font-variant" "normal" "none" common-lig-values + discretionary-lig-values historical-lig-values + contextual-alt-values "stylistic()" "historical-forms" + "styleset()" "character-variant()" "swash()" "ornaments()" + "annotation()" "small-caps" "all-small-caps" "petite-caps" + "all-petite-caps" "unicase" "titling-caps" numeric-figure-values + numeric-spacing-values numeric-fraction-values "ordinal" + "slashed-zero" east-asian-variant-values east-asian-width-values + "ruby") + ("font-variant-alternates" "normal" "stylistic()" + "historical-forms" "styleset()" "character-variant()" "swash()" + "ornaments()" "annotation()") + ("font-variant-caps" "normal" "small-caps" "all-small-caps" + "petite-caps" "all-petite-caps" "unicase" "titling-caps") + ("font-variant-east-asian" "normal" east-asian-variant-values + east-asian-width-values "ruby") + ("font-variant-ligatures" "normal" "none" common-lig-values + discretionary-lig-values historical-lig-values + contextual-alt-values) + ("font-variant-numeric" "normal" numeric-figure-values + numeric-spacing-values numeric-fraction-values "ordinal" + "slashed-zero") + ("font-variant-position" "normal" "sub" "super") + ("font-weight" "normal" "bold" "bolder" "lighter" "100" "200" + "300" "400" "500" "600" "700" "800" "900") ;; CSS Fragmentation Module Level 3 ;; (https://www.w3.org/TR/css-break-3/#property-index) - "box-decoration-break" "break-after" "break-before" "break-inside" - "orphans" "widows" + ("box-decoration-break" "slice" "clone") + ("break-after" "auto" "avoid" "avoid-page" "page" "left" "right" + "recto" "verso" "avoid-column" "column" "avoid-region" "region") + ("break-before" "auto" "avoid" "avoid-page" "page" "left" "right" + "recto" "verso" "avoid-column" "column" "avoid-region" "region") + ("break-inside" "auto" "avoid" "avoid-page" "avoid-column" + "avoid-region") + ("orphans" integer) + ("widows" integer) ;; CSS Multi-column Layout Module ;; (https://www.w3.org/TR/css3-multicol/#property-index) ;; "break-after", "break-before", and "break-inside" are left out ;; below, because they're already included in CSS Fragmentation ;; Module Level 3. - "column-count" "column-fill" "column-gap" "column-rule" - "column-rule-color" "column-rule-style" "column-rule-width" - "column-span" "column-width" "columns" + ("column-count" integer "auto") + ("column-fill" "auto" "balance") + ("column-gap" length "normal") + ("column-rule" column-rule-width column-rule-style + column-rule-color "transparent") + ("column-rule-color" color) + ("column-rule-style" border-style) + ("column-rule-width" border-width) + ("column-span" "none" "all") + ("column-width" length "auto") + ("columns" column-width column-count) ;; CSS Overflow Module Level 3 ;; (http://www.w3.org/TR/css-overflow-3/#property-index) - "max-lines" "overflow" "overflow-x" "overflow-y" + ("max-lines" "none" integer) + ("overflow" "visible" "hidden" "scroll" "auto" "paged-x" "paged-y" + "paged-x-controls" "paged-y-controls" "fragments") + ("overflow-x" "visible" "hidden" "scroll" "auto" "paged-x" + "paged-y" "paged-x-controls" "paged-y-controls" "fragments") + ("overflow-y" "visible" "hidden" "scroll" "auto" "paged-x" + "paged-y" "paged-x-controls" "paged-y-controls" "fragments") ;; CSS Text Decoration Module Level 3 ;; (http://dev.w3.org/csswg/css-text-decor-3/#property-index) - "text-decoration" "text-decoration-color" "text-decoration-line" - "text-decoration-skip" "text-decoration-style" "text-emphasis" - "text-emphasis-color" "text-emphasis-position" "text-emphasis-style" - "text-shadow" "text-underline-position" + ("text-decoration" text-decoration-line text-decoration-style + text-decoration-color) + ("text-decoration-color" color) + ("text-decoration-line" "none" "underline" "overline" + "line-through" "blink") + ("text-decoration-skip" "none" "objects" "spaces" "ink" "edges" + "box-decoration") + ("text-decoration-style" "solid" "double" "dotted" "dashed" + "wavy") + ("text-emphasis" text-emphasis-style text-emphasis-color) + ("text-emphasis-color" color) + ("text-emphasis-position" "over" "under" "right" "left") + ("text-emphasis-style" "none" "filled" "open" "dot" "circle" + "double-circle" "triangle" "sesame" string) + ("text-shadow" "none" length color) + ("text-underline-position" "auto" "under" "left" "right") ;; CSS Text Module Level 3 ;; (http://www.w3.org/TR/css3-text/#property-index) - "hanging-punctuation" "hyphens" "letter-spacing" "line-break" - "overflow-wrap" "tab-size" "text-align" "text-align-last" - "text-indent" "text-justify" "text-transform" "white-space" - "word-break" "word-spacing" "word-wrap" + ("hanging-punctuation" "none" "first" "force-end" "allow-end" + "last") + ("hyphens" "none" "manual" "auto") + ("letter-spacing" "normal" length) + ("line-break" "auto" "loose" "normal" "strict") + ("overflow-wrap" "normal" "break-word") + ("tab-size" integer length) + ("text-align" "start" "end" "left" "right" "center" "justify" + "match-parent") + ("text-align-last" "auto" "start" "end" "left" "right" "center" + "justify") + ("text-indent" length percentage) + ("text-justify" "auto" "none" "inter-word" "distribute") + ("text-transform" "none" "capitalize" "uppercase" "lowercase" + "full-width") + ("white-space" "normal" "pre" "nowrap" "pre-wrap" "pre-line") + ("word-break" "normal" "keep-all" "break-all") + ("word-spacing" "normal" length percentage) + ("word-wrap" "normal" "break-word") ;; CSS Transforms Module Level 1 ;; (http://www.w3.org/TR/css3-2d-transforms/#property-index) - "backface-visibility" "perspective" "perspective-origin" - "transform" "transform-origin" "transform-style" + ("backface-visibility" "visible" "hidden") + ("perspective" "none" length) + ("perspective-origin" "left" "center" "right" "top" "bottom" + percentage length) + ("transform" "none" transform-list) + ("transform-origin" "left" "center" "right" "top" "bottom" + percentage length) + ("transform-style" "flat" "preserve-3d") ;; CSS Transitions ;; (http://www.w3.org/TR/css3-transitions/#property-index) - "transition" "transition-delay" "transition-duration" - "transition-property" "transition-timing-function" + ("transition" single-transition) + ("transition-delay" time) + ("transition-duration" time) + ("transition-property" "none" single-transition-property "all") + ("transition-timing-function" single-transition-timing-function) ;; Filter Effects Module Level 1 ;; (http://www.w3.org/TR/filter-effects/#property-index) - "color-interpolation-filters" "filter" "flood-color" - "flood-opacity" "lighting-color") + ("color-interpolation-filters" "auto" "sRGB" "linearRGB") + ("filter" "none" filter-function-list) + ("flood-color" color) + ("flood-opacity" number percentage) + ("lighting-color" color)) + "Identifiers for properties and their possible values. +The CAR of each entry is the name of a property, while the CDR is +a list of possible values for that property. String values in +the CDRs represent literal values, while symbols represent one of +the value classes found in `css-value-class-alist'. If a symbol +is not found in `css-value-class-alist', it's interpreted as a +reference back to one of the properties in this list. Some +symbols, such as `number' or `identifier', don't produce any +further value candidates, since that list would be infinite.") + +(defconst css-property-ids + (mapcar #'car css-property-alist) "Identifiers for properties.") +(defconst css-value-class-alist + '((absolute-size + "xx-small" "x-small" "small" "medium" "large" "x-large" + "xx-large") + (alphavalue number) + (attachment "scroll" "fixed" "local") + (bg-image image "none") + (bg-layer bg-image position repeat-style attachment box) + (bg-size length percentage "auto" "cover" "contain") + (box "border-box" "padding-box" "content-box") + (color + "aqua" "black" "blue" "fuchsia" "gray" "green" "lime" "maroon" + "navy" "olive" "orange" "purple" "red" "silver" "teal" "white" + "yellow" "transparent") + (common-lig-values "common-ligatures" "no-common-ligatures") + (contextual-alt-values "contextual" "no-contextual") + (counter "counter()" "counters()") + (discretionary-lig-values + "discretionary-ligatures" "no-discretionary-ligatures") + (east-asian-variant-values + "jis78" "jis83" "jis90" "jis04" "simplified" "traditional") + (east-asian-width-values "full-width" "proportional-width") + (family-name "Courier" "Helvetica" "Times") + (feature-tag-value string integer "on" "off") + (filter-function + "blur()" "brightness()" "contrast()" "drop-shadow()" + "grayscale()" "hue-rotate()" "invert()" "opacity()" "sepia()" + "saturate()") + (filter-function-list filter-function uri) + (final-bg-layer + bg-image position repeat-style attachment box color) + (font-variant-css21 "normal" "small-caps") + (generic-family + "serif" "sans-serif" "cursive" "fantasy" "monospace") + (generic-voice "male" "female" "child") + (gradient + linear-gradient radial-gradient repeating-linear-gradient + repeating-radial-gradient) + (historical-lig-values + "historical-ligatures" "no-historical-ligatures") + (image uri image-list element-reference gradient) + (image-list "image()") + (length number) + (line-height "normal" number length percentage) + (line-style + "none" "hidden" "dotted" "dashed" "solid" "double" "groove" + "ridge" "inset" "outset") + (line-width length "thin" "medium" "thick") + (linear-gradient "linear-gradient()") + (margin-width "auto" length percentage) + (numeric-figure-values "lining-nums" "oldstyle-nums") + (numeric-fraction-values "diagonal-fractions" "stacked-fractions") + (numeric-spacing-values "proportional-nums" "tabular-nums") + (padding-width length percentage) + (position + "left" "center" "right" "top" "bottom" percentage length) + (radial-gradient "radial-gradient()") + (relative-size "larger" "smaller") + (repeat-style + "repeat-x" "repeat-y" "repeat" "space" "round" "no-repeat") + (repeating-linear-gradient "repeating-linear-gradient()") + (repeating-radial-gradient "repeating-radial-gradient()") + (shadow "inset" length color) + (shape "rect()") + (single-animation-direction + "normal" "reverse" "alternate" "alternate-reverse") + (single-animation-fill-mode "none" "forwards" "backwards" "both") + (single-animation-iteration-count "infinite" number) + (single-animation-name "none" identifier) + (single-animation-play-state "running" "paused") + (single-timing-function single-transition-timing-function) + (single-transition + "none" single-transition-property time + single-transition-timing-function) + (single-transition-property "all" identifier) + (single-transition-timing-function + "ease" "linear" "ease-in" "ease-out" "ease-in-out" "step-start" + "step-end" "steps()" "cubic-bezier()") + (specific-voice identifier) + (target-name string) + (transform-list + "matrix()" "translate()" "translateX()" "translateY()" "scale()" + "scaleX()" "scaleY()" "rotate()" "skew()" "skewX()" "skewY()" + "matrix3d()" "translate3d()" "translateZ()" "scale3d()" + "scaleZ()" "rotate3d()" "rotateX()" "rotateY()" "rotateZ()" + "perspective()") + (uri "url()") + (width length percentage "auto") + (x number) + (y number)) + "Property value classes and their values. +The format is similar to that of `css-property-alist', except +that the CARs aren't actual CSS properties, but rather a name for +a class of values, and that symbols in the CDRs always refer to +other entries in this list, not to properties. + +The following classes have been left out above because they +cannot be completed sensibly: `angle', `element-reference', +`frequency', `id', `identifier', `integer', `number', +`percentage', `string', and `time'.") + (defcustom css-electric-keys '(?\} ?\;) ;; '() "Self inserting keys which should trigger re-indentation." :version "22.2" @@ -335,8 +678,6 @@ :type 'integer :safe 'integerp) -(require 'smie) - (defconst css-smie-grammar (smie-prec2->grammar (smie-precs->prec2 '((assoc ";") (assoc ",") (left ":"))))) @@ -410,11 +751,56 @@ (when (eq (char-before) ?\@) (list (point) pos css-at-ids))))) +(defvar css--property-value-cache + (make-hash-table :test 'equal :size (length css-property-alist)) + "Cache of previously completed property values.") + +(defun css--value-class-lookup (value-class) + "Return a list of value completion candidates for VALUE-CLASS. +Completion candidates are looked up in `css-value-class-alist' by +the symbol VALUE-CLASS." + (seq-mapcat + (lambda (value) + (if (stringp value) + (list value) + (css--value-class-lookup value))) + (cdr (assq value-class css-value-class-alist)))) + +(defun css--property-values (property) + "Return a list of value completion candidates for PROPERTY. +Completion candidates are looked up in `css-property-alist' by +the string PROPERTY." + (or (gethash property css--property-value-cache) + (seq-mapcat + (lambda (value) + (if (stringp value) + (list value) + (or (css--value-class-lookup value) + (css--property-values (symbol-name value))))) + (cdr (assoc property css-property-alist))))) + +(defun css--complete-property-value () + "Complete property value at point." + (let ((property + (save-excursion + (re-search-backward ":[^/]" (line-beginning-position) t) + (let ((property-end (point))) + (skip-chars-backward "-[:alnum:]") + (let ((property (buffer-substring (point) property-end))) + (car (member property css-property-ids))))))) + (when property + (let ((end (point))) + (save-excursion + (skip-chars-backward "[:graph:]") + (list (point) end + (cons "inherit" (css--property-values property)))))))) + (defun css-completion-at-point () "Complete current symbol at point. -Currently supports completion of CSS properties, pseudo-elements, -pseudo-classes, and at-rules." +Currently supports completion of CSS properties, property values, +pseudo-elements, pseudo-classes, and at-rules." (or (css--complete-property) + (css--complete-property-value) (css--complete-pseudo-element-or-class) (css--complete-at-rule))) diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el new file mode 100644 index 0000000..9c5953d --- /dev/null +++ b/test/lisp/textmodes/css-mode-tests.el @@ -0,0 +1,66 @@ +;;; css-mode-tests.el --- Test suite for CSS mode -*- lexical-binding: t; -*- + +;; Copyright (C) 2016 Free Software Foundation, Inc. + +;; Author: Simen Heggestøyl +;; Keywords: internal + +;; This file is part of GNU Emacs. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'ert) +(require 'css-mode) + +(ert-deftest css-test-property-values () + ;; The `float' property has a flat value list. + (should + (equal (sort (css--property-values "float") #'string-lessp) + '("left" "none" "right"))) + + ;; The `list-style' property refers to several other properties. + (should + (equal (sort (css--property-values "list-style") #'string-lessp) + (sort (append (css--property-values "list-style-type") + (css--property-values "list-style-position") + (css--property-values "list-style-image")) + #'string-lessp))) + + ;; The `position' property is tricky because it's also the name of a + ;; value class. + (should + (equal (sort (css--property-values "position") #'string-lessp) + '("absolute" "fixed" "relative" "static"))) + + ;; The `background-position' property should refer to the `position' + ;; value class, not the property of the same name. + (should + (equal (css--property-values "background-position") + (css--value-class-lookup 'position))) + + ;; Check that the `color' property doesn't cause infinite recursion + ;; because it refers to the value class of the same name. + (should (= (length (css--property-values "color")) 18))) + +(ert-deftest css-test-value-class-lookup () + (should + (equal (sort (css--value-class-lookup 'position) #'string-lessp) + '("bottom" "center" "left" "right" "top")))) + +(provide 'css-mode-tests) +;;; css-mode-tests.el ends here commit c0165ea4d6ecf81db6728782c7322c311ee0a783 Author: Paul Eggert Date: Wed Mar 23 00:07:14 2016 -0700 Resurrect GNUS-NEWS autogeneration * doc/misc/gnus-coding.texi (Gnus Maintenance Guide): Update GNUS-NEWS section to match current file locations and procedure. * etc/GNUS-NEWS: Regenerate by using new procedure. * lisp/Makefile.in (update-gnus-news): New rule, containing a procedure for building GNUS-NEWS. The old procedure got lost somehow when Gnus was merged into Emacs. diff --git a/doc/misc/gnus-coding.texi b/doc/misc/gnus-coding.texi index 3b2c4af..661e705 100644 --- a/doc/misc/gnus-coding.texi +++ b/doc/misc/gnus-coding.texi @@ -364,11 +364,11 @@ such multiple commits, like whitespace differences, and unify those ;-). @heading @file{GNUS-NEWS} -Starting from No Gnus, the @file{GNUS-NEWS} is created from -@file{texi/gnus-news.texi}. Don't edit @file{GNUS-NEWS}. Edit -@file{texi/gnus-news.texi}, type @command{make GNUS-NEWS} in the -@file{texi} directory and commit @file{GNUS-NEWS} and -@file{texi/gnus-news.texi}. +The @file{etc/GNUS-NEWS} is created from +@file{doc/misc/gnus-news.texi}. Don't edit @file{etc/GNUS-NEWS}. +Edit @file{doc/misc/gnus-news.texi}, type @command{make +update-gnus-news} in the @file{lisp} directory and commit +@file{etc/GNUS-NEWS} and @file{doc/misc/gnus-news.texi}. @heading Conventions for version information in defcustoms diff --git a/etc/GNUS-NEWS b/etc/GNUS-NEWS index 4efb53e..06badc1 100644 --- a/etc/GNUS-NEWS +++ b/etc/GNUS-NEWS @@ -7,40 +7,286 @@ Please send Gnus bug reports to bugs@gnus.org. For older news, see Gnus info node "New Features". -* New features +* Supported Emacs versions The following Emacs versions are supported by No +Gnus: -** nnimap can request and use the Gmail "X-GM-LABELS". +** Emacs 22 and up +** XEmacs 21.4 +** XEmacs 21.5 +** SXEmacs -** New package `gnus-notifications.el' can send notifications when you - receive new messages. + +* Installation changes + +** Upgrading from previous (stable) version if you have used No Gnus. + +If you have tried No Gnus (the unstable Gnus branch leading to this +release) but went back to a stable version, be careful when upgrading to +this version. In particular, you will probably want to remove the +'~/News/marks' directory (perhaps selectively), so that flags are read +from your '~/.newsrc.eld' instead of from the stale marks file, where +this release will store flags for nntp. See a later entry for more +information about nntp marks. Note that downgrading isn't safe in +general. + +** Incompatibility when switching from Emacs 23 to Emacs 22 In Emacs 23, +Gnus uses Emacs's new internal coding system 'utf-8-emacs' for saving +articles drafts and '~/.newsrc.eld'. These files may not be read +correctly in Emacs 22 and below. If you want to use Gnus across +different Emacs versions, you may set 'mm-auto-save-coding-system' to +'emacs-mule'. + +** Lisp files are now installed in '.../site-lisp/gnus/' by default. It +defaulted to '.../site-lisp/' formerly. In addition to this, the new +installer issues a warning if other Gnus installations which will shadow +the latest one are detected. You can then remove those shadows manually +or remove them using 'make remove-installed-shadows'. + +** The installation directory name is allowed to have spaces and/or tabs. + + +* New packages and libraries within Gnus + +** New version of 'nnimap' + +'nnimap' has been reimplemented in a mostly-compatible way. See the Gnus +manual for a description of the new interface. In particular, +'nnimap-inbox' and the client side split method has changed. + +** Gnus includes the Emacs Lisp SASL library. + +This provides a clean API to SASL mechanisms from within Emacs. The user +visible aspects of this, compared to the earlier situation, include +support for DIGEST-MD5 and NTLM. *Note Emacs SASL: (sasl)Top. + +** ManageSieve connections uses the SASL library by default. + +The primary change this brings is support for DIGEST-MD5 and NTLM, when +the server supports it. + +** Gnus includes a password cache mechanism in password.el. + +It is enabled by default (see 'password-cache'), with a short timeout of +16 seconds (see 'password-cache-expiry'). If PGG is used as the PGP back +end, the PGP passphrase is managed by this mechanism. Passwords for +ManageSieve connections are managed by this mechanism, after querying the +user about whether to do so. + +** Using EasyPG with Gnus When EasyPG, is available, Gnus will use it +instead of PGG. EasyPG is an Emacs user interface to GNU Privacy Guard. + *Note EasyPG Assistant user's manual: (epa)Top. EasyPG is included in +Emacs 23 and available separately as well. + + +* Changes in group mode + +** Symbols like 'gcc-self' now have the same precedence rules in +'gnus-parameters' as other "real" variables: The last match wins instead +of the first match. + +** Old intermediate incoming mail files ('Incoming*') are deleted after a +couple of days, not immediately. *Note Mail Source Customization::. +(New in Gnus 5.10.10 / No Gnus 0.8) + + +* Changes in summary and article mode + +** There's now only one variable that determines how HTML is rendered: +'mm-text-html-renderer'. + +** Gnus now supports sticky article buffers. Those are article buffers that +are not reused when you select another article. *Note Sticky Articles::. + +** Gnus can selectively display 'text/html' articles with a WWW browser with +'K H'. *Note MIME Commands::. + +** International host names (IDNA) can now be decoded inside article bodies +using 'W i' ('gnus-summary-idna-message'). This requires that GNU Libidn +() has been installed. + +** The non-ASCII group names handling has been much improved. The back ends +that fully support non-ASCII group names are now 'nntp', 'nnml', and +'nnrss'. Also the agent, the cache, and the marks features work with +those back ends. *Note Non-ASCII Group Names::. + +** Gnus now displays DNS master files sent as text/dns using dns-mode. + +** Gnus supports new limiting commands in the Summary buffer: '/ r' +('gnus-summary-limit-to-replied') and '/ R' +('gnus-summary-limit-to-recipient'). *Note Limiting::. + +** You can now fetch all ticked articles from the server using 'Y t' +('gnus-summary-insert-ticked-articles'). *Note Summary Generation +Commands::. + +** Gnus supports a new sort command in the Summary buffer: 'C-c C-s C-t' +('gnus-summary-sort-by-recipient'). *Note Summary Sorting::. + +** S/MIME now features LDAP user certificate searches. You need to +configure the server in 'smime-ldap-host-list'. + +** URLs inside OpenPGP headers are retrieved and imported to your PGP key +ring when you click on them. + +** Picons can be displayed right from the textual address, see +'gnus-picon-style'. *Note Picons::. + +** ANSI SGR control sequences can be transformed using 'W A'. + +ANSI sequences are used in some Chinese hierarchies for highlighting +articles ('gnus-article-treat-ansi-sequences'). -** If you have the "tnef" program installed, Gnus will display ms-tnef - files, aka "winmail.dat". +** Gnus now MIME decodes articles even when they lack "MIME-Version" header. +This changes the default of 'gnus-article-loose-mime'. -** Archives (like tar and zip files) will be automatically unpacked, - and the files inside the packages will be displayed as MIME parts. +** 'gnus-decay-scores' can be a regexp matching score files. For example, +set it to '\\.ADAPT\\'' and only adaptive score files will be decayed. + *Note Score Decays::. -** shr has a new command `z' that cycles through image sizes. +** Strings prefixing to the 'To' and 'Newsgroup' headers in summary lines +when using 'gnus-ignored-from-addresses' can be customized with +'gnus-summary-to-prefix' and 'gnus-summary-newsgroup-prefix'. *Note To +From Newsgroups::. -** `backtab' in the summary buffer now selects the previous link in - the article buffer. +** You can replace MIME parts with external bodies. See +'gnus-mime-replace-part' and 'gnus-article-replace-part'. *Note MIME +Commands::, *note Using MIME::. -** Using the "X-Message-SMTP-Method" header in Message buffers now - allows specifying how messages are to be sent. For example: +** The option 'mm-fill-flowed' can be used to disable treatment of +format=flowed messages. Also, flowed text is disabled when sending +inline PGP signed messages. *Note Flowed text: (emacs-mime)Flowed text. +(New in Gnus 5.10.7) - X-Message-SMTP-Method: smtp smtp.fsf.org 587 +** Now the new command 'S W' ('gnus-article-wide-reply-with-original') for a +wide reply in the article buffer yanks a text that is in the active +region, if it is set, as well as the 'R' +('gnus-article-reply-with-original') command. Note that the 'R' command +in the article buffer no longer accepts a prefix argument, which was used +to make it do a wide reply. *Note Article Keymap::. -** Gnus keeps track of non-existent articles for nnimap groups, so - that sparse IMAP folders now list a correct number of messages in - them. +** The new command 'C-h b' ('gnus-article-describe-bindings') used in the +article buffer now shows not only the article commands but also the real +summary commands that are accessible from the article buffer. -** Gnus will guess the real type of MIME parts of type - application/octet-stream based on the file suffix. So an - application/octet-stream with a name of "rms.jpg" will be displayed - as an image/jpeg type by default, for instance. + +* Changes in Message mode + +** Gnus now defaults to saving all outgoing messages in per-month nnfolder +archives. + +** Gnus now supports the "hashcash" client puzzle anti-spam mechanism. Use +'(setq message-generate-hashcash t)' to enable. *Note Hashcash::. + +** You can now drag and drop attachments to the Message buffer. See +'mml-dnd-protocol-alist' and 'mml-dnd-attach-options'. *Note MIME: +(message)MIME. + +** The option 'message-yank-empty-prefix' now controls how empty lines are +prefixed in cited text. *Note Insertion Variables: (message)Insertion +Variables. + +** Gnus uses narrowing to hide headers in Message buffers. The 'References' +header is hidden by default. To make all headers visible, use '(setq +message-hidden-headers nil)'. *Note Message Headers: (message)Message +Headers. + +** You can highlight different levels of citations like in the article +buffer. See 'gnus-message-highlight-citation'. + +** 'auto-fill-mode' is enabled by default in Message mode. See +'message-fill-column'. *Note Message Headers: (message)Various Message +Variables. + +** You can now store signature files in a special directory named +'message-signature-directory'. + +** The option 'message-citation-line-format' controls the format of the +"Whomever writes:" line. You need to set +'message-citation-line-function' to +'message-insert-formatted-citation-line' as well. + + +* Changes in Browse Server mode + +** Gnus' sophisticated subscription methods are now available in Browse +Server buffers as well using the variable +'gnus-browse-subscribe-newsgroup-method'. + + +* Changes in back ends + +** The nntp back end stores article marks in '~/News/marks'. + +The directory can be changed using the (customizable) variable +'nntp-marks-directory', and marks can be disabled using the (back end) +variable 'nntp-marks-is-evil'. The advantage of this is that you can +copy '~/News/marks' (using rsync, scp or whatever) to another Gnus +installation, and it will realize what articles you have read and marked. +The data in '~/News/marks' has priority over the same data in +'~/.newsrc.eld'. + +** You can import and export your RSS subscriptions from OPML files. *Note +RSS::. + +** IMAP identity (RFC 2971) is supported. -** `nnimap-inbox' can now be a list of mail box names. - +By default, Gnus does not send any information about itself, but you can +customize it using the variable 'nnimap-id'. + +** The 'nnrss' back end now supports multilingual text. Non-ASCII group +names for the 'nnrss' groups are also supported. *Note RSS::. + +** Retrieving mail with POP3 is supported over SSL/TLS and with StartTLS. + +** The nnml back end allows other compression programs beside 'gzip' for +compressed message files. *Note Mail Spool::. + +** The nnml back end supports group compaction. + +This feature, accessible via the functions 'gnus-group-compact-group' ('G +z' in the group buffer) and 'gnus-server-compact-server' ('z' in the +server buffer) renumbers all articles in a group, starting from 1 and +removing gaps. As a consequence, you get a correct total article count +(until messages are deleted again). + + +* Appearance + +** The tool bar has been updated to use GNOME icons. You can also customize +the tool bars: 'M-x customize-apropos RET -tool-bar$' should get you +started. (Only for Emacs, not in XEmacs.) + +** The tool bar icons are now (de)activated correctly in the group buffer, +see the variable 'gnus-group-update-tool-bar'. Its default value depends +on your Emacs version. + +** You can change the location of XEmacs's toolbars in Gnus buffers. See +'gnus-use-toolbar' and 'message-use-toolbar'. + + +* Miscellaneous changes + +** Having edited the select-method for the foreign server in the server +buffer is immediately reflected to the subscription of the groups which +use the server in question. For instance, if you change +'nntp-via-address' into 'bar.example.com' from 'foo.example.com', Gnus +will connect to the news host by way of the intermediate host +'bar.example.com' from next time. + +** The 'all.SCORE' file can be edited from the group buffer using 'W e'. + +** You can set 'gnus-mark-copied-or-moved-articles-as-expirable' to a +non-'nil' value so that articles that have been read may be marked as +expirable automatically when copying or moving them to a group that has +auto-expire turned on. The default is 'nil' and copying and moving of +articles behave as before; i.e., the expirable marks will be unchanged +except that the marks will be removed when copying or moving articles to +a group that has not turned auto-expire on. *Note Expiring Mail::. + +** NoCeM support has been removed. + +** Carpal mode has been removed. + * For older news, see Gnus info node "New Features". ---------------------------------------------------------------------- diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 24400a9..f33dd01 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -194,7 +194,7 @@ update-subdirs: $(srcdir)/../build-aux/update-subdirs $$file; \ done; -.PHONY: updates repo-update update-authors +.PHONY: updates repo-update update-authors update-gnus-news # Some modes of make-dist use this. updates: update-subdirs autoloads finder-data custom-deps @@ -207,12 +207,16 @@ updates: update-subdirs autoloads finder-data custom-deps # this directory's autoloads rule. repo-update: compile finder-data custom-deps -# Update the AUTHORS file. +# Update etc/AUTHORS and etc/GNUS-NEWS. update-authors: $(emacs) -L "$(top_srcdir)/admin" -l authors \ -f batch-update-authors "$(top_srcdir)/etc/AUTHORS" "$(top_srcdir)" +update-gnus-news: + $(emacs) -L "$(top_srcdir)/doc/misc" -l gnus-news -f batch-gnus-news \ + "$(top_srcdir)/doc/misc/gnus-news.texi" \ + "$(top_srcdir)/etc/GNUS-NEWS" ETAGS = ../lib-src/etags commit 1e5327c7c7c3b96da032cfdf60146cf3121097bf Author: Paul Eggert Date: Tue Mar 22 13:22:29 2016 -0700 ; Backport ChangeLog.2 fixes from master diff --git a/ChangeLog.2 b/ChangeLog.2 index 1771269..b2dc6c5 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -9560,8 +9560,8 @@ (xref-backend-identifier-completion-table): New generic functions. - * lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Add - `elisp--xref-backend' to the beginning of + * lisp/progmodes/elisp-mode.el (emacs-lisp-mode): + Add `elisp--xref-backend' to the beginning of `xref-backend-functions', locally. Delete references to removed functions and vars. (elisp-xref-find): Remove. @@ -9579,7 +9579,8 @@ Support rectangular regions for more commands - * lisp/simple.el (region-extract-function): Handle the arg value ‘bounds’. + * lisp/simple.el (region-extract-function): Handle the arg + value ‘bounds’. (region-insert-function): New function. (shell-command-on-region): Add arg ‘region-noncontiguous-p’. If non-nil, operate on multiple chunks. @@ -9605,7 +9606,7 @@ If non-nil, operate on multiple chunks. * src/casefiddle.c (Fdowncase_region): Add arg ‘region-noncontiguous-p’. - If non-nil, operate on multiple chunks. (Bug#19829) + If non-nil, operate on multiple chunks. (Bug#19829) 2015-11-14 Dmitry Gutov @@ -9837,7 +9838,6 @@ 2015-11-13 Juanma Barranquero * test/automated/simple-test.el: Add test for bug#20698 (bug#21885) - (simple-test--transpositions): New macro. (simple-transpose-subr): New test. @@ -9848,7 +9848,6 @@ 2015-11-13 Juanma Barranquero * src/undo.c: Small fixes for previous change - (run_undoable_change): Mark void argument list. (record_property_change): Remove unused variable `boundary'. @@ -9909,7 +9908,7 @@ shr: don't invoke unbound function (Bug#21895) * lisp/net/shr.el (have-fringes-p): New function. - (shr-insert-document, shr-fill-text): Use it. + (shr-insert-document, shr-fill-text): Use it. 2015-11-12 Juanma Barranquero @@ -9966,8 +9965,8 @@ Enable sorting of JSON object keys when encoding - * lisp/json.el (json-encoding-object-sort-predicate): New variable for - specifying a sorting predicate for JSON objects during encoding. + * lisp/json.el (json-encoding-object-sort-predicate): New variable + for specifying a sorting predicate for JSON objects during encoding. (json--plist-to-alist): New utility function. (json-encode-hash-table): Re-use `json-encode-alist' when object keys are to be sorted. @@ -9977,8 +9976,8 @@ to be sorted. (json-pretty-print-buffer-ordered): New command to pretty print the buffer with object keys sorted alphabetically. - (json-pretty-print-ordered): New command to pretty print the region with - object keys sorted alphabetically. + (json-pretty-print-ordered): New command to pretty print the region + with object keys sorted alphabetically. * test/automated/json-tests.el (test-json-plist-to-alist) (test-json-encode-plist, test-json-encode-hash-table) @@ -9989,7 +9988,7 @@ 2015-11-12 Juanma Barranquero - * test/automated/keymap-tests.el: New test file + * test/automated/keymap-tests.el: New test file. 2015-11-12 Ken Raeburn @@ -10036,9 +10035,9 @@ Use color cache for creating bitmap - * src/image.c (x_create_bitmap_from_xpm_data) [ALLOC_XPM_COLORS]: Set - attributes to use the caching color allocator. Initialize and free - the cache. + * src/image.c (x_create_bitmap_from_xpm_data) [ALLOC_XPM_COLORS]: + Set attributes to use the caching color allocator. Initialize and + free the cache. 2015-11-12 Eli Barzilay @@ -10065,32 +10064,32 @@ * lisp/net/soap-inspect.el: Remove version header. - * lisp/net/soap-client.el, lisp/net/soap-inspect.el: Fix first line header + * soap-client.el, soap-inspect.el, jira2.el: Fix first line header format. 2015-11-11 Alan Mackenzie CC Mode: Respect users' settings of open-paren-in-column-0-is-defun-start. - lisp/progmodes/cc-engine.el (c-backward-single-comment, c-backward-comments) - (c-invalidate-state-cache-1, c-parse-state-1, c-guess-basic-syntax): - remove bindings of open-paren-in-column-0-is-defun-start to nil. + * lisp/progmodes/cc-engine.el (c-backward-single-comment) + (c-backward-comments, c-invalidate-state-cache-1, c-parse-state-1) + (c-guess-basic-syntax): + Remove bindings of open-paren-in-column-0-is-defun-start to nil. (c-get-fallback-scan-pos): "New" function (existed several years ago). (c-parse-state-get-strategy): Reintroduce the 'BOD strategy, using c-get-fallback-scan-pos. (c-parse-state-1): Handle 'BOD strategy. - lisp/progmodes/cc-mode.el (c-before-change, c-after-change) - c-font-lock-fontify-region): remove bindings of + * lisp/progmodes/cc-mode.el (c-before-change, c-after-change) + (c-font-lock-fontify-region): Remove bindings of open-paren-in-column-0-is-defun-start to nil. - cc-mode.texi (Performance Issues, Limitations and Known Bugs): Fix mix up - between @chapter and @appendix. + * doc/misc/cc-mode.texi (Performance Issues) + (Limitations and Known Bugs): Fix mix up between @chapter and @appendix. 2015-11-11 Artur Malabarba - * lisp/obarray.el: Fix shadowed variables - + * lisp/obarray.el: Fix shadowed variables. (obarray-map, obarray-remove, obarray-put, obarray-get): Change OBARRAY arg to OB to avoid shadowing ‘obarray’. @@ -10128,8 +10127,8 @@ New file with obarray functions. - * lisp/obarray.el: basic obarray functions extracted from abbrev.el - * test/automated/obarray-tests.el: new file + * lisp/obarray.el: Basic obarray functions extracted from abbrev.el. + * test/automated/obarray-tests.el: New file. 2015-11-11 Eli Zaretskii @@ -10217,7 +10216,7 @@ * lisp/net/tramp.el (tramp-handle-file-equal-p) (tramp-handle-file-in-directory-p): New defuns. Suggested by - Harvey Chapman + Harvey Chapman . * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): @@ -10244,11 +10243,11 @@ Avoid creating notification objects when possible - * src/nsterm.m (windowWillEnterFullScreen, windowWillExitFullScreen:, - windowDidEnterFullScreen, windowDidExitFullScreen): provide - convenience functions that do not require a notification object. When - needed, define NSWindowDidEnterFullScreenNotification to allow for - compilation on OS X 10.6.8. + * src/nsterm.m (windowWillEnterFullScreen, windowWillExitFullScreen:) + (windowDidEnterFullScreen, windowDidExitFullScreen): Provide convenience + functions that do not require a notification object. When needed, + define NSWindowDidEnterFullScreenNotification to allow for compilation + on OS X 10.6.8. 2015-11-10 Paul Eggert @@ -10281,8 +10280,7 @@ 2015-11-10 Artur Malabarba * doc/lispref/variables.texi (Directory Local Variables): - - Document dir-locals wildcards + Document dir-locals wildcards. * lisp/files.el (dir-locals-file): Point to Info node. @@ -10293,14 +10291,12 @@ 2015-11-10 Artur Malabarba - * lisp/files.el: Don't allow customization of dir-locals sorting - + * lisp/files.el: Don't allow customization of dir-locals sorting. In retrospect, this is not a good idea for the same reason that `dir-locals-file' is a defconst, because it is important that this behaviour be "uniform across different environments and users". Sure, the user can still change the sorting with a hack, but we shouldn't encourage them to change it. - (dir-locals--all-files): Return list in the order returned by `file-expand-wildcards'. (file-expand-wildcards): Document the sorting predicate used. @@ -10308,54 +10304,52 @@ 2015-11-10 Artur Malabarba - * lisp/files.el (dir-locals-read-from-file): Better handle errors + * lisp/files.el (dir-locals-read-from-file): Better handle errors. - * lisp/isearch.el (search-default-regexp-mode): change default value + * lisp/isearch.el (search-default-regexp-mode): Change default value. 2015-11-10 Artur Malabarba - * lisp/files.el (dir-locals-find-file): Don't stop at unreadable files - + * lisp/files.el (dir-locals-find-file): Don't stop at unreadable files. `locate-dominating-file' will now keep looking if the files it finds in a given directory are unreadable (or not files). 2015-11-10 Artur Malabarba - * lisp/files.el (dir-locals-file): Allow wildcards - + * lisp/files.el (dir-locals-file): Allow wildcards. (dir-locals-find-file, dir-locals-collect-variables) (dir-locals-read-from-file): Update accordingly. (hack-dir-local-variables): Rename a local variable. - * lisp/files-x.el (modify-dir-local-variable): Update accordingly + * lisp/files-x.el (modify-dir-local-variable): Update accordingly. - * lisp/help-fns.el (describe-variable): Update accordingly + * lisp/help-fns.el (describe-variable): Update accordingly. - * .gitignore: Add .dir-locals?.el + * .gitignore: Add .dir-locals?.el. 2015-11-10 Artur Malabarba - * lisp/emacs-lisp/map.el (map-merge-with): New function + * lisp/emacs-lisp/map.el (map-merge-with): New function. - * test/automated/map-tests.el (test-map-merge-with): New test + * test/automated/map-tests.el (test-map-merge-with): New test. 2015-11-10 Karl Fogel Fix some recently-perturbed bookmark autoloads * lisp/bookmark.el (bookmark-set-internal): Remove unnecessary autoload. - (bookmark-set): Restore autoload. - (bookmark-set-no-overwrite): Add autoload. + (bookmark-set): Restore autoload. + (bookmark-set-no-overwrite): Add autoload. Thanks to Juanma Barranquero for noticing the autoload problems introduced by my recent commit adding/changing the above functions (Sun Nov 8 14:16:43 2015 -0500, git commit 3812e17978). -2015-11-10 Noah Friedman +2015-11-09 Noah Friedman - (ydump-buffer): Handle case where gap is at the start of buffer. - I don't recall if older versions of gdb were less strict but you - cannot dump a 0-length range in gdb 7.9.1. + * etc/emacs-buffer.gdb (ydump-buffer): Handle case where gap is at + the start of buffer. I don't recall if older versions of gdb were + less strict but you cannot dump a 0-length range in gdb 7.9.1. 2015-11-10 Dmitry Gutov @@ -10503,13 +10497,13 @@ Offer non-overwrite bookmark setter (Bug#15746) * lisp/bookmark.el (bookmark-set-internal): New helper function to do - what `bookmark-set' used to do, but with more choices for overwrite - vs push, and with minor changes to the interactive prompt format. - (bookmark-set): Rewrite as wrapper around above. - If overwriting, inform the user of that in the prompt. - (bookmark-set-no-overwrite): New function, also done as wrapper. - Bind to "M" in `ctl-x-r-map' autoloads. - (bookmark-map): Similarly bind "M" here. + what `bookmark-set' used to do, but with more choices for overwrite + vs push, and with minor changes to the interactive prompt format. + (bookmark-set): Rewrite as wrapper around above. + If overwriting, inform the user of that in the prompt. + (bookmark-set-no-overwrite): New function, also done as wrapper. + Bind to "M" in `ctl-x-r-map' autoloads. + (bookmark-map): Similarly bind "M" here. 2015-11-08 Paul Eggert @@ -10595,7 +10589,8 @@ unchanged, in which case no clearing is needed (and sh_offset isn't necessarily valid, which can lead to a wild memset). - * src/unexelf.c (unexec): Properly handle _OBJC_ symbols in bss sections. + * src/unexelf.c (unexec): Properly handle _OBJC_ symbols in + bss sections. 2015-11-08 Alan Modra @@ -10656,8 +10651,8 @@ Remove dirs in vc project roots from the the vc project library roots - * lisp/progmodes/project.el (project-library-roots): Remove - directories inside the project roots from the result. + * lisp/progmodes/project.el (project-library-roots): + Remove directories inside the project roots from the result. (http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg00536.html) 2015-11-08 Dmitry Gutov commit e643977b6b99466bfa872b61a4101d9937615876 Author: Anders Lindgren Date: Tue Mar 22 20:18:33 2016 +0100 Make `toggle-frame-maximized' respect the dock on OS X (bug#22988). * src/nsterm.m (ns_screen_margins): New function. (ns_screen_margins_ignoring_hidden_dock): New function. (ns_menu_bar_height): Reimplement in terms of `ns_screen_margins'. ([EmacsWindow zoom:]): Take all screen margins (except those originating from a hidden dock) into account. diff --git a/src/nsterm.m b/src/nsterm.m index b796193..4048ac4 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -646,42 +646,129 @@ Free a pool and temporary objects it refers to (callable from C) } -/* True, if the menu bar should be hidden. */ - static BOOL ns_menu_bar_should_be_hidden (void) +/* True, if the menu bar should be hidden. */ { return !NILP (ns_auto_hide_menu_bar) && [NSApp respondsToSelector:@selector(setPresentationOptions:)]; } -static CGFloat -ns_menu_bar_height (NSScreen *screen) -/* The height of the menu bar, if visible. +struct EmacsMargins +{ + CGFloat top; + CGFloat bottom; + CGFloat left; + CGFloat right; +}; - Note: Don't use this when fullscreen is enabled -- the screen - sometimes includes, sometimes excludes the menu bar area. */ + +static struct EmacsMargins +ns_screen_margins (NSScreen *screen) +/* The parts of SCREEN used by the operating system. */ { - CGFloat res; + NSTRACE ("ns_screen_margins"); + + struct EmacsMargins margins; + + NSRect screenFrame = [screen frame]; + NSRect screenVisibleFrame = [screen visibleFrame]; + /* Sometimes, visibleFrame isn't up-to-date with respect to a hidden + menu bar, check this explicitly. */ if (ns_menu_bar_should_be_hidden()) { - res = 0; + margins.top = 0; } else { - NSRect screenFrame = [screen frame]; - NSRect screenVisibleFrame = [screen visibleFrame]; - CGFloat frameTop = screenFrame.origin.y + screenFrame.size.height; CGFloat visibleFrameTop = (screenVisibleFrame.origin.y + screenVisibleFrame.size.height); - res = frameTop - visibleFrameTop; + margins.top = frameTop - visibleFrameTop; + } + + { + CGFloat frameRight = screenFrame.origin.x + screenFrame.size.width; + CGFloat visibleFrameRight = (screenVisibleFrame.origin.x + + screenVisibleFrame.size.width); + margins.right = frameRight - visibleFrameRight; + } + + margins.bottom = screenVisibleFrame.origin.y - screenFrame.origin.y; + margins.left = screenVisibleFrame.origin.x - screenFrame.origin.x; + NSTRACE_MSG ("left:%g right:%g top:%g bottom:%g", + margins.left, + margins.right, + margins.top, + margins.bottom); + + return margins; +} + + +/* A screen margin between 1 and DOCK_IGNORE_LIMIT (inclusive) is + assumed to contain a hidden dock. OS X currently use 4 pixels for + this, however, to be future compatible, a larger value is used. */ +#define DOCK_IGNORE_LIMIT 6 + +static struct EmacsMargins +ns_screen_margins_ignoring_hidden_dock (NSScreen *screen) +/* The parts of SCREEN used by the operating system, excluding the parts +reserved for an hidden dock. */ +{ + NSTRACE ("ns_screen_margins_ignoring_hidden_dock"); + + struct EmacsMargins margins = ns_screen_margins(screen); + + /* OS X (currently) reserved 4 pixels along the edge where a hidden + dock is located. Unfortunately, it's not possible to find the + location and information about if the dock is hidden. Instead, + it is assumed that if the margin of an edge is less than + DOCK_IGNORE_LIMIT, it contains a hidden dock. */ + if (margins.left <= DOCK_IGNORE_LIMIT) + { + margins.left = 0; + } + if (margins.right <= DOCK_IGNORE_LIMIT) + { + margins.right = 0; + } + if (margins.top <= DOCK_IGNORE_LIMIT) + { + margins.top = 0; + } + /* Note: This doesn't occur in current versions of OS X, but + included for completeness and future compatibility. */ + if (margins.bottom <= DOCK_IGNORE_LIMIT) + { + margins.bottom = 0; } + NSTRACE_MSG ("left:%g right:%g top:%g bottom:%g", + margins.left, + margins.right, + margins.top, + margins.bottom); + + return margins; +} + + +static CGFloat +ns_menu_bar_height (NSScreen *screen) +/* The height of the menu bar, if visible. + + Note: Don't use this when fullscreen is enabled -- the screen + sometimes includes, sometimes excludes the menu bar area. */ +{ + struct EmacsMargins margins = ns_screen_margins(screen); + + CGFloat res = margins.top; + NSTRACE ("ns_menu_bar_height " NSTRACE_FMT_RETURN " %.0f", res); return res; @@ -7867,9 +7954,10 @@ - (void)zoom:(id)sender // the menu-bar. [super zoom:sender]; -#elsif 0 +#elif 0 // Native zoom done using the standard zoom animation, plus an - // explicit resize to cover the full screen. + // explicit resize to cover the full screen, except the menu-bar and + // dock, if present. [super zoom:sender]; // After the native zoom, resize the resulting frame to fill the @@ -7889,6 +7977,9 @@ - (void)zoom:(id)sender NSTRACE_FSTYPE ("fullscreenState", fs_state); NSRect sr = [screen frame]; + struct EmacsMargins margins + = ns_screen_margins_ignoring_hidden_dock(screen); + NSRect wr = [self frame]; NSTRACE_RECT ("Rect after zoom", wr); @@ -7897,15 +7988,15 @@ - (void)zoom:(id)sender if (fs_state == FULLSCREEN_MAXIMIZED || fs_state == FULLSCREEN_HEIGHT) { - newWr.origin.x = 0; - newWr.size.height = sr.size.height - ns_menu_bar_height(screen); + newWr.origin.y = sr.origin.y + margins.bottom; + newWr.size.height = sr.size.height - margins.top - margins.bottom; } if (fs_state == FULLSCREEN_MAXIMIZED || fs_state == FULLSCREEN_WIDTH) { - newWr.origin.y = 0; - newWr.size.width = sr.size.width; + newWr.origin.x = sr.origin.x + margins.left; + newWr.size.width = sr.size.width - margins.right - margins.left; } if (newWr.size.width != wr.size.width @@ -7918,13 +8009,20 @@ - (void)zoom:(id)sender } } #else - // Non-native zoom which is done instantaneously. The resulting frame - // covers the entire screen, except the menu-bar, if present. + // Non-native zoom which is done instantaneously. The resulting + // frame covers the entire screen, except the menu-bar and dock, if + // present. NSScreen * screen = [self screen]; if (screen != nil) { NSRect sr = [screen frame]; - sr.size.height -= ns_menu_bar_height (screen); + struct EmacsMargins margins + = ns_screen_margins_ignoring_hidden_dock(screen); + + sr.size.height -= (margins.top + margins.bottom); + sr.size.width -= (margins.left + margins.right); + sr.origin.x += margins.left; + sr.origin.y += margins.bottom; sr = [[self delegate] windowWillUseStandardFrame:self defaultFrame:sr]; commit 38a43f1a8f26f1ec8dbb9b2981f1d98f2b2bd228 Author: Eli Zaretskii Date: Tue Mar 22 20:16:42 2016 +0200 Fix bug in displaying header line with a box face * src/xdisp.c (get_next_display_element): Handle the case when a display string acquires the box face from an underlying string, not from the buffer. (Bug#23091) diff --git a/src/xdisp.c b/src/xdisp.c index d68244e..d6ee2de 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7229,18 +7229,21 @@ get_next_display_element (struct it *it) { ptrdiff_t ignore; int next_face_id; + bool text_from_string = false; + /* Normally, the next buffer location is stored in + IT->current.pos... */ struct text_pos pos = it->current.pos; - /* For a string from a display property, the next - buffer position is stored in the 'position' + /* ...but for a string from a display property, the + next buffer position is stored in the 'position' member of the iteration stack slot below the current one, see handle_single_display_spec. By - contrast, it->current.pos was not yet updated - to point to that buffer position; that will - happen in pop_it, after we finish displaying the - current string. Note that we already checked - above that it->sp is positive, so subtracting one - from it is safe. */ + contrast, it->current.pos was not yet updated to + point to that buffer position; that will happen + in pop_it, after we finish displaying the current + string. Note that we already checked above that + it->sp is positive, so subtracting one from it is + safe. */ if (it->from_disp_prop_p) { int stackp = it->sp - 1; @@ -7249,19 +7252,49 @@ get_next_display_element (struct it *it) while (stackp >= 0 && STRINGP ((it->stack + stackp)->string)) stackp--; - eassert (stackp >= 0); - pos = (it->stack + stackp)->position; + if (stackp < 0) + { + /* If no stack slot was found for iterating + a buffer, we are displaying text from a + string, most probably the mode line or + the header line, and that string has a + display string on some of its + characters. */ + text_from_string = true; + pos = it->stack[it->sp - 1].position; + } + else + pos = (it->stack + stackp)->position; } else INC_TEXT_POS (pos, it->multibyte_p); - if (CHARPOS (pos) >= ZV) + if (text_from_string) + { + Lisp_Object base_string = it->stack[it->sp - 1].string; + + if (CHARPOS (pos) >= SCHARS (base_string) - 1) + it->end_of_box_run_p = true; + else + { + next_face_id + = face_at_string_position (it->w, base_string, + CHARPOS (pos), 0, + &ignore, face_id, false); + it->end_of_box_run_p + = (FACE_FROM_ID (it->f, next_face_id)->box + == FACE_NO_BOX); + } + } + else if (CHARPOS (pos) >= ZV) it->end_of_box_run_p = true; else { - next_face_id = face_at_buffer_position - (it->w, CHARPOS (pos), &ignore, - CHARPOS (pos) + TEXT_PROP_DISTANCE_LIMIT, false, -1); + next_face_id = + face_at_buffer_position (it->w, CHARPOS (pos), &ignore, + CHARPOS (pos) + + TEXT_PROP_DISTANCE_LIMIT, + false, -1); it->end_of_box_run_p = (FACE_FROM_ID (it->f, next_face_id)->box == FACE_NO_BOX);