commit 319eeeb0fb154a0cd1d36ec33c68029ff9d6c290 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Wed Jun 24 23:34:26 2015 -0700 Get ‘./configure; make -C src emacs’ to work Without this fix, lib/fcntl.h isn't built in time (Bug#20894). * lib-src/Makefile.in (../lib/libgnu.a): * src/Makefile.in ($(lib)/libgnu.a): Build all, not libgnu.a. diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 6b5d379..a175967 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -350,7 +350,7 @@ TAGS: etags${EXEEXT} etags *.[ch] ../lib/libgnu.a: $(config_h) - $(MAKE) -C ../lib libgnu.a + $(MAKE) -C ../lib all regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h) $(AM_V_CC)$(CC) -c $(CPP_CFLAGS) $< diff --git a/src/Makefile.in b/src/Makefile.in index e5c5ddb..bfb911e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -556,7 +556,7 @@ globals.h: gl-stamp; @true $(ALLOBJS): globals.h $(lib)/libgnu.a: $(config_h) - $(MAKE) -C $(lib) libgnu.a + $(MAKE) -C $(lib) all ## We have to create $(etc) here because init_cmdargs tests its ## existence when setting Vinstallation_directory (FIXME?). commit 93f4f67ba93b78e8b31e498e8ce7bce4c8298b76 Author: Paul Eggert Date: Wed Jun 24 20:10:03 2015 -0700 Fix GC bugs --with-wide-int and Qnil == 0 Use the same alignment for the !USE_LSB_TAG case as for the more-typical USE_LSB_TAG case. The attempt to support arbitrary alignments with !USE_LSB_TAG had subtle bugs in garbage collection once we changed the representation of symbols so that Qnil == 0. Problem reported by Eli Zaretskii (Bug#20862). * src/alloc.c (XMALLOC_HEADER_ALIGNMENT) [XMALLOC_OVERRUN_CHECK]: * src/alloc.c (vector_alignment, union aligned_Lisp_Symbol) (union aligned_Lisp_Misc, maybe_lisp_pointer, pure_alloc): Use same alignment for !USE_LSB_TAG as for USE_LSB_TAG. * src/alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): Remove. This optimization in the !USE_LSB_TAG case is no longer valid when symbols are represented via offsets. Change the only use to assume that pointers might hide in objects. * src/lisp.h (alignas) [!USE_LSB_TAG]: Require support in this case, too. (TAG_SYMOFFSET, XSYMBOL) [!USE_LSB_TAG]: Do not shift the offset. This is OK, because the !USE_LSB_TAG case now applies only when Lisp_Object is wider than void *, so there's no longer any need to shift the offset. Not shifting the offset means that symbol representations have the same alignment as pointers, which the GC assumes. diff --git a/src/alloc.c b/src/alloc.c index a956e95..c9bdcc2 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -528,12 +528,8 @@ buffer_memory_full (ptrdiff_t nbytes) alignment that Emacs needs for C types and for USE_LSB_TAG. */ #define XMALLOC_BASE_ALIGNMENT alignof (max_align_t) -#if USE_LSB_TAG -# define XMALLOC_HEADER_ALIGNMENT \ - COMMON_MULTIPLE (GCALIGNMENT, XMALLOC_BASE_ALIGNMENT) -#else -# define XMALLOC_HEADER_ALIGNMENT XMALLOC_BASE_ALIGNMENT -#endif +#define XMALLOC_HEADER_ALIGNMENT \ + COMMON_MULTIPLE (GCALIGNMENT, XMALLOC_BASE_ALIGNMENT) #define XMALLOC_OVERRUN_SIZE_SIZE \ (((XMALLOC_OVERRUN_CHECK_SIZE + sizeof (size_t) \ + XMALLOC_HEADER_ALIGNMENT - 1) \ @@ -2730,7 +2726,7 @@ enum { /* Alignment of struct Lisp_Vector objects. */ vector_alignment = COMMON_MULTIPLE (ALIGNOF_STRUCT_LISP_VECTOR, - USE_LSB_TAG ? GCALIGNMENT : 1), + GCALIGNMENT), /* Vector size requests are a multiple of this. */ roundup_size = COMMON_MULTIPLE (vector_alignment, word_size) @@ -3299,15 +3295,13 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT ***********************************************************************/ /* Like struct Lisp_Symbol, but padded so that the size is a multiple - of the required alignment if LSB tags are used. */ + of the required alignment. */ union aligned_Lisp_Symbol { struct Lisp_Symbol s; -#if USE_LSB_TAG unsigned char c[(sizeof (struct Lisp_Symbol) + GCALIGNMENT - 1) & -GCALIGNMENT]; -#endif }; /* Each symbol_block is just under 1020 bytes long, since malloc @@ -3411,15 +3405,13 @@ Its value is void, and its function definition and property list are nil. */) ***********************************************************************/ /* Like union Lisp_Misc, but padded so that its size is a multiple of - the required alignment when LSB tags are used. */ + the required alignment. */ union aligned_Lisp_Misc { union Lisp_Misc m; -#if USE_LSB_TAG unsigned char c[(sizeof (union Lisp_Misc) + GCALIGNMENT - 1) & -GCALIGNMENT]; -#endif }; /* Allocation of markers and other objects that share that structure. @@ -4628,13 +4620,13 @@ mark_maybe_object (Lisp_Object obj) } /* Return true if P can point to Lisp data, and false otherwise. - USE_LSB_TAG needs Lisp data to be aligned on multiples of GCALIGNMENT. - Otherwise, assume that Lisp data is aligned on even addresses. */ + Symbols are implemented via offsets not pointers, but the offsets + are also multiples of GCALIGNMENT. */ static bool maybe_lisp_pointer (void *p) { - return !((intptr_t) p % (USE_LSB_TAG ? GCALIGNMENT : 2)); + return (uintptr_t) p % GCALIGNMENT == 0; } /* If P points to Lisp data, mark that as live if it isn't already @@ -4722,27 +4714,6 @@ mark_maybe_pointer (void *p) miss objects if __alignof__ were used. */ #define GC_POINTER_ALIGNMENT alignof (void *) -/* Define POINTERS_MIGHT_HIDE_IN_OBJECTS to 1 if marking via C pointers does - not suffice, which is the typical case. A host where a Lisp_Object is - wider than a pointer might allocate a Lisp_Object in non-adjacent halves. - If USE_LSB_TAG, the bottom half is not a valid pointer, but it should - suffice to widen it to to a Lisp_Object and check it that way. */ -#if USE_LSB_TAG || VAL_MAX < UINTPTR_MAX -# if !USE_LSB_TAG && VAL_MAX < UINTPTR_MAX >> GCTYPEBITS - /* If tag bits straddle pointer-word boundaries, neither mark_maybe_pointer - nor mark_maybe_object can follow the pointers. This should not occur on - any practical porting target. */ -# error "MSB type bits straddle pointer-word boundaries" -# endif - /* Marking via C pointers does not suffice, because Lisp_Objects contain - pointer words that hold pointers ORed with type bits. */ -# define POINTERS_MIGHT_HIDE_IN_OBJECTS 1 -#else - /* Marking via C pointers suffices, because Lisp_Objects contain pointer - words that hold unmodified pointers. */ -# define POINTERS_MIGHT_HIDE_IN_OBJECTS 0 -#endif - /* Mark Lisp objects referenced from the address range START+OFFSET..END or END+OFFSET..START. */ @@ -4788,8 +4759,7 @@ mark_memory (void *start, void *end) { void *p = *(void **) ((char *) pp + i); mark_maybe_pointer (p); - if (POINTERS_MIGHT_HIDE_IN_OBJECTS) - mark_maybe_object (XIL ((intptr_t) p)); + mark_maybe_object (XIL ((intptr_t) p)); } } @@ -5148,22 +5118,13 @@ static void * pure_alloc (size_t size, int type) { void *result; -#if USE_LSB_TAG - size_t alignment = GCALIGNMENT; -#else - size_t alignment = alignof (EMACS_INT); - - /* Give Lisp_Floats an extra alignment. */ - if (type == Lisp_Float) - alignment = alignof (struct Lisp_Float); -#endif again: if (type >= 0) { /* Allocate space for a Lisp object from the beginning of the free space with taking account of alignment. */ - result = ALIGN (purebeg + pure_bytes_used_lisp, alignment); + result = ALIGN (purebeg + pure_bytes_used_lisp, GCALIGNMENT); pure_bytes_used_lisp = ((char *)result - (char *)purebeg) + size; } else diff --git a/src/lisp.h b/src/lisp.h index 198f116..c3289c9 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -278,10 +278,7 @@ error !; #endif #ifndef alignas -# define alignas(alignment) /* empty */ -# if USE_LSB_TAG -# error "USE_LSB_TAG requires alignas" -# endif +# error "alignas not defined" #endif #ifdef HAVE_STRUCT_ATTRIBUTE_ALIGNED @@ -731,9 +728,7 @@ struct Lisp_Symbol /* Yield an integer that contains a symbol tag along with OFFSET. OFFSET should be the offset in bytes from 'lispsym' to the symbol. */ -#define TAG_SYMOFFSET(offset) \ - TAG_PTR (Lisp_Symbol, \ - ((uintptr_t) (offset) >> (USE_LSB_TAG ? 0 : GCTYPEBITS))) +#define TAG_SYMOFFSET(offset) TAG_PTR (Lisp_Symbol, offset) /* XLI_BUILTIN_LISPSYM (iQwhatever) is equivalent to XLI (builtin_lisp_symbol (Qwhatever)), @@ -899,8 +894,6 @@ INLINE struct Lisp_Symbol * XSYMBOL (Lisp_Object a) { uintptr_t i = (uintptr_t) XUNTAG (a, Lisp_Symbol); - if (! USE_LSB_TAG) - i <<= GCTYPEBITS; void *p = (char *) lispsym + i; return p; } commit f230b2ff3136120a9be544a5d3a974f7087ce55b Author: Xue Fuqiao Date: Thu Jun 25 10:23:03 2015 +0800 * doc/lispintro/emacs-lisp-intro.texi (Data types): Improve documentation of 'substring'. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 83d6022..183e68f 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -1947,10 +1947,12 @@ The value produced by evaluating this expression is @code{"abcdef"}. A function such as @code{substring} uses both a string and numbers as arguments. The function returns a part of the string, a substring of the first argument. This function takes three arguments. Its first -argument is the string of characters, the second and third arguments are -numbers that indicate the beginning and end of the substring. The -numbers are a count of the number of characters (including spaces and -punctuation) from the beginning of the string. +argument is the string of characters, the second and third arguments +are numbers that indicate the beginning (inclusive) and end +(exclusive) of the substring. The numbers are a count of the number +of characters (including spaces and punctuation) from the beginning of +the string. Note that the characters in a string are numbered from +zero, not one. @need 800 For example, if you evaluate the following: commit 80e46ac5e1fd6f76edbf272bf2ec7d90edadf2ea Author: Artur Malabarba Date: Thu Jun 25 02:52:02 2015 +0100 * lisp/character-fold.el (character-fold-table): Fix table generation diff --git a/lisp/character-fold.el b/lisp/character-fold.el index 15e7658..7f5be83 100644 --- a/lisp/character-fold.el +++ b/lisp/character-fold.el @@ -33,7 +33,14 @@ some).") (defconst character-fold-table (eval-when-compile - (let ((equiv (make-char-table 'character-fold-table))) + (let* ((equiv (make-char-table 'character-fold-table)) + (table (unicode-property-table-internal 'decomposition)) + (func (char-table-extra-slot table 1))) + ;; Ensure the table is populated + (map-char-table + (lambda (i v) (when (consp i) (funcall func (car i) v table))) + table) + ;; Compile a list of all complex characters that each simple ;; character should match. (map-char-table commit e7128f626356098080a85ccd9b4a9467452616dd Author: Glenn Morris Date: Wed Jun 24 21:26:29 2015 -0400 * nextstep/Makefile.in (all): Make it the first target. (../src/emacs${EXEEXT}): Add rule for making it. diff --git a/nextstep/Makefile.in b/nextstep/Makefile.in index 2b7933c..04d87d8 100644 --- a/nextstep/Makefile.in +++ b/nextstep/Makefile.in @@ -33,11 +33,20 @@ top_srcdir_abs = $(shell cd @top_srcdir@; pwd -P) @SET_MAKE@ MKDIR_P = @MKDIR_P@ +## Emacs.app. ns_appdir = @ns_appdir@ +## GNUstep: ns_appdir; OS X: ns_appdir/Contents/MacOS ns_appbindir = @ns_appbindir@ +## GNUstep/Emacs.base or Cocoa/Emacs.base. ns_appsrc = @ns_appsrc@ +## GNUstep: GNUstep/Emacs.base/Resources/Info-gnustep.plist +## OS X: Cocoa/Emacs.base/Contents/Info.plist ns_check_file = @ns_appdir@/@ns_check_file@ +.PHONY: all + +all: ${ns_appdir} ${ns_appbindir}/Emacs + ${ns_check_file} ${ns_appdir}: ${srcdir}/${ns_appsrc} ${ns_appsrc} rm -rf ${ns_appdir} ${MKDIR_P} ${ns_appdir} @@ -55,13 +64,16 @@ ${ns_appbindir}/Emacs: ${ns_appdir} ${ns_check_file} ../src/emacs${EXEEXT} ${MKDIR_P} ${ns_appbindir} cp -f ../src/emacs${EXEEXT} $@ -.PHONY: all links +.PHONY: FORCE -all: ${ns_appdir} ${ns_appbindir}/Emacs +../src/emacs${EXEEXT}: FORCE + ${MAKE} -C ../src $(notdir $@) # create a fake installation pointing back to the source tree # to run GUI Emacs in-place -links : ../src/emacs${EXEEXT} +.PHONY: links + +links: ../src/emacs${EXEEXT} for d in $(shell cd ${srcdir}/${ns_appsrc}; find . -type d); do ${MKDIR_P} ${ns_appdir}/$$d; done for f in $(shell cd ${srcdir}/${ns_appsrc}; find . -type f); do ln -s $(shell cd ${srcdir}; pwd -P)/${ns_appsrc}/$$f ${ns_appdir}/$$f; done for d in $(shell cd ${ns_appsrc}; find . -type d); do ${MKDIR_P} ${ns_appdir}/$$d; done commit 0a3c4eb74145635cf61629241c309f9104b72378 Author: Glenn Morris Date: Wed Jun 24 21:25:01 2015 -0400 ; Fix comment typos diff --git a/lisp/character-fold.el b/lisp/character-fold.el index b716e59..15e7658 100644 --- a/lisp/character-fold.el +++ b/lisp/character-fold.el @@ -1,4 +1,4 @@ -;;; chracter-fold.el --- matching unicode characters to their ascii similars -*- lexical-binding: t; -*- +;;; character-fold.el --- matching unicode characters to their ascii similars -*- lexical-binding: t; -*- ;; Copyright (C) 2015 Free Software Foundation, Inc. @@ -106,4 +106,4 @@ match any number of times." string)) (regexp-quote string))) -;;; chracter-fold.el ends here +;;; character-fold.el ends here commit b6903d80bf6dbd52d06913962c96fe93af77b82c Author: Artur Malabarba Date: Wed Jun 24 23:22:26 2015 +0100 ; Fix email address in ChangeLog diff --git a/ChangeLog.2 b/ChangeLog.2 index 083f538..276b6c8 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -116,7 +116,7 @@ * Makefile.in (install-arch-dep): Simplify with Make conditionals. -2015-06-23 Artur Malabarba +2015-06-23 Artur Malabarba * lisp/isearch.el: Fold many unicode characters to ASCII (isearch-character-fold-search, isearch--character-fold-extras) commit e02f52b800a1c9f4136d31eb57ad98c6727be21a Author: Artur Malabarba Date: Wed Jun 24 23:17:27 2015 +0100 ; make change-history-commit diff --git a/ChangeLog.2 b/ChangeLog.2 index 717a65c..083f538 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -1,3 +1,290 @@ +2015-06-24 Artur Malabarba + + * etc/NEWS: Fix mention to old function name + + * lisp/character-fold.el: New file (Bug#20887) + (character-fold-to-regexp): New function. + * lisp/replace.el (replace-search): Check value of + `character-fold-search'. + * lisp/isearch.el: Move character-folding code to + character-fold.el + (isearch-toggle-character-fold): New command. + (isearch-mode-map): Bind it to "\M-sf". + (isearch-mode): Check value of `character-fold-search'. + +2015-06-24 Stefan Monnier + + * lisp/subr.el (remove-from-invisibility-spec): Handle the t case + * lisp/subr.el (remove-from-invisibility-spec): Make sure `element' + is visible even if it's not yet in buffer-invisibility-spec (bug#20468). + + * lisp/progmodes/xref.el: Avoid init-args in oref. + * lisp/progmodes/xref.el (xref-location-group, xref-location-marker) + (xref--insert-xrefs, xref-collect-references): Avoid init-args in oref. + +2015-06-24 Glenn Morris + + * Makefile.in (install-arch-dep): Don't set sticky bit on the binary. + +2015-06-24 Stefan Monnier + + * lisp/gnus/nnmaildir.el: Silence lexical warnings + * lisp/gnus/nnmaildir.el (nnmaildir--prepare): Use a more + functional style. + (nnmaildir--update-nov): Remove unused var `numdir'. + (nnmaildir-request-type, nnmaildir--scan, nnmaildir-request-newgroups) + (nnmaildir-request-group, nnmaildir-request-create-group) + (nnmaildir-request-post, nnmaildir-request-move-article) + (nnmaildir-request-accept-article, nnmaildir-active-number): Mark unused args. + (nnmaildir-get-new-mail, nnmaildir-group-alist) + (nnmaildir-active-file): Declare. + (nnmaildir-request-scan): Remove unused vars `group' and `grp-dir'. + (nnmaildir-request-update-info): Remove unused vars `dotfile', `num', + `mark', `end', `new-mark', and `mark-sym'. + (nnmaildir-retrieve-headers): Remove unused args `srv-dir', `dir', + `nlist2'. + (nnmaildir-request-expire-articles): + Remove unused vars `article', `stop' and `nlist2'. + (nnmaildir-request-set-mark): Remove unused vars `begin', `article' and + `end'. Use nnmaildir--article when dyn-binding is needed. + Give the value directly in the `let' for `del-mark', `del-action', + `add-action', and `set-action'. Don't use `add-to-list' on a local var. + (nnmaildir-close-server): Declare those local vars that need to be + dyn-bound. + +2015-06-24 Paul Eggert + + * src/keyboard.h (kbd_buffer_store_event_hold): Remove unused local. + + Port selection info fix to clang + * src/keyboard.h (kbd_buffer_store_event_hold): + Don't assume C11 semantics for alignof (Bug#20756). + + Fix bug that munged selection info + On some optimizing C compilers, copying a structure did not + copy the padding bytes between elements, and the type punning + between struct input_data and struct selection_input_data did + not work. Change the C code to use a proper union type instead. + Problem reported by YAMAMOTO Mitsuharu (Bug#20756). + * src/keyboard.c (kbd_buffer, kbd_fetch_ptr, kbd_store_ptr) + (readable_events, discard_mouse_events, kbd_buffer_events_waiting) + (kbd_buffer_get_event, process_special_events, stuff_buffered_input) + (mark_kboards): + Use union buffered_input_event, not struct input_event. + (clear_event, deliver_input_available_signal, process_special_events): + Remove unnecessary forward decls. + (kbd_buffer_store_buffered_event): New function, mostly just the + old kbd_buffer_store_event_hold, except its argument is of type + union buffered_input_event, not struct input_event. + (kbd_buffer_unget_event): Define only if HAVE_X11, since it's + not needed otherwise. Argument is now of type + struct selection_input_event *, not struct input_event *. + All callers changed. + (clear_event): Arg is now of type union buffered_input_event *, + not struct input_event *. All callers changed. + * src/keyboard.h [HAVE_X11]: Include "xterm.h". + (union buffered_input_event): New type. + (kbd_buffer_store_event_hold): Now an inline function, + defined here. + * src/termhooks.h (EVENT_KIND_WIDTH): New constant. + (struct input_event): Use it. + * src/xselect.c (struct selection_event_queue): + Make elements be of type struct selection_input_event, + not struct input_event. + (selection_input_event_equal): New static function. + (x_queue_event): Use it. + (x_queue_event, x_decline_selection_request) + (x_selection_current_request, x_reply_selection_request) + (x_handle_selection_request, x_handle_selection_clear) + (x_handle_selection_event): Use struct selection_input_event, + not struct input_event. All callers changed. + (x_convert_selection): Omit unused first arg. All callers changed. + (Fx_disown_selection_internal): Omit unnecessary union. + * src/xterm.c (handle_one_xevent): Use new union buffered_input_event + rather than rolling our own equivalent. Prefer sie.kind when + setting up that kind of structure. + Call kbd_buffer_store_buffered_event, not kbd_buffer_store_event_hold. + * src/xterm.h (struct selection_input_event: Use EVENT_KIND_WIDTH. + (SELECTION_EVENT_DISPLAY, SELECTION_EVENT_DPYINFO) + (SELECTION_EVENT_REQUESTOR, SELECTION_EVENT_SELECTION) + (SELECTION_EVENT_TARGET, SELECTION_EVENT_PROPERTY) + (SELECTION_EVENT_TIME, x_handle_selection_event): + Arg is now of type struct selection_input_event *) + not struct input_event *. All callers changed. + +2015-06-23 Glenn Morris + + * Makefile.in (install-arch-dep): Simplify with Make conditionals. + +2015-06-23 Artur Malabarba + + * lisp/isearch.el: Fold many unicode characters to ASCII + (isearch-character-fold-search, isearch--character-fold-extras) + (isearch--character-fold-table): New variable. + (isearch--character-folded-regexp): New function. + (isearch-search-fun-default): Use them. + * lisp/replace.el (replace-character-fold): New variable. + (replace-search): Use it. + * etc/NEWS: Document it. + +2015-06-23 Glenn Morris + + Check for an input event before showing a dialog box. (Bug#20813) + * lisp/subr.el (y-or-n-p): + * src/fns.c (Fyes_or_no_p): Check last-input-event as well + as last-nonmenu-event. + +2015-06-23 Jürgen Hartmann (tiny change) + + Respect ‘switch-to-visible-buffer’ more rigidly. (Bug#20861) + * lisp/window.el (switch-to-visible-buffer): Doc adjustment. + (switch-to-prev-buffer, switch-to-next-buffer): Respect + switch-to-visible-buffer independent of the windows history. + +2015-06-23 Paul Eggert + + * src/keyboard.c (last_timer_event): Remove unused var. + +2015-06-23 Artur Malabarba + + * test/automated/package-test.el (package-test-update-listing): + Fix test. + +2015-06-23 Glenn Morris + + Revert 2014-06-25 nextstep/Makefile change. + * nextstep/Makefile.in (${ns_appbindir}): Remove rule. + (${ns_appbindir}/Emacs, links): Create ns_appbindir in the rule, + not as an order-only prerequisite. + + * configure.ac (--with-ns): Enable by default on OS X. + +2015-06-23 Leo Liu + + Fix shell-for/backward-command to exclude spaces + * lisp/shell.el (shell-forward-command, shell-backward-command): + Handle the 'move case from re-search-forward/backward. + fixes debbugs:20873 + +2015-06-22 Juri Linkov + + * lisp/replace.el (query-replace-read-from): Add separator to + the local binding of text-property-default-nonsticky. (Bug#20690) + + * lisp/simple.el (shell-command-on-region): Replace 'error' with 'user-error'. + (Bug#20785) + +2015-06-22 Ken Brown + + Enable CPU profiling on Cygwin + * src/syssignal.h [CYGWIN] (PROFILER_CPU_SUPPORT): Revert previous + change that undefined this. + (SIGEV_SIGNAL): Ensure that this is defined as a macro. + * src/profiler.c [CYGWIN] (timer_getoverrun): Define as a macro on + Cygwin. + + Improve diagnostics of profiler-cpu-start + * src/profiler.c (setup_cpu_timer): Change return type to 'int'; + return -1 if the sampling interval is invalid. + (Fprofiler_cpu_start): Improve error message if 'setup_cpu_timer' + fails. (Bug#20843) + +2015-06-22 Artur Malabarba + + * lisp/emacs-lisp/package.el: Exclude packages by name + (package-hidden-regexps): New variable. + (package-menu--refresh): Use it. + (package-menu-hide-package): New command. + + * lisp/emacs-lisp/package.el: Rename hide-obsolete to toggle-hiding + +2015-06-22 Eli Zaretskii + + Fix debug-timer-check on systems without HAVE_TIMERFD + * src/atimer.c (Fdebug_timer_check) [!HAVE_TIMERFD]: Actively run + the expired timers, since wait_reading_process_output doesn't. + (debug_timer_callback): Enlarge the tolerance to 20 msec. + + Fix RCS crashes in vc-test + * lisp/vc/vc-rcs.el (vc-rcs-register): Avoid crashes with some old + ports of 'ci' on MS-Windows by always passing the -t- switch. + +2015-06-22 Glenn Morris + + * doc/emacs/package.texi (Packages): + * doc/emacs/trouble.texi (Known Problems): Remove faq cross-references. + + * doc/misc/efaq-w32.texi (Downloading): Copyedits. (Bug#20851) + +2015-06-22 Paul Eggert + + Port tests to help-quote-translation + * test/automated/ert-x-tests.el (ert-test-describe-test): + * test/automated/package-test.el (package-test-describe-package) + (package-test-signed): Allow straight quotes, too. + +2015-06-22 Dmitry Gutov + + Make find-function-on-key use the current window + * lisp/emacs-lisp/find-func.el (find-function-on-key-do-it): + Extract from `find-function-on-key', add a second argument. + (find-function-on-key): Use it (bug#19679). + (find-function-on-key-other-window) + (find-function-on-key-other-frame): New commands. + +2015-06-21 Nicolas Petton + + Revert "Define `map-elt' as a generalized variable" + This reverts commit 8b6d82d3ca86f76ed964063b3941a7c6ab0bf1c6. + +2015-06-21 Ken Brown + + Drop support for CPU profiling on Cygwin + * src/syssignal.h (PROFILER_CPU_SUPPORT): Don't define on Cygwin. + (Bug#20843) + +2015-06-21 Paul Eggert + + Fix some “nested” quoting confusion in doc strings + * lisp/emacs-lisp/advice.el (ad-map-arglists): + * lisp/kermit.el (kermit-clean-on): + * lisp/mh-e/mh-comp.el (mh-repl-group-formfile): + * src/keyboard.c (Frecursive_edit): + Use curved quotes when quoting text containing apostrophe, + so that the apostrophe isn't curved in the output. + +2015-06-21 Nicolas Petton + + Define `map-elt' as a generalized variable + * lisp/emacs-lisp/map.el (map-elt): Define a gv-expander. + * lisp/emacs-lisp/map.el (map--dispatch): Tighten the code. + * lisp/emacs-lisp/map.el (map-put): Redefine it as a function using a + `setf' with `map-elt'. + * test/automated/map-tests.el: Comment out `test-map-put-literal'. + +2015-06-21 Michael Albinus + + Improve error handling in tramp-adb.el + * lisp/net/tramp-adb.el (tramp-adb-handle-file-local-copy): + Improve error handling. + +2015-06-21 Nicolas Petton + + Reuse `alist-get' in map.el + * lisp/emacs-lisp/map.el (map-elt): Use `alist-get' to retrieve alist + elements. + +2015-06-21 Eli Zaretskii + + Fix bytecomp-tests--warnings when $TMPDIR has a long name + * test/automated/bytecomp-tests.el (bytecomp-tests--warnings): + Allow the warning to begin on the 3rd, not only 2nd line, which + happens if temporary-file-directory has a very long name. + + Expect 2 icalendar tests to fail on MS-Windows + * test/automated/icalendar-tests.el (icalendar-import-with-timezone) + (icalendar-real-world): Make them expected failures on MS-Windows. + 2015-06-20 Paul Eggert Improve port of settings UI to older displays @@ -6441,7 +6728,7 @@ This file records repository revisions from commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to -commit bf32130d7debe3ee6dbd9974e50bb4a2a48047f4 (inclusive). +commit 0890cd833fa39d219cb333b08a4204539d1dae3f (inclusive). See ChangeLog.1 for earlier changes. ;; Local Variables: commit 0890cd833fa39d219cb333b08a4204539d1dae3f Author: Artur Malabarba Date: Wed Jun 24 23:15:45 2015 +0100 * etc/NEWS: Fix mention to old function name diff --git a/etc/NEWS b/etc/NEWS index e4cf2d6..aeb42bf 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -94,7 +94,7 @@ For instance, the " will match all variants of unicode double quotes cousins, even those composed of multiple characters, as well as many other symbols like ℀, ℁, ⒜, and ⓐ. -** New function `isearch--character-folded-regexp' can be used +** New function `character-folded-regexp' can be used by searching commands to produce a a regexp matching anything that character-folds into STRING. commit 795c9189165881c84a8ca4570510ab2db0775d07 Author: Artur Malabarba Date: Wed Jun 24 20:01:10 2015 +0100 * lisp/character-fold.el: New file (Bug#20887) (character-fold-to-regexp): New function. * lisp/replace.el (replace-search): Check value of `character-fold-search'. * lisp/isearch.el: Move character-folding code to character-fold.el (isearch-toggle-character-fold): New command. (isearch-mode-map): Bind it to "\M-sf". (isearch-mode): Check value of `character-fold-search'. diff --git a/lisp/character-fold.el b/lisp/character-fold.el new file mode 100644 index 0000000..b716e59 --- /dev/null +++ b/lisp/character-fold.el @@ -0,0 +1,109 @@ +;;; chracter-fold.el --- matching unicode characters to their ascii similars -*- lexical-binding: t; -*- + +;; Copyright (C) 2015 Free Software Foundation, Inc. + +;; Maintainer: emacs-devel@gnu.org +;; Keywords: matching + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + + +;;;###autoload +(defvar character-fold-search t + "Non-nil if searches should fold similar characters. +This means some characters will match entire groups of charactes. +For instance, \" will match all variants of double quotes, and +the letter a will match all of its accented versions (and then +some).") + +(defconst character-fold-table + (eval-when-compile + (let ((equiv (make-char-table 'character-fold-table))) + ;; Compile a list of all complex characters that each simple + ;; character should match. + (map-char-table + (lambda (i dec) + (when (consp dec) + ;; Discard a possible formatting tag. + (when (symbolp (car dec)) + (setq dec (cdr dec))) + ;; Skip trivial cases lika ?a decomposing to (?a). + (unless (or (and (eq i (car dec)) + (not (cdr dec)))) + (let ((d dec) k found multiletter) + (while (and d (not found)) + (setq k (pop d)) + ;; Is k a number or letter, per unicode standard? + (setq found (memq (get-char-code-property k 'general-category) + '(Lu Ll Lt Lm Lo Nd Nl No)))) + (if found + ;; Check if the decomposition has more than one letter, + ;; because then we don't want the first letter to match + ;; the decomposition. + (dolist (k d) + (when (memq (get-char-code-property k 'general-category) + '(Lu Ll Lt Lm Lo Nd Nl No)) + (setq multiletter t))) + ;; If there's no number or letter on the + ;; decomposition, take the first character in it. + (setq found (car-safe dec))) + ;; Add i to the list of characters that k can + ;; represent. Also possibly add its decomposition, so we can + ;; match multi-char representations like (format "a%c" 769) + (when (and found (not (eq i k))) + (let ((chars (cons (char-to-string i) (aref equiv k)))) + (aset equiv k + (if multiletter chars + (cons (apply #'string dec) chars))))))))) + (unicode-property-table-internal 'decomposition)) + (dolist (it '((?\" """ "“" "”" "”" "„" "⹂" "〞" "‟" "‟" "❞" "❝" "❠" "“" "„" "〝" "〟" "🙷" "🙶" "🙸" "«" "»") + (?' "❟" "❛" "❜" "‘" "’" "‚" "‛" "‚" "󠀢" "❮" "❯" "‹" "›") + (?` "❛" "‘" "‛" "󠀢" "❮" "‹") + (?\s "\t" "\r" "\n"))) + (let ((idx (car it)) + (chars (cdr it))) + (aset equiv idx (append chars (aref equiv idx))))) + (map-char-table + (lambda (i v) (let ((re (regexp-opt (cons (char-to-string i) v)))) + (if (consp i) + (set-char-table-range equiv i re) + (aset equiv i re)))) + equiv) + equiv)) + "Used for folding characters of the same group during search.") + +;;;###autoload +(defun character-fold-to-regexp (string &optional lax) + "Return a regexp matching anything that character-folds into STRING. +If `character-fold-search' is nil, `regexp-quote' string. +Otherwise, any character in STRING that has an entry in +`character-fold-table' is replaced with that entry (which is a +regexp) and other characters are `regexp-quote'd. +If LAX is non-nil, any single whitespace character is allowed to +match any number of times." + (if character-fold-search + (apply #'concat + (mapcar (lambda (c) (let ((out (or (aref character-fold-table c) + (regexp-quote (string c))))) + (if (and lax (memq c '(?\s ?\t ?\r ?\n ))) + (concat out "+") + out))) + string)) + (regexp-quote string))) + +;;; chracter-fold.el ends here diff --git a/lisp/isearch.el b/lisp/isearch.el index 44ce902..9ecbbdf 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -272,79 +272,6 @@ Default value, nil, means edit the string instead." :version "23.1" :group 'isearch) -(defvar isearch-character-fold-search t - "Non-nil if isearch should fold similar characters. -This means some characters will match entire groups of charactes. -For instance, \" will match all variants of double quotes, and -the letter a will match all of its accented versions (and then -some).") - -(defconst isearch--character-fold-extras - '((?\" """ "“" "”" "”" "„" "⹂" "〞" "‟" "‟" "❞" "❝" "❠" "“" "„" "〝" "〟" "🙷" "🙶" "🙸" "«" "»") - (?' "❟" "❛" "❜" "‘" "’" "‚" "‛" "‚" "󠀢" "❮" "❯" "‹" "›") - (?` "❛" "‘" "‛" "󠀢" "❮" "‹") - ;; `isearch-character-fold-search' doesn't interact with - ;; `isearch-lax-whitespace' yet. So we need to add this here. - (?\s " " "\r" "\n")) - "Extra entries to add to `isearch--character-fold-table'. -Used to specify character folding not covered by unicode -decomposition. Each car is a character and each cdr is a list of -strings that it should match (itself excluded).") - -(defvar isearch--character-fold-table - (eval-when-compile - (require 'subr-x) - (let ((equiv (make-char-table 'character-fold-table))) - ;; Compile a list of all complex characters that each simple - ;; character should match. - (dotimes (i (length equiv)) - (let ((dd (get-char-code-property i 'decomposition)) - d k found) - ;; Skip trivial cases (?a decomposes to (?a)). - (unless (and (eq i (car dd))) - ;; Discard a possible formatting tag. - (when (symbolp (car-safe dd)) - (setq dd (cdr dd))) - ;; Is k a number or letter, per unicode standard? - (setq d dd) - (while (and d (not found)) - (setq k (pop d)) - (setq found (and (characterp k) - (memq (get-char-code-property k 'general-category) - '(Lu Ll Lt Lm Lo Nd Nl No))))) - ;; If there's no number or letter on the - ;; decomposition, find the first character in it. - (setq d dd) - (while (and d (not found)) - (setq k (pop d)) - (setq found (characterp k))) - ;; Add i to the list of characters that k can - ;; represent. Also add its decomposition, so we can - ;; match multi-char representations like (format "a%c" 769) - (when (and found (not (eq i k))) - (aset equiv k (cons (apply #'string dd) - (cons (char-to-string i) - (aref equiv k)))))))) - (dotimes (i (length equiv)) - (when-let ((chars (append (cdr (assq i isearch--character-fold-extras)) - (aref equiv i)))) - (aset equiv i (regexp-opt (cons (char-to-string i) chars))))) - equiv)) - "Used for folding characters of the same group during search.") - -(defun isearch--character-folded-regexp (string) - "Return a regexp matching anything that character-folds into STRING. -If `isearch-character-fold-search' is nil, `regexp-quote' string. -Otherwise, any character in STRING that has an entry in -`isearch--character-fold-table' is replaced with that entry -\(which is a regexp) and other characters are `regexp-quote'd." - (if isearch-character-fold-search - (apply #'concat - (mapcar (lambda (c) (or (aref isearch--character-fold-table c) - (regexp-quote (string c)))) - string)) - (regexp-quote string))) - (defcustom isearch-lazy-highlight t "Controls the lazy-highlighting during incremental search. When non-nil, all text in the buffer matching the current search @@ -592,6 +519,7 @@ This is like `describe-bindings', but displays only Isearch keys." (define-key map "\M-sw" 'isearch-toggle-word) (define-key map "\M-s_" 'isearch-toggle-symbol) (define-key map "\M-s " 'isearch-toggle-lax-whitespace) + (define-key map "\M-s'" #'isearch-toggle-character-fold) (define-key map [?\M-%] 'isearch-query-replace) (define-key map [?\C-\M-%] 'isearch-query-replace-regexp) @@ -907,6 +835,9 @@ See the command `isearch-forward-symbol' for more information." ;; isearch-forward-regexp isearch-backward-regexp) ;; "List of commands for which isearch-mode does not recursive-edit.") +(autoload 'character-fold-to-regexp "character-fold") +(put 'character-fold-to-regexp 'isearch-message-prefix "char-fold ") +(defvar character-fold-search) (defun isearch-mode (forward &optional regexp op-fun recursive-edit word) "Start Isearch minor mode. @@ -931,7 +862,8 @@ convert the search string to a regexp used by regexp search functions." ;; Initialize global vars. (setq isearch-forward forward isearch-regexp regexp - isearch-word word + isearch-word (or word (and character-fold-search + 'character-fold-to-regexp)) isearch-op-fun op-fun isearch-last-case-fold-search isearch-case-fold-search isearch-case-fold-search case-fold-search @@ -1581,6 +1513,15 @@ Use `isearch-exit' to quit without signaling." (setq isearch-success t isearch-adjusted t) (isearch-update)) +(defun isearch-toggle-character-fold () + "Toggle character folding in searching on or off." + (interactive) + (setq isearch-word (unless (eq isearch-word #'character-fold-to-regexp) + #'character-fold-to-regexp)) + (if isearch-word (setq isearch-regexp nil)) + (setq isearch-success t isearch-adjusted t) + (isearch-update)) + (defun isearch-toggle-lax-whitespace () "Toggle whitespace matching in searching on or off. In ordinary search, toggles the value of the variable @@ -2680,11 +2621,6 @@ Can be changed via `isearch-search-fun-function' for special needs." 're-search-backward-lax-whitespace)) (isearch-regexp (if isearch-forward 're-search-forward 're-search-backward)) - (isearch-character-fold-search - (lambda (string &optional bound noerror count) - (funcall (if isearch-forward #'re-search-forward #'re-search-backward) - (isearch--character-folded-regexp string) - bound noerror count))) ((and isearch-lax-whitespace search-whitespace-regexp) (if isearch-forward 'search-forward-lax-whitespace diff --git a/lisp/replace.el b/lisp/replace.el index 5e3ddc5..65a2b41 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -2012,8 +2012,9 @@ It is called with three arguments, as if it were ;; outside of this function because then another I-search ;; used after `recursive-edit' might override them. (let* ((isearch-regexp regexp-flag) - (isearch-word delimited-flag) - (isearch-character-fold-search replace-character-fold) + (isearch-word (or delimited-flag + (and replace-character-fold + #'character-fold-to-regexp))) (isearch-lax-whitespace replace-lax-whitespace) (isearch-regexp-lax-whitespace commit ce2e5c7f79df609306158a8a43c3a07af364e1df Author: Stefan Monnier Date: Wed Jun 24 16:39:52 2015 -0400 * lisp/subr.el (remove-from-invisibility-spec): Handle the t case * lisp/subr.el (remove-from-invisibility-spec): Make sure `element' is visible even if it's not yet in buffer-invisibility-spec (bug#20468). diff --git a/lisp/subr.el b/lisp/subr.el index 5d40aaa..535fa2d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4066,9 +4066,10 @@ that can be added." (defun remove-from-invisibility-spec (element) "Remove ELEMENT from `buffer-invisibility-spec'." - (if (consp buffer-invisibility-spec) - (setq buffer-invisibility-spec - (delete element buffer-invisibility-spec)))) + (setq buffer-invisibility-spec + (if (consp buffer-invisibility-spec) + (delete element buffer-invisibility-spec) + (list t)))) ;;;; Syntax tables. commit 4fba36ce11978892dcd4f566b528e57ae12e5bf3 Author: Stefan Monnier Date: Wed Jun 24 16:32:09 2015 -0400 * lisp/progmodes/xref.el: Avoid init-args in oref. * lisp/progmodes/xref.el (xref-location-group, xref-location-marker) (xref--insert-xrefs, xref-collect-references): Avoid init-args in oref. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 89a9cf5..469f65d 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -107,7 +107,7 @@ Line numbers start from 1 and columns from 0.") (point-marker)))))) (cl-defmethod xref-location-group ((l xref-file-location)) - (oref l :file)) + (oref l file)) (defclass xref-buffer-location (xref-location) ((buffer :type buffer :initarg :buffer) @@ -139,7 +139,7 @@ actual location is not known.") (make-instance 'xref-bogus-location :message message)) (cl-defmethod xref-location-marker ((l xref-bogus-location)) - (user-error "%s" (oref l :message))) + (user-error "%s" (oref l message))) (cl-defmethod xref-location-group ((_ xref-bogus-location)) "(No location)") @@ -529,7 +529,7 @@ GROUP is a string for decoration purposes and XREF is an for max-line-width = (cl-loop for xref in xrefs maximize (let ((line (xref-location-line - (oref xref :location)))) + (oref xref location)))) (length (and line (format "%d" line))))) for line-format = (and max-line-width (format "%%%dd: " max-line-width)) @@ -733,7 +733,7 @@ tools are used, and when." (let* ((default-directory dir) (semantic-symref-tool 'detect) (res (semantic-symref-find-references-by-name symbol 'subdirs)) - (hits (and res (oref res :hit-lines))) + (hits (and res (oref res hit-lines))) (orig-buffers (buffer-list))) (unwind-protect (delq nil commit 94c4e0dcdf2b81dcdafb77ffb9ad520aec725376 Author: Glenn Morris Date: Wed Jun 24 15:47:01 2015 -0400 * Makefile.in (install-arch-dep): Don't set sticky bit on the binary. ; I don't think this actually does anything any more anyway, ; on at least the vast majority of the platforms running Emacs today. diff --git a/Makefile.in b/Makefile.in index c998d8d..3cfbe57 100644 --- a/Makefile.in +++ b/Makefile.in @@ -494,7 +494,7 @@ install-arch-dep: src install-arch-indep install-etcdoc install-$(NTDIR) $(MAKE) -C lib-src install ifeq (${ns_self_contained},no) ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} "$(DESTDIR)${bindir}/$(EMACSFULL)" - -chmod 1755 "$(DESTDIR)${bindir}/$(EMACSFULL)" + -chmod 755 "$(DESTDIR)${bindir}/$(EMACSFULL)" ifndef NO_BIN_LINK rm -f "$(DESTDIR)${bindir}/$(EMACS)" cd "$(DESTDIR)${bindir}" && $(LN_S_FILEONLY) $(EMACSFULL) $(EMACS) commit 1b51e23aea976abbbc1f1e9d40b777dfd19925ae Author: Stefan Monnier Date: Wed Jun 24 09:30:40 2015 -0400 * lisp/gnus/nnmaildir.el: Silence lexical warnings * lisp/gnus/nnmaildir.el (nnmaildir--prepare): Use a more functional style. (nnmaildir--update-nov): Remove unused var `numdir'. (nnmaildir-request-type, nnmaildir--scan, nnmaildir-request-newgroups) (nnmaildir-request-group, nnmaildir-request-create-group) (nnmaildir-request-post, nnmaildir-request-move-article) (nnmaildir-request-accept-article, nnmaildir-active-number): Mark unused args. (nnmaildir-get-new-mail, nnmaildir-group-alist) (nnmaildir-active-file): Declare. (nnmaildir-request-scan): Remove unused vars `group' and `grp-dir'. (nnmaildir-request-update-info): Remove unused vars `dotfile', `num', `mark', `end', `new-mark', and `mark-sym'. (nnmaildir-retrieve-headers): Remove unused args `srv-dir', `dir', `nlist2'. (nnmaildir-request-expire-articles): Remove unused vars `article', `stop' and `nlist2'. (nnmaildir-request-set-mark): Remove unused vars `begin', `article' and `end'. Use nnmaildir--article when dyn-binding is needed. Give the value directly in the `let' for `del-mark', `del-action', `add-action', and `set-action'. Don't use `add-to-list' on a local var. (nnmaildir-close-server): Declare those local vars that need to be dyn-bound. diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el index da3d546..097d4f8 100644 --- a/lisp/gnus/nnmaildir.el +++ b/lisp/gnus/nnmaildir.el @@ -333,29 +333,24 @@ by nnmaildir-request-article.") ;; given group, if non-nil, be the current group of the current server. Then ;; return the group object for the current group. (defun nnmaildir--prepare (server group) - (let (x groups) - (catch 'return - (if (null server) - (unless (setq server nnmaildir--cur-server) - (throw 'return nil)) - (unless (setq server (intern-soft server nnmaildir--servers)) + (catch 'return + (if (null server) + (unless (setq server nnmaildir--cur-server) (throw 'return nil)) - (setq server (symbol-value server) - nnmaildir--cur-server server)) - (unless (setq groups (nnmaildir--srv-groups server)) + (unless (setq server (intern-soft server nnmaildir--servers)) (throw 'return nil)) - (unless (nnmaildir--srv-method server) - (setq x (concat "nnmaildir:" (nnmaildir--srv-address server)) - x (gnus-server-to-method x)) - (unless x (throw 'return nil)) - (setf (nnmaildir--srv-method server) x)) - (if (null group) - (unless (setq group (nnmaildir--srv-curgrp server)) - (throw 'return nil)) - (unless (setq group (intern-soft group groups)) - (throw 'return nil)) - (setq group (symbol-value group))) - group))) + (setq server (symbol-value server) + nnmaildir--cur-server server)) + (let ((groups (nnmaildir--srv-groups server))) + (when groups + (unless (nnmaildir--srv-method server) + (setf (nnmaildir--srv-method server) + (or (gnus-server-to-method + (concat "nnmaildir:" (nnmaildir--srv-address server))) + (throw 'return nil)))) + (if (null group) + (nnmaildir--srv-curgrp server) + (symbol-value (intern-soft group groups))))))) (defun nnmaildir--tab-to-space (string) (let ((pos 0)) @@ -428,7 +423,7 @@ by nnmaildir-request-article.") (srv-dir (nnmaildir--srv-dir server)) (storage-version 1) ;; [version article-number msgid [...nov...]] dir gname pgname msgdir prefix suffix file attr mtime novdir novfile - nov msgid nov-beg nov-mid nov-end field val old-extra num numdir + nov msgid nov-beg nov-mid nov-end field val old-extra num deactivate-mark) (catch 'return (setq gname (nnmaildir--grp-name group) @@ -668,7 +663,7 @@ by nnmaildir-request-article.") "/" "\\057" 'literal) ":" "\\072" 'literal)) -(defun nnmaildir-request-type (group &optional article) +(defun nnmaildir-request-type (_group &optional _article) 'mail) (defun nnmaildir-status-message (&optional server) @@ -768,7 +763,7 @@ by nnmaildir-request-article.") (if (> (aref a 1) (aref b 1)) (throw 'return nil)) (string-lessp (aref a 2) (aref b 2)))) -(defun nnmaildir--scan (gname scan-msgs groups method srv-dir srv-ls) +(defun nnmaildir--scan (gname scan-msgs groups _method srv-dir srv-ls) (catch 'return (let ((36h-ago (- (car (current-time)) 2)) absdir nndir tdir ndir cdir nattr cattr isnew pgname read-only ls @@ -883,6 +878,10 @@ by nnmaildir-request-article.") (setf (nnmaildir--grp-cur group) cattr))) t)) +(defvar nnmaildir-get-new-mail) +(defvar nnmaildir-group-alist) +(defvar nnmaildir-active-file) + (defun nnmaildir-request-scan (&optional scan-group server) (let ((coding-system-for-write nnheader-file-coding-system) (buffer-file-coding-system nil) @@ -890,7 +889,7 @@ by nnmaildir-request-article.") (nnmaildir-get-new-mail t) (nnmaildir-group-alist nil) (nnmaildir-active-file nil) - x srv-ls srv-dir method groups target-prefix group dirs grp-dir seen + x srv-ls srv-dir method groups target-prefix dirs seen deactivate-mark) (nnmaildir--prepare server nil) (setq srv-ls (nnmaildir--srv-ls nnmaildir--cur-server) @@ -966,7 +965,7 @@ by nnmaildir-request-article.") (nnmaildir--srv-groups nnmaildir--cur-server)))) t) -(defun nnmaildir-request-newgroups (date &optional server) +(defun nnmaildir-request-newgroups (_date &optional server) (nnmaildir-request-list server)) (defun nnmaildir-retrieve-groups (groups &optional server) @@ -995,9 +994,9 @@ by nnmaildir-request-article.") (nnmaildir--srvgrp-dir (nnmaildir--srv-dir nnmaildir--cur-server) gname))) (curdir-mtime (nth 5 (file-attributes curdir))) - pgname flist always-marks never-marks old-marks dotfile num dir - all-marks marks mark ranges markdir read end new-marks ls - old-mmth new-mmth mtime mark-sym existing missing deactivate-mark) + pgname flist always-marks never-marks old-marks dir + all-marks marks ranges markdir read ls + old-mmth new-mmth mtime existing missing deactivate-mark) (catch 'return (unless group (setf (nnmaildir--srv-error nnmaildir--cur-server) @@ -1096,7 +1095,7 @@ by nnmaildir-request-article.") (setf (nnmaildir--grp-mmth group) new-mmth) info))) -(defun nnmaildir-request-group (gname &optional server fast info) +(defun nnmaildir-request-group (gname &optional server fast _info) (let ((group (nnmaildir--prepare server gname)) deactivate-mark) (catch 'return @@ -1119,7 +1118,7 @@ by nnmaildir-request-article.") (insert " " (gnus-replace-in-string gname " " "\\ " t) "\n") t)))) -(defun nnmaildir-request-create-group (gname &optional server args) +(defun nnmaildir-request-create-group (gname &optional server _args) (nnmaildir--prepare server nil) (catch 'return (let ((target-prefix (nnmaildir--srv-target-prefix nnmaildir--cur-server)) @@ -1265,7 +1264,7 @@ by nnmaildir-request-article.") (defun nnmaildir-retrieve-headers (articles &optional gname server fetch-old) (let ((group (nnmaildir--prepare server gname)) - srv-dir dir nlist mlist article num start stop nov nlist2 insert-nov + nlist mlist article num start stop nov insert-nov deactivate-mark) (setq insert-nov (lambda (article) @@ -1290,9 +1289,7 @@ by nnmaildir-request-article.") (erase-buffer) (setq mlist (nnmaildir--grp-mlist group) nlist (nnmaildir--grp-nlist group) - gname (nnmaildir--grp-name group) - srv-dir (nnmaildir--srv-dir nnmaildir--cur-server) - dir (nnmaildir--srvgrp-dir srv-dir gname)) + gname (nnmaildir--grp-name group)) (cond ((null nlist)) ((and fetch-old (not (numberp fetch-old))) @@ -1363,7 +1360,7 @@ by nnmaildir-request-article.") (nnheader-insert-file-contents nnmaildir-article-file-name)) (cons gname num-msgid)))) -(defun nnmaildir-request-post (&optional server) +(defun nnmaildir-request-post (&optional _server) (let (message-required-mail-headers) (funcall message-send-mail-function))) @@ -1405,7 +1402,7 @@ by nnmaildir-request-article.") t))) (defun nnmaildir-request-move-article (article gname server accept-form - &optional last move-is-internal) + &optional _last _move-is-internal) (let ((group (nnmaildir--prepare server gname)) pgname suffix result nnmaildir--file deactivate-mark) (catch 'return @@ -1442,7 +1439,7 @@ by nnmaildir-request-article.") (nnmaildir--expired-article group article)) result))) -(defun nnmaildir-request-accept-article (gname &optional server last) +(defun nnmaildir-request-accept-article (gname &optional server _last) (let ((group (nnmaildir--prepare server gname)) (coding-system-for-write nnheader-file-coding-system) (buffer-file-coding-system nil) @@ -1546,7 +1543,7 @@ by nnmaildir-request-article.") ga)) group-art))))) -(defun nnmaildir-active-number (gname) +(defun nnmaildir-active-number (_gname) 0) (declare-function gnus-group-mark-article-read "gnus-group" (group article)) @@ -1554,8 +1551,8 @@ by nnmaildir-request-article.") (defun nnmaildir-request-expire-articles (ranges &optional gname server force) (let ((no-force (not force)) (group (nnmaildir--prepare server gname)) - pgname time boundary bound-iter high low target dir nlist nlist2 - stop article didnt nnmaildir--file nnmaildir-article-file-name + pgname time boundary bound-iter high low target dir nlist + didnt nnmaildir--file nnmaildir-article-file-name deactivate-mark) (catch 'return (unless group @@ -1637,6 +1634,8 @@ by nnmaildir-request-article.") (erase-buffer)) didnt))) +(defvar nnmaildir--article) + (defun nnmaildir-request-set-mark (gname actions &optional server) (let* ((group (nnmaildir--prepare server gname)) (curdir (nnmaildir--cur @@ -1646,27 +1645,30 @@ by nnmaildir-request-article.") (coding-system-for-write nnheader-file-coding-system) (buffer-file-coding-system nil) (file-coding-system-alist nil) - del-mark del-action add-action set-action marksdir nlist - ranges begin end article all-marks todo-marks mdir mfile - pgname ls permarkfile deactivate-mark) - (setq del-mark + marksdir nlist + ranges all-marks todo-marks mdir mfile + pgname ls permarkfile deactivate-mark + (del-mark (lambda (mark) - (let ((prefix (nnmaildir--art-prefix article)) - (suffix (nnmaildir--art-suffix article)) + (let ((prefix (nnmaildir--art-prefix nnmaildir--article)) + (suffix (nnmaildir--art-suffix nnmaildir--article)) (flag (nnmaildir--mark-to-flag mark))) (when flag ;; If this mark corresponds to a flag, remove the flag from ;; the file name. (nnmaildir--article-set-flags - article (nnmaildir--remove-flag flag suffix) curdir)) + nnmaildir--article (nnmaildir--remove-flag flag suffix) + curdir)) ;; We still want to delete the hardlink in the marks dir if ;; present, regardless of whether this mark has a maildir flag or ;; not, to avoid getting out of sync. (setq mfile (nnmaildir--subdir marksdir (symbol-name mark)) mfile (concat mfile prefix)) - (nnmaildir--unlink mfile))) - del-action (lambda (article) (mapcar del-mark todo-marks)) - add-action + (nnmaildir--unlink mfile)))) + (del-action (lambda (article) + (let ((nnmaildir--article article)) + (mapcar del-mark todo-marks)))) + (add-action (lambda (article) (mapcar (lambda (mark) @@ -1695,13 +1697,14 @@ by nnmaildir-request-article.") (rename-file permarkfilenew permarkfile 'replace) (add-name-to-file permarkfile mfile))) (t (signal (car err) (cdr err)))))))) - todo-marks)) - set-action (lambda (article) + todo-marks))) + (set-action (lambda (article) (funcall add-action article) - (mapcar (lambda (mark) - (unless (memq mark todo-marks) - (funcall del-mark mark))) - all-marks))) + (let ((nnmaildir--article article)) + (mapcar (lambda (mark) + (unless (memq mark todo-marks) + (funcall del-mark mark))) + all-marks))))) (catch 'return (unless group (setf (nnmaildir--srv-error nnmaildir--cur-server) @@ -1728,7 +1731,7 @@ by nnmaildir-request-article.") (setq ranges (car action) todo-marks (caddr action)) (dolist (mark todo-marks) - (add-to-list 'all-marks mark)) + (pushnew mark all-marks :test #'equal)) (if (numberp (cdr ranges)) (setq ranges (list ranges))) (nnmaildir--nlist-iterate nlist ranges (cond ((eq 'del (cadr action)) del-action) @@ -1775,6 +1778,8 @@ by nnmaildir-request-article.") t))) (defun nnmaildir-close-server (&optional server) + (defvar flist) (defvar ls) (defvar dirs) (defvar dir) + (defvar files) (defvar file) (defvar x) (let (flist ls dirs dir files file x) (nnmaildir--prepare server nil) (when nnmaildir--cur-server