commit 4cabf16e1dd2c908c4156fb34605ed52b3be0504 (HEAD, refs/remotes/origin/master) Author: Pip Cet Date: Sun May 31 19:55:48 2020 +0000 Handle mid-gstring face changes * src/xdisp.c (fill_gstring_glyph_string): Don't extend the glyph string past face changes. (Bug#41454) diff --git a/src/xdisp.c b/src/xdisp.c index f65c3ebcd2..327e8a183b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -27706,6 +27706,7 @@ fill_gstring_glyph_string (struct glyph_string *s, int face_id, while (glyph < last && glyph->u.cmp.automatic && glyph->u.cmp.id == s->cmp_id + && glyph->face_id == face_id && s->cmp_to == glyph->slice.cmp.from) { s->width += glyph->pixel_width; commit 188dc2e5a3cb2de69ec14715ba288ab1e30da6eb Author: Paul Eggert Date: Tue Jun 2 18:40:10 2020 -0700 Fix bug in recent byte-code checking hoist Problem reported by Daniel Colascione (Bug#41680). * src/lread.c (read1): Check that AREF (tmp, COMPILED_BYTECODE) is a string before subjecting it to STRING_MULTIBYTE. Be more consistent about using AREF in the neighborhood, to help prevent this sort of problem from recurring. diff --git a/src/lread.c b/src/lread.c index 29deddaf15..8064bf4d0e 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2966,17 +2966,18 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) struct Lisp_Vector *vec; tmp = read_vector (readcharfun, 1); vec = XVECTOR (tmp); - if (! (COMPILED_STACK_DEPTH < vec->header.size - && (FIXNUMP (vec->contents[COMPILED_ARGLIST]) - || CONSP (vec->contents[COMPILED_ARGLIST]) - || NILP (vec->contents[COMPILED_ARGLIST])) - && ((STRINGP (vec->contents[COMPILED_BYTECODE]) - && VECTORP (vec->contents[COMPILED_CONSTANTS])) - || CONSP (vec->contents[COMPILED_BYTECODE])) - && FIXNATP (vec->contents[COMPILED_STACK_DEPTH]))) + if (! (COMPILED_STACK_DEPTH < ASIZE (tmp) + && (FIXNUMP (AREF (tmp, COMPILED_ARGLIST)) + || CONSP (AREF (tmp, COMPILED_ARGLIST)) + || NILP (AREF (tmp, COMPILED_ARGLIST))) + && ((STRINGP (AREF (tmp, COMPILED_BYTECODE)) + && VECTORP (AREF (tmp, COMPILED_CONSTANTS))) + || CONSP (AREF (tmp, COMPILED_BYTECODE))) + && FIXNATP (AREF (tmp, COMPILED_STACK_DEPTH)))) invalid_syntax ("Invalid byte-code object"); - if (STRING_MULTIBYTE (AREF (tmp, COMPILED_BYTECODE))) + if (STRINGP (AREF (tmp, COMPILED_BYTECODE)) + && STRING_MULTIBYTE (AREF (tmp, COMPILED_BYTECODE))) { /* BYTESTR must have been produced by Emacs 20.2 or earlier because it produced a raw 8-bit string for byte-code and @@ -2987,7 +2988,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) Fstring_as_unibyte (AREF (tmp, COMPILED_BYTECODE))); } - if (COMPILED_DOC_STRING < vec->header.size + if (COMPILED_DOC_STRING < ASIZE (tmp) && EQ (AREF (tmp, COMPILED_DOC_STRING), make_fixnum (0))) { /* read_list found a docstring like '(#$ . 5521)' and treated it commit 0bfc4b3dd36a415f118b4b67bfacf99efd6f28c5 Author: Pip Cet Date: Sun May 31 16:58:19 2020 +0000 Avoid losing composition state in handle_stop_backwards * src/xdisp.c (handle_stop_backwards): Save composition iterator state across our forward scan. (Bug#41626) diff --git a/src/xdisp.c b/src/xdisp.c index 0f06a38d40..f65c3ebcd2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -8692,6 +8692,7 @@ handle_stop_backwards (struct it *it, ptrdiff_t charpos) ptrdiff_t where_we_are = (bufp ? IT_CHARPOS (*it) : IT_STRING_CHARPOS (*it)); struct display_pos save_current = it->current; struct text_pos save_position = it->position; + struct composition_it save_cmp_it = it->cmp_it; struct text_pos pos1; ptrdiff_t next_stop; @@ -8719,6 +8720,7 @@ handle_stop_backwards (struct it *it, ptrdiff_t charpos) it->bidi_p = true; it->current = save_current; it->position = save_position; + it->cmp_it = save_cmp_it; next_stop = it->stop_charpos; it->stop_charpos = it->prev_stop; handle_stop (it); commit f3dd3ddd9e7d0f64ed46c55f92db3f7d69cbfe42 Author: Dmitry Gutov Date: Wed Jun 3 01:10:16 2020 +0300 ; NEWS updates diff --git a/etc/NEWS b/etc/NEWS index 36ef3509b2..ed4722b27f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -415,11 +415,15 @@ all commands that prompt for a project directory. These commands run Dired/VC-Dir and Shell/Eshell in a project's root directory, respectively. +*** New command 'project-compile', which runs compilation. + +++ *** New command 'project-switch-project'. This command lets you "switch" to another project and run a project command chosen from a dispatch menu. +*** New user option 'project-list-file'. + ** json.el --- commit 1fe1c84b188336e5a94b77f64d5906beac3446f2 Author: Dmitry Gutov Date: Wed Jun 3 00:33:14 2020 +0300 Small cleanup * lisp/progmodes/project.el (project--add-to-project-list-front): Small simplification. (project--remove-from-project-list): Remove oudated comment. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1c4dc7e761..bd99d5b725 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -787,9 +787,9 @@ Save the result to disk if the project list was changed." (project--ensure-read-project-list) (let* ((dir (project-root pr)) (do-write (not (equal (car project--list) dir)))) - (setq project--list (delete dir project--list)) - (push dir project--list) (when do-write + (setq project--list (delete dir project--list)) + (push dir project--list) (project--write-project-list)))) (defun project--remove-from-project-list (pr-dir) @@ -797,8 +797,6 @@ Save the result to disk if the project list was changed." If the directory was in the list before the removal, save the result to disk." (project--ensure-read-project-list) - ;; XXX: This hardcodes that the number of roots = 1. - ;; It's fine, though. (when (member pr-dir project--list) (setq project--list (delete pr-dir project--list)) (message "Project `%s' not found; removed from list" pr-dir) commit 8b71bfb891d4cc871e62dd63b28d834db4090577 Author: Dmitry Gutov Date: Wed Jun 3 00:27:29 2020 +0300 project-list-file: New user option * lisp/progmodes/project.el (project): New custom group. (project-vc): Use it as parent. (project-vc-merge-submodules): Tag with Emacs version. (project-read-file-name-function): Assign to the 'project' group. (project-list-file): New user option (bug#41600). (project--write-project-list, project--read-project-list): Use it. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 0051a84ff8..1c4dc7e761 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -93,6 +93,10 @@ (require 'cl-generic) (eval-when-compile (require 'subr-x)) +(defgroup project nil + "Operations on the current project." + :group 'tools) + (defvar project-find-functions (list #'project-try-vc) "Special hook to find the project containing a given directory. Each functions on this hook is called in turn with one @@ -236,7 +240,7 @@ to find the list of ignores for each directory." (defgroup project-vc nil "Project implementation based on the VC package." :version "25.1" - :group 'tools) + :group 'project) (defcustom project-vc-ignores nil "List of patterns to include in `project-ignores'." @@ -249,6 +253,7 @@ to find the list of ignores for each directory." After changing this variable (using Customize or .dir-locals.el) you might have to restart Emacs to see the effect." :type 'boolean + :version "28.1" :package-version '(project . "0.2.0") :safe 'booleanp) @@ -601,6 +606,7 @@ For the arguments list, see `project--read-file-cpd-relative'." (const :tag "Read with completion from absolute names" project--read-file-absolute) (function :tag "Custom function" nil)) + :group 'project :version "27.1") (defun project--read-file-cpd-relative (prompt @@ -740,12 +746,17 @@ Arguments the same as in `compile'." ;;; Project list +(defcustom project-list-file (locate-user-emacs-file "project-list") + "File to save the list of known projects." + :type 'string + :group 'project) + (defvar project--list 'unset "List of known project directories.") (defun project--read-project-list () "Initialize `project--list' from the project list file." - (let ((filename (locate-user-emacs-file "project-list"))) + (let ((filename project-list-file)) (setq project--list (when (file-exists-p filename) (with-temp-buffer @@ -765,7 +776,7 @@ Arguments the same as in `compile'." (defun project--write-project-list () "Persist `project--list' to the project list file." - (let ((filename (locate-user-emacs-file "project-list"))) + (let ((filename project-list-file)) (with-temp-buffer (insert (string-join project--list "\n")) (write-region nil nil filename nil 'silent)))) commit acba19e24768112b13820c4e9e12eff4abc5d3b4 Author: Eli Zaretskii Date: Tue Jun 2 20:46:26 2020 +0300 ; * src/composite.c (syms_of_composite): Fix last change. diff --git a/src/composite.c b/src/composite.c index 5c56107fb7..2c589e4f3a 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1988,7 +1988,8 @@ a function to call to compose that character. The element at index C in the table, if non-nil, is a list of composition rules of the form ([PATTERN PREV-CHARS FUNC] ...); -they must be in the descending order of PREV-CHARS values. +the rules must be specified in the descending order of PREV-CHARS +values. PATTERN is a regular expression which C and the surrounding characters must match. commit 22b2e9c901231312d6d8c6fd5d138b98501bc65e Author: Eli Zaretskii Date: Tue Jun 2 20:44:59 2020 +0300 Fix Arabic composition rules * lisp/language/misc-lang.el (composition-function-table): Reorder Arabic composition rules in descending order of lookback. * src/composite.c (syms_of_composite): Document the order of rules in 'composition-function-table'. diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index e25e63b4c5..e3a24c4153 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -136,10 +136,10 @@ thin (i.e. 1-dot width) space." (set-char-table-range composition-function-table '(#x600 . #x74F) - (list (vector "[\u0600-\u074F\u200C\u200D]+" 0 - 'arabic-shape-gstring) - (vector "[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" 1 - 'arabic-shape-gstring))) + (list (vector "[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" + 1 'arabic-shape-gstring) + (vector "[\u0600-\u074F\u200C\u200D]+" + 0 'arabic-shape-gstring))) (provide 'misc-lang) diff --git a/src/composite.c b/src/composite.c index 518502be49..5c56107fb7 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1987,7 +1987,8 @@ preceding and/or following characters, this char-table contains a function to call to compose that character. The element at index C in the table, if non-nil, is a list of -composition rules of this form: ([PATTERN PREV-CHARS FUNC] ...) +composition rules of the form ([PATTERN PREV-CHARS FUNC] ...); +they must be in the descending order of PREV-CHARS values. PATTERN is a regular expression which C and the surrounding characters must match. commit 9afcf2bd39ceb2988ed516efa0a474137fb30f74 Author: Simen Heggestøyl Date: Tue Jun 2 19:20:14 2020 +0200 Write project list to file only when changed * lisp/progmodes/project.el (project--add-to-project-list-front): Write the project list to file only when it has changed. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 314918901e..0051a84ff8 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -771,14 +771,15 @@ Arguments the same as in `compile'." (write-region nil nil filename nil 'silent)))) (defun project--add-to-project-list-front (pr) - "Add project PR to the front of the project list and save it. -Return PR." + "Add project PR to the front of the project list. +Save the result to disk if the project list was changed." (project--ensure-read-project-list) - (let ((dir (project-root pr))) + (let* ((dir (project-root pr)) + (do-write (not (equal (car project--list) dir)))) (setq project--list (delete dir project--list)) - (push dir project--list)) - (project--write-project-list) - pr) + (push dir project--list) + (when do-write + (project--write-project-list)))) (defun project--remove-from-project-list (pr-dir) "Remove directory PR-DIR from the project list. commit e7065459d96498163e737c0c8e45e5dc2412f181 Author: Simen Heggestøyl Date: Fri May 29 16:58:09 2020 +0200 Remove 'project--ensure-file-exists' * lisp/progmodes/project.el (project--ensure-file-exists): Remove. (project--read-project-list): Set 'project--list' to nil when the project list file doesn't exist. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1214980689..314918901e 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -743,25 +743,20 @@ Arguments the same as in `compile'." (defvar project--list 'unset "List of known project directories.") -(defun project--ensure-file-exists (filename) - "Create an empty file FILENAME if it doesn't exist." - (unless (file-exists-p filename) - (with-temp-buffer - (write-file filename)))) - (defun project--read-project-list () "Initialize `project--list' from the project list file." (let ((filename (locate-user-emacs-file "project-list"))) - (project--ensure-file-exists filename) - (with-temp-buffer - (insert-file-contents filename) - (let ((dirs (split-string (buffer-string) "\n" t)) - (project-list '())) - (dolist (dir dirs) - (cl-pushnew (file-name-as-directory dir) - project-list - :test #'equal)) - (setq project--list (reverse project-list)))))) + (setq project--list + (when (file-exists-p filename) + (with-temp-buffer + (insert-file-contents filename) + (let ((dirs (split-string (buffer-string) "\n" t)) + (project-list '())) + (dolist (dir dirs) + (cl-pushnew (file-name-as-directory dir) + project-list + :test #'equal)) + (reverse project-list))))))) (defun project--ensure-read-project-list () "Initialize `project--list' if it hasn't already been." commit 7ddfbb98d25cd939b808d71ec9693e316bc956b2 Author: Eli Zaretskii Date: Tue Jun 2 18:42:09 2020 +0300 Fix handling of CGJ in Hebrew text * lisp/language/hebrew.el (hebrew): Add CGJ U+034F to the combining characters supported in Hebrew compositions. (Bug#41645) diff --git a/lisp/language/hebrew.el b/lisp/language/hebrew.el index 573541aec1..08b70abfc2 100644 --- a/lisp/language/hebrew.el +++ b/lisp/language/hebrew.el @@ -240,7 +240,7 @@ Bidirectional editing is supported."))) (let* ((base "[\u05D0-\u05F2\uFB1D\uFB1F-\uFB28\uFB2A-\uFB4F]") (combining - "[\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\uFB1E]+") + "[\u034F\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\uFB1E]+") (pattern1 (concat base combining)) (pattern2 (concat base "\u200D" combining))) (set-char-table-range