]> git.eshelyaron.com Git - emacs.git/log
emacs.git
7 years agoMerge branch 'master' into nick.lloyd-bytecode-jit nick.lloyd-bytecode-jit
Nickolas Lloyd [Thu, 2 Feb 2017 03:31:55 +0000 (22:31 -0500)]
Merge branch 'master' into nick.lloyd-bytecode-jit

7 years ago; Fix errors introduced during merge.
Nickolas Lloyd [Thu, 2 Feb 2017 02:07:03 +0000 (21:07 -0500)]
; Fix errors introduced during merge.

7 years agoTurn on lexical-binding in parse-time.el
Mark Oteiza [Thu, 2 Feb 2017 02:01:45 +0000 (21:01 -0500)]
Turn on lexical-binding in parse-time.el

* lisp/calendar/parse-time.el: Turn on lexical-binding.
(parse-time-iso8601-regexp, parse-iso8601-time-string): Remove unused
bindings.

7 years agoPrevent creating thumbnails of all gif frames
Mark Oteiza [Thu, 2 Feb 2017 01:51:00 +0000 (20:51 -0500)]
Prevent creating thumbnails of all gif frames

With the previous defaults, doing image-dired on a directory with an
animated foo.gif would cause creation of foo.thumb-N.gif for each of
N frames in foo.gif.  By default image-dired looks for foo.thumb.gif, so
there additionally is no usable thumbnail after all the needless effort.
image-dired never handled animation, regardless.
* lisp/image-dired.el: Mention limitation.
(image-dired-cmd-create-thumbnail-options):
(image-dired-cmd-create-temp-image-options):
(image-dired-cmd-create-standard-thumbnail-options): Append [0] to
filename to indicate only converting the 0th frame.
(image-dired-display-image-mode): Don't show a cursor.

7 years agoMerge branch 'master' into nick.lloyd-bytecode-jit
Nickolas Lloyd [Thu, 2 Feb 2017 01:28:55 +0000 (20:28 -0500)]
Merge branch 'master' into nick.lloyd-bytecode-jit

7 years agoFix quitting bug when buffers are frozen
Paul Eggert [Wed, 1 Feb 2017 23:18:44 +0000 (15:18 -0800)]
Fix quitting bug when buffers are frozen

Problem noted by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00721.html
This patch also fixes some other issues in that report.
* src/lisp.h (incr_rarely_quit): Remove.
All callers changed to use rarely_quit directly.
* src/search.c (freeze_buffer_relocation)
(thaw_buffer_relocation): New functions.
(looking_at_1, fast_looking_at, search_buffer):
Use them to fix bug when quitting when buffers are frozen.
* src/sysdep.c (emacs_intr_read): Rename from emacs_nointr_read.
All uses changed.

7 years agoRevamp quitting and fix infloops
Paul Eggert [Wed, 1 Feb 2017 23:18:44 +0000 (15:18 -0800)]
Revamp quitting and fix infloops

This fixes some infinite loops that cannot be quitted out of,
e.g., (defun foo () (nth most-positive-fixnum '#1=(1 . #1#)))
when byte-compiled and when run under X.  See:
http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00577.html
This also attempts to keep the performance improvements I recently
added, as much as possible under the constraint that the infloops
must be caught.  In some cases this fixes infloop bugs recently
introduced when I removed immediate_quit.
* src/alloc.c (Fmake_list):
Use rarely_quit, not maybe_quit, for speed in the usual case.
* src/bytecode.c (exec_byte_code):
* src/editfns.c (Fcompare_buffer_substrings):
* src/fns.c (Fnthcdr):
* src/syntax.c (scan_words, skip_chars, skip_syntaxes)
(Fbackward_prefix_chars):
Use rarely_quit so that users can C-g out of long loops.
* src/callproc.c (call_process_cleanup, call_process):
* src/fileio.c (read_non_regular, Finsert_file_contents):
* src/indent.c (compute_motion):
* src/syntax.c (scan_words, Fforward_comment):
Remove now-unnecessary maybe_quit calls.
* src/callproc.c (call_process):
* src/doc.c (get_doc_string, Fsnarf_documentation):
* src/fileio.c (Fcopy_file, read_non_regular, Finsert_file_contents):
* src/lread.c (safe_to_load_version):
* src/sysdep.c (system_process_attributes) [GNU_LINUX]:
Use emacs_read_quit instead of emacs_read in places where
C-g handling is safe.
* src/eval.c (maybe_quit): Move comment here from lisp.h.
* src/fileio.c (Fcopy_file, e_write):
Use emacs_write_quit instead of emacs_write_sig in places where
C-g handling is safe.
* src/filelock.c (create_lock_file): Use emacs_write, not
plain write, as emacs_write no longer has a problem.
(read_lock_data): Use emacs_read, not read, as emacs_read
no longer has a problem.
* src/fns.c (rarely_quit): Move to lisp.h and rename to
incr_rarely_quit.  All uses changed..
* src/fns.c (Fmemq, Fmemql, Fassq, Frassq, Fplist_put, Fplist_member):
* src/indent.c (compute_motion):
* src/syntax.c (find_defun_start, back_comment, forw_comment)
(Fforward_comment, scan_lists, scan_sexps_forward):
Use incr_rarely_quit so that users can C-g out of long loops.
* src/fns.c (Fnconc): Move incr_rarely_quit call to within
inner loop, so that it catches C-g there too.
* src/keyboard.c (tty_read_avail_input): Remove commented-out
and now-obsolete code dealing with interrupts.
* src/lisp.h (rarely_quit, incr_rarely_quit): New functions,
the latter moved here from fns.c and renamed from rarely_quit.
(emacs_read_quit, emacs_write_quit): New decls.
* src/search.c (find_newline, search_buffer, find_newline1):
Add maybe_quit to catch C-g.
* src/sysdep.c (get_child_status): Always invoke maybe_quit
if interruptible, so that the caller need not bother.
(emacs_nointr_read, emacs_read_quit, emacs_write_quit):
New functions.
(emacs_read): Rewrite in terms of emacs_nointr_read.
Do not handle C-g or signals; that is now for emacs_read_quit.
(emacs_full_write): Replace PROCESS_SIGNALS two-way arg
with INTERRUPTIBLE three-way arg.  All uses changed.

7 years agoRemove immediate_quit.
Paul Eggert [Wed, 1 Feb 2017 23:18:43 +0000 (15:18 -0800)]
Remove immediate_quit.

The old code that sets and clears immediate_quit was
ineffective except when Emacs is running in terminal mode, and
has problematic race conditions anyway, so remove it.  This
will introduce some hangs when Emacs runs in terminal mode,
and these hangs should be fixed in followup patches.
* src/keyboard.c (immediate_quit): Remove.  All uses removed.

7 years agoAllow C++ nested brace-list-entries to be better indented.
Alan Mackenzie [Wed, 1 Feb 2017 20:20:09 +0000 (20:20 +0000)]
Allow C++ nested brace-list-entries to be better indented.

This fixes bug #24431.  The key change of this bug fix is correctly analyzing
nested brace lists when the opening element stands on the same line as both
its introductory brace and an enclosing parameter list parenthesis.

* list/progmodes/cc-align.el (c-lineup-under-anchor): New line-up function.

* list/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): Accept the
presence of exactly an identifier between an open parenthesis and an open
brace as evidence of the brace starting a brace list.
(c-looking-at-statement-block): New function, extracted from
c-looking-at-inexpr-block.  Enhance it to analyze inner blocks recursively
when needed.
(c-looking-at-inexpr-block): Extract new function (see above) and call it.
(c-add-stmt-syntax): Enhance, with new &optional parameter, to supply the
prime syntactic symbol with a fixed anchor point.  When this is used, restrict
all added syntactic symbols to those having an anchor point on the same line.
Add, in addition to the current additional symbols, c-brace-list-entry when
needed; use c-looking-at-statement-block to determine the latter.
(c-guess-basic-syntax, CASE 9D): Use c-add-stmt-syntax rather than just
c-add-syntax, to assemble the syntactic context of a 'brace-list-entry, thus
getting, possibly, several accompanying syntactic entries.

* lisp/progmodes/cc-styles.el (c-style-alist, "gnu" style): New entry for
'brace-list-intro, namely c-lineup-arglist-intro-after-paren.

* lisp/progmodes/cc-vars.el (c-offsets-alist): Change the factory default
offset for 'brace-list-entry from 0 to c-lineup-under-anchor.

* doc/misc/cc-mode.texi (Syntactic Symbols): Amend the definition of
brace-list-intro.
(Brace List Symbols): Amend the example to show the new analysis of brace
lists when the first element comes on the same line as the opening brace.
(Misc Line-Up): Document the new line-up function c-lineup-under-anchor.

7 years agoRevert "DOn't use string-as-unibyte in Gnus"
Lars Ingebrigtsen [Wed, 1 Feb 2017 12:48:02 +0000 (13:48 +0100)]
Revert "DOn't use string-as-unibyte in Gnus"

This reverts commit d1c931009004aef847105b7bac6b6ffafd985b82.

Not all the cases where we had string-as-unibyte were characters,
so this needs to be considered more thoroughly before being redone.

7 years agoFix a subtle problem in Tramp with timers
Michael Albinus [Wed, 1 Feb 2017 09:06:37 +0000 (10:06 +0100)]
Fix a subtle problem in Tramp with timers

* lisp/net/tramp.el (tramp-accept-process-output): Change argument
list.  Make it work when called inside a timer.  See
<http://lists.gnu.org/archive/html/tramp-devel/2017-01/msg00010.html>.

7 years ago; Bump let-alist
Mark Oteiza [Wed, 1 Feb 2017 00:46:28 +0000 (19:46 -0500)]
; Bump let-alist

* lisp/emacs-lisp/let-alist.el: Bump micro version (bug#24641).

7 years agoread-multiple-choice: explain dialog popups more
Ted Zlatanov [Tue, 31 Jan 2017 19:17:58 +0000 (14:17 -0500)]
read-multiple-choice: explain dialog popups more

* lisp/emacs-lisp/subr-x.el (read-multiple-choice): Explain
when a graphical popup is used and how it can be avoided.

7 years agoauth-source-user-and-password: add forgotten user parameter
Ted Zlatanov [Tue, 31 Jan 2017 19:12:41 +0000 (14:12 -0500)]
auth-source-user-and-password: add forgotten user parameter

* lisp/auth-source.el (auth-source-user-and-password): Use
          accidentally unused "user" parameter.
          Reported by Oscar Najera <najera.oscar@gmail.com>.

7 years agoFix typo in a NEWS entry for CSS mode
Simen Heggestøyl [Tue, 31 Jan 2017 19:08:54 +0000 (20:08 +0100)]
Fix typo in a NEWS entry for CSS mode

7 years agoDOn't use string-as-unibyte in Gnus
Lars Ingebrigtsen [Tue, 31 Jan 2017 16:52:51 +0000 (17:52 +0100)]
DOn't use string-as-unibyte in Gnus

* lisp/gnus/nnmail.el (nnmail-parse-active): Don't use
string-as-unibyte.
(nnmail-insert-xref): Ditto.

* lisp/gnus/canlock.el (canlock-make-cancel-key): Ditto.

* lisp/gnus/gnus-art.el (gnus-article-browse-html-parts): Ditto.

* lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): Ditto.
(gnus-browse-foreign-server): Ditto.
(gnus-browse-foreign-server): Ditto.

* lisp/gnus/gnus-start.el
(gnus-update-active-hashtb-from-killed): Ditto.
(gnus-read-newsrc-el-file): Ditto.

* lisp/gnus/mml.el (mml-generate-mime-1): Ditto.

* lisp/gnus/nnir.el (nnir-get-active): Ditto.
(nnir-get-active): Ditto.

7 years agoAllow C-s C-w to yank ' to the search ring in the Gnus article buffer
Juri Linkov [Tue, 31 Jan 2017 16:36:06 +0000 (17:36 +0100)]
Allow C-s C-w to yank ' to the search ring in the Gnus article buffer

* lisp/gnus/gnus-art.el (gnus-article-mode-syntax-table): Make
M-. in article buffers work for `foo' strings, and still allow
C-s C-w to yank ' to the search ring (bug#22248).

7 years ago* src/alloc.c, src/lisp.h: Fix minor glitches in recent changes.
Paul Eggert [Tue, 31 Jan 2017 16:29:02 +0000 (08:29 -0800)]
* src/alloc.c, src/lisp.h: Fix minor glitches in recent changes.

7 years ago* test/lisp/vc/diff-mode-tests.el: Require diff-mode.
Tino Calancha [Tue, 31 Jan 2017 16:20:46 +0000 (01:20 +0900)]
* test/lisp/vc/diff-mode-tests.el: Require diff-mode.

7 years agoNew test for diff-mode handling trailing --
Dima Kogan [Tue, 31 Jan 2017 07:40:54 +0000 (23:40 -0800)]
New test for diff-mode handling trailing --

test/lisp/vc/diff-mode-tests.el: New test file

7 years agoHandle patch terminators produced by git and bzr patch export
Dima Kogan [Tue, 31 Jan 2017 05:43:32 +0000 (21:43 -0800)]
Handle patch terminators produced by git and bzr patch export

Patch by Juri Linkov posted in the #9597 bug report

* lisp/vc/diff-mode.el (diff-sanity-check-hunk): Find and ignore
terminator (Bug #9597, #5302)

7 years agoRevert two accidental commits
Dima Kogan [Tue, 31 Jan 2017 15:46:10 +0000 (07:46 -0800)]
Revert two accidental commits

This reverts commit f3c77d11af65f3b319b1784b4c3cf08c51aa7997.
This reverts commit 3c941b900007c9e79c00af0f21d88154f6d8af1a.

7 years agostash
Dima Kogan [Tue, 6 Dec 2016 05:42:20 +0000 (21:42 -0800)]
stash

7 years agocomint-get-old-input-default: behavior follows docstring
Dima Kogan [Fri, 25 Nov 2016 21:15:12 +0000 (13:15 -0800)]
comint-get-old-input-default: behavior follows docstring

lisp/comint.el (comint-get-old-input-default): Modify behavior to follow
docstring: if `comint-use-prompt-regexp' is nil, then return the CURRENT LINE,
if point is on an output field.

7 years agocss-mode documentation lookup feature
Tom Tromey [Fri, 20 Jan 2017 04:40:38 +0000 (21:40 -0700)]
css-mode documentation lookup feature

* etc/NEWS: Mention new feature.
* lisp/textmodes/css-mode.el (css-mode-map): New defvar.
(css--mdn-lookup-history): New defvar.
(css-lookup-url-format): New defcustom.
(css--mdn-property-regexp, css--mdn-completion-list): New defconsts.
(css--mdn-after-render, css--mdn-find-symbol, css-lookup-symbol): New
defuns.
* test/lisp/textmodes/css-mode-tests.el (css-mdn-symbol-guessing): New
test.

7 years agoedt-mapper: just loading a library should not run code
Glenn Morris [Mon, 30 Jan 2017 22:22:32 +0000 (17:22 -0500)]
edt-mapper: just loading a library should not run code

* lisp/emulation/edt-mapper.el (edt-mapper): New function,
containing code previously at top-level.
* lisp/emulation/edt.el (edt-load-keys): After loading edt-mapper,
run edt-mapper function.

7 years agomh-compat.el: remove duplicate definition
Glenn Morris [Mon, 30 Jan 2017 21:59:37 +0000 (16:59 -0500)]
mh-compat.el: remove duplicate definition

* lisp/mh-e/mh-compat.el (mh-make-obsolete-variable):
Remove duplicate definition.

7 years agoAdd delq list arg check
Paul Eggert [Sun, 29 Jan 2017 00:45:56 +0000 (16:45 -0800)]
Add delq list arg check

* src/fns.c (Fdelq): Check that list is a proper list.
This is more compatible with what ‘delete’ does.

7 years ago* lisp/indent.el (indent-region-line-by-line): New function.
Stefan Monnier [Mon, 30 Jan 2017 18:06:07 +0000 (13:06 -0500)]
* lisp/indent.el (indent-region-line-by-line): New function.

Extracted from indent-region.
(indent-region, indent-region-function): Use it.

7 years ago* lisp/subr.el (string-make-unibyte, string-make-multibyte): Obsolete.
Stefan Monnier [Mon, 30 Jan 2017 18:02:18 +0000 (13:02 -0500)]
* lisp/subr.el (string-make-unibyte, string-make-multibyte): Obsolete.

7 years agoMore fixes to prevent crashes on C-g
Eli Zaretskii [Mon, 30 Jan 2017 17:26:02 +0000 (19:26 +0200)]
More fixes to prevent crashes on C-g

* src/fns.c (Fassq, Frassq, Fplist_put): Reset immediate_quit
before returning, to avoid crashes in quit.  (Bug#25566)

7 years agoAvoid crashes on C-g in TTY sessions
Eli Zaretskii [Mon, 30 Jan 2017 17:08:57 +0000 (19:08 +0200)]
Avoid crashes on C-g in TTY sessions

* src/keyboard.c (handle_interrupt): Don't quit if
waiting_for_input is set, as doing that is "unsafe": it will
abort.  (Bug#25566)

7 years agoFix hash tables not being purified correctly.
Vibhav Pant [Mon, 30 Jan 2017 06:33:23 +0000 (12:03 +0530)]
Fix hash tables not being purified correctly.

* src/alloc.c
(purecopy_hash_table) New function, makes a copy of the given hash
table in pure storage.
Add new struct `pinned_object' and `pinned_objects' linked list for
pinning objects.
(Fpurecopy) Allow purifying hash tables
(purecopy) Pin hash tables that are either weak or not declared with
`:purecopy t`, use purecopy_hash_table otherwise.
(marked_pinned_objects) New function, marks all objects in pinned_objects.
(garbage_collect_1) Use it. Mark all pinned objects before sweeping.
* src/lisp.h Add new field `pure' to struct `Lisp_Hash_Table'.
* src/fns.c: Add `purecopy' parameter to hash tables.
(Fmake_hash_table): Check for a `:purecopy PURECOPY' argument, pass it
to make_hash_table.
(make_hash_table): Add `pure' parameter, set h->pure to it.
(Fclrhash, Fremhash, Fputhash): Enforce that the table is impure with
CHECK_IMPURE.
* src/lread.c: (read1) Parse for `purecopy' parameter while reading
  hash tables.
* src/print.c: (print_object) add the `purecopy' parameter while
  printing hash tables.
* src/category.c, src/emacs-module.c, src/image.c, src/profiler.c,
  src/xterm.c: Use new (make_hash_table).

7 years ago; s/#if/#ifdef/ HAVE_LIBJIT
Nickolas Lloyd [Mon, 30 Jan 2017 02:27:25 +0000 (21:27 -0500)]
; s/#if/#ifdef/ HAVE_LIBJIT

; * src/alloc.c (cleanup_vector): Test for macro definition instead of value.

7 years agoEscape dash in xref rgrep regexp
Dmitry Gutov [Sun, 29 Jan 2017 08:41:32 +0000 (10:41 +0200)]
Escape dash in xref rgrep regexp

* lisp/progmodes/xref.el (xref-collect-matches): Escape dash
in REGEXP if it's the first character.

7 years agoSay JavaScript, not Javascript
Dmitry Gutov [Sun, 29 Jan 2017 08:39:55 +0000 (10:39 +0200)]
Say JavaScript, not Javascript

* lisp/progmodes/js.el (js-mode-map, js-syntax-propertize)
(js-js-error, js-eval, js-set-js-context)
(js--get-js-context):
Refer to the language consistently as JavaScript.

7 years ago; Fix a compilation error when HAVE_LIBJIT=0
Nickolas Lloyd [Sun, 29 Jan 2017 18:43:39 +0000 (13:43 -0500)]
; Fix a compilation error when HAVE_LIBJIT=0

; * src/alloc.c (cleanup_vector): Add a guard around libjit-specific
functions in case HAVE_LIBJIT=0.

7 years agolisp/*.el: Fix some warnings
Juanma Barranquero [Sun, 29 Jan 2017 18:34:35 +0000 (19:34 +0100)]
lisp/*.el: Fix some warnings

* lisp/battery.el (dbus-get-property):
* lisp/dired-aux.el (format-spec): Declare function.

* lisp/net/zeroconf.el (zeroconf-list-service-names)
(zeroconf-list-service-types, zeroconf-list-services):
Mark unused lexical arg.

* lisp/progmodes/hideshow.el (hs-hide-block-at-point):
* lisp/progmodes/sql.el (sql-end-of-statement):
Pass LIMIT to 'looking-back'.

7 years agoSmall speed improvement for JITed lisp function dispatch
Nickolas Lloyd [Sun, 29 Jan 2017 18:22:06 +0000 (13:22 -0500)]
Small speed improvement for JITed lisp function dispatch

* src/alloc.c (make-byte-code):
* src/bytecode-jit.c (jit_byte_code__):
* src/bytecode.c [HAVE_LIBJIT] (exec_byte_code):
* src/eval.c (funcall_lambda):
* src/lisp.h (funcall_lambda): Store pointer to bytecode execution function
(either `exec_byte_code' or `jit_exec') in Lisp_Compiled objects to avoid
the need for an extra function call in `exec_byte_code'.

7 years agoDon't warn about obsolete defgenerics when defining them
Noam Postavsky [Sat, 28 Jan 2017 17:31:28 +0000 (12:31 -0500)]
Don't warn about obsolete defgenerics when defining them

* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): The declaration code
should run after the definition code (Bug#25556).

7 years agoFix Bug#25524
Tino Calancha [Sun, 29 Jan 2017 09:49:10 +0000 (18:49 +0900)]
Fix Bug#25524

* lisp/vc/diff-mode.el (diff-beginning-of-hunk):
Return position at the beginning off the hunk.
(diff-file-junk-re): Add SVN keywords.

7 years agohl-line.el: Don't try to operate on a killed buffer
Stephen Berman [Sat, 28 Jan 2017 19:49:19 +0000 (20:49 +0100)]
hl-line.el: Don't try to operate on a killed buffer

* lisp/hl-line.el (hl-line-maybe-unhighlight): Examine only
live buffers (bug#25522).

7 years agoUse access-file in EWW to check before downloading a file
Mark Oteiza [Sat, 28 Jan 2017 17:06:41 +0000 (12:06 -0500)]
Use access-file in EWW to check before downloading a file

* lisp/net/eww.el (eww-download): Check accessibility of
eww-download-directory to prevent starting a download that will fail
to write.
* src/fileio.c (Faccess_file): Clarify the use of string argument in
the docstring.

7 years agoSubject: Check Bcc after the Messag hook has run
Yuri D'Elia [Sat, 28 Jan 2017 14:20:54 +0000 (15:20 +0100)]
Subject: Check Bcc after the Messag hook has run

* lisp/gnus/message.el (message-send): If the hook modifies
the message (mml tags or headers), we should check bcc on the
final message, not on the original.

7 years agotest/*.el: Avoid byte-compiler warnings
Juanma Barranquero [Sat, 28 Jan 2017 03:40:36 +0000 (04:40 +0100)]
test/*.el: Avoid byte-compiler warnings

* test/lisp/abbrev-tests.el (abbrev-table-p-test): Remove unused 'let*'.

* test/lisp/faces-tests.el (faces--test): New customization group.
(faces--test1, faces--test2): Use it.

* test/lisp/ffap-tests.el (ffap-tests-25243):
Call 'mark-whole-buffer' interactively.

* test/lisp/ibuffer-tests.el (ibuffer-filter-groups, ibuffer-filtering-alist)
(ibuffer-filtering-qualifiers, ibuffer-save-with-custom)
(ibuffer-saved-filter-groups, ibuffer-saved-filters): Defvar.
(ibuffer-format-qualifier, ibuffer-unary-operand): Declare.

* test/lisp/minibuffer-tests.el (completion-test1):
Mark unused lexical arguments.

* test/lisp/simple-tests.el (simple-test--dummy-buffer): Wrap result in
'with-no-warnings' to avoid them when the macro is invoked for effect.

* test/lisp/emacs-lisp/cl-seq-tests.el (cl-seq-count-test):
Mark unused lexical arguments.

* test/lisp/emacs-lisp/let-alist-tests.el (let-alist-surface-test):
Mark unused lexical arguments.
(let-alist-cons): Remove unused let binding.

* test/lisp/net/dbus-tests.el (dbus-debug): Defvar.
(dbus-get-unique-name): Declare.

* test/lisp/progmodes/python-tests.el (python-bob-infloop-avoid):
Call 'font-lock-fontify-buffer' interactively.

* test/lisp/textmodes/tildify-tests.el (tildify-space-undo-test--test):
Mark unused lexical argument.

7 years agoRestore a test that was removed by a recent commit
Eli Zaretskii [Fri, 27 Jan 2017 19:58:10 +0000 (21:58 +0200)]
Restore a test that was removed by a recent commit

* src/fileio.c (Ffile_accessible_directory_p): Don't overwrite the
errno value unless it's necessary.  (Bug#25419)

7 years agoFix a couple eww customization types
Mark Oteiza [Fri, 27 Jan 2017 18:09:01 +0000 (13:09 -0500)]
Fix a couple eww customization types

* lisp/new/eww.el (eww-download-directory, eww-bookmarks-directory):
Change customization type to "directory".

7 years agoDon't require a shell when loading htmlfontify
Philipp Stephani [Tue, 17 Jan 2017 17:24:29 +0000 (18:24 +0100)]
Don't require a shell when loading htmlfontify

* lisp/htmlfontify.el (hfy-which-etags): Don't call a shell for
detecting the etags version (Bug#25468).
* test/lisp/htmlfontify-tests.el (htmlfontify-bug25468): Add unit
test.

7 years agoSlightly tune file-accessible-directory-p fix
Paul Eggert [Fri, 27 Jan 2017 16:56:34 +0000 (08:56 -0800)]
Slightly tune file-accessible-directory-p fix

* src/fileio.c (Ffile_accessible_directory_p):
Remove unnecessary test (Bug#25419).

7 years agoAdd \citetitle to biblatex cite format
Arash Esbati [Thu, 26 Jan 2017 19:25:16 +0000 (20:25 +0100)]
Add \citetitle to biblatex cite format

* lisp/textmodes/reftex-vars.el (reftex-cite-format-builtin): Add
\citetitle[*] to `reftex-cite-format' and bind them to keys i/I
per user request
http://lists.gnu.org/archive/html/auctex/2017-01/msg00049.html.

7 years agoFix charsets and encodings from non-file MIME parts
Lars Ingebrigtsen [Fri, 27 Jan 2017 12:53:47 +0000 (13:53 +0100)]
Fix charsets and encodings from non-file MIME parts

* lisp/gnus/mml.el (mml-generate-mime-1): Get the charsets and
encoding right for parts that do not originate from files.

7 years agoFix 'describe-variable' for longish variable values
Eli Zaretskii [Fri, 27 Jan 2017 10:27:50 +0000 (12:27 +0200)]
Fix 'describe-variable' for longish variable values

* lisp/help-fns.el (describe-variable): Don't accidentally remove
the last character of a variable's value.  (Bug#25545)

7 years agoEnsure last line is at window bottom in shell buffers
Eli Zaretskii [Fri, 27 Jan 2017 09:39:31 +0000 (11:39 +0200)]
Ensure last line is at window bottom in shell buffers

* lisp/shell.el (shell-mode): Use setq-local.  Set
scroll-conservatively to 101 locally.  See the discussion at
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00736.html
for the reasons.

7 years agoSupport Bash Ctrl-Z indication of directory name in term.el
Michael Hoffman [Fri, 27 Jan 2017 09:26:36 +0000 (11:26 +0200)]
Support Bash Ctrl-Z indication of directory name in term.el

* term.el (term-emulate-terminal): Do not display ?\032 escape
codes even when 'handled-ansi-message' is non-nil.  (Bug#11919)

Copyright-paperwork-exempt: yes

7 years agoDon't report zero errno for inaccessible directory
Eli Zaretskii [Fri, 27 Jan 2017 08:51:53 +0000 (10:51 +0200)]
Don't report zero errno for inaccessible directory

* src/fileio.c (Ffile_accessible_directory_p): Report EACCES when
a file handler reports a failure.  (Bug#25419)

7 years agoFix filenotify-tests on MS-Windows
Eli Zaretskii [Fri, 27 Jan 2017 08:28:15 +0000 (10:28 +0200)]
Fix filenotify-tests on MS-Windows

* test/lisp/filenotify-tests.el (file-notify-test04-file-validity)
(file-notify-test05-dir-validity)
(file-notify-test06-many-events)
(file-notify-test08-watched-file-in-watched-dir): Manually remove
the watch descriptor before calling file-notify--test-cleanup-p.
(Bug#25539)

7 years agopython-mode: Fix detection for opening blocks.
Hong Xu [Tue, 13 Dec 2016 01:55:25 +0000 (17:55 -0800)]
python-mode: Fix detection for opening blocks.

* python.el (python-info-dedenter-opening-block-positions): There
can't be any back-indented lines between an opening block and the
current line.

* python-tests.el (python-indent-electric-colon-4): Add an indent
test case where there is one-more indented previous opening block.

7 years agoFix Message check for bogus domain names
Lars Ingebrigtsen [Fri, 27 Jan 2017 00:04:59 +0000 (01:04 +0100)]
Fix Message check for bogus domain names

* lisp/gnus/message.el (message-make-fqdn): Fix check for
bogus system names (bug#24570).

7 years agoSubject: Restore correct Gnus newsgroup name after sending message
Øyvind Stegard [Fri, 27 Jan 2017 00:02:23 +0000 (01:02 +0100)]
Subject: Restore correct Gnus newsgroup name after sending message

* lisp/gnus/gnus-msg.el (gnus-msg-mail): Set the value of
gnus-newsgroup-name in the correct buffer (bug#24329).

Copyright-paperwork-exempt: yes

7 years agoMention the new Gnus sorting command
Lars Ingebrigtsen [Thu, 26 Jan 2017 23:33:03 +0000 (00:33 +0100)]
Mention the new Gnus sorting command

7 years agoDon't try to find charsets of non-text MIME parts
Lars Ingebrigtsen [Thu, 26 Jan 2017 23:29:20 +0000 (00:29 +0100)]
Don't try to find charsets of non-text MIME parts

* lisp/gnus/mml.el (mml-generate-mime-1): It seems nonsensical
to try to determine the charset of non-text message parts, so
skip that (bug#24190).  This will also remove messages like
"bunzip2ing /tmp/acsb.cpio.bz2...done" while sending messages
if you include such files.

7 years agoAdd new command gnus-article-sort-by-marks
Lars Ingebrigtsen [Thu, 26 Jan 2017 23:03:41 +0000 (00:03 +0100)]
Add new command gnus-article-sort-by-marks

* doc/misc/gnus.texi (Summary Sorting): Mention
gnus-summary-sort-by-marks.

* lisp/gnus/gnus-sum.el (gnus-article-sort-by-marks): New
function (bug#23393).
(gnus-thread-sort-by-marks): Ditto.
(gnus-summary-sort-by-mark): New command suggested by Dan Jacobson.
(gnus-summary-mode-map): Add keystroke.
(gnus-summary-make-menu-bar): Add to menu.

7 years agoMake `C-h b' work correctly in Gnus article buffer (bug#18257)
Katsumi Yamaoka [Thu, 26 Jan 2017 22:43:31 +0000 (22:43 +0000)]
Make `C-h b' work correctly in Gnus article buffer (bug#18257)

* lisp/gnus/gnus-art.el (gnus-article-describe-bindings):
Ignore summary commands that aren't bound to
gnus-article-read-summary-keys keys (bug#18257).

7 years agoFix crossposting in non-primary groups
Lars Ingebrigtsen [Thu, 26 Jan 2017 22:11:50 +0000 (23:11 +0100)]
Fix crossposting in non-primary groups

* lisp/gnus/message.el
(message-cross-post-followup-to-header): Gnus server prefixes
shouldn't be included in the group names (bug#21661).
(message-cross-post-followup-to): Ditto.

7 years agoGnus doc clarification
Lars Ingebrigtsen [Thu, 26 Jan 2017 22:00:24 +0000 (23:00 +0100)]
Gnus doc clarification

* doc/misc/gnus.texi (Unavailable Servers): Explicitly say
that "unreachable" is the same as disabling it (bug#21630).

7 years agoRemove dead code from rfc2047
Lars Ingebrigtsen [Thu, 26 Jan 2017 21:52:16 +0000 (22:52 +0100)]
Remove dead code from rfc2047

* lisp/mail/rfc2047.el (rfc2047-fold-field): Remove dead code.

It's been disabled since 2005, when I made the change with the
following comment.

(rfc2047-encode-message-header): Disabled header folding -- not
all headers can be folded, and this should be done by the message
composition mode.  Probably.  I think.

7 years agoFill too long mail headers
Lars Ingebrigtsen [Thu, 26 Jan 2017 21:51:19 +0000 (22:51 +0100)]
Fill too long mail headers

* lisp/gnus/message.el (message--fold-long-headers): New
function to fold too-long headers (bug#21608).
(message-send-mail): Use it to fill headers longer than 998
characters (which is the protocol limit).

7 years agoMake nndoc more resilient against corrupted files
Lars Ingebrigtsen [Thu, 26 Jan 2017 21:28:17 +0000 (22:28 +0100)]
Make nndoc more resilient against corrupted files

* lisp/gnus/nndoc.el (nndoc-possibly-change-buffer): Don't bug
out on invalid files, like invalid .gz files (bug#21538).
This may hinder Gnus from starting up.

7 years agoRespect buffer-local message-fcc-handler-function
Lars Ingebrigtsen [Thu, 26 Jan 2017 20:38:40 +0000 (21:38 +0100)]
Respect buffer-local message-fcc-handler-function

* lisp/gnus/message.el (message-do-fcc): Copy the local
variables from the Message buffer so that local settings of
`message-fcc-handler-function' etc are respected (bug#21174).

7 years ago(message-do-fcc): Modernise the code slightly.
Lars Ingebrigtsen [Thu, 26 Jan 2017 20:35:58 +0000 (21:35 +0100)]
(message-do-fcc): Modernise the code slightly.

* lisp/gnus/message.el (message-do-fcc): Modernise the code slightly.

7 years agoAvoid a regexp overflow in message-goto-body
Lars Ingebrigtsen [Thu, 26 Jan 2017 20:12:05 +0000 (21:12 +0100)]
Avoid a regexp overflow in message-goto-body

* lisp/gnus/message.el (message-goto-body-1): Avoid using a
complicated backtracking regexp, because they may overflow on
large headers (bug#21160).

7 years agoRefactor message-goto-body
Lars Ingebrigtsen [Thu, 26 Jan 2017 20:04:00 +0000 (21:04 +0100)]
Refactor message-goto-body

* lisp/gnus/message.el (message-goto-body-1): Refactor out for reuse.

7 years agoFix typo in last checkin
Lars Ingebrigtsen [Thu, 26 Jan 2017 18:45:39 +0000 (19:45 +0100)]
Fix typo in last checkin

* lisp/gnus/nnimap.el (nnimap-shell-program): Document
nnimap-shell-program (bug#20651).

7 years agoDocument nnimap-shell-program
Lars Ingebrigtsen [Thu, 26 Jan 2017 18:44:01 +0000 (19:44 +0100)]
Document nnimap-shell-program

* lisp/gnus/nnimap.el (nnimap-shell-program): Document
nnimap-shell-program (bug#20651).

7 years agoDocument :shell-command in `make-network-process'
Lars Ingebrigtsen [Thu, 26 Jan 2017 18:41:56 +0000 (19:41 +0100)]
Document :shell-command in `make-network-process'

* doc/lispref/processes.texi (Network): Document :shell-command.

* lisp/net/network-stream.el (open-network-stream): Document
the :shell-command parameter (bug#20651).

7 years agoGnus doc clarification
Lars Ingebrigtsen [Thu, 26 Jan 2017 18:21:59 +0000 (19:21 +0100)]
Gnus doc clarification

* lisp/gnus/gnus-sum.el (gnus-summary-save-article): Mention
the gnus-prompt-before-saving variable (bug#20500).

7 years agoFix the previous mml patch better
Lars Ingebrigtsen [Thu, 26 Jan 2017 18:09:58 +0000 (19:09 +0100)]
Fix the previous mml patch better

* lisp/gnus/mml.el (mml-minibuffer-read-file): Fix the
previous patch in a better way (bug#20480).

7 years agoGive a slight better error message in mml-minibuffer-read-file
Lars Ingebrigtsen [Thu, 26 Jan 2017 18:07:00 +0000 (19:07 +0100)]
Give a slight better error message in mml-minibuffer-read-file

* lisp/gnus/mml.el (mml-minibuffer-read-file): Give a slightly
better error message when the user enters nothing (bug#20480).

7 years ago; Just use octal
Mark Oteiza [Thu, 26 Jan 2017 18:12:54 +0000 (13:12 -0500)]
; Just use octal

* lisp/recentf.el (recentf-save-file-modes): Write file mode in octal.

7 years agoMake eww buffers prettier in the buffer listing
Lars Ingebrigtsen [Thu, 26 Jan 2017 17:32:48 +0000 (18:32 +0100)]
Make eww buffers prettier in the buffer listing

* lisp/net/eww.el (eww-render): Put the currently visited URL
into the buffer listing (bug#23738).
(eww-render): Ditto.

7 years agoAllow mml-attach-file to prompt less
Lars Ingebrigtsen [Thu, 26 Jan 2017 17:19:46 +0000 (18:19 +0100)]
Allow mml-attach-file to prompt less

* lisp/gnus/mml.el (mml-attach-file): If given a prefix, don't
prompt for type/description/disposition, but use defaults
(bug#19202).

7 years agoDon't allow message-newline-and-reformat to be run outside the body
Lars Ingebrigtsen [Thu, 26 Jan 2017 14:07:38 +0000 (15:07 +0100)]
Don't allow message-newline-and-reformat to be run outside the body

* lisp/gnus/message.el (message-newline-and-reformat): Error
out if run outside the body of a message (bug#18820).

7 years agoReplace QUIT with maybe_quit
Paul Eggert [Thu, 26 Jan 2017 05:13:19 +0000 (21:13 -0800)]
Replace QUIT with maybe_quit

There’s no longer need to have QUIT stand for a slug of C statements.
Use the more-obvious function-call syntax instead.
Also, use true and false when setting immediate_quit.
These changes should not affect the generated machine code.
* src/lisp.h (QUIT): Remove.  All uses replaced by maybe_quit.

7 years agoA quicker check for quit
Paul Eggert [Thu, 26 Jan 2017 04:27:45 +0000 (20:27 -0800)]
A quicker check for quit

On some microbenchmarks this lets Emacs run 60% faster on my
platform (AMD Phenom II X4 910e, Fedora 25 x86-64).
* src/atimer.c: Include keyboard.h, for pending_signals.
* src/editfns.c (Fcompare_buffer_substrings):
* src/fns.c (Fnthcdr, Fmemq, Fmemql, Fassq, Frassq, Fplist_put)
(Fnconc, Fplist_member):
Set and clear immediate_quit before and after loop instead of
executing QUIT each time through the loop.  This is OK for loops
that affect only locals.
* src/eval.c (process_quit_flag): Now static.
(maybe_quit): New function, containing QUIT’s old body.
* src/fns.c (rarely_quit): New function.
(Fmember, Fassoc, Frassoc, Fdelete, Fnreverse, Freverse)
(Flax_plist_get, Flax_plist_put, internal_equal, Fnconc):
Use it instead of QUIT, for
speed in tight loops that might modify non-locals.
* src/keyboard.h (pending_signals, process_pending_signals):
These belong to keyboard.c, so move them here ...
* src/lisp.h: ... from here.
(QUIT): Redefine in terms of the new maybe_quit function, which
contains this macro’s old definiens.  This works well with branch
prediction on processors with return stack buffers, e.g., x86
other than the original Pentium.

7 years agoSimplify make-list implementation
Paul Eggert [Thu, 26 Jan 2017 03:07:57 +0000 (19:07 -0800)]
Simplify make-list implementation

* src/alloc.c (Fmake_list): Don’t unroll loop, as the complexity
is not worth it these days.

7 years agoMake use of cl-loop destructuring
Mark Oteiza [Thu, 26 Jan 2017 02:34:46 +0000 (21:34 -0500)]
Make use of cl-loop destructuring

* lisp/progmodes/js.el (js--get-tabs): Replace extraneous bits with
destructuring.
(with-js): Add declare forms.

7 years agoRevert "Bind C-c keys in the article buffer"
Lars Ingebrigtsen [Wed, 25 Jan 2017 21:53:07 +0000 (22:53 +0100)]
Revert "Bind C-c keys in the article buffer"

This reverts commit 6b4195f2ace1f6328c5a833fde40f39babef4fa6.

The commit somehow lead to problems in other parts of Emacs.

7 years ago; * doc/lispref/lists.texi (List Elements): Fix last change.
Eli Zaretskii [Wed, 25 Jan 2017 20:49:35 +0000 (22:49 +0200)]
; * doc/lispref/lists.texi (List Elements): Fix last change.

7 years agoDocument how to quote MML tags
Lars Ingebrigtsen [Wed, 25 Jan 2017 20:47:28 +0000 (21:47 +0100)]
Document how to quote MML tags

* doc/misc/emacs-mime.texi (MML Definition): Mention how to
quote MML tags (bug#18881).

7 years agoMake address parsing more robust
Lars Ingebrigtsen [Wed, 25 Jan 2017 20:21:40 +0000 (21:21 +0100)]
Make address parsing more robust

* lisp/mail/ietf-drums.el (ietf-drums-parse-address): Don't
bug out on addresses like
(ietf-drums-parse-address "\"Foo \"bar\" <larsi@gnus.org>")
(bug#18572).

7 years agoFix the %P (line number) thing in Gnus summary buffers
Lars Ingebrigtsen [Wed, 25 Jan 2017 19:57:52 +0000 (20:57 +0100)]
Fix the %P (line number) thing in Gnus summary buffers

* lisp/gnus/gnus-salt.el (gnus-pick-line-number): Remove hack.

* lisp/gnus/gnus-sum.el (gnus-summary-read-group-1): Reset the
"pick" mode line number on entry instead of relying in a hack (bug#18311).

7 years agoFix wrong documentation on nnmairix keystrokes
Lars Ingebrigtsen [Wed, 25 Jan 2017 19:43:27 +0000 (20:43 +0100)]
Fix wrong documentation on nnmairix keystrokes

* doc/misc/gnus.texi (nnmairix keyboard shortcuts): The
nnmairix commands are on G G, not $ (bug#18260).

7 years agoBind C-c keys in the article buffer
Lars Ingebrigtsen [Wed, 25 Jan 2017 19:40:27 +0000 (20:40 +0100)]
Bind C-c keys in the article buffer

* lisp/gnus/gnus-art.el (gnus-article-mode-map): Also bind the
C-c keys so that they execute in the summary buffer
(bug#18257).  This makes commands like `C-c C-f' work from the
article buffer.

7 years agoDon't mark articles in Gnus as displayed when they aren't
Lars Ingebrigtsen [Wed, 25 Jan 2017 19:30:44 +0000 (20:30 +0100)]
Don't mark articles in Gnus as displayed when they aren't

* lisp/gnus/gnus-sum.el (gnus-summary-read-group-1): Don't
mark any articles as selected if we're not selecting any
articles (bug#18255).

7 years agoMove cXXXr and cXXXXr to subr.el
Mark Oteiza [Wed, 25 Jan 2017 19:21:10 +0000 (14:21 -0500)]
Move cXXXr and cXXXXr to subr.el

* etc/NEWS: Mention new core Elisp.
* doc/lispref/lists.texi (List Elements): Document and index the new
functions.
* doc/misc/cl.texi (List Functions): Change "defines" to "aliases".
* lisp/subr.el (caaar, caadr, cadar, caddr, cdaar, cdadr, cddar)
(cdddr, caaaar caaadr, caadar, caaddr, cadaar, cadadr, caddar):
(cadddr, cdaaar, cdaadr, cdadar, cdaddr, cddaar, cddadr, cdddar):
(cddddr): New functions.
* lisp/emacs-lisp/cl-lib.el (cl-caaar, cl-caadr, cl-cadar, cl-caddr):
(cl-cdaar, cl-cdadr, cl-cddar cl-cdddr, cl-caaaar cl-caaadr):
(cl-caadar, cl-caaddr, cl-cadaar, cl-cadadr, cl-caddar, cl-cadddr):
(cl-cdaaar, cl-cdaadr, cl-cdadar, cl-cdaddr, cl-cddaar, cl-cddadr):
(cl-cdddar, cl-cddddr): Alias to new subr functions.
* lisp/emacs-lisp/cl.el (cl-unload-function): Remove cXXXr and cXXXXr
elements.

7 years agoOnly save .newsrc file if the native method is NNTP
Lars Ingebrigtsen [Wed, 25 Jan 2017 18:30:33 +0000 (19:30 +0100)]
Only save .newsrc file if the native method is NNTP

* lisp/gnus/gnus-start.el (gnus-save-newsrc-file): Only save
the .newsrc file if the native select method is NNTP
(bug#18198).  This avoids problems with invalid IMAP group
names and the like in the .newsrc file.

7 years agoOnly save .newsrc file if the native method is NNTP
Lars Ingebrigtsen [Wed, 25 Jan 2017 18:30:22 +0000 (19:30 +0100)]
Only save .newsrc file if the native method is NNTP

* lisp/gnus/gnus-start.el (gnus-save-newsrc-file): Only save
the .newsrc file if the native select method is NNTP
(bug#18198).  This avoids problems with invalid IMAP group
names and the like in the .newsrc file.

7 years agoGnus custom spec fix
Lars Ingebrigtsen [Wed, 25 Jan 2017 17:31:42 +0000 (18:31 +0100)]
Gnus custom spec fix

* lisp/gnus/gnus-art.el (gnus-signature-limit): Fix customize
spec to match the doc string (bug#17679).

7 years agoClarify confusing Gnus error message
Lars Ingebrigtsen [Wed, 25 Jan 2017 17:27:33 +0000 (18:27 +0100)]
Clarify confusing Gnus error message

* lisp/gnus/gnus-topic.el (gnus-topic-unindent): Clarify
confusing error message (bug#17677).

7 years agoMake C-u C-x m work with Message as documented
Lars Ingebrigtsen [Wed, 25 Jan 2017 17:14:00 +0000 (18:14 +0100)]
Make C-u C-x m work with Message as documented

* lisp/gnus/message.el (message-mail): Respect the CONTINUE
parameter (bug#17175).