commit 3d08d06a661344c0ff645e6362e2a2fe1f2e7348 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Wed Sep 2 15:08:03 2015 -0700 Treat initial-scratch-message as a doc string * doc/emacs/building.texi (Lisp Interaction): * doc/lispref/os.texi (Startup Summary): * etc/NEWS: Document this. * lisp/startup.el (initial-scratch-message): Look up find-file’s key rather than hardcoding it. (command-line-1): Substitute the doc string. This also substitutes the quotes, which will help test display quoting at startup. diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index b4a99a1..1d40a2d 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -1549,7 +1549,7 @@ mode are the same as in Emacs Lisp mode. At startup, the @file{*scratch*} buffer contains a short message, in the form of a Lisp comment, that explains what it is for. This message is controlled by the variable @code{initial-scratch-message}, -which should be either a string, or @code{nil} (which means to +which should be either a documentation string, or @code{nil} (which means to suppress the message). @findex ielm diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 64ebb45..bbe87ca 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -195,7 +195,7 @@ It now exits if the option @code{--batch} was specified. @item If the @file{*scratch*} buffer exists and is empty, it inserts -@code{initial-scratch-message} into that buffer. +@code{(substitute-command-keys initial-scratch-message)} into that buffer. @item If @code{initial-buffer-choice} is a string, it visits the file (or @@ -314,6 +314,7 @@ file will not inhibit the message for someone else. @defopt initial-scratch-message This variable, if non-@code{nil}, should be a string, which is +treated as documentation to be inserted into the @file{*scratch*} buffer when Emacs starts up. If it is @code{nil}, the @file{*scratch*} buffer is empty. @end defopt diff --git a/etc/NEWS b/etc/NEWS index c2828c9..3e50943 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -91,6 +91,10 @@ so if you want to use it, you can always take a copy from an older Emacs. and *Buffer List*. This makes Emacs convenient to use from the command line when `initial-buffer-choice' is non-nil. ++++ +** The value of ‘initial-scratch-message’ is now treated as a doc string +and can contain escape sequences for command keys, quotes, and the like. + * Changes in Emacs 25.1 diff --git a/lisp/startup.el b/lisp/startup.el index c152e01..e024959 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1390,11 +1390,11 @@ settings will be marked as \"CHANGED outside of Customize\"." (defcustom initial-scratch-message (purecopy "\ ;; This buffer is for notes you don't want to save, and for Lisp evaluation. -;; If you want to create a file, visit that file with C-x C-f, +;; If you want to create a file, visit that file with \\[find-file], ;; then enter the text in that file's own buffer. ") - "Initial message displayed in *scratch* buffer at startup. + "Initial documentation displayed in *scratch* buffer at startup. If this is nil, no message will be displayed." :type '(choice (text :tag "Message") (const :tag "none" nil)) @@ -2430,7 +2430,7 @@ nil default-directory" name) (get-buffer "*scratch*") (with-current-buffer "*scratch*" (when (zerop (buffer-size)) - (insert initial-scratch-message) + (insert (substitute-command-keys initial-scratch-message)) (set-buffer-modified-p nil)))) ;; Prepend `initial-buffer-choice' to `displayable-buffers'. commit b28ad0e9f74646b1126af096a41af20d3e01ad68 Author: Paul Eggert Date: Wed Sep 2 14:43:03 2015 -0700 Fix describe-char bug with glyphs on terminals * lisp/descr-text.el (describe-char): Terminals can have glyphs in buffers too, so don’t treat them differently from graphic displays. Without this fix, describe-char would throw an error on a terminal if given a glyph with a non-default face. diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 237cc00..f81b084 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -724,25 +724,17 @@ relevant to POS." (when disp-vector (insert "\nThe display table entry is displayed by ") - (if (display-graphic-p (selected-frame)) - (progn - (insert "these fonts (glyph codes):\n") - (dotimes (i (length disp-vector)) - (insert (glyph-char (car (aref disp-vector i))) ?: - (propertize " " 'display '(space :align-to 5)) - (or (cdr (aref disp-vector i)) "-- no font --") - "\n") - (let ((face (glyph-face (car (aref disp-vector i))))) - (when face - (insert (propertize " " 'display '(space :align-to 5)) - "face: ") - (insert (format-message "‘%s’\n" face)))))) - (insert "these terminal codes:\n") - (dotimes (i (length disp-vector)) - (insert (car (aref disp-vector i)) - (propertize " " 'display '(space :align-to 5)) - (or (cdr (aref disp-vector i)) "-- not encodable --") - "\n")))) + (insert "these fonts (glyph codes):\n") + (dotimes (i (length disp-vector)) + (insert (glyph-char (car (aref disp-vector i))) ?: + (propertize " " 'display '(space :align-to 5)) + (or (cdr (aref disp-vector i)) "-- no font --") + "\n") + (let ((face (glyph-face (car (aref disp-vector i))))) + (when face + (insert (propertize " " 'display '(space :align-to 5)) + "face: ") + (insert (format-message "‘%s’\n" face)))))) (when composition (insert "\nComposed") commit a9706c6cc16baeaf49b1dfc4badc0254870c449d Author: Paul Eggert Date: Wed Sep 2 13:55:41 2015 -0700 Follow text-quoting-style in display table init This attempts to fix a problem reported by Alan Mackenzie in: http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00112.html * doc/lispref/display.texi (Active Display Table): Mention how text-quoting-style affects it. * doc/lispref/help.texi (Keys in Documentation): Say how to set text-quoting-style in ~/.emacs. * etc/NEWS: Document the change. * lisp/startup.el (startup--setup-quote-display): Follow user preference if text-quoting-style is set. (command-line): Setup quote display again if user expresses a preference in .emacs. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 9d82edc..14e2cd3 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -6531,8 +6531,12 @@ no buffer display table. The value of this variable is the standard display table, which is used when Emacs is displaying a buffer in a window with neither a window display table nor a buffer display table defined, or when Emacs -is outputting text to the standard output or error streams. Its -default is @code{nil}. +is outputting text to the standard output or error streams. Although its +default is typically @code{nil}, in an interactive session if the +locale cannot display curved quotes, or if the initial value of +@code{text-quoting-style} specifies a preference for ASCII, its +default maps curved quotes to ASCII approximations. @xref{Keys in +Documentation}. @end defvar The @file{disp-table} library defines several functions for changing diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 44c09a2..89339ff 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -345,7 +345,9 @@ quotes. If the variable's value is @code{curve}, the style is apostrophes. If the value is @code{grave}, the style is @t{`like this'} with grave accent and apostrophe. The default value @code{nil} acts like @code{curve} if curved single quotes are displayable, and -like @code{grave} otherwise. +like @code{grave} otherwise. To use the traditional @code{grave} +style, put the line @code{(setq text-quoting-style 'grave)} into your +@file{~/.emacs} file. @end defvar @defun substitute-command-keys string diff --git a/etc/NEWS b/etc/NEWS index c664e02..c2828c9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1113,8 +1113,9 @@ integers. ** New function `set-binary-mode' allows to switch a standard stream of the Emacs process to binary I/O mode. -** In locales that cannot display curved quotes, ASCII approximations -are installed in standard-display-table. +** ASCII approximations to curved quotes are put in standard-display-table +if the locale cannot display curved quotes, or if text-quoting-style +initially specifies a preference for ASCII. ** Standard output and error streams now transliterate characters via standard-display-table, and encode output using locale-coding-system. diff --git a/lisp/startup.el b/lisp/startup.el index b5e258f..c152e01 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -804,13 +804,18 @@ to prepare for opening the first frame (e.g. open a connection to an X server)." (defvar server-process) (defun startup--setup-quote-display () - "If curved quotes don't work, display ASCII approximations." - (dolist (char-repl '((?‘ . ?\`) (?’ . ?\') (?“ . ?\") (?” . ?\"))) - (when (not (char-displayable-p (car char-repl))) - (unless standard-display-table - (setq standard-display-table (make-display-table))) - (aset standard-display-table (car char-repl) - (vector (make-glyph-code (cdr char-repl) 'shadow)))))) + "Display ASCII approximations on user request or if curved quotes don't work." + (when (memq text-quoting-style '(nil grave straight)) + (dolist (char-repl '((?‘ . ?\`) (?’ . ?\') (?“ . ?\") (?” . ?\"))) + (let ((char (car char-repl)) + (repl (cdr char-repl))) + (when (or text-quoting-style (not (char-displayable-p char))) + (when (and (eq repl ?\`) (eq text-quoting-style 'straight)) + (setq repl ?\')) + (unless standard-display-table + (setq standard-display-table (make-display-table))) + (aset standard-display-table char + (vector (make-glyph-code repl 'shadow)))))))) (defun command-line () "A subroutine of `normal-top-level'. @@ -1234,6 +1239,11 @@ the ‘--debug-init’ option to view a complete error backtrace." ;; unibyte (display table, terminal coding system &c). (set-language-environment current-language-environment))) + ;; Setup quote display again, if the init file sets + ;; text-quoting-style to a non-nil value. + (when (and (not noninteractive) text-quoting-style) + (startup--setup-quote-display)) + ;; Do this here in case the init file sets mail-host-address. (if (equal user-mail-address "") (setq user-mail-address (or (getenv "EMAIL") commit fa5a9c7bae6d484107162641d16b1b38312ac225 Author: K. Handa Date: Wed Sep 2 19:11:05 2015 +0900 Fix typo * ftfont.c (ftfont_drive_otf): otf_positioning_type_components_mask -> OTF_positioning_type_components_mask. diff --git a/src/ftfont.c b/src/ftfont.c index a110cd8..98058ac 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -1936,7 +1936,7 @@ ftfont_drive_otf (MFLTFont *font, } #ifdef OTF_POSITIONING_TYPE_GET_FORMAT g->libotf_positioning_type - = otfg->positioning_type & otf_positioning_type_components_mask; + = otfg->positioning_type & OTF_positioning_type_components_mask; #endif for (i++, otfg++; (i < otf_gstring.used && otfg->f.index.from == otfg[-1].f.index.from); @@ -1963,7 +1963,7 @@ ftfont_drive_otf (MFLTFont *font, } #ifdef OTF_POSITIONING_TYPE_GET_FORMAT g->libotf_positioning_type - = otfg->positioning_type & otf_positioning_type_components_mask; + = otfg->positioning_type & OTF_positioning_type_components_mask; #endif out->used++; } commit e7b62736aade24620c8ba6fa6bd467d017f16ee0 Merge: ae08d07 3086627 Author: K. Handa Date: Wed Sep 2 18:28:54 2015 +0900 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit ae08d073d7e2738580341534adc3c5924dc76860 Author: K. Handa Date: Wed Sep 2 18:27:23 2015 +0900 fix previous change * ftfont.c (ftfont_drive_otf): Remember some bits of OTF_Glyph->positioning_type in MFLTGlyphFT->libotf_positioning_type. diff --git a/src/ftfont.c b/src/ftfont.c index 885fee6..a110cd8 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -1934,6 +1934,10 @@ ftfont_drive_otf (MFLTFont *font, tag = PACK_OTF_TAG (tag); g->g.internal = (g->g.internal & ~0x1FFFFFFF) | tag; } +#ifdef OTF_POSITIONING_TYPE_GET_FORMAT + g->libotf_positioning_type + = otfg->positioning_type & otf_positioning_type_components_mask; +#endif for (i++, otfg++; (i < otf_gstring.used && otfg->f.index.from == otfg[-1].f.index.from); i++, otfg++) @@ -1957,6 +1961,10 @@ ftfont_drive_otf (MFLTFont *font, tag = PACK_OTF_TAG (tag); g->g.internal = (g->g.internal & ~0x1FFFFFFF) | tag; } +#ifdef OTF_POSITIONING_TYPE_GET_FORMAT + g->libotf_positioning_type + = otfg->positioning_type & otf_positioning_type_components_mask; +#endif out->used++; } }