commit e2815bfe2a1e4d5a21d6b6378ebc2108d4d104ab (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Mon Dec 15 00:00:50 2014 -0800 Correct same_at_end when restoring window points * fileio.c (Finsert_file_contents): Compute same_at_end character position using the old buffer size, not the new one, since restore_window_points wants the old size. Fixes: debbugs:19161 diff --git a/src/ChangeLog b/src/ChangeLog index 46bf280..5ce56f4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2014-12-15 Paul Eggert + + Correct same_at_end when restoring window points + * fileio.c (Finsert_file_contents): Compute same_at_end character + position using the old buffer size, not the new one, since + restore_window_points wants the old size. + Fixes: debbugs:19161 + 2014-12-14 Alan Mackenzie New feature optionally to accelerate auto-repeated scrolling. diff --git a/src/fileio.c b/src/fileio.c index 83b4954..39514ee 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3522,6 +3522,9 @@ by calling `format-decode', which see. */) bytes and BEG and END count bytes. */ ptrdiff_t same_at_start = BEGV_BYTE; ptrdiff_t same_at_end = ZV_BYTE; + /* SAME_AT_END_CHARPOS counts characters, because + restore_window_points needs the old character count. */ + ptrdiff_t same_at_end_charpos = ZV; if (current_buffer->base_buffer && ! NILP (visit)) error ("Cannot do file visiting in an indirect buffer"); @@ -3943,6 +3946,7 @@ by calling `format-decode', which see. */) + (! NILP (end) ? end_offset : st.st_size) - ZV_BYTE)); if (overlap > 0) same_at_end += overlap; + same_at_end_charpos = BYTE_TO_CHAR (same_at_end); /* Arrange to read only the nonmatching middle part of the file. */ beg_offset += same_at_start - BEGV_BYTE; @@ -3950,7 +3954,7 @@ by calling `format-decode', which see. */) invalidate_buffer_caches (current_buffer, BYTE_TO_CHAR (same_at_start), - BYTE_TO_CHAR (same_at_end)); + same_at_end_charpos); del_range_byte (same_at_start, same_at_end, 0); /* Insert from the file at the proper position. */ temp = BYTE_TO_CHAR (same_at_start); @@ -4099,6 +4103,7 @@ by calling `format-decode', which see. */) overlap = same_at_start - BEGV_BYTE - (same_at_end + inserted - ZV_BYTE); if (overlap > 0) same_at_end += overlap; + same_at_end_charpos = BYTE_TO_CHAR (same_at_end); /* If display currently starts at beginning of line, keep it that way. */ @@ -4114,7 +4119,7 @@ by calling `format-decode', which see. */) { invalidate_buffer_caches (current_buffer, BYTE_TO_CHAR (same_at_start), - BYTE_TO_CHAR (same_at_end)); + same_at_end_charpos); del_range_byte (same_at_start, same_at_end, 0); temp = GPT; eassert (same_at_start == GPT_BYTE); @@ -4122,7 +4127,7 @@ by calling `format-decode', which see. */) } else { - temp = BYTE_TO_CHAR (same_at_start); + temp = same_at_end_charpos; } /* Insert from the file at the proper position. */ SET_PT_BOTH (temp, same_at_start); @@ -4405,7 +4410,7 @@ by calling `format-decode', which see. */) if (inserted > 0) restore_window_points (window_markers, inserted, BYTE_TO_CHAR (same_at_start), - BYTE_TO_CHAR (same_at_end)); + same_at_end_charpos); if (!NILP (visit)) { commit 872617ad730906f9437b90c3b90af2e2458f00f6 Author: Lars Magne Ingebrigtsen Date: Mon Dec 15 06:05:05 2014 +0100 * net/shr.el (shr-fold-text): Don't bug out on zero-length text. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8a0d518..364511c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2014-12-15 Lars Magne Ingebrigtsen + + * net/shr.el (shr-fold-text): Don't bug out on zero-length text. + 2014-12-14 Alan Mackenzie * lisp/cus-start.el (all): Add fast-but-imprecise-scrolling. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 6e06a76..387bb02 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -414,13 +414,15 @@ size, and full-buffer size." (cdr (assq 'background-color shr-stylesheet)))))))) (defun shr-fold-text (text) - (with-temp-buffer - (let ((shr-indentation 0) - (shr-state nil) - (shr-start nil) - (shr-internal-width (window-width))) - (shr-insert text) - (buffer-string)))) + (if (zerop (length text)) + text + (with-temp-buffer + (let ((shr-indentation 0) + (shr-state nil) + (shr-start nil) + (shr-internal-width (window-width))) + (shr-insert text) + (buffer-string))))) (define-inline shr-char-breakable-p (char) "Return non-nil if a line can be broken before and after CHAR." commit 3713931778c9bc8674c391dbb9149ac6288922f2 Author: Alan Mackenzie Date: Sun Dec 14 18:26:44 2014 +0000 New feature optionally to accelerate auto-repeated scrolling. src/xdisp.c: Remove "static" from declaration of Qfontification_functions. src/window.c (window_scroll): bind fontification-functions to nil when scrolling by whole screens and fast-but-imprecise-scrolling is non-nil. (syms_of_window): New DEFVAR_BOOL fast-but-imprecise-scrolling. src/lisp.h (bool): Declare Qfontification_functions extern. lisp/cus-start.el (all): Add fast-but-imprecise-scrolling. doc/emacs/display.texi (Scrolling): fast-but-imprecise-scrolling. Describe new variable. etc/NEWS: Add entry for fast-but-imprecise-scrolling. diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index cd46d9f..d2f7a34 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2014-12-14 Alan Mackenzie + + * display.texi (Scrolling): fast-but-imprecise-scrolling. + Describe new variable. + 2014-12-14 Cameron Desautels * custom.texi (Saving Customizations): Mention diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index a5555d5..12a8e1b 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -127,6 +127,19 @@ the mouse wheel (@pxref{Mouse Commands}); in general, it affects any command that has a non-@code{nil} @code{scroll-command} property. @xref{Property Lists,,, elisp, The Emacs Lisp Reference Manual}. +@vindex fast-but-imprecise-scrolling + Sometimes, particularly when you hold down keys such as @kbd{C-v} +and @kbd{M-v}, activating keyboard auto-repeat, Emacs fails to keep up +with the rapid rate of scrolling requested; the display doesn't update +and Emacs can become unresponsive to input for quite a long time. You +can counter this sluggishness by setting the variable +@code{fast-but-imprecise-scrolling} to a non-@code{nil} value. This +instructs the scrolling commands not to fontify (@pxref{Font Lock}) +any unfontified text they scroll over, instead to assume it has the +default face. This can cause Emacs to scroll to somewhat wrong buffer +positions when the faces in use are not all the same size, even with +single (i.e. without auto-repeat) scrolling operations. + @vindex scroll-up @vindex scroll-down @findex scroll-up-line diff --git a/etc/ChangeLog b/etc/ChangeLog index f344e24..0a06cbd 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-14 Alan Mackenzie + + * NEWS: Add entry for fast-but-imprecise-scrolling. + 2014-12-14 Cameron Desautels * NEWS: Mention `custom-prompt-customize-unsaved-options'. diff --git a/etc/NEWS b/etc/NEWS index 37cb4b4..6b1a4e3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -153,6 +153,12 @@ name (as returned from, for instance, `file-name-all-completions' is a directory file name. It returns non-nil if the last character in the name is a forward slash. ++++ +** New variable `fast-but-imprecise-scrolling' inhibits +fontification during full screen scrolling operations, giving less +hesitant operation during auto-repeat of C-v, M-v at the cost of +possible inaccuracies in the end position. + * Editing Changes in Emacs 25.1 diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 288589d..8a0d518 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2014-12-14 Alan Mackenzie + + * lisp/cus-start.el (all): Add fast-but-imprecise-scrolling. + 2014-12-14 Artur Malabarba * let-alist.el: Add lexical binding. diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 3b8885a..4049974 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -460,6 +460,7 @@ since it could result in memory overflow and make Emacs crash." :value display-buffer) (other :tag "Always (t)" :value t)) "24.3") + (fast-but-imprecise-scrolling scrolling boolean "25.1") (window-resize-pixelwise windows boolean "24.4") ;; xdisp.c ;; The whitespace group is for whitespace.el. diff --git a/src/ChangeLog b/src/ChangeLog index fd56186..46bf280 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +2014-12-14 Alan Mackenzie + + New feature optionally to accelerate auto-repeated scrolling. + + * xdisp.c: Remove "static" from declaration of + Qfontification_functions. + + * window.c (window_scroll): bind fontification-functions to nil + when scrolling by whole screens and + fast-but-imprecise-scrolling is non-nil. + (syms_of_window): New DEFVAR_BOOL + fast-but-imprecise-scrolling. + + * lisp.h (bool): Declare Qfontification_functions extern. + 2014-12-14 Eli Zaretskii Load system's default trusted Certificate Authorities if available. diff --git a/src/lisp.h b/src/lisp.h index a56c4a7..37172c6 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -830,6 +830,7 @@ extern Lisp_Object Qwindowp; /* Defined in xdisp.c. */ extern Lisp_Object Qimage; +extern Lisp_Object Qfontification_functions; /* Extract a value or address from a Lisp_Object. */ diff --git a/src/window.c b/src/window.c index 7c2b3ca..0b76664 100644 --- a/src/window.c +++ b/src/window.c @@ -4869,11 +4869,16 @@ window_internal_height (struct window *w) static void window_scroll (Lisp_Object window, EMACS_INT n, bool whole, int noerror) { + ptrdiff_t count = SPECPDL_INDEX (); + immediate_quit = 1; n = clip_to_bounds (INT_MIN, n, INT_MAX); wset_redisplay (XWINDOW (window)); + if (whole && Vfast_but_imprecise_scrolling) + specbind (Qfontification_functions, Qnil); + /* If we must, use the pixel-based version which is much slower than the line-based one but can handle varying line heights. */ if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) @@ -4881,6 +4886,8 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, int noerror) else window_scroll_line_based (window, n, whole, noerror); + unbind_to (count, Qnil); + /* Bug#15957. */ XWINDOW (window)->window_end_valid = 0; immediate_quit = 0; @@ -7478,6 +7485,17 @@ frame's character size, at least one window may get resized pixelwise even if this option is nil. */); window_resize_pixelwise = 0; + DEFVAR_BOOL ("fast-but-imprecise-scrolling", + Vfast_but_imprecise_scrolling, + doc: /* When non-nil, accelerate scrolling operations. +This comes into play when scrolling rapidly over previously +unfontified buffer regions. Only those portions of the buffer which +are actually going to be displayed get fontified. + +Note that this optimization can cause the portion of the buffer +displayed after a scrolling operation to be somewhat inaccurate. */); + Vfast_but_imprecise_scrolling = 0; + defsubr (&Sselected_window); defsubr (&Sminibuffer_window); defsubr (&Swindow_minibuffer_p); diff --git a/src/xdisp.c b/src/xdisp.c index f022790..48a2979 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -347,7 +347,7 @@ Lisp_Object Qtext; /* Holds the list (error). */ static Lisp_Object list_of_error; -static Lisp_Object Qfontification_functions; +Lisp_Object Qfontification_functions; static Lisp_Object Qwrap_prefix; static Lisp_Object Qline_prefix; commit 33c5143fa63a05a983657d019b8a11a25bcfffb3 Author: Ted Zlatanov Date: Sun Dec 14 12:05:26 2014 -0500 Adjust lisp/ChangeLog for custom-prompt-customize-unsaved-options. Reworded ChangeLog entry based on Stefan Monnier's suggestions. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f856956..288589d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -10,8 +10,10 @@ 2014-12-14 Cameron Desautels - * cus-edit.el (custom-prompt-customize-unsaved-options): Add a - mechanism for prompting user about unsaved customizations. + * cus-edit.el (custom-unsaved-options): New function, extracted + from `customize-unsaved'. + (custom-unsaved): Use it. + (custom-prompt-customize-unsaved-options): New function. (Bug#19328) 2014-12-14 Dmitry Gutov commit e99ce63233398ce5d0bfa47eb1ca4ef0a1df5571 Author: Eli Zaretskii Date: Sun Dec 14 18:47:51 2014 +0200 Load system's default trusted Certificate Authorities if available. src/gnutls.c (gnutls_certificate_set_x509_system_trust) [GNUTLS >= 3.0.20]: Declare for WINDOWSNT. (init_gnutls_functions)(gnutls_certificate_set_x509_system_trust) [GNUTLS >= 3.0.20]: Load from shared library for WINDOWSNT. (fn_gnutls_certificate_set_x509_system_trust) [!WINDOWSNT]: Define new macro. (Fgnutls_boot) [GNUTLS >= 3.0.20]: Call gnutls_certificate_set_x509_system_trust. Log an error message if it fails. diff --git a/src/ChangeLog b/src/ChangeLog index 12fe16d..fd56186 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2014-12-14 Eli Zaretskii + + Load system's default trusted Certificate Authorities if available. + * gnutls.c (gnutls_certificate_set_x509_system_trust) + [GNUTLS >= 3.0.20]: Declare for WINDOWSNT. + (init_gnutls_functions)(gnutls_certificate_set_x509_system_trust) + [GNUTLS >= 3.0.20]: Load from shared library for WINDOWSNT. + (fn_gnutls_certificate_set_x509_system_trust) [!WINDOWSNT]: Define + new macro. + (Fgnutls_boot) [GNUTLS >= 3.0.20]: Call + gnutls_certificate_set_x509_system_trust. Log an error message if + it fails. + 2014-12-13 Paul Eggert * alloc.c (XMALLOC_BASE_ALIGNMENT): Use max_align_t instead of diff --git a/src/gnutls.c b/src/gnutls.c index ad4d997..1feb7e1 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -103,6 +103,11 @@ DEF_GNUTLS_FN (int, gnutls_certificate_set_x509_crl_file, DEF_GNUTLS_FN (int, gnutls_certificate_set_x509_key_file, (gnutls_certificate_credentials_t, const char *, const char *, gnutls_x509_crt_fmt_t)); +#if GNUTLS_VERSION_MAJOR + \ + (GNUTLS_VERSION_MINOR > 0 || GNUTLS_VERSION_PATCH >= 20) > 3 +DEF_GNUTLS_FN (int, gnutls_certificate_set_x509_system_trust, + (gnutls_certificate_credentials_t)); +#endif DEF_GNUTLS_FN (int, gnutls_certificate_set_x509_trust_file, (gnutls_certificate_credentials_t, const char *, gnutls_x509_crt_fmt_t)); @@ -227,6 +232,10 @@ init_gnutls_functions (void) LOAD_GNUTLS_FN (library, gnutls_certificate_set_verify_flags); LOAD_GNUTLS_FN (library, gnutls_certificate_set_x509_crl_file); LOAD_GNUTLS_FN (library, gnutls_certificate_set_x509_key_file); +#if GNUTLS_VERSION_MAJOR + \ + (GNUTLS_VERSION_MINOR > 0 || GNUTLS_VERSION_PATCH >= 20) > 3 + LOAD_GNUTLS_FN (library, gnutls_certificate_set_x509_system_trust); +#endif LOAD_GNUTLS_FN (library, gnutls_certificate_set_x509_trust_file); LOAD_GNUTLS_FN (library, gnutls_certificate_type_get); LOAD_GNUTLS_FN (library, gnutls_certificate_verify_peers2); @@ -314,6 +323,10 @@ init_gnutls_functions (void) #define fn_gnutls_certificate_set_verify_flags gnutls_certificate_set_verify_flags #define fn_gnutls_certificate_set_x509_crl_file gnutls_certificate_set_x509_crl_file #define fn_gnutls_certificate_set_x509_key_file gnutls_certificate_set_x509_key_file +#if GNUTLS_VERSION_MAJOR + \ + (GNUTLS_VERSION_MINOR > 0 || GNUTLS_VERSION_PATCH >= 20) > 3 +#define fn_gnutls_certificate_set_x509_system_trust gnutls_certificate_set_x509_system_trust +#endif #define fn_gnutls_certificate_set_x509_trust_file gnutls_certificate_set_x509_trust_file #define fn_gnutls_certificate_type_get gnutls_certificate_type_get #define fn_gnutls_certificate_verify_peers2 gnutls_certificate_verify_peers2 @@ -1308,6 +1321,14 @@ one trustfile (usually a CA bundle). */) int file_format = GNUTLS_X509_FMT_PEM; Lisp_Object tail; +#if GNUTLS_VERSION_MAJOR + \ + (GNUTLS_VERSION_MINOR > 0 || GNUTLS_VERSION_PATCH >= 20) > 3 + ret = fn_gnutls_certificate_set_x509_system_trust (x509_cred); + if (ret < GNUTLS_E_SUCCESS) + GNUTLS_LOG2i (4, max_log_level, + "setting system trust failed with code ", ret); +#endif + for (tail = trustfiles; CONSP (tail); tail = XCDR (tail)) { Lisp_Object trustfile = XCAR (tail); commit 9624075a2cc512b4c3efb155b71feed8f08838dd Author: Artur Malabarba Date: Sun Dec 14 13:17:00 2014 +0000 let-alist.el: Version bump. diff --git a/lisp/let-alist.el b/lisp/let-alist.el index 3454455..2efa027 100644 --- a/lisp/let-alist.el +++ b/lisp/let-alist.el @@ -4,7 +4,7 @@ ;; Author: Artur Malabarba ;; Maintainer: Artur Malabarba -;; Version: 1.0 +;; Version: 1.0.1 ;; Keywords: extensions lisp ;; Prefix: let-alist ;; Separator: - commit 5bbe84eccf6e884a8b2f7abec757e7dcb72baae7 Author: Artur Malabarba Date: Sun Dec 14 13:15:50 2014 +0000 let-alist.el: Add lexical binding. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2679b4f..f856956 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2014-12-14 Artur Malabarba + + * let-alist.el: Add lexical binding. + 2014-12-14 Steve Purcell (tiny change) * emacs-lisp/package.el (package-menu-mode): Use an extra column diff --git a/lisp/let-alist.el b/lisp/let-alist.el index 982dd2e..3454455 100644 --- a/lisp/let-alist.el +++ b/lisp/let-alist.el @@ -1,4 +1,4 @@ -;;; let-alist.el --- Easily let-bind values of an assoc-list by their names +;;; let-alist.el --- Easily let-bind values of an assoc-list by their names -*- lexical-binding: t; -*- ;; Copyright (C) 2014 Free Software Foundation, Inc. commit eaf25ad549dc5a9b26089f588e0a80268708a3d1 Author: Steve Purcell Date: Sun Dec 14 15:56:22 2014 +0200 Add an extra column for Version in list-packages table * emacs-lisp/package.el (package-menu-mode): Use an extra column for the "Version" column, to accomodate date-and-time-based versions. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f97a887..2679b4f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-12-14 Steve Purcell (tiny change) + + * emacs-lisp/package.el (package-menu-mode): Use an extra column + for the "Version" column, to accomodate date-and-time-based + versions. + 2014-12-14 Cameron Desautels * cus-edit.el (custom-prompt-customize-unsaved-options): Add a diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index e424e30..cd948ae 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1702,7 +1702,7 @@ Letters do not insert themselves; instead, they are commands. \\{package-menu-mode-map}" (setq tabulated-list-format `[("Package" 18 package-menu--name-predicate) - ("Version" 12 nil) + ("Version" 13 nil) ("Status" 10 package-menu--status-predicate) ,@(if (cdr package-archives) '(("Archive" 10 package-menu--archive-predicate))) commit 4c4f970c8d10b346acc6d231f3755c1d1f5827fb Author: Cameron Desautels Date: Sun Dec 14 06:49:06 2014 -0500 Provide custom-prompt-customize-unsaved-options. * doc/emacs/custom.texi (Saving Customizations): Mention `custom-prompt-customize-unsaved-options'. * etc/NEWS: Mention `custom-prompt-customize-unsaved-options'. * etc/TODO: Remove its entry. * lisp/cus-edit.el (custom-prompt-customize-unsaved-options): Add a mechanism for prompting user about unsaved customizations. (Bug#19328) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 3ed8c13..cd46d9f 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2014-12-14 Cameron Desautels + + * custom.texi (Saving Customizations): Mention + `custom-prompt-customize-unsaved-options'. + 2014-12-08 Lars Magne Ingebrigtsen * misc.texi (Network Security): Mention the new protocol-level diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 0d0013f..6c392cb 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -405,6 +405,16 @@ customizations in your initialization file. This is because saving customizations from such a session would wipe out all the other customizations you might have on your initialization file. + Please note that any customizations you have not chosen to save for +future sessions will be lost when you terminate Emacs. If you'd like +to be prompted about unsaved customizations at termination time, add +the following to your initialization file: + +@example +(add-hook 'kill-emacs-query-functions + 'custom-prompt-customize-unsaved-options) +@end example + @node Face Customization @subsection Customizing Faces @cindex customizing faces diff --git a/etc/ChangeLog b/etc/ChangeLog index 0a22f9f..f344e24 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,9 @@ +2014-12-14 Cameron Desautels + + * NEWS: Mention `custom-prompt-customize-unsaved-options'. + + * TODO: Remove its entry. + 2014-12-13 Paul Eggert Convert Czech and Slovakian refcards to UTF-8 diff --git a/etc/NEWS b/etc/NEWS index 01c8431..37cb4b4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -54,6 +54,9 @@ so if you want to use it, you can always take a copy from an older Emacs. * Changes in Emacs 25.1 +** New function `custom-prompt-customize-unsaved-options' checks for +unsaved customizations and prompts user to customize (if found). + +++ ** Network security (TLS/SSL certificate validity and the like) is added via the new Network Security Manager (NSM) and controlled via diff --git a/etc/TODO b/etc/TODO index ccd00e5..cbb2394 100644 --- a/etc/TODO +++ b/etc/TODO @@ -419,12 +419,6 @@ rather than interactively. This a trivial one-liner in easy-mode.el. ** Make byte-optimization warnings issue accurate line numbers. -** A function to check for customizable options that have been - set but not saved, and ask the user whether to save them. - This could go in kill-emacs-query-functions, to remind people - to save their changes. If the user says yes, show them - in a Custom buffer using customize-customized. - ** Record the sxhash of the default value for customized variables and notify the user (maybe by adding a menu item or toolbar button, as the detection can occur during autoload time) when the default diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 75e8476..f97a887 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-12-14 Cameron Desautels + + * cus-edit.el (custom-prompt-customize-unsaved-options): Add a + mechanism for prompting user about unsaved customizations. + (Bug#19328) + 2014-12-14 Dmitry Gutov * fringe.el (fringe-bitmap-p): Fix 2014-12-05 breakage. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index c8e9b90..a6da50e 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1356,12 +1356,10 @@ suggest to customize that face, if it's customizable." (or (face-at-point t t) "all faces") t))) (customize-face face t)) -(defalias 'customize-customized 'customize-unsaved) - -;;;###autoload -(defun customize-unsaved () - "Customize all options and faces set in this session but not saved." - (interactive) +(defun custom-unsaved-options () + "List of options and faces set in this session but not saved. +Each entry is of the form (SYMBOL TYPE), where TYPE is one of the +symbols `custom-face' or `custom-variable'." (let ((found nil)) (mapatoms (lambda (symbol) (and (or (get symbol 'customized-face) @@ -1372,6 +1370,15 @@ suggest to customize that face, if it's customizable." (get symbol 'customized-variable-comment)) (boundp symbol) (push (list symbol 'custom-variable) found)))) + found)) + +(defalias 'customize-customized 'customize-unsaved) + +;;;###autoload +(defun customize-unsaved () + "Customize all options and faces set in this session but not saved." + (interactive) + (let ((found (custom-unsaved-options))) (if (not found) (error "No user options are set but unsaved") (custom-buffer-create (custom-sort-items found t nil) @@ -1477,6 +1484,16 @@ If TYPE is `groups', include only groups." (interactive (list (apropos-read-pattern "groups"))) (customize-apropos regexp 'groups)) +;;;###autoload +(defun custom-prompt-customize-unsaved-options () + "Prompt user to customize any unsaved customization options. +Return non-nil if user chooses to customize, for use in +`kill-emacs-query-functions'." + (not (and (custom-unsaved-options) + (yes-or-no-p "Some customized options have not been saved; Examine? ") + (customize-unsaved) + t))) + ;;; Buffer. (defcustom custom-buffer-style 'links commit f7572b72fd448c8ab6002bc6a545dfb765bbc520 Author: Dmitry Gutov Date: Sun Dec 14 12:59:05 2014 +0200 Fix Semantic completion-at-point functions in non-Semantic buffers Fixes: debbugs:19077 * lisp/cedet/semantic.el (semantic-analyze-completion-at-point-function) (semantic-analyze-notc-completion-at-point-function) (semantic-analyze-nolongprefix-completion-at-point-function): Do nothing if the current buffer is not using Semantic. diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index c132a42..46296d3 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog @@ -1,3 +1,10 @@ +2014-12-14 Dmitry Gutov + + * semantic.el (semantic-analyze-completion-at-point-function) + (semantic-analyze-notc-completion-at-point-function) + (semantic-analyze-nolongprefix-completion-at-point-function): Do + nothing if the current buffer is not using Semantic (bug#19077). + 2014-12-08 Matt Curtis (tiny change) * pulse.el (pulse-momentary-highlight-one-line): Respect the POINT diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index 6bd090c..50e2082 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el @@ -1174,17 +1174,18 @@ Semantic mode. "Return possible analysis completions at point. The completions provided are via `semantic-analyze-possible-completions'. This function can be used by `completion-at-point-functions'." - (let* ((ctxt (semantic-analyze-current-context)) - (possible (semantic-analyze-possible-completions ctxt))) - - ;; The return from this is either: - ;; nil - not applicable here. - ;; A list: (START END COLLECTION . PROPS) - (when possible - (list (car (oref ctxt bounds)) - (cdr (oref ctxt bounds)) - possible)) - )) + (when (semantic-active-p) + (let* ((ctxt (semantic-analyze-current-context)) + (possible (semantic-analyze-possible-completions ctxt))) + + ;; The return from this is either: + ;; nil - not applicable here. + ;; A list: (START END COLLECTION . PROPS) + (when possible + (list (car (oref ctxt bounds)) + (cdr (oref ctxt bounds)) + possible)) + ))) (defun semantic-analyze-notc-completion-at-point-function () "Return possible analysis completions at point. @@ -1192,14 +1193,15 @@ The completions provided are via `semantic-analyze-possible-completions', but with the 'no-tc option passed in, which means constraints based on what is being assigned to are ignored. This function can be used by `completion-at-point-functions'." - (let* ((ctxt (semantic-analyze-current-context)) - (possible (semantic-analyze-possible-completions ctxt 'no-tc))) + (when (semantic-active-p) + (let* ((ctxt (semantic-analyze-current-context)) + (possible (semantic-analyze-possible-completions ctxt 'no-tc))) - (when possible - (list (car (oref ctxt bounds)) - (cdr (oref ctxt bounds)) - possible)) - )) + (when possible + (list (car (oref ctxt bounds)) + (cdr (oref ctxt bounds)) + possible)) + ))) (defun semantic-analyze-nolongprefix-completion-at-point-function () "Return possible analysis completions at point. @@ -1207,15 +1209,16 @@ The completions provided are via `semantic-analyze-possible-completions', but with the 'no-tc and 'no-longprefix option passed in, which means constraints resulting in a long multi-symbol dereference are ignored. This function can be used by `completion-at-point-functions'." - (let* ((ctxt (semantic-analyze-current-context)) - (possible (semantic-analyze-possible-completions - ctxt 'no-tc 'no-longprefix))) - - (when possible - (list (car (oref ctxt bounds)) - (cdr (oref ctxt bounds)) - possible)) - )) + (when (semantic-active-p) + (let* ((ctxt (semantic-analyze-current-context)) + (possible (semantic-analyze-possible-completions + ctxt 'no-tc 'no-longprefix))) + + (when possible + (list (car (oref ctxt bounds)) + (cdr (oref ctxt bounds)) + possible)) + ))) ;;; Autoload some functions that are not in semantic/loaddefs commit 9f28cb59dc77213e1496f4ded40017739d734114 Author: Dmitry Gutov Date: Sun Dec 14 12:51:52 2014 +0200 * lisp/fringe.el (fringe-bitmap-p): Fix 2014-12-05 breakage. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cb43a9b..75e8476 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2014-12-14 Dmitry Gutov + * fringe.el (fringe-bitmap-p): Fix 2014-12-05 breakage. + +2014-12-14 Dmitry Gutov + Move ASYNC argument to the `diff' VC command to the fifth position, for better compatibility with existing third-party code, and document it. diff --git a/lisp/fringe.el b/lisp/fringe.el index 97a0393..51d6543 100644 --- a/lisp/fringe.el +++ b/lisp/fringe.el @@ -85,7 +85,7 @@ (defun fringe-bitmap-p (symbol) "Return non-nil if SYMBOL is a fringe bitmap." - `(get ,symbol 'fringe)) + (get symbol 'fringe)) ;; Control presence of fringes commit 01b97f9df2d94e1e1c31517e084bf8d76174e1d4 Author: Dmitry Gutov Date: Sun Dec 14 12:49:08 2014 +0200 Move VC diff ASYNC argument to the fifth position * lisp/vc/vc-svn.el (vc-svn-diff): * lisp/vc/vc-src.el (vc-src-diff): * lisp/vc/vc-sccs.el (vc-sccs-diff): * lisp/vc/vc-rcs.el (vc-rcs-diff): * lisp/vc/vc-mtn.el (vc-mtn-diff): * lisp/vc/vc-hg.el (vc-hg-diff): * lisp/vc/vc-git.el (vc-git-diff): * lisp/vc/vc-dav.el (vc-dav-diff): * lisp/vc/vc-cvs.el (vc-cvs-diff): * lisp/vc/vc-bzr.el (vc-bzr-diff): * lisp/obsolete/vc-arch.el (vc-arch-diff): Move ASYNC argument to the end. * lisp/vc/vc.el (vc-diff-internal): Pass `async' argument to the backend `diff' command in the last position. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 37f637b..cb43a9b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,24 @@ +2014-12-14 Dmitry Gutov + + Move ASYNC argument to the `diff' VC command to the fifth + position, for better compatibility with existing third-party code, + and document it. + + * vc/vc.el (vc-diff-internal): Pass `async' argument to the + backend `diff' command in the last position. + + * vc/vc-svn.el (vc-svn-diff): + * vc/vc-src.el (vc-src-diff): + * vc/vc-sccs.el (vc-sccs-diff): + * vc/vc-rcs.el (vc-rcs-diff): + * vc/vc-mtn.el (vc-mtn-diff): + * vc/vc-hg.el (vc-hg-diff): + * vc/vc-git.el (vc-git-diff): + * vc/vc-dav.el (vc-dav-diff): + * vc/vc-cvs.el (vc-cvs-diff): + * vc/vc-bzr.el (vc-bzr-diff): + * obsolete/vc-arch.el (vc-arch-diff): Move ASYNC argument to the end. + 2014-12-13 Andreas Schwab * net/shr.el (shr-next-link): Don't error out at eob. diff --git a/lisp/obsolete/vc-arch.el b/lisp/obsolete/vc-arch.el index d1344f2..c1ac505 100644 --- a/lisp/obsolete/vc-arch.el +++ b/lisp/obsolete/vc-arch.el @@ -448,7 +448,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see (vc-arch-command nil 0 files "commit" "-s" summary "-L" comment "--" (vc-switches 'Arch 'checkin)))) -(defun vc-arch-diff (files &optional async oldvers newvers buffer) +(defun vc-arch-diff (files &optional oldvers newvers buffer async) "Get a difference report using Arch between two versions of FILES." ;; FIXME: This implementation only works for singleton filesets. To make ;; it work for more cases, we have to either call `file-diffs' manually on diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 1963f4e..de10164 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -767,7 +767,7 @@ If LIMIT is non-nil, show no more than this many entries." (autoload 'vc-switches "vc") -(defun vc-bzr-diff (files &optional async rev1 rev2 buffer) +(defun vc-bzr-diff (files &optional rev1 rev2 buffer async) "VC bzr backend for diff." (let* ((switches (vc-switches 'bzr 'diff)) (args diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index a5b50c1..c1d32ce 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -569,7 +569,7 @@ Remaining arguments are ignored." (autoload 'vc-version-backup-file "vc") (declare-function vc-coding-system-for-diff "vc" (file)) -(defun vc-cvs-diff (files &optional async oldvers newvers buffer) +(defun vc-cvs-diff (files &optional oldvers newvers buffer async) "Get a difference report using CVS between two revisions of FILE." (let* (process-file-side-effects (async (and async (vc-cvs-stay-local-p files))) diff --git a/lisp/vc/vc-dav.el b/lisp/vc/vc-dav.el index 4c3fe6a..f107764 100644 --- a/lisp/vc/vc-dav.el +++ b/lisp/vc/vc-dav.el @@ -117,7 +117,7 @@ only needs to update the status of URL within the backend. "Insert the revision log of URL into the *vc* buffer." ) -(defun vc-dav-diff (url &optional async rev1 rev2) +(defun vc-dav-diff (url &optional rev1 rev2 buffer async) "Insert the diff for URL into the *vc-diff* buffer. If REV1 and REV2 are non-nil report differences from REV1 to REV2. If REV1 is nil, use the current workfile version as the older version. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index c41dde1..65f683c 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -78,7 +78,7 @@ ;; - show-log-entry (revision) OK ;; - comment-history (file) ?? ;; - update-changelog (files) COULD BE SUPPORTED -;; * diff (file &optional rev1 rev2 buffer) OK +;; * diff (file &optional rev1 rev2 buffer async) OK ;; - revision-completion-table (files) OK ;; - annotate-command (file buf &optional rev) OK ;; - annotate-time () OK @@ -977,7 +977,7 @@ or BRANCH^ (where \"^\" can be repeated)." (autoload 'vc-switches "vc") -(defun vc-git-diff (files &optional async rev1 rev2 buffer) +(defun vc-git-diff (files &optional rev1 rev2 buffer async) "Get a difference report using Git between two revisions of FILES." (let (process-file-side-effects) (if vc-git-diff-switches diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 0d9f9f1..e65009d 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -313,7 +313,7 @@ If LIMIT is non-nil, show no more than this many entries." (autoload 'vc-switches "vc") -(defun vc-hg-diff (files &optional async oldvers newvers buffer) +(defun vc-hg-diff (files &optional oldvers newvers buffer async) "Get a difference report using hg between two revisions of FILES." (let* ((firstfile (car files)) (working (and firstfile (vc-working-revision firstfile)))) diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index 7d2f734..d1736a4 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el @@ -236,7 +236,7 @@ If LIMIT is non-nil, show no more than this many entries." (autoload 'vc-switches "vc") -(defun vc-mtn-diff (files &optional async rev1 rev2 buffer) +(defun vc-mtn-diff (files &optional rev1 rev2 buffer async) "Get a difference report using monotone between two revisions of FILES." (apply 'vc-mtn-command (or buffer "*vc-diff*") (if async 'async 1) diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index 8866bdb..cb3d36f 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el @@ -535,7 +535,7 @@ files beneath it." (vc-rcs-print-log-cleanup)) (when limit 'limit-unsupported)) -(defun vc-rcs-diff (files &optional async oldvers newvers buffer) +(defun vc-rcs-diff (files &optional oldvers newvers buffer async) "Get a difference report using RCS between two sets of files." (apply #'vc-do-command (or buffer "*vc-diff*") (if async 'async 1) diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el index 6362864..cfd3ccc 100644 --- a/lisp/vc/vc-sccs.el +++ b/lisp/vc/vc-sccs.el @@ -316,7 +316,7 @@ Remaining arguments are ignored." (defvar w32-quote-process-args) ;; FIXME use sccsdiff if present? -(defun vc-sccs-diff (files &optional _async oldvers newvers buffer) +(defun vc-sccs-diff (files &optional oldvers newvers buffer _async) "Get a difference report using SCCS between two filesets." (setq files (vc-expand-dirs files 'SCCS)) (setq oldvers (vc-sccs-lookup-triple (car files) oldvers)) diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el index 539437d..50c0a7e 100644 --- a/lisp/vc/vc-src.el +++ b/lisp/vc/vc-src.el @@ -288,7 +288,7 @@ If LIMIT is non-nil, show no more than this many entries." (when limit (list "-l" (format "%s" limit))) vc-src-log-switches))))) -(defun vc-src-diff (files &optional _async oldvers newvers buffer) +(defun vc-src-diff (files &optional oldvers newvers buffer _async) "Get a difference report using src between two revisions of FILES." (let* ((firstfile (car files)) (working (and firstfile (vc-working-revision firstfile)))) diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 5db2676..eedccd8 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -548,7 +548,7 @@ If LIMIT is non-nil, show no more than this many entries." (if start-revision (format "-r%s" start-revision) "-rHEAD:0")) (when limit (list "--limit" (format "%s" limit))))))))) -(defun vc-svn-diff (files &optional async oldvers newvers buffer) +(defun vc-svn-diff (files &optional oldvers newvers buffer async) "Get a difference report using SVN between two revisions of fileset FILES." (and oldvers (not newvers) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index b8be3ff..954b3cf 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -362,10 +362,10 @@ ;; default implementation runs rcs2log, which handles RCS- and ;; CVS-style logs. ;; -;; * diff (files &optional async rev1 rev2 buffer) +;; * diff (files &optional rev1 rev2 buffer async) ;; ;; Insert the diff for FILE into BUFFER, or the *vc-diff* buffer if -;; BUFFER is nil. If ASYNC is non-nil, run asynchronously.If REV1 +;; BUFFER is nil. If ASYNC is non-nil, run asynchronously. If REV1 ;; and REV2 are non-nil, report differences from REV1 to REV2. If ;; REV1 is nil, use the working revision (as found in the ;; repository) as the older revision; if REV2 is nil, use the @@ -552,7 +552,7 @@ ;; revision been even possible, let alone sane. ;; ;; INCOMPATIBLE CHANGE: In older versions of the API, vc-diff did -;; not take an async-mode flag as a first optional argument. (This +;; not take an async-mode flag as a fourth optional argument. (This ;; change eliminated a particularly ugly global.) ;; ;; - INCOMPATIBLE CHANGE: The backend operation for non-distributed @@ -1691,7 +1691,7 @@ Return t if the buffer had changes, nil otherwise." (if async 'async 1) "diff" file (append (vc-switches nil 'diff) '("/dev/null")))))) (setq files (nreverse filtered)))) - (vc-call-backend (car vc-fileset) 'diff files async rev1 rev2 buffer) + (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer async) (set-buffer buffer) (diff-mode) (set (make-local-variable 'diff-vc-backend) (car vc-fileset))