commit 82f8bee734b47e639a931048f9a6ccbfc85a8bb0 (HEAD, refs/remotes/origin/master) Author: Lars Ingebrigtsen Date: Tue Mar 24 05:30:49 2020 +0100 Don't add repeated xlmns:xlink declarations in svg-create * lisp/svg.el (svg-create): Fix previous unconditional addition of the xmlns:xlink declaration -- callers may already add one, and having it twice is something most svg libraries doesn't like. diff --git a/lisp/svg.el b/lisp/svg.el index 370c9c04e7..7aadbc2359 100644 --- a/lisp/svg.el +++ b/lisp/svg.el @@ -70,7 +70,8 @@ any further elements added." (height . ,height) (version . "1.1") (xmlns . "http://www.w3.org/2000/svg") - (xmlns:xlink . "http://www.w3.org/1999/xlink") + ,@(unless (plist-get args :xmlns:xlink) + '((xmlns:xlink . "http://www.w3.org/1999/xlink"))) ,@(svg--arguments nil args)))) (defun svg-gradient (svg id type stops) commit 78f76fe16e2737b40694f82af28d17a90a21ed7b Author: Noam Postavsky Date: Mon Mar 23 18:58:21 2020 -0400 Make cl-concatenate an alias of seq-concatenate * lisp/emacs-lisp/cl-extra.el (cl-concatenate): Use defalias instead of apply. This is simpler and more efficient. diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index f8336d397d..5bf74792c0 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -552,10 +552,9 @@ too large if positive or too small if negative)." (seq-subseq seq start end)) ;;;###autoload -(defun cl-concatenate (type &rest sequences) +(defalias 'cl-concatenate #'seq-concatenate "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs. -\n(fn TYPE SEQUENCE...)" - (apply #'seq-concatenate type sequences)) +\n(fn TYPE SEQUENCE...)") ;;; List functions. commit 5d5d5d492c0f1cc500713b133b1ad3e205031714 Merge: 7832e6192d d66331aea4 Author: Glenn Morris Date: Mon Mar 23 09:48:15 2020 -0700 Merge from origin/emacs-27 d66331aea4 (origin/emacs-27) Don't build the Gnulib 'utimens' module ... f2351a689b Add Harfbuzz dependency 8944310d7c Don't signal during backtrace unrewind (Bug#40088) 8709aaddd8 Fix a couple of problems in changelog generating functions 9ab85f087f Fix cl-concatenate (Bug#40180) 561e9fb91b Improve documentation of project.el commands b28a9a6cc3 Make svg images with links valid 7515252cce * lisp/tab-line.el (tab-line-new-button-show): New defcustom. # Conflicts: # etc/NEWS # nt/gnulib-cfg.mk commit 7832e6192de1256e37f04ec172ba3633e5e49b91 Merge: d5cfc4ac8b d801d1d8cc Author: Glenn Morris Date: Mon Mar 23 09:46:39 2020 -0700 ; Merge from origin/emacs-27 The following commit was skipped: d801d1d8cc Don't have exif bugging out on short strings commit d5cfc4ac8bd25ec43864af4b8d10fff643fb47bd Merge: 8f694831c0 bed04c502c Author: Glenn Morris Date: Mon Mar 23 09:46:39 2020 -0700 Merge from origin/emacs-27 bed04c502c Use correct registry name for windows-1251 charset 1aa1529301 ERC: Update maintainer address commit d66331aea4d86db17da2a4965e020274e623fda0 Author: Eli Zaretskii Date: Mon Mar 23 16:37:27 2020 +0200 Don't build the Gnulib 'utimens' module on MinGW * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_utimens): Omit the 'utimens' module in the MinGW build: 'utimens' is not used by Emacs, and 'fdutimens' is implemented in w32.c. diff --git a/nt/gnulib-cfg.mk b/nt/gnulib-cfg.mk index 08e83e028d..275fa61d3f 100644 --- a/nt/gnulib-cfg.mk +++ b/nt/gnulib-cfg.mk @@ -63,3 +63,4 @@ OMIT_GNULIB_MODULE_sys_time = true OMIT_GNULIB_MODULE_sys_types = true OMIT_GNULIB_MODULE_unistd = true OMIT_GNULIB_MODULE_canonicalize-lgpl = true +OMIT_GNULIB_MODULE_utimens = true commit f2351a689b8f8df840f1a21263612c7edb4b39f4 Author: Phillip Lord Date: Mon Mar 23 09:38:36 2020 +0000 Add Harfbuzz dependency * admin/nt/dist-build/build-dep-zips.py: Add harfbuzz as a dependency. diff --git a/admin/nt/dist-build/build-dep-zips.py b/admin/nt/dist-build/build-dep-zips.py index f206ff3da2..33ed4b6fb0 100755 --- a/admin/nt/dist-build/build-dep-zips.py +++ b/admin/nt/dist-build/build-dep-zips.py @@ -31,6 +31,7 @@ # This list derives from the features we want Emacs to compile with. PKG_REQ='''mingw-w64-x86_64-giflib mingw-w64-x86_64-gnutls +mingw-w64-x86_64-harfbuzz mingw-w64-x86_64-lcms2 mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libpng commit 8944310d7c9e259c9611ff2f0004c3176eb0ddab Author: Noam Postavsky Date: Fri Mar 20 04:07:39 2020 -0400 Don't signal during backtrace unrewind (Bug#40088) backtrace_eval_unrewind is used to temporarily reverse let-bindings (it's called with a positive argument to reverse bindings, and then a negative argument to re-apply them) by backtrace--locals and backtrace-eval. For the SPECPDL_LET_DEFAULT and SPECPDL_LET_LOCAL cases (which occur for let-bindings on buffer-local variables), the code calls Fdefault_value and Fbuffer_local_value on the symbol. For symbols which are unbound at top-level, the first (with positive argument) call to backtrace_eval_unrewind will set the symbol's value to unbound (putting the current value in the specpdl's "old value" slot). On the second (with negative argument) call, backtrace_eval_unrewind attempts to retrieve the symbol's value with Fdefault_value or Fbuffer_local_value, but that raises a void-variable signal. This interrupts the restoration of the let-bindings, so any other variables more recent on the stack will now have the wrong value. * src/data.c (default_value): Make non-static. * src/lisp.h: Declare it. * src/eval.c (backtrace_eval_unrewind): Replace the calls to Fdefault_value and Fbuffer_local_value with default_value and buffer_local_value, respectively. The latter do exactly the same as the former, except if the symbol's value is Qunbound they just return it instead of signaling void-variable. diff --git a/src/data.c b/src/data.c index b153068846..5ce5e360ab 100644 --- a/src/data.c +++ b/src/data.c @@ -1573,7 +1573,7 @@ notify_variable_watchers (Lisp_Object symbol, /* Return the default value of SYMBOL, but don't check for voidness. Return Qunbound if it is void. */ -static Lisp_Object +Lisp_Object default_value (Lisp_Object symbol) { struct Lisp_Symbol *sym; diff --git a/src/eval.c b/src/eval.c index 4559a0e1f6..78a787c4ff 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3816,7 +3816,7 @@ backtrace_eval_unrewind (int distance) { Lisp_Object sym = specpdl_symbol (tmp); Lisp_Object old_value = specpdl_old_value (tmp); - set_specpdl_old_value (tmp, Fdefault_value (sym)); + set_specpdl_old_value (tmp, default_value (sym)); Fset_default (sym, old_value); } break; @@ -3832,7 +3832,7 @@ backtrace_eval_unrewind (int distance) if (!NILP (Flocal_variable_p (symbol, where))) { set_specpdl_old_value - (tmp, Fbuffer_local_value (symbol, where)); + (tmp, buffer_local_value (symbol, where)); set_internal (symbol, old_value, where, SET_INTERNAL_UNBIND); } } diff --git a/src/lisp.h b/src/lisp.h index 8674fe11a6..92294ac1d3 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -594,6 +594,7 @@ extern void char_table_set (Lisp_Object, int, Lisp_Object); /* Defined in data.c. */ extern AVOID wrong_type_argument (Lisp_Object, Lisp_Object); +extern Lisp_Object default_value (Lisp_Object symbol); /* Defined in emacs.c. */ commit 8709aaddd8707c9eafb359f9ec824e4bc109bbc6 Author: Noam Postavsky Date: Fri Mar 20 06:00:11 2020 -0400 Fix a couple of problems in changelog generating functions * lisp/vc/diff-mode.el (diff-add-log-current-defuns): If there is a scan-error when calling end-of-defun, go to end of hunk. This can easily happen since we are calling end-of-defun on a partial code fragment from a diff. * lisp/vc/log-edit.el (log-edit-generate-changelog-from-diff): Bind display-buffer-overriding-action around the log-edit-show-diff call only. Otherwise, it can affect, for example, debugger windows triggered by the diff-add-log-current-defuns call. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index d61c363c82..8171a58515 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2247,29 +2247,32 @@ The elements of the alist are of the form (FILE . (DEFUN...)), where DEFUN... is a list of function names found in FILE." (save-excursion (goto-char (point-min)) - (let ((defuns nil) - (hunk-end nil) - (hunk-mismatch-files nil) - (make-defun-context-follower - (lambda (goline) - (let ((eodefun nil) - (defname nil)) - (list - (lambda () ;; Check for end of current defun. - (when (and eodefun - (funcall goline) - (>= (point) eodefun)) - (setq defname nil) - (setq eodefun nil))) - (lambda (&optional get-current) ;; Check for new defun. - (if get-current - defname - (when-let* ((def (and (not eodefun) - (funcall goline) - (add-log-current-defun))) - (eof (save-excursion (end-of-defun) (point)))) - (setq eodefun eof) - (setq defname def))))))))) + (let* ((defuns nil) + (hunk-end nil) + (hunk-mismatch-files nil) + (make-defun-context-follower + (lambda (goline) + (let ((eodefun nil) + (defname nil)) + (list + (lambda () ;; Check for end of current defun. + (when (and eodefun + (funcall goline) + (>= (point) eodefun)) + (setq defname nil) + (setq eodefun nil))) + (lambda (&optional get-current) ;; Check for new defun. + (if get-current + defname + (when-let* ((def (and (not eodefun) + (funcall goline) + (add-log-current-defun))) + (eof (save-excursion + (condition-case () + (progn (end-of-defun) (point)) + (scan-error hunk-end))))) + (setq eodefun eof) + (setq defname def))))))))) (while ;; Might need to skip over file headers between diff ;; hunks (e.g., "diff --git ..." etc). diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 8b6168835f..d5d46147cf 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -788,18 +788,20 @@ This command will generate a ChangeLog entries listing the functions. You can then add a description where needed, and use \\[fill-paragraph] to join consecutive function names." (interactive) - (let* ((diff-buf nil) - ;; Unfortunately, `log-edit-show-diff' doesn't have a NO-SHOW - ;; option, so we try to work around it via display-buffer - ;; machinery. - (display-buffer-overriding-action - `(,(lambda (buf alist) - (setq diff-buf buf) - (display-buffer-no-window buf alist)) - . ((allow-no-window . t))))) - (change-log-insert-entries - (with-current-buffer (progn (log-edit-show-diff) diff-buf) - (diff-add-log-current-defuns))))) + (change-log-insert-entries + (with-current-buffer + (let* ((diff-buf nil) + ;; Unfortunately, `log-edit-show-diff' doesn't have a + ;; NO-SHOW option, so we try to work around it via + ;; display-buffer machinery. + (display-buffer-overriding-action + `(,(lambda (buf alist) + (setq diff-buf buf) + (display-buffer-no-window buf alist)) + . ((allow-no-window . t))))) + (log-edit-show-diff) + diff-buf) + (diff-add-log-current-defuns)))) (defun log-edit-insert-changelog (&optional use-first) "Insert a log message by looking at the ChangeLog. commit 9ab85f087f7db38168dcf07d24f51ecd2c583f8a Author: Noam Postavsky Date: Sun Mar 22 07:48:14 2020 -0400 Fix cl-concatenate (Bug#40180) * lisp/emacs-lisp/cl-extra.el (cl-concatenate): Use apply, to avoid adding extra nesting of args. * test/lisp/emacs-lisp/cl-extra-tests.el (cl-concatenate): New test. diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index e9bfe8df5f..ce6fb625bc 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -556,7 +556,7 @@ too large if positive or too small if negative)." (defun cl-concatenate (type &rest sequences) "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs. \n(fn TYPE SEQUENCE...)" - (seq-concatenate type sequences)) + (apply #'seq-concatenate type sequences)) ;;; List functions. diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el b/test/lisp/emacs-lisp/cl-extra-tests.el index 2d20ba75d2..7546c14937 100644 --- a/test/lisp/emacs-lisp/cl-extra-tests.el +++ b/test/lisp/emacs-lisp/cl-extra-tests.el @@ -99,4 +99,12 @@ ;; Test for Bug#33731. (should-not (eq s (cl-make-random-state s))))) +(ert-deftest cl-concatenate () + (should (equal (cl-concatenate 'list '(1 2 3) '(4 5 6)) + '(1 2 3 4 5 6))) + (should (equal (cl-concatenate 'vector [1 2 3] [4 5 6]) + [1 2 3 4 5 6])) + (should (equal (cl-concatenate 'string "123" "456") + "123456"))) + ;;; cl-extra-tests.el ends here commit 561e9fb91bba98616f6d7ea3818727c1cdd2d853 Author: Eli Zaretskii Date: Sat Mar 21 13:26:19 2020 +0200 Improve documentation of project.el commands * lisp/progmodes/project.el (project-find-regexp): Require 'grep' to be able to call 'grep-read-files'. (project-search, project-query-replace-regexp): Doc fixes. * doc/emacs/maintaining.texi (Projects): New section. * doc/emacs/emacs.texi (Top): Add "Projects" to the detailed menu. diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index c3cb37e6a6..6ef4ca63ae 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -785,6 +785,7 @@ GDB Graphical Interface Maintaining Large Programs * Version Control:: Using version control systems. +* Projects:: Commands for handling source files in a project. * Change Log:: Maintaining a change history for your program. * Xref:: Find definitions and references of any function, method, struct, macro, @dots{} in your program. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index a6f66f6e7f..ebcdddfcae 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -13,6 +13,9 @@ large-size programs and packages. These features include: Unified interface to Support for Version Control Systems (@acronym{VCS}) that record the history of changes to source files. +@item +Commands for handling programming projects. + @item A specialized mode for maintaining @file{ChangeLog} files that provide a chronological log of program changes. @@ -38,6 +41,7 @@ Lisp Regression Testing}). @menu * Version Control:: Using version control systems. +* Projects:: Commands for handling source files in a project. * Change Log:: Maintaining a change history for your program. * Xref:: Find definitions and references of any function, method, struct, macro, @dots{} in your program. @@ -1630,6 +1634,77 @@ different revision with @kbd{C-u C-x v v}. @include vc1-xtra.texi @end ifnottex +@node Projects +@section Working with Projects +@cindex projects + +@cindex project root + A @dfn{project} is a collection of files used for producing one or +more programs. Files that belong to a project are typically stored in +a hierarchy of directories; the top-level directory of the hierarchy +is known as the @dfn{project root}. + +@cindex project back-end + Whether a given directory is a root of some project is determined by +the project-specific infrastructure, known as @dfn{project back-end}. +Emacs currently supports two such back-ends: VC (@pxref{Version +Control}), whereby a VCS repository is considered a project; and EDE +(@pxref{EDE}). This is expected to be extended in the future to +support additional types of projects. + + Which files do or don't belong to a project is also determined by +the project back-end. For example, the VC back-end doesn't consider +``ignored'' files (@pxref{VC Ignore}) to be part of the project. + + Emacs provides commands for handling project files conveniently. +This section describes these commands. + +@cindex current project + All of the commands described here share the notion of the +@dfn{current project}. The current project is determined by the +@code{default-directory} (@pxref{File Names}) of the buffer that is +the current buffer when the command is invoked. If that directory +doesn't seem to belong to a recognizable project, these commands +prompt you for the project directory. + +@findex project-find-file + The command @code{project-find-file} is a convenient way of visiting +files (@pxref{Visiting}) that belong to the current project. Unlike +@kbd{C-x C-f}, this command doesn't require to type the full file name +of the file to visit, you can type only the file's base name (i.e., +omit the leading directories). In addition, the completion candidates +considered by the command include only the files belonging to the +current project, and nothing else. If there's a file name at point, +this command offers that file as the default to visit. + +@findex project-find-regexp + The command @code{project-find-regexp} is similar to @code{rgrep} +(@pxref{Grep Searching}), but it searches only the files that belong +to the current project. The command prompts for the regular +expression to search, and pops up an Xref mode buffer with the search +results, where you can select a match using the Xref mode commands +(@pxref{Xref Commands}). When invoked with a prefix argument, this +command additionally prompts for the base directory from which to +start the search; this allows, for example, to limit the search only +to project files under a certain subdirectory of the project root. + +@findex project-search + @kbd{M-x project-search} is an interactive variant of +@code{project-find-regexp}. It prompts for a regular expression to +search in the current project's files, but instead of finding all the +matches and displaying them, it stops when it finds a match and visits +the matched file at the locus of the match, allowing you to edit the +matched file. To find the rest of the matches, type @w{@kbd{M-x +fileloop-continue @key{RET}}}. + +@findex project-query-replace-regexp + @kbd{M-x project-query-replace-regexp} is similar to +@code{project-search}, but it prompts you for whether to replace each +match it finds, like @code{query-replace} does (@pxref{Query +Replace}), and continues to the next match after you respond. If your +response causes Emacs to exit the query-replace loop, you can later +continue with @w{@kbd{M-x fileloop-continue @key{RET}}}. + @node Change Log @section Change Logs diff --git a/etc/NEWS b/etc/NEWS index b41541c715..d3f27e328e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -978,7 +978,10 @@ The mode is automatically enabled in files that start with the ** project.el ++++ *** New commands 'project-search' and 'project-query-replace-regexp'. + +--- *** New user option 'project-read-file-name-function'. ** Etags diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index ccd8cc049d..f467868185 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -437,6 +437,7 @@ triggers completion when entering a pattern, including it requires quoting, e.g. `\\[quoted-insert]'." (interactive (list (project--read-regexp))) (require 'xref) + (require 'grep) (let* ((pr (project-current t)) (files (if (not current-prefix-arg) @@ -606,7 +607,8 @@ PREDICATE, HIST, and DEFAULT have the same meaning as in (defun project-search (regexp) "Search for REGEXP in all the files of the project. Stops when a match is found. -To continue searching for next match, use command \\[fileloop-continue]." +To continue searching for the next match, use the +command \\[fileloop-continue]." (interactive "sSearch (regexp): ") (fileloop-initialize-search regexp (project-files (project-current t)) 'default) @@ -614,9 +616,10 @@ To continue searching for next match, use command \\[fileloop-continue]." ;;;###autoload (defun project-query-replace-regexp (from to) - "Search for REGEXP in all the files of the project. -Stops when a match is found. -To continue searching for next match, use command \\[fileloop-continue]." + "Query-replace REGEXP in all the files of the project. +Stops when a match is found and prompts for whether to replace it. +If you exit the query-replace, you can later continue the query-replace +loop using the command \\[fileloop-continue]." (interactive (pcase-let ((`(,from ,to) (query-replace-read-args "Query replace (regexp)" t t))) commit b28a9a6cc3451ea865449cf010466cd3ac8bf9a0 Author: Zhu Zihao Date: Fri Mar 20 16:35:31 2020 +0100 Make svg images with links valid * lisp/svg.el (svg-create): Specify xlink namespace for svg images (bug#40010). Copyright-paperwork-exempt: yes diff --git a/lisp/svg.el b/lisp/svg.el index 6a2fc4c90f..370c9c04e7 100644 --- a/lisp/svg.el +++ b/lisp/svg.el @@ -70,7 +70,8 @@ any further elements added." (height . ,height) (version . "1.1") (xmlns . "http://www.w3.org/2000/svg") - ,@(svg--arguments nil args)))) + (xmlns:xlink . "http://www.w3.org/1999/xlink") + ,@(svg--arguments nil args)))) (defun svg-gradient (svg id type stops) "Add a gradient with ID to SVG. commit 7515252cce60de91fce19f5efa84d326f0b14ca5 Author: Juri Linkov Date: Fri Mar 20 01:21:57 2020 +0200 * lisp/tab-line.el (tab-line-new-button-show): New defcustom. * lisp/tab-line.el (tab-line-format-template): Use tab-line-new-button-show. (tab-line-new-tab-choice): Remove choice 'nil' with "No button". (tab-line-separator): Add docstring. diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 53fa984caf..eb279deab4 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -142,11 +142,19 @@ (defcustom tab-line-new-tab-choice t "Defines what to show in a new tab. If t, display a selection menu with all available buffers. -If the value is a function, call it with no arguments. -If nil, don't show the new tab button." +If the value is a function, call it with no arguments." :type '(choice (const :tag "Buffer menu" t) - (function :tag "Function") - (const :tag "No button" nil)) + (function :tag "Function")) + :group 'tab-line + :version "27.1") + +(defcustom tab-line-new-button-show t + "If non-nil, show the \"New tab\" button in the tab line." + :type 'boolean + :initialize 'custom-initialize-default + :set (lambda (sym val) + (set-default sym val) + (force-mode-line-update)) :group 'tab-line :version "27.1") @@ -211,7 +219,8 @@ If nil, don't show it at all." 'help-echo "Click to scroll right") "Button for scrolling horizontally to the right.") -(defvar tab-line-separator nil) +(defvar tab-line-separator nil + "String that delimits tabs.") (defcustom tab-line-tab-name-function #'tab-line-tab-name-buffer @@ -455,7 +464,8 @@ variable `tab-line-tabs-function'." (if hscroll (nthcdr (truncate hscroll) strings) strings) (list separator) (when (and (eq tab-line-tabs-function #'tab-line-tabs-window-buffers) - tab-line-new-tab-choice) + tab-line-new-button-show + tab-line-new-button) (list tab-line-new-button))))) (defvar tab-line-auto-hscroll) commit d801d1d8ccae3d8c9ea3d55c27ae16cd28212734 Author: Lars Ingebrigtsen Date: Thu Mar 19 16:15:04 2020 +0100 Don't have exif bugging out on short strings * lisp/image/exif.el (exif--direct-ascii-value): New function (bug#40127). (exif--parse-directory): Use it to get the correct values for in-directory (i.e., shorter than 4 octets) strings. diff --git a/lisp/image/exif.el b/lisp/image/exif.el index 642bc58321..065456dc31 100644 --- a/lisp/image/exif.el +++ b/lisp/image/exif.el @@ -72,7 +72,8 @@ (283 y-resolution) (296 resolution-unit) (305 software) - (306 date-time)) + (306 date-time) + (315 artist)) "Alist of tag values and their names.") (defconst exif--orientation @@ -216,7 +217,10 @@ If the orientation isn't present in the data, return nil." (+ (1+ value) length))) ;; The value is stored directly ;; in the directory. - value) + (if (eq (car field-format) 'ascii) + (exif--direct-ascii-value + value (1- length) le) + value)) (car field-format) le))))) (let ((next (exif--read-number 4 le))) @@ -231,6 +235,19 @@ If the orientation isn't present in the data, return nil." ;; We've reached the end of the directories. dir)))) +(defun exif--direct-ascii-value (value bytes le) + "Make VALUE into a zero-terminated string. +VALUE is an integer representing BYTES characters." + (with-temp-buffer + (set-buffer-multibyte nil) + (if le + (dotimes (i bytes) + (insert (logand (lsh value (* i -8)) 255))) + (dotimes (i bytes) + (insert (logand (lsh value (* (- (1- bytes) i) -8)) 255)))) + (insert 0) + (buffer-string))) + (defun exif--process-value (value type le) "Do type-based post-processing of the value." (cl-case type diff --git a/test/data/image/black-short.jpg b/test/data/image/black-short.jpg new file mode 100644 index 0000000000..02a5b0b72e Binary files /dev/null and b/test/data/image/black-short.jpg differ diff --git a/test/lisp/image/exif-tests.el b/test/lisp/image/exif-tests.el index cb7c9ecbda..8a2231106f 100644 --- a/test/lisp/image/exif-tests.el +++ b/test/lisp/image/exif-tests.el @@ -41,4 +41,15 @@ (should (equal (exif-elem exif 'orientation) 1)) (should (equal (exif-elem exif 'x-resolution) '(180 . 1))))) +(ert-deftest test-exif-parse-short () + (let ((exif (exif-parse-file (test-image-file "black-short.jpg")))) + (should (equal (exif-elem exif 'make) "thr")) + (should (equal (exif-elem exif 'model) "four")) + (should (equal (exif-elem exif 'software) "em")) + (should (equal (exif-elem exif 'artist) "z")))) + +(ert-deftest test-exit-direct-ascii-value () + (equal (exif--direct-ascii-value 28005 2 t) (string ?e ?m 0)) + (equal (exif--direct-ascii-value 28005 2 nil) (string ?m ?e 0))) + ;;; exif-tests.el ends here commit bed04c502caa8cf0365a0808adb70451b3d8761a Author: Robert Pluim Date: Wed Mar 18 21:37:55 2020 +0100 Use correct registry name for windows-1251 charset * src/ftfont.c (fc_charset_table): The registry to use to lookup windows-1251 charset is microsoft-cp1251, not windows-1251. (Bug#40097) diff --git a/src/ftfont.c b/src/ftfont.c index 2b442ead4b..6b549c3ddf 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -119,7 +119,7 @@ static struct { "jisx0213.2004-1", { 0x20B9F }}, { "viscii1.1-1", { 0x1EA0, 0x1EAE, 0x1ED2 }, "vi"}, { "tis620.2529-1", { 0x0E01 }, "th"}, - { "windows-1251", { 0x0401, 0x0490 }, "ru"}, + { "microsoft-cp1251", { 0x0401, 0x0490 }, "ru"}, { "koi8-r", { 0x0401, 0x2219 }, "ru"}, { "mulelao-1", { 0x0E81 }, "lo"}, { "unicode-sip", { 0x20000 }}, commit 1aa15293017d4e5f5d5502f40e5bfa06b40537f2 Author: Amin Bandali Date: Wed Mar 18 21:27:49 2020 -0400 ERC: Update maintainer address diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el index be7baca719..0950cec4f7 100644 --- a/lisp/erc/erc-autoaway.el +++ b/lisp/erc/erc-autoaway.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; URL: https://www.emacswiki.org/emacs/ErcAutoAway ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index ffa72204f4..0e3495e139 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -4,7 +4,7 @@ ;; Filename: erc-backend.el ;; Author: Lawrence Mitchell -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Created: 2004-05-7 ;; Keywords: IRC chat client internet diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index cb1b71b46c..5e6f7c8d10 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1996-2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Mario Lang -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: irc, button, url, regexp ;; URL: https://www.emacswiki.org/emacs/ErcButton diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el index 129f502618..fc45725f78 100644 --- a/lisp/erc/erc-capab.el +++ b/lisp/erc/erc-capab.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2006-2020 Free Software Foundation, Inc. -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el index f433abc8d2..c77d5abf2e 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/erc/erc-compat.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc. ;; Author: Alex Schroeder -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; URL: https://www.emacswiki.org/emacs/ERC ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index e121003081..26701cec1e 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -6,7 +6,7 @@ ;; Author: Ben A. Mesander ;; Noah Friedman ;; Per Persson -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm, processes ;; Created: 1994-01-23 diff --git a/lisp/erc/erc-desktop-notifications.el b/lisp/erc/erc-desktop-notifications.el index 7c32429b96..1e65f8f427 100644 --- a/lisp/erc/erc-desktop-notifications.el +++ b/lisp/erc/erc-desktop-notifications.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2012-2020 Free Software Foundation, Inc. ;; Author: Julien Danjou -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el index 7e58469dda..1032af7a30 100644 --- a/lisp/erc/erc-ezbounce.el +++ b/lisp/erc/erc-ezbounce.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002, 2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Andreas Fuchs -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 6abbe39885..39a8be5e0c 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -4,7 +4,7 @@ ;; Author: Andreas Fuchs ;; Mario Lang -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; URL: https://www.emacswiki.org/emacs/ErcFilling ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 809f8f0a53..94d5de280c 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Most code is taken verbatim from erc.el, see there for the original ;; authors. diff --git a/lisp/erc/erc-ibuffer.el b/lisp/erc/erc-ibuffer.el index 7a04ff1c0e..7aee7705ff 100644 --- a/lisp/erc/erc-ibuffer.el +++ b/lisp/erc/erc-ibuffer.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002, 2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Mario Lang -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el index 70a09175d5..e2115f5f4b 100644 --- a/lisp/erc/erc-identd.el +++ b/lisp/erc/erc-identd.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2006-2020 Free Software Foundation, Inc. ;; Author: John Wiegley -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm, processes ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el index 3fb91ec686..c05633aaea 100644 --- a/lisp/erc/erc-imenu.el +++ b/lisp/erc/erc-imenu.el @@ -4,7 +4,7 @@ ;; Inc. ;; Author: Mario Lang -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm ;; URL: https://www.emacswiki.org/emacs/ErcImenu diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index 7bc4f00479..280d6bfe0f 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Alex Schroeder -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: irc ;; URL: https://www.emacswiki.org/emacs/ErcAutoJoin diff --git a/lisp/erc/erc-lang.el b/lisp/erc/erc-lang.el index 3ab1f03365..95b94f6a07 100644 --- a/lisp/erc/erc-lang.el +++ b/lisp/erc/erc-lang.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002, 2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Alex Schroeder -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Old-Version: 1.0.0 ;; URL: https://www.emacswiki.org/emacs/ErcLang ;; Keywords: comm languages processes diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el index 4fba9f4c0f..5faeabb721 100644 --- a/lisp/erc/erc-list.el +++ b/lisp/erc/erc-list.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2008-2020 Free Software Foundation, Inc. ;; Author: Tom Tromey -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Old-Version: 0.1 ;; URL: https://www.emacswiki.org/emacs/ErcList ;; Keywords: comm diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index e53f3c0cf3..1bad6d16c8 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2003-2020 Free Software Foundation, Inc. ;; Author: Lawrence Mitchell -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; URL: https://www.emacswiki.org/emacs/ErcLogging ;; Keywords: IRC, chat, client, Internet, logging diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index c0f3bf1967..3107ff2ccd 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002-2020 Free Software Foundation, Inc. ;; Author: Andreas Fuchs -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm, faces ;; URL: https://www.emacswiki.org/emacs/ErcMatch diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el index 4bc758ab3d..9c02899057 100644 --- a/lisp/erc/erc-menu.el +++ b/lisp/erc/erc-menu.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2001-2002, 2004-2020 Free Software Foundation, Inc. ;; Author: Mario Lang -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm, processes, menu ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el index 2816acda24..e3dc52bc4e 100644 --- a/lisp/erc/erc-netsplit.el +++ b/lisp/erc/erc-netsplit.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Mario Lang -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el index 06969938a7..1234962c51 100644 --- a/lisp/erc/erc-networks.el +++ b/lisp/erc/erc-networks.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002, 2004-2020 Free Software Foundation, Inc. ;; Author: Mario Lang -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el index 80ae0c3ae8..1b092c8a6a 100644 --- a/lisp/erc/erc-notify.el +++ b/lisp/erc/erc-notify.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Mario Lang -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; URL: https://www.emacswiki.org/emacs/ErcNotify ;; Keywords: comm diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el index c6eca51696..339beb0e85 100644 --- a/lisp/erc/erc-page.el +++ b/lisp/erc/erc-page.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2002, 2004, 2006-2020 Free Software Foundation, Inc. -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el index 65b0f66027..7643fa85b9 100644 --- a/lisp/erc/erc-pcomplete.el +++ b/lisp/erc/erc-pcomplete.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Sacha Chua -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm, convenience ;; URL: https://www.emacswiki.org/emacs/ErcCompletion diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el index dfb20626fd..8bd97be949 100644 --- a/lisp/erc/erc-replace.el +++ b/lisp/erc/erc-replace.el @@ -4,7 +4,7 @@ ;; Inc. ;; Author: Andreas Fuchs -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; URL: https://www.emacswiki.org/emacs/ErcReplace ;; Keywords: IRC, client, Internet diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el index 7594b8efd5..bc5f0ed23b 100644 --- a/lisp/erc/erc-ring.el +++ b/lisp/erc/erc-ring.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2001-2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Alex Schroeder -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm ;; URL: https://www.emacswiki.org/emacs/ErcHistory diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el index 2d1d8556b2..c0011f9808 100644 --- a/lisp/erc/erc-services.el +++ b/lisp/erc/erc-services.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc. -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; URL: https://www.emacswiki.org/emacs/ErcNickserv ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el index 96d41a64e7..91ce1c6244 100644 --- a/lisp/erc/erc-sound.el +++ b/lisp/erc/erc-sound.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2002-2003, 2006-2020 Free Software Foundation, Inc. -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; URL: https://www.emacswiki.org/emacs/ErcSound ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el index 0fde3bf7cc..5a469aa4e4 100644 --- a/lisp/erc/erc-speedbar.el +++ b/lisp/erc/erc-speedbar.el @@ -4,7 +4,7 @@ ;; Author: Mario Lang ;; Contributor: Eric M. Ludlam -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; URL: https://www.emacswiki.org/emacs/ErcSpeedbar ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-spelling.el b/lisp/erc/erc-spelling.el index 4632329e66..cedffbc56d 100644 --- a/lisp/erc/erc-spelling.el +++ b/lisp/erc/erc-spelling.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2005-2020 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: irc ;; URL: https://www.emacswiki.org/emacs/ErcSpelling diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 3717dc0b7f..cbab2f9da2 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Mario Lang -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm, processes, timestamp ;; URL: https://www.emacswiki.org/emacs/ErcStamp diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index f8c80d2e9b..db8ccbb4a7 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002-2020 Free Software Foundation, Inc. ;; Author: Mario Lang -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm, faces ;; URL: https://www.emacswiki.org/emacs/ErcChannelTracking diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el index 9de33ff244..fff073ad62 100644 --- a/lisp/erc/erc-truncate.el +++ b/lisp/erc/erc-truncate.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2003-2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Andreas Fuchs -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; URL: https://www.emacswiki.org/emacs/ErcTruncation ;; Keywords: IRC, chat, client, Internet, logging diff --git a/lisp/erc/erc-xdcc.el b/lisp/erc/erc-xdcc.el index 61087deeb5..2a236d2603 100644 --- a/lisp/erc/erc-xdcc.el +++ b/lisp/erc/erc-xdcc.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2003-2004, 2006-2020 Free Software Foundation, Inc. ;; Author: Mario Lang -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: comm, processes ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 81325df3f4..5c63382d86 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -10,7 +10,7 @@ ;; Gergely Nagy (algernon@midgard.debian.net) ;; David Edmondson (dme@dme.org) ;; Kelvin White (kwhite@gnu.org) -;; Maintainer: Amin Bandali +;; Maintainer: Amin Bandali ;; Keywords: IRC, chat, client, Internet ;; Version: 5.3