commit 379a846b8548dc32a9019ef0a37c02f62cd9bad1 (HEAD, refs/remotes/origin/master) Author: Lars Ingebrigtsen Date: Mon Feb 29 18:06:36 2016 +1100 Make
in
  • not insert extra newlines * lisp/net/shr.el (shr-tag-div): Make
    in
  • not insert extra newlines (bug#19587). diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 6e6a423..63e02d9 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1257,7 +1257,7 @@ ones, in case fg and bg are nil." (shr-ensure-paragraph)) (defun shr-tag-div (dom) - (shr-ensure-newline) + (shr-ensure-paragraph) (shr-generic dom) (shr-ensure-newline)) commit cb5f690e4a383129895abf96256fd2c52feff618 Author: Lars Ingebrigtsen Date: Mon Feb 29 17:53:00 2016 +1100 Allow reading Gnus reports from an offline cache * lisp/gnus/gnus-group.el (gnus-read-ephemeral-bug-group): Allow reading bug reports from an offline cache directory. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index f42f798..3de2609 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -2448,7 +2448,11 @@ the bug number, and browsing the URL must return mbox output." (with-temp-file tmpfile (mm-disable-multibyte) (dolist (id ids) - (url-insert-file-contents (format mbox-url id))) + (let ((file (format "~/.emacs.d/debbugs-cache/%s" id))) + (if (and (not gnus-plugged) + (file-exists-p file)) + (insert-file-contents file) + (url-insert-file-contents (format mbox-url id))))) (goto-char (point-min)) ;; Add the debbugs address so that we can respond to reports easily. (while (re-search-forward "^To: " nil t) commit 16efc8d53f30d7519cfbcb5837fce70911d6f3a1 Author: Tino Calancha Date: Mon Feb 29 17:07:59 2016 +1100 Meta + shift + Fn combos are recognized by xterm>=216. * lisp/term/xterm.el (xterm-alternatives-map): Meta + shift + Fn combos are recognized by xterm>=216 (bug#22837). diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index e06423c..5a38ebe 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -590,6 +590,19 @@ string bytes that can be copied is 3/4 of this value." (define-key map [f59] [M-f11]) (define-key map [f60] [M-f12]) + (define-key map [f61] [M-S-f1]) + (define-key map [f62] [M-S-f2]) + (define-key map [f63] [M-S-f3]) + (define-key map [f64] [M-S-f4]) + (define-key map [f65] [M-S-f5]) + (define-key map [f66] [M-S-f6]) + (define-key map [f67] [M-S-f7]) + (define-key map [f68] [M-S-f8]) + (define-key map [f69] [M-S-f9]) + (define-key map [f70] [M-S-f10]) + (define-key map [f71] [M-S-f11]) + (define-key map [f72] [M-S-f12]) + map) "Keymap of possible alternative meanings for some keys.") commit fb0959e7137a4725148a0c48a002519492f864bb Author: Simen Heggestøyl Date: Mon Feb 29 17:06:26 2016 +1100 Declare $ as an expression prefix in SCSS * lisp/textmodes/css-mode.el (scss-mode-syntax-table): Declare $ as an expression prefix (bug#22841). diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 4064374..93a8dce 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -547,6 +547,8 @@ pseudo-classes, and at-rules." (let ((st (make-syntax-table css-mode-syntax-table))) (modify-syntax-entry ?/ ". 124" st) (modify-syntax-entry ?\n ">" st) + ;; Variable names are prefixed by $. + (modify-syntax-entry ?$ "'" st) st)) (defvar scss-font-lock-keywords commit 3e2883c4cecbc9ca31655966ad2954f2034901a7 Author: Lars Ingebrigtsen Date: Mon Feb 29 17:05:14 2016 +1100 Revert "Declare $ as an expression prefix in SCSS" This reverts commit ffb33264f21e8af60b8055c47baffcf0f6c300df. Revering to fix author name. diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 93a8dce..4064374 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -547,8 +547,6 @@ pseudo-classes, and at-rules." (let ((st (make-syntax-table css-mode-syntax-table))) (modify-syntax-entry ?/ ". 124" st) (modify-syntax-entry ?\n ">" st) - ;; Variable names are prefixed by $. - (modify-syntax-entry ?$ "'" st) st)) (defvar scss-font-lock-keywords commit ffb33264f21e8af60b8055c47baffcf0f6c300df Author: Simen Date: Mon Feb 29 17:03:39 2016 +1100 Declare $ as an expression prefix in SCSS * lisp/textmodes/css-mode.el (scss-mode-syntax-table): Declare $ as an expression prefix (bug#22841). diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 4064374..93a8dce 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -547,6 +547,8 @@ pseudo-classes, and at-rules." (let ((st (make-syntax-table css-mode-syntax-table))) (modify-syntax-entry ?/ ". 124" st) (modify-syntax-entry ?\n ">" st) + ;; Variable names are prefixed by $. + (modify-syntax-entry ?$ "'" st) st)) (defvar scss-font-lock-keywords commit 90c36173fdcc7dbe1fa150784a4784a9c0cb7bbc Author: Hugh Brown Date: Mon Feb 29 16:20:05 2016 +1100 Save buffers before running grep commands * lisp/progmodes/grep.el (grep-ask-about-save): New variable (bug#96). (grep, lgrep, rgrep): Use it (bug#96). * doc/emacs/building.texi (Grep Searching): Document `grep-save-buffers'. * lisp/progmodes/grep.el (grep-save-buffers): Rename from `grep-ask-about-save'. (grep--save-buffers): New function. (grep, lgrep, rgrep): Use it. diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 3fa89d9..03fa0ed 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -382,6 +382,14 @@ use of this feature by setting @code{grep-highlight-matches} to @code{t}. When displaying a match in the source buffer, the exact match will be highlighted, instead of the entire source line. + The @command{grep} commands will offer to save buffers before +running. This is controlled by the @code{grep-save-buffers} variable. +The possible values are either @code{nil} (don't save), @code{ask} +(ask before saving), a function which will be used as a predicate (and +is called with the file name as the parameter and should return +non-nil if the buffer is to be saved), and any other non-@code{nil} +value means that all buffers should be saved without asking. + @findex grep-find @findex find-grep The command @kbd{M-x grep-find} (also available as @kbd{M-x diff --git a/etc/NEWS b/etc/NEWS index 12b98fa..8c4fb63 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1676,6 +1676,10 @@ behavior, set `diff-switches' to `-c'. dynamically. Any third-party code that changes these templates should be updated accordingly. +** The grep/rgrep/lgrep functions will now ask about saving files +before running. This is controlled by the `grep-save-buffers' +variable. + +++ ** ‘(/ N)’ is now equivalent to ‘(/ 1 N)’ rather than to ‘(/ N 1)’. The new behavior is compatible with Common Lisp and with XEmacs. diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index f04a722..b035528 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -227,6 +227,25 @@ to determine whether cdr should not be excluded." (const :tag "No ignored files" nil)) :group 'grep) +;;;###autoload +(defcustom grep-save-buffers 'ask + "If non-nil, save buffers before running the grep commands. +If `ask', ask before saving. If the variable is a function, it +will be used as a predicate that should say whether the buffer should +be saved or not. +E.g., one can set this to + (lambda () + (string-prefix-p my-grep-root (file-truename (buffer-file-name)))) +to limit saving to files located under `my-grep-root'." + :version "25.2" + :type '(choice + (const :tag "Default (ask before saving)" ask) + (const :tag "Don't save buffers" nil) + (const :tag "Save all buffers" t) + function) + :type 'boolean + :group 'grep) + (defcustom grep-error-screen-columns nil "If non-nil, column numbers in grep hits are screen columns. See `compilation-error-screen-columns'" @@ -728,6 +747,12 @@ This function is called from `compilation-filter-hook'." grep-error-screen-columns) (add-hook 'compilation-filter-hook 'grep-filter nil t)) +(defun grep--save-buffers () + (when grep-save-buffers + (save-some-buffers (and (not (eq grep-save-buffers 'ask)) + (not (functionp grep-save-buffers))) + (and (functionp grep-save-buffers) + grep-save-buffers)))) ;;;###autoload (defun grep (command-args) @@ -759,6 +784,7 @@ list is empty)." 'grep-history (if current-prefix-arg nil default)))))) + (grep--save-buffers) ;; Setting process-setup-function makes exit-message-function work ;; even when async processes aren't supported. (compilation-start (if (and grep-use-null-device null-device) @@ -952,6 +978,7 @@ This command shares argument histories with \\[rgrep] and \\[grep]." (let ((default-directory dir)) ;; Setting process-setup-function makes exit-message-function work ;; even when async processes aren't supported. + (grep--save-buffers) (compilation-start (if (and grep-use-null-device null-device) (concat command " " null-device) command) @@ -1014,6 +1041,7 @@ to specify a command to run." (read-from-minibuffer "Confirm: " command nil nil 'grep-find-history)) (add-to-history 'grep-find-history command)) + (grep--save-buffers) (let ((default-directory dir)) (compilation-start command 'grep-mode)) ;; Set default-directory if we started rgrep in the *grep* buffer. commit 04289d1cd863fa8cc0c8a9b976a8e27d9a0b4dd1 Author: Lars Ingebrigtsen Date: Mon Feb 29 15:13:30 2016 +1100 Allow sorting flyspell corrections * lisp/textmodes/flyspell.el (flyspell-sort): New function (bug#2405). (flyspell-sort-corrections-functionx): New variable. (flyspell-sort-corrections-alphabetically): New function. (flyspell-notify-misspell): Use them. (flyspell-auto-correct-word): Ditto. (flyspell-emacs-popup): Ditto. (flyspell-xemacs-popup): Ditto. Suggested by Sebastien Delafond. diff --git a/etc/NEWS b/etc/NEWS index 6fe47d4..12b98fa 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2010,6 +2010,10 @@ This is used by Google's Native Client (NaCl). ** `read-color' will now display the color names using the color itself as the background color. +--- +** There is now a new variable `flyspell-sort-corrections-function' +that allows changing the way corrections are sorted. + ** Miscellaneous name change --- diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 3b1a805..5db0d98 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -88,11 +88,34 @@ downcased before comparing with these exceptions." :version "24.1") (defcustom flyspell-sort-corrections nil - "Non-nil means, sort the corrections alphabetically before popping them." + "If non-nil, sort the corrections before popping them. +The sorting is controlled by the `flyspell-sort-corrections-function' +variable, and defaults to sorting alphabetically." :group 'flyspell :version "21.1" :type 'boolean) +(defcustom flyspell-sort-corrections-function + 'flyspell-sort-corrections-alphabetically + "The function used to sort corrections. +This only happens if `flyspell-sort-corrections' is non-nil. The +function takes three parameters -- the two correction candidates +to be sorted, and the third parameter is the word that's being +corrected." + :version "25.2" + :type 'function + :group 'flyspell) + +(defun flyspell-sort-corrections-alphabetically (corr1 corr2 _) + (string< corr1 corr2)) + +(defun flyspell-sort (corrs word) + (if flyspell-sort-corrections + (sort corrs + (lambda (c1 c2) + (funcall flyspell-sort-corrections-function c1 c2 word))) + corrs)) + (defcustom flyspell-duplicate-distance 400000 "The maximum distance for finding duplicates of unrecognized words. This applies to the feature that when a word is not found in the dictionary, @@ -1007,9 +1030,7 @@ Mostly we check word delimiters." (defun flyspell-notify-misspell (word poss) (let ((replacements (if (stringp poss) poss - (if flyspell-sort-corrections - (sort (car (cdr (cdr poss))) 'string<) - (car (cdr (cdr poss))))))) + (flyspell-sort (car (cdr (cdr poss))) word)))) (if flyspell-issue-message-flag (message "misspelling `%s' %S" word replacements)))) @@ -1979,9 +2000,8 @@ This command proposes various successive corrections for the current word." (error "Ispell: error in Ispell process")) (t ;; The word is incorrect, we have to propose a replacement. - (let ((replacements (if flyspell-sort-corrections - (sort (car (cdr (cdr poss))) 'string<) - (car (cdr (cdr poss)))))) + (let ((replacements (flyspell-sort (car (cdr (cdr poss))) + word))) (setq flyspell-auto-correct-region nil) (if (consp replacements) (progn @@ -2229,9 +2249,7 @@ If OPOINT is non-nil, restore point there after adjusting it for replacement." (setq event (list (list (car (cdr mouse-pos)) (1+ (cdr (cdr mouse-pos)))) (car mouse-pos))))) - (let* ((corrects (if flyspell-sort-corrections - (sort (car (cdr (cdr poss))) 'string<) - (car (cdr (cdr poss))))) + (let* ((corrects (flyspell-sort (car (cdr (cdr poss))) word)) (cor-menu (if (consp corrects) (mapcar (lambda (correct) (list correct correct)) @@ -2262,9 +2280,7 @@ If OPOINT is non-nil, restore point there after adjusting it for replacement." ;;*---------------------------------------------------------------------*/ (defun flyspell-xemacs-popup (poss word cursor-location start end save) "The XEmacs popup menu." - (let* ((corrects (if flyspell-sort-corrections - (sort (car (cdr (cdr poss))) 'string<) - (car (cdr (cdr poss))))) + (let* ((corrects (flyspell-sort (car (cdr (cdr poss))) word)) (cor-menu (if (consp corrects) (mapcar (lambda (correct) (vector correct commit 9671650a7c76b4dc2c74a6ae6258def228a26d95 Author: Lars Ingebrigtsen Date: Mon Feb 29 14:20:09 2016 +1100 Wait for async DNS to complete before freeing resources * src/process.c (Fdelete_process): Wait for async DNS to complete before freeing the data structures it needs. diff --git a/src/process.c b/src/process.c index a321244..d83e2d2 100644 --- a/src/process.c +++ b/src/process.c @@ -845,8 +845,24 @@ nil, indicating the current buffer's process. */) #ifdef HAVE_GETADDRINFO_A if (p->dns_request) { + int ret; + gai_cancel (p->dns_request); - free_dns_request (process); + ret = gai_error (p->dns_request); + if (ret == EAI_CANCELED || ret == 0) + free_dns_request (process); + else + { + /* If we're called during shutdown, we don't really about + freeing all the resources. Otherwise wait until + completion, and then free the request. */ + if (! inhibit_sentinels) + { + gai_suspend ((const struct gaicb * const*)&p->dns_request, + 1, NULL); + free_dns_request (process); + } + } } #endif commit f195dd692bfc1911e85f92145df57a2dba460f58 Author: Lars Ingebrigtsen Date: Mon Feb 29 13:31:45 2016 +1100 * lisp/faces.el: Remove duplicated functions from previous patch. diff --git a/lisp/faces.el b/lisp/faces.el index b5e9fdc..c9cc611 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1818,32 +1818,6 @@ with the color they represent as background color." "black" "white"))) -(defun defined-colors-with-face-attributes (&optional frame) - "Return a list of colors supported for a particular frame. -See `defined-colors' for arguments and return value. In contrast -to `define-colors' the elements of the returned list are color -strings with text properties, that make the color names render -with the color they represent as background color." - (mapcar - (lambda (color-name) - (let ((foreground (readable-foreground-color color-name)) - (color (copy-sequence color-name))) - (propertize color 'face (list :foreground foreground - :background color)))) - (defined-colors frame))) - -(defun readable-foreground-color (color) - "Return a readable foreground color for background COLOR." - (let* ((rgb (color-values color)) - (max (apply #'max rgb)) - (black (car (color-values "black"))) - (white (car (color-values "white")))) - ;; Select black or white depending on which one is less similar to - ;; the brightest component. - (if (> (abs (- max black)) (abs (- max white))) - "black" - "white"))) - (declare-function xw-color-defined-p "xfns.c" (color &optional frame)) (defun color-defined-p (color &optional frame) commit 9295d0a8c2078e5b85bc81b1f020cc73793767df Author: Eli Zaretskii Date: Sun Feb 28 18:44:50 2016 +0200 Fix TLS connections on MS-Windows * src/w32.c (sys_write): If 'send' returns with WSAENOTCONN, and this is a non-blocking socket whose connection is in progress, set errno to EWOULDBLOCK, as expected by GnuTLS and other callers. Avoid overwriting the errno value from 'send' by 'ioctlsocket'. Suggested by Alain Schneble . (Bug#22789) diff --git a/src/w32.c b/src/w32.c index d298f47..998f696 100644 --- a/src/w32.c +++ b/src/w32.c @@ -8654,6 +8654,19 @@ sys_write (int fd, const void * buffer, unsigned int count) nchars = pfn_send (SOCK_HANDLE (fd), buffer, count, 0); + if (nchars == SOCKET_ERROR) + { + set_errno (); + /* If this is a non-blocking socket whose connection is in + progress, return the proper error code to the caller; + ENOTCONN is not what they expect . */ + if (errno == ENOTCONN && (fd_info[fd].flags & FILE_CONNECT) != 0) + errno = EWOULDBLOCK; + else + DebPrint (("sys_write.send failed with error %d on socket %ld\n", + pfn_WSAGetLastError (), SOCK_HANDLE (fd))); + } + /* Set the socket back to non-blocking if it was before, for other operations that support it. */ if (fd_info[fd].flags & FILE_NDELAY) @@ -8661,13 +8674,6 @@ sys_write (int fd, const void * buffer, unsigned int count) nblock = 1; pfn_ioctlsocket (SOCK_HANDLE (fd), FIONBIO, &nblock); } - - if (nchars == SOCKET_ERROR) - { - DebPrint (("sys_write.send failed with error %d on socket %ld\n", - pfn_WSAGetLastError (), SOCK_HANDLE (fd))); - set_errno (); - } } else {