Sam Steingold [Fri, 24 Nov 2017 19:25:41 +0000 (14:25 -0500)]
Fix last patch: ensure the return value of tags-verify-table.
* lisp/progmodes/etags.el (tags-verify-table): Since `(tags-table-mode)'
always return nil now that it is a derived mode, call
`verify-tags-table-function' explicitly.
* lisp/macros.el (name-last-kbd-macro): Make it an alias of
kmacro-name-last-macro.
(insert-kbd-macro): Use kmacro-keyboard-macro-p so it also works for
kmacros that fail to have a `kmacro' property.
(see https://emacs.stackexchange.com/questions/37065, for an example).
* lisp/kmacro.el: Remove redundant :group args.
(kmacro-insert-counter): Simplify.
(kmacro-extract-lambda): Use car/cdr-safe.
(kmacro-p, kmacro-keyboard-macro-p): New functions.
(kmacro-name-last-macro): Use them.
Sam Steingold [Wed, 22 Nov 2017 21:14:22 +0000 (16:14 -0500)]
Use special-mode for read-only buffers.
* lisp/progmodes/etags.el (tags-table-mode): Define using
`define-derived-mode', inheriting from `special-mode'.
Not only the buffer is now read-only, but you can bury it with "q".
(select-tags-table-mode): No need to set `buffer-read-only'
explicitly, `special-mode' takes care of that.
* lisp/vc/log-edit.el (log-edit-show-files): Use `special-mode'
instead of setting `buffer-read-only' explicitly.
Eric Abrahamsen [Mon, 20 Nov 2017 22:21:32 +0000 (14:21 -0800)]
Use message instead of gnus-message in gnus-summary-current-score
* lisp/gnus/gnus-score.el (gnus-summary-current-score): The only point
of this function is to display the score to the user, there's no
need to do gnus-message filtering.
Alan Mackenzie [Mon, 20 Nov 2017 18:05:33 +0000 (18:05 +0000)]
read_key_sequence: correct the handling of raw_keybuf in recursive calls
This fixes bug #29349.
* src/keyboard.c (raw_keybuf_buffer, raw_keybuf_count_buffer): New variables
pointed to by ...
(raw_keybuf, raw_keybuf_count): Variables converted to pointers.
(GROW_RAW_KEYBUF): enhance with a length argument.
(command_loop_1): Initialize the above two pointers to their canonical values.
(read_key_sequence): In recursive calls (for menus) the function was
overwriting the raw event buffer of the outer call. Correct this by
introducing a local buffer for each level of call, and setting this up to be
used by the call to read_char. Any contents of this local buffer are appended
to the global buffer afterwards.
Glenn Morris [Mon, 20 Nov 2017 18:08:35 +0000 (13:08 -0500)]
Merge from origin/emacs-26
6e6bf60 Don't let delete_frame select a tooltip frame (Bug#27647) e9dd580 Filter obtrusive events in help-read-key-sequence. 90075e8 Fix symlink flag in tramp-gvfs-handle-file-attributes c355529 Fix bug in tramp-handle-file-truename 4c21d04 Fix a typo in doc string of electric-indent-functions-without... 319c2de Avoid assertion violations in echo_area_display 63c7733 ; * lisp/ido.el (ido-find-alternate-file): Doc fix. (Bug#29278) cbd319a Fix case-folding in Occur 29520b0 Fix quick-calc in C mode with hex values 3e80124 Improve documentation of dired-next/prev-marked-file 90add18 Prevent aborts in line-move-visual 648c128 More fixes in src/.gdbinit 104f3e5 Document how to enter whitespace when using grep-read-files
Michael Albinus [Mon, 20 Nov 2017 13:28:22 +0000 (14:28 +0100)]
Fix Bug#29149
* lisp/net/tramp.el (tramp-drop-volume-letter): Handle also
backup file names.
(tramp-handle-find-backup-file-name):
Call `tramp-drop-volume-letter' on the results. (Bug#29149)
Mike Kupfer [Sun, 19 Nov 2017 00:49:10 +0000 (16:49 -0800)]
MH-E: don't automatically download external-body parts
* lisp/mh-e/mh-mime.el (mh-mime-display-single): Use
mm-automatic-display-p to verify that a part should be
displayed before doing the inline checks (SF#475).
Vibhav Pant [Sun, 19 Nov 2017 09:22:06 +0000 (14:52 +0530)]
lisp/erc/erc-services.el: Fix arg eval order of inline functions.
* lisp/erc/erc-services.el (erc-nickserv-alist-sender,
erc-nickserv-alist-regexp, erc-nickserv-alist-nickserv,
erc-nickserv-alist-ident-keyword, erc-nickserv-alist-use-nick-p,
erc-nickserv-alist-ident-command,
erc-nickserv-alist-identified-regexp): Use `inline-letevals' to make
sure that `network' is evaluated first and independently of `entry'.
* lisp/emacs-lisp/eieio.el (object-write): Only write the name in the
comment when the comment's also present. Newline should only be
printed if the name is.
Alan Mackenzie [Sat, 18 Nov 2017 14:52:39 +0000 (14:52 +0000)]
Filter obtrusive events in help-read-key-sequence.
This fixes most of bug #29272.
* lisp/help.el (help-read-key-sequence): After a mouse event, pause for 0.01s,
discarding any events (such as <help-echo>) received in this time, before
polling for the double-click (etc.) events which may follow. This fixes the
infinite loop which occurred whwn <help-echo> events triggered a sit-for
whilst handling menu events.
OGAWA Hirofumi [Sat, 18 Nov 2017 10:29:41 +0000 (12:29 +0200)]
Fix quick-calc in C mode with hex values
* lisp/calc/calc-aent.el (math-read-token): Make sure the match
against "0[xX][0-9a-fA-F]+" is found at math-exp-pos. See
http://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00174.html
for the details.
Eli Zaretskii [Fri, 17 Nov 2017 19:37:04 +0000 (21:37 +0200)]
Prevent aborts in line-move-visual
* src/indent.c (line_number_display_width): Avoid assertion
violations in init_iterator when the window's buffer was
temporarily switched without updating window-start. (Bug#29326)
Robert Pluim [Fri, 17 Nov 2017 13:39:02 +0000 (15:39 +0200)]
Document how to enter whitespace when using grep-read-files
* lisp/progmodes/grep.el (lgrep, rgrep, grep-read-files): Explain
how to enter whitespace when using grep-read-files. (Bug#29303)
* lisp/progmodes/project.el (project-find-regexp): Likewise.
* lisp/vc/vc-git.el (vc-git-grep): Likewise.
Martin Rudalics [Tue, 14 Nov 2017 17:36:12 +0000 (18:36 +0100)]
; Fix last fix of 'mouse-drag-and-drop-region'
* lisp/mouse.el (mouse-drag-and-drop-region): Use 'car-safe'
instead of 'car' to ignore 'select-window' events. Thanks to
Stefan Monnier for spotting this.
Daniel Pittman [Tue, 14 Nov 2017 10:38:30 +0000 (11:38 +0100)]
Fix Bug#28139
* tramp-sh.el: Set TERM and INSIDE_EMACS environment earlier.
(tramp-remote-process-environment): Remove TERM and INSIDE_EMACS.
(tramp-remote-process-environment): Document their special handling.
(tramp-open-shell): Set TERM and INSIDE_EMACS prior to starting the
initial remote shell, so that it is also aware of the environment
in which it is operating. (Bug#28139)
Katsumi Yamaoka [Mon, 13 Nov 2017 23:56:26 +0000 (23:56 +0000)]
Fix cookie handling (bug#29282)
* lisp/url/url-cookie.el (url-cookie-handle-set-cookie):
Regard a Set-Cookie header as it contains a single cookie;
prefer Max-Age to Expires and convert it to Expires;
remove support for old time string styles (bug#29282).
Gemini Lasswell [Mon, 13 Nov 2017 21:22:39 +0000 (13:22 -0800)]
Improve documentation of Edebug and macros
* doc/lispref/edebug.texi (Instrumenting Macro Calls): Improve
discussion of when it might be necessary to find and evaluate macro
specifications before instrumenting.
(Specification List): Clarify what "defining form" means to Edebug
and when 'def-form' or 'def-body' should be used instead of 'form'
or 'body'.
Paul Eggert [Mon, 13 Nov 2017 18:54:20 +0000 (10:54 -0800)]
Merge from origin/emacs-26
79108894db Port to IBM xlc 12.01 d14956099d Simplify by removing HAVE_STRUCT_ATTRIBUTE_ALIGNED b1573a97e1 Use alignas to fix GCALIGN-related bugs 5d68dc9a2f Change vectorlike from struct to union 6aa0a26b46 Don't enable cursor-sensor-mode in mhtml-mode 2b8ef8dddf * lisp/files.el (abbreviate-file-name): Doc fix. (Bug#29267) fe85ce1e16 Unbreak interactive run of a flymake test (bug#29267) 48ad00390d Fix Bug#29225 42daf83f08 CC Mode: Fix defun-open being recognized as brace-list-ope... 7775c47298 Merge from Gnulib e470d16448 Pacify GCC when configured --with-x-toolkit=no 49450d0951 * lisp/find-dired.el (find-grep-dired): Doc fix. (Bug#29262) e286b3381f Fix more flymake-diag-region eob corner cases and add test...
Paul Eggert [Mon, 13 Nov 2017 16:51:41 +0000 (08:51 -0800)]
Simplify by removing HAVE_STRUCT_ATTRIBUTE_ALIGNED
* configure.ac (HAVE_STRUCT_ATTRIBUTE_ALIGNED): Remove. No longer
needed, since we no longer rely on __attribute__ ((aligned (8))).
All uses removed.
* src/emacs-module.c (HAVE_STRUCT_ATTRIBUTE_ALIGNED): Remove.
(lisp_to_value): Simplify now that we no longer need to worry
whether HAVE_STRUCT_ATTRIBUTE_ALIGNED is false.
Paul Eggert [Mon, 13 Nov 2017 16:51:41 +0000 (08:51 -0800)]
Use alignas to fix GCALIGN-related bugs
Use alignas and unions to specify alignments of objects needing
addresses that are at least a multiple of GCALIGNMENT. Using
these standard C facilities should be safer than relying on ad hoc
and poorly-understood features like GCC’s __attribute__
((aligned (N))), the root cause for recent porting bugs like
Bug#29040. The alignas macro was standardized by C11 and Gnulib
supports alignas for pre-C11 platforms. I have tested this on Sun
Studio 12 sparc (2007) and GCC 4.4.7 x86-64 (2012) as well as on
more recent platforms like GCC 7.2.1 (2017) on Fedora 26 (both
x86-64 and x86).
* lib-src/make-docfile.c (close_emacs_globals): lispsym is now
just an array of struct Lisp_Symbol, since struct Lisp_Symbol is
now properly aligned. All uses changed.
* src/alloc.c (NEXT_FREE_LISP_STRING): Just use the new u.next
member; this is simpler and safer than casting a pointer that
might not be aligned properly.
(aligned_Lisp_Symbol): Remove. No longer needed, now that struct
Lisp_Symbol is aligned properly. All uses replaced with struct
Lisp_Symbol.
* src/lisp.h (GCALIGNED): Remove, as it does not work as expected:
it can cause the natural alignment to be ignored. All uses
replaced by unions with a ‘char alignas (GCALIGNMENT)’ member as
described below.
(struct Lisp_Symbol, struct Lisp_Cons, struct Lisp_String):
Change definition from ‘struct TAG { MEMBERS };’ to
‘struct TAG { union { struct { MEMBERS } s; char alignas
(GCALIGNMENT) gcaligned; } u; };’. This guarantees ‘struct TAG’
to have an alignment that at least max (GCALIGNMENT, N) where N is
its old alignment. All uses like ‘PTR->MEMBER’ changed to
‘PTR->u.s.MEMBER’; these uses were supposed to be mostly private
anyway. Verify that the resulting ‘struct TAG’ is properly
aligned for Emacs.
(union vectorlike_header): New member ‘gcaligned’ to guarantee
that this type, and its containing types like ‘struct Lisp_Subr’,
‘struct buffer’ and ‘struct thread_state’, are all properly
aligned for Emacs.
(struct Lisp_String): New union member ‘next’, for the benefit
of NEXT_FREE_LISP_STRING.
(union Aligned_Cons, union Aligned_String): Remove. All uses
replaced by struct Lisp_Cons and struct Lisp_String, since they
are now properly aligned.
(USE_STACK_CONS, USE_STACK_STRING): Simplify now that we can
assume struct Lisp_Cons and struct Lisp_String are properly
aligned.
Paul Eggert [Mon, 13 Nov 2017 16:51:41 +0000 (08:51 -0800)]
Change vectorlike from struct to union
* src/lisp.h (vectorlike_headed): Change from struct to union.
All uses changed. Since it has only one member, this does not
change semantics. This is designed to simplify future changes
needed to fix bugs like Bug#29040. All uses changed.
Paul Eggert [Sun, 12 Nov 2017 06:59:41 +0000 (22:59 -0800)]
Pacify GCC when configured --with-x-toolkit=no
Without these changes, Emacs does not build on Fedora 26 x86-64
when configured --with-x-toolkit=no --enable-gcc-warnings.
* oldXMenu/Activate.c (XMenuActivate): Add FALLTHROUGH.
* src/xterm.c (x_dispatch_event): Define only if
USE_X_TOOLKIT || USE_MOTIF || USE_GTK.
Noam Postavsky [Sat, 11 Nov 2017 16:10:49 +0000 (11:10 -0500)]
; Merge from emacs-26
9533d76b0b Keep Man sections in natural order (bug#28998) d63c9a96f5 * lisp/minibuffer.el: Install a workaround for bug#16274 7657a86709 Fix comparisons with tip_frame in GTK builds 603a0716a8 Improve the documentation of M-n for entering file names 72f813fb56 Fix desktop auto-save timer when linum-mode is used 44340b475f Fix "C-h k" in xterm-mouse-mode 05aa6d4a68 Fix off-by-1 bug in --enable-checking=stringbytes 096f638ddc Correct the indentation of C99's compound literals. c52a2aa8f3 Improve the doc string of 'dired-isearch-filter-filenames' e592b92482 * lisp/isearch.el (search-invisible): Doc fix. (Bug#29222) f3e69a80ab Fix display of line numbers in GTK builds e6f1fd4091 Fix previous change to flymake-diag-region (bug#29174) 89382780e1 flymake-diag-region really returns nil if region is invali... 535688a418 Flymake correctly highlights whole last line if eob (bug#2... 72e62d3fdb Protect Flymake checkdoc backend against checkdoc errors (... b28de57411 Sort entries of the Flymake diagnostics buffer (bug#29175) fc56bea142 Correctly indent C++14 brace lists which are a second argu... 9dde8be9cd Fix redisplay of overlay-arrows on GUI frames 0da08f2f8e Protect Flymake tests against older Ruby and Perl (bug#29187) 781f276cc1 Fix URL cookie expiration bug
Eli Zaretskii [Sat, 11 Nov 2017 11:48:37 +0000 (13:48 +0200)]
Improve the documentation of M-n for entering file names
* lisp/files.el (find-file, find-file-other-window)
(find-file-other-frame): Mention file-name-at-point-functions in
the doc string. Reported by Florian Weimer <fw@deneb.enyo.de> in
http://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00224.html.
* doc/emacs/mini.texi (Minibuffer History): Document
file-name-at-point-functions and its effect on M-n when typing
file names in the minibuffer.
* doc/emacs/files.texi (File Names):
* doc/emacs/mini.texi (Minibuffer File): Add a cross-reference to
"Minibuffer History", where special features of M-n regarding
files are described.
Eli Zaretskii [Sat, 11 Nov 2017 09:53:42 +0000 (11:53 +0200)]
Fix desktop auto-save timer when linum-mode is used
* lisp/desktop.el (desktop-read): Use toplevel value of
window-configuration-change-hook when deciding whether desktop
auto-saving is enabled. Suggested by Peter Neidhardt
<pe.neidhardt@googlemail.com>. (Bug#28945)
Eric Abrahamsen [Wed, 8 Nov 2017 19:58:31 +0000 (11:58 -0800)]
Provide more control over writing of objects in object-write
* lisp/emacs-lisp/eieio.el (eieio-print-indentation,
eieio-print-object-name): New variables controlling whether an
object name is printed for each object, and whether an object's
contents are indented or not. Object names are obsoleted; omitting
indentation reduces the size of persistence files.
Paul Eggert [Fri, 10 Nov 2017 23:16:50 +0000 (15:16 -0800)]
Fix off-by-1 bug in --enable-checking=stringbytes
Evidently nobody builds Emacs with --enable-checking=all,
which is no surprise as it is so slow as to be unusable nowadays.
Perhaps we should remove the slowest checks, or move them into
another category, or speed them up, or something.
* src/alloc.c (SDATA_SIZE) [GC_CHECK_STRING_BYTES]: Fix off-by-one
error in size calculation, which caused a failure when
--enable-checking=stringbytes was used. I introduced this bug in
2016-09-08T01:08:45!eggert@cs.ucla.edu "Port flexible array
members to GCC + valgrind".
Alan Mackenzie [Fri, 10 Nov 2017 17:45:22 +0000 (17:45 +0000)]
Correct the indentation of C99's compound literals.
* lisp/progmodes/cc-engine.el (c-looking-at-statement-block): Amend so that
if there is only syntactic whitespace in a brace block, it is regarded as a
statement block. Also, if there is no semicolon or comma delimiter, treat as
a statement block when there is a keyword.
(c-guess-basic-syntax): CASE 9 test: Regard a brace as starting a brace block
when its contents indicate a brace block.