From 4e20c8f22031d6f19e70f0dfcb11c09606446d88 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Fri, 22 Dec 2017 12:27:05 +0000 Subject: [PATCH 1/9] Fix menu keyboard shortcuts on macOS (Bug#29595) * src/nsmenu.m (addItemWithWidgetValue)[NS_IMPL_COCOA]: It looks like macOS 10.13 no longer ignores long modifier strings, so explicitly use an empty string. --- src/nsmenu.m | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/nsmenu.m b/src/nsmenu.m index 20b4e58b479..604adcf40b5 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -643,14 +643,23 @@ - (NSMenuItem *)addItemWithWidgetValue: (void *)wvptr keyEq = [self parseKeyEquiv: wv->key]; #ifdef NS_IMPL_COCOA - /* macOS just ignores modifier strings longer than one character */ + /* macOS mangles modifier strings longer than one character. */ if (keyEquivModMask == 0) - title = [title stringByAppendingFormat: @" (%@)", keyEq]; + { + title = [title stringByAppendingFormat: @" (%@)", keyEq]; + item = [self addItemWithTitle: (NSString *)title + action: @selector (menuDown:) + keyEquivalent: @""]; + } + else + { +#endif + item = [self addItemWithTitle: (NSString *)title + action: @selector (menuDown:) + keyEquivalent: keyEq]; +#ifdef NS_IMPL_COCOA + } #endif - - item = [self addItemWithTitle: (NSString *)title - action: @selector (menuDown:) - keyEquivalent: keyEq]; [item setKeyEquivalentModifierMask: keyEquivModMask]; [item setEnabled: wv->enabled]; From c59ecb005e560420d927ad7884c9030ba15319a4 Mon Sep 17 00:00:00 2001 From: Ross Donaldson Date: Mon, 25 Dec 2017 12:51:19 -0800 Subject: [PATCH 2/9] New customization variable for python-mode indentation (Bug#28475) * lisp/progmodes/python.el (python-indent-def-block-scale): New variable. (python-indent--calculate-indentation): Let it control how many indent levels are inserted for multi-line function signatures. Copyright-paperwork-exempt: yes --- etc/NEWS | 7 +++++++ lisp/progmodes/python.el | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 55385f59a80..b4c489cf7bd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1037,6 +1037,13 @@ located and whether GnuPG's option '--homedir' is used or not. --- *** Deleting a package no longer respects 'delete-by-moving-to-trash'. +** Python + ++++ +*** The new variable 'python-indent-def-block-scale' has been added. +It controls the depth of indentation of arguments inside multi-line +function signatures. + ** Tramp +++ diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 68926b275ea..5baf6e0f80a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -752,6 +752,12 @@ It makes underscores and dots word constituent chars.") :type '(repeat symbol) :group 'python) +(defcustom python-indent-def-block-scale 2 + "Multiplier applied to indentation inside multi-line def blocks." + :version "26.1" + :type 'integer + :safe 'natnump) + (defvar python-indent-current-level 0 "Deprecated var available for compatibility.") @@ -1071,9 +1077,9 @@ possibilities can be narrowed to specific indentation points." (current-indentation))) opening-block-start-points)))) (`(,(or :inside-paren-newline-start-from-block) . ,start) - ;; Add two indentation levels to make the suite stand out. (goto-char start) - (+ (current-indentation) (* python-indent-offset 2)))))) + (+ (current-indentation) + (* python-indent-offset python-indent-def-block-scale)))))) (defun python-indent--calculate-levels (indentation) "Calculate levels list given INDENTATION. From a5256da588627155e873f56119686d80007d84f9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 1 Jan 2018 18:28:53 +0200 Subject: [PATCH 3/9] Update PROBLEMS with selection-related issues * etc/PROBLEMS: Update the entry about large selections and klipper. (Bug#29661) --- etc/PROBLEMS | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 2f6802948dd..32f12eab62e 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -1049,6 +1049,19 @@ commands show above to make them modifier keys. Note that if you have Alt keys but no Meta keys, Emacs translates Alt into Meta. This is because of the great importance of Meta in Emacs. +*** Emacs hangs or crashes when a large portion of text is selected or killed. + +This is caused by a bug in the clipboard management applets (it has +been observed in 'klipper' and 'clipit'), which periodically request +the X clipboard contents from applications. After a while, Emacs may +print a message: + + Timed out waiting for property-notify event + +A workaround is to not use 'klipper'/'clipit'. Upgrading 'klipper' to +the one coming with KDE 3.3 or later might solve the problem; if it +doesn't, set 'select-active-regions' to 'only' or nil. + ** Window-manager and toolkit-related problems *** Emacs built with GTK+ toolkit produces corrupted display on HiDPI screen @@ -1153,19 +1166,6 @@ It is also reported that a bug in the gtk-engines-qt engine can cause this if Emacs is compiled with Gtk+. The bug is fixed in version 0.7 or newer of gtk-engines-qt. -*** KDE: Emacs hangs on KDE when a large portion of text is killed. - -This is caused by a bug in the KDE applet 'klipper' which periodically -requests the X clipboard contents from applications. Early versions -of klipper don't implement the ICCCM protocol for large selections, -which leads to Emacs being flooded with selection requests. After a -while, Emacs may print a message: - - Timed out waiting for property-notify event - -A workaround is to not use 'klipper'. Upgrading 'klipper' to the one -coming with KDE 3.3 or later also solves the problem. - *** KDE / Plasma 5: Emacs exhausts memory and needs to be killed This problem occurs when large selections contain mixed line endings From b87a77261246048c16e0b051335ea36de3ba5855 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 1 Jan 2018 18:36:28 +0200 Subject: [PATCH 4/9] Fix description of 'emacs-internal' * doc/lispref/nonascii.texi (Coding System Basics): Correct inaccuracy in description of 'emacs-internal'. (Bug#29916) --- doc/lispref/nonascii.texi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index 9d6fc6ca72a..2fd2bbc1ce5 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi @@ -1112,7 +1112,9 @@ represented in the internal Emacs encoding (@pxref{Text Representations}). This is like @code{raw-text} in that no code conversion happens, but different in that the result is multibyte data. The name @code{emacs-internal} is an alias for -@code{utf-8-emacs}. +@code{utf-8-emacs-unix} (so it forces no conversion of end-of-line, +unlike @code{utf-8-emacs}, which can decode all 3 kinds of +end-of-line conventions). @defun coding-system-get coding-system property This function returns the specified property of the coding system From ed44d92fa6e7f52293bd2c8db44d9672f3cbb855 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 2 Jan 2018 21:24:34 +0200 Subject: [PATCH 5/9] * lisp/textmodes/picture.el (picture-open-line): Doc fix. (Bug#29948) --- lisp/textmodes/picture.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index caf76a41a1a..f5a6a254a0d 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -338,8 +338,9 @@ always moves to the beginning of a line." (newline lines-left)))) (defun picture-open-line (arg) - "Insert an empty line after the current line. -With positive argument insert that many lines." + "Insert ARG empty lines after the current line. +ARG must be positive. +Interactively, ARG is the numeric argument, and defaults to 1." (interactive "p") (save-excursion (end-of-line) From ab31bf3c5f207dbc209bac350262137f48db4037 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 2 Jan 2018 21:34:58 +0200 Subject: [PATCH 6/9] * lisp/textmodes/picture.el (picture-mode-exit): Doc fix. (Bug#29949) --- lisp/textmodes/picture.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index f5a6a254a0d..6836fd09a07 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -789,8 +789,9 @@ they are not by default assigned to keys." (defun picture-mode-exit (&optional nostrip) "Undo `picture-mode' and return to previous major mode. -With no argument, strip whitespace from end of every line in Picture buffer; - otherwise, just return to previous mode. +With NOSTRIP omitted or nil, strip whitespace from end of every line + in Picture buffer; otherwise, just return to previous mode. +Interactively, NOSTRIP is the prefix argument, and defaults to nil. Runs `picture-mode-exit-hook' at the end." (interactive "P") (if (not (eq major-mode 'picture-mode)) From 43e2aafae306d9f7a463cba301d0253db846e20d Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Mon, 18 Dec 2017 20:30:10 -0500 Subject: [PATCH 7/9] Don't bind dframe events on load (Bug#29599) * lisp/dframe.el (dframe-setup-hook): New hook. (dframe-set-special-events): New function, containing previous top-level key binding code. (top-level): Add it to dframe-setup-hook. (dframe-frame-mode): Run the hook. --- lisp/dframe.el | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/lisp/dframe.el b/lisp/dframe.el index 9b0e550728a..12cedaf5201 100644 --- a/lisp/dframe.el +++ b/lisp/dframe.el @@ -288,6 +288,7 @@ CREATE-HOOK is a hook to run after creating a frame." (set frame-var nil)) ;; Set this as our currently attached frame (setq dframe-attached-frame (selected-frame)) + (run-hooks 'dframe-setup-hook) (run-hooks popup-hook) ;; Updated the buffer passed in to contain all the hacks needed ;; to make it work well in a dedicated window. @@ -543,16 +544,21 @@ CACHE-VAR and BUFFER-VAR are symbols as in `dframe-frame-mode'." ))) ;;; Special frame event proxies -;; -(if (boundp 'special-event-map) - (progn - (define-key special-event-map [make-frame-visible] - 'dframe-handle-make-frame-visible) - (define-key special-event-map [iconify-frame] - 'dframe-handle-iconify-frame) - (define-key special-event-map [delete-frame] - 'dframe-handle-delete-frame)) - ) +(defvar dframe-setup-hook nil + "Used for setting frame special event bindings.") + +(defun dframe-set-special-events () + (define-key special-event-map [make-frame-visible] + 'dframe-handle-make-frame-visible) + (define-key special-event-map [iconify-frame] + 'dframe-handle-iconify-frame) + (define-key special-event-map [delete-frame] + 'dframe-handle-delete-frame) + ;; Only need to run once. + (remove-hook 'dframe-setup-hook #'dframe-set-special-events)) + +(when (boundp 'special-event-map) + (add-hook 'dframe-setup-hook #'dframe-set-special-events)) (defvar dframe-make-frame-visible-function nil "Function used when a dframe controlled frame is de-iconified. From 687af4c8e88a4abc004f6afb00fc724d38a12712 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 3 Jan 2018 15:33:08 -0500 Subject: [PATCH 8/9] * lisp/vc/vc.el (vc-region-history): log-view-vc-fileset holds a list! --- lisp/vc/vc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 7c502f88df9..f8d63d1498a 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2428,7 +2428,7 @@ When called interactively with a prefix argument, prompt for REMOTE-LOCATION." (with-current-buffer buf (vc-call-backend backend 'region-history-mode) (set (make-local-variable 'log-view-vc-backend) backend) - (set (make-local-variable 'log-view-vc-fileset) file) + (set (make-local-variable 'log-view-vc-fileset) (list file)) (set (make-local-variable 'revert-buffer-function) (lambda (_ignore-auto _noconfirm) (with-current-buffer buf From d382d2bfc5072d4220b3e51785d22f70b147d63f Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" Date: Thu, 4 Jan 2018 21:27:26 +0100 Subject: [PATCH 9/9] * etc/DEBUG (Getting control to the debugger): Fix grammar. --- etc/DEBUG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/DEBUG b/etc/DEBUG index 81de77285a9..7171d6db256 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -200,7 +200,7 @@ errors go through there. If you are only interested in errors that would fire the Lisp debugger, breaking at 'maybe_call_debugger' is useful. -Another technique for get control to the debugger is to put a +Another technique for getting control to the debugger is to put a breakpoint in some rarely used function. One such convenient function is Fredraw_display, which you can invoke at will interactively with "M-x redraw-display RET".