commit d8f03d82760107115bcc63a461b78a53fdd2882b (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Sat Nov 16 09:04:53 2019 +0100 Do not report move frame events for tooltip frames (Bug#38213) * src/w32term.c (w32_read_socket): * src/xterm.c (handle_one_xevent): Do not report move frame events for tooltip frames (Bug#38213). diff --git a/src/w32term.c b/src/w32term.c index d0537c67e9..17bf408c20 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5314,7 +5314,8 @@ w32_read_socket (struct terminal *terminal, case WM_MOVE: f = w32_window_to_frame (dpyinfo, msg.msg.hwnd); - if (f && FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P(f)) + if (f && FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P(f) + && !FRAME_TOOLTIP_P (f)) { w32_real_positions (f, &f->left_pos, &f->top_pos); inev.kind = MOVE_FRAME_EVENT; diff --git a/src/xterm.c b/src/xterm.c index f7005804f0..d55bc3890d 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9032,7 +9032,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, unblock_input (); } - if (old_left != f->left_pos || old_top != f->top_pos) + if (!FRAME_TOOLTIP_P (f) + && (old_left != f->left_pos || old_top != f->top_pos)) { inev.ie.kind = MOVE_FRAME_EVENT; XSETFRAME (inev.ie.frame_or_window, f); commit d03915650e110b0241d44f8283d665506455aed6 Author: Michael Orlitzky Date: Sat Nov 16 08:15:48 2019 +0100 tex-mode: paragraph separator groups text and comments * lisp/textmodes/tex-mode.el (latex-mode): Don't wrap text with leading spaces into preceding comments (bug#38152). Copyright-paperwork-exempt: yes diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 9b92a2fc60..5f2c7ee9fe 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1153,7 +1153,7 @@ subshell is initiated, `tex-shell-hook' is run." "\\>\\|\\\\[a-z]*" (regexp-opt '("space" "skip" "page") t) "\\>\\)")) (setq paragraph-separate - (concat "[\f%]\\|[ \t]*\\($\\|" + (concat "\\([ \t]*%\\)\\|[\f]\\|[ \t]*\\($\\|" "\\\\[][]\\|" "\\\\" (regexp-opt (append (mapcar #'car latex-section-alist) commit 246f050ab4ba0ec9b12f03ddfa7ee3f74030f850 Author: Lars Ingebrigtsen Date: Sat Nov 16 06:11:56 2019 +0100 Don't move point on undefined keystrokes in the article buffer * lisp/gnus/gnus-art.el (gnus-article-read-summary-keys): Don't move point on undefined commands (bug#38227). diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 99f2371363..cfb185b3d1 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -6678,43 +6678,41 @@ not have a face in `gnus-article-boring-faces'." "An" "Ap" [?A (meta return)] [?A delete])) (nosave-in-article '("AS" "\C-d")) - keys new-sum-point) + keys new-sum-point gnus-pick-mode func) (with-current-buffer gnus-article-current-summary - (let (gnus-pick-mode) - (setq unread-command-events (nconc unread-command-events - (list (or key last-command-event))) - keys (read-key-sequence nil t)))) + (setq unread-command-events (nconc unread-command-events + (list (or key last-command-event))) + keys (read-key-sequence nil t) + func (key-binding keys t))) (message "") + (when (eq func 'undefined) + (error "%s is undefined" keys)) + (cond ((eq (aref keys (1- (length keys))) ?\C-h) (gnus-article-describe-bindings (substring keys 0 -1))) ((or (member keys nosaves) (member keys nosave-but-article) (member keys nosave-in-article)) - (let (func) - (with-current-buffer gnus-article-current-summary - ;; We disable the pick minor mode commands. - (let (gnus-pick-mode) - (setq func (key-binding keys t)))) - (if (or (not func) - (numberp func)) - (ding) - (unless (member keys nosave-in-article) - (set-buffer gnus-article-current-summary)) - (when (and (symbolp func) - (get func 'disabled)) - (error "Function %s disabled" func)) - (call-interactively func) - (setq new-sum-point (point))) - (when (member keys nosave-but-article) - (pop-to-buffer gnus-article-buffer)))) + (if (or (not func) + (numberp func)) + (ding) + (unless (member keys nosave-in-article) + (set-buffer gnus-article-current-summary)) + (when (and (symbolp func) + (get func 'disabled)) + (error "Function %s disabled" func)) + (call-interactively func) + (setq new-sum-point (point))) + (when (member keys nosave-but-article) + (pop-to-buffer gnus-article-buffer))) (t ;; These commands should restore window configuration. (let ((obuf (current-buffer)) (owin (current-window-configuration)) - win func in-buffer selected new-sum-start new-sum-hscroll err) + win in-buffer selected new-sum-start new-sum-hscroll err) (cond (not-restore-window (pop-to-buffer gnus-article-current-summary) (setq win (selected-window))) @@ -6733,9 +6731,6 @@ not have a face in `gnus-article-boring-faces'." (select-frame-set-input-focus (window-frame win)) (select-window win)))) (setq in-buffer (current-buffer)) - ;; We disable the pick minor mode commands. - (setq func (let (gnus-pick-mode) - (key-binding keys t))) (when (and (symbolp func) (get func 'disabled)) (error "Function %s disabled" func)) commit 461101d67cc5f9f9dbe01ac0406c5c9762adf10c Author: Lars Ingebrigtsen Date: Sat Nov 16 05:33:17 2019 +0100 Make button-1 work on all Gnus buttons * lisp/gnus/gnus-icalendar.el (gnus-icalendar-insert-button): * lisp/gnus/gnus-art.el (gnus-insert-mime-button) (gnus-mime-display-alternative, gnus-insert-prev-page-button) (gnus-insert-next-page-button) (gnus-insert-mime-security-button): Make button-1 work on all the Gnus buttons (bug#38144). diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index ff365ed686..99f2371363 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -5864,6 +5864,7 @@ all parts." b e 'keymap gnus-mime-button-map 'face gnus-article-button-face + 'follow-link t 'help-echo "mouse-2: toggle the MIME part; down-mouse-3: more options"))) @@ -6147,6 +6148,7 @@ If nil, don't show those extra buttons." keymap ,gnus-mime-button-map mouse-face ,gnus-article-mouse-face face ,gnus-article-button-face + follow-link t gnus-part ,id button t article-type multipart @@ -6170,6 +6172,7 @@ If nil, don't show those extra buttons." keymap ,gnus-mime-button-map mouse-face ,gnus-article-mouse-face face ,gnus-article-button-face + follow-link t gnus-part ,id button t gnus-data ,handle @@ -8404,6 +8407,7 @@ url is put as the `gnus-button-url' overlay property on the button." gnus-prev-page-line-format nil `(keymap ,gnus-prev-page-map gnus-prev t + follow-link t gnus-callback gnus-article-button-prev-page article-type annotation)) (setq e (if (bolp) @@ -8435,6 +8439,7 @@ url is put as the `gnus-button-url' overlay property on the button." (gnus-eval-format gnus-next-page-line-format nil `(keymap ,gnus-next-page-map gnus-next t + follow-link t gnus-callback gnus-article-button-next-page article-type annotation)) (setq e (if (bolp) @@ -8822,11 +8827,12 @@ For example: gnus-mime-security-button-line-format gnus-mime-security-button-line-format-alist `(keymap ,gnus-mime-security-button-map - gnus-callback gnus-mime-security-press-button - gnus-line-format ,gnus-mime-security-button-line-format - gnus-mime-details ,gnus-mime-security-button-pressed - article-type annotation - gnus-data ,handle)) + gnus-callback gnus-mime-security-press-button + gnus-line-format ,gnus-mime-security-button-line-format + gnus-mime-details ,gnus-mime-security-button-pressed + article-type annotation + follow-link t + gnus-data ,handle)) (setq e (if (bolp) ;; Exclude a newline. (1- (point)) diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el index 77e73e6606..f836bdd3c5 100644 --- a/lisp/gnus/gnus-icalendar.el +++ b/lisp/gnus/gnus-icalendar.el @@ -778,6 +778,7 @@ These will be used to retrieve the RSVP information from ical events." ,callback keymap ,gnus-mime-button-map face ,gnus-article-button-face + follow-link t button t gnus-data ,data)))) commit a53c5e6474eab1da7f56f35d823c02c4930f1778 Author: Lars Ingebrigtsen Date: Sat Nov 16 05:27:33 2019 +0100 Make it clear what edebug-remove-instrumentation offers * doc/lispref/edebug.texi (Instrumenting): Reword the description of the edebug-remove-instrumentation command. diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index e1147df8af..60d4c08432 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -231,8 +231,10 @@ evaluating forms that never instrument them: from a file with (@kbd{M-:}). @findex edebug-remove-instrumentation - If you want to remove Edebug instrumentation from all functions, you -can use the @code{edebug-remove-instrumentation} command. + A different way to remove the instrumentation from a definition is +to use the @code{edebug-remove-instrumentation} command. It also +allows removing the instrumentation from everything that has been +instrumented. @xref{Edebug Eval}, for other evaluation functions available inside of Edebug. commit 5ed66f10ecae232e1af321913b22fc3ecf0608c7 Author: Paul Eggert Date: Fri Nov 15 18:40:45 2019 -0800 Port new float-scaling code to Solaris * src/floatfns.c (double_integer_scale): Simplify, so that the function works when (FP_ILOGBNAN == INT_MAX && FP_ILOGB0 == INT_MIN), as on Solaris. diff --git a/src/floatfns.c b/src/floatfns.c index 30526a1644..73d84301e4 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -350,10 +350,7 @@ double_integer_scale (double d) return (DBL_MIN_EXP - 1 <= exponent && exponent < INT_MAX ? DBL_MANT_DIG - 1 - exponent : (DBL_MANT_DIG - DBL_MIN_EXP - + ((exponent == FP_ILOGBNAN - && (FP_ILOGBNAN != FP_ILOGB0 || isnan (d))) - ? 2 - : exponent == INT_MAX))); + + (isnan (d) ? 2 : exponent == INT_MAX))); } /* Convert the Lisp number N to an integer and return a pointer to the commit c793395cca70e6a673dc4dd910ea93c7b5dcee80 Author: Phil Sainty Date: Sat Nov 16 12:12:36 2019 +1300 ; * lisp/so-long.el: Silence byte-compiler warnings diff --git a/lisp/so-long.el b/lisp/so-long.el index 78fa32508a..7d54594dd3 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -421,6 +421,9 @@ (declare-function outline-toggle-children "outline") (declare-function outline-toggle-children "outline") +(declare-function ad-find-advice "advice") +(declare-function ad-remove-advice "advice") + (defvar so-long-enabled nil "Set to nil to prevent `so-long' from being triggered automatically. commit 7fea1a3f2656c69f4de99d092680f7a917d8426f Author: João Távora Date: Fri Nov 15 20:27:18 2019 +0000 Make icomplete-tidy-shadowed-file-names less aggressive When using this option and editing input, some transient situations may arise that lead to file-name shadowing, but that shouldn't necessarily lead to auto-delete behaviour, which will be suprising. In '/foo/x/bar', if the user deletes the 'x', shadowing occurs, but probably shouldn't. So, somewhat like ido-mode, only auto-tidy shadowed file names if the user is inserting text at end of input. * lisp/icomplete.el (icomplete-exhibit): Check this-command. (icomplete-tidy-shadowed-file-names): Tweak docstring. diff --git a/lisp/icomplete.el b/lisp/icomplete.el index a732d4cc0d..8410ca5c3e 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -69,7 +69,7 @@ When nil, show candidates in full." :version "24.4") (defvar icomplete-tidy-shadowed-file-names nil - "If non-nil, delete superflous parts of input file names. + "If non-nil, automatically delete superflous parts of file names. For example, if the user types ~/ after a long path name, everything preceding the ~/ is discarded so the interactive selection process starts again from the user's $HOME.") @@ -463,58 +463,61 @@ Should be run via minibuffer `post-command-hook'. See `icomplete-mode' and `minibuffer-setup-hook'." (when (and icomplete-mode (icomplete-simple-completing-p)) ;Shouldn't be necessary. - (save-excursion - (goto-char (point-max)) + (let ((saved-point (point))) + (save-excursion + (goto-char (point-max)) ; Insert the match-status information: - (when (and (or icomplete-show-matches-on-no-input - (> (icomplete--field-end) (icomplete--field-beg))) - (or - ;; Don't bother with delay after certain number of chars: - (> (- (point) (icomplete--field-beg)) - icomplete-max-delay-chars) - ;; Don't delay if the completions are known. - completion-all-sorted-completions - ;; Don't delay if alternatives number is small enough: - (and (sequencep (icomplete--completion-table)) - (< (length (icomplete--completion-table)) - icomplete-delay-completions-threshold)) - ;; Delay - give some grace time for next keystroke, before - ;; embarking on computing completions: - (sit-for icomplete-compute-delay))) - (when (and - icomplete-tidy-shadowed-file-names - (eq (alist-get 'category - (cdr (completion--field-metadata - (icomplete--field-beg)))) - 'file) - rfn-eshadow-overlay (overlay-buffer rfn-eshadow-overlay) - (or (>= (- (point) (overlay-end rfn-eshadow-overlay)) 2) - (eq ?/ (char-before (- (point) 2))))) - (delete-region (overlay-start rfn-eshadow-overlay) - (overlay-end rfn-eshadow-overlay)) ) - (let* ((field-string (icomplete--field-string)) - ;; Not sure why, but such requests seem to come - ;; every once in a while. It's not fully - ;; deterministic but `C-x C-f M-DEL M-DEL ...' - ;; seems to trigger it fairly often! - (while-no-input-ignore-events '(selection-request)) - (text (while-no-input - (icomplete-completions - field-string - (icomplete--completion-table) - (icomplete--completion-predicate) - (if (window-minibuffer-p) - (not minibuffer-completion-confirm))))) - (buffer-undo-list t) - deactivate-mark) - ;; Do nothing if while-no-input was aborted. - (when (stringp text) - (move-overlay icomplete-overlay (point) (point) (current-buffer)) - ;; The current C cursor code doesn't know to use the overlay's - ;; marker's stickiness to figure out whether to place the cursor - ;; before or after the string, so let's spoon-feed it the pos. - (put-text-property 0 1 'cursor t text) - (overlay-put icomplete-overlay 'after-string text))))))) + (when (and (or icomplete-show-matches-on-no-input + (> (icomplete--field-end) (icomplete--field-beg))) + (or + ;; Don't bother with delay after certain number of chars: + (> (- (point) (icomplete--field-beg)) + icomplete-max-delay-chars) + ;; Don't delay if the completions are known. + completion-all-sorted-completions + ;; Don't delay if alternatives number is small enough: + (and (sequencep (icomplete--completion-table)) + (< (length (icomplete--completion-table)) + icomplete-delay-completions-threshold)) + ;; Delay - give some grace time for next keystroke, before + ;; embarking on computing completions: + (sit-for icomplete-compute-delay))) + (when (and + icomplete-tidy-shadowed-file-names + (eq (alist-get 'category + (cdr (completion--field-metadata + (icomplete--field-beg)))) + 'file) + rfn-eshadow-overlay (overlay-buffer rfn-eshadow-overlay) + (eq this-command 'self-insert-command) + (= saved-point (icomplete--field-end)) + (or (>= (- (point) (overlay-end rfn-eshadow-overlay)) 2) + (eq ?/ (char-before (- (point) 2))))) + (delete-region (overlay-start rfn-eshadow-overlay) + (overlay-end rfn-eshadow-overlay)) ) + (let* ((field-string (icomplete--field-string)) + ;; Not sure why, but such requests seem to come + ;; every once in a while. It's not fully + ;; deterministic but `C-x C-f M-DEL M-DEL ...' + ;; seems to trigger it fairly often! + (while-no-input-ignore-events '(selection-request)) + (text (while-no-input + (icomplete-completions + field-string + (icomplete--completion-table) + (icomplete--completion-predicate) + (if (window-minibuffer-p) + (not minibuffer-completion-confirm))))) + (buffer-undo-list t) + deactivate-mark) + ;; Do nothing if while-no-input was aborted. + (when (stringp text) + (move-overlay icomplete-overlay (point) (point) (current-buffer)) + ;; The current C cursor code doesn't know to use the overlay's + ;; marker's stickiness to figure out whether to place the cursor + ;; before or after the string, so let's spoon-feed it the pos. + (put-text-property 0 1 'cursor t text) + (overlay-put icomplete-overlay 'after-string text)))))))) ;;;_ > icomplete-completions (name candidates predicate require-match) (defun icomplete-completions (name candidates predicate require-match) commit 87347a5bbc2f044c51feea8d513fb1dcefa6f50e Author: Stefan Monnier Date: Fri Nov 15 13:19:21 2019 -0500 * lisp/progmodes/perl-mode.el (perl-calculate-indent): Indent qw(...) Fix initialization of `state`. Special-case `qw(...)` because we do want to indent its contents. diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index ab3680bfb7..2dcd040627 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -935,15 +935,24 @@ changed by, or (parse-state) if line starts in a quoted string." In usual case returns an integer: the column to indent to. Returns (parse-state) if line starts inside a string." (save-excursion - (let ((indent-point (point)) - (case-fold-search nil) - (colon-line-end 0) - prev-char - state containing-sexp) - (setq containing-sexp (nth 1 (syntax-ppss indent-point))) + (let* ((indent-point (point)) + (case-fold-search nil) + (colon-line-end 0) + prev-char + (state (syntax-ppss)) + (containing-sexp (nth 1 state)) + ;; Don't auto-indent in a quoted string or a here-document. + (unindentable (or (nth 3 state) (eq 2 (nth 7 state))))) + (when (and (eq t (nth 3 state)) + (save-excursion + (goto-char (nth 8 state)) + (looking-back "qw[ \t]*" (- (point) 4)))) + ;; qw(...) is a list of words so the spacing is not meaningful, + ;; and makes indentation possible (and desirable). + (setq unindentable nil) + (setq containing-sexp (nth 8 state))) (cond - ;; Don't auto-indent in a quoted string or a here-document. - ((or (nth 3 state) (eq 2 (nth 7 state))) 'noindent) + (unindentable 'noindent) ((null containing-sexp) ; Line is at top level. (skip-chars-forward " \t\f") (if (memq (following-char) @@ -965,7 +974,11 @@ Returns (parse-state) if line starts inside a string." ;; arg2 ;; ); (progn - (skip-syntax-backward "(") + ;; Go just before the open paren (don't rely on the + ;; skip-syntax-backward to jump over it, because it could + ;; have string-fence syntax instead!). + (goto-char containing-sexp) + (skip-syntax-backward "(") ;FIXME: Not sure if still want this. (condition-case nil (while (save-excursion (skip-syntax-backward " ") (not (bolp))) diff --git a/test/manual/indent/perl.perl b/test/manual/indent/perl.perl index 06f32e7f09..853aec4924 100755 --- a/test/manual/indent/perl.perl +++ b/test/manual/indent/perl.perl @@ -5,6 +5,12 @@ ($) return 0; } +# qw(...) is a quoted list of words, so we can and should indent its content! +my @tutu = qw[ + tata + titi + ]; + my $hash = { foo => 'bar', format => 'some', commit 904146cf798122aa6610fdd5209986918dad043a Author: Robert Pluim Date: Fri Nov 15 11:23:20 2019 +0100 Used magic-fallback-mode-alist to detect .doc files (Bug#20891) This avoids running doc-view-mode on files that are actually text files. * lisp/files.el (auto-mode-alist): Don't use doc-view-mode-maybe for .doc (but continue to do so for .docx). (magic-fallback-mode-alist): Add signature for .doc files. diff --git a/lisp/files.el b/lisp/files.el index 053583b4cb..448e00cbd7 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2798,7 +2798,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|CBR\\|7Z\\)\\'" . archive-mo ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MS-DOS ("\\.[eE]?[pP][sS]\\'" . ps-mode) - ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) + ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode) ("BROWSE\\'" . ebrowse-tree-mode) @@ -3062,6 +3062,7 @@ If FUNCTION is nil, then it is not called. (That is a way of saying (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\r\n]*<\\)"))) (concat "[ \t\r\n]*<" comment-re "*!DOCTYPE ")) . sgml-mode) + ("\320\317\021\340\241\261\032\341" . doc-view-mode-maybe) ; Word documents 1997-2004 ("%!PS" . ps-mode) ("# xmcd " . conf-unix-mode))) "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'. commit 48169f7c65b2f9c78aa8c066a8b89df13f08ff61 Author: Eli Zaretskii Date: Fri Nov 15 11:42:11 2019 +0200 Improve indexing of function doc string conventions * doc/lispref/functions.texi (Function Documentation): Improve indexing (bug#38158). diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 12112508b0..6157f9a535 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -453,7 +453,8 @@ after a @code{&rest} argument. @node Function Documentation @subsection Documentation Strings of Functions -@cindex documentation of function +@cindex documentation string of function +@cindex function's documentation string A lambda expression may optionally have a @dfn{documentation string} just after the lambda list. This string does not affect execution of