commit ee0b83343231427fbdf954ce9e7d4f1632583245 (HEAD, refs/remotes/origin/master) Author: Xue Fuqiao Date: Tue Jun 30 16:02:56 2015 +0800 Add cross references. * doc/emacs/display.texi (Standard Faces, Fringes): Add cross references. diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 53bea52..bed25a5 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -699,8 +699,9 @@ terminals. This face is used for the prompt strings displayed in the minibuffer. By default, Emacs automatically adds this face to the value of @code{minibuffer-prompt-properties}, which is a list of text -properties used to display the prompt text. (This variable takes -effect when you enter the minibuffer.) +properties (@pxref{Text Properties,,, elisp, the Emacs Lisp Reference +Manual}) used to display the prompt text. (This variable takes effect +when you enter the minibuffer.) @item fringe @cindex @code{fringe} face The face for the fringes to the left and right of windows on graphic @@ -1079,10 +1080,11 @@ end''. If the line's direction is right-to-left (@pxref{Bidirectional Editing}), the meanings of the curving arrows in the fringes are swapped. - The fringes indicate line truncation with short horizontal arrows -meaning ``there's more text on this line which is scrolled -horizontally out of view''. Clicking the mouse on one of the arrows -scrolls the display horizontally in the direction of the arrow. + The fringes indicate line truncation (@pxref{Line Truncation}) with +short horizontal arrows meaning ``there's more text on this line which +is scrolled horizontally out of view''. Clicking the mouse on one of +the arrows scrolls the display horizontally in the direction of the +arrow. The fringes can also indicate other things, such as buffer boundaries (@pxref{Displaying Boundaries}), and where a program you commit f66d4e860ef45719628e3c2bab336f62fff38db2 Merge: 3fa319b 1b3004c Author: Katsumi Yamaoka Date: Tue Jun 30 03:47:18 2015 +0000 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit 1b3004cbf4de52261977d32a33b9a7e1ee630647 Author: Ted Zlatanov Date: Mon Jun 29 23:07:30 2015 -0400 cfengine.el: update for the upcoming CFEngine 3.7 release Update for the upcoming CFEngine 3.7 release: support macros and quoted context strings; reformat JSON; indent promise attributes 2 units by default; give function parameter descriptions in the eldoc glue. * cfengine.el: Update version and docs and fix name. Autoload `json-pretty-print'. Support new features in 3.7. (cfengine-parameters-indent): Set default promise attribute indent to 2 more than the promise itself. (cfengine3-macro-regex): New variable to match the new macro syntax. (cfengine3-font-lock-keywords): Use it to highlight macros. (cfengine3-indent-line): Use it to indent macros to column 0. (cfengine3-class-selector-regex): Update for the new quoted strings format. (cfengine3-reformat-json-string): New function to reformat a JSON string using `json-pretty-print'. (cfengine3-format-function-docstring): Use function parameter description if it's provided by the cf-promises syntax dump. diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index aec7d20..27784a5 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el @@ -5,7 +5,7 @@ ;; Author: Dave Love ;; Maintainer: Ted Zlatanov ;; Keywords: languages -;; Version: 1.3 +;; Version: 1.4 ;; This file is part of GNU Emacs. @@ -24,7 +24,7 @@ ;;; Commentary: -;; Provides support for editing GNU Cfengine files, including +;; Provides support for editing GNU CFEngine files, including ;; font-locking, Imenu and indentation, but with no special keybindings. ;; By default, CFEngine 3.x syntax is used. @@ -46,6 +46,14 @@ ;; (add-hook 'cfengine3-mode-hook 'eldoc-mode) +;; You may also find the command `cfengine3-reformat-json-string' +;; useful, just bind it to a key you prefer. It will take the current +;; string and reformat it as JSON. So if you're editing JSON inside +;; the policy, it's a quick way to make it more legible without +;; manually reindenting it. For instance: + +;; (global-set-key [(control f4)] 'cfengine3-reformat-json-string) + ;; This is not the same as the mode written by Rolf Ebert ;; , distributed with cfengine-2.0.5. It does ;; better fontification and indentation, inter alia. @@ -53,6 +61,7 @@ ;;; Code: (autoload 'json-read "json") +(autoload 'json-pretty-print "json") (defgroup cfengine () "Editing CFEngine files." @@ -80,7 +89,7 @@ will use a fallback syntax definition." :group 'cfengine :type '(choice file (const nil))) -(defcustom cfengine-parameters-indent '(promise pname 0) +(defcustom cfengine-parameters-indent '(promise pname 2) "Indentation of CFEngine3 promise parameters (hanging indent). For example, say you have this code: @@ -101,15 +110,15 @@ You can also choose to indent the start of the word Finally, you can choose the amount of the indent. -The default is to anchor at promise, indent parameter name, and offset 0: +The default is to anchor at promise, indent parameter name, and offset 2: bundle agent rcfiles { files: any:: \"/tmp/netrc\" - comment => \"my netrc\", - perms => mog(\"600\", \"tzz\", \"tzz\"); + comment => \"my netrc\", + perms => mog(\"600\", \"tzz\", \"tzz\"); } Here we anchor at beginning of line, indent arrow, and offset 10: @@ -823,7 +832,9 @@ This includes those for cfservd as well as cfagent.") ) "Regexp matching full defun declaration (excluding argument list).") - (defconst cfengine3-class-selector-regex "\\([[:alnum:]_().&|!:]+\\)::") + (defconst cfengine3-macro-regex "\\(@[a-zA-Z].+\\)") + + (defconst cfengine3-class-selector-regex "\\([\"']?[[:alnum:]_().$&|!:]+[\"']?\\)::") (defconst cfengine3-category-regex "\\([[:alnum:]_]+\\):") @@ -850,6 +861,14 @@ This includes those for cfservd as well as cfagent.") (defvar cfengine3-font-lock-keywords `( + ;; Macros + (,(concat "^" cfengine3-macro-regex) + 1 font-lock-error-face) + + ;; invalid macros + (,(concat "^[ \t]*" cfengine3-macro-regex) + 1 font-lock-warning-face) + ;; Defuns. This happens early so they don't get caught by looser ;; patterns. (,(concat "\\_<" cfengine3-defuns-regex "\\_>" @@ -1016,7 +1035,7 @@ Treats body/bundle blocks as defuns." t) (defun cfengine3-indent-line () - "Indent a line in Cfengine 3 mode. + "Indent a line in CFEngine 3 mode. Intended as the value of `indent-line-function'." (let ((pos (- (point-max) (point))) parse) @@ -1028,6 +1047,10 @@ Intended as the value of `indent-line-function'." (message "%S" parse)) (cond + ;; Macros start at 0. But make sure we're not inside a string. + ((and (not (nth 3 parse)) + (looking-at (concat cfengine3-macro-regex))) + (indent-line-to 0)) ;; Body/bundle blocks start at 0. ((looking-at (concat cfengine3-defuns-regex "\\_>")) (indent-line-to 0)) @@ -1103,6 +1126,19 @@ Intended as the value of `indent-line-function'." (if (> (- (point-max) pos) (point)) (goto-char (- (point-max) pos))))) +(defun cfengine3-reformat-json-string () + "Reformat the current string as JSON using `json-pretty-print'." + (interactive) + (let ((ppss (syntax-ppss))) + (when (nth 3 ppss) ;inside a string + (save-excursion + (goto-char (nth 8 ppss)) + (forward-char 1) + (let ((start (point))) + (forward-sexp 1) + (json-pretty-print start + (point))))))) + ;; CFEngine 3.x grammar ;; specification: blocks @@ -1199,18 +1235,22 @@ Intended as the value of `indent-line-function'." "???") (propertize f 'face 'font-lock-function-name-face) (mapconcat (lambda (p) - (let ((type (cdr (assq 'type p))) + (let* ((type (cdr (assq 'type p))) + (description (cdr (assq 'description p))) + (desc-string (if (stringp description) + (concat " /" description "/") + "")) (range (cdr (assq 'range p)))) (cond ((not (stringp type)) "???type???") ((not (stringp range)) "???range???") ;; options are lists of possible keywords ((equal type "option") - (propertize (concat "[" range "]") + (propertize (concat "[" range "]" desc-string) 'face 'font-lock-keyword-face)) ;; anything else is a type name as a variable - (t (propertize type + (t (propertize (concat type desc-string) 'face 'font-lock-variable-name-face))))) plist commit 7466a4ded6ded0bea50151395b7a0fccc5dfd167 Author: Michael R. Mauger Date: Mon Jun 29 20:58:22 2015 -0400 Cygwin emacsclient handles w32 file names diff --git a/lisp/server.el b/lisp/server.el index 2007635..ce19b3c 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1167,6 +1167,9 @@ The following commands are accepted by the client: (let ((file (pop args-left))) (if coding-system (setq file (decode-coding-string file coding-system))) + (when (and (eq system-type 'cygwin) + (fboundp 'cygwin-convert-file-name-from-windows)) + (setq file (cygwin-convert-file-name-from-windows file))) (setq file (expand-file-name file dir)) (push (cons file filepos) files) (server-log (format "New file: %s %s" commit 3fa319bd841dfd0451fcd0e937af9582bdb81ef7 Author: Katsumi Yamaoka Date: Mon Jun 29 23:13:45 2015 +0000 * lisp/isearch.el (isearch-exit): Don't call isearch-done twice (bug#20925). diff --git a/lisp/isearch.el b/lisp/isearch.el index 45c6d97..62899ab 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1184,8 +1184,8 @@ nonincremental search instead via `isearch-edit-string'." (if (and search-nonincremental-instead (= 0 (length isearch-string))) (let ((isearch-nonincremental t)) - (isearch-edit-string))) - (isearch-done) + (isearch-edit-string)) ;; this calls isearch-done as well + (isearch-done)) (isearch-clean-overlays)) (defun isearch-fail-pos (&optional msg) commit ea399306a304d8f7e0feb46c2215e47d0eae6864 Author: Eli Zaretskii Date: Mon Jun 29 20:36:53 2015 +0300 * doc/lispref/text.texi (Sticky Properties): Improve wording. (Bug#20924) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index d4b6950..acf7234 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -3509,10 +3509,12 @@ of the text. @cindex sticky text properties @cindex inheritance, text property - Self-inserting characters normally take on the same properties as the -preceding character. This is called @dfn{inheritance} of properties. + Self-inserting characters, the ones that get inserted into a buffer +when the user types them (@pxref{Commands for Insertion}), normally +take on the same properties as the preceding character. This is +called @dfn{inheritance} of properties. - A Lisp program can do insertion with inheritance or without, + By contrast, a Lisp program can do insertion with inheritance or without, depending on the choice of insertion primitive. The ordinary text insertion functions, such as @code{insert}, do not inherit any properties. They insert text with precisely the properties of the commit ea60b543f6829061b751a0a1c60309bcfe2ff7a7 Author: Eli Zaretskii Date: Mon Jun 29 19:10:20 2015 +0300 Allow font names that end in "-NN", where NN is a number * src/font.c (font_load_for_lface): If the font-spec didn't match any available fonts, try again without interpreting trailing "-NN" as the font size. For the description of the original problem, see http://lists.gnu.org/archive/html/help-emacs-windows/2015-06/msg00001.html diff --git a/src/font.c b/src/font.c index 564c53a..575975c 100644 --- a/src/font.c +++ b/src/font.c @@ -3337,6 +3337,38 @@ font_load_for_lface (struct frame *f, Lisp_Object *attrs, Lisp_Object spec) /* No font is listed for SPEC, but each font-backend may have different criteria about "font matching". So, try it. */ entity = font_matching_entity (f, attrs, spec); + /* Perhaps the user asked for a font "Foobar-123", and we + interpreted "-123" as the size, whereas it really is part of + the name. So we reset the size to nil and the family name to + the entire "Foobar-123" thing, and try again with that. */ + if (NILP (entity)) + { + name = Ffont_get (spec, QCuser_spec); + if (STRINGP (name)) + { + char *p = SDATA (name), *q = strrchr (p, '-'); + + if (q != NULL && c_isdigit (q[1])) + { + char *tail; + double font_size = strtod (q + 1, &tail); + + if (font_size > 0 && tail != q + 1) + { + Lisp_Object lsize = Ffont_get (spec, QCsize); + + if ((FLOATP (lsize) && XFLOAT_DATA (lsize) == font_size) + || (INTEGERP (lsize) && XINT (lsize) == font_size)) + { + ASET (spec, FONT_FAMILY_INDEX, + font_intern_prop (p, tail - p, 1)); + ASET (spec, FONT_SIZE_INDEX, Qnil); + entity = font_matching_entity (f, attrs, spec); + } + } + } + } + } if (NILP (entity)) return Qnil; } commit 64110eb14d33d078c8fe6d496a780e46a0019b36 Author: Eli Zaretskii Date: Mon Jun 29 18:57:25 2015 +0300 .gdbinit followup to changes in !USE_LSB_TAG * src/.gdbinit (xgetsym): Don't left-shift $ptr even under !USE_LSB_TAG, as Emacs no longer does. diff --git a/src/.gdbinit b/src/.gdbinit index 91beaef..3b1004c 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -72,9 +72,6 @@ end define xgetsym xgetptr $arg0 - if (!USE_LSB_TAG) - set $ptr = ($ptr << GCTYPEBITS) - end set $ptr = ((struct Lisp_Symbol *) ((char *)lispsym + $ptr)) end commit 59f1e8a02d22c31168986f11debc740272eb459c Author: Wolfgang Jenkner Date: Mon Jun 29 14:26:29 2015 +0200 * lisp/calc-store.el (calc-insert-permanent-variable): Heed case. Otherwise `s p' of f and F will stomp on each other's value. (Bug#20916) diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 11bf964..91b927a 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -609,7 +609,8 @@ (defun calc-insert-permanent-variable (var) (goto-char (point-min)) - (if (search-forward (concat "(setq " (symbol-name var) " '") nil t) + (if (let (case-fold-search) + (search-forward (concat "(setq " (symbol-name var) " '") nil t)) (progn (setq calc-pv-pos (point-marker)) (forward-line -1) commit 23d00d4cddc4526483248f8886ab26310a280ed3 Author: Artur Malabarba Date: Mon Jun 29 10:07:24 2015 +0100 * lisp/emacs-lisp/tabulated-list.el (tabulated-list-print): Don't block remember-pos if buffer isn't displayed. (Bug#20921) diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 4bf714b..9119c3a 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -321,11 +321,11 @@ changing `tabulated-list-sort-key'." (sorter (tabulated-list--get-sorter)) entry-id saved-pt saved-col window-line) (and remember-pos + (setq entry-id (tabulated-list-get-id)) + (setq saved-col (current-column)) (when (eq (window-buffer) (current-buffer)) (setq window-line - (count-screen-lines (window-start) (point)))) - (setq entry-id (tabulated-list-get-id)) - (setq saved-col (current-column))) + (count-screen-lines (window-start) (point))))) ;; Sort the entries, if necessary. (when sorter (setq entries (sort entries sorter))) commit 6689b537c84f27eb2dae70a2422f2da99b57aaab Author: Nicolas Richard Date: Mon Jun 29 09:08:47 2015 +0200 * package.el (describe-package): Use symbol-at-point as additional guess diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 88dd6ac..9f56345 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2104,7 +2104,8 @@ will be deleted." (defun describe-package (package) "Display the full documentation of PACKAGE (a symbol)." (interactive - (let* ((guess (function-called-at-point))) + (let* ((guess (or (function-called-at-point) + (symbol-at-point)))) (require 'finder-inf nil t) ;; Load the package list if necessary (but don't activate them). (unless package--initialized commit a4760a347ebd61e173e7aa5c229159f7c5ac227a Author: Nicolas Richard Date: Mon Jun 29 09:07:04 2015 +0200 * package.el (describe-package): Convert the guess to a string diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 4dafe17..88dd6ac 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2120,7 +2120,8 @@ will be deleted." (format "Describe package (default %s): " guess) "Describe package: ") - packages nil t nil nil guess))) + packages nil t nil nil (when guess + (symbol-name guess))))) (list (intern val)))))) (if (not (or (package-desc-p package) (and package (symbolp package)))) (message "No package specified")