Eric Abrahamsen [Thu, 4 May 2017 05:08:49 +0000 (13:08 +0800)]
Fix for parsing delimited strings
* lisp/gnus/gnus-search.el (gnus-search-query-next-symbol): Hadn't
quite gotten this all the way over to the new definition of
`gnus-search-query-return-string'.
Eric Abrahamsen [Thu, 4 May 2017 05:05:56 +0000 (13:05 +0800)]
Some refactoring of gnus-search-run-query
* lisp/gnus/gnus-search.el (gnus-search-run-query): Move results
sorting here.
(gnus-search-run-search): No need to sort here. Also, loop
accept-process-output on process-live-p, apparently it doesn't
necessarily get *all* the output.
Eric Abrahamsen [Thu, 4 May 2017 05:00:00 +0000 (13:00 +0800)]
Refactor parsing/no parsing of queries
* lisp/gnus/gnus-search.el (gnus-search-prepare-query): Only check
`gnus-search-use-parsed-queries' here.
(gnus-search-make-query-string): New engine method responsible for
main final check of whether to use a parsed or raw query.
Eric Abrahamsen [Wed, 3 May 2017 20:08:50 +0000 (13:08 -0700)]
Change "no-parse" query meta-key to "raw"
* lisp/gnus/gnus-search.el (gnus-search-prepare-query): Easier to
type, and makes a little more sense.
* lisp/gnus/gnus-group.el (gnus-group-make-search-group): Swap out
here.
Eric Abrahamsen [Mon, 1 May 2017 21:23:22 +0000 (14:23 -0700)]
Remove Hyrex search engine
* lisp/gnus/gnus-search.el: Yank the whole engine out, it was already
obsolete, and now seems to not exist at all.
* doc/misc/gnus.texi: Remove from docs.
Eric Abrahamsen [Tue, 2 May 2017 22:04:20 +0000 (15:04 -0700)]
Handle regexp and wildcard search terms
* lisp/gnus/gnus-search.el (gnus-search-query-return-string): Fix up
this function to be a little more general. Quoted strings are now
returned with quotes.
(gnus-search-run-search): Pick up and (partially) use the FUZZY IMAP
capability.
(gnus-search-transform-expression): In IMAP, check for wildcards and
turn them into FUZZY as appropriate. Drop regexps.
(gnus-search-indexed-massage-output):
(gnus-search-transform-expression): In Notmuch, only drop leading
asterisks.
* test/lisp/gnus/search-tests.el (gnus-s-delimited-string): Add test
for `gnus-search-query-return-string'.
Eric Abrahamsen [Tue, 2 May 2017 22:05:11 +0000 (15:05 -0700)]
Create general gnus-search-indexed-massage-output method
* lisp/gnus/gnus-search.el (gnus-search-indexed-massage-output): Take
the namazu version, and install it as general for all
gnus-search-indexed engines. Probably they all can use the same
method, but I haven't taken the time to test them all yet.
Eric Abrahamsen [Thu, 27 Apr 2017 21:00:41 +0000 (14:00 -0700)]
Move search group creation functions to gnus-group.el
* lisp/gnus/gnus-group.el (gnus-group-make-search-group,
gnus-group-make-permanent-search-group): These two functions live in
gnus.group.el now.
* lisp/gnus/gnus-search.el: Remove from here.
Eric Abrahamsen [Mon, 1 May 2017 19:31:55 +0000 (12:31 -0700)]
Add function gnus-search-prepare-query
* lisp/gnus/gnus-search.el (gnus-search-prepare-query): Check for
"top-level" meta search keys and parse them into the query
structure, alongside the query itself.
Eric Abrahamsen [Wed, 29 Mar 2017 16:11:47 +0000 (09:11 -0700)]
WIP on a generalized search query language for Gnus
* lisp/gnus/nnir.el (nnir-search-parse-query, nnir-query-next-expr,
nnir-query-next-term, nnir-query-next-symbol,
nnir-query-peek-symbol, nnir-query-end-of-input,
nnir-query-parse-kv, nnir-query-parse-date nnir-query-parse-mark,
nnir-query-parse-contact): Functions for reading the generalized
search query language and parsing it into a sexp.
(gnus-search-engine, gnus-search-process, gnus-search-indexed): Base
classes for creating search-engine specific engine classes.
(nnir-run-search): Method for running one engine's search routine.
(nnir-search-transform-top-level, nnir-search-transform-expression):
Methods for transforming the parsed sexp query format into a
backend-specific string.
(nnir-search-indexed-search-command,
nnir-search-indexed-massage-output): Methods used by indexed
backends to retrieve their results.
* test/lisp/gnus/search-tests.el: Basic set of tests for the parsing
routine.
Andrew G Cohen [Sat, 13 May 2017 07:05:27 +0000 (15:05 +0800)]
Improve search and select group creation
* lisp/gnus/gnus-group.el (gnus-group-make-search-group): Make sure
new group is inserted into the group buffer.
* lisp/gnus/nnselect.el (nnselect-request-create-group): Improve input
of selection function.
Andrew G Cohen [Fri, 12 May 2017 01:40:03 +0000 (09:40 +0800)]
Redo entry functions for making search groups
* lisp/gnus/gnus-group.el (gnus-group-make-search-group):
(gnus-group-read-ephemeral-search-group): Rename these functions to be
more consistent with other group creation functions, and move to
gnus-group.el.
* lisp/gnus/nnir.el (nnir-make-specs): Refactor new function to ease
search group creation.
Andrew G Cohen [Tue, 9 May 2017 02:08:55 +0000 (10:08 +0800)]
Improve group-info handling in nnselect
* lisp/gnus/nnselect.el (nnselect-request-group):
(nnselect-push-info): Use info argument to functions or retrieve the
group info. If the info is null (for example the group might have been
killed) don't try to update it.
Andrew G Cohen [Mon, 8 May 2017 23:51:56 +0000 (07:51 +0800)]
Remove unnecessary listing in nnselect-categorize
* lisp/gnus/nnselect.el (nnselect-categorize): Remove unneeded extra
list around a category value.
(nnselect-retrieve-headers):
(nnselect-request-expire-articles):
(nnselect-request-set-mark):
(nnselect-request-update-info):
(nnselect-request-thread):
(nnselect-push-info):
(gnus-group-make-permanent-search-group): Accommodate change to
nnselect-categorize.
* lisp/gnus/nnir.el (nnir-run-query): Accommodate change to
nnselect-categorize.
Andrew G Cohen [Mon, 8 May 2017 23:44:19 +0000 (07:44 +0800)]
Use gnus-newsgroup-selection instead of nnselect-artlist
* lisp/gnus/nnselect.el (nnselect-retrieve-headers):
(nnselect-request-thread):
(nnselect-retrieve-headers):
(nnselect-close-group): Use the summary local variable
gnus-newsgroup-selection rather than the internal nnselect-artlist
variable.
(nnselect-request-group):
(nnselect-request-move-article):
(nnselect-request-expire-articles):
(nnselect-warp-to-article):
(nnselect-request-set-mark):
(nnselect-request-thread): Don't unnecessarily retrieve the
nnselect-artlist value.
Andrew G Cohen [Sat, 6 May 2017 13:24:37 +0000 (21:24 +0800)]
Fix pushing marks on nnselect exit
* lisp/gnus/nnselect.el (nnselect-push-info): Deal with scoring.
Ensure that mark lists are properly compressed before saving. Add only
the group-specific articles to the `seen' lists.
Andrew G Cohen [Sat, 29 Apr 2017 02:03:11 +0000 (10:03 +0800)]
Disable nnselect-server-opened check
* lisp/gnus/nnselect.el (nnselect-server-opened): Always return t for
now. This is disabled for testing purposes.
(nnselect-possibly-change-group): Eliminate unnecessary test for
server openness.
Andrew G Cohen [Fri, 28 Apr 2017 23:49:39 +0000 (07:49 +0800)]
Remove unnecessary check gnus-nnselect-group-p
* lisp/gnus/gnus-msg.el (gnus-setup-message):
* lisp/gnus/gnus-sum.el (gnus-summary-line-format-alist): No need to
check that we are coming from an nnselect group now that we use
gnus-newsgroup-selection.
Andrew G Cohen [Fri, 28 Apr 2017 23:43:54 +0000 (07:43 +0800)]
Don't stomp on local variables in gnus-msg
* lisp/gnus/gnus-msg.el (gnus-setup-message):
(gnus-msg-mail):
(gnus-group-mail):
(gnus-group-post-news):
(gnus-summary-news-other-window):
(gnus-summary-post-news): Use let rather than setq for temporary
overriding of gnus-newsgroup-name.
* lisp/gnus/gnus-sum.el (gnus-newsgroup-selection): Introduce a new
gnus-summary-local-variable to hold an nnselect article list.
* lisp/gnus/nnselect.el: Use the summary-local variable where
appropriate.
Andrew G Cohen [Tue, 25 Apr 2017 01:55:36 +0000 (09:55 +0800)]
Temporary function to ease search group creation
* lisp/gnus/nnselect.el (gnus-group-make-permanent-search-group):
(gnus-group-make-search-group): Allow permanent group creation.
* lisp/gnus/gnus-group.el (gnus-group-group-map): Bind it to "G g" in
the group buffer.
Further robustify cedet bootstrap to loaddefs not yet built
* lisp/cedet/semantic/util.el (semantic-something-to-tag-table):
Avoid void-function error when bootstrapping and semantic/loaddefs.el
does not yet exist.
* erc-backend.el:
erc-response: Add `tags' element.
Add (erc-parse-tags).
(erc-parse-server-response): Use (erc-parse-tags) to parse message
tags (if any), and store them in `erc-resopnse' struct.
* erc.el: (erc-display-message): Expose message tags with text
properties of the corresponding message line.
Philipp Stephani [Thu, 20 Apr 2017 13:41:15 +0000 (15:41 +0200)]
Add missing remappings for Ido mode
Among others, add a remapping for C-x 4 d, cf. Bug#26360.
* lisp/ido.el (ido-mode): Remap missing commands.
(ido-file-internal, ido-visit-buffer): Add support for new
methods.
(ido-display-buffer-other-frame)
(ido-find-alternate-file-other-window, ido-dired-other-window)
(ido-dired-other-frame): New commands.
* test/lisp/ido-tests.el (ido-tests--other-window-frame): Add unit
test for the bindings.
Andrew G Cohen [Sun, 23 Apr 2017 10:35:04 +0000 (18:35 +0800)]
Initial landing of gnus nnselect backend
This is a new virtual backend for gnus, wherein any collection of
articles can be viewed as a gnus group (permanent or ephemeral).
* lisp/gnus/nnselect.el: New file.
* lisp/gnus/nnir.el: Remove the nnir backend but leave the search
functions.
* lisp/gnus/nnimap.el: Replace nnir backend related items with
nnselect.
(gnus-refer-thread-use-search): Renamed from gnus-refer-thread-use-nnir
(nnselect-search-thread): New function.
(nnimap-request-thread): Use it.
* lisp/gnus/gnus-group.el (gnus-group-make-search-group): New function
replacing gnus-group-make-nnir-group.
* lisp/gnus/gnus-msg.el: Replace nnir backend related items with
nnselect.
(gnus-setup-message): Pass virtual group article number to
gnus-inews-add-send-actions.
* lisp/gnus/gnus-registry.el (gnus-registry-action): Find the
originating article group when in an nnselect group.
(gnus-registry-ignore-group-p): Ignore virtual groups.
* lisp/gnus/gnus-srvr.el (gnus-group-make-search-group): Use new
function.
* lisp/gnus/gnus-sum.el (nnselect-article-): Use new nnselect backend
functions.
(gnus-summary-line-format-alist): Rework specs specific to nnselect
groups.
(nnselect-artlist):
(gnus-summary-local-variables): A new group-local variable.
"Fix ert-tests when running compiled" 2016-12-06 accidentally
introduced a dependency on `bytecomp' into `ert'. As mentioned in
"Avoid ert test failures" 2017-04-18, the accidental dependency of ert
on bytecomp was masked by loading other libraries until recently.
* lisp/emacs-lisp/ert.el (ert--expand-should-1): Only use
`byte-compile-macro-environment' if it's bound.
* test/src/eval-tests.el: Add defvar for dynamic variable
`byte-compile-debug'.
Andrew G Cohen [Sun, 23 Apr 2017 00:25:02 +0000 (08:25 +0800)]
Allow limiting gnus summary buffers to a thread
* lisp/gnus/gnus-sum.el (gnus-summary-limit-include-thread): Include
an optional argument to allow limiting the summary buffer to just the
thread-related articles.
(gnus-refer-thread-limit-to-thread): Introduce customizable variable
to control whether thread-referral adds the thread to the summary
buffer or limits to just the thread.
(gnus-summary-refer-thread): Use the new variable.
Andrew G Cohen [Sun, 23 Apr 2017 00:13:09 +0000 (08:13 +0800)]
Correct gnus-newsgroup-limits in gnus when including thread
* lisp/gnus/gnus-sum.el (gnus-summary-limit-include-thread): Should
only add one list of thread-related articles to gnus-newsgroup-limits
rather than two.
Andrew G Cohen [Sun, 23 Apr 2017 00:07:22 +0000 (08:07 +0800)]
Improve gnus thread matching of similar subjects
* lisp/gnus/gnus-sum.el (gnus-summary-limit-include-thread):
Use the more liberal gnus-general-simplify-subject regexp to
find thread articles with similar subjects.
Noam Postavsky [Thu, 16 Mar 2017 02:27:27 +0000 (22:27 -0400)]
Add new `lisp-indent-region' that doesn't reparse the code.
Both `lisp-indent-region' and `lisp-indent-line' now use `syntax-ppss'
to get initial state, so they will no longer indent string literal
contents.
* lisp/emacs-lisp/lisp-mode.el (lisp-ppss): New function, like
`syntax-ppss', but with a more dependable item 2.
(lisp-indent-region): New function, like `indent-region-line-by-line'
but additionally keep a running parse state to avoid reparsing the
code repeatedly. Use `lisp-ppss' to get initial state.
(lisp-indent-line): Take optional PARSE-STATE argument, pass it to
`calculate-lisp-indent', use `lisp-ppss' if not given.
(lisp-mode-variables): Set `indent-region-function' to
`lisp-indent-region'.
Noam Postavsky [Thu, 16 Mar 2017 01:59:13 +0000 (21:59 -0400)]
Remove ignored argument from lisp-indent-line
* lisp/emacs-lisp/lisp-mode.el (lisp-indent-line): Remove WHOLE-EXP
argument, the behavior has long since been handled in
`indent-for-tab-command'. Also remove redundant `beg' and `shift-amt'
variables and use `indent-line-to'.
Noam Postavsky [Mon, 13 Mar 2017 03:59:19 +0000 (23:59 -0400)]
Don't reparse the sexp in indent-sexp (Bug#25122)
* lisp/emacs-lisp/lisp-mode.el (calculate-lisp-indent): Let
PARSE-START be a parse state that can be reused.
(indent-sexp): Pass the running parse state to calculate-lisp-indent
instead of the sexp beginning position. Saving the
CONTAINING-SEXP-START returned by `calculate-lisp-indent' is no longer
needed. Don't bother stopping if we don't descend below init-depth,
since we now alway scan the whole buffer (via syntax-ppss) anyway.
* test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp): Add blank
line to test case.
b-c--cond-jump-table-info: Use correct body for singleton clauses
* lisp/emacs-lisp/bytecomp.el (byte-compile-cond-jump-table-info):
When a clause's body consists of a single constant expression, use
that expression as the body to be compiled. This fixes switch bytecode
evaluating to nil to such clauses.
When using ffap-other-window, don't change the window configuration
unless a new buffer has actually been created (Bug#25352).
* lisp/ffap.el (ffap-other-frame): Don't change the window
configuration if no new buffer has been created.
* test/lisp/ffap-tests.el (ffap-other-window--bug-25352): Add unit
test.
Alan Mackenzie [Sat, 22 Apr 2017 14:45:24 +0000 (14:45 +0000)]
Fix fontification of C++ declaration with type FOO::FOO.
* lisp/progmodes/cc-engine.el (c-find-decl-spots): Initialize
cfd-top-level properly.
(c-forward-decl-or-cast-1): On finding FOO::FOO, check it is followed by "("
before deciding it is a constructor.
* lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare): Negate the
result of the c-bs-at-toplevel-p call passed to c-font-lock-declarators
(simple bug fix).
Alan Third [Thu, 20 Apr 2017 14:25:56 +0000 (15:25 +0100)]
Add no-accept-focus and frame-list-z-order to NS port
* lisp/frame.el (frame-list-z-order): Add NS.
* src/nsfns.m: Add x_set_no_accept_focus to handler struct.
(Fx_create_frame): Handle no-accept-focus parameter.
(ns_window_is_ancestor):
(Fns_frame_list_z_order): New functions.
* src/nsterm.m (x_set_no_accept_focus): New function.
(initFrameFromEmacs): Use EmacsWindow instead of EmacsFSWindow for
non-fullscreen windows.
(EmacsWindow:canBecomeKeyWindow): New function.
Stefan Monnier [Fri, 21 Apr 2017 16:12:42 +0000 (12:12 -0400)]
* lisp/emacs-lisp/cl-macs.el: Fix symbol-macrolet
Revert 0d112c00ba0ec14bd3014efcd3430b9ddcfe1fc1 (to fix bug#26325)
and use a different fix for bug#26068.
(cl--symbol-macro-key): New function.
(cl--sm-macroexpand, cl-symbol-macrolet): Use it instead of `symbol-name`.
* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-symbol-macrolet):
Failure is not expected any more.
Eli Zaretskii [Fri, 21 Apr 2017 08:10:14 +0000 (11:10 +0300)]
Avoid infinite loop in redisplay when header-line-format is invalid
* src/xdisp.c (handle_invisible_prop): Avoid inflooping when the
string has an invalid %-construct in it and is displayed as part
of mode-line or header-line. (Bug#26586)
Treat non-erroring lisp call as successful eshell command (Bug#26161)
This lets a compound command like 'cd .. && echo ok' print 'ok',
similar to how most other shells behave.
* lisp/eshell/esh-cmd.el (eshell-exit-success-p): Only check if the
last exit code was zero, rather than first checking whether the last
command returned nil.
(eshell-exec-lisp): Set `eshell-last-command-status' to 1 on error.
Reuben Thomas [Thu, 2 Mar 2017 12:50:06 +0000 (12:50 +0000)]
Fix reading of tab settings in whitespace-mode
lisp/whitespace.el (whitespace-indent-tabs-mode)
whitespace-tab-width): Remove these variables. The underlying
variables `indent-tabs-mode' and `tab-width' are already buffer-local
when needed, and whitespace-mode never changes them.
(whitespace-ensure-local-variables): Remove this function, which only
existed to set the above variables.
(whitespace-cleanup-region, whitespace-regexp)
(whitespace-indentation-regexp, whitespace-report-region)
(whitespace-turn-on, whitespace-color-on): Adjust these functions to
use `indent-tabs-mode' and `tab-width' directly, and not call
`whitespace-ensure-local-variables'.
bytecomp: Don't inline functions that use byte-switch (Bug#26518)
* lisp/emacs-lisp/bytecomp.el (byte-compile-unfold-bcf): Don't inline
FORM if the bytecode uses the byte-switch instruction. It is
impossible to guess the correct stack depth while inlining such
bytecode, resulting in faulty code.
Stefan Monnier [Thu, 20 Apr 2017 00:43:41 +0000 (20:43 -0400)]
Use substring completion for Info menus and index
* lisp/info.el (Info-complete-menu-item): Add `category' metadata.
(Info-menu): Simplify now that we use the `default' arg of completing-read.
* lisp/minibuffer.el (completion-category-defaults): Use substring
completion for `info-menu`.
Pcase is macros, so these should have used eval-when-compile.
Anyway, pcase entry points are autoloaded, so the compiler handles it.
* lisp/profiler.el, lisp/emacs-lisp/eieio-core.el:
* lisp/emacs-lisp/generator.el, lisp/emacs-lisp/subr-x.el:
* lisp/progmodes/xref.el: No need to require pcase.
Alan Third [Fri, 14 Apr 2017 09:02:38 +0000 (10:02 +0100)]
Add new frame functionality to NS port
* lisp/frame.el (frame-restack): Call ns-frame-restack.
* src/keyboard.c (kbd_buffer_get_event) [HAVE_NS]: Enable
MOVE_FRAME_EVENT handling.
* src/frame.h:
* src/frame.c: Enable 'z-group', 'undecorated' and 'parent' frame
definitions.
* src/nsfns.m: Add x_set_z_group, x_set_parent_frame and
x_set_undecorated (Cocoa only) to handler struct.
(Fx_create_frame): Handle 'z-group', 'parent-frame' and 'undecorated'
frame parameter.
(Fns_frame_restack): New function.
* src/nsmenu.m (free_frame_tool_bar, update_frame_tool_bar):
FRAME_TOOLBAR_HEIGHT is no longer a variable.
* src/nsterm.h (NS_PARENT_WINDOW_LEFT_POS, NS_PARENT_WINDOW_TOP_POS):
Add #defines to find the screen position of the parent frame.
(NS_TOP_POS): Remove defun.
(EmacsView): Remove redundant toolbar variables and add createToolbar
method.
(FRAME_NS_TITLEBAR_HEIGHT, FRAME_TOOLBAR_HEIGHT): Always calculate the
values instead of storing them in a variable.
* src/nsterm.m (x_set_offset, windowDidMove): Take parent frame
position into account when positioning frames.
(initFrameFromEmacs): Remove toolbar creation code and handle new
frame parameters.
(x_set_window_size): Remove toolbar height calculation.
(x_set_z_group):
(x_set_parent_frame):
(x_set_undecorated) [NS_IMPL_COCOA]: New function.
(x_destroy_window): Detach parent if child closes.
(updateFrameSize): Change NSTRACE message to reflect new reality and
no longer reset frame size.
(windowWillResize): Don’t change NS window name when the titlebar
is invisible.
(createToolbar): Move toolbar creation code into it’s own method.
(toggleFullScreen): FRAME_TOOLBAR_HEIGHT and FRAME_NS_TITLEBAR_HEIGHT
are no longer variables.
(windowDidMove): Fire MOVE_FRAME_EVENT Emacs event.
* lisp/doc-view.el, lisp/filenotify.el, lisp/info-look.el:
* lisp/svg.el, lisp/emacs-lisp/byte-opt.el, lisp/net/shr.el:
* lisp/textmodes/sgml-mode.el, test/lisp/dom-tests.el:
No need to load subr-x at run-time.
* lisp/gnus/nnheader.el: No need to load subr-x.
; * lisp/emacs-lisp/subr-x.el, lisp/gnus/message.el, lisp/net/nsm.el:
; Comments.
* lisp/emacs-lisp/ert.el (ert--expand-should-1):
Avoid errors related to undefined byte-compile-macro-environment.
Somehow masked until very recently because loading seq (eg)
loads bytecomp. http://hydra.nixos.org/build/51730765
Noam Postavsky [Sun, 26 Mar 2017 02:41:34 +0000 (22:41 -0400)]
Fix find-library-name for load-history entries with nil FILE-NAME (Bug#26355)
* lisp/emacs-lisp/find-func.el (find-library--from-load-history):
Rename from find-library--from-load-path. Check for `load-history'
entries with nil FILE-NAMEs. Simplify by not double
checking for suffixes and making use of `locate-file'.