From 0fb3fc92b33a6adb657194e056b2910058478022 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Mon, 31 Aug 2020 11:46:23 -0700 Subject: Remove obsolete "Wide Characters" section of Gnus manual * doc/misc/gnus.texi: This hasn't been valid since 2016. --- doc/misc/gnus.texi | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index c8ac7f0a7c2..a96be30cd61 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -839,7 +839,6 @@ Formatting Variables * Formatting Fonts:: Making the formatting look colorful and nice. * Positioning Point:: Moving point to a position after an operation. * Tabulation:: Tabulating your output. -* Wide Characters:: Dealing with wide characters. Image Enhancements @@ -22356,7 +22355,6 @@ lots of percentages everywhere. * Formatting Fonts:: Making the formatting look colorful and nice. * Positioning Point:: Moving point to a position after an operation. * Tabulation:: Tabulating your output. -* Wide Characters:: Dealing with wide characters. @end menu Currently Gnus uses the following formatting variables: @@ -22611,23 +22609,6 @@ This is the soft tabulator. 50 will be removed. This is the hard tabulator. -@node Wide Characters -@subsection Wide Characters - -Fixed width fonts in most countries have characters of the same width. -Some countries, however, use Latin characters mixed with wider -characters---most notable East Asian countries. - -The problem is that when formatting, Gnus assumes that if a string is 10 -characters wide, it'll be 10 Latin characters wide on the screen. In -these countries, that's not true. - -@vindex gnus-use-correct-string-widths -To help fix this, you can set @code{gnus-use-correct-string-widths} to -@code{t}. This makes buffer generation slower, but the results will be -prettier. The default value is @code{nil}. - - @node Window Layout @section Window Layout @cindex window layout -- cgit v1.2.3 From 302f71e55da427529d3d0d62dd1511552aad9f7b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 1 Sep 2020 11:39:22 +0200 Subject: Fix help message with help-window-select * lisp/help.el (help-print-return-message): (help-window-display-message): Recommend 'scroll-up-command' instead of 'scroll-up' when 'help-window-select' is non-nil. (Bug#43122) --- lisp/help.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index 0f1991e3185..c276c1dc280 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -179,7 +179,7 @@ Do not call this in the scope of `with-help-window'." (if (same-window-p (buffer-name standard-output)) ;; Say how to scroll this window. (substitute-command-keys - "\\[scroll-up] to scroll the help.") + "\\[scroll-up-command] to scroll the help.") ;; Say how to scroll some other window. (substitute-command-keys "\\[scroll-other-window] to scroll the help.")))))))) @@ -1243,7 +1243,7 @@ window." ".") ((eq scroll 'other) ", \\[scroll-other-window] to scroll help.") - (scroll ", \\[scroll-up] to scroll help.")))) + (scroll ", \\[scroll-up-command] to scroll help.")))) (message "%s" (substitute-command-keys (concat quit-part scroll-part))))) -- cgit v1.2.3 From e0a8a7e94cdf1352e7f66de74131c6c5df9b6983 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 1 Sep 2020 06:12:02 -0700 Subject: ; Auto-commit of loaddefs files. --- lisp/ldefs-boot.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index c755bdfde3f..9febeb96d4f 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -7250,7 +7250,7 @@ file. To upgrade a version 206 file to version 208, call this command explicitly with a prefix argument: \\[universal-argument] \\[desktop-save]. -If you are upgrading from Emacs 24 or older, we recommed to do +If you are upgrading from Emacs 24 or older, we recommend to do this once you decide you no longer need compatibility with versions of Emacs before 25.1. @@ -34508,7 +34508,7 @@ the output buffer or changing the window configuration. ;;;### (autoloads nil "tramp" "net/tramp.el" (0 0 0 0)) ;;; Generated autoloads from net/tramp.el -(push (purecopy '(tramp 2 4 3)) package--builtin-versions) +(push (purecopy '(tramp 2 4 5 -1)) package--builtin-versions) (defvar tramp-mode t "\ Whether Tramp is enabled. -- cgit v1.2.3 From abca75d2e9b2a406157383dfb7fe3f185e0b5741 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 1 Sep 2020 23:59:11 +0200 Subject: ; Fix typos; change "Emacs-Lisp" to "Emacs Lisp" --- doc/lispref/debugging.texi | 2 +- doc/lispref/streams.texi | 2 +- lisp/calendar/holidays.el | 2 +- lisp/gnus/gnus-start.el | 4 ++-- lisp/play/handwrite.el | 2 +- lisp/ses.el | 2 +- test/file-organization.org | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi index 29a0ab71ea4..3fea604184c 100644 --- a/doc/lispref/debugging.texi +++ b/doc/lispref/debugging.texi @@ -147,7 +147,7 @@ set @code{debug-ignored-errors} to @code{nil}. If this variable has a non-@code{nil} value (the default), running the command @code{eval-expression} causes @code{debug-on-error} to be temporarily bound to @code{t}. @xref{Lisp Eval,, Evaluating -Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}. +Emacs Lisp Expressions, emacs, The GNU Emacs Manual}. If @code{eval-expression-debug-on-error} is @code{nil}, then the value of @code{debug-on-error} is not changed during @code{eval-expression}. diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index d40ec8db105..2cd61ad04fc 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -859,7 +859,7 @@ exceeding this limit is abbreviated with an ellipsis. A value of These are the values for @code{print-length} and @code{print-level} used by @code{eval-expression}, and thus, indirectly, by many interactive evaluation commands (@pxref{Lisp Eval,, Evaluating -Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}). +Emacs Lisp Expressions, emacs, The GNU Emacs Manual}). @end defopt These variables are used for detecting and reporting circular diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 182e99a611f..444a0e53b95 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -310,7 +310,7 @@ to the list. To include the phases of the moon, add (lunar-phases) -to the holiday list, where `lunar-phases' is an Emacs-Lisp function that +to the holiday list, where `lunar-phases' is an Emacs Lisp function that you've written to return a (possibly empty) list of the relevant VISIBLE dates with descriptive strings such as diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 61319266ced..dbe92a164d0 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -71,7 +71,7 @@ uses considerably less memory." (const :tag "Write directly to file" nil))) (defcustom gnus-init-file (nnheader-concat gnus-home-directory ".gnus") - "Your Gnus Emacs-Lisp startup file name. + "Your Gnus Emacs Lisp startup file name. If a file with the `.el' or `.elc' suffixes exists, it will be read instead." :group 'gnus-start :type 'file) @@ -82,7 +82,7 @@ If a file with the `.el' or `.elc' suffixes exists, it will be read instead." (directory-file-name installation-directory)) "site-lisp/gnus-init") (error nil)) - "The site-wide Gnus Emacs-Lisp startup file name, or nil if none. + "The site-wide Gnus Emacs Lisp startup file name, or nil if none. If a file with the `.el' or `.elc' suffixes exists, it will be read instead." :group 'gnus-start :type '(choice file (const nil))) diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el index f69e0622c9a..7b4a59b6fcd 100644 --- a/lisp/play/handwrite.el +++ b/lisp/play/handwrite.el @@ -45,7 +45,7 @@ ;; Installation ;; ;; type at your prompt "emacs -l handwrite.el" or put this file on your -;; Emacs-Lisp load path, add the following into your init file: +;; Emacs Lisp load path, add the following into your init file: ;; ;; (require 'handwrite) ;; diff --git a/lisp/ses.el b/lisp/ses.el index 96b219fc601..218043f2192 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -378,7 +378,7 @@ area of a spreadsheet.") ;; "Side-effect variables". They are set in one function, altered in ;; another as a side effect, then read back by the first, as a way of ;; passing back more than one value. These declarations are just to make -;; the compiler happy, and to conform to standard Emacs-Lisp practice (I +;; the compiler happy, and to conform to standard Emacs Lisp practice (I ;; think the make-local-variable trick above is cleaner). ;; diff --git a/test/file-organization.org b/test/file-organization.org index 34bd0b90e03..64c0755b3bc 100644 --- a/test/file-organization.org +++ b/test/file-organization.org @@ -1,10 +1,10 @@ -#+TITLE: The Location of Emacs-Lisp Tests +#+TITLE: The Location of Emacs Lisp Tests * The Main Emacs Repository -The Emacs repository contains a very large number of Emacs-Lisp files, many of +The Emacs repository contains a very large number of Emacs Lisp files, many of which pre-date both formal package support for Emacs and automated unit testing. -- cgit v1.2.3 From 9b35b0c99ceaeca74a16bea86a665ae5f44430a1 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 31 Aug 2020 20:47:50 +0200 Subject: ; * lisp/man.el (Man-mode): Fix formatting. --- lisp/man.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/man.el b/lisp/man.el index c914ec34b97..bec3bfdbb2e 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1541,8 +1541,8 @@ The following man commands are available in the buffer. Try \\[man] Prompt to retrieve a new manpage. \\[Man-follow-manual-reference] Retrieve reference in SEE ALSO section. -\\[Man-next-manpage] Jump to next manpage in circular list. -\\[Man-previous-manpage] Jump to previous manpage in circular list. +\\[Man-next-manpage] Jump to next manpage in circular list. +\\[Man-previous-manpage] Jump to previous manpage in circular list. \\[Man-next-section] Jump to next manpage section. \\[Man-previous-section] Jump to previous manpage section. \\[Man-goto-section] Go to a manpage section. -- cgit v1.2.3 From c9708e5ba238661fede5a0d6cb175342a9e7fd31 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 3 Sep 2020 13:56:13 +0200 Subject: Fix bug in dbus.el; do not merge with master * lisp/net/dbus.el (dbus-register-property) (dbus-property-handler): Handle properties of the same interface at different object paths properly. (Bug#43146) --- lisp/net/dbus.el | 57 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 06bd9e567fe..cafbfa73c15 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -1477,6 +1477,26 @@ nil is returned." (nreverse result)) (push (cons (car dict) (cl-caadr dict)) result))))) +(defun dbus-get-this-registered-property (bus _service path interface property) + "Return PROPERTY entry of `dbus-registered-objects-table'. +Filter out not matching PATH." + ;; Remove entries not belonging to this case. + (seq-remove + (lambda (item) + (not (string-equal path (nth 2 item)))) + (gethash (list :property bus interface property) + dbus-registered-objects-table))) + +(defun dbus-get-other-registered-property (bus _service path interface property) + "Return PROPERTY entry of `dbus-registered-objects-table'. +Filter out matching PATH." + ;; Remove matching entries. + (seq-remove + (lambda (item) + (string-equal path (nth 2 item))) + (gethash (list :property bus interface property) + dbus-registered-objects-table))) + (defun dbus-register-property (bus service path interface property access value &optional emits-signal dont-register-service) @@ -1543,12 +1563,14 @@ clients from discovering the still incomplete interface." ;; because the property might be accessed from anybody. (let ((key (list :property bus interface property)) (val - (list + (cons (list nil service path (cons (if emits-signal (list access :emits-signal) (list access)) - value))))) + value)) + (dbus-get-other-registered-property + bus service path interface property)))) (puthash key val dbus-registered-objects-table) ;; Return the object. @@ -1566,16 +1588,16 @@ It will be registered for all objects created by `dbus-register-property'." (cond ;; "Get" returns a variant. ((string-equal method "Get") - (let ((entry (gethash (list :property bus interface property) - dbus-registered-objects-table))) + (let ((entry (dbus-get-this-registered-property + bus service path interface property))) (when (string-equal path (nth 2 (car entry))) `((:variant ,(cdar (last (car entry)))))))) ;; "Set" expects a variant. ((string-equal method "Set") (let* ((value (caar (cddr args))) - (entry (gethash (list :property bus interface property) - dbus-registered-objects-table)) + (entry (dbus-get-this-registered-property + bus service path interface property)) ;; The value of the hash table is a list; in case of ;; properties it contains just one element (UNAME SERVICE ;; PATH OBJECT). OBJECT is a cons cell of a list, which @@ -1590,8 +1612,10 @@ It will be registered for all objects created by `dbus-register-property'." (signal 'dbus-error (list "Property not writable at path" property path))) (puthash (list :property bus interface property) - (list (append (butlast (car entry)) - (list (cons (car object) value)))) + (cons (append (butlast (car entry)) + (list (cons (car object) value))) + (dbus-get-other-registered-property + bus service path interface property)) dbus-registered-objects-table) ;; Send the "PropertiesChanged" signal. (when (member :emits-signal (car object)) @@ -1607,14 +1631,15 @@ It will be registered for all objects created by `dbus-register-property'." (let (result) (maphash (lambda (key val) - (when (and (equal (butlast key) (list :property bus interface)) - (string-equal path (nth 2 (car val))) - (not (functionp (car (last (car val)))))) - (push - (list :dict-entry - (car (last key)) - (list :variant (cdar (last (car val))))) - result))) + (dolist (item val) + (when (and (equal (butlast key) (list :property bus interface)) + (string-equal path (nth 2 item)) + (not (functionp (car (last item))))) + (push + (list :dict-entry + (car (last key)) + (list :variant (cdar (last item)))) + result)))) dbus-registered-objects-table) ;; Return the result, or an empty array. (list :array (or result '(:signature "{sv}")))))))) -- cgit v1.2.3 From 5489524ab0dfb1854bf43077d9adedf1eb022027 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 4 Sep 2020 14:24:23 +0200 Subject: Backport recent change in tramp-tests.el from master, don't merge * test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name): No need to expect different results in Emacs 28 and later. --- test/lisp/net/tramp-tests.el | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 02f436141f9..89d4171ddea 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2057,8 +2057,8 @@ properly. BODY shall not contain a timeout." ;; user "foo" to "/~foo"". Otherwise, it doesn't expand. (should (string-equal - (substitute-in-file-name - "/method:host:/path/~foo") "/method:host:/path/~foo")) + (substitute-in-file-name "/method:host:/path/~foo") + "/method:host:/path/~foo")) ;; Quoting local part. (should (string-equal @@ -2070,12 +2070,12 @@ properly. BODY shall not contain a timeout." "/method:host:/:/~foo") "/method:host:/:/~foo")) (should (string-equal - (substitute-in-file-name - "/method:host:/:/path//~foo") "/method:host:/:/path//~foo")) + (substitute-in-file-name "/method:host:/:/path//~foo") + "/method:host:/:/path//~foo")) (should (string-equal - (substitute-in-file-name - "/method:host:/:/path/~foo") "/method:host:/:/path/~foo"))) + (substitute-in-file-name "/method:host:/:/path/~foo") + "/method:host:/:/path/~foo"))) (let (process-environment) (should @@ -2120,19 +2120,16 @@ properly. BODY shall not contain a timeout." (expand-file-name "/method:host:/path/../file") "/method:host:/file")) (should (string-equal - (expand-file-name "/method:host:/path/.") - (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) + (expand-file-name "/method:host:/path/.") "/method:host:/path")) (should (string-equal (expand-file-name "/method:host:/path/..") "/method:host:/")) (should (string-equal - (expand-file-name "." "/method:host:/path/") - (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) + (expand-file-name "." "/method:host:/path/") "/method:host:/path")) (should (string-equal - (expand-file-name "" "/method:host:/path/") - (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) + (expand-file-name "" "/method:host:/path/") "/method:host:/path")) ;; Quoting local part. (should (string-equal -- cgit v1.2.3 From 2b95300cf8e3da9f505233f116cabe39a3564fa7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 4 Sep 2020 08:46:45 -0400 Subject: * lisp/display-fill-column-indicator.el: Fix bug#41145 (global-display-fill-column-indicator-mode): Specify the implicit defustom's group explicitly. * lisp/cus-dep.el (custom-make-dependencies): Also look at define(-globalized)-minor-mode since it can also define custom vars. --- lisp/cus-dep.el | 2 +- lisp/display-fill-column-indicator.el | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index fd307a5c04e..e2fd7febd2f 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el @@ -99,7 +99,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" (setq name (intern name))) (condition-case nil (while (re-search-forward - "^(def\\(custom\\|face\\|group\\)" nil t) + "^(def\\(custom\\|face\\|group\\|ine\\(?:-globalized\\)?-minor-mode\\)" nil t) (beginning-of-line) (let ((type (match-string 1)) (expr (read (current-buffer)))) diff --git a/lisp/display-fill-column-indicator.el b/lisp/display-fill-column-indicator.el index 3f947bdc1c9..3391aa371b7 100644 --- a/lisp/display-fill-column-indicator.el +++ b/lisp/display-fill-column-indicator.el @@ -73,7 +73,9 @@ See Info node `Displaying Boundaries' for details." ;;;###autoload (define-globalized-minor-mode global-display-fill-column-indicator-mode - display-fill-column-indicator-mode display-fill-column-indicator--turn-on) + display-fill-column-indicator-mode display-fill-column-indicator--turn-on + ;; See bug#41145 + :group 'display-fill-column-indicator) (provide 'display-fill-column-indicator) -- cgit v1.2.3 From 793871310599f8c75cf86bed97bdad70577cc5dd Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Fri, 4 Sep 2020 19:10:17 +0000 Subject: C++ Mode: handle comma separated brace initializers. This includes both indentation and fontification. * lisp/progmodes/cc-engine.el (c-do-declarators): Handle brace initializers without = correctly. (c-looking-at-or-maybe-in-bracelist): Use c-do-declarators with a simple inline function to check that after-type-id-pos points to the start of a declarator. * lisp/progmodes/cc-langs.el (c-recognize-bare-brace-inits): New lang const/variable. --- lisp/progmodes/cc-engine.el | 53 ++++++++++++++++++++++++++++++--------------- lisp/progmodes/cc-langs.el | 14 ++++++++++++ 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 34490d1356a..4b14dd131c2 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -9091,7 +9091,7 @@ This function might do hidden buffer changes." (let ((cdd-pos (point)) cdd-next-pos cdd-id-start cdd-id-end cdd-decl-res cdd-got-func cdd-got-type cdd-got-init - c-last-identifier-range cdd-exhausted) + c-last-identifier-range cdd-exhausted cdd-after-block) ;; The following `while' applies `cdd-function' to a single declarator id ;; each time round. It loops only when CDD-LIST is non-nil. @@ -9144,23 +9144,25 @@ This function might do hidden buffer changes." (c-forward-syntactic-ws cdd-limit) (setq cdd-exhausted t))) ; unbalanced parens - (cdd-got-init ; "=" sign OR opening "(", "[", or "{" - ;; Skip an initializer expression. If we're at a '=' - ;; then accept a brace list directly after it to cope - ;; with array initializers. Otherwise stop at braces - ;; to avoid going past full function and class blocks. - (if (and (if (and (eq cdd-got-init ?=) - (= (c-forward-token-2 1 nil cdd-limit) 0) - (looking-at "{")) - (c-go-list-forward (point) cdd-limit) - t) - ;; FIXME: Should look for c-decl-end markers here; - ;; we might go far into the following declarations - ;; in e.g. ObjC mode (see e.g. methods-4.m). - (c-syntactic-re-search-forward "[;,{]" cdd-limit 'move t)) + (cdd-got-init ; "=" sign OR opening "(", "[", or "(" + ;; Skip an initializer expression in braces, whether or not (in + ;; C++ Mode) preceded by an "=". Be careful that the brace list + ;; isn't a code block or a struct (etc.) block. + (cond + ((and (eq cdd-got-init ?=) + (zerop (c-forward-token-2 1 nil cdd-limit)) + (eq (char-after) ?{) + (c-go-list-forward (point) cdd-limit))) + ((and (eq cdd-got-init ?{) + c-recognize-bare-brace-inits + (setq cdd-after-block + (save-excursion + (c-go-list-forward (point) cdd-limit))) + (not (c-looking-at-statement-block))) + (goto-char cdd-after-block))) + (if (c-syntactic-re-search-forward "[;,{]" cdd-limit 'move t) (backward-char) - (setq cdd-exhausted t) - )) + (setq cdd-exhausted t))) (t (c-forward-syntactic-ws cdd-limit))) @@ -11729,7 +11731,22 @@ comment at the start of cc-engine.el for more info." (save-excursion (c-backward-syntactic-ws) (point)) nil nil)) (and (consp res) - (eq (car res) after-type-id-pos)))))) + (cond + ((eq (car res) after-type-id-pos)) + ((> (car res) after-type-id-pos) nil) + (t + (catch 'find-decl + (save-excursion + (goto-char (car res)) + (c-do-declarators + (point-max) t nil nil + (lambda (id-start id-end tok not-top func init) + (cond + ((> id-start after-type-id-pos) + (throw 'find-decl nil)) + ((eq id-start after-type-id-pos) + (throw 'find-decl t))))) + nil))))))))) (cons bufpos (or in-paren inexpr-brace-list))) ((or (eq (char-after) ?\;) ;; Brace lists can't contain a semicolon, so we're done. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index e7e7cfd4b09..0a7f4565c0e 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3684,6 +3684,20 @@ Foo bar = gnu;" c++ t) (c-lang-defvar c-recognize-paren-inits (c-lang-const c-recognize-paren-inits)) +(c-lang-defconst c-recognize-bare-brace-inits + "Non-nil means that brace initializers without \"=\" exist, +i.e. constructs like + +int foo[] {1, 2, 3}; + +in addition to the more classic + +int foo[] = {1, 2, 3};" + t nil + c++ t) +(c-lang-defvar c-recognize-bare-brace-inits + (c-lang-const c-recognize-bare-brace-inits)) + (c-lang-defconst c-recognize-paren-inexpr-blocks "Non-nil to recognize gcc style in-expression blocks, i.e. compound statements surrounded by parentheses inside expressions." -- cgit v1.2.3 From b2f41a8a18688a3d7eeea94c19864268c9eaf4c8 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 6 Sep 2020 18:34:18 +0200 Subject: Disable display-warning buttons when doing batch compiles * lisp/emacs-lisp/warnings.el (display-warning): Don't output the buttons when we're not interactive (bug#43244). --- lisp/emacs-lisp/warnings.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 3a568cb834c..e10c149d89c 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -292,14 +292,17 @@ entirely by setting `warning-suppress-types' or (insert (format (nth 1 level-info) (format warning-type-format typename)) message) - (insert " ") - (insert-button "Disable showing" - 'type 'warning-suppress-warning - 'warning-type type) - (insert " ") - (insert-button "Disable logging" - 'type 'warning-suppress-log-warning - 'warning-type type) + ;; Don't output the buttons when doing batch compilation + ;; and similar. + (unless noninteractive + (insert " ") + (insert-button "Disable showing" + 'type 'warning-suppress-warning + 'warning-type type) + (insert " ") + (insert-button "Disable logging" + 'type 'warning-suppress-log-warning + 'warning-type type)) (funcall newline) (when (and warning-fill-prefix (not (string-match "\n" message))) (let ((fill-prefix warning-fill-prefix) -- cgit v1.2.3 From 3444f397c7d20ca59f7b18f6fe95aa79b33727e5 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 6 Sep 2020 19:04:00 +0200 Subject: Use a popup menu for + +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// js-jsx-align->-with-<: nil +// End: diff --git a/test/lisp/progmodes/js-resources/jsx-comment-string.jsx b/test/lisp/progmodes/js-resources/jsx-comment-string.jsx new file mode 100644 index 00000000000..cae023e7288 --- /dev/null +++ b/test/lisp/progmodes/js-resources/jsx-comment-string.jsx @@ -0,0 +1,23 @@ +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// End: + +// The following tests go below any comments to avoid including +// misindented comments among the erroring lines. + +// The JSX-like text in comments/strings should be treated like the enclosing +// syntax, not like JSX. + +// +void 0 + +"" +void 0 + + + {/* */} + + Yum! + + diff --git a/test/lisp/progmodes/js-resources/jsx-indent-level.jsx b/test/lisp/progmodes/js-resources/jsx-indent-level.jsx new file mode 100644 index 00000000000..0a84b9eb77a --- /dev/null +++ b/test/lisp/progmodes/js-resources/jsx-indent-level.jsx @@ -0,0 +1,13 @@ +return ( + + + Hello World! + + +) + +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 4 +// js-jsx-indent-level: 2 +// End: diff --git a/test/lisp/progmodes/js-resources/jsx-quote.jsx b/test/lisp/progmodes/js-resources/jsx-quote.jsx new file mode 100644 index 00000000000..1b2c6528734 --- /dev/null +++ b/test/lisp/progmodes/js-resources/jsx-quote.jsx @@ -0,0 +1,16 @@ +// JSX text node values should be strings, but only JS string syntax +// is considered, so quote marks delimit strings like normal, with +// disastrous results (https://github.com/mooz/js2-mode/issues/409). +function Bug() { + return
C'est Montréal
; +} +function Test(foo = /'/, + bar = 123) {} + +// This test is in a separate file because it can break other tests +// when indenting the whole buffer (not sure why). + +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// End: diff --git a/test/lisp/progmodes/js-resources/jsx-self-closing.jsx b/test/lisp/progmodes/js-resources/jsx-self-closing.jsx new file mode 100644 index 00000000000..f8ea7a138ad --- /dev/null +++ b/test/lisp/progmodes/js-resources/jsx-self-closing.jsx @@ -0,0 +1,13 @@ +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// End: + +// The following test goes below any comments to avoid including +// misindented comments among the erroring lines. + +// Properly parse/indent code with a self-closing tag inside the +// attribute of another self-closing tag. +
+
} /> +
diff --git a/test/lisp/progmodes/js-resources/jsx-unclosed-1.jsx b/test/lisp/progmodes/js-resources/jsx-unclosed-1.jsx new file mode 100644 index 00000000000..1f5c3fba8da --- /dev/null +++ b/test/lisp/progmodes/js-resources/jsx-unclosed-1.jsx @@ -0,0 +1,13 @@ +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// End: + +// The following test goes below any comments to avoid including +// misindented comments among the erroring lines. + +return ( +
+ {array.map(function () { + return { + a: 1 diff --git a/test/lisp/progmodes/js-resources/jsx-unclosed-2.jsx b/test/lisp/progmodes/js-resources/jsx-unclosed-2.jsx new file mode 100644 index 00000000000..fb665b96a43 --- /dev/null +++ b/test/lisp/progmodes/js-resources/jsx-unclosed-2.jsx @@ -0,0 +1,65 @@ +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// End: + +// The following tests go below any comments to avoid including +// misindented comments among the erroring lines. + +// Don’t misinterpret inequality operators as JSX. +for (; i < length;) void 0 +if (foo > bar) void 0 + +// Don’t misintrepet inequalities within JSX, either. +
+ {foo < bar} +
+ +// Don’t even misinterpret unary operators as JSX. +if (foo < await bar) void 0 +while (await foo > bar) void 0 + +
+ {foo < await bar} +
+ +// Allow unary keyword names as null-valued JSX attributes. +// (As if this will EVER happen
) + + + + + How would we ever live without unary support + + + + + +// “-” is not allowed in a JSXBoundaryElement’s name. + + // Weirdly-indented “continued expression.” + +// “-” may be used in a JSXAttribute’s name. + + +// Weird spaces should be tolerated. +< div > + < div > + < div + attr="" + / > + < div + attr="" + / > + < / div> +< / div > + +// Non-ASCII identifiers are acceptable. +<Über> + + Guten Tag! + + diff --git a/test/lisp/progmodes/js-resources/jsx.jsx b/test/lisp/progmodes/js-resources/jsx.jsx new file mode 100644 index 00000000000..c200979df8c --- /dev/null +++ b/test/lisp/progmodes/js-resources/jsx.jsx @@ -0,0 +1,314 @@ +var foo =
; + +return ( +
+
+
+
+
+
+
+
+); + +React.render( +
+
+
, + { + a: 1 + }, +
+
+
+); + +return ( + // Sneaky! +
+); + +return ( +
+ // Sneaky! +); + +React.render( + , + { + a: 1 + } +); + +return ( +
+ {array.map(function () { + return { + a: 1 + }; + })} +
+); + +return ( +
+
+); + +return ( +
// Also dedent. +); + +return ( +
+) + +// JSXMemberExpression names are parsed/indented: + +
+ + Hello World! + + +
+
+
+
+
+ +// JSXOpeningFragment and JSXClosingFragment are parsed/indented: +<> +
+ <> + Hello World! + + <> +
+
+ +
+ + +// Indent void expressions (no need for contextual parens / commas) +// (https://github.com/mooz/js2-mode/issues/140#issuecomment-166250016). +
+

Title

+ {array.map(() => { + return ; + })} + {message} +
+// Another example of above issue +// (https://github.com/mooz/js2-mode/issues/490). + +
+ {variable1} + +
+
+ +// Comments and arrows can break indentation (Bug#24896 / +// https://github.com/mooz/js2-mode/issues/389). +const Component = props => ( + c} + b={123}> + +); +const Component = props => ( + + +); +const Component = props => ( // Parse this comment, please. + c} + b={123}> + +); +const Component = props => ( // Parse this comment, please. + + +); +// Another example of above issue (Bug#30225). +class { + render() { + return ( + + ); + } +} + +// JSX attributes of an arrow function’s expression body’s JSX +// expression should be indented with respect to the JSX opening +// element (Bug#26001 / +// https://github.com/mooz/js2-mode/issues/389#issuecomment-271869380). +class { + render() { + const messages = this.state.messages.map( + message => + ); return messages; + } + render() { + const messages = this.state.messages.map(message => + + ); return messages; + } +} + +// Users expect tag closers to align with the tag’s start; this is the +// style used in the React docs, so it should be the default. +// - https://github.com/mooz/js2-mode/issues/389#issuecomment-390766873 +// - https://github.com/mooz/js2-mode/issues/482 +// - Bug#32158 +const foo = (props) => ( +
+ i} + /> + +
+); + +// Embedded JSX in parens breaks indentation +// (https://github.com/mooz/js2-mode/issues/411). +let a = ( +
+ {condition && } + {condition && } +
+
+) +let b = ( +
+ {condition && ()} +
+
+) +let c = ( +
+ {condition && ()} + {condition && "something"} +
+) +let d = ( +
+ {()} + {condition && "something"} +
+) +// Another example of the above issue (Bug#27000). +function testA() { + return ( +
+
{ (
) }
+
+ ); +} +function testB() { + return ( +
+
{
}
+
+ ); +} +// Another example of the above issue +// (https://github.com/mooz/js2-mode/issues/451). +class Classy extends React.Component { + render () { + return ( +
+
    + { this.state.list.map((item) => { + return (
    ) + })} +
+
+ ) + } +} + +// Self-closing tags should be indented properly +// (https://github.com/mooz/js2-mode/issues/459). +export default ({ stars }) => ( +
+
+ Congratulations! +
+
+ 0)} size='large' /> +
+ 1)} size='small' /> + 2)} size='small' /> +
+
+
+ You have created 1 reminder +
+
+) + +// JS expressions should not break indentation +// (https://github.com/mooz/js2-mode/issues/462). +// +// In the referenced issue, the user actually wanted indentation which +// was simply different than Emacs’ SGML attribute indentation. +// Nevertheless, his issue highlighted our inability to properly +// indent code with JSX inside JSXExpressionContainers inside JSX. +return ( + + + ( +
nothing
+ )} /> + +
+
+) + +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// End: diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el index 681e51de0ed..1de2df0e85a 100644 --- a/test/lisp/progmodes/js-tests.el +++ b/test/lisp/progmodes/js-tests.el @@ -22,6 +22,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'js) (require 'syntax) @@ -196,6 +197,33 @@ if (!/[ (:,='\"]/.test(value)) { ;; The bug was a hang. (should t))) +;;;; Indentation tests. + +(defmacro js-deftest-indent (file) + `(ert-deftest ,(intern (format "js-indent-test/%s" file)) () + :tags '(:expensive-test) + (let ((buf (find-file-noselect (ert-resource-file ,file)))) + (unwind-protect + (with-current-buffer buf + (let ((orig (buffer-string))) + (indent-region (point-min) (point-max)) + (should (equal (buffer-string) orig)))) + (kill-buffer buf))))) + +(js-deftest-indent "js-chain.js") +(js-deftest-indent "js-indent-align-list-continuation-nil.js") +(js-deftest-indent "js-indent-init-dynamic.js") +(js-deftest-indent "js-indent-init-t.js") +(js-deftest-indent "js.js") +(js-deftest-indent "jsx-align-gt-with-lt.jsx") +(js-deftest-indent "jsx-comment-string.jsx") +(js-deftest-indent "jsx-indent-level.jsx") +(js-deftest-indent "jsx-quote.jsx") +(js-deftest-indent "jsx-self-closing.jsx") +(js-deftest-indent "jsx-unclosed-1.jsx") +(js-deftest-indent "jsx-unclosed-2.jsx") +(js-deftest-indent "jsx.jsx") + (provide 'js-tests) ;;; js-tests.el ends here diff --git a/test/manual/indent/js-chain.js b/test/manual/indent/js-chain.js deleted file mode 100644 index 2a290294026..00000000000 --- a/test/manual/indent/js-chain.js +++ /dev/null @@ -1,29 +0,0 @@ -// Normal chaining. -let x = svg.mumble() - .zzz; - -// Chaining with an intervening line comment. -let x = svg.mumble() // line comment - .zzz; - -// Chaining with multiple dots. -let x = svg.selectAll().something() - .zzz; - -// Nested chaining. -let x = svg.selectAll(d3.svg.something() - .zzz); - -// Nothing to chain to. -let x = svg() - .zzz; - -// Nothing to chain to. -let x = svg().mumble.x() + 73 - .zzz; - -// Local Variables: -// indent-tabs-mode: nil -// js-chain-indent: t -// js-indent-level: 2 -// End: diff --git a/test/manual/indent/js-indent-align-list-continuation-nil.js b/test/manual/indent/js-indent-align-list-continuation-nil.js deleted file mode 100644 index 383b2539a26..00000000000 --- a/test/manual/indent/js-indent-align-list-continuation-nil.js +++ /dev/null @@ -1,20 +0,0 @@ -const funcAssignment = function (arg1, - arg2, - arg3) { - return { test: this, - which: "would", - align: "as well with the default setting" - }; -} - -function funcDeclaration(arg1, - arg2 -) { - return [arg1, - arg2]; -} - -// Local Variables: -// indent-tabs-mode: nil -// js-indent-align-list-continuation: nil -// End: diff --git a/test/manual/indent/js-indent-init-dynamic.js b/test/manual/indent/js-indent-init-dynamic.js deleted file mode 100644 index 536a976e86e..00000000000 --- a/test/manual/indent/js-indent-init-dynamic.js +++ /dev/null @@ -1,30 +0,0 @@ -var foo = function() { - return 7; -}; - -var foo = function() { - return 7; - }, - bar = 8; - -var foo = function() { - return 7; - }, - bar = function() { - return 8; - }; - -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// js-indent-first-init: dynamic -// End: - -// The following test intentionally produces a scan error and should -// be placed below all other tests to prevent awkward indentation. -// (It still thinks it's within the body of a function.) - -var foo = function() { - return 7; - , - bar = 8; diff --git a/test/manual/indent/js-indent-init-t.js b/test/manual/indent/js-indent-init-t.js deleted file mode 100644 index bb755420ba7..00000000000 --- a/test/manual/indent/js-indent-init-t.js +++ /dev/null @@ -1,21 +0,0 @@ -var foo = function() { - return 7; - }; - -var foo = function() { - return 7; - }, - bar = 8; - -var foo = function() { - return 7; - }, - bar = function() { - return 8; - }; - -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// js-indent-first-init: t -// End: diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js deleted file mode 100644 index 9658c95701c..00000000000 --- a/test/manual/indent/js.js +++ /dev/null @@ -1,171 +0,0 @@ -var a = 1; -b = 2; - -let c = 1, - d = 2; - -var e = 100500, - + 1; - -// Don't misinterpret "const" -/const/ - -function test () -{ - return /[/]/.test ('/') // (bug#19397) -} - -var f = bar('/protocols/') -baz(); - -var h = 100500 -1; - -const i = 1, - j = 2; - -var k = 1, - l = [ - 1, 2, - 3, 4 - ], - m = 5; - -var n = function() { - return 7; -}, - o = 8; - -foo(bar, function() { - return 2; -}); - -switch (b) { -case "a": - 2; -default: - 3; -} - -var p = { - case: 'zzzz', - default: 'donkey', - tee: 'ornery' -}; - -var evens = [e for each (e in range(0, 21)) - if (ed % 2 == 0)]; - -var funs = [ - function() { - for (;;) { - } - }, - function(){}, -]; - -!b - !=b - !==b - -a++ -b += - c - -var re = /some value/ -str.match(re) - -baz(`http://foo.bar/${tee}`) - .qux(); - -`multiline string - contents - are kept - unchanged!` - -class A { - * x() { - return 1 - * a(2); - } - - *[Symbol.iterator]() { - yield "Foo"; - yield "Bar"; - } -} - -if (true) - 1 -else - 2 - -Foobar - .find() - .catch((err) => { - return 2; - }) - .then((num) => { - console.log(num); - }); - -var z = [ - ...iterableObj, - 4, - 5 -] - -var arr = [ - -1, 2, - -3, 4 + - -5 -]; - -// Regression test for bug#15582. -if (x > 72 && - y < 85) { // found - do_something(); -} - -// Test that chaining doesn't happen when js-chain-indent is nil. -let x = svg.mumble() - .zzz; - -// https://github.com/mooz/js2-mode/issues/405 -if (1) { - isSet - ? (isEmpty ? 2 : 3) - : 4 -} - -// Regexp is not a continuation -bar( - "string arg1", - /abc/ -) - -// No infloop inside js--re-search-backward-inner -let b = { - a : ` - //1 - ` -} - -// bug#25904 -foo.bar.baz(very => // A comment - very -).biz(([baz={a: [123]}, boz]) => - baz -).snarf((snorf) => /* Another comment */ - snorf -); - -// Continuation of bug#25904; support broken arrow as N+1th arg -map(arr, (val) => - val -) - -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// End: diff --git a/test/manual/indent/jsx-align-gt-with-lt.jsx b/test/manual/indent/jsx-align-gt-with-lt.jsx deleted file mode 100644 index 8eb1d6d718c..00000000000 --- a/test/manual/indent/jsx-align-gt-with-lt.jsx +++ /dev/null @@ -1,12 +0,0 @@ - - - - -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// js-jsx-align->-with-<: nil -// End: diff --git a/test/manual/indent/jsx-comment-string.jsx b/test/manual/indent/jsx-comment-string.jsx deleted file mode 100644 index cae023e7288..00000000000 --- a/test/manual/indent/jsx-comment-string.jsx +++ /dev/null @@ -1,23 +0,0 @@ -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// End: - -// The following tests go below any comments to avoid including -// misindented comments among the erroring lines. - -// The JSX-like text in comments/strings should be treated like the enclosing -// syntax, not like JSX. - -// -void 0 - -"" -void 0 - - - {/* */} - - Yum! - - diff --git a/test/manual/indent/jsx-indent-level.jsx b/test/manual/indent/jsx-indent-level.jsx deleted file mode 100644 index 0a84b9eb77a..00000000000 --- a/test/manual/indent/jsx-indent-level.jsx +++ /dev/null @@ -1,13 +0,0 @@ -return ( - - - Hello World! - - -) - -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 4 -// js-jsx-indent-level: 2 -// End: diff --git a/test/manual/indent/jsx-quote.jsx b/test/manual/indent/jsx-quote.jsx deleted file mode 100644 index 1b2c6528734..00000000000 --- a/test/manual/indent/jsx-quote.jsx +++ /dev/null @@ -1,16 +0,0 @@ -// JSX text node values should be strings, but only JS string syntax -// is considered, so quote marks delimit strings like normal, with -// disastrous results (https://github.com/mooz/js2-mode/issues/409). -function Bug() { - return
C'est Montréal
; -} -function Test(foo = /'/, - bar = 123) {} - -// This test is in a separate file because it can break other tests -// when indenting the whole buffer (not sure why). - -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// End: diff --git a/test/manual/indent/jsx-self-closing.jsx b/test/manual/indent/jsx-self-closing.jsx deleted file mode 100644 index f8ea7a138ad..00000000000 --- a/test/manual/indent/jsx-self-closing.jsx +++ /dev/null @@ -1,13 +0,0 @@ -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// End: - -// The following test goes below any comments to avoid including -// misindented comments among the erroring lines. - -// Properly parse/indent code with a self-closing tag inside the -// attribute of another self-closing tag. -
-
} /> -
diff --git a/test/manual/indent/jsx-unclosed-1.jsx b/test/manual/indent/jsx-unclosed-1.jsx deleted file mode 100644 index 1f5c3fba8da..00000000000 --- a/test/manual/indent/jsx-unclosed-1.jsx +++ /dev/null @@ -1,13 +0,0 @@ -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// End: - -// The following test goes below any comments to avoid including -// misindented comments among the erroring lines. - -return ( -
- {array.map(function () { - return { - a: 1 diff --git a/test/manual/indent/jsx-unclosed-2.jsx b/test/manual/indent/jsx-unclosed-2.jsx deleted file mode 100644 index fb665b96a43..00000000000 --- a/test/manual/indent/jsx-unclosed-2.jsx +++ /dev/null @@ -1,65 +0,0 @@ -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// End: - -// The following tests go below any comments to avoid including -// misindented comments among the erroring lines. - -// Don’t misinterpret inequality operators as JSX. -for (; i < length;) void 0 -if (foo > bar) void 0 - -// Don’t misintrepet inequalities within JSX, either. -
- {foo < bar} -
- -// Don’t even misinterpret unary operators as JSX. -if (foo < await bar) void 0 -while (await foo > bar) void 0 - -
- {foo < await bar} -
- -// Allow unary keyword names as null-valued JSX attributes. -// (As if this will EVER happen
) - - - - - How would we ever live without unary support - - - - - -// “-” is not allowed in a JSXBoundaryElement’s name. - - // Weirdly-indented “continued expression.” - -// “-” may be used in a JSXAttribute’s name. - - -// Weird spaces should be tolerated. -< div > - < div > - < div - attr="" - / > - < div - attr="" - / > - < / div> -< / div > - -// Non-ASCII identifiers are acceptable. -<Über> - - Guten Tag! - - diff --git a/test/manual/indent/jsx.jsx b/test/manual/indent/jsx.jsx deleted file mode 100644 index c200979df8c..00000000000 --- a/test/manual/indent/jsx.jsx +++ /dev/null @@ -1,314 +0,0 @@ -var foo =
; - -return ( -
-
-
-
-
-
-
-
-); - -React.render( -
-
-
, - { - a: 1 - }, -
-
-
-); - -return ( - // Sneaky! -
-); - -return ( -
- // Sneaky! -); - -React.render( - , - { - a: 1 - } -); - -return ( -
- {array.map(function () { - return { - a: 1 - }; - })} -
-); - -return ( -
-
-); - -return ( -
// Also dedent. -); - -return ( -
-) - -// JSXMemberExpression names are parsed/indented: - -
- - Hello World! - - -
-
-
-
-
- -// JSXOpeningFragment and JSXClosingFragment are parsed/indented: -<> -
- <> - Hello World! - - <> -
-
- -
- - -// Indent void expressions (no need for contextual parens / commas) -// (https://github.com/mooz/js2-mode/issues/140#issuecomment-166250016). -
-

Title

- {array.map(() => { - return ; - })} - {message} -
-// Another example of above issue -// (https://github.com/mooz/js2-mode/issues/490). - -
- {variable1} - -
-
- -// Comments and arrows can break indentation (Bug#24896 / -// https://github.com/mooz/js2-mode/issues/389). -const Component = props => ( - c} - b={123}> - -); -const Component = props => ( - - -); -const Component = props => ( // Parse this comment, please. - c} - b={123}> - -); -const Component = props => ( // Parse this comment, please. - - -); -// Another example of above issue (Bug#30225). -class { - render() { - return ( - - ); - } -} - -// JSX attributes of an arrow function’s expression body’s JSX -// expression should be indented with respect to the JSX opening -// element (Bug#26001 / -// https://github.com/mooz/js2-mode/issues/389#issuecomment-271869380). -class { - render() { - const messages = this.state.messages.map( - message => - ); return messages; - } - render() { - const messages = this.state.messages.map(message => - - ); return messages; - } -} - -// Users expect tag closers to align with the tag’s start; this is the -// style used in the React docs, so it should be the default. -// - https://github.com/mooz/js2-mode/issues/389#issuecomment-390766873 -// - https://github.com/mooz/js2-mode/issues/482 -// - Bug#32158 -const foo = (props) => ( -
- i} - /> - -
-); - -// Embedded JSX in parens breaks indentation -// (https://github.com/mooz/js2-mode/issues/411). -let a = ( -
- {condition && } - {condition && } -
-
-) -let b = ( -
- {condition && ()} -
-
-) -let c = ( -
- {condition && ()} - {condition && "something"} -
-) -let d = ( -
- {()} - {condition && "something"} -
-) -// Another example of the above issue (Bug#27000). -function testA() { - return ( -
-
{ (
) }
-
- ); -} -function testB() { - return ( -
-
{
}
-
- ); -} -// Another example of the above issue -// (https://github.com/mooz/js2-mode/issues/451). -class Classy extends React.Component { - render () { - return ( -
-
    - { this.state.list.map((item) => { - return (
    ) - })} -
-
- ) - } -} - -// Self-closing tags should be indented properly -// (https://github.com/mooz/js2-mode/issues/459). -export default ({ stars }) => ( -
-
- Congratulations! -
-
- 0)} size='large' /> -
- 1)} size='small' /> - 2)} size='small' /> -
-
-
- You have created 1 reminder -
-
-) - -// JS expressions should not break indentation -// (https://github.com/mooz/js2-mode/issues/462). -// -// In the referenced issue, the user actually wanted indentation which -// was simply different than Emacs’ SGML attribute indentation. -// Nevertheless, his issue highlighted our inability to properly -// indent code with JSX inside JSXExpressionContainers inside JSX. -return ( - - - ( -
nothing
- )} /> - -
-
-) - -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// End: -- cgit v1.2.3 From 8299126521e4c166fe43aa7ac8eadf0ff1e41457 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 18 Oct 2020 02:46:31 +0200 Subject: Minor improvements to emacsclient man page * doc/man/emacsclient.1: Make flag descriptions into full sentences to be more consistent. --- doc/man/emacsclient.1 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/man/emacsclient.1 b/doc/man/emacsclient.1 index 62f5489653c..ba64efa282c 100644 --- a/doc/man/emacsclient.1 +++ b/doc/man/emacsclient.1 @@ -1,5 +1,5 @@ .\" See section COPYING for conditions for redistribution. -.TH EMACSCLIENT 1 "2020-10-15" "GNU Emacs" "GNU" +.TH EMACSCLIENT 1 "2020-10-18" "GNU Emacs" "GNU" .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other params are allowed: see man(7), man(1) .SH NAME @@ -61,45 +61,45 @@ is treated as column 1. This option applies only to the next file specified. .TP .B \-a, \-\-alternate-editor=COMMAND -if the Emacs server is not running, run the specified shell command instead. +If the Emacs server is not running, run the specified shell command instead. This can also be specified via the ALTERNATE_EDITOR environment variable. If the value of ALTERNATE_EDITOR is the empty string, run "emacs \-\-daemon" to start Emacs in daemon mode, and try to connect to it. .TP .B -c, \-\-create-frame -create a new frame instead of trying to use the current Emacs frame +Create a new frame instead of trying to use the current Emacs frame. .TP .B \-F, \-\-frame-parameters=ALIST -set the parameters of a newly-created frame. +Set the parameters of a newly-created frame. .TP .B \-d, \-\-display=DISPLAY -tell the server to display the files on the given display. +Tell the server to display the files on the given display. .TP .B \-e, \-\-eval -do not visit files but instead evaluate the arguments as Emacs +Do not visit files but instead evaluate the arguments as Emacs Lisp expressions. .TP .B \-f, \-\-server-file=FILENAME -use TCP configuration file FILENAME for communication. +Use TCP configuration file FILENAME for communication. This can also be specified via the EMACS_SERVER_FILE environment variable. .TP .B \-n, \-\-no-wait -returns +Return immediately without waiting for you to "finish" the buffer in Emacs. If combined with --eval, this option is ignored. .TP .B \-nw, \-t, \-\-tty -open a new Emacs frame on the current terminal +Open a new Emacs frame on the current terminal. .TP .B \-s, \-\-socket-name=FILENAME -use socket named FILENAME for communication. +Use socket named FILENAME for communication. This can also be specified via the EMACS_SOCKET_NAME environment variable. .TP .B \-V, \-\-version -print version information and exit +Print version information and exit. .TP .B \-H, \-\-help -print this usage information message and exit +Print this usage information message and exit. .SH "EXIT STATUS" Normally, the exit status is 0. If emacsclient shuts down due to Emacs signaling an error, the exit status is 1. -- cgit v1.2.3 From a67fed2e0c836658ac6bf9658bb8769c5c216b9b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 18 Oct 2020 03:17:58 +0200 Subject: Make nxml-newline-and-indent argument optional * lisp/nxml/nxml-mode.el (nxml-newline-and-indent): Make argument optional to conform to 'comment-line-break-function'. (Bug#40193) --- lisp/nxml/nxml-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index 644de03cf4c..5bb904e6915 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -2230,7 +2230,7 @@ ENDP is t in the former case, nil in the latter." (skip-line-prefix fill-prefix) fill-prefix)) -(defun nxml-newline-and-indent (soft) +(defun nxml-newline-and-indent (&optional soft) (delete-horizontal-space) (if soft (insert-and-inherit ?\n) (newline 1)) (nxml-indent-line)) -- cgit v1.2.3 From 990791262433923748047d3bec0161cbcfca5b59 Mon Sep 17 00:00:00 2001 From: Adam SjĂžgren Date: Sun, 18 Oct 2020 09:36:43 +0200 Subject: Add support for emojis i smiley.el * lisp/gnus/smiley.el (smiley-style): Add emoji tag. (smiley-emoji-regexp-alist): New defcustom. (smiley-update-cache, smiley-region): Support emoji (non-image) replacement (bug#43889). --- etc/NEWS | 4 +++ lisp/gnus/smiley.el | 76 +++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 60 insertions(+), 20 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index bae4cb3963e..d525ace6716 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -434,6 +434,10 @@ tags to be considered as well. ** Gnus +*** New value for user option 'smiley-style' +Smileys can now be rendered with emojis instead of small images when +using the new 'emoji' value in 'smiley-style'. + +++ *** New user option 'gnus-agent-eagerly-store-articles'. If non-nil (which is the default), the Gnus Agent will store all read diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el index 5504a520783..7d6efacfe07 100644 --- a/lisp/gnus/smiley.el +++ b/lisp/gnus/smiley.el @@ -44,6 +44,7 @@ ;; cry ;-( ;; dead X-) ;; grin :-D +;; halo O:-) ;;; Code: @@ -64,7 +65,8 @@ "Smiley style." :type '(choice (const :tag "small, 3 colors" low-color) ;; 13x14 (const :tag "medium, ~10 colors" medium) ;; 16x16 - (const :tag "dull, grayscale" grayscale)) ;; 14x14 + (const :tag "dull, grayscale" grayscale) ;; 14x14 + (const :tag "emoji, full color" emoji)) :set (lambda (symbol value) (set-default symbol value) (setq smiley-data-directory (smiley-directory)) @@ -96,6 +98,35 @@ is nil, use `smiley-style'." :type 'directory :group 'smiley) +(defcustom smiley-emoji-regexp-alist + '(("\\(;-)\\)\\W" 1 "😉") + ("[^;]\\(;)\\)\\W" 1 "😉") + ("\\(:-]\\)\\W" 1 "😬") + ("\\(8-)\\)\\W" 1 "đŸ„Ž") + ("\\(:-|\\)\\W" 1 "😐") + ("\\(:-[/\\]\\)\\W" 1 "😕") + ("\\(:-(\\)\\W" 1 "😠") + ("\\(X-)\\)\\W" 1 "đŸ˜”") ; 💀 + ("\\(:-{\\)\\W" 1 "😩") + ("\\(>:-)\\)\\W" 1 "😈") + ("\\(;-(\\)\\W" 1 "😱") + ("\\(:-D\\)\\W" 1 "😀") + ("\\(O:-)\\)\\W" 1 "😇") + ;; "smile" must be come after "evil" + ("\\(\\^?:-?)\\)\\W" 1 "🙂")) + "A list of regexps to map smilies to emoji. +The elements are (REGEXP MATCH EMOJI), where MATCH is the submatch in +regexp to replace with EMOJI." + :version "28.1" + :type '(repeat (list regexp + (integer :tag "Regexp match number") + (string :tag "Emoji"))) + :set (lambda (symbol value) + (set-default symbol value) + (smiley-update-cache)) + :initialize 'custom-initialize-default + :group 'smiley) + ;; The XEmacs version has a baroque, if not rococo, set of these. (defcustom smiley-regexp-alist '(("\\(;-)\\)\\W" 1 "blink") @@ -142,23 +173,25 @@ regexp to replace with IMAGE. IMAGE is the name of an image file in (defun smiley-update-cache () (setq smiley-cached-regexp-alist nil) - (dolist (elt (if (symbolp smiley-regexp-alist) - (symbol-value smiley-regexp-alist) - smiley-regexp-alist)) - (let ((types gnus-smiley-file-types) - file type) - (while (and (not file) - (setq type (pop types))) - (unless (file-exists-p - (setq file (expand-file-name (concat (nth 2 elt) "." type) - smiley-data-directory))) - (setq file nil))) - (when type - (let ((image (gnus-create-image file (intern type) nil - :ascent 'center))) - (when image - (push (list (car elt) (cadr elt) image) - smiley-cached-regexp-alist))))))) + (if (eq smiley-style 'emoji) + (setq smiley-cached-regexp-alist smiley-emoji-regexp-alist) + (dolist (elt (if (symbolp smiley-regexp-alist) + (symbol-value smiley-regexp-alist) + smiley-regexp-alist)) + (let ((types gnus-smiley-file-types) + file type) + (while (and (not file) + (setq type (pop types))) + (unless (file-exists-p + (setq file (expand-file-name (concat (nth 2 elt) "." type) + smiley-data-directory))) + (setq file nil))) + (when type + (let ((image (gnus-create-image file (intern type) nil + :ascent 'center))) + (when image + (push (list (car elt) (cadr elt) image) + smiley-cached-regexp-alist)))))))) ;; Not implemented: ;; (defvar smiley-mouse-map @@ -190,8 +223,11 @@ A list of images is returned." (when image (push image images) (gnus-add-wash-type 'smiley) - (gnus-add-image 'smiley image) - (gnus-put-image image string 'smiley)))) + (if (symbolp image) + (progn + (gnus-add-image 'smiley image) + (gnus-put-image image string 'smiley)) + (insert image))))) images)))) ;;;###autoload -- cgit v1.2.3 From d96734729d0ed1fb854231c1ede3895c04c5b8ea Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 18 Oct 2020 09:42:25 +0200 Subject: Fix up smiley emoji application to make it reversible * lisp/gnus/smiley.el (smiley-region): Use text properties for the emojis instead of rewriting the message. --- lisp/gnus/smiley.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el index 7d6efacfe07..3edae04fcc0 100644 --- a/lisp/gnus/smiley.el +++ b/lisp/gnus/smiley.el @@ -227,7 +227,11 @@ A list of images is returned." (progn (gnus-add-image 'smiley image) (gnus-put-image image string 'smiley)) - (insert image))))) + ;; This is a string, but mark the property for + ;; deletion if the washing method is switched off. + (insert (propertize string + 'display image + 'gnus-image-category 'smiley)))))) images)))) ;;;###autoload -- cgit v1.2.3 From a10a3d48e8cb6ff4e52838ccfb2a0d270ec7b470 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 18 Oct 2020 09:45:09 +0200 Subject: Document the new smiley value * doc/misc/gnus.texi (Smileys): Document the emoji smiley value. --- doc/misc/gnus.texi | 8 ++++---- etc/NEWS | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 3f893e93c8c..69ac05d5aa9 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -23919,10 +23919,10 @@ The following variables customize the appearance of the smileys: @item smiley-style @vindex smiley-style Specifies the smiley style. Predefined smiley styles include -@code{low-color} (small 13x14 pixel, three-color images), @code{medium} -(more colorful images, 16x16 pixel), and @code{grayscale} (grayscale -images, 14x14 pixel). The default depends on the height of the default -face. +@code{emoji} (use emoji characters), @code{low-color} (small 13x14 +pixel, three-color images), @code{medium} (more colorful images, 16x16 +pixel), and @code{grayscale} (grayscale images, 14x14 pixel). The +default depends on the height of the default face. @item smiley-data-directory @vindex smiley-data-directory diff --git a/etc/NEWS b/etc/NEWS index d525ace6716..27661e647a9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -434,6 +434,7 @@ tags to be considered as well. ** Gnus ++++ *** New value for user option 'smiley-style' Smileys can now be rendered with emojis instead of small images when using the new 'emoji' value in 'smiley-style'. -- cgit v1.2.3 From b7dfae3a8168977013e8de1df0916c51e76e7326 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 18 Oct 2020 10:18:57 +0200 Subject: Fix a misleading comment in Freplace_match * src/search.c (Freplace_match): Fix a misleading comment (bug#42424). --- src/search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search.c b/src/search.c index 6fb3716cd43..e7f90949464 100644 --- a/src/search.c +++ b/src/search.c @@ -2748,7 +2748,7 @@ since only regular expressions have distinguished subexpressions. */) /* Put point back where it was in the text, if possible. */ TEMP_SET_PT (clip_to_bounds (BEGV, opoint + (opoint <= 0 ? ZV : 0), ZV)); - /* Now move point "officially" to the start of the inserted replacement. */ + /* Now move point "officially" to the end of the inserted replacement. */ move_if_not_intangible (newpoint); return Qnil; -- cgit v1.2.3 From 9bc5c016a1cbdcb0c29b2deaec1d8156852a3980 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Sun, 18 Oct 2020 15:54:02 +0200 Subject: Strengthen js-mode indentation tests Test not only that the indentation engine is idempotent but that it will indent a file to the expected shape from scratch. * test/lisp/progmodes/js-tests.el (js-tests--remove-indentation): New. (js-deftest-indent): Extend test. --- test/lisp/progmodes/js-tests.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el index 1de2df0e85a..6c3a618b949 100644 --- a/test/lisp/progmodes/js-tests.el +++ b/test/lisp/progmodes/js-tests.el @@ -199,6 +199,14 @@ if (!/[ (:,='\"]/.test(value)) { ;;;; Indentation tests. +(defun js-tests--remove-indentation () + "Remove all indentation in the current buffer." + (goto-char (point-min)) + (while (re-search-forward (rx bol (+ (in " \t"))) nil t) + (let ((syntax (save-match-data (syntax-ppss)))) + (unless (nth 3 syntax) ; Avoid multiline string literals. + (replace-match ""))))) + (defmacro js-deftest-indent (file) `(ert-deftest ,(intern (format "js-indent-test/%s" file)) () :tags '(:expensive-test) @@ -206,6 +214,11 @@ if (!/[ (:,='\"]/.test(value)) { (unwind-protect (with-current-buffer buf (let ((orig (buffer-string))) + (js-tests--remove-indentation) + ;; Indent and check that we get the original text. + (indent-region (point-min) (point-max)) + (should (equal (buffer-string) orig)) + ;; Verify idempotency. (indent-region (point-min) (point-max)) (should (equal (buffer-string) orig)))) (kill-buffer buf))))) -- cgit v1.2.3 From 282f35083c02ace9b287dc311bef1d16721e6c0c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 18 Oct 2020 17:40:45 +0300 Subject: ; * etc/NEWS: Call out the new variable 'shr-offer-extend-specpdl'. --- etc/NEWS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 27661e647a9..64758d455a0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -840,6 +840,14 @@ current environment. Its default value matches localized abbreviations of the "reply" prefix on the Subject line in various languages. +--- +*** New user option 'shr-offer-extend-specpdl'. +If this is nil, rendering of HTML in the email message body that +requires to enlarge 'max-specpdl-size', the number of Lisp variable +bindings, will be aborted, and Emacs will not ask you whether to +enlarge 'max-specpdl-size' to complete the rendering. The default is +t, which preserves the original behavior. + ** Apropos *** New commands 'apropos-next-symbol' and 'apropos-previous-symbol'. -- cgit v1.2.3 From dcf9cd47ae71e39eb616d77acb531ac11357391f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 8 Jul 2019 18:37:50 +0200 Subject: Add new Lisp implementation of substitute-command-keys This is only the first step towards a full Lisp implementation, and does not remove the old C code. On the contrary, it is partly based on using the old C code, which is to be replaced in steps. This also makes it easy to test that it produces the same output as the old. * src/doc.c (Fsubstitute_command_keys_old): Rename from Fsubstitute_command_keys. (Fget_quoting_style): New defun to expose text_quoting_style to Lisp. (syms_of_doc): Expose above symbols. * lisp/help.el (substitute-command-keys): New Lisp version of substitute-command-keys. (Bug#8951) * src/keymap.c (Fdescribe_map_tree): New defun to expose describe_map_tree to Lisp. (syms_of_keymap): New defsubr for Fdescribe_map_tree. * src/keyboard.c (help_echo_substitute_command_keys): * src/doc.c (Fdocumentation, Fdocumentation_property): * src/print.c (print_error_message): * src/syntax.c (Finternal_describe_syntax_value): Fix calls to use new Lisp implementation of substitute-command-keys. * test/src/doc-tests.el: Remove file. * test/lisp/help-tests.el: Add tests for substitute-command-keys copied from above file. --- lisp/help.el | 144 +++++++++++++++++++++++++++++++++ src/doc.c | 36 +++++++-- src/keyboard.c | 4 +- src/keymap.c | 32 ++++++++ src/print.c | 2 +- src/syntax.c | 2 +- test/lisp/help-tests.el | 210 ++++++++++++++++++++++++++++++++++++++++++++++++ test/src/doc-tests.el | 98 ---------------------- 8 files changed, 419 insertions(+), 109 deletions(-) delete mode 100644 test/src/doc-tests.el diff --git a/lisp/help.el b/lisp/help.el index 9b7355c6b63..8d0d9c42704 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -973,6 +973,150 @@ is currently activated with completion." minor-modes nil) (setq minor-modes (cdr minor-modes))))) result)) + + +(defun substitute-command-keys (string) + "Substitute key descriptions for command names in STRING. +Each substring of the form \\\\=[COMMAND] is replaced by either a +keystroke sequence that invokes COMMAND, or \"M-x COMMAND\" if COMMAND +is not on any keys. + +Each substring of the form \\\\={MAPVAR} is replaced by a summary of +the value of MAPVAR as a keymap. This summary is similar to the one +produced by ‘describe-bindings’. The summary ends in two newlines +(used by the helper function ‘help-make-xrefs’ to find the end of the +summary). + +Each substring of the form \\\\= specifies the use of MAPVAR +as the keymap for future \\\\=[COMMAND] substrings. + +Each grave accent \\=` is replaced by left quote, and each apostrophe \\=' +is replaced by right quote. Left and right quote characters are +specified by ‘text-quoting-style’. + +\\\\== quotes the following character and is discarded; thus, \\\\==\\\\== puts \\\\== +into the output, \\\\==\\[ puts \\[ into the output, and \\\\==\\=` puts \\=` into the +output. + +Return the original STRING if no substitutions are made. +Otherwise, return a new string (without any text properties)." + (when (not (null string)) + ;; KEYMAP is either nil (which means search all the active + ;; keymaps) or a specified local map (which means search just that + ;; and the global map). If non-nil, it might come from + ;; overriding-local-map, or from a \\ construct in STRING + ;; itself. + (let ((keymap overriding-local-map) + (inhibit-modification-hooks t) + (orig-buf (current-buffer))) + (with-temp-buffer + (insert string) + (goto-char (point-min)) + (while (< (point) (point-max)) + (let ((orig-point (point)) + end-point active-maps + close generate-summary) + (cond + ;; 1. Handle all sequences starting with "\" + ((= (following-char) ?\\) + (ignore-errors + (forward-char 1)) + (cond + ;; 1A. Ignore \= at end of string. + ((and (= (+ (point) 1) (point-max)) + (= (following-char) ?=)) + (forward-char 1)) + ;; 1B. \= quotes the next character; thus, to put in \[ + ;; without its special meaning, use \=\[. + ((= (following-char) ?=) + (goto-char orig-point) + (delete-char 2) + (ignore-errors + (forward-char 1))) + ;; 1C. \[foo] is replaced with the keybinding. + ((and (= (following-char) ?\[) + (save-excursion + (prog1 (search-forward "]" nil t) + (setq end-point (- (point) 2))))) + (goto-char orig-point) + (delete-char 2) + (let* ((fun (intern (buffer-substring (point) (1- end-point)))) + (key (with-current-buffer orig-buf + (where-is-internal fun keymap t)))) + ;; If this a command remap, we need to follow it. + (when (and (vectorp key) + (> (length key) 1) + (eq (aref key 0) 'remap) + (symbolp (aref key 1))) + (setq fun (aref key 1)) + (setq key (with-current-buffer orig-buf + (where-is-internal fun keymap t)))) + (if (not key) + ;; Function is not on any key. + (progn (insert "M-x ") + (goto-char (+ end-point 3)) + (delete-char 1)) + ;; Function is on a key. + (delete-char (- end-point (point))) + (insert (key-description key))))) + ;; 1D. \{foo} is replaced with a summary of the keymap + ;; (symbol-value foo). + ;; \ just sets the keymap used for \[cmd]. + ((and (or (and (= (following-char) ?{) + (setq close "}") + (setq generate-summary t)) + (and (= (following-char) ?<) + (setq close ">"))) + (or (save-excursion + (prog1 (search-forward close nil t) + (setq end-point (- (point) 2)))))) + (goto-char orig-point) + (delete-char 2) + (let* ((name (intern (buffer-substring (point) (1- end-point)))) + this-keymap) + (delete-char (- end-point (point))) + ;; Get the value of the keymap in TEM, or nil if + ;; undefined. Do this in the user's current buffer + ;; in case it is a local variable. + (with-current-buffer orig-buf + ;; This is for computing the SHADOWS arg for + ;; describe-map-tree. + (setq active-maps (current-active-maps)) + (when (boundp name) + (setq this-keymap (and (keymapp (symbol-value name)) + (symbol-value name))))) + (cond + ((null this-keymap) + (insert "\nUses keymap " + (substitute-command-keys "`") + (symbol-name name) + (substitute-command-keys "'") + ", which is not currently defined.\n") + (unless generate-summary + (setq keymap nil))) + ((not generate-summary) + (setq keymap this-keymap)) + (t + ;; Get the list of active keymaps that precede this one. + ;; If this one's not active, get nil. + (let ((earlier-maps (cdr (memq this-keymap (reverse active-maps))))) + (describe-map-tree this-keymap t (nreverse earlier-maps) + nil nil t nil nil)))))))) + ;; 2. Handle quotes. + ((and (eq (get-quoting-style) 'curve) + (or (and (= (following-char) ?\`) + (prog1 t (insert "‘"))) + (and (= (following-char) ?') + (prog1 t (insert "’"))))) + (delete-char 1)) + ((and (eq (get-quoting-style) 'straight) + (= (following-char) ?\`)) + (insert "'") + (delete-char 1)) + ;; 3. Nothing to do -- next character. + (t (forward-char 1))))) + (buffer-string))))) + (declare-function x-display-pixel-height "xfns.c" (&optional terminal)) (declare-function x-display-pixel-width "xfns.c" (&optional terminal)) diff --git a/src/doc.c b/src/doc.c index 18ab346cd11..212ebe96334 100644 --- a/src/doc.c +++ b/src/doc.c @@ -415,7 +415,7 @@ string is passed through `substitute-command-keys'. */) } if (NILP (raw)) - doc = Fsubstitute_command_keys (doc); + doc = call1 (Qsubstitute_command_keys, doc); return doc; } @@ -472,7 +472,7 @@ aren't strings. */) tem = Feval (tem, Qnil); if (NILP (raw) && STRINGP (tem)) - tem = Fsubstitute_command_keys (tem); + tem = call1 (Qsubstitute_command_keys, tem); return tem; } @@ -696,8 +696,27 @@ text_quoting_style (void) return CURVE_QUOTING_STYLE; } -DEFUN ("substitute-command-keys", Fsubstitute_command_keys, - Ssubstitute_command_keys, 1, 1, 0, +/* This is just a Lisp wrapper for text_quoting_style above. */ +DEFUN ("get-quoting-style", Fget_quoting_style, + Sget_quoting_style, 0, 0, 0, + doc: /* Return the current effective text quoting style. +See variable `text-quoting-style'. */) + (void) +{ + switch (text_quoting_style ()) + { + case STRAIGHT_QUOTING_STYLE: + return Qstraight; + case CURVE_QUOTING_STYLE: + return Qcurve; + case GRAVE_QUOTING_STYLE: + default: + return Qgrave; + } +} + +DEFUN ("substitute-command-keys-old", Fsubstitute_command_keys_old, + Ssubstitute_command_keys_old, 1, 1, 0, doc: /* Substitute key descriptions for command names in STRING. Each substring of the form \\=\\[COMMAND] is replaced by either a keystroke sequence that invokes COMMAND, or "M-x COMMAND" if COMMAND @@ -884,12 +903,12 @@ Otherwise, return a new string (without any text properties). */) { name = Fsymbol_name (name); AUTO_STRING (msg_prefix, "\nUses keymap `"); - insert1 (Fsubstitute_command_keys (msg_prefix)); + insert1 (Fsubstitute_command_keys_old (msg_prefix)); insert_from_string (name, 0, 0, SCHARS (name), SBYTES (name), 1); AUTO_STRING (msg_suffix, "', which is not currently defined.\n"); - insert1 (Fsubstitute_command_keys (msg_suffix)); + insert1 (Fsubstitute_command_keys_old (msg_suffix)); if (!generate_summary) keymap = Qnil; } @@ -1002,9 +1021,11 @@ Otherwise, return a new string (without any text properties). */) void syms_of_doc (void) { + DEFSYM (Qsubstitute_command_keys, "substitute-command-keys"); DEFSYM (Qfunction_documentation, "function-documentation"); DEFSYM (Qgrave, "grave"); DEFSYM (Qstraight, "straight"); + DEFSYM (Qcurve, "curve"); DEFVAR_LISP ("internal-doc-file-name", Vdoc_file_name, doc: /* Name of file containing documentation strings of built-in symbols. */); @@ -1036,5 +1057,6 @@ otherwise. */); defsubr (&Sdocumentation); defsubr (&Sdocumentation_property); defsubr (&Ssnarf_documentation); - defsubr (&Ssubstitute_command_keys); + defsubr (&Sget_quoting_style); + defsubr (&Ssubstitute_command_keys_old); } diff --git a/src/keyboard.c b/src/keyboard.c index 10d2f6323ed..2e0143379a0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2040,7 +2040,7 @@ help_echo_substitute_command_keys (Lisp_Object help) help))) return help; - return Fsubstitute_command_keys (help); + return call1 (Qsubstitute_command_keys, help); } /* Display the help-echo property of the character after the mouse pointer. @@ -7856,7 +7856,7 @@ parse_menu_item (Lisp_Object item, int inmenubar) /* The previous code preferred :key-sequence to :keys, so we preserve this behavior. */ if (STRINGP (keyeq) && !CONSP (keyhint)) - keyeq = concat2 (space_space, Fsubstitute_command_keys (keyeq)); + keyeq = concat2 (space_space, call1 (Qsubstitute_command_keys, keyeq)); else { Lisp_Object prefix = keyeq; diff --git a/src/keymap.c b/src/keymap.c index 0608bdddeea..05b0814c475 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -2915,6 +2915,37 @@ You type Translation\n\ Any inserted text ends in two newlines (used by `help-make-xrefs'). */ +DEFUN ("describe-map-tree", Fdescribe_map_tree, Sdescribe_map_tree, 1, 8, 0, + doc: /* This is just temporary. */) + (Lisp_Object startmap, Lisp_Object partial, Lisp_Object shadow, + Lisp_Object prefix, Lisp_Object title, Lisp_Object nomenu, + Lisp_Object transl, Lisp_Object always_title) +{ + ptrdiff_t count = SPECPDL_INDEX (); + char *title_string; + + if ( !NILP (title) ) + { + CHECK_STRING (title); + title_string = SSDATA(title); + } + else + { + title_string = NULL; + } + + bool b_partial = NILP (partial) ? false : true; + bool b_nomenu = NILP (nomenu) ? false : true; + bool b_transl = NILP (transl) ? false : true; + bool b_always_title = NILP (always_title) ? false : true; + + /* specbind (Qstandard_output, Fcurrent_buffer ()); */ + describe_map_tree (startmap, b_partial, shadow, prefix, title_string, + b_nomenu, b_transl, b_always_title, true); + + return unbind_to (count, Qnil); +} + void describe_map_tree (Lisp_Object startmap, bool partial, Lisp_Object shadow, Lisp_Object prefix, const char *title, bool nomenu, @@ -3708,6 +3739,7 @@ be preferred. */); defsubr (&Scurrent_active_maps); defsubr (&Saccessible_keymaps); defsubr (&Skey_description); + defsubr (&Sdescribe_map_tree); defsubr (&Sdescribe_vector); defsubr (&Ssingle_key_description); defsubr (&Stext_char_description); diff --git a/src/print.c b/src/print.c index dca095f2812..53aa353769b 100644 --- a/src/print.c +++ b/src/print.c @@ -941,7 +941,7 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context, else { Lisp_Object error_conditions = Fget (errname, Qerror_conditions); - errmsg = Fsubstitute_command_keys (Fget (errname, Qerror_message)); + errmsg = call1 (Qsubstitute_command_keys, Fget (errname, Qerror_message)); file_error = Fmemq (Qfile_error, error_conditions); } diff --git a/src/syntax.c b/src/syntax.c index 066972e6d88..df07809aaaf 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -1421,7 +1421,7 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value, { AUTO_STRING (prefixdoc, ",\n\t is a prefix character for `backward-prefix-chars'"); - insert1 (Fsubstitute_command_keys (prefixdoc)); + insert1 (call1 (Qsubstitute_command_keys, prefixdoc)); } return syntax; diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el index 0862d1264c7..048b6c325e4 100644 --- a/test/lisp/help-tests.el +++ b/test/lisp/help-tests.el @@ -3,6 +3,8 @@ ;; Copyright (C) 2019-2020 Free Software Foundation, Inc. ;; Author: Juanma Barranquero +;; Eli Zaretskii +;; Stefan Kangas ;; Keywords: help, internal ;; This file is part of GNU Emacs. @@ -23,6 +25,7 @@ ;;; Code: (require 'ert) +(eval-when-compile (require 'cl-lib)) (ert-deftest help-split-fundoc-SECTION () "Test new optional arg SECTION." @@ -51,6 +54,213 @@ (should (equal (help-split-fundoc nil t 'usage) nil)) (should (equal (help-split-fundoc nil t 'doc) nil)))) + +;;; substitute-command-keys + +(defmacro with-substitute-command-keys-test (&rest body) + `(cl-flet* ((should-be-same-as-c-version + ;; TODO: Remove this when old C function is removed. + (lambda (orig) + (should (equal-including-properties + (substitute-command-keys orig) + (substitute-command-keys-old orig))))) + (test + (lambda (orig result) + (should (equal-including-properties + (substitute-command-keys orig) + result)) + (should-be-same-as-c-version orig))) + (test-re + (lambda (orig regexp) + (should (string-match (concat "^" regexp "$") + (substitute-command-keys orig))) + (should-be-same-as-c-version orig)))) + ,@body)) + +(ert-deftest help-tests-substitute-command-keys/no-change () + (with-substitute-command-keys-test + (test "foo" "foo") + (test "\\invalid-escape" "\\invalid-escape"))) + +(ert-deftest help-tests-substitute-command-keys/commands () + (with-substitute-command-keys-test + (test "foo \\[goto-char]" "foo M-g c") + (test "\\[next-line]" "C-n") + (test "\\[next-line]\n\\[next-line]" "C-n\nC-n") + (test "\\[next-line]\\[previous-line]" "C-nC-p") + (test "\\[next-line]\\=\\[previous-line]" "C-n\\[previous-line]") + ;; Allow any style of quotes, since the terminal might not support + ;; UTF-8. Same thing is done below. + (test-re "\\[next-line]`foo'" "C-n[`'‘]foo['’]") + (test "\\[emacs-version]" "M-x emacs-version") + (test "\\[emacs-version]\\[next-line]" "M-x emacs-versionC-n") + (test-re "\\[emacs-version]`foo'" "M-x emacs-version[`'‘]foo['’]"))) + +(ert-deftest help-tests-substitute-command-keys/keymaps () + (with-substitute-command-keys-test + (test "\\{minibuffer-local-must-match-map}" + "\ +key binding +--- ------- + +C-g abort-recursive-edit +TAB minibuffer-complete +C-j minibuffer-complete-and-exit +RET minibuffer-complete-and-exit +ESC Prefix Command +SPC minibuffer-complete-word +? minibuffer-completion-help + file-cache-minibuffer-complete + previous-history-element + next-history-element + next-line-or-history-element + next-history-element + switch-to-completions + previous-line-or-history-element + +M-v switch-to-completions + +M-< minibuffer-beginning-of-buffer +M-n next-history-element +M-p previous-history-element +M-r previous-matching-history-element +M-s next-matching-history-element + +"))) + +(ert-deftest help-tests-substitute-command-keys/keymap-change () + (with-substitute-command-keys-test + (test "\\\\[abort-recursive-edit]" "C-g") + (test "\\\\[eval-defun]" "C-M-x"))) + +(ert-deftest help-tests-substitute-command-keys/undefined-map () + (with-substitute-command-keys-test + (test-re "\\{foobar-map}" + "\nUses keymap [`'‘]foobar-map['’], which is not currently defined.\n"))) + +(ert-deftest help-tests-substitute-command-keys/quotes () + (with-substitute-command-keys-test + (let ((text-quoting-style 'curve)) + (test "quotes ‘like this’" "quotes ‘like this’") + (test "`x'" "‘x’") + (test "`" "‘") + (test "'" "’") + (test "\\`" "\\‘")) + (let ((text-quoting-style 'straight)) + (test "quotes `like this'" "quotes 'like this'") + (test "`x'" "'x'") + (test "`" "'") + (test "'" "'") + (test "\\`" "\\'")) + (let ((text-quoting-style 'grave)) + (test "quotes `like this'" "quotes `like this'") + (test "`x'" "`x'") + (test "`" "`") + (test "'" "'") + (test "\\`" "\\`")))) + +(ert-deftest help-tests-substitute-command-keys/literals () + (with-substitute-command-keys-test + (test "foo \\=\\[goto-char]" "foo \\[goto-char]") + (test "foo \\=\\=" "foo \\=") + (test "\\=\\=" "\\=") + (test "\\=\\[" "\\[") + (let ((text-quoting-style 'curve)) + (test "\\=`x\\='" "`x'")) + (let ((text-quoting-style 'straight)) + (test "\\=`x\\='" "`x'")) + (let ((text-quoting-style 'grave)) + (test "\\=`x\\='" "`x'")))) + +(ert-deftest help-tests-substitute-command-keys/no-change () + (with-substitute-command-keys-test + (test "\\[foobar" "\\[foobar") + (test "\\=" "\\="))) + +(ert-deftest help-tests-substitute-command-keys/multibyte () + ;; Cannot use string= here, as that compares unibyte and multibyte + ;; strings not equal. + (should (compare-strings + (substitute-command-keys "\200 \\[goto-char]") nil nil + "\200 M-g c" nil nil))) + +(ert-deftest help-tests-substitute-command-keys/apropos () + (save-window-excursion + (apropos "foo") + (switch-to-buffer "*Apropos*") + (goto-char (point-min)) + (should (looking-at "Type RET on")))) + +(defvar help-tests-major-mode-map + (let ((map (make-keymap))) + (define-key map "x" 'foo-original) + map)) + +(define-derived-mode help-tests-major-mode nil + "Major mode for testing shadowing.") + +(defvar help-tests-minor-mode-map + (let ((map (make-keymap))) + (define-key map "x" 'foo-shadow) + map)) + +(define-minor-mode help-tests-minor-mode + "Minor mode for testing shadowing.") + +(ert-deftest help-tests-substitute-command-keys/shadow () + (with-substitute-command-keys-test + (with-temp-buffer + (help-tests-major-mode) + (test "\\{help-tests-major-mode-map}" + "\ +key binding +--- ------- + +x foo-original + +") + (help-tests-minor-mode) + (test "\\{help-tests-major-mode-map}" + "\ +key binding +--- ------- + +x foo-original + (this binding is currently shadowed) + +")))) + +(ert-deftest help-tests-substitute-command-keys/command-remap () + (with-substitute-command-keys-test + (let ((help-tests-major-mode-map (make-keymap))) ; Protect from changes. + (with-temp-buffer + (help-tests-major-mode) + (define-key help-tests-major-mode-map [remap foo] 'bar) + (test "\\{help-tests-major-mode-map}" + "\ +key binding +--- ------- + + Prefix Command + + bar + +"))))) + +;; TODO: This is a temporary test that should be removed together with +;; substitute-command-keys-old. +(ert-deftest help-tests-substitute-command-keys/compare () + (with-substitute-command-keys-test + (with-temp-buffer + (Info-mode) + (outline-minor-mode) + (test-re "\\{Info-mode-map}" ".*"))) + (with-substitute-command-keys-test + (with-temp-buffer + (c-mode) + (outline-minor-mode) + (test-re "\\{c-mode-map}" ".*")))) + (provide 'help-tests) ;;; help-tests.el ends here diff --git a/test/src/doc-tests.el b/test/src/doc-tests.el deleted file mode 100644 index 797b9ba5480..00000000000 --- a/test/src/doc-tests.el +++ /dev/null @@ -1,98 +0,0 @@ -;;; doc-tests.el --- Tests for doc.c -*- lexical-binding: t -*- - -;; Copyright (C) 2016-2020 Free Software Foundation, Inc. - -;; Author: Eli Zaretskii - -;; 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: - -(require 'ert) - -(ert-deftest doc-test-substitute-command-keys () - ;; Bindings. - (should (string= (substitute-command-keys "foo \\[goto-char]") "foo M-g c")) - ;; Cannot use string= here, as that compares unibyte and multibyte - ;; strings not equal. - (should (compare-strings - (substitute-command-keys "\200 \\[goto-char]") nil nil - "\200 M-g c" nil nil)) - ;; Literals. - (should (string= (substitute-command-keys "foo \\=\\[goto-char]") - "foo \\[goto-char]")) - (should (string= (substitute-command-keys "foo \\=\\=") - "foo \\=")) - ;; Keymaps. - ;; I don't see that this is testing anything useful. - ;; AFAICS all it does it fail whenever someone modifies the - ;; minibuffer map. -;;; (should (string= (substitute-command-keys -;;; "\\{minibuffer-local-must-match-map}") -;;; "\ -;;; key binding -;;; --- ------- -;;; -;;; C-g abort-recursive-edit -;;; TAB minibuffer-complete -;;; C-j minibuffer-complete-and-exit -;;; RET minibuffer-complete-and-exit -;;; ESC Prefix Command -;;; SPC minibuffer-complete-word -;;; ? minibuffer-completion-help -;;; file-cache-minibuffer-complete -;;; previous-history-element -;;; next-history-element -;;; next-line-or-history-element -;;; next-history-element -;;; switch-to-completions -;;; previous-line-or-history-element -;;; -;;; M-v switch-to-completions -;;; -;;; M-< minibuffer-beginning-of-buffer -;;; M-n next-history-element -;;; M-p previous-history-element -;;; M-r previous-matching-history-element -;;; M-s next-matching-history-element -;;; -;;; ")) - (should (string= - (substitute-command-keys - "\\\\[abort-recursive-edit]") - "C-g")) - ;; Allow any style of quotes, since the terminal might not support - ;; UTF-8. - (should (string-match - "\nUses keymap [`‘']foobar-map['’], which is not currently defined.\n" - (substitute-command-keys "\\{foobar-map}"))) - ;; Quotes. - (should (let ((text-quoting-style 'grave)) - (string= (substitute-command-keys "quotes `like this'") - "quotes `like this'"))) - (should (let ((text-quoting-style 'grave)) - (string= (substitute-command-keys "quotes ‘like this’") - "quotes ‘like this’"))) - (should (let ((text-quoting-style 'straight)) - (string= (substitute-command-keys "quotes `like this'") - "quotes 'like this'"))) - ;; Bugs. - (should (string= (substitute-command-keys "\\[foobar") "\\[foobar")) - (should (string= (substitute-command-keys "\\=") "\\=")) - ) - -(provide 'doc-tests) -;;; doc-tests.el ends here -- cgit v1.2.3 From afd31f9e62e551a3f286d1d581a56ef1de33ee94 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 17 Oct 2020 20:55:04 +0200 Subject: Translate describe_map_tree to Lisp This is the second step in converting substitute-command-keys to Lisp. * lisp/help.el (describe-map-tree): New Lisp version of describe_map_tree. (substitute-command-keys): Update to use above function. * src/keymap.c (Fdescribe_map): New defun to expose describe_map to Lisp. * src/keymap.c (syms_of_keymap): New variable 'help--keymaps-seen'; a temporary kludge planned for removal. New defsubr for Fdescribe_map. --- lisp/help.el | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- src/keymap.c | 30 ++++++++++++++++++-- 2 files changed, 116 insertions(+), 4 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index 8d0d9c42704..2996581f943 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1013,7 +1013,8 @@ Otherwise, return a new string (without any text properties)." (insert string) (goto-char (point-min)) (while (< (point) (point-max)) - (let ((orig-point (point)) + (let ((standard-output (current-buffer)) + (orig-point (point)) end-point active-maps close generate-summary) (cond @@ -1101,7 +1102,7 @@ Otherwise, return a new string (without any text properties)." ;; If this one's not active, get nil. (let ((earlier-maps (cdr (memq this-keymap (reverse active-maps))))) (describe-map-tree this-keymap t (nreverse earlier-maps) - nil nil t nil nil)))))))) + nil nil t nil nil t)))))))) ;; 2. Handle quotes. ((and (eq (get-quoting-style) 'curve) (or (and (= (following-char) ?\`) @@ -1117,6 +1118,91 @@ Otherwise, return a new string (without any text properties)." (t (forward-char 1))))) (buffer-string))))) +(defun describe-map-tree (startmap partial shadow prefix title no-menu + transl always-title mention-shadow) + "Insert a description of the key bindings in STARTMAP. +This is followed by the key bindings of all maps reachable +through STARTMAP. + +If PARTIAL is non-nil, omit certain uninteresting commands +\(such as `undefined'). + +If SHADOW is non-nil, it is a list of maps; don't mention keys +which would be shadowed by any of them. + +If PREFIX is non-nil, mention only keys that start with PREFIX. + +If TITLE is non-nil, is a string to insert at the beginning. +TITLE should not end with a colon or a newline; we supply that. + +If NOMENU is non-nil, then omit menu-bar commands. + +If TRANSL is non-nil, the definitions are actually key +translations so print strings and vectors differently. + +If ALWAYS_TITLE is non-nil, print the title even if there are no +maps to look through. + +If MENTION_SHADOW is non-nil, then when something is shadowed by +SHADOW, don't omit it; instead, mention it but say it is +shadowed. + +Any inserted text ends in two newlines (used by +`help-make-xrefs')." + (let* ((amaps (accessible-keymaps startmap prefix)) + (orig-maps (if no-menu + (progn + ;; Delete from MAPS each element that is for + ;; the menu bar. + (let* ((tail amaps) + result) + (while tail + (let ((elem (car tail))) + (when (not (and (>= (length (car elem)) 1) + (eq (elt (car elem) 0) 'menu-bar))) + (setq result (append result (list elem))))) + (setq tail (cdr tail))) + result)) + amaps)) + (maps orig-maps) + (print-title (or maps always-title))) + ;; Print title. + (when print-title + (princ (concat (if title + (concat title + (if prefix + (concat " Starting With " + (key-description prefix))) + ":\n")) + "key binding\n" + "--- -------\n"))) + ;; Describe key bindings. + (setq help--keymaps-seen nil) + (while (consp maps) + (let* ((elt (car maps)) + (elt-prefix (car elt)) + (sub-shadows (lookup-key shadow elt-prefix t))) + (when (if (natnump sub-shadows) + (prog1 t (setq sub-shadows nil)) + ;; Describe this map iff elt_prefix is bound to a + ;; keymap, since otherwise it completely shadows this + ;; map. + (or (keymapp sub-shadows) + (null sub-shadows) + (consp sub-shadows) + (not (keymapp (car sub-shadows))))) + ;; Maps we have already listed in this loop shadow this map. + (let ((tail orig-maps)) + (while (not (equal tail maps)) + (when (equal (car (car tail)) elt-prefix) + (setq sub-shadows (cons (cdr (car tail)) sub-shadows))) + (setq tail (cdr tail)))) + (describe-map (cdr elt) elt-prefix transl partial + sub-shadows no-menu mention-shadow))) + (setq maps (cdr maps))) + (when print-title + (princ "\n")))) + (declare-function x-display-pixel-height "xfns.c" (&optional terminal)) (declare-function x-display-pixel-width "xfns.c" (&optional terminal)) diff --git a/src/keymap.c b/src/keymap.c index 05b0814c475..704b89eeecc 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -2915,7 +2915,7 @@ You type Translation\n\ Any inserted text ends in two newlines (used by `help-make-xrefs'). */ -DEFUN ("describe-map-tree", Fdescribe_map_tree, Sdescribe_map_tree, 1, 8, 0, +DEFUN ("describe-map-tree-old", Fdescribe_map_tree_old, Sdescribe_map_tree_old, 1, 8, 0, doc: /* This is just temporary. */) (Lisp_Object startmap, Lisp_Object partial, Lisp_Object shadow, Lisp_Object prefix, Lisp_Object title, Lisp_Object nomenu, @@ -3131,6 +3131,27 @@ describe_map_compare (const void *aa, const void *bb) return 0; } +DEFUN ("describe-map", Fdescribe_map, Sdescribe_map, 1, 7, 0, + doc: /* This is a temporary definition preparing the transition +of this function to Lisp. */) + (Lisp_Object map, Lisp_Object prefix, + Lisp_Object transl, Lisp_Object partial, Lisp_Object shadow, + Lisp_Object nomenu, Lisp_Object mention_shadow) +{ + ptrdiff_t count = SPECPDL_INDEX (); + + bool b_transl = NILP(transl) ? false : true; + bool b_partial = NILP (partial) ? false : true; + bool b_nomenu = NILP (nomenu) ? false : true; + bool b_mention_shadow = NILP (mention_shadow) ? false : true; + describe_map (map, prefix, + b_transl ? describe_translation : describe_command, + b_partial, shadow, &Vhelp__keymaps_seen, + b_nomenu, b_mention_shadow); + + return unbind_to (count, Qnil); +} + /* Describe the contents of map MAP, assuming that this map itself is reached by the sequence of prefix keys PREFIX (a string or vector). PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above. */ @@ -3685,6 +3706,10 @@ exists, bindings using keys without modifiers (or only with meta) will be preferred. */); Vwhere_is_preferred_modifier = Qnil; where_is_preferred_modifier = 0; + DEFVAR_LISP ("help--keymaps-seen", Vhelp__keymaps_seen, + doc: /* List of seen keymaps. +This is used for internal purposes only. */); + Vhelp__keymaps_seen = Qnil; DEFSYM (Qmenu_bar, "menu-bar"); DEFSYM (Qmode_line, "mode-line"); @@ -3739,7 +3764,8 @@ be preferred. */); defsubr (&Scurrent_active_maps); defsubr (&Saccessible_keymaps); defsubr (&Skey_description); - defsubr (&Sdescribe_map_tree); + defsubr (&Sdescribe_map_tree_old); + defsubr (&Sdescribe_map); defsubr (&Sdescribe_vector); defsubr (&Ssingle_key_description); defsubr (&Stext_char_description); -- cgit v1.2.3 From 647b1c5142d7a029a3124e0177112f16f84d3794 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 19 Aug 2020 12:49:39 +0200 Subject: Translate describe_map to Lisp Third step in converting substitute-command-keys to Lisp. * lisp/help.el (describe-map): New Lisp version of describe_map. (help--describe-map-compare, help--describe-translation) (help--describe-command, help--shadow-lookup): New helper functions for describe-map. (help--keymaps-seen, help--previous-description-column): New variables. * src/keymap.c (Fkeymap__get_keyelt): New defun to expose get_keyelt to Lisp. (Fdescribe_map_tree_old, Fdescribe_map): Remove defuns. (Fdescribe_vector_internal): New defun to expose describe_vector to Lisp in a way usable by describe-map. (syms_of_keymap): New defsubrs for Fkeymap__get_keyelt and Fdescribe_vector_internal. Remove defsubrs for Fdescribe_map_tree_old and Fdescribe_map. Remove 'help--keymaps-seen'. * test/lisp/help-tests.el (help-tests-substitute-command-keys/shadow): Extend test. (help-tests-substitute-command-keys/test-mode) (help-tests-substitute-command-keys/compare-all) (help-tests-describe-map-tree/no-menu-t) (help-tests-describe-map-tree/no-menu-nil) (help-tests-describe-map-tree/mention-shadow-t) (help-tests-describe-map-tree/mention-shadow-nil) (help-tests-describe-map-tree/partial-t) (help-tests-describe-map-tree/partial-nil): New tests. --- lisp/help.el | 164 ++++++++++++++++++++++++++++++++++++++++++++++++ src/keymap.c | 99 ++++++++++++----------------- test/lisp/help-tests.el | 135 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 338 insertions(+), 60 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index 2996581f943..4541d665193 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1118,6 +1118,7 @@ Otherwise, return a new string (without any text properties)." (t (forward-char 1))))) (buffer-string))))) +(defvar help--keymaps-seen nil) (defun describe-map-tree (startmap partial shadow prefix title no-menu transl always-title mention-shadow) "Insert a description of the key bindings in STARTMAP. @@ -1203,6 +1204,169 @@ Any inserted text ends in two newlines (used by (when print-title (princ "\n")))) +(defun help--shadow-lookup (keymap key accept-default remap) + "Like `lookup-key', but with command remapping. +Return nil if the key sequence is too long." + ;; Converted from shadow_lookup in keymap.c. + (let ((value (lookup-key keymap key accept-default))) + (cond ((and (fixnump value) (<= 0 value))) + ((and value remap (symbolp value)) + (or (command-remapping value nil keymap) + value)) + (t value)))) + +(defvar help--previous-description-column 0) +(defun help--describe-command (definition) + ;; Converted from describe_command in keymap.c. + ;; If column 16 is no good, go to col 32; + ;; but don't push beyond that--go to next line instead. + (let* ((column (current-column)) + (description-column (cond ((> column 30) + (insert "\n") + 32) + ((or (> column 14) + (and (> column 10) + (= help--previous-description-column 32))) + 32) + (t 16)))) + (indent-to description-column 1) + (setq help--previous-description-column description-column) + (cond ((symbolp definition) + (insert (symbol-name definition) "\n")) + ((or (stringp definition) (vectorp definition)) + (insert "Keyboard Macro\n")) + ((keymapp definition) + (insert "Prefix Command\n")) + (t (insert "??\n"))))) + +(defun help--describe-translation (definition) + ;; Converted from describe_translation in keymap.c. + (indent-to 16 1) + (cond ((symbolp definition) + (insert (symbol-name definition) "\n")) + ((or (stringp definition) (vectorp definition)) + (insert (key-description definition nil) "\n")) + ((keymapp definition) + (insert "Prefix Command\n")) + (t (insert "??\n")))) + +(defun help--describe-map-compare (a b) + (let ((a (car a)) + (b (car b))) + (cond ((and (fixnump a) (fixnump b)) (< a b)) + ;; ((and (not (fixnump a)) (fixnump b)) nil) ; not needed + ((and (fixnump a) (not (fixnump b))) t) + ((and (symbolp a) (symbolp b)) + ;; Sort the keystroke names in the "natural" way, with (for + ;; instance) "" coming between "" and "". + (string-version-lessp (symbol-name a) (symbol-name b))) + (t nil)))) + +(defun describe-map (map prefix transl partial shadow nomenu mention-shadow) + "Describe the contents of keymap MAP. +Assume that this keymap itself is reached by the sequence of +prefix keys PREFIX (a string or vector). + +TRANSL, PARTIAL, SHADOW, NOMENU, MENTION-SHADOW are as in +`describe-map-tree'." + ;; Converted from describe_map in keymap.c. + (let* ((suppress (and partial 'suppress-keymap)) + (map (keymap-canonicalize map)) + (tail map) + (first t) + done vect) + (while (and (consp tail) (not done)) + (cond ((or (vectorp (car tail)) (char-table-p (car tail))) + (describe-vector-internal (car tail) prefix transl partial + shadow map t mention-shadow)) + ((consp (car tail)) + (let ((event (caar tail)) + definition this-shadowed) + ;; Ignore bindings whose "prefix" are not really + ;; valid events. (We get these in the frames and + ;; buffers menu.) + (and (or (symbolp event) (fixnump event)) + (not (and nomenu (eq event 'menu-bar))) + ;; Don't show undefined commands or suppressed + ;; commands. + (setq definition (keymap--get-keyelt (cdr (car tail)) nil)) + (or (not (symbolp definition)) + (null (get definition suppress))) + ;; Don't show a command that isn't really + ;; visible because a local definition of the + ;; same key shadows it. + (or (not shadow) + (let ((tem (help--shadow-lookup shadow (vector event) t nil))) + (cond ((null tem) t) + ;; If both bindings are keymaps, + ;; this key is a prefix key, so + ;; don't say it is shadowed. + ((and (keymapp definition) (keymapp tem)) t) + ;; Avoid generating duplicate + ;; entries if the shadowed binding + ;; has the same definition. + ((and mention-shadow (not (eq tem definition))) + (setq this-shadowed t)) + (t nil)))) + (push (list event definition this-shadowed) vect)))) + ((eq (car tail) 'keymap) + ;; The same keymap might be in the structure twice, if + ;; we're using an inherited keymap. So skip anything + ;; we've already encountered. + (let ((tem (assq tail help--keymaps-seen))) + (if (and (consp tem) + (equal (car tem) prefix)) + (setq done t) + (push (cons tail prefix) help--keymaps-seen))))) + (setq tail (cdr tail))) + ;; If we found some sparse map events, sort them. + (let ((vect (sort vect 'help--describe-map-compare))) + ;; Now output them in sorted order. + (while vect + (let* ((elem (car vect)) + (start (car elem)) + (definition (cadr elem)) + (shadowed (caddr elem)) + (end start)) + (when first + (setq help--previous-description-column 0) + (insert "\n") + (setq first nil)) + ;; Find consecutive chars that are identically defined. + (when (fixnump start) + (while (and (cdr vect) + (let ((this-event (caar vect)) + (this-definition (cadar vect)) + (this-shadowed (caddar vect)) + (next-event (caar (cdr vect))) + (next-definition (cadar (cdr vect))) + (next-shadowed (caddar (cdr vect)))) + (and (eq next-event (1+ this-event)) + (equal next-definition this-definition) + (eq this-shadowed next-shadowed)))) + (setq vect (cdr vect)) + (setq end (caar vect)))) + ;; Now START .. END is the range to describe next. + ;; Insert the string to describe the event START. + (insert (key-description (vector start) prefix)) + (when (not (eq start end)) + (insert " .. " (key-description (vector end) prefix))) + ;; Print a description of the definition of this character. + ;; Called function will take care of spacing out far enough + ;; for alignment purposes. + (if transl + (help--describe-translation definition) + (help--describe-command definition)) + ;; Print a description of the definition of this character. + ;; elt_describer will take care of spacing out far enough for + ;; alignment purposes. + (when shadowed + (goto-char (max (1- (point)) (point-min))) + (insert "\n (this binding is currently shadowed)") + (goto-char (min (1+ (point)) (point-max))))) + ;; Next item in list. + (setq vect (cdr vect)))))) + (declare-function x-display-pixel-height "xfns.c" (&optional terminal)) (declare-function x-display-pixel-width "xfns.c" (&optional terminal)) diff --git a/src/keymap.c b/src/keymap.c index 704b89eeecc..2076e29b6fb 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -679,6 +679,23 @@ usage: (map-keymap FUNCTION KEYMAP) */) return Qnil; } +DEFUN ("keymap--get-keyelt", Fkeymap__get_keyelt, Skeymap__get_keyelt, 2, 2, 0, + doc: /* Given OBJECT which was found in a slot in a keymap, +trace indirect definitions to get the actual definition of that slot. +An indirect definition is a list of the form +(KEYMAP . INDEX), where KEYMAP is a keymap or a symbol defined as one +and INDEX is the object to look up in KEYMAP to yield the definition. + +Also if OBJECT has a menu string as the first element, +remove that. Also remove a menu help string as second element. + +If AUTOLOAD, load autoloadable keymaps +that are referred to with indirection. */) + (Lisp_Object object, Lisp_Object autoload) +{ + return get_keyelt (object, NILP (autoload) ? false : true); +} + /* Given OBJECT which was found in a slot in a keymap, trace indirect definitions to get the actual definition of that slot. An indirect definition is a list of the form @@ -2915,37 +2932,6 @@ You type Translation\n\ Any inserted text ends in two newlines (used by `help-make-xrefs'). */ -DEFUN ("describe-map-tree-old", Fdescribe_map_tree_old, Sdescribe_map_tree_old, 1, 8, 0, - doc: /* This is just temporary. */) - (Lisp_Object startmap, Lisp_Object partial, Lisp_Object shadow, - Lisp_Object prefix, Lisp_Object title, Lisp_Object nomenu, - Lisp_Object transl, Lisp_Object always_title) -{ - ptrdiff_t count = SPECPDL_INDEX (); - char *title_string; - - if ( !NILP (title) ) - { - CHECK_STRING (title); - title_string = SSDATA(title); - } - else - { - title_string = NULL; - } - - bool b_partial = NILP (partial) ? false : true; - bool b_nomenu = NILP (nomenu) ? false : true; - bool b_transl = NILP (transl) ? false : true; - bool b_always_title = NILP (always_title) ? false : true; - - /* specbind (Qstandard_output, Fcurrent_buffer ()); */ - describe_map_tree (startmap, b_partial, shadow, prefix, title_string, - b_nomenu, b_transl, b_always_title, true); - - return unbind_to (count, Qnil); -} - void describe_map_tree (Lisp_Object startmap, bool partial, Lisp_Object shadow, Lisp_Object prefix, const char *title, bool nomenu, @@ -3131,27 +3117,6 @@ describe_map_compare (const void *aa, const void *bb) return 0; } -DEFUN ("describe-map", Fdescribe_map, Sdescribe_map, 1, 7, 0, - doc: /* This is a temporary definition preparing the transition -of this function to Lisp. */) - (Lisp_Object map, Lisp_Object prefix, - Lisp_Object transl, Lisp_Object partial, Lisp_Object shadow, - Lisp_Object nomenu, Lisp_Object mention_shadow) -{ - ptrdiff_t count = SPECPDL_INDEX (); - - bool b_transl = NILP(transl) ? false : true; - bool b_partial = NILP (partial) ? false : true; - bool b_nomenu = NILP (nomenu) ? false : true; - bool b_mention_shadow = NILP (mention_shadow) ? false : true; - describe_map (map, prefix, - b_transl ? describe_translation : describe_command, - b_partial, shadow, &Vhelp__keymaps_seen, - b_nomenu, b_mention_shadow); - - return unbind_to (count, Qnil); -} - /* Describe the contents of map MAP, assuming that this map itself is reached by the sequence of prefix keys PREFIX (a string or vector). PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above. */ @@ -3363,6 +3328,28 @@ DESCRIBER is the output function used; nil means use `princ'. */) return unbind_to (count, Qnil); } +DEFUN ("describe-vector-internal", Fdescribe_vector_internal, Sdescribe_vector_internal, 8, 8, 0, + doc: /* Insert a description of contents of VECTOR. */) + (Lisp_Object vector, Lisp_Object prefix, Lisp_Object transl, + Lisp_Object partial, Lisp_Object shadow, Lisp_Object entire_map, + Lisp_Object keymap_p, Lisp_Object mention_shadow) +{ + ptrdiff_t count = SPECPDL_INDEX (); + specbind (Qstandard_output, Fcurrent_buffer ()); + CHECK_VECTOR_OR_CHAR_TABLE (vector); + + bool b_transl = NILP (transl) ? false : true; + bool b_partial = NILP (partial) ? false : true; + bool b_keymap_p = NILP (keymap_p) ? false : true; + bool b_mention_shadow = NILP (mention_shadow) ? false : true; + + describe_vector (vector, prefix, Qnil, + b_transl ? describe_translation : describe_command, + b_partial, shadow, entire_map, + b_keymap_p, b_mention_shadow); + return unbind_to (count, Qnil); +} + /* Insert in the current buffer a description of the contents of VECTOR. We call ELT_DESCRIBER to insert the description of one value found in VECTOR. @@ -3706,10 +3693,6 @@ exists, bindings using keys without modifiers (or only with meta) will be preferred. */); Vwhere_is_preferred_modifier = Qnil; where_is_preferred_modifier = 0; - DEFVAR_LISP ("help--keymaps-seen", Vhelp__keymaps_seen, - doc: /* List of seen keymaps. -This is used for internal purposes only. */); - Vhelp__keymaps_seen = Qnil; DEFSYM (Qmenu_bar, "menu-bar"); DEFSYM (Qmode_line, "mode-line"); @@ -3764,9 +3747,9 @@ This is used for internal purposes only. */); defsubr (&Scurrent_active_maps); defsubr (&Saccessible_keymaps); defsubr (&Skey_description); - defsubr (&Sdescribe_map_tree_old); - defsubr (&Sdescribe_map); + defsubr (&Skeymap__get_keyelt); defsubr (&Sdescribe_vector); + defsubr (&Sdescribe_vector_internal); defsubr (&Ssingle_key_description); defsubr (&Stext_char_description); defsubr (&Swhere_is_internal); diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el index 048b6c325e4..aff5d1853a6 100644 --- a/test/lisp/help-tests.el +++ b/test/lisp/help-tests.el @@ -194,6 +194,17 @@ M-s next-matching-history-element (defvar help-tests-major-mode-map (let ((map (make-keymap))) (define-key map "x" 'foo-original) + (define-key map "1" 'foo-range) + (define-key map "2" 'foo-range) + (define-key map "3" 'foo-range) + (define-key map "4" 'foo-range) + (define-key map (kbd "C-e") 'foo-something) + (define-key map '[F1] 'foo-function-key1) + (define-key map "(" 'short-range) + (define-key map ")" 'short-range) + (define-key map "a" 'foo-other-range) + (define-key map "b" 'foo-other-range) + (define-key map "c" 'foo-other-range) map)) (define-derived-mode help-tests-major-mode nil @@ -202,12 +213,13 @@ M-s next-matching-history-element (defvar help-tests-minor-mode-map (let ((map (make-keymap))) (define-key map "x" 'foo-shadow) + (define-key map (kbd "C-e") 'foo-shadow) map)) (define-minor-mode help-tests-minor-mode "Minor mode for testing shadowing.") -(ert-deftest help-tests-substitute-command-keys/shadow () +(ert-deftest help-tests-substitute-command-keys/test-mode () (with-substitute-command-keys-test (with-temp-buffer (help-tests-major-mode) @@ -216,17 +228,35 @@ M-s next-matching-history-element key binding --- ------- +( .. ) short-range +1 .. 4 foo-range +a .. c foo-other-range + +C-e foo-something x foo-original + foo-function-key1 + +")))) -") +(ert-deftest help-tests-substitute-command-keys/shadow () + (with-substitute-command-keys-test + (with-temp-buffer + (help-tests-major-mode) (help-tests-minor-mode) (test "\\{help-tests-major-mode-map}" "\ key binding --- ------- +( .. ) short-range +1 .. 4 foo-range +a .. c foo-other-range + +C-e foo-something + (this binding is currently shadowed) x foo-original (this binding is currently shadowed) + foo-function-key1 ")))) @@ -247,6 +277,98 @@ key binding "))))) +(ert-deftest help-tests-describe-map-tree/no-menu-t () + (with-temp-buffer + (let ((standard-output (current-buffer)) + (map '(keymap . ((1 . foo) + (menu-bar keymap + (foo menu-item "Foo" foo + :enable mark-active + :help "Help text")))))) + (describe-map-tree map nil nil nil nil t nil nil nil) + (should (equal (buffer-string) "key binding +--- ------- + +C-a foo + +"))))) + +(ert-deftest help-tests-describe-map-tree/no-menu-nil () + (with-temp-buffer + (let ((standard-output (current-buffer)) + (map '(keymap . ((1 . foo) + (menu-bar keymap + (foo menu-item "Foo" foo + :enable mark-active + :help "Help text")))))) + (describe-map-tree map nil nil nil nil nil nil nil nil) + (should (equal (buffer-string) "key binding +--- ------- + +C-a foo + Prefix Command + + foo + +"))))) + +(ert-deftest help-tests-describe-map-tree/mention-shadow-t () + (with-temp-buffer + (let ((standard-output (current-buffer)) + (map '(keymap . ((1 . foo) + (2 . bar)))) + (shadow-maps '((keymap . ((1 . baz)))))) + (describe-map-tree map t shadow-maps nil nil t nil nil t) + (should (equal (buffer-string) "key binding +--- ------- + +C-a foo + (this binding is currently shadowed) +C-b bar + +"))))) + +(ert-deftest help-tests-describe-map-tree/mention-shadow-nil () + (with-temp-buffer + (let ((standard-output (current-buffer)) + (map '(keymap . ((1 . foo) + (2 . bar)))) + (shadow-maps '((keymap . ((1 . baz)))))) + (describe-map-tree map t shadow-maps nil nil t nil nil nil) + (should (equal (buffer-string) "key binding +--- ------- + +C-b bar + +"))))) + +(ert-deftest help-tests-describe-map-tree/partial-t () + (with-temp-buffer + (let ((standard-output (current-buffer)) + (map '(keymap . ((1 . foo) + (2 . undefined))))) + (describe-map-tree map t nil nil nil nil nil nil nil) + (should (equal (buffer-string) "key binding +--- ------- + +C-a foo + +"))))) + +(ert-deftest help-tests-describe-map-tree/partial-nil () + (with-temp-buffer + (let ((standard-output (current-buffer)) + (map '(keymap . ((1 . foo) + (2 . undefined))))) + (describe-map-tree map nil nil nil nil nil nil nil nil) + (should (equal (buffer-string) "key binding +--- ------- + +C-a foo +C-b undefined + +"))))) + ;; TODO: This is a temporary test that should be removed together with ;; substitute-command-keys-old. (ert-deftest help-tests-substitute-command-keys/compare () @@ -261,6 +383,15 @@ key binding (outline-minor-mode) (test-re "\\{c-mode-map}" ".*")))) +(ert-deftest help-tests-substitute-command-keys/compare-all () + (let (keymaps) + (mapatoms (lambda (var) + (when (keymapp var) + (push var keymaps)))) + (dolist (keymap keymaps) + (with-substitute-command-keys-test + (test-re (concat "\\{" (symbol-name keymap) "}") ".*"))))) + (provide 'help-tests) ;;; help-tests.el ends here -- cgit v1.2.3 From 5ad2bb0fa95d9c9ae2387c963b453f695577450a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 23 Aug 2020 17:20:09 +0200 Subject: Translate describe_vector to Lisp * lisp/help.el (help--describe-vector): New Lisp implementation of describe_vector. * src/keymap.c (Fdescribe_vector_internal): Remove defun. (syms_of_keymap): Remove defsubr for Fdescribe_vector_internal. --- lisp/help.el | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- src/keymap.c | 23 ------------------- 2 files changed, 73 insertions(+), 25 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index 4541d665193..06d43857c24 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1277,8 +1277,8 @@ TRANSL, PARTIAL, SHADOW, NOMENU, MENTION-SHADOW are as in done vect) (while (and (consp tail) (not done)) (cond ((or (vectorp (car tail)) (char-table-p (car tail))) - (describe-vector-internal (car tail) prefix transl partial - shadow map t mention-shadow)) + (help--describe-vector (car tail) prefix transl partial + shadow map mention-shadow)) ((consp (car tail)) (let ((event (caar tail)) definition this-shadowed) @@ -1367,6 +1367,77 @@ TRANSL, PARTIAL, SHADOW, NOMENU, MENTION-SHADOW are as in ;; Next item in list. (setq vect (cdr vect)))))) +(defun help--describe-vector + (vector prefix transl partial shadow entire-map mention-shadow) + "Insert in the current buffer a description of the contents of VECTOR. + +PREFIX a prefix key which leads to the keymap that this vector is +in. + +If PARTIAL, it means do not mention suppressed commands +(that assumes the vector is in a keymap). + +SHADOW is a list of keymaps that shadow this map. If it is +non-nil, look up the key in those maps and don't mention it if it +is defined by any of them. + +ENTIRE-MAP is the vector in which this vector appears. +If the definition in effect in the whole map does not match +the one in this vector, we ignore this one." + ;; Converted from describe_vector in keymap.c. + (let* ((first t) + (idx 0)) + (while (< idx (length vector)) + (let* ((val (aref vector idx)) + (definition (keymap--get-keyelt val nil)) + (start-idx idx) + this-shadowed + found-range) + (when (and definition + ;; Don't mention suppressed commands. + (not (and partial + (symbolp definition) + (get definition 'suppress-keymap))) + ;; If this binding is shadowed by some other map, + ;; ignore it. + (not (and shadow + (help--shadow-lookup shadow (vector start-idx) t nil) + (if mention-shadow + (prog1 nil (setq this-shadowed t)) + t))) + ;; Ignore this definition if it is shadowed by an earlier + ;; one in the same keymap. + (not (and entire-map + (not (eq (lookup-key entire-map (vector start-idx) t) + definition))))) + (when first + (insert "\n") + (setq first nil)) + (when (and prefix (> (length prefix) 0)) + (insert (format "%s" prefix))) + (insert (key-description (vector start-idx) prefix)) + ;; Find all consecutive characters or rows that have the + ;; same definition. + (while (equal (keymap--get-keyelt (aref vector (1+ idx)) nil) + definition) + (setq found-range t) + (setq idx (1+ idx))) + ;; If we have a range of more than one character, + ;; print where the range reaches to. + (when found-range + (insert " .. ") + (when (and prefix (> (length prefix) 0)) + (insert (format "%s" prefix))) + (insert (key-description (vector idx) prefix))) + (if transl + (help--describe-translation definition) + (help--describe-command definition)) + (when this-shadowed + (goto-char (1- (point))) + (insert " (binding currently shadowed)") + (goto-char (1+ (point)))))) + (setq idx (1+ idx))))) + (declare-function x-display-pixel-height "xfns.c" (&optional terminal)) (declare-function x-display-pixel-width "xfns.c" (&optional terminal)) diff --git a/src/keymap.c b/src/keymap.c index 2076e29b6fb..9d12c3a47d5 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -3328,28 +3328,6 @@ DESCRIBER is the output function used; nil means use `princ'. */) return unbind_to (count, Qnil); } -DEFUN ("describe-vector-internal", Fdescribe_vector_internal, Sdescribe_vector_internal, 8, 8, 0, - doc: /* Insert a description of contents of VECTOR. */) - (Lisp_Object vector, Lisp_Object prefix, Lisp_Object transl, - Lisp_Object partial, Lisp_Object shadow, Lisp_Object entire_map, - Lisp_Object keymap_p, Lisp_Object mention_shadow) -{ - ptrdiff_t count = SPECPDL_INDEX (); - specbind (Qstandard_output, Fcurrent_buffer ()); - CHECK_VECTOR_OR_CHAR_TABLE (vector); - - bool b_transl = NILP (transl) ? false : true; - bool b_partial = NILP (partial) ? false : true; - bool b_keymap_p = NILP (keymap_p) ? false : true; - bool b_mention_shadow = NILP (mention_shadow) ? false : true; - - describe_vector (vector, prefix, Qnil, - b_transl ? describe_translation : describe_command, - b_partial, shadow, entire_map, - b_keymap_p, b_mention_shadow); - return unbind_to (count, Qnil); -} - /* Insert in the current buffer a description of the contents of VECTOR. We call ELT_DESCRIBER to insert the description of one value found in VECTOR. @@ -3749,7 +3727,6 @@ be preferred. */); defsubr (&Skey_description); defsubr (&Skeymap__get_keyelt); defsubr (&Sdescribe_vector); - defsubr (&Sdescribe_vector_internal); defsubr (&Ssingle_key_description); defsubr (&Stext_char_description); defsubr (&Swhere_is_internal); -- cgit v1.2.3 From afde53cd81c7817c5b3187e60e7a49790e0af832 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 18 Oct 2020 00:02:55 +0200 Subject: Improve substitute-command-keys performance The previous conversion of describe_vector from C to Lisp for the keymap and char table case lead to an unacceptable performance hit. Moving back to the C version, as we do here, makes this function around 50 times faster. The Lisp version of `substitute-command-keys' was benchmarked using the form `(documentation 'dired-mode)', which now takes less than 8 ms on my machine. This is around 16 times slower than the previous C version. Thanks to Stefan Monnier for helpful pointers on benchmarking. * src/keymap.c (Fhelp__describe_vector): New defun to expose describe_vector to Lisp for keymaps and char tables. (syms_of_keymap): New defsubr for Fhelp__describe_vector. * lisp/help.el (describe-map): Use above defun instead of Lisp version. (help--describe-vector): Remove defun; keep it commented out for now. --- lisp/help.el | 142 ++++++++++++++++++++++++++++++----------------------------- src/keymap.c | 35 +++++++++++++++ 2 files changed, 107 insertions(+), 70 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index 06d43857c24..e8dfbdef74a 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1367,76 +1367,78 @@ TRANSL, PARTIAL, SHADOW, NOMENU, MENTION-SHADOW are as in ;; Next item in list. (setq vect (cdr vect)))))) -(defun help--describe-vector - (vector prefix transl partial shadow entire-map mention-shadow) - "Insert in the current buffer a description of the contents of VECTOR. - -PREFIX a prefix key which leads to the keymap that this vector is -in. - -If PARTIAL, it means do not mention suppressed commands -(that assumes the vector is in a keymap). - -SHADOW is a list of keymaps that shadow this map. If it is -non-nil, look up the key in those maps and don't mention it if it -is defined by any of them. - -ENTIRE-MAP is the vector in which this vector appears. -If the definition in effect in the whole map does not match -the one in this vector, we ignore this one." - ;; Converted from describe_vector in keymap.c. - (let* ((first t) - (idx 0)) - (while (< idx (length vector)) - (let* ((val (aref vector idx)) - (definition (keymap--get-keyelt val nil)) - (start-idx idx) - this-shadowed - found-range) - (when (and definition - ;; Don't mention suppressed commands. - (not (and partial - (symbolp definition) - (get definition 'suppress-keymap))) - ;; If this binding is shadowed by some other map, - ;; ignore it. - (not (and shadow - (help--shadow-lookup shadow (vector start-idx) t nil) - (if mention-shadow - (prog1 nil (setq this-shadowed t)) - t))) - ;; Ignore this definition if it is shadowed by an earlier - ;; one in the same keymap. - (not (and entire-map - (not (eq (lookup-key entire-map (vector start-idx) t) - definition))))) - (when first - (insert "\n") - (setq first nil)) - (when (and prefix (> (length prefix) 0)) - (insert (format "%s" prefix))) - (insert (key-description (vector start-idx) prefix)) - ;; Find all consecutive characters or rows that have the - ;; same definition. - (while (equal (keymap--get-keyelt (aref vector (1+ idx)) nil) - definition) - (setq found-range t) - (setq idx (1+ idx))) - ;; If we have a range of more than one character, - ;; print where the range reaches to. - (when found-range - (insert " .. ") - (when (and prefix (> (length prefix) 0)) - (insert (format "%s" prefix))) - (insert (key-description (vector idx) prefix))) - (if transl - (help--describe-translation definition) - (help--describe-command definition)) - (when this-shadowed - (goto-char (1- (point))) - (insert " (binding currently shadowed)") - (goto-char (1+ (point)))))) - (setq idx (1+ idx))))) +;;;; This Lisp version is 100 times slower than its C equivalent: +;; +;; (defun help--describe-vector +;; (vector prefix transl partial shadow entire-map mention-shadow) +;; "Insert in the current buffer a description of the contents of VECTOR. +;; +;; PREFIX a prefix key which leads to the keymap that this vector is +;; in. +;; +;; If PARTIAL, it means do not mention suppressed commands +;; (that assumes the vector is in a keymap). +;; +;; SHADOW is a list of keymaps that shadow this map. If it is +;; non-nil, look up the key in those maps and don't mention it if it +;; is defined by any of them. +;; +;; ENTIRE-MAP is the vector in which this vector appears. +;; If the definition in effect in the whole map does not match +;; the one in this vector, we ignore this one." +;; ;; Converted from describe_vector in keymap.c. +;; (let* ((first t) +;; (idx 0)) +;; (while (< idx (length vector)) +;; (let* ((val (aref vector idx)) +;; (definition (keymap--get-keyelt val nil)) +;; (start-idx idx) +;; this-shadowed +;; found-range) +;; (when (and definition +;; ;; Don't mention suppressed commands. +;; (not (and partial +;; (symbolp definition) +;; (get definition 'suppress-keymap))) +;; ;; If this binding is shadowed by some other map, +;; ;; ignore it. +;; (not (and shadow +;; (help--shadow-lookup shadow (vector start-idx) t nil) +;; (if mention-shadow +;; (prog1 nil (setq this-shadowed t)) +;; t))) +;; ;; Ignore this definition if it is shadowed by an earlier +;; ;; one in the same keymap. +;; (not (and entire-map +;; (not (eq (lookup-key entire-map (vector start-idx) t) +;; definition))))) +;; (when first +;; (insert "\n") +;; (setq first nil)) +;; (when (and prefix (> (length prefix) 0)) +;; (insert (format "%s" prefix))) +;; (insert (key-description (vector start-idx) prefix)) +;; ;; Find all consecutive characters or rows that have the +;; ;; same definition. +;; (while (equal (keymap--get-keyelt (aref vector (1+ idx)) nil) +;; definition) +;; (setq found-range t) +;; (setq idx (1+ idx))) +;; ;; If we have a range of more than one character, +;; ;; print where the range reaches to. +;; (when found-range +;; (insert " .. ") +;; (when (and prefix (> (length prefix) 0)) +;; (insert (format "%s" prefix))) +;; (insert (key-description (vector idx) prefix))) +;; (if transl +;; (help--describe-translation definition) +;; (help--describe-command definition)) +;; (when this-shadowed +;; (goto-char (1- (point))) +;; (insert " (binding currently shadowed)") +;; (goto-char (1+ (point)))))) +;; (setq idx (1+ idx))))) (declare-function x-display-pixel-height "xfns.c" (&optional terminal)) diff --git a/src/keymap.c b/src/keymap.c index 9d12c3a47d5..5ae8da6a05a 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -3328,6 +3328,40 @@ DESCRIBER is the output function used; nil means use `princ'. */) return unbind_to (count, Qnil); } +DEFUN ("help--describe-vector", Fhelp__describe_vector, Shelp__describe_vector, 7, 7, 0, + doc: /* Insert in the current buffer a description of the contents of VECTOR. + +PREFIX is a string describing the key which leads to the keymap that +this vector is in. + +If PARTIAL, it means do not mention suppressed commands. + +SHADOW is a list of keymaps that shadow this map. +If it is non-nil, look up the key in those maps and don't mention it +if it is defined by any of them. + +ENTIRE-MAP is the keymap in which this vector appears. +If the definition in effect in the whole map does not match +the one in this keymap, we ignore this one. */) + (Lisp_Object vector, Lisp_Object prefix, Lisp_Object transl, + Lisp_Object partial, Lisp_Object shadow, Lisp_Object entire_map, + Lisp_Object mention_shadow) +{ + ptrdiff_t count = SPECPDL_INDEX (); + specbind (Qstandard_output, Fcurrent_buffer ()); + CHECK_VECTOR_OR_CHAR_TABLE (vector); + + bool b_transl = NILP (transl) ? false : true; + bool b_partial = NILP (partial) ? false : true; + bool b_mention_shadow = NILP (mention_shadow) ? false : true; + + describe_vector (vector, prefix, Qnil, + b_transl ? describe_translation : describe_command, + b_partial, shadow, entire_map, + true, b_mention_shadow); + return unbind_to (count, Qnil); +} + /* Insert in the current buffer a description of the contents of VECTOR. We call ELT_DESCRIBER to insert the description of one value found in VECTOR. @@ -3726,6 +3760,7 @@ be preferred. */); defsubr (&Saccessible_keymaps); defsubr (&Skey_description); defsubr (&Skeymap__get_keyelt); + defsubr (&Shelp__describe_vector); defsubr (&Sdescribe_vector); defsubr (&Ssingle_key_description); defsubr (&Stext_char_description); -- cgit v1.2.3 From 8a1441310aa151e739cfed3bd2eff3358edc8001 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 18 Oct 2020 15:32:22 +0200 Subject: Prefer Lisp version of describe-map-tree This is a prerequisite to remove the old C functions, and gives a measured 3 ms slowdown on my machine, from 0.27s to 0.30s per call to describe-buffer-bindings (average over 50 calls). * src/keymap.c (Fdescribe_buffer_bindings): Call Lisp function describe-map-tree instead of C function describe_map_tree. --- src/keymap.c | 89 ++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 63 insertions(+), 26 deletions(-) diff --git a/src/keymap.c b/src/keymap.c index 5ae8da6a05a..1eded130b5d 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -2750,7 +2750,7 @@ The optional argument MENUS, if non-nil, says to mention menu bindings. (Lisp_Object buffer, Lisp_Object prefix, Lisp_Object menus) { Lisp_Object outbuf, shadow; - bool nomenu = NILP (menus); + Lisp_Object nomenu = NILP (menus) ? Qt : Qnil; Lisp_Object start1; const char *alternate_heading @@ -2799,9 +2799,13 @@ You type Translation\n\ } if (!NILP (Vkey_translation_map)) - describe_map_tree (Vkey_translation_map, 0, Qnil, prefix, - "Key translations", nomenu, 1, 0, 0); - + { + Lisp_Object msg = build_unibyte_string ("Key translations"); + CALLN (Ffuncall, + Qdescribe_map_tree, + Vkey_translation_map, Qnil, Qnil, prefix, + msg, nomenu, Qt, Qnil, Qnil); + } /* Print the (major mode) local map. */ start1 = Qnil; @@ -2810,8 +2814,11 @@ You type Translation\n\ if (!NILP (start1)) { - describe_map_tree (start1, 1, shadow, prefix, - "\f\nOverriding Bindings", nomenu, 0, 0, 0); + Lisp_Object msg = build_unibyte_string ("\f\nOverriding Bindings"); + CALLN (Ffuncall, + Qdescribe_map_tree, + start1, Qt, shadow, prefix, + msg, nomenu, Qnil, Qnil, Qnil); shadow = Fcons (start1, shadow); start1 = Qnil; } @@ -2820,8 +2827,11 @@ You type Translation\n\ if (!NILP (start1)) { - describe_map_tree (start1, 1, shadow, prefix, - "\f\nOverriding Bindings", nomenu, 0, 0, 0); + Lisp_Object msg = build_unibyte_string ("\f\nOverriding Bindings"); + CALLN (Ffuncall, + Qdescribe_map_tree, + start1, Qt, shadow, prefix, + msg, nomenu, Qnil, Qnil, Qnil); shadow = Fcons (start1, shadow); } else @@ -2841,9 +2851,11 @@ You type Translation\n\ XBUFFER (buffer), Qkeymap); if (!NILP (start1)) { - describe_map_tree (start1, 1, shadow, prefix, - "\f\n`keymap' Property Bindings", nomenu, - 0, 0, 0); + Lisp_Object msg = build_unibyte_string ("\f\n`keymap' Property Bindings"); + CALLN (Ffuncall, + Qdescribe_map_tree, + start1, Qt, shadow, prefix, + msg, nomenu, Qnil, Qnil, Qnil); shadow = Fcons (start1, shadow); } @@ -2852,7 +2864,7 @@ You type Translation\n\ { /* The title for a minor mode keymap is constructed at run time. - We let describe_map_tree do the actual insertion + We let describe-map-tree do the actual insertion because it takes care of other features when doing so. */ char *title, *p; @@ -2872,8 +2884,11 @@ You type Translation\n\ p += strlen (" Minor Mode Bindings"); *p = 0; - describe_map_tree (maps[i], 1, shadow, prefix, - title, nomenu, 0, 0, 0); + Lisp_Object msg = build_unibyte_string (title); + CALLN (Ffuncall, + Qdescribe_map_tree, + maps[i], Qt, shadow, prefix, + msg, nomenu, Qnil, Qnil, Qnil); shadow = Fcons (maps[i], shadow); SAFE_FREE (); } @@ -2883,30 +2898,51 @@ You type Translation\n\ if (!NILP (start1)) { if (EQ (start1, BVAR (XBUFFER (buffer), keymap))) - describe_map_tree (start1, 1, shadow, prefix, - "\f\nMajor Mode Bindings", nomenu, 0, 0, 0); + { + Lisp_Object msg = build_unibyte_string ("\f\nMajor Mode Bindings"); + CALLN (Ffuncall, + Qdescribe_map_tree, + start1, Qt, shadow, prefix, + msg, nomenu, Qnil, Qnil, Qnil); + } else - describe_map_tree (start1, 1, shadow, prefix, - "\f\n`local-map' Property Bindings", - nomenu, 0, 0, 0); + { + Lisp_Object msg = build_unibyte_string ("\f\n`local-map' Property Bindings"); + CALLN (Ffuncall, + Qdescribe_map_tree, + start1, Qt, shadow, prefix, + msg, nomenu, Qnil, Qnil, Qnil); + } shadow = Fcons (start1, shadow); } } - describe_map_tree (current_global_map, 1, shadow, prefix, - "\f\nGlobal Bindings", nomenu, 0, 1, 0); + Lisp_Object msg = build_unibyte_string ("\f\nGlobal Bindings"); + CALLN (Ffuncall, + Qdescribe_map_tree, + current_global_map, Qt, shadow, prefix, + msg, nomenu, Qnil, Qt, Qnil); /* Print the function-key-map translations under this prefix. */ if (!NILP (KVAR (current_kboard, Vlocal_function_key_map))) - describe_map_tree (KVAR (current_kboard, Vlocal_function_key_map), 0, Qnil, prefix, - "\f\nFunction key map translations", nomenu, 1, 0, 0); + { + Lisp_Object msg = build_unibyte_string ("\f\nFunction key map translations"); + CALLN (Ffuncall, + Qdescribe_map_tree, + KVAR (current_kboard, Vlocal_function_key_map), Qnil, Qnil, prefix, + msg, nomenu, Qt, Qt, Qt); + } /* Print the input-decode-map translations under this prefix. */ if (!NILP (KVAR (current_kboard, Vinput_decode_map))) - describe_map_tree (KVAR (current_kboard, Vinput_decode_map), 0, Qnil, prefix, - "\f\nInput decoding map translations", nomenu, 1, 0, 0); - + { + Lisp_Object msg = build_unibyte_string ("\f\nInput decoding map translations"); + CALLN (Ffuncall, + Qdescribe_map_tree, + KVAR (current_kboard, Vinput_decode_map), Qnil, Qnil, prefix, + msg, nomenu, Qt, Qnil, Qnil); + } return Qnil; } @@ -3619,6 +3655,7 @@ void syms_of_keymap (void) { DEFSYM (Qkeymap, "keymap"); + DEFSYM (Qdescribe_map_tree, "describe-map-tree"); staticpro (&apropos_predicate); staticpro (&apropos_accumulate); apropos_predicate = Qnil; -- cgit v1.2.3 From ef5a604f082f772424400f48b64e9c04edbcc766 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 18 Oct 2020 15:19:09 +0200 Subject: Remove C version of substitute-command-keys * src/doc.c (Fsubstitute_command_keys_old): Remove. (syms_of_doc): Remove defsubr for Fsubstitute_command_keys_old. * src/keymap.c (describe_map, describe_map_tree) (describe_map_compare, describe_map_elt): Remove. * src/keymap.h: Remove 'describe_map_tree'. * test/lisp/help-tests.el (with-substitute-command-keys-test) (help-tests-substitute-command-keys/compare) (help-tests-substitute-command-keys/compare-all): Don't test the C version of 'substitute-command-keys' removed above. --- src/doc.c | 303 ------------------------------------------- src/keymap.c | 334 ------------------------------------------------ src/keymap.h | 2 - test/lisp/help-tests.el | 37 +----- 4 files changed, 3 insertions(+), 673 deletions(-) diff --git a/src/doc.c b/src/doc.c index 212ebe96334..f1ce266d39f 100644 --- a/src/doc.c +++ b/src/doc.c @@ -715,308 +715,6 @@ See variable `text-quoting-style'. */) } } -DEFUN ("substitute-command-keys-old", Fsubstitute_command_keys_old, - Ssubstitute_command_keys_old, 1, 1, 0, - doc: /* Substitute key descriptions for command names in STRING. -Each substring of the form \\=\\[COMMAND] is replaced by either a -keystroke sequence that invokes COMMAND, or "M-x COMMAND" if COMMAND -is not on any keys. - -Each substring of the form \\=\\{MAPVAR} is replaced by a summary of -the value of MAPVAR as a keymap. This summary is similar to the one -produced by `describe-bindings'. The summary ends in two newlines -\(used by the helper function `help-make-xrefs' to find the end of the -summary). - -Each substring of the form \\=\\ specifies the use of MAPVAR -as the keymap for future \\=\\[COMMAND] substrings. - -Each grave accent \\=` is replaced by left quote, and each apostrophe \\=' -is replaced by right quote. Left and right quote characters are -specified by `text-quoting-style'. - -\\=\\= quotes the following character and is discarded; thus, \\=\\=\\=\\= puts \\=\\= -into the output, \\=\\=\\=\\[ puts \\=\\[ into the output, and \\=\\=\\=` puts \\=` into the -output. - -Return the original STRING if no substitutions are made. -Otherwise, return a new string (without any text properties). */) - (Lisp_Object string) -{ - char *buf; - bool changed = false; - bool nonquotes_changed = false; - unsigned char *strp; - char *bufp; - ptrdiff_t idx; - ptrdiff_t bsize; - Lisp_Object tem; - Lisp_Object keymap; - unsigned char const *start; - ptrdiff_t length, length_byte; - Lisp_Object name; - ptrdiff_t nchars; - - if (NILP (string)) - return Qnil; - - /* If STRING contains non-ASCII unibyte data, process its - properly-encoded multibyte equivalent instead. This simplifies - the implementation and is OK since substitute-command-keys is - intended for use only on text strings. Keep STRING around, since - it will be returned if no changes occur. */ - Lisp_Object str = Fstring_make_multibyte (string); - - enum text_quoting_style quoting_style = text_quoting_style (); - - nchars = 0; - - /* KEYMAP is either nil (which means search all the active keymaps) - or a specified local map (which means search just that and the - global map). If non-nil, it might come from Voverriding_local_map, - or from a \\ construct in STRING itself.. */ - keymap = Voverriding_local_map; - - ptrdiff_t strbytes = SBYTES (str); - bsize = strbytes; - - /* Fixed-size stack buffer. */ - char sbuf[MAX_ALLOCA]; - - /* Heap-allocated buffer, if any. */ - char *abuf; - - /* Extra room for expansion due to replacing ‘\[]’ with ‘M-x ’. */ - enum { EXTRA_ROOM = sizeof "M-x " - sizeof "\\[]" }; - - ptrdiff_t count = SPECPDL_INDEX (); - - if (bsize <= sizeof sbuf - EXTRA_ROOM) - { - abuf = NULL; - buf = sbuf; - bsize = sizeof sbuf; - } - else - { - buf = abuf = xpalloc (NULL, &bsize, EXTRA_ROOM, STRING_BYTES_BOUND, 1); - record_unwind_protect_ptr (xfree, abuf); - } - bufp = buf; - - strp = SDATA (str); - while (strp < SDATA (str) + strbytes) - { - unsigned char *close_bracket; - - if (strp[0] == '\\' && strp[1] == '=' - && strp + 2 < SDATA (str) + strbytes) - { - /* \= quotes the next character; - thus, to put in \[ without its special meaning, use \=\[. */ - changed = nonquotes_changed = true; - strp += 2; - /* Fall through to copy one char. */ - } - else if (strp[0] == '\\' && strp[1] == '[' - && (close_bracket - = memchr (strp + 2, ']', - SDATA (str) + strbytes - (strp + 2)))) - { - bool follow_remap = 1; - - start = strp + 2; - length_byte = close_bracket - start; - idx = close_bracket + 1 - SDATA (str); - - name = Fintern (make_string ((char *) start, length_byte), Qnil); - - do_remap: - tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil); - - if (VECTORP (tem) && ASIZE (tem) > 1 - && EQ (AREF (tem, 0), Qremap) && SYMBOLP (AREF (tem, 1)) - && follow_remap) - { - name = AREF (tem, 1); - follow_remap = 0; - goto do_remap; - } - - /* Fwhere_is_internal can GC, so take relocation of string - contents into account. */ - strp = SDATA (str) + idx; - start = strp - length_byte - 1; - - if (NILP (tem)) /* but not on any keys */ - { - memcpy (bufp, "M-x ", 4); - bufp += 4; - nchars += 4; - length = multibyte_chars_in_text (start, length_byte); - goto subst; - } - else - { /* function is on a key */ - tem = Fkey_description (tem, Qnil); - goto subst_string; - } - } - /* \{foo} is replaced with a summary of the keymap (symbol-value foo). - \ just sets the keymap used for \[cmd]. */ - else if (strp[0] == '\\' && (strp[1] == '{' || strp[1] == '<') - && (close_bracket - = memchr (strp + 2, strp[1] == '{' ? '}' : '>', - SDATA (str) + strbytes - (strp + 2)))) - { - { - bool generate_summary = strp[1] == '{'; - /* This is for computing the SHADOWS arg for describe_map_tree. */ - Lisp_Object active_maps = Fcurrent_active_maps (Qnil, Qnil); - ptrdiff_t count = SPECPDL_INDEX (); - - start = strp + 2; - length_byte = close_bracket - start; - idx = close_bracket + 1 - SDATA (str); - - /* Get the value of the keymap in TEM, or nil if undefined. - Do this while still in the user's current buffer - in case it is a local variable. */ - name = Fintern (make_string ((char *) start, length_byte), Qnil); - tem = Fboundp (name); - if (! NILP (tem)) - { - tem = Fsymbol_value (name); - if (! NILP (tem)) - tem = get_keymap (tem, 0, 1); - } - - /* Now switch to a temp buffer. */ - struct buffer *oldbuf = current_buffer; - set_buffer_internal (XBUFFER (Vprin1_to_string_buffer)); - /* This is for an unusual case where some after-change - function uses 'format' or 'prin1' or something else that - will thrash Vprin1_to_string_buffer we are using. */ - specbind (Qinhibit_modification_hooks, Qt); - - if (NILP (tem)) - { - name = Fsymbol_name (name); - AUTO_STRING (msg_prefix, "\nUses keymap `"); - insert1 (Fsubstitute_command_keys_old (msg_prefix)); - insert_from_string (name, 0, 0, - SCHARS (name), - SBYTES (name), 1); - AUTO_STRING (msg_suffix, "', which is not currently defined.\n"); - insert1 (Fsubstitute_command_keys_old (msg_suffix)); - if (!generate_summary) - keymap = Qnil; - } - else if (!generate_summary) - keymap = tem; - else - { - /* Get the list of active keymaps that precede this one. - If this one's not active, get nil. */ - Lisp_Object earlier_maps - = Fcdr (Fmemq (tem, Freverse (active_maps))); - describe_map_tree (tem, 1, Fnreverse (earlier_maps), - Qnil, 0, 1, 0, 0, 1); - } - tem = Fbuffer_string (); - Ferase_buffer (); - set_buffer_internal (oldbuf); - unbind_to (count, Qnil); - } - - subst_string: - /* Convert non-ASCII unibyte data to properly-encoded multibyte, - for the same reason STRING was converted to STR. */ - tem = Fstring_make_multibyte (tem); - start = SDATA (tem); - length = SCHARS (tem); - length_byte = SBYTES (tem); - subst: - nonquotes_changed = true; - subst_quote: - changed = true; - { - ptrdiff_t offset = bufp - buf; - ptrdiff_t avail = bsize - offset; - ptrdiff_t need = strbytes - idx; - if (INT_ADD_WRAPV (need, length_byte + EXTRA_ROOM, &need)) - string_overflow (); - if (avail < need) - { - abuf = xpalloc (abuf, &bsize, need - avail, - STRING_BYTES_BOUND, 1); - if (buf == sbuf) - { - record_unwind_protect_ptr (xfree, abuf); - memcpy (abuf, sbuf, offset); - } - else - set_unwind_protect_ptr (count, xfree, abuf); - buf = abuf; - bufp = buf + offset; - } - memcpy (bufp, start, length_byte); - bufp += length_byte; - nchars += length; - - /* Some of the previous code can GC, so take relocation of - string contents into account. */ - strp = SDATA (str) + idx; - - continue; - } - } - else if ((strp[0] == '`' || strp[0] == '\'') - && quoting_style == CURVE_QUOTING_STYLE) - { - start = (unsigned char const *) (strp[0] == '`' ? uLSQM : uRSQM); - length = 1; - length_byte = sizeof uLSQM - 1; - idx = strp - SDATA (str) + 1; - goto subst_quote; - } - else if (strp[0] == '`' && quoting_style == STRAIGHT_QUOTING_STYLE) - { - *bufp++ = '\''; - strp++; - nchars++; - changed = true; - continue; - } - - /* Copy one char. */ - do - *bufp++ = *strp++; - while (! CHAR_HEAD_P (*strp)); - nchars++; - } - - if (changed) /* don't bother if nothing substituted */ - { - tem = make_string_from_bytes (buf, nchars, bufp - buf); - if (!nonquotes_changed) - { - /* Nothing has changed other than quoting, so copy the string’s - text properties. FIXME: Text properties should survive other - changes too; see bug#17052. */ - INTERVAL interval_copy = copy_intervals (string_intervals (string), - 0, SCHARS (string)); - if (interval_copy) - { - set_interval_object (interval_copy, tem); - set_string_intervals (tem, interval_copy); - } - } - } - else - tem = string; - return unbind_to (count, tem); -} void syms_of_doc (void) @@ -1058,5 +756,4 @@ otherwise. */); defsubr (&Sdocumentation_property); defsubr (&Ssnarf_documentation); defsubr (&Sget_quoting_style); - defsubr (&Ssubstitute_command_keys_old); } diff --git a/src/keymap.c b/src/keymap.c index 1eded130b5d..46fa586c753 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -91,9 +91,6 @@ static Lisp_Object store_in_keymap (Lisp_Object, Lisp_Object, Lisp_Object); static Lisp_Object define_as_prefix (Lisp_Object, Lisp_Object); static void describe_command (Lisp_Object, Lisp_Object); static void describe_translation (Lisp_Object, Lisp_Object); -static void describe_map (Lisp_Object, Lisp_Object, - void (*) (Lisp_Object, Lisp_Object), - bool, Lisp_Object, Lisp_Object *, bool, bool); static void describe_vector (Lisp_Object, Lisp_Object, Lisp_Object, void (*) (Lisp_Object, Lisp_Object), bool, Lisp_Object, Lisp_Object, bool, bool); @@ -2946,119 +2943,6 @@ You type Translation\n\ return Qnil; } -/* Insert a description of the key bindings in STARTMAP, - followed by those of all maps reachable through STARTMAP. - If PARTIAL, omit certain "uninteresting" commands - (such as `undefined'). - If SHADOW is non-nil, it is a list of maps; - don't mention keys which would be shadowed by any of them. - PREFIX, if non-nil, says mention only keys that start with PREFIX. - TITLE, if not 0, is a string to insert at the beginning. - TITLE should not end with a colon or a newline; we supply that. - If NOMENU, then omit menu-bar commands. - - If TRANSL, the definitions are actually key translations - so print strings and vectors differently. - - If ALWAYS_TITLE, print the title even if there are no maps - to look through. - - If MENTION_SHADOW, then when something is shadowed by SHADOW, - don't omit it; instead, mention it but say it is shadowed. - - Any inserted text ends in two newlines (used by `help-make-xrefs'). */ - -void -describe_map_tree (Lisp_Object startmap, bool partial, Lisp_Object shadow, - Lisp_Object prefix, const char *title, bool nomenu, - bool transl, bool always_title, bool mention_shadow) -{ - Lisp_Object maps, orig_maps, seen, sub_shadows; - bool something = 0; - const char *key_heading - = "\ -key binding\n\ ---- -------\n"; - - orig_maps = maps = Faccessible_keymaps (startmap, prefix); - seen = Qnil; - sub_shadows = Qnil; - - if (nomenu) - { - Lisp_Object list; - - /* Delete from MAPS each element that is for the menu bar. */ - for (list = maps; CONSP (list); list = XCDR (list)) - { - Lisp_Object elt, elt_prefix, tem; - - elt = XCAR (list); - elt_prefix = Fcar (elt); - if (ASIZE (elt_prefix) >= 1) - { - tem = Faref (elt_prefix, make_fixnum (0)); - if (EQ (tem, Qmenu_bar)) - maps = Fdelq (elt, maps); - } - } - } - - if (!NILP (maps) || always_title) - { - if (title) - { - insert_string (title); - if (!NILP (prefix)) - { - insert_string (" Starting With "); - insert1 (Fkey_description (prefix, Qnil)); - } - insert_string (":\n"); - } - insert_string (key_heading); - something = 1; - } - - for (; CONSP (maps); maps = XCDR (maps)) - { - register Lisp_Object elt, elt_prefix, tail; - - elt = XCAR (maps); - elt_prefix = Fcar (elt); - - sub_shadows = Flookup_key (shadow, elt_prefix, Qt); - if (FIXNATP (sub_shadows)) - sub_shadows = Qnil; - else if (!KEYMAPP (sub_shadows) - && !NILP (sub_shadows) - && !(CONSP (sub_shadows) - && KEYMAPP (XCAR (sub_shadows)))) - /* If elt_prefix is bound to something that's not a keymap, - it completely shadows this map, so don't - describe this map at all. */ - goto skip; - - /* Maps we have already listed in this loop shadow this map. */ - for (tail = orig_maps; !EQ (tail, maps); tail = XCDR (tail)) - { - Lisp_Object tem; - tem = Fequal (Fcar (XCAR (tail)), elt_prefix); - if (!NILP (tem)) - sub_shadows = Fcons (XCDR (XCAR (tail)), sub_shadows); - } - - describe_map (Fcdr (elt), elt_prefix, - transl ? describe_translation : describe_command, - partial, sub_shadows, &seen, nomenu, mention_shadow); - - skip: ; - } - - if (something) - insert_string ("\n"); -} - static int previous_description_column; static void @@ -3121,224 +3005,6 @@ describe_translation (Lisp_Object definition, Lisp_Object args) insert_string ("??\n"); } -/* describe_map puts all the usable elements of a sparse keymap - into an array of `struct describe_map_elt', - then sorts them by the events. */ - -struct describe_map_elt -{ - Lisp_Object event; - Lisp_Object definition; - bool shadowed; -}; - -/* qsort comparison function for sorting `struct describe_map_elt' by - the event field. */ - -static int -describe_map_compare (const void *aa, const void *bb) -{ - const struct describe_map_elt *a = aa, *b = bb; - if (FIXNUMP (a->event) && FIXNUMP (b->event)) - return ((XFIXNUM (a->event) > XFIXNUM (b->event)) - - (XFIXNUM (a->event) < XFIXNUM (b->event))); - if (!FIXNUMP (a->event) && FIXNUMP (b->event)) - return 1; - if (FIXNUMP (a->event) && !FIXNUMP (b->event)) - return -1; - if (SYMBOLP (a->event) && SYMBOLP (b->event)) - /* Sort the keystroke names in the "natural" way, with (for - instance) "" coming between "" and "". */ - return string_version_cmp (SYMBOL_NAME (a->event), SYMBOL_NAME (b->event)); - return 0; -} - -/* Describe the contents of map MAP, assuming that this map itself is - reached by the sequence of prefix keys PREFIX (a string or vector). - PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above. */ - -static void -describe_map (Lisp_Object map, Lisp_Object prefix, - void (*elt_describer) (Lisp_Object, Lisp_Object), - bool partial, Lisp_Object shadow, - Lisp_Object *seen, bool nomenu, bool mention_shadow) -{ - Lisp_Object tail, definition, event; - Lisp_Object tem; - Lisp_Object suppress; - Lisp_Object kludge; - bool first = 1; - - /* These accumulate the values from sparse keymap bindings, - so we can sort them and handle them in order. */ - ptrdiff_t length_needed = 0; - struct describe_map_elt *vect; - ptrdiff_t slots_used = 0; - ptrdiff_t i; - - suppress = Qnil; - - if (partial) - suppress = intern ("suppress-keymap"); - - /* This vector gets used to present single keys to Flookup_key. Since - that is done once per keymap element, we don't want to cons up a - fresh vector every time. */ - kludge = make_nil_vector (1); - definition = Qnil; - - map = call1 (Qkeymap_canonicalize, map); - - for (tail = map; CONSP (tail); tail = XCDR (tail)) - length_needed++; - - USE_SAFE_ALLOCA; - SAFE_NALLOCA (vect, 1, length_needed); - - for (tail = map; CONSP (tail); tail = XCDR (tail)) - { - maybe_quit (); - - if (VECTORP (XCAR (tail)) - || CHAR_TABLE_P (XCAR (tail))) - describe_vector (XCAR (tail), - prefix, Qnil, elt_describer, partial, shadow, map, - 1, mention_shadow); - else if (CONSP (XCAR (tail))) - { - bool this_shadowed = 0; - - event = XCAR (XCAR (tail)); - - /* Ignore bindings whose "prefix" are not really valid events. - (We get these in the frames and buffers menu.) */ - if (!(SYMBOLP (event) || FIXNUMP (event))) - continue; - - if (nomenu && EQ (event, Qmenu_bar)) - continue; - - definition = get_keyelt (XCDR (XCAR (tail)), 0); - - /* Don't show undefined commands or suppressed commands. */ - if (NILP (definition)) continue; - if (SYMBOLP (definition) && partial) - { - tem = Fget (definition, suppress); - if (!NILP (tem)) - continue; - } - - /* Don't show a command that isn't really visible - because a local definition of the same key shadows it. */ - - ASET (kludge, 0, event); - if (!NILP (shadow)) - { - tem = shadow_lookup (shadow, kludge, Qt, 0); - if (!NILP (tem)) - { - /* If both bindings are keymaps, this key is a prefix key, - so don't say it is shadowed. */ - if (KEYMAPP (definition) && KEYMAPP (tem)) - ; - /* Avoid generating duplicate entries if the - shadowed binding has the same definition. */ - else if (mention_shadow && !EQ (tem, definition)) - this_shadowed = 1; - else - continue; - } - } - - tem = Flookup_key (map, kludge, Qt); - if (!EQ (tem, definition)) continue; - - vect[slots_used].event = event; - vect[slots_used].definition = definition; - vect[slots_used].shadowed = this_shadowed; - slots_used++; - } - else if (EQ (XCAR (tail), Qkeymap)) - { - /* The same keymap might be in the structure twice, if we're - using an inherited keymap. So skip anything we've already - encountered. */ - tem = Fassq (tail, *seen); - if (CONSP (tem) && !NILP (Fequal (XCAR (tem), prefix))) - break; - *seen = Fcons (Fcons (tail, prefix), *seen); - } - } - - /* If we found some sparse map events, sort them. */ - - qsort (vect, slots_used, sizeof (struct describe_map_elt), - describe_map_compare); - - /* Now output them in sorted order. */ - - for (i = 0; i < slots_used; i++) - { - Lisp_Object start, end; - - if (first) - { - previous_description_column = 0; - insert ("\n", 1); - first = 0; - } - - ASET (kludge, 0, vect[i].event); - start = vect[i].event; - end = start; - - definition = vect[i].definition; - - /* Find consecutive chars that are identically defined. */ - if (FIXNUMP (vect[i].event)) - { - while (i + 1 < slots_used - && EQ (vect[i+1].event, make_fixnum (XFIXNUM (vect[i].event) + 1)) - && !NILP (Fequal (vect[i + 1].definition, definition)) - && vect[i].shadowed == vect[i + 1].shadowed) - i++; - end = vect[i].event; - } - - /* Now START .. END is the range to describe next. */ - - /* Insert the string to describe the event START. */ - insert1 (Fkey_description (kludge, prefix)); - - if (!EQ (start, end)) - { - insert (" .. ", 4); - - ASET (kludge, 0, end); - /* Insert the string to describe the character END. */ - insert1 (Fkey_description (kludge, prefix)); - } - - /* Print a description of the definition of this character. - elt_describer will take care of spacing out far enough - for alignment purposes. */ - (*elt_describer) (vect[i].definition, Qnil); - - if (vect[i].shadowed) - { - ptrdiff_t pt = max (PT - 1, BEG); - - SET_PT (pt); - insert_string ("\n (this binding is currently shadowed)"); - pt = min (PT + 1, Z); - SET_PT (pt); - } - } - - SAFE_FREE (); -} - static void describe_vector_princ (Lisp_Object elt, Lisp_Object fun) { diff --git a/src/keymap.h b/src/keymap.h index 3ef48fb748e..2f7df2bd955 100644 --- a/src/keymap.h +++ b/src/keymap.h @@ -36,8 +36,6 @@ extern Lisp_Object current_global_map; extern char *push_key_description (EMACS_INT, char *); extern Lisp_Object access_keymap (Lisp_Object, Lisp_Object, bool, bool, bool); extern Lisp_Object get_keymap (Lisp_Object, bool, bool); -extern void describe_map_tree (Lisp_Object, bool, Lisp_Object, Lisp_Object, - const char *, bool, bool, bool, bool); extern ptrdiff_t current_minor_maps (Lisp_Object **, Lisp_Object **); extern void initial_define_key (Lisp_Object, int, const char *); extern void initial_define_lispy_key (Lisp_Object, const char *, const char *); diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el index aff5d1853a6..079b1114a81 100644 --- a/test/lisp/help-tests.el +++ b/test/lisp/help-tests.el @@ -58,23 +58,15 @@ ;;; substitute-command-keys (defmacro with-substitute-command-keys-test (&rest body) - `(cl-flet* ((should-be-same-as-c-version - ;; TODO: Remove this when old C function is removed. - (lambda (orig) - (should (equal-including-properties - (substitute-command-keys orig) - (substitute-command-keys-old orig))))) - (test + `(cl-flet* ((test (lambda (orig result) (should (equal-including-properties (substitute-command-keys orig) - result)) - (should-be-same-as-c-version orig))) + result)))) (test-re (lambda (orig regexp) (should (string-match (concat "^" regexp "$") - (substitute-command-keys orig))) - (should-be-same-as-c-version orig)))) + (substitute-command-keys orig)))))) ,@body)) (ert-deftest help-tests-substitute-command-keys/no-change () @@ -369,29 +361,6 @@ C-b undefined "))))) -;; TODO: This is a temporary test that should be removed together with -;; substitute-command-keys-old. -(ert-deftest help-tests-substitute-command-keys/compare () - (with-substitute-command-keys-test - (with-temp-buffer - (Info-mode) - (outline-minor-mode) - (test-re "\\{Info-mode-map}" ".*"))) - (with-substitute-command-keys-test - (with-temp-buffer - (c-mode) - (outline-minor-mode) - (test-re "\\{c-mode-map}" ".*")))) - -(ert-deftest help-tests-substitute-command-keys/compare-all () - (let (keymaps) - (mapatoms (lambda (var) - (when (keymapp var) - (push var keymaps)))) - (dolist (keymap keymaps) - (with-substitute-command-keys-test - (test-re (concat "\\{" (symbol-name keymap) "}") ".*"))))) - (provide 'help-tests) ;;; help-tests.el ends here -- cgit v1.2.3 From 420023a6f066d6ffb85e23ffe3abcfee3d523ea7 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 18 Oct 2020 16:49:55 +0200 Subject: Prefer Lisp version of describer in help--describe-vector * src/keymap.c (Fhelp__describe_vector): * lisp/help.el (describe-map): Use Lisp versions of describe_command and describe_translation. * src/keymap.c (describe_command, describe_translation): Remove. (describe_vector_basic): New function. --- lisp/help.el | 5 +++- src/keymap.c | 78 +++++++----------------------------------------------------- 2 files changed, 13 insertions(+), 70 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index e8dfbdef74a..6ae2664cf41 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1274,10 +1274,13 @@ TRANSL, PARTIAL, SHADOW, NOMENU, MENTION-SHADOW are as in (map (keymap-canonicalize map)) (tail map) (first t) + (describer (if transl + #'help--describe-translation + #'help--describe-command)) done vect) (while (and (consp tail) (not done)) (cond ((or (vectorp (car tail)) (char-table-p (car tail))) - (help--describe-vector (car tail) prefix transl partial + (help--describe-vector (car tail) prefix describer partial shadow map mention-shadow)) ((consp (car tail)) (let ((event (caar tail)) diff --git a/src/keymap.c b/src/keymap.c index 46fa586c753..e5b4781076f 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -89,8 +89,6 @@ static Lisp_Object where_is_cache_keymaps; static Lisp_Object store_in_keymap (Lisp_Object, Lisp_Object, Lisp_Object); static Lisp_Object define_as_prefix (Lisp_Object, Lisp_Object); -static void describe_command (Lisp_Object, Lisp_Object); -static void describe_translation (Lisp_Object, Lisp_Object); static void describe_vector (Lisp_Object, Lisp_Object, Lisp_Object, void (*) (Lisp_Object, Lisp_Object), bool, Lisp_Object, Lisp_Object, bool, bool); @@ -2943,74 +2941,18 @@ You type Translation\n\ return Qnil; } -static int previous_description_column; - -static void -describe_command (Lisp_Object definition, Lisp_Object args) -{ - register Lisp_Object tem1; - ptrdiff_t column = current_column (); - int description_column; - - /* If column 16 is no good, go to col 32; - but don't push beyond that--go to next line instead. */ - if (column > 30) - { - insert_char ('\n'); - description_column = 32; - } - else if (column > 14 || (column > 10 && previous_description_column == 32)) - description_column = 32; - else - description_column = 16; - - Findent_to (make_fixnum (description_column), make_fixnum (1)); - previous_description_column = description_column; - - if (SYMBOLP (definition)) - { - tem1 = SYMBOL_NAME (definition); - insert1 (tem1); - insert_string ("\n"); - } - else if (STRINGP (definition) || VECTORP (definition)) - insert_string ("Keyboard Macro\n"); - else if (KEYMAPP (definition)) - insert_string ("Prefix Command\n"); - else - insert_string ("??\n"); -} - static void -describe_translation (Lisp_Object definition, Lisp_Object args) +describe_vector_princ (Lisp_Object elt, Lisp_Object fun) { - register Lisp_Object tem1; - Findent_to (make_fixnum (16), make_fixnum (1)); - - if (SYMBOLP (definition)) - { - tem1 = SYMBOL_NAME (definition); - insert1 (tem1); - insert_string ("\n"); - } - else if (STRINGP (definition) || VECTORP (definition)) - { - insert1 (Fkey_description (definition, Qnil)); - insert_string ("\n"); - } - else if (KEYMAPP (definition)) - insert_string ("Prefix Command\n"); - else - insert_string ("??\n"); + call1 (fun, elt); + Fterpri (Qnil, Qnil); } static void -describe_vector_princ (Lisp_Object elt, Lisp_Object fun) +describe_vector_basic (Lisp_Object elt, Lisp_Object fun) { - Findent_to (make_fixnum (16), make_fixnum (1)); call1 (fun, elt); - Fterpri (Qnil, Qnil); } DEFUN ("describe-vector", Fdescribe_vector, Sdescribe_vector, 1, 2, 0, @@ -3032,6 +2974,7 @@ DESCRIBER is the output function used; nil means use `princ'. */) DEFUN ("help--describe-vector", Fhelp__describe_vector, Shelp__describe_vector, 7, 7, 0, doc: /* Insert in the current buffer a description of the contents of VECTOR. +Call DESCRIBER to insert the description of one value found in VECTOR. PREFIX is a string describing the key which leads to the keymap that this vector is in. @@ -3045,7 +2988,7 @@ if it is defined by any of them. ENTIRE-MAP is the keymap in which this vector appears. If the definition in effect in the whole map does not match the one in this keymap, we ignore this one. */) - (Lisp_Object vector, Lisp_Object prefix, Lisp_Object transl, + (Lisp_Object vector, Lisp_Object prefix, Lisp_Object describer, Lisp_Object partial, Lisp_Object shadow, Lisp_Object entire_map, Lisp_Object mention_shadow) { @@ -3053,19 +2996,16 @@ the one in this keymap, we ignore this one. */) specbind (Qstandard_output, Fcurrent_buffer ()); CHECK_VECTOR_OR_CHAR_TABLE (vector); - bool b_transl = NILP (transl) ? false : true; bool b_partial = NILP (partial) ? false : true; bool b_mention_shadow = NILP (mention_shadow) ? false : true; - describe_vector (vector, prefix, Qnil, - b_transl ? describe_translation : describe_command, - b_partial, shadow, entire_map, - true, b_mention_shadow); + describe_vector (vector, prefix, describer, describe_vector_basic, b_partial, + shadow, entire_map, true, b_mention_shadow); return unbind_to (count, Qnil); } /* Insert in the current buffer a description of the contents of VECTOR. - We call ELT_DESCRIBER to insert the description of one value found + Call ELT_DESCRIBER to insert the description of one value found in VECTOR. ELT_PREFIX describes what "comes before" the keys or indices defined -- cgit v1.2.3 From 58a9cec52574cc5caacc9c7075ef45e90be3c25d Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 8 Sep 2020 16:12:43 +0200 Subject: Add "Old-" prefix to "Version" header in more cases These version numbers are historical accidents and not relevant today. Ref: https://lists.gnu.org/r/emacs-devel/2020-03/msg00080.html --- lisp/calendar/timeclock.el | 2 +- lisp/delim-col.el | 2 +- lisp/edmacro.el | 1 - lisp/emacs-lisp/chart.el | 2 +- lisp/emacs-lisp/regi.el | 2 +- lisp/mail/footnote.el | 2 +- lisp/md4.el | 2 +- lisp/net/sasl-ntlm.el | 2 +- lisp/play/dunnet.el | 4 ++-- lisp/play/gamegrid.el | 2 +- lisp/progmodes/sh-script.el | 2 +- lisp/savehist.el | 2 +- lisp/textmodes/artist.el | 2 +- 13 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 18ca05af4c5..a26da265fe8 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -4,7 +4,7 @@ ;; Author: John Wiegley ;; Created: 25 Mar 1999 -;; Version: 2.6.1 +;; Old-Version: 2.6.1 ;; Keywords: calendar data ;; This file is part of GNU Emacs. diff --git a/lisp/delim-col.el b/lisp/delim-col.el index 9d520278a70..1d4358d7385 100644 --- a/lisp/delim-col.el +++ b/lisp/delim-col.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1999-2020 Free Software Foundation, Inc. ;; Author: Vinicius Jose Latorre -;; Version: 2.1 +;; Old-Version: 2.1 ;; Keywords: convenience text ;; X-URL: https://www.emacswiki.org/emacs/ViniciusJoseLatorre diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 71474c0289a..1d9b4726b04 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -3,7 +3,6 @@ ;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc. ;; Author: Dave Gillespie -;; Version: 2.01 ;; Keywords: abbrev ;; This file is part of GNU Emacs. diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 964836a32ac..177710038a0 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -4,7 +4,7 @@ ;; Software Foundation, Inc. ;; Author: Eric M. Ludlam -;; Version: 0.2 +;; Old-Version: 0.2 ;; Keywords: OO, chart, graph ;; This file is part of GNU Emacs. diff --git a/lisp/emacs-lisp/regi.el b/lisp/emacs-lisp/regi.el index 61af5e51bda..11b28b72cf3 100644 --- a/lisp/emacs-lisp/regi.el +++ b/lisp/emacs-lisp/regi.el @@ -4,7 +4,7 @@ ;; Author: 1993 Barry A. Warsaw, Century Computing, Inc. ;; Created: 24-Feb-1993 -;; Version: 1.8 +;; Old-Version: 1.8 ;; Last Modified: 1993/06/01 21:33:00 ;; Keywords: extensions, matching diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el index 61f7cbf9695..67bfbf703bb 100644 --- a/lisp/mail/footnote.el +++ b/lisp/mail/footnote.el @@ -5,7 +5,7 @@ ;; Author: Steven L Baur (1997-2011) ;; Boruch Baum (2017-) ;; Keywords: mail, news -;; Version: 0.19 +;; Old-Version: 0.19 ;; This file is part of GNU Emacs. diff --git a/lisp/md4.el b/lisp/md4.el index 925686aa756..029a125b8ae 100644 --- a/lisp/md4.el +++ b/lisp/md4.el @@ -4,7 +4,7 @@ ;; Author: Taro Kawagishi ;; Keywords: MD4 -;; Version: 1.00 +;; Old-Version: 1.00 ;; Created: February 2001 ;; This file is part of GNU Emacs. diff --git a/lisp/net/sasl-ntlm.el b/lisp/net/sasl-ntlm.el index ec5b53ee917..6882c23d789 100644 --- a/lisp/net/sasl-ntlm.el +++ b/lisp/net/sasl-ntlm.el @@ -4,7 +4,7 @@ ;; Author: Taro Kawagishi ;; Keywords: SASL, NTLM -;; Version: 1.00 +;; Old-Version: 1.00 ;; Created: February 2001 ;; Package: sasl diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index a03d0a9a052..8a69f9decf0 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el @@ -4,7 +4,7 @@ ;; Author: Ron Schnell ;; Created: 25 Jul 1992 -;; Version: 2.02 +;; Old-Version: 2.02 ;; Keywords: games ;; This file is part of GNU Emacs. @@ -1957,7 +1957,7 @@ to swim.") (defun dun-help (_args) (dun-mprincl -"Welcome to dunnet (2.02), by Ron Schnell (ronnie@driver-aces.com - @RonnieSchnell). +"Welcome to dunnet by Ron Schnell (ronnie@driver-aces.com - @RonnieSchnell). Here is some useful information (read carefully because there are one or more clues in here): - If you have a key that can open a door, you do not need to explicitly diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index 74e6c2d034d..bb8ae5693f6 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc. ;; Author: Glynn Clements -;; Version: 1.02 +;; Old-Version: 1.02 ;; Created: 1997-08-13 ;; Keywords: games diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index a8c0e045c6b..3b24cabe8bd 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -4,7 +4,7 @@ ;; Inc. ;; Author: Daniel Pfeiffer -;; Version: 2.0f +;; Old-Version: 2.0f ;; Maintainer: emacs-devel@gnu.org ;; Keywords: languages, unix diff --git a/lisp/savehist.el b/lisp/savehist.el index 4e52efe7f1a..5d20239d17f 100644 --- a/lisp/savehist.el +++ b/lisp/savehist.el @@ -5,7 +5,7 @@ ;; Author: Hrvoje NikĆĄić ;; Maintainer: emacs-devel@gnu.org ;; Keywords: convenience, minibuffer -;; Version: 24 +;; Old-Version: 24 ;; This file is part of GNU Emacs. diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index 7196692001e..e98072c11f6 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -4,7 +4,7 @@ ;; Author: Tomas Abrahamsson ;; Keywords: mouse -;; Version: 1.2.6 +;; Old-Version: 1.2.6 ;; Release-date: 6-Aug-2004 ;; Location: http://www.lysator.liu.se/~tab/artist/ -- cgit v1.2.3 From 6da62d612eea6ecfd2b9c9c72d936b1b7b740889 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sun, 18 Oct 2020 23:30:15 +0300 Subject: * etc/HELLO: Add Belarusian and use Javanese script for Javanese (bug#43887) --- etc/HELLO | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etc/HELLO b/etc/HELLO index e0345cb7ab9..10c4e9e66c8 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -25,7 +25,8 @@ LANGUAGE (NATIVE NAME) HELLO mule-unicode-0100-24ffAmharic (አማርኛ) ሠላም Arabic (Ű§Ù„ŰčŰ±ŰšÙŠÙ‘Ű©) Ű§Ù„ŰłÙ‘Ù„Ű§Ù… Űčليكم Armenian (Ő°ŐĄŐ”Ő„Ö€Ő„Ő¶) ÔČարև Ő±Ő„ŐŠ -Bengali (àŠŹàŠŸàŠ‚àŠČàŠŸ) àŠšàŠźàŠžà§àŠ•àŠŸàŠ° +cyrillic-iso8859-5Belarusian (Đ±Đ”Đ»Đ°Ń€ŃƒŃĐșая) ПрыĐČŃ–Ń‚Đ°ĐœĐœĐ” +mule-unicode-0100-24ffBengali (àŠŹàŠŸàŠ‚àŠČàŠŸ) àŠšàŠźàŠžà§àŠ•àŠŸàŠ° mule-unicode-2500-33ffBraille ⠓⠑⠇⠇⠕ mule-unicode-0100-24ffBurmese (မဌနá€șမာ) မငá€șá€čá€‚á€œá€Źá€•á€« C printf ("Hello, world!\n"); @@ -58,8 +59,8 @@ Gujarati (àȘ—ુàȘœàȘ°àȘŸàȘ€à«€) àȘšàȘźàȘžà«àȘ€à«‡ unicodeInuktitut (ᐃᓄᒃᑎᑐᑩ) ᐊᐃ latin-iso8859-1Italian (italiano) Ciao / Buon giorno -Javanese (Jawa) System.out.println("Sugeng siang!"); -mule-unicode-0100-24ffKannada (àȕàČšàłàČšàČĄ) àČšàČźàČžàłàȕàČŸàČ° +unicodeJavanese (êŠ§êŠ±êŠ—êŠź) ꊱꊞꊒꊌꊁꊱꊶêŠȘꊁ +mule-unicode-0100-24ffKannada (àȕàČšàłàČšàČĄ) àČšàČźàČžàłàȕàČŸàČ° Khmer (ភាសាខ្មែរ) ជំរាបសវរ laoLao (àșžàșČàșȘàșČàș„àșČàș§) àșȘàș°àșšàșČàșàș”àș” / àș‚ໍໃàș«à»‰à»‚àșŠàșàș”àș” mule-unicode-0100-24ffMalayalam (àŽźàŽČàŽŻàŽŸàŽłàŽ‚) àŽšàŽźàŽžà”àŽ•àŽŸàŽ°àŽ‚ -- cgit v1.2.3 From 34eb99d7ba63761ba12acff2b01dc900bbccc720 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sun, 18 Oct 2020 23:37:57 +0300 Subject: Add new choice 'keep' to next-error-message-highlight (bug#32676) * lisp/simple.el (next-error-message-highlight): Add new choice 'keep'. (next-error-message-highlight): Don't delete overlay when option is 'keep'. --- etc/NEWS | 2 ++ lisp/simple.el | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 64758d455a0..b61bf176a47 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1185,6 +1185,8 @@ be done (and this restores how this previously worked). *** New user option 'next-error-message-highlight'. In addition to a fringe arrow, 'next-error' error may now optionally highlight the current error message in the 'next-error' buffer. +This user option can be also customized to keep highlighting on all +visited errors, so you can have an overview what errors were already visited. +++ *** New user option 'tab-first-completion'. diff --git a/lisp/simple.el b/lisp/simple.el index d6fce922c4c..a29f85b3c36 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -119,8 +119,12 @@ If non-nil, the value is passed directly to `recenter'." :version "23.1") (defcustom next-error-message-highlight nil - "If non-nil, highlight the current error message in the `next-error' buffer." - :type 'boolean + "If non-nil, highlight the current error message in the `next-error' buffer. +If the value is `keep', highlighting is permanent, so all visited error +messages are highlighted; this helps to see what messages were visited." + :type '(choice (const :tag "Highlight the current error" t) + (const :tag "Highlight all visited errors" keep) + (const :tag "No highlighting" nil)) :group 'next-error :version "28.1") @@ -482,7 +486,8 @@ buffer causes automatic display of the corresponding source code location." "Highlight the current error message in the ‘next-error’ buffer." (when next-error-message-highlight (with-current-buffer error-buffer - (when next-error--message-highlight-overlay + (when (and next-error--message-highlight-overlay + (not (eq next-error-message-highlight 'keep))) (delete-overlay next-error--message-highlight-overlay)) (let ((ol (make-overlay (line-beginning-position) (1+ (line-end-position))))) ;; do not override region highlighting -- cgit v1.2.3 From d3c99b6b6b3dcf91dca28ce1e1b456221131ae0b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 19 Oct 2020 04:03:34 +0200 Subject: ; * etc/NEWS: Some copy edits. --- etc/NEWS | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index b61bf176a47..390cccbff30 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -86,13 +86,13 @@ useful on systems such as FreeBSD which ships only with "etc/termcap". * Changes in Emacs 28.1 +++ -*** A new system for displaying documentation for groups of function is added. +** New system for displaying documentation for groups of function. This can either be used by saying 'M-x shortdoc-display-group' and choosing a group, or clicking a button in the *Help* buffers when looking at the doc string of a function that belongs to one of these groups. -*** New var 'redisplay-skip-initial-frame' to enable batch redisplay tests. +** New var 'redisplay-skip-initial-frame' to enable batch redisplay tests. Setting it to nil forces the redisplay to do its job even in the initial frame used in batch mode. @@ -104,7 +104,7 @@ sequences necessary to render faces with the 'strike-through' attribute on TTY frames. +++ -*** Emacs now defaults to UTF-8 instead of ISO-8859-1. +** Emacs now defaults to UTF-8 instead of ISO-8859-1. This is only for the default, where the user has set no 'LANG' (or similar) variable or environment. This change should lead to no user-visible changes for normal usage. @@ -163,13 +163,6 @@ your init file: (setq frame-title-format '(multiple-frames "%b" ("" invocation-name "@" system-name))) -** recentf - ---- -*** 'recentf-auto-cleanup' time string now repeats. -When 'recentf-auto-cleanup' is set to a time string, it now repeats -every day, rather than only running once after the mode is turned on. - * Editing Changes in Emacs 28.1 @@ -213,11 +206,6 @@ buffer to be able to move point to the inaccessible portion. ** When 'suggest-key-bindings' is non-nil, the completion list of 'M-x' shows equivalent key bindings for all commands that have them. ---- -** Movement commands in 'gomoku-mode' are fixed. -'gomoku-move-sw' and 'gomoku-move-ne' now work correctly, and -horizontal movements now stop at the edge of the board. - ** Autosaving via 'auto-save-visited-mode' can now be inhibited by setting the variable 'auto-save-visited-mode' buffer-locally to nil. @@ -1126,9 +1114,15 @@ custom rules, see the variables 'bug-reference-setup-from-vc-alist', It's bound to the 'C-c C-c f' keystroke, and prompts for a local file name. ---- ** Recentf -The recentf files are no longer backed up. + +--- +*** The recentf files are no longer backed up. + +--- +*** 'recentf-auto-cleanup' time string now repeats. +When 'recentf-auto-cleanup' is set to a time string, it now repeats +every day, rather than only running once after the mode is turned on. ** Calc @@ -1315,6 +1309,11 @@ never be narrower than 19 characters. When the bookmark.el library is loaded, a customize choice is added to 'tab-bar-new-tab-choice' for new tabs to show the bookmark list. +--- +*** Movement commands in 'gomoku-mode' are fixed. +'gomoku-move-sw' and 'gomoku-move-ne' now work correctly, and +horizontal movements now stop at the edge of the board. + ** xwidget-webkit mode *** New xwidget commands. -- cgit v1.2.3 From 1b3e03150690931a06a5c005f0de93e324233a18 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 19 Oct 2020 09:41:01 +0200 Subject: ; * admin/MAINTAINERS: Add entry for Michael Albinus. --- admin/MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/admin/MAINTAINERS b/admin/MAINTAINERS index f7ec181bf9c..53afe87a0f8 100644 --- a/admin/MAINTAINERS +++ b/admin/MAINTAINERS @@ -213,6 +213,7 @@ Paul Eggert src/* (except for *.m, *w32*, bitmaps, files others want to maintain) Michael Albinus + .gitlab-ci.yml src/inotify.c lisp/autorevert.el lisp/eshell/em-tramp.el -- cgit v1.2.3 From f98e57b54bbb6c8aa3d5b00b7d8b33266025b9b1 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 19 Oct 2020 09:41:11 +0200 Subject: * lisp/files.el (directory-files-no-dot-files-regexp): Adapt docstring. --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index c2c58dae934..78ccb9ba910 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5787,7 +5787,7 @@ If called interactively, then PARENTS is non-nil." (defconst directory-files-no-dot-files-regexp "[^.]\\|\\.\\.\\." - "Regexp matching any file name except \".\" and \"..\". + "Regexp matching any non-directory part of a file name except \".\" and \"..\". More precisely, it matches parts of any nonempty string except those two. It is useful as the regexp argument to `directory-files' and `directory-files-and-attributes'.") -- cgit v1.2.3 From 6d00233bfdf52fb3a03e8febabbfad5a331777cf Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 19 Oct 2020 09:48:51 +0200 Subject: * src/dired.c (Fdirectory_files, Fdirectory_files_and_attributes): Adapt docstring. --- src/dired.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dired.c b/src/dired.c index 1584b6acf08..442d3aa48fb 100644 --- a/src/dired.c +++ b/src/dired.c @@ -293,7 +293,8 @@ DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 4, 0, There are three optional arguments: If FULL is non-nil, return absolute file names. Otherwise return names that are relative to the specified directory. -If MATCH is non-nil, mention only file names that match the regexp MATCH. +If MATCH is non-nil, mention only file names which non-directory part + matches the regexp MATCH. If NOSORT is non-nil, the list is not sorted--its order is unpredictable. Otherwise, the list returned is sorted with `string-lessp'. NOSORT is useful if you plan to sort the result yourself. */) @@ -325,11 +326,12 @@ by `file-attributes'. This function accepts four optional arguments: If FULL is non-nil, return absolute file names. Otherwise return names that are relative to the specified directory. -If MATCH is non-nil, mention only file names that match the regexp MATCH. +If MATCH is non-nil, mention only file names which non-directory part + matches the regexp MATCH. If NOSORT is non-nil, the list is not sorted--its order is unpredictable. NOSORT is useful if you plan to sort the result yourself. ID-FORMAT specifies the preferred format of attributes uid and gid, see -`file-attributes' for further documentation. + `file-attributes' for further documentation. On MS-Windows, performance depends on `w32-get-true-file-attributes', which see. */) (Lisp_Object directory, Lisp_Object full, Lisp_Object match, -- cgit v1.2.3 From 9f9e3bc24b1ee44b13ebb41293f6dd012ce2298e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 19 Oct 2020 10:24:57 +0200 Subject: Ffunction doc string clarification * src/eval.c (Ffunction): Mention that `function' isn't quite like `quote' in non-bytecompile circumstances, too (bug#41864). --- src/eval.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/eval.c b/src/eval.c index 0b23905207d..76708e6e7e2 100644 --- a/src/eval.c +++ b/src/eval.c @@ -544,7 +544,10 @@ usage: (quote ARG) */) DEFUN ("function", Ffunction, Sfunction, 1, UNEVALLED, 0, doc: /* Like `quote', but preferred for objects which are functions. In byte compilation, `function' causes its argument to be handled by -the byte compiler. `quote' cannot do that. +the byte compiler. Similarly, when expanding macros and expressions, +ARG can be examined and possibly expanded. If `quote' is used +instead, this doesn't happen. + usage: (function ARG) */) (Lisp_Object args) { -- cgit v1.2.3 From 422fdabe7bcaa9eac9aa5ae688ccf9f30cf6765c Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Mon, 19 Oct 2020 10:45:14 +0200 Subject: Handle "Before first headings" error in outline-cycle * lisp/outline.el (outline-before-first-heading): New error. (outline-back-to-heading): Signal the new error. (outline-cycle): Ignore the error. (outline-cycle-buffer): Simply pass 1 to 'outline-hide-sublevels' (bug#41130). --- lisp/outline.el | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/lisp/outline.el b/lisp/outline.el index a4ce9afb445..b9806bc187e 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -402,6 +402,8 @@ at the end of the buffer." If POS is nil, use `point' instead." (eq (get-char-property (or pos (point)) 'invisible) 'outline)) +(define-error 'outline-before-first-heading "Before first heading") + (defun outline-back-to-heading (&optional invisible-ok) "Move to previous heading line, or beg of this line if it's a heading. Only visible heading lines are considered, unless INVISIBLE-OK is non-nil." @@ -412,7 +414,7 @@ Only visible heading lines are considered, unless INVISIBLE-OK is non-nil." (while (not found) (or (re-search-backward (concat "^\\(?:" outline-regexp "\\)") nil t) - (error "Before first heading")) + (signal 'outline-before-first-heading nil)) (setq found (and (or invisible-ok (not (outline-invisible-p))) (point))))) (goto-char found) @@ -1167,19 +1169,21 @@ Return either 'hide-all, 'headings-only, or 'show-all." `Headings only' means show sub headings but not their bodies. `Show all' means show all subheadings and their bodies." (interactive) - (pcase (outline--cycle-state) - ('hide-all - (if (outline-has-subheading-p) - (progn (outline-show-children) - (message "Only headings")) - (outline-show-subtree) - (message "Show all"))) - ('headings-only - (outline-show-subtree) - (message "Show all")) - ('show-all - (outline-hide-subtree) - (message "Hide all")))) + (condition-case nil + (pcase (outline--cycle-state) + ('hide-all + (if (outline-has-subheading-p) + (progn (outline-show-children) + (message "Only headings")) + (outline-show-subtree) + (message "Show all"))) + ('headings-only + (outline-show-subtree) + (message "Show all")) + ('show-all + (outline-hide-subtree) + (message "Hide all"))) + (outline-before-first-heading nil))) (defvar-local outline--cycle-buffer-state 'show-all "Internal variable used for tracking buffer cycle state.") @@ -1189,13 +1193,7 @@ Return either 'hide-all, 'headings-only, or 'show-all." (interactive) (pcase outline--cycle-buffer-state ('show-all - (save-excursion - (let ((start-point (point))) - (while (not (eq (point) start-point)) - (outline-up-heading 1)) - (outline-hide-sublevels - (progn (outline-back-to-heading) - (funcall 'outline-level))))) + (outline-hide-sublevels 1) (setq outline--cycle-buffer-state 'top-level) (message "Top level headings")) ('top-level -- cgit v1.2.3 From fb26dc130db99cda4227257c10b9b8c38079b83f Mon Sep 17 00:00:00 2001 From: Harald Jörg Date: Mon, 19 Oct 2020 10:57:57 +0200 Subject: cperl-mode: Delete a misleading comment, add tests for verification * lisp/progmodes/cperl-mode.el: Delete a comment which explains a bug which has been fixed a long time ago (bug#44073). * test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-fontify-punct-vars): Add regression tests to verify that fontification of punctuation variables doesn't start strings. --- lisp/progmodes/cperl-mode.el | 7 ------- .../fontify-punctuation-vars.pl | 20 ++++++++++++++++++++ test/lisp/progmodes/cperl-mode-tests.el | 22 ++++++++++++++++++++++ 3 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 5b6e50c8206..ebbea6bed92 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -71,13 +71,6 @@ ;; (define-key global-map [M-S-down-mouse-3] 'imenu) -;;;; Font lock bugs as of v4.32: - -;; The following kinds of Perl code erroneously start strings: -;; \$` \$' \$" -;; $opt::s $opt_s $opt{s} (s => ...) /\s+.../ -;; likewise with m, tr, y, q, qX instead of s - ;;; Code: ;;; Compatibility with older versions (for publishing on ELPA) diff --git a/test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl b/test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl new file mode 100644 index 00000000000..fa328438cb1 --- /dev/null +++ b/test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl @@ -0,0 +1,20 @@ +# The following Perl punctiation variables contain characters which +# are classified as string delimiters in the syntax table. The mode +# should not be confused by these. +# The corresponding tests check that two consecutive '#' characters +# are seen as comments, not as strings. +my $pre = $`; ## $PREMATCH, use another ` # to balance out +my $pos = $'; ## $POSTMATCH, use another ' # to balance out +my $lsp = $"; ## $LIST_SEPARATOR use another " # to balance out + +# In the second level, we use the reference constructor \ on these +# variables. The backslash is an escape character *only* in strings. +my $ref = \$`; ## \$PREMATCH, use another ` # to balance out +my $rif = \$'; ## \$POSTMATCH, use another ' # to balance out +my $raf = \$"; ## \$LIST_SEPARATOR use another " # to balance out + +my $opt::s = 0; ## s is no substitution here +my $opt_s = 0; ## s is no substitution here +my %opt = (s => 0); ## s is no substitution here +$opt{s} = 0; ## s is no substitution here +$opt_s =~ /\s+.../ ## s is no substitution here diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index e2af2b5b8de..e67678cf6bb 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -196,4 +196,26 @@ Perl Best Practices sets some indentation values different from (should (equal got expected))))) (cperl-set-style "CPerl")))) +(ert-deftest cperl-mode-fontify-punct-vars () + "Test fontification of Perl's punctiation variables. +Perl has variable names containing unbalanced quotes for the list +separator $\" and pre- and postmatch $` and $'. A reference to +these variables, for example \\$\", should not cause the dollar +to be escaped, which would then start a string beginning with the +quote character. This used to be broken in cperl-mode at some +point in the distant past, and is still broken in perl-mode. " + (skip-unless (eq cperl-test-mode #'cperl-mode)) + (let ((file (ert-resource-file "fontify-punctuation-vars.pl"))) + (with-temp-buffer + (insert-file-contents file) + (goto-char (point-min)) + (funcall cperl-test-mode) + (while (search-forward "##" nil t) + ;; The third element of syntax-ppss is true if in a string, + ;; which would indicate bad interpretation of the quote. The + ;; fourth element is true if in a comment, which should be the + ;; case. + (should (equal (nth 3 (syntax-ppss)) nil)) + (should (equal (nth 4 (syntax-ppss)) t)))))) + ;;; cperl-mode-tests.el ends here -- cgit v1.2.3 From 1f6f09c85bb5ec4d450edac910183345f3fdc500 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Mon, 19 Oct 2020 11:34:38 +0200 Subject: Explain difference between Unicode and Emacs scripts * nonascii.texi (Character Properties): Document that Emacs' scripts and Unicode's scripts do not necessarily correspond. --- doc/lispref/nonascii.texi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index 8e9d62429c2..97bc85f152e 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi @@ -722,7 +722,10 @@ The value of this variable is a char-table that specifies, for each character, a symbol whose name is the script to which the character belongs, according to the Unicode Standard classification of the Unicode code space into script-specific blocks. This char-table has a -single extra slot whose value is the list of all script symbols. +single extra slot whose value is the list of all script symbols. Note +that Emacs' classification of characters into scripts is not a 1-for-1 +reflection of the Unicode standard, e.g. there is no @samp{symbol} +script in Unicode. @end defvar @defvar char-width-table -- cgit v1.2.3 From 8cdbd84ebe72091ed02984ce85e9a3c4fbad7c54 Mon Sep 17 00:00:00 2001 From: dickmao Date: Mon, 19 Oct 2020 11:56:36 +0200 Subject: `ffap-gopher-at-point' interminable without newlines * lisp/ffap.el (ffap-gopher-at-point): Stop when we get to the end of the buffer. * test/lisp/ffap-tests.el (ffap-test-no-newlines): Ensure termination for corner case (bug#44048). --- lisp/ffap.el | 3 ++- test/lisp/ffap-tests.el | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index ccba2911445..2c1d3d5bd9d 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1383,7 +1383,8 @@ Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any." (point))) (bookmark (cl-loop for keyval = (ffap--gopher-var-on-line) while keyval collect keyval - do (forward-line 1)))) + do (forward-line 1) + until (eobp)))) (when bookmark (setq ffap-string-at-point-region (list beg (point))) (let-alist (nconc bookmark '((type . "1") (port . "70"))) diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el index e8c12669c1a..ca8c10831fd 100644 --- a/test/lisp/ffap-tests.el +++ b/test/lisp/ffap-tests.el @@ -117,6 +117,12 @@ left alone when opening a URL in an external browser." t "C:\\temp\\program.log on Windows or /var/log/program.log on Unix.") "\\temp\\program.log"))) +(ert-deftest ffap-test-no-newlines () + (should-not + (with-temp-buffer + (save-excursion (insert "type=")) + (ffap-guess-file-name-at-point)))) + (provide 'ffap-tests) ;;; ffap-tests.el ends here -- cgit v1.2.3 From a83e4a929b4637426597e1c34e525a2d7dbf15b0 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 19 Oct 2020 12:12:15 +0200 Subject: Improve Info-streamline-headings defaults * lisp/info.el (Info-streamline-headings): Improve defaults. These produce somewhat more consistent results on my system, and seems slightly more in line with current GNU practices. For example, gcc uses the "Software development" heading instead of "Programming". --- lisp/info.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/info.el b/lisp/info.el index 8ea47d2dbef..3fd8108132f 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1474,9 +1474,10 @@ is non-nil)." (defvar Info-streamline-headings '(("Emacs" . "Emacs") - ("Programming" . "Programming") + ("Software development\\|Programming" . "Software development") ("Libraries" . "Libraries") - ("World Wide Web\\|Net Utilities" . "Net Utilities")) + ("Network applications\\|World Wide Web\\|Net Utilities" + . "Network applications")) "List of elements (RE . NAME) to merge headings matching RE to NAME.") (defun Info-dir-remove-duplicates () -- cgit v1.2.3 From bacebc89afcf2f6c47ad18842e7916af4623b4b2 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 19 Oct 2020 12:18:40 +0200 Subject: * lisp/info.el: Remove redundant :group args. --- lisp/info.el | 74 ++++++++++++++++++++---------------------------------------- 1 file changed, 24 insertions(+), 50 deletions(-) diff --git a/lisp/info.el b/lisp/info.el index 3fd8108132f..c3684deb96b 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -67,7 +67,6 @@ Intermediate Info nodes are nodes visited by Info internally in the process of searching the node to display. Intermediate nodes are not presented to the user." :type 'boolean - :group 'info :version "24.1") (defvar Info-enable-active-nodes nil @@ -79,8 +78,7 @@ The Lisp code is executed when the node is selected.") '((((class color) (background light)) :foreground "brown" :weight bold :slant italic) (((class color) (background dark)) :foreground "white" :weight bold :slant italic) (t :weight bold :slant italic)) - "Face for Info node names." - :group 'info) + "Face for Info node names.") (defface info-title-1 '((((type tty pc) (class color) (background light)) @@ -88,26 +86,22 @@ The Lisp code is executed when the node is selected.") (((type tty pc) (class color) (background dark)) :foreground "yellow" :weight bold) (t :height 1.2 :inherit info-title-2)) - "Face for info titles at level 1." - :group 'info) + "Face for info titles at level 1.") (defface info-title-2 '((((type tty pc) (class color)) :foreground "lightblue" :weight bold) (t :height 1.2 :inherit info-title-3)) - "Face for info titles at level 2." - :group 'info) + "Face for info titles at level 2.") (defface info-title-3 '((((type tty pc) (class color)) :weight bold) (t :height 1.2 :inherit info-title-4)) - "Face for info titles at level 3." - :group 'info) + "Face for info titles at level 3.") (defface info-title-4 '((((type tty pc) (class color)) :weight bold) (t :weight bold :inherit variable-pitch)) - "Face for info titles at level 4." - :group 'info) + "Face for info titles at level 4.") (defface info-menu-header '((((type tty pc)) @@ -116,31 +110,26 @@ The Lisp code is executed when the node is selected.") (t :inherit variable-pitch :weight bold)) - "Face for headers in Info menus." - :group 'info) + "Face for headers in Info menus.") (defface info-menu-star '((((class color)) :foreground "red1") (t :underline t)) - "Face for every third `*' in an Info menu." - :group 'info) + "Face for every third `*' in an Info menu.") (defface info-xref '((t :inherit link)) - "Face for unvisited Info cross-references." - :group 'info) + "Face for unvisited Info cross-references.") (defface info-xref-visited '((t :inherit (link-visited info-xref))) "Face for visited Info cross-references." - :version "22.1" - :group 'info) + :version "22.1") (defcustom Info-fontify-visited-nodes t "Non-nil to fontify references to visited nodes in `info-xref-visited' face." :version "22.1" - :type 'boolean - :group 'info) + :type 'boolean) ;; It's unfortunate that nil means no fontification, as opposed to no limit, ;; since that differs from font-lock-maximum-size. @@ -150,29 +139,24 @@ Set to nil to disable node fontification; set to t for no limit." :type '(choice (const :tag "No fontification" nil) (const :tag "No size limit" t) (integer :tag "Up to this many characters")) - :version "25.1" ; 100k -> 400k - :group 'info) + :version "25.1") ; 100k -> 400k (defcustom Info-use-header-line t "Non-nil means to put the beginning-of-node links in an Emacs header-line. A header-line does not scroll with the rest of the buffer." - :type 'boolean - :group 'info) + :type 'boolean) (defface info-header-xref '((t :inherit info-xref)) - "Face for Info cross-references in a node header." - :group 'info) + "Face for Info cross-references in a node header.") (defface info-header-node '((t :inherit info-node)) - "Face for Info nodes in a node header." - :group 'info) + "Face for Info nodes in a node header.") (defface info-index-match '((t :inherit match)) "Face used to highlight matches in an index entry." - :group 'info :version "24.4") ;; This is a defcustom largely so that we can get the benefit @@ -249,8 +233,7 @@ Although this is a customizable variable, that is mainly for technical reasons. Normally, you should either set INFOPATH or customize `Info-additional-directory-list', rather than changing this variable." :initialize 'custom-initialize-delay - :type '(repeat directory) - :group 'info)) + :type '(repeat directory))) (defvar Info-directory-list nil "List of directories to search for Info documentation files. @@ -285,8 +268,7 @@ a version of Emacs without installing it.") (defcustom Info-additional-directory-list nil "List of additional directories to search for Info documentation files. These directories are searched after those in `Info-directory-list'." - :type '(repeat directory) - :group 'info) + :type '(repeat directory)) (defcustom Info-scroll-prefer-subnodes nil "If non-nil, \\\\[Info-scroll-up] in a menu visits subnodes. @@ -300,8 +282,7 @@ Setting this option to nil results in behavior similar to the stand-alone Info reader program, which visits the first subnode from the menu only when you hit the end of the current node." :version "22.1" - :type 'boolean - :group 'info) + :type 'boolean) (defcustom Info-hide-note-references t "If non-nil, hide the tag and section reference in *note and * menu items. @@ -320,8 +301,7 @@ If this is non-nil, you may wish setting `Info-refill-paragraphs' non-nil." (dolist (buffer (buffer-list)) (with-current-buffer buffer (when (derived-mode-p 'Info-mode) - (revert-buffer t t))))) - :group 'info) + (revert-buffer t t)))))) (defcustom Info-refill-paragraphs nil "If non-nil, attempt to refill paragraphs with hidden references. @@ -329,15 +309,13 @@ This refilling may accidentally remove explicit line breaks in the Info file, so be prepared for a few surprises if you enable this feature. This only has an effect if `Info-hide-note-references' is non-nil." :version "22.1" - :type 'boolean - :group 'info) + :type 'boolean) (defcustom Info-breadcrumbs-depth 4 "Depth of breadcrumbs to display. 0 means do not display breadcrumbs." :version "23.1" - :type 'integer - :group 'info) + :type 'integer) (defcustom Info-search-whitespace-regexp "\\s-+" "If non-nil, regular expression to match a sequence of whitespace chars. @@ -347,8 +325,7 @@ In the Customization buffer, that is `[' followed by a space, a tab, a carriage return (control-M), a newline, and `]+'. Don't add any capturing groups into this value; that can change the numbering of existing capture groups in unexpected ways." - :type 'regexp - :group 'info) + :type 'regexp) (defcustom Info-isearch-search t "If non-nil, isearch in Info searches through multiple nodes. @@ -363,8 +340,7 @@ node depending on search direction. Setting this option to nil restores the default isearch behavior with wrapping around the current Info node." :version "22.1" - :type 'boolean - :group 'info) + :type 'boolean) (defvar Info-isearch-initial-node nil) (defvar Info-isearch-initial-history nil) @@ -375,13 +351,11 @@ with wrapping around the current Info node." (unless (and (boundp 'Info-fontify) (null Info-fontify)) '(turn-on-font-lock)) "Hook run when activating Info Mode." - :type 'hook - :group 'info) + :type 'hook) (defcustom Info-selection-hook nil "Hook run when an Info node is selected as the current node." - :type 'hook - :group 'info) + :type 'hook) (defvar-local Info-current-file nil "Info file that Info is now looking at, or nil. -- cgit v1.2.3 From b16cd3f1e57239887d393129969bdb702feb10d4 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Mon, 19 Oct 2020 12:39:51 +0200 Subject: Hoist some loop-invariant variable bindings in compile.el * lisp/progmodes/compile.el (compilation-parse-errors): Hoist the binding of case-fold-search and a memq call out of the loop, eliminating a minor but unnecessary quadratic term. --- lisp/progmodes/compile.el | 197 +++++++++++++++++++++++----------------------- 1 file changed, 99 insertions(+), 98 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index bc0fe6d63a0..6c819db50da 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1473,105 +1473,106 @@ This updates the appropriate variable used by the mode-line." "Parse errors between START and END. The errors recognized are the ones specified in RULES which default to `compilation-error-regexp-alist' if RULES is nil." - (dolist (item (or rules compilation-error-regexp-alist)) - (if (symbolp item) - (setq item (cdr (assq item - compilation-error-regexp-alist-alist)))) - (let ((case-fold-search compilation-error-case-fold-search) - (file (nth 1 item)) - (line (nth 2 item)) - (col (nth 3 item)) - (type (nth 4 item)) - (pat (car item)) - end-line end-col fmt - props) - - ;; omake reports some error indented, so skip the indentation. - ;; another solution is to modify (some?) regexps in - ;; `compilation-error-regexp-alist'. - ;; note that omake usage is not limited to ocaml and C (for stubs). - ;; FIXME-omake: Doing it here seems wrong, at least it should depend on - ;; whether or not omake's own error messages are recognized. - (cond - ((not (memq 'omake compilation-error-regexp-alist)) nil) - ((string-match "\\`\\([^^]\\|\\^\\( \\*\\|\\[\\)\\)" pat) - nil) ;; Not anchored or anchored but already allows empty spaces. - (t (setq pat (concat "^\\(?: \\)?" (substring pat 1))))) - - (if (and (consp file) (not (functionp file))) - (setq fmt (cdr file) - file (car file))) - (if (and (consp line) (not (functionp line))) - (setq end-line (cdr line) - line (car line))) - (if (and (consp col) (not (functionp col))) - (setq end-col (cdr col) - col (car col))) - - (unless (or (null (nth 5 item)) (integerp (nth 5 item))) - (error "HYPERLINK should be an integer: %s" (nth 5 item))) - - (goto-char start) - (while (re-search-forward pat end t) - (when (setq props (compilation-error-properties - file line end-line col end-col (or type 2) fmt)) - - (when (integerp file) - (let ((this-type (if (consp type) - (compilation-type type) - (or type 2)))) - (compilation--note-type this-type) - - (compilation--put-prop - file 'font-lock-face - (symbol-value (aref [compilation-info-face - compilation-warning-face - compilation-error-face] - this-type))))) - - (compilation--put-prop - line 'font-lock-face compilation-line-face) - (compilation--put-prop - end-line 'font-lock-face compilation-line-face) - - (compilation--put-prop - col 'font-lock-face compilation-column-face) - (compilation--put-prop - end-col 'font-lock-face compilation-column-face) - - ;; Obey HIGHLIGHT. - (dolist (extra-item (nthcdr 6 item)) - (let ((mn (pop extra-item))) - (when (match-beginning mn) - (let ((face (eval (car extra-item)))) - (cond - ((null face)) - ((or (symbolp face) (stringp face)) - (put-text-property - (match-beginning mn) (match-end mn) - 'font-lock-face face)) - ((and (listp face) - (eq (car face) 'face) - (or (symbolp (cadr face)) - (stringp (cadr face)))) - (compilation--put-prop mn 'font-lock-face (cadr face)) - (add-text-properties - (match-beginning mn) (match-end mn) - (nthcdr 2 face))) - (t - (error "Don't know how to handle face %S" - face))))))) - (let ((mn (or (nth 5 item) 0))) - (when compilation-debug + (let ((case-fold-search compilation-error-case-fold-search) + (omake-included (memq 'omake compilation-error-regexp-alist))) + (dolist (item (or rules compilation-error-regexp-alist)) + (if (symbolp item) + (setq item (cdr (assq item + compilation-error-regexp-alist-alist)))) + (let ((file (nth 1 item)) + (line (nth 2 item)) + (col (nth 3 item)) + (type (nth 4 item)) + (pat (car item)) + end-line end-col fmt + props) + + ;; omake reports some error indented, so skip the indentation. + ;; another solution is to modify (some?) regexps in + ;; `compilation-error-regexp-alist'. + ;; note that omake usage is not limited to ocaml and C (for stubs). + ;; FIXME-omake: Doing it here seems wrong, at least it should depend on + ;; whether or not omake's own error messages are recognized. + (cond + ((not omake-included) nil) + ((string-match "\\`\\([^^]\\|\\^\\( \\*\\|\\[\\)\\)" pat) + nil) ;; Not anchored or anchored but already allows empty spaces. + (t (setq pat (concat "^\\(?: \\)?" (substring pat 1))))) + + (if (and (consp file) (not (functionp file))) + (setq fmt (cdr file) + file (car file))) + (if (and (consp line) (not (functionp line))) + (setq end-line (cdr line) + line (car line))) + (if (and (consp col) (not (functionp col))) + (setq end-col (cdr col) + col (car col))) + + (unless (or (null (nth 5 item)) (integerp (nth 5 item))) + (error "HYPERLINK should be an integer: %s" (nth 5 item))) + + (goto-char start) + (while (re-search-forward pat end t) + (when (setq props (compilation-error-properties + file line end-line col end-col (or type 2) fmt)) + + (when (integerp file) + (let ((this-type (if (consp type) + (compilation-type type) + (or type 2)))) + (compilation--note-type this-type) + + (compilation--put-prop + file 'font-lock-face + (symbol-value (aref [compilation-info-face + compilation-warning-face + compilation-error-face] + this-type))))) + + (compilation--put-prop + line 'font-lock-face compilation-line-face) + (compilation--put-prop + end-line 'font-lock-face compilation-line-face) + + (compilation--put-prop + col 'font-lock-face compilation-column-face) + (compilation--put-prop + end-col 'font-lock-face compilation-column-face) + + ;; Obey HIGHLIGHT. + (dolist (extra-item (nthcdr 6 item)) + (let ((mn (pop extra-item))) + (when (match-beginning mn) + (let ((face (eval (car extra-item)))) + (cond + ((null face)) + ((or (symbolp face) (stringp face)) + (put-text-property + (match-beginning mn) (match-end mn) + 'font-lock-face face)) + ((and (listp face) + (eq (car face) 'face) + (or (symbolp (cadr face)) + (stringp (cadr face)))) + (compilation--put-prop mn 'font-lock-face (cadr face)) + (add-text-properties + (match-beginning mn) (match-end mn) + (nthcdr 2 face))) + (t + (error "Don't know how to handle face %S" + face))))))) + (let ((mn (or (nth 5 item) 0))) + (when compilation-debug + (font-lock-append-text-property + (match-beginning 0) (match-end 0) + 'compilation-debug (vector 'std item props))) + (add-text-properties + (match-beginning mn) (match-end mn) + (cddr props)) (font-lock-append-text-property - (match-beginning 0) (match-end 0) - 'compilation-debug (vector 'std item props))) - (add-text-properties - (match-beginning mn) (match-end mn) - (cddr props)) - (font-lock-append-text-property - (match-beginning mn) (match-end mn) - 'font-lock-face (cadr props)))))))) + (match-beginning mn) (match-end mn) + 'font-lock-face (cadr props))))))))) (defvar compilation--parsed -1) (make-variable-buffer-local 'compilation--parsed) -- cgit v1.2.3 From 653eab4788010b2c070dadea652a99e89c0ad3ac Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Mon, 19 Oct 2020 12:14:37 +0200 Subject: Keep track of matching rules in compilation-mode When matching messages in compilation-mode, keep track of the rule employed for each match. This facilitates debugging and allows us to verify that each test case really exercises the rule that we expect it to. Naturally this uncovered several test cases that didn't check what the author thought they did; the rules affixed to compile-tests--test-regexps-data are those actually used, so that the tests still pass. * lisp/progmodes/compile.el (compilation--message): Add 'rule' slot. (compilation-directory-properties, compilation-error-properties) (compilation-internal-error-properties, compilation-parse-errors) (compilation--compat-parse-errors): Set the rule slot. * test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data) (compile-tests--grep-regexp-testcases) (compile-tests--grep-regexp-tricky-testcases): Add rules to test cases. (compile--test-error-line): Check that the rule matches what we expect. (compile-test-grep-regexps): Adapt to test case format. Remove now superfluous ert-info. --- lisp/progmodes/compile.el | 46 ++-- test/lisp/progmodes/compile-tests.el | 453 +++++++++++++++++++---------------- 2 files changed, 277 insertions(+), 222 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 6c819db50da..9188a08e780 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1063,9 +1063,9 @@ from a different message." (:constructor nil) (:copier nil) ;; (:type list) ;Old representation. - (:constructor compilation--make-message (loc type end-loc)) + (:constructor compilation--make-message (loc type end-loc rule)) (:conc-name compilation--message->)) - loc type end-loc) + loc type end-loc rule) (defvar compilation--previous-directory-cache nil "A pair (POS . RES) caching the result of previous directory search. @@ -1138,7 +1138,7 @@ POS and RES.") (cons (match-string-no-properties idx) dir)) ;; Place a `compilation-message' everywhere we change text-properties ;; so compilation--remove-properties can know what to remove. - compilation-message ,(compilation--make-message nil 0 nil) + compilation-message ,(compilation--make-message nil 0 nil nil) mouse-face highlight keymap compilation-button-map help-echo "mouse-2: visit destination directory"))) @@ -1177,7 +1177,8 @@ POS and RES.") ;; all information needed to later jump to corresponding source code. ;; Return a property list with all meta information on this error location. -(defun compilation-error-properties (file line end-line col end-col type fmt) +(defun compilation-error-properties (file line end-line col end-col type fmt + rule) (unless (text-property-not-all (match-beginning 0) (point) 'compilation-message nil) (if file @@ -1265,7 +1266,7 @@ POS and RES.") (current-buffer) (match-beginning 0))) (compilation-internal-error-properties - file line end-line col end-col type fmt)))) + file line end-line col end-col type fmt rule)))) (defun compilation-beginning-of-line (&optional n) "Like `beginning-of-line', but accounts for lines hidden by `selective-display'." @@ -1288,13 +1289,15 @@ just char-counts." (let ((tab-width 8)) (move-to-column (max col 0))) (goto-char (min (+ (line-beginning-position) col) (line-end-position))))) -(defun compilation-internal-error-properties (file line end-line col end-col type fmts) +(defun compilation-internal-error-properties (file line end-line col end-col + type fmts rule) "Get the meta-info that will be added as text-properties. LINE, END-LINE, COL, END-COL are integers or nil. TYPE can be 0, 1, or 2, meaning error, warning, or just info. FILE should be (FILENAME) or (RELATIVE-FILENAME . DIRNAME) or (BUFFER) or nil. FMTS is a list of format specs for transforming the file name. +RULE is the name (symbol) of the rule used or nil if anonymous. (See `compilation-error-regexp-alist'.)" (unless file (setq file '("*unknown*"))) (let* ((file-struct (compilation-get-file-structure file fmts)) @@ -1381,7 +1384,7 @@ FMTS is a list of format specs for transforming the file name. ;; Must start with face `(font-lock-face ,compilation-message-face - compilation-message ,(compilation--make-message loc type end-loc) + compilation-message ,(compilation--make-message loc type end-loc rule) help-echo ,(if col "mouse-2: visit this file, line and column" (if line @@ -1475,17 +1478,19 @@ The errors recognized are the ones specified in RULES which default to `compilation-error-regexp-alist' if RULES is nil." (let ((case-fold-search compilation-error-case-fold-search) (omake-included (memq 'omake compilation-error-regexp-alist))) - (dolist (item (or rules compilation-error-regexp-alist)) - (if (symbolp item) - (setq item (cdr (assq item - compilation-error-regexp-alist-alist)))) - (let ((file (nth 1 item)) - (line (nth 2 item)) - (col (nth 3 item)) - (type (nth 4 item)) - (pat (car item)) - end-line end-col fmt - props) + (dolist (rule-item (or rules compilation-error-regexp-alist)) + (let* ((item + (if (symbolp rule-item) + (cdr (assq rule-item compilation-error-regexp-alist-alist)) + rule-item)) + (pat (car item)) + (file (nth 1 item)) + (line (nth 2 item)) + (col (nth 3 item)) + (type (nth 4 item)) + (rule (and (symbolp rule-item) rule-item)) + end-line end-col fmt + props) ;; omake reports some error indented, so skip the indentation. ;; another solution is to modify (some?) regexps in @@ -1515,7 +1520,8 @@ to `compilation-error-regexp-alist' if RULES is nil." (goto-char start) (while (re-search-forward pat end t) (when (setq props (compilation-error-properties - file line end-line col end-col (or type 2) fmt)) + file line end-line col end-col + (or type 2) fmt rule)) (when (integerp file) (let ((this-type (if (consp type) @@ -3114,7 +3120,7 @@ TRUE-DIRNAME is the `file-truename' of DIRNAME, if given." ;; 'font-lock-face 'font-lock-warning-face) (put-text-property src (line-end-position) 'compilation-message - (compilation--make-message loc 2 nil))))))) + (compilation--make-message loc 2 nil nil))))))) (goto-char limit) nil) diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el index 45eebac0367..b8ed6e0e76b 100644 --- a/test/lisp/progmodes/compile-tests.el +++ b/test/lisp/progmodes/compile-tests.el @@ -35,319 +35,358 @@ ;; what's reported in the string. The end column numbers are for ;; the character after, so it matches what's reported in the string. '(;; absoft - ("Error on line 3 of t.f: Execution error unclassifiable statement" + (absoft + "Error on line 3 of t.f: Execution error unclassifiable statement" 1 nil 3 "t.f") - ("Line 45 of \"foo.c\": bloofle undefined" + (absoft "Line 45 of \"foo.c\": bloofle undefined" 1 nil 45 "foo.c") - ("error on line 19 of fplot.f: spelling error?" + (absoft "error on line 19 of fplot.f: spelling error?" 1 nil 19 "fplot.f") - ("warning on line 17 of fplot.f: data type is undefined for variable d" + (absoft + "warning on line 17 of fplot.f: data type is undefined for variable d" 1 nil 17 "fplot.f") ;; Ada & Mpatrol - ("foo.adb:61:11: [...] in call to size declared at foo.ads:11" + (gnu "foo.adb:61:11: [...] in call to size declared at foo.ads:11" 1 11 61 "foo.adb") - ("foo.adb:61:11: [...] in call to size declared at foo.ads:11" + (ada "foo.adb:61:11: [...] in call to size declared at foo.ads:11" 52 nil 11 "foo.ads") - (" 0x8008621 main+16 at error.c:17" + (ada " 0x8008621 main+16 at error.c:17" 23 nil 17 "error.c") ;; aix - ("****** Error number 140 in line 8 of file errors.c ******" + (aix "****** Error number 140 in line 8 of file errors.c ******" 25 nil 8 "errors.c") ;; ant - ("[javac] /src/DataBaseTestCase.java:27: unreported exception ..." + (ant "[javac] /src/DataBaseTestCase.java:27: unreported exception ..." 13 nil 27 "/src/DataBaseTestCase.java" 2) - ("[javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally" + (ant "[javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally" 13 nil 49 "/src/DataBaseTestCase.java" 1) - ("[jikes] foo.java:3:5:7:9: blah blah" + (ant "[jikes] foo.java:3:5:7:9: blah blah" 14 (5 . 10) (3 . 7) "foo.java" 2) - ("[javac] c:/cygwin/Test.java:12: error: foo: bar" + (ant "[javac] c:/cygwin/Test.java:12: error: foo: bar" 9 nil 12 "c:/cygwin/Test.java" 2) - ("[javac] c:\\cygwin\\Test.java:87: error: foo: bar" + (ant "[javac] c:\\cygwin\\Test.java:87: error: foo: bar" 9 nil 87 "c:\\cygwin\\Test.java" 2) ;; Checkstyle error, but ant reports a warning (note additional ;; severity level after task name) - ("[checkstyle] [ERROR] /src/Test.java:38: warning: foo" + (ant "[checkstyle] [ERROR] /src/Test.java:38: warning: foo" 22 nil 38 "/src/Test.java" 1) ;; bash - ("a.sh: line 1: ls-l: command not found" + (bash "a.sh: line 1: ls-l: command not found" 1 nil 1 "a.sh") ;; borland - ("Error ping.c 15: Unable to open include file 'sys/types.h'" + (borland "Error ping.c 15: Unable to open include file 'sys/types.h'" 1 nil 15 "ping.c") - ("Warning pong.c 68: Call to function 'func' with no prototype" + (borland "Warning pong.c 68: Call to function 'func' with no prototype" 1 nil 68 "pong.c") - ("Error E2010 ping.c 15: Unable to open include file 'sys/types.h'" + (borland "Error E2010 ping.c 15: Unable to open include file 'sys/types.h'" 1 nil 15 "ping.c") - ("Warning W1022 pong.c 68: Call to function 'func' with no prototype" + (borland + "Warning W1022 pong.c 68: Call to function 'func' with no prototype" 1 nil 68 "pong.c") ;; caml - ("File \"foobar.ml\", lines 5-8, characters 20-155: blah blah" + (python-tracebacks-and-caml + "File \"foobar.ml\", lines 5-8, characters 20-155: blah blah" 1 (20 . 156) (5 . 8) "foobar.ml") - ("File \"F:\\ocaml\\sorting.ml\", line 65, characters 2-145:\nWarning 26: unused variable equ." + (python-tracebacks-and-caml + "File \"F:\\ocaml\\sorting.ml\", line 65, characters 2-145:\nWarning 26: unused variable equ." 1 (2 . 146) 65 "F:\\ocaml\\sorting.ml") - ("File \"/usr/share/gdesklets/display/TargetGauge.py\", line 41, in add_children" + (python-tracebacks-and-caml + "File \"/usr/share/gdesklets/display/TargetGauge.py\", line 41, in add_children" 1 nil 41 "/usr/share/gdesklets/display/TargetGauge.py") - ("File \\lib\\python\\Products\\PythonScripts\\PythonScript.py, line 302, in _exec" + (python-tracebacks-and-caml + "File \\lib\\python\\Products\\PythonScripts\\PythonScript.py, line 302, in _exec" 1 nil 302 "\\lib\\python\\Products\\PythonScripts\\PythonScript.py") - ("File \"/tmp/foo.py\", line 10" + (python-tracebacks-and-caml + "File \"/tmp/foo.py\", line 10" 1 nil 10 "/tmp/foo.py") ;; clang-include - ("In file included from foo.cpp:2:" + (clang-include "In file included from foo.cpp:2:" 1 nil 2 "foo.cpp" 0) ;; cmake cmake-info - ("CMake Error at CMakeLists.txt:23 (hurz):" + (cmake "CMake Error at CMakeLists.txt:23 (hurz):" 1 nil 23 "CMakeLists.txt") - ("CMake Warning at cmake/modules/UseUG.cmake:73 (find_package):" + (cmake "CMake Warning at cmake/modules/UseUG.cmake:73 (find_package):" 1 nil 73 "cmake/modules/UseUG.cmake") - (" cmake/modules/DuneGridMacros.cmake:19 (include)" + (cmake-info " cmake/modules/DuneGridMacros.cmake:19 (include)" 1 nil 19 "cmake/modules/DuneGridMacros.cmake") ;; comma - ("\"foo.f\", line 3: Error: syntax error near end of statement" + (comma "\"foo.f\", line 3: Error: syntax error near end of statement" 1 nil 3 "foo.f") - ("\"vvouch.c\", line 19.5: 1506-046 (S) Syntax error." + (comma "\"vvouch.c\", line 19.5: 1506-046 (S) Syntax error." 1 5 19 "vvouch.c") - ("\"foo.c\", line 32 pos 1; (E) syntax error; unexpected symbol: \"lossage\"" + (comma "\"foo.c\", line 32 pos 1; (E) syntax error; unexpected symbol: \"lossage\"" 1 1 32 "foo.c") - ("\"foo.adb\", line 2(11): warning: file name does not match ..." + (comma "\"foo.adb\", line 2(11): warning: file name does not match ..." 1 11 2 "foo.adb") - ("\"src/swapping.c\", line 30.34: 1506-342 (W) \"/*\" detected in comment." + (comma + "\"src/swapping.c\", line 30.34: 1506-342 (W) \"/*\" detected in comment." 1 34 30 "src/swapping.c") ;; cucumber - ("Scenario: undefined step # features/cucumber.feature:3" + (cucumber "Scenario: undefined step # features/cucumber.feature:3" 29 nil 3 "features/cucumber.feature") - (" /home/gusev/.rvm/foo/bar.rb:500:in `_wrap_assertion'" + (gnu " /home/gusev/.rvm/foo/bar.rb:500:in `_wrap_assertion'" 1 nil 500 "/home/gusev/.rvm/foo/bar.rb") ;; edg-1 edg-2 - ("build/intel/debug/../../../struct.cpp(42): error: identifier \"foo\" is undefined" + (edg-1 "build/intel/debug/../../../struct.cpp(42): error: identifier \"foo\" is undefined" 1 nil 42 "build/intel/debug/../../../struct.cpp") - ("build/intel/debug/struct.cpp(44): warning #1011: missing return statement at end of" + (edg-1 "build/intel/debug/struct.cpp(44): warning #1011: missing return statement at end of" 1 nil 44 "build/intel/debug/struct.cpp") - ("build/intel/debug/iptr.h(302): remark #981: operands are evaluated in unspecified order" + (edg-1 "build/intel/debug/iptr.h(302): remark #981: operands are evaluated in unspecified order" 1 nil 302 "build/intel/debug/iptr.h") - (" detected during ... at line 62 of \"build/intel/debug/../../../trace.h\"" + (edg-2 " detected during ... at line 62 of \"build/intel/debug/../../../trace.h\"" 31 nil 62 "build/intel/debug/../../../trace.h") ;; epc - ("Error 24 at (2:progran.f90) : syntax error" + (epc "Error 24 at (2:progran.f90) : syntax error" 1 nil 2 "progran.f90") ;; ftnchek - (" Dummy arg W in module SUBA line 8 file arrayclash.f is array" + (ftnchek " Dummy arg W in module SUBA line 8 file arrayclash.f is array" 32 nil 8 "arrayclash.f") - (" L4 used at line 55 file test/assign.f; never set" + (ftnchek " L4 used at line 55 file test/assign.f; never set" 16 nil 55 "test/assign.f") - ("Warning near line 10 file arrayclash.f: Module contains no executable" + (ftnchek + "Warning near line 10 file arrayclash.f: Module contains no executable" 1 nil 10 "arrayclash.f") - ("Nonportable usage near line 31 col 9 file assign.f: mixed default and explicit" + (ftnchek "Nonportable usage near line 31 col 9 file assign.f: mixed default and explicit" 24 9 31 "assign.f") ;; iar - ("\"foo.c\",3 Error[32]: Error message" + (iar "\"foo.c\",3 Error[32]: Error message" 1 nil 3 "foo.c") - ("\"foo.c\",3 Warning[32]: Error message" + (iar "\"foo.c\",3 Warning[32]: Error message" 1 nil 3 "foo.c") ;; ibm - ("foo.c(2:0) : informational EDC0804: Function foo is not referenced." + (ibm "foo.c(2:0) : informational EDC0804: Function foo is not referenced." 1 0 2 "foo.c") - ("foo.c(3:8) : warning EDC0833: Implicit return statement encountered." + (ibm "foo.c(3:8) : warning EDC0833: Implicit return statement encountered." 1 8 3 "foo.c") - ("foo.c(5:5) : error EDC0350: Syntax error." + (ibm "foo.c(5:5) : error EDC0350: Syntax error." 1 5 5 "foo.c") ;; irix - ("ccom: Error: foo.c, line 2: syntax error" + (irix "ccom: Error: foo.c, line 2: syntax error" 1 nil 2 "foo.c") - ("cc: Severe: /src/Python-2.3.3/Modules/_curses_panel.c, line 17: Cannot find file ..." + (irix "cc: Severe: /src/Python-2.3.3/Modules/_curses_panel.c, line 17: Cannot find file ..." 1 nil 17 "/src/Python-2.3.3/Modules/_curses_panel.c") - ("cc: Info: foo.c, line 27: ..." + (irix "cc: Info: foo.c, line 27: ..." 1 nil 27 "foo.c") - ("cfe: Warning 712: foo.c, line 2: illegal combination of pointer and ..." + (irix + "cfe: Warning 712: foo.c, line 2: illegal combination of pointer and ..." 1 nil 2 "foo.c") - ("cfe: Warning 600: xfe.c: 170: Not in a conditional directive while ..." + (irix + "cfe: Warning 600: xfe.c: 170: Not in a conditional directive while ..." 1 nil 170 "xfe.c") - ("/usr/lib/cmplrs/cc/cfe: Error: foo.c: 1: blah blah" + (irix "/usr/lib/cmplrs/cc/cfe: Error: foo.c: 1: blah blah" 1 nil 1 "foo.c") - ("/usr/lib/cmplrs/cc/cfe: warning: foo.c: 1: blah blah" + (irix "/usr/lib/cmplrs/cc/cfe: warning: foo.c: 1: blah blah" 1 nil 1 "foo.c") - ("foo bar: baz.f, line 27: ..." + (irix "foo bar: baz.f, line 27: ..." 1 nil 27 "baz.f") ;; java - ("\tat org.foo.ComponentGateway.doGet(ComponentGateway.java:172)" + (java "\tat org.foo.ComponentGateway.doGet(ComponentGateway.java:172)" 5 nil 172 "ComponentGateway.java") - ("\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:740)" + (java "\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:740)" 5 nil 740 "HttpServlet.java") - ("==1332== at 0x4040743C: System::getErrorString() (../src/Lib/System.cpp:217)" + (java "==1332== at 0x4040743C: System::getErrorString() (../src/Lib/System.cpp:217)" 13 nil 217 "../src/Lib/System.cpp") - ("==1332== by 0x8008621: main (vtest.c:180)" + (java "==1332== by 0x8008621: main (vtest.c:180)" 13 nil 180 "vtest.c") ;; javac - ("/src/Test.java:5: ';' expected\n foo foo\n ^\n" 1 15 5 "/src/Test.java" 2) - ("e:\\src\\Test.java:7: warning: ';' expected\n foo foo\n ^\n" 1 10 7 "e:\\src\\Test.java" 1) + (javac + "/src/Test.java:5: ';' expected\n foo foo\n ^\n" + 1 15 5 "/src/Test.java" 2) + (javac + "e:\\src\\Test.java:7: warning: ';' expected\n foo foo\n ^\n" + 1 10 7 "e:\\src\\Test.java" 1) ;; jikes-file jikes-line - ("Found 2 semantic errors compiling \"../javax/swing/BorderFactory.java\":" + (jikes-file + "Found 2 semantic errors compiling \"../javax/swing/BorderFactory.java\":" 1 nil nil "../javax/swing/BorderFactory.java") - ("Issued 1 semantic warning compiling \"java/awt/Toolkit.java\":" + (jikes-file "Issued 1 semantic warning compiling \"java/awt/Toolkit.java\":" 1 nil nil "java/awt/Toolkit.java") ;; gcc-include - ("In file included from /usr/include/c++/3.3/backward/warn.h:4," + (gcc-include "In file included from /usr/include/c++/3.3/backward/warn.h:4," 1 nil 4 "/usr/include/c++/3.3/backward/warn.h") - (" from /usr/include/c++/3.3/backward/iostream.h:31:0," + (gcc-include + " from /usr/include/c++/3.3/backward/iostream.h:31:0," 1 0 31 "/usr/include/c++/3.3/backward/iostream.h") - (" from test_clt.cc:1:" + (gcc-include " from test_clt.cc:1:" 1 nil 1 "test_clt.cc") ;; gmake - ("make: *** [Makefile:20: all] Error 2" 12 nil 20 "Makefile" 0) - ("make[4]: *** [sub/make.mk:19: all] Error 127" 15 nil 19 "sub/make.mk" 0) - ("gmake[4]: *** [sub/make.mk:19: all] Error 2" 16 nil 19 "sub/make.mk" 0) - ("gmake-4.3[4]: *** [make.mk:1119: all] Error 2" 20 nil 1119 "make.mk" 0) - ("Make-4.3: *** [make.INC:1119: dir/all] Error 2" 16 nil 1119 "make.INC" 0) + (gmake "make: *** [Makefile:20: all] Error 2" 12 nil 20 "Makefile" 0) + (gmake "make[4]: *** [sub/make.mk:19: all] Error 127" 15 nil 19 + "sub/make.mk" 0) + (gmake "gmake[4]: *** [sub/make.mk:19: all] Error 2" 16 nil 19 + "sub/make.mk" 0) + (gmake "gmake-4.3[4]: *** [make.mk:1119: all] Error 2" 20 nil 1119 + "make.mk" 0) + (gmake "Make-4.3: *** [make.INC:1119: dir/all] Error 2" 16 nil 1119 + "make.INC" 0) ;; gnu - ("foo.c:8: message" 1 nil 8 "foo.c") - ("../foo.c:8: W: message" 1 nil 8 "../foo.c") - ("/tmp/foo.c:8:warning message" 1 nil 8 "/tmp/foo.c") - ("foo/bar.py:8: FutureWarning message" 1 nil 8 "foo/bar.py") - ("foo.py:8: RuntimeWarning message" 1 nil 8 "foo.py") - ("foo.c:8:I: message" 1 nil 8 "foo.c") - ("foo.c:8.23: note: message" 1 23 8 "foo.c") - ("foo.c:8.23: info: message" 1 23 8 "foo.c") - ("foo.c:8:23:information: message" 1 23 8 "foo.c") - ("foo.c:8.23-45: Informational: message" 1 (23 . 46) (8 . nil) "foo.c") - ("foo.c:8-23: message" 1 nil (8 . 23) "foo.c") + (gnu "foo.c:8: message" 1 nil 8 "foo.c") + (gnu "../foo.c:8: W: message" 1 nil 8 "../foo.c") + (gnu "/tmp/foo.c:8:warning message" 1 nil 8 "/tmp/foo.c") + (gnu "foo/bar.py:8: FutureWarning message" 1 nil 8 "foo/bar.py") + (gnu "foo.py:8: RuntimeWarning message" 1 nil 8 "foo.py") + (gnu "foo.c:8:I: message" 1 nil 8 "foo.c") + (gnu "foo.c:8.23: note: message" 1 23 8 "foo.c") + (gnu "foo.c:8.23: info: message" 1 23 8 "foo.c") + (gnu "foo.c:8:23:information: message" 1 23 8 "foo.c") + (gnu "foo.c:8.23-45: Informational: message" 1 (23 . 46) (8 . nil) "foo.c") + (gnu "foo.c:8-23: message" 1 nil (8 . 23) "foo.c") ;; The next one is not in the GNU standards AFAICS. ;; Here we seem to interpret it as LINE1-LINE2.COL2. - ("foo.c:8-45.3: message" 1 (nil . 4) (8 . 45) "foo.c") - ("foo.c:8.23-9.1: message" 1 (23 . 2) (8 . 9) "foo.c") - ("jade:dbcommon.dsl:133:17:E: missing argument for function call" + (gnu "foo.c:8-45.3: message" 1 (nil . 4) (8 . 45) "foo.c") + (gnu "foo.c:8.23-9.1: message" 1 (23 . 2) (8 . 9) "foo.c") + (gnu "jade:dbcommon.dsl:133:17:E: missing argument for function call" 1 17 133 "dbcommon.dsl") - ("G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." + (gnu "G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." 1 nil 54 "G:/cygwin/dev/build-myproj.xml") - ("file:G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." + (gnu "file:G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." 1 nil 54 "G:/cygwin/dev/build-myproj.xml") - ("{standard input}:27041: Warning: end of file not at end of a line; newline inserted" + (gnu "{standard input}:27041: Warning: end of file not at end of a line; newline inserted" 1 nil 27041 "{standard input}") - ("boost/container/detail/flat_tree.hpp:589:25: [ skipping 5 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]" + (gnu "boost/container/detail/flat_tree.hpp:589:25: [ skipping 5 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]" 1 25 589 "boost/container/detail/flat_tree.hpp" 0) ;; gradle-kotlin - ("e: /src/Test.kt: (34, 15): foo: bar" 4 15 34 "/src/Test.kt" 2) - ("w: /src/Test.kt: (11, 98): foo: bar" 4 98 11 "/src/Test.kt" 1) - ("e: e:/cygwin/src/Test.kt: (34, 15): foo: bar" 4 15 34 "e:/cygwin/src/Test.kt" 2) - ("w: e:/cygwin/src/Test.kt: (11, 98): foo: bar" 4 98 11 "e:/cygwin/src/Test.kt" 1) - ("e: e:\\src\\Test.kt: (34, 15): foo: bar" 4 15 34 "e:\\src\\Test.kt" 2) - ("w: e:\\src\\Test.kt: (11, 98): foo: bar" 4 98 11 "e:\\src\\Test.kt" 1) + (gradle-kotlin + "e: /src/Test.kt: (34, 15): foo: bar" 4 15 34 "/src/Test.kt" 2) + (gradle-kotlin + "w: /src/Test.kt: (11, 98): foo: bar" 4 98 11 "/src/Test.kt" 1) + (gradle-kotlin + "e: e:/cygwin/src/Test.kt: (34, 15): foo: bar" + 4 15 34 "e:/cygwin/src/Test.kt" 2) + (gradle-kotlin + "w: e:/cygwin/src/Test.kt: (11, 98): foo: bar" + 4 98 11 "e:/cygwin/src/Test.kt" 1) + (gradle-kotlin + "e: e:\\src\\Test.kt: (34, 15): foo: bar" 4 15 34 "e:\\src\\Test.kt" 2) + (gradle-kotlin + "w: e:\\src\\Test.kt: (11, 98): foo: bar" 4 98 11 "e:\\src\\Test.kt" 1) ;; Guile - ("In foo.scm:\n" 1 nil nil "foo.scm") - (" 63:4 [call-with-prompt prompt0 ...]" 1 4 63 nil) - ("1038: 1 [main (\"gud-break.scm\")]" 1 1 1038 nil) + (guile-file "In foo.scm:\n" 1 nil nil "foo.scm") + (guile-line " 63:4 [call-with-prompt prompt0 ...]" 1 4 63 nil) + (guile-line "1038: 1 [main (\"gud-break.scm\")]" 1 1 1038 nil) ;; lcc - ("E, file.cc(35,52) Illegal operation on pointers" 1 52 35 "file.cc") - ("W, file.cc(36,52) blah blah" 1 52 36 "file.cc") + (lcc "E, file.cc(35,52) Illegal operation on pointers" 1 52 35 "file.cc") + (lcc "W, file.cc(36,52) blah blah" 1 52 36 "file.cc") ;; makepp - ("makepp: Scanning `/foo/bar.c'" 19 nil nil "/foo/bar.c") - ("makepp: warning: bla bla `/foo/bar.c' and `/foo/bar.h'" 27 nil nil "/foo/bar.c") - ("makepp: bla bla `/foo/Makeppfile:12' bla" 18 nil 12 "/foo/Makeppfile") - ("makepp: bla bla `/foo/bar.c' and `/foo/bar.h'" 35 nil nil "/foo/bar.h") + (makepp "makepp: Scanning `/foo/bar.c'" 19 nil nil "/foo/bar.c") + (makepp "makepp: warning: bla bla `/foo/bar.c' and `/foo/bar.h'" + 27 nil nil "/foo/bar.c") + (makepp "makepp: bla bla `/foo/Makeppfile:12' bla" + 18 nil 12 "/foo/Makeppfile") + (nil "makepp: bla bla `/foo/bar.c' and `/foo/bar.h'" + 35 nil nil "/foo/bar.h") ;; maven - ("FooBar.java:[111,53] no interface expected here" + (maven "FooBar.java:[111,53] no interface expected here" 1 53 111 "FooBar.java" 2) - ("[ERROR] /Users/cinsk/hello.java:[651,96] ';' expected" + (maven "[ERROR] /Users/cinsk/hello.java:[651,96] ';' expected" 15 96 651 "/Users/cinsk/hello.java" 2) ;Bug#11517. - ("[WARNING] /foo/bar/Test.java:[27,43] unchecked conversion" + (maven "[WARNING] /foo/bar/Test.java:[27,43] unchecked conversion" 11 43 27 "/foo/bar/Test.java" 1) ;Bug#20556 ;; mips-1 mips-2 - ("TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation" + (mips-1 "TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation" 11 nil 255 "solomon.c") - ("TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation" + (mips-1 "TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation" 70 nil 93 "solomo.c") - ("name defined but never used: LinInt in cmap_calc.c(199)" + (mips-2 "name defined but never used: LinInt in cmap_calc.c(199)" 40 nil 199 "cmap_calc.c") ;; msft - ("keyboard handler.c(537) : warning C4005: 'min' : macro redefinition" + (msft "keyboard handler.c(537) : warning C4005: 'min' : macro redefinition" 1 nil 537 "keyboard handler.c") - ("d:\\tmp\\test.c(23) : error C2143: syntax error : missing ';' before 'if'" + (msft + "d:\\tmp\\test.c(23) : error C2143: syntax error : missing ';' before 'if'" 1 nil 23 "d:\\tmp\\test.c") - ("d:\\tmp\\test.c(1145) : see declaration of 'nsRefPtr'" + (msft "d:\\tmp\\test.c(1145) : see declaration of 'nsRefPtr'" 1 nil 1145 "d:\\tmp\\test.c") - ("1>test_main.cpp(29): error C2144: syntax error : 'int' should be preceded by ';'" + (msft "1>test_main.cpp(29): error C2144: syntax error : 'int' should be preceded by ';'" 3 nil 29 "test_main.cpp") - ("1>test_main.cpp(29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int" + (msft "1>test_main.cpp(29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int" 3 nil 29 "test_main.cpp") - ("C:\\tmp\\test.cpp(101,11): error C4101: 'bias0123': unreferenced local variable [C:\\tmp\\project.vcxproj]" + (msft "C:\\tmp\\test.cpp(101,11): error C4101: 'bias0123': unreferenced local variable [C:\\tmp\\project.vcxproj]" 1 11 101 "C:\\tmp\\test.cpp") ;; watcom - ("..\\src\\ctrl\\lister.c(109): Error! E1009: Expecting ';' but found '{'" + (watcom + "..\\src\\ctrl\\lister.c(109): Error! E1009: Expecting ';' but found '{'" 1 nil 109 "..\\src\\ctrl\\lister.c") - ("..\\src\\ctrl\\lister.c(120): Warning! W201: Unreachable code" + (watcom "..\\src\\ctrl\\lister.c(120): Warning! W201: Unreachable code" 1 nil 120 "..\\src\\ctrl\\lister.c") ;; omake - (" alpha.c:5:15: error: expected ';' after expression" + ;; FIXME: This doesn't actually test the omake rule. + (gnu " alpha.c:5:15: error: expected ';' after expression" 1 15 5 "alpha.c") ;; oracle - ("Semantic error at line 528, column 5, file erosacqdb.pc:" + (oracle "Semantic error at line 528, column 5, file erosacqdb.pc:" 1 5 528 "erosacqdb.pc") - ("Error at line 41, column 10 in file /usr/src/sb/ODBI_BHP.hpp" + (oracle "Error at line 41, column 10 in file /usr/src/sb/ODBI_BHP.hpp" 1 10 41 "/usr/src/sb/ODBI_BHP.hpp") - ("PCC-02150: error at line 49, column 27 in file /usr/src/sb/ODBI_dxfgh.pc" + (oracle + "PCC-02150: error at line 49, column 27 in file /usr/src/sb/ODBI_dxfgh.pc" 1 27 49 "/usr/src/sb/ODBI_dxfgh.pc") - ("PCC-00003: invalid SQL Identifier at column name in line 12 of file /usr/src/sb/ODBI_BHP.hpp" + (oracle "PCC-00003: invalid SQL Identifier at column name in line 12 of file /usr/src/sb/ODBI_BHP.hpp" 1 nil 12 "/usr/src/sb/ODBI_BHP.hpp") - ("PCC-00004: mismatched IF/ELSE/ENDIF block at line 27 in file /usr/src/sb/ODBI_BHP.hpp" + (oracle "PCC-00004: mismatched IF/ELSE/ENDIF block at line 27 in file /usr/src/sb/ODBI_BHP.hpp" 1 nil 27 "/usr/src/sb/ODBI_BHP.hpp") - ("PCC-02151: line 21 column 40 file /usr/src/sb/ODBI_BHP.hpp:" + (oracle "PCC-02151: line 21 column 40 file /usr/src/sb/ODBI_BHP.hpp:" 1 40 21 "/usr/src/sb/ODBI_BHP.hpp") ;; perl - ("syntax error at automake line 922, near \"':'\"" + (perl "syntax error at automake line 922, near \"':'\"" 14 nil 922 "automake") - ("Died at test.pl line 27." + (perl "Died at test.pl line 27." 6 nil 27 "test.pl") - ("store::odrecall('File_A', 'x2') called at store.pm line 90" + (perl "store::odrecall('File_A', 'x2') called at store.pm line 90" 40 nil 90 "store.pm") - ("\t(in cleanup) something bad at foo.pl line 3 during global destruction." + (perl + "\t(in cleanup) something bad at foo.pl line 3 during global destruction." 29 nil 3 "foo.pl") - ("GLib-GObject-WARNING **: /build/buildd/glib2.0-2.14.5/gobject/gsignal.c:1741: instance `0x8206790' has no handler with id `1234' at t-compilation-perl-gtk.pl line 3." + (perl "GLib-GObject-WARNING **: /build/buildd/glib2.0-2.14.5/gobject/gsignal.c:1741: instance `0x8206790' has no handler with id `1234' at t-compilation-perl-gtk.pl line 3." 130 nil 3 "t-compilation-perl-gtk.pl") ;; php - ("Parse error: parse error, unexpected $ in main.php on line 59" + (php "Parse error: parse error, unexpected $ in main.php on line 59" 1 nil 59 "main.php") - ("Fatal error: Call to undefined function: mysql_pconnect() in db.inc on line 66" + (php "Fatal error: Call to undefined function: mysql_pconnect() in db.inc on line 66" 1 nil 66 "db.inc") - ;; ruby - ("plain-exception.rb:7:in `fun': unhandled exception" + ;; ruby (uses gnu) + (gnu "plain-exception.rb:7:in `fun': unhandled exception" 1 nil 7 "plain-exception.rb") - ("\tfrom plain-exception.rb:3:in `proxy'" 2 nil 3 "plain-exception.rb") - ("\tfrom plain-exception.rb:12" 2 nil 12 "plain-exception.rb") + (gcc-include + "\tfrom plain-exception.rb:3:in `proxy'" 2 nil 3 "plain-exception.rb") + (gcc-include "\tfrom plain-exception.rb:12" 2 nil 12 "plain-exception.rb") ;; ruby-Test::Unit ;; FIXME - (" [examples/test-unit.rb:28:in `here_is_a_deep_assert'" + (ruby-Test::Unit " [examples/test-unit.rb:28:in `here_is_a_deep_assert'" 5 nil 28 "examples/test-unit.rb") - (" examples/test-unit.rb:19:in `test_a_deep_assert']:" + (ruby-Test::Unit " examples/test-unit.rb:19:in `test_a_deep_assert']:" 6 nil 19 "examples/test-unit.rb") - ("examples/test-unit.rb:10:in `test_assert_raise'" + (gnu "examples/test-unit.rb:10:in `test_assert_raise'" 1 nil 10 "examples/test-unit.rb") ;; rxp - ("Error: Mismatched end tag: expected , got \nin unnamed entity at line 71 char 8 of file:///home/reto/test/group.xml" + (rxp "Error: Mismatched end tag: expected , got \nin unnamed entity at line 71 char 8 of file:///home/reto/test/group.xml" 1 8 71 "/home/reto/test/group.xml") - ("Warning: Start tag for undeclared element geroup\nin unnamed entity at line 4 char 8 of file:///home/reto/test/group.xml" + (rxp "Warning: Start tag for undeclared element geroup\nin unnamed entity at line 4 char 8 of file:///home/reto/test/group.xml" 1 8 4 "/home/reto/test/group.xml") ;; shellcheck - ("In autogen.sh line 48:" + (shellcheck "In autogen.sh line 48:" 1 nil 48 "autogen.sh") ;; sparc-pascal-file sparc-pascal-line sparc-pascal-example - ("Thu May 14 10:46:12 1992 mom3.p:" + (sparc-pascal-file "Thu May 14 10:46:12 1992 mom3.p:" 1 nil nil "mom3.p") ;; sun - ("cc-1020 CC: REMARK File = CUI_App.h, Line = 735" + (sun "cc-1020 CC: REMARK File = CUI_App.h, Line = 735" 13 nil 735 "CUI_App.h") - ("cc-1070 cc: WARNING File = linkl.c, Line = 38" + (sun "cc-1070 cc: WARNING File = linkl.c, Line = 38" 13 nil 38 "linkl.c") - ("cf90-113 f90comp: ERROR NSE, File = Hoved.f90, Line = 16, Column = 3" + (sun "cf90-113 f90comp: ERROR NSE, File = Hoved.f90, Line = 16, Column = 3" 18 3 16 "Hoved.f90") ;; sun-ada - ("/home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: \",\" inserted" + (sun-ada "/home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: \",\" inserted" 1 6 361 "/home3/xdhar/rcds_rc/main.a") ;; 4bsd - ("/usr/src/foo/foo.c(8): warning: w may be used before set" + (edg-1 "/usr/src/foo/foo.c(8): warning: w may be used before set" 1 nil 8 "/usr/src/foo/foo.c") - ("/usr/src/foo/foo.c(9): error: w is used before set" + (edg-1 "/usr/src/foo/foo.c(9): error: w is used before set" 1 nil 9 "/usr/src/foo/foo.c") - ("strcmp: variable # of args. llib-lc(359) :: /usr/src/foo/foo.c(8)" + (4bsd "strcmp: variable # of args. llib-lc(359) :: /usr/src/foo/foo.c(8)" 44 nil 8 "/usr/src/foo/foo.c") - ("bloofle defined( /users/wolfgang/foo.c(4) ), but never used" + (4bsd "bloofle defined( /users/wolfgang/foo.c(4) ), but never used" 18 nil 4 "/users/wolfgang/foo.c") ;; perl--Pod::Checker ;; FIXME @@ -355,21 +394,21 @@ ;; *** ERROR: =over on line 37 without closing =back at line EOF in file bar.pm ;; *** ERROR: =over on line 1 without closing =back (at head1) at line 3 in file x.pod ;; perl--Test - ("# Failed test 1 in foo.t at line 6" + (perl--Test "# Failed test 1 in foo.t at line 6" 1 nil 6 "foo.t") ;; perl--Test::Harness - ("NOK 1# Test 1 got: \"1234\" (t/foo.t at line 46)" + (perl--Test2 "NOK 1# Test 1 got: \"1234\" (t/foo.t at line 46)" 1 nil 46 "t/foo.t") ;; weblint - ("index.html (13:1) Unknown element " + (weblint "index.html (13:1) Unknown element " 1 1 13 "index.html")) "List of tests for `compilation-error-regexp-alist'. -Each element has the form (STR POS COLUMN LINE FILENAME [TYPE]), -where STR is an error string, POS is the position of the error in -STR, COLUMN and LINE are the reported column and line numbers (or -nil) for that error, FILENAME is the reported filename, and TYPE -is 0 for an information message, 1 for a warning, and 2 for an -error. +Each element has the form (RULE STR POS COLUMN LINE FILENAME +[TYPE]), where RULE is the rule (as a symbol), STR is an error +string, POS is the position of the error in STR, COLUMN and LINE +are the reported column and line numbers (or nil) for that error, +FILENAME is the reported filename, and TYPE is 0 for an +information message, 1 for a warning, and 2 for an error. LINE can also be of the form (LINE . END-LINE) meaning a range of lines. COLUMN can also be of the form (COLUMN . END-COLUMN) @@ -379,11 +418,14 @@ any message type is accepted.") (defconst compile-tests--grep-regexp-testcases ;; Bug#32051. - '(("c:/Users/my.name/src/project\\src\\kbhit.hpp\0\ 29:#include " + '((nil + "c:/Users/my.name/src/project\\src\\kbhit.hpp\0\ 29:#include " 1 nil 29 "c:/Users/my.name/src/project\\src\\kbhit.hpp") - ("d:/gnu/emacs/branch/src/callproc.c\0\ 214:#ifdef DOS_NT" + (nil + "d:/gnu/emacs/branch/src/callproc.c\0\ 214:#ifdef DOS_NT" 1 nil 214 "d:/gnu/emacs/branch/src/callproc.c") - ("/gnu/emacs/branch/src/callproc.c\0\ 214:#ifdef DOS_NT" + (nil + "/gnu/emacs/branch/src/callproc.c\0\ 214:#ifdef DOS_NT" 1 nil 214 "/gnu/emacs/branch/src/callproc.c")) "List of tests for `grep-regexp-list'. The format is the same as `compile-tests--test-regexps-data', but @@ -392,43 +434,51 @@ with colon.") (defconst compile-tests--grep-regexp-tricky-testcases ;; Bug#7378. - '(("./x11-libs---nx/3.4.0:0:C.30253.1289557929.792611.C/nx-3.4.0.exheres-0\0\ 42:some text" + '((nil + "./x11-libs---nx/3.4.0:0:C.30253.1289557929.792611.C/nx-3.4.0.exheres-0\0\ 42:some text" 1 nil 42 "./x11-libs---nx/3.4.0:0:C.30253.1289557929.792611.C/nx-3.4.0.exheres-0") - ("2011-08-31_11:57:03_1\0\ 7:Date: Wed, 31 Aug 2011 11:57:03 +0000" + (nil + "2011-08-31_11:57:03_1\0\ 7:Date: Wed, 31 Aug 2011 11:57:03 +0000" 1 nil 7 "2011-08-31_11:57:03_1")) "List of tricky tests for `grep-regexp-list'. Same as `compile-tests--grep-regexp-testcases', but these cases can only work with the NUL byte to disambiguate colons.") (defun compile--test-error-line (test) - (erase-buffer) - (setq compilation-locs (make-hash-table)) - (insert (car test)) - (compilation-parse-errors (point-min) (point-max)) - (let ((msg (get-text-property (nth 1 test) 'compilation-message))) - (should msg) - (let ((loc (compilation--message->loc msg)) - (col (nth 2 test)) - (line (nth 3 test)) - (file (nth 4 test)) - (type (nth 5 test)) - end-col end-line) - (if (consp col) - (setq end-col (cdr col) col (car col))) - (if (consp line) - (setq end-line (cdr line) line (car line))) - (should (equal (compilation--loc->col loc) col)) - (should (equal (compilation--loc->line loc) line)) - (when file - (should (equal (caar (compilation--loc->file-struct loc)) file))) - (when end-col - (should (equal (car (cadr (nth 2 (compilation--loc->file-struct loc)))) - end-col))) - (should (equal (car (nth 2 (compilation--loc->file-struct loc))) - (or end-line line))) - (when type - (should (equal type (compilation--message->type msg))))) - msg)) + (ert-info ((format "%S" test) :prefix "testcase: ") + (erase-buffer) + (setq compilation-locs (make-hash-table)) + (let ((rule (nth 0 test)) + (str (nth 1 test)) + (pos (nth 2 test)) + (col (nth 3 test)) + (line (nth 4 test)) + (file (nth 5 test)) + (type (nth 6 test))) + (insert str) + (compilation-parse-errors (point-min) (point-max)) + (let ((msg (get-text-property pos 'compilation-message))) + (should msg) + (let ((loc (compilation--message->loc msg)) + end-col end-line) + (if (consp col) + (setq end-col (cdr col) col (car col))) + (if (consp line) + (setq end-line (cdr line) line (car line))) + (should (equal (compilation--loc->col loc) col)) + (should (equal (compilation--loc->line loc) line)) + (when file + (should (equal (caar (compilation--loc->file-struct loc)) file))) + (when end-col + (should (equal + (car (cadr (nth 2 (compilation--loc->file-struct loc)))) + end-col))) + (should (equal (car (nth 2 (compilation--loc->file-struct loc))) + (or end-line line))) + (when type + (should (equal type (compilation--message->type msg)))) + (should (equal rule (compilation--message->rule msg)))) + msg)))) (ert-deftest compile-test-error-regexps () "Test the `compilation-error-regexp-alist' regexps. @@ -452,16 +502,15 @@ The test data is in `compile-tests--grep-regexp-testcases'." (font-lock-mode -1) (dolist (testcase compile-tests--grep-regexp-testcases) (let (msg1 msg2) - (setq msg1 (ert-info ((format "%S" testcase) :prefix "testcase: ") - (compile--test-error-line testcase))) + (setq msg1 (compile--test-error-line testcase)) ;; Make sure replacing the NUL character with a colon still matches. - (setf (car testcase) (replace-regexp-in-string "\0" ":" (car testcase))) - (setq msg2 (ert-info ((format "%S" testcase) :prefix "testcase: ") - (compile--test-error-line testcase))) + (let ((testcase2 (copy-sequence testcase))) + (setf (nth 1 testcase2) + (string-replace "\0" ":" (nth 1 testcase2))) + (setq msg2 (compile--test-error-line testcase2))) (should (equal msg1 msg2)))) (dolist (testcase compile-tests--grep-regexp-tricky-testcases) - (ert-info ((format "%S" testcase) :prefix "testcase: ") - (compile--test-error-line testcase))) + (compile--test-error-line testcase)) (should (eq compilation-num-errors-found 8)))) ;;; compile-tests.el ends here -- cgit v1.2.3 From 74519db6dfcffad8ac7a273d43992d2535320a8c Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 19 Oct 2020 13:31:33 +0200 Subject: Further clarification of directory-files* doc * doc/lispref/files.texi (Contents of Directories): Precise description of MATCH-REGEXP of directory-files. Add directory-files-no-dot-files-regexp. * lisp/files.el (directory-files-no-dot-files-regexp): Revert last fix. * src/dired.c (Fdirectory_files) (Fdirectory_files_and_attributes): Fix wording in docstring. --- doc/lispref/files.texi | 21 +++++++++++++++++---- lisp/files.el | 2 +- src/dired.c | 4 ++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 3b8b4fb3a9e..fc66d1c085d 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -2926,11 +2926,11 @@ absolute file names. Otherwise, it returns the names relative to the specified directory. If @var{match-regexp} is non-@code{nil}, this function returns only -those file names that contain a match for that regular expression---the -other file names are excluded from the list. On case-insensitive -filesystems, the regular expression matching is case-insensitive. +those file names whose non-directory part contain a match for that +regular expression---the other file names are excluded from the list. +On case-insensitive filesystems, the regular expression matching is +case-insensitive. -@c Emacs 19 feature If @var{nosort} is non-@code{nil}, @code{directory-files} does not sort the list, so you get the file names in no particular order. Use this if you want the utmost possible speed and don't care what order the files @@ -3007,6 +3007,19 @@ corresponding argument to @code{file-attributes} (@pxref{Definition of file-attributes}). @end defun +@defvr Constant directory-files-no-dot-files-regexp +This regular expression matches any file name except @samp{.} and +@samp{..}. More precisely, it matches parts of any nonempty string +except those two. It is useful as the @var{match-regexp} argument to +@code{directory-files} and @code{directory-files-and-attributes}: + +@example +(directory-files "/foo" nil directory-files-no-dot-files-regexp) +@end example + +returns @code{nil}, if directory @samp{/foo} is empty. +@end defvr + @defun file-expand-wildcards pattern &optional full This function expands the wildcard pattern @var{pattern}, returning a list of file names that match it. diff --git a/lisp/files.el b/lisp/files.el index 78ccb9ba910..c2c58dae934 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5787,7 +5787,7 @@ If called interactively, then PARENTS is non-nil." (defconst directory-files-no-dot-files-regexp "[^.]\\|\\.\\.\\." - "Regexp matching any non-directory part of a file name except \".\" and \"..\". + "Regexp matching any file name except \".\" and \"..\". More precisely, it matches parts of any nonempty string except those two. It is useful as the regexp argument to `directory-files' and `directory-files-and-attributes'.") diff --git a/src/dired.c b/src/dired.c index 442d3aa48fb..8256f2626dc 100644 --- a/src/dired.c +++ b/src/dired.c @@ -293,7 +293,7 @@ DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 4, 0, There are three optional arguments: If FULL is non-nil, return absolute file names. Otherwise return names that are relative to the specified directory. -If MATCH is non-nil, mention only file names which non-directory part +If MATCH is non-nil, mention only file names whose non-directory part matches the regexp MATCH. If NOSORT is non-nil, the list is not sorted--its order is unpredictable. Otherwise, the list returned is sorted with `string-lessp'. @@ -326,7 +326,7 @@ by `file-attributes'. This function accepts four optional arguments: If FULL is non-nil, return absolute file names. Otherwise return names that are relative to the specified directory. -If MATCH is non-nil, mention only file names which non-directory part +If MATCH is non-nil, mention only file names whose non-directory part matches the regexp MATCH. If NOSORT is non-nil, the list is not sorted--its order is unpredictable. NOSORT is useful if you plan to sort the result yourself. -- cgit v1.2.3 From fe16248b77067281e25ac90b393a1e0da77d445e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 12 Sep 2020 19:49:20 +0200 Subject: Make auto-revert-mode tests run faster * test/lisp/autorevert-tests.el (auto-revert--timeout): Make into defun and shorten timeout by a factor 10. (auto-revert--wait-for-revert): Cut timeouts in half. (with-auto-revert-test): New macro to set timeout to 0.1. (auto-revert-tests--write-file): New defun. (auto-revert-test00-auto-revert-mode) (auto-revert-test01-auto-revert-several-files) (auto-revert-test02-auto-revert-deleted-file) (auto-revert-test03-auto-revert-tail-mode) (auto-revert-test04-auto-revert-mode-dired) (auto-revert-test05-global-notify) (auto-revert-test06-write-file): Adapt test to run faster. Remove :expensive-test marks. This was discussed in: https://lists.gnu.org/r/emacs-devel/2020-10/msg01233.html --- test/lisp/autorevert-tests.el | 656 +++++++++++++++++++++--------------------- 1 file changed, 327 insertions(+), 329 deletions(-) diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index 3243a80e52c..1b26a3d2468 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el @@ -61,8 +61,9 @@ file-notify-debug nil tramp-verbose 0) -(defconst auto-revert--timeout (1+ auto-revert-interval) - "Time to wait for a message.") +(defun auto-revert--timeout () + "Time to wait for a message." + (+ auto-revert-interval 0.1)) (defvar auto-revert--messages nil "Used to collect messages issued during a section of a test.") @@ -125,14 +126,14 @@ This expects `auto-revert--messages' to be bound by ;; Remote files do not cooperate well with timers. So we count ourselves. (let ((ct (current-time))) (while (and (< (float-time (time-subtract (current-time) ct)) - auto-revert--timeout) + (auto-revert--timeout)) (null (string-match (format-message "Reverting buffer `%s'\\." (buffer-name buffer)) auto-revert--messages))) (if (with-current-buffer buffer auto-revert-use-notify) - (read-event nil nil 0.1) - (sleep-for 0.1))))) + (read-event nil nil 0.05) + (sleep-for 0.05))))) (defmacro auto-revert--deftest-remote (test docstring) "Define ert `TEST-remote' for remote files." @@ -152,51 +153,59 @@ This expects `auto-revert--messages' to be bound by (funcall (ert-test-body ert-test)) (error (message "%s" err) (signal (car err) (cdr err))))))) +(defmacro with-auto-revert-test (&rest body) + `(let ((auto-revert-interval-orig auto-revert-interval)) + (unwind-protect + (progn + (customize-set-variable 'auto-revert-interval 0.1) + ,@body) + (customize-set-variable 'auto-revert-interval auto-revert-interval-orig)))) + +(defun auto-revert-tests--write-file (text file time-delta &optional append) + (write-region text nil file append 'no-message) + (set-file-times file (time-subtract (current-time) time-delta))) + (ert-deftest auto-revert-test00-auto-revert-mode () "Check autorevert for a file." ;; `auto-revert-buffers' runs every 5". And we must wait, until the ;; file has been reverted. - :tags '(:expensive-test) - (let ((tmpfile (make-temp-file "auto-revert-test")) - buf) - (unwind-protect - (progn - (write-region "any text" nil tmpfile nil 'no-message) - (setq buf (find-file-noselect tmpfile)) - (with-current-buffer buf - (ert-with-message-capture auto-revert--messages - (should (string-equal (buffer-string) "any text")) - ;; `buffer-stale--default-function' checks for - ;; `verify-visited-file-modtime'. We must ensure that it - ;; returns nil. - (sleep-for 1) - (auto-revert-mode 1) - (should auto-revert-mode) - - ;; Modify file. We wait for a second, in order to have - ;; another timestamp. - (sleep-for 1) - (write-region "another text" nil tmpfile nil 'no-message) - - ;; Check, that the buffer has been reverted. - (auto-revert--wait-for-revert buf)) - (should (string-match "another text" (buffer-string))) - - ;; When the buffer is modified, it shall not be reverted. - (ert-with-message-capture auto-revert--messages - (set-buffer-modified-p t) - (sleep-for 1) - (write-region "any text" nil tmpfile nil 'no-message) - - ;; Check, that the buffer hasn't been reverted. - (auto-revert--wait-for-revert buf)) - (should-not (string-match "any text" (buffer-string))))) - - ;; Exit. - (ignore-errors - (with-current-buffer buf (set-buffer-modified-p nil)) - (kill-buffer buf)) - (ignore-errors (delete-file tmpfile))))) + (with-auto-revert-test + (let ((tmpfile (make-temp-file "auto-revert-test")) + (times '(60 30 15)) + buf) + (unwind-protect + (progn + (auto-revert-tests--write-file "any text" tmpfile (pop times)) + (setq buf (find-file-noselect tmpfile)) + (with-current-buffer buf + (ert-with-message-capture auto-revert--messages + (should (string-equal (buffer-string) "any text")) + ;; `buffer-stale--default-function' checks for + ;; `verify-visited-file-modtime'. We must ensure that it + ;; returns nil. + (auto-revert-mode 1) + (should auto-revert-mode) + + (auto-revert-tests--write-file "another text" tmpfile (pop times)) + + ;; Check, that the buffer has been reverted. + (auto-revert--wait-for-revert buf)) + (should (string-match "another text" (buffer-string))) + + ;; When the buffer is modified, it shall not be reverted. + (ert-with-message-capture auto-revert--messages + (set-buffer-modified-p t) + (auto-revert-tests--write-file "any text" tmpfile (pop times)) + + ;; Check, that the buffer hasn't been reverted. + (auto-revert--wait-for-revert buf)) + (should-not (string-match "any text" (buffer-string))))) + + ;; Exit. + (ignore-errors + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf)) + (ignore-errors (delete-file tmpfile)))))) (auto-revert--deftest-remote auto-revert-test00-auto-revert-mode "Check autorevert for a remote file.") @@ -204,66 +213,65 @@ This expects `auto-revert--messages' to be bound by ;; This is inspired by Bug#21841. (ert-deftest auto-revert-test01-auto-revert-several-files () "Check autorevert for several files at once." - :tags '(:expensive-test) (skip-unless (executable-find "cp" (file-remote-p temporary-file-directory))) - (let* ((cp (executable-find "cp" (file-remote-p temporary-file-directory))) - (tmpdir1 (make-temp-file "auto-revert-test" 'dir)) - (tmpdir2 (make-temp-file "auto-revert-test" 'dir)) - (tmpfile1 - (make-temp-file (expand-file-name "auto-revert-test" tmpdir1))) - (tmpfile2 - (make-temp-file (expand-file-name "auto-revert-test" tmpdir1))) - buf1 buf2) - (unwind-protect - (ert-with-message-capture auto-revert--messages - (write-region "any text" nil tmpfile1 nil 'no-message) - (setq buf1 (find-file-noselect tmpfile1)) - (write-region "any text" nil tmpfile2 nil 'no-message) - (setq buf2 (find-file-noselect tmpfile2)) - - (dolist (buf (list buf1 buf2)) - (with-current-buffer buf - (should (string-equal (buffer-string) "any text")) - ;; `buffer-stale--default-function' checks for - ;; `verify-visited-file-modtime'. We must ensure that - ;; it returns nil. - (sleep-for 1) - (auto-revert-mode 1) - (should auto-revert-mode))) - - ;; Modify files. We wait for a second, in order to have - ;; another timestamp. - (sleep-for 1) - (write-region - "another text" nil - (expand-file-name (file-name-nondirectory tmpfile1) tmpdir2) - nil 'no-message) - (write-region - "another text" nil - (expand-file-name (file-name-nondirectory tmpfile2) tmpdir2) - nil 'no-message) - ;;(copy-directory tmpdir2 tmpdir1 nil 'copy-contents) - ;; Strange, that `copy-directory' does not work as expected. - ;; The following shell command is not portable on all - ;; platforms, unfortunately. - (shell-command - (format "%s -f %s/* %s" - cp (file-local-name tmpdir2) (file-local-name tmpdir1))) - - ;; Check, that the buffers have been reverted. - (dolist (buf (list buf1 buf2)) - (with-current-buffer buf - (auto-revert--wait-for-revert buf) - (should (string-match "another text" (buffer-string)))))) - - ;; Exit. - (ignore-errors - (dolist (buf (list buf1 buf2)) - (with-current-buffer buf (set-buffer-modified-p nil)) - (kill-buffer buf))) - (ignore-errors (delete-directory tmpdir1 'recursive)) - (ignore-errors (delete-directory tmpdir2 'recursive))))) + (with-auto-revert-test + (let* ((cp (executable-find "cp" (file-remote-p temporary-file-directory))) + (tmpdir1 (make-temp-file "auto-revert-test" 'dir)) + (tmpdir2 (make-temp-file "auto-revert-test" 'dir)) + (tmpfile1 + (make-temp-file (expand-file-name "auto-revert-test" tmpdir1))) + (tmpfile2 + (make-temp-file (expand-file-name "auto-revert-test" tmpdir1))) + (times '(120 60 30 15)) + buf1 buf2) + (unwind-protect + (ert-with-message-capture auto-revert--messages + (auto-revert-tests--write-file "any text" tmpfile1 (pop times)) + (setq buf1 (find-file-noselect tmpfile1)) + (auto-revert-tests--write-file "any text" tmpfile2 (pop times)) + (setq buf2 (find-file-noselect tmpfile2)) + + (dolist (buf (list buf1 buf2)) + (with-current-buffer buf + (should (string-equal (buffer-string) "any text")) + ;; `buffer-stale--default-function' checks for + ;; `verify-visited-file-modtime'. We must ensure that + ;; it returns nil. + (auto-revert-mode 1) + (should auto-revert-mode))) + + ;; Modify files. We wait for a second, in order to have + ;; another timestamp. + (auto-revert-tests--write-file + "another text" + (expand-file-name (file-name-nondirectory tmpfile1) tmpdir2) + (pop times)) + (auto-revert-tests--write-file + "another text" + (expand-file-name (file-name-nondirectory tmpfile2) tmpdir2) + (pop times)) + ;;(copy-directory tmpdir2 tmpdir1 nil 'copy-contents) + ;; Strange, that `copy-directory' does not work as expected. + ;; The following shell command is not portable on all + ;; platforms, unfortunately. + (shell-command + (format "%s -f %s/* %s" + cp (file-local-name tmpdir2) (file-local-name tmpdir1))) + + ;; Check, that the buffers have been reverted. + (dolist (buf (list buf1 buf2)) + (with-current-buffer buf + (auto-revert--wait-for-revert buf) + (should (string-match "another text" (buffer-string)))))) + + ;; Exit. + (ignore-errors + (dolist (buf (list buf1 buf2)) + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf))) + (ignore-errors (delete-directory tmpdir1 'recursive)) + (ignore-errors (delete-directory tmpdir2 'recursive)))))) (auto-revert--deftest-remote auto-revert-test01-auto-revert-several-files "Check autorevert for several remote files at once.") @@ -271,84 +279,81 @@ This expects `auto-revert--messages' to be bound by ;; This is inspired by Bug#23276. (ert-deftest auto-revert-test02-auto-revert-deleted-file () "Check autorevert for a deleted file." - :tags '(:expensive-test) ;; Repeated unpredictable failures, bug#32645. ;; Unlikely to be hydra-specific? ; (skip-unless (not (getenv "EMACS_HYDRA_CI"))) - (let ((tmpfile (make-temp-file "auto-revert-test")) - ;; Try to catch bug#32645. - (auto-revert-debug (getenv "EMACS_HYDRA_CI")) - (file-notify-debug (getenv "EMACS_HYDRA_CI")) - buf desc) - (unwind-protect - (progn - (write-region "any text" nil tmpfile nil 'no-message) - (setq buf (find-file-noselect tmpfile)) - (with-current-buffer buf - (should-not - (file-notify-valid-p auto-revert-notify-watch-descriptor)) - (should (string-equal (buffer-string) "any text")) - ;; `buffer-stale--default-function' checks for - ;; `verify-visited-file-modtime'. We must ensure that - ;; it returns nil. - (sleep-for 1) - (auto-revert-mode 1) - (should auto-revert-mode) - (setq desc auto-revert-notify-watch-descriptor) - - ;; Remove file while reverting. We simulate this by - ;; modifying `before-revert-hook'. - (add-hook - 'before-revert-hook - (lambda () - (when auto-revert-debug - (message "%s deleted" buffer-file-name)) - (delete-file buffer-file-name)) - nil t) - - (ert-with-message-capture auto-revert--messages - (sleep-for 1) - (write-region "another text" nil tmpfile nil 'no-message) - (auto-revert--wait-for-revert buf)) - ;; Check, that the buffer hasn't been reverted. File - ;; notification should be disabled, falling back to - ;; polling. - (should (string-match "any text" (buffer-string))) - ;; With w32notify, and on emba, the `stopped' events are not sent. - (or (eq file-notify--library 'w32notify) - (getenv "EMACS_EMBA_CI") - (should-not - (file-notify-valid-p auto-revert-notify-watch-descriptor))) - - ;; Once the file has been recreated, the buffer shall be - ;; reverted. - (kill-local-variable 'before-revert-hook) - (ert-with-message-capture auto-revert--messages - (sleep-for 1) - (write-region "another text" nil tmpfile nil 'no-message) - (auto-revert--wait-for-revert buf)) - ;; Check, that the buffer has been reverted. - (should (string-match "another text" (buffer-string))) - ;; When file notification is used, it must be reenabled - ;; after recreation of the file. We cannot expect that - ;; the descriptor is the same, so we just check the - ;; existence. - (should (eq (null desc) (null auto-revert-notify-watch-descriptor))) - - ;; An empty file shall still be reverted. - (ert-with-message-capture auto-revert--messages - (sleep-for 1) - (write-region "" nil tmpfile nil 'no-message) - (auto-revert--wait-for-revert buf)) - ;; Check, that the buffer has been reverted. - (should (string-equal "" (buffer-string))))) - - ;; Exit. - (ignore-errors - (with-current-buffer buf (set-buffer-modified-p nil)) - (kill-buffer buf)) - (ignore-errors (delete-file tmpfile))))) + (with-auto-revert-test + (let ((tmpfile (make-temp-file "auto-revert-test")) + ;; Try to catch bug#32645. + (auto-revert-debug (getenv "EMACS_HYDRA_CI")) + (file-notify-debug (getenv "EMACS_HYDRA_CI")) + (times '(120 60 30 15)) + buf desc) + (unwind-protect + (progn + (auto-revert-tests--write-file "any text" tmpfile (pop times)) + (setq buf (find-file-noselect tmpfile)) + (with-current-buffer buf + (should-not + (file-notify-valid-p auto-revert-notify-watch-descriptor)) + (should (string-equal (buffer-string) "any text")) + ;; `buffer-stale--default-function' checks for + ;; `verify-visited-file-modtime'. We must ensure that + ;; it returns nil. + (auto-revert-mode 1) + (should auto-revert-mode) + (setq desc auto-revert-notify-watch-descriptor) + + ;; Remove file while reverting. We simulate this by + ;; modifying `before-revert-hook'. + (add-hook + 'before-revert-hook + (lambda () + (when auto-revert-debug + (message "%s deleted" buffer-file-name)) + (delete-file buffer-file-name)) + nil t) + + (ert-with-message-capture auto-revert--messages + (auto-revert-tests--write-file "another text" tmpfile (pop times)) + (auto-revert--wait-for-revert buf)) + ;; Check, that the buffer hasn't been reverted. File + ;; notification should be disabled, falling back to + ;; polling. + (should (string-match "any text" (buffer-string))) + ;; With w32notify, and on emba, the `stopped' events are not sent. + (or (eq file-notify--library 'w32notify) + (getenv "EMACS_EMBA_CI") + (should-not + (file-notify-valid-p auto-revert-notify-watch-descriptor))) + + ;; Once the file has been recreated, the buffer shall be + ;; reverted. + (kill-local-variable 'before-revert-hook) + (ert-with-message-capture auto-revert--messages + (auto-revert-tests--write-file "another text" tmpfile (pop times)) + (auto-revert--wait-for-revert buf)) + ;; Check, that the buffer has been reverted. + (should (string-match "another text" (buffer-string))) + ;; When file notification is used, it must be reenabled + ;; after recreation of the file. We cannot expect that + ;; the descriptor is the same, so we just check the + ;; existence. + (should (eq (null desc) (null auto-revert-notify-watch-descriptor))) + + ;; An empty file shall still be reverted. + (ert-with-message-capture auto-revert--messages + (auto-revert-tests--write-file "" tmpfile (pop times)) + (auto-revert--wait-for-revert buf)) + ;; Check, that the buffer has been reverted. + (should (string-equal "" (buffer-string))))) + + ;; Exit. + (ignore-errors + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf)) + (ignore-errors (delete-file tmpfile)))))) (auto-revert--deftest-remote auto-revert-test02-auto-revert-deleted-file "Check autorevert for a deleted remote file.") @@ -357,28 +362,25 @@ This expects `auto-revert--messages' to be bound by "Check autorevert tail mode." ;; `auto-revert-buffers' runs every 5". And we must wait, until the ;; file has been reverted. - :tags '(:expensive-test) (let ((tmpfile (make-temp-file "auto-revert-test")) + (times '(30 15)) buf) (unwind-protect (ert-with-message-capture auto-revert--messages - (write-region "any text" nil tmpfile nil 'no-message) + (auto-revert-tests--write-file "any text" tmpfile (pop times)) (setq buf (find-file-noselect tmpfile)) (with-current-buffer buf ;; `buffer-stale--default-function' checks for ;; `verify-visited-file-modtime'. We must ensure that it ;; returns nil. - (sleep-for 1) (auto-revert-tail-mode 1) (should auto-revert-tail-mode) (erase-buffer) (insert "modified text\n") (set-buffer-modified-p nil) - ;; Modify file. We wait for a second, in order to have - ;; another timestamp. - (sleep-for 1) - (write-region "another text" nil tmpfile 'append 'no-message) + ;; Modify file. + (auto-revert-tests--write-file "another text" tmpfile (pop times) 'append) ;; Check, that the buffer has been reverted. (auto-revert--wait-for-revert buf) @@ -396,50 +398,47 @@ This expects `auto-revert--messages' to be bound by "Check autorevert for dired." ;; `auto-revert-buffers' runs every 5". And we must wait, until the ;; file has been reverted. - :tags '(:expensive-test) - (let* ((tmpfile (make-temp-file "auto-revert-test")) - (name (file-name-nondirectory tmpfile)) - buf) - (unwind-protect - (progn - (setq buf (dired-noselect temporary-file-directory)) - (with-current-buffer buf - ;; `buffer-stale--default-function' checks for - ;; `verify-visited-file-modtime'. We must ensure that it - ;; returns nil. - (sleep-for 1) - (auto-revert-mode 1) - (should auto-revert-mode) - (should - (string-match name (substring-no-properties (buffer-string)))) - - (ert-with-message-capture auto-revert--messages - ;; Delete file. We wait for a second, in order to have - ;; another timestamp. - (sleep-for 1) - (delete-file tmpfile) - (auto-revert--wait-for-revert buf)) - ;; Check, that the buffer has been reverted. - (should-not - (string-match name (substring-no-properties (buffer-string)))) - - (ert-with-message-capture auto-revert--messages - ;; Make dired buffer modified. Check, that the buffer has - ;; been still reverted. - (set-buffer-modified-p t) - (sleep-for 1) - (write-region "any text" nil tmpfile nil 'no-message) - - (auto-revert--wait-for-revert buf)) - ;; Check, that the buffer has been reverted. - (should - (string-match name (substring-no-properties (buffer-string)))))) - - ;; Exit. - (ignore-errors - (with-current-buffer buf (set-buffer-modified-p nil)) - (kill-buffer buf)) - (ignore-errors (delete-file tmpfile))))) + (with-auto-revert-test + (let* ((tmpfile (make-temp-file "auto-revert-test")) + (name (file-name-nondirectory tmpfile)) + (times '(30)) + buf) + (unwind-protect + (progn + (setq buf (dired-noselect temporary-file-directory)) + (with-current-buffer buf + ;; `buffer-stale--default-function' checks for + ;; `verify-visited-file-modtime'. We must ensure that it + ;; returns nil. + (auto-revert-mode 1) + (should auto-revert-mode) + (should + (string-match name (substring-no-properties (buffer-string)))) + + (ert-with-message-capture auto-revert--messages + ;; Delete file. + (delete-file tmpfile) + (auto-revert--wait-for-revert buf)) + ;; Check, that the buffer has been reverted. + (should-not + (string-match name (substring-no-properties (buffer-string)))) + + (ert-with-message-capture auto-revert--messages + ;; Make dired buffer modified. Check, that the buffer has + ;; been still reverted. + (set-buffer-modified-p t) + (auto-revert-tests--write-file "any text" tmpfile (pop times)) + + (auto-revert--wait-for-revert buf)) + ;; Check, that the buffer has been reverted. + (should + (string-match name (substring-no-properties (buffer-string)))))) + + ;; Exit. + (ignore-errors + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf)) + (ignore-errors (delete-file tmpfile)))))) (auto-revert--deftest-remote auto-revert-test04-auto-revert-mode-dired "Check remote autorevert for dired.") @@ -468,117 +467,116 @@ This expects `auto-revert--messages' to be bound by (ert-deftest auto-revert-test05-global-notify () "Test `global-auto-revert-mode' without polling." - :tags '(:expensive-test) (skip-unless (or file-notify--library (file-remote-p temporary-file-directory))) - (let* ((auto-revert-use-notify t) - (auto-revert-avoid-polling t) - (was-in-global-auto-revert-mode global-auto-revert-mode) - (file-1 (make-temp-file "global-auto-revert-test-1")) - (file-2 (make-temp-file "global-auto-revert-test-2")) - (file-3 (make-temp-file "global-auto-revert-test-3")) - (file-2b (concat file-2 "-b")) - require-final-newline buf-1 buf-2 buf-3) - (unwind-protect - (progn - (setq buf-1 (find-file-noselect file-1)) - (setq buf-2 (find-file-noselect file-2)) - (auto-revert-test--write-file "1-a" file-1) - (should (equal (auto-revert-test--buffer-string buf-1) "")) - - (global-auto-revert-mode 1) ; Turn it on. - - (should (buffer-local-value - 'auto-revert-notify-watch-descriptor buf-1)) - (should (buffer-local-value - 'auto-revert-notify-watch-descriptor buf-2)) - - ;; buf-1 should have been reverted immediately when the mode - ;; was enabled. - (should (equal (auto-revert-test--buffer-string buf-1) "1-a")) - - ;; Alter a file. - (auto-revert-test--write-file "2-a" file-2) - ;; Allow for some time to handle notification events. - (auto-revert-test--wait-for-buffer-text buf-2 "2-a" 1) - (should (equal (auto-revert-test--buffer-string buf-2) "2-a")) - - ;; Visit a file, and modify it on disk. - (setq buf-3 (find-file-noselect file-3)) - ;; Newly opened buffers won't be use notification until the - ;; first poll cycle; wait for it. - (auto-revert-test--wait-for - (lambda () (buffer-local-value - 'auto-revert-notify-watch-descriptor buf-3)) - auto-revert--timeout) - (should (buffer-local-value + (with-auto-revert-test + (let* ((auto-revert-use-notify t) + (auto-revert-avoid-polling t) + (was-in-global-auto-revert-mode global-auto-revert-mode) + (file-1 (make-temp-file "global-auto-revert-test-1")) + (file-2 (make-temp-file "global-auto-revert-test-2")) + (file-3 (make-temp-file "global-auto-revert-test-3")) + (file-2b (concat file-2 "-b")) + require-final-newline buf-1 buf-2 buf-3) + (unwind-protect + (progn + (setq buf-1 (find-file-noselect file-1)) + (setq buf-2 (find-file-noselect file-2)) + (auto-revert-test--write-file "1-a" file-1) + (should (equal (auto-revert-test--buffer-string buf-1) "")) + + (global-auto-revert-mode 1) ; Turn it on. + + (should (buffer-local-value + 'auto-revert-notify-watch-descriptor buf-1)) + (should (buffer-local-value + 'auto-revert-notify-watch-descriptor buf-2)) + + ;; buf-1 should have been reverted immediately when the mode + ;; was enabled. + (should (equal (auto-revert-test--buffer-string buf-1) "1-a")) + + ;; Alter a file. + (auto-revert-test--write-file "2-a" file-2) + ;; Allow for some time to handle notification events. + (auto-revert-test--wait-for-buffer-text buf-2 "2-a" 1) + (should (equal (auto-revert-test--buffer-string buf-2) "2-a")) + + ;; Visit a file, and modify it on disk. + (setq buf-3 (find-file-noselect file-3)) + ;; Newly opened buffers won't be use notification until the + ;; first poll cycle; wait for it. + (auto-revert-test--wait-for + (lambda () (buffer-local-value 'auto-revert-notify-watch-descriptor buf-3)) - (auto-revert-test--write-file "3-a" file-3) - (auto-revert-test--wait-for-buffer-text buf-3 "3-a" 1) - (should (equal (auto-revert-test--buffer-string buf-3) "3-a")) - - ;; Delete a visited file, and re-create it with new contents. - (delete-file file-1) - (sleep-for 0.5) - (should (equal (auto-revert-test--buffer-string buf-1) "1-a")) - (auto-revert-test--write-file "1-b" file-1) - (auto-revert-test--wait-for-buffer-text - buf-1 "1-b" auto-revert--timeout) - (should (buffer-local-value - 'auto-revert-notify-watch-descriptor buf-1)) - - ;; Write a buffer to a new file, then modify the new file on disk. - (with-current-buffer buf-2 - (write-file file-2b)) - (should (equal (auto-revert-test--buffer-string buf-2) "2-a")) - (auto-revert-test--write-file "2-b" file-2b) - (auto-revert-test--wait-for-buffer-text - buf-2 "2-b" auto-revert--timeout) - (should (buffer-local-value - 'auto-revert-notify-watch-descriptor buf-2))) - - ;; Clean up. - (unless was-in-global-auto-revert-mode - (global-auto-revert-mode 0)) ; Turn it off. - (dolist (buf (list buf-1 buf-2 buf-3)) - (ignore-errors (kill-buffer buf))) - (dolist (file (list file-1 file-2 file-2b file-3)) - (ignore-errors (delete-file file))) - ))) + (auto-revert--timeout)) + (should (buffer-local-value + 'auto-revert-notify-watch-descriptor buf-3)) + (auto-revert-test--write-file "3-a" file-3) + (auto-revert-test--wait-for-buffer-text buf-3 "3-a" 1) + (should (equal (auto-revert-test--buffer-string buf-3) "3-a")) + + ;; Delete a visited file, and re-create it with new contents. + (delete-file file-1) + (should (equal (auto-revert-test--buffer-string buf-1) "1-a")) + (auto-revert-test--write-file "1-b" file-1) + (auto-revert-test--wait-for-buffer-text + buf-1 "1-b" (auto-revert--timeout)) + (should (buffer-local-value + 'auto-revert-notify-watch-descriptor buf-1)) + + ;; Write a buffer to a new file, then modify the new file on disk. + (with-current-buffer buf-2 + (write-file file-2b)) + (should (equal (auto-revert-test--buffer-string buf-2) "2-a")) + (auto-revert-test--write-file "2-b" file-2b) + (auto-revert-test--wait-for-buffer-text + buf-2 "2-b" (auto-revert--timeout)) + (should (buffer-local-value + 'auto-revert-notify-watch-descriptor buf-2))) + + ;; Clean up. + (unless was-in-global-auto-revert-mode + (global-auto-revert-mode 0)) ; Turn it off. + (dolist (buf (list buf-1 buf-2 buf-3)) + (ignore-errors (kill-buffer buf))) + (dolist (file (list file-1 file-2 file-2b file-3)) + (ignore-errors (delete-file file))) + )))) (auto-revert--deftest-remote auto-revert-test05-global-notify "Test `global-auto-revert-mode' without polling for remote buffers.") (ert-deftest auto-revert-test06-write-file () "Verify that notification follows `write-file' correctly." - :tags '(:expensive-test) (skip-unless (or file-notify--library (file-remote-p temporary-file-directory))) - (let* ((auto-revert-use-notify t) - (file-1 (make-temp-file "auto-revert-test")) - (file-2 (concat file-1 "-2")) - require-final-newline buf) - (unwind-protect - (progn - (setq buf (find-file-noselect file-1)) - (with-current-buffer buf - (insert "A") - (save-buffer) - - (auto-revert-mode 1) - - (insert "B") - (write-file file-2) - - (auto-revert-test--write-file "C" file-2) - (auto-revert-test--wait-for-buffer-text - buf "C" auto-revert--timeout) - (should (equal (buffer-string) "C")))) - - ;; Clean up. - (ignore-errors (kill-buffer buf)) - (ignore-errors (delete-file file-1)) - (ignore-errors (delete-file file-2))))) + (with-auto-revert-test + (let* ((auto-revert-use-notify t) + (file-1 (make-temp-file "auto-revert-test")) + (file-2 (concat file-1 "-2")) + require-final-newline buf) + (unwind-protect + (progn + (setq buf (find-file-noselect file-1)) + (with-current-buffer buf + (insert "A") + (save-buffer) + + (auto-revert-mode 1) + + (insert "B") + (write-file file-2) + + (auto-revert-test--write-file "C" file-2) + (auto-revert-test--wait-for-buffer-text + buf "C" (auto-revert--timeout)) + (should (equal (buffer-string) "C")))) + + ;; Clean up. + (ignore-errors (kill-buffer buf)) + (ignore-errors (delete-file file-1)) + (ignore-errors (delete-file file-2)))))) (auto-revert--deftest-remote auto-revert-test06-write-file "Test `write-file' in `auto-revert-mode' for remote buffers.") -- cgit v1.2.3 From 4970e2c7ea1ec144f152829cb88416616b719d4a Mon Sep 17 00:00:00 2001 From: Protesilaos Stavrou Date: Mon, 19 Oct 2020 15:48:10 +0300 Subject: Fix documentation of the Modus Themes (Bug#43944) * doc/misc/modus-themes.texi (Installation): Remove reference to MELPA. (Top) (Install from the archives, GNU Guix) (Load at a given time or at sunset/sunrise) (Configure options prior to loading, Command prompts) (Headings' font, Will NOT be supported): Fix spelling, wording, markup. (Acknowledgements): Spell contributor's surname correctly. --- doc/misc/modus-themes.texi | 51 ++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/doc/misc/modus-themes.texi b/doc/misc/modus-themes.texi index c34ee15229e..383073c00d0 100644 --- a/doc/misc/modus-themes.texi +++ b/doc/misc/modus-themes.texi @@ -50,8 +50,8 @@ and with no Back-Cover Texts. * Overview:: * Installation:: * Enable and load:: -* Customisation Options:: -* Advanced customisation (do-it-yourself):: +* Customization Options:: +* Advanced customization (do-it-yourself):: * Face coverage:: * Notes for individual packages:: * Contributing:: @@ -85,7 +85,7 @@ Enable and load * Toggle between the themes on demand:: * Configure options prior to loading:: -Customisation Options +Customization Options * Bold constructs:: Toggle bold constructs in code * Slanted constructs:: Toggle slanted constructs (italics) in code @@ -108,7 +108,7 @@ Scaled headings * Scaled heading sizes:: Specify rate of increase for scaled headings -Advanced customisation (do-it-yourself) +Advanced customization (do-it-yourself) * Tweak colors (DIY):: Declare your own palette overrides * Font configs (DIY):: Optimise for mixed typeface buffers @@ -193,9 +193,8 @@ On older versions of Emacs, they can be installed using Emacs' package manager or manually from their code repository. Modus Operandi (light theme) and Modus Vivendi (dark) are normally -distributed as standalone packages in Emacs-specific archives: GNU ELPA, -MELPA, and MELPA Stable. There also exist packages for GNU/Linux -distributions. +distributed as standalone packages in Emacs-specific archives. There +also exist packages for GNU/Linux distributions. @menu * Install from the archives:: @@ -206,14 +205,12 @@ distributions. @section Install from the archives @samp{modus-operandi-theme} and @samp{modus-vivendi-theme} are -available from GNU ELPA. +available from the GNU ELPA archive, which is configured by default. Prior to querying any package archive, make sure to have updated the index, with @samp{M-x package-refresh-contents}. Then all you need to do is type @samp{M-x package-install} and specify the theme of your choice. -GNU ELPA contains the last tagged release. - @node Install on GNU/Linux @section Install on GNU/Linux @@ -247,22 +244,22 @@ Users of either the Guix System (the distro) or just Guix (the package manager) can get each theme as a standalone package. @example -guix package -i modus-operandi-theme +guix package -i emacs-modus-operandi-theme @end example And/or: @example -guix package -i modus-vivendi-theme +guix package -i emacs-modus-vivendi-theme @end example @node Enable and load @chapter Enable and load -This section documents how to load the theme of your -choice and how to further control its initialization. It also includes -some sample code snippets that could help you in the task, especially if -you intend to use both Modus Operandi and Modus Vivendi. +This section documents how to load the theme of your choice and how to +further control its initialization. It also includes some sample code +snippets that could help you in the task, especially if you intend to +use both Modus Operandi and Modus Vivendi. @menu * Load automatically:: @@ -298,7 +295,7 @@ evaluate the expression: @section Load at a given time or at sunset/sunrise It is possible to schedule a time during the day at or after which a -given theme will be loaded.@footnote{Contributed on Reddit by user b3n +given theme will be loaded.@footnote{Contributed on Reddit by user @samp{b3n} @uref{https://www.reddit.com/r/emacs/comments/gdtqov/weekly_tipstricketc_thread/fq9186h/}.} @lisp @@ -373,7 +370,7 @@ disabling a single target, but you get the idea. @section Configure options prior to loading If you plan to use both themes and wish to apply styles consistently -(see @ref{Customisation Options}), you could define wrapper functions around +(see @ref{Customization Options}), you could define wrapper functions around the standard @samp{load-theme} command. These extend the simple function we presented in @ref{Toggle between the themes on demand}. @@ -427,8 +424,8 @@ method were contributed on Reddit by user @samp{b3n}, (modus-operandi-theme-load))) @end lisp -@node Customisation Options -@chapter Customisation Options +@node Customization Options +@chapter Customization Options The Modus themes are highly configurable, though they should work well without any further tweaks. @@ -639,7 +636,7 @@ background and foreground to the minibuffer and other REPL prompts (like @samp{M-x shell} and @samp{M-x eshell}). The difference between the two is that the latter has a more pronounced/noticeable effect than the former. -The default is not to use any background for such prompts, while relying +The default does not use any background for such prompts, while relying exclusively on an accented foreground color. @node Mode line @@ -1182,13 +1179,13 @@ main font family. @ref{Font configs (DIY), , Font configurations for Org (and others)}. -@node Advanced customisation (do-it-yourself) -@chapter Advanced customisation (do-it-yourself) +@node Advanced customization (do-it-yourself) +@chapter Advanced customization (do-it-yourself) Unlike the predefined customization options which follow a straightforward pattern of allowing the user to quickly specify their preference, the themes also provide a more flexible, albeit difficult, -mechanism to control things with precision (see @ref{Customisation Options}). +mechanism to control things with precision (see @ref{Customization Options}). This section is of interest only to users who are prepared to maintain their own local tweaks and who are willing to deal with any possible @@ -2043,7 +2040,7 @@ that secondary elements like sidebars can have the default (pure white/black) background. I will only cover this package if it ever supports the inverse effect: -less intense colors (but still accessible) for supportive interfaces +less intense colors (but still accessible) for ancillary interfaces and the intended styles for the content you are actually working on. @node Notes for individual packages @@ -2302,13 +2299,13 @@ The Modus themes are a collective effort. Every contribution counts. Protesilaos Stavrou. @item Code contributions -Anders Johansson, Basil L@. Contovounisios, +Anders Johansson, Basil L@. Contovounesios, Markus Beppler, Matthew Stevenson. @item Ideas and user feedback Aaron Jensen, Adam Spiers, Alex Griffin, Alex Peitsinis, Alexey Shmalko, Anders Johansson, AndrĂ© Alexandre -Gomes, Arif Rezai, Basil L@. Contovounisios, Damien Cassou, Dario +Gomes, Arif Rezai, Basil L@. Contovounesios, Damien Cassou, Dario Gjorgjevski, David Edmondson, Davor Rotim, Divan Santana, Gerry Agbobada, Gianluca Recchia, Iris Garcia, Len Trigg, Manuel Uberti, Mark Burton, Markus Beppler, Michael Goldenberg, Murilo Pereira, -- cgit v1.2.3 From ed9520b38e1fb8dc45a9eb4227ceb49387843de2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 19 Oct 2020 13:03:41 -0400 Subject: * lisp/mail/rfc2231.el (rfc2231-decode-encoded-string): Fix match data error Get (match-string 3 string) earlier, in case `mm-charset-to-coding-system` clobbers the match data. Also, check that `string-match` succeeded before using its match data. --- lisp/mail/rfc2231.el | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/lisp/mail/rfc2231.el b/lisp/mail/rfc2231.el index add099745b6..17da60e0bee 100644 --- a/lisp/mail/rfc2231.el +++ b/lisp/mail/rfc2231.el @@ -215,23 +215,25 @@ These look like: \"\\='en-us\\='This%20is%20%2A%2A%2Afun%2A%2A%2A\", \"\\='\\='This%20is%20%2A%2A%2Afun%2A%2A%2A\", or \"This is ***fun***\"." - (string-match "\\`\\(?:\\([^']+\\)?'\\([^']+\\)?'\\)?\\(.+\\)" string) - (let ((coding-system (mm-charset-to-coding-system - (match-string 1 string) nil t)) - ;;(language (match-string 2 string)) - (value (match-string 3 string))) - (mm-with-unibyte-buffer - (insert value) - (goto-char (point-min)) - (while (re-search-forward "%\\([[:xdigit:]][[:xdigit:]]\\)" nil t) - (insert - (prog1 - (string-to-number (match-string 1) 16) - (delete-region (match-beginning 0) (match-end 0))))) - ;; Decode using the charset, if any. - (if (memq coding-system '(nil ascii)) - (buffer-string) - (decode-coding-string (buffer-string) coding-system))))) + (if (not (string-match "\\`\\(?:\\([^']+\\)?'\\([^']+\\)?'\\)?\\(.+\\)\\'" + string)) + (error "Unrecognized RFC2231 format: %S" string) + (let ((value (match-string 3 string)) + ;;(language (match-string 2 string)) + (coding-system (mm-charset-to-coding-system + (match-string 1 string) nil t))) + (mm-with-unibyte-buffer + (insert value) + (goto-char (point-min)) + (while (re-search-forward "%\\([[:xdigit:]][[:xdigit:]]\\)" nil t) + (insert + (prog1 + (string-to-number (match-string 1) 16) + (delete-region (match-beginning 0) (match-end 0))))) + ;; Decode using the charset, if any. + (if (memq coding-system '(nil ascii)) + (buffer-string) + (decode-coding-string (buffer-string) coding-system)))))) (defun rfc2231-encode-string (param value) "Return a PARAM=VALUE string encoded according to RFC2231. -- cgit v1.2.3 From f831fa174425d3f945dcbd399290ce9cc68e8ea2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 19 Oct 2020 13:39:42 -0400 Subject: * lisp/progmodes/python.el: Bump version to release the f-string support --- lisp/progmodes/python.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d1871c93a78..7f4d2251fd8 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4,7 +4,7 @@ ;; Author: FabiĂĄn E. Gallina ;; URL: https://github.com/fgallina/python.el -;; Version: 0.26.1 +;; Version: 0.27 ;; Package-Requires: ((emacs "24.1") (cl-lib "1.0")) ;; Maintainer: emacs-devel@gnu.org ;; Created: Jul 2010 -- cgit v1.2.3 From 8c96c720fa5ee67b902778199ee35991779300dc Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 19 Oct 2020 20:30:52 +0200 Subject: Add command package-menu-filter-upgradable * lisp/emacs-lisp/package.el (package-menu-filter-upgradable): New command. (Bug#41436) (package-menu-mode-map): Bind the new command. * doc/emacs/package.texi (Package Menu): Document the new command. --- doc/emacs/package.texi | 6 ++++++ etc/NEWS | 1 + lisp/emacs-lisp/package.el | 10 ++++++++++ 3 files changed, 17 insertions(+) diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 453d9eb4010..56e8ee1363a 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi @@ -222,6 +222,12 @@ lower, equal or higher version than the one specified. Filter package list by non-empty mark (@code{package-menu-filter-marked}). This shows only the packages that have been marked to be installed or deleted. +@item / u +@kindex / u @r{(Package Menu)} +@findex package-menu-filter-upgradable +Filter package list to show only packages for which there are +available upgrades (@code{package-menu-filter-upgradable}). + @item / / @kindex / / @r{(Package Menu)} @findex package-menu-filter-clear diff --git a/etc/NEWS b/etc/NEWS index 390cccbff30..c571fa95d18 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -736,6 +736,7 @@ key binding / s package-menu-filter-by-status / v package-menu-filter-by-version / m package-menu-filter-marked +/ u package-menu-filter-upgradable / / package-menu-filter-clear --- diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7b192d640b2..23692aab32a 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2708,6 +2708,7 @@ either a full name or nil, and EMAIL is a valid email address." (define-key map (kbd "/ s") 'package-menu-filter-by-status) (define-key map (kbd "/ v") 'package-menu-filter-by-version) (define-key map (kbd "/ m") 'package-menu-filter-marked) + (define-key map (kbd "/ u") 'package-menu-filter-upgradable) map) "Local keymap for `package-menu-mode' buffers.") @@ -3904,6 +3905,15 @@ Unlike other filters, this leaves the marks intact." (tabulated-list-put-tag (char-to-string mark) t))) (user-error "No packages found"))))) +(defun package-menu-filter-upgradable () + "Filter \"*Packages*\" buffer to show only upgradable packages." + (interactive) + (let ((pkgs (mapcar #'car (package-menu--find-upgrades)))) + (package-menu--filter-by + (lambda (pkg) + (memql (package-desc-name pkg) pkgs)) + "upgradable"))) + (defun package-menu-clear-filter () "Clear any filter currently applied to the \"*Packages*\" buffer." (interactive) -- cgit v1.2.3 From 72bdc44caefc5b77fb7fafeb15e9c58ee6e5f7a8 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Mon, 19 Oct 2020 21:12:04 +0100 Subject: ; Fix last change in modus-themes.texi * doc/misc/modus-themes.texi (How do the themes look like): Update xref with new spelling. --- doc/misc/modus-themes.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/misc/modus-themes.texi b/doc/misc/modus-themes.texi index 383073c00d0..de3ccd27c4b 100644 --- a/doc/misc/modus-themes.texi +++ b/doc/misc/modus-themes.texi @@ -177,7 +177,7 @@ display that draw attention to details and important aspects in the design of the themes. They also showcase the numerous customization options. -@xref{Customisation Options, , Customisation options}. +@xref{Customization Options}. @node Learn about the latest changes @section Learn about the latest changes -- cgit v1.2.3 From 196d6c851c7d154f6e660456e287a46eed2c8898 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 20 Oct 2020 03:14:36 +0200 Subject: Make a bookmark test more robust * test/lisp/bookmark-tests.el (bookmark-tests-insert-annotation): Make test more robust by not being timing dependent. --- test/lisp/bookmark-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lisp/bookmark-tests.el b/test/lisp/bookmark-tests.el index d0162889a86..6745e4c1d8a 100644 --- a/test/lisp/bookmark-tests.el +++ b/test/lisp/bookmark-tests.el @@ -312,7 +312,7 @@ the lexically-bound variable `buffer'." (with-bookmark-test (should-error (bookmark-insert-annotation "a missing bookmark")) (bookmark-insert-annotation "name") - (should (equal (buffer-string) (bookmark-default-annotation-text "name")))) + (should (string-match "Type the annotation" (buffer-string)))) (with-bookmark-test (bookmark-set-annotation "name" "some stuff") (bookmark-insert-annotation "name") -- cgit v1.2.3 From e7b8c93f94a2f7ccab5a872d6454f312a2a37a70 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 20 Oct 2020 03:21:16 +0200 Subject: * lisp/image-file.el: Use lexical-binding. --- lisp/image-file.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/image-file.el b/lisp/image-file.el index 22366c89e6a..3b4f5722518 100644 --- a/lisp/image-file.el +++ b/lisp/image-file.el @@ -1,4 +1,4 @@ -;;; image-file.el --- support for visiting image files +;;; image-file.el --- support for visiting image files -*- lexical-binding:t -*- ;; ;; Copyright (C) 2000-2020 Free Software Foundation, Inc. ;; @@ -90,7 +90,7 @@ the variable is set using \\[customize]." t) "\\'")))) (mapconcat - 'identity + #'identity (delq nil (list exts-regexp image-file-name-regexps (car (rassq 'imagemagick image-type-file-name-regexps)))) -- cgit v1.2.3 From 117d58ace75fc210c15e6815d965b080466edc55 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 20 Oct 2020 13:07:25 +0200 Subject: Preserve all `eval' elements from both .dir-locals files * lisp/files.el (dir-locals-read-from-dir): Preserve all `eval' elements from both .dir-locals files (bug#44066). --- lisp/emacs-lisp/seq.el | 1 + lisp/files.el | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 9073f9c7a51..4656277ea16 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -474,6 +474,7 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil." (seq-reverse sequence1) '())) +;;;###autoload (cl-defgeneric seq-group-by (function sequence) "Apply FUNCTION to each element of SEQUENCE. Separate the elements of SEQUENCE into an alist using the results as diff --git a/lisp/files.el b/lisp/files.el index c2c58dae934..bbc8f881590 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4301,9 +4301,27 @@ Return the new class name, which is a symbol named DIR." (if (not (and newvars variables)) (or newvars variables) (require 'map) - (map-merge-with 'list (lambda (a b) (map-merge 'list a b)) - variables - newvars)))))) + ;; We want to make the variable setting from + ;; newvars (the second .dir-locals file) take + ;; presedence over the old variables, but we also + ;; want to preserve all `eval' elements as is from + ;; both lists. + (map-merge-with + 'list + (lambda (a b) + (let ((ag + (seq-group-by + (lambda (e) (eq (car e) 'eval)) a)) + (bg + (seq-group-by + (lambda (e) (eq (car e) 'eval)) b))) + (append (map-merge 'list + (assoc-default nil ag) + (assoc-default nil bg)) + (assoc-default t ag) + (assoc-default t bg)))) + variables + newvars)))))) (setq success latest)) (setq variables (dir-locals--sort-variables variables)) (dir-locals-set-class-variables class-name variables) -- cgit v1.2.3 From 2e2a8e5491bc6259a9ebe8c703c1c501307953e2 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Tue, 20 Oct 2020 13:09:16 +0200 Subject: Man highlighting: Don't occasionally bold entire sections. * lisp/ansi-color.el (ansi-color-apply-on-region): Always save a restart position in ansi-color-context-region if the region ends with highlighting active. --- lisp/ansi-color.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index 141ad2353e8..c3b2d98c140 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -414,11 +414,17 @@ this." ;; if the rest of the region should have a face, put it there (funcall ansi-color-apply-face-function start-marker end-marker (ansi-color--find-face codes)) - (setq ansi-color-context-region (if codes (list codes))))) + ;; Save a restart position when there are codes active. It's + ;; convenient for man.el's process filter to pass `begin' + ;; positions that overlap regions previously colored; these + ;; `codes' should not be applied to that overlap, so we need + ;; to know where they should really start. + (setq ansi-color-context-region (if codes (list codes end-marker))))) ;; Clean up our temporary markers. (unless (eq start-marker (cadr ansi-color-context-region)) (set-marker start-marker nil)) - (set-marker end-marker nil))) + (unless (eq end-marker (cadr ansi-color-context-region)) + (set-marker end-marker nil)))) (defun ansi-color-apply-overlay-face (beg end face) "Make an overlay from BEG to END, and apply face FACE. -- cgit v1.2.3 From e3fa592899f6999fda9fdaaab3929f346ce67f66 Mon Sep 17 00:00:00 2001 From: Masahiro Nakamura Date: Tue, 20 Oct 2020 13:20:48 +0200 Subject: Fix some mpc.el updating quirks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/mpc.el (mpc-songs-jump-to): Update the status buffer. * lisp/mpc.el (mpc-stop): M-x mpc-stop clears playlist queue. So updating *MPC-Songs* buffer is useful. * lisp/mpc.el (mpc-cmd-delete): I noticed M-x mpc-playlist-delete always messages “Deleted 1 songs” even if playlist queue has more than one songs. This is because mpc-cmd-delete’s sort modifies songs-poss by side effect. Using copy-sequence fixes this (bug#44093). * lisp/mpc.el (mpc-cmd-move): Ditto. --- lisp/mpc.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/mpc.el b/lisp/mpc.el index d22b7ab4506..fade23e3cc2 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -819,8 +819,8 @@ The songs are returned as alists." (defun mpc-cmd-status () (mpc-proc-cmd-to-alist "status")) -(defun mpc-cmd-play () - (mpc-proc-cmd "play") +(defun mpc-cmd-play (&optional sn) + (mpc-proc-cmd (if sn (list "play" sn) "play")) (mpc-status-refresh)) (defun mpc-cmd-seekcur (time) @@ -849,7 +849,7 @@ If PLAYLIST is t or nil or missing, use the main playlist." ;; Sort them from last to first, so the renumbering ;; caused by the earlier deletions don't affect ;; later ones. - (sort song-poss '>)))) + (sort (copy-sequence song-poss) '>)))) (if (stringp playlist) (puthash (cons 'Playlist playlist) nil mpc--find-memoize))) @@ -873,7 +873,7 @@ If PLAYLIST is t or nil or missing, use the main playlist." ;; Sort them from last to first, so the renumbering ;; caused by the earlier deletions affect ;; later ones a bit less. - (sort song-poss '>)))) + (sort (copy-sequence song-poss) '>)))) (if (stringp playlist) (puthash (cons 'Playlist playlist) nil mpc--find-memoize)))) @@ -2089,7 +2089,7 @@ This is used so that they can be compared with `eq', which is needed for ((null (with-current-buffer plbuf (re-search-forward re nil t))) ;; song-file only appears once in the playlist: no ambiguity, ;; we're good to go! - (mpc-proc-cmd (list "play" sn))) + (mpc-cmd-play sn)) (t ;; The song appears multiple times in the playlist. If the current ;; buffer holds not only the destination song but also the current @@ -2391,6 +2391,7 @@ This is used so that they can be compared with `eq', which is needed for (interactive) (mpc-cmd-stop) (mpc-cmd-clear) + (mpc-songs-refresh) (mpc-status-refresh)) (defun mpc-pause () -- cgit v1.2.3 From 4ef8c4a0f4e26f6ea2186a2b80c068b8d93e4993 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 20 Oct 2020 13:28:29 +0200 Subject: Tweak the documentation for define-obsolete-variable-alias * doc/lispref/variables.texi (Variable Aliases): Actually describe the macro parameters (bug#44088). * lisp/emacs-lisp/byte-run.el (define-obsolete-variable-alias): Ditto (bug#44088). --- doc/lispref/variables.texi | 8 ++++++++ lisp/emacs-lisp/byte-run.el | 14 ++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 6c0b3b5be1b..394fb96acbe 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2385,6 +2385,14 @@ equivalent to the following: (defvaralias @var{obsolete-name} @var{current-name} @var{docstring}) (make-obsolete-variable @var{obsolete-name} @var{current-name} @var{when}) @end example + +This macro evaluates all its parameters, and both @var{obsolete-name} +and @var{current-name} should be symbols, so a typical usage would +look like: + +@lisp +(define-obsolete-variable-alias 'foo-thing 'bar-thing "27.1") +@end lisp @end defmac @defun indirect-variable variable diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 5279a57cd0c..27f54d0ca2a 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -432,7 +432,16 @@ ACCESS-TYPE if non-nil should specify the kind of access that will trigger (defmacro define-obsolete-variable-alias (obsolete-name current-name &optional when docstring) "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete. -This uses `defvaralias' and `make-obsolete-variable' (which see). + +WHEN should be a string indicating when the variable was first +made obsolete, for example a date or a release number. + +This macro evaluates all its parameters, and both OBSOLETE-NAME +and CURRENT-NAME should be symbols, so a typical usage would look like: + + (define-obsolete-variable-alias 'foo-thing 'bar-thing \"27.1\") + +This macro uses `defvaralias' and `make-obsolete-variable' (which see). See the Info node `(elisp)Variable Aliases' for more details. If CURRENT-NAME is a defcustom or a defvar (more generally, any variable @@ -446,9 +455,6 @@ dumped with Emacs). This is so that any user customizations are applied before the defcustom tries to initialize the variable (this is due to the way `defvaralias' works). -WHEN should be a string indicating when the variable was first -made obsolete, for example a date or a release number. - For the benefit of Customize, if OBSOLETE-NAME has any of the following properties, they are copied to CURRENT-NAME, if it does not already have them: -- cgit v1.2.3 From 0d25e274d7a087795f2f167fa39ff5509b9ddf31 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 20 Oct 2020 15:01:02 +0200 Subject: ; * etc/tutorials/TUTORIAL.fr: Fix typo. --- etc/tutorials/TUTORIAL.fr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/tutorials/TUTORIAL.fr b/etc/tutorials/TUTORIAL.fr index bc94f9ac626..3148c3f07e7 100644 --- a/etc/tutorials/TUTORIAL.fr +++ b/etc/tutorials/TUTORIAL.fr @@ -917,7 +917,7 @@ que vous recherchez. termine une recherche. Avez-vous vu ce qui se passait ? Emacs, dans une recherche incrĂ©mentale, essaie d'aller sur l'occurrence de la chaĂźne que vous -avec tapĂ©e jusqu'Ă  cet instant. Pour aller sur l'occurrence suivante de +avez tapĂ©e jusqu'Ă  cet instant. Pour aller sur l'occurrence suivante de « curseur », il suffit de refaire C-s : s'il ne trouve rien, Emacs bippe et vous indique que la recherche a Ă©chouĂ©. C-g permet Ă©galement de mettre fin Ă  la recherche. -- cgit v1.2.3 From 01e0357ba77031dfc66a00822a034e561c0c1ccc Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 20 Oct 2020 15:41:04 +0200 Subject: * lisp/language/utf-8-lang.el: Use lexical-binding. --- lisp/language/utf-8-lang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/language/utf-8-lang.el b/lisp/language/utf-8-lang.el index 78fbae3c89d..9e59f61ee10 100644 --- a/lisp/language/utf-8-lang.el +++ b/lisp/language/utf-8-lang.el @@ -1,4 +1,4 @@ -;;; utf-8-lang.el --- generic UTF-8 language environment +;;; utf-8-lang.el --- generic UTF-8 language environment -*- lexical-binding: t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From d3c3fe781424c866ad64ce9a8e3b649b30a0b5ae Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 20 Oct 2020 18:27:47 +0300 Subject: Avoid assertion violations in malformed Unicode escapes * src/lread.c (read_escape): Produce better diagnostic for malformed \u Unicode escapes, while avoiding assertion violation when READCHAR returns -1 because the input is exhausted. (Bug#44084) --- src/lread.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lread.c b/src/lread.c index 4b788e99407..a3d5fd7bb81 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2573,6 +2573,13 @@ read_escape (Lisp_Object readcharfun, bool stringp) while (++count <= unicode_hex_count) { c = READCHAR; + if (c < 0) + { + if (unicode_hex_count > 4) + error ("Malformed Unicode escape: \\U%x", i); + else + error ("Malformed Unicode escape: \\u%x", i); + } /* `isdigit' and `isalpha' may be locale-specific, which we don't want. */ int digit = char_hexdigit (c); -- cgit v1.2.3 From 5f9fb508e6dcc25462b3c9a5595a3ec87903720c Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Tue, 20 Oct 2020 17:27:31 +0200 Subject: * lisp/textmodes/picture.el: Use lexical binding. --- lisp/textmodes/picture.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index 7a82f8f0e6a..5216812b587 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -1,4 +1,4 @@ -;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model +;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model -*- lexical-binding: t -*- ;; Copyright (C) 1985, 1994, 2001-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From 6a946d29a119b9cf7d05c04d5751b18b6438ef4e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 20 Oct 2020 18:26:38 +0200 Subject: Tweak test data for signed package installation * test/lisp/emacs-lisp/package-resources/signed/signed-bad-1.0.el: * test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el: Use lexical-binding. * test/lisp/emacs-lisp/package-resources/signed/update-signatures.sh: New file. * test/lisp/emacs-lisp/package-resources/key.pub: * test/lisp/emacs-lisp/package-resources/key.sec: Add new key. * test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el.sig: * test/lisp/emacs-lisp/package-resources/signed/archive-contents.sig: Update signatures using new key. --- test/lisp/emacs-lisp/package-resources/key.pub | 32 ++++++----- test/lisp/emacs-lisp/package-resources/key.sec | 62 +++++++++++---------- .../package-resources/signed/archive-contents.sig | Bin 287 -> 181 bytes .../package-resources/signed/signed-bad-1.0.el | 2 +- .../package-resources/signed/signed-good-1.0.el | 2 +- .../signed/signed-good-1.0.el.sig | Bin 287 -> 181 bytes .../package-resources/signed/update-signatures.sh | 32 +++++++++++ 7 files changed, 83 insertions(+), 47 deletions(-) create mode 100755 test/lisp/emacs-lisp/package-resources/signed/update-signatures.sh diff --git a/test/lisp/emacs-lisp/package-resources/key.pub b/test/lisp/emacs-lisp/package-resources/key.pub index a326d34e54f..5e2ebc55d35 100644 --- a/test/lisp/emacs-lisp/package-resources/key.pub +++ b/test/lisp/emacs-lisp/package-resources/key.pub @@ -1,18 +1,20 @@ -----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.14 (GNU/Linux) -mQENBFJNB8gBCACfbtpvYrM8V1HM0KFlIwatcEJugHqwOHpr/Z9mrCW0fxyQAW/d -2L+3QVNsN9Tz/K9lLcBUgeR7rhVEzHNqhmhNj/HnikwGqXbIofhp+QbZmBKnAlCz -d77kg8K9lozHtfTkm1gX/7DdPzQKmgi7WOzzi2395wGubeqJLvYaEcqVbI0Eob+E -3CzRjNy/e/Tf3TJRW5etTcdZN6LVuIY7tNCHqlQZTwyycON/hfLTX6cLCnzDsqm/ -NxCuwn9aqP9aGRGfIu7Y+If3zTymvrXEPUN98OEID814bOKdx0uVTZRiSMbvuTGI -8uMa/kpGX/78rqI61gbZV51RFoU7pT2tzwY/ABEBAAG0HkouIFIuIEhhY2tlciA8 -anJoQGV4YW1wbGUuY29tPokBOAQTAQIAIgUCUk0HyAIbAwYLCQgHAwIGFQgCCQoL -BBYCAwECHgECF4AACgkQtpVAhgkYletuhQf+JAyHYhTZNxjq0UYlikuLX8EtYbXX -PB+03J0B73SMzEai5XsiTU2ADxqxwr7pveVK1INf+IGLiiXBlQq+4DSOvQY4xLfp -58jTOYRV1ECvlXK/JtvVOwufXREADaydf9l/MUxA5G2PPBWIuQknh3ysPSsx68OJ -SzNHFwklLn0DKc4WloE/GLDpTzimnCg7QGzuUo3Iilpjdy8EvTdI5d3jx/mGJIwI -goB+YZgyxSPM+GjDwh5DEwD7OexNqqa7RynnmU0epmlYyi9UufCHLwgiiEIzjpWi -6+iF+CQ45ZAKncovByenIUv73J3ImOudrsskeAHBmahljv1he6uV9Egj2Q== -=b5Kg +mI0EX48EbAEEANrsWXyZ4MRZRjVbLAh5jX/+1+31oB/aJ/q/5DkH1qUHJf0La9LC +sykUSM3H2u5VWLytX/ozrxIRYX13GR2xBxyJlUkDWB209AAVLFrjSp1yUX/Sb5SU +Kb7p421ZAeHiOxfnLRuErFZkTfzY19mUCyw4cdamw430V3mUC9uns/d9ABEBAAG0 +LUouIFJhbmRvbSBIYWNrZXIgKFRFU1QgS0VZKSA8anJoQGV4YW1wbGUub3JnPojO +BBMBCgA4FiEEHP310DrP36xrZ1kSMKdkJgeTYhoFAl+PBGwCGwMFCwkIBwIGFQoJ +CAsCBBYCAwECHgECF4AACgkQMKdkJgeTYhq9MQP7BYkCk8r5G777Ilp8kWjsEIo3 +aDX9jORiNfMAGys/aLjjEajHFAlTQKfSLm/VXLDYtK28c8ACjThQagaDF46MRWqQ +rFFiH4IAZRgj2ELj+/j1ljQZjGjKR2Yx4BCDhbumz8zeMSPL6yFT5+8LOMUAtdv4 +lEPWXW0AycylbdbE7024jQRfjwRsAQQApjTw9kONmSVouCi8ZIQwwYiA9tLzbSZv +CYxbJ6KH0icRhBLfdb1hL/Kn8x3k+xll9A0c/ABVkMxRcbQkY98xsFck7E2GcvnC +sY+w/NdcUUZJYMB3l2MH5ojCbOk5jSAZzxzeFcJhNAhmLqomMHg2LI6KDVey6iYU +FxyIpIQ3SlkAEQEAAYi2BBgBCgAgFiEEHP310DrP36xrZ1kSMKdkJgeTYhoFAl+P +BGwCGwwACgkQMKdkJgeTYhrtywQAhoCR/skBSQWWBI10N0qhtdlNxbpvK8ErSPKw +wS74Pq407Zv0VD9ual/HC3Uet2z8LeG9ZwU4Jd23g96fmJt7AM9CQWrOhC242JYr +YSqWxANyek8otsvppJNHtt2Stmknv7XbJFFB1JDC8WKo8lVo9/MkmzROxuEFEvOU +Yn923VI= +=NRtx -----END PGP PUBLIC KEY BLOCK----- diff --git a/test/lisp/emacs-lisp/package-resources/key.sec b/test/lisp/emacs-lisp/package-resources/key.sec index d21e6ae9a45..dbc80f43cb7 100644 --- a/test/lisp/emacs-lisp/package-resources/key.sec +++ b/test/lisp/emacs-lisp/package-resources/key.sec @@ -1,33 +1,35 @@ -----BEGIN PGP PRIVATE KEY BLOCK----- -Version: GnuPG v1.4.14 (GNU/Linux) -lQO+BFJNB8gBCACfbtpvYrM8V1HM0KFlIwatcEJugHqwOHpr/Z9mrCW0fxyQAW/d -2L+3QVNsN9Tz/K9lLcBUgeR7rhVEzHNqhmhNj/HnikwGqXbIofhp+QbZmBKnAlCz -d77kg8K9lozHtfTkm1gX/7DdPzQKmgi7WOzzi2395wGubeqJLvYaEcqVbI0Eob+E -3CzRjNy/e/Tf3TJRW5etTcdZN6LVuIY7tNCHqlQZTwyycON/hfLTX6cLCnzDsqm/ -NxCuwn9aqP9aGRGfIu7Y+If3zTymvrXEPUN98OEID814bOKdx0uVTZRiSMbvuTGI -8uMa/kpGX/78rqI61gbZV51RFoU7pT2tzwY/ABEBAAH+AwMCKCCpPNXkXuVgF7cz -eByuvgIO7wImDYGOdJqsASSzV4q0u1acnGtlxg7WphKDF9RnC5+1ZZ1ZcrBcv2uJ -xZm2jHdjqM3FmgQTN70GVzO1nKEur2wxlKotG4Q+8BtaRDwHdKpQFk+QW9aInH3C -BkNWTK97iFwZaoUGxKuRJb35qjMe3SsDE7kdbtOqO+tOeppRVeOOZCn7F33ir/6i -j2gmIME6LFDzvBi6YAyMBSh90Ak70HJINt0QfXlZf5MtX1NaxaEcnsRmwwcNqxh9 -JvcC9q4WrR92NhHCHI+lOsAe7hbwo/VkwRjSSx0HdKkx6kvdcNj/9LeX/jykzLvg -kEqvAqT4Jmk57W2seqvpNcAO+eUVrJ5D1OR6khsUtikPp2pQH5MDXJDGcie+ZAFb -w6BwoWBDBjooKtfuP0LKqrdtJG2JLe6yhBhWvfqHPBlUU1SsA7a5aTCLo8FiqgEI -Kyy60zMx/2Mi48oN1a/mAoV1MTWLhOVUWJlIHM7nVLj1OaX0316LcLX/uTLTq40p -apHKwERanzY7f8ROiv/Fa/J+9cCsfOLKfjFAjpBVUVoOb39HsyS/vvkGMY4kgaD6 -K6r9JPdsaoYvsLkxk5HyHF7Mk2uS1z1EIArD2/3lRiX6ag+IU1Nl3XDkgfZj06K3 -juS84dGF8CmN49uOEjzAJAQZH9jTs5OKzUuZhGJF+gt0L78vLOoKRr8bu1N1GPqU -wnS908HWruXzjJl1CAhnuCa8FnDaU+tmEKjYpWuelx85kolpMW7LT5gOFZr84MIj -Kq3Rt2hU6qQ7Cdy1ep531YKkmyh9Y4l/Tgir1OtnQQqtNuwHI497l7qAUnKZBBHZ -guApjS9BoHsRXkw2mgDssZ+khOwj/xJm876nFSiQeCD0aIbU/4zJ9e2HUOJAZI1r -d7QeSi4gUi4gSGFja2VyIDxqcmhAZXhhbXBsZS5jb20+iQE4BBMBAgAiBQJSTQfI -AhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRC2lUCGCRiV626FB/4kDIdi -FNk3GOrRRiWKS4tfwS1htdc8H7TcnQHvdIzMRqLleyJNTYAPGrHCvum95UrUg1/4 -gYuKJcGVCr7gNI69BjjEt+nnyNM5hFXUQK+Vcr8m29U7C59dEQANrJ1/2X8xTEDk -bY88FYi5CSeHfKw9KzHrw4lLM0cXCSUufQMpzhaWgT8YsOlPOKacKDtAbO5SjciK -WmN3LwS9N0jl3ePH+YYkjAiCgH5hmDLFI8z4aMPCHkMTAPs57E2qprtHKeeZTR6m -aVjKL1S58IcvCCKIQjOOlaLr6IX4JDjlkAqdyi8HJ6chS/vcnciY652uyyR4AcGZ -qGWO/WF7q5X0SCPZ -=5FZK +lQIGBF+PBGwBBADa7Fl8meDEWUY1WywIeY1//tft9aAf2if6v+Q5B9alByX9C2vS +wrMpFEjNx9ruVVi8rV/6M68SEWF9dxkdsQcciZVJA1gdtPQAFSxa40qdclF/0m+U +lCm+6eNtWQHh4jsX5y0bhKxWZE382NfZlAssOHHWpsON9Fd5lAvbp7P3fQARAQAB +/gcDAngNw4ppSPBe/w734cz++xNEv0TDgwxGBWp2wGSwWao04Nl1U4LkjiIy+dkc +uUPwEZMvxXwMcq10PPH26ifP8Xfi/zANXUoLJ0DsG6rtE3BcSC9MPFe3EJENtcIP +a0jFLsbi72aBzolNEDCZCv93znXFPekaXw/RAeeFLJz8GR2Sx6bHbTJKklXgWPHw +C5Dw6xr/kEZktgjlhjkx280STpLGaFO4jiiGZ4Obp5ePp7kyOzDUzaimdZgJwClT +VbZDNQMTzgQrBOP8doXlo9euW4Wo1IYBIOwgeYieM3ZA9YjJAmp4lFnk/KFYt0Ak +0H9IWzDU8VERcU4B04PSXahzvB1Ii7C7bbHxPyuu6sAfMK8DRkrGjwgAlrhuWNLX +M07acT/E9Pm+mBlDcdkyKB2LfwgaVb9F3C25sfcFSvc5p+sqgZp1Zx7Qg9pOhQjw +U7Ln+96c0bUl+iQKdm3TGjOXAFUHYXbRkx2cJ4gxnMVNj0D68xBtBSm0LUouIFJh +bmRvbSBIYWNrZXIgKFRFU1QgS0VZKSA8anJoQGV4YW1wbGUub3JnPojOBBMBCgA4 +FiEEHP310DrP36xrZ1kSMKdkJgeTYhoFAl+PBGwCGwMFCwkIBwIGFQoJCAsCBBYC +AwECHgECF4AACgkQMKdkJgeTYhq9MQP7BYkCk8r5G777Ilp8kWjsEIo3aDX9jORi +NfMAGys/aLjjEajHFAlTQKfSLm/VXLDYtK28c8ACjThQagaDF46MRWqQrFFiH4IA +ZRgj2ELj+/j1ljQZjGjKR2Yx4BCDhbumz8zeMSPL6yFT5+8LOMUAtdv4lEPWXW0A +ycylbdbE702dAgYEX48EbAEEAKY08PZDjZklaLgovGSEMMGIgPbS820mbwmMWyei +h9InEYQS33W9YS/yp/Md5PsZZfQNHPwAVZDMUXG0JGPfMbBXJOxNhnL5wrGPsPzX +XFFGSWDAd5djB+aIwmzpOY0gGc8c3hXCYTQIZi6qJjB4NiyOig1XsuomFBcciKSE +N0pZABEBAAH+BwMCXeUOBwcOsxb/AY6rnHmgACNTGwIa5vgelw0qfET0ms/YzVrN +ufikyV9dEWVxJyuTKav978wanPu7VcCh0pTjL2nTm2nZWyRJN4gb3UIC0MA1xfB2 +yPLTCmsGeJhVOqi4Af/r06mk+NOQ96ivOA2CJuw1LSpcUtuYxB5t/grGyEojYjRP +s0Htvf2bfN9KbFJ26DGsfYzC8bCxm9szPFHBQjw4NboCigUSAHmkoTW01aWZU9Vq +brY4cWhdmCqHgfmsQgzP3LfaAQ6kJ/bkuKef7z57lz5XmlyjMQGWcZWp5xf2n81p +BV6unaIPyavzkKVAXizVfNiHNJgK9PoVoEOJkPLjRfMxVmFSGN/oF7lVTRWfOIwo +68rtNPhr6UzE4ArGHYv/pK3kijUp5daWmfrySWPcwoVAaR3mIIVs/1rhd9aZrwn6 +Q07Yo5u11rH9b8anZQF3BdTcrnU9pUzLYlFPnfhtyGqhikQILtPTf0iwr8hpG9b2 +Zoi2BBgBCgAgFiEEHP310DrP36xrZ1kSMKdkJgeTYhoFAl+PBGwCGwwACgkQMKdk +JgeTYhrtywQAhoCR/skBSQWWBI10N0qhtdlNxbpvK8ErSPKwwS74Pq407Zv0VD9u +al/HC3Uet2z8LeG9ZwU4Jd23g96fmJt7AM9CQWrOhC242JYrYSqWxANyek8otsvp +pJNHtt2Stmknv7XbJFFB1JDC8WKo8lVo9/MkmzROxuEFEvOUYn923VI= +=2DW8 -----END PGP PRIVATE KEY BLOCK----- diff --git a/test/lisp/emacs-lisp/package-resources/signed/archive-contents.sig b/test/lisp/emacs-lisp/package-resources/signed/archive-contents.sig index 658edd3f60e..dac168b0e4c 100644 Binary files a/test/lisp/emacs-lisp/package-resources/signed/archive-contents.sig and b/test/lisp/emacs-lisp/package-resources/signed/archive-contents.sig differ diff --git a/test/lisp/emacs-lisp/package-resources/signed/signed-bad-1.0.el b/test/lisp/emacs-lisp/package-resources/signed/signed-bad-1.0.el index 3734823876e..ff070c6526f 100644 --- a/test/lisp/emacs-lisp/package-resources/signed/signed-bad-1.0.el +++ b/test/lisp/emacs-lisp/package-resources/signed/signed-bad-1.0.el @@ -1,4 +1,4 @@ -;;; signed-bad.el --- A single-file package with bad signature +;;; signed-bad.el --- A single-file package with bad signature -*- lexical-binding: t -*- ;; Author: J. R. Hacker ;; Version: 1.0 diff --git a/test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el b/test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el index 22718df2763..60b1b8663d9 100644 --- a/test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el +++ b/test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el @@ -1,4 +1,4 @@ -;;; signed-good.el --- A single-file package with good signature +;;; signed-good.el --- A single-file package with good signature -*- lexical-binding: t -*- ;; Author: J. R. Hacker ;; Version: 1.0 diff --git a/test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el.sig b/test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el.sig index 747918794ca..5b1c721e32a 100644 Binary files a/test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el.sig and b/test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el.sig differ diff --git a/test/lisp/emacs-lisp/package-resources/signed/update-signatures.sh b/test/lisp/emacs-lisp/package-resources/signed/update-signatures.sh new file mode 100755 index 00000000000..a48c9bb1aa2 --- /dev/null +++ b/test/lisp/emacs-lisp/package-resources/signed/update-signatures.sh @@ -0,0 +1,32 @@ +#! /bin/sh + +# Generate a new key and update the signatures for tests. + +# Copyright (C) 2020 Free Software Foundation, Inc. + +# 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 . + +export GPG_AGENT="" +KEYRING="./key.ring" +TRUSTDB="./trust.db" +GPG="gpg --no-default-keyring --trustdb-name $TRUSTDB --keyring $KEYRING --yes" + +rm $KEYRING +$GPG --full-generate-key +$GPG --export --armor > "../key.pub" +$GPG --export-secret-keys -armor > "../key.sec" +$GPG --detach-sign --sign "./archive-contents" +$GPG --detach-sign --sign "./signed-good-1.0.el" -- cgit v1.2.3 From ec4f2723c13321f2abe6aa57035146d80b640db6 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 20 Oct 2020 17:28:26 +0100 Subject: Simplify syntax of shortdoc face specs * lisp/emacs-lisp/shortdoc.el: Remove unused dependency. (shortdoc-section, shortdoc-example): Use newer (DISPLAY . PLIST) face spec syntax. --- lisp/emacs-lisp/shortdoc.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index f6309c7652e..7ae6d53a21b 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -24,7 +24,6 @@ ;;; Code: -(require 'macroexp) (require 'seq) (eval-when-compile (require 'cl-lib)) @@ -34,18 +33,16 @@ (defface shortdoc-section '((((class color) (background dark)) - (:inherit variable-pitch - :background "#303030" :extend t)) + :inherit variable-pitch :background "#303030" :extend t) (((class color) (background light)) - (:inherit variable-pitch - :background "#f0f0f0" :extend t))) + :inherit variable-pitch :background "#f0f0f0" :extend t)) "Face used for a section.") (defface shortdoc-example '((((class color) (background dark)) - (:background "#202020" :extend t)) + :background "#202020" :extend t) (((class color) (background light)) - (:background "#e8e8e8" :extend t))) + :background "#e8e8e8" :extend t)) "Face used for examples.") (defvar shortdoc--groups nil) -- cgit v1.2.3 From 1841b13282473b0ed8c591974e89bd781026180d Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 20 Oct 2020 17:35:29 +0100 Subject: Simplify regexp in last change to woman.el * lisp/woman.el (woman-decode-region): Use simpler character alternative instead of alternation. --- lisp/woman.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/woman.el b/lisp/woman.el index 52f610b569f..96ae7fe5794 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -2292,7 +2292,7 @@ Currently set only from \\='\\\" t in the first line of the source file.") ;; Ignore the \, and \/ kerning operators. See ;; https://www.gnu.org/software/groff/manual/groff.html#Ligatures-and-Kerning (goto-char (point-min)) - (while (re-search-forward "\\\\,\\|\\\\/" nil t) + (while (re-search-forward "\\\\[,/]" nil t) (replace-match "" t t)) ;; Hide unpaddable and digit-width spaces \(space) and \0: -- cgit v1.2.3 From 4a575eb18cca3eed5019f2d2d2abeea1f0c07005 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 22 Sep 2020 00:16:22 +0200 Subject: byte-compile-file: Make optional LOAD argument obsolete * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Declare optional LOAD argument obsolete. Adjust callers. (Bug#38072) (byte-recompile-file): Declare optional LOAD argument obsolete. * doc/lispref/compile.texi (Compilation Functions): Update documentation to reflect above obsoletion. * etc/NEWS: Announce above obsoletion. --- doc/lispref/compile.texi | 5 +---- etc/NEWS | 5 +++++ lisp/emacs-lisp/bytecomp.el | 15 +++++++++------ lisp/org/org.el | 3 ++- lisp/progmodes/elisp-mode.el | 3 ++- lisp/speedbar.el | 2 +- test/lisp/emacs-lisp/bytecomp-tests.el | 7 ++++--- 7 files changed, 24 insertions(+), 16 deletions(-) diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index e979fda41eb..ad8afaae608 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -164,7 +164,7 @@ echo area, but if @var{arg} is non-@code{nil}, it inserts the result in the current buffer after the form it has compiled. @end deffn -@deffn Command byte-compile-file filename &optional load +@deffn Command byte-compile-file filename This function compiles a file of Lisp code named @var{filename} into a file of byte-code. The output file's name is made by changing the @samp{.el} suffix into @samp{.elc}; if @var{filename} does not end in @@ -180,9 +180,6 @@ input file is read. This command returns @code{t} if there were no errors and @code{nil} otherwise. When called interactively, it prompts for the file name. -If @var{load} is non-@code{nil}, this command loads the compiled file -after compiling it. Interactively, @var{load} is the prefix argument. - @example @group $ ls -l push* diff --git a/etc/NEWS b/etc/NEWS index c571fa95d18..f3e3d9a1b6e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1500,6 +1500,11 @@ This is no longer supported, and setting this variable has no effect. ** The macro 'with-displayed-buffer-window' is now obsolete. Use macro 'with-current-buffer-window' with action alist entry 'body-function'. ++++ +** `byte-compile-file' optional argument LOAD is now obsolete. +To load the file after byte-compiling, add a call to 'load' from Lisp +or use 'M-x emacs-lisp-byte-compile-and-load' interactively. + ** The metamail.el library is now marked obsolete. --- diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 90809a929b9..b63d06a5849 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1845,10 +1845,9 @@ compile FILENAME. If optional argument ARG is 0, it compiles the input file even if the `.elc' file does not exist. Any other non-nil value of ARG means to ask the user. -If optional argument LOAD is non-nil, loads the file after compiling. - If compilation is needed, this functions returns the result of `byte-compile-file'; otherwise it returns `no-byte-compile'." + (declare (advertised-calling-convention (filename &optional force arg) "28.1")) (interactive (let ((file buffer-file-name) (file-name nil) @@ -1877,7 +1876,9 @@ If compilation is needed, this functions returns the result of (progn (if (and noninteractive (not byte-compile-verbose)) (message "Compiling %s..." filename)) - (byte-compile-file filename load)) + (byte-compile-file filename) + (when load + (load (if (file-exists-p dest) dest filename)))) (when load (load (if (file-exists-p dest) dest filename))) 'no-byte-compile))) @@ -1901,8 +1902,10 @@ If compilation is needed, this functions returns the result of "Compile a file of Lisp code named FILENAME into a file of byte code. The output file's name is generated by passing FILENAME to the function `byte-compile-dest-file' (which see). -With prefix arg (noninteractively: 2nd arg), LOAD the file after compiling. -The value is non-nil if there were no errors, nil if errors." +The value is non-nil if there were no errors, nil if errors. + +See also `emacs-lisp-byte-compile-and-load'." + (declare (advertised-calling-convention (filename) "28.1")) ;; (interactive "fByte compile file: \nP") (interactive (let ((file buffer-file-name) @@ -2068,7 +2071,7 @@ The value is non-nil if there were no errors, nil if errors." (insert (format "%S\n" (cons var filename)))) (write-region (point-min) (point-max) dynvar-file))))) (if load - (load target-file)) + (load target-file)) t)))) ;;; compiling a single function diff --git a/lisp/org/org.el b/lisp/org/org.el index 7733198c588..1ab8ab68880 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -223,7 +223,8 @@ byte-compiled before it is loaded." (org-babel-tangle-file file tangled-file "emacs-lisp")) (if compile (progn - (byte-compile-file tangled-file 'load) + (byte-compile-file tangled-file) + (load tangled-file) (message "Compiled and loaded %s" tangled-file)) (load-file tangled-file) (message "Loaded %s" tangled-file)))) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index dbbb1274faa..eed73f57918 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -196,7 +196,8 @@ All commands in `lisp-mode-shared-map' are inherited by this map.") (if (and (buffer-modified-p) (y-or-n-p (format "Save buffer %s first? " (buffer-name)))) (save-buffer)) - (byte-recompile-file buffer-file-name nil 0 t)) + (byte-recompile-file buffer-file-name nil 0) + (load buffer-file-name)) (defun emacs-lisp-macroexpand () "Macroexpand the form after point. diff --git a/lisp/speedbar.el b/lisp/speedbar.el index aab6a3a1283..9c5f028e4ab 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -1392,7 +1392,7 @@ Argument ARG represents to force a refresh past any caches that may exist." (if (and (file-exists-p f) (string-match "\\.el\\'" f)) (progn (dframe-select-attached-frame speedbar-frame) - (byte-compile-file f nil) + (byte-compile-file f) (select-frame sf) (speedbar-reset-scanners))) )) diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index a9dcf152617..ea5aacd7912 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -444,8 +444,8 @@ Subtests signal errors if something goes wrong." (if compile (let ((byte-compile-dest-file-function (lambda (e) elcfile))) - (byte-compile-file elfile t)) - (load elfile nil 'nomessage))) + (byte-compile-file elfile))) + (load elfile nil 'nomessage)) (when elfile (delete-file elfile)) (when elcfile (delete-file elcfile))))) (put 'test-byte-comp-compile-and-load 'lisp-indent-function 1) @@ -646,7 +646,8 @@ literals (Bug#20852)." (setq bytecomp-tests--foobar (bytecomp-tests--foobar)))) (print form (current-buffer))) (write-region (point-min) (point-max) source nil 'silent) - (byte-compile-file source t) + (byte-compile-file source) + (load source) (should (equal bytecomp-tests--foobar (cons 1 2))))) (ert-deftest bytecomp-tests--test-no-warnings-with-advice () -- cgit v1.2.3 From 6c58d900427e8195c5cfc37e7422bdb0bc73c047 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 20 Oct 2020 19:10:51 +0200 Subject: Make more load-hooks obsolete (Bug#21563) * lisp/progmodes/dcl-mode.el (dcl-mode): * lisp/progmodes/idlw-complete-structtag.el: Recommend with-eval-after-load instead of load-hooks. * lisp/calc/calc-ext.el (calc-ext-load-hook): * lisp/emacs-lisp/bytecomp.el (bytecomp-load-hook): * lisp/emacs-lisp/cl-extra.el (cl-extra-load-hook): * lisp/emacs-lisp/cl-macs.el (cl-macs-load-hook): * lisp/emacs-lisp/cl-seq.el (cl-seq-load-hook): * lisp/gnus/message.el (message-load-hook): * lisp/gnus/nnheader.el (nnheader-load-hook): * lisp/gnus/nnmail.el (nnmail-load-hook): * lisp/progmodes/dcl-mode.el (dcl-mode-load-hook): * lisp/textmodes/tex-mode.el (tex-mode-load-hook): * lisp/whitespace.el (whitespace-load-hook): Obsolete for with-eval-after-load. Note that these variables are never declared, but the byte-compiler will still warn about them if used. --- lisp/calc/calc-ext.el | 2 ++ lisp/emacs-lisp/bytecomp.el | 2 ++ lisp/emacs-lisp/cl-extra.el | 2 ++ lisp/emacs-lisp/cl-macs.el | 2 ++ lisp/emacs-lisp/cl-seq.el | 2 ++ lisp/gnus/message.el | 2 ++ lisp/gnus/nnheader.el | 2 ++ lisp/gnus/nnmail.el | 2 ++ lisp/progmodes/dcl-mode.el | 5 +++-- lisp/progmodes/idlw-complete-structtag.el | 7 +++---- lisp/textmodes/tex-mode.el | 2 ++ lisp/whitespace.el | 3 ++- 12 files changed, 26 insertions(+), 7 deletions(-) diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index c48d1595822..23248ce1bd5 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -3458,6 +3458,8 @@ A command spec is a command name symbol, a keyboard macro string, a list containing a numeric entry string, or nil. A key may contain additional specs for Inverse, Hyperbolic, and Inv+Hyp.") +(make-obsolete-variable 'calc-ext-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'calc-ext-load-hook) (provide 'calc-ext) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index b63d06a5849..a547b672b1a 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -5259,6 +5259,8 @@ and corresponding effects." byte-compile-variable-ref)))) nil) +(make-obsolete-variable 'bytecomp-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'bytecomp-load-hook) ;;; bytecomp.el ends here diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 5bf74792c08..23c784f9f8e 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -910,6 +910,8 @@ Outputs to the current buffer." (mapc #'cl--describe-class-slot cslots)))) +(make-obsolete-variable 'cl-extra-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'cl-extra-load-hook) ;; Local variables: diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 147a0a8f5a4..1501ed43082 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -3430,6 +3430,8 @@ STRUCT and SLOT-NAME are symbols. INST is a structure instance." (nth (cl-struct-slot-offset ,struct-type ,slot-name) ,inst) (aref ,inst (cl-struct-slot-offset ,struct-type ,slot-name))))))) +(make-obsolete-variable 'cl-macs-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'cl-macs-load-hook) ;; Local variables: diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el index f90cce9b471..d34d50172df 100644 --- a/lisp/emacs-lisp/cl-seq.el +++ b/lisp/emacs-lisp/cl-seq.el @@ -1042,6 +1042,8 @@ Atoms are compared by `eql'; cons cells are compared recursively. (and (not (consp cl-x)) (not (consp cl-y)) (cl--check-match cl-x cl-y))) +(make-obsolete-variable 'cl-seq-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'cl-seq-load-hook) ;; Local variables: diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 7d897391973..150f70e240f 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -8863,6 +8863,8 @@ will then start up Emacs ready to compose mail." (provide 'message) +(make-obsolete-variable 'message-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'message-load-hook) ;; Local Variables: diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index 67dc379ef81..2952e20928b 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -1067,6 +1067,8 @@ See `find-file-noselect' for the arguments." (setq nnheader-last-message-time now) (apply 'nnheader-message args)))) +(make-obsolete-variable 'nnheader-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'nnheader-load-hook) (provide 'nnheader) diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index b6308140fc9..57801d6f9e6 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -2082,6 +2082,8 @@ Doesn't change point." (format "%S" split) "\n")))) +(make-obsolete-variable 'nnmail-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'nnmail-load-hook) (provide 'nnmail) diff --git a/lisp/progmodes/dcl-mode.el b/lisp/progmodes/dcl-mode.el index ab3321f6868..ca45795adc0 100644 --- a/lisp/progmodes/dcl-mode.el +++ b/lisp/progmodes/dcl-mode.el @@ -557,8 +557,7 @@ Variables controlling indentation style and extra features: dcl-imenu-label-call Change the text that is used as sub-listing labels in imenu. -Loading this package calls the value of the variable -`dcl-mode-load-hook' with no args, if that value is non-nil. +To run code after DCL mode has loaded, use `with-eval-after-load'. Turning on DCL mode calls the value of the variable `dcl-mode-hook' with no args, if that value is non-nil. @@ -2192,6 +2191,8 @@ otherwise return nil." (provide 'dcl-mode) +(make-obsolete-variable 'dcl-mode-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'dcl-mode-load-hook) ; for your customizations ;;; dcl-mode.el ends here diff --git a/lisp/progmodes/idlw-complete-structtag.el b/lisp/progmodes/idlw-complete-structtag.el index 3bc3971f5ee..120cfcd12ba 100644 --- a/lisp/progmodes/idlw-complete-structtag.el +++ b/lisp/progmodes/idlw-complete-structtag.el @@ -53,11 +53,10 @@ ;; ;; INSTALLATION ;; ============ -;; Put this file on the emacs load path and load it with the following -;; line in your init file: +;; Load it with the following line in your init file: ;; -;; (add-hook 'idlwave-load-hook -;; (lambda () (require 'idlw-complete-structtag))) +;; (with-eval-after-load 'idlwave +;; (require 'idlw-complete-structtag)) ;; ;; DESCRIPTION ;; =========== diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 11db25cb7a2..37ab11ad89f 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -3541,6 +3541,8 @@ There might be text before point." (process-send-region tex-chktex--process (point-min) (point-max)) (process-send-eof tex-chktex--process)))) +(make-obsolete-variable 'tex-mode-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'tex-mode-load-hook) (provide 'tex-mode) diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 669057811a5..94ed6dc47fe 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -2473,7 +2473,8 @@ It should be added buffer-locally to `write-file-functions'." (provide 'whitespace) - +(make-obsolete-variable 'whitespace-load-hook + "use `with-eval-after-load' instead." "28.1") (run-hooks 'whitespace-load-hook) -- cgit v1.2.3 From 39bf2160f3bb69c181f2ffcd54b7316fb0bf3145 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 20 Oct 2020 20:14:24 +0200 Subject: Use lexical-binding in m4-mode.el * lisp/progmodes/m4-mode.el: Use lexical-binding. Remove redundant :group args. * lisp/progmodes/m4-mode.el (m4-m4-buffer, m4-m4-region): Quote function symbols as such. --- lisp/progmodes/m4-mode.el | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lisp/progmodes/m4-mode.el b/lisp/progmodes/m4-mode.el index 95fead9b374..ec0f425de92 100644 --- a/lisp/progmodes/m4-mode.el +++ b/lisp/progmodes/m4-mode.el @@ -1,4 +1,4 @@ -;;; m4-mode.el --- m4 code editing commands for Emacs +;;; m4-mode.el --- m4 code editing commands for Emacs -*- lexical-binding:t -*- ;; Copyright (C) 1996-1997, 2001-2020 Free Software Foundation, Inc. @@ -48,14 +48,12 @@ "File name of the m4 executable. If m4 is not in your PATH, set this to an absolute file name." :version "24.4" - :type 'file - :group 'm4) + :type 'file) ;;options to m4 (defcustom m4-program-options nil "Options to pass to `m4-program'." - :type '(repeat string) - :group 'm4) + :type '(repeat string)) ;;to use --prefix-builtins, you can use ;;(defconst m4-program-options '("-P")) @@ -72,8 +70,7 @@ If m4 is not in your PATH, set this to an absolute file name." (defcustom m4-mode-hook nil "Hook called by `m4-mode'." - :type 'hook - :group 'm4) + :type 'hook) ;;this may still need some work (defvar m4-mode-syntax-table @@ -125,7 +122,7 @@ If m4 is not in your PATH, set this to an absolute file name." (interactive) (shell-command-on-region (point-min) (point-max) - (mapconcat 'identity (cons m4-program m4-program-options) "\s") + (mapconcat #'identity (cons m4-program m4-program-options) "\s") "*m4-output*" nil) (switch-to-buffer-other-window "*m4-output*")) @@ -134,7 +131,7 @@ If m4 is not in your PATH, set this to an absolute file name." (interactive) (shell-command-on-region (point) (mark) - (mapconcat 'identity (cons m4-program m4-program-options) "\s") + (mapconcat #'identity (cons m4-program m4-program-options) "\s") "*m4-output*" nil) (switch-to-buffer-other-window "*m4-output*")) -- cgit v1.2.3 From 39271ed108380494667ab680fc71b800f9ea5097 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 20 Oct 2020 20:02:29 +0100 Subject: ; Fix last change to idlw-complete-structtag.el --- lisp/progmodes/idlw-complete-structtag.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/idlw-complete-structtag.el b/lisp/progmodes/idlw-complete-structtag.el index 120cfcd12ba..4cb82786aef 100644 --- a/lisp/progmodes/idlw-complete-structtag.el +++ b/lisp/progmodes/idlw-complete-structtag.el @@ -56,7 +56,7 @@ ;; Load it with the following line in your init file: ;; ;; (with-eval-after-load 'idlwave -;; (require 'idlw-complete-structtag)) +;; (require 'idlw-complete-structtag)) ;; ;; DESCRIPTION ;; =========== -- cgit v1.2.3 From 8a91d055b289979a750b81c4ecfdbe44bdd68481 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 20 Oct 2020 19:00:52 -0400 Subject: * lisp/outline.el: Use lexical-binding Remove redundant `group` arguments. (outline-level): Move before first use. (outline-mode): Use `setq-local`. (outline-isearch-open-invisible-function): Give it a non-nil default. --- lisp/outline.el | 121 +++++++++++++++++++++++--------------------------------- 1 file changed, 49 insertions(+), 72 deletions(-) diff --git a/lisp/outline.el b/lisp/outline.el index b9806bc187e..47e6528859f 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1,4 +1,4 @@ -;;; outline.el --- outline mode commands for Emacs +;;; outline.el --- outline mode commands for Emacs -*- lexical-binding: t; -*- ;; Copyright (C) 1986, 1993-1995, 1997, 2000-2020 Free Software ;; Foundation, Inc. @@ -166,7 +166,7 @@ in the file it applies to.") ;; Remove extra separator (cdr ;; Flatten the major mode's menus into a single menu. - (apply 'append + (apply #'append (mapcar (lambda (x) (if (consp x) ;; Add a separator between each @@ -196,47 +196,45 @@ in the file it applies to.") (defface outline-1 '((t :inherit font-lock-function-name-face)) - "Level 1." - :group 'outlines) + "Level 1.") (defface outline-2 '((t :inherit font-lock-variable-name-face)) - "Level 2." - :group 'outlines) + "Level 2.") (defface outline-3 '((t :inherit font-lock-keyword-face)) - "Level 3." - :group 'outlines) + "Level 3.") (defface outline-4 '((t :inherit font-lock-comment-face)) - "Level 4." - :group 'outlines) + "Level 4.") (defface outline-5 '((t :inherit font-lock-type-face)) - "Level 5." - :group 'outlines) + "Level 5.") (defface outline-6 '((t :inherit font-lock-constant-face)) - "Level 6." - :group 'outlines) + "Level 6.") (defface outline-7 '((t :inherit font-lock-builtin-face)) - "Level 7." - :group 'outlines) + "Level 7.") (defface outline-8 '((t :inherit font-lock-string-face)) - "Level 8." - :group 'outlines) + "Level 8.") (defvar outline-font-lock-faces [outline-1 outline-2 outline-3 outline-4 outline-5 outline-6 outline-7 outline-8]) + +(defvar outline-level #'outline-level + "Function of no args to compute a header's nesting level in an outline. +It can assume point is at the beginning of a header line and that the match +data reflects the `outline-regexp'.") +;;;###autoload(put 'outline-level 'risky-local-variable t) (defun outline-font-lock-face () "Return one of `outline-font-lock-faces' for current level." @@ -279,21 +277,20 @@ beginning of the line. The longer the match, the deeper the level. Turning on outline mode calls the value of `text-mode-hook' and then of `outline-mode-hook', if they are non-nil." - (make-local-variable 'line-move-ignore-invisible) - (setq line-move-ignore-invisible t) + (setq-local line-move-ignore-invisible t) ;; Cause use of ellipses for invisible text. (add-to-invisibility-spec '(outline . t)) - (set (make-local-variable 'paragraph-start) - (concat paragraph-start "\\|\\(?:" outline-regexp "\\)")) + (setq-local paragraph-start + (concat paragraph-start "\\|\\(?:" outline-regexp "\\)")) ;; Inhibit auto-filling of header lines. - (set (make-local-variable 'auto-fill-inhibit-regexp) outline-regexp) - (set (make-local-variable 'paragraph-separate) - (concat paragraph-separate "\\|\\(?:" outline-regexp "\\)")) - (set (make-local-variable 'font-lock-defaults) - '(outline-font-lock-keywords t nil nil backward-paragraph)) - (setq imenu-generic-expression - (list (list nil (concat "^\\(?:" outline-regexp "\\).*$") 0))) - (add-hook 'change-major-mode-hook 'outline-show-all nil t)) + (setq-local auto-fill-inhibit-regexp outline-regexp) + (setq-local paragraph-separate + (concat paragraph-separate "\\|\\(?:" outline-regexp "\\)")) + (setq-local font-lock-defaults + '(outline-font-lock-keywords t nil nil backward-paragraph)) + (setq-local imenu-generic-expression + (list (list nil (concat "^\\(?:" outline-regexp "\\).*$") 0))) + (add-hook 'change-major-mode-hook #'outline-show-all nil t)) (defvar outline-minor-mode-map) @@ -302,7 +299,6 @@ Turning on outline mode calls the value of `text-mode-hook' and then of The value of this variable is checked as part of loading Outline mode. After that, changing the prefix key requires manipulating keymaps." :type 'key-sequence - :group 'outlines :initialize 'custom-initialize-default :set (lambda (sym val) (define-key outline-minor-mode-map outline-minor-mode-prefix nil) @@ -316,7 +312,6 @@ After that, changing the prefix key requires manipulating keymaps." See the command `outline-mode' for more information on this mode." nil " Outl" (list (cons [menu-bar] outline-minor-mode-menu-bar-map) (cons outline-minor-mode-prefix outline-mode-prefix-map)) - :group 'outlines (if outline-minor-mode (progn ;; Turn off this mode if we change major modes. @@ -331,14 +326,8 @@ See the command `outline-mode' for more information on this mode." (remove-from-invisibility-spec '(outline . t)) ;; When turning off outline mode, get rid of any outline hiding. (outline-show-all))) - -(defvar outline-level 'outline-level - "Function of no args to compute a header's nesting level in an outline. -It can assume point is at the beginning of a header line and that the match -data reflects the `outline-regexp'.") -;;;###autoload(put 'outline-level 'risky-local-variable t) -(defvar outline-heading-alist () +(defvar-local outline-heading-alist () "Alist associating a heading for every possible level. Each entry is of the form (HEADING . LEVEL). This alist is used two ways: to find the heading corresponding to @@ -357,7 +346,6 @@ within each set. For example in texinfo mode: Instead of sorting the entries in each set, you can also separate the sets with nil.") -(make-variable-buffer-local 'outline-heading-alist) ;; This used to count columns rather than characters, but that made ^L ;; appear to be at level 2 instead of 1. Columns would be better for @@ -479,9 +467,9 @@ nil for WHICH, or do not pass any argument)." (if current-prefix-arg nil 'subtree)))) (cond ((eq which 'region) - (outline-map-region 'outline-promote (region-beginning) (region-end))) + (outline-map-region #'outline-promote (region-beginning) (region-end))) (which - (outline-map-region 'outline-promote + (outline-map-region #'outline-promote (point) (save-excursion (outline-get-next-sibling) (point)))) (t @@ -518,9 +506,9 @@ nil for WHICH, or do not pass any argument)." (if current-prefix-arg nil 'subtree)))) (cond ((eq which 'region) - (outline-map-region 'outline-demote (region-beginning) (region-end))) + (outline-map-region #'outline-demote (region-beginning) (region-end))) (which - (outline-map-region 'outline-demote + (outline-map-region #'outline-demote (point) (save-excursion (outline-get-next-sibling) (point)))) (t @@ -700,12 +688,12 @@ This puts point at the start of the current subtree, and mark at the end." (goto-char beg))) -(defvar outline-isearch-open-invisible-function nil +(defvar outline-isearch-open-invisible-function + #'outline-isearch-open-invisible "Function called if `isearch' finishes in an invisible overlay. -The function is called with the overlay as its only argument. -If nil, `outline-show-entry' is called to reveal the invisible text.") +The function is called with the overlay as its only argument.") -(put 'outline 'reveal-toggle-invisible 'outline-reveal-toggle-invisible) +(put 'outline 'reveal-toggle-invisible #'outline-reveal-toggle-invisible) (defun outline-flag-region (from to flag) "Hide or show lines from FROM to TO, according to FLAG. If FLAG is nil then text is shown, while if FLAG is t the text is hidden." @@ -719,7 +707,7 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden." (overlay-put o 'invisible 'outline) (overlay-put o 'isearch-open-invisible (or outline-isearch-open-invisible-function - 'outline-isearch-open-invisible)))) + #'outline-isearch-open-invisible)))) ;; Seems only used by lazy-lock. I.e. obsolete. (run-hooks 'outline-view-change-hook)) @@ -779,8 +767,7 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden." (outline-end-of-heading) (outline-flag-region (point) (progn (outline-next-preface) (point)) t))) -(define-obsolete-function-alias - 'hide-entry 'outline-hide-entry "25.1") +(define-obsolete-function-alias 'hide-entry #'outline-hide-entry "25.1") (defun outline-show-entry () "Show the body directly following this heading. @@ -796,8 +783,7 @@ Show the heading too, if it is currently invisible." (point))) nil))) -(define-obsolete-function-alias - 'show-entry 'outline-show-entry "25.1") +(define-obsolete-function-alias 'show-entry #'outline-show-entry "25.1") (defun outline-hide-body () "Hide all body lines in buffer, leaving all headings visible. @@ -805,8 +791,7 @@ Note that this does not hide the lines preceding the first heading line." (interactive) (outline-hide-region-body (point-min) (point-max))) -(define-obsolete-function-alias - 'hide-body 'outline-hide-body "25.1") +(define-obsolete-function-alias 'hide-body #'outline-hide-body "25.1") (defun outline-hide-region-body (start end) "Hide all body lines between START and END, but not headings." @@ -830,23 +815,21 @@ Note that this does not hide the lines preceding the first heading line." (run-hooks 'outline-view-change-hook)) (define-obsolete-function-alias - 'hide-region-body 'outline-hide-region-body "25.1") + 'hide-region-body #'outline-hide-region-body "25.1") (defun outline-show-all () "Show all of the text in the buffer." (interactive) (outline-flag-region (point-min) (point-max) nil)) -(define-obsolete-function-alias - 'show-all 'outline-show-all "25.1") +(define-obsolete-function-alias 'show-all #'outline-show-all "25.1") (defun outline-hide-subtree () "Hide everything after this heading at deeper levels." (interactive) (outline-flag-subtree t)) -(define-obsolete-function-alias - 'hide-subtree 'outline-hide-subtree "25.1") +(define-obsolete-function-alias 'hide-subtree #'outline-hide-subtree "25.1") (defun outline-hide-leaves () "Hide the body after this heading and at deeper levels." @@ -859,16 +842,14 @@ Note that this does not hide the lines preceding the first heading line." (point) (progn (outline-end-of-subtree) (point))))) -(define-obsolete-function-alias - 'hide-leaves 'outline-hide-leaves "25.1") +(define-obsolete-function-alias 'hide-leaves #'outline-hide-leaves "25.1") (defun outline-show-subtree () "Show everything after this heading at deeper levels." (interactive) (outline-flag-subtree nil)) -(define-obsolete-function-alias - 'show-subtree 'outline-show-subtree "25.1") +(define-obsolete-function-alias 'show-subtree #'outline-show-subtree "25.1") (defun outline-show-heading () "Show the current heading and move to its end." @@ -923,8 +904,7 @@ of the current heading, or to 1 if the current line is not a heading." (outline-flag-region (1- (point)) (point) nil)))) (run-hooks 'outline-view-change-hook)) -(define-obsolete-function-alias - 'hide-sublevels 'outline-hide-sublevels "25.1") +(define-obsolete-function-alias 'hide-sublevels #'outline-hide-sublevels "25.1") (defun outline-hide-other () "Hide everything except current body and parent and top-level headings. @@ -942,8 +922,7 @@ This also unhides the top heading-less body, if any." nil)))) (run-hooks 'outline-view-change-hook)) -(define-obsolete-function-alias - 'hide-other 'outline-hide-other "25.1") +(define-obsolete-function-alias 'hide-other #'outline-hide-other "25.1") (defun outline-toggle-children () "Show or hide the current subtree depending on its current state." @@ -987,8 +966,7 @@ This also unhides the top heading-less body, if any." (interactive) (outline-show-children 1000)) -(define-obsolete-function-alias - 'show-branches 'outline-show-branches "25.1") +(define-obsolete-function-alias 'show-branches #'outline-show-branches "25.1") (defun outline-show-children (&optional level) "Show all direct subheadings of this heading. @@ -1017,8 +995,7 @@ Default is enough to cause the following heading to appear." (if (eobp) (point-max) (1+ (point))))))) (run-hooks 'outline-view-change-hook)) -(define-obsolete-function-alias - 'show-children 'outline-show-children "25.1") +(define-obsolete-function-alias 'show-children #'outline-show-children "25.1") -- cgit v1.2.3 From e3229aff5485d35c4855dda71eb1ac29b4ef8ea9 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 21 Oct 2020 12:24:46 +0200 Subject: * etc/HELLO: Keep Javanese System.out.println(""); --- etc/HELLO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/HELLO b/etc/HELLO index 10c4e9e66c8..06c1c433b00 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -59,7 +59,7 @@ Gujarati (àȘ—ુàȘœàȘ°àȘŸàȘ€à«€) àȘšàȘźàȘžà«àȘ€à«‡ unicodeInuktitut (ᐃᓄᒃᑎᑐᑩ) ᐊᐃ latin-iso8859-1Italian (italiano) Ciao / Buon giorno -unicodeJavanese (êŠ§êŠ±êŠ—êŠź) ꊱꊞꊒꊌꊁꊱꊶêŠȘꊁ +unicodeJavanese (êŠ§êŠ±êŠ—êŠź) System.out.println("ꊱꊞꊒꊌꊁꊱꊶêŠȘꊁ"); mule-unicode-0100-24ffKannada (àȕàČšàłàČšàČĄ) àČšàČźàČžàłàȕàČŸàČ° Khmer (ភាសាខ្មែរ) ជំរាបសវរ laoLao (àșžàșČàșȘàșČàș„àșČàș§) àșȘàș°àșšàșČàșàș”àș” / àș‚ໍໃàș«à»‰à»‚àșŠàșàș”àș” -- cgit v1.2.3 From a1fcdeec25be87e8f97ac5c14e6fbf6a4d1eb2d4 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 21 Oct 2020 12:31:12 +0200 Subject: Add emoji to etc/HELLO --- etc/HELLO | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/HELLO b/etc/HELLO index 06c1c433b00..79b08c26535 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -76,6 +76,7 @@ Khmer (ភាសាខ្មែរ) ជំរាបសវរ mule-unicode-0100-24ffSinhala (සිංහග) ආà¶șුබෝවන් latin-iso8859-2Slovak (slovenčina) DobrĂœ deƈ Slovenian (slovenơčina) Pozdravljeni! +Social Media 👋 Spanish (espalatin-iso8859-1ñol) ÂĄHola! Swedish (svenska) Hej / Goddag / HallĂ„ mule-unicode-0100-24ffTamil (àź€àźźàźżàźŽàŻ) àź”àźŁàź•àŻàź•àźźàŻ -- cgit v1.2.3 From 0aa881f231ef8593e3bc2031b59feb1254db8b55 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 13:05:32 +0200 Subject: Use lexical-binding in hfy-cmap.el and add tests * lisp/hfy-cmap.el: Use lexical-binding. (hfy-cmap--parse-buffer): Extract from... (htmlfontify-load-rgb-file): ...here. * test/lisp/hfy-cmap-resources/rgb.txt: * test/lisp/hfy-cmap-tests.el: New files. --- lisp/hfy-cmap.el | 45 ++++++++++++++++------------- test/lisp/hfy-cmap-resources/rgb.txt | 3 ++ test/lisp/hfy-cmap-tests.el | 55 ++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 20 deletions(-) create mode 100644 test/lisp/hfy-cmap-resources/rgb.txt create mode 100644 test/lisp/hfy-cmap-tests.el diff --git a/lisp/hfy-cmap.el b/lisp/hfy-cmap.el index 4cff2a42001..a3398f6e809 100644 --- a/lisp/hfy-cmap.el +++ b/lisp/hfy-cmap.el @@ -1,4 +1,4 @@ -;;; hfy-cmap.el --- Fallback color name -> rgb mapping for `htmlfontify' +;;; hfy-cmap.el --- Fallback color name -> rgb mapping for `htmlfontify' -*- lexical-binding:t -*- ;; Copyright (C) 2002-2003, 2009-2020 Free Software Foundation, Inc. @@ -809,6 +809,22 @@ (defconst hfy-rgb-regex "^\\s-*\\([0-9]+\\)\\s-+\\([0-9]+\\)\\s-+\\([0-9]+\\)\\s-+\\(.+\\)\\s-*$") +(defun hfy-cmap--parse-buffer (buffer) + (with-current-buffer buffer + (let ((end-of-rgb 0) + result) + (goto-char (point-min)) + (htmlfontify-unload-rgb-file) + (while (/= end-of-rgb 1) + (if (looking-at hfy-rgb-regex) + (push (list (match-string 4) + (string-to-number (match-string 1)) + (string-to-number (match-string 2)) + (string-to-number (match-string 3))) + result)) + (setq end-of-rgb (forward-line))) + result))) + ;;;###autoload (defun htmlfontify-load-rgb-file (&optional file) "Load an X11 style rgb.txt FILE. @@ -818,25 +834,14 @@ Loads the variable `hfy-rgb-txt-color-map', which is used by (interactive (list (read-file-name "rgb.txt (equivalent) file: " "" nil t (hfy-rgb-file)))) - (let ((rgb-buffer nil) - (end-of-rgb 0) - (rgb-txt nil)) - (if (and (setq rgb-txt (or file (hfy-rgb-file))) - (file-readable-p rgb-txt)) - (with-current-buffer - (setq rgb-buffer (find-file-noselect rgb-txt 'nowarn)) - (goto-char (point-min)) - (htmlfontify-unload-rgb-file) - (while (/= end-of-rgb 1) - (if (looking-at hfy-rgb-regex) - (setq hfy-rgb-txt-color-map - (cons (list (match-string 4) - (string-to-number (match-string 1)) - (string-to-number (match-string 2)) - (string-to-number (match-string 3))) - hfy-rgb-txt-color-map)) ) - (setq end-of-rgb (forward-line))) - (kill-buffer rgb-buffer))))) + (let ((rgb-buffer nil) + (rgb-txt (or file (hfy-rgb-file)))) + (when (and rgb-txt + (file-readable-p rgb-txt)) + (setq rgb-buffer (find-file-noselect rgb-txt 'nowarn)) + (when-let ((result (hfy-cmap--parse-buffer rgb-buffer))) + (setq hfy-rgb-txt-color-map result)) + (kill-buffer rgb-buffer)))) (defun htmlfontify-unload-rgb-file () "Unload the current color name -> rgb translation map." diff --git a/test/lisp/hfy-cmap-resources/rgb.txt b/test/lisp/hfy-cmap-resources/rgb.txt new file mode 100644 index 00000000000..86a00539909 --- /dev/null +++ b/test/lisp/hfy-cmap-resources/rgb.txt @@ -0,0 +1,3 @@ +255 250 250 snow +248 248 255 ghost white +248 248 255 GhostWhite diff --git a/test/lisp/hfy-cmap-tests.el b/test/lisp/hfy-cmap-tests.el new file mode 100644 index 00000000000..4cdc6ffc827 --- /dev/null +++ b/test/lisp/hfy-cmap-tests.el @@ -0,0 +1,55 @@ +;;; hfy-cmap-tests.el --- tests for hfy-cmap.el -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; 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: + +(require 'ert) +(require 'ert-x) +(require 'hfy-cmap) + +(defconst hfy-cmap-tests--data + (concat "255 250 250 snow\n" + "248 248 255 ghost white\n" + "248 248 255 GhostWhite\n")) + +(defconst hfy-cmap-tests--parsed + '(("GhostWhite" 248 248 255) + ("ghost white" 248 248 255) + ("snow" 255 250 250))) + +(ert-deftest test-hfy-cmap--parse-buffer () + (with-temp-buffer + (insert hfy-cmap-tests--data) + (should (equal (hfy-cmap--parse-buffer (current-buffer)) + hfy-cmap-tests--parsed)))) + +(ert-deftest test-htmlfontify-load-rgb-file () + :tags '(:expensive-test) + (let (hfy-rgb-txt-color-map) + (htmlfontify-load-rgb-file (ert-resource-file "rgb.txt")) + (should (equal hfy-rgb-txt-color-map + hfy-cmap-tests--parsed)))) + +(ert-deftest test-htmlfontify-load-rgb-file/non-existent-file () + (let (hfy-rgb-txt-color-map) + (htmlfontify-load-rgb-file "/non/existent/file") + (should-not hfy-rgb-txt-color-map))) + +(provide 'hfy-cmap-tests) +;;; hfy-cmap-tests.el ends here -- cgit v1.2.3 From 0e6f1e4e80006b03bc85b50aa99b67b9d4c2dd9f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 13:19:02 +0200 Subject: Use lexical-binding in iso-ascii.el * lisp/international/iso-ascii.el: Use lexical-binding. Remove redundant :group args. --- lisp/international/iso-ascii.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/international/iso-ascii.el b/lisp/international/iso-ascii.el index e86efe5827b..0df07d65148 100644 --- a/lisp/international/iso-ascii.el +++ b/lisp/international/iso-ascii.el @@ -1,4 +1,4 @@ -;;; iso-ascii.el --- set up char tables for ISO 8859/1 on ASCII terminals +;;; iso-ascii.el --- set up char tables for ISO 8859/1 on ASCII terminals -*- lexical-binding: t -*- ;; Copyright (C) 1987, 1995, 1998, 2001-2020 Free Software Foundation, ;; Inc. @@ -41,8 +41,7 @@ (defcustom iso-ascii-convenient nil "Non-nil means `iso-ascii' should aim for convenience, not precision." - :type 'boolean - :group 'iso-ascii) + :type 'boolean) (defvar iso-ascii-display-table (make-display-table) "Display table used for ISO-ASCII mode.") -- cgit v1.2.3 From 95a458724dc9402cb35a6ed4a3eb571aada52348 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 13:25:39 +0200 Subject: Use lexical-binding in files-x-tests.el * test/lisp/files-x-tests.el: Use lexical-binding. (remote-null-device): Declare. --- test/lisp/files-x-tests.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/lisp/files-x-tests.el b/test/lisp/files-x-tests.el index d3ed4b5312c..9db198384d0 100644 --- a/test/lisp/files-x-tests.el +++ b/test/lisp/files-x-tests.el @@ -1,4 +1,4 @@ -;;; files-x-tests.el --- tests for files-x.el. +;;; files-x-tests.el --- tests for files-x.el. -*- lexical-binding: t -*- ;; Copyright (C) 2016-2020 Free Software Foundation, Inc. @@ -35,6 +35,7 @@ '((remote-null-device . "/dev/null"))) (defconst files-x-test--variables4 '((remote-null-device . "null"))) +(defvar remote-null-device) (put 'remote-shell-file-name 'safe-local-variable #'identity) (put 'remote-shell-command-switch 'safe-local-variable #'identity) (put 'remote-shell-interactive-switch 'safe-local-variable #'identity) -- cgit v1.2.3 From e656600c965ede7754753800ecf76ad574e7220f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 13:26:57 +0200 Subject: * test/lisp/vc/vc-bzr-tests.el: Use lexical-binding. --- test/lisp/vc/vc-bzr-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lisp/vc/vc-bzr-tests.el b/test/lisp/vc/vc-bzr-tests.el index 408d6e8e23d..d922e98348e 100644 --- a/test/lisp/vc/vc-bzr-tests.el +++ b/test/lisp/vc/vc-bzr-tests.el @@ -1,4 +1,4 @@ -;;; vc-bzr.el --- tests for vc/vc-bzr.el +;;; vc-bzr.el --- tests for vc/vc-bzr.el -*- lexical-binding: t -*- ;; Copyright (C) 2011-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From 8532fa41bb46de2f01698caa70cd26bbdbef149c Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 21 Oct 2020 14:10:58 +0200 Subject: Revert "Add emoji to etc/HELLO" This reverts commit a1fcdeec25be87e8f97ac5c14e6fbf6a4d1eb2d4. There was already an emoji in there. --- etc/HELLO | 1 - 1 file changed, 1 deletion(-) diff --git a/etc/HELLO b/etc/HELLO index 79b08c26535..06c1c433b00 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -76,7 +76,6 @@ Khmer (ភាសាខ្មែរ) ជំរាបសវរ mule-unicode-0100-24ffSinhala (සිංහග) ආà¶șුබෝවන් latin-iso8859-2Slovak (slovenčina) DobrĂœ deƈ Slovenian (slovenơčina) Pozdravljeni! -Social Media 👋 Spanish (espalatin-iso8859-1ñol) ÂĄHola! Swedish (svenska) Hej / Goddag / HallĂ„ mule-unicode-0100-24ffTamil (àź€àźźàźżàźŽàŻ) àź”àźŁàź•àŻàź•àźźàŻ -- cgit v1.2.3 From d72696d3b12bebe6cfc8745ac9b0b8e0db03b686 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 14:49:04 +0200 Subject: Add some top level domains * lisp/mail/mail-extr.el (mail-extr-all-top-level-domains): Add some geographic domains. --- lisp/mail/mail-extr.el | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el index bd9aef17a87..c296f29f9ea 100644 --- a/lisp/mail/mail-extr.el +++ b/lisp/mail/mail-extr.el @@ -1856,6 +1856,11 @@ place. It affects how `mail-extract-address-components' works." ;; https://www.iana.org/cctld/cctld-whois.htm ;; Latest change: 2007/11/15 +;; FIXME: There are over 1500 top level domains, the vast majority of +;; which are not in the below list. Should they be? +;; https://data.iana.org/TLD/tlds-alpha-by-domain.txt +;; https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains + (defconst mail-extr-all-top-level-domains (let ((ob (make-vector 739 0))) (mapc @@ -2145,6 +2150,80 @@ place. It affects how `mail-extract-address-components' works." ("uucp" t "Unix to Unix CoPy") ;; Infrastructure Domains: ("arpa" t "Advanced Research Projects Agency (U.S. DoD)") + ;; Geographic Domains: + ("abudhabi" "Abu Dhabi") + ("africa" "Africa") + ("alsace" "Alsace, France") + ("amsterdam" "Amsterdam, The Netherlands") + ("arab" "League of Arab States") + ("asia" "Asia-Pacific region") + ("bar" "Bar, Montenegro") + ("barcelona" "Barcelona, Spain") + ("bayern" "Bavaria, Germany") + ("bcn" "Barcelona, Spain") + ("berlin" "Berlin, Germany") + ("boston" "Boston, Massachusetts") + ("brussels" "Brussels, Belgium") + ("budapest" "Budapest, Hungary") + ("bzh" "Brittany, France") + ("capetown" "Cape Town, South Africa") + ("cat" "Catalonia, Spain") + ("cologne" "Cologne, Germany") + ("corsica" "Corsica, France") + ("cymru" "Wales, United Kingdom") + ("doha" "Doha") + ("dubai" "Dubai") + ("durban" "Durban, South Africa") + ("eus" "Basque, Spain and France") + ("frl" "Friesland, Netherlands") + ("gal" "Galicia, Spain") + ("gent" "Ghent, Belgium") + ("hamburg" "Hamburg, Germany") + ("helsinki" "Helsinki, Finland") + ("irish" "Ireland") + ("ist" "Ä°stanbul, Turkey") + ("istanbul" "Ä°stanbul, Turkey") + ("joburg" "Johannesburg, South Africa") + ("kiwi" "New Zealanders") + ("koeln" "Cologne, Germany") + ("krd" "Kurdistan") + ("kyoto" "Kyoto, Japan") + ("lat" "Latin America") + ("london" "London, United Kingdom") + ("madrid" "Madrid, Spain") + ("melbourne" "Melbourne, Australia") + ("miami" "Miami, Florida") + ("nagoya" "Nagoya, Japan") + ("nrw" "North Rhine-Westphalia, Germany") + ("nyc" "New York City, New York") + ("okinawa" "Okinawa, Japan") + ("osaka" "Osaka, Japan") + ("paris" "Paris, France") + ("quebec" "QuĂ©bec, Canada") + ("rio" "Rio de Janeiro, Brazil") + ("ruhr" "Ruhr, Germany") + ("ryukyu" "Ryukyu Islands, Japan") + ("saarland" "Saarland, Germany") + ("scot" "Scotland, United Kingdom") + ("stockholm" "Stockholm, Sweden") + ("swiss" "Switzerland") + ("sydney" "Sydney, Australia") + ("taipei" "Taipei, Taiwan") + ("tatar" "Tatars") + ("tirol" "Tyrol, Austria") + ("tokyo" "Tokyo, Japan") + ("vegas" "Las Vegas, Nevada") + ("wales" "Wales, United Kingdom") + ("wien" "Vienna, Austria") + ("yokohama" "Yokohama, Japan") + ("zuerich" "Zurich, Switzerland") + ;; Internationalized Geographic Domains: + ("xn--1qqw23a" "Foshan, China") + ("xn--xhq521b" "Guangdong, China") + ("xn--80adxhks" "Moscow, Russia") + ("xn--p1acf" "Russia") + ("xn--mgbca7dzdo" "Abu Dhabi") + ("xn--ngbrx" "Arab") )) ob)) -- cgit v1.2.3 From 29cb2fdd0c09235a91282f54e81c9856e39bd3ca Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 15:25:45 +0200 Subject: Declare old compat aliases in tcl.el obsolete * lisp/progmodes/tcl.el (tcl-uncomment-region) (tcl-indent-for-comment, add-log-tcl-defun, indent-tcl-exp) (calculate-tcl-indent, tcl-beginning-of-defun, tcl-end-of-defun) (tcl-mark-defun, tcl-mark): Make obsolete. --- lisp/progmodes/tcl.el | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index 33aad2d39f7..717008a0a22 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -1555,21 +1555,21 @@ The first line is assumed to look like \"#!.../program ...\"." (char-to-string char))) string "")) + + ;; -;; Bug reporting. +;; Obsolete. ;; - -;; These are relics kept "just in case". -(defalias 'tcl-uncomment-region 'uncomment-region) -(defalias 'tcl-indent-for-comment 'comment-indent) -(defalias 'add-log-tcl-defun 'tcl-add-log-defun) -(defalias 'indent-tcl-exp 'tcl-indent-exp) -(defalias 'calculate-tcl-indent 'tcl-calculate-indent) -(defalias 'tcl-beginning-of-defun 'beginning-of-defun) -(defalias 'tcl-end-of-defun 'end-of-defun) -(defalias 'tcl-mark-defun 'mark-defun) -(defun tcl-mark () (mark t)) +(define-obsolete-function-alias 'tcl-uncomment-region #'uncomment-region "28.1") +(define-obsolete-function-alias 'tcl-indent-for-comment #'comment-indent "28.1") +(define-obsolete-function-alias 'add-log-tcl-defun #'tcl-add-log-defun "28.1") +(define-obsolete-function-alias 'indent-tcl-exp #'tcl-indent-exp "28.1") +(define-obsolete-function-alias 'calculate-tcl-indent #'tcl-calculate-indent "28.1") +(define-obsolete-function-alias 'tcl-beginning-of-defun #'beginning-of-defun "28.1") +(define-obsolete-function-alias 'tcl-end-of-defun #'end-of-defun "28.1") +(define-obsolete-function-alias 'tcl-mark-defun #'mark-defun "28.1") +(defun tcl-mark () (declare (obsolete nil "28.1")) (mark t)) (provide 'tcl) -- cgit v1.2.3 From 234cf7491872155dbd9716dc4652febefbe3759f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 15:37:13 +0200 Subject: Remove some compat code from uudecode.el and binhex.el * lisp/mail/uudecode.el (uudecode-char-int): Make obsolete. (uudecode-decode-region-internal): Adjust callers. * lisp/mail/binhex.el (binhex-char-int): Make obsolete. (binhex-string-big-endian, binhex-string-little-endian) (binhex-header): Adjust callers. --- lisp/mail/binhex.el | 16 ++++++---------- lisp/mail/uudecode.el | 11 ++++------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/lisp/mail/binhex.el b/lisp/mail/binhex.el index 2c77f88f97b..431c681be01 100644 --- a/lisp/mail/binhex.el +++ b/lisp/mail/binhex.el @@ -29,12 +29,6 @@ ;;; Code: -(eval-and-compile - (defalias 'binhex-char-int - (if (fboundp 'char-int) - 'char-int - 'identity))) - (defgroup binhex nil "Decoding of BinHex (binary-to-hexadecimal) data." :group 'mail @@ -150,14 +144,14 @@ input and write the converted data to its standard output." (defun binhex-string-big-endian (string) (let ((ret 0) (i 0) (len (length string))) (while (< i len) - (setq ret (+ (ash ret 8) (binhex-char-int (aref string i))) + (setq ret (+ (ash ret 8) (aref string i)) i (1+ i))) ret)) (defun binhex-string-little-endian (string) (let ((ret 0) (i 0) (shift 0) (len (length string))) (while (< i len) - (setq ret (+ ret (ash (binhex-char-int (aref string i)) shift)) + (setq ret (+ ret (ash (aref string i) shift)) i (1+ i) shift (+ shift 8))) ret)) @@ -167,11 +161,11 @@ input and write the converted data to its standard output." (let ((pos (point-min)) len) (vector (prog1 - (setq len (binhex-char-int (char-after pos))) + (setq len (char-after pos)) (setq pos (1+ pos))) (buffer-substring pos (setq pos (+ pos len))) (prog1 - (setq len (binhex-char-int (char-after pos))) + (setq len (char-after pos)) (setq pos (1+ pos))) (buffer-substring pos (setq pos (+ pos 4))) (buffer-substring pos (setq pos (+ pos 4))) @@ -323,6 +317,8 @@ If HEADER-ONLY is non-nil only decode header and return filename." (binhex-decode-region-external start end) (binhex-decode-region-internal start end))) +(define-obsolete-function-alias 'binhex-char-int #'identity) + (provide 'binhex) ;;; binhex.el ends here diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el index 945bff35f79..bcbd571b539 100644 --- a/lisp/mail/uudecode.el +++ b/lisp/mail/uudecode.el @@ -24,11 +24,6 @@ ;;; Code: -(defalias 'uudecode-char-int - (if (fboundp 'char-int) - 'char-int - 'identity)) - (defgroup uudecode nil "Decoding of uuencoded data." :group 'mail @@ -140,7 +135,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." ((> (skip-chars-forward uudecode-alphabet end) 0) (setq lim (point)) (setq remain - (logand (- (uudecode-char-int (char-after inputpos)) 32) + (logand (- (char-after inputpos) 32) 63)) (setq inputpos (1+ inputpos)) (if (= remain 0) (setq done t)) @@ -148,7 +143,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." (setq bits (+ bits (logand (- - (uudecode-char-int (char-after inputpos)) 32) + (char-after inputpos) 32) 63))) (if (/= counter 0) (setq remain (1- remain))) (setq counter (1+ counter) @@ -201,6 +196,8 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." (uudecode-decode-region-external start end file-name) (uudecode-decode-region-internal start end file-name))) +(define-obsolete-function-alias 'uudecode-char-int #'identity "28.1") + (provide 'uudecode) ;;; uudecode.el ends here -- cgit v1.2.3 From a497b8e4a41e3223089654da4b36d0fdd51ce555 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 16:09:12 +0200 Subject: Use lexical-binding in bindat.el * lisp/emacs-lisp/bindat.el: Use lexical-binding. (bindat-raw, bindat-idx, bindat-unpack, bindat-pack): Adjust for lexical-binding. (bindat--unpack-group, bindat--length-group): Fix byte-compiler warning about unused variables last and vlen. (bindat--unpack-group, bindat--length-group, bindat--pack-group) (bindat-format-vector): Quote function symbols as such. --- lisp/emacs-lisp/bindat.el | 178 ++++++++++++++++++++++------------------------ 1 file changed, 87 insertions(+), 91 deletions(-) diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index d168c255121..f6f8b7c8ccc 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -1,4 +1,4 @@ -;;; bindat.el --- binary data structure packing and unpacking. +;;; bindat.el --- binary data structure packing and unpacking. -*- lexical-binding: t -*- ;; Copyright (C) 2002-2020 Free Software Foundation, Inc. @@ -193,8 +193,8 @@ ;; Helper functions for structure unpacking. ;; Relies on dynamic binding of BINDAT-RAW and BINDAT-IDX -(defvar bindat-raw) -(defvar bindat-idx) +(defvar bindat-raw nil) +(defvar bindat-idx nil) (defun bindat--unpack-u8 () (prog1 @@ -276,7 +276,7 @@ (t nil))) (defun bindat--unpack-group (spec) - (let (struct last) + (let (struct) (while spec (let* ((item (car spec)) (field (car item)) @@ -298,7 +298,7 @@ type field field nil)) (if (and (consp len) (not (eq type 'eval))) - (setq len (apply 'bindat-get-field struct len))) + (setq len (apply #'bindat-get-field struct len))) (if (not len) (setq len 1)) (cond @@ -330,21 +330,21 @@ (setq data (bindat--unpack-group (cdr case)) cases nil))))) (t - (setq data (bindat--unpack-item type len vectype) - last data))) + (setq data (bindat--unpack-item type len vectype)))) (if data (if field (setq struct (cons (cons field data) struct)) (setq struct (append data struct)))))) struct)) -(defun bindat-unpack (spec bindat-raw &optional bindat-idx) - "Return structured data according to SPEC for binary data in BINDAT-RAW. -BINDAT-RAW is a unibyte string or vector. -Optional third arg BINDAT-IDX specifies the starting offset in BINDAT-RAW." +(defun bindat-unpack (spec raw &optional idx) + "Return structured data according to SPEC for binary data in RAW. +RAW is a unibyte string or vector. +Optional third arg IDX specifies the starting offset in RAW." (when (multibyte-string-p bindat-raw) (error "String is multibyte")) - (unless bindat-idx (setq bindat-idx 0)) + (setq bindat-raw raw) + (setq bindat-idx (or idx 0)) (bindat--unpack-group spec)) (defun bindat-get-field (struct &rest field) @@ -373,74 +373,70 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..." (ip . 4))) (defun bindat--length-group (struct spec) - (let (last) - (while spec - (let* ((item (car spec)) - (field (car item)) - (type (nth 1 item)) - (len (nth 2 item)) - (vectype (and (eq type 'vec) (nth 3 item))) - (tail 3)) - (setq spec (cdr spec)) - (if (and (consp field) (eq (car field) 'eval)) - (setq field (eval (car (cdr field))))) - (if (and type (consp type) (eq (car type) 'eval)) - (setq type (eval (car (cdr type))))) - (if (and len (consp len) (eq (car len) 'eval)) - (setq len (eval (car (cdr len))))) - (if (memq field '(eval fill align struct union)) - (setq tail 2 - len type - type field - field nil)) - (if (and (consp len) (not (eq type 'eval))) - (setq len (apply 'bindat-get-field struct len))) - (if (not len) - (setq len 1)) - (while (eq type 'vec) - (let ((vlen 1)) - (if (consp vectype) - (setq len (* len (nth 1 vectype)) - type (nth 2 vectype)) - (setq type (or vectype 'u8) - vectype nil)))) - (cond - ((eq type 'eval) - (if field - (setq struct (cons (cons field (eval len)) struct)) - (eval len))) - ((eq type 'fill) - (setq bindat-idx (+ bindat-idx len))) - ((eq type 'align) - (while (/= (% bindat-idx len) 0) - (setq bindat-idx (1+ bindat-idx)))) - ((eq type 'struct) - (bindat--length-group - (if field (bindat-get-field struct field) struct) (eval len))) - ((eq type 'repeat) - (let ((index 0) (count len)) - (while (< index count) - (bindat--length-group - (nth index (bindat-get-field struct field)) - (nthcdr tail item)) - (setq index (1+ index))))) - ((eq type 'union) - (let ((tag len) (cases (nthcdr tail item)) case cc) - (while cases - (setq case (car cases) - cases (cdr cases) - cc (car case)) - (if (or (equal cc tag) (equal cc t) - (and (consp cc) (eval cc))) - (progn - (bindat--length-group struct (cdr case)) - (setq cases nil)))))) - (t - (if (setq type (assq type bindat--fixed-length-alist)) - (setq len (* len (cdr type)))) - (if field - (setq last (bindat-get-field struct field))) - (setq bindat-idx (+ bindat-idx len)))))))) + (while spec + (let* ((item (car spec)) + (field (car item)) + (type (nth 1 item)) + (len (nth 2 item)) + (vectype (and (eq type 'vec) (nth 3 item))) + (tail 3)) + (setq spec (cdr spec)) + (if (and (consp field) (eq (car field) 'eval)) + (setq field (eval (car (cdr field))))) + (if (and type (consp type) (eq (car type) 'eval)) + (setq type (eval (car (cdr type))))) + (if (and len (consp len) (eq (car len) 'eval)) + (setq len (eval (car (cdr len))))) + (if (memq field '(eval fill align struct union)) + (setq tail 2 + len type + type field + field nil)) + (if (and (consp len) (not (eq type 'eval))) + (setq len (apply #'bindat-get-field struct len))) + (if (not len) + (setq len 1)) + (while (eq type 'vec) + (if (consp vectype) + (setq len (* len (nth 1 vectype)) + type (nth 2 vectype)) + (setq type (or vectype 'u8) + vectype nil))) + (cond + ((eq type 'eval) + (if field + (setq struct (cons (cons field (eval len)) struct)) + (eval len))) + ((eq type 'fill) + (setq bindat-idx (+ bindat-idx len))) + ((eq type 'align) + (while (/= (% bindat-idx len) 0) + (setq bindat-idx (1+ bindat-idx)))) + ((eq type 'struct) + (bindat--length-group + (if field (bindat-get-field struct field) struct) (eval len))) + ((eq type 'repeat) + (let ((index 0) (count len)) + (while (< index count) + (bindat--length-group + (nth index (bindat-get-field struct field)) + (nthcdr tail item)) + (setq index (1+ index))))) + ((eq type 'union) + (let ((tag len) (cases (nthcdr tail item)) case cc) + (while cases + (setq case (car cases) + cases (cdr cases) + cc (car case)) + (if (or (equal cc tag) (equal cc t) + (and (consp cc) (eval cc))) + (progn + (bindat--length-group struct (cdr case)) + (setq cases nil)))))) + (t + (if (setq type (assq type bindat--fixed-length-alist)) + (setq len (* len (cdr type)))) + (setq bindat-idx (+ bindat-idx len))))))) (defun bindat-length (spec struct) "Calculate bindat-raw length for STRUCT according to bindat SPEC." @@ -557,7 +553,7 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..." type field field nil)) (if (and (consp len) (not (eq type 'eval))) - (setq len (apply 'bindat-get-field struct len))) + (setq len (apply #'bindat-get-field struct len))) (if (not len) (setq len 1)) (cond @@ -596,17 +592,17 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..." (bindat--pack-item last type len vectype) )))))) -(defun bindat-pack (spec struct &optional bindat-raw bindat-idx) +(defun bindat-pack (spec struct &optional raw idx) "Return binary data packed according to SPEC for structured data STRUCT. -Optional third arg BINDAT-RAW is a pre-allocated unibyte string or vector to -pack into. -Optional fourth arg BINDAT-IDX is the starting offset into BINDAT-RAW." - (when (multibyte-string-p bindat-raw) +Optional third arg RAW is a pre-allocated unibyte string or +vector to pack into. +Optional fourth arg IDX is the starting offset into BINDAT-RAW." + (when (multibyte-string-p raw) (error "Pre-allocated string is multibyte")) - (let ((no-return bindat-raw)) - (unless bindat-idx (setq bindat-idx 0)) - (unless bindat-raw - (setq bindat-raw (make-string (+ bindat-idx (bindat-length spec struct)) 0))) + (let ((no-return raw)) + (setq bindat-idx (or idx 0)) + (setq bindat-raw (or raw + (make-string (+ bindat-idx (bindat-length spec struct)) 0))) (bindat--pack-group struct spec) (if no-return nil bindat-raw))) @@ -624,7 +620,7 @@ only that many elements from VECT." (while (> i 0) (setq i (1- i) s (cons (format (if (= i 0) fmt fmt2) (aref vect i)) s))) - (apply 'concat s))) + (apply #'concat s))) (defun bindat-vector-to-dec (vect &optional sep) "Format vector VECT in decimal format separated by dots. -- cgit v1.2.3 From b69f363698b15775ddbffe873a1ddbb9eef73ce4 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 16:59:50 +0200 Subject: Add tests for time.el * lisp/time.el (display-time-update--load) (display-time-update--mail): Extract from... (display-time-update): ...here. * test/lisp/time-tests.el: New file. --- lisp/time.el | 108 +++++++++++++++++++++++++----------------------- test/lisp/time-tests.el | 74 +++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+), 51 deletions(-) create mode 100644 test/lisp/time-tests.el diff --git a/lisp/time.el b/lisp/time.el index cb3a8470edc..440f8ac9c6b 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -284,6 +284,60 @@ Switches from the 1 to 5 to 15 minute load average, and then back to 1." (defvar month) (defvar dayname)) +(defun display-time-update--load () + (if (null display-time-load-average) + "" + (condition-case () + ;; Do not show values less than + ;; `display-time-load-average-threshold'. + (if (> (* display-time-load-average-threshold 100) + (nth display-time-load-average (load-average))) + "" + ;; The load average number is mysterious, so + ;; provide some help. + (let ((str (format " %03d" + (nth display-time-load-average + (load-average))))) + (propertize + (concat (substring str 0 -2) "." (substring str -2)) + 'local-map (make-mode-line-mouse-map + 'mouse-2 'display-time-next-load-average) + 'mouse-face 'mode-line-highlight + 'help-echo (concat + "System load average for past " + (if (= 0 display-time-load-average) + "1 minute" + (if (= 1 display-time-load-average) + "5 minutes" + "15 minutes")) + "; mouse-2: next")))) + (error "")))) + +(defun display-time-update--mail () + (let ((mail-spool-file (or display-time-mail-file + (getenv "MAIL") + (concat rmail-spool-directory + (user-login-name))))) + (cond + (display-time-mail-function + (funcall display-time-mail-function)) + (display-time-mail-directory + (display-time-mail-check-directory)) + ((and (stringp mail-spool-file) + (or (null display-time-server-down-time) + ;; If have been down for 20 min, try again. + (time-less-p 1200 (time-since + display-time-server-down-time)))) + (let ((start-time (current-time))) + (prog1 + (display-time-file-nonempty-p mail-spool-file) + ;; Record whether mail file is accessible. + (setq display-time-server-down-time + (let ((end-time (current-time))) + (and (time-less-p 20 (time-subtract + end-time start-time)) + (float-time end-time)))))))))) + (defun display-time-update () "Update the display-time info for the mode line. However, don't redisplay right now. @@ -291,57 +345,9 @@ However, don't redisplay right now. This is used for things like Rmail `g' that want to force an update which can wait for the next redisplay." (let* ((now (current-time)) - (time (current-time-string now)) - (load (if (null display-time-load-average) - "" - (condition-case () - ;; Do not show values less than - ;; `display-time-load-average-threshold'. - (if (> (* display-time-load-average-threshold 100) - (nth display-time-load-average (load-average))) - "" - ;; The load average number is mysterious, so - ;; provide some help. - (let ((str (format " %03d" - (nth display-time-load-average - (load-average))))) - (propertize - (concat (substring str 0 -2) "." (substring str -2)) - 'local-map (make-mode-line-mouse-map - 'mouse-2 'display-time-next-load-average) - 'mouse-face 'mode-line-highlight - 'help-echo (concat - "System load average for past " - (if (= 0 display-time-load-average) - "1 minute" - (if (= 1 display-time-load-average) - "5 minutes" - "15 minutes")) - "; mouse-2: next")))) - (error "")))) - (mail-spool-file (or display-time-mail-file - (getenv "MAIL") - (concat rmail-spool-directory - (user-login-name)))) - (mail (cond - (display-time-mail-function - (funcall display-time-mail-function)) - (display-time-mail-directory - (display-time-mail-check-directory)) - ((and (stringp mail-spool-file) - (or (null display-time-server-down-time) - ;; If have been down for 20 min, try again. - (time-less-p 1200 (time-since - display-time-server-down-time)))) - (let ((start-time (current-time))) - (prog1 - (display-time-file-nonempty-p mail-spool-file) - ;; Record whether mail file is accessible. - (setq display-time-server-down-time - (let ((end-time (current-time))) - (and (time-less-p 20 (time-subtract - end-time start-time)) - (float-time end-time))))))))) + (time (current-time-string now)) + (load (display-time-update--load)) + (mail (display-time-update--mail)) (24-hours (substring time 11 13)) (hour (string-to-number 24-hours)) (12-hours (int-to-string (1+ (% (+ hour 11) 12)))) diff --git a/test/lisp/time-tests.el b/test/lisp/time-tests.el new file mode 100644 index 00000000000..efb3f491468 --- /dev/null +++ b/test/lisp/time-tests.el @@ -0,0 +1,74 @@ +;;; time-tests.el --- Tests for time.el -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Stefan Kangas + +;; 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 . + +;;; Commentary: + +(require 'ert) +(require 'ert-x) +(require 'time) + +(ert-deftest time-tests-display-time-mail-check-directory () + (let ((display-time-mail-directory (ert-resource-directory))) + (should (display-time-mail-check-directory)))) + +(ert-deftest time-tests-display-time-update--load () + (let ((display-time-load-average 1) + (display-time-load-average-threshold 0)) + (display-time-next-load-average) + (should (string-match (rx string-start " " (+ digit ".")) + (display-time-update--load)))) + (let (display-time-load-average) + (should (equal (display-time-update--load) "")))) + +(ert-deftest time-tests-display-time-update () + (let ((display-time-load-average 1) + (display-time-load-average-threshold 0) + display-time-string) + (display-time-update) + (should (string-match (rx string-start (? digit) digit ":" digit digit + (? (| "AM" "PM")) + " " (+ digit ".")) + display-time-string)))) + +(ert-deftest time-tests-display-time-file-nonempty-p () + (should (display-time-file-nonempty-p (ert-resource-file "non-empty"))) + (should-not (display-time-file-nonempty-p "/non/existent"))) + +(ert-deftest time-tests-world-clock () + (save-window-excursion + (world-clock) + (should (equal (buffer-name) world-clock-buffer-name)) + (should (string-match "New York" (buffer-string))))) + +(ert-deftest time-tests-world-clock/revert-buffer-works () + (save-window-excursion + (world-clock) + (revert-buffer) + (should (string-match "New York" (buffer-string))))) + +(ert-deftest time-tests-emacs-uptime () + (should (string-match "^[0-9.]+ seconds?$" (emacs-uptime "%S")))) + +(ert-deftest time-tests-emacs-init-time () + (should (string-match "^[0-9.]+ seconds?$" (emacs-init-time)))) + +(provide 'time-tests) +;;; time-tests.el ends here -- cgit v1.2.3 From 06373c15248292f924925b6e7344e51ac6708d5f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 17:00:11 +0200 Subject: * lisp/time.el: Use lexical-binding. --- lisp/time.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/time.el b/lisp/time.el index 440f8ac9c6b..63773d42048 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -1,4 +1,4 @@ -;;; time.el --- display time, load and mail indicator in mode line of Emacs +;;; time.el --- display time, load and mail indicator in mode line of Emacs -*- lexical-binding: t -*- ;; Copyright (C) 1985-1987, 1993-1994, 1996, 2000-2020 Free Software ;; Foundation, Inc. -- cgit v1.2.3 From ffbea0d705a278b3c268b7cd44ed0484be8b89c1 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 17:21:46 +0200 Subject: Tweak two time.el tests * test/lisp/time-tests.el (time-tests-display-time-update--load) (time-tests-display-time-update): Tweak tests. --- test/lisp/time-tests.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/lisp/time-tests.el b/test/lisp/time-tests.el index efb3f491468..1a62450cb3a 100644 --- a/test/lisp/time-tests.el +++ b/test/lisp/time-tests.el @@ -33,7 +33,9 @@ (let ((display-time-load-average 1) (display-time-load-average-threshold 0)) (display-time-next-load-average) - (should (string-match (rx string-start " " (+ digit ".")) + (should (string-match (rx string-start " " + (+ (| digit ".")) + string-end) (display-time-update--load)))) (let (display-time-load-average) (should (equal (display-time-update--load) "")))) @@ -43,9 +45,11 @@ (display-time-load-average-threshold 0) display-time-string) (display-time-update) - (should (string-match (rx string-start (? digit) digit ":" digit digit + (should (string-match (rx string-start + (? digit) digit ":" digit digit (? (| "AM" "PM")) - " " (+ digit ".")) + " " (+ (| digit ".")) + string-end) display-time-string)))) (ert-deftest time-tests-display-time-file-nonempty-p () -- cgit v1.2.3 From 743bd40126af56ef2b388d05e53758237b77019b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 17:31:47 +0200 Subject: ; * lisp/emacs-lisp/bindat.el (bindat-unpack): Fix typo. --- lisp/emacs-lisp/bindat.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index f6f8b7c8ccc..95581c40a46 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -341,7 +341,7 @@ "Return structured data according to SPEC for binary data in RAW. RAW is a unibyte string or vector. Optional third arg IDX specifies the starting offset in RAW." - (when (multibyte-string-p bindat-raw) + (when (multibyte-string-p raw) (error "String is multibyte")) (setq bindat-raw raw) (setq bindat-idx (or idx 0)) -- cgit v1.2.3 From e29cace60afdab04ff20c4f4043a3ee64ec9d01d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 21 Oct 2020 18:32:51 +0300 Subject: Avoid rare crashes while producing line numbers * src/xdisp.c (maybe_produce_line_number): Prevent freeing of realized faces for as long as we are using lnum_face_id and current_lnum_face_id for producing glyphs. (Bug#44111) --- src/xdisp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index 6c401d0abb9..03dc4bec712 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22793,6 +22793,10 @@ maybe_produce_line_number (struct it *it) int lnum_face_id = merge_faces (it->w, Qline_number, 0, DEFAULT_FACE_ID); int current_lnum_face_id = merge_faces (it->w, Qline_number_current_line, 0, DEFAULT_FACE_ID); + /* From here onwards, we must prevent freeing realized faces, because + we are using the above 2 face IDs for the glyphs we produce. */ + bool save_free_realized_faces = inhibit_free_realized_faces; + inhibit_free_realized_faces = true; /* Compute point's line number if needed. */ if ((EQ (Vdisplay_line_numbers, Qrelative) || EQ (Vdisplay_line_numbers, Qvisual) @@ -22922,10 +22926,13 @@ maybe_produce_line_number (struct it *it) it->lnum_width = 0; it->lnum_pixel_width = 0; bidi_unshelve_cache (itdata, false); + inhibit_free_realized_faces = save_free_realized_faces; return; } } + inhibit_free_realized_faces = save_free_realized_faces; + /* Record the width in pixels we need for the line number display. */ it->lnum_pixel_width = tem_it.current_x; /* Copy the produced glyphs into IT's glyph_row. */ -- cgit v1.2.3 From 4bd8add2e3cc668c04b634e8d5a915c7d6803e17 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Wed, 21 Oct 2020 18:15:14 +0200 Subject: Convert artist.el to lexical binding * lisp/textmodes/artist.el (artist-system, (artist-flood-fill): Remove binding of the obsolete variables binary-process-input, binary-process-output and input-queue. (artist-down-mouse-1): Fix mistyped 'echo-keystrokes'; bind it to 0. (artist-fill-rect, artist-fill-square, artist-pen-set-arrow-points) (artist-spray-clear-circle, artist-spray-set-radius) (artist-draw-ellipse-with-0-height, artist-fill-ellipse) (artist-ff-is-topmost-line, artist-ff-is-bottommost-line) (artist-set-arrow-points-for-2points, artist-key-undraw-continously) (artist-key-undraw-poly, artist-key-undraw-1point) (artist-key-undraw-2points, artist-key-do-continously-1point) (artist-key-set-point-1point, artist-shift-has-changed) (artist-mouse-draw-continously, artist-mouse-draw-1point) (artist-submit-bug-report): Suppress warnings about unused parameters which are there for function signature commonality. Remove unused variables. --- lisp/textmodes/artist.el | 62 +++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index e98072c11f6..5ce9a90ea65 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -1,4 +1,4 @@ -;;; artist.el --- draw ascii graphics with your mouse +;;; artist.el --- draw ascii graphics with your mouse -*- lexical-binding: t -*- ;; Copyright (C) 2000-2020 Free Software Foundation, Inc. @@ -1844,9 +1844,7 @@ Return a list (RETURN-CODE STDOUT STDERR)." nil)) (tmp-stdout-buffer (get-buffer-create (concat "*artist-" program "*"))) - (tmp-stderr-file-name (make-temp-file "artist-stdout.")) - (binary-process-input nil) ; for msdos - (binary-process-output nil)) + (tmp-stderr-file-name (make-temp-file "artist-stdout."))) ;; Prepare stdin (if stdin (artist-string-to-file stdin tmp-stdin-file-name)) @@ -2721,7 +2719,7 @@ SHAPE-INFO is a list of four straight lines." ;; Filling rectangles and squares ;; -(defun artist-fill-rect (rect x1 y1 x2 y2) +(defun artist-fill-rect (_rect x1 y1 x2 y2) "Fill rectangle RECT from X1,Y1 to X2,Y2." (let ((x (1+ (min x1 x2))) (y (1+ (min y1 y2))) @@ -2733,7 +2731,7 @@ SHAPE-INFO is a list of four straight lines." (artist-replace-chars artist-fill-char w) (setq y (1+ y)))))) -(defun artist-fill-square (square x1 y1 x2 y2) +(defun artist-fill-square (_square x1 y1 x2 y2) "Fill a SQUARE from X1,Y1 to X2,Y2." (let* ((square-corners (artist-rect-corners-squarify x1 y1 x2 y2)) (new-x1 (elt square-corners 0)) @@ -2795,7 +2793,7 @@ to append to the end of the list, when doing free-hand drawing)." (setq artist-key-poly-point-list (list (cons x1 y1)))) -(defun artist-pen-set-arrow-points (x1 y1) +(defun artist-pen-set-arrow-points (_x1 _y1) "Set arrow points for pen drawing using X1, Y1. Also, the `artist-key-poly-point-list' is reversed." @@ -2996,11 +2994,11 @@ Returns a list of points. Each point is on the form (X1 . Y1)." ;; Step to next spray point (setq spray-points (cdr spray-points))))) -(defun artist-spray-clear-circle (circle x1 y1 x2 y2) +(defun artist-spray-clear-circle (circle _x1 _y1 _x2 _y2) "Clear circle CIRCLE at X1, Y1 through X2, Y2." (artist-undraw-circle circle)) -(defun artist-spray-set-radius (circle x1 y1 x2 y2) +(defun artist-spray-set-radius (_circle x1 y1 x2 y2) "Set spray radius from CIRCLE at X1, Y1 through X2, Y2." (let ((dx (- x2 x1)) (dy (- y2 y1))) @@ -3493,8 +3491,7 @@ POINT-LIST is a list of vectors on the form [X Y SAVED-CHAR NEW-CHAR]. FILL-INFO is a list of vectors on the form [X Y ELLIPSE-WIDTH-ON-THIS-LINE]. The Y-RADIUS must be 0, but the X-RADIUS must not be 0." - (let ((point-list nil) - (width (max (- (abs (* 2 x-radius)) 1))) + (let ((width (max (- (abs (* 2 x-radius)) 1))) (left-edge (1+ (- x1 (abs x-radius)))) (line-char (if artist-line-char-set artist-line-char ?-)) (i 0) @@ -3602,7 +3599,7 @@ FILL-INFO is a list of vectors on the form [X Y ELLIPSE-WIDTH-ON-THIS-LINE]." ; ; Filling ellipses ; -(defun artist-fill-ellipse (ellipse x y x-radius y-radius) +(defun artist-fill-ellipse (ellipse _x _y _x-radius _y-radius) "Fill an ELLIPSE centered at X,Y with radius X-RADIUS and Y-RADIUS." (let ((fill-info (aref (artist-2point-get-shapeinfo ellipse) 1))) (mapcar @@ -3722,11 +3719,11 @@ original contents of that area in the buffer." (setq x (1+ x))) last-x))) -(defun artist-ff-is-topmost-line (x y) +(defun artist-ff-is-topmost-line (_x y) "Determine whether the position X,Y is on the topmost line or not." (= y 0)) -(defun artist-ff-is-bottommost-line (x y) +(defun artist-ff-is-bottommost-line (_x y) "Determine whether the position X,Y is on the bottommost line or not." (save-excursion (goto-char (point-max)) @@ -3742,7 +3739,6 @@ original contents of that area in the buffer." (defun artist-flood-fill (x1 y1) "Flood-fill starting at X1, Y1. Fill with the char in `artist-fill-char'." (let ((stack nil) - (input-queue nil) ;; We are flood-filling the area that has this character. (c (artist-get-char-at-xy-conv x1 y1)) (artist-fill-char (if artist-fill-char-set @@ -3884,7 +3880,7 @@ Optional argument STATE can be used to set state (default is nil)." (setq artist-arrow-point-2 (artist-make-arrow-point xn yn dirn)))) -(defun artist-set-arrow-points-for-2points (shape x1 y1 x2 y2) +(defun artist-set-arrow-points-for-2points (shape _x1 _y1 _x2 _y2) "Generic function for setting arrow-points for 2-point shapes. The 2-point shape SHAPE is drawn from X1, Y1 to X2, Y2." (let* ((endpoint1 (artist-2point-get-endpoint1 shape)) @@ -3906,28 +3902,24 @@ The 2-point shape SHAPE is drawn from X1, Y1 to X2, Y2." ;; on the draw-how ;; -(defun artist-key-undraw-continously (x y) +(defun artist-key-undraw-continously (_x _y) "Undraw current continuous shape with point at X, Y." ;; No undraw-info for continuous shapes nil) -(defun artist-key-undraw-poly (x y) +(defun artist-key-undraw-poly (_x _y) "Undraw current poly shape with point at X, Y." - (let ((undraw-fn (artist-go-get-undraw-fn-from-symbol artist-curr-go)) - (x1 (artist-endpoint-get-x artist-key-endpoint1)) - (y1 (artist-endpoint-get-y artist-key-endpoint1))) + (let ((undraw-fn (artist-go-get-undraw-fn-from-symbol artist-curr-go))) (artist-funcall undraw-fn artist-key-shape))) -(defun artist-key-undraw-1point (x y) +(defun artist-key-undraw-1point (_x _y) "Undraw current 1-point shape at X, Y." ;; No undraw-info for 1-point shapes nil) -(defun artist-key-undraw-2points (x y) +(defun artist-key-undraw-2points (_x _y) "Undraw current 2-point shape at X, Y." - (let ((undraw-fn (artist-go-get-undraw-fn-from-symbol artist-curr-go)) - (x1 (artist-endpoint-get-x artist-key-endpoint1)) - (y1 (artist-endpoint-get-y artist-key-endpoint1))) + (let ((undraw-fn (artist-go-get-undraw-fn-from-symbol artist-curr-go))) (artist-funcall undraw-fn artist-key-shape))) (defun artist-key-undraw-common () @@ -4071,7 +4063,7 @@ Trimming here means removing white space at end of a line." (setq artist-key-shape (artist-funcall draw-fn x1 y1 x2 y2)))))) -(defun artist-key-do-continously-1point (x y) +(defun artist-key-do-continously-1point (_x _y) "Update current 1-point shape at X,Y." ;; Nothing to do continuously for operations ;; where we have only one input point @@ -4271,8 +4263,7 @@ If optional argument THIS-IS-LAST-POINT is non-nil, this point is the last." (defun artist-key-set-point-1point (x y) "Set point for current 1-point shape at X,Y." - (let ((draw-fn (artist-go-get-draw-fn-from-symbol artist-curr-go)) - (init-fn (artist-go-get-init-fn-from-symbol artist-curr-go)) + (let ((init-fn (artist-go-get-init-fn-from-symbol artist-curr-go)) (prep-fill-fn (artist-go-get-prep-fill-fn-from-symbol artist-curr-go)) (exit-fn (artist-go-get-exit-fn-from-symbol artist-curr-go)) (draw-fn (artist-go-get-draw-fn-from-symbol artist-curr-go)) @@ -4802,7 +4793,7 @@ If optional argument STATE is positive, turn borders on." (orig-draw-region-min-y artist-draw-region-min-y) (orig-draw-region-max-y artist-draw-region-max-y) (orig-pointer-shape (if (eq window-system 'x) x-pointer-shape nil)) - (echoq-keystrokes 10000) ; a lot of seconds + (echo-keystrokes 0) ; Don't echo unfinished commands. ;; Remember original binding for the button-up event to this ;; button-down event. (key (artist-compute-up-event-key ev)) @@ -4918,7 +4909,7 @@ If optional argument STATE is positive, turn borders on." ;; Mouse routines ;; -(defsubst artist-shift-has-changed (shift-state ev) +(defsubst artist-shift-has-changed (_shift-state _ev) "From the last SHIFT-STATE and EV, determine if the shift-state has changed." ;; This one simply doesn't work. ;; @@ -4972,8 +4963,7 @@ The event, EV, is the mouse event." (ev-start-pos (artist-coord-win-to-buf (posn-col-row ev-start))) (x1 (artist--adjust-x (car ev-start-pos))) (y1 (cdr ev-start-pos)) - (shape) - (timer)) + (timer nil)) (select-window (posn-window ev-start)) (artist-funcall init-fn x1 y1) (if (not artist-rubber-banding) @@ -5017,7 +5007,7 @@ The event, EV, is the mouse event." (setq draw-fn (artist-go-get-draw-fn-from-symbol op)))) ;; Draw the new shape - (setq shape (artist-funcall draw-fn x1 y1)) + (artist-funcall draw-fn x1 y1) (artist-move-to-xy x1 y1) ;; Start the timer to call `draw-fn' repeatedly every @@ -5262,7 +5252,6 @@ Operation is done once. The event, EV, is the mouse event." (shifted (artist-go-get-symbol-shift artist-curr-go t)) (shift-state (artist-event-is-shifted ev)) (op (if shift-state shifted unshifted)) - (draw-how (artist-go-get-draw-how-from-symbol op)) (init-fn (artist-go-get-init-fn-from-symbol op)) (prep-fill-fn (artist-go-get-prep-fill-fn-from-symbol op)) (exit-fn (artist-go-get-exit-fn-from-symbol op)) @@ -5394,8 +5383,7 @@ The event, EV, is the mouse event." (interactive) (require 'reporter) (if (y-or-n-p "Do you want to submit a bug report on Artist? ") - (let ((to artist-maintainer-address) - (vars '(window-system + (let ((vars '(window-system window-system-version ;; artist-rubber-banding -- cgit v1.2.3 From 0e9e36747f060a52ce4ecbf48eeb8421d4a19c68 Mon Sep 17 00:00:00 2001 From: Ć těpĂĄn Němec Date: Mon, 6 Apr 2020 13:25:41 +0200 Subject: unload-feature: Improve logic (don't repeat computation) * lisp/loadhist.el (unload-feature): Don't do the same computation twice. --- lisp/loadhist.el | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lisp/loadhist.el b/lisp/loadhist.el index a1ff2f6270d..60da00cceb2 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -287,22 +287,23 @@ something strange, such as redefining an Emacs function." ;; functions which the package might just have installed, and ;; there might be other important state, but this tactic ;; normally works. - (mapatoms - (lambda (x) - (when (and (boundp x) - (or (and (consp (symbol-value x)) ; Random hooks. - (string-match "-hooks?\\'" (symbol-name x))) - (memq x unload-feature-special-hooks))) ; Known abnormal hooks etc. - (dolist (y unload-function-defs-list) - (when (and (eq (car-safe y) 'defun) - (not (get (cdr y) 'autoload))) - (remove-hook x (cdr y))))))) - ;; Remove any feature-symbols from auto-mode-alist as well. - (dolist (y unload-function-defs-list) - (when (and (eq (car-safe y) 'defun) - (not (get (cdr y) 'autoload))) - (setq auto-mode-alist - (rassq-delete-all (cdr y) auto-mode-alist))))) + (let ((removables (cl-loop for def in unload-function-defs-list + when (and (eq (car-safe def) 'defun) + (not (get (cdr def) 'autoload))) + collect (cdr def)))) + (mapatoms + (lambda (x) + (when (and (boundp x) + (or (and (consp (symbol-value x)) ; Random hooks. + (string-match "-hooks?\\'" (symbol-name x))) + ;; Known abnormal hooks etc. + (memq x unload-feature-special-hooks))) + (dolist (func removables) + (remove-hook x func))))) + ;; Remove any feature-symbols from auto-mode-alist as well. + (dolist (func removables) + (setq auto-mode-alist + (rassq-delete-all func auto-mode-alist))))) ;; Change major mode in all buffers using one defined in the feature being unloaded. (unload--set-major-mode) -- cgit v1.2.3 From 5c266a71c160ed823e9ef69d2ff44fb0bb81ff77 Mon Sep 17 00:00:00 2001 From: Ć těpĂĄn Němec Date: Mon, 6 Apr 2020 13:30:11 +0200 Subject: unload-feature: Handle local hooks (bug#5293) Buffer-local hooks were introduced in 1994-09-30T20:47:13+00:00!rms@gnu.org 0e4d378b32 (add-hook): Initialize default value and local value. but 'unload-feature' has not been updated to handle them. * lisp/loadhist.el (unload-feature): Handle local hooks (bug#5293). --- etc/NEWS | 3 +++ lisp/loadhist.el | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index f3e3d9a1b6e..2aed5751595 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1748,6 +1748,9 @@ to lexical binding, where dynamic (special) variables bound in one file can affect code in another. For details, see the manual section '(Elisp) Converting to Lexical Binding'. +--- +** 'unload-feature' now also tries to undo additions to buffer-local hooks. + * Changes in Emacs 28.1 on Non-Free Operating Systems diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 60da00cceb2..81576679c35 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -300,6 +300,15 @@ something strange, such as redefining an Emacs function." (memq x unload-feature-special-hooks))) (dolist (func removables) (remove-hook x func))))) + (save-current-buffer + (dolist (buffer (buffer-list)) + (pcase-dolist (`(,sym . ,val) (buffer-local-variables buffer)) + (when (or (and (consp val) + (string-match "-hooks?\\'" (symbol-name sym))) + (memq sym unload-feature-special-hooks)) + (set-buffer buffer) + (dolist (func removables) + (remove-hook sym func t)))))) ;; Remove any feature-symbols from auto-mode-alist as well. (dolist (func removables) (setq auto-mode-alist -- cgit v1.2.3 From 8dc8ab6b42b021f9796e59cfdb758b48aaf55ffc Mon Sep 17 00:00:00 2001 From: Ć těpĂĄn Němec Date: Mon, 6 Apr 2020 17:05:33 +0200 Subject: unload-feature: Correct doc string to match info manual and reality 'unload-feature' doesn't try to "undo any additions the library has made" to hooks, it tries to remove functions defined by the library from hooks, no matter how they got there. * lisp/loadhist.el (unload-feature): Correct the doc string. * doc/lispref/loading.texi (Unloading): Clarify, fix typo. --- doc/lispref/loading.texi | 4 ++-- lisp/loadhist.el | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index aa6ef307b18..e5364152d52 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi @@ -1063,7 +1063,7 @@ It then restores any autoloads formerly associated with those symbols. (Loading saves these in the @code{autoload} property of the symbol.) Before restoring the previous definitions, @code{unload-feature} runs -@code{remove-hook} to remove functions in the library from certain +@code{remove-hook} to remove functions defined by the library from certain hooks. These hooks include variables whose names end in @samp{-hook} (or the deprecated suffix @samp{-hooks}), plus those listed in @code{unload-feature-special-hooks}, as well as @@ -1071,7 +1071,7 @@ hooks. These hooks include variables whose names end in @samp{-hook} function because important hooks refer to functions that are no longer defined. -Standard unloading activities also undoes ELP profiling of functions +Standard unloading activities also undo ELP profiling of functions in that library, unprovides any features provided by the library, and cancels timers held in variables defined by the library. diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 81576679c35..8ac575e8e39 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -234,11 +234,10 @@ If the feature is required by any other loaded code, and prefix arg FORCE is nil, raise an error. Standard unloading activities include restoring old autoloads for -functions defined by the library, undoing any additions that the -library has made to hook variables or to `auto-mode-alist', undoing -ELP profiling of functions in that library, unproviding any features -provided by the library, and canceling timers held in variables -defined by the library. +functions defined by the library, removing such functions from +hooks and `auto-mode-alist', undoing their ELP profiling, +unproviding any features provided by the library, and canceling +timers held in variables defined by the library. If a function `FEATURE-unload-function' is defined, this function calls it with no arguments, before doing anything else. That function -- cgit v1.2.3 From 394f1269d106d6ed641b8491101e18aa225beb1a Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 22 Oct 2020 07:27:45 +0200 Subject: Update TUTORIAL.de This also includes the minor fix for bug #44123. --- etc/tutorials/TUTORIAL.de | 156 +++++++++++++++++++++++++++------------------- 1 file changed, 93 insertions(+), 63 deletions(-) diff --git a/etc/tutorials/TUTORIAL.de b/etc/tutorials/TUTORIAL.de index 75c03a18e4a..f1461563c18 100644 --- a/etc/tutorials/TUTORIAL.de +++ b/etc/tutorials/TUTORIAL.de @@ -19,15 +19,22 @@ EDIT oder ALT genannt). Folgende AbkĂŒrzungen werden verwendet: <> [Leerzeilen befinden sich hier aus didaktischen GrĂŒnden. Fortsetzung unten.] >> DrĂŒcken Sie C-v, um zur nĂ€chsten Bildschirmseite vorzublĂ€ttern. - Ab jetzt sollten Sie das stets tun, wenn Sie eine Seite fertig - gelesen haben. + Ab jetzt sollten Sie das stets tun, wenn Sie das untere + Bildschirmende erreicht haben. Beachten Sie bitte, dass beim BlĂ€ttern die untersten zwei Zeilen der vorigen Bildschirmseite als die zwei obersten Zeilen der neuen Seite erscheinen, um eine gewisse KontinuitĂ€t wĂ€hrend des Lesens zu ermöglichen. +Was Sie gerade lesen, ist eine leicht angepasste Kopie der deutschen +EinfĂŒhrung. SpĂ€ter werden Sie aufgefordert, verschiedene Befehle +auszufĂŒhren, um den Text der EinfĂŒhrung zu Ă€ndern. Es spielt keine +Rolle, wenn Sie den Text schon vorher Ă€ndern sollten – man nennt das +»editieren«, und genau dafĂŒr ist ein Editor wie Emacs da. + Wichtig: Sie können Emacs mit der Befehlsfolge C-x C-c beenden. +Diese EinfĂŒhrung beenden Sie mit C-x k, gefolgt von der Eingabetaste. Im weiteren wird die ESC-Taste mit bezeichnet. @@ -41,7 +48,7 @@ Sie schon (C-v). Mit M-v blĂ€ttern Sie eine Bildschirmseite zurĂŒck (halten Sie die META-Taste gedrĂŒckt und geben Sie v ein, oder drĂŒcken Sie zuerst und anschließend v). ->> Probieren Sie einige Male M-v und C-v aus. +>> Probieren Sie einige Male M-v und C-v aus. [Auf den meisten Tastaturen bewirkt die PgUp-Taste (»page up«, auch mit »Bild« und einem AufwĂ€rtspfeil beschriftet) dasselbe wie M-v bzw. @@ -277,14 +284,14 @@ Wert, signalisiert dem Befehl, etwas anderes zu tun. C-v und M-v sind weitere Ausnahmen. Gibt man diesen Befehlen einen Parameter n, dann verschieben sie den Bildschirminhalt nicht um eine -ganze Bildschirmseite, sondern um n Zeilen. Beispiel: C-u 4 C-v -verschiebt den Bildschirminhalt um vier Zeilen. +ganze Bildschirmseite, sondern um n Zeilen. Beispiel: C-u 8 C-v +verschiebt den dargestellten Text um acht Zeilen. >> Versuchen Sie jetzt C-u 8 C-v auszufĂŒhren. -Der Bildschirminhalt sollte jetzt um acht Zeilen nach oben verschoben -sein. Wollen Sie ihn nach unten verschieben, dann geben Sie M-v mit -einem numerischen Argument ein. +Der Text sollte jetzt um acht Zeilen nach oben verschoben sein. +Wollen Sie ihn nach unten verschieben, dann geben Sie M-v mit einem +numerischen Argument ein. Wenn Sie eine graphische OberflĂ€che wie X oder MS-Windows verwenden, dann befindet sich ein schmaler, langgezogener rechteckiger Bereich @@ -411,12 +418,12 @@ Fortsetzungszeile. >> Geben Sie ein, um wieder ein Zeilenvorschubzeichen einzufĂŒgen. -Die -Taste ist insofern besonders, als dass sie mehr bewirken -kann, als einfach ein Zeilenvorschubszeichen einzufĂŒgen. AbhĂ€ngig vom -umgebenden Text können zusĂ€tzliche Leerzeichen eingefĂŒgt werden, damit -der neue Zeilenanfang bĂŒndig zur vorherigen Zeile ist. Wir nennen -dieses Verhalten (wenn das DrĂŒcken einer Taste mehr bewirkt, als nur -das entsprechende Zeichen einzufĂŒgen) »electric«. +Die -Taste ist besonders, da sie mehr bewirken kann als +einfach ein Zeilenvorschubzeichen einfĂŒgen. AbhĂ€ngig vom umgebenden +Text können zusĂ€tzliche Leerzeichen eingefĂŒgt werden, damit der neue +Zeilenanfang bĂŒndig zur vorherigen Zeile ist. Wir nennen dieses +Verhalten (wenn das DrĂŒcken einer Taste mehr bewirkt, als nur das +entsprechende Zeichen einzufĂŒgen) »electric«. >> Ein Beispiel fĂŒr dieses Verhalten von . DrĂŒcken Sie am Ende dieser Zeile. @@ -468,7 +475,7 @@ gelöschten Text, damit Sie ihn bei Bedarf wieder zurĂŒckholen können. EinfĂŒgen von bereits gelöschtem Text wird im englischen Dokumentation von Emacs als »yanking« (wörtlich »herausreißen«) bezeichnet. Sie können den gelöschten Text an einer beliebigen Stelle wieder -einzufĂŒgen. Solange Sie nichts neues löschen, steht Ihnen dieser +einfĂŒgen. Solange Sie nichts neues löschen, steht Ihnen dieser gelöschte Textteil immer wieder zu VerfĂŒgung. Der Befehl dazu ist C-y (das Ypsilon steht fĂŒr »yank«). @@ -584,9 +591,11 @@ Anzahl der notwendigen C-/-Befehle zu reduzieren. >> Löschen Sie diese Zeilen mit C-k und drĂŒcken Sie anschließend mehrmals C-/, und die Zeilen erscheinen wieder. -Alternative Tastenkombinationen fĂŒr C-/ sind C-_ und C-x u. Ein -numerisches Argument fĂŒr C-/, C-_ oder C-x u wird als -WiederholungszĂ€hler interpretiert. +Alternative Tastenkombinationen fĂŒr C-/ sind C-_ und C-x u (in manchen +Terminals funktioniert C-_ auch ohne SHIFT-Taste). WĂ€hlen Sie das +aus, was am bequemsten fĂŒr Sie zu tippen ist. Ein numerisches +Argument fĂŒr C-/, C-_ oder C-x u wird als WiederholungszĂ€hler +interpretiert. Der Unterschied zwischen der Undo-Funktion und dem oben erklĂ€rten C-y ist, dass erstere gelöschten Text an exakt der gleichen Position wie @@ -668,10 +677,7 @@ Name besteht aus dem Originalnamen plus einer angehĂ€ngten Tilde »~« Namenserweiterung durch ».bak« ersetzt]. Emacs schreibt den Namen der gesicherten Datei in die unterste Zeile, -sobald C-x C-s fertig ausgefĂŒhrt ist. Sie sollten den editierten Text -oft speichern, damit nicht allzuviel bei einem etwaigen Systemabsturz -verloren geht (siehe auch den Abschnitt »AUTOMATISCHES SPEICHERN« -weiter unten). +sobald C-x C-s fertig ausgefĂŒhrt ist. >> Geben Sie @@ -715,12 +721,11 @@ ein. >> Probieren Sie jetzt C-x C-b. -Beachten Sie, dass jeder Puffer einen Namen hat und manche auch mit -dem Namen einer Datei assoziiert sind, dessen Inhalt sie enthalten. -Manche Puffer aber haben keinen zugehörige Datei, z.B. der mit dem -Namen »*Buffer List*«. Er wurde von dem Befehl C-x C-b erzeugt, um -die Pufferliste darzustellen. JEDER Text, den Sie innerhalb Emacs in -einem Fenster sehen, ist immer ein Ausschnitt eines Puffers. +Beachten Sie, dass manche Puffer keine zugehörige Datei haben, +z.B. der mit dem Namen »*Buffer List*«. Er wurde von dem Befehl C-x +C-b erzeugt, um die Pufferliste darzustellen. JEDER Text, den Sie +innerhalb Emacs in einem Fenster sehen, ist immer ein Ausschnitt eines +Puffers. >> Geben Sie jetzt C-x 1 ein, um die Pufferliste wieder verschwinden zu lassen. @@ -748,13 +753,11 @@ den VerzeichnisprĂ€fix), jedoch nicht immer. Die von C-x C-b erzeugte Pufferliste zeigt stets die Namen aller Puffer mit den korrespondierenden Dateinamen. -JEDER Text in Emacs ist Teil eines Puffers, aber nicht jeder Puffer -entspricht einer Datei. So ist z.B. der Puffer »*Buffer List*« mit -keiner Datei assoziiert -- er wurde direkt von dem Befehl C-x C-b -erzeugt. Auch dieser »TUTORIAL.de«-Puffer war anfangs keiner Datei -zugeordnet, jetzt allerdings schon, denn Sie haben im letzten -Abschnitt den Befehl C-x C-s eingegeben und so den Pufferinhalt als -Datei gespeichert. +Wie schon erwĂ€hnt, ist JEDER Text in Emacs Teil eines Puffers, aber +nicht jeder Puffer entspricht einer Datei. Auch dieser +»TUTORIAL.de«-Puffer war anfangs keiner Datei zugeordnet, jetzt +allerdings schon, denn Sie haben im letzten Abschnitt den Befehl C-x +C-s eingegeben und so den Pufferinhalt als Datei gespeichert. Der Puffer »*Messages*« hat ebenfalls keine Entsprechung als Datei; er enthĂ€lt alle Mitteilungen, die in der untersten Zeile wĂ€hrend des @@ -774,10 +777,10 @@ Datei permanent abzuspeichern. Es wĂ€re Ă€ußerst umstĂ€ndlich, mĂŒsste man jedesmal C-x C-f eingeben, um den Puffer dann mit C-x C-s abzuspeichern. Daher gibt es den Befehl - C-x s (sichere mehrere Puffer) + C-x s (sichere mehrere Puffer in Dateien) -Dieser Befehl fragt Sie bei jedem Puffer, der Änderungen enthĂ€lt, ob -Sie ihn speichern wollen. +Dieser Befehl fragt Sie bei jedem einer Datei zugeordneten Puffer, der +Änderungen enthĂ€lt, ob Sie ihn in der Datei speichern wollen. >> FĂŒgen Sie eine Textzeile ein und drĂŒcken Sie dann C-x s. Emacs fragt Sie jetzt, ob Sie einen Puffer mit dem Namen @@ -824,15 +827,15 @@ zu Emacs zurĂŒckzukehren. Der beste Zeitpunkt fĂŒr C-x C-c ist, wenn Sie sich ausloggen (bzw. Ihren Computer ausschalten); Sie sollten Emacs ebenfalls -beenden, wenn Sie Emacs von einem anderen Programm aus aufgerufen -haben (z.B. einem Programm, das E-mails liest). +beenden, wenn Sie Emacs von einem anderen Programm aus kurzzeitig +aufgerufen haben (z.B. einem Programm, das E-Mails liest). Hier ist eine Liste aller C-x-Befehle, die Sie bereits kennengelernt haben: C-x C-f lade Datei - C-x C-s sichere Datei - C-x s sichere einige Puffer + C-x C-s sichere Puffer in Datei + C-x s sichere einige Puffer in zugehörige Dateien C-x C-b zeige Pufferliste an C-x b wechsle zu Puffer C-x C-c beende Emacs @@ -840,10 +843,10 @@ haben: C-x u widerrufen Ein Beispiel fĂŒr einen Befehl mit langen Namen ist replace-string, der -global (also in der ganzen Datei bzw. Puffer) eine Zeichenkette durch -eine andere ersetzt. Wenn Sie M-x drĂŒcken, dann fragt Sie Emacs in -der untersten Bildschirmzeile nach dem Namen des Befehls (in diesem -Fall »replace-string«). Geben Sie jetzt »repl s« ein und Emacs +in der ganzen Datei bzw. Puffer eine Zeichenkette durch eine andere +ersetzt. Wenn Sie M-x drĂŒcken, dann fragt Sie Emacs in der untersten +Bildschirmzeile nach dem Namen des Befehls (in diesem Fall +»replace-string«). Geben Sie jetzt »repl s« ein und Emacs vervollstĂ€ndigt den Namen. Schließen Sie die Eingabe mit ab. [ bezeichnet die Tabulatortaste.] @@ -855,7 +858,7 @@ vervollstĂ€ndigt den Namen. Schließen Sie die Eingabe mit ab. ein und kehren Sie mit C-u C-SPC an diese Position zurĂŒck. Beachten Sie wie diese Bildschirmzeile jetzt aussieht: Sie haben - den Wortteil B-i-l-d-s-c-h-i-r-m durch »Text« ersetzt (und zwar im + den Wortteil »Bildschirm« durch »Text« ersetzt (und zwar im ganzen Dokument beginnend von der Cursorposition). >> DrĂŒcken Sie jetzt C-x u, um diese Änderungen auf einmal rĂŒckgĂ€ngig @@ -878,8 +881,8 @@ StĂŒrzt der Rechner einmal wirklich ab, können Sie die Änderungen, die beim letzten Auto-Save gespeichert worden sind, folgendermaßen wiederherstellen: Laden Sie die Datei auf normalem Wege (die Datei, die Sie bearbeitet haben, nicht die Auto-Save-Datei) und geben Sie -dann »M-x recover-file « ein. Wenn Emacs Sie um BestĂ€tigung -fragt, antworten Sie mit »yes «, um den Inhalt der +dann »M-x recover-this-file « ein. Wenn Emacs Sie um +BestĂ€tigung fragt, antworten Sie mit »yes «, um den Inhalt der Auto-Save-Datei zu ĂŒbernehmen. @@ -979,6 +982,7 @@ jeweils ein bisschen anders. Dokumentation zum derzeit aktuellen Hauptmodus bekommen Sie mit C-h m. +>> Bewegen Sie den Cursor zur nĂ€chsten Zeile. >> DrĂŒcken Sie C-l C-l, um diese Zeile an den oberen Bildschirmrand zu bringen. >> Lesen Sie nun mittels C-h m die englische Dokumentation zum @@ -1129,13 +1133,13 @@ Rechteck dargestellt). Alle normalen Editierbefehle betreffen das Fenster, in dem sich der Cursor befindet. Wir nennen dieses Fenster »ausgewĂ€hlt« (»selected window«). -Der Befehl M-C-v ist sehr nĂŒtzlich, wenn man Text in einem Fenster +Der Befehl C-M-v ist sehr nĂŒtzlich, wenn man Text in einem Fenster editiert und das andere Fenster als Referenz verwendet. Ohne das -momentante Arbeitsfenster verlassen zu mĂŒssen, kann man mit M-C-v im +momentante Arbeitsfenster verlassen zu mĂŒssen, kann man mit C-M-v im anderen Fenster bequem vorwĂ€rtsblĂ€ttern. -M-C-v ist ein Beispiel eines CONTROL-META-Zeichens. Haben Sie eine -META-Taste, dann kann man M-C-v erzeugen, indem man CTRL und META +C-M-v ist ein Beispiel eines CONTROL-META-Zeichens. Haben Sie eine +META-Taste, dann kann man C-M-v erzeugen, indem man CTRL und META gleichzeitig niedergedrĂŒckt hĂ€lt, wĂ€hrend man v eintippt. Es ist egal, ob zuerst CTRL oder META niedergedrĂŒckt wird, da beide Tasten gleichberechtigt das jeweils einzugebende Zeichen modifizieren. @@ -1146,10 +1150,10 @@ gefolgt von CTRL-v. CTRL-ESC v funktioniert nicht! Der Grund dafĂŒr ist, dass ESC ein eigenes Zeichen ist und keine Modifizier-Taste wie META oder CTRL. -Der umgekehrte Befehl zu M-C-v ist M-C-S-v, um im anderen Fenster -rĂŒckwĂ€rts zu blĂ€ttern (d.h., Sie mĂŒssen die META-Taste sowie die -CONTROL- und SHIFT-Taste zusammen mit »v« betĂ€tigen) -- jetzt werden -Sie wahrscheinlich verstehen, warum manche Kritiker das Wort Emacs als +Der umgekehrte Befehl zu C-M-v ist C-M-S-v, um im anderen Fenster +rĂŒckwĂ€rts zu blĂ€ttern (d.h., Sie mĂŒssen die CONTROL-Taste sowie die +META- und SHIFT-Taste zusammen mit »v« betĂ€tigen) -- jetzt werden Sie +wahrscheinlich verstehen, warum manche Kritiker das Wort Emacs als AbkĂŒrzung von Escape-Meta-Alt-Control-Shift betrachten. Leider funktioniert diese Befehlsfolge normalerweise nur mit graphischen OberflĂ€chen, da C-v von C-S-v auf den meisten Textterminals nicht @@ -1196,7 +1200,7 @@ Textterminal kann genau ein Rahmen dargestellt werden. >> Geben Sie - M-x make-frame + C-x 5 2 ein, um einen neuen Rahmen zu erzeugen. @@ -1206,7 +1210,7 @@ gleichwertig. >> Geben Sie - M-x delete-frame + C-x 5 0 ein, um den ausgewĂ€hlten Rahmen zu entfernen. @@ -1343,7 +1347,7 @@ zwar fĂŒr die Tastatur- und Bildschirmkodierung.] Wir haben uns bemĂŒht, in dieser EinfĂŒhrung genau soviel Information zu geben, dass Sie beginnen können, mit Emacs zu arbeiten. Emacs ist jedoch so mĂ€chtig und umfangreich, dass es den Rahmen einer EinfĂŒhrung -sprĂ€nge, an dieser Stelle mehr zu erklĂ€ren. Um Sie im weiteren +sprengte, an dieser Stelle mehr zu erklĂ€ren. Um Sie im weiteren Lernverlauf zu unterstĂŒtzen, stellt Emacs eine Reihe von Hilfe-Funktionen zu VerfĂŒgung, die alle mit dem PrĂ€fix C-h (dem Hilfe-Zeichen, »Help character«) beginnen. @@ -1424,18 +1428,44 @@ zugehörigen langen Namen, find-file. >> Schließen Sie das Hilfefenster mit C-x 1. - C-h i Dieser Befehl öffnet einen speziellen Puffer, um - HandbĂŒcher zu lesen (im »Info«-Format), die auf dem + C-h i Dieser Befehl öffnet einen speziellen Puffer »*info*«, + um HandbĂŒcher zu lesen (im »Info«-Format), die auf dem verwendeten Computersystem installiert sind. Geben Sie z.B. m emacs ein, um das Emacs-Handbuch zu lesen. Haben Sie »Info« noch nie benutzt, tippen - Sie ?, und Emacs fĂŒhrt Sie Schritt fĂŒr Schritt durch + Sie h, und Emacs fĂŒhrt Sie Schritt fĂŒr Schritt durch die Möglichkeiten des Info-Modus. Wenn Sie diese EinfĂŒhrung fertiggelesen haben, sollten Sie das Info-Handbuch fĂŒr Emacs als primĂ€re Dokumentation benutzen. +* MEHR FEATURES +--------------- + +Sie können mehr ĂŒber Emacs lernen, in dem Sie das Handbuch lesen, +entweder in der gedruckten Form oder innerhalb von Emacs (benĂŒtzen Sie +dazu das Hilfe-Menu oder tippen Sie C-h r). Zwei besonders nĂŒtzliche +Features sind VervollstĂ€ndigung, um weniger tippen zu mĂŒssen, und +Dired, um das Laden von Dateien zu vereinfachen. + +Das VervollstĂ€ndigungs-Feature ist eine Methode, um unnötiges Eingeben +von Zeichen zu vermeiden. Wenn Sie beispielsweise zum +»*Messages*«-Puffer umschalten wollen, genĂŒgt C-x b *M, und Emacs +ergĂ€nzt automatisch den Namen des Puffers, soweit das anhand der +bisherigen Eingabe möglich ist. VervollstĂ€ndigung funktioniert auch +fĂŒr Befehls- und Dateinamen. Eine genaue Beschreibung finden Sie im +Abschnitt »Completion« des Emacs-Handbuchs. + +Dired ermöglicht es, Dateien eines Verzeichnisses (auf Wunsch +inklusive seiner Unterverzeichnisse) aufzulisten, sich innerhalb der +Liste zu bewegen, Dateien zu besuchen, umzubenennen, zu löschen u.a. +Eine genaue Beschreibung finden Sie im Abschnitt »Dired« des +Emacs-Handbuchs. + +Viele weitere Features sind ebenfalls im Handbuch beschrieben. + + * SCHLUSSBEMERKUNG ------------------ -- cgit v1.2.3 From 3479390c4c4b053667aab79c83239ababbdac9d0 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Thu, 22 Oct 2020 11:46:09 +0200 Subject: * lisp/progmodes/cpp.el: Use lexical binding. --- lisp/progmodes/cpp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index bcbe669c16e..65ef83f7698 100644 --- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el @@ -1,4 +1,4 @@ -;;; cpp.el --- highlight or hide text according to cpp conditionals +;;; cpp.el --- highlight or hide text according to cpp conditionals -*- lexical-binding: t -*- ;; Copyright (C) 1994-1995, 2001-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From 701ed2e4edd470f8b45de7671becde30b3786989 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Thu, 22 Oct 2020 12:18:16 +0200 Subject: Use lexical binding in fortran.el * lisp/progmodes/fortran.el: Use lexical binding. (fortran-make-syntax-propertize-function): Hoist use of lexical variable to outside the 'eval' call. --- lisp/progmodes/fortran.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index abc860b9478..206d1f2a05d 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -1,4 +1,4 @@ -;;; fortran.el --- Fortran mode for GNU Emacs +;;; fortran.el --- Fortran mode for GNU Emacs -*- lexical-binding: t -*- ;; Copyright (C) 1986, 1993-1995, 1997-2020 Free Software Foundation, ;; Inc. @@ -495,13 +495,13 @@ This is used to fontify fixed-format Fortran comments." ;; `byte-compile', but simple benchmarks indicate that it's probably not ;; worth the trouble (about 0.5% of slow down). (eval ;I hate `eval', but it's hard to avoid it here. - '(syntax-propertize-rules + `(syntax-propertize-rules ("^[CcDd\\*]" (0 "<")) ;; We mark all chars after line-length as "comment-start", rather than ;; just the first one. This is so that a closing ' that's past the ;; line-length will indeed be ignored (and will result in a string that ;; leaks into subsequent lines). - ((format "^[^CcDd\\*\t\n].\\{%d\\}\\(.+\\)" (1- line-length)) + (,(format "^[^CcDd\\*\t\n].\\{%d\\}\\(.+\\)" (1- line-length)) (1 "<"))))) (defvar fortran-font-lock-keywords fortran-font-lock-keywords-1 -- cgit v1.2.3 From 954a4decfcc8e41084789516773b22d0adc11d91 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Thu, 22 Oct 2020 13:40:34 +0200 Subject: Handle Cairo errors in ftcrfont_open * src/ftcrfont.c (ftcrfont_open): Handle Cairo errors (bug#41627). --- src/ftcrfont.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ftcrfont.c b/src/ftcrfont.c index 4892a34a3ab..a10308c62ee 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -139,7 +139,8 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) FcPatternDestroy (pat); font_face = cairo_ft_font_face_create_for_pattern (match); - if (!font_face) + if (!font_face + || cairo_font_face_status (font_face) != CAIRO_STATUS_SUCCESS) { unblock_input (); FcPatternDestroy (match); @@ -154,6 +155,18 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) cairo_font_face_destroy (font_face); cairo_font_options_destroy (options); unblock_input (); + if (!scaled_font + || cairo_scaled_font_status (scaled_font) != CAIRO_STATUS_SUCCESS) + { + FcPatternDestroy (match); + return Qnil; + } + ft_face = cairo_ft_scaled_font_lock_face (scaled_font); + if (!ft_face) + { + FcPatternDestroy (match); + return Qnil; + } font_object = font_build_object (VECSIZE (struct font_info), AREF (entity, FONT_TYPE_INDEX), @@ -234,7 +247,6 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) font->descent = font->height - font->ascent; } - ft_face = cairo_ft_scaled_font_lock_face (scaled_font); if (XFIXNUM (AREF (entity, FONT_SIZE_INDEX)) == 0) { int upEM = ft_face->units_per_EM; -- cgit v1.2.3 From c009a0a6f73bb61d2bd37f4acb8435b335ed2fa0 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Thu, 22 Oct 2020 13:52:42 +0200 Subject: Allow moving members of editable-list widget, via delete+insert * etc/NEWS (Widget): Announce the feature (bug#6419). * lisp/wid-edit.el (widget-editable-list-delete-at): Save into a new widget property, :last-deleted, the WIDGET to be deleted. Add docstring. (widget-editable-list-insert-before): If there is a recently deleted child for the editable list, insert that one, instead of a new default widget. Add docstring. (insert-button widget): Make :help-echo a function to avoid the help-echo string become too long. (delete-button widget): Tweak the :help-echo string, to document this behavior. * test/lisp/wid-edit-tests.el (widget-test-moving-editable-list-item): Test the feature. --- etc/NEWS | 7 +++++++ lisp/wid-edit.el | 33 +++++++++++++++++++++++++++++---- test/lisp/wid-edit-tests.el | 19 +++++++++++++++++++ 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 2aed5751595..9e8182a2dae 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1166,6 +1166,13 @@ window after starting). This variable defaults to nil. +++ *** 'widget-choose' now supports menus in extended format. +--- +*** The 'editable-list' widget now supports moving items up and down. +You can now move items up and down by deleting and then reinserting +them, using the DEL and INS buttons respectively. This is useful in +Custom buffers, for example, to change the order of the elements in a +list. + ** Miscellaneous --- diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 6568cd2c8f1..c3366b62cdb 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -2721,7 +2721,10 @@ Return an alist of (TYPE MATCH)." (define-widget 'insert-button 'push-button "An insert button for the `editable-list' widget." :tag "INS" - :help-echo "Insert a new item into the list at this position." + :help-echo (lambda (widget) + (if (widget-get (widget-get widget :parent) :last-deleted) + "Insert back the last deleted item from this list, at this position." + "Insert a new item into the list at this position.")) :action 'widget-insert-button-action) (defun widget-insert-button-action (widget &optional _event) @@ -2734,7 +2737,7 @@ Return an alist of (TYPE MATCH)." (define-widget 'delete-button 'push-button "A delete button for the `editable-list' widget." :tag "DEL" - :help-echo "Delete this item from the list." + :help-echo "Delete this item from the list, saving it for later reinsertion." :action 'widget-delete-button-action) (defun widget-delete-button-action (widget &optional _event) @@ -2824,9 +2827,18 @@ Return an alist of (TYPE MATCH)." (cons found value))) (defun widget-editable-list-insert-before (widget before) - ;; Insert a new child in the list of children. + "Insert a new widget as a child of WIDGET. + +If there is a recently deleted child, the new widget is that deleted child. +Otherwise, the new widget is the default child of WIDGET. + +The new widget gets inserted at the position of the BEFORE child." (save-excursion (let ((children (widget-get widget :children)) + (last-deleted (when-let ((lst (widget-get widget :last-deleted))) + (prog1 + (pop lst) + (widget-put widget :last-deleted lst)))) (inhibit-read-only t) (inhibit-modification-hooks t)) (cond (before @@ -2834,7 +2846,11 @@ Return an alist of (TYPE MATCH)." (t (goto-char (widget-get widget :value-pos)))) (let ((child (widget-editable-list-entry-create - widget nil nil))) + widget (and last-deleted + (widget-apply last-deleted + :value-to-external + (widget-get last-deleted :value))) + last-deleted))) (when (< (widget-get child :entry-from) (widget-get widget :from)) (set-marker (widget-get widget :from) (widget-get child :entry-from))) @@ -2847,6 +2863,15 @@ Return an alist of (TYPE MATCH)." (widget-apply widget :notify widget)) (defun widget-editable-list-delete-at (widget child) + "Delete the widget CHILD from the known children of widget WIDGET. + +Save CHILD into the :last-deleted list, so it can be inserted later." + ;; Save the current value of CHILD, to use if the user later inserts the + ;; widget. + (widget-put child :value (widget-apply child :value-get)) + (let ((lst (widget-get widget :last-deleted))) + (push child lst) + (widget-put widget :last-deleted lst)) ;; Delete child from list of children. (save-excursion (let ((buttons (copy-sequence (widget-get widget :buttons))) diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el index df49ffc8224..4508b680232 100644 --- a/test/lisp/wid-edit-tests.el +++ b/test/lisp/wid-edit-tests.el @@ -129,4 +129,23 @@ (widget-insert "And some non-widget text.") (should (string= (widget-apply wid :value-get) ""))))) +(ert-deftest widget-test-moving-editable-list-item () + "Check that we can move an editable list item up or down, via delete+insert." + (with-temp-buffer + (widget-insert "Testing editable-list.\n\n") + (let ((lst (widget-create 'editable-list + :value '("beg" "end" "middle") + '(editable-field :value "unknown")))) + (use-local-map widget-keymap) + (widget-setup) + ;; Go to the DEL button for the 2nd element and action it. + (goto-char (widget-get (nth 2 (widget-get lst :buttons)) :from)) + (widget-apply-action (widget-at)) + ;; Go to the INS button and action it. + (goto-char (widget-get lst :to)) + (widget-backward 1) + (widget-apply-action (widget-at)) + ;; Check that we effectively moved the item to the last position. + (should (equal (widget-value lst) '("beg" "middle" "end")))))) + ;;; wid-edit-tests.el ends here -- cgit v1.2.3 From bb0256d9d129390690b8fb03a1e1b2739f3e0984 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 22 Oct 2020 13:52:42 +0200 Subject: Remove two references to Emacs 21 from the FAQ * doc/misc/efaq.texi (Turning on syntax highlighting): Remove some references to Emacs 21 and older. --- doc/misc/efaq.texi | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 115dd8a5ae6..a5f33113439 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -2718,8 +2718,7 @@ menus}), use: @cindex FAQ, @code{font-lock-mode} @code{font-lock-mode} is the standard way to have Emacs perform syntax -highlighting in the current buffer. It is enabled by default in Emacs -22.1 and later. +highlighting in the current buffer. It is enabled by default. With @code{font-lock-mode} turned on, different types of text will appear in different colors. For instance, in a programming mode, @@ -2729,13 +2728,6 @@ a third. To turn @code{font-lock-mode} off within an existing buffer, use @kbd{M-x font-lock-mode @key{RET}}. -In Emacs 21 and earlier versions, you could use the following code in -your @file{.emacs} file to turn on @code{font-lock-mode} globally: - -@lisp -(global-font-lock-mode 1) -@end lisp - Highlighting a buffer with @code{font-lock-mode} can take quite a while, and cause an annoying delay in display, so several features exist to work around this. -- cgit v1.2.3 From a5b4789d994622acc8eb5e92e476839025583edc Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 22 Oct 2020 13:58:23 +0200 Subject: Remove reference HP-UX 8.0 and 9.x bug from FAQ * doc/misc/efaq.texi (Meta key does not work in xterm): Remove section about a bug on HP-UX 8.0 and 9.x. Support for these platforms were removed in 23.1. --- doc/misc/efaq.texi | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index a5f33113439..e1b099edaab 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -3664,7 +3664,6 @@ See the file @file{nextstep/INSTALL} in the distribution. * Compose Character:: * Binding combinations of modifiers and function keys:: * Meta key does not work in xterm:: -* ExtendChar key does not work as Meta:: * SPC no longer completes file names:: @end menu @@ -4139,29 +4138,6 @@ You might have to replace @samp{Meta} with @samp{Alt}. @end itemize -@node ExtendChar key does not work as Meta -@section Why doesn't my @key{ExtendChar} key work as a @key{Meta} key under HP-UX 8.0 and 9.x? -@cindex @key{ExtendChar} key as @key{Meta} -@cindex @key{Meta}, using @key{ExtendChar} for -@cindex HP-UX, the @key{ExtendChar} key - -This is a result of an internationalization extension in X11R4 and the -fact that HP is now using this extension. Emacs assumes that the -@code{XLookupString} function returns the same result regardless of the -@key{Meta} key state which is no longer necessarily true. Until Emacs -is fixed, the temporary kludge is to run this command after each time -the X server is started but preferably before any xterm clients are: - -@example -xmodmap -e 'remove mod1 = Mode_switch' -@end example - -@c FIXME: Emacs 21 supports I18N in X11; does that mean that this bug is -@c solved? - -This will disable the use of the extra keysyms systemwide, which may be -undesirable if you actually intend to use them. - @node SPC no longer completes file names @section Why doesn't @key{SPC} complete file names anymore? @cindex @kbd{SPC} file name completion -- cgit v1.2.3 From 5215067c4efd186ffc0d8bf2e68bd4be7bf627c5 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Thu, 22 Oct 2020 14:30:13 +0200 Subject: Pretty print restricted sexp values too * lisp/wid-edit.el (restricted-sexp widget): Use widget-sexp-value-to-internal to pretty print the widget's value, when it is a valid one (bug#7524). --- lisp/wid-edit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index c3366b62cdb..009c6b4faf2 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -3584,7 +3584,7 @@ To use this type, you must define :match or :match-alternatives." :match 'widget-restricted-sexp-match :value-to-internal (lambda (widget value) (if (widget-apply widget :match value) - (prin1-to-string value) + (widget-sexp-value-to-internal widget value) value))) (defun widget-restricted-sexp-match (widget value) -- cgit v1.2.3 From 0d7d09b0ef1b3a939422d273be2fa348e8a148c8 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 18:23:38 +0200 Subject: Test for error with multibyte strings in bindat.el * test/lisp/emacs-lisp/bindat-tests.el (bindat-test-pack/multibyte-string-fails) (bindat-test-unpack/multibyte-string-fails): New tests. --- test/lisp/emacs-lisp/bindat-tests.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/lisp/emacs-lisp/bindat-tests.el b/test/lisp/emacs-lisp/bindat-tests.el index 14f95a8bf80..0fb1955695d 100644 --- a/test/lisp/emacs-lisp/bindat-tests.el +++ b/test/lisp/emacs-lisp/bindat-tests.el @@ -1,4 +1,4 @@ -;;; bindat-tests.el --- tests for bindat.el -*- lexical-binding: t; -*- +;;; bindat-tests.el --- tests for bindat.el -*- lexical-binding: t; coding: utf-8; -*- ;; Copyright (C) 2019-2020 Free Software Foundation, Inc. @@ -94,7 +94,13 @@ (src-ip . [192 168 1 101]) (dest-ip . - [192 168 1 100])))))) + [192 168 1 100])))))) + +(ert-deftest bindat-test-pack/multibyte-string-fails () + (should-error (bindat-pack nil nil (decode-coding-string "ö" 'utf-8)))) + +(ert-deftest bindat-test-unpack/multibyte-string-fails () + (should-error (bindat-unpack nil (decode-coding-string "ö" 'utf-8)))) (ert-deftest bindat-test-format-vector () (should (equal (bindat-format-vector [1 2 3] "%d" "x" 2) "1x2")) -- cgit v1.2.3 From 45c1be62a1e92f3e688495880664a13d042e718c Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 22 Oct 2020 15:20:04 +0200 Subject: Comment JSX lines using JSX syntax * lisp/progmodes/js.el (js-jsx--comment-region): New function (bug#41696). (js-jsx-mode): Use it. --- lisp/progmodes/js.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 5c50e2accdf..f3cfbbb948f 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -4656,8 +4656,19 @@ could set `js-jsx-syntax' to t in your init file, or in a one of the aforementioned options instead of using this mode." :group 'js (js-jsx-enable) + (setq-local comment-region-function #'js-jsx--comment-region) (js-use-syntactic-mode-name)) +(defun js-jsx--comment-region (beg end &optional arg) + (if (or (js-jsx--context) + (save-excursion + (skip-chars-forward " \t") + (js-jsx--looking-at-start-tag-p))) + (let ((comment-start "{/* ") + (comment-end " */}")) + (comment-region-default beg end arg)) + (comment-region-default beg end arg))) + ;;;###autoload (defalias 'javascript-mode 'js-mode) (eval-after-load 'folding -- cgit v1.2.3 From 5d152ed73754f3fcd8ce7e08bf1cfcf96e9656bb Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 22 Oct 2020 15:36:59 +0200 Subject: Use HTTP instead of Tramp for the ffap rfc path (and also fix it) * lisp/ffap.el (ffap-rfc-path): Use an URL instead of an FTP tramp file, since that's more widely supported (bug#41663). --- lisp/ffap.el | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 2c1d3d5bd9d..575821bdeaa 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1049,22 +1049,19 @@ out of NAME." "/pub/gnu/emacs/elisp-archive/")) (substring name 2)))) -(defcustom ffap-rfc-path - (concat (ffap-host-to-filename "ftp.rfc-editor.org") "/in-notes/rfc%s.txt") +(defcustom ffap-rfc-path "https://www.rfc-editor.org/in-notes/rfc%s.txt" "A `format' string making a filename for RFC documents. -This can be an ange-ftp or Tramp remote filename to download, or -a local filename if you have full set of RFCs locally. See also -`ffap-rfc-directories'." +This can be an URL, and ange-ftp or Tramp remote filename to +download, or a local filename if you have full set of RFCs +locally. See also `ffap-rfc-directories'." :type 'string - :version "23.1" - :group 'ffap) + :version "28.1") (defcustom ffap-rfc-directories nil "A list of directories to look for RFC files. If a given RFC isn't in these then `ffap-rfc-path' is offered." :type '(repeat directory) - :version "23.1" - :group 'ffap) + :version "23.1") (defun ffap-rfc (name) (let ((num (match-string 1 name))) -- cgit v1.2.3 From d5fdb1b1f6335da2a1dd60430b7521910dacab68 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Thu, 22 Oct 2020 16:49:10 +0200 Subject: ; fix docstring typo in last commit --- lisp/ffap.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 575821bdeaa..94aba5e5fb5 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1051,8 +1051,8 @@ out of NAME." (defcustom ffap-rfc-path "https://www.rfc-editor.org/in-notes/rfc%s.txt" "A `format' string making a filename for RFC documents. -This can be an URL, and ange-ftp or Tramp remote filename to -download, or a local filename if you have full set of RFCs +This can be an URL, an ange-ftp or Tramp remote filename to +download, or a local filename if you have the full set of RFCs locally. See also `ffap-rfc-directories'." :type 'string :version "28.1") -- cgit v1.2.3 From 8dffe61a9c461506311027c99374246440bd97fe Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Thu, 22 Oct 2020 16:55:03 +0200 Subject: Make State button interaction less confusing * lisp/cus-edit.el (custom-variable-current-value): New function. (custom-variable-backup-value): Use it. (custom-variable-set, custom-variable-mark-to-reset-standard): Check that old value is different than the new one. If it is, make a backup. This way, we avoid offering the Set to Backup Value unnecesarily. (custom-variable-reset-saved): Reset the variable-comment property for the variable, to help custom-variable-state be more correct. Also check if we should backup old value. (custom-variable-state): If a variable was set to the standard value, say its state is standard rather than set, which is more correct. Getting the right variable state is important for menu options to be enabled/disabled, and for displaying the right message to the user (bug#12864). --- lisp/cus-edit.el | 59 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 510c6e3b4c4..85c197b400f 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2789,7 +2789,9 @@ Possible return values are `standard', `saved', `set', `themed', (and (equal value (eval (car tmp))) (equal comment temp)) (error nil)) - 'set + (if (equal value (eval (car (get symbol 'standard-value)))) + 'standard + 'set) 'changed)) ((progn (setq tmp (get symbol 'theme-value)) (setq temp (get symbol 'saved-variable-comment)) @@ -2859,6 +2861,18 @@ otherwise." (defun custom-variable-standard-value (widget) (get (widget-value widget) 'standard-value)) +(defun custom-variable-current-value (widget) + "Return the current value of the variable edited by WIDGET. + +WIDGET should be a custom-variable widget." + (let* ((symbol (widget-value widget)) + (get (or (get symbol 'custom-get) 'default-value)) + (type (custom-variable-type symbol)) + (conv (widget-convert type))) + (if (default-boundp symbol) + (funcall get symbol) + (widget-get conv :value)))) + (defvar custom-variable-menu nil "If non-nil, an alist of actions for the `custom-variable' widget. @@ -2989,10 +3003,12 @@ Optional EVENT is the location for the menu." (setq comment nil) ;; Make the comment invisible by hand if it's empty (custom-comment-hide comment-widget)) - (custom-variable-backup-value widget) + (setq val (widget-value child)) + (unless (equal (eval val) (custom-variable-current-value widget)) + (custom-variable-backup-value widget)) (custom-push-theme 'theme-value symbol 'user - 'set (custom-quote (widget-value child))) - (funcall set symbol (eval (setq val (widget-value child)))) + 'set (custom-quote val)) + (funcall set symbol (eval val)) (put symbol 'customized-value (list val)) (put symbol 'variable-comment comment) (put symbol 'customized-variable-comment comment)) @@ -3001,10 +3017,12 @@ Optional EVENT is the location for the menu." (setq comment nil) ;; Make the comment invisible by hand if it's empty (custom-comment-hide comment-widget)) - (custom-variable-backup-value widget) + (setq val (widget-value child)) + (unless (equal val (custom-variable-current-value widget)) + (custom-variable-backup-value widget)) (custom-push-theme 'theme-value symbol 'user - 'set (custom-quote (widget-value child))) - (funcall set symbol (setq val (widget-value child))) + 'set (custom-quote val)) + (funcall set symbol val) (put symbol 'customized-value (list (custom-quote val))) (put symbol 'variable-comment comment) (put symbol 'customized-variable-comment comment))) @@ -3073,17 +3091,23 @@ before this operation becomes the backup value." (let* ((symbol (widget-value widget)) (saved-value (get symbol 'saved-value)) (comment (get symbol 'saved-variable-comment)) + (old-value (custom-variable-current-value widget)) value) - (custom-variable-backup-value widget) (if (not (or saved-value comment)) - ;; If there is no saved value, remove the setting. - (custom-push-theme 'theme-value symbol 'user 'reset) + (progn + (setq value (car (get symbol 'standard-value))) + ;; If there is no saved value, remove the setting. + (custom-push-theme 'theme-value symbol 'user 'reset) + ;; And reset this property too. + (put symbol 'variable-comment nil)) (setq value (car-safe saved-value)) (custom-push-theme 'theme-value symbol 'user 'set value) (put symbol 'variable-comment comment)) + (unless (equal (eval value) old-value) + (custom-variable-backup-value widget)) (ignore-errors (funcall (or (get symbol 'custom-set) #'set-default) symbol - (eval (or value (car (get symbol 'standard-value)))))) + (eval value))) (put symbol 'customized-value nil) (put symbol 'customized-variable-comment nil) (widget-put widget :custom-state 'unknown) @@ -3096,7 +3120,9 @@ If `custom-reset-standard-variables-list' is nil, save, reset and redraw the widget immediately." (let* ((symbol (widget-value widget))) (if (get symbol 'standard-value) - (custom-variable-backup-value widget) + (unless (equal (custom-variable-current-value widget) + (eval (car (get symbol 'standard-value)))) + (custom-variable-backup-value widget)) (user-error "No standard setting known for %S" symbol)) (put symbol 'variable-comment nil) (put symbol 'customized-value nil) @@ -3133,13 +3159,8 @@ becomes the backup value, so you can get it again." (defun custom-variable-backup-value (widget) "Back up the current value for WIDGET's variable. The backup value is kept in the car of the `backup-value' property." - (let* ((symbol (widget-value widget)) - (get (or (get symbol 'custom-get) 'default-value)) - (type (custom-variable-type symbol)) - (conv (widget-convert type)) - (value (if (default-boundp symbol) - (funcall get symbol) - (widget-get conv :value)))) + (let ((symbol (widget-value widget)) + (value (custom-variable-current-value widget))) (put symbol 'backup-value (list value)))) (defun custom-variable-reset-backup (widget) -- cgit v1.2.3 From 997ebf91dd6b1f586af44843c37aaad4708011c3 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 22 Oct 2020 16:34:11 +0200 Subject: Use lexical-binding in time-date.el and expand tests * lisp/calendar/time-date.el: Use lexical-binding. * test/lisp/calendar/time-date-tests.el (test-obsolete-with-decoded-time-value) (test-obsolete-encode-time-value, test-format-seconds) (test-days-to-time, test-seconds-to-string): New tests. (test-days-in-month, test-time-since, test-time-decoded-period): Expand test with a few more values. --- lisp/calendar/time-date.el | 2 +- test/lisp/calendar/time-date-tests.el | 52 ++++++++++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 638d8c1f884..f60c9c2ffd3 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -1,4 +1,4 @@ -;;; time-date.el --- Date and time handling functions +;;; time-date.el --- Date and time handling functions -*- lexical-binding: t -*- ;; Copyright (C) 1998-2020 Free Software Foundation, Inc. diff --git a/test/lisp/calendar/time-date-tests.el b/test/lisp/calendar/time-date-tests.el index 233d43cd01a..3f8954a8ff9 100644 --- a/test/lisp/calendar/time-date-tests.el +++ b/test/lisp/calendar/time-date-tests.el @@ -22,19 +22,67 @@ (require 'ert) (require 'time-date) +(ert-deftest test-obsolete-with-decoded-time-value () + (with-suppressed-warnings ((obsolete with-decoded-time-value)) + (with-decoded-time-value ((high low micro pico type '(1 2 3 4 5 6 8 8))) + (should (equal (list high low micro pico type) '(1 2 3 4 3)))))) + +(ert-deftest test-obsolete-encode-time-value () + (should (equal (with-suppressed-warnings ((obsolete encode-time-value)) + (encode-time-value 1 2 3 4 0)) + '(1 . 2))) + (should (equal (with-suppressed-warnings ((obsolete encode-time-value)) + (encode-time-value 1 2 3 4 1)) + '(1 2))) + (should (equal (with-suppressed-warnings ((obsolete encode-time-value)) + (encode-time-value 1 2 3 4 2)) + '(1 2 3))) + (should (equal (with-suppressed-warnings ((obsolete encode-time-value)) + (encode-time-value 1 2 3 4 3)) + '(1 2 3 4)))) + (ert-deftest test-leap-year () (should-not (date-leap-year-p 1999)) (should-not (date-leap-year-p 1900)) (should (date-leap-year-p 2000)) (should (date-leap-year-p 2004))) +(ert-deftest test-days-to-time () + (should (equal (days-to-time 0) '(0 0))) + (should (equal (days-to-time 1) '(1 20864))) + (should (equal (days-to-time 999) '(1317 2688))) + (should (equal (days-to-time 0.0) '(0 0 0 0))) + (should (equal (days-to-time 0.5) '(0 43200 0 0))) + (should (equal (days-to-time 1.0) '(1 20864 0 0))) + (should (equal (days-to-time 999.0) '(1317 2688 0 0)))) + +(ert-deftest test-seconds-to-string () + (should (equal (seconds-to-string 0) "0s")) + (should (equal (seconds-to-string 9) "9.00s")) + (should (equal (seconds-to-string 99) "99.00s")) + (should (equal (seconds-to-string 999) "16.65m")) + (should (equal (seconds-to-string 9999) "2.78h")) + (should (equal (seconds-to-string 99999) "27.78h")) + (should (equal (seconds-to-string 999999) "11.57d")) + (should (equal (seconds-to-string 9999999) "115.74d")) + (should (equal (seconds-to-string 99999999) "3.17y")) + (should (equal (seconds-to-string 999999999) "31.69y"))) + (ert-deftest test-days-in-month () (should (= (date-days-in-month 2004 2) 29)) (should (= (date-days-in-month 2004 3) 31)) + (should (= (date-days-in-month 2019 2) 28)) + (should (= (date-days-in-month 2020 12) 31)) (should-not (= (date-days-in-month 1900 3) 28)) + (should-error (date-days-in-month 2020 0)) (should-error (date-days-in-month 2020 15)) (should-error (date-days-in-month 2020 'foo))) +(ert-deftest test-format-seconds () + (should (equal (format-seconds "%y %d %h %m %s %%" 0) "0 0 0 0 0 %")) + (should (equal (format-seconds "%y %d %h %m %s %%" 9999999) "0 115 17 46 39 %")) + (should (equal (format-seconds "%y %d %h %m %z %s %%" 1) " 1 %"))) + (ert-deftest test-ordinal () (should (equal (date-ordinal-to-time 2008 271) '(nil nil nil 27 9 2008 nil nil nil))) @@ -107,7 +155,8 @@ '(12 15 14 8 7 2019 1 t 7200))))) (ert-deftest test-time-since () - (should (time-equal-p 0 (time-since nil)))) + (should (time-equal-p 0 (time-since nil))) + (should (= (cadr (time-since (time-subtract (current-time) 1))) 1))) (ert-deftest test-time-decoded-period () (should (equal (decoded-time-period '(nil nil 1 nil nil nil nil nil nil)) @@ -119,6 +168,7 @@ (should (equal (decoded-time-period '(0 0 0 1 0 0 nil nil nil)) 86400)) (should (equal (decoded-time-period '(0 0 0 0 1 0 nil nil nil)) 2592000)) (should (equal (decoded-time-period '(0 0 0 0 0 1 nil nil nil)) 31536000)) + (should (equal (decoded-time-period '(1 2 3 4 5 6 nil nil nil)) 202532521)) (should (equal (decoded-time-period '((135 . 10) 0 0 0 0 0 nil nil nil)) 13.5))) -- cgit v1.2.3 From 6342264ef74bdc5d649d6baaaa986d54d3aa11fe Mon Sep 17 00:00:00 2001 From: Ulf Jasper Date: Thu, 22 Oct 2020 17:45:59 +0200 Subject: Move test data for icalendar tests to separate files. * test/lisp/calendar/icalendar-tests.el (icalendar-tests--data-dir, icalendar-tests--get-file-contents): New. (icalendar-tests--test-import, icalendar-tests--do-test-import): Read input and expected results from files. (icalendar-import-non-recurring, icalendar-import-rrule) (icalendar-import-duration, icalendar-import-bug-6766) (icalendar-import-bug-24199, icalendar-import-bug-33277) (icalendar-import-multiple-vcalendars, icalendar-import-with-uid) (icalendar-import-with-timezone, icalendar-real-world): Move test data (input and expected result) to separate files. * test/calendar/icalendar/* New files containing test data for icalendar tests. --- .../data/icalendar/import-bug-11473.diary-european | 10 + test/data/icalendar/import-bug-11473.ics | 54 + .../data/icalendar/import-bug-22092.diary-american | 6 + .../data/icalendar/import-bug-22092.diary-european | 6 + test/data/icalendar/import-bug-22092.diary-iso | 6 + test/data/icalendar/import-bug-22092.ics | 30 + .../data/icalendar/import-bug-24199.diary-american | 5 + .../data/icalendar/import-bug-24199.diary-european | 5 + test/data/icalendar/import-bug-24199.diary-iso | 5 + test/data/icalendar/import-bug-24199.ics | 25 + .../data/icalendar/import-bug-33277.diary-american | 1 + .../data/icalendar/import-bug-33277.diary-european | 1 + test/data/icalendar/import-bug-33277.diary-iso | 1 + test/data/icalendar/import-bug-33277.ics | 15 + test/data/icalendar/import-bug-6766.diary-american | 7 + test/data/icalendar/import-bug-6766.diary-european | 7 + test/data/icalendar/import-bug-6766.diary-iso | 7 + test/data/icalendar/import-bug-6766.ics | 28 + .../icalendar/import-duration-2.diary-american | 3 + .../icalendar/import-duration-2.diary-european | 3 + test/data/icalendar/import-duration-2.diary-iso | 3 + test/data/icalendar/import-duration-2.ics | 17 + test/data/icalendar/import-duration.diary-american | 1 + test/data/icalendar/import-duration.diary-european | 1 + test/data/icalendar/import-duration.diary-iso | 1 + test/data/icalendar/import-duration.ics | 10 + .../import-multiple-vcalendars.diary-american | 4 + .../import-multiple-vcalendars.diary-european | 4 + .../icalendar/import-multiple-vcalendars.diary-iso | 4 + test/data/icalendar/import-multiple-vcalendars.ics | 21 + .../import-non-recurring-1.diary-american | 1 + .../import-non-recurring-1.diary-european | 1 + .../icalendar/import-non-recurring-1.diary-iso | 1 + test/data/icalendar/import-non-recurring-1.ics | 10 + .../import-non-recurring-all-day.diary-american | 1 + .../import-non-recurring-all-day.diary-european | 1 + .../import-non-recurring-all-day.diary-iso | 1 + .../icalendar/import-non-recurring-all-day.ics | 9 + ...rt-non-recurring-another-example.diary-american | 4 + ...rt-non-recurring-another-example.diary-european | 4 + .../import-non-recurring-another-example.diary-iso | 4 + .../import-non-recurring-another-example.ics | 23 + .../import-non-recurring-block.diary-american | 4 + .../import-non-recurring-block.diary-european | 4 + .../icalendar/import-non-recurring-block.diary-iso | 4 + test/data/icalendar/import-non-recurring-block.ics | 16 + ...ort-non-recurring-folded-summary.diary-american | 4 + ...ort-non-recurring-folded-summary.diary-european | 4 + .../import-non-recurring-folded-summary.diary-iso | 4 + .../import-non-recurring-folded-summary.ics | 25 + ...mport-non-recurring-long-summary.diary-american | 1 + ...mport-non-recurring-long-summary.diary-european | 1 + .../import-non-recurring-long-summary.diary-iso | 1 + .../import-non-recurring-long-summary.ics | 10 + .../import-real-world-2003-05-29.diary-american | 6 + .../import-real-world-2003-05-29.diary-european | 6 + .../icalendar/import-real-world-2003-05-29.ics | 54 + .../import-real-world-2003-06-18a.diary-american | 6 + .../import-real-world-2003-06-18a.diary-european | 6 + .../icalendar/import-real-world-2003-06-18a.ics | 36 + .../import-real-world-2003-06-18b.diary-american | 6 + .../import-real-world-2003-06-18b.diary-european | 6 + .../icalendar/import-real-world-2003-06-18b.ics | 55 + .../import-real-world-2004-11-19.diary-american | 19 + .../import-real-world-2004-11-19.diary-european | 19 + .../icalendar/import-real-world-2004-11-19.ics | 120 ++ .../import-real-world-2005-02-07.diary-american | 5 + .../import-real-world-2005-02-07.diary-european | 5 + .../icalendar/import-real-world-2005-02-07.ics | 26 + .../import-real-world-2005-03-01.diary-american | 2 + .../import-real-world-2005-03-01.diary-european | 2 + .../icalendar/import-real-world-2005-03-01.ics | 11 + .../import-real-world-no-dst.diary-american | 4 + .../import-real-world-no-dst.diary-european | 4 + test/data/icalendar/import-real-world-no-dst.ics | 26 + .../import-rrule-anniversary.diary-american | 1 + .../import-rrule-anniversary.diary-european | 1 + .../icalendar/import-rrule-anniversary.diary-iso | 1 + test/data/icalendar/import-rrule-anniversary.ics | 11 + .../import-rrule-count-bi-weekly.diary-american | 1 + .../import-rrule-count-bi-weekly.diary-european | 1 + .../import-rrule-count-bi-weekly.diary-iso | 1 + .../icalendar/import-rrule-count-bi-weekly.ics | 11 + .../import-rrule-count-daily-long.diary-american | 1 + .../import-rrule-count-daily-long.diary-european | 1 + .../import-rrule-count-daily-long.diary-iso | 1 + .../icalendar/import-rrule-count-daily-long.ics | 11 + .../import-rrule-count-daily-short.diary-american | 1 + .../import-rrule-count-daily-short.diary-european | 1 + .../import-rrule-count-daily-short.diary-iso | 1 + .../icalendar/import-rrule-count-daily-short.ics | 11 + ...t-rrule-count-every-second-month.diary-american | 1 + ...t-rrule-count-every-second-month.diary-european | 1 + ...import-rrule-count-every-second-month.diary-iso | 1 + .../import-rrule-count-every-second-month.ics | 11 + ...rt-rrule-count-every-second-year.diary-american | 1 + ...rt-rrule-count-every-second-year.diary-european | 1 + .../import-rrule-count-every-second-year.diary-iso | 1 + .../import-rrule-count-every-second-year.ics | 10 + .../import-rrule-count-monthly.diary-american | 1 + .../import-rrule-count-monthly.diary-european | 1 + .../icalendar/import-rrule-count-monthly.diary-iso | 1 + test/data/icalendar/import-rrule-count-monthly.ics | 11 + .../import-rrule-count-yearly.diary-american | 1 + .../import-rrule-count-yearly.diary-european | 1 + .../icalendar/import-rrule-count-yearly.diary-iso | 1 + test/data/icalendar/import-rrule-count-yearly.ics | 11 + .../import-rrule-daily-two-day.diary-american | 1 + .../import-rrule-daily-two-day.diary-european | 1 + .../icalendar/import-rrule-daily-two-day.diary-iso | 1 + test/data/icalendar/import-rrule-daily-two-day.ics | 10 + ...port-rrule-daily-with-exceptions.diary-american | 1 + ...port-rrule-daily-with-exceptions.diary-european | 1 + .../import-rrule-daily-with-exceptions.diary-iso | 1 + .../import-rrule-daily-with-exceptions.ics | 12 + .../icalendar/import-rrule-daily.diary-american | 1 + .../icalendar/import-rrule-daily.diary-european | 1 + test/data/icalendar/import-rrule-daily.diary-iso | 1 + test/data/icalendar/import-rrule-daily.ics | 11 + .../import-rrule-monthly-no-end.diary-american | 1 + .../import-rrule-monthly-no-end.diary-european | 1 + .../import-rrule-monthly-no-end.diary-iso | 1 + .../data/icalendar/import-rrule-monthly-no-end.ics | 11 + .../import-rrule-monthly-with-end.diary-american | 1 + .../import-rrule-monthly-with-end.diary-european | 1 + .../import-rrule-monthly-with-end.diary-iso | 1 + .../icalendar/import-rrule-monthly-with-end.ics | 11 + .../icalendar/import-rrule-weekly.diary-american | 1 + .../icalendar/import-rrule-weekly.diary-european | 1 + test/data/icalendar/import-rrule-weekly.diary-iso | 1 + test/data/icalendar/import-rrule-weekly.ics | 11 + .../icalendar/import-rrule-yearly.diary-american | 1 + .../icalendar/import-rrule-yearly.diary-european | 1 + test/data/icalendar/import-rrule-yearly.diary-iso | 1 + test/data/icalendar/import-rrule-yearly.ics | 11 + test/data/icalendar/import-with-timezone.diary-iso | 2 + test/data/icalendar/import-with-timezone.ics | 27 + test/data/icalendar/import-with-uid.diary-american | 2 + test/data/icalendar/import-with-uid.diary-european | 2 + test/data/icalendar/import-with-uid.diary-iso | 2 + test/data/icalendar/import-with-uid.ics | 10 + test/lisp/calendar/icalendar-tests.el | 1227 +++----------------- 142 files changed, 1297 insertions(+), 1037 deletions(-) create mode 100644 test/data/icalendar/import-bug-11473.diary-european create mode 100644 test/data/icalendar/import-bug-11473.ics create mode 100644 test/data/icalendar/import-bug-22092.diary-american create mode 100644 test/data/icalendar/import-bug-22092.diary-european create mode 100644 test/data/icalendar/import-bug-22092.diary-iso create mode 100644 test/data/icalendar/import-bug-22092.ics create mode 100644 test/data/icalendar/import-bug-24199.diary-american create mode 100644 test/data/icalendar/import-bug-24199.diary-european create mode 100644 test/data/icalendar/import-bug-24199.diary-iso create mode 100644 test/data/icalendar/import-bug-24199.ics create mode 100644 test/data/icalendar/import-bug-33277.diary-american create mode 100644 test/data/icalendar/import-bug-33277.diary-european create mode 100644 test/data/icalendar/import-bug-33277.diary-iso create mode 100644 test/data/icalendar/import-bug-33277.ics create mode 100644 test/data/icalendar/import-bug-6766.diary-american create mode 100644 test/data/icalendar/import-bug-6766.diary-european create mode 100644 test/data/icalendar/import-bug-6766.diary-iso create mode 100644 test/data/icalendar/import-bug-6766.ics create mode 100644 test/data/icalendar/import-duration-2.diary-american create mode 100644 test/data/icalendar/import-duration-2.diary-european create mode 100644 test/data/icalendar/import-duration-2.diary-iso create mode 100644 test/data/icalendar/import-duration-2.ics create mode 100644 test/data/icalendar/import-duration.diary-american create mode 100644 test/data/icalendar/import-duration.diary-european create mode 100644 test/data/icalendar/import-duration.diary-iso create mode 100644 test/data/icalendar/import-duration.ics create mode 100644 test/data/icalendar/import-multiple-vcalendars.diary-american create mode 100644 test/data/icalendar/import-multiple-vcalendars.diary-european create mode 100644 test/data/icalendar/import-multiple-vcalendars.diary-iso create mode 100644 test/data/icalendar/import-multiple-vcalendars.ics create mode 100644 test/data/icalendar/import-non-recurring-1.diary-american create mode 100644 test/data/icalendar/import-non-recurring-1.diary-european create mode 100644 test/data/icalendar/import-non-recurring-1.diary-iso create mode 100644 test/data/icalendar/import-non-recurring-1.ics create mode 100644 test/data/icalendar/import-non-recurring-all-day.diary-american create mode 100644 test/data/icalendar/import-non-recurring-all-day.diary-european create mode 100644 test/data/icalendar/import-non-recurring-all-day.diary-iso create mode 100644 test/data/icalendar/import-non-recurring-all-day.ics create mode 100644 test/data/icalendar/import-non-recurring-another-example.diary-american create mode 100644 test/data/icalendar/import-non-recurring-another-example.diary-european create mode 100644 test/data/icalendar/import-non-recurring-another-example.diary-iso create mode 100644 test/data/icalendar/import-non-recurring-another-example.ics create mode 100644 test/data/icalendar/import-non-recurring-block.diary-american create mode 100644 test/data/icalendar/import-non-recurring-block.diary-european create mode 100644 test/data/icalendar/import-non-recurring-block.diary-iso create mode 100644 test/data/icalendar/import-non-recurring-block.ics create mode 100644 test/data/icalendar/import-non-recurring-folded-summary.diary-american create mode 100644 test/data/icalendar/import-non-recurring-folded-summary.diary-european create mode 100644 test/data/icalendar/import-non-recurring-folded-summary.diary-iso create mode 100644 test/data/icalendar/import-non-recurring-folded-summary.ics create mode 100644 test/data/icalendar/import-non-recurring-long-summary.diary-american create mode 100644 test/data/icalendar/import-non-recurring-long-summary.diary-european create mode 100644 test/data/icalendar/import-non-recurring-long-summary.diary-iso create mode 100644 test/data/icalendar/import-non-recurring-long-summary.ics create mode 100644 test/data/icalendar/import-real-world-2003-05-29.diary-american create mode 100644 test/data/icalendar/import-real-world-2003-05-29.diary-european create mode 100644 test/data/icalendar/import-real-world-2003-05-29.ics create mode 100644 test/data/icalendar/import-real-world-2003-06-18a.diary-american create mode 100644 test/data/icalendar/import-real-world-2003-06-18a.diary-european create mode 100644 test/data/icalendar/import-real-world-2003-06-18a.ics create mode 100644 test/data/icalendar/import-real-world-2003-06-18b.diary-american create mode 100644 test/data/icalendar/import-real-world-2003-06-18b.diary-european create mode 100644 test/data/icalendar/import-real-world-2003-06-18b.ics create mode 100644 test/data/icalendar/import-real-world-2004-11-19.diary-american create mode 100644 test/data/icalendar/import-real-world-2004-11-19.diary-european create mode 100644 test/data/icalendar/import-real-world-2004-11-19.ics create mode 100644 test/data/icalendar/import-real-world-2005-02-07.diary-american create mode 100644 test/data/icalendar/import-real-world-2005-02-07.diary-european create mode 100644 test/data/icalendar/import-real-world-2005-02-07.ics create mode 100644 test/data/icalendar/import-real-world-2005-03-01.diary-american create mode 100644 test/data/icalendar/import-real-world-2005-03-01.diary-european create mode 100644 test/data/icalendar/import-real-world-2005-03-01.ics create mode 100644 test/data/icalendar/import-real-world-no-dst.diary-american create mode 100644 test/data/icalendar/import-real-world-no-dst.diary-european create mode 100644 test/data/icalendar/import-real-world-no-dst.ics create mode 100644 test/data/icalendar/import-rrule-anniversary.diary-american create mode 100644 test/data/icalendar/import-rrule-anniversary.diary-european create mode 100644 test/data/icalendar/import-rrule-anniversary.diary-iso create mode 100644 test/data/icalendar/import-rrule-anniversary.ics create mode 100644 test/data/icalendar/import-rrule-count-bi-weekly.diary-american create mode 100644 test/data/icalendar/import-rrule-count-bi-weekly.diary-european create mode 100644 test/data/icalendar/import-rrule-count-bi-weekly.diary-iso create mode 100644 test/data/icalendar/import-rrule-count-bi-weekly.ics create mode 100644 test/data/icalendar/import-rrule-count-daily-long.diary-american create mode 100644 test/data/icalendar/import-rrule-count-daily-long.diary-european create mode 100644 test/data/icalendar/import-rrule-count-daily-long.diary-iso create mode 100644 test/data/icalendar/import-rrule-count-daily-long.ics create mode 100644 test/data/icalendar/import-rrule-count-daily-short.diary-american create mode 100644 test/data/icalendar/import-rrule-count-daily-short.diary-european create mode 100644 test/data/icalendar/import-rrule-count-daily-short.diary-iso create mode 100644 test/data/icalendar/import-rrule-count-daily-short.ics create mode 100644 test/data/icalendar/import-rrule-count-every-second-month.diary-american create mode 100644 test/data/icalendar/import-rrule-count-every-second-month.diary-european create mode 100644 test/data/icalendar/import-rrule-count-every-second-month.diary-iso create mode 100644 test/data/icalendar/import-rrule-count-every-second-month.ics create mode 100644 test/data/icalendar/import-rrule-count-every-second-year.diary-american create mode 100644 test/data/icalendar/import-rrule-count-every-second-year.diary-european create mode 100644 test/data/icalendar/import-rrule-count-every-second-year.diary-iso create mode 100644 test/data/icalendar/import-rrule-count-every-second-year.ics create mode 100644 test/data/icalendar/import-rrule-count-monthly.diary-american create mode 100644 test/data/icalendar/import-rrule-count-monthly.diary-european create mode 100644 test/data/icalendar/import-rrule-count-monthly.diary-iso create mode 100644 test/data/icalendar/import-rrule-count-monthly.ics create mode 100644 test/data/icalendar/import-rrule-count-yearly.diary-american create mode 100644 test/data/icalendar/import-rrule-count-yearly.diary-european create mode 100644 test/data/icalendar/import-rrule-count-yearly.diary-iso create mode 100644 test/data/icalendar/import-rrule-count-yearly.ics create mode 100644 test/data/icalendar/import-rrule-daily-two-day.diary-american create mode 100644 test/data/icalendar/import-rrule-daily-two-day.diary-european create mode 100644 test/data/icalendar/import-rrule-daily-two-day.diary-iso create mode 100644 test/data/icalendar/import-rrule-daily-two-day.ics create mode 100644 test/data/icalendar/import-rrule-daily-with-exceptions.diary-american create mode 100644 test/data/icalendar/import-rrule-daily-with-exceptions.diary-european create mode 100644 test/data/icalendar/import-rrule-daily-with-exceptions.diary-iso create mode 100644 test/data/icalendar/import-rrule-daily-with-exceptions.ics create mode 100644 test/data/icalendar/import-rrule-daily.diary-american create mode 100644 test/data/icalendar/import-rrule-daily.diary-european create mode 100644 test/data/icalendar/import-rrule-daily.diary-iso create mode 100644 test/data/icalendar/import-rrule-daily.ics create mode 100644 test/data/icalendar/import-rrule-monthly-no-end.diary-american create mode 100644 test/data/icalendar/import-rrule-monthly-no-end.diary-european create mode 100644 test/data/icalendar/import-rrule-monthly-no-end.diary-iso create mode 100644 test/data/icalendar/import-rrule-monthly-no-end.ics create mode 100644 test/data/icalendar/import-rrule-monthly-with-end.diary-american create mode 100644 test/data/icalendar/import-rrule-monthly-with-end.diary-european create mode 100644 test/data/icalendar/import-rrule-monthly-with-end.diary-iso create mode 100644 test/data/icalendar/import-rrule-monthly-with-end.ics create mode 100644 test/data/icalendar/import-rrule-weekly.diary-american create mode 100644 test/data/icalendar/import-rrule-weekly.diary-european create mode 100644 test/data/icalendar/import-rrule-weekly.diary-iso create mode 100644 test/data/icalendar/import-rrule-weekly.ics create mode 100644 test/data/icalendar/import-rrule-yearly.diary-american create mode 100644 test/data/icalendar/import-rrule-yearly.diary-european create mode 100644 test/data/icalendar/import-rrule-yearly.diary-iso create mode 100644 test/data/icalendar/import-rrule-yearly.ics create mode 100644 test/data/icalendar/import-with-timezone.diary-iso create mode 100644 test/data/icalendar/import-with-timezone.ics create mode 100644 test/data/icalendar/import-with-uid.diary-american create mode 100644 test/data/icalendar/import-with-uid.diary-european create mode 100644 test/data/icalendar/import-with-uid.diary-iso create mode 100644 test/data/icalendar/import-with-uid.ics diff --git a/test/data/icalendar/import-bug-11473.diary-european b/test/data/icalendar/import-bug-11473.diary-european new file mode 100644 index 00000000000..97348ae0498 --- /dev/null +++ b/test/data/icalendar/import-bug-11473.diary-european @@ -0,0 +1,10 @@ +&15/5/2012 15:00-15:30 Query + Desc: + Whassup? + + + Location: phone + Organizer: MAILTO:a.luser@foo.com + Status: CONFIRMED + Class: PUBLIC + UID: 040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000010000000575268034ECDB649A15349B1BF240F15 diff --git a/test/data/icalendar/import-bug-11473.ics b/test/data/icalendar/import-bug-11473.ics new file mode 100644 index 00000000000..bc3a6c69fb7 --- /dev/null +++ b/test/data/icalendar/import-bug-11473.ics @@ -0,0 +1,54 @@ +BEGIN:VCALENDAR +METHOD:REQUEST +PRODID:Microsoft Exchange Server 2007 +VERSION:2.0 +BEGIN:VTIMEZONE +TZID:(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna +BEGIN:STANDARD +DTSTART:16010101T030000 +TZOFFSETFROM:+0200 +TZOFFSETTO:+0100 +RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10 +END:STANDARD +BEGIN:DAYLIGHT +DTSTART:16010101T020000 +TZOFFSETFROM:+0100 +TZOFFSETTO:+0200 +RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3 +END:DAYLIGHT +END:VTIMEZONE +BEGIN:VEVENT +ORGANIZER;CN="A. Luser":MAILTO:a.luser@foo.com +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Luser, Oth + er":MAILTO:other.luser@foo.com +DESCRIPTION;LANGUAGE=en-US:\nWhassup?\n\n +SUMMARY;LANGUAGE=en-US:Query +DTSTART;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna" + :20120515T150000 +DTEND;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna":2 + 0120515T153000 +UID:040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000 + 010000000575268034ECDB649A15349B1BF240F15 +RECURRENCE-ID;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, V + ienna":20120515T170000 +CLASS:PUBLIC +PRIORITY:5 +DTSTAMP:20120514T153645Z +TRANSP:OPAQUE +STATUS:CONFIRMED +SEQUENCE:15 +LOCATION;LANGUAGE=en-US:phone +X-MICROSOFT-CDO-APPT-SEQUENCE:15 +X-MICROSOFT-CDO-OWNERAPPTID:1907632092 +X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE +X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY +X-MICROSOFT-CDO-ALLDAYEVENT:FALSE +X-MICROSOFT-CDO-IMPORTANCE:1 +X-MICROSOFT-CDO-INSTTYPE:3 +BEGIN:VALARM +ACTION:DISPLAY +DESCRIPTION:REMINDER +TRIGGER;RELATED=START:-PT15M +END:VALARM +END:VEVENT +END:VCALENDAR \ No newline at end of file diff --git a/test/data/icalendar/import-bug-22092.diary-american b/test/data/icalendar/import-bug-22092.diary-american new file mode 100644 index 00000000000..392345fe0a2 --- /dev/null +++ b/test/data/icalendar/import-bug-22092.diary-american @@ -0,0 +1,6 @@ +&12/8/2014 18:30-22:55 Norwegian til Tromsoe-Langnes - + Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 + Location: Stavanger-Sola + Organizer: noreply@norwegian.no + Class: PUBLIC + UID: RFCALITEM1 diff --git a/test/data/icalendar/import-bug-22092.diary-european b/test/data/icalendar/import-bug-22092.diary-european new file mode 100644 index 00000000000..6a64cf6a8e9 --- /dev/null +++ b/test/data/icalendar/import-bug-22092.diary-european @@ -0,0 +1,6 @@ +&8/12/2014 18:30-22:55 Norwegian til Tromsoe-Langnes - + Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 + Location: Stavanger-Sola + Organizer: noreply@norwegian.no + Class: PUBLIC + UID: RFCALITEM1 diff --git a/test/data/icalendar/import-bug-22092.diary-iso b/test/data/icalendar/import-bug-22092.diary-iso new file mode 100644 index 00000000000..e0fadbf94dc --- /dev/null +++ b/test/data/icalendar/import-bug-22092.diary-iso @@ -0,0 +1,6 @@ +&2014/12/8 18:30-22:55 Norwegian til Tromsoe-Langnes - + Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 + Location: Stavanger-Sola + Organizer: noreply@norwegian.no + Class: PUBLIC + UID: RFCALITEM1 diff --git a/test/data/icalendar/import-bug-22092.ics b/test/data/icalendar/import-bug-22092.ics new file mode 100644 index 00000000000..4a4c679da9c --- /dev/null +++ b/test/data/icalendar/import-bug-22092.ics @@ -0,0 +1,30 @@ +BEGIN:VCALENDAR +PRODID:-//www.norwegian.no//iCalendar MIMEDIR//EN +VERSION:2.0 +METHOD:REQUEST +BEGIN:VEVENT +UID:RFCALITEM1 +SEQUENCE:1512040950 +DTSTAMP:20141204T095043Z +ORGANIZER:noreply@norwegian.no +DTSTART:20141208T173000Z + +DTEND:20141208T215500Z + +LOCATION:Stavanger-Sola + +DESCRIPTION:Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 + +X-ALT-DESC;FMTTYPE=text/html:Reisereferanse

+SUMMARY:Norwegian til Tromsoe-Langnes - + +CATEGORIES:Appointment + + +PRIORITY:5 + +CLASS:PUBLIC + +TRANSP:OPAQUE +END:VEVENT +END:VCALENDAR diff --git a/test/data/icalendar/import-bug-24199.diary-american b/test/data/icalendar/import-bug-24199.diary-american new file mode 100644 index 00000000000..b3308f1fcfa --- /dev/null +++ b/test/data/icalendar/import-bug-24199.diary-american @@ -0,0 +1,5 @@ +&%%(and (not (diary-date 1 6 2016)) (not (diary-date 2 3 2016)) (not (diary-date 3 2 2016)) (not (diary-date 5 4 2016)) (not (diary-date 6 1 2016)) (diary-float t 3 1) (diary-block 12 2 2015 1 1 9999)) 12:46-16:00 Summary + Desc: Desc + Location: Loc + Class: DEFAULT + UID: 9188710a-08a7-4061-bae3-d4cf4972599a diff --git a/test/data/icalendar/import-bug-24199.diary-european b/test/data/icalendar/import-bug-24199.diary-european new file mode 100644 index 00000000000..acba714b527 --- /dev/null +++ b/test/data/icalendar/import-bug-24199.diary-european @@ -0,0 +1,5 @@ +&%%(and (not (diary-date 6 1 2016)) (not (diary-date 3 2 2016)) (not (diary-date 2 3 2016)) (not (diary-date 4 5 2016)) (not (diary-date 1 6 2016)) (diary-float t 3 1) (diary-block 2 12 2015 1 1 9999)) 12:46-16:00 Summary + Desc: Desc + Location: Loc + Class: DEFAULT + UID: 9188710a-08a7-4061-bae3-d4cf4972599a diff --git a/test/data/icalendar/import-bug-24199.diary-iso b/test/data/icalendar/import-bug-24199.diary-iso new file mode 100644 index 00000000000..2c18395dea8 --- /dev/null +++ b/test/data/icalendar/import-bug-24199.diary-iso @@ -0,0 +1,5 @@ +&%%(and (not (diary-date 2016 1 6)) (not (diary-date 2016 2 3)) (not (diary-date 2016 3 2)) (not (diary-date 2016 5 4)) (not (diary-date 2016 6 1)) (diary-float t 3 1) (diary-block 2015 12 2 9999 1 1)) 12:46-16:00 Summary + Desc: Desc + Location: Loc + Class: DEFAULT + UID: 9188710a-08a7-4061-bae3-d4cf4972599a diff --git a/test/data/icalendar/import-bug-24199.ics b/test/data/icalendar/import-bug-24199.ics new file mode 100644 index 00000000000..a307c2da3ca --- /dev/null +++ b/test/data/icalendar/import-bug-24199.ics @@ -0,0 +1,25 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:Summary +DESCRIPTION:Desc +LOCATION:Loc +DTSTART:20151202T124600 +DTEND:20151202T160000 +RRULE:FREQ=MONTHLY;BYDAY=1WE;INTERVAL=1 +EXDATE:20160106T114600Z +EXDATE:20160203T114600Z +EXDATE:20160302T114600Z +EXDATE:20160504T104600Z +EXDATE:20160601T104600Z +CLASS:DEFAULT +TRANSP:OPAQUE +BEGIN:VALARM +ACTION:DISPLAY +TRIGGER;VALUE=DURATION:-PT3H +END:VALARM +LAST-MODIFIED:20160805T191040Z +UID:9188710a-08a7-4061-bae3-d4cf4972599a +END:VEVENT +END:VCALENDAR diff --git a/test/data/icalendar/import-bug-33277.diary-american b/test/data/icalendar/import-bug-33277.diary-american new file mode 100644 index 00000000000..c546fa9a97c --- /dev/null +++ b/test/data/icalendar/import-bug-33277.diary-american @@ -0,0 +1 @@ +&11/5/2018 21:00 event with same start/end time diff --git a/test/data/icalendar/import-bug-33277.diary-european b/test/data/icalendar/import-bug-33277.diary-european new file mode 100644 index 00000000000..28e53960536 --- /dev/null +++ b/test/data/icalendar/import-bug-33277.diary-european @@ -0,0 +1 @@ +&5/11/2018 21:00 event with same start/end time diff --git a/test/data/icalendar/import-bug-33277.diary-iso b/test/data/icalendar/import-bug-33277.diary-iso new file mode 100644 index 00000000000..faa7aeafeb5 --- /dev/null +++ b/test/data/icalendar/import-bug-33277.diary-iso @@ -0,0 +1 @@ +&2018/11/5 21:00 event with same start/end time diff --git a/test/data/icalendar/import-bug-33277.ics b/test/data/icalendar/import-bug-33277.ics new file mode 100644 index 00000000000..a4122a28007 --- /dev/null +++ b/test/data/icalendar/import-bug-33277.ics @@ -0,0 +1,15 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTART:20181105T200000Z +DTSTAMP:20181105T181652Z +DESCRIPTION: +LAST-MODIFIED:20181105T181646Z +LOCATION: +SEQUENCE:0 +SUMMARY:event with same start/end time +TRANSP:OPAQUE +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-bug-6766.diary-american b/test/data/icalendar/import-bug-6766.diary-american new file mode 100644 index 00000000000..30deea9911a --- /dev/null +++ b/test/data/icalendar/import-bug-6766.diary-american @@ -0,0 +1,7 @@ +&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum + Status: CONFIRMED + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1262 +&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1263 diff --git a/test/data/icalendar/import-bug-6766.diary-european b/test/data/icalendar/import-bug-6766.diary-european new file mode 100644 index 00000000000..ba16c02305a --- /dev/null +++ b/test/data/icalendar/import-bug-6766.diary-european @@ -0,0 +1,7 @@ +&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum + Status: CONFIRMED + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1262 +&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1263 diff --git a/test/data/icalendar/import-bug-6766.diary-iso b/test/data/icalendar/import-bug-6766.diary-iso new file mode 100644 index 00000000000..7794e586f37 --- /dev/null +++ b/test/data/icalendar/import-bug-6766.diary-iso @@ -0,0 +1,7 @@ +&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 2010 4 21)) 11:30-12:00 Scrum + Status: CONFIRMED + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1262 +&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1263 diff --git a/test/data/icalendar/import-bug-6766.ics b/test/data/icalendar/import-bug-6766.ics new file mode 100644 index 00000000000..451391be025 --- /dev/null +++ b/test/data/icalendar/import-bug-6766.ics @@ -0,0 +1,28 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +CLASS:PUBLIC +DTEND;TZID=America/New_York:20100421T120000 +DTSTAMP:20100525T141214Z +DTSTART;TZID=America/New_York:20100421T113000 +RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,TH,FR +SEQUENCE:1 +STATUS:CONFIRMED +SUMMARY:Scrum +TRANSP:OPAQUE +UID:8814e3f9-7482-408f-996c-3bfe486a1262 +END:VEVENT +BEGIN:VEVENT +CLASS:PUBLIC +DTSTAMP:20100525T141214Z +DTSTART;VALUE=DATE:20100422 +DTEND;VALUE=DATE:20100423 +RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,TH +SEQUENCE:1 +SUMMARY:Tues + Thurs thinking +TRANSP:OPAQUE +UID:8814e3f9-7482-408f-996c-3bfe486a1263 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-duration-2.diary-american b/test/data/icalendar/import-duration-2.diary-american new file mode 100644 index 00000000000..56f41d6ad9e --- /dev/null +++ b/test/data/icalendar/import-duration-2.diary-american @@ -0,0 +1,3 @@ +&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub + Class: PUBLIC + UID: 20041127T183329Z-18215-1001-4536-49109@andromeda diff --git a/test/data/icalendar/import-duration-2.diary-european b/test/data/icalendar/import-duration-2.diary-european new file mode 100644 index 00000000000..999102ab6b4 --- /dev/null +++ b/test/data/icalendar/import-duration-2.diary-european @@ -0,0 +1,3 @@ +&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub + Class: PUBLIC + UID: 20041127T183329Z-18215-1001-4536-49109@andromeda diff --git a/test/data/icalendar/import-duration-2.diary-iso b/test/data/icalendar/import-duration-2.diary-iso new file mode 100644 index 00000000000..393937e6cd9 --- /dev/null +++ b/test/data/icalendar/import-duration-2.diary-iso @@ -0,0 +1,3 @@ +&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub + Class: PUBLIC + UID: 20041127T183329Z-18215-1001-4536-49109@andromeda diff --git a/test/data/icalendar/import-duration-2.ics b/test/data/icalendar/import-duration-2.ics new file mode 100644 index 00000000000..eb8a03ba36f --- /dev/null +++ b/test/data/icalendar/import-duration-2.ics @@ -0,0 +1,17 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID:20041127T183329Z-18215-1001-4536-49109@andromeda +DTSTAMP:20041127T183315Z +LAST-MODIFIED:20041127T183329 +SUMMARY:Urlaub +DTSTART;VALUE=DATE:20011221 +DTEND;VALUE=DATE:20011221 +RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU +CLASS:PUBLIC +SEQUENCE:1 +CREATED:20041127T183329 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-duration.diary-american b/test/data/icalendar/import-duration.diary-american new file mode 100644 index 00000000000..268736a8cd0 --- /dev/null +++ b/test/data/icalendar/import-duration.diary-american @@ -0,0 +1 @@ +&%%(and (diary-block 2 17 2005 2 23 2005)) duration diff --git a/test/data/icalendar/import-duration.diary-european b/test/data/icalendar/import-duration.diary-european new file mode 100644 index 00000000000..7d852ddcd3c --- /dev/null +++ b/test/data/icalendar/import-duration.diary-european @@ -0,0 +1 @@ +&%%(and (diary-block 17 2 2005 23 2 2005)) duration diff --git a/test/data/icalendar/import-duration.diary-iso b/test/data/icalendar/import-duration.diary-iso new file mode 100644 index 00000000000..5d3a714284e --- /dev/null +++ b/test/data/icalendar/import-duration.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-block 2005 2 17 2005 2 23)) duration diff --git a/test/data/icalendar/import-duration.ics b/test/data/icalendar/import-duration.ics new file mode 100644 index 00000000000..67f5c73571b --- /dev/null +++ b/test/data/icalendar/import-duration.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTART;VALUE=DATE:20050217 +SUMMARY:duration +DURATION:P7D +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-multiple-vcalendars.diary-american b/test/data/icalendar/import-multiple-vcalendars.diary-american new file mode 100644 index 00000000000..d1b1992a022 --- /dev/null +++ b/test/data/icalendar/import-multiple-vcalendars.diary-american @@ -0,0 +1,4 @@ +&7/23/2011 event-1 +&7/24/2011 event-2 +&7/25/2011 event-3a +&7/25/2011 event-3b diff --git a/test/data/icalendar/import-multiple-vcalendars.diary-european b/test/data/icalendar/import-multiple-vcalendars.diary-european new file mode 100644 index 00000000000..f068354220c --- /dev/null +++ b/test/data/icalendar/import-multiple-vcalendars.diary-european @@ -0,0 +1,4 @@ +&23/7/2011 event-1 +&24/7/2011 event-2 +&25/7/2011 event-3a +&25/7/2011 event-3b diff --git a/test/data/icalendar/import-multiple-vcalendars.diary-iso b/test/data/icalendar/import-multiple-vcalendars.diary-iso new file mode 100644 index 00000000000..5685e4708a7 --- /dev/null +++ b/test/data/icalendar/import-multiple-vcalendars.diary-iso @@ -0,0 +1,4 @@ +&2011/7/23 event-1 +&2011/7/24 event-2 +&2011/7/25 event-3a +&2011/7/25 event-3b diff --git a/test/data/icalendar/import-multiple-vcalendars.ics b/test/data/icalendar/import-multiple-vcalendars.ics new file mode 100644 index 00000000000..69a02c09b1b --- /dev/null +++ b/test/data/icalendar/import-multiple-vcalendars.ics @@ -0,0 +1,21 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTART;VALUE=DATE:20110723 +SUMMARY:event-1 +END:VEVENT +BEGIN:VEVENT +DTSTART;VALUE=DATE:20110724 +SUMMARY:event-2 +END:VEVENT +BEGIN:VEVENT +DTSTART;VALUE=DATE:20110725 +SUMMARY:event-3a +END:VEVENT +BEGIN:VEVENT +DTSTART;VALUE=DATE:20110725 +SUMMARY:event-3b +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-non-recurring-1.diary-american b/test/data/icalendar/import-non-recurring-1.diary-american new file mode 100644 index 00000000000..780e3a8ce64 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-1.diary-american @@ -0,0 +1 @@ +&9/19/2003 09:00-11:30 non-recurring diff --git a/test/data/icalendar/import-non-recurring-1.diary-european b/test/data/icalendar/import-non-recurring-1.diary-european new file mode 100644 index 00000000000..7e0cd21b784 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-1.diary-european @@ -0,0 +1 @@ +&19/9/2003 09:00-11:30 non-recurring diff --git a/test/data/icalendar/import-non-recurring-1.diary-iso b/test/data/icalendar/import-non-recurring-1.diary-iso new file mode 100644 index 00000000000..c7311286619 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-1.diary-iso @@ -0,0 +1 @@ +&2003/9/19 09:00-11:30 non-recurring diff --git a/test/data/icalendar/import-non-recurring-1.ics b/test/data/icalendar/import-non-recurring-1.ics new file mode 100644 index 00000000000..cd471efc861 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-1.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:non-recurring +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-non-recurring-all-day.diary-american b/test/data/icalendar/import-non-recurring-all-day.diary-american new file mode 100644 index 00000000000..1d4bb6a337e --- /dev/null +++ b/test/data/icalendar/import-non-recurring-all-day.diary-american @@ -0,0 +1 @@ +&9/19/2003 non-recurring allday diff --git a/test/data/icalendar/import-non-recurring-all-day.diary-european b/test/data/icalendar/import-non-recurring-all-day.diary-european new file mode 100644 index 00000000000..b56c7f4e17f --- /dev/null +++ b/test/data/icalendar/import-non-recurring-all-day.diary-european @@ -0,0 +1 @@ +&19/9/2003 non-recurring allday diff --git a/test/data/icalendar/import-non-recurring-all-day.diary-iso b/test/data/icalendar/import-non-recurring-all-day.diary-iso new file mode 100644 index 00000000000..f1c70ab34c3 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-all-day.diary-iso @@ -0,0 +1 @@ +&2003/9/19 non-recurring allday diff --git a/test/data/icalendar/import-non-recurring-all-day.ics b/test/data/icalendar/import-non-recurring-all-day.ics new file mode 100644 index 00000000000..4efa8ffa133 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-all-day.ics @@ -0,0 +1,9 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:non-recurring allday +DTSTART;VALUE=DATE-TIME:20030919 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-non-recurring-another-example.diary-american b/test/data/icalendar/import-non-recurring-another-example.diary-american new file mode 100644 index 00000000000..2eb8c0ab686 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-another-example.diary-american @@ -0,0 +1,4 @@ +&11/23/2004 14:45-15:45 another example + Status: TENTATIVE + Class: PRIVATE + UID: 6161a312-3902-11d9-b512-f764153bb28b diff --git a/test/data/icalendar/import-non-recurring-another-example.diary-european b/test/data/icalendar/import-non-recurring-another-example.diary-european new file mode 100644 index 00000000000..394eae8bb77 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-another-example.diary-european @@ -0,0 +1,4 @@ +&23/11/2004 14:45-15:45 another example + Status: TENTATIVE + Class: PRIVATE + UID: 6161a312-3902-11d9-b512-f764153bb28b diff --git a/test/data/icalendar/import-non-recurring-another-example.diary-iso b/test/data/icalendar/import-non-recurring-another-example.diary-iso new file mode 100644 index 00000000000..5e8bdf417d5 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-another-example.diary-iso @@ -0,0 +1,4 @@ +&2004/11/23 14:45-15:45 another example + Status: TENTATIVE + Class: PRIVATE + UID: 6161a312-3902-11d9-b512-f764153bb28b diff --git a/test/data/icalendar/import-non-recurring-another-example.ics b/test/data/icalendar/import-non-recurring-another-example.ics new file mode 100644 index 00000000000..b145e418791 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-another-example.ics @@ -0,0 +1,23 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID + :6161a312-3902-11d9-b512-f764153bb28b +SUMMARY + :another example +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + :20041123T144500 +DTEND + :20041123T154500 +DTSTAMP + :20041118T013641Z +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-non-recurring-block.diary-american b/test/data/icalendar/import-non-recurring-block.diary-american new file mode 100644 index 00000000000..b22234229cf --- /dev/null +++ b/test/data/icalendar/import-non-recurring-block.diary-american @@ -0,0 +1,4 @@ +&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien + Status: TENTATIVE + Class: PRIVATE + UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 diff --git a/test/data/icalendar/import-non-recurring-block.diary-european b/test/data/icalendar/import-non-recurring-block.diary-european new file mode 100644 index 00000000000..8043482442f --- /dev/null +++ b/test/data/icalendar/import-non-recurring-block.diary-european @@ -0,0 +1,4 @@ +&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien + Status: TENTATIVE + Class: PRIVATE + UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 diff --git a/test/data/icalendar/import-non-recurring-block.diary-iso b/test/data/icalendar/import-non-recurring-block.diary-iso new file mode 100644 index 00000000000..e0f1896114f --- /dev/null +++ b/test/data/icalendar/import-non-recurring-block.diary-iso @@ -0,0 +1,4 @@ +&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien + Status: TENTATIVE + Class: PRIVATE + UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 diff --git a/test/data/icalendar/import-non-recurring-block.ics b/test/data/icalendar/import-non-recurring-block.ics new file mode 100644 index 00000000000..0c52ba3d66a --- /dev/null +++ b/test/data/icalendar/import-non-recurring-block.ics @@ -0,0 +1,16 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61 +SUMMARY:Sommerferien +STATUS:TENTATIVE +CLASS:PRIVATE +X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten +X-MOZILLA-RECUR-DEFAULT-INTERVAL:0 +DTSTART;VALUE=DATE:20040719 +DTEND;VALUE=DATE:20040828 +DTSTAMP:20031103T011641Z +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-non-recurring-folded-summary.diary-american b/test/data/icalendar/import-non-recurring-folded-summary.diary-american new file mode 100644 index 00000000000..2954d0c4fd1 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-folded-summary.diary-american @@ -0,0 +1,4 @@ +&11/23/2004 14:00-14:30 folded summary + Status: TENTATIVE + Class: PRIVATE + UID: 04979712-3902-11d9-93dd-8f9f4afe08da diff --git a/test/data/icalendar/import-non-recurring-folded-summary.diary-european b/test/data/icalendar/import-non-recurring-folded-summary.diary-european new file mode 100644 index 00000000000..7745fc811b4 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-folded-summary.diary-european @@ -0,0 +1,4 @@ +&23/11/2004 14:00-14:30 folded summary + Status: TENTATIVE + Class: PRIVATE + UID: 04979712-3902-11d9-93dd-8f9f4afe08da diff --git a/test/data/icalendar/import-non-recurring-folded-summary.diary-iso b/test/data/icalendar/import-non-recurring-folded-summary.diary-iso new file mode 100644 index 00000000000..8c19a95ed2d --- /dev/null +++ b/test/data/icalendar/import-non-recurring-folded-summary.diary-iso @@ -0,0 +1,4 @@ +&2004/11/23 14:00-14:30 folded summary + Status: TENTATIVE + Class: PRIVATE + UID: 04979712-3902-11d9-93dd-8f9f4afe08da diff --git a/test/data/icalendar/import-non-recurring-folded-summary.ics b/test/data/icalendar/import-non-recurring-folded-summary.ics new file mode 100644 index 00000000000..e3ecee9dae8 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-folded-summary.ics @@ -0,0 +1,25 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID + :04979712-3902-11d9-93dd-8f9f4afe08da +SUMMARY + :folded summary +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + :20041123T140000 +DTEND + :20041123T143000 +DTSTAMP + :20041118T013430Z +LAST-MODIFIED + :20041118T013640Z +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-non-recurring-long-summary.diary-american b/test/data/icalendar/import-non-recurring-long-summary.diary-american new file mode 100644 index 00000000000..84cd464c568 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-long-summary.diary-american @@ -0,0 +1 @@ +&9/19/2003 long summary diff --git a/test/data/icalendar/import-non-recurring-long-summary.diary-european b/test/data/icalendar/import-non-recurring-long-summary.diary-european new file mode 100644 index 00000000000..5d6524202c3 --- /dev/null +++ b/test/data/icalendar/import-non-recurring-long-summary.diary-european @@ -0,0 +1 @@ +&19/9/2003 long summary diff --git a/test/data/icalendar/import-non-recurring-long-summary.diary-iso b/test/data/icalendar/import-non-recurring-long-summary.diary-iso new file mode 100644 index 00000000000..d2300522d9a --- /dev/null +++ b/test/data/icalendar/import-non-recurring-long-summary.diary-iso @@ -0,0 +1 @@ +&2003/9/19 long summary diff --git a/test/data/icalendar/import-non-recurring-long-summary.ics b/test/data/icalendar/import-non-recurring-long-summary.ics new file mode 100644 index 00000000000..39ae02f10ca --- /dev/null +++ b/test/data/icalendar/import-non-recurring-long-summary.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:long + summary +DTSTART;VALUE=DATE:20030919 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-real-world-2003-05-29.diary-american b/test/data/icalendar/import-real-world-2003-05-29.diary-american new file mode 100644 index 00000000000..e6c8712d254 --- /dev/null +++ b/test/data/icalendar/import-real-world-2003-05-29.diary-american @@ -0,0 +1,6 @@ +&5/9/2003 07:00-12:00 On-Site Interview + Desc: 10:30am - Blah + Location: Cccc + Organizer: MAILTO:aaaaaaa@aaaaaaa.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9 diff --git a/test/data/icalendar/import-real-world-2003-05-29.diary-european b/test/data/icalendar/import-real-world-2003-05-29.diary-european new file mode 100644 index 00000000000..cecca070a51 --- /dev/null +++ b/test/data/icalendar/import-real-world-2003-05-29.diary-european @@ -0,0 +1,6 @@ +&9/5/2003 07:00-12:00 On-Site Interview + Desc: 10:30am - Blah + Location: Cccc + Organizer: MAILTO:aaaaaaa@aaaaaaa.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9 diff --git a/test/data/icalendar/import-real-world-2003-05-29.ics b/test/data/icalendar/import-real-world-2003-05-29.ics new file mode 100644 index 00000000000..decc8df5451 --- /dev/null +++ b/test/data/icalendar/import-real-world-2003-05-29.ics @@ -0,0 +1,54 @@ +BEGIN:VCALENDAR +METHOD:REQUEST +PRODID:Microsoft CDO for Microsoft Exchange +VERSION:2.0 +BEGIN:VTIMEZONE +TZID:Kolkata, Chennai, Mumbai, New Delhi +X-MICROSOFT-CDO-TZID:23 +BEGIN:STANDARD +DTSTART:16010101T000000 +TZOFFSETFROM:+0530 +TZOFFSETTO:+0530 +END:STANDARD +BEGIN:DAYLIGHT +DTSTART:16010101T000000 +TZOFFSETFROM:+0530 +TZOFFSETTO:+0530 +END:DAYLIGHT +END:VTIMEZONE +BEGIN:VEVENT +DTSTAMP:20030509T043439Z +DTSTART;TZID="Kolkata, Chennai, Mumbai, New Delhi":20030509T103000 +SUMMARY:On-Site Interview +UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000 + 010000000DB823520692542408ED02D7023F9DFF9 +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Xxxxx + xxx Xxxxxxxxxxxx":MAILTO:xxxxxxxx@xxxxxxx.com +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Yyyyyyy Y + yyyy":MAILTO:yyyyyyy@yyyyyyy.com +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Zzzz Zzzz + zz":MAILTO:zzzzzz@zzzzzzz.com +ORGANIZER;CN="Aaaaaa Aaaaa":MAILTO:aaaaaaa@aaaaaaa.com +LOCATION:Cccc +DTEND;TZID="Kolkata, Chennai, Mumbai, New Delhi":20030509T153000 +DESCRIPTION:10:30am - Blah +SEQUENCE:0 +PRIORITY:5 +CLASS: +CREATED:20030509T043439Z +LAST-MODIFIED:20030509T043459Z +STATUS:CONFIRMED +TRANSP:OPAQUE +X-MICROSOFT-CDO-BUSYSTATUS:BUSY +X-MICROSOFT-CDO-INSTTYPE:0 +X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY +X-MICROSOFT-CDO-ALLDAYEVENT:FALSE +X-MICROSOFT-CDO-IMPORTANCE:1 +X-MICROSOFT-CDO-OWNERAPPTID:126441427 +BEGIN:VALARM +ACTION:DISPLAY +DESCRIPTION:REMINDER +TRIGGER;RELATED=START:-PT00H15M00S +END:VALARM +END:VEVENT +END:VCALENDAR diff --git a/test/data/icalendar/import-real-world-2003-06-18a.diary-american b/test/data/icalendar/import-real-world-2003-06-18a.diary-american new file mode 100644 index 00000000000..f2c914184e7 --- /dev/null +++ b/test/data/icalendar/import-real-world-2003-06-18a.diary-american @@ -0,0 +1,6 @@ +&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX + Desc: 753 Zeichen hier radiert + Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) + Organizer: MAILTO:xxx@xxxxx.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/data/icalendar/import-real-world-2003-06-18a.diary-european b/test/data/icalendar/import-real-world-2003-06-18a.diary-european new file mode 100644 index 00000000000..89cff58af42 --- /dev/null +++ b/test/data/icalendar/import-real-world-2003-06-18a.diary-european @@ -0,0 +1,6 @@ +&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX + Desc: 753 Zeichen hier radiert + Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) + Organizer: MAILTO:xxx@xxxxx.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/data/icalendar/import-real-world-2003-06-18a.ics b/test/data/icalendar/import-real-world-2003-06-18a.ics new file mode 100644 index 00000000000..6bb5b05af17 --- /dev/null +++ b/test/data/icalendar/import-real-world-2003-06-18a.ics @@ -0,0 +1,36 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTAMP:20030618T195512Z +DTSTART;TZID="Mountain Time (US & Canada)":20030623T110000 +SUMMARY:Dress Rehearsal for XXXX-XXXX +UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000 + 0100000007C3A6D65EE726E40B7F3D69A23BD567E +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="AAAAA,AAA + AA (A-AAAAAAA,ex1)":MAILTO:aaaaa_aaaaa@aaaaa.com +ORGANIZER;CN="ABCD,TECHTRAINING + (A-Americas,exgen1)":MAILTO:xxx@xxxxx.com +LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below) +DTEND;TZID="Mountain Time (US & Canada)":20030623T120000 +DESCRIPTION:753 Zeichen hier radiert +SEQUENCE:0 +PRIORITY:5 +CLASS: +CREATED:20030618T195518Z +LAST-MODIFIED:20030618T195527Z +STATUS:CONFIRMED +TRANSP:OPAQUE +X-MICROSOFT-CDO-BUSYSTATUS:BUSY +X-MICROSOFT-CDO-INSTTYPE:0 +X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY +X-MICROSOFT-CDO-ALLDAYEVENT:FALSE +X-MICROSOFT-CDO-IMPORTANCE:1 +X-MICROSOFT-CDO-OWNERAPPTID:1022519251 +BEGIN:VALARM +ACTION:DISPLAY +DESCRIPTION:REMINDER +TRIGGER;RELATED=START:-PT00H15M00S +END:VALARM +END:VEVENT +END:VCALENDAR diff --git a/test/data/icalendar/import-real-world-2003-06-18b.diary-american b/test/data/icalendar/import-real-world-2003-06-18b.diary-american new file mode 100644 index 00000000000..2c0774cdd83 --- /dev/null +++ b/test/data/icalendar/import-real-world-2003-06-18b.diary-american @@ -0,0 +1,6 @@ +&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 + Desc: Viele Zeichen standen hier frĂŒher + Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) + Organizer: MAILTO:bbb@bbbbb.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/data/icalendar/import-real-world-2003-06-18b.diary-european b/test/data/icalendar/import-real-world-2003-06-18b.diary-european new file mode 100644 index 00000000000..95aac168699 --- /dev/null +++ b/test/data/icalendar/import-real-world-2003-06-18b.diary-european @@ -0,0 +1,6 @@ +&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 + Desc: Viele Zeichen standen hier frĂŒher + Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) + Organizer: MAILTO:bbb@bbbbb.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/data/icalendar/import-real-world-2003-06-18b.ics b/test/data/icalendar/import-real-world-2003-06-18b.ics new file mode 100644 index 00000000000..1523135adf3 --- /dev/null +++ b/test/data/icalendar/import-real-world-2003-06-18b.ics @@ -0,0 +1,55 @@ +BEGIN:VCALENDAR +METHOD:REQUEST +PRODID:Microsoft CDO for Microsoft Exchange +VERSION:2.0 +BEGIN:VTIMEZONE +TZID:Mountain Time (US & Canada) +X-MICROSOFT-CDO-TZID:12 +BEGIN:STANDARD +DTSTART:16010101T020000 +TZOFFSETFROM:-0600 +TZOFFSETTO:-0700 +RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU +END:STANDARD +BEGIN:DAYLIGHT +DTSTART:16010101T020000 +TZOFFSETFROM:-0700 +TZOFFSETTO:-0600 +RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU +END:DAYLIGHT +END:VTIMEZONE +BEGIN:VEVENT +DTSTAMP:20030618T230323Z +DTSTART;TZID="Mountain Time (US & Canada)":20030623T090000 +SUMMARY:Updated: Dress Rehearsal for ABC01-15 +UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000 + 0100000007C3A6D65EE726E40B7F3D69A23BD567E +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20 + 0700Z;RSVP=TRUE;CN="AAAAA,AAAAAA +\(A-AAAAAAA,ex1)":MAILTO:aaaaaa_aaaaa@aaaaa + .com +ORGANIZER;CN="ABCD,TECHTRAINING +\(A-Americas,exgen1)":MAILTO:bbb@bbbbb.com +LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below) +DTEND;TZID="Mountain Time (US & Canada)":20030623T100000 +DESCRIPTION:Viele Zeichen standen hier frĂŒher +SEQUENCE:0 +PRIORITY:5 +CLASS: +CREATED:20030618T230326Z +LAST-MODIFIED:20030618T230335Z +STATUS:CONFIRMED +TRANSP:OPAQUE +X-MICROSOFT-CDO-BUSYSTATUS:BUSY +X-MICROSOFT-CDO-INSTTYPE:0 +X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY +X-MICROSOFT-CDO-ALLDAYEVENT:FALSE +X-MICROSOFT-CDO-IMPORTANCE:1 +X-MICROSOFT-CDO-OWNERAPPTID:1022519251 +BEGIN:VALARM +ACTION:DISPLAY +DESCRIPTION:REMINDER +TRIGGER;RELATED=START:-PT00H15M00S +END:VALARM +END:VEVENT +END:VCALENDAR \ No newline at end of file diff --git a/test/data/icalendar/import-real-world-2004-11-19.diary-american b/test/data/icalendar/import-real-world-2004-11-19.diary-american new file mode 100644 index 00000000000..a986f700ba2 --- /dev/null +++ b/test/data/icalendar/import-real-world-2004-11-19.diary-american @@ -0,0 +1,19 @@ +&11/23/2004 14:00-14:30 Jjjjj & Wwwww + Status: TENTATIVE + Class: PRIVATE +&11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb + Status: TENTATIVE + Class: PRIVATE +&11/23/2004 11:00-12:00 Hhhhhhhh + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa + Desc: Vvvvv Rrrr aaa Cccccc + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh + Status: TENTATIVE + Class: PRIVATE diff --git a/test/data/icalendar/import-real-world-2004-11-19.diary-european b/test/data/icalendar/import-real-world-2004-11-19.diary-european new file mode 100644 index 00000000000..cbfe99eb8e3 --- /dev/null +++ b/test/data/icalendar/import-real-world-2004-11-19.diary-european @@ -0,0 +1,19 @@ +&23/11/2004 14:00-14:30 Jjjjj & Wwwww + Status: TENTATIVE + Class: PRIVATE +&23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb + Status: TENTATIVE + Class: PRIVATE +&23/11/2004 11:00-12:00 Hhhhhhhh + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa + Desc: Vvvvv Rrrr aaa Cccccc + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh + Status: TENTATIVE + Class: PRIVATE diff --git a/test/data/icalendar/import-real-world-2004-11-19.ics b/test/data/icalendar/import-real-world-2004-11-19.ics new file mode 100644 index 00000000000..9edb682fcad --- /dev/null +++ b/test/data/icalendar/import-real-world-2004-11-19.ics @@ -0,0 +1,120 @@ +BEGIN:VCALENDAR +VERSION + :2.0 +PRODID + :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN +BEGIN:VEVENT +SUMMARY + :Jjjjj & Wwwww +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + :20041123T140000 +DTEND + :20041123T143000 +DTSTAMP + :20041118T013430Z +LAST-MODIFIED + :20041118T013640Z +END:VEVENT +BEGIN:VEVENT +SUMMARY + :BB Aaaaaaaa Bbbbb +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + :20041123T144500 +DTEND + :20041123T154500 +DTSTAMP + :20041118T013641Z +END:VEVENT +BEGIN:VEVENT +SUMMARY + :Hhhhhhhh +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + :20041123T110000 +DTEND + :20041123T120000 +DTSTAMP + :20041118T013831Z +END:VEVENT +BEGIN:VEVENT +SUMMARY + :MMM Aaaaaaaaa +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +X-MOZILLA-RECUR-DEFAULT-INTERVAL + :2 +RRULE + :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR +DTSTART + :20041112T140000 +DTEND + :20041112T183000 +DTSTAMP + :20041118T014117Z +END:VEVENT +BEGIN:VEVENT +SUMMARY + :Rrrr/Cccccc ii Aaaaaaaa +DESCRIPTION + :Vvvvv Rrrr aaa Cccccc +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + ;VALUE=DATE + :20041119 +DTEND + ;VALUE=DATE + :20041120 +DTSTAMP + :20041118T013107Z +LAST-MODIFIED + :20041118T014203Z +END:VEVENT +BEGIN:VEVENT +SUMMARY + :Wwww aa hhhh +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +RRULE + :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO +DTSTART + ;VALUE=DATE + :20041101 +DTEND + ;VALUE=DATE + :20041102 +DTSTAMP + :20041118T014045Z +LAST-MODIFIED + :20041118T023846Z +END:VEVENT +END:VCALENDAR diff --git a/test/data/icalendar/import-real-world-2005-02-07.diary-american b/test/data/icalendar/import-real-world-2005-02-07.diary-american new file mode 100644 index 00000000000..ce7d835d96b --- /dev/null +++ b/test/data/icalendar/import-real-world-2005-02-07.diary-american @@ -0,0 +1,5 @@ +&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day + Desc: abcdef + Status: CONFIRMED + Class: PRIVATE + UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4 diff --git a/test/data/icalendar/import-real-world-2005-02-07.diary-european b/test/data/icalendar/import-real-world-2005-02-07.diary-european new file mode 100644 index 00000000000..3a52b0ab271 --- /dev/null +++ b/test/data/icalendar/import-real-world-2005-02-07.diary-european @@ -0,0 +1,5 @@ +&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day + Desc: abcdef + Status: CONFIRMED + Class: PRIVATE + UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4 diff --git a/test/data/icalendar/import-real-world-2005-02-07.ics b/test/data/icalendar/import-real-world-2005-02-07.ics new file mode 100644 index 00000000000..9eec71fe751 --- /dev/null +++ b/test/data/icalendar/import-real-world-2005-02-07.ics @@ -0,0 +1,26 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID + :b60d398e-1dd1-11b2-a159-cf8cb05139f4 +SUMMARY + :Waitangi Day +DESCRIPTION + :abcdef +CATEGORIES + :Public Holiday +STATUS + :CONFIRMED +CLASS + :PRIVATE +DTSTART + ;VALUE=DATE + :20050206 +DTEND + ;VALUE=DATE + :20050207 +DTSTAMP + :20050128T011209Z +END:VEVENT +END:VCALENDAR diff --git a/test/data/icalendar/import-real-world-2005-03-01.diary-american b/test/data/icalendar/import-real-world-2005-03-01.diary-american new file mode 100644 index 00000000000..23c93d45d9a --- /dev/null +++ b/test/data/icalendar/import-real-world-2005-03-01.diary-american @@ -0,0 +1,2 @@ +&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa + UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID diff --git a/test/data/icalendar/import-real-world-2005-03-01.diary-european b/test/data/icalendar/import-real-world-2005-03-01.diary-european new file mode 100644 index 00000000000..106e9f3cdd0 --- /dev/null +++ b/test/data/icalendar/import-real-world-2005-03-01.diary-european @@ -0,0 +1,2 @@ +&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa + UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID diff --git a/test/data/icalendar/import-real-world-2005-03-01.ics b/test/data/icalendar/import-real-world-2005-03-01.ics new file mode 100644 index 00000000000..ed9faa9b0bd --- /dev/null +++ b/test/data/icalendar/import-real-world-2005-03-01.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTART;VALUE=DATE:20050217 +SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa +UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID +DTSTAMP:20050118T210335Z +DURATION:P7D +END:VEVENT +END:VCALENDAR diff --git a/test/data/icalendar/import-real-world-no-dst.diary-american b/test/data/icalendar/import-real-world-no-dst.diary-american new file mode 100644 index 00000000000..290edb88760 --- /dev/null +++ b/test/data/icalendar/import-real-world-no-dst.diary-american @@ -0,0 +1,4 @@ +&11/16/2014 04:30-05:30 NoDST + Desc: Test event from timezone without DST + Location: Everywhere + UID: 20141116T171439Z-678877132@marudot.com diff --git a/test/data/icalendar/import-real-world-no-dst.diary-european b/test/data/icalendar/import-real-world-no-dst.diary-european new file mode 100644 index 00000000000..c56b7a6547a --- /dev/null +++ b/test/data/icalendar/import-real-world-no-dst.diary-european @@ -0,0 +1,4 @@ +&16/11/2014 04:30-05:30 NoDST + Desc: Test event from timezone without DST + Location: Everywhere + UID: 20141116T171439Z-678877132@marudot.com diff --git a/test/data/icalendar/import-real-world-no-dst.ics b/test/data/icalendar/import-real-world-no-dst.ics new file mode 100644 index 00000000000..5f147af4f37 --- /dev/null +++ b/test/data/icalendar/import-real-world-no-dst.ics @@ -0,0 +1,26 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//www.marudot.com//iCal Event Maker +X-WR-CALNAME:Test +CALSCALE:GREGORIAN +BEGIN:VTIMEZONE +TZID:Asia/Tehran +TZURL:http://tzurl.org/zoneinfo-outlook/Asia/Tehran +X-LIC-LOCATION:Asia/Tehran +BEGIN:STANDARD +TZOFFSETFROM:+0330 +TZOFFSETTO:+0330 +TZNAME:IRST +DTSTART:19700101T000000 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +DTSTAMP:20141116T171439Z +UID:20141116T171439Z-678877132@marudot.com +DTSTART;TZID="Asia/Tehran":20141116T070000 +DTEND;TZID="Asia/Tehran":20141116T080000 +SUMMARY:NoDST +DESCRIPTION:Test event from timezone without DST +LOCATION:Everywhere +END:VEVENT +END:VCALENDAR \ No newline at end of file diff --git a/test/data/icalendar/import-rrule-anniversary.diary-american b/test/data/icalendar/import-rrule-anniversary.diary-american new file mode 100644 index 00000000000..7b86b554dd4 --- /dev/null +++ b/test/data/icalendar/import-rrule-anniversary.diary-american @@ -0,0 +1 @@ +&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt diff --git a/test/data/icalendar/import-rrule-anniversary.diary-european b/test/data/icalendar/import-rrule-anniversary.diary-european new file mode 100644 index 00000000000..3b82ec09fd5 --- /dev/null +++ b/test/data/icalendar/import-rrule-anniversary.diary-european @@ -0,0 +1 @@ +&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt diff --git a/test/data/icalendar/import-rrule-anniversary.diary-iso b/test/data/icalendar/import-rrule-anniversary.diary-iso new file mode 100644 index 00000000000..7fc99478d4e --- /dev/null +++ b/test/data/icalendar/import-rrule-anniversary.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt diff --git a/test/data/icalendar/import-rrule-anniversary.ics b/test/data/icalendar/import-rrule-anniversary.ics new file mode 100644 index 00000000000..2996f494167 --- /dev/null +++ b/test/data/icalendar/import-rrule-anniversary.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTART;VALUE=DATE:20040815 +DTEND;VALUE=DATE:20040816 +SUMMARY:Maria Himmelfahrt +RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-count-bi-weekly.diary-american b/test/data/icalendar/import-rrule-count-bi-weekly.diary-american new file mode 100644 index 00000000000..84b6d109953 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-bi-weekly.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 14 9 19 2003) (diary-block 9 19 2003 10 31 2003)) 09:00-11:30 rrule count bi-weekly 3 times diff --git a/test/data/icalendar/import-rrule-count-bi-weekly.diary-european b/test/data/icalendar/import-rrule-count-bi-weekly.diary-european new file mode 100644 index 00000000000..0bebdf8872f --- /dev/null +++ b/test/data/icalendar/import-rrule-count-bi-weekly.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 14 19 9 2003) (diary-block 19 9 2003 31 10 2003)) 09:00-11:30 rrule count bi-weekly 3 times diff --git a/test/data/icalendar/import-rrule-count-bi-weekly.diary-iso b/test/data/icalendar/import-rrule-count-bi-weekly.diary-iso new file mode 100644 index 00000000000..11429081abe --- /dev/null +++ b/test/data/icalendar/import-rrule-count-bi-weekly.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 14 2003 9 19) (diary-block 2003 9 19 2003 10 31)) 09:00-11:30 rrule count bi-weekly 3 times diff --git a/test/data/icalendar/import-rrule-count-bi-weekly.ics b/test/data/icalendar/import-rrule-count-bi-weekly.ics new file mode 100644 index 00000000000..888b85bb331 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-bi-weekly.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count bi-weekly 3 times +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-count-daily-long.diary-american b/test/data/icalendar/import-rrule-count-daily-long.diary-american new file mode 100644 index 00000000000..23fe9fcaf32 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-daily-long.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long diff --git a/test/data/icalendar/import-rrule-count-daily-long.diary-european b/test/data/icalendar/import-rrule-count-daily-long.diary-european new file mode 100644 index 00000000000..0d4ab669058 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-daily-long.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long diff --git a/test/data/icalendar/import-rrule-count-daily-long.diary-iso b/test/data/icalendar/import-rrule-count-daily-long.diary-iso new file mode 100644 index 00000000000..8cecda5c879 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-daily-long.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long diff --git a/test/data/icalendar/import-rrule-count-daily-long.ics b/test/data/icalendar/import-rrule-count-daily-long.ics new file mode 100644 index 00000000000..73df19a8196 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-daily-long.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count daily long +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-count-daily-short.diary-american b/test/data/icalendar/import-rrule-count-daily-short.diary-american new file mode 100644 index 00000000000..d69bb08c318 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-daily-short.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short diff --git a/test/data/icalendar/import-rrule-count-daily-short.diary-european b/test/data/icalendar/import-rrule-count-daily-short.diary-european new file mode 100644 index 00000000000..33a1ce4cf51 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-daily-short.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short diff --git a/test/data/icalendar/import-rrule-count-daily-short.diary-iso b/test/data/icalendar/import-rrule-count-daily-short.diary-iso new file mode 100644 index 00000000000..a06bcba0dc1 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-daily-short.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short diff --git a/test/data/icalendar/import-rrule-count-daily-short.ics b/test/data/icalendar/import-rrule-count-daily-short.ics new file mode 100644 index 00000000000..92ffe8be654 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-daily-short.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count daily short +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-count-every-second-month.diary-american b/test/data/icalendar/import-rrule-count-every-second-month.diary-american new file mode 100644 index 00000000000..4ce8ef842f8 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-every-second-month.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month diff --git a/test/data/icalendar/import-rrule-count-every-second-month.diary-european b/test/data/icalendar/import-rrule-count-every-second-month.diary-european new file mode 100644 index 00000000000..09ec3756295 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-every-second-month.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month diff --git a/test/data/icalendar/import-rrule-count-every-second-month.diary-iso b/test/data/icalendar/import-rrule-count-every-second-month.diary-iso new file mode 100644 index 00000000000..ae6feb70d4c --- /dev/null +++ b/test/data/icalendar/import-rrule-count-every-second-month.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month diff --git a/test/data/icalendar/import-rrule-count-every-second-month.ics b/test/data/icalendar/import-rrule-count-every-second-month.ics new file mode 100644 index 00000000000..3b27b665498 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-every-second-month.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count every second month +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-count-every-second-year.diary-american b/test/data/icalendar/import-rrule-count-every-second-year.diary-american new file mode 100644 index 00000000000..99543aa9596 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-every-second-year.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year diff --git a/test/data/icalendar/import-rrule-count-every-second-year.diary-european b/test/data/icalendar/import-rrule-count-every-second-year.diary-european new file mode 100644 index 00000000000..3b330886ce0 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-every-second-year.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year diff --git a/test/data/icalendar/import-rrule-count-every-second-year.diary-iso b/test/data/icalendar/import-rrule-count-every-second-year.diary-iso new file mode 100644 index 00000000000..16af52ea91c --- /dev/null +++ b/test/data/icalendar/import-rrule-count-every-second-year.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year diff --git a/test/data/icalendar/import-rrule-count-every-second-year.ics b/test/data/icalendar/import-rrule-count-every-second-year.ics new file mode 100644 index 00000000000..ce21c34d09a --- /dev/null +++ b/test/data/icalendar/import-rrule-count-every-second-year.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count every second year +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5 +END:VEVENT +END:VCALENDAR diff --git a/test/data/icalendar/import-rrule-count-monthly.diary-american b/test/data/icalendar/import-rrule-count-monthly.diary-american new file mode 100644 index 00000000000..ad5ca0b0ed4 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-monthly.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly diff --git a/test/data/icalendar/import-rrule-count-monthly.diary-european b/test/data/icalendar/import-rrule-count-monthly.diary-european new file mode 100644 index 00000000000..709de3a3fd5 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-monthly.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly diff --git a/test/data/icalendar/import-rrule-count-monthly.diary-iso b/test/data/icalendar/import-rrule-count-monthly.diary-iso new file mode 100644 index 00000000000..9fc2a2def94 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-monthly.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly diff --git a/test/data/icalendar/import-rrule-count-monthly.ics b/test/data/icalendar/import-rrule-count-monthly.ics new file mode 100644 index 00000000000..3391ca24252 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-monthly.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count monthly +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-count-yearly.diary-american b/test/data/icalendar/import-rrule-count-yearly.diary-american new file mode 100644 index 00000000000..8c1f95b0c05 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-yearly.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly diff --git a/test/data/icalendar/import-rrule-count-yearly.diary-european b/test/data/icalendar/import-rrule-count-yearly.diary-european new file mode 100644 index 00000000000..e216e224eae --- /dev/null +++ b/test/data/icalendar/import-rrule-count-yearly.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly diff --git a/test/data/icalendar/import-rrule-count-yearly.diary-iso b/test/data/icalendar/import-rrule-count-yearly.diary-iso new file mode 100644 index 00000000000..3801192ee60 --- /dev/null +++ b/test/data/icalendar/import-rrule-count-yearly.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly diff --git a/test/data/icalendar/import-rrule-count-yearly.ics b/test/data/icalendar/import-rrule-count-yearly.ics new file mode 100644 index 00000000000..d8569933e0c --- /dev/null +++ b/test/data/icalendar/import-rrule-count-yearly.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count yearly +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-daily-two-day.diary-american b/test/data/icalendar/import-rrule-daily-two-day.diary-american new file mode 100644 index 00000000000..495fca5f8df --- /dev/null +++ b/test/data/icalendar/import-rrule-daily-two-day.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily-two-day.diary-european b/test/data/icalendar/import-rrule-daily-two-day.diary-european new file mode 100644 index 00000000000..61db14ab24a --- /dev/null +++ b/test/data/icalendar/import-rrule-daily-two-day.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily-two-day.diary-iso b/test/data/icalendar/import-rrule-daily-two-day.diary-iso new file mode 100644 index 00000000000..0e0a4b19781 --- /dev/null +++ b/test/data/icalendar/import-rrule-daily-two-day.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily-two-day.ics b/test/data/icalendar/import-rrule-daily-two-day.ics new file mode 100644 index 00000000000..8c9cb3b2845 --- /dev/null +++ b/test/data/icalendar/import-rrule-daily-two-day.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule daily +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=DAILY;INTERVAL=2 +END:VEVENT +END:VCALENDAR diff --git a/test/data/icalendar/import-rrule-daily-with-exceptions.diary-american b/test/data/icalendar/import-rrule-daily-with-exceptions.diary-american new file mode 100644 index 00000000000..83e5f582d5f --- /dev/null +++ b/test/data/icalendar/import-rrule-daily-with-exceptions.diary-american @@ -0,0 +1 @@ +&%%(and (not (diary-date 9 25 2003)) (not (diary-date 9 21 2003)) (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily with exceptions diff --git a/test/data/icalendar/import-rrule-daily-with-exceptions.diary-european b/test/data/icalendar/import-rrule-daily-with-exceptions.diary-european new file mode 100644 index 00000000000..a3c7fdd4177 --- /dev/null +++ b/test/data/icalendar/import-rrule-daily-with-exceptions.diary-european @@ -0,0 +1 @@ +&%%(and (not (diary-date 25 9 2003)) (not (diary-date 21 9 2003)) (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily with exceptions diff --git a/test/data/icalendar/import-rrule-daily-with-exceptions.diary-iso b/test/data/icalendar/import-rrule-daily-with-exceptions.diary-iso new file mode 100644 index 00000000000..88b4c892d16 --- /dev/null +++ b/test/data/icalendar/import-rrule-daily-with-exceptions.diary-iso @@ -0,0 +1 @@ +&%%(and (not (diary-date 2003 9 25)) (not (diary-date 2003 9 21)) (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily with exceptions diff --git a/test/data/icalendar/import-rrule-daily-with-exceptions.ics b/test/data/icalendar/import-rrule-daily-with-exceptions.ics new file mode 100644 index 00000000000..5284bf42d8b --- /dev/null +++ b/test/data/icalendar/import-rrule-daily-with-exceptions.ics @@ -0,0 +1,12 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule daily with exceptions +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=DAILY;INTERVAL=2 +EXDATE:20030921,20030925 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-daily.diary-american b/test/data/icalendar/import-rrule-daily.diary-american new file mode 100644 index 00000000000..9213270fa41 --- /dev/null +++ b/test/data/icalendar/import-rrule-daily.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily.diary-european b/test/data/icalendar/import-rrule-daily.diary-european new file mode 100644 index 00000000000..2c70cd7da55 --- /dev/null +++ b/test/data/icalendar/import-rrule-daily.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily.diary-iso b/test/data/icalendar/import-rrule-daily.diary-iso new file mode 100644 index 00000000000..b201cb44308 --- /dev/null +++ b/test/data/icalendar/import-rrule-daily.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily.ics b/test/data/icalendar/import-rrule-daily.ics new file mode 100644 index 00000000000..6d013b0b4f6 --- /dev/null +++ b/test/data/icalendar/import-rrule-daily.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule daily +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=DAILY; +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-monthly-no-end.diary-american b/test/data/icalendar/import-rrule-monthly-no-end.diary-american new file mode 100644 index 00000000000..bc5453fe425 --- /dev/null +++ b/test/data/icalendar/import-rrule-monthly-no-end.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end diff --git a/test/data/icalendar/import-rrule-monthly-no-end.diary-european b/test/data/icalendar/import-rrule-monthly-no-end.diary-european new file mode 100644 index 00000000000..f071519701d --- /dev/null +++ b/test/data/icalendar/import-rrule-monthly-no-end.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end diff --git a/test/data/icalendar/import-rrule-monthly-no-end.diary-iso b/test/data/icalendar/import-rrule-monthly-no-end.diary-iso new file mode 100644 index 00000000000..3709e933337 --- /dev/null +++ b/test/data/icalendar/import-rrule-monthly-no-end.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end diff --git a/test/data/icalendar/import-rrule-monthly-no-end.ics b/test/data/icalendar/import-rrule-monthly-no-end.ics new file mode 100644 index 00000000000..b871658600a --- /dev/null +++ b/test/data/icalendar/import-rrule-monthly-no-end.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule monthly no end +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=MONTHLY; +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-monthly-with-end.diary-american b/test/data/icalendar/import-rrule-monthly-with-end.diary-american new file mode 100644 index 00000000000..638ab8b2327 --- /dev/null +++ b/test/data/icalendar/import-rrule-monthly-with-end.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end diff --git a/test/data/icalendar/import-rrule-monthly-with-end.diary-european b/test/data/icalendar/import-rrule-monthly-with-end.diary-european new file mode 100644 index 00000000000..c70cde25f32 --- /dev/null +++ b/test/data/icalendar/import-rrule-monthly-with-end.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end diff --git a/test/data/icalendar/import-rrule-monthly-with-end.diary-iso b/test/data/icalendar/import-rrule-monthly-with-end.diary-iso new file mode 100644 index 00000000000..ee51a2142a4 --- /dev/null +++ b/test/data/icalendar/import-rrule-monthly-with-end.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end diff --git a/test/data/icalendar/import-rrule-monthly-with-end.ics b/test/data/icalendar/import-rrule-monthly-with-end.ics new file mode 100644 index 00000000000..d8a1fe2e5af --- /dev/null +++ b/test/data/icalendar/import-rrule-monthly-with-end.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule monthly with end +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=MONTHLY;UNTIL=20050819; +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-weekly.diary-american b/test/data/icalendar/import-rrule-weekly.diary-american new file mode 100644 index 00000000000..d8bf2eba104 --- /dev/null +++ b/test/data/icalendar/import-rrule-weekly.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly diff --git a/test/data/icalendar/import-rrule-weekly.diary-european b/test/data/icalendar/import-rrule-weekly.diary-european new file mode 100644 index 00000000000..e368fde9709 --- /dev/null +++ b/test/data/icalendar/import-rrule-weekly.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly diff --git a/test/data/icalendar/import-rrule-weekly.diary-iso b/test/data/icalendar/import-rrule-weekly.diary-iso new file mode 100644 index 00000000000..49cd9d8ace6 --- /dev/null +++ b/test/data/icalendar/import-rrule-weekly.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly diff --git a/test/data/icalendar/import-rrule-weekly.ics b/test/data/icalendar/import-rrule-weekly.ics new file mode 100644 index 00000000000..c3f0b8ae933 --- /dev/null +++ b/test/data/icalendar/import-rrule-weekly.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule weekly +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=WEEKLY; +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-rrule-yearly.diary-american b/test/data/icalendar/import-rrule-yearly.diary-american new file mode 100644 index 00000000000..a54780b9699 --- /dev/null +++ b/test/data/icalendar/import-rrule-yearly.diary-american @@ -0,0 +1 @@ +&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly diff --git a/test/data/icalendar/import-rrule-yearly.diary-european b/test/data/icalendar/import-rrule-yearly.diary-european new file mode 100644 index 00000000000..a4bd81d6f2b --- /dev/null +++ b/test/data/icalendar/import-rrule-yearly.diary-european @@ -0,0 +1 @@ +&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly diff --git a/test/data/icalendar/import-rrule-yearly.diary-iso b/test/data/icalendar/import-rrule-yearly.diary-iso new file mode 100644 index 00000000000..65a7abe0344 --- /dev/null +++ b/test/data/icalendar/import-rrule-yearly.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly diff --git a/test/data/icalendar/import-rrule-yearly.ics b/test/data/icalendar/import-rrule-yearly.ics new file mode 100644 index 00000000000..21cca097f7e --- /dev/null +++ b/test/data/icalendar/import-rrule-yearly.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule yearly +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=YEARLY;INTERVAL=2 +END:VEVENT +END:VCALENDAR + diff --git a/test/data/icalendar/import-with-timezone.diary-iso b/test/data/icalendar/import-with-timezone.diary-iso new file mode 100644 index 00000000000..f99b59213e5 --- /dev/null +++ b/test/data/icalendar/import-with-timezone.diary-iso @@ -0,0 +1,2 @@ +&2012/1/15 15:00-15:30 standardtime +&2012/12/15 11:00-11:30 daylightsavingtime diff --git a/test/data/icalendar/import-with-timezone.ics b/test/data/icalendar/import-with-timezone.ics new file mode 100644 index 00000000000..110a9835e41 --- /dev/null +++ b/test/data/icalendar/import-with-timezone.ics @@ -0,0 +1,27 @@ +BEGIN:VCALENDAR +BEGIN:VTIMEZONE +TZID:fictional, nonexistent, arbitrary +BEGIN:STANDARD +DTSTART:20100101T000000 +TZOFFSETFROM:+0200 +TZOFFSETTO:-0200 +RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=01 +END:STANDARD +BEGIN:DAYLIGHT +DTSTART:20101201T000000 +TZOFFSETFROM:-0200 +TZOFFSETTO:+0200 +RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11 +END:DAYLIGHT +END:VTIMEZONE +BEGIN:VEVENT +SUMMARY:standardtime +DTSTART;TZID="fictional, nonexistent, arbitrary":20120115T120000 +DTEND;TZID="fictional, nonexistent, arbitrary":20120115T123000 +END:VEVENT +BEGIN:VEVENT +SUMMARY:daylightsavingtime +DTSTART;TZID="fictional, nonexistent, arbitrary":20121215T120000 +DTEND;TZID="fictional, nonexistent, arbitrary":20121215T123000 +END:VEVENT +END:VCALENDAR diff --git a/test/data/icalendar/import-with-uid.diary-american b/test/data/icalendar/import-with-uid.diary-american new file mode 100644 index 00000000000..9b2f06afc26 --- /dev/null +++ b/test/data/icalendar/import-with-uid.diary-american @@ -0,0 +1,2 @@ +&9/19/2003 09:00-11:30 non-recurring + UID: 1234567890uid diff --git a/test/data/icalendar/import-with-uid.diary-european b/test/data/icalendar/import-with-uid.diary-european new file mode 100644 index 00000000000..95db4d40151 --- /dev/null +++ b/test/data/icalendar/import-with-uid.diary-european @@ -0,0 +1,2 @@ +&19/9/2003 09:00-11:30 non-recurring + UID: 1234567890uid diff --git a/test/data/icalendar/import-with-uid.diary-iso b/test/data/icalendar/import-with-uid.diary-iso new file mode 100644 index 00000000000..d372e5a3d1f --- /dev/null +++ b/test/data/icalendar/import-with-uid.diary-iso @@ -0,0 +1,2 @@ +&2003/9/19 09:00-11:30 non-recurring + UID: 1234567890uid diff --git a/test/data/icalendar/import-with-uid.ics b/test/data/icalendar/import-with-uid.ics new file mode 100644 index 00000000000..db412d9d9f5 --- /dev/null +++ b/test/data/icalendar/import-with-uid.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID:1234567890uid +SUMMARY:non-recurring +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-tests.el b/test/lisp/calendar/icalendar-tests.el index bce7de769e0..5143c78632a 100644 --- a/test/lisp/calendar/icalendar-tests.el +++ b/test/lisp/calendar/icalendar-tests.el @@ -51,6 +51,20 @@ (replace-regexp-in-string "[ \t\n]+\\'" "" (replace-regexp-in-string "\\`[ \t\n]+" "" string))) +(defconst icalendar-tests--data-dir + (expand-file-name "test/data/icalendar" source-directory)) + +(defun icalendar-tests--get-file-contents (filename) + "Return contents of file in test data directory named FILENAME." + (with-temp-buffer + (let ((f1 (expand-file-name filename icalendar-tests--data-dir)) + (f2 (expand-file-name filename "../../data/icalendar")) + (coding-system-for-read 'raw-text) + (inhibit-eol-conversion t)) + (insert-file-contents-literally + (if (file-exists-p f1) f1 f2)) + (buffer-string)))) + ;; ====================================================================== ;; Tests of functions ;; ====================================================================== @@ -963,13 +977,16 @@ END:VALARM ;; Import tests ;; ====================================================================== -(defun icalendar-tests--test-import (input expected-iso expected-european - expected-american) +(defun icalendar-tests--test-import (filename expected-iso expected-european + expected-american) "Perform import test. -Argument INPUT icalendar event string. -Argument EXPECTED-ISO expected iso style diary string. -Argument EXPECTED-EUROPEAN expected european style diary string. -Argument EXPECTED-AMERICAN expected american style diary string. +Argument FILENAME ics file to import. +Argument EXPECTED-ISO diary-file containing expected +iso-calendar-style result. +Argument EXPECTED-EUROPEAN diary-file containing expected +european-calendar-style result. +Argument EXPECTED-AMERICAN diary-file containing expected +american-calendar-style result. During import test the timezone is set to Central European Time." (let ((timezone (getenv "TZ"))) (unwind-protect @@ -978,14 +995,7 @@ During import test the timezone is set to Central European Time." ;; Eg hydra.nixos.org. (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3") (with-temp-buffer - (if (string-match "^BEGIN:VCALENDAR" input) - (insert input) - (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n") - (insert "VERSION:2.0\nBEGIN:VEVENT\n") - (insert input) - (unless (eq (char-before) ?\n) - (insert "\n")) - (insert "END:VEVENT\nEND:VCALENDAR\n")) + (insert (icalendar-tests--get-file-contents filename)) (let ((icalendar-import-format "%s%d%l%o%t%u%c%U") (icalendar-import-format-summary "%s") (icalendar-import-format-location "\n Location: %s") @@ -998,26 +1008,29 @@ During import test the timezone is set to Central European Time." calendar-date-style) (when expected-iso (setq calendar-date-style 'iso) - (icalendar-tests--do-test-import input expected-iso)) + (icalendar-tests--do-test-import + (icalendar-tests--get-file-contents expected-iso))) (when expected-european (setq calendar-date-style 'european) - (icalendar-tests--do-test-import input expected-european)) + (icalendar-tests--do-test-import + (icalendar-tests--get-file-contents expected-european))) (when expected-american (setq calendar-date-style 'american) - (icalendar-tests--do-test-import input expected-american))))) + (icalendar-tests--do-test-import + (icalendar-tests--get-file-contents expected-american)))))) (setenv "TZ" timezone)))) -(defun icalendar-tests--do-test-import (_input expected-output) +(defun icalendar-tests--do-test-import (expected-output) "Actually perform import test. -Argument INPUT input icalendar string. -Argument EXPECTED-OUTPUT expected diary string." +Argument EXPECTED-OUTPUT file containing expected diary string." (let ((temp-file (make-temp-file "icalendar-test-diary"))) ;; Test the Catch-the-mysterious-coding-header logic below. ;; Ruby-mode adds an after-save-hook which inserts the header! ;; (save-excursion ;; (find-file temp-file) ;; (ruby-mode)) - (icalendar-import-buffer temp-file t t) + (let ((coding-system-for-write 'raw-text)) + (icalendar-import-buffer temp-file t t)) (save-excursion (find-file temp-file) ;; Check for the mysterious "# coding: ..." header, remove it @@ -1045,452 +1058,135 @@ Argument EXPECTED-OUTPUT expected diary string." (ert-deftest icalendar-import-non-recurring () "Perform standard import tests." - (icalendar-tests--test-import - "SUMMARY:non-recurring -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000" - "&2003/9/19 09:00-11:30 non-recurring\n" - "&19/9/2003 09:00-11:30 non-recurring\n" - "&9/19/2003 09:00-11:30 non-recurring\n") - (icalendar-tests--test-import - "SUMMARY:non-recurring allday -DTSTART;VALUE=DATE-TIME:20030919" - "&2003/9/19 non-recurring allday\n" - "&19/9/2003 non-recurring allday\n" - "&9/19/2003 non-recurring allday\n") - (icalendar-tests--test-import - ;; Checkdoc removes trailing blanks. Therefore: format! - (format "%s\n%s\n%s" "SUMMARY:long " " summary" - "DTSTART;VALUE=DATE:20030919") - "&2003/9/19 long summary\n" - "&19/9/2003 long summary\n" - "&9/19/2003 long summary\n") - (icalendar-tests--test-import - "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61 -SUMMARY:Sommerferien -STATUS:TENTATIVE -CLASS:PRIVATE -X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten -X-MOZILLA-RECUR-DEFAULT-INTERVAL:0 -DTSTART;VALUE=DATE:20040719 -DTEND;VALUE=DATE:20040828 -DTSTAMP:20031103T011641Z -" - "&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien - Status: TENTATIVE - Class: PRIVATE - UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 -" - "&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien - Status: TENTATIVE - Class: PRIVATE - UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 -" - "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien - Status: TENTATIVE - Class: PRIVATE - UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 -") - (icalendar-tests--test-import - "UID - :04979712-3902-11d9-93dd-8f9f4afe08da -SUMMARY - :folded summary -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - :20041123T140000 -DTEND - :20041123T143000 -DTSTAMP - :20041118T013430Z -LAST-MODIFIED - :20041118T013640Z -" - "&2004/11/23 14:00-14:30 folded summary - Status: TENTATIVE - Class: PRIVATE - UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n" - "&23/11/2004 14:00-14:30 folded summary - Status: TENTATIVE - Class: PRIVATE - UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n" - "&11/23/2004 14:00-14:30 folded summary - Status: TENTATIVE - Class: PRIVATE - UID: 04979712-3902-11d9-93dd-8f9f4afe08da\n") - - (icalendar-tests--test-import - "UID - :6161a312-3902-11d9-b512-f764153bb28b -SUMMARY - :another example -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - :20041123T144500 -DTEND - :20041123T154500 -DTSTAMP - :20041118T013641Z -" - "&2004/11/23 14:45-15:45 another example - Status: TENTATIVE - Class: PRIVATE - UID: 6161a312-3902-11d9-b512-f764153bb28b\n" - "&23/11/2004 14:45-15:45 another example - Status: TENTATIVE - Class: PRIVATE - UID: 6161a312-3902-11d9-b512-f764153bb28b\n" - "&11/23/2004 14:45-15:45 another example - Status: TENTATIVE - Class: PRIVATE - UID: 6161a312-3902-11d9-b512-f764153bb28b\n")) + (icalendar-tests--test-import "import-non-recurring-1.ics" + "import-non-recurring-1.diary-iso" + "import-non-recurring-1.diary-european" + "import-non-recurring-1.diary-american") + (icalendar-tests--test-import "import-non-recurring-all-day.ics" + "import-non-recurring-all-day.diary-iso" + "import-non-recurring-all-day.diary-european" + "import-non-recurring-all-day.diary-american") + (icalendar-tests--test-import "import-non-recurring-long-summary.ics" + "import-non-recurring-long-summary.diary-iso" + "import-non-recurring-long-summary.diary-european" + "import-non-recurring-long-summary.diary-american") + (icalendar-tests--test-import "import-non-recurring-block.ics" + "import-non-recurring-block.diary-iso" + "import-non-recurring-block.diary-european" + "import-non-recurring-block.diary-american") + (icalendar-tests--test-import "import-non-recurring-folded-summary.ics" + "import-non-recurring-folded-summary.diary-iso" + "import-non-recurring-folded-summary.diary-european" + "import-non-recurring-folded-summary.diary-american") + (icalendar-tests--test-import "import-non-recurring-another-example.ics" + "import-non-recurring-another-example.diary-iso" + "import-non-recurring-another-example.diary-european" + "import-non-recurring-another-example.diary-american")) + (ert-deftest icalendar-import-rrule () - (icalendar-tests--test-import - "SUMMARY:rrule daily -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=DAILY; -" - "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily\n" - "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily\n" - "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily\n") - ;; RRULE examples - (icalendar-tests--test-import - "SUMMARY:rrule daily -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=DAILY;INTERVAL=2 -" - "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily\n" - "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily\n" - "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily\n") - (icalendar-tests--test-import - "SUMMARY:rrule daily with exceptions -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=DAILY;INTERVAL=2 -EXDATE:20030921,20030925 -" - "&%%(and (not (diary-date 2003 9 25)) (not (diary-date 2003 9 21)) (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily with exceptions\n" - "&%%(and (not (diary-date 25 9 2003)) (not (diary-date 21 9 2003)) (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily with exceptions\n" - "&%%(and (not (diary-date 9 25 2003)) (not (diary-date 9 21 2003)) (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily with exceptions\n") - (icalendar-tests--test-import - "SUMMARY:rrule weekly -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=WEEKLY; -" - "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly\n" - "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly\n" - "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly\n") - (icalendar-tests--test-import - "SUMMARY:rrule monthly no end -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=MONTHLY; -" - "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end\n" - "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n" - "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n") - (icalendar-tests--test-import - "SUMMARY:rrule monthly with end -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=MONTHLY;UNTIL=20050819; -" - "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end\n" - "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end\n" - "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end\n") - (icalendar-tests--test-import - "DTSTART;VALUE=DATE:20040815 -DTEND;VALUE=DATE:20040816 -SUMMARY:Maria Himmelfahrt -RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8 -" - "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt\n" - "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt\n" - "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt\n") - (icalendar-tests--test-import - "SUMMARY:rrule yearly -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=YEARLY;INTERVAL=2 -" - "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly\n" ;FIXME - "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly\n" ;FIXME - "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly\n") ;FIXME - (icalendar-tests--test-import - "SUMMARY:rrule count daily short -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1 -" - "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short\n" - "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short\n" - "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short\n") - (icalendar-tests--test-import - "SUMMARY:rrule count daily long -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1 -" - "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long\n" - "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long\n" - "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long\n") - (icalendar-tests--test-import - "SUMMARY:rrule count bi-weekly 3 times -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2 -" - "&%%(and (diary-cyclic 14 2003 9 19) (diary-block 2003 9 19 2003 10 31)) 09:00-11:30 rrule count bi-weekly 3 times\n" - "&%%(and (diary-cyclic 14 19 9 2003) (diary-block 19 9 2003 31 10 2003)) 09:00-11:30 rrule count bi-weekly 3 times\n" - "&%%(and (diary-cyclic 14 9 19 2003) (diary-block 9 19 2003 10 31 2003)) 09:00-11:30 rrule count bi-weekly 3 times\n") - (icalendar-tests--test-import - "SUMMARY:rrule count monthly -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5 -" - "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly\n" - "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly\n" - "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly\n") - (icalendar-tests--test-import - "SUMMARY:rrule count every second month -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5 -" - "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month\n" ;FIXME - "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month\n" ;FIXME - "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month\n") ;FIXME - (icalendar-tests--test-import - "SUMMARY:rrule count yearly -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5 -" - "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly\n" - "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly\n" - "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly\n") - (icalendar-tests--test-import - "SUMMARY:rrule count every second year -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5 -" - "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year\n" ;FIXME!!! - "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year\n" ;FIXME!!! - "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year\n") ;FIXME!!! -) + (icalendar-tests--test-import "import-rrule-daily.ics" + "import-rrule-daily.diary-iso" + "import-rrule-daily.diary-european" + "import-rrule-daily.diary-american") + (icalendar-tests--test-import "import-rrule-daily-two-day.ics" + "import-rrule-daily-two-day.diary-iso" + "import-rrule-daily-two-day.diary-european" + "import-rrule-daily-two-day.diary-american") + (icalendar-tests--test-import "import-rrule-daily-with-exceptions.ics" + "import-rrule-daily-with-exceptions.diary-iso" + "import-rrule-daily-with-exceptions.diary-european" + "import-rrule-daily-with-exceptions.diary-american") + (icalendar-tests--test-import "import-rrule-weekly.ics" + "import-rrule-weekly.diary-iso" + "import-rrule-weekly.diary-european" + "import-rrule-weekly.diary-american") + (icalendar-tests--test-import "import-rrule-monthly-no-end.ics" + "import-rrule-monthly-no-end.diary-iso" + "import-rrule-monthly-no-end.diary-european" + "import-rrule-monthly-no-end.diary-american") + (icalendar-tests--test-import "import-rrule-monthly-with-end.ics" + "import-rrule-monthly-with-end.diary-iso" + "import-rrule-monthly-with-end.diary-european" + "import-rrule-monthly-with-end.diary-american") + (icalendar-tests--test-import "import-rrule-anniversary.ics" + "import-rrule-anniversary.diary-iso" + "import-rrule-anniversary.diary-european" + "import-rrule-anniversary.diary-american") + (icalendar-tests--test-import "import-rrule-yearly.ics" + "import-rrule-yearly.diary-iso" + "import-rrule-yearly.diary-european" + "import-rrule-yearly.diary-american") + (icalendar-tests--test-import "import-rrule-count-daily-short.ics" + "import-rrule-count-daily-short.diary-iso" + "import-rrule-count-daily-short.diary-european" + "import-rrule-count-daily-short.diary-american") + (icalendar-tests--test-import "import-rrule-count-daily-long.ics" + "import-rrule-count-daily-long.diary-iso" + "import-rrule-count-daily-long.diary-european" + "import-rrule-count-daily-long.diary-american") + (icalendar-tests--test-import "import-rrule-count-monthly.ics" + "import-rrule-count-monthly.diary-iso" + "import-rrule-count-monthly.diary-european" + "import-rrule-count-monthly.diary-american") + (icalendar-tests--test-import "import-rrule-count-every-second-month.ics" + "import-rrule-count-every-second-month.diary-iso" + "import-rrule-count-every-second-month.diary-european" + "import-rrule-count-every-second-month.diary-american") + (icalendar-tests--test-import "import-rrule-count-yearly.ics" + "import-rrule-count-yearly.diary-iso" + "import-rrule-count-yearly.diary-european" + "import-rrule-count-yearly.diary-american") + (icalendar-tests--test-import "import-rrule-count-every-second-year.ics" + "import-rrule-count-every-second-year.diary-iso" + "import-rrule-count-every-second-year.diary-european" + "import-rrule-count-every-second-year.diary-american") + ) (ert-deftest icalendar-import-duration () - ;; duration - (icalendar-tests--test-import - "DTSTART;VALUE=DATE:20050217 -SUMMARY:duration -DURATION:P7D -" - "&%%(and (diary-block 2005 2 17 2005 2 23)) duration\n" - "&%%(and (diary-block 17 2 2005 23 2 2005)) duration\n" - "&%%(and (diary-block 2 17 2005 2 23 2005)) duration\n") - (icalendar-tests--test-import - "UID:20041127T183329Z-18215-1001-4536-49109@andromeda -DTSTAMP:20041127T183315Z -LAST-MODIFIED:20041127T183329 -SUMMARY:Urlaub -DTSTART;VALUE=DATE:20011221 -DTEND;VALUE=DATE:20011221 -RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU -CLASS:PUBLIC -SEQUENCE:1 -CREATED:20041127T183329 -" - "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub - Class: PUBLIC - UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n" - "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub - Class: PUBLIC - UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n" - "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub - Class: PUBLIC - UID: 20041127T183329Z-18215-1001-4536-49109@andromeda\n")) + (icalendar-tests--test-import "import-duration.ics" + "import-duration.diary-iso" + "import-duration.diary-european" + "import-duration.diary-american") + ;; duration-2: this is actually an rrule test + (icalendar-tests--test-import "import-duration-2.ics" + "import-duration-2.diary-iso" + "import-duration-2.diary-european" + "import-duration-2.diary-american")) (ert-deftest icalendar-import-bug-6766 () ;;bug#6766 -- multiple byday values in a weekly rrule - (icalendar-tests--test-import -"CLASS:PUBLIC -DTEND;TZID=America/New_York:20100421T120000 -DTSTAMP:20100525T141214Z -DTSTART;TZID=America/New_York:20100421T113000 -RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,TH,FR -SEQUENCE:1 -STATUS:CONFIRMED -SUMMARY:Scrum -TRANSP:OPAQUE -UID:8814e3f9-7482-408f-996c-3bfe486a1262 -END:VEVENT -BEGIN:VEVENT -CLASS:PUBLIC -DTSTAMP:20100525T141214Z -DTSTART;VALUE=DATE:20100422 -DTEND;VALUE=DATE:20100423 -RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,TH -SEQUENCE:1 -SUMMARY:Tues + Thurs thinking -TRANSP:OPAQUE -UID:8814e3f9-7482-408f-996c-3bfe486a1263 -" -"&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 2010 4 21)) 11:30-12:00 Scrum - Status: CONFIRMED - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1262 -&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1263 -" -"&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum - Status: CONFIRMED - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1262 -&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1263 -" -"&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum - Status: CONFIRMED - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1262 -&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1263 -")) + (icalendar-tests--test-import "import-bug-6766.ics" + "import-bug-6766.diary-iso" + "import-bug-6766.diary-european" + "import-bug-6766.diary-american")) (ert-deftest icalendar-import-bug-24199 () ;;bug#24199 -- monthly rule with byday-clause - (icalendar-tests--test-import -" -SUMMARY:Summary -DESCRIPTION:Desc -LOCATION:Loc -DTSTART:20151202T124600 -DTEND:20151202T160000 -RRULE:FREQ=MONTHLY;BYDAY=1WE;INTERVAL=1 -EXDATE:20160106T114600Z -EXDATE:20160203T114600Z -EXDATE:20160302T114600Z -EXDATE:20160504T104600Z -EXDATE:20160601T104600Z -CLASS:DEFAULT -TRANSP:OPAQUE -BEGIN:VALARM -ACTION:DISPLAY -TRIGGER;VALUE=DURATION:-PT3H -END:VALARM -LAST-MODIFIED:20160805T191040Z -UID:9188710a-08a7-4061-bae3-d4cf4972599a -" -"&%%(and (not (diary-date 2016 1 6)) (not (diary-date 2016 2 3)) (not (diary-date 2016 3 2)) (not (diary-date 2016 5 4)) (not (diary-date 2016 6 1)) (diary-float t 3 1) (diary-block 2015 12 2 9999 1 1)) 12:46-16:00 Summary - Desc: Desc - Location: Loc - Class: DEFAULT - UID: 9188710a-08a7-4061-bae3-d4cf4972599a -" -"&%%(and (not (diary-date 6 1 2016)) (not (diary-date 3 2 2016)) (not (diary-date 2 3 2016)) (not (diary-date 4 5 2016)) (not (diary-date 1 6 2016)) (diary-float t 3 1) (diary-block 2 12 2015 1 1 9999)) 12:46-16:00 Summary - Desc: Desc - Location: Loc - Class: DEFAULT - UID: 9188710a-08a7-4061-bae3-d4cf4972599a -" -"&%%(and (not (diary-date 1 6 2016)) (not (diary-date 2 3 2016)) (not (diary-date 3 2 2016)) (not (diary-date 5 4 2016)) (not (diary-date 6 1 2016)) (diary-float t 3 1) (diary-block 12 2 2015 1 1 9999)) 12:46-16:00 Summary - Desc: Desc - Location: Loc - Class: DEFAULT - UID: 9188710a-08a7-4061-bae3-d4cf4972599a -" -)) + (icalendar-tests--test-import "import-bug-24199.ics" + "import-bug-24199.diary-iso" + "import-bug-24199.diary-european" + "import-bug-24199.diary-american")) (ert-deftest icalendar-import-bug-33277 () ;;bug#33277 -- start time equals end time - (icalendar-tests--test-import - "DTSTART:20181105T200000Z -DTSTAMP:20181105T181652Z -DESCRIPTION: -LAST-MODIFIED:20181105T181646Z -LOCATION: -SEQUENCE:0 -SUMMARY:event with same start/end time -TRANSP:OPAQUE -" - - "&2018/11/5 21:00 event with same start/end time\n" - "&5/11/2018 21:00 event with same start/end time\n" - "&11/5/2018 21:00 event with same start/end time\n" - )) + (icalendar-tests--test-import "import-bug-33277.ics" + "import-bug-33277.diary-iso" + "import-bug-33277.diary-european" + "import-bug-33277.diary-american")) (ert-deftest icalendar-import-multiple-vcalendars () - (icalendar-tests--test-import - "DTSTART;VALUE=DATE:20110723 -SUMMARY:event-1 -" - "&2011/7/23 event-1\n" - "&23/7/2011 event-1\n" - "&7/23/2011 event-1\n") - - (icalendar-tests--test-import - "BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0\nBEGIN:VEVENT -DTSTART;VALUE=DATE:20110723 -SUMMARY:event-1 -END:VEVENT -END:VCALENDAR -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -DTSTART;VALUE=DATE:20110724 -SUMMARY:event-2 -END:VEVENT -END:VCALENDAR -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -DTSTART;VALUE=DATE:20110725 -SUMMARY:event-3a -END:VEVENT -BEGIN:VEVENT -DTSTART;VALUE=DATE:20110725 -SUMMARY:event-3b -END:VEVENT -END:VCALENDAR -" - "&2011/7/23 event-1\n&2011/7/24 event-2\n&2011/7/25 event-3a\n&2011/7/25 event-3b\n" - "&23/7/2011 event-1\n&24/7/2011 event-2\n&25/7/2011 event-3a\n&25/7/2011 event-3b\n" - "&7/23/2011 event-1\n&7/24/2011 event-2\n&7/25/2011 event-3a\n&7/25/2011 event-3b\n")) + (icalendar-tests--test-import "import-multiple-vcalendars.ics" + "import-multiple-vcalendars.diary-iso" + "import-multiple-vcalendars.diary-european" + "import-multiple-vcalendars.diary-american")) (ert-deftest icalendar-import-with-uid () "Perform import test with uid." - (icalendar-tests--test-import - "UID:1234567890uid -SUMMARY:non-recurring -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000" - "&2003/9/19 09:00-11:30 non-recurring\n UID: 1234567890uid\n" - "&19/9/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n" - "&9/19/2003 09:00-11:30 non-recurring\n UID: 1234567890uid\n")) + (icalendar-tests--test-import "import-with-uid.ics" + "import-with-uid.diary-iso" + "import-with-uid.diary-european" + "import-with-uid.diary-american")) (ert-deftest icalendar-import-with-timezone () ;; This is known to fail on MS-Windows, because the test assumes @@ -1499,42 +1195,13 @@ DTEND;VALUE=DATE-TIME:20030919T113000" :failed :passed) ;; bug#11473 - (icalendar-tests--test-import - "BEGIN:VCALENDAR -BEGIN:VTIMEZONE -TZID:fictional, nonexistent, arbitrary -BEGIN:STANDARD -DTSTART:20100101T000000 -TZOFFSETFROM:+0200 -TZOFFSETTO:-0200 -RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=01 -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:20101201T000000 -TZOFFSETFROM:-0200 -TZOFFSETTO:+0200 -RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11 -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -SUMMARY:standardtime -DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20120115T120000 -DTEND;TZID=\"fictional, nonexistent, arbitrary\":20120115T123000 -END:VEVENT -BEGIN:VEVENT -SUMMARY:daylightsavingtime -DTSTART;TZID=\"fictional, nonexistent, arbitrary\":20121215T120000 -DTEND;TZID=\"fictional, nonexistent, arbitrary\":20121215T123000 -END:VEVENT -END:VCALENDAR" - ;; "standardtime" begins first sunday in january and is 4 hours behind CET - ;; "daylightsavingtime" begins first sunday in november and is 1 hour before CET - "&2012/1/15 15:00-15:30 standardtime -&2012/12/15 11:00-11:30 daylightsavingtime -" - nil - nil) - ) + ;; "standardtime" begins first sunday in january and is 4 hours behind CET + ;; "daylightsavingtime" begins first sunday in november and is 1 hour before CET + (icalendar-tests--test-import "import-with-timezone.ics" + "import-with-timezone.diary-iso" + nil + nil)) + ;; ====================================================================== ;; Cycle ;; ====================================================================== @@ -1632,237 +1299,27 @@ SUMMARY:and diary-anniversary :failed :passed) ;; 2003-05-29 - (icalendar-tests--test-import - "BEGIN:VCALENDAR -METHOD:REQUEST -PRODID:Microsoft CDO for Microsoft Exchange -VERSION:2.0 -BEGIN:VTIMEZONE -TZID:Kolkata, Chennai, Mumbai, New Delhi -X-MICROSOFT-CDO-TZID:23 -BEGIN:STANDARD -DTSTART:16010101T000000 -TZOFFSETFROM:+0530 -TZOFFSETTO:+0530 -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:16010101T000000 -TZOFFSETFROM:+0530 -TZOFFSETTO:+0530 -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -DTSTAMP:20030509T043439Z -DTSTART;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T103000 -SUMMARY:On-Site Interview -UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000 - 010000000DB823520692542408ED02D7023F9DFF9 -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Xxxxx - xxx Xxxxxxxxxxxx\":MAILTO:xxxxxxxx@xxxxxxx.com -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Yyyyyyy Y - yyyy\":MAILTO:yyyyyyy@yyyyyyy.com -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Zzzz Zzzz - zz\":MAILTO:zzzzzz@zzzzzzz.com -ORGANIZER;CN=\"Aaaaaa Aaaaa\":MAILTO:aaaaaaa@aaaaaaa.com -LOCATION:Cccc -DTEND;TZID=\"Kolkata, Chennai, Mumbai, New Delhi\":20030509T153000 -DESCRIPTION:10:30am - Blah -SEQUENCE:0 -PRIORITY:5 -CLASS: -CREATED:20030509T043439Z -LAST-MODIFIED:20030509T043459Z -STATUS:CONFIRMED -TRANSP:OPAQUE -X-MICROSOFT-CDO-BUSYSTATUS:BUSY -X-MICROSOFT-CDO-INSTTYPE:0 -X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY -X-MICROSOFT-CDO-ALLDAYEVENT:FALSE -X-MICROSOFT-CDO-IMPORTANCE:1 -X-MICROSOFT-CDO-OWNERAPPTID:126441427 -BEGIN:VALARM -ACTION:DISPLAY -DESCRIPTION:REMINDER -TRIGGER;RELATED=START:-PT00H15M00S -END:VALARM -END:VEVENT -END:VCALENDAR" - nil - "&9/5/2003 07:00-12:00 On-Site Interview - Desc: 10:30am - Blah - Location: Cccc - Organizer: MAILTO:aaaaaaa@aaaaaaa.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9 -" - "&5/9/2003 07:00-12:00 On-Site Interview - Desc: 10:30am - Blah - Location: Cccc - Organizer: MAILTO:aaaaaaa@aaaaaaa.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9 -") + (icalendar-tests--test-import "import-real-world-2003-05-29.ics" + nil + "import-real-world-2003-05-29.diary-european" + "import-real-world-2003-05-29.diary-american") ;; created with http://apps.marudot.com/ical/ - (icalendar-tests--test-import - "BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//www.marudot.com//iCal Event Maker -X-WR-CALNAME:Test -CALSCALE:GREGORIAN -BEGIN:VTIMEZONE -TZID:Asia/Tehran -TZURL:http://tzurl.org/zoneinfo-outlook/Asia/Tehran -X-LIC-LOCATION:Asia/Tehran -BEGIN:STANDARD -TZOFFSETFROM:+0330 -TZOFFSETTO:+0330 -TZNAME:IRST -DTSTART:19700101T000000 -END:STANDARD -END:VTIMEZONE -BEGIN:VEVENT -DTSTAMP:20141116T171439Z -UID:20141116T171439Z-678877132@marudot.com -DTSTART;TZID=\"Asia/Tehran\":20141116T070000 -DTEND;TZID=\"Asia/Tehran\":20141116T080000 -SUMMARY:NoDST -DESCRIPTION:Test event from timezone without DST -LOCATION:Everywhere -END:VEVENT -END:VCALENDAR" - nil - "&16/11/2014 04:30-05:30 NoDST - Desc: Test event from timezone without DST - Location: Everywhere - UID: 20141116T171439Z-678877132@marudot.com -" - "&11/16/2014 04:30-05:30 NoDST - Desc: Test event from timezone without DST - Location: Everywhere - UID: 20141116T171439Z-678877132@marudot.com -") - + (icalendar-tests--test-import "import-real-world-no-dst.ics" + nil + "import-real-world-no-dst.diary-european" + "import-real-world-no-dst.diary-american") ;; 2003-06-18 a - (icalendar-tests--test-import - "DTSTAMP:20030618T195512Z -DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T110000 -SUMMARY:Dress Rehearsal for XXXX-XXXX -UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000 - 0100000007C3A6D65EE726E40B7F3D69A23BD567E -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"AAAAA,AAA - AA (A-AAAAAAA,ex1)\":MAILTO:aaaaa_aaaaa@aaaaa.com -ORGANIZER;CN=\"ABCD,TECHTRAINING - (A-Americas,exgen1)\":MAILTO:xxx@xxxxx.com -LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below) -DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T120000 -DESCRIPTION:753 Zeichen hier radiert -SEQUENCE:0 -PRIORITY:5 -CLASS: -CREATED:20030618T195518Z -LAST-MODIFIED:20030618T195527Z -STATUS:CONFIRMED -TRANSP:OPAQUE -X-MICROSOFT-CDO-BUSYSTATUS:BUSY -X-MICROSOFT-CDO-INSTTYPE:0 -X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY -X-MICROSOFT-CDO-ALLDAYEVENT:FALSE -X-MICROSOFT-CDO-IMPORTANCE:1 -X-MICROSOFT-CDO-OWNERAPPTID:1022519251 -BEGIN:VALARM -ACTION:DISPLAY -DESCRIPTION:REMINDER -TRIGGER;RELATED=START:-PT00H15M00S -END:VALARM" - nil - "&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX - Desc: 753 Zeichen hier radiert - Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) - Organizer: MAILTO:xxx@xxxxx.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E -" - "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX - Desc: 753 Zeichen hier radiert - Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) - Organizer: MAILTO:xxx@xxxxx.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E -") + (icalendar-tests--test-import "import-real-world-2003-06-18a.ics" + nil + "import-real-world-2003-06-18a.diary-european" + "import-real-world-2003-06-18a.diary-american") ;; 2003-06-18 b -- uses timezone - (icalendar-tests--test-import - "BEGIN:VCALENDAR -METHOD:REQUEST -PRODID:Microsoft CDO for Microsoft Exchange -VERSION:2.0 -BEGIN:VTIMEZONE -TZID:Mountain Time (US & Canada) -X-MICROSOFT-CDO-TZID:12 -BEGIN:STANDARD -DTSTART:16010101T020000 -TZOFFSETFROM:-0600 -TZOFFSETTO:-0700 -RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:16010101T020000 -TZOFFSETFROM:-0700 -TZOFFSETTO:-0600 -RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -DTSTAMP:20030618T230323Z -DTSTART;TZID=\"Mountain Time (US & Canada)\":20030623T090000 -SUMMARY:Updated: Dress Rehearsal for ABC01-15 -UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000 - 0100000007C3A6D65EE726E40B7F3D69A23BD567E -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20 - 0700Z;RSVP=TRUE;CN=\"AAAAA,AAAAAA -\(A-AAAAAAA,ex1)\":MAILTO:aaaaaa_aaaaa@aaaaa - .com -ORGANIZER;CN=\"ABCD,TECHTRAINING -\(A-Americas,exgen1)\":MAILTO:bbb@bbbbb.com -LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below) -DTEND;TZID=\"Mountain Time (US & Canada)\":20030623T100000 -DESCRIPTION:Viele Zeichen standen hier frĂŒher -SEQUENCE:0 -PRIORITY:5 -CLASS: -CREATED:20030618T230326Z -LAST-MODIFIED:20030618T230335Z -STATUS:CONFIRMED -TRANSP:OPAQUE -X-MICROSOFT-CDO-BUSYSTATUS:BUSY -X-MICROSOFT-CDO-INSTTYPE:0 -X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY -X-MICROSOFT-CDO-ALLDAYEVENT:FALSE -X-MICROSOFT-CDO-IMPORTANCE:1 -X-MICROSOFT-CDO-OWNERAPPTID:1022519251 -BEGIN:VALARM -ACTION:DISPLAY -DESCRIPTION:REMINDER -TRIGGER;RELATED=START:-PT00H15M00S -END:VALARM -END:VEVENT -END:VCALENDAR" - nil - "&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 - Desc: Viele Zeichen standen hier frĂŒher - Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) - Organizer: MAILTO:bbb@bbbbb.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E -" - "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 - Desc: Viele Zeichen standen hier frĂŒher - Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) - Organizer: MAILTO:bbb@bbbbb.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E -") + (icalendar-tests--test-import "import-real-world-2003-06-18b.ics" + nil + "import-real-world-2003-06-18b.diary-european" + "import-real-world-2003-06-18b.diary-american") ;; export 2004-10-28 block entries (icalendar-tests--test-export nil @@ -2078,169 +1535,10 @@ DTEND;VALUE=DATE-TIME:20041012T150000 SUMMARY:Tue: [2004-10-12] q1") ;; 2004-11-19 - (icalendar-tests--test-import - "BEGIN:VCALENDAR -VERSION - :2.0 -PRODID - :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN -BEGIN:VEVENT -SUMMARY - :Jjjjj & Wwwww -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - :20041123T140000 -DTEND - :20041123T143000 -DTSTAMP - :20041118T013430Z -LAST-MODIFIED - :20041118T013640Z -END:VEVENT -BEGIN:VEVENT -SUMMARY - :BB Aaaaaaaa Bbbbb -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - :20041123T144500 -DTEND - :20041123T154500 -DTSTAMP - :20041118T013641Z -END:VEVENT -BEGIN:VEVENT -SUMMARY - :Hhhhhhhh -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - :20041123T110000 -DTEND - :20041123T120000 -DTSTAMP - :20041118T013831Z -END:VEVENT -BEGIN:VEVENT -SUMMARY - :MMM Aaaaaaaaa -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -X-MOZILLA-RECUR-DEFAULT-INTERVAL - :2 -RRULE - :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR -DTSTART - :20041112T140000 -DTEND - :20041112T183000 -DTSTAMP - :20041118T014117Z -END:VEVENT -BEGIN:VEVENT -SUMMARY - :Rrrr/Cccccc ii Aaaaaaaa -DESCRIPTION - :Vvvvv Rrrr aaa Cccccc -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - ;VALUE=DATE - :20041119 -DTEND - ;VALUE=DATE - :20041120 -DTSTAMP - :20041118T013107Z -LAST-MODIFIED - :20041118T014203Z -END:VEVENT -BEGIN:VEVENT -SUMMARY - :Wwww aa hhhh -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -RRULE - :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO -DTSTART - ;VALUE=DATE - :20041101 -DTEND - ;VALUE=DATE - :20041102 -DTSTAMP - :20041118T014045Z -LAST-MODIFIED - :20041118T023846Z -END:VEVENT -END:VCALENDAR -" - nil - "&23/11/2004 14:00-14:30 Jjjjj & Wwwww - Status: TENTATIVE - Class: PRIVATE -&23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb - Status: TENTATIVE - Class: PRIVATE -&23/11/2004 11:00-12:00 Hhhhhhhh - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa - Desc: Vvvvv Rrrr aaa Cccccc - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh - Status: TENTATIVE - Class: PRIVATE -" - "&11/23/2004 14:00-14:30 Jjjjj & Wwwww - Status: TENTATIVE - Class: PRIVATE -&11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb - Status: TENTATIVE - Class: PRIVATE -&11/23/2004 11:00-12:00 Hhhhhhhh - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa - Desc: Vvvvv Rrrr aaa Cccccc - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh - Status: TENTATIVE - Class: PRIVATE -") + (icalendar-tests--test-import "import-real-world-2004-11-19.ics" + nil + "import-real-world-2004-11-19.diary-european" + "import-real-world-2004-11-19.diary-american") ;; 2004-09-09 pg (icalendar-tests--test-export @@ -2270,53 +1568,16 @@ DTEND;VALUE=DATE-TIME:20041102T163000 SUMMARY:Zahnarzt") ;; 2005-02-07 lt - (icalendar-tests--test-import - "UID - :b60d398e-1dd1-11b2-a159-cf8cb05139f4 -SUMMARY - :Waitangi Day -DESCRIPTION - :abcdef -CATEGORIES - :Public Holiday -STATUS - :CONFIRMED -CLASS - :PRIVATE -DTSTART - ;VALUE=DATE - :20050206 -DTEND - ;VALUE=DATE - :20050207 -DTSTAMP - :20050128T011209Z" - nil - "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day - Desc: abcdef - Status: CONFIRMED - Class: PRIVATE - UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4 -" - "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day - Desc: abcdef - Status: CONFIRMED - Class: PRIVATE - UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4 -") + (icalendar-tests--test-import "import-real-world-2005-02-07.ics" + nil + "import-real-world-2005-02-07.diary-european" + "import-real-world-2005-02-07.diary-american") ;; 2005-03-01 lt - (icalendar-tests--test-import - "DTSTART;VALUE=DATE:20050217 -SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa -UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID -DTSTAMP:20050118T210335Z -DURATION:P7D" - nil - "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa - UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n" - "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa - UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID\n") + (icalendar-tests--test-import "import-real-world-2005-03-01.ics" + nil + "import-real-world-2005-03-01.diary-european" + "import-real-world-2005-03-01.diary-american") ;; 2005-03-23 lt (icalendar-tests--test-export @@ -2343,132 +1604,24 @@ SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30 ") ;; bug#11473 - (icalendar-tests--test-import - "BEGIN:VCALENDAR -METHOD:REQUEST -PRODID:Microsoft Exchange Server 2007 -VERSION:2.0 -BEGIN:VTIMEZONE -TZID:(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna -BEGIN:STANDARD -DTSTART:16010101T030000 -TZOFFSETFROM:+0200 -TZOFFSETTO:+0100 -RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10 -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:16010101T020000 -TZOFFSETFROM:+0100 -TZOFFSETTO:+0200 -RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3 -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -ORGANIZER;CN=\"A. Luser\":MAILTO:a.luser@foo.com -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"Luser, Oth - er\":MAILTO:other.luser@foo.com -DESCRIPTION;LANGUAGE=en-US:\nWhassup?\n\n -SUMMARY;LANGUAGE=en-US:Query -DTSTART;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\" - :20120515T150000 -DTEND;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna\":2 - 0120515T153000 -UID:040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000 - 010000000575268034ECDB649A15349B1BF240F15 -RECURRENCE-ID;TZID=\"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, V - ienna\":20120515T170000 -CLASS:PUBLIC -PRIORITY:5 -DTSTAMP:20120514T153645Z -TRANSP:OPAQUE -STATUS:CONFIRMED -SEQUENCE:15 -LOCATION;LANGUAGE=en-US:phone -X-MICROSOFT-CDO-APPT-SEQUENCE:15 -X-MICROSOFT-CDO-OWNERAPPTID:1907632092 -X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE -X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY -X-MICROSOFT-CDO-ALLDAYEVENT:FALSE -X-MICROSOFT-CDO-IMPORTANCE:1 -X-MICROSOFT-CDO-INSTTYPE:3 -BEGIN:VALARM -ACTION:DISPLAY -DESCRIPTION:REMINDER -TRIGGER;RELATED=START:-PT15M -END:VALARM -END:VEVENT -END:VCALENDAR" - nil - "&15/5/2012 15:00-15:30 Query - Location: phone - Organizer: MAILTO:a.luser@foo.com - Status: CONFIRMED - Class: PUBLIC - UID: 040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000010000000575268034ECDB649A15349B1BF240F15 -" nil) + (icalendar-tests--test-import "import-bug-11473.ics" + nil + "import-bug-11473.diary-european" + nil) ;; 2015-12-05, mixed line endings and empty lines, see Bug#22092. - (icalendar-tests--test-import - "BEGIN:VCALENDAR\r -PRODID:-//www.norwegian.no//iCalendar MIMEDIR//EN\r -VERSION:2.0\r -METHOD:REQUEST\r -BEGIN:VEVENT\r -UID:RFCALITEM1\r -SEQUENCE:1512040950\r -DTSTAMP:20141204T095043Z\r -ORGANIZER:noreply@norwegian.no\r -DTSTART:20141208T173000Z\r - -DTEND:20141208T215500Z\r - -LOCATION:Stavanger-Sola\r - -DESCRIPTION:Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390\r - -X-ALT-DESC;FMTTYPE=text/html:Reisereferanse

-SUMMARY:Norwegian til Tromsoe-Langnes -\r - -CATEGORIES:Appointment\r - - -PRIORITY:5\r - -CLASS:PUBLIC\r - -TRANSP:OPAQUE\r -END:VEVENT\r -END:VCALENDAR -" -"&2014/12/8 18:30-22:55 Norwegian til Tromsoe-Langnes - - Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 - Location: Stavanger-Sola - Organizer: noreply@norwegian.no - Class: PUBLIC - UID: RFCALITEM1 -" -"&8/12/2014 18:30-22:55 Norwegian til Tromsoe-Langnes - - Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 - Location: Stavanger-Sola - Organizer: noreply@norwegian.no - Class: PUBLIC - UID: RFCALITEM1 -" -"&12/8/2014 18:30-22:55 Norwegian til Tromsoe-Langnes - - Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 - Location: Stavanger-Sola - Organizer: noreply@norwegian.no - Class: PUBLIC - UID: RFCALITEM1 -" -) - ) + (icalendar-tests--test-import "import-bug-22092.ics" + "import-bug-22092.diary-iso" + "import-bug-22092.diary-european" + "import-bug-22092.diary-american")) (defun icalendar-test--format (string &optional day zone) + "Decode and format STRING with DAY and ZONE." (let ((time (icalendar--decode-isodatetime string day zone))) (format-time-string "%FT%T%z" (encode-time time) 0))) (defun icalendar-tests--decode-isodatetime (_ical-string) + "Test icalendar--decode-isodatetime." (should (equal (icalendar-test--format "20040917T050910-0200") "2004-09-17T03:09:10+0000")) (should (equal (icalendar-test--format "20040917T050910") -- cgit v1.2.3 From 754a2f11b8a80e2d01693cf3df42d8d0a871dbea Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 22 Oct 2020 18:23:40 +0200 Subject: Add tests for perl-mode.el * test/lisp/progmodes/perl-mode-tests.el: New file. --- test/lisp/progmodes/perl-mode-tests.el | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/lisp/progmodes/perl-mode-tests.el diff --git a/test/lisp/progmodes/perl-mode-tests.el b/test/lisp/progmodes/perl-mode-tests.el new file mode 100644 index 00000000000..a2ea972c103 --- /dev/null +++ b/test/lisp/progmodes/perl-mode-tests.el @@ -0,0 +1,33 @@ +;;; perl-mode-tests --- Test for perl-mode -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; 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: + +(require 'perl-mode) + +;;;; Re-use cperl-mode tests + +(defvar cperl-test-mode) +(setq cperl-test-mode #'perl-mode) +(load-file (expand-file-name "cperl-mode-tests.el" + (file-truename + (file-name-directory (or load-file-name + buffer-file-name))))) + +;;; perl-mode-tests.el ends here -- cgit v1.2.3 From a090e5fe0855587fd122151794757dbf04dc7c73 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Thu, 22 Oct 2020 18:26:24 +0200 Subject: Remove useless uses of bindat-get-field * lisp/progmodes/gdb-mi.el (gdb-var-list-children-handler) (gdb-edit-register-value): bindat-get-field with a single argument is identity; remove. --- lisp/progmodes/gdb-mi.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 79df97080df..9e8af84a600 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1317,7 +1317,7 @@ With arg, enter name of variable to be watched in the minibuffer." (defun gdb-var-list-children-handler (varnum) (let* ((var-list nil) - (output (bindat-get-field (gdb-json-partial-output "child"))) + (output (gdb-json-partial-output "child")) (children (bindat-get-field output 'children))) (catch 'child-already-watched (dolist (var gdb-var-list) @@ -4395,8 +4395,7 @@ member." (save-excursion (if event (posn-set-point (event-end event))) (beginning-of-line) - (let* ((var (bindat-get-field - (get-text-property (point) 'gdb-register-name))) + (let* ((var (get-text-property (point) 'gdb-register-name)) (value (read-string (format "New value (%s): " var)))) (gud-basic-call (concat "-gdb-set variable $" var " = " value))))) -- cgit v1.2.3 From 30dba74e77baa31af32bc7044146d69965220ad7 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Thu, 22 Oct 2020 18:31:31 +0200 Subject: ; * lisp/progmodes/fortran.el: Call 'eval' with lexical binding. --- lisp/progmodes/fortran.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 206d1f2a05d..d84c3795653 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -502,7 +502,8 @@ This is used to fontify fixed-format Fortran comments." ;; line-length will indeed be ignored (and will result in a string that ;; leaks into subsequent lines). (,(format "^[^CcDd\\*\t\n].\\{%d\\}\\(.+\\)" (1- line-length)) - (1 "<"))))) + (1 "<"))) + t)) (defvar fortran-font-lock-keywords fortran-font-lock-keywords-1 "Default expressions to highlight in Fortran mode.") -- cgit v1.2.3 From f6d138979626951a035a6ecf90b77637b06ad6fc Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 22 Oct 2020 18:28:21 +0200 Subject: Add missed file needed by time-tests.el * test/lisp/time-resources/non-empty: New file. This file is needed by time-tests.el but was missed when it was committed. --- test/lisp/time-resources/non-empty | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/lisp/time-resources/non-empty diff --git a/test/lisp/time-resources/non-empty b/test/lisp/time-resources/non-empty new file mode 100644 index 00000000000..86f5704d8ee --- /dev/null +++ b/test/lisp/time-resources/non-empty @@ -0,0 +1 @@ +This file should be non-empty. -- cgit v1.2.3 From b572308fbf095da3bd7382d3b1c8f952a51ce3ac Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 22 Oct 2020 20:07:24 +0200 Subject: eww: don't add keymap to without href * lisp/net/eww.el (eww-tag-a): Only add keymap if the href attribute is present. (Bug#44147) --- lisp/net/eww.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index fd9fe98439d..53835bb5440 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -695,11 +695,12 @@ Currently this means either text/html or application/xhtml+xml." (eww-handle-link dom) (let ((start (point))) (shr-tag-a dom) - (put-text-property start (point) - 'keymap - (if (mm-images-in-region-p start (point)) - eww-image-link-keymap - eww-link-keymap)))) + (if (dom-attr dom 'href) + (put-text-property start (point) + 'keymap + (if (mm-images-in-region-p start (point)) + eww-image-link-keymap + eww-link-keymap))))) (defun eww--limit-string-pixelwise (string pixels) (if (not pixels) -- cgit v1.2.3 From 8b87ea6844036c168c9ec67dd318ee3ba8dab5ae Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 01:50:50 +0200 Subject: Recommend lexical-binding in Coding Conventions * doc/lispref/tips.texi (Coding Conventions, Library Headers): Recommend using lexical-binding. --- doc/lispref/tips.texi | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 5b09b2ccea6..4d6dcb9f834 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -94,6 +94,11 @@ it to Emacs. If and when we do, we can change the name easily enough. If one prefix is insufficient, your package can use two or three alternative common prefixes, so long as they make sense. +@item +We recommend enabling @code{lexical-binding} in new code, and +converting existing Emacs Lisp code to enable @code{lexical-binding} +if it doesn't already. @xref{Using Lexical Binding}. + @item Put a call to @code{provide} at the end of each separate Lisp file. @xref{Named Features}. @@ -963,7 +968,7 @@ explains these conventions, starting with an example: @smallexample @group -;;; foo.el --- Support for the Foo programming language +;;; foo.el --- Support for the Foo programming language -*- lexical-binding: t; -*- ;; Copyright (C) 2010-2020 Your Name @end group @@ -986,14 +991,14 @@ explains these conventions, starting with an example: The very first line should have this format: @example -;;; @var{filename} --- @var{description} +;;; @var{filename} --- @var{description} -*- lexical-binding: t; -*- @end example @noindent -The description should be contained in one line. If the file -needs a @samp{-*-} specification, put it after @var{description}. -If this would make the first line too long, use a Local Variables -section at the end of the file. +The description should be contained in one line. If the file needs to +set more variables in the @samp{-*-} specification, add it after +@code{lexical-binding}. If this would make the first line too long, use +a Local Variables section at the end of the file. The copyright notice usually lists your name (if you wrote the file). If you have an employer who claims copyright on your work, you -- cgit v1.2.3 From 8c7a55531b400dd3d9aa1dacd2bac3ee06b56ff1 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 22 Oct 2020 20:32:32 +0200 Subject: Remove incorrect use of decode-coding-string * test/lisp/emacs-lisp/bindat-tests.el (bindat-test-pack/multibyte-string-fails) (bindat-test-unpack/multibyte-string-fails): Don't use decode-coding-string. Problem pointed out by Stefan Monnier . --- test/lisp/emacs-lisp/bindat-tests.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lisp/emacs-lisp/bindat-tests.el b/test/lisp/emacs-lisp/bindat-tests.el index 0fb1955695d..842ef10bc57 100644 --- a/test/lisp/emacs-lisp/bindat-tests.el +++ b/test/lisp/emacs-lisp/bindat-tests.el @@ -97,10 +97,10 @@ [192 168 1 100])))))) (ert-deftest bindat-test-pack/multibyte-string-fails () - (should-error (bindat-pack nil nil (decode-coding-string "ö" 'utf-8)))) + (should-error (bindat-pack nil nil "ö"))) (ert-deftest bindat-test-unpack/multibyte-string-fails () - (should-error (bindat-unpack nil (decode-coding-string "ö" 'utf-8)))) + (should-error (bindat-unpack nil "ö"))) (ert-deftest bindat-test-format-vector () (should (equal (bindat-format-vector [1 2 3] "%d" "x" 2) "1x2")) -- cgit v1.2.3 From 87239f0a5c613dc716328e129bf79b69979b8a12 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Thu, 22 Oct 2020 19:47:17 +0100 Subject: Fix crash when no face is defined (bug#44058, bug#43973) * src/nsterm.m (ns_clear_under_internal_border): If face is null, don't try drawing anything. --- src/nsterm.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nsterm.m b/src/nsterm.m index a702a051d00..fa38350a2f6 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3048,6 +3048,12 @@ ns_clear_under_internal_border (struct frame *f) if (!face) face = FRAME_DEFAULT_FACE (f); + /* Sometimes with new frames we reach this point and have no + face. I'm not sure why we have a live frame but no face, so + just give up. */ + if (!face) + return; + ns_focus (f, &frame_rect, 1); [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set]; for (int i = 0; i < 4 ; i++) -- cgit v1.2.3 From b42481e22eb1c1adfcef419d45bf9733837684cb Mon Sep 17 00:00:00 2001 From: Alan Third Date: Mon, 19 Oct 2020 21:19:57 +0100 Subject: Fix SVG image dimension calculations (bug#44065) * src/image.c (svg_load_image): Calculate the image size by using the viewBox size and applying it to the image. * etc/PROBLEMS: Describe the problem with librsvg 2.45 and below. --- etc/PROBLEMS | 4 ++++ src/image.c | 46 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 41d5ea1bb75..8ed92ab75e0 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -181,6 +181,10 @@ Configure checks for the correct version, but this problem could occur if a binary built against a shared libungif is run on a system with an older version. +** SVG images may be cropped incorrectly with librsvg 2.45 and below. +Librsvg 2.46 and above have improved geometry code which Emacs is able +to take advantage of. + ** Emacs aborts inside the function 'tparam1'. This can happen if Emacs was built without terminfo support, but the diff --git a/src/image.c b/src/image.c index 25d5af8a8d5..5f6d9f4c443 100644 --- a/src/image.c +++ b/src/image.c @@ -9736,7 +9736,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, ptrdiff_t size, char *filename) { RsvgHandle *rsvg_handle; - RsvgDimensionData dimension_data; + double viewbox_width, viewbox_height; GError *err = NULL; GdkPixbuf *pixbuf; int width; @@ -9789,15 +9789,38 @@ svg_load_image (struct frame *f, struct image *img, char *contents, #endif /* Get the image dimensions. */ +#if LIBRSVG_CHECK_VERSION (2, 46, 0) + RsvgRectangle zero_rect, viewbox; + + rsvg_handle_get_geometry_for_layer (rsvg_handle, NULL, + &zero_rect, &viewbox, + NULL, NULL); + viewbox_width = viewbox.x + viewbox.width; + viewbox_height = viewbox.y + viewbox.height; +#else + /* The function used above to get the geometry of the visible area + of the SVG are only available in librsvg 2.46 and above, so in + certain circumstances this code path can result in some parts of + the SVG being cropped. */ + RsvgDimensionData dimension_data; + rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); + viewbox_width = dimension_data.width; + viewbox_height = dimension_data.height; +#endif + compute_image_size (viewbox_width, viewbox_height, img->spec, + &width, &height); + + if (! check_image_size (f, width, height)) + { + image_size_error (); + goto rsvg_error; + } + /* We are now done with the unmodified data. */ g_object_unref (rsvg_handle); - /* Calculate the final image size. */ - compute_image_size (dimension_data.width, dimension_data.height, - img->spec, &width, &height); - /* Wrap the SVG data in another SVG. This allows us to set the width and height, as well as modify the foreground and background colors. */ @@ -9820,7 +9843,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, "xmlns:xi=\"http://www.w3.org/2001/XInclude\" " "style=\"color: #%06X; fill: currentColor;\" " "width=\"%d\" height=\"%d\" preserveAspectRatio=\"none\" " - "viewBox=\"0 0 %d %d\">" + "viewBox=\"0 0 %f %f\">" "" "" ""; @@ -9845,8 +9868,9 @@ svg_load_image (struct frame *f, struct image *img, char *contents, if (!wrapped_contents || buffer_size <= snprintf (wrapped_contents, buffer_size, wrapper, foreground & 0xFFFFFF, width, height, - dimension_data.width, dimension_data.height, - background & 0xFFFFFF, SSDATA (encoded_contents))) + viewbox_width, viewbox_height, + background & 0xFFFFFF, + SSDATA (encoded_contents))) goto rsvg_error; wrapped_size = strlen (wrapped_contents); @@ -9887,12 +9911,6 @@ svg_load_image (struct frame *f, struct image *img, char *contents, if (err) goto rsvg_error; #endif - rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); - if (! check_image_size (f, dimension_data.width, dimension_data.height)) - { - image_size_error (); - goto rsvg_error; - } /* We can now get a valid pixel buffer from the svg file, if all went ok. */ -- cgit v1.2.3 From ed502406bfeb87b3ee23661cacf04285634d8036 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 22 Oct 2020 23:09:24 +0300 Subject: * etc/HELLO: Use JavaScript for Javanese script (bug#43887) --- etc/HELLO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/HELLO b/etc/HELLO index 06c1c433b00..3c1fd63fb71 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -59,7 +59,7 @@ Gujarati (àȘ—ુàȘœàȘ°àȘŸàȘ€à«€) àȘšàȘźàȘžà«àȘ€à«‡
unicodeInuktitut (ᐃᓄᒃᑎᑐᑩ) ᐊᐃ latin-iso8859-1Italian (italiano) Ciao / Buon giorno -unicodeJavanese (êŠ§êŠ±êŠ—êŠź) System.out.println("ꊱꊞꊒꊌꊁꊱꊶêŠȘꊁ"); +unicodeJavanese (êŠ§êŠ±êŠ—êŠź) console.log("ꊱꊞꊒꊌꊁꊱꊶêŠȘꊁ"); mule-unicode-0100-24ffKannada (àȕàČšàłàČšàČĄ) àČšàČźàČžàłàȕàČŸàČ° Khmer (ភាសាខ្មែរ) ជំរាបសវរ laoLao (àșžàșČàșȘàșČàș„àșČàș§) àșȘàș°àșšàșČàșàș”àș” / àș‚ໍໃàș«à»‰à»‚àșŠàșàș”àș” -- cgit v1.2.3 From dc8bffba5a4c3befcae2659d19ff90d5fd2b129f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 23 Oct 2020 05:25:22 +0200 Subject: * lisp/emacs-lisp/pcase.el: Add "extensions" to keyword header. --- lisp/emacs-lisp/pcase.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 09c48d095cc..e603900b095 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2010-2020 Free Software Foundation, Inc. ;; Author: Stefan Monnier -;; Keywords: +;; Keywords: extensions ;; This file is part of GNU Emacs. -- cgit v1.2.3 From c57a60ee958821790a1fe4220a2c3837b664e9be Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Fri, 23 Oct 2020 11:11:51 +0200 Subject: Use lexical binding in ffap.el * lisp/ffap.el (ffap-search-backward-file-end): Remove binding for variable shadowing an optional (and never used) argument. (ffap--gopher-var-on-line): Remove unused variable. --- lisp/ffap.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 94aba5e5fb5..bf035886006 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1,4 +1,4 @@ -;;; ffap.el --- find file (or url) at point +;;; ffap.el --- find file (or url) at point -*- lexical-binding: t -*- ;; Copyright (C) 1995-1997, 2000-2020 Free Software Foundation, Inc. @@ -1139,7 +1139,7 @@ Move point and return point if an adjustment was done." (unless dir-separator (setq dir-separator "/")) (let ((opoint (point)) - point punct end whitespace-p) + point punct whitespace-p) (when (re-search-backward (regexp-quote dir-separator) (line-beginning-position) t) ;; Move to the beginning of the match.. @@ -1360,12 +1360,14 @@ Set to nil to disable matching gopher bookmarks.") (defun ffap--gopher-var-on-line () "Return (KEY . VALUE) of gopher bookmark on current line." (save-excursion - (let ((eol (progn (end-of-line) (skip-chars-backward " ") (point))) - (bol (progn (beginning-of-line) (point)))) - (when (re-search-forward ffap-gopher-regexp eol t) - (let ((key (match-string 1)) - (val (buffer-substring-no-properties (match-end 0) eol))) - (cons (intern (downcase key)) val)))))) + (end-of-line) + (skip-chars-backward " ") + (let ((eol (point))) + (beginning-of-line) + (when (re-search-forward ffap-gopher-regexp eol t) + (let ((key (match-string 1)) + (val (buffer-substring-no-properties (match-end 0) eol))) + (cons (intern (downcase key)) val)))))) (defun ffap-gopher-at-point () "If point is inside a gopher bookmark block, return its URL. -- cgit v1.2.3 From 22e5239c172ccc603b1f0def87aeabc3ccdb61c6 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 23 Oct 2020 12:56:39 +0200 Subject: Clean up temporary files after package tests * test/lisp/emacs-lisp/package-tests.el (with-package-test): Remove temporary files after test. (Bug#43359) --- test/lisp/emacs-lisp/package-tests.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 155a8e6fce9..23267545f83 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el @@ -151,6 +151,15 @@ `(insert-file-contents ,file)) ,@body))) + (when ,upload-base + (dolist (f '("archive-contents" + "simple-single-1.3.el" + "simple-single-1.4.el" + "simple-single-readme.txt")) + (ignore-errors + (delete-file + (expand-file-name f package-test-archive-upload-base)))) + (delete-directory package-test-archive-upload-base)) (when (file-directory-p package-test-user-dir) (delete-directory package-test-user-dir t)) -- cgit v1.2.3 From 9e4f11a1631f627af49d5854e0f651371c8f1c19 Mon Sep 17 00:00:00 2001 From: Ulf Jasper Date: Fri, 23 Oct 2020 14:48:49 +0200 Subject: Move icalendar test data to test/lisp/calendar/icalendar-resources * test/lisp/calendar/icalendar-tests.el (ert-x): Required for 'ert-resource-file'. (icalendar-tests--data-dir): Removed. (icalendar-tests--get-file-contents): Use 'ert-resource-file' for finding test data files. * test/data/icalendar/*: Moved to test/lisp/calendar/icalendar-resources/. * test/lisp/calendar/icalendar-resources/*: Moved from test/data/icalendar. --- .../data/icalendar/import-bug-11473.diary-european | 10 -- test/data/icalendar/import-bug-11473.ics | 54 ---------- .../data/icalendar/import-bug-22092.diary-american | 6 -- .../data/icalendar/import-bug-22092.diary-european | 6 -- test/data/icalendar/import-bug-22092.diary-iso | 6 -- test/data/icalendar/import-bug-22092.ics | 30 ------ .../data/icalendar/import-bug-24199.diary-american | 5 - .../data/icalendar/import-bug-24199.diary-european | 5 - test/data/icalendar/import-bug-24199.diary-iso | 5 - test/data/icalendar/import-bug-24199.ics | 25 ----- .../data/icalendar/import-bug-33277.diary-american | 1 - .../data/icalendar/import-bug-33277.diary-european | 1 - test/data/icalendar/import-bug-33277.diary-iso | 1 - test/data/icalendar/import-bug-33277.ics | 15 --- test/data/icalendar/import-bug-6766.diary-american | 7 -- test/data/icalendar/import-bug-6766.diary-european | 7 -- test/data/icalendar/import-bug-6766.diary-iso | 7 -- test/data/icalendar/import-bug-6766.ics | 28 ----- .../icalendar/import-duration-2.diary-american | 3 - .../icalendar/import-duration-2.diary-european | 3 - test/data/icalendar/import-duration-2.diary-iso | 3 - test/data/icalendar/import-duration-2.ics | 17 --- test/data/icalendar/import-duration.diary-american | 1 - test/data/icalendar/import-duration.diary-european | 1 - test/data/icalendar/import-duration.diary-iso | 1 - test/data/icalendar/import-duration.ics | 10 -- .../import-multiple-vcalendars.diary-american | 4 - .../import-multiple-vcalendars.diary-european | 4 - .../icalendar/import-multiple-vcalendars.diary-iso | 4 - test/data/icalendar/import-multiple-vcalendars.ics | 21 ---- .../import-non-recurring-1.diary-american | 1 - .../import-non-recurring-1.diary-european | 1 - .../icalendar/import-non-recurring-1.diary-iso | 1 - test/data/icalendar/import-non-recurring-1.ics | 10 -- .../import-non-recurring-all-day.diary-american | 1 - .../import-non-recurring-all-day.diary-european | 1 - .../import-non-recurring-all-day.diary-iso | 1 - .../icalendar/import-non-recurring-all-day.ics | 9 -- ...rt-non-recurring-another-example.diary-american | 4 - ...rt-non-recurring-another-example.diary-european | 4 - .../import-non-recurring-another-example.diary-iso | 4 - .../import-non-recurring-another-example.ics | 23 ---- .../import-non-recurring-block.diary-american | 4 - .../import-non-recurring-block.diary-european | 4 - .../icalendar/import-non-recurring-block.diary-iso | 4 - test/data/icalendar/import-non-recurring-block.ics | 16 --- ...ort-non-recurring-folded-summary.diary-american | 4 - ...ort-non-recurring-folded-summary.diary-european | 4 - .../import-non-recurring-folded-summary.diary-iso | 4 - .../import-non-recurring-folded-summary.ics | 25 ----- ...mport-non-recurring-long-summary.diary-american | 1 - ...mport-non-recurring-long-summary.diary-european | 1 - .../import-non-recurring-long-summary.diary-iso | 1 - .../import-non-recurring-long-summary.ics | 10 -- .../import-real-world-2003-05-29.diary-american | 6 -- .../import-real-world-2003-05-29.diary-european | 6 -- .../icalendar/import-real-world-2003-05-29.ics | 54 ---------- .../import-real-world-2003-06-18a.diary-american | 6 -- .../import-real-world-2003-06-18a.diary-european | 6 -- .../icalendar/import-real-world-2003-06-18a.ics | 36 ------- .../import-real-world-2003-06-18b.diary-american | 6 -- .../import-real-world-2003-06-18b.diary-european | 6 -- .../icalendar/import-real-world-2003-06-18b.ics | 55 ---------- .../import-real-world-2004-11-19.diary-american | 19 ---- .../import-real-world-2004-11-19.diary-european | 19 ---- .../icalendar/import-real-world-2004-11-19.ics | 120 --------------------- .../import-real-world-2005-02-07.diary-american | 5 - .../import-real-world-2005-02-07.diary-european | 5 - .../icalendar/import-real-world-2005-02-07.ics | 26 ----- .../import-real-world-2005-03-01.diary-american | 2 - .../import-real-world-2005-03-01.diary-european | 2 - .../icalendar/import-real-world-2005-03-01.ics | 11 -- .../import-real-world-no-dst.diary-american | 4 - .../import-real-world-no-dst.diary-european | 4 - test/data/icalendar/import-real-world-no-dst.ics | 26 ----- .../import-rrule-anniversary.diary-american | 1 - .../import-rrule-anniversary.diary-european | 1 - .../icalendar/import-rrule-anniversary.diary-iso | 1 - test/data/icalendar/import-rrule-anniversary.ics | 11 -- .../import-rrule-count-bi-weekly.diary-american | 1 - .../import-rrule-count-bi-weekly.diary-european | 1 - .../import-rrule-count-bi-weekly.diary-iso | 1 - .../icalendar/import-rrule-count-bi-weekly.ics | 11 -- .../import-rrule-count-daily-long.diary-american | 1 - .../import-rrule-count-daily-long.diary-european | 1 - .../import-rrule-count-daily-long.diary-iso | 1 - .../icalendar/import-rrule-count-daily-long.ics | 11 -- .../import-rrule-count-daily-short.diary-american | 1 - .../import-rrule-count-daily-short.diary-european | 1 - .../import-rrule-count-daily-short.diary-iso | 1 - .../icalendar/import-rrule-count-daily-short.ics | 11 -- ...t-rrule-count-every-second-month.diary-american | 1 - ...t-rrule-count-every-second-month.diary-european | 1 - ...import-rrule-count-every-second-month.diary-iso | 1 - .../import-rrule-count-every-second-month.ics | 11 -- ...rt-rrule-count-every-second-year.diary-american | 1 - ...rt-rrule-count-every-second-year.diary-european | 1 - .../import-rrule-count-every-second-year.diary-iso | 1 - .../import-rrule-count-every-second-year.ics | 10 -- .../import-rrule-count-monthly.diary-american | 1 - .../import-rrule-count-monthly.diary-european | 1 - .../icalendar/import-rrule-count-monthly.diary-iso | 1 - test/data/icalendar/import-rrule-count-monthly.ics | 11 -- .../import-rrule-count-yearly.diary-american | 1 - .../import-rrule-count-yearly.diary-european | 1 - .../icalendar/import-rrule-count-yearly.diary-iso | 1 - test/data/icalendar/import-rrule-count-yearly.ics | 11 -- .../import-rrule-daily-two-day.diary-american | 1 - .../import-rrule-daily-two-day.diary-european | 1 - .../icalendar/import-rrule-daily-two-day.diary-iso | 1 - test/data/icalendar/import-rrule-daily-two-day.ics | 10 -- ...port-rrule-daily-with-exceptions.diary-american | 1 - ...port-rrule-daily-with-exceptions.diary-european | 1 - .../import-rrule-daily-with-exceptions.diary-iso | 1 - .../import-rrule-daily-with-exceptions.ics | 12 --- .../icalendar/import-rrule-daily.diary-american | 1 - .../icalendar/import-rrule-daily.diary-european | 1 - test/data/icalendar/import-rrule-daily.diary-iso | 1 - test/data/icalendar/import-rrule-daily.ics | 11 -- .../import-rrule-monthly-no-end.diary-american | 1 - .../import-rrule-monthly-no-end.diary-european | 1 - .../import-rrule-monthly-no-end.diary-iso | 1 - .../data/icalendar/import-rrule-monthly-no-end.ics | 11 -- .../import-rrule-monthly-with-end.diary-american | 1 - .../import-rrule-monthly-with-end.diary-european | 1 - .../import-rrule-monthly-with-end.diary-iso | 1 - .../icalendar/import-rrule-monthly-with-end.ics | 11 -- .../icalendar/import-rrule-weekly.diary-american | 1 - .../icalendar/import-rrule-weekly.diary-european | 1 - test/data/icalendar/import-rrule-weekly.diary-iso | 1 - test/data/icalendar/import-rrule-weekly.ics | 11 -- .../icalendar/import-rrule-yearly.diary-american | 1 - .../icalendar/import-rrule-yearly.diary-european | 1 - test/data/icalendar/import-rrule-yearly.diary-iso | 1 - test/data/icalendar/import-rrule-yearly.ics | 11 -- test/data/icalendar/import-with-timezone.diary-iso | 2 - test/data/icalendar/import-with-timezone.ics | 27 ----- test/data/icalendar/import-with-uid.diary-american | 2 - test/data/icalendar/import-with-uid.diary-european | 2 - test/data/icalendar/import-with-uid.diary-iso | 2 - test/data/icalendar/import-with-uid.ics | 10 -- .../import-bug-11473.diary-european | 10 ++ .../icalendar-resources/import-bug-11473.ics | 54 ++++++++++ .../import-bug-22092.diary-american | 6 ++ .../import-bug-22092.diary-european | 6 ++ .../icalendar-resources/import-bug-22092.diary-iso | 6 ++ .../icalendar-resources/import-bug-22092.ics | 30 ++++++ .../import-bug-24199.diary-american | 5 + .../import-bug-24199.diary-european | 5 + .../icalendar-resources/import-bug-24199.diary-iso | 5 + .../icalendar-resources/import-bug-24199.ics | 25 +++++ .../import-bug-33277.diary-american | 1 + .../import-bug-33277.diary-european | 1 + .../icalendar-resources/import-bug-33277.diary-iso | 1 + .../icalendar-resources/import-bug-33277.ics | 15 +++ .../import-bug-6766.diary-american | 7 ++ .../import-bug-6766.diary-european | 7 ++ .../icalendar-resources/import-bug-6766.diary-iso | 7 ++ .../icalendar-resources/import-bug-6766.ics | 28 +++++ .../import-duration-2.diary-american | 3 + .../import-duration-2.diary-european | 3 + .../import-duration-2.diary-iso | 3 + .../icalendar-resources/import-duration-2.ics | 17 +++ .../import-duration.diary-american | 1 + .../import-duration.diary-european | 1 + .../icalendar-resources/import-duration.diary-iso | 1 + .../icalendar-resources/import-duration.ics | 10 ++ .../import-multiple-vcalendars.diary-american | 4 + .../import-multiple-vcalendars.diary-european | 4 + .../import-multiple-vcalendars.diary-iso | 4 + .../import-multiple-vcalendars.ics | 21 ++++ .../import-non-recurring-1.diary-american | 1 + .../import-non-recurring-1.diary-european | 1 + .../import-non-recurring-1.diary-iso | 1 + .../icalendar-resources/import-non-recurring-1.ics | 10 ++ .../import-non-recurring-all-day.diary-american | 1 + .../import-non-recurring-all-day.diary-european | 1 + .../import-non-recurring-all-day.diary-iso | 1 + .../import-non-recurring-all-day.ics | 9 ++ ...rt-non-recurring-another-example.diary-american | 4 + ...rt-non-recurring-another-example.diary-european | 4 + .../import-non-recurring-another-example.diary-iso | 4 + .../import-non-recurring-another-example.ics | 23 ++++ .../import-non-recurring-block.diary-american | 4 + .../import-non-recurring-block.diary-european | 4 + .../import-non-recurring-block.diary-iso | 4 + .../import-non-recurring-block.ics | 16 +++ ...ort-non-recurring-folded-summary.diary-american | 4 + ...ort-non-recurring-folded-summary.diary-european | 4 + .../import-non-recurring-folded-summary.diary-iso | 4 + .../import-non-recurring-folded-summary.ics | 25 +++++ ...mport-non-recurring-long-summary.diary-american | 1 + ...mport-non-recurring-long-summary.diary-european | 1 + .../import-non-recurring-long-summary.diary-iso | 1 + .../import-non-recurring-long-summary.ics | 10 ++ .../import-real-world-2003-05-29.diary-american | 6 ++ .../import-real-world-2003-05-29.diary-european | 6 ++ .../import-real-world-2003-05-29.ics | 54 ++++++++++ .../import-real-world-2003-06-18a.diary-american | 6 ++ .../import-real-world-2003-06-18a.diary-european | 6 ++ .../import-real-world-2003-06-18a.ics | 36 +++++++ .../import-real-world-2003-06-18b.diary-american | 6 ++ .../import-real-world-2003-06-18b.diary-european | 6 ++ .../import-real-world-2003-06-18b.ics | 55 ++++++++++ .../import-real-world-2004-11-19.diary-american | 19 ++++ .../import-real-world-2004-11-19.diary-european | 19 ++++ .../import-real-world-2004-11-19.ics | 120 +++++++++++++++++++++ .../import-real-world-2005-02-07.diary-american | 5 + .../import-real-world-2005-02-07.diary-european | 5 + .../import-real-world-2005-02-07.ics | 26 +++++ .../import-real-world-2005-03-01.diary-american | 2 + .../import-real-world-2005-03-01.diary-european | 2 + .../import-real-world-2005-03-01.ics | 11 ++ .../import-real-world-no-dst.diary-american | 4 + .../import-real-world-no-dst.diary-european | 4 + .../import-real-world-no-dst.ics | 26 +++++ .../import-rrule-anniversary.diary-american | 1 + .../import-rrule-anniversary.diary-european | 1 + .../import-rrule-anniversary.diary-iso | 1 + .../import-rrule-anniversary.ics | 11 ++ .../import-rrule-count-bi-weekly.diary-american | 1 + .../import-rrule-count-bi-weekly.diary-european | 1 + .../import-rrule-count-bi-weekly.diary-iso | 1 + .../import-rrule-count-bi-weekly.ics | 11 ++ .../import-rrule-count-daily-long.diary-american | 1 + .../import-rrule-count-daily-long.diary-european | 1 + .../import-rrule-count-daily-long.diary-iso | 1 + .../import-rrule-count-daily-long.ics | 11 ++ .../import-rrule-count-daily-short.diary-american | 1 + .../import-rrule-count-daily-short.diary-european | 1 + .../import-rrule-count-daily-short.diary-iso | 1 + .../import-rrule-count-daily-short.ics | 11 ++ ...t-rrule-count-every-second-month.diary-american | 1 + ...t-rrule-count-every-second-month.diary-european | 1 + ...import-rrule-count-every-second-month.diary-iso | 1 + .../import-rrule-count-every-second-month.ics | 11 ++ ...rt-rrule-count-every-second-year.diary-american | 1 + ...rt-rrule-count-every-second-year.diary-european | 1 + .../import-rrule-count-every-second-year.diary-iso | 1 + .../import-rrule-count-every-second-year.ics | 10 ++ .../import-rrule-count-monthly.diary-american | 1 + .../import-rrule-count-monthly.diary-european | 1 + .../import-rrule-count-monthly.diary-iso | 1 + .../import-rrule-count-monthly.ics | 11 ++ .../import-rrule-count-yearly.diary-american | 1 + .../import-rrule-count-yearly.diary-european | 1 + .../import-rrule-count-yearly.diary-iso | 1 + .../import-rrule-count-yearly.ics | 11 ++ .../import-rrule-daily-two-day.diary-american | 1 + .../import-rrule-daily-two-day.diary-european | 1 + .../import-rrule-daily-two-day.diary-iso | 1 + .../import-rrule-daily-two-day.ics | 10 ++ ...port-rrule-daily-with-exceptions.diary-american | 1 + ...port-rrule-daily-with-exceptions.diary-european | 1 + .../import-rrule-daily-with-exceptions.diary-iso | 1 + .../import-rrule-daily-with-exceptions.ics | 12 +++ .../import-rrule-daily.diary-american | 1 + .../import-rrule-daily.diary-european | 1 + .../import-rrule-daily.diary-iso | 1 + .../icalendar-resources/import-rrule-daily.ics | 11 ++ .../import-rrule-monthly-no-end.diary-american | 1 + .../import-rrule-monthly-no-end.diary-european | 1 + .../import-rrule-monthly-no-end.diary-iso | 1 + .../import-rrule-monthly-no-end.ics | 11 ++ .../import-rrule-monthly-with-end.diary-american | 1 + .../import-rrule-monthly-with-end.diary-european | 1 + .../import-rrule-monthly-with-end.diary-iso | 1 + .../import-rrule-monthly-with-end.ics | 11 ++ .../import-rrule-weekly.diary-american | 1 + .../import-rrule-weekly.diary-european | 1 + .../import-rrule-weekly.diary-iso | 1 + .../icalendar-resources/import-rrule-weekly.ics | 11 ++ .../import-rrule-yearly.diary-american | 1 + .../import-rrule-yearly.diary-european | 1 + .../import-rrule-yearly.diary-iso | 1 + .../icalendar-resources/import-rrule-yearly.ics | 11 ++ .../import-with-timezone.diary-iso | 2 + .../icalendar-resources/import-with-timezone.ics | 27 +++++ .../import-with-uid.diary-american | 2 + .../import-with-uid.diary-european | 2 + .../icalendar-resources/import-with-uid.diary-iso | 2 + .../icalendar-resources/import-with-uid.ics | 10 ++ test/lisp/calendar/icalendar-tests.el | 10 +- 283 files changed, 1110 insertions(+), 1114 deletions(-) delete mode 100644 test/data/icalendar/import-bug-11473.diary-european delete mode 100644 test/data/icalendar/import-bug-11473.ics delete mode 100644 test/data/icalendar/import-bug-22092.diary-american delete mode 100644 test/data/icalendar/import-bug-22092.diary-european delete mode 100644 test/data/icalendar/import-bug-22092.diary-iso delete mode 100644 test/data/icalendar/import-bug-22092.ics delete mode 100644 test/data/icalendar/import-bug-24199.diary-american delete mode 100644 test/data/icalendar/import-bug-24199.diary-european delete mode 100644 test/data/icalendar/import-bug-24199.diary-iso delete mode 100644 test/data/icalendar/import-bug-24199.ics delete mode 100644 test/data/icalendar/import-bug-33277.diary-american delete mode 100644 test/data/icalendar/import-bug-33277.diary-european delete mode 100644 test/data/icalendar/import-bug-33277.diary-iso delete mode 100644 test/data/icalendar/import-bug-33277.ics delete mode 100644 test/data/icalendar/import-bug-6766.diary-american delete mode 100644 test/data/icalendar/import-bug-6766.diary-european delete mode 100644 test/data/icalendar/import-bug-6766.diary-iso delete mode 100644 test/data/icalendar/import-bug-6766.ics delete mode 100644 test/data/icalendar/import-duration-2.diary-american delete mode 100644 test/data/icalendar/import-duration-2.diary-european delete mode 100644 test/data/icalendar/import-duration-2.diary-iso delete mode 100644 test/data/icalendar/import-duration-2.ics delete mode 100644 test/data/icalendar/import-duration.diary-american delete mode 100644 test/data/icalendar/import-duration.diary-european delete mode 100644 test/data/icalendar/import-duration.diary-iso delete mode 100644 test/data/icalendar/import-duration.ics delete mode 100644 test/data/icalendar/import-multiple-vcalendars.diary-american delete mode 100644 test/data/icalendar/import-multiple-vcalendars.diary-european delete mode 100644 test/data/icalendar/import-multiple-vcalendars.diary-iso delete mode 100644 test/data/icalendar/import-multiple-vcalendars.ics delete mode 100644 test/data/icalendar/import-non-recurring-1.diary-american delete mode 100644 test/data/icalendar/import-non-recurring-1.diary-european delete mode 100644 test/data/icalendar/import-non-recurring-1.diary-iso delete mode 100644 test/data/icalendar/import-non-recurring-1.ics delete mode 100644 test/data/icalendar/import-non-recurring-all-day.diary-american delete mode 100644 test/data/icalendar/import-non-recurring-all-day.diary-european delete mode 100644 test/data/icalendar/import-non-recurring-all-day.diary-iso delete mode 100644 test/data/icalendar/import-non-recurring-all-day.ics delete mode 100644 test/data/icalendar/import-non-recurring-another-example.diary-american delete mode 100644 test/data/icalendar/import-non-recurring-another-example.diary-european delete mode 100644 test/data/icalendar/import-non-recurring-another-example.diary-iso delete mode 100644 test/data/icalendar/import-non-recurring-another-example.ics delete mode 100644 test/data/icalendar/import-non-recurring-block.diary-american delete mode 100644 test/data/icalendar/import-non-recurring-block.diary-european delete mode 100644 test/data/icalendar/import-non-recurring-block.diary-iso delete mode 100644 test/data/icalendar/import-non-recurring-block.ics delete mode 100644 test/data/icalendar/import-non-recurring-folded-summary.diary-american delete mode 100644 test/data/icalendar/import-non-recurring-folded-summary.diary-european delete mode 100644 test/data/icalendar/import-non-recurring-folded-summary.diary-iso delete mode 100644 test/data/icalendar/import-non-recurring-folded-summary.ics delete mode 100644 test/data/icalendar/import-non-recurring-long-summary.diary-american delete mode 100644 test/data/icalendar/import-non-recurring-long-summary.diary-european delete mode 100644 test/data/icalendar/import-non-recurring-long-summary.diary-iso delete mode 100644 test/data/icalendar/import-non-recurring-long-summary.ics delete mode 100644 test/data/icalendar/import-real-world-2003-05-29.diary-american delete mode 100644 test/data/icalendar/import-real-world-2003-05-29.diary-european delete mode 100644 test/data/icalendar/import-real-world-2003-05-29.ics delete mode 100644 test/data/icalendar/import-real-world-2003-06-18a.diary-american delete mode 100644 test/data/icalendar/import-real-world-2003-06-18a.diary-european delete mode 100644 test/data/icalendar/import-real-world-2003-06-18a.ics delete mode 100644 test/data/icalendar/import-real-world-2003-06-18b.diary-american delete mode 100644 test/data/icalendar/import-real-world-2003-06-18b.diary-european delete mode 100644 test/data/icalendar/import-real-world-2003-06-18b.ics delete mode 100644 test/data/icalendar/import-real-world-2004-11-19.diary-american delete mode 100644 test/data/icalendar/import-real-world-2004-11-19.diary-european delete mode 100644 test/data/icalendar/import-real-world-2004-11-19.ics delete mode 100644 test/data/icalendar/import-real-world-2005-02-07.diary-american delete mode 100644 test/data/icalendar/import-real-world-2005-02-07.diary-european delete mode 100644 test/data/icalendar/import-real-world-2005-02-07.ics delete mode 100644 test/data/icalendar/import-real-world-2005-03-01.diary-american delete mode 100644 test/data/icalendar/import-real-world-2005-03-01.diary-european delete mode 100644 test/data/icalendar/import-real-world-2005-03-01.ics delete mode 100644 test/data/icalendar/import-real-world-no-dst.diary-american delete mode 100644 test/data/icalendar/import-real-world-no-dst.diary-european delete mode 100644 test/data/icalendar/import-real-world-no-dst.ics delete mode 100644 test/data/icalendar/import-rrule-anniversary.diary-american delete mode 100644 test/data/icalendar/import-rrule-anniversary.diary-european delete mode 100644 test/data/icalendar/import-rrule-anniversary.diary-iso delete mode 100644 test/data/icalendar/import-rrule-anniversary.ics delete mode 100644 test/data/icalendar/import-rrule-count-bi-weekly.diary-american delete mode 100644 test/data/icalendar/import-rrule-count-bi-weekly.diary-european delete mode 100644 test/data/icalendar/import-rrule-count-bi-weekly.diary-iso delete mode 100644 test/data/icalendar/import-rrule-count-bi-weekly.ics delete mode 100644 test/data/icalendar/import-rrule-count-daily-long.diary-american delete mode 100644 test/data/icalendar/import-rrule-count-daily-long.diary-european delete mode 100644 test/data/icalendar/import-rrule-count-daily-long.diary-iso delete mode 100644 test/data/icalendar/import-rrule-count-daily-long.ics delete mode 100644 test/data/icalendar/import-rrule-count-daily-short.diary-american delete mode 100644 test/data/icalendar/import-rrule-count-daily-short.diary-european delete mode 100644 test/data/icalendar/import-rrule-count-daily-short.diary-iso delete mode 100644 test/data/icalendar/import-rrule-count-daily-short.ics delete mode 100644 test/data/icalendar/import-rrule-count-every-second-month.diary-american delete mode 100644 test/data/icalendar/import-rrule-count-every-second-month.diary-european delete mode 100644 test/data/icalendar/import-rrule-count-every-second-month.diary-iso delete mode 100644 test/data/icalendar/import-rrule-count-every-second-month.ics delete mode 100644 test/data/icalendar/import-rrule-count-every-second-year.diary-american delete mode 100644 test/data/icalendar/import-rrule-count-every-second-year.diary-european delete mode 100644 test/data/icalendar/import-rrule-count-every-second-year.diary-iso delete mode 100644 test/data/icalendar/import-rrule-count-every-second-year.ics delete mode 100644 test/data/icalendar/import-rrule-count-monthly.diary-american delete mode 100644 test/data/icalendar/import-rrule-count-monthly.diary-european delete mode 100644 test/data/icalendar/import-rrule-count-monthly.diary-iso delete mode 100644 test/data/icalendar/import-rrule-count-monthly.ics delete mode 100644 test/data/icalendar/import-rrule-count-yearly.diary-american delete mode 100644 test/data/icalendar/import-rrule-count-yearly.diary-european delete mode 100644 test/data/icalendar/import-rrule-count-yearly.diary-iso delete mode 100644 test/data/icalendar/import-rrule-count-yearly.ics delete mode 100644 test/data/icalendar/import-rrule-daily-two-day.diary-american delete mode 100644 test/data/icalendar/import-rrule-daily-two-day.diary-european delete mode 100644 test/data/icalendar/import-rrule-daily-two-day.diary-iso delete mode 100644 test/data/icalendar/import-rrule-daily-two-day.ics delete mode 100644 test/data/icalendar/import-rrule-daily-with-exceptions.diary-american delete mode 100644 test/data/icalendar/import-rrule-daily-with-exceptions.diary-european delete mode 100644 test/data/icalendar/import-rrule-daily-with-exceptions.diary-iso delete mode 100644 test/data/icalendar/import-rrule-daily-with-exceptions.ics delete mode 100644 test/data/icalendar/import-rrule-daily.diary-american delete mode 100644 test/data/icalendar/import-rrule-daily.diary-european delete mode 100644 test/data/icalendar/import-rrule-daily.diary-iso delete mode 100644 test/data/icalendar/import-rrule-daily.ics delete mode 100644 test/data/icalendar/import-rrule-monthly-no-end.diary-american delete mode 100644 test/data/icalendar/import-rrule-monthly-no-end.diary-european delete mode 100644 test/data/icalendar/import-rrule-monthly-no-end.diary-iso delete mode 100644 test/data/icalendar/import-rrule-monthly-no-end.ics delete mode 100644 test/data/icalendar/import-rrule-monthly-with-end.diary-american delete mode 100644 test/data/icalendar/import-rrule-monthly-with-end.diary-european delete mode 100644 test/data/icalendar/import-rrule-monthly-with-end.diary-iso delete mode 100644 test/data/icalendar/import-rrule-monthly-with-end.ics delete mode 100644 test/data/icalendar/import-rrule-weekly.diary-american delete mode 100644 test/data/icalendar/import-rrule-weekly.diary-european delete mode 100644 test/data/icalendar/import-rrule-weekly.diary-iso delete mode 100644 test/data/icalendar/import-rrule-weekly.ics delete mode 100644 test/data/icalendar/import-rrule-yearly.diary-american delete mode 100644 test/data/icalendar/import-rrule-yearly.diary-european delete mode 100644 test/data/icalendar/import-rrule-yearly.diary-iso delete mode 100644 test/data/icalendar/import-rrule-yearly.ics delete mode 100644 test/data/icalendar/import-with-timezone.diary-iso delete mode 100644 test/data/icalendar/import-with-timezone.ics delete mode 100644 test/data/icalendar/import-with-uid.diary-american delete mode 100644 test/data/icalendar/import-with-uid.diary-european delete mode 100644 test/data/icalendar/import-with-uid.diary-iso delete mode 100644 test/data/icalendar/import-with-uid.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-11473.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-11473.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-22092.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-22092.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-22092.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-22092.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-24199.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-24199.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-24199.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-24199.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-33277.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-33277.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-33277.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-33277.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-6766.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-6766.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-6766.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-bug-6766.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-duration-2.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-duration-2.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-duration-2.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-duration-2.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-duration.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-duration.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-duration.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-duration.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-1.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-block.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-no-dst.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-no-dst.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-real-world-no-dst.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-anniversary.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-daily.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-weekly.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-rrule-yearly.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-with-timezone.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-with-timezone.ics create mode 100644 test/lisp/calendar/icalendar-resources/import-with-uid.diary-american create mode 100644 test/lisp/calendar/icalendar-resources/import-with-uid.diary-european create mode 100644 test/lisp/calendar/icalendar-resources/import-with-uid.diary-iso create mode 100644 test/lisp/calendar/icalendar-resources/import-with-uid.ics diff --git a/test/data/icalendar/import-bug-11473.diary-european b/test/data/icalendar/import-bug-11473.diary-european deleted file mode 100644 index 97348ae0498..00000000000 --- a/test/data/icalendar/import-bug-11473.diary-european +++ /dev/null @@ -1,10 +0,0 @@ -&15/5/2012 15:00-15:30 Query - Desc: - Whassup? - - - Location: phone - Organizer: MAILTO:a.luser@foo.com - Status: CONFIRMED - Class: PUBLIC - UID: 040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000010000000575268034ECDB649A15349B1BF240F15 diff --git a/test/data/icalendar/import-bug-11473.ics b/test/data/icalendar/import-bug-11473.ics deleted file mode 100644 index bc3a6c69fb7..00000000000 --- a/test/data/icalendar/import-bug-11473.ics +++ /dev/null @@ -1,54 +0,0 @@ -BEGIN:VCALENDAR -METHOD:REQUEST -PRODID:Microsoft Exchange Server 2007 -VERSION:2.0 -BEGIN:VTIMEZONE -TZID:(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna -BEGIN:STANDARD -DTSTART:16010101T030000 -TZOFFSETFROM:+0200 -TZOFFSETTO:+0100 -RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10 -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:16010101T020000 -TZOFFSETFROM:+0100 -TZOFFSETTO:+0200 -RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3 -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -ORGANIZER;CN="A. Luser":MAILTO:a.luser@foo.com -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Luser, Oth - er":MAILTO:other.luser@foo.com -DESCRIPTION;LANGUAGE=en-US:\nWhassup?\n\n -SUMMARY;LANGUAGE=en-US:Query -DTSTART;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna" - :20120515T150000 -DTEND;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna":2 - 0120515T153000 -UID:040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000 - 010000000575268034ECDB649A15349B1BF240F15 -RECURRENCE-ID;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, V - ienna":20120515T170000 -CLASS:PUBLIC -PRIORITY:5 -DTSTAMP:20120514T153645Z -TRANSP:OPAQUE -STATUS:CONFIRMED -SEQUENCE:15 -LOCATION;LANGUAGE=en-US:phone -X-MICROSOFT-CDO-APPT-SEQUENCE:15 -X-MICROSOFT-CDO-OWNERAPPTID:1907632092 -X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE -X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY -X-MICROSOFT-CDO-ALLDAYEVENT:FALSE -X-MICROSOFT-CDO-IMPORTANCE:1 -X-MICROSOFT-CDO-INSTTYPE:3 -BEGIN:VALARM -ACTION:DISPLAY -DESCRIPTION:REMINDER -TRIGGER;RELATED=START:-PT15M -END:VALARM -END:VEVENT -END:VCALENDAR \ No newline at end of file diff --git a/test/data/icalendar/import-bug-22092.diary-american b/test/data/icalendar/import-bug-22092.diary-american deleted file mode 100644 index 392345fe0a2..00000000000 --- a/test/data/icalendar/import-bug-22092.diary-american +++ /dev/null @@ -1,6 +0,0 @@ -&12/8/2014 18:30-22:55 Norwegian til Tromsoe-Langnes - - Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 - Location: Stavanger-Sola - Organizer: noreply@norwegian.no - Class: PUBLIC - UID: RFCALITEM1 diff --git a/test/data/icalendar/import-bug-22092.diary-european b/test/data/icalendar/import-bug-22092.diary-european deleted file mode 100644 index 6a64cf6a8e9..00000000000 --- a/test/data/icalendar/import-bug-22092.diary-european +++ /dev/null @@ -1,6 +0,0 @@ -&8/12/2014 18:30-22:55 Norwegian til Tromsoe-Langnes - - Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 - Location: Stavanger-Sola - Organizer: noreply@norwegian.no - Class: PUBLIC - UID: RFCALITEM1 diff --git a/test/data/icalendar/import-bug-22092.diary-iso b/test/data/icalendar/import-bug-22092.diary-iso deleted file mode 100644 index e0fadbf94dc..00000000000 --- a/test/data/icalendar/import-bug-22092.diary-iso +++ /dev/null @@ -1,6 +0,0 @@ -&2014/12/8 18:30-22:55 Norwegian til Tromsoe-Langnes - - Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 - Location: Stavanger-Sola - Organizer: noreply@norwegian.no - Class: PUBLIC - UID: RFCALITEM1 diff --git a/test/data/icalendar/import-bug-22092.ics b/test/data/icalendar/import-bug-22092.ics deleted file mode 100644 index 4a4c679da9c..00000000000 --- a/test/data/icalendar/import-bug-22092.ics +++ /dev/null @@ -1,30 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//www.norwegian.no//iCalendar MIMEDIR//EN -VERSION:2.0 -METHOD:REQUEST -BEGIN:VEVENT -UID:RFCALITEM1 -SEQUENCE:1512040950 -DTSTAMP:20141204T095043Z -ORGANIZER:noreply@norwegian.no -DTSTART:20141208T173000Z - -DTEND:20141208T215500Z - -LOCATION:Stavanger-Sola - -DESCRIPTION:Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 - -X-ALT-DESC;FMTTYPE=text/html:Reisereferanse

-SUMMARY:Norwegian til Tromsoe-Langnes - - -CATEGORIES:Appointment - - -PRIORITY:5 - -CLASS:PUBLIC - -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR diff --git a/test/data/icalendar/import-bug-24199.diary-american b/test/data/icalendar/import-bug-24199.diary-american deleted file mode 100644 index b3308f1fcfa..00000000000 --- a/test/data/icalendar/import-bug-24199.diary-american +++ /dev/null @@ -1,5 +0,0 @@ -&%%(and (not (diary-date 1 6 2016)) (not (diary-date 2 3 2016)) (not (diary-date 3 2 2016)) (not (diary-date 5 4 2016)) (not (diary-date 6 1 2016)) (diary-float t 3 1) (diary-block 12 2 2015 1 1 9999)) 12:46-16:00 Summary - Desc: Desc - Location: Loc - Class: DEFAULT - UID: 9188710a-08a7-4061-bae3-d4cf4972599a diff --git a/test/data/icalendar/import-bug-24199.diary-european b/test/data/icalendar/import-bug-24199.diary-european deleted file mode 100644 index acba714b527..00000000000 --- a/test/data/icalendar/import-bug-24199.diary-european +++ /dev/null @@ -1,5 +0,0 @@ -&%%(and (not (diary-date 6 1 2016)) (not (diary-date 3 2 2016)) (not (diary-date 2 3 2016)) (not (diary-date 4 5 2016)) (not (diary-date 1 6 2016)) (diary-float t 3 1) (diary-block 2 12 2015 1 1 9999)) 12:46-16:00 Summary - Desc: Desc - Location: Loc - Class: DEFAULT - UID: 9188710a-08a7-4061-bae3-d4cf4972599a diff --git a/test/data/icalendar/import-bug-24199.diary-iso b/test/data/icalendar/import-bug-24199.diary-iso deleted file mode 100644 index 2c18395dea8..00000000000 --- a/test/data/icalendar/import-bug-24199.diary-iso +++ /dev/null @@ -1,5 +0,0 @@ -&%%(and (not (diary-date 2016 1 6)) (not (diary-date 2016 2 3)) (not (diary-date 2016 3 2)) (not (diary-date 2016 5 4)) (not (diary-date 2016 6 1)) (diary-float t 3 1) (diary-block 2015 12 2 9999 1 1)) 12:46-16:00 Summary - Desc: Desc - Location: Loc - Class: DEFAULT - UID: 9188710a-08a7-4061-bae3-d4cf4972599a diff --git a/test/data/icalendar/import-bug-24199.ics b/test/data/icalendar/import-bug-24199.ics deleted file mode 100644 index a307c2da3ca..00000000000 --- a/test/data/icalendar/import-bug-24199.ics +++ /dev/null @@ -1,25 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:Summary -DESCRIPTION:Desc -LOCATION:Loc -DTSTART:20151202T124600 -DTEND:20151202T160000 -RRULE:FREQ=MONTHLY;BYDAY=1WE;INTERVAL=1 -EXDATE:20160106T114600Z -EXDATE:20160203T114600Z -EXDATE:20160302T114600Z -EXDATE:20160504T104600Z -EXDATE:20160601T104600Z -CLASS:DEFAULT -TRANSP:OPAQUE -BEGIN:VALARM -ACTION:DISPLAY -TRIGGER;VALUE=DURATION:-PT3H -END:VALARM -LAST-MODIFIED:20160805T191040Z -UID:9188710a-08a7-4061-bae3-d4cf4972599a -END:VEVENT -END:VCALENDAR diff --git a/test/data/icalendar/import-bug-33277.diary-american b/test/data/icalendar/import-bug-33277.diary-american deleted file mode 100644 index c546fa9a97c..00000000000 --- a/test/data/icalendar/import-bug-33277.diary-american +++ /dev/null @@ -1 +0,0 @@ -&11/5/2018 21:00 event with same start/end time diff --git a/test/data/icalendar/import-bug-33277.diary-european b/test/data/icalendar/import-bug-33277.diary-european deleted file mode 100644 index 28e53960536..00000000000 --- a/test/data/icalendar/import-bug-33277.diary-european +++ /dev/null @@ -1 +0,0 @@ -&5/11/2018 21:00 event with same start/end time diff --git a/test/data/icalendar/import-bug-33277.diary-iso b/test/data/icalendar/import-bug-33277.diary-iso deleted file mode 100644 index faa7aeafeb5..00000000000 --- a/test/data/icalendar/import-bug-33277.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&2018/11/5 21:00 event with same start/end time diff --git a/test/data/icalendar/import-bug-33277.ics b/test/data/icalendar/import-bug-33277.ics deleted file mode 100644 index a4122a28007..00000000000 --- a/test/data/icalendar/import-bug-33277.ics +++ /dev/null @@ -1,15 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -DTSTART:20181105T200000Z -DTSTAMP:20181105T181652Z -DESCRIPTION: -LAST-MODIFIED:20181105T181646Z -LOCATION: -SEQUENCE:0 -SUMMARY:event with same start/end time -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-bug-6766.diary-american b/test/data/icalendar/import-bug-6766.diary-american deleted file mode 100644 index 30deea9911a..00000000000 --- a/test/data/icalendar/import-bug-6766.diary-american +++ /dev/null @@ -1,7 +0,0 @@ -&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum - Status: CONFIRMED - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1262 -&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1263 diff --git a/test/data/icalendar/import-bug-6766.diary-european b/test/data/icalendar/import-bug-6766.diary-european deleted file mode 100644 index ba16c02305a..00000000000 --- a/test/data/icalendar/import-bug-6766.diary-european +++ /dev/null @@ -1,7 +0,0 @@ -&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum - Status: CONFIRMED - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1262 -&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1263 diff --git a/test/data/icalendar/import-bug-6766.diary-iso b/test/data/icalendar/import-bug-6766.diary-iso deleted file mode 100644 index 7794e586f37..00000000000 --- a/test/data/icalendar/import-bug-6766.diary-iso +++ /dev/null @@ -1,7 +0,0 @@ -&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 2010 4 21)) 11:30-12:00 Scrum - Status: CONFIRMED - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1262 -&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking - Class: PUBLIC - UID: 8814e3f9-7482-408f-996c-3bfe486a1263 diff --git a/test/data/icalendar/import-bug-6766.ics b/test/data/icalendar/import-bug-6766.ics deleted file mode 100644 index 451391be025..00000000000 --- a/test/data/icalendar/import-bug-6766.ics +++ /dev/null @@ -1,28 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -CLASS:PUBLIC -DTEND;TZID=America/New_York:20100421T120000 -DTSTAMP:20100525T141214Z -DTSTART;TZID=America/New_York:20100421T113000 -RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,TH,FR -SEQUENCE:1 -STATUS:CONFIRMED -SUMMARY:Scrum -TRANSP:OPAQUE -UID:8814e3f9-7482-408f-996c-3bfe486a1262 -END:VEVENT -BEGIN:VEVENT -CLASS:PUBLIC -DTSTAMP:20100525T141214Z -DTSTART;VALUE=DATE:20100422 -DTEND;VALUE=DATE:20100423 -RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,TH -SEQUENCE:1 -SUMMARY:Tues + Thurs thinking -TRANSP:OPAQUE -UID:8814e3f9-7482-408f-996c-3bfe486a1263 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-duration-2.diary-american b/test/data/icalendar/import-duration-2.diary-american deleted file mode 100644 index 56f41d6ad9e..00000000000 --- a/test/data/icalendar/import-duration-2.diary-american +++ /dev/null @@ -1,3 +0,0 @@ -&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub - Class: PUBLIC - UID: 20041127T183329Z-18215-1001-4536-49109@andromeda diff --git a/test/data/icalendar/import-duration-2.diary-european b/test/data/icalendar/import-duration-2.diary-european deleted file mode 100644 index 999102ab6b4..00000000000 --- a/test/data/icalendar/import-duration-2.diary-european +++ /dev/null @@ -1,3 +0,0 @@ -&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub - Class: PUBLIC - UID: 20041127T183329Z-18215-1001-4536-49109@andromeda diff --git a/test/data/icalendar/import-duration-2.diary-iso b/test/data/icalendar/import-duration-2.diary-iso deleted file mode 100644 index 393937e6cd9..00000000000 --- a/test/data/icalendar/import-duration-2.diary-iso +++ /dev/null @@ -1,3 +0,0 @@ -&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub - Class: PUBLIC - UID: 20041127T183329Z-18215-1001-4536-49109@andromeda diff --git a/test/data/icalendar/import-duration-2.ics b/test/data/icalendar/import-duration-2.ics deleted file mode 100644 index eb8a03ba36f..00000000000 --- a/test/data/icalendar/import-duration-2.ics +++ /dev/null @@ -1,17 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -UID:20041127T183329Z-18215-1001-4536-49109@andromeda -DTSTAMP:20041127T183315Z -LAST-MODIFIED:20041127T183329 -SUMMARY:Urlaub -DTSTART;VALUE=DATE:20011221 -DTEND;VALUE=DATE:20011221 -RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU -CLASS:PUBLIC -SEQUENCE:1 -CREATED:20041127T183329 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-duration.diary-american b/test/data/icalendar/import-duration.diary-american deleted file mode 100644 index 268736a8cd0..00000000000 --- a/test/data/icalendar/import-duration.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-block 2 17 2005 2 23 2005)) duration diff --git a/test/data/icalendar/import-duration.diary-european b/test/data/icalendar/import-duration.diary-european deleted file mode 100644 index 7d852ddcd3c..00000000000 --- a/test/data/icalendar/import-duration.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-block 17 2 2005 23 2 2005)) duration diff --git a/test/data/icalendar/import-duration.diary-iso b/test/data/icalendar/import-duration.diary-iso deleted file mode 100644 index 5d3a714284e..00000000000 --- a/test/data/icalendar/import-duration.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-block 2005 2 17 2005 2 23)) duration diff --git a/test/data/icalendar/import-duration.ics b/test/data/icalendar/import-duration.ics deleted file mode 100644 index 67f5c73571b..00000000000 --- a/test/data/icalendar/import-duration.ics +++ /dev/null @@ -1,10 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -DTSTART;VALUE=DATE:20050217 -SUMMARY:duration -DURATION:P7D -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-multiple-vcalendars.diary-american b/test/data/icalendar/import-multiple-vcalendars.diary-american deleted file mode 100644 index d1b1992a022..00000000000 --- a/test/data/icalendar/import-multiple-vcalendars.diary-american +++ /dev/null @@ -1,4 +0,0 @@ -&7/23/2011 event-1 -&7/24/2011 event-2 -&7/25/2011 event-3a -&7/25/2011 event-3b diff --git a/test/data/icalendar/import-multiple-vcalendars.diary-european b/test/data/icalendar/import-multiple-vcalendars.diary-european deleted file mode 100644 index f068354220c..00000000000 --- a/test/data/icalendar/import-multiple-vcalendars.diary-european +++ /dev/null @@ -1,4 +0,0 @@ -&23/7/2011 event-1 -&24/7/2011 event-2 -&25/7/2011 event-3a -&25/7/2011 event-3b diff --git a/test/data/icalendar/import-multiple-vcalendars.diary-iso b/test/data/icalendar/import-multiple-vcalendars.diary-iso deleted file mode 100644 index 5685e4708a7..00000000000 --- a/test/data/icalendar/import-multiple-vcalendars.diary-iso +++ /dev/null @@ -1,4 +0,0 @@ -&2011/7/23 event-1 -&2011/7/24 event-2 -&2011/7/25 event-3a -&2011/7/25 event-3b diff --git a/test/data/icalendar/import-multiple-vcalendars.ics b/test/data/icalendar/import-multiple-vcalendars.ics deleted file mode 100644 index 69a02c09b1b..00000000000 --- a/test/data/icalendar/import-multiple-vcalendars.ics +++ /dev/null @@ -1,21 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -DTSTART;VALUE=DATE:20110723 -SUMMARY:event-1 -END:VEVENT -BEGIN:VEVENT -DTSTART;VALUE=DATE:20110724 -SUMMARY:event-2 -END:VEVENT -BEGIN:VEVENT -DTSTART;VALUE=DATE:20110725 -SUMMARY:event-3a -END:VEVENT -BEGIN:VEVENT -DTSTART;VALUE=DATE:20110725 -SUMMARY:event-3b -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-non-recurring-1.diary-american b/test/data/icalendar/import-non-recurring-1.diary-american deleted file mode 100644 index 780e3a8ce64..00000000000 --- a/test/data/icalendar/import-non-recurring-1.diary-american +++ /dev/null @@ -1 +0,0 @@ -&9/19/2003 09:00-11:30 non-recurring diff --git a/test/data/icalendar/import-non-recurring-1.diary-european b/test/data/icalendar/import-non-recurring-1.diary-european deleted file mode 100644 index 7e0cd21b784..00000000000 --- a/test/data/icalendar/import-non-recurring-1.diary-european +++ /dev/null @@ -1 +0,0 @@ -&19/9/2003 09:00-11:30 non-recurring diff --git a/test/data/icalendar/import-non-recurring-1.diary-iso b/test/data/icalendar/import-non-recurring-1.diary-iso deleted file mode 100644 index c7311286619..00000000000 --- a/test/data/icalendar/import-non-recurring-1.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&2003/9/19 09:00-11:30 non-recurring diff --git a/test/data/icalendar/import-non-recurring-1.ics b/test/data/icalendar/import-non-recurring-1.ics deleted file mode 100644 index cd471efc861..00000000000 --- a/test/data/icalendar/import-non-recurring-1.ics +++ /dev/null @@ -1,10 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:non-recurring -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-non-recurring-all-day.diary-american b/test/data/icalendar/import-non-recurring-all-day.diary-american deleted file mode 100644 index 1d4bb6a337e..00000000000 --- a/test/data/icalendar/import-non-recurring-all-day.diary-american +++ /dev/null @@ -1 +0,0 @@ -&9/19/2003 non-recurring allday diff --git a/test/data/icalendar/import-non-recurring-all-day.diary-european b/test/data/icalendar/import-non-recurring-all-day.diary-european deleted file mode 100644 index b56c7f4e17f..00000000000 --- a/test/data/icalendar/import-non-recurring-all-day.diary-european +++ /dev/null @@ -1 +0,0 @@ -&19/9/2003 non-recurring allday diff --git a/test/data/icalendar/import-non-recurring-all-day.diary-iso b/test/data/icalendar/import-non-recurring-all-day.diary-iso deleted file mode 100644 index f1c70ab34c3..00000000000 --- a/test/data/icalendar/import-non-recurring-all-day.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&2003/9/19 non-recurring allday diff --git a/test/data/icalendar/import-non-recurring-all-day.ics b/test/data/icalendar/import-non-recurring-all-day.ics deleted file mode 100644 index 4efa8ffa133..00000000000 --- a/test/data/icalendar/import-non-recurring-all-day.ics +++ /dev/null @@ -1,9 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:non-recurring allday -DTSTART;VALUE=DATE-TIME:20030919 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-non-recurring-another-example.diary-american b/test/data/icalendar/import-non-recurring-another-example.diary-american deleted file mode 100644 index 2eb8c0ab686..00000000000 --- a/test/data/icalendar/import-non-recurring-another-example.diary-american +++ /dev/null @@ -1,4 +0,0 @@ -&11/23/2004 14:45-15:45 another example - Status: TENTATIVE - Class: PRIVATE - UID: 6161a312-3902-11d9-b512-f764153bb28b diff --git a/test/data/icalendar/import-non-recurring-another-example.diary-european b/test/data/icalendar/import-non-recurring-another-example.diary-european deleted file mode 100644 index 394eae8bb77..00000000000 --- a/test/data/icalendar/import-non-recurring-another-example.diary-european +++ /dev/null @@ -1,4 +0,0 @@ -&23/11/2004 14:45-15:45 another example - Status: TENTATIVE - Class: PRIVATE - UID: 6161a312-3902-11d9-b512-f764153bb28b diff --git a/test/data/icalendar/import-non-recurring-another-example.diary-iso b/test/data/icalendar/import-non-recurring-another-example.diary-iso deleted file mode 100644 index 5e8bdf417d5..00000000000 --- a/test/data/icalendar/import-non-recurring-another-example.diary-iso +++ /dev/null @@ -1,4 +0,0 @@ -&2004/11/23 14:45-15:45 another example - Status: TENTATIVE - Class: PRIVATE - UID: 6161a312-3902-11d9-b512-f764153bb28b diff --git a/test/data/icalendar/import-non-recurring-another-example.ics b/test/data/icalendar/import-non-recurring-another-example.ics deleted file mode 100644 index b145e418791..00000000000 --- a/test/data/icalendar/import-non-recurring-another-example.ics +++ /dev/null @@ -1,23 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -UID - :6161a312-3902-11d9-b512-f764153bb28b -SUMMARY - :another example -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - :20041123T144500 -DTEND - :20041123T154500 -DTSTAMP - :20041118T013641Z -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-non-recurring-block.diary-american b/test/data/icalendar/import-non-recurring-block.diary-american deleted file mode 100644 index b22234229cf..00000000000 --- a/test/data/icalendar/import-non-recurring-block.diary-american +++ /dev/null @@ -1,4 +0,0 @@ -&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien - Status: TENTATIVE - Class: PRIVATE - UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 diff --git a/test/data/icalendar/import-non-recurring-block.diary-european b/test/data/icalendar/import-non-recurring-block.diary-european deleted file mode 100644 index 8043482442f..00000000000 --- a/test/data/icalendar/import-non-recurring-block.diary-european +++ /dev/null @@ -1,4 +0,0 @@ -&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien - Status: TENTATIVE - Class: PRIVATE - UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 diff --git a/test/data/icalendar/import-non-recurring-block.diary-iso b/test/data/icalendar/import-non-recurring-block.diary-iso deleted file mode 100644 index e0f1896114f..00000000000 --- a/test/data/icalendar/import-non-recurring-block.diary-iso +++ /dev/null @@ -1,4 +0,0 @@ -&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien - Status: TENTATIVE - Class: PRIVATE - UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 diff --git a/test/data/icalendar/import-non-recurring-block.ics b/test/data/icalendar/import-non-recurring-block.ics deleted file mode 100644 index 0c52ba3d66a..00000000000 --- a/test/data/icalendar/import-non-recurring-block.ics +++ /dev/null @@ -1,16 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61 -SUMMARY:Sommerferien -STATUS:TENTATIVE -CLASS:PRIVATE -X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten -X-MOZILLA-RECUR-DEFAULT-INTERVAL:0 -DTSTART;VALUE=DATE:20040719 -DTEND;VALUE=DATE:20040828 -DTSTAMP:20031103T011641Z -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-non-recurring-folded-summary.diary-american b/test/data/icalendar/import-non-recurring-folded-summary.diary-american deleted file mode 100644 index 2954d0c4fd1..00000000000 --- a/test/data/icalendar/import-non-recurring-folded-summary.diary-american +++ /dev/null @@ -1,4 +0,0 @@ -&11/23/2004 14:00-14:30 folded summary - Status: TENTATIVE - Class: PRIVATE - UID: 04979712-3902-11d9-93dd-8f9f4afe08da diff --git a/test/data/icalendar/import-non-recurring-folded-summary.diary-european b/test/data/icalendar/import-non-recurring-folded-summary.diary-european deleted file mode 100644 index 7745fc811b4..00000000000 --- a/test/data/icalendar/import-non-recurring-folded-summary.diary-european +++ /dev/null @@ -1,4 +0,0 @@ -&23/11/2004 14:00-14:30 folded summary - Status: TENTATIVE - Class: PRIVATE - UID: 04979712-3902-11d9-93dd-8f9f4afe08da diff --git a/test/data/icalendar/import-non-recurring-folded-summary.diary-iso b/test/data/icalendar/import-non-recurring-folded-summary.diary-iso deleted file mode 100644 index 8c19a95ed2d..00000000000 --- a/test/data/icalendar/import-non-recurring-folded-summary.diary-iso +++ /dev/null @@ -1,4 +0,0 @@ -&2004/11/23 14:00-14:30 folded summary - Status: TENTATIVE - Class: PRIVATE - UID: 04979712-3902-11d9-93dd-8f9f4afe08da diff --git a/test/data/icalendar/import-non-recurring-folded-summary.ics b/test/data/icalendar/import-non-recurring-folded-summary.ics deleted file mode 100644 index e3ecee9dae8..00000000000 --- a/test/data/icalendar/import-non-recurring-folded-summary.ics +++ /dev/null @@ -1,25 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -UID - :04979712-3902-11d9-93dd-8f9f4afe08da -SUMMARY - :folded summary -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - :20041123T140000 -DTEND - :20041123T143000 -DTSTAMP - :20041118T013430Z -LAST-MODIFIED - :20041118T013640Z -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-non-recurring-long-summary.diary-american b/test/data/icalendar/import-non-recurring-long-summary.diary-american deleted file mode 100644 index 84cd464c568..00000000000 --- a/test/data/icalendar/import-non-recurring-long-summary.diary-american +++ /dev/null @@ -1 +0,0 @@ -&9/19/2003 long summary diff --git a/test/data/icalendar/import-non-recurring-long-summary.diary-european b/test/data/icalendar/import-non-recurring-long-summary.diary-european deleted file mode 100644 index 5d6524202c3..00000000000 --- a/test/data/icalendar/import-non-recurring-long-summary.diary-european +++ /dev/null @@ -1 +0,0 @@ -&19/9/2003 long summary diff --git a/test/data/icalendar/import-non-recurring-long-summary.diary-iso b/test/data/icalendar/import-non-recurring-long-summary.diary-iso deleted file mode 100644 index d2300522d9a..00000000000 --- a/test/data/icalendar/import-non-recurring-long-summary.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&2003/9/19 long summary diff --git a/test/data/icalendar/import-non-recurring-long-summary.ics b/test/data/icalendar/import-non-recurring-long-summary.ics deleted file mode 100644 index 39ae02f10ca..00000000000 --- a/test/data/icalendar/import-non-recurring-long-summary.ics +++ /dev/null @@ -1,10 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:long - summary -DTSTART;VALUE=DATE:20030919 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-real-world-2003-05-29.diary-american b/test/data/icalendar/import-real-world-2003-05-29.diary-american deleted file mode 100644 index e6c8712d254..00000000000 --- a/test/data/icalendar/import-real-world-2003-05-29.diary-american +++ /dev/null @@ -1,6 +0,0 @@ -&5/9/2003 07:00-12:00 On-Site Interview - Desc: 10:30am - Blah - Location: Cccc - Organizer: MAILTO:aaaaaaa@aaaaaaa.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9 diff --git a/test/data/icalendar/import-real-world-2003-05-29.diary-european b/test/data/icalendar/import-real-world-2003-05-29.diary-european deleted file mode 100644 index cecca070a51..00000000000 --- a/test/data/icalendar/import-real-world-2003-05-29.diary-european +++ /dev/null @@ -1,6 +0,0 @@ -&9/5/2003 07:00-12:00 On-Site Interview - Desc: 10:30am - Blah - Location: Cccc - Organizer: MAILTO:aaaaaaa@aaaaaaa.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9 diff --git a/test/data/icalendar/import-real-world-2003-05-29.ics b/test/data/icalendar/import-real-world-2003-05-29.ics deleted file mode 100644 index decc8df5451..00000000000 --- a/test/data/icalendar/import-real-world-2003-05-29.ics +++ /dev/null @@ -1,54 +0,0 @@ -BEGIN:VCALENDAR -METHOD:REQUEST -PRODID:Microsoft CDO for Microsoft Exchange -VERSION:2.0 -BEGIN:VTIMEZONE -TZID:Kolkata, Chennai, Mumbai, New Delhi -X-MICROSOFT-CDO-TZID:23 -BEGIN:STANDARD -DTSTART:16010101T000000 -TZOFFSETFROM:+0530 -TZOFFSETTO:+0530 -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:16010101T000000 -TZOFFSETFROM:+0530 -TZOFFSETTO:+0530 -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -DTSTAMP:20030509T043439Z -DTSTART;TZID="Kolkata, Chennai, Mumbai, New Delhi":20030509T103000 -SUMMARY:On-Site Interview -UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000 - 010000000DB823520692542408ED02D7023F9DFF9 -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Xxxxx - xxx Xxxxxxxxxxxx":MAILTO:xxxxxxxx@xxxxxxx.com -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Yyyyyyy Y - yyyy":MAILTO:yyyyyyy@yyyyyyy.com -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Zzzz Zzzz - zz":MAILTO:zzzzzz@zzzzzzz.com -ORGANIZER;CN="Aaaaaa Aaaaa":MAILTO:aaaaaaa@aaaaaaa.com -LOCATION:Cccc -DTEND;TZID="Kolkata, Chennai, Mumbai, New Delhi":20030509T153000 -DESCRIPTION:10:30am - Blah -SEQUENCE:0 -PRIORITY:5 -CLASS: -CREATED:20030509T043439Z -LAST-MODIFIED:20030509T043459Z -STATUS:CONFIRMED -TRANSP:OPAQUE -X-MICROSOFT-CDO-BUSYSTATUS:BUSY -X-MICROSOFT-CDO-INSTTYPE:0 -X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY -X-MICROSOFT-CDO-ALLDAYEVENT:FALSE -X-MICROSOFT-CDO-IMPORTANCE:1 -X-MICROSOFT-CDO-OWNERAPPTID:126441427 -BEGIN:VALARM -ACTION:DISPLAY -DESCRIPTION:REMINDER -TRIGGER;RELATED=START:-PT00H15M00S -END:VALARM -END:VEVENT -END:VCALENDAR diff --git a/test/data/icalendar/import-real-world-2003-06-18a.diary-american b/test/data/icalendar/import-real-world-2003-06-18a.diary-american deleted file mode 100644 index f2c914184e7..00000000000 --- a/test/data/icalendar/import-real-world-2003-06-18a.diary-american +++ /dev/null @@ -1,6 +0,0 @@ -&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX - Desc: 753 Zeichen hier radiert - Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) - Organizer: MAILTO:xxx@xxxxx.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/data/icalendar/import-real-world-2003-06-18a.diary-european b/test/data/icalendar/import-real-world-2003-06-18a.diary-european deleted file mode 100644 index 89cff58af42..00000000000 --- a/test/data/icalendar/import-real-world-2003-06-18a.diary-european +++ /dev/null @@ -1,6 +0,0 @@ -&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX - Desc: 753 Zeichen hier radiert - Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) - Organizer: MAILTO:xxx@xxxxx.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/data/icalendar/import-real-world-2003-06-18a.ics b/test/data/icalendar/import-real-world-2003-06-18a.ics deleted file mode 100644 index 6bb5b05af17..00000000000 --- a/test/data/icalendar/import-real-world-2003-06-18a.ics +++ /dev/null @@ -1,36 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -DTSTAMP:20030618T195512Z -DTSTART;TZID="Mountain Time (US & Canada)":20030623T110000 -SUMMARY:Dress Rehearsal for XXXX-XXXX -UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000 - 0100000007C3A6D65EE726E40B7F3D69A23BD567E -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="AAAAA,AAA - AA (A-AAAAAAA,ex1)":MAILTO:aaaaa_aaaaa@aaaaa.com -ORGANIZER;CN="ABCD,TECHTRAINING - (A-Americas,exgen1)":MAILTO:xxx@xxxxx.com -LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below) -DTEND;TZID="Mountain Time (US & Canada)":20030623T120000 -DESCRIPTION:753 Zeichen hier radiert -SEQUENCE:0 -PRIORITY:5 -CLASS: -CREATED:20030618T195518Z -LAST-MODIFIED:20030618T195527Z -STATUS:CONFIRMED -TRANSP:OPAQUE -X-MICROSOFT-CDO-BUSYSTATUS:BUSY -X-MICROSOFT-CDO-INSTTYPE:0 -X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY -X-MICROSOFT-CDO-ALLDAYEVENT:FALSE -X-MICROSOFT-CDO-IMPORTANCE:1 -X-MICROSOFT-CDO-OWNERAPPTID:1022519251 -BEGIN:VALARM -ACTION:DISPLAY -DESCRIPTION:REMINDER -TRIGGER;RELATED=START:-PT00H15M00S -END:VALARM -END:VEVENT -END:VCALENDAR diff --git a/test/data/icalendar/import-real-world-2003-06-18b.diary-american b/test/data/icalendar/import-real-world-2003-06-18b.diary-american deleted file mode 100644 index 2c0774cdd83..00000000000 --- a/test/data/icalendar/import-real-world-2003-06-18b.diary-american +++ /dev/null @@ -1,6 +0,0 @@ -&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 - Desc: Viele Zeichen standen hier frĂŒher - Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) - Organizer: MAILTO:bbb@bbbbb.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/data/icalendar/import-real-world-2003-06-18b.diary-european b/test/data/icalendar/import-real-world-2003-06-18b.diary-european deleted file mode 100644 index 95aac168699..00000000000 --- a/test/data/icalendar/import-real-world-2003-06-18b.diary-european +++ /dev/null @@ -1,6 +0,0 @@ -&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 - Desc: Viele Zeichen standen hier frĂŒher - Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) - Organizer: MAILTO:bbb@bbbbb.com - Status: CONFIRMED - UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/data/icalendar/import-real-world-2003-06-18b.ics b/test/data/icalendar/import-real-world-2003-06-18b.ics deleted file mode 100644 index 1523135adf3..00000000000 --- a/test/data/icalendar/import-real-world-2003-06-18b.ics +++ /dev/null @@ -1,55 +0,0 @@ -BEGIN:VCALENDAR -METHOD:REQUEST -PRODID:Microsoft CDO for Microsoft Exchange -VERSION:2.0 -BEGIN:VTIMEZONE -TZID:Mountain Time (US & Canada) -X-MICROSOFT-CDO-TZID:12 -BEGIN:STANDARD -DTSTART:16010101T020000 -TZOFFSETFROM:-0600 -TZOFFSETTO:-0700 -RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:16010101T020000 -TZOFFSETFROM:-0700 -TZOFFSETTO:-0600 -RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -DTSTAMP:20030618T230323Z -DTSTART;TZID="Mountain Time (US & Canada)":20030623T090000 -SUMMARY:Updated: Dress Rehearsal for ABC01-15 -UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000 - 0100000007C3A6D65EE726E40B7F3D69A23BD567E -ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20 - 0700Z;RSVP=TRUE;CN="AAAAA,AAAAAA -\(A-AAAAAAA,ex1)":MAILTO:aaaaaa_aaaaa@aaaaa - .com -ORGANIZER;CN="ABCD,TECHTRAINING -\(A-Americas,exgen1)":MAILTO:bbb@bbbbb.com -LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below) -DTEND;TZID="Mountain Time (US & Canada)":20030623T100000 -DESCRIPTION:Viele Zeichen standen hier frĂŒher -SEQUENCE:0 -PRIORITY:5 -CLASS: -CREATED:20030618T230326Z -LAST-MODIFIED:20030618T230335Z -STATUS:CONFIRMED -TRANSP:OPAQUE -X-MICROSOFT-CDO-BUSYSTATUS:BUSY -X-MICROSOFT-CDO-INSTTYPE:0 -X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY -X-MICROSOFT-CDO-ALLDAYEVENT:FALSE -X-MICROSOFT-CDO-IMPORTANCE:1 -X-MICROSOFT-CDO-OWNERAPPTID:1022519251 -BEGIN:VALARM -ACTION:DISPLAY -DESCRIPTION:REMINDER -TRIGGER;RELATED=START:-PT00H15M00S -END:VALARM -END:VEVENT -END:VCALENDAR \ No newline at end of file diff --git a/test/data/icalendar/import-real-world-2004-11-19.diary-american b/test/data/icalendar/import-real-world-2004-11-19.diary-american deleted file mode 100644 index a986f700ba2..00000000000 --- a/test/data/icalendar/import-real-world-2004-11-19.diary-american +++ /dev/null @@ -1,19 +0,0 @@ -&11/23/2004 14:00-14:30 Jjjjj & Wwwww - Status: TENTATIVE - Class: PRIVATE -&11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb - Status: TENTATIVE - Class: PRIVATE -&11/23/2004 11:00-12:00 Hhhhhhhh - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa - Desc: Vvvvv Rrrr aaa Cccccc - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh - Status: TENTATIVE - Class: PRIVATE diff --git a/test/data/icalendar/import-real-world-2004-11-19.diary-european b/test/data/icalendar/import-real-world-2004-11-19.diary-european deleted file mode 100644 index cbfe99eb8e3..00000000000 --- a/test/data/icalendar/import-real-world-2004-11-19.diary-european +++ /dev/null @@ -1,19 +0,0 @@ -&23/11/2004 14:00-14:30 Jjjjj & Wwwww - Status: TENTATIVE - Class: PRIVATE -&23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb - Status: TENTATIVE - Class: PRIVATE -&23/11/2004 11:00-12:00 Hhhhhhhh - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa - Desc: Vvvvv Rrrr aaa Cccccc - Status: TENTATIVE - Class: PRIVATE -&%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh - Status: TENTATIVE - Class: PRIVATE diff --git a/test/data/icalendar/import-real-world-2004-11-19.ics b/test/data/icalendar/import-real-world-2004-11-19.ics deleted file mode 100644 index 9edb682fcad..00000000000 --- a/test/data/icalendar/import-real-world-2004-11-19.ics +++ /dev/null @@ -1,120 +0,0 @@ -BEGIN:VCALENDAR -VERSION - :2.0 -PRODID - :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN -BEGIN:VEVENT -SUMMARY - :Jjjjj & Wwwww -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - :20041123T140000 -DTEND - :20041123T143000 -DTSTAMP - :20041118T013430Z -LAST-MODIFIED - :20041118T013640Z -END:VEVENT -BEGIN:VEVENT -SUMMARY - :BB Aaaaaaaa Bbbbb -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - :20041123T144500 -DTEND - :20041123T154500 -DTSTAMP - :20041118T013641Z -END:VEVENT -BEGIN:VEVENT -SUMMARY - :Hhhhhhhh -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - :20041123T110000 -DTEND - :20041123T120000 -DTSTAMP - :20041118T013831Z -END:VEVENT -BEGIN:VEVENT -SUMMARY - :MMM Aaaaaaaaa -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -X-MOZILLA-RECUR-DEFAULT-INTERVAL - :2 -RRULE - :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR -DTSTART - :20041112T140000 -DTEND - :20041112T183000 -DTSTAMP - :20041118T014117Z -END:VEVENT -BEGIN:VEVENT -SUMMARY - :Rrrr/Cccccc ii Aaaaaaaa -DESCRIPTION - :Vvvvv Rrrr aaa Cccccc -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -DTSTART - ;VALUE=DATE - :20041119 -DTEND - ;VALUE=DATE - :20041120 -DTSTAMP - :20041118T013107Z -LAST-MODIFIED - :20041118T014203Z -END:VEVENT -BEGIN:VEVENT -SUMMARY - :Wwww aa hhhh -STATUS - :TENTATIVE -CLASS - :PRIVATE -X-MOZILLA-ALARM-DEFAULT-LENGTH - :0 -RRULE - :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO -DTSTART - ;VALUE=DATE - :20041101 -DTEND - ;VALUE=DATE - :20041102 -DTSTAMP - :20041118T014045Z -LAST-MODIFIED - :20041118T023846Z -END:VEVENT -END:VCALENDAR diff --git a/test/data/icalendar/import-real-world-2005-02-07.diary-american b/test/data/icalendar/import-real-world-2005-02-07.diary-american deleted file mode 100644 index ce7d835d96b..00000000000 --- a/test/data/icalendar/import-real-world-2005-02-07.diary-american +++ /dev/null @@ -1,5 +0,0 @@ -&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day - Desc: abcdef - Status: CONFIRMED - Class: PRIVATE - UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4 diff --git a/test/data/icalendar/import-real-world-2005-02-07.diary-european b/test/data/icalendar/import-real-world-2005-02-07.diary-european deleted file mode 100644 index 3a52b0ab271..00000000000 --- a/test/data/icalendar/import-real-world-2005-02-07.diary-european +++ /dev/null @@ -1,5 +0,0 @@ -&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day - Desc: abcdef - Status: CONFIRMED - Class: PRIVATE - UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4 diff --git a/test/data/icalendar/import-real-world-2005-02-07.ics b/test/data/icalendar/import-real-world-2005-02-07.ics deleted file mode 100644 index 9eec71fe751..00000000000 --- a/test/data/icalendar/import-real-world-2005-02-07.ics +++ /dev/null @@ -1,26 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -UID - :b60d398e-1dd1-11b2-a159-cf8cb05139f4 -SUMMARY - :Waitangi Day -DESCRIPTION - :abcdef -CATEGORIES - :Public Holiday -STATUS - :CONFIRMED -CLASS - :PRIVATE -DTSTART - ;VALUE=DATE - :20050206 -DTEND - ;VALUE=DATE - :20050207 -DTSTAMP - :20050128T011209Z -END:VEVENT -END:VCALENDAR diff --git a/test/data/icalendar/import-real-world-2005-03-01.diary-american b/test/data/icalendar/import-real-world-2005-03-01.diary-american deleted file mode 100644 index 23c93d45d9a..00000000000 --- a/test/data/icalendar/import-real-world-2005-03-01.diary-american +++ /dev/null @@ -1,2 +0,0 @@ -&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa - UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID diff --git a/test/data/icalendar/import-real-world-2005-03-01.diary-european b/test/data/icalendar/import-real-world-2005-03-01.diary-european deleted file mode 100644 index 106e9f3cdd0..00000000000 --- a/test/data/icalendar/import-real-world-2005-03-01.diary-european +++ /dev/null @@ -1,2 +0,0 @@ -&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa - UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID diff --git a/test/data/icalendar/import-real-world-2005-03-01.ics b/test/data/icalendar/import-real-world-2005-03-01.ics deleted file mode 100644 index ed9faa9b0bd..00000000000 --- a/test/data/icalendar/import-real-world-2005-03-01.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -DTSTART;VALUE=DATE:20050217 -SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa -UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID -DTSTAMP:20050118T210335Z -DURATION:P7D -END:VEVENT -END:VCALENDAR diff --git a/test/data/icalendar/import-real-world-no-dst.diary-american b/test/data/icalendar/import-real-world-no-dst.diary-american deleted file mode 100644 index 290edb88760..00000000000 --- a/test/data/icalendar/import-real-world-no-dst.diary-american +++ /dev/null @@ -1,4 +0,0 @@ -&11/16/2014 04:30-05:30 NoDST - Desc: Test event from timezone without DST - Location: Everywhere - UID: 20141116T171439Z-678877132@marudot.com diff --git a/test/data/icalendar/import-real-world-no-dst.diary-european b/test/data/icalendar/import-real-world-no-dst.diary-european deleted file mode 100644 index c56b7a6547a..00000000000 --- a/test/data/icalendar/import-real-world-no-dst.diary-european +++ /dev/null @@ -1,4 +0,0 @@ -&16/11/2014 04:30-05:30 NoDST - Desc: Test event from timezone without DST - Location: Everywhere - UID: 20141116T171439Z-678877132@marudot.com diff --git a/test/data/icalendar/import-real-world-no-dst.ics b/test/data/icalendar/import-real-world-no-dst.ics deleted file mode 100644 index 5f147af4f37..00000000000 --- a/test/data/icalendar/import-real-world-no-dst.ics +++ /dev/null @@ -1,26 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//www.marudot.com//iCal Event Maker -X-WR-CALNAME:Test -CALSCALE:GREGORIAN -BEGIN:VTIMEZONE -TZID:Asia/Tehran -TZURL:http://tzurl.org/zoneinfo-outlook/Asia/Tehran -X-LIC-LOCATION:Asia/Tehran -BEGIN:STANDARD -TZOFFSETFROM:+0330 -TZOFFSETTO:+0330 -TZNAME:IRST -DTSTART:19700101T000000 -END:STANDARD -END:VTIMEZONE -BEGIN:VEVENT -DTSTAMP:20141116T171439Z -UID:20141116T171439Z-678877132@marudot.com -DTSTART;TZID="Asia/Tehran":20141116T070000 -DTEND;TZID="Asia/Tehran":20141116T080000 -SUMMARY:NoDST -DESCRIPTION:Test event from timezone without DST -LOCATION:Everywhere -END:VEVENT -END:VCALENDAR \ No newline at end of file diff --git a/test/data/icalendar/import-rrule-anniversary.diary-american b/test/data/icalendar/import-rrule-anniversary.diary-american deleted file mode 100644 index 7b86b554dd4..00000000000 --- a/test/data/icalendar/import-rrule-anniversary.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt diff --git a/test/data/icalendar/import-rrule-anniversary.diary-european b/test/data/icalendar/import-rrule-anniversary.diary-european deleted file mode 100644 index 3b82ec09fd5..00000000000 --- a/test/data/icalendar/import-rrule-anniversary.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt diff --git a/test/data/icalendar/import-rrule-anniversary.diary-iso b/test/data/icalendar/import-rrule-anniversary.diary-iso deleted file mode 100644 index 7fc99478d4e..00000000000 --- a/test/data/icalendar/import-rrule-anniversary.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt diff --git a/test/data/icalendar/import-rrule-anniversary.ics b/test/data/icalendar/import-rrule-anniversary.ics deleted file mode 100644 index 2996f494167..00000000000 --- a/test/data/icalendar/import-rrule-anniversary.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -DTSTART;VALUE=DATE:20040815 -DTEND;VALUE=DATE:20040816 -SUMMARY:Maria Himmelfahrt -RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-count-bi-weekly.diary-american b/test/data/icalendar/import-rrule-count-bi-weekly.diary-american deleted file mode 100644 index 84b6d109953..00000000000 --- a/test/data/icalendar/import-rrule-count-bi-weekly.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 14 9 19 2003) (diary-block 9 19 2003 10 31 2003)) 09:00-11:30 rrule count bi-weekly 3 times diff --git a/test/data/icalendar/import-rrule-count-bi-weekly.diary-european b/test/data/icalendar/import-rrule-count-bi-weekly.diary-european deleted file mode 100644 index 0bebdf8872f..00000000000 --- a/test/data/icalendar/import-rrule-count-bi-weekly.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 14 19 9 2003) (diary-block 19 9 2003 31 10 2003)) 09:00-11:30 rrule count bi-weekly 3 times diff --git a/test/data/icalendar/import-rrule-count-bi-weekly.diary-iso b/test/data/icalendar/import-rrule-count-bi-weekly.diary-iso deleted file mode 100644 index 11429081abe..00000000000 --- a/test/data/icalendar/import-rrule-count-bi-weekly.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 14 2003 9 19) (diary-block 2003 9 19 2003 10 31)) 09:00-11:30 rrule count bi-weekly 3 times diff --git a/test/data/icalendar/import-rrule-count-bi-weekly.ics b/test/data/icalendar/import-rrule-count-bi-weekly.ics deleted file mode 100644 index 888b85bb331..00000000000 --- a/test/data/icalendar/import-rrule-count-bi-weekly.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule count bi-weekly 3 times -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-count-daily-long.diary-american b/test/data/icalendar/import-rrule-count-daily-long.diary-american deleted file mode 100644 index 23fe9fcaf32..00000000000 --- a/test/data/icalendar/import-rrule-count-daily-long.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long diff --git a/test/data/icalendar/import-rrule-count-daily-long.diary-european b/test/data/icalendar/import-rrule-count-daily-long.diary-european deleted file mode 100644 index 0d4ab669058..00000000000 --- a/test/data/icalendar/import-rrule-count-daily-long.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long diff --git a/test/data/icalendar/import-rrule-count-daily-long.diary-iso b/test/data/icalendar/import-rrule-count-daily-long.diary-iso deleted file mode 100644 index 8cecda5c879..00000000000 --- a/test/data/icalendar/import-rrule-count-daily-long.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long diff --git a/test/data/icalendar/import-rrule-count-daily-long.ics b/test/data/icalendar/import-rrule-count-daily-long.ics deleted file mode 100644 index 73df19a8196..00000000000 --- a/test/data/icalendar/import-rrule-count-daily-long.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule count daily long -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-count-daily-short.diary-american b/test/data/icalendar/import-rrule-count-daily-short.diary-american deleted file mode 100644 index d69bb08c318..00000000000 --- a/test/data/icalendar/import-rrule-count-daily-short.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short diff --git a/test/data/icalendar/import-rrule-count-daily-short.diary-european b/test/data/icalendar/import-rrule-count-daily-short.diary-european deleted file mode 100644 index 33a1ce4cf51..00000000000 --- a/test/data/icalendar/import-rrule-count-daily-short.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short diff --git a/test/data/icalendar/import-rrule-count-daily-short.diary-iso b/test/data/icalendar/import-rrule-count-daily-short.diary-iso deleted file mode 100644 index a06bcba0dc1..00000000000 --- a/test/data/icalendar/import-rrule-count-daily-short.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short diff --git a/test/data/icalendar/import-rrule-count-daily-short.ics b/test/data/icalendar/import-rrule-count-daily-short.ics deleted file mode 100644 index 92ffe8be654..00000000000 --- a/test/data/icalendar/import-rrule-count-daily-short.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule count daily short -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-count-every-second-month.diary-american b/test/data/icalendar/import-rrule-count-every-second-month.diary-american deleted file mode 100644 index 4ce8ef842f8..00000000000 --- a/test/data/icalendar/import-rrule-count-every-second-month.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month diff --git a/test/data/icalendar/import-rrule-count-every-second-month.diary-european b/test/data/icalendar/import-rrule-count-every-second-month.diary-european deleted file mode 100644 index 09ec3756295..00000000000 --- a/test/data/icalendar/import-rrule-count-every-second-month.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month diff --git a/test/data/icalendar/import-rrule-count-every-second-month.diary-iso b/test/data/icalendar/import-rrule-count-every-second-month.diary-iso deleted file mode 100644 index ae6feb70d4c..00000000000 --- a/test/data/icalendar/import-rrule-count-every-second-month.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month diff --git a/test/data/icalendar/import-rrule-count-every-second-month.ics b/test/data/icalendar/import-rrule-count-every-second-month.ics deleted file mode 100644 index 3b27b665498..00000000000 --- a/test/data/icalendar/import-rrule-count-every-second-month.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule count every second month -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-count-every-second-year.diary-american b/test/data/icalendar/import-rrule-count-every-second-year.diary-american deleted file mode 100644 index 99543aa9596..00000000000 --- a/test/data/icalendar/import-rrule-count-every-second-year.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year diff --git a/test/data/icalendar/import-rrule-count-every-second-year.diary-european b/test/data/icalendar/import-rrule-count-every-second-year.diary-european deleted file mode 100644 index 3b330886ce0..00000000000 --- a/test/data/icalendar/import-rrule-count-every-second-year.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year diff --git a/test/data/icalendar/import-rrule-count-every-second-year.diary-iso b/test/data/icalendar/import-rrule-count-every-second-year.diary-iso deleted file mode 100644 index 16af52ea91c..00000000000 --- a/test/data/icalendar/import-rrule-count-every-second-year.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year diff --git a/test/data/icalendar/import-rrule-count-every-second-year.ics b/test/data/icalendar/import-rrule-count-every-second-year.ics deleted file mode 100644 index ce21c34d09a..00000000000 --- a/test/data/icalendar/import-rrule-count-every-second-year.ics +++ /dev/null @@ -1,10 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule count every second year -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5 -END:VEVENT -END:VCALENDAR diff --git a/test/data/icalendar/import-rrule-count-monthly.diary-american b/test/data/icalendar/import-rrule-count-monthly.diary-american deleted file mode 100644 index ad5ca0b0ed4..00000000000 --- a/test/data/icalendar/import-rrule-count-monthly.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly diff --git a/test/data/icalendar/import-rrule-count-monthly.diary-european b/test/data/icalendar/import-rrule-count-monthly.diary-european deleted file mode 100644 index 709de3a3fd5..00000000000 --- a/test/data/icalendar/import-rrule-count-monthly.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly diff --git a/test/data/icalendar/import-rrule-count-monthly.diary-iso b/test/data/icalendar/import-rrule-count-monthly.diary-iso deleted file mode 100644 index 9fc2a2def94..00000000000 --- a/test/data/icalendar/import-rrule-count-monthly.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly diff --git a/test/data/icalendar/import-rrule-count-monthly.ics b/test/data/icalendar/import-rrule-count-monthly.ics deleted file mode 100644 index 3391ca24252..00000000000 --- a/test/data/icalendar/import-rrule-count-monthly.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule count monthly -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-count-yearly.diary-american b/test/data/icalendar/import-rrule-count-yearly.diary-american deleted file mode 100644 index 8c1f95b0c05..00000000000 --- a/test/data/icalendar/import-rrule-count-yearly.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly diff --git a/test/data/icalendar/import-rrule-count-yearly.diary-european b/test/data/icalendar/import-rrule-count-yearly.diary-european deleted file mode 100644 index e216e224eae..00000000000 --- a/test/data/icalendar/import-rrule-count-yearly.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly diff --git a/test/data/icalendar/import-rrule-count-yearly.diary-iso b/test/data/icalendar/import-rrule-count-yearly.diary-iso deleted file mode 100644 index 3801192ee60..00000000000 --- a/test/data/icalendar/import-rrule-count-yearly.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly diff --git a/test/data/icalendar/import-rrule-count-yearly.ics b/test/data/icalendar/import-rrule-count-yearly.ics deleted file mode 100644 index d8569933e0c..00000000000 --- a/test/data/icalendar/import-rrule-count-yearly.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule count yearly -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-daily-two-day.diary-american b/test/data/icalendar/import-rrule-daily-two-day.diary-american deleted file mode 100644 index 495fca5f8df..00000000000 --- a/test/data/icalendar/import-rrule-daily-two-day.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily-two-day.diary-european b/test/data/icalendar/import-rrule-daily-two-day.diary-european deleted file mode 100644 index 61db14ab24a..00000000000 --- a/test/data/icalendar/import-rrule-daily-two-day.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily-two-day.diary-iso b/test/data/icalendar/import-rrule-daily-two-day.diary-iso deleted file mode 100644 index 0e0a4b19781..00000000000 --- a/test/data/icalendar/import-rrule-daily-two-day.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily-two-day.ics b/test/data/icalendar/import-rrule-daily-two-day.ics deleted file mode 100644 index 8c9cb3b2845..00000000000 --- a/test/data/icalendar/import-rrule-daily-two-day.ics +++ /dev/null @@ -1,10 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule daily -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=DAILY;INTERVAL=2 -END:VEVENT -END:VCALENDAR diff --git a/test/data/icalendar/import-rrule-daily-with-exceptions.diary-american b/test/data/icalendar/import-rrule-daily-with-exceptions.diary-american deleted file mode 100644 index 83e5f582d5f..00000000000 --- a/test/data/icalendar/import-rrule-daily-with-exceptions.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (not (diary-date 9 25 2003)) (not (diary-date 9 21 2003)) (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily with exceptions diff --git a/test/data/icalendar/import-rrule-daily-with-exceptions.diary-european b/test/data/icalendar/import-rrule-daily-with-exceptions.diary-european deleted file mode 100644 index a3c7fdd4177..00000000000 --- a/test/data/icalendar/import-rrule-daily-with-exceptions.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (not (diary-date 25 9 2003)) (not (diary-date 21 9 2003)) (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily with exceptions diff --git a/test/data/icalendar/import-rrule-daily-with-exceptions.diary-iso b/test/data/icalendar/import-rrule-daily-with-exceptions.diary-iso deleted file mode 100644 index 88b4c892d16..00000000000 --- a/test/data/icalendar/import-rrule-daily-with-exceptions.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (not (diary-date 2003 9 25)) (not (diary-date 2003 9 21)) (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily with exceptions diff --git a/test/data/icalendar/import-rrule-daily-with-exceptions.ics b/test/data/icalendar/import-rrule-daily-with-exceptions.ics deleted file mode 100644 index 5284bf42d8b..00000000000 --- a/test/data/icalendar/import-rrule-daily-with-exceptions.ics +++ /dev/null @@ -1,12 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule daily with exceptions -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=DAILY;INTERVAL=2 -EXDATE:20030921,20030925 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-daily.diary-american b/test/data/icalendar/import-rrule-daily.diary-american deleted file mode 100644 index 9213270fa41..00000000000 --- a/test/data/icalendar/import-rrule-daily.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily.diary-european b/test/data/icalendar/import-rrule-daily.diary-european deleted file mode 100644 index 2c70cd7da55..00000000000 --- a/test/data/icalendar/import-rrule-daily.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily.diary-iso b/test/data/icalendar/import-rrule-daily.diary-iso deleted file mode 100644 index b201cb44308..00000000000 --- a/test/data/icalendar/import-rrule-daily.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily diff --git a/test/data/icalendar/import-rrule-daily.ics b/test/data/icalendar/import-rrule-daily.ics deleted file mode 100644 index 6d013b0b4f6..00000000000 --- a/test/data/icalendar/import-rrule-daily.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule daily -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=DAILY; -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-monthly-no-end.diary-american b/test/data/icalendar/import-rrule-monthly-no-end.diary-american deleted file mode 100644 index bc5453fe425..00000000000 --- a/test/data/icalendar/import-rrule-monthly-no-end.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end diff --git a/test/data/icalendar/import-rrule-monthly-no-end.diary-european b/test/data/icalendar/import-rrule-monthly-no-end.diary-european deleted file mode 100644 index f071519701d..00000000000 --- a/test/data/icalendar/import-rrule-monthly-no-end.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end diff --git a/test/data/icalendar/import-rrule-monthly-no-end.diary-iso b/test/data/icalendar/import-rrule-monthly-no-end.diary-iso deleted file mode 100644 index 3709e933337..00000000000 --- a/test/data/icalendar/import-rrule-monthly-no-end.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end diff --git a/test/data/icalendar/import-rrule-monthly-no-end.ics b/test/data/icalendar/import-rrule-monthly-no-end.ics deleted file mode 100644 index b871658600a..00000000000 --- a/test/data/icalendar/import-rrule-monthly-no-end.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule monthly no end -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=MONTHLY; -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-monthly-with-end.diary-american b/test/data/icalendar/import-rrule-monthly-with-end.diary-american deleted file mode 100644 index 638ab8b2327..00000000000 --- a/test/data/icalendar/import-rrule-monthly-with-end.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end diff --git a/test/data/icalendar/import-rrule-monthly-with-end.diary-european b/test/data/icalendar/import-rrule-monthly-with-end.diary-european deleted file mode 100644 index c70cde25f32..00000000000 --- a/test/data/icalendar/import-rrule-monthly-with-end.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end diff --git a/test/data/icalendar/import-rrule-monthly-with-end.diary-iso b/test/data/icalendar/import-rrule-monthly-with-end.diary-iso deleted file mode 100644 index ee51a2142a4..00000000000 --- a/test/data/icalendar/import-rrule-monthly-with-end.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end diff --git a/test/data/icalendar/import-rrule-monthly-with-end.ics b/test/data/icalendar/import-rrule-monthly-with-end.ics deleted file mode 100644 index d8a1fe2e5af..00000000000 --- a/test/data/icalendar/import-rrule-monthly-with-end.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule monthly with end -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=MONTHLY;UNTIL=20050819; -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-weekly.diary-american b/test/data/icalendar/import-rrule-weekly.diary-american deleted file mode 100644 index d8bf2eba104..00000000000 --- a/test/data/icalendar/import-rrule-weekly.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly diff --git a/test/data/icalendar/import-rrule-weekly.diary-european b/test/data/icalendar/import-rrule-weekly.diary-european deleted file mode 100644 index e368fde9709..00000000000 --- a/test/data/icalendar/import-rrule-weekly.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly diff --git a/test/data/icalendar/import-rrule-weekly.diary-iso b/test/data/icalendar/import-rrule-weekly.diary-iso deleted file mode 100644 index 49cd9d8ace6..00000000000 --- a/test/data/icalendar/import-rrule-weekly.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly diff --git a/test/data/icalendar/import-rrule-weekly.ics b/test/data/icalendar/import-rrule-weekly.ics deleted file mode 100644 index c3f0b8ae933..00000000000 --- a/test/data/icalendar/import-rrule-weekly.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule weekly -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=WEEKLY; -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-rrule-yearly.diary-american b/test/data/icalendar/import-rrule-yearly.diary-american deleted file mode 100644 index a54780b9699..00000000000 --- a/test/data/icalendar/import-rrule-yearly.diary-american +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly diff --git a/test/data/icalendar/import-rrule-yearly.diary-european b/test/data/icalendar/import-rrule-yearly.diary-european deleted file mode 100644 index a4bd81d6f2b..00000000000 --- a/test/data/icalendar/import-rrule-yearly.diary-european +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly diff --git a/test/data/icalendar/import-rrule-yearly.diary-iso b/test/data/icalendar/import-rrule-yearly.diary-iso deleted file mode 100644 index 65a7abe0344..00000000000 --- a/test/data/icalendar/import-rrule-yearly.diary-iso +++ /dev/null @@ -1 +0,0 @@ -&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly diff --git a/test/data/icalendar/import-rrule-yearly.ics b/test/data/icalendar/import-rrule-yearly.ics deleted file mode 100644 index 21cca097f7e..00000000000 --- a/test/data/icalendar/import-rrule-yearly.ics +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -SUMMARY:rrule yearly -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -RRULE:FREQ=YEARLY;INTERVAL=2 -END:VEVENT -END:VCALENDAR - diff --git a/test/data/icalendar/import-with-timezone.diary-iso b/test/data/icalendar/import-with-timezone.diary-iso deleted file mode 100644 index f99b59213e5..00000000000 --- a/test/data/icalendar/import-with-timezone.diary-iso +++ /dev/null @@ -1,2 +0,0 @@ -&2012/1/15 15:00-15:30 standardtime -&2012/12/15 11:00-11:30 daylightsavingtime diff --git a/test/data/icalendar/import-with-timezone.ics b/test/data/icalendar/import-with-timezone.ics deleted file mode 100644 index 110a9835e41..00000000000 --- a/test/data/icalendar/import-with-timezone.ics +++ /dev/null @@ -1,27 +0,0 @@ -BEGIN:VCALENDAR -BEGIN:VTIMEZONE -TZID:fictional, nonexistent, arbitrary -BEGIN:STANDARD -DTSTART:20100101T000000 -TZOFFSETFROM:+0200 -TZOFFSETTO:-0200 -RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=01 -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:20101201T000000 -TZOFFSETFROM:-0200 -TZOFFSETTO:+0200 -RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11 -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -SUMMARY:standardtime -DTSTART;TZID="fictional, nonexistent, arbitrary":20120115T120000 -DTEND;TZID="fictional, nonexistent, arbitrary":20120115T123000 -END:VEVENT -BEGIN:VEVENT -SUMMARY:daylightsavingtime -DTSTART;TZID="fictional, nonexistent, arbitrary":20121215T120000 -DTEND;TZID="fictional, nonexistent, arbitrary":20121215T123000 -END:VEVENT -END:VCALENDAR diff --git a/test/data/icalendar/import-with-uid.diary-american b/test/data/icalendar/import-with-uid.diary-american deleted file mode 100644 index 9b2f06afc26..00000000000 --- a/test/data/icalendar/import-with-uid.diary-american +++ /dev/null @@ -1,2 +0,0 @@ -&9/19/2003 09:00-11:30 non-recurring - UID: 1234567890uid diff --git a/test/data/icalendar/import-with-uid.diary-european b/test/data/icalendar/import-with-uid.diary-european deleted file mode 100644 index 95db4d40151..00000000000 --- a/test/data/icalendar/import-with-uid.diary-european +++ /dev/null @@ -1,2 +0,0 @@ -&19/9/2003 09:00-11:30 non-recurring - UID: 1234567890uid diff --git a/test/data/icalendar/import-with-uid.diary-iso b/test/data/icalendar/import-with-uid.diary-iso deleted file mode 100644 index d372e5a3d1f..00000000000 --- a/test/data/icalendar/import-with-uid.diary-iso +++ /dev/null @@ -1,2 +0,0 @@ -&2003/9/19 09:00-11:30 non-recurring - UID: 1234567890uid diff --git a/test/data/icalendar/import-with-uid.ics b/test/data/icalendar/import-with-uid.ics deleted file mode 100644 index db412d9d9f5..00000000000 --- a/test/data/icalendar/import-with-uid.ics +++ /dev/null @@ -1,10 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Emacs//NONSGML icalendar.el//EN -VERSION:2.0 -BEGIN:VEVENT -UID:1234567890uid -SUMMARY:non-recurring -DTSTART;VALUE=DATE-TIME:20030919T090000 -DTEND;VALUE=DATE-TIME:20030919T113000 -END:VEVENT -END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/import-bug-11473.diary-european b/test/lisp/calendar/icalendar-resources/import-bug-11473.diary-european new file mode 100644 index 00000000000..97348ae0498 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-11473.diary-european @@ -0,0 +1,10 @@ +&15/5/2012 15:00-15:30 Query + Desc: + Whassup? + + + Location: phone + Organizer: MAILTO:a.luser@foo.com + Status: CONFIRMED + Class: PUBLIC + UID: 040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000010000000575268034ECDB649A15349B1BF240F15 diff --git a/test/lisp/calendar/icalendar-resources/import-bug-11473.ics b/test/lisp/calendar/icalendar-resources/import-bug-11473.ics new file mode 100644 index 00000000000..bc3a6c69fb7 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-11473.ics @@ -0,0 +1,54 @@ +BEGIN:VCALENDAR +METHOD:REQUEST +PRODID:Microsoft Exchange Server 2007 +VERSION:2.0 +BEGIN:VTIMEZONE +TZID:(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna +BEGIN:STANDARD +DTSTART:16010101T030000 +TZOFFSETFROM:+0200 +TZOFFSETTO:+0100 +RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10 +END:STANDARD +BEGIN:DAYLIGHT +DTSTART:16010101T020000 +TZOFFSETFROM:+0100 +TZOFFSETTO:+0200 +RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3 +END:DAYLIGHT +END:VTIMEZONE +BEGIN:VEVENT +ORGANIZER;CN="A. Luser":MAILTO:a.luser@foo.com +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Luser, Oth + er":MAILTO:other.luser@foo.com +DESCRIPTION;LANGUAGE=en-US:\nWhassup?\n\n +SUMMARY;LANGUAGE=en-US:Query +DTSTART;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna" + :20120515T150000 +DTEND;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna":2 + 0120515T153000 +UID:040000008200E00074C5B7101A82E0080000000020FFAED0CFEFCC01000000000000000 + 010000000575268034ECDB649A15349B1BF240F15 +RECURRENCE-ID;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, V + ienna":20120515T170000 +CLASS:PUBLIC +PRIORITY:5 +DTSTAMP:20120514T153645Z +TRANSP:OPAQUE +STATUS:CONFIRMED +SEQUENCE:15 +LOCATION;LANGUAGE=en-US:phone +X-MICROSOFT-CDO-APPT-SEQUENCE:15 +X-MICROSOFT-CDO-OWNERAPPTID:1907632092 +X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE +X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY +X-MICROSOFT-CDO-ALLDAYEVENT:FALSE +X-MICROSOFT-CDO-IMPORTANCE:1 +X-MICROSOFT-CDO-INSTTYPE:3 +BEGIN:VALARM +ACTION:DISPLAY +DESCRIPTION:REMINDER +TRIGGER;RELATED=START:-PT15M +END:VALARM +END:VEVENT +END:VCALENDAR \ No newline at end of file diff --git a/test/lisp/calendar/icalendar-resources/import-bug-22092.diary-american b/test/lisp/calendar/icalendar-resources/import-bug-22092.diary-american new file mode 100644 index 00000000000..392345fe0a2 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-22092.diary-american @@ -0,0 +1,6 @@ +&12/8/2014 18:30-22:55 Norwegian til Tromsoe-Langnes - + Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 + Location: Stavanger-Sola + Organizer: noreply@norwegian.no + Class: PUBLIC + UID: RFCALITEM1 diff --git a/test/lisp/calendar/icalendar-resources/import-bug-22092.diary-european b/test/lisp/calendar/icalendar-resources/import-bug-22092.diary-european new file mode 100644 index 00000000000..6a64cf6a8e9 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-22092.diary-european @@ -0,0 +1,6 @@ +&8/12/2014 18:30-22:55 Norwegian til Tromsoe-Langnes - + Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 + Location: Stavanger-Sola + Organizer: noreply@norwegian.no + Class: PUBLIC + UID: RFCALITEM1 diff --git a/test/lisp/calendar/icalendar-resources/import-bug-22092.diary-iso b/test/lisp/calendar/icalendar-resources/import-bug-22092.diary-iso new file mode 100644 index 00000000000..e0fadbf94dc --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-22092.diary-iso @@ -0,0 +1,6 @@ +&2014/12/8 18:30-22:55 Norwegian til Tromsoe-Langnes - + Desc: Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 + Location: Stavanger-Sola + Organizer: noreply@norwegian.no + Class: PUBLIC + UID: RFCALITEM1 diff --git a/test/lisp/calendar/icalendar-resources/import-bug-22092.ics b/test/lisp/calendar/icalendar-resources/import-bug-22092.ics new file mode 100644 index 00000000000..4a4c679da9c --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-22092.ics @@ -0,0 +1,30 @@ +BEGIN:VCALENDAR +PRODID:-//www.norwegian.no//iCalendar MIMEDIR//EN +VERSION:2.0 +METHOD:REQUEST +BEGIN:VEVENT +UID:RFCALITEM1 +SEQUENCE:1512040950 +DTSTAMP:20141204T095043Z +ORGANIZER:noreply@norwegian.no +DTSTART:20141208T173000Z + +DTEND:20141208T215500Z + +LOCATION:Stavanger-Sola + +DESCRIPTION:Fly med Norwegian, reservasjon. Fra Stavanger til Tromsø 8. des 2014 18:30, DY545Fly med Norwegian, reservasjon . Fra Stavanger til Tromsø 8. des 2014 21:00, DY390 + +X-ALT-DESC;FMTTYPE=text/html:Reisereferanse

+SUMMARY:Norwegian til Tromsoe-Langnes - + +CATEGORIES:Appointment + + +PRIORITY:5 + +CLASS:PUBLIC + +TRANSP:OPAQUE +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/import-bug-24199.diary-american b/test/lisp/calendar/icalendar-resources/import-bug-24199.diary-american new file mode 100644 index 00000000000..b3308f1fcfa --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-24199.diary-american @@ -0,0 +1,5 @@ +&%%(and (not (diary-date 1 6 2016)) (not (diary-date 2 3 2016)) (not (diary-date 3 2 2016)) (not (diary-date 5 4 2016)) (not (diary-date 6 1 2016)) (diary-float t 3 1) (diary-block 12 2 2015 1 1 9999)) 12:46-16:00 Summary + Desc: Desc + Location: Loc + Class: DEFAULT + UID: 9188710a-08a7-4061-bae3-d4cf4972599a diff --git a/test/lisp/calendar/icalendar-resources/import-bug-24199.diary-european b/test/lisp/calendar/icalendar-resources/import-bug-24199.diary-european new file mode 100644 index 00000000000..acba714b527 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-24199.diary-european @@ -0,0 +1,5 @@ +&%%(and (not (diary-date 6 1 2016)) (not (diary-date 3 2 2016)) (not (diary-date 2 3 2016)) (not (diary-date 4 5 2016)) (not (diary-date 1 6 2016)) (diary-float t 3 1) (diary-block 2 12 2015 1 1 9999)) 12:46-16:00 Summary + Desc: Desc + Location: Loc + Class: DEFAULT + UID: 9188710a-08a7-4061-bae3-d4cf4972599a diff --git a/test/lisp/calendar/icalendar-resources/import-bug-24199.diary-iso b/test/lisp/calendar/icalendar-resources/import-bug-24199.diary-iso new file mode 100644 index 00000000000..2c18395dea8 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-24199.diary-iso @@ -0,0 +1,5 @@ +&%%(and (not (diary-date 2016 1 6)) (not (diary-date 2016 2 3)) (not (diary-date 2016 3 2)) (not (diary-date 2016 5 4)) (not (diary-date 2016 6 1)) (diary-float t 3 1) (diary-block 2015 12 2 9999 1 1)) 12:46-16:00 Summary + Desc: Desc + Location: Loc + Class: DEFAULT + UID: 9188710a-08a7-4061-bae3-d4cf4972599a diff --git a/test/lisp/calendar/icalendar-resources/import-bug-24199.ics b/test/lisp/calendar/icalendar-resources/import-bug-24199.ics new file mode 100644 index 00000000000..a307c2da3ca --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-24199.ics @@ -0,0 +1,25 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:Summary +DESCRIPTION:Desc +LOCATION:Loc +DTSTART:20151202T124600 +DTEND:20151202T160000 +RRULE:FREQ=MONTHLY;BYDAY=1WE;INTERVAL=1 +EXDATE:20160106T114600Z +EXDATE:20160203T114600Z +EXDATE:20160302T114600Z +EXDATE:20160504T104600Z +EXDATE:20160601T104600Z +CLASS:DEFAULT +TRANSP:OPAQUE +BEGIN:VALARM +ACTION:DISPLAY +TRIGGER;VALUE=DURATION:-PT3H +END:VALARM +LAST-MODIFIED:20160805T191040Z +UID:9188710a-08a7-4061-bae3-d4cf4972599a +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/import-bug-33277.diary-american b/test/lisp/calendar/icalendar-resources/import-bug-33277.diary-american new file mode 100644 index 00000000000..c546fa9a97c --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-33277.diary-american @@ -0,0 +1 @@ +&11/5/2018 21:00 event with same start/end time diff --git a/test/lisp/calendar/icalendar-resources/import-bug-33277.diary-european b/test/lisp/calendar/icalendar-resources/import-bug-33277.diary-european new file mode 100644 index 00000000000..28e53960536 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-33277.diary-european @@ -0,0 +1 @@ +&5/11/2018 21:00 event with same start/end time diff --git a/test/lisp/calendar/icalendar-resources/import-bug-33277.diary-iso b/test/lisp/calendar/icalendar-resources/import-bug-33277.diary-iso new file mode 100644 index 00000000000..faa7aeafeb5 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-33277.diary-iso @@ -0,0 +1 @@ +&2018/11/5 21:00 event with same start/end time diff --git a/test/lisp/calendar/icalendar-resources/import-bug-33277.ics b/test/lisp/calendar/icalendar-resources/import-bug-33277.ics new file mode 100644 index 00000000000..a4122a28007 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-33277.ics @@ -0,0 +1,15 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTART:20181105T200000Z +DTSTAMP:20181105T181652Z +DESCRIPTION: +LAST-MODIFIED:20181105T181646Z +LOCATION: +SEQUENCE:0 +SUMMARY:event with same start/end time +TRANSP:OPAQUE +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-bug-6766.diary-american b/test/lisp/calendar/icalendar-resources/import-bug-6766.diary-american new file mode 100644 index 00000000000..30deea9911a --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-6766.diary-american @@ -0,0 +1,7 @@ +&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum + Status: CONFIRMED + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1262 +&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1263 diff --git a/test/lisp/calendar/icalendar-resources/import-bug-6766.diary-european b/test/lisp/calendar/icalendar-resources/import-bug-6766.diary-european new file mode 100644 index 00000000000..ba16c02305a --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-6766.diary-european @@ -0,0 +1,7 @@ +&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum + Status: CONFIRMED + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1262 +&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1263 diff --git a/test/lisp/calendar/icalendar-resources/import-bug-6766.diary-iso b/test/lisp/calendar/icalendar-resources/import-bug-6766.diary-iso new file mode 100644 index 00000000000..7794e586f37 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-6766.diary-iso @@ -0,0 +1,7 @@ +&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 2010 4 21)) 11:30-12:00 Scrum + Status: CONFIRMED + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1262 +&%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking + Class: PUBLIC + UID: 8814e3f9-7482-408f-996c-3bfe486a1263 diff --git a/test/lisp/calendar/icalendar-resources/import-bug-6766.ics b/test/lisp/calendar/icalendar-resources/import-bug-6766.ics new file mode 100644 index 00000000000..451391be025 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-bug-6766.ics @@ -0,0 +1,28 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +CLASS:PUBLIC +DTEND;TZID=America/New_York:20100421T120000 +DTSTAMP:20100525T141214Z +DTSTART;TZID=America/New_York:20100421T113000 +RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,TH,FR +SEQUENCE:1 +STATUS:CONFIRMED +SUMMARY:Scrum +TRANSP:OPAQUE +UID:8814e3f9-7482-408f-996c-3bfe486a1262 +END:VEVENT +BEGIN:VEVENT +CLASS:PUBLIC +DTSTAMP:20100525T141214Z +DTSTART;VALUE=DATE:20100422 +DTEND;VALUE=DATE:20100423 +RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,TH +SEQUENCE:1 +SUMMARY:Tues + Thurs thinking +TRANSP:OPAQUE +UID:8814e3f9-7482-408f-996c-3bfe486a1263 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-duration-2.diary-american b/test/lisp/calendar/icalendar-resources/import-duration-2.diary-american new file mode 100644 index 00000000000..56f41d6ad9e --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-duration-2.diary-american @@ -0,0 +1,3 @@ +&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub + Class: PUBLIC + UID: 20041127T183329Z-18215-1001-4536-49109@andromeda diff --git a/test/lisp/calendar/icalendar-resources/import-duration-2.diary-european b/test/lisp/calendar/icalendar-resources/import-duration-2.diary-european new file mode 100644 index 00000000000..999102ab6b4 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-duration-2.diary-european @@ -0,0 +1,3 @@ +&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub + Class: PUBLIC + UID: 20041127T183329Z-18215-1001-4536-49109@andromeda diff --git a/test/lisp/calendar/icalendar-resources/import-duration-2.diary-iso b/test/lisp/calendar/icalendar-resources/import-duration-2.diary-iso new file mode 100644 index 00000000000..393937e6cd9 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-duration-2.diary-iso @@ -0,0 +1,3 @@ +&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub + Class: PUBLIC + UID: 20041127T183329Z-18215-1001-4536-49109@andromeda diff --git a/test/lisp/calendar/icalendar-resources/import-duration-2.ics b/test/lisp/calendar/icalendar-resources/import-duration-2.ics new file mode 100644 index 00000000000..eb8a03ba36f --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-duration-2.ics @@ -0,0 +1,17 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID:20041127T183329Z-18215-1001-4536-49109@andromeda +DTSTAMP:20041127T183315Z +LAST-MODIFIED:20041127T183329 +SUMMARY:Urlaub +DTSTART;VALUE=DATE:20011221 +DTEND;VALUE=DATE:20011221 +RRULE:FREQ=DAILY;UNTIL=20011229;INTERVAL=1;WKST=SU +CLASS:PUBLIC +SEQUENCE:1 +CREATED:20041127T183329 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-duration.diary-american b/test/lisp/calendar/icalendar-resources/import-duration.diary-american new file mode 100644 index 00000000000..268736a8cd0 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-duration.diary-american @@ -0,0 +1 @@ +&%%(and (diary-block 2 17 2005 2 23 2005)) duration diff --git a/test/lisp/calendar/icalendar-resources/import-duration.diary-european b/test/lisp/calendar/icalendar-resources/import-duration.diary-european new file mode 100644 index 00000000000..7d852ddcd3c --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-duration.diary-european @@ -0,0 +1 @@ +&%%(and (diary-block 17 2 2005 23 2 2005)) duration diff --git a/test/lisp/calendar/icalendar-resources/import-duration.diary-iso b/test/lisp/calendar/icalendar-resources/import-duration.diary-iso new file mode 100644 index 00000000000..5d3a714284e --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-duration.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-block 2005 2 17 2005 2 23)) duration diff --git a/test/lisp/calendar/icalendar-resources/import-duration.ics b/test/lisp/calendar/icalendar-resources/import-duration.ics new file mode 100644 index 00000000000..67f5c73571b --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-duration.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTART;VALUE=DATE:20050217 +SUMMARY:duration +DURATION:P7D +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-american b/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-american new file mode 100644 index 00000000000..d1b1992a022 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-american @@ -0,0 +1,4 @@ +&7/23/2011 event-1 +&7/24/2011 event-2 +&7/25/2011 event-3a +&7/25/2011 event-3b diff --git a/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-european b/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-european new file mode 100644 index 00000000000..f068354220c --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-european @@ -0,0 +1,4 @@ +&23/7/2011 event-1 +&24/7/2011 event-2 +&25/7/2011 event-3a +&25/7/2011 event-3b diff --git a/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-iso b/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-iso new file mode 100644 index 00000000000..5685e4708a7 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.diary-iso @@ -0,0 +1,4 @@ +&2011/7/23 event-1 +&2011/7/24 event-2 +&2011/7/25 event-3a +&2011/7/25 event-3b diff --git a/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.ics b/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.ics new file mode 100644 index 00000000000..69a02c09b1b --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-multiple-vcalendars.ics @@ -0,0 +1,21 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTART;VALUE=DATE:20110723 +SUMMARY:event-1 +END:VEVENT +BEGIN:VEVENT +DTSTART;VALUE=DATE:20110724 +SUMMARY:event-2 +END:VEVENT +BEGIN:VEVENT +DTSTART;VALUE=DATE:20110725 +SUMMARY:event-3a +END:VEVENT +BEGIN:VEVENT +DTSTART;VALUE=DATE:20110725 +SUMMARY:event-3b +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-american b/test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-american new file mode 100644 index 00000000000..780e3a8ce64 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-american @@ -0,0 +1 @@ +&9/19/2003 09:00-11:30 non-recurring diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-european b/test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-european new file mode 100644 index 00000000000..7e0cd21b784 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-european @@ -0,0 +1 @@ +&19/9/2003 09:00-11:30 non-recurring diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-iso b/test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-iso new file mode 100644 index 00000000000..c7311286619 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-1.diary-iso @@ -0,0 +1 @@ +&2003/9/19 09:00-11:30 non-recurring diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-1.ics b/test/lisp/calendar/icalendar-resources/import-non-recurring-1.ics new file mode 100644 index 00000000000..cd471efc861 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-1.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:non-recurring +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-american b/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-american new file mode 100644 index 00000000000..1d4bb6a337e --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-american @@ -0,0 +1 @@ +&9/19/2003 non-recurring allday diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-european b/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-european new file mode 100644 index 00000000000..b56c7f4e17f --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-european @@ -0,0 +1 @@ +&19/9/2003 non-recurring allday diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-iso b/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-iso new file mode 100644 index 00000000000..f1c70ab34c3 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.diary-iso @@ -0,0 +1 @@ +&2003/9/19 non-recurring allday diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.ics b/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.ics new file mode 100644 index 00000000000..4efa8ffa133 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.ics @@ -0,0 +1,9 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:non-recurring allday +DTSTART;VALUE=DATE-TIME:20030919 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-american b/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-american new file mode 100644 index 00000000000..2eb8c0ab686 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-american @@ -0,0 +1,4 @@ +&11/23/2004 14:45-15:45 another example + Status: TENTATIVE + Class: PRIVATE + UID: 6161a312-3902-11d9-b512-f764153bb28b diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-european b/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-european new file mode 100644 index 00000000000..394eae8bb77 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-european @@ -0,0 +1,4 @@ +&23/11/2004 14:45-15:45 another example + Status: TENTATIVE + Class: PRIVATE + UID: 6161a312-3902-11d9-b512-f764153bb28b diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-iso b/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-iso new file mode 100644 index 00000000000..5e8bdf417d5 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.diary-iso @@ -0,0 +1,4 @@ +&2004/11/23 14:45-15:45 another example + Status: TENTATIVE + Class: PRIVATE + UID: 6161a312-3902-11d9-b512-f764153bb28b diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.ics b/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.ics new file mode 100644 index 00000000000..b145e418791 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-another-example.ics @@ -0,0 +1,23 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID + :6161a312-3902-11d9-b512-f764153bb28b +SUMMARY + :another example +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + :20041123T144500 +DTEND + :20041123T154500 +DTSTAMP + :20041118T013641Z +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-american b/test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-american new file mode 100644 index 00000000000..b22234229cf --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-american @@ -0,0 +1,4 @@ +&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien + Status: TENTATIVE + Class: PRIVATE + UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-european b/test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-european new file mode 100644 index 00000000000..8043482442f --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-european @@ -0,0 +1,4 @@ +&%%(and (diary-block 19 7 2004 27 8 2004)) Sommerferien + Status: TENTATIVE + Class: PRIVATE + UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-iso b/test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-iso new file mode 100644 index 00000000000..e0f1896114f --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-block.diary-iso @@ -0,0 +1,4 @@ +&%%(and (diary-block 2004 7 19 2004 8 27)) Sommerferien + Status: TENTATIVE + Class: PRIVATE + UID: 748f2da0-0d9b-11d8-97af-b4ec8686ea61 diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-block.ics b/test/lisp/calendar/icalendar-resources/import-non-recurring-block.ics new file mode 100644 index 00000000000..0c52ba3d66a --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-block.ics @@ -0,0 +1,16 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61 +SUMMARY:Sommerferien +STATUS:TENTATIVE +CLASS:PRIVATE +X-MOZILLA-ALARM-DEFAULT-UNITS:Minuten +X-MOZILLA-RECUR-DEFAULT-INTERVAL:0 +DTSTART;VALUE=DATE:20040719 +DTEND;VALUE=DATE:20040828 +DTSTAMP:20031103T011641Z +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-american b/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-american new file mode 100644 index 00000000000..2954d0c4fd1 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-american @@ -0,0 +1,4 @@ +&11/23/2004 14:00-14:30 folded summary + Status: TENTATIVE + Class: PRIVATE + UID: 04979712-3902-11d9-93dd-8f9f4afe08da diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-european b/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-european new file mode 100644 index 00000000000..7745fc811b4 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-european @@ -0,0 +1,4 @@ +&23/11/2004 14:00-14:30 folded summary + Status: TENTATIVE + Class: PRIVATE + UID: 04979712-3902-11d9-93dd-8f9f4afe08da diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-iso b/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-iso new file mode 100644 index 00000000000..8c19a95ed2d --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.diary-iso @@ -0,0 +1,4 @@ +&2004/11/23 14:00-14:30 folded summary + Status: TENTATIVE + Class: PRIVATE + UID: 04979712-3902-11d9-93dd-8f9f4afe08da diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.ics b/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.ics new file mode 100644 index 00000000000..e3ecee9dae8 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-folded-summary.ics @@ -0,0 +1,25 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID + :04979712-3902-11d9-93dd-8f9f4afe08da +SUMMARY + :folded summary +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + :20041123T140000 +DTEND + :20041123T143000 +DTSTAMP + :20041118T013430Z +LAST-MODIFIED + :20041118T013640Z +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-american b/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-american new file mode 100644 index 00000000000..84cd464c568 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-american @@ -0,0 +1 @@ +&9/19/2003 long summary diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-european b/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-european new file mode 100644 index 00000000000..5d6524202c3 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-european @@ -0,0 +1 @@ +&19/9/2003 long summary diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-iso b/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-iso new file mode 100644 index 00000000000..d2300522d9a --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.diary-iso @@ -0,0 +1 @@ +&2003/9/19 long summary diff --git a/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.ics b/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.ics new file mode 100644 index 00000000000..39ae02f10ca --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-non-recurring-long-summary.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:long + summary +DTSTART;VALUE=DATE:20030919 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.diary-american b/test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.diary-american new file mode 100644 index 00000000000..e6c8712d254 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.diary-american @@ -0,0 +1,6 @@ +&5/9/2003 07:00-12:00 On-Site Interview + Desc: 10:30am - Blah + Location: Cccc + Organizer: MAILTO:aaaaaaa@aaaaaaa.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9 diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.diary-european b/test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.diary-european new file mode 100644 index 00000000000..cecca070a51 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.diary-european @@ -0,0 +1,6 @@ +&9/5/2003 07:00-12:00 On-Site Interview + Desc: 10:30am - Blah + Location: Cccc + Organizer: MAILTO:aaaaaaa@aaaaaaa.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000010000000DB823520692542408ED02D7023F9DFF9 diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.ics b/test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.ics new file mode 100644 index 00000000000..decc8df5451 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2003-05-29.ics @@ -0,0 +1,54 @@ +BEGIN:VCALENDAR +METHOD:REQUEST +PRODID:Microsoft CDO for Microsoft Exchange +VERSION:2.0 +BEGIN:VTIMEZONE +TZID:Kolkata, Chennai, Mumbai, New Delhi +X-MICROSOFT-CDO-TZID:23 +BEGIN:STANDARD +DTSTART:16010101T000000 +TZOFFSETFROM:+0530 +TZOFFSETTO:+0530 +END:STANDARD +BEGIN:DAYLIGHT +DTSTART:16010101T000000 +TZOFFSETFROM:+0530 +TZOFFSETTO:+0530 +END:DAYLIGHT +END:VTIMEZONE +BEGIN:VEVENT +DTSTAMP:20030509T043439Z +DTSTART;TZID="Kolkata, Chennai, Mumbai, New Delhi":20030509T103000 +SUMMARY:On-Site Interview +UID:040000008200E00074C5B7101A82E0080000000080B6DE661216C301000000000000000 + 010000000DB823520692542408ED02D7023F9DFF9 +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Xxxxx + xxx Xxxxxxxxxxxx":MAILTO:xxxxxxxx@xxxxxxx.com +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Yyyyyyy Y + yyyy":MAILTO:yyyyyyy@yyyyyyy.com +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Zzzz Zzzz + zz":MAILTO:zzzzzz@zzzzzzz.com +ORGANIZER;CN="Aaaaaa Aaaaa":MAILTO:aaaaaaa@aaaaaaa.com +LOCATION:Cccc +DTEND;TZID="Kolkata, Chennai, Mumbai, New Delhi":20030509T153000 +DESCRIPTION:10:30am - Blah +SEQUENCE:0 +PRIORITY:5 +CLASS: +CREATED:20030509T043439Z +LAST-MODIFIED:20030509T043459Z +STATUS:CONFIRMED +TRANSP:OPAQUE +X-MICROSOFT-CDO-BUSYSTATUS:BUSY +X-MICROSOFT-CDO-INSTTYPE:0 +X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY +X-MICROSOFT-CDO-ALLDAYEVENT:FALSE +X-MICROSOFT-CDO-IMPORTANCE:1 +X-MICROSOFT-CDO-OWNERAPPTID:126441427 +BEGIN:VALARM +ACTION:DISPLAY +DESCRIPTION:REMINDER +TRIGGER;RELATED=START:-PT00H15M00S +END:VALARM +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.diary-american b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.diary-american new file mode 100644 index 00000000000..f2c914184e7 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.diary-american @@ -0,0 +1,6 @@ +&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX + Desc: 753 Zeichen hier radiert + Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) + Organizer: MAILTO:xxx@xxxxx.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.diary-european b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.diary-european new file mode 100644 index 00000000000..89cff58af42 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.diary-european @@ -0,0 +1,6 @@ +&23/6/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX + Desc: 753 Zeichen hier radiert + Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) + Organizer: MAILTO:xxx@xxxxx.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.ics b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.ics new file mode 100644 index 00000000000..6bb5b05af17 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18a.ics @@ -0,0 +1,36 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTAMP:20030618T195512Z +DTSTART;TZID="Mountain Time (US & Canada)":20030623T110000 +SUMMARY:Dress Rehearsal for XXXX-XXXX +UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000 + 0100000007C3A6D65EE726E40B7F3D69A23BD567E +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="AAAAA,AAA + AA (A-AAAAAAA,ex1)":MAILTO:aaaaa_aaaaa@aaaaa.com +ORGANIZER;CN="ABCD,TECHTRAINING + (A-Americas,exgen1)":MAILTO:xxx@xxxxx.com +LOCATION:555 or TN 555-5555 ID 5555 & NochWas (see below) +DTEND;TZID="Mountain Time (US & Canada)":20030623T120000 +DESCRIPTION:753 Zeichen hier radiert +SEQUENCE:0 +PRIORITY:5 +CLASS: +CREATED:20030618T195518Z +LAST-MODIFIED:20030618T195527Z +STATUS:CONFIRMED +TRANSP:OPAQUE +X-MICROSOFT-CDO-BUSYSTATUS:BUSY +X-MICROSOFT-CDO-INSTTYPE:0 +X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY +X-MICROSOFT-CDO-ALLDAYEVENT:FALSE +X-MICROSOFT-CDO-IMPORTANCE:1 +X-MICROSOFT-CDO-OWNERAPPTID:1022519251 +BEGIN:VALARM +ACTION:DISPLAY +DESCRIPTION:REMINDER +TRIGGER;RELATED=START:-PT00H15M00S +END:VALARM +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.diary-american b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.diary-american new file mode 100644 index 00000000000..2c0774cdd83 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.diary-american @@ -0,0 +1,6 @@ +&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 + Desc: Viele Zeichen standen hier frĂŒher + Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) + Organizer: MAILTO:bbb@bbbbb.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.diary-european b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.diary-european new file mode 100644 index 00000000000..95aac168699 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.diary-european @@ -0,0 +1,6 @@ +&23/6/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 + Desc: Viele Zeichen standen hier frĂŒher + Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) + Organizer: MAILTO:bbb@bbbbb.com + Status: CONFIRMED + UID: 040000008200E00074C5B7101A82E00800000000608AA7DA9835C3010000000000000000100000007C3A6D65EE726E40B7F3D69A23BD567E diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.ics b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.ics new file mode 100644 index 00000000000..1523135adf3 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2003-06-18b.ics @@ -0,0 +1,55 @@ +BEGIN:VCALENDAR +METHOD:REQUEST +PRODID:Microsoft CDO for Microsoft Exchange +VERSION:2.0 +BEGIN:VTIMEZONE +TZID:Mountain Time (US & Canada) +X-MICROSOFT-CDO-TZID:12 +BEGIN:STANDARD +DTSTART:16010101T020000 +TZOFFSETFROM:-0600 +TZOFFSETTO:-0700 +RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU +END:STANDARD +BEGIN:DAYLIGHT +DTSTART:16010101T020000 +TZOFFSETFROM:-0700 +TZOFFSETTO:-0600 +RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU +END:DAYLIGHT +END:VTIMEZONE +BEGIN:VEVENT +DTSTAMP:20030618T230323Z +DTSTART;TZID="Mountain Time (US & Canada)":20030623T090000 +SUMMARY:Updated: Dress Rehearsal for ABC01-15 +UID:040000008200E00074C5B7101A82E00800000000608AA7DA9835C301000000000000000 + 0100000007C3A6D65EE726E40B7F3D69A23BD567E +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;X-REPLYTIME=20030618T20 + 0700Z;RSVP=TRUE;CN="AAAAA,AAAAAA +\(A-AAAAAAA,ex1)":MAILTO:aaaaaa_aaaaa@aaaaa + .com +ORGANIZER;CN="ABCD,TECHTRAINING +\(A-Americas,exgen1)":MAILTO:bbb@bbbbb.com +LOCATION:123 or TN 123-1234 ID abcd & SonstWo (see below) +DTEND;TZID="Mountain Time (US & Canada)":20030623T100000 +DESCRIPTION:Viele Zeichen standen hier frĂŒher +SEQUENCE:0 +PRIORITY:5 +CLASS: +CREATED:20030618T230326Z +LAST-MODIFIED:20030618T230335Z +STATUS:CONFIRMED +TRANSP:OPAQUE +X-MICROSOFT-CDO-BUSYSTATUS:BUSY +X-MICROSOFT-CDO-INSTTYPE:0 +X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY +X-MICROSOFT-CDO-ALLDAYEVENT:FALSE +X-MICROSOFT-CDO-IMPORTANCE:1 +X-MICROSOFT-CDO-OWNERAPPTID:1022519251 +BEGIN:VALARM +ACTION:DISPLAY +DESCRIPTION:REMINDER +TRIGGER;RELATED=START:-PT00H15M00S +END:VALARM +END:VEVENT +END:VCALENDAR \ No newline at end of file diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.diary-american b/test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.diary-american new file mode 100644 index 00000000000..a986f700ba2 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.diary-american @@ -0,0 +1,19 @@ +&11/23/2004 14:00-14:30 Jjjjj & Wwwww + Status: TENTATIVE + Class: PRIVATE +&11/23/2004 14:45-15:45 BB Aaaaaaaa Bbbbb + Status: TENTATIVE + Class: PRIVATE +&11/23/2004 11:00-12:00 Hhhhhhhh + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-cyclic 14 11 12 2004)) 14:00-18:30 MMM Aaaaaaaaa + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-block 11 19 2004 11 19 2004)) Rrrr/Cccccc ii Aaaaaaaa + Desc: Vvvvv Rrrr aaa Cccccc + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh + Status: TENTATIVE + Class: PRIVATE diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.diary-european b/test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.diary-european new file mode 100644 index 00000000000..cbfe99eb8e3 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.diary-european @@ -0,0 +1,19 @@ +&23/11/2004 14:00-14:30 Jjjjj & Wwwww + Status: TENTATIVE + Class: PRIVATE +&23/11/2004 14:45-15:45 BB Aaaaaaaa Bbbbb + Status: TENTATIVE + Class: PRIVATE +&23/11/2004 11:00-12:00 Hhhhhhhh + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-cyclic 14 12 11 2004)) 14:00-18:30 MMM Aaaaaaaaa + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-block 19 11 2004 19 11 2004)) Rrrr/Cccccc ii Aaaaaaaa + Desc: Vvvvv Rrrr aaa Cccccc + Status: TENTATIVE + Class: PRIVATE +&%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh + Status: TENTATIVE + Class: PRIVATE diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.ics b/test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.ics new file mode 100644 index 00000000000..9edb682fcad --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.ics @@ -0,0 +1,120 @@ +BEGIN:VCALENDAR +VERSION + :2.0 +PRODID + :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN +BEGIN:VEVENT +SUMMARY + :Jjjjj & Wwwww +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + :20041123T140000 +DTEND + :20041123T143000 +DTSTAMP + :20041118T013430Z +LAST-MODIFIED + :20041118T013640Z +END:VEVENT +BEGIN:VEVENT +SUMMARY + :BB Aaaaaaaa Bbbbb +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + :20041123T144500 +DTEND + :20041123T154500 +DTSTAMP + :20041118T013641Z +END:VEVENT +BEGIN:VEVENT +SUMMARY + :Hhhhhhhh +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + :20041123T110000 +DTEND + :20041123T120000 +DTSTAMP + :20041118T013831Z +END:VEVENT +BEGIN:VEVENT +SUMMARY + :MMM Aaaaaaaaa +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +X-MOZILLA-RECUR-DEFAULT-INTERVAL + :2 +RRULE + :FREQ=WEEKLY;INTERVAL=2;BYDAY=FR +DTSTART + :20041112T140000 +DTEND + :20041112T183000 +DTSTAMP + :20041118T014117Z +END:VEVENT +BEGIN:VEVENT +SUMMARY + :Rrrr/Cccccc ii Aaaaaaaa +DESCRIPTION + :Vvvvv Rrrr aaa Cccccc +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +DTSTART + ;VALUE=DATE + :20041119 +DTEND + ;VALUE=DATE + :20041120 +DTSTAMP + :20041118T013107Z +LAST-MODIFIED + :20041118T014203Z +END:VEVENT +BEGIN:VEVENT +SUMMARY + :Wwww aa hhhh +STATUS + :TENTATIVE +CLASS + :PRIVATE +X-MOZILLA-ALARM-DEFAULT-LENGTH + :0 +RRULE + :FREQ=WEEKLY;INTERVAL=1;BYDAY=MO +DTSTART + ;VALUE=DATE + :20041101 +DTEND + ;VALUE=DATE + :20041102 +DTSTAMP + :20041118T014045Z +LAST-MODIFIED + :20041118T023846Z +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.diary-american b/test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.diary-american new file mode 100644 index 00000000000..ce7d835d96b --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.diary-american @@ -0,0 +1,5 @@ +&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day + Desc: abcdef + Status: CONFIRMED + Class: PRIVATE + UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4 diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.diary-european b/test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.diary-european new file mode 100644 index 00000000000..3a52b0ab271 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.diary-european @@ -0,0 +1,5 @@ +&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day + Desc: abcdef + Status: CONFIRMED + Class: PRIVATE + UID: b60d398e-1dd1-11b2-a159-cf8cb05139f4 diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.ics b/test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.ics new file mode 100644 index 00000000000..9eec71fe751 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2005-02-07.ics @@ -0,0 +1,26 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID + :b60d398e-1dd1-11b2-a159-cf8cb05139f4 +SUMMARY + :Waitangi Day +DESCRIPTION + :abcdef +CATEGORIES + :Public Holiday +STATUS + :CONFIRMED +CLASS + :PRIVATE +DTSTART + ;VALUE=DATE + :20050206 +DTEND + ;VALUE=DATE + :20050207 +DTSTAMP + :20050128T011209Z +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.diary-american b/test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.diary-american new file mode 100644 index 00000000000..23c93d45d9a --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.diary-american @@ -0,0 +1,2 @@ +&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa + UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.diary-european b/test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.diary-european new file mode 100644 index 00000000000..106e9f3cdd0 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.diary-european @@ -0,0 +1,2 @@ +&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa + UID: 6AFA7558-6994-11D9-8A3A-000A95A0E830-RID diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.ics b/test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.ics new file mode 100644 index 00000000000..ed9faa9b0bd --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-2005-03-01.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTART;VALUE=DATE:20050217 +SUMMARY:Hhhhhh Aaaaa ii Aaaaaaaa +UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID +DTSTAMP:20050118T210335Z +DURATION:P7D +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-no-dst.diary-american b/test/lisp/calendar/icalendar-resources/import-real-world-no-dst.diary-american new file mode 100644 index 00000000000..290edb88760 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-no-dst.diary-american @@ -0,0 +1,4 @@ +&11/16/2014 04:30-05:30 NoDST + Desc: Test event from timezone without DST + Location: Everywhere + UID: 20141116T171439Z-678877132@marudot.com diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-no-dst.diary-european b/test/lisp/calendar/icalendar-resources/import-real-world-no-dst.diary-european new file mode 100644 index 00000000000..c56b7a6547a --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-no-dst.diary-european @@ -0,0 +1,4 @@ +&16/11/2014 04:30-05:30 NoDST + Desc: Test event from timezone without DST + Location: Everywhere + UID: 20141116T171439Z-678877132@marudot.com diff --git a/test/lisp/calendar/icalendar-resources/import-real-world-no-dst.ics b/test/lisp/calendar/icalendar-resources/import-real-world-no-dst.ics new file mode 100644 index 00000000000..5f147af4f37 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-real-world-no-dst.ics @@ -0,0 +1,26 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//www.marudot.com//iCal Event Maker +X-WR-CALNAME:Test +CALSCALE:GREGORIAN +BEGIN:VTIMEZONE +TZID:Asia/Tehran +TZURL:http://tzurl.org/zoneinfo-outlook/Asia/Tehran +X-LIC-LOCATION:Asia/Tehran +BEGIN:STANDARD +TZOFFSETFROM:+0330 +TZOFFSETTO:+0330 +TZNAME:IRST +DTSTART:19700101T000000 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +DTSTAMP:20141116T171439Z +UID:20141116T171439Z-678877132@marudot.com +DTSTART;TZID="Asia/Tehran":20141116T070000 +DTEND;TZID="Asia/Tehran":20141116T080000 +SUMMARY:NoDST +DESCRIPTION:Test event from timezone without DST +LOCATION:Everywhere +END:VEVENT +END:VCALENDAR \ No newline at end of file diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-american new file mode 100644 index 00000000000..7b86b554dd4 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-american @@ -0,0 +1 @@ +&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-european new file mode 100644 index 00000000000..3b82ec09fd5 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-european @@ -0,0 +1 @@ +&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-iso new file mode 100644 index 00000000000..7fc99478d4e --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.ics b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.ics new file mode 100644 index 00000000000..2996f494167 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTART;VALUE=DATE:20040815 +DTEND;VALUE=DATE:20040816 +SUMMARY:Maria Himmelfahrt +RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-american new file mode 100644 index 00000000000..84b6d109953 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 14 9 19 2003) (diary-block 9 19 2003 10 31 2003)) 09:00-11:30 rrule count bi-weekly 3 times diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-european new file mode 100644 index 00000000000..0bebdf8872f --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 14 19 9 2003) (diary-block 19 9 2003 31 10 2003)) 09:00-11:30 rrule count bi-weekly 3 times diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-iso new file mode 100644 index 00000000000..11429081abe --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 14 2003 9 19) (diary-block 2003 9 19 2003 10 31)) 09:00-11:30 rrule count bi-weekly 3 times diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.ics b/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.ics new file mode 100644 index 00000000000..888b85bb331 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-bi-weekly.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count bi-weekly 3 times +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-american new file mode 100644 index 00000000000..23fe9fcaf32 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-european new file mode 100644 index 00000000000..0d4ab669058 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-iso new file mode 100644 index 00000000000..8cecda5c879 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.ics b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.ics new file mode 100644 index 00000000000..73df19a8196 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-long.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count daily long +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-american new file mode 100644 index 00000000000..d69bb08c318 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-european new file mode 100644 index 00000000000..33a1ce4cf51 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-iso new file mode 100644 index 00000000000..a06bcba0dc1 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.ics b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.ics new file mode 100644 index 00000000000..92ffe8be654 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-daily-short.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count daily short +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-american new file mode 100644 index 00000000000..4ce8ef842f8 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-european new file mode 100644 index 00000000000..09ec3756295 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-iso new file mode 100644 index 00000000000..ae6feb70d4c --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.ics b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.ics new file mode 100644 index 00000000000..3b27b665498 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-month.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count every second month +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-american new file mode 100644 index 00000000000..99543aa9596 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-european new file mode 100644 index 00000000000..3b330886ce0 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-iso new file mode 100644 index 00000000000..16af52ea91c --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.ics b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.ics new file mode 100644 index 00000000000..ce21c34d09a --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-every-second-year.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count every second year +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5 +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-american new file mode 100644 index 00000000000..ad5ca0b0ed4 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-european new file mode 100644 index 00000000000..709de3a3fd5 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-iso new file mode 100644 index 00000000000..9fc2a2def94 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.ics b/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.ics new file mode 100644 index 00000000000..3391ca24252 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-monthly.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count monthly +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-american new file mode 100644 index 00000000000..8c1f95b0c05 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-european new file mode 100644 index 00000000000..e216e224eae --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-iso new file mode 100644 index 00000000000..3801192ee60 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.ics b/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.ics new file mode 100644 index 00000000000..d8569933e0c --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-count-yearly.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule count yearly +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-american new file mode 100644 index 00000000000..495fca5f8df --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-european new file mode 100644 index 00000000000..61db14ab24a --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-iso new file mode 100644 index 00000000000..0e0a4b19781 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.ics b/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.ics new file mode 100644 index 00000000000..8c9cb3b2845 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily-two-day.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule daily +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=DAILY;INTERVAL=2 +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-american new file mode 100644 index 00000000000..83e5f582d5f --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-american @@ -0,0 +1 @@ +&%%(and (not (diary-date 9 25 2003)) (not (diary-date 9 21 2003)) (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily with exceptions diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-european new file mode 100644 index 00000000000..a3c7fdd4177 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-european @@ -0,0 +1 @@ +&%%(and (not (diary-date 25 9 2003)) (not (diary-date 21 9 2003)) (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily with exceptions diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-iso new file mode 100644 index 00000000000..88b4c892d16 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.diary-iso @@ -0,0 +1 @@ +&%%(and (not (diary-date 2003 9 25)) (not (diary-date 2003 9 21)) (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily with exceptions diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.ics b/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.ics new file mode 100644 index 00000000000..5284bf42d8b --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.ics @@ -0,0 +1,12 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule daily with exceptions +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=DAILY;INTERVAL=2 +EXDATE:20030921,20030925 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-american new file mode 100644 index 00000000000..9213270fa41 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-european new file mode 100644 index 00000000000..2c70cd7da55 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-iso new file mode 100644 index 00000000000..b201cb44308 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-daily.ics b/test/lisp/calendar/icalendar-resources/import-rrule-daily.ics new file mode 100644 index 00000000000..6d013b0b4f6 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-daily.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule daily +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=DAILY; +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-american new file mode 100644 index 00000000000..bc5453fe425 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-european new file mode 100644 index 00000000000..f071519701d --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-iso new file mode 100644 index 00000000000..3709e933337 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.ics b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.ics new file mode 100644 index 00000000000..b871658600a --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule monthly no end +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=MONTHLY; +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-american new file mode 100644 index 00000000000..638ab8b2327 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-american @@ -0,0 +1 @@ +&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-european new file mode 100644 index 00000000000..c70cde25f32 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-european @@ -0,0 +1 @@ +&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-iso new file mode 100644 index 00000000000..ee51a2142a4 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.ics b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.ics new file mode 100644 index 00000000000..d8a1fe2e5af --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule monthly with end +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=MONTHLY;UNTIL=20050819; +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-american new file mode 100644 index 00000000000..d8bf2eba104 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-american @@ -0,0 +1 @@ +&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-european new file mode 100644 index 00000000000..e368fde9709 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-european @@ -0,0 +1 @@ +&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-iso new file mode 100644 index 00000000000..49cd9d8ace6 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-weekly.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-weekly.ics b/test/lisp/calendar/icalendar-resources/import-rrule-weekly.ics new file mode 100644 index 00000000000..c3f0b8ae933 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-weekly.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule weekly +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=WEEKLY; +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-american new file mode 100644 index 00000000000..a54780b9699 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-american @@ -0,0 +1 @@ +&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-european new file mode 100644 index 00000000000..a4bd81d6f2b --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-european @@ -0,0 +1 @@ +&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-iso new file mode 100644 index 00000000000..65a7abe0344 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-iso @@ -0,0 +1 @@ +&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-yearly.ics b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.ics new file mode 100644 index 00000000000..21cca097f7e --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.ics @@ -0,0 +1,11 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:rrule yearly +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +RRULE:FREQ=YEARLY;INTERVAL=2 +END:VEVENT +END:VCALENDAR + diff --git a/test/lisp/calendar/icalendar-resources/import-with-timezone.diary-iso b/test/lisp/calendar/icalendar-resources/import-with-timezone.diary-iso new file mode 100644 index 00000000000..f99b59213e5 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-with-timezone.diary-iso @@ -0,0 +1,2 @@ +&2012/1/15 15:00-15:30 standardtime +&2012/12/15 11:00-11:30 daylightsavingtime diff --git a/test/lisp/calendar/icalendar-resources/import-with-timezone.ics b/test/lisp/calendar/icalendar-resources/import-with-timezone.ics new file mode 100644 index 00000000000..110a9835e41 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-with-timezone.ics @@ -0,0 +1,27 @@ +BEGIN:VCALENDAR +BEGIN:VTIMEZONE +TZID:fictional, nonexistent, arbitrary +BEGIN:STANDARD +DTSTART:20100101T000000 +TZOFFSETFROM:+0200 +TZOFFSETTO:-0200 +RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=01 +END:STANDARD +BEGIN:DAYLIGHT +DTSTART:20101201T000000 +TZOFFSETFROM:-0200 +TZOFFSETTO:+0200 +RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11 +END:DAYLIGHT +END:VTIMEZONE +BEGIN:VEVENT +SUMMARY:standardtime +DTSTART;TZID="fictional, nonexistent, arbitrary":20120115T120000 +DTEND;TZID="fictional, nonexistent, arbitrary":20120115T123000 +END:VEVENT +BEGIN:VEVENT +SUMMARY:daylightsavingtime +DTSTART;TZID="fictional, nonexistent, arbitrary":20121215T120000 +DTEND;TZID="fictional, nonexistent, arbitrary":20121215T123000 +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/import-with-uid.diary-american b/test/lisp/calendar/icalendar-resources/import-with-uid.diary-american new file mode 100644 index 00000000000..9b2f06afc26 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-with-uid.diary-american @@ -0,0 +1,2 @@ +&9/19/2003 09:00-11:30 non-recurring + UID: 1234567890uid diff --git a/test/lisp/calendar/icalendar-resources/import-with-uid.diary-european b/test/lisp/calendar/icalendar-resources/import-with-uid.diary-european new file mode 100644 index 00000000000..95db4d40151 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-with-uid.diary-european @@ -0,0 +1,2 @@ +&19/9/2003 09:00-11:30 non-recurring + UID: 1234567890uid diff --git a/test/lisp/calendar/icalendar-resources/import-with-uid.diary-iso b/test/lisp/calendar/icalendar-resources/import-with-uid.diary-iso new file mode 100644 index 00000000000..d372e5a3d1f --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-with-uid.diary-iso @@ -0,0 +1,2 @@ +&2003/9/19 09:00-11:30 non-recurring + UID: 1234567890uid diff --git a/test/lisp/calendar/icalendar-resources/import-with-uid.ics b/test/lisp/calendar/icalendar-resources/import-with-uid.ics new file mode 100644 index 00000000000..db412d9d9f5 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/import-with-uid.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +PRODID:-//Emacs//NONSGML icalendar.el//EN +VERSION:2.0 +BEGIN:VEVENT +UID:1234567890uid +SUMMARY:non-recurring +DTSTART;VALUE=DATE-TIME:20030919T090000 +DTEND;VALUE=DATE-TIME:20030919T113000 +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-tests.el b/test/lisp/calendar/icalendar-tests.el index 5143c78632a..8b44f639475 100644 --- a/test/lisp/calendar/icalendar-tests.el +++ b/test/lisp/calendar/icalendar-tests.el @@ -32,6 +32,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'icalendar) ;; ====================================================================== @@ -51,18 +52,13 @@ (replace-regexp-in-string "[ \t\n]+\\'" "" (replace-regexp-in-string "\\`[ \t\n]+" "" string))) -(defconst icalendar-tests--data-dir - (expand-file-name "test/data/icalendar" source-directory)) - (defun icalendar-tests--get-file-contents (filename) "Return contents of file in test data directory named FILENAME." (with-temp-buffer - (let ((f1 (expand-file-name filename icalendar-tests--data-dir)) - (f2 (expand-file-name filename "../../data/icalendar")) - (coding-system-for-read 'raw-text) + (let ((coding-system-for-read 'raw-text) (inhibit-eol-conversion t)) (insert-file-contents-literally - (if (file-exists-p f1) f1 f2)) + (ert-resource-file filename)) (buffer-string)))) ;; ====================================================================== -- cgit v1.2.3 From ead957a2c3281002d5675f0f6efdc28ea223ea6f Mon Sep 17 00:00:00 2001 From: Ruthra Kumar Date: Fri, 23 Oct 2020 13:02:55 +0200 Subject: Add support for squashfs files in archive mode * lisp/arc-mode.el (archive-squashfs-extract): New variable (bug#43827). (archive-find-type): Identify squashfs. (archive-squashfs-summarize, archive-squashfs-extract-by-stdout): New functions to parse/extract squashfs. * lisp/files.el (auto-mode-alist): Add squashfs. --- etc/NEWS | 3 ++ lisp/arc-mode.el | 120 ++++++++++++++++++++++++++++++++++++++++----- lisp/files.el | 4 +- lisp/international/mule.el | 4 +- 4 files changed, 116 insertions(+), 15 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 9e8182a2dae..11c19b378a6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -308,6 +308,9 @@ and variables. ** Archive mode +--- +*** Archive Mode can now parse .squashfs files. + *** Can now modify members of 'ar' archives. *** Display of summaries unified between backends. diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index eb62a851183..ce0c061fc09 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -51,17 +51,17 @@ ;; ARCHIVE TYPES: Currently only the archives below are handled, but the ;; structure for handling just about anything is in place. ;; -;; Arc Lzh Zip Zoo Rar 7z Ar -;; -------------------------------------------------- -;; View listing Intern Intern Intern Intern Y Y Y -;; Extract member Y Y Y Y Y Y Y -;; Save changed member Y Y Y Y N Y Y -;; Add new member N N N N N N N -;; Delete member Y Y Y Y N Y N -;; Rename member Y Y N N N N N -;; Chmod - Y Y - N N N -;; Chown - Y - - N N N -;; Chgrp - Y - - N N N +;; Arc Lzh Zip Zoo Rar 7z Ar Squashfs +;; --------------------------------------------------------------- +;; View listing Intern Intern Intern Intern Y Y Y Y +;; Extract member Y Y Y Y Y Y Y Y +;; Save changed member Y Y Y Y N Y Y N +;; Add new member N N N N N N N N +;; Delete member Y Y Y Y N Y N N +;; Rename member Y Y N N N N N N +;; Chmod - Y Y - N N N N +;; Chown - Y - - N N N N +;; Chgrp - Y - - N N N N ;; ;; Special thanks to Bill Brodie for very useful tips ;; on the first released version of this package. @@ -370,6 +370,24 @@ file. Archive and member name will be added." :inline t (string :format "%v")))) +;; ------------------------------ +;; Squashfs archive configuration + +(defgroup archive-squashfs nil + "Squashfs-specific options to archive." + :group 'archive) + +(defcustom archive-squashfs-extract '("rdsquashfs" "-c") + "Program and its options to run in order to extract a squashsfs file member. +Extraction should happen to standard output. Archive and member name will +be added." + :type '(list (string :tag "Program") + (repeat :tag "Options" + :inline t + (string :format "%v"))) + :version "28.1" + :group 'archive-squashfs) + ;; ------------------------------------------------------------------------- ;;; Section: Variables @@ -741,6 +759,7 @@ archive. (re-search-forward "Rar!" (+ (point) 100000) t)) 'rar-exe) ((looking-at "7z\274\257\047\034") '7z) + ((looking-at "hsqs") 'squashfs) (t (error "Buffer format not recognized"))))) ;; ------------------------------------------------------------------------- @@ -2280,6 +2299,85 @@ NAME is expected to be the 16-bytes part of an ar record." descr '("ar" "r"))) +;; ------------------------------------------------------------------------- +;;; Section Squashfs archives. + +(defun archive-squashfs-summarize (&optional file) + (unless file + (setq file buffer-file-name)) + (let ((copy (file-local-copy file)) + (files ())) + (with-temp-buffer + (call-process "unsquashfs" nil t nil "-ll" (or file copy)) + (when copy + (delete-file copy)) + (goto-char (point-min)) + (search-forward-regexp "[drwxl\\-]\\{10\\}") + (beginning-of-line) + (while (looking-at (concat + "^\\(.[rwx\\-]\\{9\\}\\) " ;Mode + "\\(.+\\)/\\(.+\\) " ;user/group + "\\(.+\\) " ;size + "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\) " ;date + "\\([0-9]\\{2\\}:[0-9]\\{2\\}\\) " ;time + "\\(.+\\)\n")) ;Filename + (let* ((name (match-string 7)) + (flags (match-string 1)) + (uid (match-string 2)) + (gid (match-string 3)) + (size (string-to-number (match-string 4))) + (date (match-string 5)) + (time (match-string 6)) + (date-time) + (mode)) + ;; Only list directory and regular files + (when (or (eq (aref flags 0) ?d) + (eq (aref flags 0) ?-)) + (when (equal name "squashfs-root") + (setf name "/")) + ;; Remove 'squashfs-root/' from filenames. + (setq name (string-replace "squashfs-root/" "" name)) + (setq date-time (concat date " " time)) + (setq mode (logior + (cond + ((eq (aref flags 0) ?d) #o40000) + (t 0)) + ;; Convert symbolic to octal representation. + (file-modes-symbolic-to-number + (concat + "u=" (string-replace "-" "" (substring flags 1 4)) + ",g=" (string-replace "-" "" (substring flags 4 7)) + ",o=" (string-replace "-" "" + (substring flags 7 10)))))) + (push (archive--file-desc name name mode size + date-time :uid uid :gid gid) + files))) + (goto-char (match-end 0)))) + (archive--summarize-descs (nreverse files)))) + +(defun archive-squashfs-extract-by-stdout (archive name command + &optional stderr-test) + (let ((stderr-file (make-temp-file "arc-stderr"))) + (unwind-protect + (prog1 + (apply #'call-process + (car command) + nil + (if stderr-file (list t stderr-file) t) + nil + (append (cdr command) (list name archive))) + (with-temp-buffer + (insert-file-contents stderr-file) + (goto-char (point-min)) + (when (if (stringp stderr-test) + (not (re-search-forward stderr-test nil t)) + (> (buffer-size) 0)) + (message "%s" (buffer-string))))) + (if (file-exists-p stderr-file) + (delete-file stderr-file))))) + +(defun archive-squashfs-extract (archive name) + (archive-squashfs-extract-by-stdout archive name archive-squashfs-extract)) ;; ------------------------------------------------------------------------- ;; This line was a mistake; it is kept now for compatibility. diff --git a/lisp/files.el b/lisp/files.el index bbc8f881590..fdf758ad927 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2758,8 +2758,8 @@ since only a single case-insensitive search through the alist is made." ;; The list of archive file extensions should be in sync with ;; `auto-coding-alist' with `no-conversion' coding system. ("\\.\\(\ -arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|cbr\\|7z\\|\ -ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|CBR\\|7Z\\)\\'" . archive-mode) +arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|cbr\\|7z\\|squashfs\\|\ +ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|CBR\\|7Z\\|SQUASHFS\\)\\'" . archive-mode) ("\\.oxt\\'" . archive-mode) ;(Open|Libre)Office extensions. ("\\.\\(deb\\|[oi]pk\\)\\'" . archive-mode) ; Debian/Opkg packages. ;; Mailer puts message to be edited in diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 2af64de77b5..ad9c3a23066 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1710,8 +1710,8 @@ in-place." ;; self-extracting exe archives. (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg))) '(("\\.\\(\ -arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|\ -ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" +arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|squashfs\\|\ +ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\|SQUASHFS\\)\\'" . no-conversion-multibyte) ("\\.\\(exe\\|EXE\\)\\'" . no-conversion) ("\\.\\(sx[dmicw]\\|odt\\|tar\\|t[bg]z\\)\\'" . no-conversion) -- cgit v1.2.3 From 944c4708358e0121a1a62b629959032e399f3187 Mon Sep 17 00:00:00 2001 From: Olivier Certner Date: Fri, 23 Oct 2020 14:39:04 +0200 Subject: ERC: Fix ERC's IBuffer format "crash" on killed server buffer * lisp/erc/erc-ibuffer.el (erc-server-name): Fix a crash when displaying (or updating) an IBuffer buffer using ERC's first IBuffer format. This happens when one ERC buffer has its associated server buffer killed, e.g., voluntarily or automatically after server disconnection when `erc-kill-server-buffer-on-quit' is set to t. The culprit is the "Server" column, which returns nil in this case. Display "(closed)" instead (bug#44156). Copyright-paperwork-exempt: yes --- lisp/erc/erc-ibuffer.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/erc/erc-ibuffer.el b/lisp/erc/erc-ibuffer.el index 7aee7705fff..556a25e3e7b 100644 --- a/lisp/erc/erc-ibuffer.el +++ b/lisp/erc/erc-ibuffer.el @@ -92,10 +92,14 @@ " ")) (define-ibuffer-column erc-server-name (:name "Server") - (if (and erc-server-process (processp erc-server-process)) - (with-current-buffer (process-buffer erc-server-process) - (or erc-server-announced-name erc-session-server)) - "")) + (or + (when (and erc-server-process (processp erc-server-process)) + (let ((buffer (process-buffer erc-server-process))) + (if (buffer-live-p buffer) + (with-current-buffer buffer + (or erc-server-announced-name erc-session-server)) + "(closed)"))) + "")) (define-ibuffer-column erc-target (:name "Target") (if (eq major-mode 'erc-mode) -- cgit v1.2.3 From 4a92e2f95e80787f0eaa6ba7392641b6020dd5cd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 23 Oct 2020 16:59:37 +0300 Subject: Remove most of charset markup from etc/HELLO For the reasons, see the discussion that started in https://lists.gnu.org/archive/html/emacs-devel/2018-12/msg00407.html and its conclusion in https://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00144.html. The only markup left is in the preamble, just to show the example of this facility. --- etc/HELLO | 118 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/etc/HELLO b/etc/HELLO index 3c1fd63fb71..fcc907536e3 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -7,89 +7,89 @@ some of the character sets that Emacs supports. Non-ASCII examples: - Europe: latin-iso8859-1ÂĄHola!, GrĂŒĂŸ Gott, HyvÀÀ pĂ€ivÀÀ,latin-iso8859-15 Tere Ă”htust,latin-iso8859-3 BonÄĄu - Czeƛć!,latin-iso8859-2 DobrĂœ den,cyrillic-iso8859-5 ЗЮраĐČстĐČуĐčŃ‚Đ”!,greek-iso8859-7 ΓΔÎčÎŹ σας,mule-unicode-0100-24ff გამარჯობა - Africa:mule-unicode-0100-24ff ethiopicሠላም - Middle/Near East:hebrew-iso8859-8 Ś©ÖžŚŚœŚ•Ö覝,mule-unicode-0100-24ff Ű§Ù„ŰłÙ‘Ù„Ű§Ù… Űčليكم - South Asia:mule-unicode-0100-24ff àȘšàȘźàȘžà«àȘ€à«‡, à€šà€źà€žà„à€€à„‡, àČšàČźàČžàłàȕàČŸàČ°, àŽšàŽźàŽžà”àŽ•àŽŸàŽ°àŽ‚, àŹ¶à­àŹŁàŹżàŹŹà­‡, - ආà¶șුබෝවන්, àź”àźŁàź•àŻàź•àźźàŻ, à°šà°źà°žà±à°•à°Ÿà°°à°‚,tibetan àœ–àœ€àŸČàŒ‹àœ€àœČàœŠàŒ‹àœ–àœ‘àœșàŒ‹àœŁàœșàœ‚àœŠàŒŽ - South East Asia:mule-unicode-0100-24ff ជំរាបសវរ,lao àșȘàș°àșšàșČàșàș”àș”,mule-unicode-0100-24ff မငá€șá€čá€‚á€œá€Źá€•á€«,thai-tis620 àžȘàž§àž±àžȘàž”àž”àž„àžŁàž±àžš,vietnamese-viscii-lower vietnamese-viscii-upperCvietnamese-viscii-lowerhĂ o báșĄn + Europe: latin-iso8859-1ÂĄHola!, GrĂŒĂŸ Gott, HyvÀÀ pĂ€ivÀÀ, Tere Ă”htust,latin-iso8859-3 BonÄĄu + Czeƛć!,latin-iso8859-2 DobrĂœ den,cyrillic-iso8859-5 ЗЮраĐČстĐČуĐčŃ‚Đ”!,greek-iso8859-7 ΓΔÎčÎŹ σας, გამარჯობა + Africa: ethiopicሠላም + Middle/Near East:hebrew-iso8859-8 Ś©ÖžŚŚœŚ•Ö覝, Ű§Ù„ŰłÙ‘Ù„Ű§Ù… Űčليكم + South Asia: àȘšàȘźàȘžà«àȘ€à«‡, à€šà€źà€žà„à€€à„‡, àČšàČźàČžàłàȕàČŸàČ°, àŽšàŽźàŽžà”àŽ•àŽŸàŽ°àŽ‚, àŹ¶à­àŹŁàŹżàŹŹà­‡, + ආà¶șුබෝවන්, àź”àźŁàź•àŻàź•àźźàŻ, à°šà°źà°žà±à°•à°Ÿà°°à°‚,tibetan àœ–àœ€àŸČàŒ‹àœ€àœČàœŠàŒ‹àœ–àœ‘àœșàŒ‹àœŁàœșàœ‚àœŠàŒŽ + South East Asia: ជំរាបសវរ,lao àșȘàș°àșšàșČàșàș”àș”, မငá€șá€čá€‚á€œá€Źá€•á€«,thai-tis620 àžȘàž§àž±àžȘàž”àž”àž„àžŁàž±àžš,vietnamese-viscii-lower vietnamese-viscii-upperCvietnamese-viscii-lowerhĂ o báșĄn East Asia:chinese-gb2312 äœ ć„œ,chinese-big5-1 早晚,japanese-jisx0208 こんにづは,korean-ksc5601 안녕하섞요 - Misc:latin-iso8859-3 EÄ„oƝanĝo ĉiuÄ”aĆ­de,mule-unicode-2500-33ff ⠓⠑⠇⠇⠕,mule-unicode-0100-24ff ∀ p ∈ world ‱ hello p mule-unicode-2500-33ff□ + Misc:latin-iso8859-3 EÄ„oƝanĝo ĉiuÄ”aĆ­de, ⠓⠑⠇⠇⠕, ∀ p ∈ world ‱ hello p □ CJK variety:chinese-gb2312 GB(ć…ƒæ°”,ćŒ€ć‘),chinese-big5-1 BIG5(ć…ƒæ°Ł,開癌),japanese-jisx0208 JIS(ć…ƒæ°—,開ç™ș),korean-ksc5601 KSC(ć…ƒæ°Ł,開癌) Unicode charset:unicode EÄ„oƝanĝo ĉiuÄ”aĆ­de, ΓΔÎčÎŹ σας, Ś©ŚœŚ•Ś, ЗЮраĐČстĐČуĐčŃ‚Đ”! LANGUAGE (NATIVE NAME) HELLO ---------------------- ----- -mule-unicode-0100-24ffAmharic (አማርኛ) ሠላም +Amharic (አማርኛ) ሠላም Arabic (Ű§Ù„ŰčŰ±ŰšÙŠÙ‘Ű©) Ű§Ù„ŰłÙ‘Ù„Ű§Ù… Űčليكم Armenian (Ő°ŐĄŐ”Ő„Ö€Ő„Ő¶) ÔČարև Ő±Ő„ŐŠ -cyrillic-iso8859-5Belarusian (Đ±Đ”Đ»Đ°Ń€ŃƒŃĐșая) ПрыĐČŃ–Ń‚Đ°ĐœĐœĐ” -mule-unicode-0100-24ffBengali (àŠŹàŠŸàŠ‚àŠČàŠŸ) àŠšàŠźàŠžà§àŠ•àŠŸàŠ° -mule-unicode-2500-33ffBraille ⠓⠑⠇⠇⠕ -mule-unicode-0100-24ffBurmese (မဌနá€șမာ) မငá€șá€čá€‚á€œá€Źá€•á€« -C printf ("Hello, world!\n"); -unicodeCherokee (áŁáŽłáŽ© ᎩᏬᏂᎯᏍᏗ) ᎣᏏáČ / ᏏáČ +Belarusian (Đ±Đ”Đ»Đ°Ń€ŃƒŃĐșая) ПрыĐČŃ–Ń‚Đ°ĐœĐœĐ” +Bengali (àŠŹàŠŸàŠ‚àŠČàŠŸ) àŠšàŠźàŠžà§àŠ•àŠŸàŠ° +Braille ⠓⠑⠇⠇⠕ +Burmese (မဌနá€șမာ) မငá€șá€čá€‚á€œá€Źá€•á€« +C printf ("Hello, world!\n"); +Cherokee (áŁáŽłáŽ© ᎩᏬᏂᎯᏍᏗ) ᎣᏏáČ / ᏏáČ Comanche /kəˈmĂŠntʃiː/ Haa marʉ́awe Cree (ᓀᐩᐃᔭᐍᐏᐣ) ᑕᓂᓯ / ᐙᒋᔼ -latin-iso8859-2Czech (čeĆĄtina) DobrĂœ den -latin-iso8859-1Danish (dansk) Hej / Goddag / HallĂžj +Czech (čeĆĄtina) DobrĂœ den +Danish (dansk) Hej / Goddag / HallĂžj Dutch (Nederlands) Hallo / Dag -unicodeEfik /ˈɛfÉȘk/ Mɔkɔm +Efik /ˈɛfÉȘk/ Mɔkɔm Emacs emacs --no-splash -f view-hello-file Emoji 👋 -English ipa/ˈÉȘƋɡlÉȘʃ/ Hello -latin-iso8859-3Esperanto Saluton (EÄ„oƝanĝo ĉiuÄ”aĆ­de) -latin-iso8859-15Estonian (eesti keel) Tere pĂ€evast / Tere Ă”htust -latin-iso8859-1Finnish (suomi) Hei / HyvÀÀ pĂ€ivÀÀ +English /ˈÉȘƋɡlÉȘʃ/ Hello +Esperanto Saluton (EÄ„oƝanĝo ĉiuÄ”aĆ­de) +Estonian (eesti keel) Tere pĂ€evast / Tere Ă”htust +Finnish (suomi) Hei / HyvÀÀ pĂ€ivÀÀ French (français) Bonjour / Salut -mule-unicode-0100-24ffGeorgian (áƒ„áƒáƒ áƒ—áƒŁáƒšáƒ˜) გამარჯობა -latin-iso8859-1German (Deutsch) Guten Tag / GrĂŒĂŸ Gott -greek-iso8859-7Greek (ΔλληΜÎčÎșÎŹ) ΓΔÎčÎŹ σας -mule-unicode-0100-24ffGreek, ancient (጑λληΜÎčÎșÎź) Ο᜖λέ τΔ Îșα᜶ ÎŒÎ­ÎłÎ± Ï‡Î±áż–ÏÎ” +Georgian (áƒ„áƒáƒ áƒ—áƒŁáƒšáƒ˜) გამარჯობა +German (Deutsch) Guten Tag / GrĂŒĂŸ Gott +Greek (ΔλληΜÎčÎșÎŹ) ΓΔÎčÎŹ σας +Greek, ancient (጑λληΜÎčÎșÎź) Ο᜖λέ τΔ Îșα᜶ ÎŒÎ­ÎłÎ± Ï‡Î±áż–ÏÎ” Gujarati (àȘ—ુàȘœàȘ°àȘŸàȘ€à«€) àȘšàȘźàȘžà«àȘ€à«‡ -hebrew-iso8859-8Hebrew (ŚąÖŽŚ‘Ö°ŚšÖŽŚ™ŚȘ) Ś©ÖžŚŚœŚ•Ö覝 -latin-iso8859-2Hungarian (magyar) SzĂ©p jĂł napot! -mule-unicode-0100-24ffHindi (à€čà€żà€‚à€Šà„€) à€šà€źà€žà„à€€à„‡ / à€šà€źà€žà„à€•à€Ÿà€° à„€ -unicodeInuktitut (ᐃᓄᒃᑎᑐᑩ) ᐊᐃ - -latin-iso8859-1Italian (italiano) Ciao / Buon giorno -unicodeJavanese (êŠ§êŠ±êŠ—êŠź) console.log("ꊱꊞꊒꊌꊁꊱꊶêŠȘꊁ"); -mule-unicode-0100-24ffKannada (àȕàČšàłàČšàČĄ) àČšàČźàČžàłàȕàČŸàČ° +Hebrew (ŚąÖŽŚ‘Ö°ŚšÖŽŚ™ŚȘ) Ś©ÖžŚŚœŚ•Ö覝 +Hungarian (magyar) SzĂ©p jĂł napot! +Hindi (à€čà€żà€‚à€Šà„€) à€šà€źà€žà„à€€à„‡ / à€šà€źà€žà„à€•à€Ÿà€° à„€ +Inuktitut (ᐃᓄᒃᑎᑐᑩ) ᐊᐃ + +Italian (italiano) Ciao / Buon giorno +Javanese (êŠ§êŠ±êŠ—êŠź) console.log("ꊱꊞꊒꊌꊁꊱꊶêŠȘꊁ"); +Kannada (àȕàČšàłàČšàČĄ) àČšàČźàČžàłàȕàČŸàČ° Khmer (ភាសាខ្មែរ) ជំរាបសវរ -laoLao (àșžàșČàșȘàșČàș„àșČàș§) àșȘàș°àșšàșČàșàș”àș” / àș‚ໍໃàș«à»‰à»‚àșŠàșàș”àș” -mule-unicode-0100-24ffMalayalam (àŽźàŽČàŽŻàŽŸàŽłàŽ‚) àŽšàŽźàŽžà”àŽ•àŽŸàŽ°àŽ‚ -unicodeMaldivian (Ț‹ȚšȚˆȚŹȚ€Țš) Ț‡ȚŠȚ‡Ț°ȚȚŠȚȚ§Ț‰ȚȘ ȚąȚŠȚȚŠȚ‡ȚšȚ†ȚȘȚ‰Ț° / Ț†ȚšȚ€ȚšȚ‚ȚŹȚ€Ț°ŰŸ - -latin-iso8859-3Maltese (il-Malti) BonÄĄu / Saħħa -unicodeMathematics ∀ p ∈ world ‱ hello p □ -cyrillic-iso8859-5Mongolian (ĐŒĐŸĐœĐłĐŸĐ» Ń…ŃĐ») ĐĄĐ°ĐčĐœ баĐčĐœĐ° уу? -latin-iso8859-1Norwegian (norsk) Hei / God dag -mule-unicode-0100-24ffOriya (àŹ“à­œàŹżàŹ†) àŹ¶à­àŹŁàŹżàŹŹà­‡ -latin-iso8859-2Polish (język polski) DzieƄ dobry! / Czeƛć! -cyrillic-iso8859-5Russian (руссĐșĐžĐč) Đ—ĐŽŃ€Đ°ÌĐČстĐČуĐčŃ‚Đ”! -mule-unicode-0100-24ffSinhala (සිංහග) ආà¶șුබෝවන් -latin-iso8859-2Slovak (slovenčina) DobrĂœ deƈ +Lao (àșžàșČàșȘàșČàș„àșČàș§) àșȘàș°àșšàșČàșàș”àș” / àș‚ໍໃàș«à»‰à»‚àșŠàșàș”àș” +Malayalam (àŽźàŽČàŽŻàŽŸàŽłàŽ‚) àŽšàŽźàŽžà”àŽ•àŽŸàŽ°àŽ‚ +Maldivian (Ț‹ȚšȚˆȚŹȚ€Țš) Ț‡ȚŠȚ‡Ț°ȚȚŠȚȚ§Ț‰ȚȘ ȚąȚŠȚȚŠȚ‡ȚšȚ†ȚȘȚ‰Ț° / Ț†ȚšȚ€ȚšȚ‚ȚŹȚ€Ț°ŰŸ + +Maltese (il-Malti) BonÄĄu / Saħħa +Mathematics ∀ p ∈ world ‱ hello p □ +Mongolian (ĐŒĐŸĐœĐłĐŸĐ» Ń…ŃĐ») ĐĄĐ°ĐčĐœ баĐčĐœĐ° уу? +Norwegian (norsk) Hei / God dag +Oriya (àŹ“à­œàŹżàŹ†) àŹ¶à­àŹŁàŹżàŹŹà­‡ +Polish (język polski) DzieƄ dobry! / Czeƛć! +Russian (руссĐșĐžĐč) Đ—ĐŽŃ€Đ°ÌĐČстĐČуĐčŃ‚Đ”! +Sinhala (සිංහග) ආà¶șුබෝවන් +Slovak (slovenčina) DobrĂœ deƈ Slovenian (slovenơčina) Pozdravljeni! -Spanish (espalatin-iso8859-1ñol) ÂĄHola! +Spanish (español) ÂĄHola! Swedish (svenska) Hej / Goddag / HallĂ„ -mule-unicode-0100-24ffTamil (àź€àźźàźżàźŽàŻ) àź”àźŁàź•àŻàź•àźźàŻ +Tamil (àź€àźźàźżàźŽàŻ) àź”àźŁàź•àŻàź•àźźàŻ Telugu (ఀెà°Čుగు) à°šà°źà°žà±à°•à°Ÿà°°à°‚ -TaiViet (êȘêȘ«êȘ±êȘŁ êȘŒêȘ•) êȘ…êȘ°êȘ™ê«‚ êȘšêȘźê«‚ êȘêȘ«êȘ± / êȘ…êȘœ êȘšêȘ· êȘêȘ«êȘ± +TaiViet (êȘêȘ«êȘ±êȘŁ êȘŒêȘ•) êȘ…êȘ°êȘ™ê«‚ êȘšêȘźê«‚ êȘêȘ«êȘ± / êȘ…êȘœ êȘšêȘ· êȘêȘ«êȘ± + +Thai (àž àžČàž©àžČàč„àž—àžą) àžȘàž§àž±àžȘàž”àž”àž„àžŁàž±àžš / àžȘàž§àž±àžȘàž”àž”àž„àčˆàž° +Tibetan (àœ–àœŒàœ‘àŒ‹àœŠàŸàœ‘àŒ‹) àœ–àœ€àŸČàŒ‹àœ€àœČàœŠàŒ‹àœ–àœ‘àœșàŒ‹àœŁàœșàœ‚àœŠàŒŽ +Tigrigna (ቔግርኛ) ሰላማቔ +Turkish (TĂŒrkçe) Merhaba +Ukrainian (уĐșŃ€Đ°Ń—ĐœŃŃŒĐșĐ°) Вітаю +Vietnamese (tiáșżng Việt) ChĂ o báșĄn -thai-tis620Thai (àž àžČàž©àžČàč„àž—àžą) àžȘàž§àž±àžȘàž”àž”àž„àžŁàž±àžš / àžȘàž§àž±àžȘàž”àž”àž„àčˆàž° -tibetanTibetan (àœ–àœŒàœ‘àŒ‹àœŠàŸàœ‘àŒ‹) àœ–àœ€àŸČàŒ‹àœ€àœČàœŠàŒ‹àœ–àœ‘àœșàŒ‹àœŁàœșàœ‚àœŠàŒŽ -mule-unicode-0100-24ffTigrigna (ቔግርኛ) ሰላማቔ -latin-iso8859-9Turkish (TĂŒrkçe) Merhaba -cyrillic-iso8859-5Ukrainian (уĐșŃ€Đ°Ń—ĐœŃŃŒĐșĐ°) Вітаю -vietnamese-viscii-lowerVietnamese (tiáșżng vietnamese-viscii-upperVvietnamese-viscii-loweriệt) vietnamese-viscii-upperChĂ o báșĄn - japanese-jisx0208Japanese (æ—„æœŹèȘž) こんにづは katakana-jisx0201/ ïœș chinese-gb2312Chinese (äž­æ–‡,æ™źé€šèŻ,æ±‰èŻ­) äœ ć„œ @@ -98,7 +98,7 @@ Telugu (ఀెà°Čుగు) à°šà°źà°žà±à°•à°Ÿà°°à°‚ -unicode + Copyright (C) 2001-2020 Free Software Foundation, Inc. @@ -128,4 +128,4 @@ along with GNU Emacs. If not, see <. ;;; bidi-display-reordering: t ;;; coding: utf-8 ;;; inhibit-compacting-font-caches: t -;;; End: +;;; End: -- cgit v1.2.3 From d21cdb6c056453d4e4ef8a3a1f27d8bc203c09ea Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 23 Oct 2020 17:23:23 +0300 Subject: Set up composition-function-table for Egyptian * lisp/language/misc-lang.el (composition-function-table): Set up for Egyptian Hieroglyphs. --- lisp/language/misc-lang.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index e3a24c41536..3f45f70c45e 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -141,6 +141,20 @@ thin (i.e. 1-dot width) space." (vector "[\u0600-\u074F\u200C\u200D]+" 0 'arabic-shape-gstring))) +;; The Egyptian Hieroglyph Format Controls were introduced in Unicode +;; Standard v12.0. Apparently, they are not yet well supported in +;; existing fonts, as of late 2020. But there's no reason for us not +;; to be ready for when they will be! +;; The below is needed to support the arrangement of the Egyptian +;; Hieroglyphs in "quadrats", as directed by the format controls, +;; which specify how the hieroglyphs should be joined horizontally and +;; vertically. +(set-char-table-range + composition-function-table + '(#x13000 . #x1343F) + (list (vector "[\U00013000-\U0001343F]+" + 0 'compose-gstring-for-graphic))) + (provide 'misc-lang) ;;; misc-lang.el ends here -- cgit v1.2.3 From 8101083c7ab885281cbe1ede717957c8080f7111 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 23 Oct 2020 16:26:25 +0200 Subject: Fix an error in tramp-sh-handle-make-process. Dont' merge with master * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Don't use heredoc script whent the argument contains a string. --- lisp/net/tramp-sh.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 7adfb49a858..19d50fce4c5 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2863,8 +2863,10 @@ STDERR can also be a file name." ;; command. (heredoc (and (stringp program) (string-match-p "sh$" program) + (= (length args) 2) (string-equal "-c" (car args)) - (= (length args) 2))) + ;; Don't if there is a string. + (not (string-match-p "'\\|\"" (cadr args))))) ;; When PROGRAM is nil, we just provide a tty. (args (if (not heredoc) args (let ((i 250)) -- cgit v1.2.3 From 49bc8586b7abc8e1e36027ca5eec0d0488a27474 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 23 Oct 2020 16:29:46 +0200 Subject: Move some test data to follow our conventions * test/data/emacs-module/mod-test.c: Move from here... * test/src/emacs-module-resources/mod-test.c: ...to here. * test/src/emacs-module-tests.el (ert-x): Require. (mod-test-file, module/describe-function-1): * test/Makefile.in (test_module_dir): Adjust for move. * test/data/files-bug18141.el.gz: Move from here... * test/lisp/files-resources/files-bug18141.el.gz: ... to here. * test/lisp/files-tests.el (ert-x): Require. (files-test-bug-18141-file): Use ert-resource-file. * test/data/mailcap/mime.types: Move from here... * test/lisp/net/mailcap-resources/mime.types: ...to here. * test/lisp/net/mailcap-tests.el (ert-x): Require. (mailcap-tests-path): Use ert-resource-file. * test/data/somelib.el: * test/data/somelib2.el: Move from here... * test/src/lread-resources/somelib.el: * test/src/lread-resources/somelib2.el: ...to here. * test/src/lread-tests.el (ert, ert-x): Require. (lread-test-bug26837): Use ert-resource-directory. * test/data/syntax-comments.txt: Move from here.... * test/src/syntax-resources/syntax-comments.txt: ...to here. * test/src/syntax-tests.el (ert-x): Require. (syntax-comments, syntax-br-comments, syntax-pps-comments): Use ert-resource-file. * test/data/xref/file1.txt: * test/data/xref/file2.txt: Move from here... * test/lisp/progmodes/xref-resources/file1.txt: * test/lisp/progmodes/xref-resources/file2.txt: ...to here. * test/lisp/progmodes/xref-tests.el (ert, ert-x): Require. (xref-tests-data-dir): Use ert-resource-directory. --- test/Makefile.in | 2 +- test/data/emacs-module/mod-test.c | 801 ------------------------- test/data/files-bug18141.el.gz | Bin 77 -> 0 bytes test/data/mailcap/mime.types | 5 - test/data/somelib.el | 7 - test/data/somelib2.el | 7 - test/data/syntax-comments.txt | 68 --- test/data/xref/file1.txt | 2 - test/data/xref/file2.txt | 2 - test/lisp/files-resources/files-bug18141.el.gz | Bin 0 -> 77 bytes test/lisp/files-tests.el | 3 +- test/lisp/net/mailcap-resources/mime.types | 5 + test/lisp/net/mailcap-tests.el | 7 +- test/lisp/progmodes/xref-resources/file1.txt | 2 + test/lisp/progmodes/xref-resources/file2.txt | 2 + test/lisp/progmodes/xref-tests.el | 7 +- test/src/emacs-module-resources/mod-test.c | 801 +++++++++++++++++++++++++ test/src/emacs-module-tests.el | 12 +- test/src/lread-resources/somelib.el | 7 + test/src/lread-resources/somelib2.el | 7 + test/src/lread-tests.el | 8 +- test/src/syntax-resources/syntax-comments.txt | 68 +++ test/src/syntax-tests.el | 12 +- 23 files changed, 915 insertions(+), 920 deletions(-) delete mode 100644 test/data/emacs-module/mod-test.c delete mode 100644 test/data/files-bug18141.el.gz delete mode 100644 test/data/mailcap/mime.types delete mode 100644 test/data/somelib.el delete mode 100644 test/data/somelib2.el delete mode 100644 test/data/syntax-comments.txt delete mode 100644 test/data/xref/file1.txt delete mode 100644 test/data/xref/file2.txt create mode 100644 test/lisp/files-resources/files-bug18141.el.gz create mode 100644 test/lisp/net/mailcap-resources/mime.types create mode 100644 test/lisp/progmodes/xref-resources/file1.txt create mode 100644 test/lisp/progmodes/xref-resources/file2.txt create mode 100644 test/src/emacs-module-resources/mod-test.c create mode 100644 test/src/lread-resources/somelib.el create mode 100644 test/src/lread-resources/somelib2.el create mode 100644 test/src/syntax-resources/syntax-comments.txt diff --git a/test/Makefile.in b/test/Makefile.in index 9974eb54b03..67d203df297 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -132,7 +132,7 @@ emacs = EMACSLOADPATH= \ # exists, or writing to ~/.bzr.log when running bzr commands). TEST_HOME = /nonexistent -test_module_dir := data/emacs-module +test_module_dir := src/emacs-module-resources .PHONY: all check diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c deleted file mode 100644 index 258a679b207..00000000000 --- a/test/data/emacs-module/mod-test.c +++ /dev/null @@ -1,801 +0,0 @@ -/* Test GNU Emacs modules. - -Copyright 2015-2020 Free Software Foundation, Inc. - -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 . */ - -#include "config.h" - -#undef NDEBUG -#include - -#include -#include -#include -#include -#include -#include -#include - -#ifdef WINDOWSNT -/* Cannot include because of the local header by the same - name, sigh. */ -uintptr_t _beginthread (void (__cdecl *)(void *), unsigned, void *); -# if !defined __x86_64__ -# define ALIGN_STACK __attribute__((force_align_arg_pointer)) -# endif -# include /* for Sleep */ -#else /* !WINDOWSNT */ -# include -# include -#endif - -#include -#include - -#include "timespec.h" - -int plugin_is_GPL_compatible; - -#if INTPTR_MAX <= 0 -# error "INTPTR_MAX misconfigured" -#elif INTPTR_MAX <= INT_MAX || INTPTR_MAX <= LONG_MAX -# define pT "ld" -# define pZ "lu" -# define T_TYPE long -# define Z_TYPE unsigned long -#elif INTPTR_MAX <= INT64_MAX -# ifdef __MINGW32__ -# define pT "lld" -# define pZ "llu" -# define T_TYPE long long -# define Z_TYPE unsigned long long -# else -# define pT "ld" -# define pZ "lu" -# define T_TYPE long -# define Z_TYPE unsigned long -# endif -#else -# error "INTPTR_MAX too large" -#endif - -/* Smoke test to verify that EMACS_LIMB_MAX is defined. */ -_Static_assert (0 < EMACS_LIMB_MAX, "EMACS_LIMB_MAX missing or incorrect"); - -/* Always return symbol 't'. */ -static emacs_value -Fmod_test_return_t (emacs_env *env, ptrdiff_t nargs, emacs_value args[], - void *data) -{ - return env->intern (env, "t"); -} - -/* Expose simple sum function. */ -static intmax_t -sum (intmax_t a, intmax_t b) -{ - return a + b; -} - -static emacs_value -Fmod_test_sum (emacs_env *env, ptrdiff_t nargs, emacs_value args[], void *data) -{ - assert (nargs == 2); - assert ((uintptr_t) data == 0x1234); - - intmax_t a = env->extract_integer (env, args[0]); - intmax_t b = env->extract_integer (env, args[1]); - - intmax_t r = sum (a, b); - - return env->make_integer (env, r); -} - - -/* Signal '(error 56). */ -static emacs_value -Fmod_test_signal (emacs_env *env, ptrdiff_t nargs, emacs_value args[], - void *data) -{ - assert (env->non_local_exit_check (env) == emacs_funcall_exit_return); - env->non_local_exit_signal (env, env->intern (env, "error"), - env->make_integer (env, 56)); - return NULL; -} - - -/* Throw '(tag 65). */ -static emacs_value -Fmod_test_throw (emacs_env *env, ptrdiff_t nargs, emacs_value args[], - void *data) -{ - assert (env->non_local_exit_check (env) == emacs_funcall_exit_return); - env->non_local_exit_throw (env, env->intern (env, "tag"), - env->make_integer (env, 65)); - return NULL; -} - - -/* Call argument function, catch all non-local exists and return - either normal result or a list describing the non-local exit. */ -static emacs_value -Fmod_test_non_local_exit_funcall (emacs_env *env, ptrdiff_t nargs, - emacs_value args[], void *data) -{ - assert (nargs == 1); - emacs_value result = env->funcall (env, args[0], 0, NULL); - emacs_value non_local_exit_symbol, non_local_exit_data; - enum emacs_funcall_exit code - = env->non_local_exit_get (env, &non_local_exit_symbol, - &non_local_exit_data); - switch (code) - { - case emacs_funcall_exit_return: - return result; - case emacs_funcall_exit_signal: - { - env->non_local_exit_clear (env); - emacs_value Flist = env->intern (env, "list"); - emacs_value list_args[] = {env->intern (env, "signal"), - non_local_exit_symbol, non_local_exit_data}; - return env->funcall (env, Flist, 3, list_args); - } - case emacs_funcall_exit_throw: - { - env->non_local_exit_clear (env); - emacs_value Flist = env->intern (env, "list"); - emacs_value list_args[] = {env->intern (env, "throw"), - non_local_exit_symbol, non_local_exit_data}; - return env->funcall (env, Flist, 3, list_args); - } - } - - /* Never reached. */ - return env->intern (env, "nil");; -} - - -/* Return a global reference. */ -static emacs_value -Fmod_test_globref_make (emacs_env *env, ptrdiff_t nargs, emacs_value args[], - void *data) -{ - /* Make a big string and make it global. */ - char str[26 * 100]; - for (int i = 0; i < sizeof str; i++) - str[i] = 'a' + (i % 26); - - /* We don't need to null-terminate str. */ - emacs_value lisp_str = env->make_string (env, str, sizeof str); - return env->make_global_ref (env, lisp_str); -} - -/* Create a few global references from arguments and free them. */ -static emacs_value -Fmod_test_globref_free (emacs_env *env, ptrdiff_t nargs, emacs_value args[], - void *data) -{ - emacs_value refs[10]; - for (int i = 0; i < 10; i++) - { - refs[i] = env->make_global_ref (env, args[i % nargs]); - } - for (int i = 0; i < 10; i++) - { - env->free_global_ref (env, refs[i]); - } - return env->intern (env, "ok"); -} - -/* Treat a local reference as global and free it. Module assertions - should detect this case even if a global reference representing the - same object also exists. */ - -static emacs_value -Fmod_test_globref_invalid_free (emacs_env *env, ptrdiff_t nargs, - emacs_value *args, void *data) -{ - emacs_value local = env->make_integer (env, 9876); - env->make_global_ref (env, local); - env->free_global_ref (env, local); /* Not allowed. */ - return env->intern (env, "nil"); -} - -/* Allocate and free global references in a different order. */ - -static emacs_value -Fmod_test_globref_reordered (emacs_env *env, ptrdiff_t nargs, - emacs_value *args, void *data) -{ - emacs_value booleans[2] = { - env->intern (env, "nil"), - env->intern (env, "t"), - }; - emacs_value local = env->intern (env, "foo"); - emacs_value globals[4] = { - env->make_global_ref (env, local), - env->make_global_ref (env, local), - env->make_global_ref (env, env->intern (env, "foo")), - env->make_global_ref (env, env->intern (env, "bar")), - }; - emacs_value elements[4]; - for (int i = 0; i < 4; ++i) - elements[i] = booleans[env->eq (env, globals[i], local)]; - emacs_value ret = env->funcall (env, env->intern (env, "list"), 4, elements); - env->free_global_ref (env, globals[2]); - env->free_global_ref (env, globals[1]); - env->free_global_ref (env, globals[3]); - env->free_global_ref (env, globals[0]); - return ret; -} - - -/* Return a copy of the argument string where every 'a' is replaced - with 'b'. */ -static emacs_value -Fmod_test_string_a_to_b (emacs_env *env, ptrdiff_t nargs, emacs_value args[], - void *data) -{ - emacs_value lisp_str = args[0]; - ptrdiff_t size = 0; - char * buf = NULL; - - env->copy_string_contents (env, lisp_str, buf, &size); - buf = malloc (size); - env->copy_string_contents (env, lisp_str, buf, &size); - - for (ptrdiff_t i = 0; i + 1 < size; i++) - if (buf[i] == 'a') - buf[i] = 'b'; - - emacs_value ret = env->make_string (env, buf, size - 1); - free (buf); - return ret; -} - - -/* Return a unibyte string. */ -static emacs_value -Fmod_test_return_unibyte (emacs_env *env, ptrdiff_t nargs, emacs_value args[], - void *data) -{ - const char *string = "foo\x00zot"; - return env->make_unibyte_string (env, string, 7); -} - - -/* Embedded pointers in lisp objects. */ - -/* C struct (pointer to) that will be embedded. */ -struct super_struct -{ - int amazing_int; - char large_unused_buffer[512]; -}; - -/* Return a new user-pointer to a super_struct, with amazing_int set - to the passed parameter. */ -static emacs_value -Fmod_test_userptr_make (emacs_env *env, ptrdiff_t nargs, emacs_value args[], - void *data) -{ - struct super_struct *p = calloc (1, sizeof *p); - p->amazing_int = env->extract_integer (env, args[0]); - return env->make_user_ptr (env, free, p); -} - -/* Return the amazing_int of a passed 'user-pointer to a super_struct'. */ -static emacs_value -Fmod_test_userptr_get (emacs_env *env, ptrdiff_t nargs, emacs_value args[], - void *data) -{ - struct super_struct *p = env->get_user_ptr (env, args[0]); - return env->make_integer (env, p->amazing_int); -} - - -/* Fill vector in args[0] with value in args[1]. */ -static emacs_value -Fmod_test_vector_fill (emacs_env *env, ptrdiff_t nargs, emacs_value args[], - void *data) -{ - emacs_value vec = args[0]; - emacs_value val = args[1]; - ptrdiff_t size = env->vec_size (env, vec); - for (ptrdiff_t i = 0; i < size; i++) - env->vec_set (env, vec, i, val); - return env->intern (env, "t"); -} - - -/* Return whether all elements of vector in args[0] are 'eq' to value - in args[1]. */ -static emacs_value -Fmod_test_vector_eq (emacs_env *env, ptrdiff_t nargs, emacs_value args[], - void *data) -{ - emacs_value vec = args[0]; - emacs_value val = args[1]; - ptrdiff_t size = env->vec_size (env, vec); - for (ptrdiff_t i = 0; i < size; i++) - if (!env->eq (env, env->vec_get (env, vec, i), val)) - return env->intern (env, "nil"); - return env->intern (env, "t"); -} - -static emacs_value invalid_stored_value; - -/* The next two functions perform a possibly-invalid operation: they - store a value in a static variable and load it. This causes - undefined behavior if the environment that the value was created - from is no longer live. The module assertions check for this - error. */ - -static emacs_value -Fmod_test_invalid_store (emacs_env *env, ptrdiff_t nargs, emacs_value *args, - void *data) -{ - return invalid_stored_value = env->make_integer (env, 123); -} - -static emacs_value -Fmod_test_invalid_load (emacs_env *env, ptrdiff_t nargs, emacs_value *args, - void *data) -{ - return invalid_stored_value; -} - -/* The next function works in conjunction with the two previous ones. - It stows away a copy of the object created by - `Fmod_test_invalid_store' in a global reference. Module assertions - should still detect the invalid load of the local reference. */ - -static emacs_value global_copy_of_invalid_stored_value; - -static emacs_value -Fmod_test_invalid_store_copy (emacs_env *env, ptrdiff_t nargs, - emacs_value *args, void *data) -{ - emacs_value local = Fmod_test_invalid_store (env, 0, NULL, NULL); - return global_copy_of_invalid_stored_value - = env->make_global_ref (env, local); -} - -/* An invalid finalizer: Finalizers are run during garbage collection, - where Lisp code can't be executed. -module-assertions tests for - this case. */ - -static emacs_env *current_env; - -static void -invalid_finalizer (void *ptr) -{ - current_env->intern (current_env, "nil"); -} - -static emacs_value -Fmod_test_invalid_finalizer (emacs_env *env, ptrdiff_t nargs, emacs_value *args, - void *data) -{ - current_env = env; - env->make_user_ptr (env, invalid_finalizer, NULL); - return env->intern (env, "nil"); -} - -static void -signal_system_error (emacs_env *env, int error, const char *function) -{ - const char *message = strerror (error); - emacs_value message_value = env->make_string (env, message, strlen (message)); - emacs_value symbol = env->intern (env, "file-error"); - emacs_value elements[2] - = {env->make_string (env, function, strlen (function)), message_value}; - emacs_value data = env->funcall (env, env->intern (env, "list"), 2, elements); - env->non_local_exit_signal (env, symbol, data); -} - -static void -signal_errno (emacs_env *env, const char *function) -{ - signal_system_error (env, errno, function); -} - -/* A long-running operation that occasionally calls `should_quit' or - `process_input'. */ - -static emacs_value -Fmod_test_sleep_until (emacs_env *env, ptrdiff_t nargs, emacs_value *args, - void *data) -{ - assert (nargs == 2); - const struct timespec until = env->extract_time (env, args[0]); - if (env->non_local_exit_check (env)) - return NULL; - const bool process_input = env->is_not_nil (env, args[1]); - const struct timespec amount = make_timespec(0, 10000000); - while (true) - { - const struct timespec now = current_timespec (); - if (timespec_cmp (now, until) >= 0) - break; - if (nanosleep (&amount, NULL) && errno != EINTR) - { - signal_errno (env, "nanosleep"); - return NULL; - } - if ((process_input - && env->process_input (env) == emacs_process_input_quit) - || env->should_quit (env)) - return NULL; - } - return env->intern (env, "finished"); -} - -static emacs_value -Fmod_test_add_nanosecond (emacs_env *env, ptrdiff_t nargs, emacs_value *args, - void *data) -{ - assert (nargs == 1); - struct timespec time = env->extract_time (env, args[0]); - assert (time.tv_nsec >= 0); - assert (time.tv_nsec < 2000000000); /* possible leap second */ - time.tv_nsec++; - return env->make_time (env, time); -} - -static void -signal_error (emacs_env *env, const char *message) -{ - emacs_value data = env->make_string (env, message, strlen (message)); - env->non_local_exit_signal (env, env->intern (env, "error"), - env->funcall (env, env->intern (env, "list"), 1, - &data)); -} - -static void -memory_full (emacs_env *env) -{ - signal_error (env, "Memory exhausted"); -} - -enum -{ - max_count = ((SIZE_MAX < PTRDIFF_MAX ? SIZE_MAX : PTRDIFF_MAX) - / sizeof (emacs_limb_t)) -}; - -static bool -extract_big_integer (emacs_env *env, emacs_value arg, mpz_t result) -{ - int sign; - ptrdiff_t count; - bool success = env->extract_big_integer (env, arg, &sign, &count, NULL); - if (!success) - return false; - if (sign == 0) - { - mpz_set_ui (result, 0); - return true; - } - enum { order = -1, size = sizeof (emacs_limb_t), endian = 0, nails = 0 }; - assert (0 < count && count <= max_count); - emacs_limb_t *magnitude = malloc (count * size); - if (magnitude == NULL) - { - memory_full (env); - return false; - } - success = env->extract_big_integer (env, arg, NULL, &count, magnitude); - assert (success); - mpz_import (result, count, order, size, endian, nails, magnitude); - free (magnitude); - if (sign < 0) - mpz_neg (result, result); - return true; -} - -static emacs_value -make_big_integer (emacs_env *env, const mpz_t value) -{ - if (mpz_sgn (value) == 0) - return env->make_integer (env, 0); - /* See - https://gmplib.org/manual/Integer-Import-and-Export.html#index-Export. */ - enum - { - order = -1, - size = sizeof (emacs_limb_t), - endian = 0, - nails = 0, - numb = 8 * size - nails - }; - size_t count = (mpz_sizeinbase (value, 2) + numb - 1) / numb; - if (max_count < count) - { - memory_full (env); - return NULL; - } - emacs_limb_t *magnitude = malloc (count * size); - if (magnitude == NULL) - { - memory_full (env); - return NULL; - } - size_t written; - mpz_export (magnitude, &written, order, size, endian, nails, value); - assert (written == count); - assert (count <= PTRDIFF_MAX); - emacs_value result = env->make_big_integer (env, mpz_sgn (value), - (ptrdiff_t) count, magnitude); - free (magnitude); - return result; -} - -static emacs_value -Fmod_test_nanoseconds (emacs_env *env, ptrdiff_t nargs, emacs_value *args, void *data) { - assert (nargs == 1); - struct timespec time = env->extract_time (env, args[0]); - mpz_t nanoseconds; - assert (LONG_MIN <= time.tv_sec && time.tv_sec <= LONG_MAX); - mpz_init_set_si (nanoseconds, time.tv_sec); -#ifdef __MINGW32__ - _Static_assert (1000000000 <= ULONG_MAX, "unsupported architecture"); -#else - static_assert (1000000000 <= ULONG_MAX, "unsupported architecture"); -#endif - mpz_mul_ui (nanoseconds, nanoseconds, 1000000000); - assert (0 <= time.tv_nsec && time.tv_nsec <= ULONG_MAX); - mpz_add_ui (nanoseconds, nanoseconds, time.tv_nsec); - emacs_value result = make_big_integer (env, nanoseconds); - mpz_clear (nanoseconds); - return result; -} - -static emacs_value -Fmod_test_double (emacs_env *env, ptrdiff_t nargs, emacs_value *args, - void *data) -{ - assert (nargs == 1); - emacs_value arg = args[0]; - mpz_t value; - mpz_init (value); - extract_big_integer (env, arg, value); - mpz_mul_ui (value, value, 2); - emacs_value result = make_big_integer (env, value); - mpz_clear (value); - return result; -} - -static int function_data; -static int finalizer_calls_with_correct_data; -static int finalizer_calls_with_incorrect_data; - -static void -finalizer (void *data) -{ - if (data == &function_data) - ++finalizer_calls_with_correct_data; - else - ++finalizer_calls_with_incorrect_data; -} - -static emacs_value -Fmod_test_make_function_with_finalizer (emacs_env *env, ptrdiff_t nargs, - emacs_value *args, void *data) -{ - emacs_value fun - = env->make_function (env, 2, 2, Fmod_test_sum, NULL, &function_data); - env->set_function_finalizer (env, fun, finalizer); - if (env->get_function_finalizer (env, fun) != finalizer) - signal_error (env, "Invalid finalizer"); - return fun; -} - -static emacs_value -Fmod_test_function_finalizer_calls (emacs_env *env, ptrdiff_t nargs, - emacs_value *args, void *data) -{ - emacs_value Flist = env->intern (env, "list"); - emacs_value list_args[] - = {env->make_integer (env, finalizer_calls_with_correct_data), - env->make_integer (env, finalizer_calls_with_incorrect_data)}; - return env->funcall (env, Flist, 2, list_args); -} - -static void -sleep_for_half_second (void) -{ - /* mingw.org's MinGW has nanosleep, but MinGW64 doesn't. */ -#ifdef WINDOWSNT - Sleep (500); -#else - const struct timespec sleep = {0, 500000000}; - if (nanosleep (&sleep, NULL) != 0) - perror ("nanosleep"); -#endif -} - -#ifdef WINDOWSNT -static void ALIGN_STACK -#else -static void * -#endif -write_to_pipe (void *arg) -{ - /* We sleep a bit to test that writing to a pipe is indeed possible - if no environment is active. */ - sleep_for_half_second (); - FILE *stream = arg; - /* The string below should be identical to the one we compare with - in emacs-module-tests.el:module/async-pipe. */ - if (fputs ("data from thread", stream) < 0) - perror ("fputs"); - if (fclose (stream) != 0) - perror ("close"); -#ifndef WINDOWSNT - return NULL; -#endif -} - -static emacs_value -Fmod_test_async_pipe (emacs_env *env, ptrdiff_t nargs, emacs_value *args, - void *data) -{ - assert (nargs == 1); - int fd = env->open_channel (env, args[0]); - if (env->non_local_exit_check (env) != emacs_funcall_exit_return) - return NULL; - FILE *stream = fdopen (fd, "w"); - if (stream == NULL) - { - signal_errno (env, "fdopen"); - return NULL; - } -#ifdef WINDOWSNT - uintptr_t thd = _beginthread (write_to_pipe, 0, stream); - int error = (thd == (uintptr_t)-1L) ? errno : 0; -#else /* !WINDOWSNT */ - pthread_t thread; - int error - = pthread_create (&thread, NULL, write_to_pipe, stream); -#endif - if (error != 0) - { - signal_system_error (env, error, "thread create"); - if (fclose (stream) != 0) - perror ("fclose"); - return NULL; - } - return env->intern (env, "nil"); -} - -static emacs_value -Fmod_test_identity (emacs_env *env, ptrdiff_t nargs, emacs_value *args, - void *data) -{ - assert (nargs == 1); - return args[0]; -} - -/* Lisp utilities for easier readability (simple wrappers). */ - -/* Provide FEATURE to Emacs. */ -static void -provide (emacs_env *env, const char *feature) -{ - emacs_value Qfeat = env->intern (env, feature); - emacs_value Qprovide = env->intern (env, "provide"); - emacs_value args[] = { Qfeat }; - - env->funcall (env, Qprovide, 1, args); -} - -/* Bind NAME to FUN. */ -static void -bind_function (emacs_env *env, const char *name, emacs_value Sfun) -{ - emacs_value Qdefalias = env->intern (env, "defalias"); - emacs_value Qsym = env->intern (env, name); - emacs_value args[] = { Qsym, Sfun }; - - env->funcall (env, Qdefalias, 2, args); -} - -/* Module init function. */ -int -emacs_module_init (struct emacs_runtime *ert) -{ - /* Check that EMACS_MAJOR_VERSION is defined and an integral - constant. */ - char dummy[EMACS_MAJOR_VERSION]; - assert (27 <= sizeof dummy); - - if (ert->size < sizeof *ert) - { - fprintf (stderr, "Runtime size of runtime structure (%"pT" bytes) " - "smaller than compile-time size (%"pZ" bytes)", - (T_TYPE) ert->size, (Z_TYPE) sizeof (*ert)); - return 1; - } - - emacs_env *env = ert->get_environment (ert); - - if (env->size < sizeof *env) - { - fprintf (stderr, "Runtime size of environment structure (%"pT" bytes) " - "smaller than compile-time size (%"pZ" bytes)", - (T_TYPE) env->size, (Z_TYPE) sizeof (*env)); - return 2; - } - -#define DEFUN(lsym, csym, amin, amax, doc, data) \ - bind_function (env, lsym, \ - env->make_function (env, amin, amax, csym, doc, data)) - - DEFUN ("mod-test-return-t", Fmod_test_return_t, 1, 1, NULL, NULL); - DEFUN ("mod-test-sum", Fmod_test_sum, 2, 2, "Return A + B\n\n(fn a b)", - (void *) (uintptr_t) 0x1234); - DEFUN ("mod-test-signal", Fmod_test_signal, 0, 0, NULL, NULL); - DEFUN ("mod-test-throw", Fmod_test_throw, 0, 0, NULL, NULL); - DEFUN ("mod-test-non-local-exit-funcall", Fmod_test_non_local_exit_funcall, - 1, 1, NULL, NULL); - DEFUN ("mod-test-globref-make", Fmod_test_globref_make, 0, 0, NULL, NULL); - DEFUN ("mod-test-globref-free", Fmod_test_globref_free, 4, 4, NULL, NULL); - DEFUN ("mod-test-globref-invalid-free", Fmod_test_globref_invalid_free, 0, 0, - NULL, NULL); - DEFUN ("mod-test-globref-reordered", Fmod_test_globref_reordered, 0, 0, NULL, - NULL); - DEFUN ("mod-test-string-a-to-b", Fmod_test_string_a_to_b, 1, 1, NULL, NULL); - DEFUN ("mod-test-return-unibyte", Fmod_test_return_unibyte, 0, 0, NULL, NULL); - DEFUN ("mod-test-userptr-make", Fmod_test_userptr_make, 1, 1, NULL, NULL); - DEFUN ("mod-test-userptr-get", Fmod_test_userptr_get, 1, 1, NULL, NULL); - DEFUN ("mod-test-vector-fill", Fmod_test_vector_fill, 2, 2, NULL, NULL); - DEFUN ("mod-test-vector-eq", Fmod_test_vector_eq, 2, 2, NULL, NULL); - DEFUN ("mod-test-invalid-store", Fmod_test_invalid_store, 0, 0, NULL, NULL); - DEFUN ("mod-test-invalid-store-copy", Fmod_test_invalid_store_copy, 0, 0, - NULL, NULL); - DEFUN ("mod-test-invalid-load", Fmod_test_invalid_load, 0, 0, NULL, NULL); - DEFUN ("mod-test-invalid-finalizer", Fmod_test_invalid_finalizer, 0, 0, - NULL, NULL); - DEFUN ("mod-test-sleep-until", Fmod_test_sleep_until, 2, 2, NULL, NULL); - DEFUN ("mod-test-add-nanosecond", Fmod_test_add_nanosecond, 1, 1, NULL, NULL); - DEFUN ("mod-test-nanoseconds", Fmod_test_nanoseconds, 1, 1, NULL, NULL); - DEFUN ("mod-test-double", Fmod_test_double, 1, 1, NULL, NULL); - DEFUN ("mod-test-make-function-with-finalizer", - Fmod_test_make_function_with_finalizer, 0, 0, NULL, NULL); - DEFUN ("mod-test-function-finalizer-calls", - Fmod_test_function_finalizer_calls, 0, 0, NULL, NULL); - DEFUN ("mod-test-async-pipe", Fmod_test_async_pipe, 1, 1, NULL, NULL); - -#undef DEFUN - - emacs_value constant_fn - = env->make_function (env, 0, 0, Fmod_test_return_t, NULL, NULL); - env->make_interactive (env, constant_fn, env->intern (env, "nil")); - bind_function (env, "mod-test-return-t-int", constant_fn); - - emacs_value identity_fn - = env->make_function (env, 1, 1, Fmod_test_identity, NULL, NULL); - const char *interactive_spec = "i"; - env->make_interactive (env, identity_fn, - env->make_string (env, interactive_spec, - strlen (interactive_spec))); - bind_function (env, "mod-test-identity", identity_fn); - - provide (env, "mod-test"); - return 0; -} diff --git a/test/data/files-bug18141.el.gz b/test/data/files-bug18141.el.gz deleted file mode 100644 index 53d463e85b5..00000000000 Binary files a/test/data/files-bug18141.el.gz and /dev/null differ diff --git a/test/data/mailcap/mime.types b/test/data/mailcap/mime.types deleted file mode 100644 index 4bedfaf9702..00000000000 --- a/test/data/mailcap/mime.types +++ /dev/null @@ -1,5 +0,0 @@ -# this is a comment - -audio/ogg opus -audio/flac flac -audio/x-wav wav diff --git a/test/data/somelib.el b/test/data/somelib.el deleted file mode 100644 index 7b8d4037396..00000000000 --- a/test/data/somelib.el +++ /dev/null @@ -1,7 +0,0 @@ -;;; -*- lexical-binding: t; -*- - -;; blah - -(defun somefunc () t) - -(provide 'somelib) diff --git a/test/data/somelib2.el b/test/data/somelib2.el deleted file mode 100644 index 05156145a22..00000000000 --- a/test/data/somelib2.el +++ /dev/null @@ -1,7 +0,0 @@ -;;; -*- lexical-binding: t; -*- - -;; blah - -(defun somefunc2 () t) - -(provide 'somelib2) diff --git a/test/data/syntax-comments.txt b/test/data/syntax-comments.txt deleted file mode 100644 index 6f595e4d8dc..00000000000 --- a/test/data/syntax-comments.txt +++ /dev/null @@ -1,68 +0,0 @@ -/* This file is a test file for tests of the comment handling in src/syntax.c. - This includes the testing of comments which figure in parse-partial-sexp - and scan-lists. */ - -/* Straight C comments */ -1/* comment */1 -2/**/2 -3// comment -3 -4// -4 -5/*/5 -6*/6 -7/* \*/7 -8*/8 -9/* \\*/9 -10*/10 -11// \ -12 -11 -13// \\ -14 -13 -15/* /*/15 - -/* C Comments within lists */ -59}59 -50{ /*70 comment */71 }50 -51{ /**/ }51 -52{ //72 comment -73}52 -53{ // -}53 -54{ //74 \ -}54 -55{/* */}55 -56{ /*76 \*/ }56 -57*/77 -58}58 -60{ /*78 \\*/79}60 - - -/* Straight Pascal comments (not nested) */ -20}20 -21{ Comment }21 -22{}22 -23{ -}23 -24{ -25{25 -}24 -26{ \}26 - - -/* Straight Lisp comments (not nested) */ -30 -30 -31; Comment -31 -32;;;;;;;;; -32 -33; \ -33 - -Local Variables: -mode: fundamental -eval: (set-syntax-table (make-syntax-table)) -End: diff --git a/test/data/xref/file1.txt b/test/data/xref/file1.txt deleted file mode 100644 index 5d7cc544443..00000000000 --- a/test/data/xref/file1.txt +++ /dev/null @@ -1,2 +0,0 @@ -foo foo -bar diff --git a/test/data/xref/file2.txt b/test/data/xref/file2.txt deleted file mode 100644 index 9f075f26004..00000000000 --- a/test/data/xref/file2.txt +++ /dev/null @@ -1,2 +0,0 @@ - -bar diff --git a/test/lisp/files-resources/files-bug18141.el.gz b/test/lisp/files-resources/files-bug18141.el.gz new file mode 100644 index 00000000000..53d463e85b5 Binary files /dev/null and b/test/lisp/files-resources/files-bug18141.el.gz differ diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index 1b964af6887..8818099a223 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -20,6 +20,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'nadvice) (eval-when-compile (require 'cl-lib)) (require 'bytecomp) ; `byte-compiler-base-file-name'. @@ -151,7 +152,7 @@ form.") (should (file-test--do-local-variables-test str subtest))))))) (defvar files-test-bug-18141-file - (expand-file-name "data/files-bug18141.el.gz" (getenv "EMACS_TEST_DIRECTORY")) + (ert-resource-file "files-bug18141.el.gz") "Test file for bug#18141.") (ert-deftest files-tests-bug-18141 () diff --git a/test/lisp/net/mailcap-resources/mime.types b/test/lisp/net/mailcap-resources/mime.types new file mode 100644 index 00000000000..4bedfaf9702 --- /dev/null +++ b/test/lisp/net/mailcap-resources/mime.types @@ -0,0 +1,5 @@ +# this is a comment + +audio/ogg opus +audio/flac flac +audio/x-wav wav diff --git a/test/lisp/net/mailcap-tests.el b/test/lisp/net/mailcap-tests.el index 8354d8e5e23..0ebbec61159 100644 --- a/test/lisp/net/mailcap-tests.el +++ b/test/lisp/net/mailcap-tests.el @@ -24,13 +24,10 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'mailcap) -(defconst mailcap-tests-data-dir - (expand-file-name "test/data/mailcap" source-directory)) - -(defconst mailcap-tests-path - (expand-file-name "mime.types" mailcap-tests-data-dir) +(defconst mailcap-tests-path (ert-resource-file "mime.types") "String used as PATH argument of `mailcap-parse-mimetypes'.") (defconst mailcap-tests-mime-extensions (copy-alist mailcap-mime-extensions)) diff --git a/test/lisp/progmodes/xref-resources/file1.txt b/test/lisp/progmodes/xref-resources/file1.txt new file mode 100644 index 00000000000..5d7cc544443 --- /dev/null +++ b/test/lisp/progmodes/xref-resources/file1.txt @@ -0,0 +1,2 @@ +foo foo +bar diff --git a/test/lisp/progmodes/xref-resources/file2.txt b/test/lisp/progmodes/xref-resources/file2.txt new file mode 100644 index 00000000000..9f075f26004 --- /dev/null +++ b/test/lisp/progmodes/xref-resources/file2.txt @@ -0,0 +1,2 @@ + +bar diff --git a/test/lisp/progmodes/xref-tests.el b/test/lisp/progmodes/xref-tests.el index a4980b2acb1..060c9cb5d1c 100644 --- a/test/lisp/progmodes/xref-tests.el +++ b/test/lisp/progmodes/xref-tests.el @@ -23,13 +23,12 @@ ;;; Code: +(require 'ert) +(require 'ert-x) (require 'xref) (require 'cl-lib) -(defvar xref-tests-data-dir - (expand-file-name "../../../data/xref/" - (or load-file-name - buffer-file-name))) +(defvar xref-tests-data-dir (ert-resource-directory)) (ert-deftest xref-matches-in-directory-finds-none-for-some-regexp () (should (null (xref-matches-in-directory "zzz" "*" xref-tests-data-dir nil)))) diff --git a/test/src/emacs-module-resources/mod-test.c b/test/src/emacs-module-resources/mod-test.c new file mode 100644 index 00000000000..258a679b207 --- /dev/null +++ b/test/src/emacs-module-resources/mod-test.c @@ -0,0 +1,801 @@ +/* Test GNU Emacs modules. + +Copyright 2015-2020 Free Software Foundation, Inc. + +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 . */ + +#include "config.h" + +#undef NDEBUG +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef WINDOWSNT +/* Cannot include because of the local header by the same + name, sigh. */ +uintptr_t _beginthread (void (__cdecl *)(void *), unsigned, void *); +# if !defined __x86_64__ +# define ALIGN_STACK __attribute__((force_align_arg_pointer)) +# endif +# include /* for Sleep */ +#else /* !WINDOWSNT */ +# include +# include +#endif + +#include +#include + +#include "timespec.h" + +int plugin_is_GPL_compatible; + +#if INTPTR_MAX <= 0 +# error "INTPTR_MAX misconfigured" +#elif INTPTR_MAX <= INT_MAX || INTPTR_MAX <= LONG_MAX +# define pT "ld" +# define pZ "lu" +# define T_TYPE long +# define Z_TYPE unsigned long +#elif INTPTR_MAX <= INT64_MAX +# ifdef __MINGW32__ +# define pT "lld" +# define pZ "llu" +# define T_TYPE long long +# define Z_TYPE unsigned long long +# else +# define pT "ld" +# define pZ "lu" +# define T_TYPE long +# define Z_TYPE unsigned long +# endif +#else +# error "INTPTR_MAX too large" +#endif + +/* Smoke test to verify that EMACS_LIMB_MAX is defined. */ +_Static_assert (0 < EMACS_LIMB_MAX, "EMACS_LIMB_MAX missing or incorrect"); + +/* Always return symbol 't'. */ +static emacs_value +Fmod_test_return_t (emacs_env *env, ptrdiff_t nargs, emacs_value args[], + void *data) +{ + return env->intern (env, "t"); +} + +/* Expose simple sum function. */ +static intmax_t +sum (intmax_t a, intmax_t b) +{ + return a + b; +} + +static emacs_value +Fmod_test_sum (emacs_env *env, ptrdiff_t nargs, emacs_value args[], void *data) +{ + assert (nargs == 2); + assert ((uintptr_t) data == 0x1234); + + intmax_t a = env->extract_integer (env, args[0]); + intmax_t b = env->extract_integer (env, args[1]); + + intmax_t r = sum (a, b); + + return env->make_integer (env, r); +} + + +/* Signal '(error 56). */ +static emacs_value +Fmod_test_signal (emacs_env *env, ptrdiff_t nargs, emacs_value args[], + void *data) +{ + assert (env->non_local_exit_check (env) == emacs_funcall_exit_return); + env->non_local_exit_signal (env, env->intern (env, "error"), + env->make_integer (env, 56)); + return NULL; +} + + +/* Throw '(tag 65). */ +static emacs_value +Fmod_test_throw (emacs_env *env, ptrdiff_t nargs, emacs_value args[], + void *data) +{ + assert (env->non_local_exit_check (env) == emacs_funcall_exit_return); + env->non_local_exit_throw (env, env->intern (env, "tag"), + env->make_integer (env, 65)); + return NULL; +} + + +/* Call argument function, catch all non-local exists and return + either normal result or a list describing the non-local exit. */ +static emacs_value +Fmod_test_non_local_exit_funcall (emacs_env *env, ptrdiff_t nargs, + emacs_value args[], void *data) +{ + assert (nargs == 1); + emacs_value result = env->funcall (env, args[0], 0, NULL); + emacs_value non_local_exit_symbol, non_local_exit_data; + enum emacs_funcall_exit code + = env->non_local_exit_get (env, &non_local_exit_symbol, + &non_local_exit_data); + switch (code) + { + case emacs_funcall_exit_return: + return result; + case emacs_funcall_exit_signal: + { + env->non_local_exit_clear (env); + emacs_value Flist = env->intern (env, "list"); + emacs_value list_args[] = {env->intern (env, "signal"), + non_local_exit_symbol, non_local_exit_data}; + return env->funcall (env, Flist, 3, list_args); + } + case emacs_funcall_exit_throw: + { + env->non_local_exit_clear (env); + emacs_value Flist = env->intern (env, "list"); + emacs_value list_args[] = {env->intern (env, "throw"), + non_local_exit_symbol, non_local_exit_data}; + return env->funcall (env, Flist, 3, list_args); + } + } + + /* Never reached. */ + return env->intern (env, "nil");; +} + + +/* Return a global reference. */ +static emacs_value +Fmod_test_globref_make (emacs_env *env, ptrdiff_t nargs, emacs_value args[], + void *data) +{ + /* Make a big string and make it global. */ + char str[26 * 100]; + for (int i = 0; i < sizeof str; i++) + str[i] = 'a' + (i % 26); + + /* We don't need to null-terminate str. */ + emacs_value lisp_str = env->make_string (env, str, sizeof str); + return env->make_global_ref (env, lisp_str); +} + +/* Create a few global references from arguments and free them. */ +static emacs_value +Fmod_test_globref_free (emacs_env *env, ptrdiff_t nargs, emacs_value args[], + void *data) +{ + emacs_value refs[10]; + for (int i = 0; i < 10; i++) + { + refs[i] = env->make_global_ref (env, args[i % nargs]); + } + for (int i = 0; i < 10; i++) + { + env->free_global_ref (env, refs[i]); + } + return env->intern (env, "ok"); +} + +/* Treat a local reference as global and free it. Module assertions + should detect this case even if a global reference representing the + same object also exists. */ + +static emacs_value +Fmod_test_globref_invalid_free (emacs_env *env, ptrdiff_t nargs, + emacs_value *args, void *data) +{ + emacs_value local = env->make_integer (env, 9876); + env->make_global_ref (env, local); + env->free_global_ref (env, local); /* Not allowed. */ + return env->intern (env, "nil"); +} + +/* Allocate and free global references in a different order. */ + +static emacs_value +Fmod_test_globref_reordered (emacs_env *env, ptrdiff_t nargs, + emacs_value *args, void *data) +{ + emacs_value booleans[2] = { + env->intern (env, "nil"), + env->intern (env, "t"), + }; + emacs_value local = env->intern (env, "foo"); + emacs_value globals[4] = { + env->make_global_ref (env, local), + env->make_global_ref (env, local), + env->make_global_ref (env, env->intern (env, "foo")), + env->make_global_ref (env, env->intern (env, "bar")), + }; + emacs_value elements[4]; + for (int i = 0; i < 4; ++i) + elements[i] = booleans[env->eq (env, globals[i], local)]; + emacs_value ret = env->funcall (env, env->intern (env, "list"), 4, elements); + env->free_global_ref (env, globals[2]); + env->free_global_ref (env, globals[1]); + env->free_global_ref (env, globals[3]); + env->free_global_ref (env, globals[0]); + return ret; +} + + +/* Return a copy of the argument string where every 'a' is replaced + with 'b'. */ +static emacs_value +Fmod_test_string_a_to_b (emacs_env *env, ptrdiff_t nargs, emacs_value args[], + void *data) +{ + emacs_value lisp_str = args[0]; + ptrdiff_t size = 0; + char * buf = NULL; + + env->copy_string_contents (env, lisp_str, buf, &size); + buf = malloc (size); + env->copy_string_contents (env, lisp_str, buf, &size); + + for (ptrdiff_t i = 0; i + 1 < size; i++) + if (buf[i] == 'a') + buf[i] = 'b'; + + emacs_value ret = env->make_string (env, buf, size - 1); + free (buf); + return ret; +} + + +/* Return a unibyte string. */ +static emacs_value +Fmod_test_return_unibyte (emacs_env *env, ptrdiff_t nargs, emacs_value args[], + void *data) +{ + const char *string = "foo\x00zot"; + return env->make_unibyte_string (env, string, 7); +} + + +/* Embedded pointers in lisp objects. */ + +/* C struct (pointer to) that will be embedded. */ +struct super_struct +{ + int amazing_int; + char large_unused_buffer[512]; +}; + +/* Return a new user-pointer to a super_struct, with amazing_int set + to the passed parameter. */ +static emacs_value +Fmod_test_userptr_make (emacs_env *env, ptrdiff_t nargs, emacs_value args[], + void *data) +{ + struct super_struct *p = calloc (1, sizeof *p); + p->amazing_int = env->extract_integer (env, args[0]); + return env->make_user_ptr (env, free, p); +} + +/* Return the amazing_int of a passed 'user-pointer to a super_struct'. */ +static emacs_value +Fmod_test_userptr_get (emacs_env *env, ptrdiff_t nargs, emacs_value args[], + void *data) +{ + struct super_struct *p = env->get_user_ptr (env, args[0]); + return env->make_integer (env, p->amazing_int); +} + + +/* Fill vector in args[0] with value in args[1]. */ +static emacs_value +Fmod_test_vector_fill (emacs_env *env, ptrdiff_t nargs, emacs_value args[], + void *data) +{ + emacs_value vec = args[0]; + emacs_value val = args[1]; + ptrdiff_t size = env->vec_size (env, vec); + for (ptrdiff_t i = 0; i < size; i++) + env->vec_set (env, vec, i, val); + return env->intern (env, "t"); +} + + +/* Return whether all elements of vector in args[0] are 'eq' to value + in args[1]. */ +static emacs_value +Fmod_test_vector_eq (emacs_env *env, ptrdiff_t nargs, emacs_value args[], + void *data) +{ + emacs_value vec = args[0]; + emacs_value val = args[1]; + ptrdiff_t size = env->vec_size (env, vec); + for (ptrdiff_t i = 0; i < size; i++) + if (!env->eq (env, env->vec_get (env, vec, i), val)) + return env->intern (env, "nil"); + return env->intern (env, "t"); +} + +static emacs_value invalid_stored_value; + +/* The next two functions perform a possibly-invalid operation: they + store a value in a static variable and load it. This causes + undefined behavior if the environment that the value was created + from is no longer live. The module assertions check for this + error. */ + +static emacs_value +Fmod_test_invalid_store (emacs_env *env, ptrdiff_t nargs, emacs_value *args, + void *data) +{ + return invalid_stored_value = env->make_integer (env, 123); +} + +static emacs_value +Fmod_test_invalid_load (emacs_env *env, ptrdiff_t nargs, emacs_value *args, + void *data) +{ + return invalid_stored_value; +} + +/* The next function works in conjunction with the two previous ones. + It stows away a copy of the object created by + `Fmod_test_invalid_store' in a global reference. Module assertions + should still detect the invalid load of the local reference. */ + +static emacs_value global_copy_of_invalid_stored_value; + +static emacs_value +Fmod_test_invalid_store_copy (emacs_env *env, ptrdiff_t nargs, + emacs_value *args, void *data) +{ + emacs_value local = Fmod_test_invalid_store (env, 0, NULL, NULL); + return global_copy_of_invalid_stored_value + = env->make_global_ref (env, local); +} + +/* An invalid finalizer: Finalizers are run during garbage collection, + where Lisp code can't be executed. -module-assertions tests for + this case. */ + +static emacs_env *current_env; + +static void +invalid_finalizer (void *ptr) +{ + current_env->intern (current_env, "nil"); +} + +static emacs_value +Fmod_test_invalid_finalizer (emacs_env *env, ptrdiff_t nargs, emacs_value *args, + void *data) +{ + current_env = env; + env->make_user_ptr (env, invalid_finalizer, NULL); + return env->intern (env, "nil"); +} + +static void +signal_system_error (emacs_env *env, int error, const char *function) +{ + const char *message = strerror (error); + emacs_value message_value = env->make_string (env, message, strlen (message)); + emacs_value symbol = env->intern (env, "file-error"); + emacs_value elements[2] + = {env->make_string (env, function, strlen (function)), message_value}; + emacs_value data = env->funcall (env, env->intern (env, "list"), 2, elements); + env->non_local_exit_signal (env, symbol, data); +} + +static void +signal_errno (emacs_env *env, const char *function) +{ + signal_system_error (env, errno, function); +} + +/* A long-running operation that occasionally calls `should_quit' or + `process_input'. */ + +static emacs_value +Fmod_test_sleep_until (emacs_env *env, ptrdiff_t nargs, emacs_value *args, + void *data) +{ + assert (nargs == 2); + const struct timespec until = env->extract_time (env, args[0]); + if (env->non_local_exit_check (env)) + return NULL; + const bool process_input = env->is_not_nil (env, args[1]); + const struct timespec amount = make_timespec(0, 10000000); + while (true) + { + const struct timespec now = current_timespec (); + if (timespec_cmp (now, until) >= 0) + break; + if (nanosleep (&amount, NULL) && errno != EINTR) + { + signal_errno (env, "nanosleep"); + return NULL; + } + if ((process_input + && env->process_input (env) == emacs_process_input_quit) + || env->should_quit (env)) + return NULL; + } + return env->intern (env, "finished"); +} + +static emacs_value +Fmod_test_add_nanosecond (emacs_env *env, ptrdiff_t nargs, emacs_value *args, + void *data) +{ + assert (nargs == 1); + struct timespec time = env->extract_time (env, args[0]); + assert (time.tv_nsec >= 0); + assert (time.tv_nsec < 2000000000); /* possible leap second */ + time.tv_nsec++; + return env->make_time (env, time); +} + +static void +signal_error (emacs_env *env, const char *message) +{ + emacs_value data = env->make_string (env, message, strlen (message)); + env->non_local_exit_signal (env, env->intern (env, "error"), + env->funcall (env, env->intern (env, "list"), 1, + &data)); +} + +static void +memory_full (emacs_env *env) +{ + signal_error (env, "Memory exhausted"); +} + +enum +{ + max_count = ((SIZE_MAX < PTRDIFF_MAX ? SIZE_MAX : PTRDIFF_MAX) + / sizeof (emacs_limb_t)) +}; + +static bool +extract_big_integer (emacs_env *env, emacs_value arg, mpz_t result) +{ + int sign; + ptrdiff_t count; + bool success = env->extract_big_integer (env, arg, &sign, &count, NULL); + if (!success) + return false; + if (sign == 0) + { + mpz_set_ui (result, 0); + return true; + } + enum { order = -1, size = sizeof (emacs_limb_t), endian = 0, nails = 0 }; + assert (0 < count && count <= max_count); + emacs_limb_t *magnitude = malloc (count * size); + if (magnitude == NULL) + { + memory_full (env); + return false; + } + success = env->extract_big_integer (env, arg, NULL, &count, magnitude); + assert (success); + mpz_import (result, count, order, size, endian, nails, magnitude); + free (magnitude); + if (sign < 0) + mpz_neg (result, result); + return true; +} + +static emacs_value +make_big_integer (emacs_env *env, const mpz_t value) +{ + if (mpz_sgn (value) == 0) + return env->make_integer (env, 0); + /* See + https://gmplib.org/manual/Integer-Import-and-Export.html#index-Export. */ + enum + { + order = -1, + size = sizeof (emacs_limb_t), + endian = 0, + nails = 0, + numb = 8 * size - nails + }; + size_t count = (mpz_sizeinbase (value, 2) + numb - 1) / numb; + if (max_count < count) + { + memory_full (env); + return NULL; + } + emacs_limb_t *magnitude = malloc (count * size); + if (magnitude == NULL) + { + memory_full (env); + return NULL; + } + size_t written; + mpz_export (magnitude, &written, order, size, endian, nails, value); + assert (written == count); + assert (count <= PTRDIFF_MAX); + emacs_value result = env->make_big_integer (env, mpz_sgn (value), + (ptrdiff_t) count, magnitude); + free (magnitude); + return result; +} + +static emacs_value +Fmod_test_nanoseconds (emacs_env *env, ptrdiff_t nargs, emacs_value *args, void *data) { + assert (nargs == 1); + struct timespec time = env->extract_time (env, args[0]); + mpz_t nanoseconds; + assert (LONG_MIN <= time.tv_sec && time.tv_sec <= LONG_MAX); + mpz_init_set_si (nanoseconds, time.tv_sec); +#ifdef __MINGW32__ + _Static_assert (1000000000 <= ULONG_MAX, "unsupported architecture"); +#else + static_assert (1000000000 <= ULONG_MAX, "unsupported architecture"); +#endif + mpz_mul_ui (nanoseconds, nanoseconds, 1000000000); + assert (0 <= time.tv_nsec && time.tv_nsec <= ULONG_MAX); + mpz_add_ui (nanoseconds, nanoseconds, time.tv_nsec); + emacs_value result = make_big_integer (env, nanoseconds); + mpz_clear (nanoseconds); + return result; +} + +static emacs_value +Fmod_test_double (emacs_env *env, ptrdiff_t nargs, emacs_value *args, + void *data) +{ + assert (nargs == 1); + emacs_value arg = args[0]; + mpz_t value; + mpz_init (value); + extract_big_integer (env, arg, value); + mpz_mul_ui (value, value, 2); + emacs_value result = make_big_integer (env, value); + mpz_clear (value); + return result; +} + +static int function_data; +static int finalizer_calls_with_correct_data; +static int finalizer_calls_with_incorrect_data; + +static void +finalizer (void *data) +{ + if (data == &function_data) + ++finalizer_calls_with_correct_data; + else + ++finalizer_calls_with_incorrect_data; +} + +static emacs_value +Fmod_test_make_function_with_finalizer (emacs_env *env, ptrdiff_t nargs, + emacs_value *args, void *data) +{ + emacs_value fun + = env->make_function (env, 2, 2, Fmod_test_sum, NULL, &function_data); + env->set_function_finalizer (env, fun, finalizer); + if (env->get_function_finalizer (env, fun) != finalizer) + signal_error (env, "Invalid finalizer"); + return fun; +} + +static emacs_value +Fmod_test_function_finalizer_calls (emacs_env *env, ptrdiff_t nargs, + emacs_value *args, void *data) +{ + emacs_value Flist = env->intern (env, "list"); + emacs_value list_args[] + = {env->make_integer (env, finalizer_calls_with_correct_data), + env->make_integer (env, finalizer_calls_with_incorrect_data)}; + return env->funcall (env, Flist, 2, list_args); +} + +static void +sleep_for_half_second (void) +{ + /* mingw.org's MinGW has nanosleep, but MinGW64 doesn't. */ +#ifdef WINDOWSNT + Sleep (500); +#else + const struct timespec sleep = {0, 500000000}; + if (nanosleep (&sleep, NULL) != 0) + perror ("nanosleep"); +#endif +} + +#ifdef WINDOWSNT +static void ALIGN_STACK +#else +static void * +#endif +write_to_pipe (void *arg) +{ + /* We sleep a bit to test that writing to a pipe is indeed possible + if no environment is active. */ + sleep_for_half_second (); + FILE *stream = arg; + /* The string below should be identical to the one we compare with + in emacs-module-tests.el:module/async-pipe. */ + if (fputs ("data from thread", stream) < 0) + perror ("fputs"); + if (fclose (stream) != 0) + perror ("close"); +#ifndef WINDOWSNT + return NULL; +#endif +} + +static emacs_value +Fmod_test_async_pipe (emacs_env *env, ptrdiff_t nargs, emacs_value *args, + void *data) +{ + assert (nargs == 1); + int fd = env->open_channel (env, args[0]); + if (env->non_local_exit_check (env) != emacs_funcall_exit_return) + return NULL; + FILE *stream = fdopen (fd, "w"); + if (stream == NULL) + { + signal_errno (env, "fdopen"); + return NULL; + } +#ifdef WINDOWSNT + uintptr_t thd = _beginthread (write_to_pipe, 0, stream); + int error = (thd == (uintptr_t)-1L) ? errno : 0; +#else /* !WINDOWSNT */ + pthread_t thread; + int error + = pthread_create (&thread, NULL, write_to_pipe, stream); +#endif + if (error != 0) + { + signal_system_error (env, error, "thread create"); + if (fclose (stream) != 0) + perror ("fclose"); + return NULL; + } + return env->intern (env, "nil"); +} + +static emacs_value +Fmod_test_identity (emacs_env *env, ptrdiff_t nargs, emacs_value *args, + void *data) +{ + assert (nargs == 1); + return args[0]; +} + +/* Lisp utilities for easier readability (simple wrappers). */ + +/* Provide FEATURE to Emacs. */ +static void +provide (emacs_env *env, const char *feature) +{ + emacs_value Qfeat = env->intern (env, feature); + emacs_value Qprovide = env->intern (env, "provide"); + emacs_value args[] = { Qfeat }; + + env->funcall (env, Qprovide, 1, args); +} + +/* Bind NAME to FUN. */ +static void +bind_function (emacs_env *env, const char *name, emacs_value Sfun) +{ + emacs_value Qdefalias = env->intern (env, "defalias"); + emacs_value Qsym = env->intern (env, name); + emacs_value args[] = { Qsym, Sfun }; + + env->funcall (env, Qdefalias, 2, args); +} + +/* Module init function. */ +int +emacs_module_init (struct emacs_runtime *ert) +{ + /* Check that EMACS_MAJOR_VERSION is defined and an integral + constant. */ + char dummy[EMACS_MAJOR_VERSION]; + assert (27 <= sizeof dummy); + + if (ert->size < sizeof *ert) + { + fprintf (stderr, "Runtime size of runtime structure (%"pT" bytes) " + "smaller than compile-time size (%"pZ" bytes)", + (T_TYPE) ert->size, (Z_TYPE) sizeof (*ert)); + return 1; + } + + emacs_env *env = ert->get_environment (ert); + + if (env->size < sizeof *env) + { + fprintf (stderr, "Runtime size of environment structure (%"pT" bytes) " + "smaller than compile-time size (%"pZ" bytes)", + (T_TYPE) env->size, (Z_TYPE) sizeof (*env)); + return 2; + } + +#define DEFUN(lsym, csym, amin, amax, doc, data) \ + bind_function (env, lsym, \ + env->make_function (env, amin, amax, csym, doc, data)) + + DEFUN ("mod-test-return-t", Fmod_test_return_t, 1, 1, NULL, NULL); + DEFUN ("mod-test-sum", Fmod_test_sum, 2, 2, "Return A + B\n\n(fn a b)", + (void *) (uintptr_t) 0x1234); + DEFUN ("mod-test-signal", Fmod_test_signal, 0, 0, NULL, NULL); + DEFUN ("mod-test-throw", Fmod_test_throw, 0, 0, NULL, NULL); + DEFUN ("mod-test-non-local-exit-funcall", Fmod_test_non_local_exit_funcall, + 1, 1, NULL, NULL); + DEFUN ("mod-test-globref-make", Fmod_test_globref_make, 0, 0, NULL, NULL); + DEFUN ("mod-test-globref-free", Fmod_test_globref_free, 4, 4, NULL, NULL); + DEFUN ("mod-test-globref-invalid-free", Fmod_test_globref_invalid_free, 0, 0, + NULL, NULL); + DEFUN ("mod-test-globref-reordered", Fmod_test_globref_reordered, 0, 0, NULL, + NULL); + DEFUN ("mod-test-string-a-to-b", Fmod_test_string_a_to_b, 1, 1, NULL, NULL); + DEFUN ("mod-test-return-unibyte", Fmod_test_return_unibyte, 0, 0, NULL, NULL); + DEFUN ("mod-test-userptr-make", Fmod_test_userptr_make, 1, 1, NULL, NULL); + DEFUN ("mod-test-userptr-get", Fmod_test_userptr_get, 1, 1, NULL, NULL); + DEFUN ("mod-test-vector-fill", Fmod_test_vector_fill, 2, 2, NULL, NULL); + DEFUN ("mod-test-vector-eq", Fmod_test_vector_eq, 2, 2, NULL, NULL); + DEFUN ("mod-test-invalid-store", Fmod_test_invalid_store, 0, 0, NULL, NULL); + DEFUN ("mod-test-invalid-store-copy", Fmod_test_invalid_store_copy, 0, 0, + NULL, NULL); + DEFUN ("mod-test-invalid-load", Fmod_test_invalid_load, 0, 0, NULL, NULL); + DEFUN ("mod-test-invalid-finalizer", Fmod_test_invalid_finalizer, 0, 0, + NULL, NULL); + DEFUN ("mod-test-sleep-until", Fmod_test_sleep_until, 2, 2, NULL, NULL); + DEFUN ("mod-test-add-nanosecond", Fmod_test_add_nanosecond, 1, 1, NULL, NULL); + DEFUN ("mod-test-nanoseconds", Fmod_test_nanoseconds, 1, 1, NULL, NULL); + DEFUN ("mod-test-double", Fmod_test_double, 1, 1, NULL, NULL); + DEFUN ("mod-test-make-function-with-finalizer", + Fmod_test_make_function_with_finalizer, 0, 0, NULL, NULL); + DEFUN ("mod-test-function-finalizer-calls", + Fmod_test_function_finalizer_calls, 0, 0, NULL, NULL); + DEFUN ("mod-test-async-pipe", Fmod_test_async_pipe, 1, 1, NULL, NULL); + +#undef DEFUN + + emacs_value constant_fn + = env->make_function (env, 0, 0, Fmod_test_return_t, NULL, NULL); + env->make_interactive (env, constant_fn, env->intern (env, "nil")); + bind_function (env, "mod-test-return-t-int", constant_fn); + + emacs_value identity_fn + = env->make_function (env, 1, 1, Fmod_test_identity, NULL, NULL); + const char *interactive_spec = "i"; + env->make_interactive (env, identity_fn, + env->make_string (env, interactive_spec, + strlen (interactive_spec))); + bind_function (env, "mod-test-identity", identity_fn); + + provide (env, "mod-test"); + return 0; +} diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index 621229c62aa..fb4ed4a6842 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -21,13 +21,14 @@ ;; Unit tests for the dynamic module facility. See Info node `(elisp) ;; Writing Dynamic Modules'. These tests make use of a small test -;; module in test/data/emacs-module. +;; module in the "emacs-module-resources" directory. ;;; Code: ;;; Prelude (require 'cl-lib) (require 'ert) +(require 'ert-x) (require 'help-fns) (defconst mod-test-emacs @@ -35,8 +36,7 @@ "File name of the Emacs binary currently running.") (eval-and-compile - (defconst mod-test-file - (expand-file-name "../test/data/emacs-module/mod-test" invocation-directory) + (defconst mod-test-file (ert-resource-file "mod-test") "File name of the module test file.")) (require 'mod-test mod-test-file) @@ -313,11 +313,11 @@ local reference." (text-quoting-style 'grave)) (describe-function-1 #'mod-test-sum) (goto-char (point-min)) - (while (re-search-forward "`[^']*/data/emacs-module/" nil t) - (replace-match "`data/emacs-module/")) + (while (re-search-forward "`[^']*/src/emacs-module-resources/" nil t) + (replace-match "`src/emacs-module-resources/")) (should (equal (buffer-substring-no-properties 1 (point-max)) - (format "a module function in `data/emacs-module/mod-test%s'. + (format "a module function in `src/emacs-module-resources/mod-test%s'. (mod-test-sum a b) diff --git a/test/src/lread-resources/somelib.el b/test/src/lread-resources/somelib.el new file mode 100644 index 00000000000..7b8d4037396 --- /dev/null +++ b/test/src/lread-resources/somelib.el @@ -0,0 +1,7 @@ +;;; -*- lexical-binding: t; -*- + +;; blah + +(defun somefunc () t) + +(provide 'somelib) diff --git a/test/src/lread-resources/somelib2.el b/test/src/lread-resources/somelib2.el new file mode 100644 index 00000000000..05156145a22 --- /dev/null +++ b/test/src/lread-resources/somelib2.el @@ -0,0 +1,7 @@ +;;; -*- lexical-binding: t; -*- + +;; blah + +(defun somefunc2 () t) + +(provide 'somelib2) diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index 26fd6aa22a1..825b74e6234 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el @@ -25,6 +25,9 @@ ;;; Code: +(require 'ert) +(require 'ert-x) + (ert-deftest lread-char-number () (should (equal (read "?\\N{U+A817}") #xA817))) @@ -146,10 +149,7 @@ literals (Bug#20852)." (ert-deftest lread-test-bug26837 () "Test for https://debbugs.gnu.org/26837 ." - (let ((load-path (cons - (file-name-as-directory - (expand-file-name "data" (getenv "EMACS_TEST_DIRECTORY"))) - load-path))) + (let ((load-path (cons (ert-resource-directory) load-path))) (load "somelib" nil t) (should (string-suffix-p "/somelib.el" (caar load-history))) (load "somelib2" nil t) diff --git a/test/src/syntax-resources/syntax-comments.txt b/test/src/syntax-resources/syntax-comments.txt new file mode 100644 index 00000000000..6f595e4d8dc --- /dev/null +++ b/test/src/syntax-resources/syntax-comments.txt @@ -0,0 +1,68 @@ +/* This file is a test file for tests of the comment handling in src/syntax.c. + This includes the testing of comments which figure in parse-partial-sexp + and scan-lists. */ + +/* Straight C comments */ +1/* comment */1 +2/**/2 +3// comment +3 +4// +4 +5/*/5 +6*/6 +7/* \*/7 +8*/8 +9/* \\*/9 +10*/10 +11// \ +12 +11 +13// \\ +14 +13 +15/* /*/15 + +/* C Comments within lists */ +59}59 +50{ /*70 comment */71 }50 +51{ /**/ }51 +52{ //72 comment +73}52 +53{ // +}53 +54{ //74 \ +}54 +55{/* */}55 +56{ /*76 \*/ }56 +57*/77 +58}58 +60{ /*78 \\*/79}60 + + +/* Straight Pascal comments (not nested) */ +20}20 +21{ Comment }21 +22{}22 +23{ +}23 +24{ +25{25 +}24 +26{ \}26 + + +/* Straight Lisp comments (not nested) */ +30 +30 +31; Comment +31 +32;;;;;;;;; +32 +33; \ +33 + +Local Variables: +mode: fundamental +eval: (set-syntax-table (make-syntax-table)) +End: diff --git a/test/src/syntax-tests.el b/test/src/syntax-tests.el index 56e03380579..4b9c3f277aa 100644 --- a/test/src/syntax-tests.el +++ b/test/src/syntax-tests.el @@ -20,6 +20,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (ert-deftest parse-partial-sexp-continue-over-comment-marker () "Continue a parse that stopped in the middle of a comment marker." @@ -91,7 +92,7 @@ also has open paren syntax (see Bug#24870)." ;; It is intended to enhance this bit to test nested comments ;; (2020-10-01). -;; This bit uses the data file test/data/syntax-comments.txt. +;; This bit uses the data file syntax-resources/syntax-comments.txt. (defun syntax-comments-point (n forw) "Return the buffer offset corresponding to the \"label\" N. @@ -182,8 +183,7 @@ missing or nil, the value of START is assumed for it." () (with-current-buffer (find-file - ,(expand-file-name "data/syntax-comments.txt" - (getenv "EMACS_TEST_DIRECTORY"))) + ,(ert-resource-file "syntax-comments.txt")) (,(intern (concat (symbol-name type) "-in"))) (goto-char (syntax-comments-point ,start ,forw)) (let ((stop (syntax-comments-point ,(or stop start) ,(not forw)))) @@ -230,8 +230,7 @@ missing or nil, the value of -START- is assumed for it." () (with-current-buffer (find-file - ,(expand-file-name "data/syntax-comments.txt" - (getenv "EMACS_TEST_DIRECTORY"))) + ,(ert-resource-file "syntax-comments.txt")) (,(intern (concat (symbol-name type) "-in"))) (let ((start-pos (syntax-comments-point ,start ,forw)) ,@(if res @@ -285,8 +284,7 @@ the `parse-partial-sexp's are expected to stop. See () (with-current-buffer (find-file - ,(expand-file-name "data/syntax-comments.txt" - (getenv "EMACS_TEST_DIRECTORY"))) + ,(ert-resource-file "syntax-comments.txt")) (,(intern (concat (symbol-name type) "-in"))) (let ((start-pos (syntax-comments-point ,start t)) (open-pos (syntax-comments-midpoint ,open)) -- cgit v1.2.3 From 46f5d2867cf73a845d582eeb8929ae51b78eae55 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 23 Oct 2020 16:31:56 +0200 Subject: Fix error in tramp-sh-handle-make-process * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Don't use heredoc script whent the argument contains a string. --- lisp/net/tramp-sh.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 15eab0a4de5..2c7c6dae755 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2850,8 +2850,10 @@ implementation will be used." ;; command. (heredoc (and (stringp program) (string-match-p "sh$" program) + (= (length args) 2) (string-equal "-c" (car args)) - (= (length args) 2))) + ;; Don't if there is a string. + (not (string-match-p "'\\|\"" (cadr args))))) ;; When PROGRAM is nil, we just provide a tty. (args (if (not heredoc) args (let ((i 250)) -- cgit v1.2.3 From 72c9d4bee112a7e44316b04f361cc4ad3b16cf76 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 23 Oct 2020 21:07:26 +0200 Subject: Move more test data to follow our conventions * test/data/minibuffer-test-cttq$tion: Move from here... * test/lisp/minibuffer-resources/data/minibuffer-test-cttq$tion: ...to here. * test/lisp/minibuffer-resources/lisp/cedet/semantic-utest-c.test: * test/lisp/minibuffer-resources/lisp/cedet/semantic-utest.test: New files. * test/lisp/minibuffer-tests.el (ert, ert-x): Require. (completion-table-test-quoting): Use ert-resource-directory. * test/data/net/cert.pem: * test/data/net/key.pem: Move frome here... * test/lisp/net/network-stream-resources/cert.pem: * test/lisp/net/network-stream-resources/key.pem: ...to here. * test/lisp/net/network-stream-tests.el (ert, ert-x): Require. (network-stream-tests--datadir): Remove variable. (make-tls-server): Use ert-resource-file. * test/data/vc/diff-mode/hello_emacs.c: * test/data/vc/diff-mode/hello_emacs_1.c: * test/data/vc/diff-mode/hello_world.c: * test/data/vc/diff-mode/hello_world_1.c: Move from here... * test/lisp/vc/diff-mode-resources/hello_emacs.c: * test/lisp/vc/diff-mode-resources/hello_emacs_1.c: * test/lisp/vc/diff-mode-resources/hello_world.c: * test/lisp/vc/diff-mode-resources/hello_world_1.c: ...to here. * test/lisp/vc/diff-mode-tests.el (ert, ert-x): Require. (diff-mode-tests--datadir): Remove variable. (diff-mode-test-font-lock-syntax-one-line) (diff-mode-test-font-lock): Use ert-resource-directory. * test/data/xdg/l10n.desktop: * test/data/xdg/malformed.desktop: * test/data/xdg/mimeapps.list: * test/data/xdg/mimeinfo.cache: * test/data/xdg/test.desktop: Move from here... * test/lisp/xdg-resources/l10n.desktop: * test/lisp/xdg-resources/malformed.desktop: * test/lisp/xdg-resources/mimeapps.list: * test/lisp/xdg-resources/mimeinfo.cache: * test/lisp/xdg-resources/test.desktop: ...to here. * test/lisp/xdg-tests.el (ert-x): Require. (xdg-tests-data-dir): Remove variable. (xdg-desktop-parsing, xdg-mime-associations): Use ert-resource-file. --- test/data/minibuffer-test-cttq$tion | 0 test/data/net/cert.pem | 25 ------------------- test/data/net/key.pem | 28 ---------------------- test/data/vc/diff-mode/hello_emacs.c | 6 ----- test/data/vc/diff-mode/hello_emacs_1.c | 1 - test/data/vc/diff-mode/hello_world.c | 6 ----- test/data/vc/diff-mode/hello_world_1.c | 1 - test/data/xdg/l10n.desktop | 5 ---- test/data/xdg/malformed.desktop | 4 ---- test/data/xdg/mimeapps.list | 9 ------- test/data/xdg/mimeinfo.cache | 4 ---- test/data/xdg/test.desktop | 5 ---- test/data/xdg/wrong.desktop | 2 -- .../data/minibuffer-test-cttq$tion | 0 .../lisp/cedet/semantic-utest-c.test | 0 .../lisp/cedet/semantic-utest.test | 0 test/lisp/minibuffer-tests.el | 5 +++- test/lisp/net/network-stream-resources/cert.pem | 25 +++++++++++++++++++ test/lisp/net/network-stream-resources/key.pem | 28 ++++++++++++++++++++++ test/lisp/net/network-stream-tests.el | 9 ++++--- test/lisp/vc/diff-mode-resources/hello_emacs.c | 6 +++++ test/lisp/vc/diff-mode-resources/hello_emacs_1.c | 1 + test/lisp/vc/diff-mode-resources/hello_world.c | 6 +++++ test/lisp/vc/diff-mode-resources/hello_world_1.c | 1 + test/lisp/vc/diff-mode-tests.el | 13 +++++----- test/lisp/xdg-resources/l10n.desktop | 5 ++++ test/lisp/xdg-resources/malformed.desktop | 4 ++++ test/lisp/xdg-resources/mimeapps.list | 9 +++++++ test/lisp/xdg-resources/mimeinfo.cache | 4 ++++ test/lisp/xdg-resources/test.desktop | 5 ++++ test/lisp/xdg-resources/wrong.desktop | 2 ++ test/lisp/xdg-tests.el | 20 ++++++---------- 32 files changed, 117 insertions(+), 122 deletions(-) delete mode 100644 test/data/minibuffer-test-cttq$tion delete mode 100644 test/data/net/cert.pem delete mode 100644 test/data/net/key.pem delete mode 100644 test/data/vc/diff-mode/hello_emacs.c delete mode 100644 test/data/vc/diff-mode/hello_emacs_1.c delete mode 100644 test/data/vc/diff-mode/hello_world.c delete mode 100644 test/data/vc/diff-mode/hello_world_1.c delete mode 100644 test/data/xdg/l10n.desktop delete mode 100644 test/data/xdg/malformed.desktop delete mode 100644 test/data/xdg/mimeapps.list delete mode 100644 test/data/xdg/mimeinfo.cache delete mode 100644 test/data/xdg/test.desktop delete mode 100644 test/data/xdg/wrong.desktop create mode 100644 test/lisp/minibuffer-resources/data/minibuffer-test-cttq$tion create mode 100644 test/lisp/minibuffer-resources/lisp/cedet/semantic-utest-c.test create mode 100644 test/lisp/minibuffer-resources/lisp/cedet/semantic-utest.test create mode 100644 test/lisp/net/network-stream-resources/cert.pem create mode 100644 test/lisp/net/network-stream-resources/key.pem create mode 100644 test/lisp/vc/diff-mode-resources/hello_emacs.c create mode 100644 test/lisp/vc/diff-mode-resources/hello_emacs_1.c create mode 100644 test/lisp/vc/diff-mode-resources/hello_world.c create mode 100644 test/lisp/vc/diff-mode-resources/hello_world_1.c create mode 100644 test/lisp/xdg-resources/l10n.desktop create mode 100644 test/lisp/xdg-resources/malformed.desktop create mode 100644 test/lisp/xdg-resources/mimeapps.list create mode 100644 test/lisp/xdg-resources/mimeinfo.cache create mode 100644 test/lisp/xdg-resources/test.desktop create mode 100644 test/lisp/xdg-resources/wrong.desktop diff --git a/test/data/minibuffer-test-cttq$tion b/test/data/minibuffer-test-cttq$tion deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/data/net/cert.pem b/test/data/net/cert.pem deleted file mode 100644 index 4df4e92e0bf..00000000000 --- a/test/data/net/cert.pem +++ /dev/null @@ -1,25 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIELTCCAxWgAwIBAgIJAI6LqlFyaPRkMA0GCSqGSIb3DQEBCwUAMIGsMQswCQYD -VQQGEwJBVTEYMBYGA1UECAwPTmV3IFNvdXRoIFdhbGVzMQ8wDQYDVQQHDAZTeWRu -ZXkxITAfBgNVBAoMGEVtYWNzIFRlc3QgU2VydmljZXNzIExMQzESMBAGA1UECwwJ -QXV0b21hdGVkMRcwFQYDVQQDDA50ZXN0LmVtYWNzLnpvdDEiMCAGCSqGSIb3DQEJ -ARYTZW1hY3MtZGV2ZWxAZnNmLm9yZzAeFw0xNjAyMDgwNDA0MzJaFw0xNjAzMDkw -NDA0MzJaMIGsMQswCQYDVQQGEwJBVTEYMBYGA1UECAwPTmV3IFNvdXRoIFdhbGVz -MQ8wDQYDVQQHDAZTeWRuZXkxITAfBgNVBAoMGEVtYWNzIFRlc3QgU2VydmljZXNz -IExMQzESMBAGA1UECwwJQXV0b21hdGVkMRcwFQYDVQQDDA50ZXN0LmVtYWNzLnpv -dDEiMCAGCSqGSIb3DQEJARYTZW1hY3MtZGV2ZWxAZnNmLm9yZzCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAM52lP7k1rBpctBX1irRVgDerxqlFSTkvg8L -WmRCfwm3XY8EZWqM/8Eex5soH7myRlWfUH/cKxbqScZqXotj0hlPxdRkM6gWgHS9 -Mml7wnz2LZGvD5PfMfs+yBHKAMrqortFXCKksHsYIJ66l9gJMm1G5XjWha6CaEr/ -k2bE5Ovw0fB2B4vH0OqhJzGyenJOspXZz1ttn3h3UC5fbDXS8fUM9k/FbgJKypWr -zB3P12GcMR939FsR5sqa8nNoCMw+WBzs4XuM5Ad+s/UtEaZvmtwvLwmdB7cgCEyM -x5gaM969SlpOmuy7dDTCCK3lBl6B5dgFKvVcChYwSW+xJz5tfL0CAwEAAaNQME4w -HQYDVR0OBBYEFG3YhH7ZzEdOGstkT67uUh1RylNjMB8GA1UdIwQYMBaAFG3YhH7Z -zEdOGstkT67uUh1RylNjMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB -ADnJL2tBMnPepywA57yDfJz54FvrqRd+UAjSiB7/QySDpHnTM3b3sXWfwAkXPTjM -c+jRW2kfdnL6OQW2tpcpPZANGnwK8MJrtGcbHhtPXjgDRhVZp64hsB7ayS+l0Dm7 -2ZBbi2SF8FgZVcQy0WD01ir2raSODo124dMrq+3aHP77YLbiNEKj+wFoDbndQ1FQ -gtIJBE80FADoqc7LnBrpA20aVlfqhKZqe+leYDSZ+CE1iwlPdvD+RTUxVDs5EfpB -qVOHDlzEfVmcMnddKTV8pNYuo93AG4s0KdrGG9RwSvtLaOoHd2i6RmIs+Yiumbau -mXodMxxAEW/cM7Ita/2QVmk= ------END CERTIFICATE----- diff --git a/test/data/net/key.pem b/test/data/net/key.pem deleted file mode 100644 index 5db58f573ca..00000000000 --- a/test/data/net/key.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDOdpT+5NawaXLQ -V9Yq0VYA3q8apRUk5L4PC1pkQn8Jt12PBGVqjP/BHsebKB+5skZVn1B/3CsW6knG -al6LY9IZT8XUZDOoFoB0vTJpe8J89i2Rrw+T3zH7PsgRygDK6qK7RVwipLB7GCCe -upfYCTJtRuV41oWugmhK/5NmxOTr8NHwdgeLx9DqoScxsnpyTrKV2c9bbZ94d1Au -X2w10vH1DPZPxW4CSsqVq8wdz9dhnDEfd/RbEebKmvJzaAjMPlgc7OF7jOQHfrP1 -LRGmb5rcLy8JnQe3IAhMjMeYGjPevUpaTprsu3Q0wgit5QZegeXYBSr1XAoWMElv -sSc+bXy9AgMBAAECggEAaqHkIiGeoE5V9jTncAXeHWTlmyVX3k4luy9p6A5P/nyt -3YevuXBJRzzWatQ2Tno8yUwXD3Ju7s7ie4/EdMmBYYFJ84AtDctRXPm6Z7B7qn6a -2ntH2F+WOOUb/9QMxMCae44/H8VfQLQdZN2KPxHA8Z+ENPzW3mKL6vBE+PcIJLK2 -kTXQdCEIuUb1v4kxKYfjyyHAQ9yHvocUvZdodGHrpmWOr/2QCrqCjwiKnXyvdJMi -JQ4a3dU+JG5Zwr2hScyeLgS4p+M3A2NY+oIACn2rCcsIKC6uvBK3wAbhssaY8z9c -5kap862oMBNmPCxPuQTIIO7ptla0EWHktpFxnu7GIQKBgQDvKyXt82zGHiOZ9acx -4fV7t3NF2MNd9fOn59NYWYRSs2gaEjit6BnsCgiKZOJJ2YFsggBiQMiWuEzwqIdW -bOH8W5AubTxnE2OjeIpH5r8AXI6I/pKdOedM86oeElbL0p53OZqSqBK6vA5SnE76 -fZwC505h/mqH2E6AdKpcyL7sJwKBgQDc/jc4MkVnqF7xcYoJrYEbnkhwqRxIM+0Y -HY2qXszWQPgjae3NK1rw/PEOATzWrHLvRS/utQ8yeLUAZIGsFY8+c1kjvkvl4ZK2 -OnsEOVLmEwjDqqnq3JFYCVSkXfLBGRD3wGldzkCQljOiGuJ/Co1rGHk7CfBmxX2p -kxdts5OKewKBgQDTRsSc7Zs7cMh2a0GlmTyoa6iTHSeIy4rQ2sQimgGApSfjUBFt -30l28G4XA4O7RT9FwZnhMeWA75JYTigwOsNvkNtPiAQB8mjksclGNxqnkRwA/RI7 -fjlMCzxOkFjIeWivXd2kjIDvIM1uQNKsCWZWUks12e/1zSmb5HPSvyuZpQKBgQDQ -qVgKP604ysmav9HOgXy+Tx2nAoYpxp2/f2gbzZcrVfz1szdN2fnsQWh6CMEhEYMU -WQeBJIRM65w72qp1iYXPOaqZDT0suWiFl4I/4sBbbO2BkssNb2Xs8iJxcCOeH8Td -qVfTssNTwf7OuQPTYGtXC6ysCh5ra13Tl4cvlbdhsQKBgFHXP+919wSncLS+2ySD -waBzG6GyVOgV+FE3DrM3Xp4S6fldWYAndKHQ1HjJVDY8SkC2Tk1D7QSQnmS+ZzYs -YqzcnkPCTHLb6wCErs4ZiW0gn9xJnfxyv6wPujsayL4TMsmsqkj/IAB61UjwaA/a -Z+rUw/WkcNPD59AD1J0eeSZu ------END PRIVATE KEY----- diff --git a/test/data/vc/diff-mode/hello_emacs.c b/test/data/vc/diff-mode/hello_emacs.c deleted file mode 100644 index c7ed7538c3a..00000000000 --- a/test/data/vc/diff-mode/hello_emacs.c +++ /dev/null @@ -1,6 +0,0 @@ -#include -int main() -{ - printf("Hello, Emacs!\n"); - return 0; -} diff --git a/test/data/vc/diff-mode/hello_emacs_1.c b/test/data/vc/diff-mode/hello_emacs_1.c deleted file mode 100644 index 62145a6b44a..00000000000 --- a/test/data/vc/diff-mode/hello_emacs_1.c +++ /dev/null @@ -1 +0,0 @@ -int main() { printf("Hello, Emacs!\n"); return 0; } \ No newline at end of file diff --git a/test/data/vc/diff-mode/hello_world.c b/test/data/vc/diff-mode/hello_world.c deleted file mode 100644 index dcbe06c6012..00000000000 --- a/test/data/vc/diff-mode/hello_world.c +++ /dev/null @@ -1,6 +0,0 @@ -#include -int main() -{ - printf("Hello, World!\n"); - return 0; -} diff --git a/test/data/vc/diff-mode/hello_world_1.c b/test/data/vc/diff-mode/hello_world_1.c deleted file mode 100644 index 606afb371cb..00000000000 --- a/test/data/vc/diff-mode/hello_world_1.c +++ /dev/null @@ -1 +0,0 @@ -int main() { printf("Hello, World!\n"); return 0; } \ No newline at end of file diff --git a/test/data/xdg/l10n.desktop b/test/data/xdg/l10n.desktop deleted file mode 100644 index 42da83910da..00000000000 --- a/test/data/xdg/l10n.desktop +++ /dev/null @@ -1,5 +0,0 @@ -# localized strings -[Desktop Entry] -Comment=Cheers -Comment[en_US@piglatin]=Eerschay -Comment[sv]=SkĂ„l diff --git a/test/data/xdg/malformed.desktop b/test/data/xdg/malformed.desktop deleted file mode 100644 index 144a3f719d5..00000000000 --- a/test/data/xdg/malformed.desktop +++ /dev/null @@ -1,4 +0,0 @@ -# unacceptable key=value format -[Desktop Entry] -Key=value -aowef faoweif of diff --git a/test/data/xdg/mimeapps.list b/test/data/xdg/mimeapps.list deleted file mode 100644 index 27fbd94b16b..00000000000 --- a/test/data/xdg/mimeapps.list +++ /dev/null @@ -1,9 +0,0 @@ -[Default Applications] -x-test/foo=a.desktop - -[Added Associations] -x-test/foo=b.desktop -x-test/baz=a.desktop - -[Removed Associations] -x-test/foo=c.desktop;d.desktop diff --git a/test/data/xdg/mimeinfo.cache b/test/data/xdg/mimeinfo.cache deleted file mode 100644 index 6e54f604fa0..00000000000 --- a/test/data/xdg/mimeinfo.cache +++ /dev/null @@ -1,4 +0,0 @@ -[MIME Cache] -x-test/foo=c.desktop;d.desktop -x-test/bar=a.desktop;c.desktop -x-test/baz=b.desktop;d.desktop diff --git a/test/data/xdg/test.desktop b/test/data/xdg/test.desktop deleted file mode 100644 index b848cef5b0f..00000000000 --- a/test/data/xdg/test.desktop +++ /dev/null @@ -1,5 +0,0 @@ -# this is a comment -[Desktop Entry] -Name=Test -[Another Section] -Exec=frobnicate diff --git a/test/data/xdg/wrong.desktop b/test/data/xdg/wrong.desktop deleted file mode 100644 index e0b4c221cf9..00000000000 --- a/test/data/xdg/wrong.desktop +++ /dev/null @@ -1,2 +0,0 @@ -# the first section must be "Desktop Entry" -[Why] diff --git a/test/lisp/minibuffer-resources/data/minibuffer-test-cttq$tion b/test/lisp/minibuffer-resources/data/minibuffer-test-cttq$tion new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/lisp/minibuffer-resources/lisp/cedet/semantic-utest-c.test b/test/lisp/minibuffer-resources/lisp/cedet/semantic-utest-c.test new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/lisp/minibuffer-resources/lisp/cedet/semantic-utest.test b/test/lisp/minibuffer-resources/lisp/cedet/semantic-utest.test new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 5da86f36148..32734794413 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -26,6 +26,9 @@ ;;; Code: +(require 'ert) +(require 'ert-x) + (eval-when-compile (require 'cl-lib)) (ert-deftest completion-test1 () @@ -85,7 +88,7 @@ (ert-deftest completion-table-test-quoting () (let ((process-environment `("CTTQ1=ed" "CTTQ2=et/" ,@process-environment)) - (default-directory (expand-file-name "test" source-directory))) + (default-directory (ert-resource-directory))) (pcase-dolist (`(,input ,output) '( ;; Test that $ in files is properly $$ quoted. diff --git a/test/lisp/net/network-stream-resources/cert.pem b/test/lisp/net/network-stream-resources/cert.pem new file mode 100644 index 00000000000..4df4e92e0bf --- /dev/null +++ b/test/lisp/net/network-stream-resources/cert.pem @@ -0,0 +1,25 @@ +-----BEGIN CERTIFICATE----- +MIIELTCCAxWgAwIBAgIJAI6LqlFyaPRkMA0GCSqGSIb3DQEBCwUAMIGsMQswCQYD +VQQGEwJBVTEYMBYGA1UECAwPTmV3IFNvdXRoIFdhbGVzMQ8wDQYDVQQHDAZTeWRu +ZXkxITAfBgNVBAoMGEVtYWNzIFRlc3QgU2VydmljZXNzIExMQzESMBAGA1UECwwJ +QXV0b21hdGVkMRcwFQYDVQQDDA50ZXN0LmVtYWNzLnpvdDEiMCAGCSqGSIb3DQEJ +ARYTZW1hY3MtZGV2ZWxAZnNmLm9yZzAeFw0xNjAyMDgwNDA0MzJaFw0xNjAzMDkw +NDA0MzJaMIGsMQswCQYDVQQGEwJBVTEYMBYGA1UECAwPTmV3IFNvdXRoIFdhbGVz +MQ8wDQYDVQQHDAZTeWRuZXkxITAfBgNVBAoMGEVtYWNzIFRlc3QgU2VydmljZXNz +IExMQzESMBAGA1UECwwJQXV0b21hdGVkMRcwFQYDVQQDDA50ZXN0LmVtYWNzLnpv +dDEiMCAGCSqGSIb3DQEJARYTZW1hY3MtZGV2ZWxAZnNmLm9yZzCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAM52lP7k1rBpctBX1irRVgDerxqlFSTkvg8L +WmRCfwm3XY8EZWqM/8Eex5soH7myRlWfUH/cKxbqScZqXotj0hlPxdRkM6gWgHS9 +Mml7wnz2LZGvD5PfMfs+yBHKAMrqortFXCKksHsYIJ66l9gJMm1G5XjWha6CaEr/ +k2bE5Ovw0fB2B4vH0OqhJzGyenJOspXZz1ttn3h3UC5fbDXS8fUM9k/FbgJKypWr +zB3P12GcMR939FsR5sqa8nNoCMw+WBzs4XuM5Ad+s/UtEaZvmtwvLwmdB7cgCEyM +x5gaM969SlpOmuy7dDTCCK3lBl6B5dgFKvVcChYwSW+xJz5tfL0CAwEAAaNQME4w +HQYDVR0OBBYEFG3YhH7ZzEdOGstkT67uUh1RylNjMB8GA1UdIwQYMBaAFG3YhH7Z +zEdOGstkT67uUh1RylNjMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB +ADnJL2tBMnPepywA57yDfJz54FvrqRd+UAjSiB7/QySDpHnTM3b3sXWfwAkXPTjM +c+jRW2kfdnL6OQW2tpcpPZANGnwK8MJrtGcbHhtPXjgDRhVZp64hsB7ayS+l0Dm7 +2ZBbi2SF8FgZVcQy0WD01ir2raSODo124dMrq+3aHP77YLbiNEKj+wFoDbndQ1FQ +gtIJBE80FADoqc7LnBrpA20aVlfqhKZqe+leYDSZ+CE1iwlPdvD+RTUxVDs5EfpB +qVOHDlzEfVmcMnddKTV8pNYuo93AG4s0KdrGG9RwSvtLaOoHd2i6RmIs+Yiumbau +mXodMxxAEW/cM7Ita/2QVmk= +-----END CERTIFICATE----- diff --git a/test/lisp/net/network-stream-resources/key.pem b/test/lisp/net/network-stream-resources/key.pem new file mode 100644 index 00000000000..5db58f573ca --- /dev/null +++ b/test/lisp/net/network-stream-resources/key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDOdpT+5NawaXLQ +V9Yq0VYA3q8apRUk5L4PC1pkQn8Jt12PBGVqjP/BHsebKB+5skZVn1B/3CsW6knG +al6LY9IZT8XUZDOoFoB0vTJpe8J89i2Rrw+T3zH7PsgRygDK6qK7RVwipLB7GCCe +upfYCTJtRuV41oWugmhK/5NmxOTr8NHwdgeLx9DqoScxsnpyTrKV2c9bbZ94d1Au +X2w10vH1DPZPxW4CSsqVq8wdz9dhnDEfd/RbEebKmvJzaAjMPlgc7OF7jOQHfrP1 +LRGmb5rcLy8JnQe3IAhMjMeYGjPevUpaTprsu3Q0wgit5QZegeXYBSr1XAoWMElv +sSc+bXy9AgMBAAECggEAaqHkIiGeoE5V9jTncAXeHWTlmyVX3k4luy9p6A5P/nyt +3YevuXBJRzzWatQ2Tno8yUwXD3Ju7s7ie4/EdMmBYYFJ84AtDctRXPm6Z7B7qn6a +2ntH2F+WOOUb/9QMxMCae44/H8VfQLQdZN2KPxHA8Z+ENPzW3mKL6vBE+PcIJLK2 +kTXQdCEIuUb1v4kxKYfjyyHAQ9yHvocUvZdodGHrpmWOr/2QCrqCjwiKnXyvdJMi +JQ4a3dU+JG5Zwr2hScyeLgS4p+M3A2NY+oIACn2rCcsIKC6uvBK3wAbhssaY8z9c +5kap862oMBNmPCxPuQTIIO7ptla0EWHktpFxnu7GIQKBgQDvKyXt82zGHiOZ9acx +4fV7t3NF2MNd9fOn59NYWYRSs2gaEjit6BnsCgiKZOJJ2YFsggBiQMiWuEzwqIdW +bOH8W5AubTxnE2OjeIpH5r8AXI6I/pKdOedM86oeElbL0p53OZqSqBK6vA5SnE76 +fZwC505h/mqH2E6AdKpcyL7sJwKBgQDc/jc4MkVnqF7xcYoJrYEbnkhwqRxIM+0Y +HY2qXszWQPgjae3NK1rw/PEOATzWrHLvRS/utQ8yeLUAZIGsFY8+c1kjvkvl4ZK2 +OnsEOVLmEwjDqqnq3JFYCVSkXfLBGRD3wGldzkCQljOiGuJ/Co1rGHk7CfBmxX2p +kxdts5OKewKBgQDTRsSc7Zs7cMh2a0GlmTyoa6iTHSeIy4rQ2sQimgGApSfjUBFt +30l28G4XA4O7RT9FwZnhMeWA75JYTigwOsNvkNtPiAQB8mjksclGNxqnkRwA/RI7 +fjlMCzxOkFjIeWivXd2kjIDvIM1uQNKsCWZWUks12e/1zSmb5HPSvyuZpQKBgQDQ +qVgKP604ysmav9HOgXy+Tx2nAoYpxp2/f2gbzZcrVfz1szdN2fnsQWh6CMEhEYMU +WQeBJIRM65w72qp1iYXPOaqZDT0suWiFl4I/4sBbbO2BkssNb2Xs8iJxcCOeH8Td +qVfTssNTwf7OuQPTYGtXC6ysCh5ra13Tl4cvlbdhsQKBgFHXP+919wSncLS+2ySD +waBzG6GyVOgV+FE3DrM3Xp4S6fldWYAndKHQ1HjJVDY8SkC2Tk1D7QSQnmS+ZzYs +YqzcnkPCTHLb6wCErs4ZiW0gn9xJnfxyv6wPujsayL4TMsmsqkj/IAB61UjwaA/a +Z+rUw/WkcNPD59AD1J0eeSZu +-----END PRIVATE KEY----- diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el index cf416155e50..07eb2823282 100644 --- a/test/lisp/net/network-stream-tests.el +++ b/test/lisp/net/network-stream-tests.el @@ -24,6 +24,8 @@ ;;; Code: +(require 'ert) +(require 'ert-x) (require 'gnutls) (require 'network-stream) ;; The require above is needed for 'open-network-stream' to work, but @@ -239,16 +241,13 @@ (should (equal (buffer-string) "foo\n"))) (delete-process server))) -(defconst network-stream-tests--datadir - (expand-file-name "test/data/net" source-directory)) - (defun make-tls-server (port) (start-process "gnutls" (generate-new-buffer "*tls*") "gnutls-serv" "--http" "--x509keyfile" - (concat network-stream-tests--datadir "/key.pem") + (ert-resource-file "key.pem") "--x509certfile" - (concat network-stream-tests--datadir "/cert.pem") + (ert-resource-file "cert.pem") "--port" (format "%s" port))) (ert-deftest connect-to-tls-ipv4-wait () diff --git a/test/lisp/vc/diff-mode-resources/hello_emacs.c b/test/lisp/vc/diff-mode-resources/hello_emacs.c new file mode 100644 index 00000000000..c7ed7538c3a --- /dev/null +++ b/test/lisp/vc/diff-mode-resources/hello_emacs.c @@ -0,0 +1,6 @@ +#include +int main() +{ + printf("Hello, Emacs!\n"); + return 0; +} diff --git a/test/lisp/vc/diff-mode-resources/hello_emacs_1.c b/test/lisp/vc/diff-mode-resources/hello_emacs_1.c new file mode 100644 index 00000000000..62145a6b44a --- /dev/null +++ b/test/lisp/vc/diff-mode-resources/hello_emacs_1.c @@ -0,0 +1 @@ +int main() { printf("Hello, Emacs!\n"); return 0; } \ No newline at end of file diff --git a/test/lisp/vc/diff-mode-resources/hello_world.c b/test/lisp/vc/diff-mode-resources/hello_world.c new file mode 100644 index 00000000000..dcbe06c6012 --- /dev/null +++ b/test/lisp/vc/diff-mode-resources/hello_world.c @@ -0,0 +1,6 @@ +#include +int main() +{ + printf("Hello, World!\n"); + return 0; +} diff --git a/test/lisp/vc/diff-mode-resources/hello_world_1.c b/test/lisp/vc/diff-mode-resources/hello_world_1.c new file mode 100644 index 00000000000..606afb371cb --- /dev/null +++ b/test/lisp/vc/diff-mode-resources/hello_world_1.c @@ -0,0 +1 @@ +int main() { printf("Hello, World!\n"); return 0; } \ No newline at end of file diff --git a/test/lisp/vc/diff-mode-tests.el b/test/lisp/vc/diff-mode-tests.el index f17ec3648f1..b25836405cc 100644 --- a/test/lisp/vc/diff-mode-tests.el +++ b/test/lisp/vc/diff-mode-tests.el @@ -22,12 +22,11 @@ ;;; Code: +(require 'ert) +(require 'ert-x) (require 'diff-mode) (require 'diff) -(defconst diff-mode-tests--datadir - (expand-file-name "test/data/vc/diff-mode" source-directory)) - (ert-deftest diff-mode-test-ignore-trailing-dashes () "Check to make sure we successfully ignore trailing -- made by 'git format-patch'. This is bug #9597" @@ -209,11 +208,11 @@ youthfulness ;; See comments in diff-hunk-file-names about nonascii. ;; In such cases, the diff-font-lock-syntax portion of this fails. :expected-result (if (string-match-p "[[:nonascii:]]" - diff-mode-tests--datadir) + (ert-resource-directory)) :failed :passed) (skip-unless (executable-find shell-file-name)) (skip-unless (executable-find diff-command)) - (let ((default-directory diff-mode-tests--datadir) + (let ((default-directory (ert-resource-directory)) (old "hello_world.c") (new "hello_emacs.c") (diff-buffer (get-buffer-create "*Diff*")) @@ -274,11 +273,11 @@ youthfulness (ert-deftest diff-mode-test-font-lock-syntax-one-line () "Check diff syntax highlighting for one line with no newline at end." :expected-result (if (string-match-p "[[:nonascii:]]" - diff-mode-tests--datadir) + (ert-resource-directory)) :failed :passed) (skip-unless (executable-find shell-file-name)) (skip-unless (executable-find diff-command)) - (let ((default-directory diff-mode-tests--datadir) + (let ((default-directory (ert-resource-directory)) (old "hello_world_1.c") (new "hello_emacs_1.c") (diff-buffer (get-buffer-create "*Diff*")) diff --git a/test/lisp/xdg-resources/l10n.desktop b/test/lisp/xdg-resources/l10n.desktop new file mode 100644 index 00000000000..42da83910da --- /dev/null +++ b/test/lisp/xdg-resources/l10n.desktop @@ -0,0 +1,5 @@ +# localized strings +[Desktop Entry] +Comment=Cheers +Comment[en_US@piglatin]=Eerschay +Comment[sv]=SkĂ„l diff --git a/test/lisp/xdg-resources/malformed.desktop b/test/lisp/xdg-resources/malformed.desktop new file mode 100644 index 00000000000..144a3f719d5 --- /dev/null +++ b/test/lisp/xdg-resources/malformed.desktop @@ -0,0 +1,4 @@ +# unacceptable key=value format +[Desktop Entry] +Key=value +aowef faoweif of diff --git a/test/lisp/xdg-resources/mimeapps.list b/test/lisp/xdg-resources/mimeapps.list new file mode 100644 index 00000000000..27fbd94b16b --- /dev/null +++ b/test/lisp/xdg-resources/mimeapps.list @@ -0,0 +1,9 @@ +[Default Applications] +x-test/foo=a.desktop + +[Added Associations] +x-test/foo=b.desktop +x-test/baz=a.desktop + +[Removed Associations] +x-test/foo=c.desktop;d.desktop diff --git a/test/lisp/xdg-resources/mimeinfo.cache b/test/lisp/xdg-resources/mimeinfo.cache new file mode 100644 index 00000000000..6e54f604fa0 --- /dev/null +++ b/test/lisp/xdg-resources/mimeinfo.cache @@ -0,0 +1,4 @@ +[MIME Cache] +x-test/foo=c.desktop;d.desktop +x-test/bar=a.desktop;c.desktop +x-test/baz=b.desktop;d.desktop diff --git a/test/lisp/xdg-resources/test.desktop b/test/lisp/xdg-resources/test.desktop new file mode 100644 index 00000000000..b848cef5b0f --- /dev/null +++ b/test/lisp/xdg-resources/test.desktop @@ -0,0 +1,5 @@ +# this is a comment +[Desktop Entry] +Name=Test +[Another Section] +Exec=frobnicate diff --git a/test/lisp/xdg-resources/wrong.desktop b/test/lisp/xdg-resources/wrong.desktop new file mode 100644 index 00000000000..e0b4c221cf9 --- /dev/null +++ b/test/lisp/xdg-resources/wrong.desktop @@ -0,0 +1,2 @@ +# the first section must be "Desktop Entry" +[Why] diff --git a/test/lisp/xdg-tests.el b/test/lisp/xdg-tests.el index 294996af5f8..c2a16006c35 100644 --- a/test/lisp/xdg-tests.el +++ b/test/lisp/xdg-tests.el @@ -25,26 +25,20 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'xdg) -(defconst xdg-tests-data-dir - (expand-file-name "test/data/xdg" source-directory)) - (ert-deftest xdg-desktop-parsing () "Test `xdg-desktop-read-file' parsing of .desktop files." - (let ((tab1 (xdg-desktop-read-file - (expand-file-name "test.desktop" xdg-tests-data-dir))) - (tab2 (xdg-desktop-read-file - (expand-file-name "test.desktop" xdg-tests-data-dir) + (let ((tab1 (xdg-desktop-read-file (ert-resource-file "test.desktop"))) + (tab2 (xdg-desktop-read-file (ert-resource-file "test.desktop") "Another Section"))) (should (equal (gethash "Name" tab1) "Test")) (should (eq 'default (gethash "Exec" tab1 'default))) (should (equal "frobnicate" (gethash "Exec" tab2)))) (should-error - (xdg-desktop-read-file - (expand-file-name "malformed.desktop" xdg-tests-data-dir))) - (let ((tab (xdg-desktop-read-file - (expand-file-name "l10n.desktop" xdg-tests-data-dir))) + (xdg-desktop-read-file (ert-resource-file "malformed.desktop"))) + (let ((tab (xdg-desktop-read-file (ert-resource-file "l10n.desktop"))) (env (getenv "LC_MESSAGES"))) (unwind-protect (progn @@ -67,8 +61,8 @@ (ert-deftest xdg-mime-associations () "Test reading MIME associations from files." - (let* ((apps (expand-file-name "mimeapps.list" xdg-tests-data-dir)) - (cache (expand-file-name "mimeinfo.cache" xdg-tests-data-dir)) + (let* ((apps (ert-resource-file "mimeapps.list")) + (cache (ert-resource-file "mimeinfo.cache")) (fs (list apps cache))) (should (equal (xdg-mime-collect-associations "x-test/foo" fs) '("a.desktop" "b.desktop"))) -- cgit v1.2.3 From ab7dddea907ebb226fd657cc2fad441a374dfd7f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 02:17:37 +0200 Subject: Move mml-sec.el test data to follow our conventions * test/lisp/gnus/mml-sec-tests.el (ert-x): Require. (mml-secure-test-fixture, mml-sec-test--kill-gpg-agent): Use ert-resource-directory. * test/lisp/gnus/mml-sec-resources/*: Moved from test/data/mml-sec/. * .gitignore: Update location of moved file "random_seed". --- .gitignore | 2 +- test/data/mml-sec/.gpg-v21-migrated | 0 test/data/mml-sec/gpg-agent.conf | 5 ---- .../02089CDDC6DFE93B8EA10D9E876F983E61FEC476.key | Bin 797 -> 0 bytes .../171B444DE92BEF997229000D9784118A94EEC1C9.key | Bin 526 -> 0 bytes .../19FFEBC04DF3E037E16F6A4474DCB7984406975D.key | Bin 841 -> 0 bytes .../1E36D27DF9DAB96302D35268DADC5CE73EF45A2A.key | Bin 797 -> 0 bytes .../293109315BE584AB2EFEFCFCAD64666221D8B36C.key | Bin 526 -> 0 bytes .../335689599E1C0F66D73ADCF51E03EE36C97D121F.key | Bin 797 -> 0 bytes .../40BF94E540E3726CB150A1ADF7C1B514444B3FA6.key | Bin 797 -> 0 bytes .../515D4637EFC6C09DB1F78BE8C2F2A3D63E7756C3.key | Bin 798 -> 0 bytes .../5A11B1935C46D0B227A73978DCA1293A85604F1D.key | Bin 798 -> 0 bytes .../62643CEBC7AEBE6817577A34399483700D76BD64.key | Bin 526 -> 0 bytes .../680D01F368916A0021C14E3453B27B3C5F900683.key | Bin 710 -> 0 bytes .../6DF2D9DF7AED06F0524BEB642DF0FB48EFDBDB93.key | Bin 798 -> 0 bytes .../78C17E134E86E691297F7B719B2F2CDF41976234.key | Bin 527 -> 0 bytes .../7F714F4D9D9676638214991E96D45704E4FFC409.key | Bin 798 -> 0 bytes .../854752F5D8090CA36EFBDD79C72BDFF6FA2D1FF0.key | Bin 526 -> 0 bytes .../93FF37C268FDBF0767F5FFDC49409DDAC9388B2C.key | Bin 709 -> 0 bytes .../A3BA94EAE83509CC90DB1B77B54A51959D8DABEA.key | Bin 797 -> 0 bytes .../A73E9D01F0465B518E8E7D5AD529077AAC1603B4.key | Bin 710 -> 0 bytes .../AE6A24B17A8D0CAF9B7E000AA77F0B41D7BFFFCF.key | Bin 841 -> 0 bytes .../C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key | Bin 841 -> 0 bytes .../C43E1A079B28DFAEBB39CBA01793BDE11EF4B490.key | Bin 527 -> 0 bytes .../C67DAD345455EAD6D51368008FC3A53B8D195B5A.key | Bin 710 -> 0 bytes .../CB5E00CE582C2645D2573FC16B2F14F85A7F47AA.key | Bin 797 -> 0 bytes .../CC68630A06B048F5A91136C162C7A3273E20DE6F.key | Bin 710 -> 0 bytes .../E7E73903E1BF93481DE0E7C9769D6C31E1863CFF.key | Bin 797 -> 0 bytes .../F0117468BE801ED4B81972E159A98FDD4814DCEC.key | Bin 797 -> 0 bytes .../F4C5EFD5779BE892CAFD5B721D68DED677C9B151.key | Bin 841 -> 0 bytes test/data/mml-sec/pubring.gpg | Bin 13883 -> 0 bytes test/data/mml-sec/pubring.kbx | Bin 3076 -> 0 bytes test/data/mml-sec/secring.gpg | Bin 17362 -> 0 bytes test/data/mml-sec/trustdb.gpg | Bin 1880 -> 0 bytes test/data/mml-sec/trustlist.txt | 26 --------------------- test/lisp/gnus/mml-sec-resources/.gpg-v21-migrated | 0 test/lisp/gnus/mml-sec-resources/gpg-agent.conf | 5 ++++ .../02089CDDC6DFE93B8EA10D9E876F983E61FEC476.key | Bin 0 -> 797 bytes .../171B444DE92BEF997229000D9784118A94EEC1C9.key | Bin 0 -> 526 bytes .../19FFEBC04DF3E037E16F6A4474DCB7984406975D.key | Bin 0 -> 841 bytes .../1E36D27DF9DAB96302D35268DADC5CE73EF45A2A.key | Bin 0 -> 797 bytes .../293109315BE584AB2EFEFCFCAD64666221D8B36C.key | Bin 0 -> 526 bytes .../335689599E1C0F66D73ADCF51E03EE36C97D121F.key | Bin 0 -> 797 bytes .../40BF94E540E3726CB150A1ADF7C1B514444B3FA6.key | Bin 0 -> 797 bytes .../515D4637EFC6C09DB1F78BE8C2F2A3D63E7756C3.key | Bin 0 -> 798 bytes .../5A11B1935C46D0B227A73978DCA1293A85604F1D.key | Bin 0 -> 798 bytes .../62643CEBC7AEBE6817577A34399483700D76BD64.key | Bin 0 -> 526 bytes .../680D01F368916A0021C14E3453B27B3C5F900683.key | Bin 0 -> 710 bytes .../6DF2D9DF7AED06F0524BEB642DF0FB48EFDBDB93.key | Bin 0 -> 798 bytes .../78C17E134E86E691297F7B719B2F2CDF41976234.key | Bin 0 -> 527 bytes .../7F714F4D9D9676638214991E96D45704E4FFC409.key | Bin 0 -> 798 bytes .../854752F5D8090CA36EFBDD79C72BDFF6FA2D1FF0.key | Bin 0 -> 526 bytes .../93FF37C268FDBF0767F5FFDC49409DDAC9388B2C.key | Bin 0 -> 709 bytes .../A3BA94EAE83509CC90DB1B77B54A51959D8DABEA.key | Bin 0 -> 797 bytes .../A73E9D01F0465B518E8E7D5AD529077AAC1603B4.key | Bin 0 -> 710 bytes .../AE6A24B17A8D0CAF9B7E000AA77F0B41D7BFFFCF.key | Bin 0 -> 841 bytes .../C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key | Bin 0 -> 841 bytes .../C43E1A079B28DFAEBB39CBA01793BDE11EF4B490.key | Bin 0 -> 527 bytes .../C67DAD345455EAD6D51368008FC3A53B8D195B5A.key | Bin 0 -> 710 bytes .../CB5E00CE582C2645D2573FC16B2F14F85A7F47AA.key | Bin 0 -> 797 bytes .../CC68630A06B048F5A91136C162C7A3273E20DE6F.key | Bin 0 -> 710 bytes .../E7E73903E1BF93481DE0E7C9769D6C31E1863CFF.key | Bin 0 -> 797 bytes .../F0117468BE801ED4B81972E159A98FDD4814DCEC.key | Bin 0 -> 797 bytes .../F4C5EFD5779BE892CAFD5B721D68DED677C9B151.key | Bin 0 -> 841 bytes test/lisp/gnus/mml-sec-resources/pubring.gpg | Bin 0 -> 13883 bytes test/lisp/gnus/mml-sec-resources/pubring.kbx | Bin 0 -> 3076 bytes test/lisp/gnus/mml-sec-resources/secring.gpg | Bin 0 -> 17362 bytes test/lisp/gnus/mml-sec-resources/trustdb.gpg | Bin 0 -> 1880 bytes test/lisp/gnus/mml-sec-resources/trustlist.txt | 26 +++++++++++++++++++++ test/lisp/gnus/mml-sec-tests.el | 7 +++--- 70 files changed, 35 insertions(+), 36 deletions(-) delete mode 100644 test/data/mml-sec/.gpg-v21-migrated delete mode 100644 test/data/mml-sec/gpg-agent.conf delete mode 100644 test/data/mml-sec/private-keys-v1.d/02089CDDC6DFE93B8EA10D9E876F983E61FEC476.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/171B444DE92BEF997229000D9784118A94EEC1C9.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/19FFEBC04DF3E037E16F6A4474DCB7984406975D.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/1E36D27DF9DAB96302D35268DADC5CE73EF45A2A.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/293109315BE584AB2EFEFCFCAD64666221D8B36C.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/335689599E1C0F66D73ADCF51E03EE36C97D121F.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/40BF94E540E3726CB150A1ADF7C1B514444B3FA6.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/515D4637EFC6C09DB1F78BE8C2F2A3D63E7756C3.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/5A11B1935C46D0B227A73978DCA1293A85604F1D.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/62643CEBC7AEBE6817577A34399483700D76BD64.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/680D01F368916A0021C14E3453B27B3C5F900683.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/6DF2D9DF7AED06F0524BEB642DF0FB48EFDBDB93.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/78C17E134E86E691297F7B719B2F2CDF41976234.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/7F714F4D9D9676638214991E96D45704E4FFC409.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/854752F5D8090CA36EFBDD79C72BDFF6FA2D1FF0.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/93FF37C268FDBF0767F5FFDC49409DDAC9388B2C.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/A3BA94EAE83509CC90DB1B77B54A51959D8DABEA.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/A73E9D01F0465B518E8E7D5AD529077AAC1603B4.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/AE6A24B17A8D0CAF9B7E000AA77F0B41D7BFFFCF.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/C43E1A079B28DFAEBB39CBA01793BDE11EF4B490.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/C67DAD345455EAD6D51368008FC3A53B8D195B5A.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/CB5E00CE582C2645D2573FC16B2F14F85A7F47AA.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/CC68630A06B048F5A91136C162C7A3273E20DE6F.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/E7E73903E1BF93481DE0E7C9769D6C31E1863CFF.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/F0117468BE801ED4B81972E159A98FDD4814DCEC.key delete mode 100644 test/data/mml-sec/private-keys-v1.d/F4C5EFD5779BE892CAFD5B721D68DED677C9B151.key delete mode 100644 test/data/mml-sec/pubring.gpg delete mode 100644 test/data/mml-sec/pubring.kbx delete mode 100644 test/data/mml-sec/secring.gpg delete mode 100644 test/data/mml-sec/trustdb.gpg delete mode 100644 test/data/mml-sec/trustlist.txt create mode 100644 test/lisp/gnus/mml-sec-resources/.gpg-v21-migrated create mode 100644 test/lisp/gnus/mml-sec-resources/gpg-agent.conf create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/02089CDDC6DFE93B8EA10D9E876F983E61FEC476.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/171B444DE92BEF997229000D9784118A94EEC1C9.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/19FFEBC04DF3E037E16F6A4474DCB7984406975D.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/1E36D27DF9DAB96302D35268DADC5CE73EF45A2A.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/293109315BE584AB2EFEFCFCAD64666221D8B36C.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/335689599E1C0F66D73ADCF51E03EE36C97D121F.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/40BF94E540E3726CB150A1ADF7C1B514444B3FA6.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/515D4637EFC6C09DB1F78BE8C2F2A3D63E7756C3.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/5A11B1935C46D0B227A73978DCA1293A85604F1D.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/62643CEBC7AEBE6817577A34399483700D76BD64.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/680D01F368916A0021C14E3453B27B3C5F900683.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/6DF2D9DF7AED06F0524BEB642DF0FB48EFDBDB93.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/78C17E134E86E691297F7B719B2F2CDF41976234.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/7F714F4D9D9676638214991E96D45704E4FFC409.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/854752F5D8090CA36EFBDD79C72BDFF6FA2D1FF0.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/93FF37C268FDBF0767F5FFDC49409DDAC9388B2C.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/A3BA94EAE83509CC90DB1B77B54A51959D8DABEA.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/A73E9D01F0465B518E8E7D5AD529077AAC1603B4.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/AE6A24B17A8D0CAF9B7E000AA77F0B41D7BFFFCF.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C43E1A079B28DFAEBB39CBA01793BDE11EF4B490.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C67DAD345455EAD6D51368008FC3A53B8D195B5A.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/CB5E00CE582C2645D2573FC16B2F14F85A7F47AA.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/CC68630A06B048F5A91136C162C7A3273E20DE6F.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/E7E73903E1BF93481DE0E7C9769D6C31E1863CFF.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/F0117468BE801ED4B81972E159A98FDD4814DCEC.key create mode 100644 test/lisp/gnus/mml-sec-resources/private-keys-v1.d/F4C5EFD5779BE892CAFD5B721D68DED677C9B151.key create mode 100644 test/lisp/gnus/mml-sec-resources/pubring.gpg create mode 100644 test/lisp/gnus/mml-sec-resources/pubring.kbx create mode 100644 test/lisp/gnus/mml-sec-resources/secring.gpg create mode 100644 test/lisp/gnus/mml-sec-resources/trustdb.gpg create mode 100644 test/lisp/gnus/mml-sec-resources/trustlist.txt diff --git a/.gitignore b/.gitignore index 94c0009aa29..29565d0417b 100644 --- a/.gitignore +++ b/.gitignore @@ -152,7 +152,7 @@ test/manual/etags/regexfile test/manual/etags/ETAGS test/manual/etags/CTAGS test/manual/indent/*.new -test/data/mml-sec/random_seed +test/lisp/gnus/mml-sec-resources/random_seed # ctags, etags. TAGS diff --git a/test/data/mml-sec/.gpg-v21-migrated b/test/data/mml-sec/.gpg-v21-migrated deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/data/mml-sec/gpg-agent.conf b/test/data/mml-sec/gpg-agent.conf deleted file mode 100644 index 20192990caf..00000000000 --- a/test/data/mml-sec/gpg-agent.conf +++ /dev/null @@ -1,5 +0,0 @@ -# pinentry-program /usr/bin/pinentry-gtk-2 - -# verbose -# log-file /tmp/gpg-agent.log -# debug-all diff --git a/test/data/mml-sec/private-keys-v1.d/02089CDDC6DFE93B8EA10D9E876F983E61FEC476.key b/test/data/mml-sec/private-keys-v1.d/02089CDDC6DFE93B8EA10D9E876F983E61FEC476.key deleted file mode 100644 index 58fd0b5edbc..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/02089CDDC6DFE93B8EA10D9E876F983E61FEC476.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/171B444DE92BEF997229000D9784118A94EEC1C9.key b/test/data/mml-sec/private-keys-v1.d/171B444DE92BEF997229000D9784118A94EEC1C9.key deleted file mode 100644 index 62f4ab25a69..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/171B444DE92BEF997229000D9784118A94EEC1C9.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/19FFEBC04DF3E037E16F6A4474DCB7984406975D.key b/test/data/mml-sec/private-keys-v1.d/19FFEBC04DF3E037E16F6A4474DCB7984406975D.key deleted file mode 100644 index 2a8ce135fb2..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/19FFEBC04DF3E037E16F6A4474DCB7984406975D.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/1E36D27DF9DAB96302D35268DADC5CE73EF45A2A.key b/test/data/mml-sec/private-keys-v1.d/1E36D27DF9DAB96302D35268DADC5CE73EF45A2A.key deleted file mode 100644 index 9f8de71c5e2..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/1E36D27DF9DAB96302D35268DADC5CE73EF45A2A.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/293109315BE584AB2EFEFCFCAD64666221D8B36C.key b/test/data/mml-sec/private-keys-v1.d/293109315BE584AB2EFEFCFCAD64666221D8B36C.key deleted file mode 100644 index 6e4a4e548fd..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/293109315BE584AB2EFEFCFCAD64666221D8B36C.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/335689599E1C0F66D73ADCF51E03EE36C97D121F.key b/test/data/mml-sec/private-keys-v1.d/335689599E1C0F66D73ADCF51E03EE36C97D121F.key deleted file mode 100644 index cff58edaa89..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/335689599E1C0F66D73ADCF51E03EE36C97D121F.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/40BF94E540E3726CB150A1ADF7C1B514444B3FA6.key b/test/data/mml-sec/private-keys-v1.d/40BF94E540E3726CB150A1ADF7C1B514444B3FA6.key deleted file mode 100644 index 14af8662f79..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/40BF94E540E3726CB150A1ADF7C1B514444B3FA6.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/515D4637EFC6C09DB1F78BE8C2F2A3D63E7756C3.key b/test/data/mml-sec/private-keys-v1.d/515D4637EFC6C09DB1F78BE8C2F2A3D63E7756C3.key deleted file mode 100644 index 207a7237d3a..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/515D4637EFC6C09DB1F78BE8C2F2A3D63E7756C3.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/5A11B1935C46D0B227A73978DCA1293A85604F1D.key b/test/data/mml-sec/private-keys-v1.d/5A11B1935C46D0B227A73978DCA1293A85604F1D.key deleted file mode 100644 index 85ca78da04d..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/5A11B1935C46D0B227A73978DCA1293A85604F1D.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/62643CEBC7AEBE6817577A34399483700D76BD64.key b/test/data/mml-sec/private-keys-v1.d/62643CEBC7AEBE6817577A34399483700D76BD64.key deleted file mode 100644 index 79f3cd2b841..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/62643CEBC7AEBE6817577A34399483700D76BD64.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/680D01F368916A0021C14E3453B27B3C5F900683.key b/test/data/mml-sec/private-keys-v1.d/680D01F368916A0021C14E3453B27B3C5F900683.key deleted file mode 100644 index 776ddf7e9e2..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/680D01F368916A0021C14E3453B27B3C5F900683.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/6DF2D9DF7AED06F0524BEB642DF0FB48EFDBDB93.key b/test/data/mml-sec/private-keys-v1.d/6DF2D9DF7AED06F0524BEB642DF0FB48EFDBDB93.key deleted file mode 100644 index 2b464f0ccbe..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/6DF2D9DF7AED06F0524BEB642DF0FB48EFDBDB93.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/78C17E134E86E691297F7B719B2F2CDF41976234.key b/test/data/mml-sec/private-keys-v1.d/78C17E134E86E691297F7B719B2F2CDF41976234.key deleted file mode 100644 index 28a07668b21..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/78C17E134E86E691297F7B719B2F2CDF41976234.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/7F714F4D9D9676638214991E96D45704E4FFC409.key b/test/data/mml-sec/private-keys-v1.d/7F714F4D9D9676638214991E96D45704E4FFC409.key deleted file mode 100644 index 137659693bd..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/7F714F4D9D9676638214991E96D45704E4FFC409.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/854752F5D8090CA36EFBDD79C72BDFF6FA2D1FF0.key b/test/data/mml-sec/private-keys-v1.d/854752F5D8090CA36EFBDD79C72BDFF6FA2D1FF0.key deleted file mode 100644 index c99824ccd43..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/854752F5D8090CA36EFBDD79C72BDFF6FA2D1FF0.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/93FF37C268FDBF0767F5FFDC49409DDAC9388B2C.key b/test/data/mml-sec/private-keys-v1.d/93FF37C268FDBF0767F5FFDC49409DDAC9388B2C.key deleted file mode 100644 index 49c2dc58bd8..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/93FF37C268FDBF0767F5FFDC49409DDAC9388B2C.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/A3BA94EAE83509CC90DB1B77B54A51959D8DABEA.key b/test/data/mml-sec/private-keys-v1.d/A3BA94EAE83509CC90DB1B77B54A51959D8DABEA.key deleted file mode 100644 index ca128408952..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/A3BA94EAE83509CC90DB1B77B54A51959D8DABEA.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/A73E9D01F0465B518E8E7D5AD529077AAC1603B4.key b/test/data/mml-sec/private-keys-v1.d/A73E9D01F0465B518E8E7D5AD529077AAC1603B4.key deleted file mode 100644 index 3f14b40927a..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/A73E9D01F0465B518E8E7D5AD529077AAC1603B4.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/AE6A24B17A8D0CAF9B7E000AA77F0B41D7BFFFCF.key b/test/data/mml-sec/private-keys-v1.d/AE6A24B17A8D0CAF9B7E000AA77F0B41D7BFFFCF.key deleted file mode 100644 index 06adc06c427..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/AE6A24B17A8D0CAF9B7E000AA77F0B41D7BFFFCF.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key b/test/data/mml-sec/private-keys-v1.d/C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key deleted file mode 100644 index cf9a60d233b..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/C43E1A079B28DFAEBB39CBA01793BDE11EF4B490.key b/test/data/mml-sec/private-keys-v1.d/C43E1A079B28DFAEBB39CBA01793BDE11EF4B490.key deleted file mode 100644 index 0ed35172fe0..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/C43E1A079B28DFAEBB39CBA01793BDE11EF4B490.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/C67DAD345455EAD6D51368008FC3A53B8D195B5A.key b/test/data/mml-sec/private-keys-v1.d/C67DAD345455EAD6D51368008FC3A53B8D195B5A.key deleted file mode 100644 index 090059d9e81..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/C67DAD345455EAD6D51368008FC3A53B8D195B5A.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/CB5E00CE582C2645D2573FC16B2F14F85A7F47AA.key b/test/data/mml-sec/private-keys-v1.d/CB5E00CE582C2645D2573FC16B2F14F85A7F47AA.key deleted file mode 100644 index 9061f675121..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/CB5E00CE582C2645D2573FC16B2F14F85A7F47AA.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/CC68630A06B048F5A91136C162C7A3273E20DE6F.key b/test/data/mml-sec/private-keys-v1.d/CC68630A06B048F5A91136C162C7A3273E20DE6F.key deleted file mode 100644 index 89f6013100d..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/CC68630A06B048F5A91136C162C7A3273E20DE6F.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/E7E73903E1BF93481DE0E7C9769D6C31E1863CFF.key b/test/data/mml-sec/private-keys-v1.d/E7E73903E1BF93481DE0E7C9769D6C31E1863CFF.key deleted file mode 100644 index 41dac37574e..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/E7E73903E1BF93481DE0E7C9769D6C31E1863CFF.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/F0117468BE801ED4B81972E159A98FDD4814DCEC.key b/test/data/mml-sec/private-keys-v1.d/F0117468BE801ED4B81972E159A98FDD4814DCEC.key deleted file mode 100644 index 5df7b4a5953..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/F0117468BE801ED4B81972E159A98FDD4814DCEC.key and /dev/null differ diff --git a/test/data/mml-sec/private-keys-v1.d/F4C5EFD5779BE892CAFD5B721D68DED677C9B151.key b/test/data/mml-sec/private-keys-v1.d/F4C5EFD5779BE892CAFD5B721D68DED677C9B151.key deleted file mode 100644 index 03daf80975b..00000000000 Binary files a/test/data/mml-sec/private-keys-v1.d/F4C5EFD5779BE892CAFD5B721D68DED677C9B151.key and /dev/null differ diff --git a/test/data/mml-sec/pubring.gpg b/test/data/mml-sec/pubring.gpg deleted file mode 100644 index 6bd169963df..00000000000 Binary files a/test/data/mml-sec/pubring.gpg and /dev/null differ diff --git a/test/data/mml-sec/pubring.kbx b/test/data/mml-sec/pubring.kbx deleted file mode 100644 index 399a0414fd2..00000000000 Binary files a/test/data/mml-sec/pubring.kbx and /dev/null differ diff --git a/test/data/mml-sec/secring.gpg b/test/data/mml-sec/secring.gpg deleted file mode 100644 index b323c072c04..00000000000 Binary files a/test/data/mml-sec/secring.gpg and /dev/null differ diff --git a/test/data/mml-sec/trustdb.gpg b/test/data/mml-sec/trustdb.gpg deleted file mode 100644 index 09ebd8db114..00000000000 Binary files a/test/data/mml-sec/trustdb.gpg and /dev/null differ diff --git a/test/data/mml-sec/trustlist.txt b/test/data/mml-sec/trustlist.txt deleted file mode 100644 index f886572d283..00000000000 --- a/test/data/mml-sec/trustlist.txt +++ /dev/null @@ -1,26 +0,0 @@ -# This is the list of trusted keys. Comment lines, like this one, as -# well as empty lines are ignored. Lines have a length limit but this -# is not a serious limitation as the format of the entries is fixed and -# checked by gpg-agent. A non-comment line starts with optional white -# space, followed by the SHA-1 fingerpint in hex, followed by a flag -# which may be one of 'P', 'S' or '*' and optionally followed by a list of -# other flags. The fingerprint may be prefixed with a '!' to mark the -# key as not trusted. You should give the gpg-agent a HUP or run the -# command "gpgconf --reload gpg-agent" after changing this file. - - -# Include the default trust list -include-default - - -# CN=No Expiry -D0:6A:A1:18:65:3C:C3:8E:9D:0C:AF:56:ED:7A:21:35:E1:58:21:77 S relax - -# CN=Second Key Pair -0E:58:22:9B:80:EE:33:95:9F:F7:18:FE:EF:25:40:2B:47:9D:C6:E2 S relax - -# CN=No Expiry two UIDs -D4:CA:78:E1:47:0B:9F:C2:AE:45:D7:84:64:9B:8C:E6:4E:BB:32:0C S relax - -# CN=Different subkeys -4F:96:2A:B7:F4:76:61:6A:78:3D:72:AA:40:35:D5:9B:5F:88:E9:FC S relax diff --git a/test/lisp/gnus/mml-sec-resources/.gpg-v21-migrated b/test/lisp/gnus/mml-sec-resources/.gpg-v21-migrated new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/lisp/gnus/mml-sec-resources/gpg-agent.conf b/test/lisp/gnus/mml-sec-resources/gpg-agent.conf new file mode 100644 index 00000000000..20192990caf --- /dev/null +++ b/test/lisp/gnus/mml-sec-resources/gpg-agent.conf @@ -0,0 +1,5 @@ +# pinentry-program /usr/bin/pinentry-gtk-2 + +# verbose +# log-file /tmp/gpg-agent.log +# debug-all diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/02089CDDC6DFE93B8EA10D9E876F983E61FEC476.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/02089CDDC6DFE93B8EA10D9E876F983E61FEC476.key new file mode 100644 index 00000000000..58fd0b5edbc Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/02089CDDC6DFE93B8EA10D9E876F983E61FEC476.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/171B444DE92BEF997229000D9784118A94EEC1C9.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/171B444DE92BEF997229000D9784118A94EEC1C9.key new file mode 100644 index 00000000000..62f4ab25a69 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/171B444DE92BEF997229000D9784118A94EEC1C9.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/19FFEBC04DF3E037E16F6A4474DCB7984406975D.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/19FFEBC04DF3E037E16F6A4474DCB7984406975D.key new file mode 100644 index 00000000000..2a8ce135fb2 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/19FFEBC04DF3E037E16F6A4474DCB7984406975D.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/1E36D27DF9DAB96302D35268DADC5CE73EF45A2A.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/1E36D27DF9DAB96302D35268DADC5CE73EF45A2A.key new file mode 100644 index 00000000000..9f8de71c5e2 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/1E36D27DF9DAB96302D35268DADC5CE73EF45A2A.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/293109315BE584AB2EFEFCFCAD64666221D8B36C.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/293109315BE584AB2EFEFCFCAD64666221D8B36C.key new file mode 100644 index 00000000000..6e4a4e548fd Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/293109315BE584AB2EFEFCFCAD64666221D8B36C.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/335689599E1C0F66D73ADCF51E03EE36C97D121F.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/335689599E1C0F66D73ADCF51E03EE36C97D121F.key new file mode 100644 index 00000000000..cff58edaa89 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/335689599E1C0F66D73ADCF51E03EE36C97D121F.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/40BF94E540E3726CB150A1ADF7C1B514444B3FA6.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/40BF94E540E3726CB150A1ADF7C1B514444B3FA6.key new file mode 100644 index 00000000000..14af8662f79 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/40BF94E540E3726CB150A1ADF7C1B514444B3FA6.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/515D4637EFC6C09DB1F78BE8C2F2A3D63E7756C3.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/515D4637EFC6C09DB1F78BE8C2F2A3D63E7756C3.key new file mode 100644 index 00000000000..207a7237d3a Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/515D4637EFC6C09DB1F78BE8C2F2A3D63E7756C3.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/5A11B1935C46D0B227A73978DCA1293A85604F1D.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/5A11B1935C46D0B227A73978DCA1293A85604F1D.key new file mode 100644 index 00000000000..85ca78da04d Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/5A11B1935C46D0B227A73978DCA1293A85604F1D.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/62643CEBC7AEBE6817577A34399483700D76BD64.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/62643CEBC7AEBE6817577A34399483700D76BD64.key new file mode 100644 index 00000000000..79f3cd2b841 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/62643CEBC7AEBE6817577A34399483700D76BD64.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/680D01F368916A0021C14E3453B27B3C5F900683.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/680D01F368916A0021C14E3453B27B3C5F900683.key new file mode 100644 index 00000000000..776ddf7e9e2 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/680D01F368916A0021C14E3453B27B3C5F900683.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/6DF2D9DF7AED06F0524BEB642DF0FB48EFDBDB93.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/6DF2D9DF7AED06F0524BEB642DF0FB48EFDBDB93.key new file mode 100644 index 00000000000..2b464f0ccbe Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/6DF2D9DF7AED06F0524BEB642DF0FB48EFDBDB93.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/78C17E134E86E691297F7B719B2F2CDF41976234.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/78C17E134E86E691297F7B719B2F2CDF41976234.key new file mode 100644 index 00000000000..28a07668b21 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/78C17E134E86E691297F7B719B2F2CDF41976234.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/7F714F4D9D9676638214991E96D45704E4FFC409.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/7F714F4D9D9676638214991E96D45704E4FFC409.key new file mode 100644 index 00000000000..137659693bd Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/7F714F4D9D9676638214991E96D45704E4FFC409.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/854752F5D8090CA36EFBDD79C72BDFF6FA2D1FF0.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/854752F5D8090CA36EFBDD79C72BDFF6FA2D1FF0.key new file mode 100644 index 00000000000..c99824ccd43 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/854752F5D8090CA36EFBDD79C72BDFF6FA2D1FF0.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/93FF37C268FDBF0767F5FFDC49409DDAC9388B2C.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/93FF37C268FDBF0767F5FFDC49409DDAC9388B2C.key new file mode 100644 index 00000000000..49c2dc58bd8 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/93FF37C268FDBF0767F5FFDC49409DDAC9388B2C.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/A3BA94EAE83509CC90DB1B77B54A51959D8DABEA.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/A3BA94EAE83509CC90DB1B77B54A51959D8DABEA.key new file mode 100644 index 00000000000..ca128408952 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/A3BA94EAE83509CC90DB1B77B54A51959D8DABEA.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/A73E9D01F0465B518E8E7D5AD529077AAC1603B4.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/A73E9D01F0465B518E8E7D5AD529077AAC1603B4.key new file mode 100644 index 00000000000..3f14b40927a Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/A73E9D01F0465B518E8E7D5AD529077AAC1603B4.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/AE6A24B17A8D0CAF9B7E000AA77F0B41D7BFFFCF.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/AE6A24B17A8D0CAF9B7E000AA77F0B41D7BFFFCF.key new file mode 100644 index 00000000000..06adc06c427 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/AE6A24B17A8D0CAF9B7E000AA77F0B41D7BFFFCF.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key new file mode 100644 index 00000000000..cf9a60d233b Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C43E1A079B28DFAEBB39CBA01793BDE11EF4B490.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C43E1A079B28DFAEBB39CBA01793BDE11EF4B490.key new file mode 100644 index 00000000000..0ed35172fe0 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C43E1A079B28DFAEBB39CBA01793BDE11EF4B490.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C67DAD345455EAD6D51368008FC3A53B8D195B5A.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C67DAD345455EAD6D51368008FC3A53B8D195B5A.key new file mode 100644 index 00000000000..090059d9e81 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C67DAD345455EAD6D51368008FC3A53B8D195B5A.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/CB5E00CE582C2645D2573FC16B2F14F85A7F47AA.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/CB5E00CE582C2645D2573FC16B2F14F85A7F47AA.key new file mode 100644 index 00000000000..9061f675121 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/CB5E00CE582C2645D2573FC16B2F14F85A7F47AA.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/CC68630A06B048F5A91136C162C7A3273E20DE6F.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/CC68630A06B048F5A91136C162C7A3273E20DE6F.key new file mode 100644 index 00000000000..89f6013100d Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/CC68630A06B048F5A91136C162C7A3273E20DE6F.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/E7E73903E1BF93481DE0E7C9769D6C31E1863CFF.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/E7E73903E1BF93481DE0E7C9769D6C31E1863CFF.key new file mode 100644 index 00000000000..41dac37574e Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/E7E73903E1BF93481DE0E7C9769D6C31E1863CFF.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/F0117468BE801ED4B81972E159A98FDD4814DCEC.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/F0117468BE801ED4B81972E159A98FDD4814DCEC.key new file mode 100644 index 00000000000..5df7b4a5953 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/F0117468BE801ED4B81972E159A98FDD4814DCEC.key differ diff --git a/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/F4C5EFD5779BE892CAFD5B721D68DED677C9B151.key b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/F4C5EFD5779BE892CAFD5B721D68DED677C9B151.key new file mode 100644 index 00000000000..03daf80975b Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/F4C5EFD5779BE892CAFD5B721D68DED677C9B151.key differ diff --git a/test/lisp/gnus/mml-sec-resources/pubring.gpg b/test/lisp/gnus/mml-sec-resources/pubring.gpg new file mode 100644 index 00000000000..6bd169963df Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/pubring.gpg differ diff --git a/test/lisp/gnus/mml-sec-resources/pubring.kbx b/test/lisp/gnus/mml-sec-resources/pubring.kbx new file mode 100644 index 00000000000..399a0414fd2 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/pubring.kbx differ diff --git a/test/lisp/gnus/mml-sec-resources/secring.gpg b/test/lisp/gnus/mml-sec-resources/secring.gpg new file mode 100644 index 00000000000..b323c072c04 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/secring.gpg differ diff --git a/test/lisp/gnus/mml-sec-resources/trustdb.gpg b/test/lisp/gnus/mml-sec-resources/trustdb.gpg new file mode 100644 index 00000000000..09ebd8db114 Binary files /dev/null and b/test/lisp/gnus/mml-sec-resources/trustdb.gpg differ diff --git a/test/lisp/gnus/mml-sec-resources/trustlist.txt b/test/lisp/gnus/mml-sec-resources/trustlist.txt new file mode 100644 index 00000000000..f886572d283 --- /dev/null +++ b/test/lisp/gnus/mml-sec-resources/trustlist.txt @@ -0,0 +1,26 @@ +# This is the list of trusted keys. Comment lines, like this one, as +# well as empty lines are ignored. Lines have a length limit but this +# is not a serious limitation as the format of the entries is fixed and +# checked by gpg-agent. A non-comment line starts with optional white +# space, followed by the SHA-1 fingerpint in hex, followed by a flag +# which may be one of 'P', 'S' or '*' and optionally followed by a list of +# other flags. The fingerprint may be prefixed with a '!' to mark the +# key as not trusted. You should give the gpg-agent a HUP or run the +# command "gpgconf --reload gpg-agent" after changing this file. + + +# Include the default trust list +include-default + + +# CN=No Expiry +D0:6A:A1:18:65:3C:C3:8E:9D:0C:AF:56:ED:7A:21:35:E1:58:21:77 S relax + +# CN=Second Key Pair +0E:58:22:9B:80:EE:33:95:9F:F7:18:FE:EF:25:40:2B:47:9D:C6:E2 S relax + +# CN=No Expiry two UIDs +D4:CA:78:E1:47:0B:9F:C2:AE:45:D7:84:64:9B:8C:E6:4E:BB:32:0C S relax + +# CN=Different subkeys +4F:96:2A:B7:F4:76:61:6A:78:3D:72:AA:40:35:D5:9B:5F:88:E9:FC S relax diff --git a/test/lisp/gnus/mml-sec-tests.el b/test/lisp/gnus/mml-sec-tests.el index 427018520c8..3da620d64e1 100644 --- a/test/lisp/gnus/mml-sec-tests.el +++ b/test/lisp/gnus/mml-sec-tests.el @@ -23,6 +23,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'message) (require 'epa) @@ -65,8 +66,7 @@ instead of gpg-agent." (let ((agent-info (getenv "GPG_AGENT_INFO")) (gpghome (getenv "GNUPGHOME"))) (condition-case error - (let ((epg-gpg-home-directory - (expand-file-name "test/data/mml-sec" source-directory)) + (let ((epg-gpg-home-directory (ert-resource-directory)) (mml-smime-use 'epg) ;; Create debug output in empty epg-debug-buffer. (epg-debug t) @@ -880,8 +880,7 @@ So the second decryption fails." (equal (cdr (assq 'comm atts)) "gpg-agent") (string-match (concat "homedir.*" - (regexp-quote (expand-file-name "test/data/mml-sec" - source-directory))) + (regexp-quote (ert-resource-directory))) (cdr (assq 'args atts)))) (call-process "kill" nil nil nil (format "%d" pid)))))) -- cgit v1.2.3 From e402887d5d2f7cfc5e3f1cb2a9e629bce782e0a8 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 02:28:45 +0200 Subject: Move shr.el test data to follow our conventions * test/lisp/net/shr-tests.el (ert, ert-x): Require. (shr-tests--datadir): Remove variable. (shr-test, rendering): Use ert-resource-directory. * test/lisp/net/shr-resources/*: Move from test/data/shr/. --- test/data/shr/div-div.html | 1 - test/data/shr/div-div.txt | 2 -- test/data/shr/div-p.html | 1 - test/data/shr/div-p.txt | 3 --- test/data/shr/li-div.html | 10 ---------- test/data/shr/li-div.txt | 6 ------ test/data/shr/li-empty.html | 1 - test/data/shr/li-empty.txt | 3 --- test/data/shr/nonbr.html | 1 - test/data/shr/nonbr.txt | 12 ------------ test/data/shr/ol.html | 29 ----------------------------- test/data/shr/ol.txt | 19 ------------------- test/data/shr/ul-empty.html | 4 ---- test/data/shr/ul-empty.txt | 3 --- test/lisp/net/shr-resources/div-div.html | 1 + test/lisp/net/shr-resources/div-div.txt | 2 ++ test/lisp/net/shr-resources/div-p.html | 1 + test/lisp/net/shr-resources/div-p.txt | 3 +++ test/lisp/net/shr-resources/li-div.html | 10 ++++++++++ test/lisp/net/shr-resources/li-div.txt | 6 ++++++ test/lisp/net/shr-resources/li-empty.html | 1 + test/lisp/net/shr-resources/li-empty.txt | 3 +++ test/lisp/net/shr-resources/nonbr.html | 1 + test/lisp/net/shr-resources/nonbr.txt | 12 ++++++++++++ test/lisp/net/shr-resources/ol.html | 29 +++++++++++++++++++++++++++++ test/lisp/net/shr-resources/ol.txt | 19 +++++++++++++++++++ test/lisp/net/shr-resources/ul-empty.html | 4 ++++ test/lisp/net/shr-resources/ul-empty.txt | 3 +++ test/lisp/net/shr-tests.el | 11 +++++------ 29 files changed, 100 insertions(+), 101 deletions(-) delete mode 100644 test/data/shr/div-div.html delete mode 100644 test/data/shr/div-div.txt delete mode 100644 test/data/shr/div-p.html delete mode 100644 test/data/shr/div-p.txt delete mode 100644 test/data/shr/li-div.html delete mode 100644 test/data/shr/li-div.txt delete mode 100644 test/data/shr/li-empty.html delete mode 100644 test/data/shr/li-empty.txt delete mode 100644 test/data/shr/nonbr.html delete mode 100644 test/data/shr/nonbr.txt delete mode 100644 test/data/shr/ol.html delete mode 100644 test/data/shr/ol.txt delete mode 100644 test/data/shr/ul-empty.html delete mode 100644 test/data/shr/ul-empty.txt create mode 100644 test/lisp/net/shr-resources/div-div.html create mode 100644 test/lisp/net/shr-resources/div-div.txt create mode 100644 test/lisp/net/shr-resources/div-p.html create mode 100644 test/lisp/net/shr-resources/div-p.txt create mode 100644 test/lisp/net/shr-resources/li-div.html create mode 100644 test/lisp/net/shr-resources/li-div.txt create mode 100644 test/lisp/net/shr-resources/li-empty.html create mode 100644 test/lisp/net/shr-resources/li-empty.txt create mode 100644 test/lisp/net/shr-resources/nonbr.html create mode 100644 test/lisp/net/shr-resources/nonbr.txt create mode 100644 test/lisp/net/shr-resources/ol.html create mode 100644 test/lisp/net/shr-resources/ol.txt create mode 100644 test/lisp/net/shr-resources/ul-empty.html create mode 100644 test/lisp/net/shr-resources/ul-empty.txt diff --git a/test/data/shr/div-div.html b/test/data/shr/div-div.html deleted file mode 100644 index 1c191ae44d8..00000000000 --- a/test/data/shr/div-div.html +++ /dev/null @@ -1 +0,0 @@ -
foo
Bar
diff --git a/test/data/shr/div-div.txt b/test/data/shr/div-div.txt deleted file mode 100644 index 62715e12513..00000000000 --- a/test/data/shr/div-div.txt +++ /dev/null @@ -1,2 +0,0 @@ -foo -Bar diff --git a/test/data/shr/div-p.html b/test/data/shr/div-p.html deleted file mode 100644 index fcbdfc43293..00000000000 --- a/test/data/shr/div-p.html +++ /dev/null @@ -1 +0,0 @@ -
foo

Bar

diff --git a/test/data/shr/div-p.txt b/test/data/shr/div-p.txt deleted file mode 100644 index 859d731da89..00000000000 --- a/test/data/shr/div-p.txt +++ /dev/null @@ -1,3 +0,0 @@ -foo - -Bar diff --git a/test/data/shr/li-div.html b/test/data/shr/li-div.html deleted file mode 100644 index eca3c511bd9..00000000000 --- a/test/data/shr/li-div.html +++ /dev/null @@ -1,10 +0,0 @@ -
    -
  • -
    -

    This is the first paragraph of a list item.

    -

    This is the second paragraph of a list item.

  • -
  • -
    This is the first paragraph of a list item.
    -
    This is the second paragraph of a list item.
    -
  • -
diff --git a/test/data/shr/li-div.txt b/test/data/shr/li-div.txt deleted file mode 100644 index 9fc54f2bdc6..00000000000 --- a/test/data/shr/li-div.txt +++ /dev/null @@ -1,6 +0,0 @@ -* This is the first paragraph of a list item. - - This is the second paragraph of a list item. - -* This is the first paragraph of a list item. - This is the second paragraph of a list item. diff --git a/test/data/shr/li-empty.html b/test/data/shr/li-empty.html deleted file mode 100644 index 05cfee7bdd4..00000000000 --- a/test/data/shr/li-empty.html +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/test/data/shr/li-empty.txt b/test/data/shr/li-empty.txt deleted file mode 100644 index 906fd8df8b3..00000000000 --- a/test/data/shr/li-empty.txt +++ /dev/null @@ -1,3 +0,0 @@ -1%20 -2%20 -3%20 diff --git a/test/data/shr/nonbr.html b/test/data/shr/nonbr.html deleted file mode 100644 index 56282cf4ca5..00000000000 --- a/test/data/shr/nonbr.html +++ /dev/null @@ -1 +0,0 @@ -
(progn
  (setq minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt))

  (defun turn-on-cursor-intangible-mode ()
    "Turns on cursor-intangible-mode."
    (interactive)
    (cursor-intangible-mode 1))
  (define-globalized-minor-mode global-cursor-intangible-mode cursor-intangible-mode turn-on-cursor-intangible-mode)

  (global-cursor-intangible-mode 1))

diff --git a/test/data/shr/nonbr.txt b/test/data/shr/nonbr.txt deleted file mode 100644 index 0c3cffa93f9..00000000000 --- a/test/data/shr/nonbr.txt +++ /dev/null @@ -1,12 +0,0 @@ -(progn - (setq minibuffer-prompt-properties '(read-only t cursor-intangible t face -minibuffer-prompt)) - - (defun turn-on-cursor-intangible-mode () - "Turns on cursor-intangible-mode." - (interactive) - (cursor-intangible-mode 1)) - (define-globalized-minor-mode global-cursor-intangible-mode -cursor-intangible-mode turn-on-cursor-intangible-mode) - - (global-cursor-intangible-mode 1)) diff --git a/test/data/shr/ol.html b/test/data/shr/ol.html deleted file mode 100644 index f9a15f26409..00000000000 --- a/test/data/shr/ol.html +++ /dev/null @@ -1,29 +0,0 @@ -
    -
  1. one
  2. -
  3. two
  4. -
  5. three
  6. -
- -
    -
  1. ten
  2. -
  3. eleven
  4. -
  5. twelve
  6. -
- -
    -
  1. zero
  2. -
  3. one
  4. -
  5. two
  6. -
- -
    -
  1. minus five
  2. -
  3. minus four
  4. -
  5. minus three
  6. -
- -
    -
  1. one
  2. -
  3. two
  4. -
  5. three
  6. -
diff --git a/test/data/shr/ol.txt b/test/data/shr/ol.txt deleted file mode 100644 index 0d46e2a8ddb..00000000000 --- a/test/data/shr/ol.txt +++ /dev/null @@ -1,19 +0,0 @@ -1 one -2 two -3 three - -10 ten -11 eleven -12 twelve - -0 zero -1 one -2 two - --5 minus five --4 minus four --3 minus three - -1 one -2 two -3 three diff --git a/test/data/shr/ul-empty.html b/test/data/shr/ul-empty.html deleted file mode 100644 index e5a75ab9216..00000000000 --- a/test/data/shr/ul-empty.html +++ /dev/null @@ -1,4 +0,0 @@ -
    -
  • -
-Lala diff --git a/test/data/shr/ul-empty.txt b/test/data/shr/ul-empty.txt deleted file mode 100644 index 8993555425b..00000000000 --- a/test/data/shr/ul-empty.txt +++ /dev/null @@ -1,3 +0,0 @@ -* - -Lala \ No newline at end of file diff --git a/test/lisp/net/shr-resources/div-div.html b/test/lisp/net/shr-resources/div-div.html new file mode 100644 index 00000000000..1c191ae44d8 --- /dev/null +++ b/test/lisp/net/shr-resources/div-div.html @@ -0,0 +1 @@ +
foo
Bar
diff --git a/test/lisp/net/shr-resources/div-div.txt b/test/lisp/net/shr-resources/div-div.txt new file mode 100644 index 00000000000..62715e12513 --- /dev/null +++ b/test/lisp/net/shr-resources/div-div.txt @@ -0,0 +1,2 @@ +foo +Bar diff --git a/test/lisp/net/shr-resources/div-p.html b/test/lisp/net/shr-resources/div-p.html new file mode 100644 index 00000000000..fcbdfc43293 --- /dev/null +++ b/test/lisp/net/shr-resources/div-p.html @@ -0,0 +1 @@ +
foo

Bar

diff --git a/test/lisp/net/shr-resources/div-p.txt b/test/lisp/net/shr-resources/div-p.txt new file mode 100644 index 00000000000..859d731da89 --- /dev/null +++ b/test/lisp/net/shr-resources/div-p.txt @@ -0,0 +1,3 @@ +foo + +Bar diff --git a/test/lisp/net/shr-resources/li-div.html b/test/lisp/net/shr-resources/li-div.html new file mode 100644 index 00000000000..eca3c511bd9 --- /dev/null +++ b/test/lisp/net/shr-resources/li-div.html @@ -0,0 +1,10 @@ +
    +
  • +
    +

    This is the first paragraph of a list item.

    +

    This is the second paragraph of a list item.

  • +
  • +
    This is the first paragraph of a list item.
    +
    This is the second paragraph of a list item.
    +
  • +
diff --git a/test/lisp/net/shr-resources/li-div.txt b/test/lisp/net/shr-resources/li-div.txt new file mode 100644 index 00000000000..9fc54f2bdc6 --- /dev/null +++ b/test/lisp/net/shr-resources/li-div.txt @@ -0,0 +1,6 @@ +* This is the first paragraph of a list item. + + This is the second paragraph of a list item. + +* This is the first paragraph of a list item. + This is the second paragraph of a list item. diff --git a/test/lisp/net/shr-resources/li-empty.html b/test/lisp/net/shr-resources/li-empty.html new file mode 100644 index 00000000000..05cfee7bdd4 --- /dev/null +++ b/test/lisp/net/shr-resources/li-empty.html @@ -0,0 +1 @@ +
diff --git a/test/lisp/net/shr-resources/li-empty.txt b/test/lisp/net/shr-resources/li-empty.txt new file mode 100644 index 00000000000..906fd8df8b3 --- /dev/null +++ b/test/lisp/net/shr-resources/li-empty.txt @@ -0,0 +1,3 @@ +1%20 +2%20 +3%20 diff --git a/test/lisp/net/shr-resources/nonbr.html b/test/lisp/net/shr-resources/nonbr.html new file mode 100644 index 00000000000..56282cf4ca5 --- /dev/null +++ b/test/lisp/net/shr-resources/nonbr.html @@ -0,0 +1 @@ +
(progn
  (setq minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt))

  (defun turn-on-cursor-intangible-mode ()
    "Turns on cursor-intangible-mode."
    (interactive)
    (cursor-intangible-mode 1))
  (define-globalized-minor-mode global-cursor-intangible-mode cursor-intangible-mode turn-on-cursor-intangible-mode)

  (global-cursor-intangible-mode 1))

diff --git a/test/lisp/net/shr-resources/nonbr.txt b/test/lisp/net/shr-resources/nonbr.txt new file mode 100644 index 00000000000..0c3cffa93f9 --- /dev/null +++ b/test/lisp/net/shr-resources/nonbr.txt @@ -0,0 +1,12 @@ +(progn + (setq minibuffer-prompt-properties '(read-only t cursor-intangible t face +minibuffer-prompt)) + + (defun turn-on-cursor-intangible-mode () + "Turns on cursor-intangible-mode." + (interactive) + (cursor-intangible-mode 1)) + (define-globalized-minor-mode global-cursor-intangible-mode +cursor-intangible-mode turn-on-cursor-intangible-mode) + + (global-cursor-intangible-mode 1)) diff --git a/test/lisp/net/shr-resources/ol.html b/test/lisp/net/shr-resources/ol.html new file mode 100644 index 00000000000..f9a15f26409 --- /dev/null +++ b/test/lisp/net/shr-resources/ol.html @@ -0,0 +1,29 @@ +
    +
  1. one
  2. +
  3. two
  4. +
  5. three
  6. +
+ +
    +
  1. ten
  2. +
  3. eleven
  4. +
  5. twelve
  6. +
+ +
    +
  1. zero
  2. +
  3. one
  4. +
  5. two
  6. +
+ +
    +
  1. minus five
  2. +
  3. minus four
  4. +
  5. minus three
  6. +
+ +
    +
  1. one
  2. +
  3. two
  4. +
  5. three
  6. +
diff --git a/test/lisp/net/shr-resources/ol.txt b/test/lisp/net/shr-resources/ol.txt new file mode 100644 index 00000000000..0d46e2a8ddb --- /dev/null +++ b/test/lisp/net/shr-resources/ol.txt @@ -0,0 +1,19 @@ +1 one +2 two +3 three + +10 ten +11 eleven +12 twelve + +0 zero +1 one +2 two + +-5 minus five +-4 minus four +-3 minus three + +1 one +2 two +3 three diff --git a/test/lisp/net/shr-resources/ul-empty.html b/test/lisp/net/shr-resources/ul-empty.html new file mode 100644 index 00000000000..e5a75ab9216 --- /dev/null +++ b/test/lisp/net/shr-resources/ul-empty.html @@ -0,0 +1,4 @@ +
    +
  • +
+Lala diff --git a/test/lisp/net/shr-resources/ul-empty.txt b/test/lisp/net/shr-resources/ul-empty.txt new file mode 100644 index 00000000000..8993555425b --- /dev/null +++ b/test/lisp/net/shr-resources/ul-empty.txt @@ -0,0 +1,3 @@ +* + +Lala \ No newline at end of file diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el index 88a31bcf645..abc4f6a656b 100644 --- a/test/lisp/net/shr-tests.el +++ b/test/lisp/net/shr-tests.el @@ -23,14 +23,13 @@ ;;; Code: +(require 'ert) +(require 'ert-x) (require 'shr) -(defconst shr-tests--datadir - (expand-file-name "test/data/shr" source-directory)) - (defun shr-test (name) (with-temp-buffer - (insert-file-contents (format (concat shr-tests--datadir "/%s.html") name)) + (insert-file-contents (format (concat (ert-resource-directory) "/%s.html") name)) (let ((dom (libxml-parse-html-region (point-min) (point-max))) (shr-width 80) (shr-use-fonts nil)) @@ -39,7 +38,7 @@ (cons (buffer-substring-no-properties (point-min) (point-max)) (with-temp-buffer (insert-file-contents - (format (concat shr-tests--datadir "/%s.txt") name)) + (format (concat (ert-resource-directory) "/%s.txt") name)) (while (re-search-forward "%\\([0-9A-F][0-9A-F]\\)" nil t) (replace-match (string (string-to-number (match-string 1) 16)) t t)) @@ -47,7 +46,7 @@ (ert-deftest rendering () (skip-unless (fboundp 'libxml-parse-html-region)) - (dolist (file (directory-files shr-tests--datadir nil "\\.html\\'")) + (dolist (file (directory-files (ert-resource-directory) nil "\\.html\\'")) (let* ((name (replace-regexp-in-string "\\.html\\'" "" file)) (result (shr-test name))) (unless (equal (car result) (cdr result)) -- cgit v1.2.3 From 8461cfc8fcef424c7f1098f967679b4bdaa4348e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 02:36:33 +0200 Subject: Move epg.el test data to follow our conventions * test/lisp/epg-tests.el (ert-x): Require. (epg-tests-data-directory): Remove variable. (with-epg-tests): Use ert-resource-file. * test/lisp/epg-resources/*: Moved from test/data/epg/. --- test/data/epg/dummy-pinentry | 22 ---------------------- test/data/epg/pubkey.asc | 20 -------------------- test/data/epg/seckey.asc | 33 --------------------------------- test/lisp/epg-resources/dummy-pinentry | 22 ++++++++++++++++++++++ test/lisp/epg-resources/pubkey.asc | 20 ++++++++++++++++++++ test/lisp/epg-resources/seckey.asc | 33 +++++++++++++++++++++++++++++++++ test/lisp/epg-tests.el | 12 ++++-------- 7 files changed, 79 insertions(+), 83 deletions(-) delete mode 100755 test/data/epg/dummy-pinentry delete mode 100644 test/data/epg/pubkey.asc delete mode 100644 test/data/epg/seckey.asc create mode 100755 test/lisp/epg-resources/dummy-pinentry create mode 100644 test/lisp/epg-resources/pubkey.asc create mode 100644 test/lisp/epg-resources/seckey.asc diff --git a/test/data/epg/dummy-pinentry b/test/data/epg/dummy-pinentry deleted file mode 100755 index 2228dfb0c6d..00000000000 --- a/test/data/epg/dummy-pinentry +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/bash -# Dummy pinentry -# -# Copyright 2008 g10 Code GmbH -# -# This file is free software; as a special exception the author gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. -# -# This file is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. - -echo OK Your orders please - -while read cmd; do - case $cmd in - GETPIN) echo D test0123456789; echo OK;; - *) echo OK;; - esac -done diff --git a/test/data/epg/pubkey.asc b/test/data/epg/pubkey.asc deleted file mode 100644 index c0bf28f6200..00000000000 --- a/test/data/epg/pubkey.asc +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 - -mI0EVRDxCAEEALcScrRmxq5N+Hh+NxPg75RJJdtEi824pwtqMlT/3wG1esmP5gNu -ZIPVaTTSGNZkEzeYdhaLXBUe5qD+RQIQVh+MLt9nisF9nD35imyOrhHwAHnglOPx -GdylH8nQ/tIO5p/lfUlw+iCBlPH7eZHqFJhwP0hJML4PKE8ArWG6RtsxABEBAAG0 -J0pvZSBUZXN0ZXIgKHRlc3Qga2V5KSA8am9lQGV4YW1wbGUuY29tPoi4BBMBAgAi -BQJVEPEIAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRAoscCWMvu4GGYO -A/0Zzoc2z/dvAtFVLh4ovKqP2qliQt2qschJHVP30hJnKT7dmJfJl7kz9mXmMfSt -Ym0luYmeSzdeWORM9SygLRYXuDfN6G4ZPJTlsRhgnARhNzNhSx+YlcFh48Z+a5zR -goBMn7DgYVqfU4UteZOSXMlnuA2Z5ao1qgGhVqESSJgU5riNBFUQ8QgBBADacLkK -D0U11nmlsScxPGkrDr0aJPrG8MEaDRnKjHJKNp3XTp1psGBUpWF/ErjQAIu+psFt -LO8owCGsg/vJM7CzTv2dVBRbrZXjIKvdq7HdivosTMaHArQBpEtSO9rmgVHO+jaQ -q/M2oGvNEB86zo3nfTWhOgBiB32m8kttWRiuWQARAQABiJ8EGAECAAkFAlUQ8QgC -GwwACgkQKLHAljL7uBj44AQAkMJRm7VJUryrDKFtfIfytQx/vmyU/cZcVV6IpKqP -KhztgR+QD9czlHvQhz+y3hqtLRShu2Eyf75dNexcUvKs/lS4LIDXg5V7pWSRk9eQ -G403muqR/NGu6+QmUx09rJl72trdaGxNkyHA7Zy7ZDGkcMvQsd3qoSNGsPR5TKes -w7Q= -=NMxb ------END PGP PUBLIC KEY BLOCK----- diff --git a/test/data/epg/seckey.asc b/test/data/epg/seckey.asc deleted file mode 100644 index 4ac7ba4a502..00000000000 --- a/test/data/epg/seckey.asc +++ /dev/null @@ -1,33 +0,0 @@ ------BEGIN PGP PRIVATE KEY BLOCK----- -Version: GnuPG v1 - -lQHYBFUQ8QgBBAC3EnK0ZsauTfh4fjcT4O+USSXbRIvNuKcLajJU/98BtXrJj+YD -bmSD1Wk00hjWZBM3mHYWi1wVHuag/kUCEFYfjC7fZ4rBfZw9+Ypsjq4R8AB54JTj -8RncpR/J0P7SDuaf5X1JcPoggZTx+3mR6hSYcD9ISTC+DyhPAK1hukbbMQARAQAB -AAP9Hs9agZTobA5QOksXjt9kwqJ63gePtbwVVNz3AoobaGi39PMkRUCPZwaEEbEo -H/CwsUMV4J5sjVtpef/A8mN4csai7NYp82mbo+dPim4p+SUtBg4Ms8ujGVcQeRQd -1CXtIkixDu6fw4wDtNw03ZyNJOhBOXVTgAyOTSlIz3D+6n8CAMeCqEFBHQIVoQpf -Bza4YvFtJRdfGMTix3u7Cb6y9CHGBok7uUgQAeWnzQvMGTCHc3e8iHGAYBQ88GPF -v1TpiusCAOroRe69Aiid5JMVTjWoJ0SHKd47nIj0gQFiDfa5de0BNq9gYj7JLg+R -EjsJbJN39z+Z9HWjIOCUOIXDvucmM1MB/iNxW1Z8mEMflEYK5rop+PDxwqUbr8uZ -kzogw98ZdmuEuN0bheGWUiJI+0Pd8jb40zlR1KgOEMx1mZchToAJdtybMLQnSm9l -IFRlc3RlciAodGVzdCBrZXkpIDxqb2VAZXhhbXBsZS5jb20+iLgEEwECACIFAlUQ -8QgCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJECixwJYy+7gYZg4D/RnO -hzbP928C0VUuHii8qo/aqWJC3aqxyEkdU/fSEmcpPt2Yl8mXuTP2ZeYx9K1ibSW5 -iZ5LN15Y5Ez1LKAtFhe4N83obhk8lOWxGGCcBGE3M2FLH5iVwWHjxn5rnNGCgEyf -sOBhWp9ThS15k5JcyWe4DZnlqjWqAaFWoRJImBTmnQHYBFUQ8QgBBADacLkKD0U1 -1nmlsScxPGkrDr0aJPrG8MEaDRnKjHJKNp3XTp1psGBUpWF/ErjQAIu+psFtLO8o -wCGsg/vJM7CzTv2dVBRbrZXjIKvdq7HdivosTMaHArQBpEtSO9rmgVHO+jaQq/M2 -oGvNEB86zo3nfTWhOgBiB32m8kttWRiuWQARAQABAAP7B8uNtb/DLvGoRfL+mA0Q -REhgOJ1WpRcU6rvKYNPh8xTkKMvM+EK0nVU/znBedEpXjb0pY1WRT0uvXs2pzY2V -YeaugyKIkdUpPWnyWoEQwI8hFvHOWmU2rNHyXLW0MY7bxcGgqv2XbkL4m7/D6VQS -SR8hQ2CxBbW+9ov6aBMwv/UCAOW89+5xxuzkv48AVraWlMnaU0ggVOf6ht0Qa40+ -+uw2yziNlD403gAAAycoICiB/oqwslx61B2xOHn0laCKrgsCAPNpIsHRlAwWbAsq -uCtfIQxg+C3mPXkqsNTMjeK5NjLNytrmO49NXco36zVEG6q7qz5Zj9d9IPYoGOSa -I+dQZ6sB/RKF5aonR5/e7IHJgc8BG7I0yiya4llE0AB9ghnRI/3uHwnCBnmo/32a -n4+rQkx6vm+rg3JA/09Gi7W4R9SwV+ane4ifBBgBAgAJBQJVEPEIAhsMAAoJECix -wJYy+7gY+OAEAJDCUZu1SVK8qwyhbXyH8rUMf75slP3GXFVeiKSqjyoc7YEfkA/X -M5R70Ic/st4arS0UobthMn++XTXsXFLyrP5UuCyA14OVe6VkkZPXkBuNN5rqkfzR -ruvkJlMdPayZe9ra3WhsTZMhwO2cu2QxpHDL0LHd6qEjRrD0eUynrMO0 -=iCIm ------END PGP PRIVATE KEY BLOCK----- diff --git a/test/lisp/epg-resources/dummy-pinentry b/test/lisp/epg-resources/dummy-pinentry new file mode 100755 index 00000000000..2228dfb0c6d --- /dev/null +++ b/test/lisp/epg-resources/dummy-pinentry @@ -0,0 +1,22 @@ +#! /bin/bash +# Dummy pinentry +# +# Copyright 2008 g10 Code GmbH +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This file is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. + +echo OK Your orders please + +while read cmd; do + case $cmd in + GETPIN) echo D test0123456789; echo OK;; + *) echo OK;; + esac +done diff --git a/test/lisp/epg-resources/pubkey.asc b/test/lisp/epg-resources/pubkey.asc new file mode 100644 index 00000000000..c0bf28f6200 --- /dev/null +++ b/test/lisp/epg-resources/pubkey.asc @@ -0,0 +1,20 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +mI0EVRDxCAEEALcScrRmxq5N+Hh+NxPg75RJJdtEi824pwtqMlT/3wG1esmP5gNu +ZIPVaTTSGNZkEzeYdhaLXBUe5qD+RQIQVh+MLt9nisF9nD35imyOrhHwAHnglOPx +GdylH8nQ/tIO5p/lfUlw+iCBlPH7eZHqFJhwP0hJML4PKE8ArWG6RtsxABEBAAG0 +J0pvZSBUZXN0ZXIgKHRlc3Qga2V5KSA8am9lQGV4YW1wbGUuY29tPoi4BBMBAgAi +BQJVEPEIAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRAoscCWMvu4GGYO +A/0Zzoc2z/dvAtFVLh4ovKqP2qliQt2qschJHVP30hJnKT7dmJfJl7kz9mXmMfSt +Ym0luYmeSzdeWORM9SygLRYXuDfN6G4ZPJTlsRhgnARhNzNhSx+YlcFh48Z+a5zR +goBMn7DgYVqfU4UteZOSXMlnuA2Z5ao1qgGhVqESSJgU5riNBFUQ8QgBBADacLkK +D0U11nmlsScxPGkrDr0aJPrG8MEaDRnKjHJKNp3XTp1psGBUpWF/ErjQAIu+psFt +LO8owCGsg/vJM7CzTv2dVBRbrZXjIKvdq7HdivosTMaHArQBpEtSO9rmgVHO+jaQ +q/M2oGvNEB86zo3nfTWhOgBiB32m8kttWRiuWQARAQABiJ8EGAECAAkFAlUQ8QgC +GwwACgkQKLHAljL7uBj44AQAkMJRm7VJUryrDKFtfIfytQx/vmyU/cZcVV6IpKqP +KhztgR+QD9czlHvQhz+y3hqtLRShu2Eyf75dNexcUvKs/lS4LIDXg5V7pWSRk9eQ +G403muqR/NGu6+QmUx09rJl72trdaGxNkyHA7Zy7ZDGkcMvQsd3qoSNGsPR5TKes +w7Q= +=NMxb +-----END PGP PUBLIC KEY BLOCK----- diff --git a/test/lisp/epg-resources/seckey.asc b/test/lisp/epg-resources/seckey.asc new file mode 100644 index 00000000000..4ac7ba4a502 --- /dev/null +++ b/test/lisp/epg-resources/seckey.asc @@ -0,0 +1,33 @@ +-----BEGIN PGP PRIVATE KEY BLOCK----- +Version: GnuPG v1 + +lQHYBFUQ8QgBBAC3EnK0ZsauTfh4fjcT4O+USSXbRIvNuKcLajJU/98BtXrJj+YD +bmSD1Wk00hjWZBM3mHYWi1wVHuag/kUCEFYfjC7fZ4rBfZw9+Ypsjq4R8AB54JTj +8RncpR/J0P7SDuaf5X1JcPoggZTx+3mR6hSYcD9ISTC+DyhPAK1hukbbMQARAQAB +AAP9Hs9agZTobA5QOksXjt9kwqJ63gePtbwVVNz3AoobaGi39PMkRUCPZwaEEbEo +H/CwsUMV4J5sjVtpef/A8mN4csai7NYp82mbo+dPim4p+SUtBg4Ms8ujGVcQeRQd +1CXtIkixDu6fw4wDtNw03ZyNJOhBOXVTgAyOTSlIz3D+6n8CAMeCqEFBHQIVoQpf +Bza4YvFtJRdfGMTix3u7Cb6y9CHGBok7uUgQAeWnzQvMGTCHc3e8iHGAYBQ88GPF +v1TpiusCAOroRe69Aiid5JMVTjWoJ0SHKd47nIj0gQFiDfa5de0BNq9gYj7JLg+R +EjsJbJN39z+Z9HWjIOCUOIXDvucmM1MB/iNxW1Z8mEMflEYK5rop+PDxwqUbr8uZ +kzogw98ZdmuEuN0bheGWUiJI+0Pd8jb40zlR1KgOEMx1mZchToAJdtybMLQnSm9l +IFRlc3RlciAodGVzdCBrZXkpIDxqb2VAZXhhbXBsZS5jb20+iLgEEwECACIFAlUQ +8QgCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJECixwJYy+7gYZg4D/RnO +hzbP928C0VUuHii8qo/aqWJC3aqxyEkdU/fSEmcpPt2Yl8mXuTP2ZeYx9K1ibSW5 +iZ5LN15Y5Ez1LKAtFhe4N83obhk8lOWxGGCcBGE3M2FLH5iVwWHjxn5rnNGCgEyf +sOBhWp9ThS15k5JcyWe4DZnlqjWqAaFWoRJImBTmnQHYBFUQ8QgBBADacLkKD0U1 +1nmlsScxPGkrDr0aJPrG8MEaDRnKjHJKNp3XTp1psGBUpWF/ErjQAIu+psFtLO8o +wCGsg/vJM7CzTv2dVBRbrZXjIKvdq7HdivosTMaHArQBpEtSO9rmgVHO+jaQq/M2 +oGvNEB86zo3nfTWhOgBiB32m8kttWRiuWQARAQABAAP7B8uNtb/DLvGoRfL+mA0Q +REhgOJ1WpRcU6rvKYNPh8xTkKMvM+EK0nVU/znBedEpXjb0pY1WRT0uvXs2pzY2V +YeaugyKIkdUpPWnyWoEQwI8hFvHOWmU2rNHyXLW0MY7bxcGgqv2XbkL4m7/D6VQS +SR8hQ2CxBbW+9ov6aBMwv/UCAOW89+5xxuzkv48AVraWlMnaU0ggVOf6ht0Qa40+ ++uw2yziNlD403gAAAycoICiB/oqwslx61B2xOHn0laCKrgsCAPNpIsHRlAwWbAsq +uCtfIQxg+C3mPXkqsNTMjeK5NjLNytrmO49NXco36zVEG6q7qz5Zj9d9IPYoGOSa +I+dQZ6sB/RKF5aonR5/e7IHJgc8BG7I0yiya4llE0AB9ghnRI/3uHwnCBnmo/32a +n4+rQkx6vm+rg3JA/09Gi7W4R9SwV+ane4ifBBgBAgAJBQJVEPEIAhsMAAoJECix +wJYy+7gY+OAEAJDCUZu1SVK8qwyhbXyH8rUMf75slP3GXFVeiKSqjyoc7YEfkA/X +M5R70Ic/st4arS0UobthMn++XTXsXFLyrP5UuCyA14OVe6VkkZPXkBuNN5rqkfzR +ruvkJlMdPayZe9ra3WhsTZMhwO2cu2QxpHDL0LHd6qEjRrD0eUynrMO0 +=iCIm +-----END PGP PRIVATE KEY BLOCK----- diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el index 2a9c021c67b..c9c92f529be 100644 --- a/test/lisp/epg-tests.el +++ b/test/lisp/epg-tests.el @@ -22,14 +22,11 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'epg) (defvar epg-tests-context nil) -(defvar epg-tests-data-directory - (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY")) - "Directory containing epg test data.") - (defconst epg-tests--config-program-alist ;; The default `epg-config--program-alist' requires gpg2 2.1 or ;; greater due to some practical problems with pinentry. But most @@ -85,8 +82,7 @@ '(with-temp-file (expand-file-name "gpg-agent.conf" epg-tests-home-directory) (insert "pinentry-program " - (expand-file-name "dummy-pinentry" - epg-tests-data-directory) + (ert-resource-file "dummy-pinentry") "\n") (epg-context-set-passphrase-callback context @@ -94,11 +90,11 @@ ,(if require-public-key '(epg-import-keys-from-file context - (expand-file-name "pubkey.asc" epg-tests-data-directory))) + (ert-resource-file "pubkey.asc"))) ,(if require-secret-key '(epg-import-keys-from-file context - (expand-file-name "seckey.asc" epg-tests-data-directory))) + (ert-resource-file "seckey.asc"))) (with-temp-buffer (make-local-variable 'epg-tests-context) (setq epg-tests-context context) -- cgit v1.2.3 From 3af9e84ff59811734dcbb5d55e04e1fdb7051e77 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 02:56:00 +0200 Subject: Fix a broken unsafep test * test/lisp/emacs-lisp/unsafep-tests.el (test-unsafep/message): Fix test case. (unsafep-tests--safe): Rename from testcover-unsafep-safe. (unsafep-tests--unsafe): Rename from testcover-unsafep-unsafe. (test-unsafep/safe, test-unsafep/unsafe): Doc fix. Adjust usage of above renamed variables. --- test/lisp/emacs-lisp/unsafep-tests.el | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/test/lisp/emacs-lisp/unsafep-tests.el b/test/lisp/emacs-lisp/unsafep-tests.el index 2b920a00ca4..dde0e0201d9 100644 --- a/test/lisp/emacs-lisp/unsafep-tests.el +++ b/test/lisp/emacs-lisp/unsafep-tests.el @@ -27,7 +27,7 @@ (defvar safe-functions) ;;; These forms are all considered safe -(defconst testcover-unsafep-safe +(defconst unsafep-tests--safe '(((lambda (x) (* x 2)) 14) (apply 'cdr (mapcar (lambda (x) (car x)) y)) (cond ((= x 4) 5) (t 27)) @@ -47,7 +47,7 @@ "List of forms that `unsafep' should decide are safe.") ;;; These forms are considered unsafe -(defconst testcover-unsafep-unsafe +(defconst unsafep-tests--unsafe '(( (add-to-list x y) . (unquoted x)) ( (add-to-list y x) @@ -106,25 +106,23 @@ ( (let (1) 2) . (variable 1)) ) - "A-list of (FORM . REASON)... that`unsafep' should decide are unsafe.") + "A-list of (FORM . REASON)... that `unsafep' should decide are unsafe.") (ert-deftest test-unsafep/safe () - "Executes all unsafep tests and displays the coverage results." + "Check safe forms with safe-functions nil." (let (safe-functions) - (dolist (x testcover-unsafep-safe) + (dolist (x unsafep-tests--safe) (should-not (unsafep x))))) (ert-deftest test-unsafep/message () - ;; FIXME: This failed after converting these tests from testcover to - ;; ert. - :expected-result :failed - (should-not '(dolist (x y) (message "here: %s" x))) - (should-not '(dotimes (x 14 (* x 2)) (message "here: %d" x)))) + "Check that message is considered unsafe." + (should (unsafep '(dolist (x y) (message "here: %s" x)))) + (should (unsafep '(dotimes (x 14 (* x 2)) (message "here: %d" x))))) (ert-deftest test-unsafep/unsafe () - "Executes all unsafep tests and displays the coverage results." + "Check unsafe forms with safe-functions nil." (let (safe-functions) - (dolist (x testcover-unsafep-unsafe) + (dolist (x unsafep-tests--unsafe) (should (equal (unsafep (car x)) (cdr x)))))) (ert-deftest test-unsafep/safe-functions-t () -- cgit v1.2.3 From 5b3e4db53f0e81a51f611823f3b6627b973a18c6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 24 Oct 2020 10:07:44 +0300 Subject: Fix last change in image.c for MS-Windows * src/image.c [LIBRSVG_CHECK_VERSION (2, 46, 0)]: Define prototype for rsvg_handle_get_geometry_for_layer. (init_svg_functions) [LIBRSVG_CHECK_VERSION (2, 46, 0)]: Load rsvg_handle_get_geometry_for_layer from the DLL, instead of rsvg_handle_get_dimensions. (rsvg_handle_get_geometry_for_layer) [LIBRSVG_CHECK_VERSION (2, 46, 0)]: Define macro. (Bug#44065) --- src/image.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/image.c b/src/image.c index 5f6d9f4c443..61c5aa760c7 100644 --- a/src/image.c +++ b/src/image.c @@ -9543,10 +9543,16 @@ DEF_DLL_FN (gboolean, rsvg_handle_write, (RsvgHandle *, const guchar *, gsize, GError **)); DEF_DLL_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **)); #endif + +#if LIBRSVG_CHECK_VERSION (2, 46, 0) +DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, + (RsvgHandle *, const char *, const RsvgRectangle *, + RsvgRectangle *, RsvgRectangle *, GError **)); +#else DEF_DLL_FN (void, rsvg_handle_get_dimensions, (RsvgHandle *, RsvgDimensionData *)); +#endif DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); - DEF_DLL_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *)); DEF_DLL_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *)); DEF_DLL_FN (guchar *, gdk_pixbuf_get_pixels, (const GdkPixbuf *)); @@ -9592,7 +9598,11 @@ init_svg_functions (void) LOAD_DLL_FN (library, rsvg_handle_write); LOAD_DLL_FN (library, rsvg_handle_close); #endif +#if LIBRSVG_CHECK_VERSION (2, 46, 0) + LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer); +#else LOAD_DLL_FN (library, rsvg_handle_get_dimensions); +#endif LOAD_DLL_FN (library, rsvg_handle_get_pixbuf); LOAD_DLL_FN (gdklib, gdk_pixbuf_get_width); @@ -9627,7 +9637,11 @@ init_svg_functions (void) # undef g_clear_error # undef g_object_unref # undef g_type_init -# undef rsvg_handle_get_dimensions +# if LIBRSVG_CHECK_VERSION (2, 46, 0) +# undef rsvg_handle_get_geometry_for_layer +# else +# undef rsvg_handle_get_dimensions +# endif # undef rsvg_handle_get_pixbuf # if LIBRSVG_CHECK_VERSION (2, 32, 0) # undef g_file_new_for_path @@ -9653,7 +9667,11 @@ init_svg_functions (void) # if ! GLIB_CHECK_VERSION (2, 36, 0) # define g_type_init fn_g_type_init # endif -# define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions +# if LIBRSVG_CHECK_VERSION (2, 46, 0) +# define rsvg_handle_get_geometry_for_layer fn_rsvg_handle_get_geometry_for_layer +# else +# define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions +# endif # define rsvg_handle_get_pixbuf fn_rsvg_handle_get_pixbuf # if LIBRSVG_CHECK_VERSION (2, 32, 0) # define g_file_new_for_path fn_g_file_new_for_path -- cgit v1.2.3 From 9d230684ff16e105db168ebaafdbea2de2e7d6ca Mon Sep 17 00:00:00 2001 From: Jared Finder Date: Sat, 19 Sep 2020 00:43:29 -0700 Subject: Adding mouse controls to menu-bar.el. * lisp/isearch.el (tmm-menubar-keymap): Remove declare-function. * lisp/menu-bar.el (menu-bar-open-mouse, menu-bar-keymap) (menu-bar-current-active-maps, menu-bar-item-at-x): New functions. *lisp.tmm.el (tmm-menubar-keymap, tmm-get-keybind): Functions deleted. (tmm-menubar): Call 'menu-bar-item-at-x'. --- lisp/isearch.el | 3 +-- lisp/menu-bar.el | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ lisp/tmm.el | 63 +++++--------------------------------------- 3 files changed, 87 insertions(+), 59 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 0879f948cff..c3d5ff2d313 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -54,7 +54,6 @@ ;;; Code: (eval-when-compile (require 'cl-lib)) -(declare-function tmm-menubar-keymap "tmm.el") ;; Some additional options and constants. @@ -505,7 +504,7 @@ This is like `describe-bindings', but displays only Isearch keys." (require 'tmm) (run-hooks 'menu-bar-update-hook) (let ((command nil)) - (let ((menu-bar (tmm-menubar-keymap))) + (let ((menu-bar (menu-bar-keymap))) (with-isearch-suspended (setq command (let ((isearch-mode t)) ; Show bindings from ; `isearch-mode-map' in diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index da4ad9799bd..8690569ac0a 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2663,6 +2663,86 @@ If FRAME is nil or not given, use the selected frame." (global-set-key [f10] 'menu-bar-open) +(defun menu-bar-open-mouse (event) + "Open the menu bar for the menu item clicked on by the mouse. +EVENT should be a mouse down or click event. + +Also see `menu-bar-open', which this calls. +This command is to be used when you click the mouse in the menubar." + (interactive "e") + (let* ((x-position (car (posn-x-y (event-start event)))) + (menu-bar-item-cons (menu-bar-item-at-x x-position))) + (menu-bar-open nil + (if menu-bar-item-cons + (cdr menu-bar-item-cons) + 0)))) + +(defun menu-bar-keymap () + "Return the current menu-bar keymap. + +The ordering of the return value respects `menu-bar-final-items'." + (let ((menu-bar '()) + (menu-end '())) + (map-keymap + (lambda (key binding) + (let ((pos (seq-position menu-bar-final-items key)) + (menu-item (cons key binding))) + (if pos + ;; If KEY is the name of an item that we want to put + ;; last, store it separately with explicit ordering for + ;; sorting. + (push (cons pos menu-item) menu-end) + (push menu-item menu-bar)))) + (lookup-key (menu-bar-current-active-maps) [menu-bar])) + `(keymap ,@(nreverse menu-bar) + ,@(mapcar #'cdr (sort menu-end + (lambda (a b) + (< (car a) (car b)))))))) + +(defun menu-bar-current-active-maps () + "Return the current active maps in the order the menu bar displays them. +This value does not take into account `menu-bar-final-items' as that applies +per-item." + ;; current-active-maps returns maps in the order local then + ;; global. The menu bar displays items in the opposite order. + (cons 'keymap (nreverse (current-active-maps)))) + +(defun menu-bar-item-at-x (x-position) + "Return a cons of the form (KEY . X) for a menu item. +The returned X is the left X coordinate for that menu item. + +X-POSITION is the X coordinate being queried. If nothing is clicked on, +returns nil." + (let ((column 0) + (menu-bar (menu-bar-keymap)) + prev-key + prev-column + found) + (catch 'done + (map-keymap + (lambda (key binding) + (when (> column x-position) + (setq found t) + (throw 'done nil)) + (setq prev-key key) + (pcase binding + ((or `(,(and (pred stringp) name) . ,_) ;Simple menu item. + `(menu-item ,name ,_cmd ;Extended menu item. + . ,(and props + (guard (let ((visible + (plist-get props :visible))) + (or (null visible) + (eval visible))))))) + (setq prev-column column + column (+ column (length name) 1))))) + menu-bar) + ;; Check the last menu item. + (when (> column x-position) + (setq found t))) + (if found + (cons prev-key prev-column) + nil))) + (defun buffer-menu-open () "Start key navigation of the buffer menu. This is the keyboard interface to \\[mouse-buffer-menu]." diff --git a/lisp/tmm.el b/lisp/tmm.el index 0e83f427f5f..fc02fd57907 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -42,28 +42,6 @@ (defvar tmm-next-shortcut-digit) (defvar tmm-table-undef) -(defun tmm-menubar-keymap () - "Return the current menu-bar keymap. - -The ordering of the return value respects `menu-bar-final-items'." - (let ((menu-bar '()) - (menu-end '())) - (map-keymap - (lambda (key binding) - (let ((pos (seq-position menu-bar-final-items key)) - (menu-item (cons key binding))) - (if pos - ;; If KEY is the name of an item that we want to put - ;; last, store it separately with explicit ordering for - ;; sorting. - (push (cons pos menu-item) menu-end) - (push menu-item menu-bar)))) - (tmm-get-keybind [menu-bar])) - `(keymap ,@(nreverse menu-bar) - ,@(mapcar #'cdr (sort menu-end - (lambda (a b) - (< (car a) (car b)))))))) - ;;;###autoload (define-key global-map "\M-`" 'tmm-menubar) ;;;###autoload (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse) @@ -79,33 +57,12 @@ to invoke `tmm-menubar' instead, customize the variable `tty-menu-open-use-tmm' to a non-nil value." (interactive) (run-hooks 'menu-bar-update-hook) - ;; Obey menu-bar-final-items; put those items last. - (let ((menu-bar (tmm-menubar-keymap)) - menu-bar-item) - (if x-position - (let ((column 0) - prev-key) - (catch 'done - (map-keymap - (lambda (key binding) - (when (> column x-position) - (setq menu-bar-item prev-key) - (throw 'done nil)) - (setq prev-key key) - (pcase binding - ((or `(,(and (pred stringp) name) . ,_) ;Simple menu item. - `(menu-item ,name ,_cmd ;Extended menu item. - . ,(and props - (guard (let ((visible - (plist-get props :visible))) - (or (null visible) - (eval visible))))))) - (setq column (+ column (length name) 1))))) - menu-bar) - ;; Check the last menu item. - (when (> column x-position) - (setq menu-bar-item prev-key))))) - (tmm-prompt menu-bar nil menu-bar-item))) + (let ((menu-bar (menu-bar-keymap)) + (menu-bar-item-cons (and x-position + (menu-bar-item-at-x x-position)))) + (tmm-prompt menu-bar + nil + (and menu-bar-item-cons (car menu-bar-item-cons))))) ;;;###autoload (defun tmm-menubar-mouse (event) @@ -525,14 +482,6 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." (or (assoc str tmm-km-list) (push (cons str (cons event km)) tmm-km-list)))))) -(defun tmm-get-keybind (keyseq) - "Return the current binding of KEYSEQ, merging prefix definitions. -If KEYSEQ is a prefix key that has local and global bindings, -we merge them into a single keymap which shows the proper order of the menu. -However, for the menu bar itself, the value does not take account -of `menu-bar-final-items'." - (lookup-key (cons 'keymap (nreverse (current-active-maps))) keyseq)) - (provide 'tmm) ;;; tmm.el ends here -- cgit v1.2.3 From 0695c9e8599b5036a80361571e7cb0ea9fdead99 Mon Sep 17 00:00:00 2001 From: Jared Finder Date: Sat, 3 Oct 2020 14:46:30 -0700 Subject: Make TTY menus work with xterm-mouse-mode * src/term.c (mouse_get_xy): Call 'mouse_position' passing it the value of 'tty-menu-calls-mouse-position-function' as the argument. (syms_of_term) : New DEFVAR_BOOL. * src/frame.c (mouse_position): New function, with most of the code from Fmouse_position, but call 'mouse-position-function' only if called with non-zero argument. (Fmouse_position): Call 'mouse_position' to do the job. * lisp/xt-mouse.el (xterm-mouse-translate-1): Respect 'track-mouse'. (xterm-mouse-mode): Set 'tty-menu-calls-mouse-position-function' when setting 'mouse-position-function'. (xterm-mouse-tracking-enable-sequence): Use SET_ANY_EVENT_MOUSE (0x1003) so that mouse movement can be reported even if no buttons are pressed. Doc fix. * lisp/menu-bar.el (menu-bar-define-mouse-key): New function. (tty-menu-navigation-map): Call it. * doc/lispref/frames.texi (Mouse Position): Document 'tty-menu-calls-mouse-position-function'. * etc/NEWS: Announce 'tty-menu-calls-mouse-position-function'. --- doc/lispref/frames.texi | 7 ++++++ etc/NEWS | 8 +++++++ lisp/menu-bar.el | 64 ++++++++++++++++++++++++++----------------------- lisp/xt-mouse.el | 26 ++++++++++++-------- src/frame.c | 8 ++++++- src/frame.h | 1 + src/term.c | 26 ++++++++++++-------- 7 files changed, 89 insertions(+), 51 deletions(-) diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 22d32c00d9b..e3d0fdeb277 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -3526,6 +3526,13 @@ This abnormal hook exists for the benefit of packages like @file{xt-mouse.el} that need to do mouse handling at the Lisp level. @end defvar +@defvar tty-menu-calls-mouse-position-function +If non-@code{nil}, TTY menus will call @code{mouse-position-function} +as described above. This exists for cases where +@code{mouse-position-function} is not safe to be called by the TTY +menus, such as if it could trigger redisplay. +@end defvar + @defun set-mouse-position frame x y This function @dfn{warps the mouse} to position @var{x}, @var{y} in frame @var{frame}. The arguments @var{x} and @var{y} are integers, diff --git a/etc/NEWS b/etc/NEWS index 11c19b378a6..a212edfcfb2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1748,6 +1748,14 @@ convert them to a list '(R G B)' of primary color values. This user option can be one of the predefined styles or a function to personalize the uniquified buffer name. ++++ +** New variable 'tty-menu-calls-mouse-position-function'. +This controls whether 'mouse-position-function' is called by functions +that retrieve the mouse position when that happens during TTY menu +handling. Lisp programs that set 'mouse-position-function' should +also set this variable non-nil if they are compatible with the tty +menu handling. + +++ ** 'inhibit-nul-byte-detection' is renamed to 'inhibit-null-byte-detection'. diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 8690569ac0a..e78c1a6c707 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2762,6 +2762,16 @@ This is the keyboard interface to \\[mouse-buffer-menu]." (menu-bar-buffer-vector item))))) km)) +(defun menu-bar-define-mouse-key (map key def) + "Like `define-key', but adds all possible prefixes for the mouse." + (define-key map (vector key) def) + (mapc (lambda (prefix) (define-key map (vector prefix key) def)) + ;; This list only needs to contain special window areas that + ;; are rendered in TTYs. No need for *-scroll-bar, *-fringe, + ;; or *-divider. + '(tab-line header-line menu-bar tab-bar mode-line vertical-line + left-margin right-margin))) + (defvar tty-menu-navigation-map (let ((map (make-sparse-keymap))) ;; The next line is disabled because it breaks interpretation of @@ -2796,39 +2806,33 @@ This is the keyboard interface to \\[mouse-buffer-menu]." (define-key map [?\C-j] 'tty-menu-select) (define-key map [return] 'tty-menu-select) (define-key map [linefeed] 'tty-menu-select) - (define-key map [mouse-1] 'tty-menu-select) - (define-key map [drag-mouse-1] 'tty-menu-select) - (define-key map [mouse-2] 'tty-menu-select) - (define-key map [drag-mouse-2] 'tty-menu-select) - (define-key map [mouse-3] 'tty-menu-select) - (define-key map [drag-mouse-3] 'tty-menu-select) - (define-key map [wheel-down] 'tty-menu-next-item) - (define-key map [wheel-up] 'tty-menu-prev-item) - (define-key map [wheel-left] 'tty-menu-prev-menu) - (define-key map [wheel-right] 'tty-menu-next-menu) - ;; The following 4 bindings are for those whose text-mode mouse + (menu-bar-define-mouse-key map 'mouse-1 'tty-menu-select) + (menu-bar-define-mouse-key map 'drag-mouse-1 'tty-menu-select) + (menu-bar-define-mouse-key map 'mouse-2 'tty-menu-select) + (menu-bar-define-mouse-key map 'drag-mouse-2 'tty-menu-select) + (menu-bar-define-mouse-key map 'mouse-3 'tty-menu-select) + (menu-bar-define-mouse-key map 'drag-mouse-3 'tty-menu-select) + (menu-bar-define-mouse-key map 'wheel-down 'tty-menu-next-item) + (menu-bar-define-mouse-key map 'wheel-up 'tty-menu-prev-item) + (menu-bar-define-mouse-key map 'wheel-left 'tty-menu-prev-menu) + (menu-bar-define-mouse-key map 'wheel-right 'tty-menu-next-menu) + ;; The following 6 bindings are for those whose text-mode mouse ;; lack the wheel. - (define-key map [S-mouse-1] 'tty-menu-next-item) - (define-key map [S-drag-mouse-1] 'tty-menu-next-item) - (define-key map [S-mouse-2] 'tty-menu-prev-item) - (define-key map [S-drag-mouse-2] 'tty-menu-prev-item) - (define-key map [S-mouse-3] 'tty-menu-prev-item) - (define-key map [S-drag-mouse-3] 'tty-menu-prev-item) - (define-key map [header-line mouse-1] 'tty-menu-select) - (define-key map [header-line drag-mouse-1] 'tty-menu-select) + (menu-bar-define-mouse-key map 'S-mouse-1 'tty-menu-next-item) + (menu-bar-define-mouse-key map 'S-drag-mouse-1 'tty-menu-next-item) + (menu-bar-define-mouse-key map 'S-mouse-2 'tty-menu-prev-item) + (menu-bar-define-mouse-key map 'S-drag-mouse-2 'tty-menu-prev-item) + (menu-bar-define-mouse-key map 'S-mouse-3 'tty-menu-prev-item) + (menu-bar-define-mouse-key map 'S-drag-mouse-3 'tty-menu-prev-item) ;; The down-mouse events must be bound to tty-menu-ignore, so that ;; only releasing the mouse button pops up the menu. - (define-key map [mode-line down-mouse-1] 'tty-menu-ignore) - (define-key map [mode-line down-mouse-2] 'tty-menu-ignore) - (define-key map [mode-line down-mouse-3] 'tty-menu-ignore) - (define-key map [mode-line C-down-mouse-1] 'tty-menu-ignore) - (define-key map [mode-line C-down-mouse-2] 'tty-menu-ignore) - (define-key map [mode-line C-down-mouse-3] 'tty-menu-ignore) - (define-key map [down-mouse-1] 'tty-menu-ignore) - (define-key map [C-down-mouse-1] 'tty-menu-ignore) - (define-key map [C-down-mouse-2] 'tty-menu-ignore) - (define-key map [C-down-mouse-3] 'tty-menu-ignore) - (define-key map [mouse-movement] 'tty-menu-mouse-movement) + (menu-bar-define-mouse-key map 'down-mouse-1 'tty-menu-ignore) + (menu-bar-define-mouse-key map 'down-mouse-2 'tty-menu-ignore) + (menu-bar-define-mouse-key map 'down-mouse-3 'tty-menu-ignore) + (menu-bar-define-mouse-key map 'C-down-mouse-1 'tty-menu-ignore) + (menu-bar-define-mouse-key map 'C-down-mouse-2 'tty-menu-ignore) + (menu-bar-define-mouse-key map 'C-down-mouse-3 'tty-menu-ignore) + (menu-bar-define-mouse-key map 'mouse-movement 'tty-menu-mouse-movement) map) "Keymap used while processing TTY menus.") diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 362d29b943d..3c0dfb65ecf 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -76,7 +76,11 @@ https://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." ;; to guard against that. (copy-sequence event)) vec) - (is-move vec) + (is-move + (if track-mouse vec + ;; Mouse movement events are currently supposed to be + ;; suppressed. Return no event. + [])) (t (let* ((down (terminal-parameter nil 'xterm-mouse-last-down)) (down-data (nth 1 down)) @@ -321,11 +325,13 @@ down the SHIFT key while pressing the mouse button." (if xterm-mouse-mode ;; Turn it on (progn - (setq mouse-position-function #'xterm-mouse-position-function) + (setq mouse-position-function #'xterm-mouse-position-function + tty-menu-calls-mouse-position-function t) (mapc #'turn-on-xterm-mouse-tracking-on-terminal (terminal-list))) ;; Turn it off (mapc #'turn-off-xterm-mouse-tracking-on-terminal (terminal-list)) - (setq mouse-position-function nil))) + (setq mouse-position-function nil + tty-menu-calls-mouse-position-function nil))) (defun xterm-mouse-tracking-enable-sequence () "Return a control sequence to enable XTerm mouse tracking. @@ -339,8 +345,8 @@ modern xterms: position (<= 223), which can be reported in this basic mode. -\"\\e[?1002h\" \"Mouse motion mode\": Enables reports for mouse - motion events during dragging operations. +\"\\e[?1003h\" \"Mouse motion mode\": Enables reports for mouse + motion events. \"\\e[?1005h\" \"UTF-8 coordinate extension\": Enables an extension to the basic mouse mode, which uses UTF-8 @@ -360,7 +366,7 @@ given escape sequence takes precedence over the former." (apply #'concat (xterm-mouse--tracking-sequence ?h))) (defconst xterm-mouse-tracking-enable-sequence - "\e[?1000h\e[?1002h\e[?1005h\e[?1006h" + "\e[?1000h\e[?1003h\e[?1005h\e[?1006h" "Control sequence to enable xterm mouse tracking. Enables basic mouse tracking, mouse motion events and finally extended tracking on terminals that support it. The following @@ -371,8 +377,8 @@ escape sequences are understood by modern xterms: position (<= 223), which can be reported in this basic mode. -\"\\e[?1002h\" \"Mouse motion mode\": Enables reports for mouse - motion events during dragging operations. +\"\\e[?1003h\" \"Mouse motion mode\": Enables reports for mouse + motion events. \"\\e[?1005h\" \"UTF-8 coordinate extension\": Enables an extension to the basic mouse mode, which uses UTF-8 @@ -400,7 +406,7 @@ The control sequence resets the modes set by (apply #'concat (nreverse (xterm-mouse--tracking-sequence ?l)))) (defconst xterm-mouse-tracking-disable-sequence - "\e[?1006l\e[?1005l\e[?1002l\e[?1000l" + "\e[?1006l\e[?1005l\e[?1003l\e[?1000l" "Reset the modes set by `xterm-mouse-tracking-enable-sequence'.") (make-obsolete-variable @@ -414,7 +420,7 @@ SUFFIX is the last character of each escape sequence (?h to enable, ?l to disable)." (mapcar (lambda (code) (format "\e[?%d%c" code suffix)) - `(1000 1002 ,@(when xterm-mouse-utf-8 '(1005)) 1006))) + `(1000 1003 ,@(when xterm-mouse-utf-8 '(1005)) 1006))) (defun turn-on-xterm-mouse-tracking-on-terminal (&optional terminal) "Enable xterm mouse tracking on TERMINAL." diff --git a/src/frame.c b/src/frame.c index 0b707c2af87..5d967a59ce3 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2433,6 +2433,12 @@ If `mouse-position-function' is non-nil, `mouse-position' calls it, passing the normal return value to that function as an argument, and returns whatever that function returns. */) (void) +{ + return mouse_position (true); +} + +Lisp_Object +mouse_position (bool call_mouse_position_function) { struct frame *f; Lisp_Object lispy_dummy; @@ -2462,7 +2468,7 @@ and returns whatever that function returns. */) } XSETFRAME (lispy_dummy, f); retval = Fcons (lispy_dummy, Fcons (x, y)); - if (!NILP (Vmouse_position_function)) + if (call_mouse_position_function && !NILP (Vmouse_position_function)) retval = call1 (Vmouse_position_function, retval); return retval; } diff --git a/src/frame.h b/src/frame.h index 476bac67faf..16ecfd311c3 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1361,6 +1361,7 @@ extern bool frame_inhibit_resize (struct frame *, bool, Lisp_Object); extern void adjust_frame_size (struct frame *, int, int, int, bool, Lisp_Object); extern void frame_size_history_add (struct frame *f, Lisp_Object fun_symbol, int width, int height, Lisp_Object rest); +extern Lisp_Object mouse_position (bool); extern Lisp_Object Vframe_list; diff --git a/src/term.c b/src/term.c index 53a1016183b..ff1aabfed23 100644 --- a/src/term.c +++ b/src/term.c @@ -2804,16 +2804,15 @@ tty_menu_calc_size (tty_menu *menu, int *width, int *height) static void mouse_get_xy (int *x, int *y) { - struct frame *sf = SELECTED_FRAME (); - Lisp_Object lmx = Qnil, lmy = Qnil, lisp_dummy; - enum scroll_bar_part part_dummy; - Time time_dummy; - - if (FRAME_TERMINAL (sf)->mouse_position_hook) - (*FRAME_TERMINAL (sf)->mouse_position_hook) (&sf, -1, - &lisp_dummy, &part_dummy, - &lmx, &lmy, - &time_dummy); + Lisp_Object lmx = Qnil, lmy = Qnil; + Lisp_Object mouse = mouse_position (tty_menu_calls_mouse_position_function); + + if (EQ (selected_frame, XCAR (mouse))) + { + lmx = XCAR (XCDR (mouse)); + lmy = XCDR (XCDR (mouse)); + } + if (!NILP (lmx)) { *x = XFIXNUM (lmx); @@ -4554,6 +4553,13 @@ What means \"very visible\" is up to your terminal. It may make the cursor bigger, or it may make it blink, or it may do nothing at all. */); visible_cursor = 1; + DEFVAR_BOOL ("tty-menu-calls-mouse-position-function", + tty_menu_calls_mouse_position_function, + doc: /* Non-nil means TTY menu code will call `mouse-position-function'. +This should be set if the function in `mouse-position-function' does not +trigger redisplay. */); + tty_menu_calls_mouse_position_function = 0; + defsubr (&Stty_display_color_p); defsubr (&Stty_display_color_cells); defsubr (&Stty_no_underline); -- cgit v1.2.3 From 92d37029a755e7f610c3bc10c816763c5d853d2f Mon Sep 17 00:00:00 2001 From: Jared Finder Date: Tue, 6 Oct 2020 20:04:12 -0700 Subject: Enable TTY menus with xterm-mouse-mode * lisp/tmm.el: No need to bind 'tmm-menubar-mouse' to mouse clicks on the menu bar. * lisp/menu-bar.el (global-map): Bind 'menu-bar-open-mouse' to mouse click on menu bar. This is needed in xt-mouse. * etc/NEWS: Announce TTY menu support in xterm-mouse-mode. --- etc/NEWS | 10 ++++++++++ lisp/menu-bar.el | 2 ++ lisp/tmm.el | 1 - 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index a212edfcfb2..a405c0dd3d7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1325,6 +1325,16 @@ to 'tab-bar-new-tab-choice' for new tabs to show the bookmark list. 'gomoku-move-sw' and 'gomoku-move-ne' now work correctly, and horizontal movements now stop at the edge of the board. +** xterm-mouse mode + +--- +*** TTY menu navigation is now supported in 'xterm-mouse-mode'. +TTY menus support mouse navigation and selection when xterm-mouse-mode +is active. When run on a terminal, clicking on the menu bar with the +mouse now pops up a TTY menu by default instead of running the command +'tmm-menubar'. To restore the old behavior, set the variable +'tty-menu-open-use-tmm' to non-nil. + ** xwidget-webkit mode *** New xwidget commands. diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index e78c1a6c707..e42602364d2 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2088,6 +2088,8 @@ key, a click, or a menu-item")) (bindings--define-key global-map [menu-bar help-menu] (cons (purecopy "Help") menu-bar-help-menu)) +(define-key global-map [menu-bar mouse-1] 'menu-bar-open-mouse) + (defun menu-bar-menu-frame-live-and-visible-p () "Return non-nil if the menu frame is alive and visible. The menu frame is the frame for which we are updating the menu." diff --git a/lisp/tmm.el b/lisp/tmm.el index fc02fd57907..4c2855751c2 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -43,7 +43,6 @@ (defvar tmm-table-undef) ;;;###autoload (define-key global-map "\M-`" 'tmm-menubar) -;;;###autoload (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse) ;;;###autoload (defun tmm-menubar (&optional x-position) -- cgit v1.2.3 From 2c487c47c8c3060818b2fcbfebbcd859f9d06ef5 Mon Sep 17 00:00:00 2001 From: Jared Finder Date: Sun, 11 Oct 2020 20:16:00 -0700 Subject: Fix a bug where the wrong menu would be triggered by mouse For layouts such as the following, clicking the "l" in Tools with the right window focused would trigger the File menu, not the Tools menu. This is because the event would have window coordinate (1 . 0). Similarly, clicking the "p" in Help would trigger the Edit menu. Example Emacs frame: +--------------------------------------------------------+ |File Edit Options Buffers Tools Help | |;; This buffer is for text$|;; This buffer is for text $| |;; To create a file, visit$|;; To create a file, visit $| | | | | | | |-UUU:----F1 *scratch* |-UUU:----F1 *scratch* | | | +--------------------------------------------------------+ * lisp/menu-bar.el (menu-bar-open-mouse): Reject clicks not on the menu bar. *lisp/xt-mouse.el (xterm-mouse-event): Pass the current frame to 'posn-at-x-y', to make the effect consistent with other mouse-handling features. --- lisp/menu-bar.el | 6 ++++++ lisp/xt-mouse.el | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index e42602364d2..f9afc8a5f31 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2672,6 +2672,12 @@ EVENT should be a mouse down or click event. Also see `menu-bar-open', which this calls. This command is to be used when you click the mouse in the menubar." (interactive "e") + ;; This only should be bound to clicks on the menu-bar, outside of + ;; any window. + (let ((window (posn-window (event-start event)))) + (when window + (error "Event is inside window %s" window))) + (let* ((x-position (car (posn-x-y (event-start event)))) (menu-bar-item-cons (menu-bar-item-at-x x-position))) (menu-bar-open nil diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 3c0dfb65ecf..f9c08f9a174 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -267,7 +267,7 @@ which is the \"1006\" extension implemented in Xterm >= 277." (eq y 1))) 'tab-bar 'menu-bar)) - (nthcdr 2 (posn-at-x-y x y))))) + (nthcdr 2 (posn-at-x-y x y (selected-frame)))))) (event (list type posn))) (setcar (nthcdr 3 posn) timestamp) -- cgit v1.2.3 From 8b1ccf5e7bc734aa3d0de6e1906677699c7eb3b2 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 24 Oct 2020 13:08:31 +0200 Subject: Fix tramp-sh-handle-make-process; don't merge with master * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Accept nil COMMAND. (Bug#44151) * test/lisp/net/tramp-tests.el (tramp-test29-start-file-process): Extend test. --- lisp/net/tramp-sh.el | 2 +- test/lisp/net/tramp-tests.el | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 19d50fce4c5..df6720b99b7 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2822,7 +2822,7 @@ STDERR can also be a file name." (signal 'wrong-type-argument (list #'stringp name))) (unless (or (null buffer) (bufferp buffer) (stringp buffer)) (signal 'wrong-type-argument (list #'stringp buffer))) - (unless (consp command) + (unless (or (null command) (consp command)) (signal 'wrong-type-argument (list #'consp command))) (unless (or (null coding) (and (symbolp coding) (memq coding coding-system-list)) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index fb4df639e5a..cc9ccefb0df 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4282,6 +4282,21 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; echoes also the sent string. (should (string-match "\\`foo" (buffer-string)))) + ;; Cleanup. + (ignore-errors (delete-process proc))) + + ;; PTY. + (unwind-protect + (with-temp-buffer + (if (not (tramp--test-sh-p)) + (should-error + (start-file-process "test4" (current-buffer) nil) + :type 'wrong-type-argument) + (setq proc (start-file-process "test4" (current-buffer) nil)) + (should (processp proc)) + (should (equal (process-status proc) 'run)) + (should (stringp (process-tty-name proc))))) + ;; Cleanup. (ignore-errors (delete-process proc)))))) -- cgit v1.2.3 From 228d9d615d7067ca06a2b53205c29d78dbbfe725 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 03:45:48 +0200 Subject: Move faces.el test data to follow our conventions * test/lisp/faces-tests.el (ert-x): Require. (faces--test-data-dir): Remove variable. (faces--test-extend-with-themes): Use ert-resource-directory. * test/lisp/faces-resources/*: Moved from test/data/themes/*. --- test/data/themes/faces-test-dark-theme.el | 35 ---------------------- test/data/themes/faces-test-light-theme.el | 34 --------------------- test/lisp/faces-resources/faces-test-dark-theme.el | 35 ++++++++++++++++++++++ .../lisp/faces-resources/faces-test-light-theme.el | 34 +++++++++++++++++++++ test/lisp/faces-tests.el | 8 ++--- 5 files changed, 71 insertions(+), 75 deletions(-) delete mode 100644 test/data/themes/faces-test-dark-theme.el delete mode 100644 test/data/themes/faces-test-light-theme.el create mode 100644 test/lisp/faces-resources/faces-test-dark-theme.el create mode 100644 test/lisp/faces-resources/faces-test-light-theme.el diff --git a/test/data/themes/faces-test-dark-theme.el b/test/data/themes/faces-test-dark-theme.el deleted file mode 100644 index a5e2ca43627..00000000000 --- a/test/data/themes/faces-test-dark-theme.el +++ /dev/null @@ -1,35 +0,0 @@ -;;; faces-test-dark-theme.el --- A dark theme from tests ;;; -*- lexical-binding: t; -*- - -;; Copyright (C) 2019-2020 Free Software Foundation, Inc. - -;; 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 . - -;;; Commentary: - -;;; Code: - -(deftheme faces-test-dark - "") - -(custom-theme-set-faces - 'faces-test-dark - '(spiff-added ((t (:foreground "Green" :extend t)))) - '(spiff-changed-face ((t (:foreground "Khaki")))) - '(spiff-file-header-face ((t (:background "grey20" :foreground "ivory1"))))) - -(provide-theme 'faces-test-dark) - -;;; faces-test-dark-theme.el ends here diff --git a/test/data/themes/faces-test-light-theme.el b/test/data/themes/faces-test-light-theme.el deleted file mode 100644 index b2f7ec69742..00000000000 --- a/test/data/themes/faces-test-light-theme.el +++ /dev/null @@ -1,34 +0,0 @@ -;;; faces-test-light-theme.el --- A dark theme from tests ;;; -*- lexical-binding: t; -*- - -;; Copyright (C) 2019-2020 Free Software Foundation, Inc. - -;; 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 . - -;;; Commentary: - -;;; Code: - -(deftheme faces-test-light - "") - -(custom-theme-set-faces - 'faces-test-light - '(spiff-added ((t (:inherit diff-changed :background "light green" :extend t)))) - '(spiff-changed ((t (:background "light steel blue"))))) - -(provide-theme 'faces-test-light) - -;;; faces-test-light-theme.el ends here diff --git a/test/lisp/faces-resources/faces-test-dark-theme.el b/test/lisp/faces-resources/faces-test-dark-theme.el new file mode 100644 index 00000000000..a5e2ca43627 --- /dev/null +++ b/test/lisp/faces-resources/faces-test-dark-theme.el @@ -0,0 +1,35 @@ +;;; faces-test-dark-theme.el --- A dark theme from tests ;;; -*- lexical-binding: t; -*- + +;; Copyright (C) 2019-2020 Free Software Foundation, Inc. + +;; 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 . + +;;; Commentary: + +;;; Code: + +(deftheme faces-test-dark + "") + +(custom-theme-set-faces + 'faces-test-dark + '(spiff-added ((t (:foreground "Green" :extend t)))) + '(spiff-changed-face ((t (:foreground "Khaki")))) + '(spiff-file-header-face ((t (:background "grey20" :foreground "ivory1"))))) + +(provide-theme 'faces-test-dark) + +;;; faces-test-dark-theme.el ends here diff --git a/test/lisp/faces-resources/faces-test-light-theme.el b/test/lisp/faces-resources/faces-test-light-theme.el new file mode 100644 index 00000000000..b2f7ec69742 --- /dev/null +++ b/test/lisp/faces-resources/faces-test-light-theme.el @@ -0,0 +1,34 @@ +;;; faces-test-light-theme.el --- A dark theme from tests ;;; -*- lexical-binding: t; -*- + +;; Copyright (C) 2019-2020 Free Software Foundation, Inc. + +;; 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 . + +;;; Commentary: + +;;; Code: + +(deftheme faces-test-light + "") + +(custom-theme-set-faces + 'faces-test-light + '(spiff-added ((t (:inherit diff-changed :background "light green" :extend t)))) + '(spiff-changed ((t (:background "light steel blue"))))) + +(provide-theme 'faces-test-light) + +;;; faces-test-light-theme.el ends here diff --git a/test/lisp/faces-tests.el b/test/lisp/faces-tests.el index 32dc1eea856..b19cef5decd 100644 --- a/test/lisp/faces-tests.el +++ b/test/lisp/faces-tests.el @@ -23,13 +23,9 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'faces) -(defvar faces--test-data-dir - (expand-file-name "../data/" - (file-name-directory (or load-file-name - buffer-file-name)))) - (defgroup faces--test nil "" :group 'faces--test) @@ -122,7 +118,7 @@ (should (equal (face-attribute 'spiff-changed-face :extend) t)) (should (equal (face-attribute 'spiff-added :extend) 'unspecified)) (should (equal (face-attribute 'spiff-file-header-face :extend) nil)) - (add-to-list 'custom-theme-load-path (concat faces--test-data-dir "themes")) + (add-to-list 'custom-theme-load-path (ert-resource-directory)) (load-theme 'faces-test-dark t t) (load-theme 'faces-test-light t t) (should (equal (face-attribute 'faces--test-inherit-extend :extend) -- cgit v1.2.3 From ff1068936fe59019b9d94aaf80d4cb8481c4acdd Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 12:34:23 +0200 Subject: * test/manual/image-transforms-tests.el: Use lexical-binding. --- test/manual/image-transforms-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/manual/image-transforms-tests.el b/test/manual/image-transforms-tests.el index 02607e63676..13d74a7c4b5 100644 --- a/test/manual/image-transforms-tests.el +++ b/test/manual/image-transforms-tests.el @@ -1,4 +1,4 @@ -;;; image-transform-tests.el --- Test suite for image transforms. +;;; image-transform-tests.el --- Test suite for image transforms. -*- lexical-binding: t -*- ;; Copyright (C) 2019-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From 9f1dd2a7d51e20c76b7916db76a2e90c86356b3d Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 13:35:04 +0200 Subject: Use lexical-binding in copyright.el and add tests * lisp/emacs-lisp/copyright.el: Use lexical-binding. Remove redundant :group args. * test/lisp/emacs-lisp/copyright-tests.el: New file. --- lisp/emacs-lisp/copyright.el | 9 +----- test/lisp/emacs-lisp/copyright-tests.el | 50 +++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 test/lisp/emacs-lisp/copyright-tests.el diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 6fa51c3f644..9828ca63ebc 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -1,4 +1,4 @@ -;;; copyright.el --- update the copyright notice in current buffer +;;; copyright.el --- update the copyright notice in current buffer -*- lexical-binding: t -*- ;; Copyright (C) 1991-1995, 1998, 2001-2020 Free Software Foundation, ;; Inc. @@ -37,14 +37,12 @@ (defcustom copyright-limit 2000 "Don't try to update copyright beyond this position unless interactive. A value of nil means to search whole buffer." - :group 'copyright :type '(choice (integer :tag "Limit") (const :tag "No limit"))) (defcustom copyright-at-end-flag nil "Non-nil means to search backwards from the end of the buffer for copyright. This is useful for ChangeLogs." - :group 'copyright :type 'boolean :version "23.1") ;;;###autoload(put 'copyright-at-end-flag 'safe-local-variable 'booleanp) @@ -56,7 +54,6 @@ This is useful for ChangeLogs." \\([1-9]\\([-0-9, ';/*%#\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)" "What your copyright notice looks like. The second \\( \\) construct must match the years." - :group 'copyright :type 'regexp) (defcustom copyright-names-regexp "" @@ -64,7 +61,6 @@ The second \\( \\) construct must match the years." Only copyright lines where the name matches this regexp will be updated. This allows you to avoid adding years to a copyright notice belonging to someone else or to a group for which you do not work." - :group 'copyright :type 'regexp) ;; The worst that can happen is a malicious regexp that overflows in @@ -76,7 +72,6 @@ someone else or to a group for which you do not work." "\\(\\s *\\)\\([1-9]\\([-0-9, ';/*%#\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)" "Match additional copyright notice years. The second \\( \\) construct must match the years." - :group 'copyright :type 'regexp) ;; See "Copyright Notices" in maintain.info. @@ -87,7 +82,6 @@ The second \\( \\) construct must match the years." For example: 2005, 2006, 2007, 2008 might be replaced with 2005-2008. If you use ranges, you should add an explanatory note in a README file. The function `copyright-fix-years' respects this variable." - :group 'copyright :type 'boolean :version "24.1") @@ -96,7 +90,6 @@ The function `copyright-fix-years' respects this variable." (defcustom copyright-query 'function "If non-nil, ask user before changing copyright. When this is `function', only ask when called non-interactively." - :group 'copyright :type '(choice (const :tag "Do not ask") (const :tag "Ask unless interactive" function) (other :tag "Ask" t))) diff --git a/test/lisp/emacs-lisp/copyright-tests.el b/test/lisp/emacs-lisp/copyright-tests.el new file mode 100644 index 00000000000..77b9e05da67 --- /dev/null +++ b/test/lisp/emacs-lisp/copyright-tests.el @@ -0,0 +1,50 @@ +;;; copyright-tests.el --- tests for copyright.el -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; 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: + +(require 'ert) +(require 'cl-lib) +(require 'copyright) + +(defmacro with-copyright-test (orig result) + `(cl-letf (((symbol-function 'format-time-string) (lambda (&rest _) "2019"))) + (let ((copyright-query nil) + (copyright-current-year 2019)) + (with-temp-buffer + (insert ,orig) + (copyright-update) + (should (equal (buffer-string) ,result)))))) + +(defvar copyright-tests--data + '((";; Copyright (C) 2017 Free Software Foundation, Inc." + . ";; Copyright (C) 2017, 2019 Free Software Foundation, Inc.") + (";; Copyright (C) 2017-2018 Free Software Foundation, Inc." + . ";; Copyright (C) 2017-2019 Free Software Foundation, Inc.") + (";; Copyright (C) 2005-2006, 2015, 2017-2018 Free Software Foundation, Inc." + . ";; Copyright (C) 2005-2006, 2015, 2017-2019 Free Software Foundation, Inc.") + (";; copyright '18 FSF" + . ";; copyright '18, '19 FSF"))) + +(ert-deftest test-copyright-update () + (dolist (test copyright-tests--data) + (with-copyright-test (car test) (cdr test)))) + +(provide 'copyright-tests) +;;; copyright-tests.el ends here -- cgit v1.2.3 From f378d65e5ea26662bf90a171ea292f20510939eb Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 14:17:35 +0200 Subject: Use lexical-binding in most term libraries * lisp/term/AT386.el: * lisp/term/internal.el: * lisp/term/iris-ansi.el: * lisp/term/lk201.el: * lisp/term/news.el: * lisp/term/rxvt.el: * lisp/term/sun.el: * lisp/term/tvi970.el: * lisp/term/wyse50.el: Use lexical-binding. --- lisp/term/AT386.el | 2 +- lisp/term/internal.el | 2 +- lisp/term/iris-ansi.el | 2 +- lisp/term/lk201.el | 2 +- lisp/term/news.el | 2 +- lisp/term/rxvt.el | 2 +- lisp/term/sun.el | 2 +- lisp/term/tvi970.el | 2 +- lisp/term/wyse50.el | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lisp/term/AT386.el b/lisp/term/AT386.el index 674c33b45c1..8ce7fbbcafd 100644 --- a/lisp/term/AT386.el +++ b/lisp/term/AT386.el @@ -1,4 +1,4 @@ -;;; AT386.el --- terminal support package for IBM AT keyboards +;;; AT386.el --- terminal support package for IBM AT keyboards -*- lexical-binding: t -*- ;; Copyright (C) 1992, 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/term/internal.el b/lisp/term/internal.el index c54481a5327..9a6f4fac1ee 100644 --- a/lisp/term/internal.el +++ b/lisp/term/internal.el @@ -1,4 +1,4 @@ -;;; internal.el --- support for PC internal terminal +;;; internal.el --- support for PC internal terminal -*- lexical-binding: t -*- ;; Copyright (C) 1993-1994, 1998-1999, 2001-2020 Free Software ;; Foundation, Inc. diff --git a/lisp/term/iris-ansi.el b/lisp/term/iris-ansi.el index 8a99ddf8c0d..7a92aa7adaa 100644 --- a/lisp/term/iris-ansi.el +++ b/lisp/term/iris-ansi.el @@ -1,4 +1,4 @@ -;;; iris-ansi.el --- configure Emacs for SGI xwsh and winterm apps +;;; iris-ansi.el --- configure Emacs for SGI xwsh and winterm apps -*- lexical-binding: t -*- ;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el index aab4110b3ae..3bcaa2ecd18 100644 --- a/lisp/term/lk201.el +++ b/lisp/term/lk201.el @@ -1,4 +1,4 @@ -;; Define function key sequences for DEC terminals. +;; Define function key sequences for DEC terminals. -*- lexical-binding: t -*- (defvar lk201-function-map (let ((map (make-sparse-keymap))) diff --git a/lisp/term/news.el b/lisp/term/news.el index e01d6f64be3..33c7aa6ccaa 100644 --- a/lisp/term/news.el +++ b/lisp/term/news.el @@ -1,4 +1,4 @@ -;;; news.el --- keypad and function key bindings for the Sony NEWS keyboard +;;; news.el --- keypad and function key bindings for the Sony NEWS keyboard -*- lexical-binding: t -*- ;; Copyright (C) 1989, 1993, 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el index 31e3d6ede4f..71ee9086937 100644 --- a/lisp/term/rxvt.el +++ b/lisp/term/rxvt.el @@ -1,4 +1,4 @@ -;;; rxvt.el --- define function key sequences and standard colors for rxvt +;;; rxvt.el --- define function key sequences and standard colors for rxvt -*- lexical-binding: t -*- ;; Copyright (C) 2002-2020 Free Software Foundation, Inc. diff --git a/lisp/term/sun.el b/lisp/term/sun.el index 41915e1b07c..7d1cd9f2cfe 100644 --- a/lisp/term/sun.el +++ b/lisp/term/sun.el @@ -1,4 +1,4 @@ -;;; sun.el --- keybinding for standard default sunterm keys +;;; sun.el --- keybinding for standard default sunterm keys -*- lexical-binding: t -*- ;; Copyright (C) 1987, 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el index c0e6a12b735..fc8ad80ae5c 100644 --- a/lisp/term/tvi970.el +++ b/lisp/term/tvi970.el @@ -1,4 +1,4 @@ -;;; tvi970.el --- terminal support for the Televideo 970 +;;; tvi970.el --- terminal support for the Televideo 970 -*- lexical-binding: t -*- ;; Copyright (C) 1992, 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el index 9e9fc4dd7de..6d72d4a05b6 100644 --- a/lisp/term/wyse50.el +++ b/lisp/term/wyse50.el @@ -1,4 +1,4 @@ -;;; wyse50.el --- terminal support code for Wyse 50 +;;; wyse50.el --- terminal support code for Wyse 50 -*- lexical-binding: t -*- ;; Copyright (C) 1989, 1993-1994, 2001-2020 Free Software Foundation, ;; Inc. -- cgit v1.2.3 From 6dfcb4d4dc3b7852143d8f7d9919ab0426476591 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 14:22:58 +0200 Subject: Revert "Use lexical-binding in bindat.el" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a497b8e4a41e3223089654da4b36d0fdd51ce555. This conversion to lexical-binding broke the eval specification, documented in the ELisp manual. We will probably want to add tests for that before we can confidently convert this to lexical-binding. Problem reported by Mattias EngdegĂ„rd . --- lisp/emacs-lisp/bindat.el | 174 ++++++++++++++++++++++++---------------------- 1 file changed, 89 insertions(+), 85 deletions(-) diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index 95581c40a46..0fd273aa3e3 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -1,4 +1,4 @@ -;;; bindat.el --- binary data structure packing and unpacking. -*- lexical-binding: t -*- +;;; bindat.el --- binary data structure packing and unpacking. ;; Copyright (C) 2002-2020 Free Software Foundation, Inc. @@ -193,8 +193,8 @@ ;; Helper functions for structure unpacking. ;; Relies on dynamic binding of BINDAT-RAW and BINDAT-IDX -(defvar bindat-raw nil) -(defvar bindat-idx nil) +(defvar bindat-raw) +(defvar bindat-idx) (defun bindat--unpack-u8 () (prog1 @@ -276,7 +276,7 @@ (t nil))) (defun bindat--unpack-group (spec) - (let (struct) + (let (struct last) (while spec (let* ((item (car spec)) (field (car item)) @@ -330,21 +330,21 @@ (setq data (bindat--unpack-group (cdr case)) cases nil))))) (t - (setq data (bindat--unpack-item type len vectype)))) + (setq data (bindat--unpack-item type len vectype) + last data))) (if data (if field (setq struct (cons (cons field data) struct)) (setq struct (append data struct)))))) struct)) -(defun bindat-unpack (spec raw &optional idx) - "Return structured data according to SPEC for binary data in RAW. -RAW is a unibyte string or vector. -Optional third arg IDX specifies the starting offset in RAW." - (when (multibyte-string-p raw) +(defun bindat-unpack (spec bindat-raw &optional bindat-idx) + "Return structured data according to SPEC for binary data in BINDAT-RAW. +BINDAT-RAW is a unibyte string or vector. +Optional third arg BINDAT-IDX specifies the starting offset in BINDAT-RAW." + (when (multibyte-string-p bindat-raw) (error "String is multibyte")) - (setq bindat-raw raw) - (setq bindat-idx (or idx 0)) + (unless bindat-idx (setq bindat-idx 0)) (bindat--unpack-group spec)) (defun bindat-get-field (struct &rest field) @@ -373,70 +373,74 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..." (ip . 4))) (defun bindat--length-group (struct spec) - (while spec - (let* ((item (car spec)) - (field (car item)) - (type (nth 1 item)) - (len (nth 2 item)) - (vectype (and (eq type 'vec) (nth 3 item))) - (tail 3)) - (setq spec (cdr spec)) - (if (and (consp field) (eq (car field) 'eval)) - (setq field (eval (car (cdr field))))) - (if (and type (consp type) (eq (car type) 'eval)) - (setq type (eval (car (cdr type))))) - (if (and len (consp len) (eq (car len) 'eval)) - (setq len (eval (car (cdr len))))) - (if (memq field '(eval fill align struct union)) - (setq tail 2 - len type - type field - field nil)) - (if (and (consp len) (not (eq type 'eval))) - (setq len (apply #'bindat-get-field struct len))) - (if (not len) - (setq len 1)) - (while (eq type 'vec) - (if (consp vectype) - (setq len (* len (nth 1 vectype)) - type (nth 2 vectype)) - (setq type (or vectype 'u8) - vectype nil))) - (cond - ((eq type 'eval) - (if field - (setq struct (cons (cons field (eval len)) struct)) - (eval len))) - ((eq type 'fill) - (setq bindat-idx (+ bindat-idx len))) - ((eq type 'align) - (while (/= (% bindat-idx len) 0) - (setq bindat-idx (1+ bindat-idx)))) - ((eq type 'struct) - (bindat--length-group - (if field (bindat-get-field struct field) struct) (eval len))) - ((eq type 'repeat) - (let ((index 0) (count len)) - (while (< index count) - (bindat--length-group - (nth index (bindat-get-field struct field)) - (nthcdr tail item)) - (setq index (1+ index))))) - ((eq type 'union) - (let ((tag len) (cases (nthcdr tail item)) case cc) - (while cases - (setq case (car cases) - cases (cdr cases) - cc (car case)) - (if (or (equal cc tag) (equal cc t) - (and (consp cc) (eval cc))) - (progn - (bindat--length-group struct (cdr case)) - (setq cases nil)))))) - (t - (if (setq type (assq type bindat--fixed-length-alist)) - (setq len (* len (cdr type)))) - (setq bindat-idx (+ bindat-idx len))))))) + (let (last) + (while spec + (let* ((item (car spec)) + (field (car item)) + (type (nth 1 item)) + (len (nth 2 item)) + (vectype (and (eq type 'vec) (nth 3 item))) + (tail 3)) + (setq spec (cdr spec)) + (if (and (consp field) (eq (car field) 'eval)) + (setq field (eval (car (cdr field))))) + (if (and type (consp type) (eq (car type) 'eval)) + (setq type (eval (car (cdr type))))) + (if (and len (consp len) (eq (car len) 'eval)) + (setq len (eval (car (cdr len))))) + (if (memq field '(eval fill align struct union)) + (setq tail 2 + len type + type field + field nil)) + (if (and (consp len) (not (eq type 'eval))) + (setq len (apply 'bindat-get-field struct len))) + (if (not len) + (setq len 1)) + (while (eq type 'vec) + (let ((vlen 1)) + (if (consp vectype) + (setq len (* len (nth 1 vectype)) + type (nth 2 vectype)) + (setq type (or vectype 'u8) + vectype nil)))) + (cond + ((eq type 'eval) + (if field + (setq struct (cons (cons field (eval len)) struct)) + (eval len))) + ((eq type 'fill) + (setq bindat-idx (+ bindat-idx len))) + ((eq type 'align) + (while (/= (% bindat-idx len) 0) + (setq bindat-idx (1+ bindat-idx)))) + ((eq type 'struct) + (bindat--length-group + (if field (bindat-get-field struct field) struct) (eval len))) + ((eq type 'repeat) + (let ((index 0) (count len)) + (while (< index count) + (bindat--length-group + (nth index (bindat-get-field struct field)) + (nthcdr tail item)) + (setq index (1+ index))))) + ((eq type 'union) + (let ((tag len) (cases (nthcdr tail item)) case cc) + (while cases + (setq case (car cases) + cases (cdr cases) + cc (car case)) + (if (or (equal cc tag) (equal cc t) + (and (consp cc) (eval cc))) + (progn + (bindat--length-group struct (cdr case)) + (setq cases nil)))))) + (t + (if (setq type (assq type bindat--fixed-length-alist)) + (setq len (* len (cdr type)))) + (if field + (setq last (bindat-get-field struct field))) + (setq bindat-idx (+ bindat-idx len)))))))) (defun bindat-length (spec struct) "Calculate bindat-raw length for STRUCT according to bindat SPEC." @@ -592,17 +596,17 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..." (bindat--pack-item last type len vectype) )))))) -(defun bindat-pack (spec struct &optional raw idx) +(defun bindat-pack (spec struct &optional bindat-raw bindat-idx) "Return binary data packed according to SPEC for structured data STRUCT. -Optional third arg RAW is a pre-allocated unibyte string or -vector to pack into. -Optional fourth arg IDX is the starting offset into BINDAT-RAW." - (when (multibyte-string-p raw) +Optional third arg BINDAT-RAW is a pre-allocated unibyte string or vector to +pack into. +Optional fourth arg BINDAT-IDX is the starting offset into BINDAT-RAW." + (when (multibyte-string-p bindat-raw) (error "Pre-allocated string is multibyte")) - (let ((no-return raw)) - (setq bindat-idx (or idx 0)) - (setq bindat-raw (or raw - (make-string (+ bindat-idx (bindat-length spec struct)) 0))) + (let ((no-return bindat-raw)) + (unless bindat-idx (setq bindat-idx 0)) + (unless bindat-raw + (setq bindat-raw (make-string (+ bindat-idx (bindat-length spec struct)) 0))) (bindat--pack-group struct spec) (if no-return nil bindat-raw))) -- cgit v1.2.3 From 95553309efcdbf219dc0682383172d55c65d2277 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 24 Oct 2020 14:36:34 +0200 Subject: Accept nil COMMAND in tramp-sh-handle-make-process (Bug#44151) * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Accept nil COMMAND. (Bug#44151) * test/lisp/net/tramp-tests.el (tramp-test29-start-file-process): Extend test. --- lisp/net/tramp-sh.el | 2 +- test/lisp/net/tramp-tests.el | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 2c7c6dae755..e65d376effc 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2809,7 +2809,7 @@ implementation will be used." (signal 'wrong-type-argument (list #'stringp name))) (unless (or (null buffer) (bufferp buffer) (stringp buffer)) (signal 'wrong-type-argument (list #'stringp buffer))) - (unless (consp command) + (unless (or (null command) (consp command)) (signal 'wrong-type-argument (list #'consp command))) (unless (or (null coding) (and (symbolp coding) (memq coding coding-system-list)) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index c894f7ddaaa..02bd6138d5d 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4366,6 +4366,22 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (while (accept-process-output proc 0 nil t)))) (should (string-match "foo" (buffer-string)))) + ;; Cleanup. + (ignore-errors (delete-process proc))) + + ;; PTY. + (unwind-protect + (with-temp-buffer + ;; It works only for tramp-sh.el, and not direct async processes. + (if (or (not (tramp--test-sh-p)) (tramp-direct-async-process-p)) + (should-error + (start-file-process "test4" (current-buffer) nil) + :type 'wrong-type-argument) + (setq proc (start-file-process "test4" (current-buffer) nil)) + (should (processp proc)) + (should (equal (process-status proc) 'run)) + (should (stringp (process-tty-name proc))))) + ;; Cleanup. (ignore-errors (delete-process proc)))))) -- cgit v1.2.3 From 6f92674ce81b39a44a0d841a5176884e0321b508 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 15:34:52 +0200 Subject: Use lexical-binding in several language support libraries * lisp/language/burmese.el: * lisp/language/cham.el: * lisp/language/czech.el: * lisp/language/georgian.el: * lisp/language/greek.el: * lisp/language/khmer.el: * lisp/language/romanian.el: * lisp/language/sinhala.el: * lisp/language/slovak.el: * lisp/language/tai-viet.el: * lisp/language/vietnamese.el: Use lexical-binding. --- lisp/language/burmese.el | 2 +- lisp/language/cham.el | 2 +- lisp/language/czech.el | 2 +- lisp/language/georgian.el | 2 +- lisp/language/greek.el | 2 +- lisp/language/khmer.el | 2 +- lisp/language/romanian.el | 2 +- lisp/language/sinhala.el | 2 +- lisp/language/slovak.el | 2 +- lisp/language/tai-viet.el | 2 +- lisp/language/vietnamese.el | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lisp/language/burmese.el b/lisp/language/burmese.el index 1888c8f86a2..d689e87d785 100644 --- a/lisp/language/burmese.el +++ b/lisp/language/burmese.el @@ -1,4 +1,4 @@ -;;; burmese.el --- support for Burmese -*- coding: utf-8 -*- +;;; burmese.el --- support for Burmese -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) diff --git a/lisp/language/cham.el b/lisp/language/cham.el index 4749f2e8db4..eef6d6f8f9f 100644 --- a/lisp/language/cham.el +++ b/lisp/language/cham.el @@ -1,4 +1,4 @@ -;;; cham.el --- support for Cham -*- coding: utf-8 -*- +;;; cham.el --- support for Cham -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2008, 2009, 2010, 2011, 2012 ;; National Institute of Advanced Industrial Science and Technology (AIST) diff --git a/lisp/language/czech.el b/lisp/language/czech.el index b3cc152d25e..e6923426b52 100644 --- a/lisp/language/czech.el +++ b/lisp/language/czech.el @@ -1,4 +1,4 @@ -;;; czech.el --- support for Czech -*- coding: utf-8 -*- +;;; czech.el --- support for Czech -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/language/georgian.el b/lisp/language/georgian.el index 3e3c1df31a0..53c994bd76f 100644 --- a/lisp/language/georgian.el +++ b/lisp/language/georgian.el @@ -1,4 +1,4 @@ -;;; georgian.el --- language support for Georgian +;;; georgian.el --- language support for Georgian -*- lexical-binding: t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/language/greek.el b/lisp/language/greek.el index 2fec52637be..15ae5f42f94 100644 --- a/lisp/language/greek.el +++ b/lisp/language/greek.el @@ -1,4 +1,4 @@ -;;; greek.el --- support for Greek +;;; greek.el --- support for Greek -*- lexical-binding: t -*- ;; Copyright (C) 2002, 2013-2020 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, diff --git a/lisp/language/khmer.el b/lisp/language/khmer.el index 4a070321961..37173c9fb95 100644 --- a/lisp/language/khmer.el +++ b/lisp/language/khmer.el @@ -1,4 +1,4 @@ -;;; khmer.el --- support for Khmer -*- coding: utf-8 -*- +;;; khmer.el --- support for Khmer -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) diff --git a/lisp/language/romanian.el b/lisp/language/romanian.el index 0cd1d61de0f..9f1c67765e1 100644 --- a/lisp/language/romanian.el +++ b/lisp/language/romanian.el @@ -1,4 +1,4 @@ -;;; romanian.el --- support for Romanian -*- coding: utf-8 -*- +;;; romanian.el --- support for Romanian -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/language/sinhala.el b/lisp/language/sinhala.el index efd8aacc5ac..90fc41c1c41 100644 --- a/lisp/language/sinhala.el +++ b/lisp/language/sinhala.el @@ -1,4 +1,4 @@ -;;; sinhala.el --- support for Sinhala -*- coding: utf-8 -*- +;;; sinhala.el --- support for Sinhala -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) diff --git a/lisp/language/slovak.el b/lisp/language/slovak.el index bc70a05ad08..c42a872574d 100644 --- a/lisp/language/slovak.el +++ b/lisp/language/slovak.el @@ -1,4 +1,4 @@ -;;; slovak.el --- support for Slovak -*- coding: utf-8 -*- +;;; slovak.el --- support for Slovak -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/language/tai-viet.el b/lisp/language/tai-viet.el index 22295f39e52..039e478b162 100644 --- a/lisp/language/tai-viet.el +++ b/lisp/language/tai-viet.el @@ -1,4 +1,4 @@ -;;; tai-viet.el --- support for Tai Viet -*- coding: utf-8 -*- +;;; tai-viet.el --- support for Tai Viet -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2007-2020 Free Software Foundation, Inc. ;; Copyright (C) 2007, 2008, 2009, 2010, 2011 diff --git a/lisp/language/vietnamese.el b/lisp/language/vietnamese.el index cb282db0762..c1cef962865 100644 --- a/lisp/language/vietnamese.el +++ b/lisp/language/vietnamese.el @@ -1,4 +1,4 @@ -;;; vietnamese.el --- support for Vietnamese -*- coding: utf-8; -*- +;;; vietnamese.el --- support for Vietnamese -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -- cgit v1.2.3 From 97267d2bf1fbb9279d32f75eda9dbcf0c4316edd Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 15:47:26 +0200 Subject: Re-introduce variable for world clock timer * lisp/time.el (world-clock--timer): New variable. (world-clock): Save timer to above variable when it is started. (world-clock-cancel-timer): Delete timer saved in variable instead of searching for the function name. --- lisp/time.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lisp/time.el b/lisp/time.el index 63773d42048..519c96242dd 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -531,6 +531,9 @@ See `world-clock'." (setq-local revert-buffer-function #'world-clock-update) (setq show-trailing-whitespace nil)) +(defvar world-clock--timer nil + "The current world clock timer.") + (defun world-clock-display (alist) "Replace current buffer text with times in various zones, based on ALIST." (let ((inhibit-read-only t) @@ -571,7 +574,8 @@ To turn off the world time display, go to the window and type `\\[quit-window]'. (pop-to-buffer buffer) (pop-to-buffer world-clock-buffer-name) (when world-clock-timer-enable - (run-at-time t world-clock-timer-second #'world-clock-update) + (setq world-clock--timer + (run-at-time t world-clock-timer-second #'world-clock-update)) (add-hook 'kill-buffer-hook #'world-clock-cancel-timer nil t))) (world-clock-display (time--display-world-list)) (world-clock-mode) @@ -579,12 +583,9 @@ To turn off the world time display, go to the window and type `\\[quit-window]'. (defun world-clock-cancel-timer () "Cancel the world clock timer." - (let ((list timer-list)) - (while list - (let ((elt (pop list))) - (when (equal (symbol-name (timer--function elt)) - "world-clock-update") - (cancel-timer elt)))))) + (when world-clock--timer + (cancel-timer world-clock--timer) + (setq world-clock--timer nil)))) (defun world-clock-update (&optional _arg _noconfirm) "Update the `world-clock' buffer." -- cgit v1.2.3 From 8c2382d309b437dca94d453e4bd5f3169bb36bfb Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sat, 24 Oct 2020 15:50:16 +0100 Subject: ; Fix last change --- lisp/time.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/time.el b/lisp/time.el index 519c96242dd..eca9a0752e4 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -585,7 +585,7 @@ To turn off the world time display, go to the window and type `\\[quit-window]'. "Cancel the world clock timer." (when world-clock--timer (cancel-timer world-clock--timer) - (setq world-clock--timer nil)))) + (setq world-clock--timer nil))) (defun world-clock-update (&optional _arg _noconfirm) "Update the `world-clock' buffer." -- cgit v1.2.3 From 4c543a724f2caff41d97a323bd4fffe3e86e8471 Mon Sep 17 00:00:00 2001 From: JoĂŁo TĂĄvora Date: Sun, 6 Sep 2020 15:37:02 +0100 Subject: Introduce eldoc-display-functions See bug#43609. * lisp/emacs-lisp/eldoc.el (eldoc--request-state): Add comment. (eldoc--last-request-state): No longer buffer-local. (eldoc--request-docs-p): Delete. (eldoc-display-functions): New user variable. (eldoc--doc-buffer-docs): New variable. (eldoc-display-message-p): Rework. (eldoc--format-doc-buffer): Rework from eldoc--handle-docs. (eldoc-display-in-echo-area, eldoc-display-in-buffer): New user-visible function. (eldoc--invoke-strategy): Take INTERACTIVE arg. Invoke eldoc-display-in-buffer (eldoc-print-current-symbol-info): Simplify. (Version): Bump to 1.11.0 * etc/NEWS: Mention eldoc-display-functions. --- etc/NEWS | 7 ++ lisp/emacs-lisp/eldoc.el | 268 +++++++++++++++++++++++++++-------------------- 2 files changed, 164 insertions(+), 111 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index a405c0dd3d7..8aa27fd651e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -650,6 +650,13 @@ may arrange for it to be produced asynchronously. The results of all doc string functions are accessible to the user through the user option 'eldoc-documentation-strategy'. +*** New hook 'eldoc-display-functions'. +This hook is intended to be used for displaying doc string. The +functions receive the docstrings composed according to +`eldoc-documentation-strategy' and are tasked with displaying it to +the user. Examples of such functions would use the echo area, a +separate buffer or a tooltip. + +++ *** New user option 'eldoc-documentation-strategy'. The built-in choices available for this user option let users compose diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 9e38e5908ed..1b180f26c58 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -5,7 +5,7 @@ ;; Author: Noah Friedman ;; Keywords: extensions ;; Created: 1995-10-06 -;; Version: 1.10.0 +;; Version: 1.11.0 ;; Package-Requires: ((emacs "26.3")) ;; This is a GNU ELPA :core package. Avoid functionality that is not @@ -350,40 +350,26 @@ Also store it in `eldoc-last-message' and return that value." ;; for us, but do note that the last-message will be gone. (setq eldoc-last-message nil)))) -(defvar-local eldoc--last-request-state nil +;; The point of `eldoc--request-state' is not to over-request, which +;; can happen if the idle timer is restarted on execution of command +;; which is guaranteed not to change the conditions that warrant a new +;; request for documentation. +(defvar eldoc--last-request-state nil "Tuple containing information about last ElDoc request.") (defun eldoc--request-state () "Compute information to store in `eldoc--last-request-state'." (list (current-buffer) (buffer-modified-tick) (point))) (defun eldoc-display-message-p () - (eldoc--request-docs-p (eldoc--request-state))) + "Tell if ElDoc can use the echo area." + (and (eldoc-display-message-no-interference-p) + (not this-command) + (eldoc--message-command-p last-command))) + (make-obsolete 'eldoc-display-message-p "Use `eldoc-documentation-functions' instead." "eldoc-1.6.0") -(defun eldoc--request-docs-p (request-state) - "Return non-nil when it is appropriate to request docs. -REQUEST-STATE is a candidate for `eldoc--last-request-state'" - (and - ;; FIXME: The original idea behind this function is to protect the - ;; Echo area from ElDoc interference, but since that is only one of - ;; the possible outlets of ElDoc, this must soon be reworked. - (eldoc-display-message-no-interference-p) - (not (and eldoc--doc-buffer - (get-buffer-window eldoc--doc-buffer) - (equal request-state - (with-current-buffer - eldoc--doc-buffer - eldoc--last-request-state)))) - ;; If this-command is non-nil while running via an idle - ;; timer, we're still in the middle of executing a command, - ;; e.g. a query-replace where it would be annoying to - ;; overwrite the echo area. - (not this-command) - (eldoc--message-command-p last-command))) - - ;; Check various conditions about the current environment that might make ;; it undesirable to print eldoc messages right this instant. (defun eldoc-display-message-no-interference-p () @@ -416,43 +402,112 @@ about the context around point. To call the CALLBACK function, the hook function must pass it an obligatory argument DOCSTRING, a string containing the -documentation, followed by an optional list of keyword-value -pairs of the form (:KEY VALUE :KEY2 VALUE2...). KEY can be: - -* `:thing', VALUE is a short string or symbol designating what is - being reported on. The documentation display engine can elect - to remove this information depending on space constraints; - -* `:face', VALUE is a symbol designating a face to use when - displaying `:thing''s value. - -Major modes should modify this hook locally, for example: +documentation, followed by an optional list of arbitrary +keyword-value pairs of the form (:KEY VALUE :KEY2 VALUE2...). +The information contained in these pairs is understood by members +of `eldoc-display-functions', allowing the +documentation-producing backend to cooperate with specific +documentation-displaying frontends. For example, KEY can be: + +* `:thing', VALUE being a short string or symbol designating what + is being reported on. It can, for example be the name of the + function whose signature is being documented, or the name of + the variable whose docstring is being documented. + `eldoc-display-in-echo-area', a member of + `eldoc-display-functions', sometimes omits this information + depending on space constraints; + +* `:face', VALUE being a symbol designating a face which both + `eldoc-display-in-echo-area' and `eldoc-display-in-buffer' will + use when displaying `:thing''s value. + +Finally, major modes should modify this hook locally, for +example: (add-hook \\='eldoc-documentation-functions #\\='foo-mode-eldoc nil t) so that the global value (i.e. the default value of the hook) is taken into account if the major mode specific function does not return any documentation.") +(defvar eldoc-display-functions + '(eldoc-display-in-echo-area eldoc-display-in-buffer) + "Hook of functions tasked with displaying ElDoc results. +Each function is passed two arguments: DOCS and INTERACTIVE. DOCS +is a list (DOC ...) where DOC looks like (STRING :KEY VALUE :KEY2 +VALUE2 ...). STRING is a string containing the documentation's +text and the remainder of DOC is an optional list of +keyword-value pairs denoting additional properties of that +documentation. For commonly recognized properties, see +`eldoc-documentation-functions'. + +INTERACTIVE says if the request to display doc strings came +directly from the user or from ElDoc's automatic mechanisms'.") + (defvar eldoc--doc-buffer nil "Buffer displaying latest ElDoc-produced docs.") +(defvar eldoc--doc-buffer-docs nil "Documentation items in `eldoc--doc-buffer'.") + (defun eldoc-doc-buffer (&optional interactive) - "Get latest *eldoc* help buffer. Interactively, display it." (interactive (list t)) - (prog1 - (if (and eldoc--doc-buffer (buffer-live-p eldoc--doc-buffer)) - eldoc--doc-buffer - (setq eldoc--doc-buffer (get-buffer-create "*eldoc*"))) - (when interactive (display-buffer eldoc--doc-buffer)))) - - -(defun eldoc--handle-docs (docs) - "Display multiple DOCS in echo area. -DOCS is a list of (STRING PLIST...). It is already sorted. -Honor most of `eldoc-echo-area-use-multiline-p'." - ;; If there's nothing to report clear the echo area, but don't erase - ;; the last *eldoc* buffer. - (if (null docs) (eldoc--message nil) + "Display ElDoc documentation buffer. +This holds the results of the last documentation request." + (unless (buffer-live-p eldoc--doc-buffer) + (setq eldoc--doc-buffer (get-buffer-create "*eldoc*"))) + (when interactive + (display-buffer eldoc--doc-buffer))) + +(defun eldoc--format-doc-buffer (docs) + "Ensure DOCS are displayed in an *eldoc* buffer." + (interactive (list t)) + (eldoc-doc-buffer) ;; ensure buffer exists + (with-current-buffer eldoc--doc-buffer + (unless (eq docs eldoc--doc-buffer-docs) + (setq-local eldoc--doc-buffer-docs docs) + (let ((inhibit-read-only t) + (things-reported-on)) + (erase-buffer) (setq buffer-read-only t) + (local-set-key "q" 'quit-window) + (cl-loop for (docs . rest) on docs + for (this-doc . plist) = docs + for thing = (plist-get plist :thing) + when thing do + (cl-pushnew thing things-reported-on) + (setq this-doc + (concat + (propertize (format "%s" thing) + 'face (plist-get plist :face)) + ": " + this-doc)) + do (insert this-doc) + when rest do (insert "\n")) + ;; Maybe rename the buffer. + (rename-buffer (if things-reported-on + (format "*eldoc for %s*" + (mapconcat (lambda (s) (format "%s" s)) + things-reported-on + ", ")) + "*eldoc*"))))) + eldoc--doc-buffer) + +(defun eldoc-display-in-echo-area (docs _interactive) + "Display DOCS in echo area. +Honor `eldoc-echo-area-use-multiline-p' and +`eldoc-prefer-doc-buffer'." + (cond + (;; Check if he wave permission to mess with echo area at all. For + ;; example, if this-command is non-nil while running via an idle + ;; timer, we're still in the middle of executing a command, e.g. a + ;; query-replace where it would be annoying to overwrite the echo + ;; area. + (or + (not (eldoc-display-message-no-interference-p)) + this-command + (not (eldoc--message-command-p last-command)))) + (;; If we do but nothing to report, clear the echo area. + (null docs) + (eldoc--message nil)) + (t + ;; Otherwise, establish some parameters. (let* - ;; Otherwise, establish some parameters. ((width (1- (window-width (minibuffer-window)))) (val (if (and (symbolp eldoc-echo-area-use-multiline-p) eldoc-echo-area-use-multiline-p) @@ -462,43 +517,12 @@ Honor most of `eldoc-echo-area-use-multiline-p'." (float (truncate (* (frame-height) val))) (integer val) (t 1))) - (things-reported-on) - (request eldoc--last-request-state) single-doc single-doc-sym) - ;; Then, compose the contents of the `*eldoc*' buffer. - (with-current-buffer (eldoc-doc-buffer) - ;; Set doc-buffer's `eldoc--last-request-state', too - (setq eldoc--last-request-state request) - (let ((inhibit-read-only t)) - (erase-buffer) (setq buffer-read-only t) - (local-set-key "q" 'quit-window) - (cl-loop for (docs . rest) on docs - for (this-doc . plist) = docs - for thing = (plist-get plist :thing) - when thing do - (cl-pushnew thing things-reported-on) - (setq this-doc - (concat - (propertize (format "%s" thing) - 'face (plist-get plist :face)) - ": " - this-doc)) - do (insert this-doc) - when rest do (insert "\n"))) - ;; Rename the buffer. - (when things-reported-on - (rename-buffer (format "*eldoc for %s*" - (mapconcat (lambda (s) (format "%s" s)) - things-reported-on - ", "))))) - ;; Finally, output to the echo area. I'm pretty sure nicer - ;; strategies can be used here, probably by splitting this - ;; function into some `eldoc-display-functions' special hook. (let ((echo-area-message (cond - (;; We handle the `truncate-sym-name-if-fit' special - ;; case first, by checking if for a lot of special - ;; conditions. + (;; To output to the echo area,We handle the + ;; `truncate-sym-name-if-fit' special case first, by + ;; checking if for a lot of special conditions. (and (eq 'truncate-sym-name-if-fit eldoc-echo-area-use-multiline-p) (null (cdr docs)) @@ -514,7 +538,11 @@ Honor most of `eldoc-echo-area-use-multiline-p'." ;; display that, we have one extra line to use. (unless eldoc-display-truncation-message (setq available (1+ available))) - (with-current-buffer (eldoc-doc-buffer) + ;; Else we format the *eldoc* buffer, then use some of + ;; its contents top section. I'm pretty sure smarter + ;; strategies can be used here that don't necessarily + ;; involve composing that entire buffer. + (with-current-buffer (eldoc--format-doc-buffer docs) (cl-loop initially (goto-char (point-min)) @@ -543,11 +571,18 @@ Honor most of `eldoc-echo-area-use-multiline-p'." "...")))))))) ((= available 1) ;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer' too? - (with-current-buffer (eldoc-doc-buffer) + (with-current-buffer (eldoc--format-doc-buffer docs) (truncate-string-to-width (buffer-substring (goto-char (point-min)) (line-end-position 1)) width)))))) (when echo-area-message - (eldoc--message echo-area-message)))))) + (eldoc--message echo-area-message))))))) + +(defun eldoc-display-in-buffer (docs interactive) + "Display DOCS in a dedicated buffer. +If INTERACTIVE is t, also display the buffer." + (let ((buf (eldoc--format-doc-buffer docs))) + (when interactive + (display-buffer buf)))) (defun eldoc-documentation-default () "Show first doc string for item at point. @@ -709,19 +744,29 @@ have the following values: strings so far, as soon as possible." (funcall eldoc--make-callback method)) -(defun eldoc--invoke-strategy () +(defun eldoc--invoke-strategy (interactive) "Invoke `eldoc-documentation-strategy' function. +If INTERACTIVE is non-nil, the request came directly from a user +command, otherwise it came from ElDoc's idle +timer, `eldoc-timer'. + That function's job is to run the `eldoc-documentation-functions' special hook, using the `run-hook' family of functions. ElDoc's built-in strategy functions play along with the -`eldoc--make-callback' protocol, using it to produce callback to -feed to the functgions of `eldoc-documentation-functions'. - -Other third-party strategy functions do not use -`eldoc--make-callback'. They must find some alternate way to -produce callbacks to feed to `eldoc-documentation-function' and -should endeavour to display the docstrings eventually produced." +`eldoc--make-callback' protocol, using it to produce a callback +argument to feed the functions that the user places in +`eldoc-documentation-functions'. Whenever the strategy +determines it has information to display to the user, this +function passes responsibility to the functions in +`eldoc-display-functions'. + +Other third-party values of `eldoc-documentation-strategy' should +not use `eldoc--make-callback'. They must find some alternate +way to produce callbacks to feed to +`eldoc-documentation-function' and should endeavour to display +the docstrings eventually produced, using +`eldoc-display-functions'." (let* (;; How many callbacks have been created by the strategy ;; function and passed to elements of ;; `eldoc-documentation-functions'. @@ -739,11 +784,12 @@ should endeavour to display the docstrings eventually produced." (push (cons pos (cons string plist)) docs-registered))) (display-doc () - (eldoc--handle-docs - (mapcar #'cdr - (setq docs-registered - (sort docs-registered - (lambda (a b) (< (car a) (car b)))))))) + (run-hook-with-args + 'eldoc-display-functions (mapcar #'cdr + (setq docs-registered + (sort docs-registered + (lambda (a b) (< (car a) (car b)))))) + interactive)) (make-callback (method) (let ((pos (prog1 howmany (cl-incf howmany)))) @@ -786,22 +832,23 @@ should endeavour to display the docstrings eventually produced." (defun eldoc-print-current-symbol-info (&optional interactive) "Document thing at point." (interactive '(t)) - (let ((token (eldoc--request-state))) + (let (token) (cond (interactive - (eldoc--invoke-strategy)) - ((not (eldoc--request-docs-p token)) - ;; Erase the last message if we won't display a new one. - (when eldoc-last-message - (eldoc--message nil))) - (t + (eldoc--invoke-strategy t)) + ((not (equal (setq token (eldoc--request-state)) + eldoc--last-request-state)) (let ((non-essential t)) (setq eldoc--last-request-state token) ;; Only keep looking for the info as long as the user hasn't ;; requested our attention. This also locally disables ;; inhibit-quit. (while-no-input - (eldoc--invoke-strategy))))))) + (eldoc--invoke-strategy nil))))))) + +;; This section only affects ElDoc output to the echo area, as in +;; `eldoc-display-in-echo-area'. +;; ;; When point is in a sexp, the function args are not reprinted in the echo ;; area after every possible interactive command because some of them print ;; their own messages in the echo area; the eldoc functions would instantly @@ -833,7 +880,6 @@ should endeavour to display the docstrings eventually produced." (apply #'eldoc-remove-command (all-completions name eldoc-message-commands)))) - ;; Prime the command list. (eldoc-add-command-completions "back-to-indentation" -- cgit v1.2.3 From 5daa6a6a0398131717c5b5fd570c5efad34a4afa Mon Sep 17 00:00:00 2001 From: JoĂŁo TĂĄvora Date: Sat, 3 Oct 2020 17:27:05 +0100 Subject: Rework eldoc-echo-area-prefer-doc-buffer (bug#42532) * lisp/emacs-lisp/eldoc.el: (eldoc-echo-area-prefer-doc-buffer): Rename from eldoc-echo-area-prefer-doc-buffer (eldoc-display-in-echo-area): Rework to honour eldoc-echo-area-prefer-doc-buffer. --- lisp/emacs-lisp/eldoc.el | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 1b180f26c58..6c6570f847a 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -117,12 +117,13 @@ single line of display in the echo area." symbol names if it will\ enable argument list to fit on one line" truncate-sym-name-if-fit))) -(defcustom eldoc-prefer-doc-buffer nil +(defcustom eldoc-echo-area-prefer-doc-buffer nil "Prefer ElDoc's documentation buffer if it is showing in some frame. -If this variable's value is t and a piece of documentation needs -to be truncated to fit in the echo area, do so if ElDoc's -documentation buffer is not already showing, since the buffer -always holds the full documentation." +If this variable's value is t, ElDoc will skip showing +documentation in the echo area if the dedicated documentation +buffer (given by `eldoc-doc-buffer') is being displayed in some +window. If the value is the symbol `maybe', then the echo area +is only skipped if the documentation doesn't fit there." :type 'boolean) (defface eldoc-highlight-function-argument @@ -491,7 +492,7 @@ This holds the results of the last documentation request." (defun eldoc-display-in-echo-area (docs _interactive) "Display DOCS in echo area. Honor `eldoc-echo-area-use-multiline-p' and -`eldoc-prefer-doc-buffer'." +`eldoc-echo-area-prefer-doc-buffer'." (cond (;; Check if he wave permission to mess with echo area at all. For ;; example, if this-command is non-nil while running via an idle @@ -517,7 +518,14 @@ Honor `eldoc-echo-area-use-multiline-p' and (float (truncate (* (frame-height) val))) (integer val) (t 1))) - single-doc single-doc-sym) + single-doc single-doc-sym + (prefer-doc-buffer-p + (lambda (truncated) + (and (or (eq eldoc-echo-area-prefer-doc-buffer t) + (and truncated + (eq eldoc-echo-area-prefer-doc-buffer + 'maybe))) + (get-buffer-window eldoc--doc-buffer))))) (let ((echo-area-message (cond (;; To output to the echo area,We handle the @@ -556,9 +564,7 @@ Honor `eldoc-echo-area-use-multiline-p' and do (goto-char (line-end-position (if truncated 0 -1))) (while (and (not (bobp)) (bolp)) (goto-char (line-end-position 0))) finally - (unless (and truncated - eldoc-prefer-doc-buffer - (get-buffer-window eldoc--doc-buffer)) + (unless (funcall prefer-doc-buffer-p truncated) (cl-return (concat (buffer-substring (point-min) (point)) @@ -570,10 +576,15 @@ Honor `eldoc-echo-area-use-multiline-p' and (substitute-command-keys "\\[eldoc-doc-buffer]")) "...")))))))) ((= available 1) - ;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer' too? - (with-current-buffer (eldoc--format-doc-buffer docs) - (truncate-string-to-width - (buffer-substring (goto-char (point-min)) (line-end-position 1)) width)))))) + (let ((string + (with-current-buffer (eldoc--format-doc-buffer docs) + (buffer-substring (goto-char (point-min)) + (line-end-position 1))))) + (if (> (length string) width) ; truncation to happen + (unless (funcall prefer-doc-buffer-p t) + (truncate-string-to-width string width)) + (unless (funcall prefer-doc-buffer-p nil) + string))))))) (when echo-area-message (eldoc--message echo-area-message))))))) -- cgit v1.2.3 From 77c39284259fe7a6bd6935bbe78a799dd9191c43 Mon Sep 17 00:00:00 2001 From: JoĂŁo TĂĄvora Date: Sun, 4 Oct 2020 12:19:47 +0100 Subject: Rename ElDoc user option controlling display of truncation notice The new name makes it consistent with other variables controlling the display of ElDoc documentation in the echo area. Per bug#43543. * etc/NEWS (Eldoc): Rename eldoc-display-truncation-message to eldoc-echo-area-display-truncation-message. * lisp/emacs-lisp/eldoc.el (eldoc-echo-area-display-truncation-message): Rename from eldoc-display-truncation-message. (eldoc-display-in-echo-area): Use new variable name. --- etc/NEWS | 2 +- lisp/emacs-lisp/eldoc.el | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 8aa27fd651e..7dbd3d51fa4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -636,7 +636,7 @@ definition. ** ElDoc +++ -*** New user option 'eldoc-display-truncation-message'. +*** New user option 'eldoc-echo-area-display-truncation-message'. If non-nil (the default), eldoc will display a message saying something like "(Documentation truncated. Use `M-x eldoc-doc-buffer' to see rest)" when a message has been truncated. If nil, truncated diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 6c6570f847a..bad9eabe64d 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -67,7 +67,7 @@ If this variable is set to 0, no idle time is required." Changing the value requires toggling `eldoc-mode'." :type 'boolean) -(defcustom eldoc-display-truncation-message t +(defcustom eldoc-echo-area-display-truncation-message t "If non-nil, provide verbose help when a message has been truncated. If nil, truncated messages will just have \"...\" appended." :type 'boolean @@ -544,7 +544,7 @@ Honor `eldoc-echo-area-use-multiline-p' and ((> available 1) ;; The message takes one extra line, so if we don't ;; display that, we have one extra line to use. - (unless eldoc-display-truncation-message + (unless eldoc-echo-area-display-truncation-message (setq available (1+ available))) ;; Else we format the *eldoc* buffer, then use some of ;; its contents top section. I'm pretty sure smarter @@ -570,7 +570,7 @@ Honor `eldoc-echo-area-use-multiline-p' and (buffer-substring (point-min) (point)) (and truncated - (if eldoc-display-truncation-message + (if eldoc-echo-area-display-truncation-message (format "\n(Documentation truncated. Use `%s' to see rest)" (substitute-command-keys "\\[eldoc-doc-buffer]")) -- cgit v1.2.3 From 10e7c76ee3e263a7691745d9384bae475c2f5c86 Mon Sep 17 00:00:00 2001 From: JoĂŁo TĂĄvora Date: Sun, 4 Oct 2020 19:31:02 +0100 Subject: Rework semantics of eldoc-echo-are-use-multiline-p Per bug#43543. Now uses logical lines, not visual lines. * lisp/emacs-lisp/eldoc.el (eldoc-echo-area-use-multiline-p): Rework semantics. (eldoc--echo-area-substring): New helper. (eldoc--echo-area-prefer-doc-buffer-p): New helper. (eldoc-display-in-echo-area): Rework using new helpers. --- lisp/emacs-lisp/eldoc.el | 118 ++++++++++++++++++++++++----------------------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index bad9eabe64d..922de18743d 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -96,19 +96,22 @@ Note that this variable has no effect, unless If value is t, never attempt to truncate messages, even if the echo area must be resized to fit. -If value is a number (integer or floating point), it has the -semantics of `max-mini-window-height', constraining the resizing -for ElDoc purposes only. +If the value is a positive number, it is used to calculate a +number of logical lines of documentation that ElDoc is allowed to +put in the echo area. If a positive integer, the number is used +directly, while a float specifies the number of lines as a +proporting of the echo area frame's height. -Any resizing respects `max-mini-window-height'. - -If value is any non-nil symbol other than t, the part of the doc -string that represents the symbol's name may be truncated if it -will enable the rest of the doc string to fit on a single line, -without resizing the echo area. +If value is the symbol `truncate-sym-name-if-fit' t, the part of +the doc string that represents a symbol's name may be truncated +if it will enable the rest of the doc string to fit on a single +line, without resizing the echo area. If value is nil, a doc string is always truncated to fit in a -single line of display in the echo area." +single line of display in the echo area. + +Any resizing of the echo area additionally respects +`max-mini-window-height'." :type '(radio (const :tag "Always" t) (float :tag "Fraction of frame height" 0.25) (integer :tag "Number of lines" 5) @@ -489,6 +492,41 @@ This holds the results of the last documentation request." "*eldoc*"))))) eldoc--doc-buffer) +(defun eldoc--echo-area-substring (available) + "Given AVAILABLE lines, get buffer substring to display in echo area. +Helper for `eldoc-display-in-echo-area'." + (let ((start (prog1 (progn + (goto-char (point-min)) + (skip-chars-forward " \t\n") + (point)) + (goto-char (line-end-position available)) + (skip-chars-backward " \t\n"))) + (truncated (save-excursion + (skip-chars-forward " \t\n") + (not (eobp))))) + (cond ((eldoc--echo-area-prefer-doc-buffer-p truncated) + nil) + ((and truncated + (> available 1) + eldoc-echo-area-display-truncation-message) + (goto-char (line-end-position 0)) + (concat (buffer-substring start (point)) + (format + "\n(Documentation truncated. Use `%s' to see rest)" + (substitute-command-keys "\\[eldoc-doc-buffer]")))) + (t + (buffer-substring start (point)))))) + +(defun eldoc--echo-area-prefer-doc-buffer-p (truncatedp) + "Tell if display in the echo area should be skipped. +Helper for `eldoc-display-in-echo-area'. If TRUNCATEDP the +documentation to potentially appear in the echo are is truncated." + (and (or (eq eldoc-echo-area-prefer-doc-buffer t) + (and truncatedp + (eq eldoc-echo-area-prefer-doc-buffer + 'maybe))) + (get-buffer-window eldoc--doc-buffer))) + (defun eldoc-display-in-echo-area (docs _interactive) "Display DOCS in echo area. Honor `eldoc-echo-area-use-multiline-p' and @@ -517,20 +555,13 @@ Honor `eldoc-echo-area-use-multiline-p' and (available (cl-typecase val (float (truncate (* (frame-height) val))) (integer val) - (t 1))) - single-doc single-doc-sym - (prefer-doc-buffer-p - (lambda (truncated) - (and (or (eq eldoc-echo-area-prefer-doc-buffer t) - (and truncated - (eq eldoc-echo-area-prefer-doc-buffer - 'maybe))) - (get-buffer-window eldoc--doc-buffer))))) + (t 'just-one-line))) + single-doc single-doc-sym) (let ((echo-area-message (cond - (;; To output to the echo area,We handle the + (;; To output to the echo area, we handle the ;; `truncate-sym-name-if-fit' special case first, by - ;; checking if for a lot of special conditions. + ;; checking for a lot of special conditions. (and (eq 'truncate-sym-name-if-fit eldoc-echo-area-use-multiline-p) (null (cdr docs)) @@ -541,49 +572,22 @@ Honor `eldoc-echo-area-use-multiline-p' and (not (string-match "\n" single-doc)) (> (+ (length single-doc) (length single-doc-sym) 2) width)) single-doc) - ((> available 1) - ;; The message takes one extra line, so if we don't - ;; display that, we have one extra line to use. - (unless eldoc-echo-area-display-truncation-message - (setq available (1+ available))) - ;; Else we format the *eldoc* buffer, then use some of - ;; its contents top section. I'm pretty sure smarter - ;; strategies can be used here that don't necessarily - ;; involve composing that entire buffer. + ((and (numberp available) + (cl-plusp available)) + ;; Else, given a positive number of logical lines, we + ;; format the *eldoc* buffer, using as most of its + ;; contents as we know will fit. (with-current-buffer (eldoc--format-doc-buffer docs) - (cl-loop - initially - (goto-char (point-min)) - (goto-char (line-end-position (1+ available))) - for truncated = nil then t - for needed - = (let ((truncate-lines message-truncate-lines)) - (count-screen-lines (point-min) (point) t - (minibuffer-window))) - while (> needed (if truncated (1- available) available)) - do (goto-char (line-end-position (if truncated 0 -1))) - (while (and (not (bobp)) (bolp)) (goto-char (line-end-position 0))) - finally - (unless (funcall prefer-doc-buffer-p truncated) - (cl-return - (concat - (buffer-substring (point-min) (point)) - (and - truncated - (if eldoc-echo-area-display-truncation-message - (format - "\n(Documentation truncated. Use `%s' to see rest)" - (substitute-command-keys "\\[eldoc-doc-buffer]")) - "...")))))))) - ((= available 1) + (eldoc--echo-area-substring available))) + (t ;; this is the "truncate brutally" situation (let ((string (with-current-buffer (eldoc--format-doc-buffer docs) (buffer-substring (goto-char (point-min)) (line-end-position 1))))) (if (> (length string) width) ; truncation to happen - (unless (funcall prefer-doc-buffer-p t) + (unless (eldoc--echo-area-prefer-doc-buffer-p t) (truncate-string-to-width string width)) - (unless (funcall prefer-doc-buffer-p nil) + (unless (eldoc--echo-area-prefer-doc-buffer-p nil) string))))))) (when echo-area-message (eldoc--message echo-area-message))))))) -- cgit v1.2.3 From dd16e46bb9d0099baea06d780ad8f62728addc2e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 20:22:33 +0200 Subject: ; Prefer https to http in more URLs These were all tested and confirmed working. --- ChangeLog.2 | 6 +- ChangeLog.3 | 78 ++++++++++++------------- admin/ChangeLog.1 | 10 ++-- admin/charsets/mapfiles/README | 6 +- doc/lispref/display.texi | 2 +- doc/misc/efaq-w32.texi | 14 ++--- doc/misc/efaq.texi | 6 +- doc/misc/idlwave.texi | 10 ++-- doc/misc/org.texi | 6 +- doc/misc/pcl-cvs.texi | 2 +- doc/misc/pgg.texi | 2 +- etc/NEXTSTEP | 2 +- etc/TODO | 4 +- etc/themes/manoj-dark-theme.el | 2 +- leim/MISC-DIC/CTLau-b5.html | 2 +- leim/MISC-DIC/CTLau.html | 2 +- leim/MISC-DIC/pinyin.map | 2 +- leim/MISC-DIC/ziranma.cin | 2 +- lisp/ChangeLog.11 | 2 +- lisp/ChangeLog.16 | 10 ++-- lisp/ChangeLog.17 | 2 +- lisp/ansi-color.el | 4 +- lisp/cedet/semantic/wisent/grammar.el | 2 +- lisp/erc/ChangeLog.1 | 2 +- lisp/erc/erc-backend.el | 2 +- lisp/frame.el | 2 +- lisp/international/mule-conf.el | 2 +- lisp/jsonrpc.el | 2 +- lisp/mail/mail-extr.el | 2 +- lisp/mh-e/mh-thread.el | 2 +- lisp/misc.el | 4 +- lisp/net/ldap.el | 2 +- lisp/net/tramp-archive.el | 2 +- lisp/notifications.el | 2 +- lisp/nxml/xsd-regexp.el | 4 +- lisp/org/ob-coq.el | 2 +- lisp/org/ob-js.el | 6 +- lisp/org/ob-vala.el | 2 +- lisp/org/org-tempo.el | 2 +- lisp/pcmpl-x.el | 2 +- lisp/progmodes/antlr-mode.el | 2 +- lisp/progmodes/cl-font-lock.el | 2 +- lisp/progmodes/python.el | 2 +- lisp/progmodes/xref.el | 2 +- lisp/term.el | 2 +- lisp/vc/vc-bzr.el | 2 +- lisp/vc/vc-svn.el | 4 +- msdos/autogen/Makefile.in | 4 +- msdos/autogen/config.in | 2 +- nt/INSTALL.W64 | 2 +- src/nsxwidget.h | 2 +- src/nsxwidget.m | 2 +- src/w32heap.c | 4 +- test/lisp/gnus/gnus-util-tests.el | 2 +- test/lisp/gnus/mml-sec-tests.el | 2 +- test/lisp/man-tests.el | 4 +- test/lisp/progmodes/python-tests.el | 2 +- test/lisp/progmodes/ruby-mode-resources/ruby.rb | 2 +- test/lisp/textmodes/bibtex-tests.el | 2 +- test/lisp/vc/vc-bzr-tests.el | 2 +- 60 files changed, 134 insertions(+), 134 deletions(-) diff --git a/ChangeLog.2 b/ChangeLog.2 index ebaf3846dca..5e9b8b901e0 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -9269,7 +9269,7 @@ This is related to the autogen.sh changes made by Paul Eggert in commit d766ca8f (2016-02-01) and commit cedd7cad (2016-02-01), and to - my edits today to http://www.emacswiki.org/emacs/GitForEmacsDevs and + my edits today to https://www.emacswiki.org/emacs/GitForEmacsDevs and to emacswiki.org/emacs/GitQuickStartForEmacsDevs. See also the thread "Recommend these .gitconfig settings for git integrity." at https://lists.gnu.org/r/emacs-devel/2016-01/threads.html#01802. @@ -13444,7 +13444,7 @@ (gdb-send): Recognize various ways of exiting from Python and Guile interpreters and returning to GDB. For details, see https://lists.gnu.org/r/emacs-devel/2015-12/msg00693.html - and http://stackoverflow.com/questions/31514741. + and https://stackoverflow.com/questions/31514741. 2015-12-16 Paul Eggert @@ -23731,7 +23731,7 @@ * lisp/progmodes/etags.el (etags-tags-completion-table): Allow even one non-regular character before the implicit tag name. - Reported at http://emacs.stackexchange.com/questions/15269/. + Reported at https://emacs.stackexchange.com/questions/15269/. 2015-09-06 Thomas Fitzsimmons diff --git a/ChangeLog.3 b/ChangeLog.3 index ec2d3f8d462..0f363100794 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -44031,8 +44031,8 @@ * src/marker.c (buf_bytepos_to_charpos): Remove the assertion regarding bytepos always at the head byte of a multibyte sequence. For the reasons, see - http://lists.gnu.org/archive/html/emacs-devel/2019-03/msg00100.html - http://lists.gnu.org/archive/html/emacs-devel/2019-03/msg00102.html + https://lists.gnu.org/archive/html/emacs-devel/2019-03/msg00100.html + https://lists.gnu.org/archive/html/emacs-devel/2019-03/msg00102.html 2019-03-05 Wilson Snyder @@ -45541,7 +45541,7 @@ * lisp/startup.el (command-line): Pass 'early-init.el', with an explicit .el extension, to load-user-init-file. Reported by Radon Rosborough in - http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00314.html. + https://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00314.html. 2019-02-15 Stefan Monnier @@ -50624,7 +50624,7 @@ the correct directory in emacs_wd, which is now initialized way earlier in the startup process, when init_environment was not yet called. For details, see the problems reported in - http://lists.gnu.org/archive/html/emacs-devel/2018-12/msg00068.html. + https://lists.gnu.org/archive/html/emacs-devel/2018-12/msg00068.html. Reported by Angelo Graziosi . 2018-12-06 Juri Linkov @@ -52313,7 +52313,7 @@ * lib-src/emacsclient.c (set_local_socket): Don't ignore socket ownership when run by root. - Ref: http://lists.gnu.org/r/emacs-devel/2018-11/msg00019.html + Ref: https://lists.gnu.org/r/emacs-devel/2018-11/msg00019.html 2018-11-13 Eli Zaretskii @@ -57139,7 +57139,7 @@ alias for thai-iso8859-11. Instead, reinstate the original definition of tis620-2533, but without eight-bit-control in the :superset attribute. For the details, see - http://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00117.html + https://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00117.html and the surrounding discussions. * lisp/international/fontset.el (font-encoding-alist) (font-encoding-charset-alist): Reinstate tis620-2533 charset. @@ -60017,7 +60017,7 @@ * src/w32proc.c (syms_of_ntproc) : Set to zero. For the details, see this discussion: - http://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00711.html. + https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00711.html. * src/w32.c (_sys_read_ahead): Update the commentary for w32-pipe-read-delay usage. @@ -62471,7 +62471,7 @@ * lisp/subr.el (string-to-unibyte): No longer obsolete. See the emacs-devel discussion around this message: - http://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00656.html. + https://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00656.html. * etc/NEWS: Announce the change. @@ -63512,7 +63512,7 @@ * lisp/international/fontset.el (font-encoding-alist): Fix the GB18030 entry to encode characters correctly when passing them to the xfont back-end. (Bug#31315) See also - http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg00754.html. + https://lists.gnu.org/archive/html/emacs-devel/2008-01/msg00754.html. 2018-05-04 Noam Postavsky @@ -65267,7 +65267,7 @@ (eww-display-html): ... and don't get it here, because it's gone by now. - Test URL: http://www.gnu.org/s/hyperbole/#summary + Test URL: https://www.gnu.org/s/hyperbole/#summary 2018-04-13 Robert Pluim @@ -70827,7 +70827,7 @@ TO_CHARPOS, but didn't yet produce glyphs for that buffer position, because the last call to PRODUCE_GLYPHS at this position was for an object other than the buffer. For further details, see - http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00537.html. + https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00537.html. 2018-01-19 Reuben Thomas @@ -80561,7 +80561,7 @@ * configure.ac: Add -Wabi to the list of disabled warning options. For the details, see - http://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00123.html. + https://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00123.html. 2018-08-10 Filipp Gunbin @@ -80935,7 +80935,7 @@ * lisp/emacs-lisp/rx.el (rx): Clarify and improve the doc string. For the details, see the discussion starting at - http://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00399.html. + https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00399.html. 2018-07-19 Eli Zaretskii @@ -81072,7 +81072,7 @@ Improve documentation of Flyspell For the background, see - http://lists.gnu.org/archive/html/help-gnu-emacs/2018-07/msg00099.html. + https://lists.gnu.org/archive/html/help-gnu-emacs/2018-07/msg00099.html. * doc/emacs/fixit.texi (Spelling): Add a couple of caveats. * lisp/textmodes/flyspell.el: Update commentary. @@ -81781,7 +81781,7 @@ * lisp/info.el: Explain in commentary why some commands start with "info-" and others with "Info-". See also - http://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00482.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00482.html. 2018-06-13 Michael Albinus @@ -82336,7 +82336,7 @@ * lisp/international/fontset.el (font-encoding-alist): Fix the GB18030 entry to encode characters correctly when passing them to the xfont back-end. (Bug#31315) See also - http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg00754.html. + https://lists.gnu.org/archive/html/emacs-devel/2008-01/msg00754.html. (cherry picked from commit bbe2cadc544e63e9378350621887f8fb9bbcc236) @@ -82460,7 +82460,7 @@ TO_CHARPOS, but didn't yet produce glyphs for that buffer position, because the last call to PRODUCE_GLYPHS at this position was for an object other than the buffer. For further details, see - http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00537.html. + https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00537.html. (cherry picked from commit c0154ac7c3423f68d8f3a2e85a756c9759219039) @@ -83153,7 +83153,7 @@ (Note for Novices): * doc/lispref/tips.texi (Key Binding Conventions): Fix use of @key. For the details, see - http://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00390.html. + https://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00390.html. 2018-04-19 Eli Zaretskii @@ -83239,7 +83239,7 @@ * src/process.c (Fmake_pipe_process): Set up the decoding and encoding buffers. For the details, see - http://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00295.html. + https://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00295.html. 2018-04-13 Robert Pluim @@ -84015,7 +84015,7 @@ * doc/lispref/variables.texi (Local Variables): Make more clear that local bindings of 'let' are in effect only within the body. Suggested by Marcin Borkowski , see - http://lists.gnu.org/archive/html/emacs-devel/2018-03/msg00217.html + https://lists.gnu.org/archive/html/emacs-devel/2018-03/msg00217.html for the details. * doc/emacs/programs.texi (Matching): Fix a typo. Reported by @@ -85790,7 +85790,7 @@ * doc/emacs/text.texi (Words): Improve wording. Reported by Marcin Borkowski in - http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00784.html. + https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00784.html. 2018-01-28 Martin Rudalics @@ -86006,7 +86006,7 @@ This is part two of a two part fix for the GTK scaling problems. See the thread starting at - http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00372.html + https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00372.html for an explanation of why it has been added to Emacs 26. * src/gtkutil.c (xg_set_geometry): Scale down the coordinates that we @@ -86019,7 +86019,7 @@ This is part one of a two part fix for the GTK scaling problems. See the thread starting at - http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00372.html + https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00372.html for an explanation of why it has been added to Emacs 26. * src/xfns.c (Fx_display_monitor_attributes_list): Take scaling factor @@ -86163,7 +86163,7 @@ being compiled is specified by an absolute file name. This avoids problems with ACL copying from temporary-file-directory on FreeBSD. For the details, see - http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00513.html. + https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00513.html. 2018-01-19 Eli Zaretskii @@ -86356,7 +86356,7 @@ * doc/lispref/variables.texi (File Local Variables): Mention the autoload cookie as a means of defining safe values for variables. - See http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00261.html + See https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00261.html for the details. * doc/lispref/compile.texi (Compiler Errors): Document 'byte-compile-error-on-warn'. @@ -86750,7 +86750,7 @@ scroll-margin when scrolling down, i.e. moving window-start towards the beginning of the buffer. Reported by zhang cc in - http://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00894.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00894.html. 2017-12-29 Eli Zaretskii @@ -86991,7 +86991,7 @@ Clarify what selecting a window means for keyboard input, and that input focus may need to be considered when selecting windows on other frames. See - http://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00372.html + https://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00372.html for more details. 2017-12-22 Eli Zaretskii @@ -87530,7 +87530,7 @@ * lisp/progmodes/prog-mode.el (prog-indentation-context): Un-document all elements but the first. (prog-widen): Remove. - (http://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00321.html) + (https://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00321.html) * doc/lispref/text.texi (Mode-Specific Indent): Update. @@ -87675,7 +87675,7 @@ Import the latest IVD_Sequences.txt * admin/unidata/IVD_Sequences.txt: New version from - http://www.unicode.org/ivd/, the 2017-12-12 version of the Unicode + https://www.unicode.org/ivd/, the 2017-12-12 version of the Unicode Ideographic Variation Database. * src/macuvs.h: Regenerated. @@ -87989,7 +87989,7 @@ * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Pass basename of target-file to make-temp-file, in case target-file includes a leading directory that might not exist under TMPDIR. See - http://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00680.html + https://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00680.html for the details. 2017-12-02 Michael Albinus @@ -88670,7 +88670,7 @@ * lisp/calc/calc-aent.el (math-read-token): Make sure the match against "0[xX][0-9a-fA-F]+" is found at math-exp-pos. See - http://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00174.html + https://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00174.html for the details. 2017-11-18 Eli Zaretskii @@ -88984,7 +88984,7 @@ * lisp/files.el (find-file, find-file-other-window) (find-file-other-frame): Mention file-name-at-point-functions in the doc string. Reported by Florian Weimer in - http://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00224.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00224.html. * doc/emacs/mini.texi (Minibuffer History): Document file-name-at-point-functions and its effect on M-n when typing @@ -97350,7 +97350,7 @@ Improve make-temp-file performance on local files For the motivation behind this patch, please see Bug#28023 and: - http://emacshorrors.com/posts/make-temp-name.html + https://emacshorrors.com/posts/make-temp-name.html Although, given the recent changes to Tramp, the related security problem in make-temp-file is already fixed, make-temp-file still has several unnecessary system calls. In the typical case on GNU/Linux, @@ -104823,7 +104823,7 @@ Remove s_client usage from tls.el * lisp/net/tls.el (tls-program, tls-checktrust): Remove s_client. - Ref http://bugs.debian.org/766397 + Ref https://bugs.debian.org/766397 https://lists.gnu.org/r/emacs-devel/2014-10/msg00803.html @@ -107262,7 +107262,7 @@ Remove s_client usage from tls.el * lisp/net/tls.el (tls-program, tls-checktrust): Remove s_client. - Ref http://bugs.debian.org/766397 + Ref https://bugs.debian.org/766397 https://lists.gnu.org/r/emacs-devel/2014-10/msg00803.html 2017-04-25 Glenn Morris @@ -107708,7 +107708,7 @@ * lisp/emacs-lisp/ert.el (ert--expand-should-1): Avoid errors related to undefined byte-compile-macro-environment. Somehow masked until very recently because loading seq (eg) - loads bytecomp. http://hydra.nixos.org/build/51730765 + loads bytecomp. https://hydra.nixos.org/build/51730765 2017-04-18 Eli Zaretskii @@ -108380,7 +108380,7 @@ * test/lisp/emacs-lisp/package-tests.el (with-package-test): Also bind package-gnupghome-dir, see eg - http://hydra.nixos.org/build/51462182 . + https://hydra.nixos.org/build/51462182 . 2017-04-11 Martin Rudalics @@ -113197,7 +113197,7 @@ The [5ec3a584: Generate upcase and downcase tables from Unicode data] commit broke bootstrap from a truly clean tree (e.g. a fresh clone or one created with ‘make extraclean’), see - . + . The failure was caused by characters.el trying to read Unicode property tables which aren’t available so early in the build process. @@ -122075,7 +122075,7 @@ Support zstd compressed files * lisp/jka-cmpr-hook.el (jka-compr-compression-info-list): Add - zstd compression info: . + zstd compression info: . (jka-compr-mode-alist-additions): Handle .tzst suffix for zstd compressed tar archives. (Bug#24853) diff --git a/admin/ChangeLog.1 b/admin/ChangeLog.1 index 7a576a03123..64c65bdd12c 100644 --- a/admin/ChangeLog.1 +++ b/admin/ChangeLog.1 @@ -1629,10 +1629,10 @@ 2010-09-05 Juanma Barranquero * unidata/BidiMirroring.txt: Update from - http://www.unicode.org/Public/6.0.0/ucd/BidiMirroring-6.0.0d2.txt + https://www.unicode.org/Public/6.0.0/ucd/BidiMirroring-6.0.0d2.txt * unidata/UnicodeData.txt: Update from - http://www.unicode.org/Public/6.0.0/ucd/UnicodeData-6.0.0d7.txt + https://www.unicode.org/Public/6.0.0/ucd/UnicodeData-6.0.0d7.txt 2010-08-09 Andreas Schwab @@ -1668,7 +1668,7 @@ * unidata/bidimirror.awk: New file. * unidata/BidiMirroring.txt: New file from - http://www.unicode.org/Public/6.0.0/ucd/BidiMirroring-6.0.0d1.txt. + https://www.unicode.org/Public/6.0.0/ucd/BidiMirroring-6.0.0d1.txt. * unidata/Makefile.in (../../src/bidimirror.h): New target. (all): Depend on ../../src/biditype.h and ../../src/bidimirror.h. @@ -1685,7 +1685,7 @@ 2010-06-09 Juanma Barranquero * unidata/UnicodeData.txt: Update from - http://www.unicode.org/Public/6.0.0/ucd/UnicodeData-6.0.0d5.txt + https://www.unicode.org/Public/6.0.0/ucd/UnicodeData-6.0.0d5.txt 2010-05-27 Glenn Morris @@ -2031,7 +2031,7 @@ * unidata/unidata-gen.el: New file. * unidata/UnicodeData.txt: New file. Copied from - http://www.unicode.org on 2006-05-23. + https://www.unicode.org on 2006-05-23. * unidata/.cvsignore: New file. diff --git a/admin/charsets/mapfiles/README b/admin/charsets/mapfiles/README index fe1d07f4f98..c3205672d19 100644 --- a/admin/charsets/mapfiles/README +++ b/admin/charsets/mapfiles/README @@ -20,7 +20,7 @@ Available at: * PTCP154 Available at: - + * Uni2JIS @@ -50,8 +50,8 @@ Available at: * CP720.map and CP858.map Created manually by looking at these pages: - . - . + . + . The text in that page is under the terms of the GNU Free Documentation License. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index c3043423039..6fc8587fe52 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -8037,7 +8037,7 @@ positions do not increase monotonically with string or buffer position. In performing this @dfn{bidirectional reordering}, Emacs follows the Unicode Bidirectional Algorithm (a.k.a.@: @acronym{UBA}), which is described in Annex #9 of the Unicode standard -(@url{http://www.unicode.org/reports/tr9/}). Emacs provides a ``Full +(@url{https://www.unicode.org/reports/tr9/}). Emacs provides a ``Full Bidirectionality'' class implementation of the @acronym{UBA}, consistent with the requirements of the Unicode Standard v9.0. Note, however, that the way Emacs displays continuation lines when text diff --git a/doc/misc/efaq-w32.texi b/doc/misc/efaq-w32.texi index bbfc86b111e..c875d58ef16 100644 --- a/doc/misc/efaq-w32.texi +++ b/doc/misc/efaq-w32.texi @@ -1188,9 +1188,9 @@ MS Windows, but this has still been insufficient to keep up with changes in printing technology from text and postscript based printers connected via ports that can be accessed directly, to graphical printers that are only accessible via USB@. For details, see -@uref{http://www.emacswiki.org/emacs/PrintingFromEmacs, Emacs -Wiki}, @uref{http://www.emacswiki.org/emacs/PrintWithWebBrowser}, and -@uref{http://www.emacswiki.org/emacs/PrintFromWindowsExplorer}. +@uref{https://www.emacswiki.org/emacs/PrintingFromEmacs, Emacs +Wiki}, @uref{https://www.emacswiki.org/emacs/PrintWithWebBrowser}, and +@uref{https://www.emacswiki.org/emacs/PrintFromWindowsExplorer}. @c ------------------------------------------------------------ @node Sub-processes @@ -1414,7 +1414,7 @@ continue to use bash as your subshell: @cindex cygwin mount points, using within Emacs The package -@uref{http://www.emacswiki.org/emacs/cygwin-mount.el, +@uref{https://www.emacswiki.org/emacs/cygwin-mount.el, cygwin-mount.el} teaches Emacs about Cygwin mount points. @node Dired ls @@ -1793,7 +1793,7 @@ do not need to add its installation directory to the @env{PATH}. @cindex Emacs distribution, checking digital signatures GNU Privacy Guard is a Free replacement for PGP, with Windows binaries -available. See @uref{http://www.gnupg.org/}. +available. See @uref{https://www.gnupg.org/}. @node Mouse wheel @section Why doesn't my wheel mouse work in Emacs? @@ -2131,7 +2131,7 @@ suggestions} for improving the interaction of perldb and Emacs. @cindex subprocesses, cygwin tools @vindex exec-path -@uref{http://www.cygwin.com/}. +@uref{https://www.cygwin.com/}. Cygwin is a popular complete POSIX emulation environment for Windows. Most of its tools can be used with Emacs, and it covers a wide range @@ -2281,7 +2281,7 @@ and you can view the FAQ by typing @kbd{C-h C-f}. Other resources include: @itemize @item @uref{https://www.gnu.org/software/emacs/, The Emacs homepage} @item @uref{https://www.gnu.org/software/emacs/manual/, Other Emacs manuals} -@item @uref{http://www.emacswiki.org/, Emacs Wiki} +@item @uref{https://www.emacswiki.org/, Emacs Wiki} @end itemize @node Mailing lists diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index e1b099edaab..1bc9d41f9bb 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -400,7 +400,7 @@ archive can be browsed over the web at @uref{https://lists.gnu.org/r/, the GNU mail archive}. Web-based Usenet search services, such as -@uref{http://groups.google.com/groups/dir?q=gnu&, Google}, also +@uref{https://groups.google.com/groups/dir?q=gnu&, Google}, also archive the @code{gnu.*} groups. @node Reporting bugs @@ -865,7 +865,7 @@ Bulletin}, are at @uref{https://www.gnu.org/bulletins/bulletins.html} and -@uref{http://www.cs.pdx.edu/~trent/gnu/gnu.html} +@uref{https://www.cs.pdx.edu/~trent/gnu/gnu.html} @node Help installing Emacs @section Where can I get help in installing Emacs? @@ -3613,7 +3613,7 @@ For a list of other MS-DOS implementations of Emacs (and Emacs look-alikes), consult the list of ``Emacs implementations and literature,'' available at -@uref{http://www.finseth.com/emacs.html} +@uref{https://www.finseth.com/emacs.html} Note that while many of these programs look similar to Emacs, they often lack certain features, such as the Emacs Lisp extension language. diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 5cb6b19181c..538c088282b 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -247,15 +247,15 @@ Here are a number of screenshots showing IDLWAVE in action: @itemize @bullet @item -@uref{http://github.com/jdtsmith/idlwave/screenshots/emacs_21_nav.gif,An IDLWAVE buffer} +@uref{https://github.com/jdtsmith/idlwave/screenshots/emacs_21_nav.gif,An IDLWAVE buffer} @item -@uref{http://github.com/jdtsmith/idlwave/screenshots/emacs_21_keys.gif,A keyword being completed} +@uref{https://github.com/jdtsmith/idlwave/screenshots/emacs_21_keys.gif,A keyword being completed} @item -@uref{http://github.com/jdtsmith/idlwave/screenshots/emacs_21_help.gif,Online help text.} +@uref{https://github.com/jdtsmith/idlwave/screenshots/emacs_21_help.gif,Online help text.} @item -@uref{http://github.com/jdtsmith/idlwave/screenshots/emacs_21_ri.gif,Routine information displayed} +@uref{https://github.com/jdtsmith/idlwave/screenshots/emacs_21_ri.gif,Routine information displayed} @item -@uref{http://github.com/jdtsmith/idlwave/screenshots/emacs_21_bp.gif,Debugging code +@uref{https://github.com/jdtsmith/idlwave/screenshots/emacs_21_bp.gif,Debugging code stopped at a breakpoint} @end itemize @end ifnottex diff --git a/doc/misc/org.texi b/doc/misc/org.texi index 495d562f50b..b7e05feb0f1 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi @@ -3753,7 +3753,7 @@ A link should be enclosed in double brackets and may contain descriptive text to be displayed instead of the URL (see @ref{Link Format}), for example: @example -[[http://www.gnu.org/software/emacs/][GNU Emacs]] +[[https://www.gnu.org/software/emacs/][GNU Emacs]] @end example @@ -22361,7 +22361,7 @@ Marco Wahl wrote @samp{ol-eww.el}. @display Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. -@uref{http://fsf.org/} +@uref{https://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -22786,7 +22786,7 @@ The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See -@uref{http://www.gnu.org/copyleft/}. +@uref{https://www.gnu.org/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered diff --git a/doc/misc/pcl-cvs.texi b/doc/misc/pcl-cvs.texi index c3df33eb9aa..d1951f581c9 100644 --- a/doc/misc/pcl-cvs.texi +++ b/doc/misc/pcl-cvs.texi @@ -1389,7 +1389,7 @@ bugs, please report them separately. If you have problems using PCL-CVS or other questions, send them to the @url{https://lists.gnu.org/mailman/listinfo/help-gnu-emacs, help-gnu-emacs mailing list}. This is a good place to get help, as is -the @url{http://lists.nongnu.org/mailman/listinfo/info-cvs, info-cvs list}. +the @url{https://lists.nongnu.org/mailman/listinfo/info-cvs, info-cvs list}. If you have ideas for improvements, or if you have written some extensions to this package, we would like to hear from you. We hope that diff --git a/doc/misc/pgg.texi b/doc/misc/pgg.texi index 5daa16fb27e..261897b735c 100644 --- a/doc/misc/pgg.texi +++ b/doc/misc/pgg.texi @@ -94,7 +94,7 @@ and that you are familiar with its basic functions. By default, PGG uses GnuPG@. If you are new to such a system, I recommend that you should look over the GNU Privacy Handbook (GPH) -which is available at @uref{http://www.gnupg.org/documentation/}. +which is available at @uref{https://www.gnupg.org/documentation/}. When using GnuPG, we recommend the use of the @code{gpg-agent} program, which is distributed with versions 2.0 and later of GnuPG@. diff --git a/etc/NEXTSTEP b/etc/NEXTSTEP index 77a1752a4a4..5ac3b6b1741 100644 --- a/etc/NEXTSTEP +++ b/etc/NEXTSTEP @@ -27,7 +27,7 @@ the absence of any other determinant, we are using the term created these APIs, and because all of the classes and functions still begin with the letters "NS". -(See http://en.wikipedia.org/wiki/Nextstep) +(See https://en.wikipedia.org/wiki/Nextstep) This Emacs port was first released in the early 1990's on the NeXT computer, and was successively updated to OpenStep, Rhapsody, Mac OS diff --git a/etc/TODO b/etc/TODO index 4f9ea7e5d46..8e93e7fb10a 100644 --- a/etc/TODO +++ b/etc/TODO @@ -402,7 +402,7 @@ built-in. See the discussion of bug#39799 for more details about this task. Another relevant resource is the Unicode Technical Standard #51 -"Unicode Emoji" (http://www.unicode.org/reports/tr51/). +"Unicode Emoji" (https://www.unicode.org/reports/tr51/). ** Extend text-properties and overlays @@ -497,7 +497,7 @@ https://savannah.nongnu.org/projects/emacs-rtf/, which is still in very early stages. Another place to look is the Wikipedia article at -http://en.wikipedia.org/wiki/Rich_Text_Format. It currently points to +https://en.wikipedia.org/wiki/Rich_Text_Format. It currently points to the latest spec of RTF v1.9.1 at https://web.archive.org/web/20190708132914/http://www.kleinlercher.at/tools/Windows_Protocols/Word2007RTFSpec9.pdf diff --git a/etc/themes/manoj-dark-theme.el b/etc/themes/manoj-dark-theme.el index ac395f993c9..195d40d7af6 100644 --- a/etc/themes/manoj-dark-theme.el +++ b/etc/themes/manoj-dark-theme.el @@ -62,7 +62,7 @@ ;; org-mode, CUA-mode, apt-utils, bbdb, compilation buffers, changelog ;; mode, diff and ediff, eshell, and more. You need emacs-goodies ;; package on Debian to use this. See the wiki page at -;; http://www.emacswiki.org/cgi-bin/wiki?ColorTheme for details. The +;; https://www.emacswiki.org/cgi-bin/wiki?ColorTheme for details. The ;; project home page is at https://gna.org/projects/color-theme. ;;; Code: diff --git a/leim/MISC-DIC/CTLau-b5.html b/leim/MISC-DIC/CTLau-b5.html index e718edeb121..117a6ee374e 100644 --- a/leim/MISC-DIC/CTLau-b5.html +++ b/leim/MISC-DIC/CTLau-b5.html @@ -23,7 +23,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # # # File Format: diff --git a/leim/MISC-DIC/CTLau.html b/leim/MISC-DIC/CTLau.html index 18a48c125d0..e7759117325 100644 --- a/leim/MISC-DIC/CTLau.html +++ b/leim/MISC-DIC/CTLau.html @@ -23,7 +23,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # # # File Format: diff --git a/leim/MISC-DIC/pinyin.map b/leim/MISC-DIC/pinyin.map index 6c2117713b5..4809769d1ad 100644 --- a/leim/MISC-DIC/pinyin.map +++ b/leim/MISC-DIC/pinyin.map @@ -23,7 +23,7 @@ % details. % % You should have received a copy of the GNU General Public License along with -% CCE. If not, see . +% CCE. If not, see . % % End of header added for Emacs a °ą°ĄșÇëçàÄïčßč diff --git a/leim/MISC-DIC/ziranma.cin b/leim/MISC-DIC/ziranma.cin index 13a63fd7335..b61aea2b6f4 100644 --- a/leim/MISC-DIC/ziranma.cin +++ b/leim/MISC-DIC/ziranma.cin @@ -23,7 +23,7 @@ % details. % % You should have received a copy of the GNU General Public License along with -% CCE. If not, see . +% CCE. If not, see . % % End of header added for Emacs %ename ZiranMa diff --git a/lisp/ChangeLog.11 b/lisp/ChangeLog.11 index 52b85950be0..374a5668932 100644 --- a/lisp/ChangeLog.11 +++ b/lisp/ChangeLog.11 @@ -13392,7 +13392,7 @@ * progmodes/compile.el (compilation-error-regexp-alist): Add Java ANt error detection as described in document - http://ant.apache.org/faq.html + https://ant.apache.org/faq.html 2003-08-12 Juri Linkov (tiny change) diff --git a/lisp/ChangeLog.16 b/lisp/ChangeLog.16 index 6c093790d31..bb7389c5b71 100644 --- a/lisp/ChangeLog.16 +++ b/lisp/ChangeLog.16 @@ -379,7 +379,7 @@ 2013-02-28 Sam Steingold * vc/diff-mode.el (diff-hunk-file-names): Handle filenames with spaces. - See . + See . 2013-02-28 Thierry Volpiatto @@ -1326,7 +1326,7 @@ * net/soap-client.el (soap-invoke): Encode the string for `url-request-data' as UTF-8. - Fixes . + Fixes . 2013-02-01 Glenn Morris @@ -2462,7 +2462,7 @@ 2012-12-27 Sam Steingold * progmodes/cperl-mode.el (cperl-calculate-indent): Do not stagger - continuations, see . + continuations, see . 2012-12-27 Dmitry Gutov @@ -11473,7 +11473,7 @@ (sh-set-shell): Use smie-setup if requested. * term.el (term-set-escape-char): Properly set term-escape-char. - See http://stackoverflow.com/questions/10524656. + See https://stackoverflow.com/questions/10524656. 2012-05-10 Chong Yidong @@ -16476,7 +16476,7 @@ (python-pdbtrack-track-stack-file): Adjust to recognize ipdb as well as regular python pdb prompts. Adjustments shamelessly taken exactly as suggested in EmacsWiki page (tiny change): - http://www.emacswiki.org/PythonProgrammingInEmacs#toc14 + https://www.emacswiki.org/PythonProgrammingInEmacs#toc14 2011-11-16 Juanma Barranquero diff --git a/lisp/ChangeLog.17 b/lisp/ChangeLog.17 index 8039e3f28a3..5789445fcd6 100644 --- a/lisp/ChangeLog.17 +++ b/lisp/ChangeLog.17 @@ -23951,7 +23951,7 @@ * simple.el (shell-command-on-region): Pass the `replace' argument down to `call-process-region' to comply with the doc as reported on - + 2013-05-23 Stefan Monnier diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index c3b2d98c140..d20260b185c 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -39,7 +39,7 @@ ;; ;; SGR control sequences are defined in section 3.8.117 of the ECMA-48 ;; standard (identical to ISO/IEC 6429), which is freely available as a -;; PDF file . +;; PDF file . ;; The "Graphic Rendition Combination Mode (GRCM)" implemented is ;; "cumulative mode" as defined in section 7.2.8. Cumulative mode ;; means that whenever possible, SGR control sequences are combined @@ -84,7 +84,7 @@ This translation effectively colorizes strings and regions based upon SGR control sequences embedded in the text. SGR (Select Graphic Rendition) control sequences are defined in section 8.3.117 of the ECMA-48 standard (identical to ISO/IEC 6429), which is freely available -at +at as a PDF file." :version "21.1" :group 'processes) diff --git a/lisp/cedet/semantic/wisent/grammar.el b/lisp/cedet/semantic/wisent/grammar.el index 49b0fd1b3b4..0ff9cde80ef 100644 --- a/lisp/cedet/semantic/wisent/grammar.el +++ b/lisp/cedet/semantic/wisent/grammar.el @@ -427,7 +427,7 @@ Menu items are appended to the common grammar menu.") "\n;; It is derived from the grammar in the ECMAScript Language ;; Specification published at ;; -;; http://www.ecma-international.org/publications/standards/Ecma-262.htm +;; https://www.ecma-international.org/publications/standards/Ecma-262.htm ;; ;; and redistributed under the following license: ;; diff --git a/lisp/erc/ChangeLog.1 b/lisp/erc/ChangeLog.1 index 90bd8bd09ee..fdf51954684 100644 --- a/lisp/erc/ChangeLog.1 +++ b/lisp/erc/ChangeLog.1 @@ -9116,7 +9116,7 @@ 2002-11-10 Alex Schroeder * TODO: - TODO: moved it to http://www.emacswiki.org/cgi-bin/wiki.pl?ErcTODO + TODO: moved it to https://www.emacswiki.org/cgi-bin/wiki.pl?ErcTODO * erc.el(with-erc-channel-buffer): Rudimentary doc string. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 1cf0bb49217..f99088d4c78 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -408,7 +408,7 @@ This string is processed using `format-time-string'." ;;; Flood-related ;; Most of this is courtesy of Jorgen Schaefer and Circe -;; (http://www.nongnu.org/circe) +;; (https://www.nongnu.org/circe) (defcustom erc-server-flood-margin 10 "A margin on how much excess data we send. diff --git a/lisp/frame.el b/lisp/frame.el index 29ac862ccd4..772ba3d8c47 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1934,7 +1934,7 @@ for FRAME." ;; features change, it will be easy to find all the tests for such ;; capabilities by a simple text search. See more about the history ;; and the intent of these functions in -;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2019-04/msg00004.html +;; https://lists.gnu.org/archive/html/bug-gnu-emacs/2019-04/msg00004.html ;; or in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35058#17. (declare-function msdos-mouse-p "dosfns.c") diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el index c84f0a49901..42dd19842c8 100644 --- a/lisp/international/mule-conf.el +++ b/lisp/international/mule-conf.el @@ -39,7 +39,7 @@ ;; Society of Japan/Information Technology Standards Commission of ;; Japan (IPSJ/ITSCJ) at https://www.itscj.ipsj.or.jp/itscj_english/. ;; Standards docs equivalent to iso-2022 and iso-8859 are at -;; http://www.ecma.ch/. +;; https://www.ecma.ch/. ;; FWIW, http://www.microsoft.com/globaldev/ lists the following for ;; MS Windows, which are presumably the only charsets we really need diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index ffbc253a976..7de6baeb00a 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -26,7 +26,7 @@ ;;; Commentary: ;; This library implements the JSONRPC 2.0 specification as described -;; in http://www.jsonrpc.org/. As the name suggests, JSONRPC is a +;; in https://www.jsonrpc.org/. As the name suggests, JSONRPC is a ;; generic Remote Procedure Call protocol designed around JSON ;; objects. To learn how to write JSONRPC programs with this library, ;; see Info node `(elisp)JSONRPC'." diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el index c296f29f9ea..49dfd2ee874 100644 --- a/lisp/mail/mail-extr.el +++ b/lisp/mail/mail-extr.el @@ -1851,7 +1851,7 @@ place. It affects how `mail-extract-address-components' works." ;; Updated by the RIPE Network Coordination Centre. ;; ;; Source: ISO 3166 Maintenance Agency -;; http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1-semic.txt +;; https://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1-semic.txt ;; https://www.iana.org/domain-names.htm ;; https://www.iana.org/cctld/cctld-whois.htm ;; Latest change: 2007/11/15 diff --git a/lisp/mh-e/mh-thread.el b/lisp/mh-e/mh-thread.el index 43a589aeca2..e6ee87b8411 100644 --- a/lisp/mh-e/mh-thread.el +++ b/lisp/mh-e/mh-thread.el @@ -29,7 +29,7 @@ ;; https://www.jwz.org/doc/threading.html ;; It also begins to implement the threading section of the IMAP - ;; SORT and THREAD Extensions RFC at: -;; http://tools.ietf.org/html/rfc5256 +;; https://tools.ietf.org/html/rfc5256 ;; The implementation lacks the reference and subject canonicalization ;; of the RFC. diff --git a/lisp/misc.el b/lisp/misc.el index be191c50d2f..03395781a51 100644 --- a/lisp/misc.el +++ b/lisp/misc.el @@ -127,7 +127,7 @@ upper atmosphere. These cause momentary pockets of higher-pressure air to form, which act as lenses that deflect incoming cosmic rays, focusing them to strike the drive platter and flip the desired bit. You can type `M-x butterfly C-M-c' to run it. This is a permuted -variation of `C-x M-c M-butterfly' from url `http://xkcd.com/378/'." +variation of `C-x M-c M-butterfly' from url `https://xkcd.com/378/'." (interactive) (if (yes-or-no-p "Do you really want to unleash the powers of the butterfly? ") (progn @@ -139,7 +139,7 @@ variation of `C-x M-c M-butterfly' from url `http://xkcd.com/378/'." (sit-for (* 5 (/ (abs (random)) (float most-positive-fixnum)))) (message "Successfully flipped one bit!")) (message "Well, then go to xkcd.com!") - (browse-url "http://xkcd.com/378/"))) + (browse-url "https://xkcd.com/378/"))) ;; A command to list dynamically loaded libraries. This useful in ;; environments where dynamic-library-alist is used, i.e., Windows diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 700653250fb..5639d52f815 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -29,7 +29,7 @@ ;; `ldapsearch' to actually perform the searches. That program can be ;; found in all LDAP developer kits such as: ;; - UM-LDAP 3.3 (http://www.umich.edu/~dirsvcs/ldap/) -;; - OpenLDAP (http://www.openldap.org/) +;; - OpenLDAP (https://www.openldap.org/) ;;; Code: diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 9502cc35300..931a9717310 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -163,7 +163,7 @@ "List of suffixes which indicate a file archive. It must be supported by libarchive(3).") -;; +;; ;; read and write: tar, cpio, pax , gzip , zip, bzip2, xz, lzip, lzma, ar, mtree, iso9660, compress. ;; read only: 7-Zip, mtree, xar, lha/lzh, rar, microsoft cab. diff --git a/lisp/notifications.el b/lisp/notifications.el index 3c2a8cf39c0..f83898622ec 100644 --- a/lisp/notifications.el +++ b/lisp/notifications.el @@ -23,7 +23,7 @@ ;;; Commentary: ;; This package provides an implementation of the Desktop Notifications -;; . +;; . ;; In order to activate this package, you must add the following code ;; into your .emacs: diff --git a/lisp/nxml/xsd-regexp.el b/lisp/nxml/xsd-regexp.el index f5bdf79349a..622ba911995 100644 --- a/lisp/nxml/xsd-regexp.el +++ b/lisp/nxml/xsd-regexp.el @@ -24,7 +24,7 @@ ;; This handles the regular expressions in the syntax defined by: ;; W3C XML Schema Part 2: Datatypes -;; +;; ;; ;; The main entry point is `xsdre-translate'. ;; @@ -1219,7 +1219,7 @@ Code is inserted into the current buffer." ;; The rest of the file was auto-generated by doing M-x xsdre-gen-categories ;; on UnicodeData-3.1.0.txt available from -;; http://www.unicode.org/Public/3.1-Update/UnicodeData-3.1.0.txt +;; https://www.unicode.org/Public/3.1-Update/UnicodeData-3.1.0.txt (xsdre-def-primitive-category 'Lu '((65 . 90) diff --git a/lisp/org/ob-coq.el b/lisp/org/ob-coq.el index 56a57cdf649..d04a40dd3b3 100644 --- a/lisp/org/ob-coq.el +++ b/lisp/org/ob-coq.el @@ -27,7 +27,7 @@ ;; session evaluation is supported. Requires both coq.el and ;; coq-inferior.el, both of which are distributed with Coq. ;; -;; http://coq.inria.fr/ +;; https://coq.inria.fr/ ;;; Code: (require 'ob) diff --git a/lisp/org/ob-js.el b/lisp/org/ob-js.el index 8f66d102074..655e253d925 100644 --- a/lisp/org/ob-js.el +++ b/lisp/org/ob-js.el @@ -30,11 +30,11 @@ ;;; Requirements: -;; - a non-browser javascript engine such as node.js http://nodejs.org/ -;; or mozrepl http://wiki.github.com/bard/mozrepl/ +;; - a non-browser javascript engine such as node.js https://nodejs.org/ +;; or mozrepl https://wiki.github.com/bard/mozrepl/ ;; ;; - for session based evaluation mozrepl and moz.el are required see -;; http://wiki.github.com/bard/mozrepl/emacs-integration for +;; https://wiki.github.com/bard/mozrepl/emacs-integration for ;; configuration instructions ;;; Code: diff --git a/lisp/org/ob-vala.el b/lisp/org/ob-vala.el index e9c214f7dfc..b1c22756226 100644 --- a/lisp/org/ob-vala.el +++ b/lisp/org/ob-vala.el @@ -26,7 +26,7 @@ ;;; Commentary: ;; ob-vala.el provides Babel support for the Vala language -;; (see http://live.gnome.org/Vala for details) +;; (see https://live.gnome.org/Vala for details) ;;; Requirements: diff --git a/lisp/org/org-tempo.el b/lisp/org/org-tempo.el index 9ae2700549c..fe3b5f8da10 100644 --- a/lisp/org/org-tempo.el +++ b/lisp/org/org-tempo.el @@ -4,7 +4,7 @@ ;; ;; Author: Rasmus Pank Roulund ;; Keywords: outlines, hypermedia, calendar, wp -;; Homepage: http://orgmode.org +;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/pcmpl-x.el b/lisp/pcmpl-x.el index 6e96a67b7b2..0fd426e3d1f 100644 --- a/lisp/pcmpl-x.el +++ b/lisp/pcmpl-x.el @@ -141,7 +141,7 @@ (pcomplete-here* (pcomplete-dirs-or-entries))))))) -;;;; ack - http://betterthangrep.com +;;;; ack - https://betterthangrep.com ;; Usage: ;; - To complete short options type '-' first diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 00fcb804d43..9dacd5856cf 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -52,7 +52,7 @@ ;; ;; * Probably. Show rules/dependencies for ANT like for Makefile (does ANT ;; support vocabularies and grammar inheritance?), I have to look at -;; jde-ant.el: http://jakarta.apache.org/ant/manual/OptionalTasks/antlr.html +;; jde-ant.el: https://jakarta.apache.org/ant/manual/OptionalTasks/antlr.html ;; * Probably. Make `indent-region' faster, especially in actions. ELP ;; profiling in a class init action shows half the time is spent in ;; `antlr-next-rule', the other half in `c-guess-basic-syntax'. diff --git a/lisp/progmodes/cl-font-lock.el b/lisp/progmodes/cl-font-lock.el index 65090ac3ca5..cb6bd6c34bb 100644 --- a/lisp/progmodes/cl-font-lock.el +++ b/lisp/progmodes/cl-font-lock.el @@ -23,7 +23,7 @@ ;; 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 . +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 7f4d2251fd8..0487964d815 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -135,7 +135,7 @@ ;; values enable completion for both CPython and IPython, and probably ;; any readline based shell (it's known to work with PyPy). If your ;; Python installation lacks readline (like CPython for Windows), -;; installing pyreadline (URL `http://ipython.org/pyreadline.html') +;; installing pyreadline (URL `https://ipython.org/pyreadline.html') ;; should suffice. To troubleshoot why you are not getting any ;; completions, you can try the following in your Python shell: diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index de2053c3c99..a1c4c08c263 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1325,7 +1325,7 @@ FILES must be a list of absolute file names." ;; call-process-region *is* measurably faster, even for a program ;; doing some actual work (for a period of time). Even though ;; call-process-region also creates a temp file internally - ;; (http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00211.html). + ;; (https://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00211.html). (if (not (file-remote-p default-directory)) (apply #'call-process-region start end program nil buffer display args) diff --git a/lisp/term.el b/lisp/term.el index ff8b3f00f34..8cbbfff1b63 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -2805,7 +2805,7 @@ See `term-prompt-regexp'." ;; References: ;; [ctlseqs]: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html -;; [ECMA-48]: http://www.ecma-international.org/publications/standards/Ecma-048.htm +;; [ECMA-48]: https://www.ecma-international.org/publications/standards/Ecma-048.htm ;; [vt100]: https://vt100.net/docs/vt100-ug/chapter3.html (defconst term-control-seq-regexp diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index f98730ed221..e2d0ca69a20 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -26,7 +26,7 @@ ;;; Commentary: -;; See concerning bzr. +;; See concerning bzr. ;; This library provides bzr support in VC. diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index e108b3a340f..06dd09490d2 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -51,8 +51,8 @@ :group 'vc-svn) ;; Might be nice if svn defaulted to non-interactive if stdin not tty. -;; http://svn.haxx.se/dev/archive-2008-05/0762.shtml -;; http://svn.haxx.se/dev/archive-2009-04/0094.shtml +;; https://svn.haxx.se/dev/archive-2008-05/0762.shtml +;; https://svn.haxx.se/dev/archive-2009-04/0094.shtml ;; Maybe newer ones do? (defcustom vc-svn-global-switches (unless (eq system-type 'darwin) ; bug#13513 '("--non-interactive")) diff --git a/msdos/autogen/Makefile.in b/msdos/autogen/Makefile.in index be1a84faa66..42a4656f9d5 100644 --- a/msdos/autogen/Makefile.in +++ b/msdos/autogen/Makefile.in @@ -26,7 +26,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this file. If not, see . +# along with this file. If not, see . # # As a special exception to the GNU General Public License, # this file may be distributed as part of a program that @@ -49,7 +49,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this file. If not, see . +# along with this file. If not, see . # # As a special exception to the GNU General Public License, # this file may be distributed as part of a program that diff --git a/msdos/autogen/config.in b/msdos/autogen/config.in index 6101abd1fa6..6475d99d6f1 100644 --- a/msdos/autogen/config.in +++ b/msdos/autogen/config.in @@ -18,7 +18,7 @@ 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 . */ +along with GNU Emacs. If not, see . */ /* No code in Emacs #includes config.h twice, but some bits of code diff --git a/nt/INSTALL.W64 b/nt/INSTALL.W64 index c3d4dfa4c28..0a0e0330a24 100644 --- a/nt/INSTALL.W64 +++ b/nt/INSTALL.W64 @@ -22,7 +22,7 @@ MinGW-w64 provides a complete runtime for projects built with GCC for 64-bit Windows -- it's located at http://mingw-w64.org/. MSYS2 is a Cygwin-derived software distribution for Windows which provides -build tools for MinGW-w64 -- see http://msys2.github.io/. +build tools for MinGW-w64 -- see https://msys2.github.io/. ** Download and install MinGW-w64 and MSYS2 diff --git a/src/nsxwidget.h b/src/nsxwidget.h index 3d91594c341..dcdb26cb34c 100644 --- a/src/nsxwidget.h +++ b/src/nsxwidget.h @@ -15,7 +15,7 @@ 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 . */ +along with GNU Emacs. If not, see . */ #ifndef NSXWIDGET_H_INCLUDED #define NSXWIDGET_H_INCLUDED diff --git a/src/nsxwidget.m b/src/nsxwidget.m index 3c6402c03ff..dbd4cb29a62 100644 --- a/src/nsxwidget.m +++ b/src/nsxwidget.m @@ -15,7 +15,7 @@ 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 . */ +along with GNU Emacs. If not, see . */ #include diff --git a/src/w32heap.c b/src/w32heap.c index ba3550b6e9b..a72bed62caf 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -191,7 +191,7 @@ free_fn the_free_fn; /* It doesn't seem to be useful to allocate from a file mapping. It would be if the memory was shared. - http://stackoverflow.com/questions/307060/what-is-the-purpose-of-allocating-pages-in-the-pagefile-with-createfilemapping */ + https://stackoverflow.com/questions/307060/what-is-the-purpose-of-allocating-pages-in-the-pagefile-with-createfilemapping */ /* This is the function to commit memory when the heap allocator claims for new memory. Before dumping with unexec, we allocate @@ -246,7 +246,7 @@ init_heap (bool use_dynamic_heap) environment before starting GDB to get low fragmentation heap on XP and older systems, for the price of losing "certain heap debug options"; for the details see - http://msdn.microsoft.com/en-us/library/windows/desktop/aa366705%28v=vs.85%29.aspx. */ + https://msdn.microsoft.com/en-us/library/windows/desktop/aa366705%28v=vs.85%29.aspx. */ data_region_end = data_region_base; /* Create the private heap. */ diff --git a/test/lisp/gnus/gnus-util-tests.el b/test/lisp/gnus/gnus-util-tests.el index 4869d162fb3..5a5e66594fa 100644 --- a/test/lisp/gnus/gnus-util-tests.el +++ b/test/lisp/gnus/gnus-util-tests.el @@ -16,7 +16,7 @@ ;; 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 . +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/test/lisp/gnus/mml-sec-tests.el b/test/lisp/gnus/mml-sec-tests.el index 3da620d64e1..d85516179fa 100644 --- a/test/lisp/gnus/mml-sec-tests.el +++ b/test/lisp/gnus/mml-sec-tests.el @@ -16,7 +16,7 @@ ;; 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 . +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/test/lisp/man-tests.el b/test/lisp/man-tests.el index 8267d8e4f6a..ddf22ecd404 100644 --- a/test/lisp/man-tests.el +++ b/test/lisp/man-tests.el @@ -44,7 +44,7 @@ sinl [sin] (3) - sine function" sin(3), sinf(3), sinl(3) - sine functions" . (#("sin(3)" 0 6 (help-echo "sine functions")) #("sinf(3)" 0 7 (help-echo "sine functions")) #("sinl(3)" 0 7 (help-echo "sine functions")))) ;; SunOS, Solaris - ;; http://docs.oracle.com/cd/E19455-01/805-6331/usradm-7/index.html + ;; https://docs.oracle.com/cd/E19455-01/805-6331/usradm-7/index.html ;; SunOS 4 ("\ tset, reset (1) - establish or restore terminal characteristics" @@ -61,7 +61,7 @@ cawf, nroff (1) - C version of the nroff-like, Amazingly Workable (text) Formatt whatis (5) - database of online manual pages" . (#("cawf(1)" 0 7 (help-echo "C version of the nroff-like, Amazingly Workable (text) Formatter")) #("nroff(1)" 0 8 (help-echo "C version of the nroff-like, Amazingly Workable (text) Formatter")) #("whatis(5)" 0 9 (help-echo "database of online manual pages")))) ;; HP-UX - ;; http://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/man.1.html + ;; https://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/man.1.html ;; Assuming that the line break in the zgrep description was ;; introduced by the man page formatting. ("\ diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index bc77443ff4f..64626333c44 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -204,7 +204,7 @@ aliqua." ;;; Indentation -;; See: http://www.python.org/dev/peps/pep-0008/#indentation +;; See: https://www.python.org/dev/peps/pep-0008/#indentation (ert-deftest python-indent-pep8-1 () "First pep8 case." diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby.rb b/test/lisp/progmodes/ruby-mode-resources/ruby.rb index 6b7d10dea38..95928030396 100644 --- a/test/lisp/progmodes/ruby-mode-resources/ruby.rb +++ b/test/lisp/progmodes/ruby-mode-resources/ruby.rb @@ -343,7 +343,7 @@ abc(foo tee .qux) -# http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation +# https://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation tee = if foo bar else diff --git a/test/lisp/textmodes/bibtex-tests.el b/test/lisp/textmodes/bibtex-tests.el index c12722fca13..56bd54efb74 100644 --- a/test/lisp/textmodes/bibtex-tests.el +++ b/test/lisp/textmodes/bibtex-tests.el @@ -17,7 +17,7 @@ ;; 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 . +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/test/lisp/vc/vc-bzr-tests.el b/test/lisp/vc/vc-bzr-tests.el index d922e98348e..bd26f7979dc 100644 --- a/test/lisp/vc/vc-bzr-tests.el +++ b/test/lisp/vc/vc-bzr-tests.el @@ -37,7 +37,7 @@ ;; commands (eg `bzr status') want to access ~/.bazaar, and will ;; abort if they cannot. I could not figure out how to stop bzr ;; doing that, so just give it a temporary homedir for the duration. - ;; http://bugs.launchpad.net/bzr/+bug/137407 ? + ;; https://bugs.launchpad.net/bzr/+bug/137407 ? ;; ;; Note that with bzr 2.x, this works: ;; mkdir /tmp/bzr -- cgit v1.2.3 From c3835bd3803e5f395c4ebf0b2585cc9272173548 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Sat, 24 Oct 2020 21:40:42 +0200 Subject: Warn about a bad default value in restricted-sexp widget * lisp/wid-edit.el (restricted-sexp widget): New :value-to-external function. If value is not in the internal format, then we might be dealing with a bad default value for the widget, so display a warning about that (bug#25152). --- lisp/wid-edit.el | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 009c6b4faf2..4e2cf7416d4 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -3585,7 +3585,30 @@ To use this type, you must define :match or :match-alternatives." :value-to-internal (lambda (widget value) (if (widget-apply widget :match value) (widget-sexp-value-to-internal widget value) - value))) + value)) + :value-to-external (lambda (widget value) + ;; We expect VALUE to be a string, so we can convert it + ;; into the external format just by `read'ing it. + ;; But for a restricted-sexp widget with a bad default + ;; value, we might end up calling read with a nil + ;; argument, resulting in an undesired prompt to the + ;; user. A bad default value is not always a big + ;; problem, but might end up in a messed up buffer, + ;; so display a warning here. (Bug#25152) + (unless (stringp value) + (display-warning + 'widget-bad-default-value + (format-message + "\nA widget of type %S has a bad default value. +value: %S +match function: %S +match-alternatives: %S" + (widget-type widget) + value + (widget-get widget :match) + (widget-get widget :match-alternatives)) + :warning)) + (read value))) (defun widget-restricted-sexp-match (widget value) (let ((alternatives (widget-get widget :match-alternatives)) -- cgit v1.2.3 From d35d5c7ecde9b5003c3b21f773570800542664fa Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 24 Oct 2020 13:41:01 -0700 Subject: Improve doprnt performance This patch implements some of my suggestions in Bug#8545, with further changes suggested by Eli Zaretskii (Bug#43439). * src/doprnt.c: Improve comments. (SIZE_BOUND_EXTRA): Now at top level, for parse_format_integer. (parse_format_integer): New static function, containing some of the old doprnt. Fix a bug that caused doprnt to infloop on formats like "%10s" that Emacs does not use. We could simplify doprnt further if we dropped support for these never-used formats. (doprnt_nul): New function. (doprnt): Use it. Change doprnt API to exit when either it finds NUL or reaches the character specified by FORMAT_END. In the typical case where FORMAT_END is null, take just one pass over FORMAT, not two. Assume C99 to make code clearer. Do not use malloc or alloca to allocate a copy of the format FMTCPY; instead, use a small fixed-size array FMTSTAR, and use '*' in that array to represent width and precision, passing them as separate int arguments. Use eassume to pacify GCC in switch statements. --- src/doprnt.c | 230 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 132 insertions(+), 98 deletions(-) diff --git a/src/doprnt.c b/src/doprnt.c index ceadf3bdfad..07c4d8d7977 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -28,6 +28,7 @@ along with GNU Emacs. If not, see . */ . For %s and %c, when field width is specified (e.g., %25s), it accounts for the display width of each character, according to char-width-table. That is, it does not assume that each character takes one column on display. + Nor does it assume that each character is a single byte. . If the size of the buffer is not enough to produce the formatted string in its entirety, it makes sure that truncation does not chop the last @@ -42,12 +43,14 @@ along with GNU Emacs. If not, see . */ Emacs can handle. OTOH, this function supports only a small subset of the standard C formatted - output facilities. E.g., %u and %ll are not supported, and precision is - ignored %s and %c conversions. (See below for the detailed documentation of - what is supported.) However, this is okay, as this function is supposed to - be called from `error' and similar functions, and thus does not need to - support features beyond those in `Fformat_message', which is used - by `error' on the Lisp level. */ + output facilities. E.g., %u is not supported, precision is ignored + in %s and %c conversions, and %lld does not necessarily work and + code should use something like %"pM"d with intmax_t instead. + (See below for the detailed documentation of what is supported.) + However, this is okay, as this function is supposed to be called + from 'error' and similar C functions, and thus does not need to + support all the features of 'Fformat_message', which is used by the + Lisp 'error' function. */ /* In the FORMAT argument this function supports ` and ' as directives that output left and right quotes as per ‘text-quoting style’. It @@ -61,19 +64,21 @@ along with GNU Emacs. If not, see . */ %e means print a `double' argument in exponential notation. %f means print a `double' argument in decimal-point notation. %g means print a `double' argument in exponential notation - or in decimal-point notation, whichever uses fewer characters. + or in decimal-point notation, depending on the value; + this is often (though not always) the shorter of the two notations. %c means print a `signed int' argument as a single character. %% means produce a literal % character. - A %-sequence may contain optional flag, width, and precision specifiers, and - a length modifier, as follows: + A %-sequence other than %% may contain optional flags, width, precision, + and length, as follows: %character where flags is [+ -0], width is [0-9]+, precision is .[0-9]+, and length is empty or l or the value of the pD or pI or PRIdMAX (sans "d") macros. - Also, %% in a format stands for a single % in the output. A % that - does not introduce a valid %-sequence causes undefined behavior. + A % that does not introduce a valid %-sequence causes undefined behavior. + ASCII bytes in FORMAT other than % are copied through as-is; + non-ASCII bytes should not appear in FORMAT. The + flag character inserts a + before any positive number, while a space inserts a space before any positive number; these flags only affect %d, %o, @@ -99,7 +104,9 @@ along with GNU Emacs. If not, see . */ For %e, %f, and %g sequences, the number after the "." in the precision specifier says how many decimal places to show; if zero, the decimal point - itself is omitted. For %s and %S, the precision specifier is ignored. */ + itself is omitted. For %d, %o, and %x sequences, the precision specifies + the minimum number of digits to appear. Precision specifiers are + not supported for other %-sequences. */ #include #include @@ -115,7 +122,50 @@ along with GNU Emacs. If not, see . */ another macro. */ #include "character.h" +/* Enough to handle floating point formats with large numbers. */ +enum { SIZE_BOUND_EXTRA = DBL_MAX_10_EXP + 50 }; + +/* Parse FMT as an unsigned decimal integer, putting its value into *VALUE. + Return the address of the first byte after the integer. + If FMT is not an integer, return FMT and store zero into *VALUE. */ +static char const * +parse_format_integer (char const *fmt, int *value) +{ + int n = 0; + bool overflow = false; + for (; '0' <= *fmt && *fmt <= '9'; fmt++) + { + overflow |= INT_MULTIPLY_WRAPV (n, 10, &n); + overflow |= INT_ADD_WRAPV (n, *fmt - '0', &n); + } + if (overflow || min (PTRDIFF_MAX, SIZE_MAX) - SIZE_BOUND_EXTRA < n) + error ("Format width or precision too large"); + *value = n; + return fmt; +} + +/* Like doprnt, except FORMAT must not contain NUL bytes and + FORMAT_END must be non-null. Although this function is never + exercised in current Emacs, it is retained in case some future + Emacs version contains doprnt callers that need such formats. + Having a separate function helps GCC optimize doprnt better. */ +static ptrdiff_t +doprnt_nul (char *buffer, ptrdiff_t bufsize, char const *format, + char const *format_end, va_list ap) +{ + USE_SAFE_ALLOCA; + ptrdiff_t fmtlen = format_end - format; + char *fmt = SAFE_ALLOCA (fmtlen + 1); + memcpy (fmt, format, fmtlen); + fmt[fmtlen] = 0; + ptrdiff_t nbytes = doprnt (buffer, bufsize, fmt, NULL, ap); + SAFE_FREE (); + return nbytes; +} + /* Generate output from a format-spec FORMAT, + terminated at either the first NUL or (if FORMAT_END is non-null + and there are no NUL bytes between FORMAT and FORMAT_END) terminated at position FORMAT_END. (*FORMAT_END is not part of the format, but must exist and be readable.) Output goes in BUFFER, which has room for BUFSIZE chars. @@ -131,12 +181,12 @@ ptrdiff_t doprnt (char *buffer, ptrdiff_t bufsize, const char *format, const char *format_end, va_list ap) { + if (format_end && !memchr (format, 0, format_end - format)) + return doprnt_nul (buffer, bufsize, format, format_end, ap); + const char *fmt = format; /* Pointer into format string. */ char *bufptr = buffer; /* Pointer into output buffer. */ - /* Enough to handle floating point formats with large numbers. */ - enum { SIZE_BOUND_EXTRA = DBL_MAX_10_EXP + 50 }; - /* Use this for sprintf unless we need something really big. */ char tembuf[SIZE_BOUND_EXTRA + 50]; @@ -150,103 +200,91 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, char *big_buffer = NULL; enum text_quoting_style quoting_style = text_quoting_style (); - ptrdiff_t tem = -1; - char *string; - char fixed_buffer[20]; /* Default buffer for small formatting. */ - char *fmtcpy; - int minlen; - char charbuf[MAX_MULTIBYTE_LENGTH + 1]; /* Used for %c. */ - USE_SAFE_ALLOCA; - - if (format_end == 0) - format_end = format + strlen (format); - - fmtcpy = (format_end - format < sizeof (fixed_buffer) - 1 - ? fixed_buffer - : SAFE_ALLOCA (format_end - format + 1)); bufsize--; /* Loop until end of format string or buffer full. */ - while (fmt < format_end && bufsize > 0) + while (*fmt && bufsize > 0) { char const *fmt0 = fmt; char fmtchar = *fmt++; if (fmtchar == '%') { - ptrdiff_t size_bound = 0; ptrdiff_t width; /* Columns occupied by STRING on display. */ enum { pDlen = sizeof pD - 1, pIlen = sizeof pI - 1, - pMlen = sizeof PRIdMAX - 2 + pMlen = sizeof PRIdMAX - 2, + maxmlen = max (max (1, pDlen), max (pIlen, pMlen)) }; enum { no_modifier, long_modifier, pD_modifier, pI_modifier, pM_modifier } length_modifier = no_modifier; static char const modifier_len[] = { 0, 1, pDlen, pIlen, pMlen }; - int maxmlen = max (max (1, pDlen), max (pIlen, pMlen)); int mlen; + char charbuf[MAX_MULTIBYTE_LENGTH + 1]; /* Used for %c. */ - /* Copy this one %-spec into fmtcpy. */ - string = fmtcpy; + /* Width and precision specified by this %-sequence. */ + int wid = 0, prec = -1; + + /* FMTSTAR will be a "%*.*X"-like version of this %-sequence. + Start by putting '%' into FMTSTAR. */ + char fmtstar[sizeof "%-+ 0*.*d" + maxmlen]; + char *string = fmtstar; *string++ = '%'; - while (fmt < format_end) + + /* Copy at most one instance of each flag into FMTSTAR. */ + bool minusflag = false, plusflag = false, zeroflag = false, + spaceflag = false; + for (;; fmt++) { - *string++ = *fmt; - if ('0' <= *fmt && *fmt <= '9') + *string = *fmt; + switch (*fmt) { - /* Get an idea of how much space we might need. - This might be a field width or a precision; e.g. - %1.1000f and %1000.1f both might need 1000+ bytes. - Parse the width or precision, checking for overflow. */ - int n = *fmt - '0'; - bool overflow = false; - while (fmt + 1 < format_end - && '0' <= fmt[1] && fmt[1] <= '9') - { - overflow |= INT_MULTIPLY_WRAPV (n, 10, &n); - overflow |= INT_ADD_WRAPV (n, fmt[1] - '0', &n); - *string++ = *++fmt; - } - - if (overflow - || min (PTRDIFF_MAX, SIZE_MAX) - SIZE_BOUND_EXTRA < n) - error ("Format width or precision too large"); - if (size_bound < n) - size_bound = n; + case '-': string += !minusflag; minusflag = true; continue; + case '+': string += !plusflag; plusflag = true; continue; + case ' ': string += !spaceflag; spaceflag = true; continue; + case '0': string += !zeroflag; zeroflag = true; continue; } - else if (! (*fmt == '-' || *fmt == ' ' || *fmt == '.' - || *fmt == '+')) - break; - fmt++; + break; } + /* Parse width and precision, putting "*.*" into FMTSTAR. */ + if ('1' <= *fmt && *fmt <= '9') + fmt = parse_format_integer (fmt, &wid); + if (*fmt == '.') + fmt = parse_format_integer (fmt + 1, &prec); + *string++ = '*'; + *string++ = '.'; + *string++ = '*'; + /* Check for the length modifiers in textual length order, so that longer modifiers override shorter ones. */ for (mlen = 1; mlen <= maxmlen; mlen++) { - if (format_end - fmt < mlen) - break; if (mlen == 1 && *fmt == 'l') length_modifier = long_modifier; - if (mlen == pDlen && memcmp (fmt, pD, pDlen) == 0) + if (mlen == pDlen && strncmp (fmt, pD, pDlen) == 0) length_modifier = pD_modifier; - if (mlen == pIlen && memcmp (fmt, pI, pIlen) == 0) + if (mlen == pIlen && strncmp (fmt, pI, pIlen) == 0) length_modifier = pI_modifier; - if (mlen == pMlen && memcmp (fmt, PRIdMAX, pMlen) == 0) + if (mlen == pMlen && strncmp (fmt, PRIdMAX, pMlen) == 0) length_modifier = pM_modifier; } + /* Copy optional length modifier and conversion specifier + character into FMTSTAR, and append a NUL. */ mlen = modifier_len[length_modifier]; - memcpy (string, fmt + 1, mlen); - string += mlen; + string = mempcpy (string, fmt, mlen + 1); fmt += mlen; *string = 0; - /* Make the size bound large enough to handle floating point formats + /* An idea of how much space we might need. + This might be a field width or a precision; e.g. + %1.1000f and %1000.1f both might need 1000+ bytes. + Make it large enough to handle floating point formats with large numbers. */ - size_bound += SIZE_BOUND_EXTRA; + ptrdiff_t size_bound = max (wid, prec) + SIZE_BOUND_EXTRA; /* Make sure we have that much. */ if (size_bound > size_allocated) @@ -257,48 +295,49 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, sprintf_buffer = big_buffer; size_allocated = size_bound; } - minlen = 0; + int minlen = 0; + ptrdiff_t tem; switch (*fmt++) { default: - error ("Invalid format operation %s", fmtcpy); + error ("Invalid format operation %s", fmt0); -/* case 'b': */ - case 'l': case 'd': switch (length_modifier) { case no_modifier: { int v = va_arg (ap, int); - tem = sprintf (sprintf_buffer, fmtcpy, v); + tem = sprintf (sprintf_buffer, fmtstar, wid, prec, v); } break; case long_modifier: { long v = va_arg (ap, long); - tem = sprintf (sprintf_buffer, fmtcpy, v); + tem = sprintf (sprintf_buffer, fmtstar, wid, prec, v); } break; case pD_modifier: signed_pD_modifier: { ptrdiff_t v = va_arg (ap, ptrdiff_t); - tem = sprintf (sprintf_buffer, fmtcpy, v); + tem = sprintf (sprintf_buffer, fmtstar, wid, prec, v); } break; case pI_modifier: { EMACS_INT v = va_arg (ap, EMACS_INT); - tem = sprintf (sprintf_buffer, fmtcpy, v); + tem = sprintf (sprintf_buffer, fmtstar, wid, prec, v); } break; case pM_modifier: { intmax_t v = va_arg (ap, intmax_t); - tem = sprintf (sprintf_buffer, fmtcpy, v); + tem = sprintf (sprintf_buffer, fmtstar, wid, prec, v); } break; + default: + eassume (false); } /* Now copy into final output, truncating as necessary. */ string = sprintf_buffer; @@ -311,13 +350,13 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, case no_modifier: { unsigned v = va_arg (ap, unsigned); - tem = sprintf (sprintf_buffer, fmtcpy, v); + tem = sprintf (sprintf_buffer, fmtstar, wid, prec, v); } break; case long_modifier: { unsigned long v = va_arg (ap, unsigned long); - tem = sprintf (sprintf_buffer, fmtcpy, v); + tem = sprintf (sprintf_buffer, fmtstar, wid, prec, v); } break; case pD_modifier: @@ -325,15 +364,17 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, case pI_modifier: { EMACS_UINT v = va_arg (ap, EMACS_UINT); - tem = sprintf (sprintf_buffer, fmtcpy, v); + tem = sprintf (sprintf_buffer, fmtstar, wid, prec, v); } break; case pM_modifier: { uintmax_t v = va_arg (ap, uintmax_t); - tem = sprintf (sprintf_buffer, fmtcpy, v); + tem = sprintf (sprintf_buffer, fmtstar, wid, prec, v); } break; + default: + eassume (false); } /* Now copy into final output, truncating as necessary. */ string = sprintf_buffer; @@ -344,18 +385,15 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, case 'g': { double d = va_arg (ap, double); - tem = sprintf (sprintf_buffer, fmtcpy, d); + tem = sprintf (sprintf_buffer, fmtstar, wid, prec, d); /* Now copy into final output, truncating as necessary. */ string = sprintf_buffer; goto doit; } case 'S': - string[-1] = 's'; - FALLTHROUGH; case 's': - if (fmtcpy[1] != 's') - minlen = atoi (&fmtcpy[1]); + minlen = minusflag ? -wid : wid; string = va_arg (ap, char *); tem = strnlen (string, STRING_BYTES_BOUND + 1); if (tem == STRING_BYTES_BOUND + 1) @@ -432,14 +470,12 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, string = charbuf; string[tem] = 0; width = strwidth (string, tem); - if (fmtcpy[1] != 'c') - minlen = atoi (&fmtcpy[1]); + minlen = minusflag ? -wid : wid; goto doit1; } case '%': /* Treat this '%' as normal. */ - fmt0 = fmt - 1; break; } } @@ -450,13 +486,13 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, src = uLSQM, srclen = sizeof uLSQM - 1; else if (quoting_style == CURVE_QUOTING_STYLE && fmtchar == '\'') src = uRSQM, srclen = sizeof uRSQM - 1; - else if (quoting_style == STRAIGHT_QUOTING_STYLE && fmtchar == '`') - src = "'", srclen = 1; else { - while (fmt < format_end && !CHAR_HEAD_P (*fmt)) - fmt++; - src = fmt0, srclen = fmt - fmt0; + if (quoting_style == STRAIGHT_QUOTING_STYLE && fmtchar == '`') + fmtchar = '\''; + eassert (ASCII_CHAR_P (fmtchar)); + *bufptr++ = fmtchar; + continue; } if (bufsize < srclen) @@ -479,8 +515,6 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, xfree (big_buffer); *bufptr = 0; /* Make sure our string ends with a '\0' */ - - SAFE_FREE (); return bufptr - buffer; } -- cgit v1.2.3 From 28d2931b4bc934d06f449c01e067258d76a16738 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 24 Oct 2020 13:46:46 -0700 Subject: Rename doprnt_nul to doprnt_non_null_end * src/doprnt.c (doprnt_non_null_end): Rename from doprnt_nul, as the old name was misleading (left over from a previous proposal). Caller changed. --- src/doprnt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doprnt.c b/src/doprnt.c index 07c4d8d7977..be256f44974 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -150,8 +150,8 @@ parse_format_integer (char const *fmt, int *value) Emacs version contains doprnt callers that need such formats. Having a separate function helps GCC optimize doprnt better. */ static ptrdiff_t -doprnt_nul (char *buffer, ptrdiff_t bufsize, char const *format, - char const *format_end, va_list ap) +doprnt_non_null_end (char *buffer, ptrdiff_t bufsize, char const *format, + char const *format_end, va_list ap) { USE_SAFE_ALLOCA; ptrdiff_t fmtlen = format_end - format; @@ -182,7 +182,7 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, const char *format_end, va_list ap) { if (format_end && !memchr (format, 0, format_end - format)) - return doprnt_nul (buffer, bufsize, format, format_end, ap); + return doprnt_non_null_end (buffer, bufsize, format, format_end, ap); const char *fmt = format; /* Pointer into format string. */ char *bufptr = buffer; /* Pointer into output buffer. */ -- cgit v1.2.3 From 32e427cca112f5471356c1fa95ba1ed256d200b6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 24 Oct 2020 13:50:29 -0700 Subject: Minor doprnt cleanup: remove memchr call * src/doprnt.c (doprnt): Remove unnecessary call to memchr. --- src/doprnt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/doprnt.c b/src/doprnt.c index be256f44974..ce259d07cfe 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -144,10 +144,10 @@ parse_format_integer (char const *fmt, int *value) return fmt; } -/* Like doprnt, except FORMAT must not contain NUL bytes and - FORMAT_END must be non-null. Although this function is never - exercised in current Emacs, it is retained in case some future - Emacs version contains doprnt callers that need such formats. +/* Like doprnt, except FORMAT_END must be non-null. + Although this function is never exercised in current Emacs, + it is retained in case some future Emacs version + contains doprnt callers that need such formats. Having a separate function helps GCC optimize doprnt better. */ static ptrdiff_t doprnt_non_null_end (char *buffer, ptrdiff_t bufsize, char const *format, @@ -181,7 +181,7 @@ ptrdiff_t doprnt (char *buffer, ptrdiff_t bufsize, const char *format, const char *format_end, va_list ap) { - if (format_end && !memchr (format, 0, format_end - format)) + if (format_end) return doprnt_non_null_end (buffer, bufsize, format, format_end, ap); const char *fmt = format; /* Pointer into format string. */ -- cgit v1.2.3 From b6a41c76a5a4b95a1cf62d708e33e8b7472302aa Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 25 Oct 2020 00:51:23 +0200 Subject: Add shortdoc group for hash-table * lisp/emacs-lisp/shortdoc.el (hash-table): New shortdoc group. --- lisp/emacs-lisp/shortdoc.el | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 7ae6d53a21b..af17a7bf971 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -380,6 +380,37 @@ There can be any number of :example/:result elements." :no-eval (set-file-acl "/tmp/foo" "group::rxx") :eg-result t)) +(define-short-documentation-group hash-table + "Hash Table Basics" + (make-hash-table + :no-eval (make-hash-table) + :result-string "#s(hash-table ...)") + (puthash + :no-eval (puthash 'key "value" table)) + (gethash + :no-eval (gethash 'key table) + :eg-result "value") + (remhash + :no-eval (remhash 'key table) + :result nil) + (clrhash + :no-eval (clrhash table) + :result-string "#s(hash-table ...)") + (maphash + :no-eval (maphash (lambda (key value) (message value)) table) + :result nil) + "Other Hash Table Functions" + (hash-table-p + :eval (hash-table-p 123)) + (copy-hash-table + :no-eval (copy-hash-table table) + :result-string "#s(hash-table ...)") + (hash-table-count + :no-eval (hash-table-count table) + :eg-result 15) + (hash-table-size + :no-eval (hash-table-size table) + :eg-result 65)) (define-short-documentation-group list "Making Lists" -- cgit v1.2.3 From 10ea719abcde4f2ee40e717eb846fe93f51d5d79 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 25 Oct 2020 01:40:27 +0200 Subject: Add shortdoc group for alist * lisp/emacs-lisp/shortdoc.el (alist): New shortdoc group. --- lisp/emacs-lisp/shortdoc.el | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index af17a7bf971..acc7d13195e 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -78,6 +78,45 @@ There can be any number of :example/:result elements." shortdoc--groups)) (push (cons ',group ',functions) shortdoc--groups))) +(define-short-documentation-group alist + "Alist Basics" + (assoc + :eval (assoc 'foo '((foo . bar) (zot . baz)))) + (rassoc + :eval (rassoc 'bar '((foo . bar) (zot . baz)))) + (assq + :eval (assq 'foo '((foo . bar) (zot . baz)))) + (rassq + :eval (rassq 'bar '((foo . bar) (zot . baz)))) + (assoc-string + :eval (assoc-string "foo" '(("foo" . "bar") ("zot" "baz")))) + "Manipulating Alists" + (assoc-delete-all + :eval (assoc-delete-all "foo" '(("foo" . "bar") ("zot" . "baz")) #'equal)) + (assq-delete-all + :eval (assq-delete-all 'foo '((foo . bar) (zot . baz)))) + (rassq-delete-all + :eval (rassq-delete-all 'bar '((foo . bar) (zot . baz)))) + (alist-get + :eval (let ((foo '((bar . baz)))) + (setf (alist-get 'bar foo) 'zot) + foo)) + "Misc" + (assoc-default + :eval (assoc-default "foobar" '(("foo" . baz)) #'string-match)) + (copy-alist + :eval (let* ((old '((foo . bar))) + (new (copy-alist old))) + (eq old new))) + ;; FIXME: Outputs "\.rose" for the symbol `.rose'. + ;; (let-alist + ;; :eval (let ((colors '((rose . red) + ;; (lily . white)))) + ;; (let-alist colors + ;; (if (eq .rose 'red) + ;; .lily)))) + ) + (define-short-documentation-group string "Making Strings" (make-string -- cgit v1.2.3 From 71661b287297f328c2c5ad67e180a760f80850cb Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 24 Oct 2020 15:34:12 -0700 Subject: Use WebKit sandboxing * src/xwidget.c (Fmake_xwidget): Enable sandboxing if WebKit 2.26 or later. Do this early, as required for sandboxing (Bug#43071). Co-authored-by: Qiantan Hong Copyright-paperwork-exempt: yes --- src/xwidget.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xwidget.c b/src/xwidget.c index ea8987f5b3b..fb906d181ac 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -101,6 +101,13 @@ Returns the newly constructed xwidget, or nil if construction fails. */) if (EQ (xw->type, Qwebkit)) { block_input (); + WebKitWebContext *webkit_context = webkit_web_context_get_default (); + +# if WEBKIT_CHECK_VERSION (2, 26, 0) + if (!webkit_web_context_get_sandbox_enabled (webkit_context)) + webkit_web_context_set_sandbox_enabled (webkit_context, TRUE); +# endif + xw->widgetwindow_osr = gtk_offscreen_window_new (); gtk_window_resize (GTK_WINDOW (xw->widgetwindow_osr), xw->width, xw->height); @@ -139,7 +146,7 @@ Returns the newly constructed xwidget, or nil if construction fails. */) "load-changed", G_CALLBACK (webkit_view_load_changed_cb), xw); - g_signal_connect (G_OBJECT (webkit_web_context_get_default ()), + g_signal_connect (G_OBJECT (webkit_context), "download-started", G_CALLBACK (webkit_download_cb), xw); -- cgit v1.2.3 From 2e090da77591c1e0f59815a34e2a4059f418c776 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sun, 25 Oct 2020 10:59:11 +0100 Subject: Revert commit 1f44a776729adf9c6468a76f8310616fde62eeaa for Flymake. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flymake supports all Emacs versions back to 26.1, so it can’t use ‘ert-resource-file’. * test/lisp/progmodes/flymake-tests.el (flymake-tests-data-directory): Recreate. (flymake-tests--call-with-fixture): Stop using ‘ert-resource-file’. --- test/lisp/progmodes/flymake-tests.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index c62a2dbde13..df72b523a9d 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -23,10 +23,17 @@ ;;; Code: (require 'ert) -(require 'ert-x) (require 'flymake) (eval-when-compile (require 'subr-x)) ; string-trim +(defvar flymake-tests-data-directory + (expand-file-name "lisp/progmodes/flymake-resources" + (or (getenv "EMACS_TEST_DIRECTORY") + (expand-file-name "../../.." + (or load-file-name + buffer-file-name)))) + "Directory containing flymake test data.") + ;; ;; @@ -56,7 +63,7 @@ "Call FN after flymake setup in FILE, using `flymake-proc`. SEVERITY-PREDICATE is used to setup `flymake-proc-diagnostic-type-pred'" - (let* ((file (ert-resource-file file)) + (let* ((file (expand-file-name file flymake-tests-data-directory)) (visiting (find-buffer-visiting file)) (buffer (or visiting (find-file-noselect file))) (process-environment (cons "LC_ALL=C" process-environment)) -- cgit v1.2.3 From e73e7a8bd6782b24045ea64aa9147bee5f44d65d Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sun, 25 Oct 2020 11:24:11 +0100 Subject: Revert commit 1f44a776729adf9c6468a76f8310616fde62eeaa for XRef. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit XRef supports Emacs versions back to Emacs 26.3, so it can’t use newer functions such as ‘ert-resource-directory’. * test/lisp/progmodes/xref-tests.el (xref-tests-data-dir): Don’t use ‘ert-resource-directory’ --- test/lisp/progmodes/xref-tests.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/lisp/progmodes/xref-tests.el b/test/lisp/progmodes/xref-tests.el index 060c9cb5d1c..038f9d0e304 100644 --- a/test/lisp/progmodes/xref-tests.el +++ b/test/lisp/progmodes/xref-tests.el @@ -24,11 +24,13 @@ ;;; Code: (require 'ert) -(require 'ert-x) (require 'xref) (require 'cl-lib) -(defvar xref-tests-data-dir (ert-resource-directory)) +(defvar xref-tests-data-dir + (expand-file-name "xref-resources/" + (file-name-directory + (or load-file-name buffer-file-name)))) (ert-deftest xref-matches-in-directory-finds-none-for-some-regexp () (should (null (xref-matches-in-directory "zzz" "*" xref-tests-data-dir nil)))) -- cgit v1.2.3 From e2005f1f2a7d7b743c79057565729375797c13ce Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 25 Oct 2020 12:44:01 +0100 Subject: * INSTALL: Mention efaq.texi for installation of intlfonts. --- INSTALL | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 2d257f9ce68..4d65f302aac 100644 --- a/INSTALL +++ b/INSTALL @@ -147,7 +147,9 @@ lisp/ps-mule.el defines the *.bdf font files required for printing each character set. The intlfonts distribution contains its own installation instructions, -in the intlfonts/README file. +in the intlfonts/README file. See also the Emacs Frequently Asked +Questions info pages "(efaq) How to add fonts" for installation +instructions. * Image support libraries -- cgit v1.2.3 From b0a7a19d5ddef9887032fe3c2f943e6b6545f253 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 25 Oct 2020 14:34:47 +0100 Subject: Fix problem when replacing the final char in checkdoc * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-ask-replace): Ensure that the end-of-doc-string marker is really at the end, even if we replace the final " char in the string (bug#44201). --- lisp/emacs-lisp/checkdoc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 23121c245ef..a485378a926 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2589,7 +2589,7 @@ This function will not modify `match-data'." ;; going on. (if checkdoc-bouncy-flag (message "%s -> done" question)) (delete-region start end) - (insert replacewith) + (insert-before-markers replacewith) (if checkdoc-bouncy-flag (sit-for 0)) (setq ret t))) (delete-overlay o) -- cgit v1.2.3 From 35df337979e5e719c12cb80dd6a5dbda5f46b56d Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 25 Oct 2020 15:16:05 +0100 Subject: Fix syntax error in message-add-openpgp-header * lisp/gnus/message.el (message-add-openpgp-header): Remove redundant (and syntactically wrong) check. --- lisp/gnus/message.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 150f70e240f..0782778fd43 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -2788,9 +2788,7 @@ Consider adding this function to `message-header-setup-hook'" ;; add URL (when (nth 1 message-openpgp-header) (when need-sep (insert "; ")) - (if (string-match-p ";") - (insert "url=\"" (nth 1 message-openpgp-header) "\"") - (insert "url=\"" (nth 1 message-openpgp-header) "\"")) + (insert "url=\"" (nth 1 message-openpgp-header) "\"") (setq need-sep t)) ;; add preference (when (nth 2 message-openpgp-header) -- cgit v1.2.3 From 7276723630f93878762d474b0a5adda4251191bd Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Sun, 25 Oct 2020 16:41:31 +0100 Subject: Better file name in dynvars-check example * doc/lispref/variables.texi (Converting to Lexical Binding): Don't suggest an aggregate file name that matches the glob used when generating it. --- doc/lispref/variables.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 394fb96acbe..095ea9dce24 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1317,9 +1317,9 @@ a Unix shell and @command{make} are used for byte-compilation: @example $ rm *.elc # force recompilation $ EMACS_GENERATE_DYNVARS=1 make # generate .dynvars -$ cat *.dynvars > ~/my.dynvars # combine .dynvars +$ cat *.dynvars > ~/my-dynvars # combine .dynvars $ rm *.elc # force recompilation -$ EMACS_DYNVARS_FILE=~/my.dynvars make # perform checks +$ EMACS_DYNVARS_FILE=~/my-dynvars make # perform checks @end example @node Buffer-Local Variables -- cgit v1.2.3 From 8164f3e1ab3ca8d28f782407ab8daf086a624d1a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 25 Oct 2020 18:05:37 +0200 Subject: Improve support for shaping Egyptian Hieroglyphs * src/composite.c (composition_gstring_lookup_cache): Renamed from gstring_lookup_cache and made external. All callers changed. * src/composite.h (composition_gstring_lookup_cache): Add prototype. * src/font.c (Ffont_shape_gstring): Call composition_gstring_lookup_cache and return the cached composition if it is already in the cache. * lisp/language/misc-lang.el (egyptian-shape-grouping): New function. (composition-function-table): Use egyptian-shape-grouping in setting up compositions for Egyptian Hieroglyphs. Fix the composition setup for horizontal and vertical joiners. --- lisp/language/misc-lang.el | 49 +++++++++++++++++++++++++++++++++++++++++----- src/composite.c | 8 +++----- src/composite.h | 1 + src/font.c | 4 ++++ 4 files changed, 52 insertions(+), 10 deletions(-) diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index 3f45f70c45e..089b79c5208 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -149,11 +149,50 @@ thin (i.e. 1-dot width) space." ;; Hieroglyphs in "quadrats", as directed by the format controls, ;; which specify how the hieroglyphs should be joined horizontally and ;; vertically. -(set-char-table-range - composition-function-table - '(#x13000 . #x1343F) - (list (vector "[\U00013000-\U0001343F]+" - 0 'compose-gstring-for-graphic))) +(defun egyptian-shape-grouping (gstring direction) + (if (= (lgstring-char gstring 0) #x13437) + (let ((nchars (lgstring-char-len gstring)) + (i 1) + (nesting 1) + ch) + ;; Find where this group ends. + (while (and (< i nchars) (> nesting 0)) + (setq ch (lgstring-char gstring i)) + (cond + ((= ch #x13437) + (setq nesting (1+ nesting))) + ((= ch #x13438) + (setq nesting (1- nesting)))) + (setq i (1+ i))) + (when (zerop nesting) + ;; Make a new gstring from the characters that constitute a + ;; complete nested group. + (let ((new-header (make-vector (1+ i) nil)) + (new-gstring (make-vector (+ i 2) nil))) + (aset new-header 0 (lgstring-font gstring)) + (dotimes (j i) + (aset new-header (1+ j) (lgstring-char gstring j)) + (lgstring-set-glyph new-gstring j (lgstring-glyph gstring j))) + (lgstring-set-header new-gstring new-header) + (font-shape-gstring new-gstring direction)))))) + +(let ((hieroglyph "[\U00013000-\U0001342F]")) + ;; HORIZONTAL/VERTICAL JOINER and INSERT AT.../OVERLAY controls + (set-char-table-range + composition-function-table + '(#x13430 . #x13436) + (list (vector (concat hieroglyph "[\U00013430-\U00013436]" hieroglyph) + ;; We use font-shape-gstring so that, if the font + ;; doesn't support these controls, the glyphs are + ;; displayed individually, and not as a single + ;; grapheme cluster. + 1 'font-shape-gstring))) + ;; Grouping controls + (set-char-table-range + composition-function-table + #x13437 + (list (vector "\U00013437[\U00013000-\U0001343F]+" + 0 'egyptian-shape-grouping)))) (provide 'misc-lang) diff --git a/src/composite.c b/src/composite.c index 984e0d9cda8..90f8536b2de 100644 --- a/src/composite.c +++ b/src/composite.c @@ -637,10 +637,8 @@ compose_text (ptrdiff_t start, ptrdiff_t end, Lisp_Object components, static Lisp_Object gstring_hash_table; -static Lisp_Object gstring_lookup_cache (Lisp_Object); - -static Lisp_Object -gstring_lookup_cache (Lisp_Object header) +Lisp_Object +composition_gstring_lookup_cache (Lisp_Object header) { struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table); ptrdiff_t i = hash_lookup (h, header, NULL); @@ -1781,7 +1779,7 @@ should be ignored. */) header = fill_gstring_header (frompos, frombyte, topos, font_object, string); - gstring = gstring_lookup_cache (header); + gstring = composition_gstring_lookup_cache (header); if (! NILP (gstring)) return gstring; diff --git a/src/composite.h b/src/composite.h index 239f1e531ef..d39fdbaae05 100644 --- a/src/composite.h +++ b/src/composite.h @@ -330,6 +330,7 @@ extern int composition_update_it (struct composition_it *, ptrdiff_t, ptrdiff_t, Lisp_Object); extern ptrdiff_t composition_adjust_point (ptrdiff_t, ptrdiff_t); +extern Lisp_Object composition_gstring_lookup_cache (Lisp_Object); INLINE_HEADER_END diff --git a/src/font.c b/src/font.c index fe257f47dc3..f7c4c816b5d 100644 --- a/src/font.c +++ b/src/font.c @@ -4461,6 +4461,10 @@ GSTRING. */) signal_error ("Invalid glyph-string: ", gstring); if (! NILP (LGSTRING_ID (gstring))) return gstring; + Lisp_Object cached_gstring = + composition_gstring_lookup_cache (LGSTRING_HEADER (gstring)); + if (! NILP (cached_gstring)) + return cached_gstring; font_object = LGSTRING_FONT (gstring); CHECK_FONT_OBJECT (font_object); font = XFONT_OBJECT (font_object); -- cgit v1.2.3 From 158d2a1f50cfe233af83aa93501f51c9986918f3 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 20 Oct 2020 19:31:40 +0200 Subject: Remove some Emacs 19 compat code and references * lisp/progmodes/sql.el: * lisp/mh-e/mh-show.el (mh-display-msg): Remove Emacs 19 compat code. * lisp/emacs-lisp/edebug.el (edebug-mark-marker): Make into obsolete alias for mark-marker. (edebug--display-1, edebug-bounce-point) (edebug-outside-excursion): Adjust callers. * lisp/net/snmp-mode.el: * lisp/forms.el: Remove references to Emacs 19. (forms-use-text-properties): Doc fix. --- lisp/emacs-lisp/edebug.el | 17 ++++++++--------- lisp/forms.el | 10 ++++------ lisp/mh-e/mh-show.el | 3 +-- lisp/net/snmp-mode.el | 4 +--- lisp/progmodes/sql.el | 3 --- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index f10dc13fa07..fe733630bad 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2665,9 +2665,6 @@ See `edebug-behavior-alist' for implementations.") (defvar edebug-previous-result nil) ;; Last result returned. -;; Emacs 19 adds an arg to mark and mark-marker. -(defalias 'edebug-mark-marker 'mark-marker) - (defun edebug--display (value offset-index arg-mode) ;; edebug--display-1 is too big, we should split it. This function ;; here was just introduced to avoid making edebug--display-1 @@ -2895,8 +2892,8 @@ See `edebug-behavior-alist' for implementations.") ;; But don't restore point if edebug-buffer is current buffer. (if (not (eq edebug-buffer edebug-outside-buffer)) (goto-char edebug-outside-point)) - (if (marker-buffer (edebug-mark-marker)) - (set-marker (edebug-mark-marker) edebug-outside-mark)) + (if (marker-buffer (mark-marker)) + (set-marker (mark-marker) edebug-outside-mark)) )) ; unwind-protect ;; None of the following is done if quit or signal occurs. @@ -3153,8 +3150,8 @@ before returning. The default is one second." (goto-char edebug-outside-point) (message "Current buffer: %s Point: %s Mark: %s" (current-buffer) (point) - (if (marker-buffer (edebug-mark-marker)) - (marker-position (edebug-mark-marker)) "")) + (if (marker-buffer (mark-marker)) + (marker-position (mark-marker)) "")) (sit-for arg) (edebug-pop-to-buffer edebug-buffer (car edebug-window-data))))) @@ -3725,8 +3722,8 @@ Return the result of the last expression." ;; for us. (with-current-buffer edebug-outside-buffer ; of edebug-buffer (goto-char edebug-outside-point) - (if (marker-buffer (edebug-mark-marker)) - (set-marker (edebug-mark-marker) edebug-outside-mark)) + (if (marker-buffer (mark-marker)) + (set-marker (mark-marker) edebug-outside-mark)) ,@body) ;; Back to edebug-buffer. Restore rest of inside context. @@ -4667,5 +4664,7 @@ instrumentation for, defaulting to all functions." (message "Removed edebug instrumentation from %s" (mapconcat #'symbol-name functions ", "))) +(define-obsolete-function-alias 'edebug-mark-marker #'mark-marker "28.1") + (provide 'edebug) ;;; edebug.el ends here diff --git a/lisp/forms.el b/lisp/forms.el index e9242ce4cb8..8974f99ef57 100644 --- a/lisp/forms.el +++ b/lisp/forms.el @@ -168,10 +168,9 @@ ;; modified (using text-property `read-only'). ;; Also, the read-write fields are shown using a ;; distinct face, if possible. -;; As of emacs 19.29, the `intangible' text property -;; is used to prevent moving into read-only fields. -;; This variable defaults to t if running Emacs 19 or -;; later with text properties. +;; The `intangible' text property is used to +;; prevent moving into read-only fields. +;; This variable defaults to t. ;; The default face to show read-write fields is ;; copied from face `region'. ;; @@ -363,8 +362,7 @@ This variable is for use by the filter routines only. The contents may NOT be modified.") (defcustom forms-use-text-properties t - "Non-nil means: use text properties. -Defaults to t if this Emacs is capable of handling text properties." + "Non-nil means to use text properties. " :group 'forms :type 'boolean) diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index 3c07d426b7d..04551acd143 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el @@ -219,8 +219,7 @@ Sets the current buffer to the show buffer." (erase-buffer) ;; Changing contents, so this hook needs to be reinitialized. ;; pgp.el uses this. - (if (boundp 'write-contents-hooks) ;Emacs 19 - (kill-local-variable 'write-contents-hooks)) + (kill-local-variable 'write-contents-hooks) (font-lock-mode -1) (mh-show-mode) (if formfile diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el index 441e6b14f7b..76d9ced58a6 100644 --- a/lisp/net/snmp-mode.el +++ b/lisp/net/snmp-mode.el @@ -24,9 +24,7 @@ ;; INTRODUCTION ;; ------------ -;; This package provides a major mode for editing SNMP MIBs. It -;; provides all the modern Emacs 19 bells and whistles: default -;; fontification via font-lock, imenu search functions, etc. +;; This package provides a major mode for editing SNMP MIBs. ;; ;; SNMP mode also uses tempo, a textual boilerplate insertion package ;; distributed with Emacs, to add in boilerplate SNMP MIB structures. diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index bfef2a663a0..6b0df2d700d 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -232,9 +232,6 @@ (require 'cl-lib) (require 'comint) -;; Need the following to allow GNU Emacs 19 to compile the file. -(eval-when-compile - (require 'regexp-opt)) (require 'custom) (require 'thingatpt) (require 'view) -- cgit v1.2.3 From a98bb620c4b4f483694239067b258242c5c7316e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 25 Oct 2020 19:18:27 +0100 Subject: Add section "Replacing Match" to the regexp shortdoc group * lisp/emacs-lisp/shortdoc.el (regexp): New section "Replacing Match". --- lisp/emacs-lisp/shortdoc.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index acc7d13195e..6cb7aa0282b 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -646,6 +646,13 @@ There can be any number of :example/:result elements." (looking-at-p :no-eval (looking-at "f[0-9]") :eg-result t) + "Replacing Match" + (replace-match + :no-eval (replace-match "new") + :eg-result nil) + (match-substitute-replacement + :no-eval (match-substitute-replacement "new") + :eg-result "new") "Utilities" (regexp-quote :eval (regexp-quote "foo.*bar")) -- cgit v1.2.3 From cdb3c9d662c772ce25ea4d803eccd2c9e6a6ae99 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Mon, 26 Oct 2020 12:40:51 +0100 Subject: Don't consider play-sound-file to be a 'safe' function (bug#44018) While there are currently no known security holes in play-sound-file, the attack surface is considerable and historically audio file processing has had more than its share of security problems; the benefit to risk ratio is low. * lisp/emacs-lisp/unsafep.el: Don't mark play-sound-file as safe. --- lisp/emacs-lisp/unsafep.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el index e7077140e54..96db5c71939 100644 --- a/lisp/emacs-lisp/unsafep.el +++ b/lisp/emacs-lisp/unsafep.el @@ -101,7 +101,7 @@ in the parse.") ;;Macros from subr.el save-match-data unless when ;;Functions from subr.el that have side effects - split-string replace-regexp-in-string play-sound-file)) + split-string replace-regexp-in-string)) (put x 'safe-function t)) ;;;###autoload -- cgit v1.2.3 From 20c02e628cb6126457e675d824d51ad4286c7c7a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 26 Oct 2020 18:01:13 +0200 Subject: Improve documentation of display-fill-column-indicator * lisp/display-fill-column-indicator.el (display-fill-column-indicator-mode): Mention the globalized version in the doc string. * doc/emacs/display.texi (Displaying Boundaries): Improve and clarify the documentation of display-fill-column-indicator. Suggest using the minor mode as the primary means for turning the feature on. * src/xdisp.c (syms_of_xdisp) : Doc fix. (Bug#44226) --- doc/emacs/display.texi | 51 ++++++++++++++++++----------------- lisp/display-fill-column-indicator.el | 2 ++ src/xdisp.c | 6 +++-- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index a4040d986e1..ed2fa8bf710 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -1173,31 +1173,34 @@ right-to-left paragraphs. @cindex mode, display-fill-column-indicator @findex display-fill-column-indicator-mode @findex global-display-fill-column-indicator-mode - Emacs can add an indicator to display a fill column position. The -fill column indicator is a useful functionality especially in -@code{prog-mode} to indicate the position of a specific column. + Emacs can display an indication of the @code{fill-column} position +(@pxref{Fill Commands}). The fill-column indicator is a useful +functionality especially in @code{prog-mode} and its descendants +(@pxref{Major Modes}) to indicate the position of a specific column +that has some special meaning for formatting the source code of a +program. + + To activate the fill-column indication display, use the minor modes +@w{@kbd{M-x display-fill-column-indicator-mode}} and +@w{@kbd{M-x global-display-fill-column-indicator-mode}}, which enable +the indicator locally or globally, respectively. - You can set the buffer-local variables +Alternatively, you can set the two buffer-local variables @code{display-fill-column-indicator} and @code{display-fill-column-indicator-character} to activate the -indicator and control how it looks, respectively. +indicator and control the character used for the indication. Note +that both variables must be non-@code{nil} for the indication to be +displayed. (Turning on the minor mode sets both these variables.) -Alternatively you can type @w{@kbd{M-x display-fill-column-indicator-mode}} -or @w{@kbd{M-x global-display-fill-column-indicator-mode}} which -enables the indicator locally or globally, respectively, and also -chooses the character to use if none is already set. It is possible -to use the first one to activate the indicator in a hook and the -second one to enable it globally. - -There are 2 buffer local variables and 1 face to customize this mode: +There are 2 buffer local variables and a face to customize this mode: @table @code @item display-fill-column-indicator-column @vindex display-fill-column-indicator-column Specifies the column number where the indicator should be set. It can -take positive numerical values for the column or the special value -@code{t} which means that the variable @code{fill-column} will be -used. +take positive numerical values for the column, or the special value +@code{t}, which means that the value of the variable +@code{fill-column} will be used. Any other value disables the indicator. The default value is @code{t}. @@ -1205,18 +1208,18 @@ Any other value disables the indicator. The default value is @code{t}. @vindex display-fill-column-indicator-character Specifies the character used for the indicator. This character can be any valid character including Unicode ones if the font supports them. - -When the mode is enabled through the functions -@code{display-fill-column-indicator-mode} or -@code{global-display-fill-column-indicator-mode}, the initialization -functions check if this variable is non-@code{nil}, otherwise the -initialization tries to set it to @code{U+2502} or @samp{|}. +The value @code{nil} disables the indicator. When the mode is enabled +through the functions @code{display-fill-column-indicator-mode} or +@code{global-display-fill-column-indicator-mode}, they will use the +character specified by this variable, if it is non-@code{nil}; +otherwise Emacs will use the character @samp{U+2502 VERTICAL LINE}, +falling back to @samp{|} if @code{U+2502} cannot be displayed. @item fill-column-indicator @vindex fill-column-indicator Specifies the face used to display the indicator. It inherits its -default values from the face @code{shadow} but without background -color. To change the indicator color you need only set the foreground +default values from the face @code{shadow}, but without background +color. To change the indicator color, you need only set the foreground color of this face. @end table diff --git a/lisp/display-fill-column-indicator.el b/lisp/display-fill-column-indicator.el index 3391aa371b7..2013fb13abd 100644 --- a/lisp/display-fill-column-indicator.el +++ b/lisp/display-fill-column-indicator.el @@ -51,6 +51,8 @@ This uses `display-fill-column-indicator' internally. To change the position of the column displayed by default customize `display-fill-column-indicator-column'. You can change the character for the indicator setting `display-fill-column-indicator-character'. +The globalized version is `global-display-fill-column-indicator-mode', +which see. See Info node `Displaying Boundaries' for details." :lighter nil (if display-fill-column-indicator-mode diff --git a/src/xdisp.c b/src/xdisp.c index 03dc4bec712..6c14a9a7b9d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -35025,6 +35025,8 @@ It has no effect when set to 0, or when line numbers are not absolute. */); DEFVAR_BOOL ("display-fill-column-indicator", Vdisplay_fill_column_indicator, doc: /* Non-nil means display the fill column indicator. +If you set this non-nil, make sure `display-fill-column-indicator-character' +is also non-nil. See Info node `Displaying Boundaries' for details. */); Vdisplay_fill_column_indicator = false; DEFSYM (Qdisplay_fill_column_indicator, "display-fill-column-indicator"); @@ -35042,8 +35044,8 @@ See Info node `Displaying Boundaries' for details. */); DEFVAR_LISP ("display-fill-column-indicator-character", Vdisplay_fill_column_indicator_character, doc: /* Character to draw the indicator when `display-fill-column-indicator' is non-nil. -The default is U+2502 but a good alternative is (ascii 124) -if the font in fill-column-indicator face does not support Unicode characters. +A good candidate is U+2502, and an alternative is (ascii 124) if the +font of `fill-column-indicator' face does not support Unicode characters. See Info node `Displaying Boundaries' for details. */); Vdisplay_fill_column_indicator_character = Qnil; DEFSYM (Qdisplay_fill_column_indicator_character, "display-fill-column-indicator-character"); -- cgit v1.2.3 From 27910f4e96304444704455ea6ce7141a3c2abcc3 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Mon, 26 Oct 2020 17:10:06 +0100 Subject: Revert "Don't consider play-sound-file to be a 'safe' function (bug#44018)" This reverts commit cdb3c9d662c772ce25ea4d803eccd2c9e6a6ae99. --- lisp/emacs-lisp/unsafep.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el index 96db5c71939..e7077140e54 100644 --- a/lisp/emacs-lisp/unsafep.el +++ b/lisp/emacs-lisp/unsafep.el @@ -101,7 +101,7 @@ in the parse.") ;;Macros from subr.el save-match-data unless when ;;Functions from subr.el that have side effects - split-string replace-regexp-in-string)) + split-string replace-regexp-in-string play-sound-file)) (put x 'safe-function t)) ;;;###autoload -- cgit v1.2.3 From 634bbb61f2f1b3e0fdf830f58a7ec7e39ea5a14f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 26 Oct 2020 18:14:32 +0200 Subject: Avoid segfaults due to using fonts that were closed * src/composite.c (composition_gstring_cache_clear_font): New function. * src/composite.h (composition_gstring_cache_clear_font): Add prototype. * src/font.c (font_clear_cache): When we are about to close a font, remove from the gstring cache any lgstring that uses this font. (Bug#42943) --- src/composite.c | 21 +++++++++++++++++++++ src/composite.h | 2 ++ src/font.c | 5 +++++ 3 files changed, 28 insertions(+) diff --git a/src/composite.c b/src/composite.c index 90f8536b2de..66c1e86aae1 100644 --- a/src/composite.c +++ b/src/composite.c @@ -677,6 +677,27 @@ composition_gstring_from_id (ptrdiff_t id) return HASH_VALUE (h, id); } +/* Remove from the composition hash table every lgstring that + references the given FONT_OBJECT. */ +void +composition_gstring_cache_clear_font (Lisp_Object font_object) +{ + struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table); + + for (ptrdiff_t i = 0; i < HASH_TABLE_SIZE (h); ++i) + { + Lisp_Object k = HASH_KEY (h, i); + + if (!EQ (k, Qunbound)) + { + Lisp_Object gstring = HASH_VALUE (h, i); + + if (EQ (LGSTRING_FONT (gstring), font_object)) + hash_remove_from_table (h, k); + } + } +} + DEFUN ("clear-composition-cache", Fclear_composition_cache, Sclear_composition_cache, 0, 0, 0, doc: /* Internal use only. diff --git a/src/composite.h b/src/composite.h index d39fdbaae05..bdf63fed10e 100644 --- a/src/composite.h +++ b/src/composite.h @@ -332,6 +332,8 @@ extern int composition_update_it (struct composition_it *, extern ptrdiff_t composition_adjust_point (ptrdiff_t, ptrdiff_t); extern Lisp_Object composition_gstring_lookup_cache (Lisp_Object); +extern void composition_gstring_cache_clear_font (Lisp_Object); + INLINE_HEADER_END #endif /* not EMACS_COMPOSITE_H */ diff --git a/src/font.c b/src/font.c index f7c4c816b5d..8dbf8cb8999 100644 --- a/src/font.c +++ b/src/font.c @@ -2645,6 +2645,11 @@ font_clear_cache (struct frame *f, Lisp_Object cache, if (! NILP (AREF (val, FONT_TYPE_INDEX))) { eassert (font && driver == font->driver); + /* We are going to close the font, so make + sure we don't have any lgstrings lying + around in lgstring cache that reference + the font. */ + composition_gstring_cache_clear_font (val); driver->close_font (font); } } -- cgit v1.2.3 From d23e483cfb51bc25193f5725bbc67b92f9dc200f Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 26 Oct 2020 13:12:34 +0100 Subject: Tweak how shortdocs are displayed * lisp/emacs-lisp/shortdoc.el (shortdoc-example): Removed. (shortdoc-section): Remove colors. (shortdoc-separator): New face. (shortdoc-display-group, shortdoc--display-function): Don't use background colours, because that makes things harder to read. Separate with a horizontal line instead. --- lisp/emacs-lisp/shortdoc.el | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 6cb7aa0282b..a2e5ce6e29a 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -31,19 +31,17 @@ "Short documentation." :group 'lisp) -(defface shortdoc-section +(defface shortdoc-separator '((((class color) (background dark)) - :inherit variable-pitch :background "#303030" :extend t) + :height 0.1 :background "#505050" :extend t) (((class color) (background light)) - :inherit variable-pitch :background "#f0f0f0" :extend t)) - "Face used for a section.") + :height 0.1 :background "#a0a0a0" :extend t) + (t :height 0.1 :inverse-video t :extend t)) + "Face used to separate sections.") -(defface shortdoc-example - '((((class color) (background dark)) - :background "#202020" :extend t) - (((class color) (background light)) - :background "#e8e8e8" :extend t)) - "Face used for examples.") +(defface shortdoc-section + '((t :inherit variable-pitch)) + "Face used for a section.") (defvar shortdoc--groups nil) @@ -1040,7 +1038,8 @@ There can be any number of :example/:result elements." (unless (assq group shortdoc--groups) (error "No such documentation group %s" group)) (pop-to-buffer (format "*Shortdoc %s*" group)) - (let ((inhibit-read-only t)) + (let ((inhibit-read-only t) + (prev nil)) (erase-buffer) (special-mode) (button-mode) @@ -1048,11 +1047,17 @@ There can be any number of :example/:result elements." (lambda (data) (cond ((stringp data) + (setq prev nil) + (unless (bobp) + (insert "\n")) (insert (propertize (concat data "\n\n") 'face '(variable-pitch (:height 1.3 :weight bold))))) ;; There may be functions not yet defined in the data. ((fboundp (car data)) + (when prev + (insert (propertize "\n" 'face 'shortdoc-separator))) + (setq prev t) (shortdoc--display-function data)))) (cdr (assq group shortdoc--groups)))) (goto-char (point-min))) @@ -1078,8 +1083,7 @@ There can be any number of :example/:result elements." (car (split-string (documentation function) "\n")))) (insert "\n") (add-face-text-property start-section (point) 'shortdoc-section t) - (let ((start (point)) - (print-escape-newlines t) + (let ((print-escape-newlines t) (double-arrow (if (char-displayable-p ?⇒) "⇒" "=>")) @@ -1134,9 +1138,7 @@ There can be any number of :example/:result elements." (:eg-result-string (insert " eg. " double-arrow " ") (princ value (current-buffer)) - (insert "\n")))) - (put-text-property start (point) 'face 'shortdoc-example)) - (insert "\n") + (insert "\n"))))) ;; Insert the arglist after doing the evals, in case that's pulled ;; in the function definition. (save-excursion -- cgit v1.2.3 From 9e8fb4a7cb7d2e460557dfc88d82b289df809a27 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 26 Oct 2020 15:14:53 +0100 Subject: Make delete-selection-helper more resilient * lisp/delsel.el (delete-selection-helper): Don't bug out on `C-g' (bug#40357). --- lisp/delsel.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/delsel.el b/lisp/delsel.el index 16886dfdb12..df2adc7aeba 100644 --- a/lisp/delsel.el +++ b/lisp/delsel.el @@ -217,6 +217,10 @@ With ARG, repeat that many times. `C-u' means until end of buffer." (self-insert-command (prefix-numeric-value current-prefix-arg)) (setq this-command 'ignore))))) + ;; If the user has quit here (for instance, if the user is + ;; presented with a "changed on disk; really edit the buffer?" + ;; prompt, but hit `C-g'), just ding. + (quit (ding)) ;; If ask-user-about-supersession-threat signals an error, ;; stop safe_run_hooks from clearing out pre-command-hook. (file-supersession (message "%s" (cadr data)) (ding)) -- cgit v1.2.3 From b8b18cf34a04af0f359e01c29333d58848307a13 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 26 Oct 2020 19:13:14 +0100 Subject: Implement a :predicate parameter for globalized minor modes * doc/lispref/modes.texi (Defining Minor Modes): Describe the new :predicate keyword (bug#44232). * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Allow a new :predicate keyword. (easy-mmode--globalized-predicate-p): New function. --- doc/lispref/modes.texi | 41 ++++++++++-- etc/NEWS | 5 ++ lisp/emacs-lisp/easy-mmode.el | 105 +++++++++++++++++++++++++------ test/lisp/emacs-lisp/easy-mmode-tests.el | 49 +++++++++++++++ 4 files changed, 177 insertions(+), 23 deletions(-) create mode 100644 test/lisp/emacs-lisp/easy-mmode-tests.el diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 022eda0bec8..98aa94e90d4 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1806,10 +1806,11 @@ don't need any. @defmac define-globalized-minor-mode global-mode mode turn-on keyword-args@dots{} body@dots{} This defines a global toggle named @var{global-mode} whose meaning is -to enable or disable the buffer-local minor mode @var{mode} in all -buffers. It also executes the @var{body} forms. To turn on the minor -mode in a buffer, it uses the function @var{turn-on}; to turn off the -minor mode, it calls @var{mode} with @minus{}1 as argument. +to enable or disable the buffer-local minor mode @var{mode} in all (or +some; see below) buffers. It also executes the @var{body} forms. To +turn on the minor mode in a buffer, it uses the function +@var{turn-on}; to turn off the minor mode, it calls @var{mode} with +@minus{}1 as argument. Globally enabling the mode also affects buffers subsequently created by visiting files, and buffers that use a major mode other than @@ -1830,6 +1831,38 @@ also define a non-globalized version, so that people can use (or disable) it in individual buffers. This also allows them to disable a globally enabled minor mode in a specific major mode, by using that mode's hook. + +If given a @code{:predicate} keyword, a user option called the same as +the global mode variable, but with @code{-modes} instead of +@code{-mode} at the end will be created. The variable is used as a +predicate that specifies which major modes the minor mode should be +activated in. Valid values include @code{t} (use in all major modes, +@code{nil} (use in no major modes), or a list of mode names (or +@code{(not mode-name ...)}) elements (as well as @code{t} and +@code{nil}). + +@example +(c-mode (not mail-mode message-mode) text-mode) +@end example + +This means ``use in modes derived from @code{c-mode}, and not in +modes derived from @code{message-mode} or @code{mail-mode}, but do use +in modes derived from @code{text-mode}, and otherwise no other +modes''. + +@example +((not c-mode) t) +@end example + +This means ``don't use modes derived from @code{c-mode}, but use +everywhere else''. + +@example +(text-mode) +@end example + +This means ``use in modes derived from @code{text-mode}, but nowhere +else''. (There's an implicit @code{nil} element at the end.) @end defmac diff --git a/etc/NEWS b/etc/NEWS index 7dbd3d51fa4..d2d4a044007 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1616,6 +1616,11 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el. * Lisp Changes in Emacs 28.1 ++++ +** 'define-globalized-minor-mode' now takes a :predicate parameter. +This can be used to control which major modes the minor mode should be +used in. + +++ ** 'truncate-string-ellipsis' now uses '
' by default. Modes that use 'truncate-string-to-width' with non-nil, non-string diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 8c1e5b227a6..fe85667545d 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -375,18 +375,21 @@ No problems result if this variable is not bound. (defmacro define-globalized-minor-mode (global-mode mode turn-on &rest body) "Make a global mode GLOBAL-MODE corresponding to buffer-local minor MODE. TURN-ON is a function that will be called with no args in every buffer - and that should try to turn MODE on if applicable for that buffer. -Each of KEY VALUE is a pair of CL-style keyword arguments. As - the minor mode defined by this function is always global, any - :global keyword is ignored. Other keywords have the same - meaning as in `define-minor-mode', which see. In particular, - :group specifies the custom group. The most useful keywords - are those that are passed on to the `defcustom'. It normally - makes no sense to pass the :lighter or :keymap keywords to - `define-globalized-minor-mode', since these are usually passed - to the buffer-local version of the minor mode. +and that should try to turn MODE on if applicable for that buffer. + +Each of KEY VALUE is a pair of CL-style keyword arguments. :predicate +specifies which major modes the globalized minor mode should be switched on +in. As the minor mode defined by this function is always global, any +:global keyword is ignored. Other keywords have the same meaning as in +`define-minor-mode', which see. In particular, :group specifies the custom +group. The most useful keywords are those that are passed on to the +`defcustom'. It normally makes no sense to pass the :lighter or :keymap +keywords to `define-globalized-minor-mode', since these are usually passed +to the buffer-local version of the minor mode. + BODY contains code to execute each time the mode is enabled or disabled. - It is executed after toggling the mode, and before running GLOBAL-MODE-hook. +It is executed after toggling the mode, and before running +GLOBAL-MODE-hook. If MODE's set-up depends on the major mode in effect when it was enabled, then disabling and reenabling MODE should make MODE work @@ -415,7 +418,11 @@ on if the hook has explicitly disabled it. (minor-MODE-hook (intern (concat mode-name "-hook"))) (MODE-set-explicitly (intern (concat mode-name "-set-explicitly"))) (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode"))) - keyw) + (MODE-predicate (intern (concat (replace-regexp-in-string + "-mode\\'" "" global-mode-name) + "-modes"))) + (turn-on-function `#',turn-on) + keyw predicate) ;; Check keys. (while (keywordp (setq keyw (car body))) @@ -423,6 +430,13 @@ on if the hook has explicitly disabled it. (pcase keyw (:group (setq group (nconc group (list :group (pop body))))) (:global (pop body)) + (:predicate + (setq predicate (list (pop body))) + (setq turn-on-function + `(lambda () + (require 'easy-mmode) + (when (easy-mmode--globalized-predicate-p ,(car predicate)) + (funcall ,turn-on-function))))) (_ (push keyw extra-keywords) (push (pop body) extra-keywords)))) `(progn @@ -442,10 +456,17 @@ ARG is omitted or nil. %s is enabled in all buffers where `%s' would do it. -See `%s' for more information on %s." + +See `%s' for more information on +%s.%s" pretty-name pretty-global-name - pretty-name turn-on mode pretty-name) - :global t ,@group ,@(nreverse extra-keywords) + pretty-name turn-on mode pretty-name + (if predicate + (format "\n\n`%s' is used to control which modes +this minor mode is used in." + MODE-predicate) + "")) + :global t ,@group ,@(nreverse extra-keywords) ;; Setup hook to handle future mode changes and new buffers. (if ,global-mode @@ -461,7 +482,8 @@ See `%s' for more information on %s." ;; Go through existing buffers. (dolist (buf (buffer-list)) (with-current-buffer buf - (if ,global-mode (funcall #',turn-on) (when ,mode (,mode -1))))) + (if ,global-mode (funcall ,turn-on-function) + (when ,mode (,mode -1))))) ,@body) ;; Autoloading define-globalized-minor-mode autoloads everything @@ -497,8 +519,8 @@ See `%s' for more information on %s." (if ,mode (progn (,mode -1) - (funcall #',turn-on)) - (funcall #',turn-on)))) + (funcall ,turn-on-function)) + (funcall ,turn-on-function)))) (setq ,MODE-major-mode major-mode)))))) (put ',MODE-enable-in-buffers 'definition-name ',global-mode) @@ -511,7 +533,52 @@ See `%s' for more information on %s." (defun ,MODE-cmhh () (add-to-list ',MODE-buffers (current-buffer)) (add-hook 'post-command-hook ',MODE-check-buffers)) - (put ',MODE-cmhh 'definition-name ',global-mode)))) + (put ',MODE-cmhh 'definition-name ',global-mode) + + ,(when predicate + `(defcustom ,MODE-predicate ,(car predicate) + ,(format "Which major modes `%s' is switched on in. +This variable can be either t (all major modes), nil (no major modes), +or a list of modes and (not modes) to switch use this minor mode or +not. For instance + + (c-mode (not message-mode mail-mode) text-mode) + +means \"use this mode in all modes derived from `c-mode', don't use in +modes derived from `message-mode' or `mail-mode', but do use in other +modes derived from `text-mode'\". An element with value t means \"use\" +and nil means \"don't use\". There's an implicit nil at the end of the +list." + mode) + :type '(repeat sexp) + :group ,group))))) + +(defun easy-mmode--globalized-predicate-p (predicate) + (cond + ((eq predicate t) + t) + ((eq predicate nil) + nil) + ((listp predicate) + ;; Legacy support for (not a b c). + (when (eq (car predicate) 'not) + (setq predicate (nconc (mapcar (lambda (e) (list 'not e)) + (cdr predicate)) + (list t)))) + (catch 'found + (dolist (elem predicate) + (cond + ((eq elem t) + (throw 'found t)) + ((eq elem nil) + (throw 'found nil)) + ((and (consp elem) + (eq (car elem) 'not)) + (when (apply #'derived-mode-p (cdr elem)) + (throw 'found nil))) + ((symbolp elem) + (when (derived-mode-p elem) + (throw 'found t))))))))) ;;; ;;; easy-mmode-defmap diff --git a/test/lisp/emacs-lisp/easy-mmode-tests.el b/test/lisp/emacs-lisp/easy-mmode-tests.el new file mode 100644 index 00000000000..4d7fe9444fb --- /dev/null +++ b/test/lisp/emacs-lisp/easy-mmode-tests.el @@ -0,0 +1,49 @@ +;;; easy-mmode-tests.el --- tests for easy-mmode.el -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; 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: + +(require 'ert) +(require 'easy-mmode) +(require 'message) + +(ert-deftest easy-mmode--globalized-predicate () + (with-temp-buffer + (emacs-lisp-mode) + (should (eq (easy-mmode--globalized-predicate-p nil) nil)) + (should (eq (easy-mmode--globalized-predicate-p t) t)) + (should (eq (easy-mmode--globalized-predicate-p '(not text-mode)) t)) + (should (eq (easy-mmode--globalized-predicate-p '(not text-mode)) t)) + (should (eq (easy-mmode--globalized-predicate-p '((not text-mode))) nil)) + (should (eq (easy-mmode--globalized-predicate-p '((not text-mode) t)) t)) + (should (eq (easy-mmode--globalized-predicate-p + '(c-mode emacs-lisp-mode)) + t)) + (mail-mode) + (should (eq (easy-mmode--globalized-predicate-p + '(c-mode (not message-mode mail-mode) text-mode)) + nil)) + (text-mode) + (should (eq (easy-mmode--globalized-predicate-p + '(c-mode (not message-mode mail-mode) text-mode)) + t)))) + +(provide 'easy-mmode-tests) + +;;; easy-mmode-tests.el ends here -- cgit v1.2.3 From fedb25819a40515249cd7b26f914e3b224190761 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 26 Oct 2020 19:15:30 +0100 Subject: Tweak where global-display-fill-column-indicator-modes is on * lisp/display-fill-column-indicator.el (global-display-fill-column-indicator-mode): Don't switch on in special-mode buffers (bug#44232). --- etc/NEWS | 5 +++++ lisp/display-fill-column-indicator.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index d2d4a044007..e681ce3a854 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1185,6 +1185,11 @@ list. ** Miscellaneous +--- +*** 'global-display-fill-column-indicator-mode' isn't on in all buffers. +It's not off in special-mode buffers, as specified by the new user +option 'global-display-fill-column-indicator-modes'. + --- *** New user option 'compilation-search-all-directories'. When doing parallel builds, directories and compilation errors may diff --git a/lisp/display-fill-column-indicator.el b/lisp/display-fill-column-indicator.el index e1395f000bf..3ba419156e8 100644 --- a/lisp/display-fill-column-indicator.el +++ b/lisp/display-fill-column-indicator.el @@ -74,7 +74,8 @@ See Info node `Displaying Boundaries' for details." ;;;###autoload (define-globalized-minor-mode global-display-fill-column-indicator-mode - display-fill-column-indicator-mode display-fill-column-indicator--turn-on) + display-fill-column-indicator-mode display-fill-column-indicator--turn-on + :predicate '((not special-mode) t)) (provide 'display-fill-column-indicator) -- cgit v1.2.3 From 6415eb8d7413fe5a6d6c80a54f1d785d743f8737 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 26 Oct 2020 20:38:42 +0200 Subject: ; * etc/NEWS: Fix a recently-added entry. --- etc/NEWS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index e681ce3a854..7dd993cdab9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1186,9 +1186,9 @@ list. ** Miscellaneous --- -*** 'global-display-fill-column-indicator-mode' isn't on in all buffers. -It's not off in special-mode buffers, as specified by the new user -option 'global-display-fill-column-indicator-modes'. +*** 'global-display-fill-column-indicator-mode' skips some buffers. +Turning on 'global-display-fill-column-indicator-mode' doesn't turn on +'display-fill-column-indicator-mode' in special-mode buffers. --- *** New user option 'compilation-search-all-directories'. -- cgit v1.2.3 From f314ac2a30a475a2c578df8816adc9a2155dc259 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 26 Oct 2020 20:44:15 +0100 Subject: Make the -modes variable autoloaded * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Make the -modes variable be autoloaded. --- lisp/emacs-lisp/easy-mmode.el | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index fe85667545d..a707d204f8b 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -486,6 +486,24 @@ this minor mode is used in." (when ,mode (,mode -1))))) ,@body) + ,(when predicate + `(defcustom ,MODE-predicate ,(car predicate) + ,(format "Which major modes `%s' is switched on in. +This variable can be either t (all major modes), nil (no major modes), +or a list of modes and (not modes) to switch use this minor mode or +not. For instance + + (c-mode (not message-mode mail-mode) text-mode) + +means \"use this mode in all modes derived from `c-mode', don't use in +modes derived from `message-mode' or `mail-mode', but do use in other +modes derived from `text-mode'\". An element with value t means \"use\" +and nil means \"don't use\". There's an implicit nil at the end of the +list." + mode) + :type '(repeat sexp) + :group ,group)) + ;; Autoloading define-globalized-minor-mode autoloads everything ;; up-to-here. :autoload-end @@ -533,25 +551,7 @@ this minor mode is used in." (defun ,MODE-cmhh () (add-to-list ',MODE-buffers (current-buffer)) (add-hook 'post-command-hook ',MODE-check-buffers)) - (put ',MODE-cmhh 'definition-name ',global-mode) - - ,(when predicate - `(defcustom ,MODE-predicate ,(car predicate) - ,(format "Which major modes `%s' is switched on in. -This variable can be either t (all major modes), nil (no major modes), -or a list of modes and (not modes) to switch use this minor mode or -not. For instance - - (c-mode (not message-mode mail-mode) text-mode) - -means \"use this mode in all modes derived from `c-mode', don't use in -modes derived from `message-mode' or `mail-mode', but do use in other -modes derived from `text-mode'\". An element with value t means \"use\" -and nil means \"don't use\". There's an implicit nil at the end of the -list." - mode) - :type '(repeat sexp) - :group ,group))))) + (put ',MODE-cmhh 'definition-name ',global-mode)))) (defun easy-mmode--globalized-predicate-p (predicate) (cond -- cgit v1.2.3 From eb57ae084450cd33d6ad1fdb2b7a6a81975b869e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 26 Oct 2020 21:23:50 +0100 Subject: Fix time-test error on machines with mail * test/lisp/time-tests.el (time-tests-display-time-update): There may be mail on the machine (bug#44241). --- test/lisp/time-tests.el | 1 + 1 file changed, 1 insertion(+) diff --git a/test/lisp/time-tests.el b/test/lisp/time-tests.el index 1a62450cb3a..2d327b959cc 100644 --- a/test/lisp/time-tests.el +++ b/test/lisp/time-tests.el @@ -49,6 +49,7 @@ (? digit) digit ":" digit digit (? (| "AM" "PM")) " " (+ (| digit ".")) + (? " Mail") string-end) display-time-string)))) -- cgit v1.2.3 From 2697123933e3ac7ed4e21a6d12746a98ed7fa74a Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 26 Oct 2020 21:10:36 +0100 Subject: Make vc-responsible-backend choose the most specific backend * lisp/vc/vc.el (vc-responsible-backend): Search through all the VC backends instead of the first one, and choose the one that's most specific (bug#42966). --- etc/NEWS | 8 ++++++++ lisp/vc/vc.el | 22 ++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 7dd993cdab9..2674094c79c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -403,6 +403,14 @@ their 'default-directory' under VC. *** New command 'vc-dir-root' uses the root directory without asking. +--- +*** The responsible VC backend is now the most specific one. +'vc-responsible-backend' loops over the backends in +'vc-handled-backends' to determine which backend is responsible for a +specific (unregistered) file. Previously the first matching backend +was chosen, but now the one with the most specific path is chosen (in +case there's a directory handled by one backend inside another). + *** New commands 'vc-dir-mark-registered-files' (bound to '* r') and 'vc-dir-mark-unregistered-files'. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 39d0fab391d..8def7da3776 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -979,12 +979,22 @@ be reported. If NO-ERROR is nil, signal an error that no VC backend is responsible for the given file." (or (and (not (file-directory-p file)) (vc-backend file)) - (catch 'found - ;; First try: find a responsible backend. If this is for registration, - ;; it must be a backend under which FILE is not yet registered. - (dolist (backend vc-handled-backends) - (and (vc-call-backend backend 'responsible-p file) - (throw 'found backend)))) + ;; First try: find a responsible backend. If this is for registration, + ;; it must be a backend under which FILE is not yet registered. + (let ((dirs (delq nil + (mapcar + (lambda (backend) + (when-let ((dir (vc-call-backend + backend 'responsible-p file))) + (cons backend dir))) + vc-handled-backends)))) + ;; Just a single response (or none); use it. + (if (< (length dirs) 2) + (caar dirs) + ;; Several roots; we seem to have one vc inside another's + ;; directory. Choose the most specific. + (caar (sort dirs (lambda (d1 d2) + (< (length (cdr d2)) (length (cdr d1)))))))) (unless no-error (error "No VC backend is responsible for %s" file)))) -- cgit v1.2.3 From a4ec03fa9be8315fba1be1658654be98643498ea Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Mon, 26 Oct 2020 21:38:13 +0100 Subject: ; * etc/tutorials/TUTORIAL.de: Fix grammar (Bug#44246) --- etc/tutorials/TUTORIAL.de | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/tutorials/TUTORIAL.de b/etc/tutorials/TUTORIAL.de index 75c03a18e4a..2df066972e1 100644 --- a/etc/tutorials/TUTORIAL.de +++ b/etc/tutorials/TUTORIAL.de @@ -1276,7 +1276,7 @@ Funktion set-language-environment). Mittels C-x l latin-1 können Sie z.B. in einer laufenden Emacs-Sitzung auf Latin-1 -umzuschalten. Dadurch wird erreicht, dass Emacs beim Laden einer +umschalten. Dadurch wird erreicht, dass Emacs beim Laden einer Datei (und Speichern derselben) standardmĂ€ĂŸig die Latin-1-Zeichenkodierung verwendet. Sie können an der Ziffer 1 unmittelbar vor dem Doppelpunkt links unten in der Statuszeile -- cgit v1.2.3 From c7a3bd9b56912be30adaaef75f10e369e6c62886 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 26 Oct 2020 23:01:08 +0200 Subject: vc-git-root: Remove unnecessary caching * lisp/vc/vc-git.el (vc-git-root): Simplify (bug#42966). --- lisp/vc/vc-git.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index b1880c0f7b0..91554bb6d83 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1573,8 +1573,7 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"." (defun vc-git-extra-status-menu () vc-git-extra-menu-map) (defun vc-git-root (file) - (or (vc-file-getprop file 'git-root) - (vc-file-setprop file 'git-root (vc-find-root file ".git")))) + (vc-find-root file ".git")) ;; grep-compute-defaults autoloads grep. (declare-function grep-read-regexp "grep" ()) -- cgit v1.2.3 From e7009a6dc2643125036154313924fd72c3d9847a Mon Sep 17 00:00:00 2001 From: Stephen Berman Date: Mon, 26 Oct 2020 22:21:07 +0100 Subject: Fix an unbound variable in html skeletons * lisp/skeleton.el (skeleton-internal-list): Fix an unbound variable in html skeletons (bug#44157). --- lisp/skeleton.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/skeleton.el b/lisp/skeleton.el index ea4e5dbc227..6e2c10d9711 100644 --- a/lisp/skeleton.el +++ b/lisp/skeleton.el @@ -339,7 +339,8 @@ automatically, and you are prompted to fill in the variable parts."))) (dlet ((str (or str `(setq str (skeleton-read ',(car skeleton-il) - nil ,recursive))))) + nil ,recursive)))) + resume:) (when (and (eq (cadr skeleton-il) '\n) (not recursive) (save-excursion (skip-chars-backward " \t") (bolp))) (setq skeleton-il (cons nil (cons '> (cddr skeleton-il))))) -- cgit v1.2.3 From c00758a4bca7464250bdd752cb03498ec587e6aa Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 27 Oct 2020 00:35:46 +0100 Subject: Remove XEmacs compat code from hashcash.el * lisp/mail/hashcash.el (hashcash-point-at-bol) (hashcash-point-at-eol): Make obsolete. (hashcash-token-substring): Don't use the above now obsolete aliases. --- lisp/mail/hashcash.el | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lisp/mail/hashcash.el b/lisp/mail/hashcash.el index 12cffd9bc4b..a2705d659a4 100644 --- a/lisp/mail/hashcash.el +++ b/lisp/mail/hashcash.el @@ -116,15 +116,6 @@ For example, you may want to set this to (\"-Z2\") to reduce header length." (require 'mail-utils) -(eval-and-compile - (if (fboundp 'point-at-bol) - (defalias 'hashcash-point-at-bol 'point-at-bol) - (defalias 'hashcash-point-at-bol 'line-beginning-position)) - - (if (fboundp 'point-at-eol) - (defalias 'hashcash-point-at-eol 'point-at-eol) - (defalias 'hashcash-point-at-eol 'line-end-position))) - (defun hashcash-strip-quoted-names (addr) (setq addr (mail-strip-quoted-names addr)) (if (and addr (string-match "\\`\\([^+@]+\\)\\+[^@]*\\(@.+\\)" addr)) @@ -141,8 +132,8 @@ For example, you may want to set this to (\"-Z2\") to reduce header length." (let ((token "")) (cl-loop (setq token - (concat token (buffer-substring (point) (hashcash-point-at-eol)))) - (goto-char (hashcash-point-at-eol)) + (concat token (buffer-substring (point) (line-end-position)))) + (goto-char (line-end-position)) (forward-char 1) (unless (looking-at "[ \t]") (cl-return token)) (while (looking-at "[ \t]") (forward-char 1)))))) @@ -374,6 +365,9 @@ Prefix arg sets default accept amount temporarily." (message "Payment valid")) ok)))) +(define-obsolete-function-alias 'hashcash-point-at-bol #'line-beginning-position "28.1") +(define-obsolete-function-alias 'hashcash-point-at-eol #'line-end-position "28.1") + (provide 'hashcash) ;;; hashcash.el ends here -- cgit v1.2.3 From e679e0abcf2a1c5c8c95974a9f759edac9c934b4 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 27 Oct 2020 00:49:28 +0100 Subject: Don't use obsolete variable write-contents-hooks * lisp/mh-e/mh-show.el (mh-display-msg): * lisp/textmodes/rst.el: Don't use obsolete variable write-contents-hooks. Problem reported by Stefan Monnier . --- lisp/mh-e/mh-show.el | 2 +- lisp/textmodes/rst.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index 04551acd143..7536f949e76 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el @@ -219,7 +219,7 @@ Sets the current buffer to the show buffer." (erase-buffer) ;; Changing contents, so this hook needs to be reinitialized. ;; pgp.el uses this. - (kill-local-variable 'write-contents-hooks) + (kill-local-variable 'write-contents-functions) (font-lock-mode -1) (mh-show-mode) (if formfile diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index f2fcd62c871..adda28cb81b 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -2862,7 +2862,7 @@ file-write hook to always make it up-to-date automatically." ;; FIXME: Updating the toc on saving would be nice. However, this doesn't work ;; correctly: ;; -;; (add-hook 'write-contents-hooks 'rst-toc-update-fun) +;; (add-hook 'write-contents-functions 'rst-toc-update-fun) ;; (defun rst-toc-update-fun () ;; ;; Disable undo for the write file hook. ;; (let ((buffer-undo-list t)) (rst-toc-update) )) -- cgit v1.2.3 From 65f36a8471823d44eb8dcecebb44531ccdb1754f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 27 Oct 2020 01:29:43 +0100 Subject: Use lexical-binding in tool-bar.el * lisp/tool-bar.el: Use lexical-binding. (tool-bar-add-item, tool-bar-add-item-from-menu): Quote function symbols as such. --- lisp/tool-bar.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el index 7df1e28e06f..84562164300 100644 --- a/lisp/tool-bar.el +++ b/lisp/tool-bar.el @@ -1,4 +1,4 @@ -;;; tool-bar.el --- setting up the tool bar +;;; tool-bar.el --- setting up the tool bar -*- lexical-binding: t -*- ;; Copyright (C) 2000-2020 Free Software Foundation, Inc. @@ -139,7 +139,7 @@ ICON.xbm, using `find-image'. Use this function only to make bindings in the global value of `tool-bar-map'. To define items in any other map, use `tool-bar-local-item'." - (apply 'tool-bar-local-item icon def key tool-bar-map props)) + (apply #'tool-bar-local-item icon def key tool-bar-map props)) (defun tool-bar--image-expression (icon) "Return an expression that evaluates to an image spec for ICON." @@ -191,7 +191,7 @@ MAP must contain appropriate binding for `[menu-bar]' which holds a keymap. Use this function only to make bindings in the global value of `tool-bar-map'. To define items in any other map, use `tool-bar-local-item-from-menu'." - (apply 'tool-bar-local-item-from-menu command icon + (apply #'tool-bar-local-item-from-menu command icon (default-value 'tool-bar-map) map props)) ;;;###autoload -- cgit v1.2.3 From cfc70e51c29df37f4245fd1754124a46ffca19f7 Mon Sep 17 00:00:00 2001 From: Boruch Baum Date: Tue, 27 Oct 2020 02:30:29 +0100 Subject: Add some missing docstrings in cua-rect.el * lisp/emulation/cua-rect.el (cua--rectangle) (cua--last-rectangle, cua--restored-rectangle) (cua--rectangle-overlays, cua--rectangle-operation) (cua--tabify-start, cua--tabify-start, cua--insert-rectangle): Add docstrings, in several cases by converting existing comments. (Bug#30085) (cua--last-killed-rectangle): Update comment. --- lisp/emulation/cua-rect.el | 82 +++++++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 26 deletions(-) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 9c3251e0e6f..7ca9dc1af1d 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -37,26 +37,56 @@ (require 'rect) -;; If non-nil, restrict current region to this rectangle. -;; Value is a vector [top bot left right corner ins virt select]. -;; CORNER specifies currently active corner 0=t/l 1=t/r 2=b/l 3=b/r. -;; INS specifies whether to insert on left(nil) or right(t) side. -;; If VIRT is non-nil, virtual straight edges are enabled. -;; If SELECT is a regexp, only lines starting with that regexp are affected.") -(defvar cua--rectangle nil) +(defvar cua--rectangle nil + "If non-nil, restrict current region to this rectangle. +A cua-rectangle definition is a vector used for all actions in +`cua-rectangle-mark-mode', of the form: + + [top bot left right corner ins virt select] + +TOP is the upper-left corner point. + +BOTTOM is the point at the end of line after the the lower-right +corner point. + +LEFT and RIGHT are column numbers. + +CORNER specifies currently active corner 0=t/l 1=t/r 2=b/l 3=b/r. + +INS specifies whether to insert on left(nil) or right(t) side. + +If VIRT is non-nil, virtual straight edges are enabled. + +If SELECT is a regexp, only lines starting with that regexp are +affected.") (make-variable-buffer-local 'cua--rectangle) -;; Most recent rectangle geometry. Note: car is buffer. -(defvar cua--last-rectangle nil) +(defvar cua--last-rectangle nil + "Most recent rectangle geometry. +A CONS cell, the car of which is the rectangle's buffer, and the +cdr of which is a cua-rectangle definition. +See `cua--rectangle'.") + -;; Rectangle restored by undo. -(defvar cua--restored-rectangle nil) +(defvar cua--restored-rectangle nil + "Rectangle restored by undo.") ;; Last rectangle copied/killed; nil if last kill was not a rectangle. +;; FIXME: The above seems to be incorrect: +;; + It seems to be the two most recent killed rectangles, and is not +;; reset upon either a `kill-region' or `kill-line' +;; + In the following example, the rectangle full of question marks +;; was killed prior to the rectangle with the string "active". +;; (#("???e\n??? \n???i\n???," 0 19 +;; (yank-handler +;; (rectangle--insert-for-yank +;; ("???e" "??? " "???i" "???,") +;; t))) +;; "active " "sert on" " straig" " lines ") (defvar cua--last-killed-rectangle nil) -;; List of overlays used to display current rectangle. -(defvar cua--rectangle-overlays nil) +(defvar cua--rectangle-overlays nil + "List of overlays used to display current rectangle.") (make-variable-buffer-local 'cua--rectangle-overlays) (put 'cua--rectangle-overlays 'permanent-local t) @@ -522,7 +552,7 @@ If command is repeated at same position, delete the rectangle." ;;; Operations on current rectangle (defun cua--tabify-start (start end) - ;; Return position where auto-tabify should start (or nil if not required). + "Return position where auto-tabify should start (or nil if not required)." (save-excursion (save-restriction (widen) @@ -538,15 +568,15 @@ If command is repeated at same position, delete the rectangle." start))))) (defun cua--rectangle-operation (keep-clear visible undo pad tabify &optional fct post-fct) - ;; Call FCT for each line of region with 4 parameters: - ;; Region start, end, left-col, right-col - ;; Point is at start when FCT is called - ;; Call fct with (s,e) = whole lines if VISIBLE non-nil. - ;; Only call fct for visible lines if VISIBLE==t. - ;; Set undo boundary if UNDO is non-nil. - ;; Rectangle is padded if PAD = t or numeric and (cua--rectangle-virtual-edges) - ;; Perform auto-tabify after operation if TABIFY is non-nil. - ;; Mark is kept if keep-clear is 'keep and cleared if keep-clear is 'clear. + "Call FCT for each line of region with 4 parameters: +Region start, end, left-col, right-col. +Point is at start when FCT is called. +Call fct with (s,e) = whole lines if VISIBLE non-nil. +Only call fct for visible lines if VISIBLE==t. +Set undo boundary if UNDO is non-nil. +Rectangle is padded if PAD = t or numeric and (cua--rectangle-virtual-edges) +Perform auto-tabify after operation if TABIFY is non-nil. +Mark is kept if keep-clear is 'keep and cleared if keep-clear is 'clear." (let* ((inhibit-field-text-motion t) (start (cua--rectangle-top)) (end (cua--rectangle-bot)) @@ -683,9 +713,9 @@ If command is repeated at same position, delete the rectangle." (nreverse rect))) (defun cua--insert-rectangle (rect &optional below paste-column line-count) - ;; Insert rectangle as insert-rectangle, but don't set mark and exit with - ;; point at either next to top right or below bottom left corner - ;; Notice: In overwrite mode, the rectangle is inserted as separate text lines. + "Insert rectangle as insert-rectangle, but don't set mark and exit with +point at either next to top right or below bottom left corner +Notice: In overwrite mode, the rectangle is inserted as separate text lines." (if (eq below 'auto) (setq below (and (bolp) (or (eolp) (eobp) (= (1+ (point)) (point-max)))))) -- cgit v1.2.3 From 25a57640c59e1630ad31b766a7a92abab856a284 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 27 Oct 2020 03:09:44 +0100 Subject: Allow pcomplete/gzip to complete on files in subdirectories * lisp/pcmpl-gnu.el (pcmpl-gnu-zipped-files): Allow "gzip" to complete on files in subdirectories. (Bug#30271) --- lisp/pcmpl-gnu.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/pcmpl-gnu.el b/lisp/pcmpl-gnu.el index d7c5b381d29..fa84b31675e 100644 --- a/lisp/pcmpl-gnu.el +++ b/lisp/pcmpl-gnu.el @@ -67,12 +67,13 @@ nil (function (lambda (entry) - (when (and (file-readable-p entry) - (file-regular-p entry)) - (let ((zipped (string-match "\\.\\(t?gz\\|\\(ta\\)?Z\\)\\'" - entry))) - (or (and unzip-p zipped) - (and (not unzip-p) (not zipped))))))))) + (or (file-directory-p entry) + (when (and (file-readable-p entry) + (file-regular-p entry)) + (let ((zipped (string-match "\\.\\(t?gz\\|\\(ta\\)?Z\\)\\'" + entry))) + (or (and unzip-p zipped) + (and (not unzip-p) (not zipped)))))))))) ;;;###autoload (defun pcomplete/bzip2 () -- cgit v1.2.3 From 8916ea7f98a8dae9674c142d2774431f7f6846a9 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 27 Oct 2020 03:51:57 +0100 Subject: * lisp/mail/mail-parse.el: Use lexical-binding. --- lisp/mail/mail-parse.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/mail/mail-parse.el b/lisp/mail/mail-parse.el index 894313633da..e0274c8a11b 100644 --- a/lisp/mail/mail-parse.el +++ b/lisp/mail/mail-parse.el @@ -1,4 +1,4 @@ -;;; mail-parse.el --- Interface functions for parsing mail +;;; mail-parse.el --- Interface functions for parsing mail -*- lexical-binding: t -*- ;; Copyright (C) 1998-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From 96c6281d5647b9aae2a0443d6e1b1ac99835bb37 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 27 Oct 2020 03:53:02 +0100 Subject: * lisp/mail/mail-prsvr.el: Use lexical-binding. --- lisp/mail/mail-prsvr.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/mail/mail-prsvr.el b/lisp/mail/mail-prsvr.el index 9023c00a66e..7c67c49b0b4 100644 --- a/lisp/mail/mail-prsvr.el +++ b/lisp/mail/mail-prsvr.el @@ -1,4 +1,4 @@ -;;; mail-prsvr.el --- Interface variables for parsing mail +;;; mail-prsvr.el --- Interface variables for parsing mail -*- lexical-binding: t -*- ;; Copyright (C) 1999-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From d2be9233d1d2a1e49c3990559e8cfb4885e35b91 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 27 Oct 2020 05:25:17 +0200 Subject: ; * etc/NEWS: Fix a recent change. --- etc/NEWS | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 2674094c79c..a77c1c883eb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1195,8 +1195,10 @@ list. --- *** 'global-display-fill-column-indicator-mode' skips some buffers. -Turning on 'global-display-fill-column-indicator-mode' doesn't turn on -'display-fill-column-indicator-mode' in special-mode buffers. +By default, turning on 'global-display-fill-column-indicator-mode' +doesn't turn on 'display-fill-column-indicator-mode' in special-mode +buffers. This can be controlled by customizing the variable +'global-display-fill-column-indicator-modes'. --- *** New user option 'compilation-search-all-directories'. -- cgit v1.2.3 From eca5f4dec7258e385ad77b85b983e71712aa53a1 Mon Sep 17 00:00:00 2001 From: Nicolas Graner Date: Tue, 27 Oct 2020 08:15:22 +0100 Subject: Define backtab in text fields in eww * lisp/net/eww.el (eww-text-map): (eww-textarea-map): Define backtab, as in the main mode map (bug#44247). --- lisp/net/eww.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 53835bb5440..ebc75e0e8a7 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1190,6 +1190,7 @@ just re-display the HTML already fetched." (define-key map [(control e)] 'eww-end-of-text) (define-key map [?\t] 'shr-next-link) (define-key map [?\M-\t] 'shr-previous-link) + (define-key map [backtab] 'shr-previous-link) map)) (defvar eww-textarea-map @@ -1199,6 +1200,7 @@ just re-display the HTML already fetched." (define-key map [(control c) (control c)] 'eww-submit) (define-key map [?\t] 'shr-next-link) (define-key map [?\M-\t] 'shr-previous-link) + (define-key map [backtab] 'shr-previous-link) map)) (defvar eww-select-map -- cgit v1.2.3 From be2b43c4d6ee7a4f63caf0d496789963fcf4fb00 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Oct 2020 08:23:31 +0100 Subject: `g' in *Help* doesn't require confirmation * lisp/help-mode.el (help-mode-revert-buffer): Don't require confirmation before reverting (bug#44202). This mimics how most other non-file reverting functions work. --- etc/NEWS | 3 +++ lisp/help-mode.el | 19 +++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index a77c1c883eb..71749d1b1ff 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -583,6 +583,9 @@ skipped. ** Help +--- +*** 'g' ('revert-buffer') in 'help-mode' no longer requires confirmation. + +++ *** New command 'describe-keymap' describes keybindings in a keymap. diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 0dc6c9ffae0..f0770fb6602 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -756,16 +756,15 @@ Show all docs for that symbol as either a variable, function or face." (help-do-xref pos #'describe-symbol (list sym)) (user-error "No symbol here")))) -(defun help-mode-revert-buffer (_ignore-auto noconfirm) - (when (or noconfirm (yes-or-no-p "Revert help buffer? ")) - (let ((pos (point)) - (item help-xref-stack-item) - ;; Pretend there is no current item to add to the history. - (help-xref-stack-item nil) - ;; Use the current buffer. - (help-xref-following t)) - (apply (car item) (cdr item)) - (goto-char pos)))) +(defun help-mode-revert-buffer (_ignore-auto _noconfirm) + (let ((pos (point)) + (item help-xref-stack-item) + ;; Pretend there is no current item to add to the history. + (help-xref-stack-item nil) + ;; Use the current buffer. + (help-xref-following t)) + (apply (car item) (cdr item)) + (goto-char pos))) (defun help-insert-string (string) "Insert STRING to the help buffer and install xref info for it. -- cgit v1.2.3 From 7f32224dc324b0ee0f1b512c8d8b19aeb80141c1 Mon Sep 17 00:00:00 2001 From: mvar Date: Tue, 27 Oct 2020 09:27:51 +0100 Subject: Fontify strings in {} better in tcl-mode * lisp/progmodes/tcl.el (tcl-syntax-propertize-function): Propertize {} forms after commands as strings (bug#39277). (tcl-set-font-lock-keywords): Fontify as strings. This allows things like puts {"foo} to be fontified correctly. Copyright-paperwork-exempt: yes --- lisp/progmodes/tcl.el | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index 717008a0a22..583f4e396e5 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -386,32 +386,36 @@ Call `tcl-set-font-lock-keywords' after changing this list.") Default list includes some TclX keywords. Call `tcl-set-font-lock-keywords' after changing this list.") -(defvar tcl-builtin-list - '("after" "append" "array" "bgerror" "binary" "catch" "cd" "clock" - "close" "concat" "console" "dde" "encoding" "eof" "exec" "expr" - "fblocked" "fconfigure" "fcopy" "file" "fileevent" "flush" - "format" "gets" "glob" "history" "incr" "info" "interp" "join" - "lappend" "lindex" "linsert" "list" "llength" "load" "lrange" - "lreplace" "lsort" "namespace" "open" "package" "pid" "puts" "pwd" - "read" "regexp" "registry" "regsub" "rename" "scan" "seek" "set" - "socket" "source" "split" "string" "subst" "tell" "time" "trace" - "unknown" "unset" "vwait") - "List of Tcl commands. Used only for highlighting. -Call `tcl-set-font-lock-keywords' after changing this list. -This list excludes those commands already found in `tcl-proc-list' and -`tcl-keyword-list'.") - (defvar tcl-font-lock-keywords nil "Keywords to highlight for Tcl. See variable `font-lock-keywords'. This variable is generally set from `tcl-proc-regexp', `tcl-typeword-list', and `tcl-keyword-list' by the function `tcl-set-font-lock-keywords'.") -(defconst tcl-syntax-propertize-function - (syntax-propertize-rules - ;; Mark the few `#' that are not comment-markers. - ("[^;[{ \t\n][ \t]*\\(#\\)" (1 "."))) - "Syntactic keywords for `tcl-mode'.") +(eval-and-compile + (defvar tcl-builtin-list + '("after" "append" "array" "bgerror" "binary" "catch" "cd" "clock" + "close" "concat" "console" "dde" "encoding" "eof" "exec" "expr" + "fblocked" "fconfigure" "fcopy" "file" "fileevent" "flush" + "format" "gets" "glob" "history" "incr" "info" "interp" "join" + "lappend" "lindex" "linsert" "list" "llength" "load" "lrange" + "lreplace" "lsort" "namespace" "open" "package" "pid" "puts" "pwd" + "read" "regexp" "registry" "regsub" "rename" "scan" "seek" "set" + "socket" "source" "split" "string" "subst" "tell" "time" "trace" + "unknown" "unset" "vwait") + "List of Tcl commands. Used only for highlighting. +Call `tcl-set-font-lock-keywords' after changing this list. +This list excludes those commands already found in `tcl-proc-list' and +`tcl-keyword-list'.") + + (defconst tcl-syntax-propertize-function + (syntax-propertize-rules + ;; Mark the few `#' that are not comment-markers. + ("[^;[{ \t\n][ \t]*\\(#\\)" (1 ".")) + ((concat "\\_<" (regexp-opt tcl-builtin-list t) + "\\_>" "\s*{\\([^}].*\\)}") + (2 "_"))) + "Syntactic keywords for `tcl-mode'.")) ;; FIXME need some way to recognize variables because array refs look ;; like 2 sexps. @@ -506,6 +510,7 @@ Uses variables `tcl-proc-regexp' and `tcl-keyword-list'." ;; number of "namespace::" qualifiers. A leading "::" refers ;; to the global namespace. '("\\${\\([^}]+\\)}" 1 font-lock-variable-name-face) + '("{\\([^}]+\\)}" 1 font-lock-string-face) '("\\$\\(\\(?:::\\)?\\(?:[[:alnum:]_]+::\\)*[[:alnum:]_]+\\)" 1 font-lock-variable-name-face) '("\\(?:\\s-\\|^\\|\\[\\)set\\s-+{\\([^}]+\\)}" -- cgit v1.2.3 From 083707bbab74a7fcc60fa566156224924ffc3c64 Mon Sep 17 00:00:00 2001 From: Paul Pogonyshev Date: Tue, 27 Oct 2020 09:43:55 +0100 Subject: Don't leak result of nested byte-compilation to outer level * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Bind `byte-compiler-error-flag' instead of setting it (bug#41065). This fixes a problem of "leaking" the flag when compiling something that then compiles something that errors out (i.e., an "inner" compile). --- lisp/emacs-lisp/bytecomp.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index a547b672b1a..cbda16d051b 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1938,7 +1938,7 @@ See also `emacs-lisp-byte-compile-and-load'." (byte-compile--known-dynamic-vars (byte-compile--load-dynvars (getenv "EMACS_DYNVARS_FILE"))) target-file input-buffer output-buffer - byte-compile-dest-file) + byte-compile-dest-file byte-compiler-error-flag) (setq target-file (byte-compile-dest-file filename)) (setq byte-compile-dest-file target-file) (with-current-buffer @@ -2000,7 +2000,6 @@ See also `emacs-lisp-byte-compile-and-load'." 'no-byte-compile) (when byte-compile-verbose (message "Compiling %s..." filename)) - (setq byte-compiler-error-flag nil) ;; It is important that input-buffer not be current at this call, ;; so that the value of point set in input-buffer ;; within byte-compile-from-buffer lingers in that buffer. -- cgit v1.2.3 From e0de9f3295b4c46cb7198ec0b9634809d7b7a36d Mon Sep 17 00:00:00 2001 From: Clemens Radermacher Date: Tue, 27 Oct 2020 09:45:25 +0100 Subject: Don't skip empty lines when fitting mini frame to buffer (Bug#44080) * lisp/window.el (fit-mini-frame-to-buffer, window--resize-mini-frame, fit-frame-to-buffer, fit-frame-to-buffer-1): By default, fit a mini frame without skipping its buffer's leading or trailing empty lines. * src/frame.c (resize-mini-frames): Update doc-string. * lisp/cus-start.el (resize-mini-frames): Update for customize. * doc/lispref/minibuf.texi (resize-mini-frames): Update description. --- doc/lispref/minibuf.texi | 6 ++++-- etc/NEWS | 8 ++++++++ lisp/cus-start.el | 4 ++-- lisp/window.el | 24 +++++++++++++++++++++--- src/frame.c | 2 +- 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index ecab882fed7..b955355dc0a 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -2445,8 +2445,10 @@ frame is the buffer whose contents will be shown the next time that window is redisplayed. The function is expected to fit the frame to the buffer in some appropriate way. -Any other non-@code{nil} value means to resize minibuffer-only frames -by calling @code{fit-frame-to-buffer} (@pxref{Resizing Windows}). +Any other non-@code{nil} value means to resize minibuffer-only frames by +calling @code{fit-mini-frame-to-buffer}, a function that behaves like +@code{fit-frame-to-buffer} (@pxref{Resizing Windows}) but does not strip +leading or trailing empty lines from the buffer text. @end defopt diff --git a/etc/NEWS b/etc/NEWS index c3ee1cdd6a9..f0b5dd088af 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -32,6 +32,14 @@ applies, and please also update docstrings as needed. This is a bug-fix release with no new features. + +* Lisp Changes in Emacs 27.2 + +*** The behavior of the user option 'resize-mini-frames' has changed. +If set to non-nil, resize the mini frame using the new function +'fit-mini-frame-to-buffer' which won't skip leading or trailing empty +lines of the buffer. + * Editing Changes in Emacs 27.2 diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 6632687da47..1d344893a5a 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -317,9 +317,9 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of (resize-mini-frames frames (choice (const :tag "Never" nil) - (const :tag "Fit frame to buffer" t) + (const :tag "Fit mini frame to buffer" t) (function :tag "User-defined function")) - "27.1") + "27.2") (menu-bar-mode frames boolean nil ;; FIXME? ;; :initialize custom-initialize-default diff --git a/lisp/window.el b/lisp/window.el index 7b75495ad84..48005fc93e0 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -3406,7 +3406,7 @@ routines." "Resize minibuffer-only frame FRAME." (if (functionp resize-mini-frames) (funcall resize-mini-frames frame) - (fit-frame-to-buffer frame))) + (fit-mini-frame-to-buffer frame))) (defun window--sanitize-window-sizes (horizontal) "Assert that all windows on selected frame are large enough. @@ -8762,6 +8762,14 @@ Return 0 otherwise." (declare-function tool-bar-height "xdisp.c" (&optional frame pixelwise)) +(defun fit-mini-frame-to-buffer (&optional frame) + "Adjust size of minibuffer FRAME to display its contents. +FRAME should be a minibuffer-only frame and defaults to the +selected one. Unlike `fit-frame-to-buffer' FRAME will fit to the +contents of its buffer with any leading or trailing empty lines +included." + (fit-frame-to-buffer-1 frame)) + (defun fit-frame-to-buffer (&optional frame max-height min-height max-width min-width only) "Adjust size of FRAME to display the contents of its buffer exactly. FRAME can be any live frame and defaults to the selected one. @@ -8780,8 +8788,18 @@ horizontally only. The new position and size of FRAME can be additionally determined by customizing the options `fit-frame-to-buffer-sizes' and `fit-frame-to-buffer-margins' or setting the corresponding -parameters of FRAME." +parameters of FRAME. + +Any leading or trailing empty lines of the buffer content are not +considered." (interactive) + (fit-frame-to-buffer-1 frame max-height min-height max-width min-width only t t)) + +(defun fit-frame-to-buffer-1 (&optional frame max-height min-height max-width min-width only from to) + "Helper function for `fit-frame-to-buffer'. +FROM and TO are the buffer positions to determine the size to fit +to, see `window-text-pixel-size'. The remaining arguments are as +for `fit-frame-to-buffer'." (unless (fboundp 'display-monitor-attributes-list) (user-error "Cannot resize frame in non-graphic Emacs")) (setq frame (window-normalize-frame frame)) @@ -8916,7 +8934,7 @@ parameters of FRAME." ;; Note: Currently, for a new frame the sizes of the header ;; and mode line may be estimated incorrectly (size - (window-text-pixel-size window t t max-width max-height)) + (window-text-pixel-size window from to max-width max-height)) (width (max (car size) min-width)) (height (max (cdr size) min-height))) ;; Don't change height or width when the window's size is fixed diff --git a/src/frame.c b/src/frame.c index 255606957c2..adcc489a406 100644 --- a/src/frame.c +++ b/src/frame.c @@ -6204,7 +6204,7 @@ window of that frame is the buffer whose text will be eventually shown in the minibuffer window. Any other non-nil value means to resize minibuffer-only frames by -calling `fit-frame-to-buffer'. */); +calling `fit-mini-frame-to-buffer'. */); resize_mini_frames = Qnil; DEFVAR_LISP ("focus-follows-mouse", focus_follows_mouse, -- cgit v1.2.3 From 8d3ed5f815de0e12fb11f809d295c2820643295d Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Oct 2020 10:17:13 +0100 Subject: Don't do compilation-transform-file-match-alist if there's no file name * lisp/progmodes/compile.el (compilation-error-properties): There may not be a file name (bug#40111). In that case, don't do the `compilation-transform-file-match-alist' thing. --- lisp/progmodes/compile.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 9188a08e780..de0ea428d5e 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1242,12 +1242,12 @@ POS and RES.") 2))) ;; Remove matches like /bin/sh and do other file name transforms. (save-match-data - (let ((file-name - (and (consp file) - (not (bufferp (car file))) - (if (cdr file) - (expand-file-name (car file) (cdr file)) - (car file))))) + (when-let ((file-name + (and (consp file) + (not (bufferp (car file))) + (if (cdr file) + (expand-file-name (car file) (cdr file)) + (car file))))) (cl-loop for (regexp replacement) in compilation-transform-file-match-alist when (string-match regexp file-name) -- cgit v1.2.3 From 7d429d7ef0dc864ddb869593d4938926248624a8 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Oct 2020 11:32:14 +0100 Subject: Add a link to inherited faces in Customize * lisp/cus-edit.el (cus--face-link): New function (bug#44154). (face): Use the function to format the link. --- lisp/cus-edit.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 85c197b400f..ed0117e067b 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -3739,6 +3739,15 @@ the present value is saved to its :shown-value property instead." (widget-put widget :children children) (custom-face-state-set widget)))))) +(defun cus--face-link (widget _format) + (let ((face (intern (widget-get widget :value)))) + (widget-create-child-and-convert + widget 'face-link + :button-face 'link + :tag "link" + :action (lambda (&rest _x) + (customize-face face))))) + (defvar custom-face-menu nil "If non-nil, an alist of actions for the `custom-face' widget. @@ -4008,7 +4017,7 @@ restoring it to the state of a face that has never been customized." (define-widget 'face 'symbol "A Lisp face name (with sample)." - :format "%{%t%}: (%{sample%}) %v" + :format "%f %{%t%}: (%{sample%}) %v" :tag "Face" :value 'default :sample-face-get 'widget-face-sample-face-get @@ -4018,6 +4027,7 @@ restoring it to the state of a face that has never been customized." obarray #'facep 'strict) :prompt-match 'facep :prompt-history 'widget-face-prompt-value-history + :format-handler 'cus--face-link :validate (lambda (widget) (unless (facep (widget-value widget)) (widget-put widget -- cgit v1.2.3 From 281524943f1eba8f68602125e3fe2c96a68c51fe Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 27 Oct 2020 12:11:28 +0100 Subject: * lisp/net/sieve-mode.el: Use lexical-binding. --- lisp/net/sieve-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el index d6dc008e87a..7475a7b59d5 100644 --- a/lisp/net/sieve-mode.el +++ b/lisp/net/sieve-mode.el @@ -1,4 +1,4 @@ -;;; sieve-mode.el --- Sieve code editing commands for Emacs +;;; sieve-mode.el --- Sieve code editing commands for Emacs -*- lexical-binding: t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From 990c0620cb9fee3f4779468662d8447c2b301156 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Oct 2020 12:18:27 +0100 Subject: Make edit-abbrevs parsing less brittle * lisp/abbrev.el (define-abbrevs): Make the parsing less brittle -- allow more blank lines (bug#42611). --- lisp/abbrev.el | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/lisp/abbrev.el b/lisp/abbrev.el index dc52a220125..f35c637eed5 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -189,17 +189,21 @@ the ones defined from the buffer now." (table (read buf)) abbrevs name hook exp count sys) (forward-line 1) - (while (progn (forward-line 1) - (not (eolp))) - (setq name (read buf) count (read buf)) - (if (equal count '(sys)) - (setq sys t count (read buf)) - (setq sys nil)) - (setq exp (read buf)) - (skip-chars-backward " \t\n\f") - (setq hook (if (not (eolp)) (read buf))) - (skip-chars-backward " \t\n\f") - (setq abbrevs (cons (list name exp hook count sys) abbrevs))) + (while (and (not (eobp)) + ;; Advance as long as we're looking at blank lines + ;; or we have an abbrev. + (looking-at "[ \t\n]\\|\\(\"\\)")) + (when (match-string 1) + (setq name (read buf) count (read buf)) + (if (equal count '(sys)) + (setq sys t count (read buf)) + (setq sys nil)) + (setq exp (read buf)) + (skip-chars-backward " \t\n\f") + (setq hook (if (not (eolp)) (read buf))) + (skip-chars-backward " \t\n\f") + (setq abbrevs (cons (list name exp hook count sys) abbrevs))) + (forward-line 1)) (define-abbrev-table table abbrevs))))) (defun read-abbrev-file (&optional file quietly) -- cgit v1.2.3 From f971a612a92eea4c8aab6b002d7998bb0b6f5ca1 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Tue, 27 Oct 2020 11:52:38 +0100 Subject: Don't rely on bignums in ntlm.el Since ntlm.el is distributed as a separate package in GNU ELPA and should be able to run on older Emacs versions without bignums, we cannot make use of them here. See discussion at https://lists.gnu.org/archive/html/emacs-devel/2020-10/msg01665.html. Instead, we add a small poor man's bignum implementation. * lisp/net/ntlm.el (ntlm--bignat-of-int, ntlm--bignat-add) (ntlm--bignat-shift-left, ntlm--bignat-mul-byte, ntlm--bignat-mul) (ntlm--bignat-of-string, ntlm--bignat-of-digits) (ntlm--bignat-to-int64): New. (ntlm--time-to-timestamp): Use the ntlm--bignat- functions instead of Lisp integers. * test/lisp/net/ntlm-tests.el: New file. --- lisp/net/ntlm.el | 88 +++++++++++++++++++++++++++++++++++++++------ test/lisp/net/ntlm-tests.el | 52 +++++++++++++++++++++++++++ 2 files changed, 129 insertions(+), 11 deletions(-) create mode 100644 test/lisp/net/ntlm-tests.el diff --git a/lisp/net/ntlm.el b/lisp/net/ntlm.el index 9401430799c..6d1cf2da71f 100644 --- a/lisp/net/ntlm.el +++ b/lisp/net/ntlm.el @@ -132,23 +132,89 @@ is not given." domain ;buffer field )))) +;; Poor man's bignums: natural numbers represented as lists of bytes +;; in little-endian order. +;; When this code no longer needs to run on Emacs 26 or older, all this +;; silliness should be simplified to use ordinary Lisp integers. + +(eval-and-compile ; for compile-time simplification + (defun ntlm--bignat-of-int (x) + "Convert the natural number X into a bignat." + (declare (pure t)) + (and (not (zerop x)) + (cons (logand x #xff) (ntlm--bignat-of-int (ash x -8))))) + + (defun ntlm--bignat-add (a b &optional carry) + "Add the bignats A and B and the natural number CARRY." + (declare (pure t)) + (and (or a b (and carry (not (zerop carry)))) + (let ((s (+ (if a (car a) 0) + (if b (car b) 0) + (or carry 0)))) + (cons (logand s #xff) + (ntlm--bignat-add (cdr a) (cdr b) (ash s -8)))))) + + (defun ntlm--bignat-shift-left (x n) + "Multiply the bignat X by 2^{8N}." + (declare (pure t)) + (if (zerop n) x (ntlm--bignat-shift-left (cons 0 x) (1- n)))) + + (defun ntlm--bignat-mul-byte (a b) + "Multiply the bignat A with the byte B." + (declare (pure t)) + (let ((p (mapcar (lambda (x) (* x b)) a))) + (ntlm--bignat-add + (mapcar (lambda (x) (logand x #xff)) p) + (cons 0 (mapcar (lambda (x) (ash x -8)) p))))) + + (defun ntlm--bignat-mul (a b) + "Multiply the bignats A and B." + (declare (pure t)) + (and a b (ntlm--bignat-add (ntlm--bignat-mul-byte a (car b)) + (cons 0 (ntlm--bignat-mul a (cdr b)))))) + + (defun ntlm--bignat-of-string (s) + "Convert the string S (in decimal) to a bignat." + (declare (pure t)) + (ntlm--bignat-of-digits (reverse (string-to-list s)))) + + (defun ntlm--bignat-of-digits (digits) + "Convert the little-endian list DIGITS of decimal digits to a bignat." + (declare (pure t)) + (and digits + (ntlm--bignat-add + nil + (ntlm--bignat-mul-byte (ntlm--bignat-of-digits (cdr digits)) 10) + (- (car digits) ?0)))) + + (defun ntlm--bignat-to-int64 (x) + "Convert the bignat X to a 64-bit little-endian number as a string." + (declare (pure t)) + (apply #'unibyte-string (mapcar (lambda (n) (or (nth n x) 0)) + (number-sequence 0 7)))) + ) + (defun ntlm--time-to-timestamp (time) "Convert TIME to an NTLMv2 timestamp. Return a unibyte string representing the number of tenths of a microsecond since January 1, 1601 as a 64-bit little-endian signed integer. TIME must be on the form (HIGH LOW USEC PSEC)." - (let* ((s (+ (ash (nth 0 time) 16) (nth 1 time))) - (us (nth 2 time)) - (ps (nth 3 time)) + (let* ((s-hi (ntlm--bignat-of-int (nth 0 time))) + (s-lo (ntlm--bignat-of-int (nth 1 time))) + (s (ntlm--bignat-add (ntlm--bignat-shift-left s-hi 2) s-lo)) + (us*10 (ntlm--bignat-of-int (* (nth 2 time) 10))) + (ps/1e5 (ntlm--bignat-of-int (/ (nth 3 time) 100000))) + ;; tenths of microseconds between 1601-01-01 and 1970-01-01 + (to-unix-epoch (ntlm--bignat-of-string "116444736000000000")) (tenths-of-us-since-jan-1-1601 - (+ (* s 10000000) (* us 10) (/ ps 100000) - ;; tenths of microseconds between 1601-01-01 and 1970-01-01 - 116444736000000000))) - (apply #'unibyte-string - (mapcar (lambda (i) - (logand (ash tenths-of-us-since-jan-1-1601 (* i -8)) - #xff)) - (number-sequence 0 7))))) + (ntlm--bignat-add + (ntlm--bignat-add + (ntlm--bignat-add + (ntlm--bignat-mul s (ntlm--bignat-of-int 10000000)) + us*10) + ps/1e5) + to-unix-epoch))) + (ntlm--bignat-to-int64 tenths-of-us-since-jan-1-1601))) (defun ntlm-compute-timestamp () "Current time as an NTLMv2 timestamp, as a unibyte string." diff --git a/test/lisp/net/ntlm-tests.el b/test/lisp/net/ntlm-tests.el new file mode 100644 index 00000000000..e515ebe2635 --- /dev/null +++ b/test/lisp/net/ntlm-tests.el @@ -0,0 +1,52 @@ +;;; ntlm-tests.el --- tests for ntlm.el -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; 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 . + +(require 'ert) +(require 'ntlm) + +;; This is the Lisp bignum implementation of `ntlm--time-to-timestamp', +;; for reference. +(defun ntlm-tests--time-to-timestamp (time) + "Convert TIME to an NTLMv2 timestamp. +Return a unibyte string representing the number of tenths of a +microsecond since January 1, 1601 as a 64-bit little-endian +signed integer. TIME must be on the form (HIGH LOW USEC PSEC)." + (let* ((s (+ (ash (nth 0 time) 16) (nth 1 time))) + (us (nth 2 time)) + (ps (nth 3 time)) + (tenths-of-us-since-jan-1-1601 + (+ (* s 10000000) (* us 10) (/ ps 100000) + ;; tenths of microseconds between 1601-01-01 and 1970-01-01 + 116444736000000000))) + (apply #'unibyte-string + (mapcar (lambda (i) + (logand (ash tenths-of-us-since-jan-1-1601 (* i -8)) + #xff)) + (number-sequence 0 7))))) + +(ert-deftest ntlm-time-to-timestamp () + ;; Verify poor man's bignums in implementation that can run on Emacs < 27.1. + (let ((time '(24471 63910 412962 0))) + (should (equal (ntlm--time-to-timestamp time) + (ntlm-tests--time-to-timestamp time)))) + (let ((time '(397431 65535 999999 999999))) + (should (equal (ntlm--time-to-timestamp time) + (ntlm-tests--time-to-timestamp time))))) + +(provide 'ntlm-tests) -- cgit v1.2.3 From cde72637dfd6989081ed8b2f26e7187c309780b8 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Mon, 26 Oct 2020 18:44:05 +0100 Subject: Fix sunrise and sunset calculation (bug#44237) * lisp/calendar/solar.el (solar-moment): Use initial values for binary search that won't end the loop prematurely and yield incorrect answers. * test/lisp/calendar/solar-tests.el: New file. --- lisp/calendar/solar.el | 4 ++-- test/lisp/calendar/solar-tests.el | 42 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 test/lisp/calendar/solar-tests.el diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el index 05bb3164e12..07562f62240 100644 --- a/lisp/calendar/solar.el +++ b/lisp/calendar/solar.el @@ -490,8 +490,8 @@ Uses binary search." (utmin (+ ut (* direction 12.0))) (utmax ut) ; the time searched is between utmin and utmax ;; utmin and utmax are in hours. - (utmoment-old 0.0) ; rise or set approximation - (utmoment 1.0) ; rise or set approximation + (utmoment-old utmin) ; rise or set approximation + (utmoment utmax) ; rise or set approximation (hut 0) ; sun height at utmoment (t0 (car time)) (hmin (cadr (solar-horizontal-coordinates (list t0 utmin) diff --git a/test/lisp/calendar/solar-tests.el b/test/lisp/calendar/solar-tests.el new file mode 100644 index 00000000000..441beafe71c --- /dev/null +++ b/test/lisp/calendar/solar-tests.el @@ -0,0 +1,42 @@ +;;; solar-tests.el --- tests for solar.el -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; 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 . + +(require 'ert) +(require 'solar) + +(ert-deftest solar-sunrise-sunset () + ;; Bug#44237: wrong sunrise time on Dec 30 and 31, 2020 for Jaipur. + (let ((calendar-latitude 26.9) + (calendar-longitude 75.8) + (calendar-time-zone +330) + (calendar-standard-time-zone-name "IST") + (calendar-daylight-time-zone-name "IST") + (epsilon (/ 60.0))) ; Minute accuracy is good enough. + (let* ((sunrise-sunset (solar-sunrise-sunset '(12 30 2020))) + (sunrise (car (nth 0 sunrise-sunset))) + (sunset (car (nth 1 sunrise-sunset)))) + (should (< (abs (- sunrise 7.27)) epsilon)) + (should (< (abs (- sunset 17.72)) epsilon))) + (let* ((sunrise-sunset (solar-sunrise-sunset '(12 31 2020))) + (sunrise (car (nth 0 sunrise-sunset))) + (sunset (car (nth 1 sunrise-sunset)))) + (should (< (abs (- sunrise 7.28)) epsilon)) + (should (< (abs (- sunset 17.72)) epsilon))))) + +(provide 'solar-tests) -- cgit v1.2.3 From 88f5530a9b861ae3f3003171ef9efa98ab1f8222 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Tue, 27 Oct 2020 13:20:20 +0100 Subject: ERT: escape control characters in pretty-printed error output * lisp/emacs-lisp/ert.el (ert--pp-with-indentation-and-newline): Escape control characters which would otherwise be blasted directly to the terminal (when running noninteractively) with unpleasant results. --- lisp/emacs-lisp/ert.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index ebb27e8a62c..baa04f2c6af 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1305,7 +1305,8 @@ EXPECTEDP specifies whether the result was expected." "Pretty-print OBJECT, indenting it to the current column of point. Ensures a final newline is inserted." (let ((begin (point)) - (pp-escape-newlines nil)) + (pp-escape-newlines nil) + (print-escape-control-characters t)) (pp object (current-buffer)) (unless (bolp) (insert "\n")) (save-excursion -- cgit v1.2.3 From 608c821716e20a6ba973219beb1edf14139ea12a Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Oct 2020 13:44:16 +0100 Subject: Fix history problem in `M-x shell' when started twice * lisp/comint.el (comint-input-ring-file-name): Avoid having this variable being killed on mode restart while the other ring variables aren't (bug#39667). This would mean that `M-x shell'/`C-d'/`M-x shell' didn't save commands entered after the second `M-x shell'. --- lisp/comint.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/comint.el b/lisp/comint.el index 944e1ae8c06..2873416c5f4 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -611,6 +611,7 @@ The command \\[comint-accumulate] sets this.") (put 'comint-replace-by-expanded-history 'menu-enable 'comint-input-autoexpand) (put 'comint-input-ring 'permanent-local t) +(put 'comint-input-ring-file-name 'permanent-local t) (put 'comint-input-ring-index 'permanent-local t) (put 'comint-save-input-ring-index 'permanent-local t) (put 'comint-input-autoexpand 'permanent-local t) -- cgit v1.2.3 From d34082671a03e0567a903a9d683e4fa5836c00a6 Mon Sep 17 00:00:00 2001 From: Simen HeggestĂžyl Date: Mon, 26 Oct 2020 10:01:44 +0100 Subject: Complete property values in multi-line CSS declarations * lisp/textmodes/css-mode.el (css--complete-property-value): Complete property values even when preceded by a newline (bug#44214). --- lisp/textmodes/css-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 0d1eeed5611..748a561bab5 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1357,7 +1357,9 @@ the string PROPERTY." (defun css--complete-property-value () "Complete property value at point." (let ((property (and (looking-back "\\([[:alnum:]-]+\\):[^/][^;]*" - (line-beginning-position) t) + (or (ppss-innermost-start (syntax-ppss)) + (point-min)) + t) (member (match-string-no-properties 1) css-property-ids)))) (when property -- cgit v1.2.3 From a8426f46726d94cdf21c0e6b3c85c0afe0064784 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 27 Oct 2020 08:35:10 -0700 Subject: Temporarily mark two failing tests ; Persistently failing tests can cause problems for automated builds, ; and make it harder to spot new failures. * test/lisp/xt-mouse-tests.el (xt-mouse-tracking-basic) (xt-mouse-tracking-utf-8): Currently failing. --- test/lisp/xt-mouse-tests.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/lisp/xt-mouse-tests.el b/test/lisp/xt-mouse-tests.el index 61bd7590183..2b27e3cbc8b 100644 --- a/test/lisp/xt-mouse-tests.el +++ b/test/lisp/xt-mouse-tests.el @@ -52,6 +52,7 @@ (xterm-mouse-mode 0))))) (ert-deftest xt-mouse-tracking-basic () + :expected-result :failed ; FIXME (should (equal (xterm-mouse-tracking-enable-sequence) "\e[?1000h\e[?1002h\e[?1006h")) (should (equal (xterm-mouse-tracking-disable-sequence) @@ -71,6 +72,7 @@ (should (equal xy '(184 . 95)))))))) (ert-deftest xt-mouse-tracking-utf-8 () + :expected-result :failed ; FIXME (let ((xterm-mouse-utf-8 t)) (should (equal (xterm-mouse-tracking-enable-sequence) "\e[?1000h\e[?1002h\e[?1005h\e[?1006h")) -- cgit v1.2.3 From 7b257dff01d9f8dde497745352e62203d7e665d0 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Sun, 25 Oct 2020 13:27:52 +0100 Subject: gdb-mi: Don't use bindat for field access Replace uses of bindat-get-field with a simpler accessor, since nothing here uses the bindat machinery in any way. * lisp/progmodes/gdb-mi.el (gdb-mi--field): New. (gdb-get-many-fields): Remove. (gdb-var-create-handler, gdb-var-list-children-handler) (gdb-var-update-handler, gdb-current-buffer-frame) (gdb-update-gud-running, gdb-thread-exited, gdb-thread-selected) (gdb-running, gdb-stopped, gdb-breakpoints-list-handler-custom) (gdb-place-breakpoints, gdb-thread-list-handler-custom) (def-gdb-thread-buffer-simple-command, gdb-select-thread) (def-gdb-thread-buffer-gud-command, gdb-read-memory-custom) (gdb-invalidate-disassembly, gdb-disassembly-handler-custom) (gdb-disassembly-place-breakpoints, gdb-toggle-breakpoint) (gdb-delete-breakpoint, gdb-goto-breakpoint, gdb-frame-location) (gdb-stack-list-frames-custom, gdb-select-frame) (gdb-edit-locals-value, gdb-locals-handler-custom) (gdb-registers-handler-custom, gdb-changed-registers-handler) (gdb-register-names-handler, gdb-frame-handler): Use gdb-mi--field. --- lisp/progmodes/gdb-mi.el | 267 +++++++++++++++++++++++------------------------ 1 file changed, 132 insertions(+), 135 deletions(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 9e8af84a600..36e941fa426 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -90,7 +90,6 @@ (require 'gud) (require 'json) -(require 'bindat) (require 'cl-lib) (require 'cl-seq) (eval-when-compile (require 'pcase)) @@ -516,8 +515,6 @@ contains fields of corresponding MI *stopped async record: Note that \"reason\" is only present in non-stop debugging mode. -`bindat-get-field' may be used to access the fields of response. - Each function is called after the new current thread was selected and GDB buffers were updated in `gdb-stopped'." :type '(repeat function) @@ -1265,20 +1262,23 @@ With arg, enter name of variable to be watched in the minibuffer." `(lambda () (gdb-var-create-handler ,expr)))))) (message "gud-watch is a no-op in this mode.")))) +(defsubst gdb-mi--field (value field) + (cdr (assq field value))) + (defun gdb-var-create-handler (expr) (let* ((result (gdb-json-partial-output))) - (if (not (bindat-get-field result 'msg)) + (if (not (gdb-mi--field result 'msg)) (let ((var - (list (bindat-get-field result 'name) + (list (gdb-mi--field result 'name) (if (and (string-equal gdb-current-language "c") gdb-use-colon-colon-notation gdb-selected-frame) (setq expr (concat gdb-selected-frame "::" expr)) expr) - (bindat-get-field result 'numchild) - (bindat-get-field result 'type) - (bindat-get-field result 'value) + (gdb-mi--field result 'numchild) + (gdb-mi--field result 'type) + (gdb-mi--field result 'value) nil - (bindat-get-field result 'has_more) + (gdb-mi--field result 'has_more) gdb-frame-address))) (push var gdb-var-list) (speedbar 1) @@ -1317,23 +1317,23 @@ With arg, enter name of variable to be watched in the minibuffer." (defun gdb-var-list-children-handler (varnum) (let* ((var-list nil) - (output (gdb-json-partial-output "child")) - (children (bindat-get-field output 'children))) + (output (gdb-json-partial-output 'child)) + (children (gdb-mi--field output 'children))) (catch 'child-already-watched (dolist (var gdb-var-list) (if (string-equal varnum (car var)) (progn ;; With dynamic varobjs numchild may have increased. - (setcar (nthcdr 2 var) (bindat-get-field output 'numchild)) + (setcar (nthcdr 2 var) (gdb-mi--field output 'numchild)) (push var var-list) (dolist (child children) - (let ((varchild (list (bindat-get-field child 'name) - (bindat-get-field child 'exp) - (bindat-get-field child 'numchild) - (bindat-get-field child 'type) - (bindat-get-field child 'value) + (let ((varchild (list (gdb-mi--field child 'name) + (gdb-mi--field child 'exp) + (gdb-mi--field child 'numchild) + (gdb-mi--field child 'type) + (gdb-mi--field child 'value) nil - (bindat-get-field child 'has_more)))) + (gdb-mi--field child 'has_more)))) (if (assoc (car varchild) gdb-var-list) (throw 'child-already-watched nil)) (push varchild var-list)))) @@ -1392,17 +1392,17 @@ With arg, enter name of variable to be watched in the minibuffer." 'gdb-var-update)) (defun gdb-var-update-handler () - (let ((changelist (bindat-get-field (gdb-json-partial-output) 'changelist))) + (let ((changelist (gdb-mi--field (gdb-json-partial-output) 'changelist))) (dolist (var gdb-var-list) (setcar (nthcdr 5 var) nil)) (let ((temp-var-list gdb-var-list)) (dolist (change changelist) - (let* ((varnum (bindat-get-field change 'name)) + (let* ((varnum (gdb-mi--field change 'name)) (var (assoc varnum gdb-var-list)) - (new-num (bindat-get-field change 'new_num_children))) + (new-num (gdb-mi--field change 'new_num_children))) (when var - (let ((scope (bindat-get-field change 'in_scope)) - (has-more (bindat-get-field change 'has_more))) + (let ((scope (gdb-mi--field change 'in_scope)) + (has-more (gdb-mi--field change 'has_more))) (cond ((string-equal scope "false") (if gdb-delete-out-of-scope (gdb-var-delete-1 var varnum) @@ -1414,12 +1414,12 @@ With arg, enter name of variable to be watched in the minibuffer." (not new-num) (string-equal (nth 2 var) "0")) (setcar (nthcdr 4 var) - (bindat-get-field change 'value)) + (gdb-mi--field change 'value)) (setcar (nthcdr 5 var) 'changed))) ((string-equal scope "invalid") (gdb-var-delete-1 var varnum))))) (let ((var-list nil) var1 - (children (bindat-get-field change 'new_children))) + (children (gdb-mi--field change 'new_children))) (when new-num (setq var1 (pop temp-var-list)) (while var1 @@ -1435,13 +1435,13 @@ With arg, enter name of variable to be watched in the minibuffer." (push (pop temp-var-list) var-list)) (dolist (child children) (let ((varchild - (list (bindat-get-field child 'name) - (bindat-get-field child 'exp) - (bindat-get-field child 'numchild) - (bindat-get-field child 'type) - (bindat-get-field child 'value) + (list (gdb-mi--field child 'name) + (gdb-mi--field child 'exp) + (gdb-mi--field child 'numchild) + (gdb-mi--field child 'type) + (gdb-mi--field child 'value) 'changed - (bindat-get-field child 'has_more)))) + (gdb-mi--field child 'has_more)))) (push varchild var-list)))) ;; Remove deleted children from list. ((< new previous) @@ -1522,7 +1522,7 @@ thread." (defun gdb-current-buffer-frame () "Get current stack frame object for thread of current buffer." - (bindat-get-field (gdb-current-buffer-thread) 'frame)) + (gdb-mi--field (gdb-current-buffer-thread) 'frame)) (defun gdb-buffer-type (buffer) "Get value of `gdb-buffer-type' for BUFFER." @@ -2057,7 +2057,7 @@ For all-stop mode, thread information is unavailable while target is running." (let ((old-value gud-running)) (setq gud-running - (string= (bindat-get-field (gdb-current-buffer-thread) 'state) + (string= (gdb-mi--field (gdb-current-buffer-thread) 'state) "running")) ;; Set frame number to "0" when _current_ threads stops. (when (and (gdb-current-buffer-thread) @@ -2565,7 +2565,7 @@ file names include non-ASCII characters." (defun gdb-thread-exited (_token output-field) "Handle =thread-exited async record. Unset `gdb-thread-number' if current thread exited and update threads list." - (let* ((thread-id (bindat-get-field (gdb-json-string output-field) 'id))) + (let* ((thread-id (gdb-mi--field (gdb-json-string output-field) 'id))) (if (string= gdb-thread-number thread-id) (gdb-setq-thread-number nil)) ;; When we continue current thread and it quickly exits, @@ -2580,7 +2580,7 @@ Unset `gdb-thread-number' if current thread exited and update threads list." Sets `gdb-thread-number' to new id." (let* ((result (gdb-json-string output-field)) - (thread-id (bindat-get-field result 'id))) + (thread-id (gdb-mi--field result 'id))) (gdb-setq-thread-number thread-id) ;; Typing `thread N' in GUD buffer makes GDB emit `^done' followed ;; by `=thread-selected' notification. `^done' causes `gdb-update' @@ -2595,7 +2595,7 @@ Sets `gdb-thread-number' to new id." (defun gdb-running (_token output-field) (let* ((thread-id - (bindat-get-field (gdb-json-string output-field) 'thread-id))) + (gdb-mi--field (gdb-json-string output-field) 'thread-id))) ;; We reset gdb-frame-number to nil if current thread has gone ;; running. This can't be done in gdb-thread-list-handler-custom ;; because we need correct gdb-frame-number by the time @@ -2625,10 +2625,10 @@ Sets `gdb-thread-number' to new id." current thread and update GDB buffers." ;; Reason is available with target-async only (let* ((result (gdb-json-string output-field)) - (reason (bindat-get-field result 'reason)) - (thread-id (bindat-get-field result 'thread-id)) - (retval (bindat-get-field result 'return-value)) - (varnum (bindat-get-field result 'gdb-result-var))) + (reason (gdb-mi--field result 'reason)) + (thread-id (gdb-mi--field result 'thread-id)) + (retval (gdb-mi--field result 'return-value)) + (varnum (gdb-mi--field result 'gdb-result-var))) ;; -data-list-register-names needs to be issued for any stopped ;; thread @@ -2671,7 +2671,7 @@ current thread and update GDB buffers." ;; gdb-switch-when-another-stopped: (when (or gdb-switch-when-another-stopped (not (string= "stopped" - (bindat-get-field (gdb-current-buffer-thread) 'state)))) + (gdb-mi--field (gdb-current-buffer-thread) 'state)))) ;; Switch if current reason has been selected or we have no ;; reasons (if (or (eq gdb-switch-reasons t) @@ -2937,14 +2937,6 @@ calling `gdb-table-string'." (gdb-table-row-properties table)) "\n"))) -;; bindat-get-field goes deep, gdb-get-many-fields goes wide -(defun gdb-get-many-fields (struct &rest fields) - "Return a list of FIELDS values from STRUCT." - (let ((values)) - (dolist (field fields) - (push (bindat-get-field struct field) values)) - (nreverse values))) - (defmacro def-gdb-auto-update-trigger (trigger-name gdb-command handler-name &optional signal-list) @@ -3032,26 +3024,27 @@ See `def-gdb-auto-update-handler'." 'gdb-invalidate-breakpoints) (defun gdb-breakpoints-list-handler-custom () - (let ((breakpoints-list (bindat-get-field - (gdb-json-partial-output "bkpt" "script") - 'BreakpointTable 'body)) + (let ((breakpoints-list (gdb-mi--field + (gdb-mi--field (gdb-json-partial-output 'bkpt) + 'BreakpointTable) + 'body)) (table (make-gdb-table))) (setq gdb-breakpoints-list nil) (gdb-table-add-row table '("Num" "Type" "Disp" "Enb" "Addr" "Hits" "What")) (dolist (breakpoint breakpoints-list) (add-to-list 'gdb-breakpoints-list - (cons (bindat-get-field breakpoint 'number) + (cons (gdb-mi--field breakpoint 'number) breakpoint)) - (let ((at (bindat-get-field breakpoint 'at)) - (pending (bindat-get-field breakpoint 'pending)) - (func (bindat-get-field breakpoint 'func)) - (type (bindat-get-field breakpoint 'type))) + (let ((at (gdb-mi--field breakpoint 'at)) + (pending (gdb-mi--field breakpoint 'pending)) + (func (gdb-mi--field breakpoint 'func)) + (type (gdb-mi--field breakpoint 'type))) (gdb-table-add-row table (list - (bindat-get-field breakpoint 'number) + (gdb-mi--field breakpoint 'number) (or type "") - (or (bindat-get-field breakpoint 'disp) "") - (let ((flag (bindat-get-field breakpoint 'enabled))) + (or (gdb-mi--field breakpoint 'disp) "") + (let ((flag (gdb-mi--field breakpoint 'enabled))) (if (string-equal flag "y") (eval-when-compile (propertize "y" 'font-lock-face @@ -3059,10 +3052,10 @@ See `def-gdb-auto-update-handler'." (eval-when-compile (propertize "n" 'font-lock-face font-lock-comment-face)))) - (bindat-get-field breakpoint 'addr) - (or (bindat-get-field breakpoint 'times) "") + (gdb-mi--field breakpoint 'addr) + (or (gdb-mi--field breakpoint 'times) "") (if (and type (string-match ".*watchpoint" type)) - (bindat-get-field breakpoint 'what) + (gdb-mi--field breakpoint 'what) (or pending at (concat "in " (propertize (or func "unknown") @@ -3087,11 +3080,11 @@ See `def-gdb-auto-update-handler'." (dolist (breakpoint gdb-breakpoints-list) (let* ((breakpoint (cdr breakpoint)) ; gdb-breakpoints-list is ; an associative list - (line (bindat-get-field breakpoint 'line))) + (line (gdb-mi--field breakpoint 'line))) (when line - (let ((file (bindat-get-field breakpoint 'fullname)) - (flag (bindat-get-field breakpoint 'enabled)) - (bptno (bindat-get-field breakpoint 'number))) + (let ((file (gdb-mi--field breakpoint 'fullname)) + (flag (gdb-mi--field breakpoint 'enabled)) + (bptno (gdb-mi--field breakpoint 'number))) (unless (and file (file-exists-p file)) (setq file (cdr (assoc bptno gdb-location-alist)))) (if (or (null file) @@ -3099,7 +3092,7 @@ See `def-gdb-auto-update-handler'." ;; If the full filename is not recorded in the ;; breakpoint structure or in `gdb-location-alist', use ;; -file-list-exec-source-file to extract it. - (when (setq file (bindat-get-field breakpoint 'file)) + (when (setq file (gdb-mi--field breakpoint 'file)) (gdb-input (concat "list " file ":1") 'ignore) (gdb-input "-file-list-exec-source-file" `(lambda () (gdb-get-location @@ -3355,7 +3348,7 @@ corresponding to the mode line clicked." 'gdb-invalidate-threads) (defun gdb-thread-list-handler-custom () - (let ((threads-list (bindat-get-field (gdb-json-partial-output) 'threads)) + (let ((threads-list (gdb-mi--field (gdb-json-partial-output) 'threads)) (table (make-gdb-table)) (marked-line nil)) (setq gdb-threads-list nil) @@ -3364,9 +3357,9 @@ corresponding to the mode line clicked." (set-marker gdb-thread-position nil) (dolist (thread (reverse threads-list)) - (let ((running (equal (bindat-get-field thread 'state) "running"))) + (let ((running (equal (gdb-mi--field thread 'state) "running"))) (add-to-list 'gdb-threads-list - (cons (bindat-get-field thread 'id) + (cons (gdb-mi--field thread 'id) thread)) (cl-incf (if running gdb-running-threads-count @@ -3375,37 +3368,41 @@ corresponding to the mode line clicked." (gdb-table-add-row table (list - (bindat-get-field thread 'id) + (gdb-mi--field thread 'id) (concat (if gdb-thread-buffer-verbose-names - (concat (bindat-get-field thread 'target-id) " ") "") - (bindat-get-field thread 'state) + (concat (gdb-mi--field thread 'target-id) " ") "") + (gdb-mi--field thread 'state) ;; Include frame information for stopped threads (if (not running) (concat - " in " (bindat-get-field thread 'frame 'func) + " in " (gdb-mi--field (gdb-mi--field thread 'frame) 'func) (if gdb-thread-buffer-arguments (concat " (" - (let ((args (bindat-get-field thread 'frame 'args))) + (let ((args (gdb-mi--field (gdb-mi--field thread 'frame) + 'args))) (mapconcat (lambda (arg) - (apply #'format "%s=%s" - (gdb-get-many-fields arg 'name 'value))) + (format "%s=%s" + (gdb-mi--field arg 'name) + (gdb-mi--field arg 'value))) args ",")) ")") "") (if gdb-thread-buffer-locations - (gdb-frame-location (bindat-get-field thread 'frame)) "") + (gdb-frame-location (gdb-mi--field thread 'frame)) "") (if gdb-thread-buffer-addresses - (concat " at " (bindat-get-field thread 'frame 'addr)) "")) + (concat " at " (gdb-mi--field (gdb-mi--field thread 'frame) + 'addr)) + "")) ""))) (list 'gdb-thread thread 'mouse-face 'highlight 'help-echo "mouse-2, RET: select thread"))) (when (string-equal gdb-thread-number - (bindat-get-field thread 'id)) + (gdb-mi--field thread 'id)) (setq marked-line (length gdb-threads-list)))) (insert (gdb-table-string table " ")) (when marked-line @@ -3437,11 +3434,11 @@ If `gdb-thread' is nil, error is signaled." "Define a NAME which will call BUFFER-COMMAND with id of thread on the current line." `(def-gdb-thread-buffer-command ,name - (,buffer-command (bindat-get-field thread 'id)) + (,buffer-command (gdb-mi--field thread 'id)) ,doc)) (def-gdb-thread-buffer-command gdb-select-thread - (let ((new-id (bindat-get-field thread 'id))) + (let ((new-id (gdb-mi--field thread 'id))) (gdb-setq-thread-number new-id) (gdb-input (concat "-thread-select " new-id) 'ignore) (gdb-update)) @@ -3493,7 +3490,7 @@ on the current line." line." `(def-gdb-thread-buffer-command ,name (if gdb-non-stop - (let ((gdb-thread-number (bindat-get-field thread 'id)) + (let ((gdb-thread-number (gdb-mi--field thread 'id)) (gdb-gud-control-all-threads nil)) (call-interactively #',gud-command)) (error "Available in non-stop mode only, customize `gdb-non-stop-setting'")) @@ -3593,19 +3590,19 @@ in `gdb-memory-format'." (defun gdb-read-memory-custom () (let* ((res (gdb-json-partial-output)) - (err-msg (bindat-get-field res 'msg))) + (err-msg (gdb-mi--field res 'msg))) (if (not err-msg) - (let ((memory (bindat-get-field res 'memory))) + (let ((memory (gdb-mi--field res 'memory))) (when gdb-memory-last-address ;; Nil means last retrieve emits error or just started the session. (setq gdb--memory-display-warning nil)) - (setq gdb-memory-address (bindat-get-field res 'addr)) - (setq gdb-memory-next-page (bindat-get-field res 'next-page)) - (setq gdb-memory-prev-page (bindat-get-field res 'prev-page)) + (setq gdb-memory-address (gdb-mi--field res 'addr)) + (setq gdb-memory-next-page (gdb-mi--field res 'next-page)) + (setq gdb-memory-prev-page (gdb-mi--field res 'prev-page)) (setq gdb-memory-last-address gdb-memory-address) (dolist (row memory) - (insert (concat (bindat-get-field row 'addr) ":")) - (dolist (column (bindat-get-field row 'data)) + (insert (concat (gdb-mi--field row 'addr) ":")) + (dolist (column (gdb-mi--field row 'data)) (insert (gdb-pad-string column (+ 2 (gdb-memory-column-width gdb-memory-unit @@ -3944,8 +3941,8 @@ DOC is an optional documentation string." (def-gdb-auto-update-trigger gdb-invalidate-disassembly (let* ((frame (gdb-current-buffer-frame)) - (file (bindat-get-field frame 'fullname)) - (line (bindat-get-field frame 'line))) + (file (gdb-mi--field frame 'fullname)) + (line (gdb-mi--field frame 'line))) (if file (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line) ;; If we're unable to get a file name / line for $PC, simply @@ -4001,22 +3998,22 @@ DOC is an optional documentation string." 'gdb-invalidate-disassembly) (defun gdb-disassembly-handler-custom () - (let* ((instructions (bindat-get-field (gdb-json-partial-output) 'asm_insns)) - (address (bindat-get-field (gdb-current-buffer-frame) 'addr)) + (let* ((instructions (gdb-mi--field (gdb-json-partial-output) 'asm_insns)) + (address (gdb-mi--field (gdb-current-buffer-frame) 'addr)) (table (make-gdb-table)) (marked-line nil)) (dolist (instr instructions) (gdb-table-add-row table (list - (bindat-get-field instr 'address) + (gdb-mi--field instr 'address) (let - ((func-name (bindat-get-field instr 'func-name)) - (offset (bindat-get-field instr 'offset))) + ((func-name (gdb-mi--field instr 'func-name)) + (offset (gdb-mi--field instr 'offset))) (if func-name (format "<%s+%s>:" func-name offset) "")) - (bindat-get-field instr 'inst))) - (when (string-equal (bindat-get-field instr 'address) + (gdb-mi--field instr 'inst))) + (when (string-equal (gdb-mi--field instr 'address) address) (progn (setq marked-line (length (gdb-table-rows table))) @@ -4035,15 +4032,15 @@ DOC is an optional documentation string." (setq mode-name (gdb-current-context-mode-name (concat "Disassembly: " - (bindat-get-field (gdb-current-buffer-frame) 'func)))))) + (gdb-mi--field (gdb-current-buffer-frame) 'func)))))) (defun gdb-disassembly-place-breakpoints () (gdb-remove-breakpoint-icons (point-min) (point-max)) (dolist (breakpoint gdb-breakpoints-list) (let* ((breakpoint (cdr breakpoint)) - (bptno (bindat-get-field breakpoint 'number)) - (flag (bindat-get-field breakpoint 'enabled)) - (address (bindat-get-field breakpoint 'addr))) + (bptno (gdb-mi--field breakpoint 'number)) + (flag (gdb-mi--field breakpoint 'enabled)) + (address (gdb-mi--field breakpoint 'addr))) (save-excursion (goto-char (point-min)) (if (re-search-forward (concat "^" address) nil t) @@ -4073,10 +4070,10 @@ DOC is an optional documentation string." (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) (if breakpoint (gud-basic-call - (concat (if (equal "y" (bindat-get-field breakpoint 'enabled)) + (concat (if (equal "y" (gdb-mi--field breakpoint 'enabled)) "-break-disable " "-break-enable ") - (bindat-get-field breakpoint 'number))) + (gdb-mi--field breakpoint 'number))) (error "Not recognized as break/watchpoint line"))))) (defun gdb-delete-breakpoint () @@ -4087,7 +4084,7 @@ DOC is an optional documentation string." (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) (if breakpoint (gud-basic-call (concat "-break-delete " - (bindat-get-field breakpoint 'number))) + (gdb-mi--field breakpoint 'number))) (error "Not recognized as break/watchpoint line"))))) (defun gdb-goto-breakpoint (&optional event) @@ -4101,9 +4098,9 @@ DOC is an optional documentation string." (beginning-of-line) (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) (if breakpoint - (let ((bptno (bindat-get-field breakpoint 'number)) - (file (bindat-get-field breakpoint 'fullname)) - (line (bindat-get-field breakpoint 'line))) + (let ((bptno (gdb-mi--field breakpoint 'number)) + (file (gdb-mi--field breakpoint 'fullname)) + (line (gdb-mi--field breakpoint 'line))) (save-selected-window (let* ((buffer (find-file-noselect (if (file-exists-p file) file @@ -4134,28 +4131,28 @@ DOC is an optional documentation string." FRAME must have either \"file\" and \"line\" members or \"from\" member." - (let ((file (bindat-get-field frame 'file)) - (line (bindat-get-field frame 'line)) - (from (bindat-get-field frame 'from))) + (let ((file (gdb-mi--field frame 'file)) + (line (gdb-mi--field frame 'line)) + (from (gdb-mi--field frame 'from))) (let ((res (or (and file line (concat file ":" line)) from))) (if res (concat " of " res) "")))) (defun gdb-stack-list-frames-custom () - (let ((stack (bindat-get-field (gdb-json-partial-output "frame") 'stack)) + (let ((stack (gdb-mi--field (gdb-json-partial-output 'frame) 'stack)) (table (make-gdb-table))) (set-marker gdb-stack-position nil) (dolist (frame stack) (gdb-table-add-row table (list - (bindat-get-field frame 'level) + (gdb-mi--field frame 'level) "in" (concat - (bindat-get-field frame 'func) + (gdb-mi--field frame 'func) (if gdb-stack-buffer-locations (gdb-frame-location frame) "") (if gdb-stack-buffer-addresses - (concat " at " (bindat-get-field frame 'addr)) ""))) + (concat " at " (gdb-mi--field frame 'addr)) ""))) `(mouse-face highlight help-echo "mouse-2, RET: Select frame" gdb-frame ,frame))) @@ -4215,7 +4212,7 @@ member." (let ((frame (get-text-property (point) 'gdb-frame))) (if frame (if (gdb-buffer-shows-main-thread-p) - (let ((new-level (bindat-get-field frame 'level))) + (let ((new-level (gdb-mi--field frame 'level))) (setq gdb-frame-number new-level) (gdb-input (concat "-stack-select-frame " new-level) 'ignore) @@ -4261,7 +4258,7 @@ member." (save-excursion (if event (posn-set-point (event-end event))) (beginning-of-line) - (let* ((var (bindat-get-field + (let* ((var (gdb-mi--field (get-text-property (point) 'gdb-local-variable) 'name)) (value (read-string (format "New value (%s): " var)))) (gud-basic-call @@ -4270,12 +4267,12 @@ member." ;; Don't display values of arrays or structures. ;; These can be expanded using gud-watch. (defun gdb-locals-handler-custom () - (let ((locals-list (bindat-get-field (gdb-json-partial-output) 'locals)) + (let ((locals-list (gdb-mi--field (gdb-json-partial-output) 'locals)) (table (make-gdb-table))) (dolist (local locals-list) - (let ((name (bindat-get-field local 'name)) - (value (bindat-get-field local 'value)) - (type (bindat-get-field local 'type))) + (let ((name (gdb-mi--field local 'name)) + (value (gdb-mi--field local 'value)) + (type (gdb-mi--field local 'type))) (when (not value) (setq value "")) (if (or (not value) @@ -4301,7 +4298,7 @@ member." (setq mode-name (gdb-current-context-mode-name (concat "Locals: " - (bindat-get-field (gdb-current-buffer-frame) 'func)))))) + (gdb-mi--field (gdb-current-buffer-frame) 'func)))))) (defvar gdb-locals-header (list @@ -4367,11 +4364,11 @@ member." (defun gdb-registers-handler-custom () (when gdb-register-names (let ((register-values - (bindat-get-field (gdb-json-partial-output) 'register-values)) + (gdb-mi--field (gdb-json-partial-output) 'register-values)) (table (make-gdb-table))) (dolist (register register-values) - (let* ((register-number (bindat-get-field register 'number)) - (value (bindat-get-field register 'value)) + (let* ((register-number (gdb-mi--field register 'number)) + (value (gdb-mi--field register 'value)) (register-name (nth (string-to-number register-number) gdb-register-names))) (gdb-table-add-row @@ -4457,7 +4454,7 @@ member." (defun gdb-changed-registers-handler () (setq gdb-changed-registers nil) (dolist (register-number - (bindat-get-field (gdb-json-partial-output) 'changed-registers)) + (gdb-mi--field (gdb-json-partial-output) 'changed-registers)) (push register-number gdb-changed-registers))) (defun gdb-register-names-handler () @@ -4465,7 +4462,7 @@ member." ;; only once (in gdb-init-1) (setq gdb-register-names nil) (dolist (register-name - (bindat-get-field (gdb-json-partial-output) 'register-names)) + (gdb-mi--field (gdb-json-partial-output) 'register-names)) (push register-name gdb-register-names)) (setq gdb-register-names (reverse gdb-register-names))) @@ -4492,13 +4489,13 @@ Called from `gdb-update'." (defun gdb-frame-handler () "Set `gdb-selected-frame' and `gdb-selected-file' to show overlay arrow in source buffer." - (let ((frame (bindat-get-field (gdb-json-partial-output) 'frame))) + (let ((frame (gdb-mi--field (gdb-json-partial-output) 'frame))) (when frame - (setq gdb-selected-frame (bindat-get-field frame 'func)) - (setq gdb-selected-file (bindat-get-field frame 'fullname)) - (setq gdb-frame-number (bindat-get-field frame 'level)) - (setq gdb-frame-address (bindat-get-field frame 'addr)) - (let ((line (bindat-get-field frame 'line))) + (setq gdb-selected-frame (gdb-mi--field frame 'func)) + (setq gdb-selected-file (gdb-mi--field frame 'fullname)) + (setq gdb-frame-number (gdb-mi--field frame 'level)) + (setq gdb-frame-address (gdb-mi--field frame 'addr)) + (let ((line (gdb-mi--field frame 'line))) (setq gdb-selected-line (and line (string-to-number line))) (when (and gdb-selected-file gdb-selected-line) (setq gud-last-frame (cons gdb-selected-file gdb-selected-line)) -- cgit v1.2.3 From 5cb9b8c24df39c019966d7335992cdd428dc560c Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Tue, 27 Oct 2020 18:34:40 +0100 Subject: Small fix to the new link for inherited faces in Customize * lisp/cus-edit.el (cus--face-link): Link to the current value of the widget, rather than to the widget's value upon creation (bug#44154). --- lisp/cus-edit.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index ed0117e067b..769a69a50f2 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -3740,13 +3740,12 @@ the present value is saved to its :shown-value property instead." (custom-face-state-set widget)))))) (defun cus--face-link (widget _format) - (let ((face (intern (widget-get widget :value)))) - (widget-create-child-and-convert - widget 'face-link - :button-face 'link - :tag "link" - :action (lambda (&rest _x) - (customize-face face))))) + (widget-create-child-and-convert + widget 'face-link + :button-face 'link + :tag "link" + :action (lambda (&rest _x) + (customize-face (widget-value widget))))) (defvar custom-face-menu nil "If non-nil, an alist of actions for the `custom-face' widget. -- cgit v1.2.3 From 045d2a50ddccbebba315aac55f60dfa270b36d7f Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Oct 2020 18:46:16 +0100 Subject: Revert "Fontify strings in {} better in tcl-mode" This reverts commit 7f32224dc324b0ee0f1b512c8d8b19aeb80141c1. The changes led to things like proc foo5 () { return 6 } being fontified as a string, which is wrong. --- lisp/progmodes/tcl.el | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index 583f4e396e5..717008a0a22 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -386,36 +386,32 @@ Call `tcl-set-font-lock-keywords' after changing this list.") Default list includes some TclX keywords. Call `tcl-set-font-lock-keywords' after changing this list.") +(defvar tcl-builtin-list + '("after" "append" "array" "bgerror" "binary" "catch" "cd" "clock" + "close" "concat" "console" "dde" "encoding" "eof" "exec" "expr" + "fblocked" "fconfigure" "fcopy" "file" "fileevent" "flush" + "format" "gets" "glob" "history" "incr" "info" "interp" "join" + "lappend" "lindex" "linsert" "list" "llength" "load" "lrange" + "lreplace" "lsort" "namespace" "open" "package" "pid" "puts" "pwd" + "read" "regexp" "registry" "regsub" "rename" "scan" "seek" "set" + "socket" "source" "split" "string" "subst" "tell" "time" "trace" + "unknown" "unset" "vwait") + "List of Tcl commands. Used only for highlighting. +Call `tcl-set-font-lock-keywords' after changing this list. +This list excludes those commands already found in `tcl-proc-list' and +`tcl-keyword-list'.") + (defvar tcl-font-lock-keywords nil "Keywords to highlight for Tcl. See variable `font-lock-keywords'. This variable is generally set from `tcl-proc-regexp', `tcl-typeword-list', and `tcl-keyword-list' by the function `tcl-set-font-lock-keywords'.") -(eval-and-compile - (defvar tcl-builtin-list - '("after" "append" "array" "bgerror" "binary" "catch" "cd" "clock" - "close" "concat" "console" "dde" "encoding" "eof" "exec" "expr" - "fblocked" "fconfigure" "fcopy" "file" "fileevent" "flush" - "format" "gets" "glob" "history" "incr" "info" "interp" "join" - "lappend" "lindex" "linsert" "list" "llength" "load" "lrange" - "lreplace" "lsort" "namespace" "open" "package" "pid" "puts" "pwd" - "read" "regexp" "registry" "regsub" "rename" "scan" "seek" "set" - "socket" "source" "split" "string" "subst" "tell" "time" "trace" - "unknown" "unset" "vwait") - "List of Tcl commands. Used only for highlighting. -Call `tcl-set-font-lock-keywords' after changing this list. -This list excludes those commands already found in `tcl-proc-list' and -`tcl-keyword-list'.") - - (defconst tcl-syntax-propertize-function - (syntax-propertize-rules - ;; Mark the few `#' that are not comment-markers. - ("[^;[{ \t\n][ \t]*\\(#\\)" (1 ".")) - ((concat "\\_<" (regexp-opt tcl-builtin-list t) - "\\_>" "\s*{\\([^}].*\\)}") - (2 "_"))) - "Syntactic keywords for `tcl-mode'.")) +(defconst tcl-syntax-propertize-function + (syntax-propertize-rules + ;; Mark the few `#' that are not comment-markers. + ("[^;[{ \t\n][ \t]*\\(#\\)" (1 "."))) + "Syntactic keywords for `tcl-mode'.") ;; FIXME need some way to recognize variables because array refs look ;; like 2 sexps. @@ -510,7 +506,6 @@ Uses variables `tcl-proc-regexp' and `tcl-keyword-list'." ;; number of "namespace::" qualifiers. A leading "::" refers ;; to the global namespace. '("\\${\\([^}]+\\)}" 1 font-lock-variable-name-face) - '("{\\([^}]+\\)}" 1 font-lock-string-face) '("\\$\\(\\(?:::\\)?\\(?:[[:alnum:]_]+::\\)*[[:alnum:]_]+\\)" 1 font-lock-variable-name-face) '("\\(?:\\s-\\|^\\|\\[\\)set\\s-+{\\([^}]+\\)}" -- cgit v1.2.3 From 5a2b03043c767f219dcf5b14819cb8dede0e6e0c Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Tue, 27 Oct 2020 16:54:38 +0100 Subject: Remove unused function in gdb-mi.el * lisp/progmodes/gdb-mi.el (gdb-var-evaluate-expression-handler): Remove. (It was left behind in an old code reorganisation.) --- lisp/progmodes/gdb-mi.el | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 36e941fa426..aadfb7c2215 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1299,16 +1299,6 @@ With arg, enter name of variable to be watched in the minibuffer." (raise-frame speedbar-frame)) (speedbar-timer-fn)) -(defun gdb-var-evaluate-expression-handler (varnum changed) - (goto-char (point-min)) - (re-search-forward (concat ".*value=\\(" gdb--string-regexp "\\)") - nil t) - (let ((var (assoc varnum gdb-var-list))) - (when var - (if changed (setcar (nthcdr 5 var) 'changed)) - (setcar (nthcdr 4 var) (read (match-string 1))))) - (gdb-speedbar-update)) - ; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards. (defun gdb-var-list-children (varnum) (gdb-input (concat "-var-update " varnum) 'ignore) -- cgit v1.2.3 From 3a6d55b7922ff2d71b91b54812219ee9dcc33649 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Mon, 26 Oct 2020 22:02:55 +0100 Subject: gdb-mi: use lexical lambdas * lisp/progmodes/gdb-mi.el (gdb-tooltip-print-1, gud-watch) (gdb-var-list-children, gdb-edit-value) (gdb-bind-function-to-buffer, gdb-place-breakpoints) (gdb-preempt-existing-or-display-buffer): Expose lambdas to the compiler as lexical closures instead of building them the old-fashioned way. Remove #' before lambda. --- lisp/progmodes/gdb-mi.el | 58 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index aadfb7c2215..f0262c23151 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1139,7 +1139,7 @@ no input, and GDB is waiting for input." (if (search-forward "expands to: " nil t) (unless (looking-at "\\S-+.*(.*).*") (gdb-input (concat "-data-evaluate-expression \"" expr "\"") - `(lambda () (gdb-tooltip-print ,expr))))))) + (lambda () (gdb-tooltip-print expr))))))) (defun gdb-init-buffer () (set (make-local-variable 'gud-minor-mode) 'gdbmi) @@ -1259,7 +1259,7 @@ With arg, enter name of variable to be watched in the minibuffer." (tooltip-identifier-from-point (point))))))) (set-text-properties 0 (length expr) nil expr) (gdb-input (concat "-var-create - * " expr "") - `(lambda () (gdb-var-create-handler ,expr)))))) + (lambda () (gdb-var-create-handler expr)))))) (message "gud-watch is a no-op in this mode.")))) (defsubst gdb-mi--field (value field) @@ -1303,7 +1303,7 @@ With arg, enter name of variable to be watched in the minibuffer." (defun gdb-var-list-children (varnum) (gdb-input (concat "-var-update " varnum) 'ignore) (gdb-input (concat "-var-list-children --all-values " varnum) - `(lambda () (gdb-var-list-children-handler ,varnum)))) + (lambda () (gdb-var-list-children-handler varnum)))) (defun gdb-var-list-children-handler (varnum) (let* ((var-list nil) @@ -1366,7 +1366,7 @@ With arg, enter name of variable to be watched in the minibuffer." (varnum (car var)) (value (read-string "New value: "))) (gdb-input (concat "-var-assign " varnum " " value) - `(lambda () (gdb-edit-value-handler ,value))))) + (lambda () (gdb-edit-value-handler value))))) (defconst gdb-error-regexp "\\^error,msg=\\(\".+\"\\)") @@ -1574,9 +1574,9 @@ this trigger is subscribed to `gdb-buf-publisher' and called with (defun gdb-bind-function-to-buffer (expr buffer) "Return a function which will evaluate EXPR in BUFFER." - `(lambda (&rest args) - (with-current-buffer ,buffer - (apply ',expr args)))) + (lambda (&rest args) + (with-current-buffer buffer + (apply expr args)))) ;; Used to display windows with thread-bound buffers (defmacro def-gdb-preempt-display-buffer (name buffer &optional doc @@ -3085,8 +3085,8 @@ See `def-gdb-auto-update-handler'." (when (setq file (gdb-mi--field breakpoint 'file)) (gdb-input (concat "list " file ":1") 'ignore) (gdb-input "-file-list-exec-source-file" - `(lambda () (gdb-get-location - ,bptno ,line ,flag)))) + (lambda () (gdb-get-location + bptno line flag)))) (with-current-buffer (find-file-noselect file 'nowarn) (gdb-init-buffer) ;; Only want one breakpoint icon at each location. @@ -4547,17 +4547,17 @@ SPLIT-HORIZONTAL and show BUF in the new window." (let* ((buf-type (gdb-buffer-type buf)) (existing-window (get-window-with-predicate - #'(lambda (w) - (and (eq buf-type - (gdb-buffer-type (window-buffer w))) - (not (window-dedicated-p w))))))) + (lambda (w) + (and (eq buf-type + (gdb-buffer-type (window-buffer w))) + (not (window-dedicated-p w))))))) (if existing-window (set-window-buffer existing-window buf) (let ((dedicated-window (get-window-with-predicate - #'(lambda (w) - (eq buf-type - (gdb-buffer-type (window-buffer w))))))) + (lambda (w) + (eq buf-type + (gdb-buffer-type (window-buffer w))))))) (if dedicated-window (set-window-buffer (split-window dedicated-window nil split-horizontal) buf) @@ -4622,7 +4622,7 @@ SPLIT-HORIZONTAL and show BUF in the new window." (let ((menu (make-sparse-keymap "GDB-MI"))) (define-key menu [gdb-customize] - '(menu-item "Customize" (lambda () (interactive) (customize-group 'gdb)) + `(menu-item "Customize" ,(lambda () (interactive) (customize-group 'gdb)) :help "Customize Gdb Graphical Mode options.")) (define-key menu [gdb-many-windows] '(menu-item "Display Other Windows" gdb-many-windows @@ -4631,26 +4631,26 @@ SPLIT-HORIZONTAL and show BUF in the new window." (define-key menu [sep1] '(menu-item "--")) (define-key menu [all-threads] - '(menu-item "GUD controls all threads" - (lambda () - (interactive) - (setq gdb-gud-control-all-threads t)) + `(menu-item "GUD controls all threads" + ,(lambda () + (interactive) + (setq gdb-gud-control-all-threads t)) :help "GUD start/stop commands apply to all threads" :button (:radio . gdb-gud-control-all-threads))) (define-key menu [current-thread] - '(menu-item "GUD controls current thread" - (lambda () - (interactive) - (setq gdb-gud-control-all-threads nil)) + `(menu-item "GUD controls current thread" + ,(lambda () + (interactive) + (setq gdb-gud-control-all-threads nil)) :help "GUD start/stop commands apply to current thread only" :button (:radio . (not gdb-gud-control-all-threads)))) (define-key menu [sep2] '(menu-item "--")) (define-key menu [gdb-customize-reasons] - '(menu-item "Customize switching..." - (lambda () - (interactive) - (customize-option 'gdb-switch-reasons)))) + `(menu-item "Customize switching..." + ,(lambda () + (interactive) + (customize-option 'gdb-switch-reasons)))) (define-key menu [gdb-switch-when-another-stopped] (menu-bar-make-toggle-command gdb-toggle-switch-when-another-stopped -- cgit v1.2.3 From 15a67102dd9581b6c53eb2e168c1387e9b2ba796 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Oct 2020 18:54:41 +0100 Subject: Fix intermittent rmail-summary-delete-forward problem * lisp/mail/rmailsum.el (rmail-summary-delete-forward): `rmail-delete-message' may apparently clear `rmail-current-message' sometimes, so save the message number before deleting (bug#39612). --- lisp/mail/rmailsum.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index cc55451902a..521659b7eb6 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -931,8 +931,8 @@ a negative argument means to delete and move backward." (not (and backward (bobp)))) (rmail-summary-goto-msg) (with-current-buffer rmail-buffer - (rmail-delete-message) - (setq del-msg rmail-current-message)) + (setq del-msg rmail-current-message) + (rmail-delete-message)) (rmail-summary-mark-deleted del-msg) (while (and (not (if backward (bobp) (eobp))) (save-excursion (beginning-of-line) -- cgit v1.2.3 From f1bf89e3837199fd9ac37faf52a166b2af9ead0f Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Oct 2020 19:28:57 +0100 Subject: Make gnus-output-to-rmail appending work better * lisp/gnus/gnus-util.el (gnus-output-to-rmail): Ensure we have a blank line before the next line when using mbox format (bug#39580). --- lisp/gnus/gnus-util.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 807bd6a14af..ef811c65b86 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1013,6 +1013,12 @@ FILENAME exists and is Babyl format." (rmail-swap-buffers-maybe) (rmail-maybe-set-message-counters)) (widen) + (unless babyl + (goto-char (point-max)) + ;; Ensure we have a blank line before the next message. + (unless (bolp) + (insert "\n")) + (insert "\n")) (narrow-to-region (point-max) (point-max))) (insert-buffer-substring tmpbuf) (when msg -- cgit v1.2.3 From 8c8349e4b57e9772b673cea2594f0a1e01a6f356 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Oct 2020 20:29:08 +0100 Subject: Tweak how `C-c C-r' computes the region in python-mode * lisp/progmodes/python.el (python-shell-buffer-substring): Don't extend the region to the start of the line (bug#39398), but allow sending the actual region as marked. --- etc/NEWS | 7 +++++++ lisp/progmodes/python.el | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 71749d1b1ff..5e159480e00 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -239,6 +239,13 @@ the buffer cycles the whole buffer between "only top-level headings", * Changes in Specialized Modes and Packages in Emacs 28.1 +** Python mode + +*** 'C-c C-r' can now be used on arbitrary regions. +The command previously extended the start of the region to the start +of the line, but will now actually send the marked region, as +documented. + ** Ruby mode *** 'ruby-use-smie' is declared obsolete. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0487964d815..53542a75f58 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3138,11 +3138,7 @@ the python shell: coding cookie is added. 4. Wraps indented regions under an \"if True:\" block so the interpreter evaluates them correctly." - (let* ((start (save-excursion - ;; Normalize start to the line beginning position. - (goto-char start) - (line-beginning-position))) - (substring (buffer-substring-no-properties start end)) + (let* ((substring (buffer-substring-no-properties start end)) (starts-at-point-min-p (save-restriction (widen) (= (point-min) start))) -- cgit v1.2.3 From 12505df89f64c4a0fc77f6deebf513eb41bc1106 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 27 Oct 2020 22:32:37 +0100 Subject: Remove some Emacs 20 compat code from speedbar.el * lisp/speedbar.el (speedbar-easymenu-definition-trailer): Remove Emacs 20 compat code. --- lisp/speedbar.el | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 9c5f028e4ab..991c8a33d46 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -899,12 +899,9 @@ This basically creates a sparse keymap, and makes its parent be "Additional menu items while in file-mode.") (defvar speedbar-easymenu-definition-trailer - (append - (if (and (featurep 'custom) (fboundp 'custom-declare-variable)) - (list ["Customize..." speedbar-customize t])) - (list + '(["Customize..." speedbar-customize t] ["Close" dframe-close-frame t] - ["Quit" delete-frame t] )) + ["Quit" delete-frame t]) "Menu items appearing at the end of the speedbar menu.") (defvar speedbar-desired-buffer nil -- cgit v1.2.3 From 86cfabc0c1547418cd99057058ad4de7bb2f08ef Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 28 Oct 2020 02:07:05 +0100 Subject: Remove some compat code from feedmail.el * lisp/mail/feedmail.el (feedmail-message-action-help-blat) (feedmail-run-the-queue, feedmail-queue-send-edit-prompt-inner) (feedmail-send-it-immediately): Remove compat code for XEmacs, Emacs 19 and 20. --- lisp/mail/feedmail.el | 43 ++++++++++++------------------------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 0d7193c1be0..98782efb4b6 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -1911,7 +1911,7 @@ see the variable feedmail-prompt-before-queue-user-alist. (and (stringp feedmail-prompt-before-queue-help-supplement) (princ feedmail-prompt-before-queue-help-supplement)) (with-current-buffer standard-output - (if (fboundp 'help-mode) (help-mode))))) + (help-mode)))) (defun feedmail-message-action-scroll-up () @@ -1972,13 +1972,9 @@ backup file names and the like)." (list-of-possible-fqms)) (if (and (> q-cnt 0) feedmail-queue-runner-confirm-global) (setq do-the-run - (if (fboundp 'y-or-n-p-with-timeout) - (y-or-n-p-with-timeout (format "FQM: Draft: %dm+%d, Queue: %dm+%d; run the queue? " - d-cnt d-oth q-cnt q-oth) - 5 nil) - (y-or-n-p (format "FQM: Draft: %dm+%d, Queue: %dm+%d; run the queue? " - d-cnt d-oth q-cnt q-oth)) - ))) + (y-or-n-p-with-timeout (format "FQM: Draft: %dm+%d, Queue: %dm+%d; run the queue? " + d-cnt d-oth q-cnt q-oth) + 5 nil))) (if (not do-the-run) (setq messages-skipped q-cnt) (save-window-excursion @@ -1997,15 +1993,10 @@ backup file names and the like)." (if (and already-buffer (buffer-modified-p already-buffer)) (save-window-excursion (display-buffer (set-buffer already-buffer)) - (if (fboundp 'y-or-n-p-with-timeout) - ;; make a guess that the user just forgot to save - (if (y-or-n-p-with-timeout (format "FQM: Visiting %s; save before send? " blobby) 10 t) - (save-buffer)) - (if (y-or-n-p (format "FQM: Visiting %s; save before send? " blobby)) - (save-buffer)) - ))) - - (set-buffer blobby-buffer) + ;; make a guess that the user just forgot to save + (if (y-or-n-p-with-timeout (format "FQM: Visiting %s; save before send? " blobby) 10 t) + (save-buffer)))) + (set-buffer blobby-buffer) (setq buffer-offer-save nil) (buffer-disable-undo blobby-buffer) (insert-file-contents-literally maybe-file) @@ -2158,17 +2149,8 @@ you can set `feedmail-queue-reminder-alist' to nil." (setq answer (cons '^ helper)) (if (or (eq user-sez ?\C-m) (eq user-sez ?\C-j) (eq user-sez ?y)) (setq user-sez d-char)) - ;; these char-to-int things are because of some - ;; incomprehensible difference between the two in - ;; byte-compiled stuff between Emacs and XEmacs - ;; (well, I'm sure someone could comprehend it, - ;; but I say 'uncle') - (setq answer (or (assoc user-sez user-alist) - (and (fboundp 'char-to-int) - (assoc (char-to-int user-sez) user-alist)) - (assoc user-sez standard-alist) - (and (fboundp 'char-to-int) - (assoc (char-to-int user-sez) standard-alist)))) + (setq answer (or (assoc user-sez user-alist) + (assoc user-sez standard-alist))) (if (or (null answer) (null (cdr answer))) (progn (beep) @@ -2414,7 +2396,7 @@ mapped to mostly alphanumerics for safety." ;; mail-aliases nil = mail-abbrevs.el (feedmail-say-debug "expanding mail aliases") (if (or feedmail-force-expand-mail-aliases - (and (fboundp 'expand-mail-aliases) mail-aliases)) + mail-aliases) (expand-mail-aliases (point-min) eoh-marker)) ;; Make it pretty. @@ -3130,8 +3112,7 @@ been weeded out." ;; won't delete the newly created frame upon exit! (save-window-excursion (switch-to-buffer buffer) - (if (and (fboundp 'y-or-n-p-with-timeout) - (numberp feedmail-confirm-outgoing-timeout)) + (if (numberp feedmail-confirm-outgoing-timeout) (y-or-n-p-with-timeout "FQM: Send this email? " (abs feedmail-confirm-outgoing-timeout) -- cgit v1.2.3 From 9944385cfb1e9e63512091fdcfdba9094b9e17db Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 28 Oct 2020 02:08:39 +0100 Subject: Remove Emacs 20 compat code from ede/files.el * lisp/cedet/ede/files.el (ede--put-inode-dir-hash) (ede--get-inode-dir-hash, ede-project-directory-remove-hash) (ede--directory-project-from-hash) (ede--directory-project-add-description-to-hash): Remove Emacs 20 compat code. --- lisp/cedet/ede/files.el | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/lisp/cedet/ede/files.el b/lisp/cedet/ede/files.el index db539450e62..1d6a082c5d3 100644 --- a/lisp/cedet/ede/files.el +++ b/lisp/cedet/ede/files.el @@ -96,15 +96,12 @@ of the anchor file for the project." (defun ede--put-inode-dir-hash (dir inode) "Add to the EDE project hash DIR associated with INODE." - (when (fboundp 'puthash) - (puthash dir inode ede-inode-directory-hash) - inode)) + (puthash dir inode ede-inode-directory-hash) + inode) (defun ede--get-inode-dir-hash (dir) "Get the EDE project hash DIR associated with INODE." - (when (fboundp 'gethash) - (gethash dir ede-inode-directory-hash) - )) + (gethash dir ede-inode-directory-hash)) (defun ede--inode-for-dir (dir) "Return the inode for the directory DIR." @@ -272,28 +269,24 @@ Do this only when developing new projects that are incorrectly putting Do this whenever a new project is created, as opposed to loaded." ;; TODO - Use maphash, and delete by regexp, not by dir searching! (setq dir (expand-file-name dir)) - (when (fboundp 'remhash) - (remhash (file-name-as-directory dir) ede-project-directory-hash) - ;; Look for all subdirs of D, and remove them. - (let ((match (concat "^" (regexp-quote dir)))) - (maphash (lambda (K O) - (when (string-match match K) - (remhash K ede-project-directory-hash))) - ede-project-directory-hash)) - )) + (remhash (file-name-as-directory dir) ede-project-directory-hash) + ;; Look for all subdirs of D, and remove them. + (let ((match (concat "^" (regexp-quote dir)))) + (maphash (lambda (K O) + (when (string-match match K) + (remhash K ede-project-directory-hash))) + ede-project-directory-hash))) (defun ede--directory-project-from-hash (dir) "If there is an already loaded project for DIR, return it from the hash." - (when (fboundp 'gethash) - (setq dir (expand-file-name dir)) - (gethash dir ede-project-directory-hash nil))) + (setq dir (expand-file-name dir)) + (gethash dir ede-project-directory-hash nil)) (defun ede--directory-project-add-description-to-hash (dir desc) "Add to the EDE project hash DIR associated with DESC." - (when (fboundp 'puthash) - (setq dir (expand-file-name dir)) - (puthash dir desc ede-project-directory-hash) - desc)) + (setq dir (expand-file-name dir)) + (puthash dir desc ede-project-directory-hash) + desc) ;;; DIRECTORY-PROJECT-P, -CONS ;; -- cgit v1.2.3 From 2efff5e61caae07b827840dd80eef61ed5ef40f9 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 28 Oct 2020 03:43:47 +0200 Subject: css--complete-property-value: Limit the backward search * lisp/textmodes/css-mode.el (css--complete-property-value): Don't search back when ppss-innermost-start is nil (bug#44214). --- lisp/textmodes/css-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 748a561bab5..747657b1ed5 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1358,7 +1358,7 @@ the string PROPERTY." "Complete property value at point." (let ((property (and (looking-back "\\([[:alnum:]-]+\\):[^/][^;]*" (or (ppss-innermost-start (syntax-ppss)) - (point-min)) + (point)) t) (member (match-string-no-properties 1) css-property-ids)))) -- cgit v1.2.3 From 01d67bc8450a4c9f94667efd8698feb454a81d6e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 28 Oct 2020 02:37:18 +0100 Subject: Warn against using the MD4 hash function * lisp/md4.el (md4): Warn against using it, since its security is non-existent and it has been declared obsolete. It should probably only be used by our NTLM support. Point users to secure-hash instead. --- lisp/md4.el | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lisp/md4.el b/lisp/md4.el index 029a125b8ae..11c91307afc 100644 --- a/lisp/md4.el +++ b/lisp/md4.el @@ -22,6 +22,16 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + +;; The MD4 Message-Digest Algorithm. +;; +;; The security of the MD4 hashing algorithm is very poor to +;; non-existent. It was declared obsolete by RFC 6150 in 2011: +;; https://tools.ietf.org/html/rfc6150 +;; +;; You probably want to use `secure-hash' instead. + ;;; Code: ;;; @@ -33,7 +43,12 @@ (defun md4 (in n) "Return the MD4 hash for a string IN of length N bytes. The returned hash is 16 bytes long. N is required to handle -strings containing the character 0." +strings containing the character 0. + +The security of the MD4 hashing algorithm is very poor to +non-existent. It was declared obsolete by RFC 6150 in 2011. + +You probably want to use `secure-hash' instead." (let (m (b (cons 0 (* n 8))) (i 0) -- cgit v1.2.3 From 039ffaf69f87b4b7664222f7649209bc22fc6309 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 28 Oct 2020 03:22:12 +0100 Subject: Use lexical-binding in netrc.el and add tests * lisp/net/netrc.el: Use lexical-binding. (netrc-file): Remove redundant :group arg. * test/lisp/net/netrc-resources/authinfo: * test/lisp/net/netrc-resources/services: * test/lisp/net/netrc-tests.el: New files. --- lisp/net/netrc.el | 6 ++-- test/lisp/net/netrc-resources/authinfo | 2 ++ test/lisp/net/netrc-resources/services | 6 ++++ test/lisp/net/netrc-tests.el | 53 ++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 test/lisp/net/netrc-resources/authinfo create mode 100644 test/lisp/net/netrc-resources/services create mode 100644 test/lisp/net/netrc-tests.el diff --git a/lisp/net/netrc.el b/lisp/net/netrc.el index 3c7f243e801..01db97c29d4 100644 --- a/lisp/net/netrc.el +++ b/lisp/net/netrc.el @@ -1,4 +1,5 @@ -;;; netrc.el --- .netrc parsing functionality +;;; netrc.el --- .netrc parsing functionality -*- lexical-binding: t -*- + ;; Copyright (C) 1996-2020 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen @@ -40,8 +41,7 @@ (defcustom netrc-file "~/.authinfo" "File where user credentials are stored." :version "24.1" - :type 'file - :group 'netrc) + :type 'file) (defvar netrc-services-file "/etc/services" "The name of the services file.") diff --git a/test/lisp/net/netrc-resources/authinfo b/test/lisp/net/netrc-resources/authinfo new file mode 100644 index 00000000000..88aa1712e9d --- /dev/null +++ b/test/lisp/net/netrc-resources/authinfo @@ -0,0 +1,2 @@ +machine imap.example.org login jrh@example.org password "*foobar*" +machine ftp.example.org login jrh password "*baz*" diff --git a/test/lisp/net/netrc-resources/services b/test/lisp/net/netrc-resources/services new file mode 100644 index 00000000000..fd8a0348df2 --- /dev/null +++ b/test/lisp/net/netrc-resources/services @@ -0,0 +1,6 @@ +tcpmux 1/tcp # TCP port service multiplexer +smtp 25/tcp mail +http 80/tcp www # WorldWideWeb HTTP +kerberos 88/tcp kerberos5 krb5 kerberos-sec # Kerberos v5 +kerberos 88/udp kerberos5 krb5 kerberos-sec # Kerberos v5 +rtmp 1/ddp # Routing Table Maintenance Protocol diff --git a/test/lisp/net/netrc-tests.el b/test/lisp/net/netrc-tests.el new file mode 100644 index 00000000000..291943990ad --- /dev/null +++ b/test/lisp/net/netrc-tests.el @@ -0,0 +1,53 @@ +;;; netrc-tests.el --- Tests for netrc.el -*- lexical-binding:t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Stefan Kangas + +;; 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: + +(require 'ert) +(require 'ert-x) +(require 'netrc) + +(ert-deftest test-netrc-parse-services () + (let ((netrc-services-file (ert-resource-file "services"))) + (should (equal (netrc-parse-services) + '(("tcpmux" 1 tcp) + ("smtp" 25 tcp) + ("http" 80 tcp) + ("kerberos" 88 tcp) + ("kerberos" 88 udp) + ("rtmp" 1 ddp)))))) + +(ert-deftest test-netrc-find-service-name () + (let ((netrc-services-file (ert-resource-file "services"))) + (should (equal (netrc-find-service-name 25) "smtp")) + (should (equal (netrc-find-service-name 88 'udp) "kerberos")) + (should-not (netrc-find-service-name 12345)))) + +(ert-deftest test-netrc-credentials () + (let ((netrc-file (ert-resource-file "authinfo"))) + (should (equal (netrc-credentials "imap.example.org") + '("jrh@example.org" "*foobar*"))) + (should (equal (netrc-credentials "ftp.example.org") + '("jrh" "*baz*"))))) + +(provide 'netrc-tests) + +;;; netrc-tests.el ends here -- cgit v1.2.3 From 94ddb1987ea1f88f41dd4c7c8acaaad5ede20322 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 28 Oct 2020 03:41:55 +0100 Subject: ; Fix license statement in several files Add the line "This file is part of GNU Emacs." --- test/lisp/autorevert-tests.el | 8 +++++--- test/lisp/emacs-lisp/find-func-tests.el | 8 +++++--- test/lisp/filenotify-tests.el | 8 +++++--- test/lisp/net/rcirc-tests.el | 8 +++++--- test/lisp/net/rfc2104-tests.el | 8 +++++--- test/lisp/net/secrets-tests.el | 8 +++++--- test/lisp/net/tramp-archive-tests.el | 8 +++++--- test/lisp/net/tramp-tests.el | 8 +++++--- test/lisp/shadowfile-tests.el | 8 +++++--- test/lisp/vc/ediff-ptch-tests.el | 8 +++++--- test/lisp/vc/vc-tests.el | 8 +++++--- test/manual/biditest.el | 6 ++++-- test/src/undo-tests.el | 8 +++++--- 13 files changed, 64 insertions(+), 38 deletions(-) diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index 1b26a3d2468..9ebf137f87c 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el @@ -4,18 +4,20 @@ ;; Author: Michael Albinus -;; This program is free software: you can redistribute it and/or +;; 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. ;; -;; This program is distributed in the hope that it will be useful, but +;; 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 this program. If not, see `https://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/test/lisp/emacs-lisp/find-func-tests.el b/test/lisp/emacs-lisp/find-func-tests.el index f505e78566e..d77eb6757ff 100644 --- a/test/lisp/emacs-lisp/find-func-tests.el +++ b/test/lisp/emacs-lisp/find-func-tests.el @@ -5,18 +5,20 @@ ;; Author: Stefan Monnier ;; Keywords: -;; This program is free software; you can redistribute it and/or modify +;; 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. -;; This program is distributed in the hope that it will be useful, +;; 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 this program. If not, see . +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 47ed661ebf8..268c3185bc6 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -4,18 +4,20 @@ ;; Author: Michael Albinus -;; This program is free software: you can redistribute it and/or +;; 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. ;; -;; This program is distributed in the hope that it will be useful, but +;; 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 this program. If not, see `https://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/test/lisp/net/rcirc-tests.el b/test/lisp/net/rcirc-tests.el index 8d14378b4ff..285926af9d2 100644 --- a/test/lisp/net/rcirc-tests.el +++ b/test/lisp/net/rcirc-tests.el @@ -2,18 +2,20 @@ ;; Copyright (C) 2019-2020 Free Software Foundation, Inc. -;; This program is free software: you can redistribute it and/or +;; 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. ;; -;; This program is distributed in the hope that it will be useful, but +;; 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 this program. If not, see `https://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Code: diff --git a/test/lisp/net/rfc2104-tests.el b/test/lisp/net/rfc2104-tests.el index 90535898382..e7d5a7f30e5 100644 --- a/test/lisp/net/rfc2104-tests.el +++ b/test/lisp/net/rfc2104-tests.el @@ -4,18 +4,20 @@ ;; Author: Lars Ingebrigtsen -;; This program is free software: you can redistribute it and/or +;; 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. ;; -;; This program is distributed in the hope that it will be useful, but +;; 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 this program. If not, see `https://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Code: diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el index 6d420c4cb17..1e2cf3aef66 100644 --- a/test/lisp/net/secrets-tests.el +++ b/test/lisp/net/secrets-tests.el @@ -4,18 +4,20 @@ ;; Author: Michael Albinus -;; This program is free software: you can redistribute it and/or +;; 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. ;; -;; This program is distributed in the hope that it will be useful, but +;; 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 this program. If not, see `https://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Code: diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 988288c045d..97c22fd2feb 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el @@ -4,18 +4,20 @@ ;; Author: Michael Albinus -;; This program is free software: you can redistribute it and/or +;; 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. ;; -;; This program is distributed in the hope that it will be useful, but +;; 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 this program. If not, see `https://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 02bd6138d5d..2c5b4bf18d8 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4,18 +4,20 @@ ;; Author: Michael Albinus -;; This program is free software: you can redistribute it and/or +;; 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. ;; -;; This program is distributed in the hope that it will be useful, but +;; 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 this program. If not, see `https://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el index f40f6a1cdb0..eed9cb534b1 100644 --- a/test/lisp/shadowfile-tests.el +++ b/test/lisp/shadowfile-tests.el @@ -4,18 +4,20 @@ ;; Author: Michael Albinus -;; This program is free software: you can redistribute it and/or +;; 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. ;; -;; This program is distributed in the hope that it will be useful, but +;; 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 this program. If not, see `https://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/test/lisp/vc/ediff-ptch-tests.el b/test/lisp/vc/ediff-ptch-tests.el index a3a592bb623..15270d68cb5 100644 --- a/test/lisp/vc/ediff-ptch-tests.el +++ b/test/lisp/vc/ediff-ptch-tests.el @@ -4,18 +4,20 @@ ;; Author: Tino Calancha -;; This program is free software: you can redistribute it and/or +;; 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. ;; -;; This program is distributed in the hope that it will be useful, but +;; 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 this program. If not, see `https://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Code: diff --git a/test/lisp/vc/vc-tests.el b/test/lisp/vc/vc-tests.el index 01d196565dd..7b88b8d531a 100644 --- a/test/lisp/vc/vc-tests.el +++ b/test/lisp/vc/vc-tests.el @@ -4,18 +4,20 @@ ;; Author: Michael Albinus -;; This program is free software: you can redistribute it and/or +;; 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. ;; -;; This program is distributed in the hope that it will be useful, but +;; 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 this program. If not, see `https://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/test/manual/biditest.el b/test/manual/biditest.el index 71a44ae429a..c4ee96a79c6 100644 --- a/test/manual/biditest.el +++ b/test/manual/biditest.el @@ -6,12 +6,14 @@ ;; Maintainer: emacs-devel@gnu.org ;; Package: emacs -;; This program is free software: you can redistribute it and/or modify +;; 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. -;; This program is distributed in the hope that it will be useful, +;; 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. diff --git a/test/src/undo-tests.el b/test/src/undo-tests.el index b26a276c61b..182e2df93bc 100644 --- a/test/src/undo-tests.el +++ b/test/src/undo-tests.el @@ -4,18 +4,20 @@ ;; Author: Aaron S. Hawley -;; This program is free software: you can redistribute it and/or +;; 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. ;; -;; This program is distributed in the hope that it will be useful, but +;; 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 this program. If not, see `https://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Commentary: -- cgit v1.2.3 From 9f6bb7c9c75a2cce014f1d865570ffe26db2d09a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 28 Oct 2020 06:04:21 +0100 Subject: * lisp/net/eudc-vars.el: Use lexical-binding. --- lisp/net/eudc-vars.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/net/eudc-vars.el b/lisp/net/eudc-vars.el index bc939e0d396..bb1474b8b5b 100644 --- a/lisp/net/eudc-vars.el +++ b/lisp/net/eudc-vars.el @@ -1,4 +1,4 @@ -;;; eudc-vars.el --- Emacs Unified Directory Client +;;; eudc-vars.el --- Emacs Unified Directory Client -*- lexical-binding: t -*- ;; Copyright (C) 1998-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From c6fb23873a594b6a4fc57fa107869a2e82159d07 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 28 Oct 2020 09:13:53 +0100 Subject: Adjust python tests after fix for bug#39398 --- test/lisp/progmodes/python-tests.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 64626333c44..186290593e6 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -3481,7 +3481,7 @@ def foo(): (point-max)) "if True: - print ('a') +print ('a') ")))) (ert-deftest python-shell-buffer-substring-11 () @@ -3499,7 +3499,7 @@ def foo(): (point-max)) "if True: - print ('a') + print ('a') ")))) (ert-deftest python-shell-buffer-substring-12 () @@ -3518,7 +3518,7 @@ def foo(): "if True: - # Whitespace +# Whitespace print ('a') ")))) -- cgit v1.2.3 From e6f8f68e376fa7a87adba5682ac50c5578d38797 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 28 Oct 2020 09:49:59 +0100 Subject: * lisp/net/hmac-def.el: Use lexical-binding. --- lisp/net/hmac-def.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/net/hmac-def.el b/lisp/net/hmac-def.el index bfacc73a2a4..944cc6cef6c 100644 --- a/lisp/net/hmac-def.el +++ b/lisp/net/hmac-def.el @@ -1,4 +1,4 @@ -;;; hmac-def.el --- A macro for defining HMAC functions. +;;; hmac-def.el --- A macro for defining HMAC functions. -*- lexical-binding: t -*- ;; Copyright (C) 1999, 2001, 2007-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From 0cb44eed6c67b3db3991963d90a6573828285074 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 28 Oct 2020 10:07:03 +0100 Subject: Display times in a more human-readable way in list-timers * lisp/emacs-lisp/timer-list.el (list-timers): Format the intervals in a more human-readable way (bug#39956). --- lisp/emacs-lisp/timer-list.el | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/lisp/emacs-lisp/timer-list.el b/lisp/emacs-lisp/timer-list.el index 00d09696d2a..725ca312fca 100644 --- a/lisp/emacs-lisp/timer-list.el +++ b/lisp/emacs-lisp/timer-list.el @@ -49,23 +49,24 @@ (let ((time (list (aref timer 1) (aref timer 2) (aref timer 3)))) - (format "%10.2f" - (float-time - (if (aref timer 7) - time - (time-subtract time nil))))) - 'help-echo "Time in sec till next invocation") + (format "%12s" + (format-seconds "%dd %hh %mm %z%ss" + (float-time + (if (aref timer 7) + time + (time-subtract time nil)))))) + 'help-echo "Time until next invocation") ;; Repeat. - ,(propertize - (let ((repeat (aref timer 4))) - (cond - ((numberp repeat) - (format "%8.1f" repeat)) - ((null repeat) - " -") - (t - (format "%8s" repeat)))) - 'help-echo "Symbol: repeat; number: repeat interval in sec") + ,(let ((repeat (aref timer 4))) + (cond + ((numberp repeat) + (propertize + (format "%12s" (format-seconds "%dd %hh %mm %z%ss" repeat)) + 'help-echo "Repeat interval")) + ((null repeat) + (propertize " -" 'help-echo "Runs once")) + (t + (format "%12s" repeat)))) ;; Function. ,(propertize (let ((cl-print-compiled 'static) @@ -93,8 +94,8 @@ (setq-local revert-buffer-function #'list-timers) (setq tabulated-list-format '[("Idle" 6 timer-list--idle-predicate) - (" Next" 12 timer-list--next-predicate) - (" Repeat" 11 timer-list--repeat-predicate) + (" Next" 12 timer-list--next-predicate) + (" Repeat" 12 timer-list--repeat-predicate) ("Function" 10 timer-list--function-predicate)])) (defun timer-list--idle-predicate (A B) -- cgit v1.2.3 From 63b8f25b88fcfe3198c15e5e78bdd075a7990cfe Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 28 Oct 2020 11:54:53 +0100 Subject: Disable mml-sec-tests on MacOS * test/lisp/gnus/mml-sec-tests.el (test-conf): Disable tests on MacOS (bug#44259). --- test/lisp/gnus/mml-sec-tests.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/lisp/gnus/mml-sec-tests.el b/test/lisp/gnus/mml-sec-tests.el index d85516179fa..a6002b4d51e 100644 --- a/test/lisp/gnus/mml-sec-tests.el +++ b/test/lisp/gnus/mml-sec-tests.el @@ -38,7 +38,10 @@ Mostly, the empty passphrase is used. However, the keys for as S/MIME).") (defun test-conf () - (ignore-errors (epg-find-configuration 'OpenPGP))) + ;; Emacs doesn't have support for finding the name of the PGP agent + ;; on MacOS, so disable the checks. + (and (not (eq system-type 'darwin)) + (ignore-errors (epg-find-configuration 'OpenPGP)))) (defun enc-standards () (if with-smime '(enc-pgp enc-pgp-mime enc-smime) -- cgit v1.2.3 From 5de5b63e57d45330221c7f3c160b75fd7d02ef9e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 28 Oct 2020 12:47:00 +0100 Subject: Document all parameters on `indent-relative' * doc/lispref/text.texi (Relative Indent): Mention the FIRST-ONLY parameter (bug#39330). --- doc/lispref/text.texi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 559b2b1c973..550e7feee2e 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -2566,7 +2566,7 @@ the beginning of the line (if @var{nochange-regexp} is non-@code{nil}). This section describes two commands that indent the current line based on the contents of previous lines. -@deffn Command indent-relative &optional unindented-ok +@deffn Command indent-relative &optional first-only unindented-ok This command inserts whitespace at point, extending to the same column as the next @dfn{indent point} of the previous nonblank line. An indent point is a non-whitespace character following whitespace. The @@ -2582,6 +2582,9 @@ nothing (if @var{unindented-ok} is non-@code{nil}) or calls of the last column of a short line of text, this command ordinarily moves point to the next tab stop by inserting whitespace. +If @var{first-only} is non-@code{nil}, only the first indent point is +considered. + The return value of @code{indent-relative} is unpredictable. In the following example, point is at the beginning of the second -- cgit v1.2.3 From 6b3ed2375ba97307905d94db099c5834e4b8e09e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 28 Oct 2020 14:46:28 +0100 Subject: Extend the regexp shortdoc group * lisp/emacs-lisp/shortdoc.el (regexp): New section "Match Data"; add save-match-data. New section "The `rx' Structured Regexp Notation". --- lisp/emacs-lisp/shortdoc.el | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index a2e5ce6e29a..39ba7ee6dba 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -625,15 +625,6 @@ There can be any number of :example/:result elements." :eval (replace-regexp-in-string "[a-z]+" "_" "*foo*")) (string-match-p :eval (string-match-p "^[fo]+" "foobar")) - (match-string - :eval (and (string-match "^\\([fo]+\\)b" "foobar") - (match-string 0 "foobar"))) - (match-beginning - :no-eval (match-beginning 1) - :eg-result 0) - (match-end - :no-eval (match-end 1) - :eg-result 3) "Looking in Buffers" (re-search-forward :no-eval (re-search-forward "^foo$" nil t) @@ -644,6 +635,18 @@ There can be any number of :example/:result elements." (looking-at-p :no-eval (looking-at "f[0-9]") :eg-result t) + "Match Data" + (match-string + :eval (and (string-match "^\\([fo]+\\)b" "foobar") + (match-string 0 "foobar"))) + (match-beginning + :no-eval (match-beginning 1) + :eg-result 0) + (match-end + :no-eval (match-end 1) + :eg-result 3) + (save-match-data + :no-eval (save-match-data ...)) "Replacing Match" (replace-match :no-eval (replace-match "new") @@ -659,7 +662,28 @@ There can be any number of :example/:result elements." (regexp-opt-depth :eval (regexp-opt-depth "\\(a\\(b\\)\\)")) (regexp-opt-charset - :eval (regexp-opt-charset '(?a ?b ?c ?d ?e)))) + :eval (regexp-opt-charset '(?a ?b ?c ?d ?e))) + "The `rx' Structured Regexp Notation" + (rx + :eval (rx bol (| (* "f") (+ "o") (? "o")) (| digit space) (group "bar"))) + (rx-to-string + :eval (rx-to-string '(| "foo" "bar"))) + (rx-define + :no-eval "(and (rx-define haskell-comment (seq \"--\" (zero-or-more nonl))) + (rx haskell-comment))" + :result "--.*") + (rx-let + :eval "(rx-let ((comma-separated (item) (seq item (0+ \",\" item))) + (number (1+ digit)) + (numbers (comma-separated number))) + (rx \"(\" numbers \")\"))" + :result "([[:digit:]]+\\(?:,[[:digit:]]+\\)*)") + (rx-let-eval + :eval "(rx-let-eval + '((ponder (x) (seq \"Where have all the \" x \" gone?\"))) + (rx-to-string + '(ponder (or \"flowers\" \"cars\" \"socks\"))))" + :result "\\(?:Where have all the \\(?:\\(?:car\\|flower\\|sock\\)s\\) gone\\?\\)")) (define-short-documentation-group sequence "Sequence Predicates" -- cgit v1.2.3 From bd3ecfef8429aaced824286074abc7f77ef0c98f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 28 Oct 2020 14:46:43 +0100 Subject: Run substitute-command-keys on shortdoc section headings * lisp/emacs-lisp/shortdoc.el (shortdoc-display-group): Run substitute-command-keys on section headings before displaying. --- lisp/emacs-lisp/shortdoc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 39ba7ee6dba..1231e799edd 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -1075,7 +1075,7 @@ There can be any number of :example/:result elements." (unless (bobp) (insert "\n")) (insert (propertize - (concat data "\n\n") + (concat (substitute-command-keys data) "\n\n") 'face '(variable-pitch (:height 1.3 :weight bold))))) ;; There may be functions not yet defined in the data. ((fboundp (car data)) -- cgit v1.2.3 From bb3d13ac3586d3577605d3d8809d31c62a267c99 Mon Sep 17 00:00:00 2001 From: Mattias EngdegĂ„rd Date: Wed, 28 Oct 2020 15:05:35 +0100 Subject: ; * lisp/emacs-lisp/shortdoc.el (regexp): less contrived rx example --- lisp/emacs-lisp/shortdoc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 1231e799edd..59c8c7794cf 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -665,7 +665,7 @@ There can be any number of :example/:result elements." :eval (regexp-opt-charset '(?a ?b ?c ?d ?e))) "The `rx' Structured Regexp Notation" (rx - :eval (rx bol (| (* "f") (+ "o") (? "o")) (| digit space) (group "bar"))) + :eval (rx "IP=" (+ digit) (= 3 "." (+ digit)))) (rx-to-string :eval (rx-to-string '(| "foo" "bar"))) (rx-define -- cgit v1.2.3 From 46b3db5579e57b9daf16667914205adc99d3f104 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 29 Oct 2020 11:09:20 +0200 Subject: Widen buffer before going to point found by xref-find-definitions (bug#44294) * lisp/progmodes/elisp-mode.el (xref-location-marker): Widen before going to the found position. * lisp/progmodes/etags.el (etags-goto-tag-location): Rerun after removing narrowing. * lisp/simple.el (goto-line-read-args): Use buffer-narrowed-p. --- lisp/progmodes/elisp-mode.el | 6 ++++-- lisp/progmodes/etags.el | 9 +++++++-- lisp/simple.el | 8 ++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index eed73f57918..c7ff351845e 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -897,8 +897,10 @@ non-nil result supersedes the xrefs produced by (let ((buffer-point (find-function-search-for-symbol symbol type file))) (with-current-buffer (car buffer-point) (save-excursion - (goto-char (or (cdr buffer-point) (point-min))) - (point-marker)))))) + (save-restriction + (widen) + (goto-char (or (cdr buffer-point) (point-min))) + (point-marker))))))) (cl-defmethod xref-location-group ((l xref-elisp-location)) (xref-elisp-location-file l)) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index f6af1f2ea84..41ed3177660 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1406,8 +1406,13 @@ hits the start of file." offset (* 3 offset))) ; expand search window (or found (re-search-forward pat nil t) - (user-error "Rerun etags: `%s' not found in %s" - pat buffer-file-name))) + (if (and (buffer-narrowed-p) widen-automatically) + (progn + ;; Rerun after removing narrowing + (widen) + (etags-goto-tag-location tag-info)) + (user-error "Rerun etags: `%s' not found in %s" + pat buffer-file-name)))) ;; Position point at the right place ;; if the search string matched an extra Ctrl-m at the beginning. (and (eq selective-display t) diff --git a/lisp/simple.el b/lisp/simple.el index a29f85b3c36..2e40e3261c9 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1291,11 +1291,11 @@ that uses or sets the mark." ""))) ;; Read the argument, offering that number (if any) as default. (list (read-number (format "Goto%s line%s: " - (if (= (point-min) 1) "" - ;; In a narrowed buffer. - (if relative " relative" " absolute")) + (if (buffer-narrowed-p) + (if relative " relative" " absolute") + "") buffer-prompt) - (list default (if (or relative (= (point-min) 1)) + (list default (if (or relative (not (buffer-narrowed-p))) (line-number-at-pos) (save-restriction (widen) -- cgit v1.2.3 From eae31b01a26f1a31a58f23c72549f4edfb949272 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 29 Oct 2020 11:18:33 +0200 Subject: * lisp/bindings.el (narrow-map): Bind C-x n g to goto-line-relative (bug#9917) --- etc/NEWS | 1 + lisp/bindings.el | 1 + 2 files changed, 2 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 5e159480e00..4b1272d18bb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -201,6 +201,7 @@ It moves point to the line relative to the accessible portion of the narrowed buffer. 'M-g M-g' in Info is rebound to this command. When 'widen-automatically' is non-nil, 'goto-line' widens the narrowed buffer to be able to move point to the inaccessible portion. +'goto-line-relative' is bound to 'C-x n g'. +++ ** When 'suggest-key-bindings' is non-nil, the completion list of 'M-x' diff --git a/lisp/bindings.el b/lisp/bindings.el index 3930f5b52c6..250234e94c1 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -918,6 +918,7 @@ if `inhibit-field-text-motion' is non-nil." (define-key narrow-map "n" 'narrow-to-region) (define-key narrow-map "w" 'widen) +(define-key narrow-map "g" 'goto-line-relative) ;; Quitting (define-key global-map "\e\e\e" 'keyboard-escape-quit) -- cgit v1.2.3 From 8cd0ce9b857f9d258e447cba13ca32ef5c1641fe Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 29 Oct 2020 10:15:40 +0100 Subject: Don't spill ansi-color across parts in articles * lisp/gnus/gnus-art.el (article-treat-ansi-sequences): Reset ansi-color-context-region. (Bug#44299) --- lisp/gnus/gnus-art.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 2e9d85e39d8..f9a6dd64427 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2170,7 +2170,8 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")." (save-excursion (when (article-goto-body) (let ((inhibit-read-only t)) - (ansi-color-apply-on-region (point) (point-max)))))) + (ansi-color-apply-on-region (point) (point-max))))) + (setq ansi-color-context-region nil)) (defun gnus-article-treat-unfold-headers () "Unfold folded message headers. -- cgit v1.2.3 From 1fb85fb138980ba82a4f99673a020586123b9bc9 Mon Sep 17 00:00:00 2001 From: Hugh Daschbach Date: Thu, 29 Oct 2020 12:16:45 +0100 Subject: * test/lisp/net/dbus-tests.el (dbus-test09-get-managed-objects): New test. --- test/lisp/net/dbus-tests.el | 82 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index 2186d454aee..3bb2264defb 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -1889,6 +1889,88 @@ The argument EXPECTED-ARGS is a list of expected arguments for the method." ;; Cleanup. (dbus-unregister-service :session dbus--test-service))) +(ert-deftest dbus-test09-get-managed-objects () + "Check `dbus-get-all-managed-objects'." + (skip-unless dbus--test-enabled-session-bus) + (dbus-ignore-errors (dbus-unregister-service :session dbus--test-service)) + (dbus-register-service :session dbus--test-service) + + (unwind-protect + (let ((path1 (concat dbus--test-path "/path1")) + (path2 (concat dbus--test-path "/path2")) + (path3 (concat dbus--test-path "/path3"))) + + (should-not + (dbus-get-all-managed-objects :session dbus--test-service dbus--test-path)) + + (should + (equal + (dbus-register-property + :session dbus--test-service path1 dbus--test-interface + "Property1" :readwrite "Simple string one.") + `((:property :session ,dbus--test-interface "Property1") + (,dbus--test-service ,path1)))) + + (should + (equal + (dbus-get-property + :session dbus--test-service path1 dbus--test-interface + "Property1") + "Simple string one.")) + + (should + (equal + (dbus-register-property + :session dbus--test-service path2 dbus--test-interface + "Property1" :readwrite "Simple string two.") + `((:property :session ,dbus--test-interface "Property1") + (,dbus--test-service ,path2)))) + + (should + (equal + (dbus-register-property + :session dbus--test-service path3 dbus--test-interface + "Property1" :readwrite "Simple string three.") + `((:property :session ,dbus--test-interface "Property1") + (,dbus--test-service ,path3)))) + + (should + (equal + (dbus-get-property + :session dbus--test-service path1 dbus--test-interface + "Property1") + "Simple string one.")) + + (should + (equal + (dbus-get-property + :session dbus--test-service path2 dbus--test-interface + "Property1") + "Simple string two.")) + + (should + (equal + (dbus-get-property + :session dbus--test-service path3 dbus--test-interface + "Property1") + "Simple string three.")) + + (let ((result (dbus-get-all-managed-objects :session dbus--test-service dbus--test-path))) + (should + (= 3 (length result))) + + (should + (assoc-string path1 result)) + + (should + (assoc-string path2 result)) + + (should + (assoc-string path3 result)))) + + ;; Cleanup. + (dbus-unregister-service :session dbus--test-service))) + (defun dbus-test-all (&optional interactive) "Run all tests for \\[dbus]." (interactive "p") -- cgit v1.2.3 From ada9b7c9cecdbc2dd6cbd08553d8f83cb80f793a Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 29 Oct 2020 12:38:13 +0100 Subject: Tweak previous article-treat-ansi-sequences fix * lisp/gnus/gnus-art.el (article-treat-ansi-sequences): Redo the previous fix to avoid a compilation warning (bug#44299). --- lisp/gnus/gnus-art.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index f9a6dd64427..1efc1d6f7d9 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2169,9 +2169,10 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")." (interactive) (save-excursion (when (article-goto-body) - (let ((inhibit-read-only t)) - (ansi-color-apply-on-region (point) (point-max))))) - (setq ansi-color-context-region nil)) + (require 'ansi-color) + (let ((inhibit-read-only t) + (ansi-color-context-region nil)) + (ansi-color-apply-on-region (point) (point-max)))))) (defun gnus-article-treat-unfold-headers () "Unfold folded message headers. -- cgit v1.2.3 From be59466be711b573f7c9a9643af08bbfc05289f6 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 29 Oct 2020 15:45:07 +0100 Subject: Fix CUA Mode menu entry to be less confusing Note that the old text was incorrect; shift-selection is controlled by the variable shift-select-mode. * lisp/menu-bar.el (menu-bar-options-menu): Make CUA Mode menu entry less confusing when cua-enable-cua-keys is nil. (Bug#43322) --- lisp/menu-bar.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index f9afc8a5f31..c6ced689a67 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1570,8 +1570,8 @@ mail status in mode line")) (bindings--define-key menu [cua-emulation-mode] (menu-bar-make-mm-toggle cua-mode - "Shift movement mark region (CUA)" - "Use shifted movement keys to set and extend the region" + "CUA Mode (without C-x/C-c/C-v)" + "Enable CUA Mode without rebinding C-x/C-c/C-v keys" (:visible (and (boundp 'cua-enable-cua-keys) (not cua-enable-cua-keys))))) -- cgit v1.2.3 From 372739b4069dee1911606817cf962b6ff8b49bac Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 29 Oct 2020 16:56:40 +0100 Subject: Handle several children of PATH in dbus-managed-objects-handler * lisp/net/dbus.el (dbus-managed-objects-handler): Handle several children of PATH. (Bug#44298) * src/dbusbind.c (xd_signature, xd_append_arg): Check object path. * test/lisp/net/dbus-tests.el (dbus-test09-get-managed-objects): Tag it :expensive-test. Remove superfluous check. --- lisp/net/dbus.el | 51 ++++++++++++++++++++++++--------------------- src/dbusbind.c | 18 ++++++++++------ test/lisp/net/dbus-tests.el | 15 +++++-------- 3 files changed, 44 insertions(+), 40 deletions(-) diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index bb2420e1f49..8b40808005b 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -1942,35 +1942,38 @@ It will be registered for all objects created by `dbus-register-service'." ;; Check for object path wildcard interfaces. (maphash (lambda (key val) - (when (and (equal (butlast key 2) (list :property bus)) - (null (nth 2 (car-safe val)))) - (push (nth 2 key) interfaces))) + (when (equal (butlast key 2) (list :property bus)) + (dolist (item val) + (unless (nth 2 item) ; Path. + (push (nth 2 key) interfaces))))) dbus-registered-objects-table) ;; Check all registered object paths. (maphash (lambda (key val) - (let ((object (or (nth 2 (car-safe val)) ""))) - (when (and (equal (butlast key 2) (list :property bus)) - (string-prefix-p path object)) - (dolist (interface (cons (nth 2 key) interfaces)) - (unless (assoc object result) - (push (list object) result)) - (unless (assoc interface (cdr (assoc object result))) - (setcdr - (assoc object result) - (append - (list (cons - interface - ;; We simulate "org.freedesktop.DBus.Properties.GetAll" - ;; by using an appropriate D-Bus event. - (let ((last-input-event - (append - (butlast last-input-event 4) - (list object dbus-interface-properties - "GetAll" #'dbus-property-handler)))) - (dbus-property-handler interface)))) - (cdr (assoc object result))))))))) + (when (equal (butlast key 2) (list :property bus)) + (dolist (item val) + (let ((object (or (nth 2 item) ""))) ; Path. + (when (string-prefix-p path object) + (dolist (interface (cons (nth 2 key) (delete-dups interfaces))) + (unless (assoc object result) + (push (list object) result)) + (unless (assoc interface (cdr (assoc object result))) + (setcdr + (assoc object result) + (append + (list (cons + interface + ;; We simulate + ;; "org.freedesktop.DBus.Properties.GetAll" + ;; by using an appropriate D-Bus event. + (let ((last-input-event + (append + (butlast last-input-event 4) + (list object dbus-interface-properties + "GetAll" #'dbus-property-handler)))) + (dbus-property-handler interface)))) + (cdr (assoc object result))))))))))) dbus-registered-objects-table) ;; Return the result, or an empty array. diff --git a/src/dbusbind.c b/src/dbusbind.c index 7904606d39e..dc4db5c8513 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -409,9 +409,12 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) case DBUS_TYPE_STRING: case DBUS_TYPE_OBJECT_PATH: case DBUS_TYPE_SIGNATURE: - /* We dont check the syntax of object path and signature. This - will be done by libdbus. */ - CHECK_STRING (object); + /* We dont check the syntax of signature. This will be done by + libdbus. */ + if (dtype == DBUS_TYPE_OBJECT_PATH) + XD_DBUS_VALIDATE_PATH (object) + else + CHECK_STRING (object); sprintf (signature, "%c", dtype); break; @@ -732,9 +735,12 @@ xd_append_arg (int dtype, Lisp_Object object, DBusMessageIter *iter) case DBUS_TYPE_STRING: case DBUS_TYPE_OBJECT_PATH: case DBUS_TYPE_SIGNATURE: - /* We dont check the syntax of object path and signature. - This will be done by libdbus. */ - CHECK_STRING (object); + /* We dont check the syntax of signature. This will be done + by libdbus. */ + if (dtype == DBUS_TYPE_OBJECT_PATH) + XD_DBUS_VALIDATE_PATH (object) + else + CHECK_STRING (object); { /* We need to send a valid UTF-8 string. We could encode `object' but by not encoding it, we guarantee it's valid utf-8, even if diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index 3bb2264defb..d630f80706e 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -125,7 +125,6 @@ (should-error (dbus-check-arguments :session dbus--test-service :object-path) :type 'wrong-type-argument) - ;; Raises an error on stderr. (should-error (dbus-check-arguments :session dbus--test-service :object-path "string") :type 'dbus-error) @@ -1891,6 +1890,7 @@ The argument EXPECTED-ARGS is a list of expected arguments for the method." (ert-deftest dbus-test09-get-managed-objects () "Check `dbus-get-all-managed-objects'." + :tags '(:expensive-test) (skip-unless dbus--test-enabled-session-bus) (dbus-ignore-errors (dbus-unregister-service :session dbus--test-service)) (dbus-register-service :session dbus--test-service) @@ -1901,7 +1901,8 @@ The argument EXPECTED-ARGS is a list of expected arguments for the method." (path3 (concat dbus--test-path "/path3"))) (should-not - (dbus-get-all-managed-objects :session dbus--test-service dbus--test-path)) + (dbus-get-all-managed-objects + :session dbus--test-service dbus--test-path)) (should (equal @@ -1911,13 +1912,6 @@ The argument EXPECTED-ARGS is a list of expected arguments for the method." `((:property :session ,dbus--test-interface "Property1") (,dbus--test-service ,path1)))) - (should - (equal - (dbus-get-property - :session dbus--test-service path1 dbus--test-interface - "Property1") - "Simple string one.")) - (should (equal (dbus-register-property @@ -1955,7 +1949,8 @@ The argument EXPECTED-ARGS is a list of expected arguments for the method." "Property1") "Simple string three.")) - (let ((result (dbus-get-all-managed-objects :session dbus--test-service dbus--test-path))) + (let ((result (dbus-get-all-managed-objects + :session dbus--test-service dbus--test-path))) (should (= 3 (length result))) -- cgit v1.2.3 From 7b02d9ba480cdd5710b0cdfefc11facd96b44444 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 29 Oct 2020 13:38:59 -0400 Subject: * lisp/progmodes/tcl.el: Better match Tcl string formation rules (bug#39277) (tcl--word-delimiters): New const. (tcl--syntax-of-quote): New function. (tcl-syntax-propertize-function): Use them. (tcl-mode): Enable `syntax-propertize-multiline`. * test/manual/indent/tcl.tcl: New file. --- lisp/progmodes/tcl.el | 58 +++++++++++++++++++++++++++++++++++++++++++++- test/manual/indent/tcl.tcl | 22 ++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 test/manual/indent/tcl.tcl diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index 717008a0a22..d4d51e8b50c 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -407,10 +407,64 @@ This variable is generally set from `tcl-proc-regexp', `tcl-typeword-list', and `tcl-keyword-list' by the function `tcl-set-font-lock-keywords'.") +(eval-and-compile + (defconst tcl--word-delimiters "[;{ \t\n")) + +(defun tcl--syntax-of-quote (pos) + "Decide whether a double quote opens a string or not." + ;; This is pretty tricky, because strings can be written as "..." + ;; or as {...} or without any quoting at all for some simple and not so + ;; simple cases (e.g. `abc' but also `a"b'). To make things more + ;; interesting, code is represented as strings, so the content of + ;; strings can be later re-lexed to find nested strings. + (save-excursion + (let ((ppss (syntax-ppss pos))) + (cond + ((nth 8 ppss) nil) ;; Within a string or a comment. + ((not (memq (char-before pos) + (cons nil + (eval-when-compile + (mapcar #'identity tcl--word-delimiters))))) + ;; The double quote appears within some other lexical entity. + ;; FIXME: Similar treatment should be used for `{' which can appear + ;; within non-delimited strings (but only at top-level, so + ;; maybe it's not worth worrying about). + (string-to-syntax ".")) + ((zerop (nth 0 ppss)) + ;; Not within a { ... }, so can't be truncated by a }. + ;; FIXME: The syntax-table also considers () and [] as paren + ;; delimiters just like {}, even though Tcl treats them differently. + ;; Tho I'm not sure it's worth worrying about, either. + nil) + (t + ;; A double quote within a {...}: leave it as a normal string + ;; delimiter only if we don't find a closing } before we + ;; find a closing ". + (let ((type nil) + (depth 0)) + (forward-char 1) + (while (and (not type) + (re-search-forward "[\"{}\\]" nil t)) + (pcase (char-after (match-beginning 0)) + (?\\ (forward-char 1)) + (?\" (setq type 'matched)) + (?\{ (cl-incf depth)) + (?\} (if (zerop depth) (setq type 'unmatched) + (cl-incf depth))))) + (when (> (line-beginning-position) pos) + ;; The quote is not on the same line as the deciding + ;; factor, so make sure we revisit this choice later. + (put-text-property pos (point) 'syntax-multiline t)) + (when (eq type 'unmatched) + ;; The quote has no matching close because a } closes the + ;; surrounding string before, so it doesn't really "open a string". + (string-to-syntax ".")))))))) + (defconst tcl-syntax-propertize-function (syntax-propertize-rules ;; Mark the few `#' that are not comment-markers. - ("[^;[{ \t\n][ \t]*\\(#\\)" (1 "."))) + ((concat "[^" tcl--word-delimiters "][ \t]*\\(#\\)") (1 ".")) + ("\"" (0 (tcl--syntax-of-quote (match-beginning 0))))) "Syntactic keywords for `tcl-mode'.") ;; FIXME need some way to recognize variables because array refs look @@ -593,6 +647,8 @@ already exist." '(tcl-font-lock-keywords nil nil nil beginning-of-defun)) (set (make-local-variable 'syntax-propertize-function) tcl-syntax-propertize-function) + (add-hook 'syntax-propertize-extend-region-functions + #'syntax-propertize-multiline 'append 'local) (set (make-local-variable 'imenu-generic-expression) tcl-imenu-generic-expression) diff --git a/test/manual/indent/tcl.tcl b/test/manual/indent/tcl.tcl new file mode 100644 index 00000000000..c3781533ca4 --- /dev/null +++ b/test/manual/indent/tcl.tcl @@ -0,0 +1,22 @@ +# Some sample code that tries to exercise the font-lock +# of various forms of writing strings. + +puts "hello}"; # Top-level strings can contain unescaped closing braces! + +puts a"b; # Non-delimited strings can contain quotes! +puts a""b; # Even several of them! + +proc foo1 {} { + puts "hello"; # Normal case! + puts "hello\}; # This will signal an error when `foo1` is called! +} + +proc foo2 {} { + puts "hello; # This will also signal an error when `foo2` is called! +} + +proc foo3 {} { + puts a"b; # This will not signal an error! + puts a""b"; # And that won't either! + puts "a""b"; # But this will! +} -- cgit v1.2.3 From 020a334992b17a4dd72053c9c7f7d5c125340c54 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 29 Oct 2020 19:20:47 +0100 Subject: * lisp/reposition.el: Use lexical-binding. --- lisp/reposition.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/reposition.el b/lisp/reposition.el index 4788e6ee81e..7561cc4c5f3 100644 --- a/lisp/reposition.el +++ b/lisp/reposition.el @@ -1,4 +1,4 @@ -;;; reposition.el --- center a Lisp function or comment on the screen +;;; reposition.el --- center a Lisp function or comment on the screen -*- lexical-binding: t -*- ;; Copyright (C) 1991, 1994, 2001-2020 Free Software Foundation, Inc. -- cgit v1.2.3 From a6cb425240dc1e27fcaa134f98fdc94c87f37613 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Thu, 29 Oct 2020 20:42:31 +0000 Subject: Simplify some bibtex.el variable definitions * lisp/textmodes/bibtex.el (bibtex-include-OPTkey) (bibtex-user-optional-fields, bibtex-BibTeX-entry-alist) (bibtex-biblatex-entry-alist, bibtex-generate-url-list): Use :risky tag instead of risky-local-variable property. (bibtex-entry-format, bibtex-maintain-sorted-entries) (bibtex-sort-entry-class, bibtex-dialect) (bibtex-autokey-name-case-convert-function): Use :safe tag instead of safe-local-variable property. (bibtex-autokey-name-case-convert-function): Let custom function default to 'identity', not 'ignore'. (bibtex-strings, bibtex-reference-keys): Define with defvar-local instead of defvar+make-variable-buffer-local. --- lisp/textmodes/bibtex.el | 89 ++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 48 deletions(-) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 910bd7dbb9d..715379fa80f 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -85,8 +85,8 @@ If this is a function, call it to generate the initial field text." :type '(choice (const :tag "None" nil) (string :tag "Initial text") (function :tag "Initialize Function") - (const :tag "Default" t))) -(put 'bibtex-include-OPTkey 'risky-local-variable t) + (const :tag "Default" t)) + :risky t) (defcustom bibtex-user-optional-fields '(("annote" "Personal annotation (ignored)")) @@ -97,8 +97,8 @@ in `bibtex-BibTeX-entry-alist' (which see)." :type '(repeat (group (string :tag "Field") (string :tag "Comment") (option (choice :tag "Init" - (const nil) string function))))) -(put 'bibtex-user-optional-fields 'risky-local-variable t) + (const nil) string function)))) + :risky t) (defcustom bibtex-entry-format '(opts-or-alts required-fields numerical-fields) @@ -148,20 +148,18 @@ The value nil means do no formatting at all." (const unify-case) (const braces) (const strings) - (const sort-fields)))) -(put 'bibtex-entry-format 'safe-local-variable - (lambda (x) - (or (eq x t) - (let ((OK t)) - (while (consp x) - (unless (memq (pop x) - '(opts-or-alts required-fields numerical-fields - page-dashes whitespace inherit-booktitle realign - last-comma delimiters unify-case braces strings - sort-fields)) - (setq OK nil))) - (unless (null x) (setq OK nil)) - OK)))) + (const sort-fields))) + :safe (lambda (x) + (or (eq x t) + (let ((ok t)) + (while (consp x) + (unless (memq (pop x) + '( opts-or-alts required-fields numerical-fields + page-dashes whitespace inherit-booktitle + realign last-comma delimiters unify-case + braces strings sort-fields )) + (setq ok nil))) + (unless x ok))))) (defcustom bibtex-field-braces-alist nil "Alist of field regexps that \\[bibtex-clean-entry] encloses by braces. @@ -207,9 +205,8 @@ See also `bibtex-sort-ignore-string-entries'." (const plain) (const crossref) (const entry-class) - (const t))) -(put 'bibtex-maintain-sorted-entries 'safe-local-variable - (lambda (a) (memq a '(nil t plain crossref entry-class)))) + (const t)) + :safe (lambda (a) (memq a '(nil t plain crossref entry-class)))) (defcustom bibtex-sort-entry-class '(("String") @@ -223,18 +220,17 @@ to all entries not explicitly mentioned." :group 'bibtex :type '(repeat (choice :tag "Class" (const :tag "catch-all" (catch-all)) - (repeat :tag "Entry type" string)))) -(put 'bibtex-sort-entry-class 'safe-local-variable - (lambda (x) (let ((OK t)) - (while (consp x) - (let ((y (pop x))) - (while (consp y) - (let ((z (pop y))) - (unless (or (stringp z) (eq z 'catch-all)) - (setq OK nil)))) - (unless (null y) (setq OK nil)))) - (unless (null x) (setq OK nil)) - OK))) + (repeat :tag "Entry type" string))) + :safe (lambda (x) + (let ((ok t)) + (while (consp x) + (let ((y (pop x))) + (while (consp y) + (let ((z (pop y))) + (unless (or (stringp z) (eq z 'catch-all)) + (setq ok nil)))) + (when y (setq ok nil)))) + (unless x ok)))) (defcustom bibtex-sort-ignore-string-entries t "If non-nil, BibTeX @String entries are not sort-significant. @@ -459,8 +455,8 @@ ALTERNATIVE if non-nil is an integer that numbers sets of alternatives, starting from zero." :group 'bibtex :version "26.1" ; add Conference - :type 'bibtex-entry-alist) -(put 'bibtex-BibTeX-entry-alist 'risky-local-variable t) + :type 'bibtex-entry-alist + :risky t) (defcustom bibtex-biblatex-entry-alist ;; Compare in biblatex documentation: @@ -714,8 +710,8 @@ alternatives, starting from zero." It has the same format as `bibtex-BibTeX-entry-alist'." :group 'bibtex :version "24.1" - :type 'bibtex-entry-alist) -(put 'bibtex-biblatex-entry-alist 'risky-local-variable t) + :type 'bibtex-entry-alist + :risky t) (define-widget 'bibtex-field-alist 'lazy "Format of `bibtex-BibTeX-entry-alist' and friends." @@ -857,8 +853,8 @@ To interactively change the dialect use the command `bibtex-set-dialect'." (bibtex-set-dialect value))) :type '(choice (const BibTeX) (const biblatex) - (symbol :tag "Custom"))) -(put 'bibtex-dialect 'safe-local-variable 'symbolp) + (symbol :tag "Custom")) + :safe #'symbolp) (defcustom bibtex-no-opt-remove-re "\\`option" "If a field name matches this regexp, the prefix OPT is not removed. @@ -1059,9 +1055,8 @@ See `bibtex-generate-autokey' for details." (const :tag "Downcase" downcase) (const :tag "Capitalize" capitalize) (const :tag "Upcase" upcase) - (function :tag "Conversion function"))) -(put 'bibtex-autokey-name-case-convert-function 'safe-local-variable - (lambda (x) (memq x '(upcase downcase capitalize identity)))) + (function :tag "Conversion function" :value identity)) + :safe (lambda (x) (memq x '(upcase downcase capitalize identity)))) (defcustom bibtex-autokey-name-length 'infty "Number of characters from name to incorporate into key. @@ -1313,8 +1308,8 @@ The following is a complex example, see URL `http://link.aps.org/'. (regexp :tag "Regexp") (choice (string :tag "Replacement") (integer :tag "Sub-match") - (function :tag "Filter")))))))) -(put 'bibtex-generate-url-list 'risky-local-variable t) + (function :tag "Filter"))))))) + :risky t) (defcustom bibtex-cite-matcher-alist '(("\\\\cite[ \t\n]*{\\([^}]+\\)}" . 1)) @@ -1536,21 +1531,19 @@ At most `bibtex-entry-kill-ring-max' items are kept here.") (defvar bibtex-last-kill-command nil "Type of the last kill command (either `field' or `entry').") -(defvar bibtex-strings +(defvar-local bibtex-strings (lazy-completion-table bibtex-strings (lambda () (bibtex-parse-strings (bibtex-string-files-init)))) "Completion table for BibTeX string keys. Initialized from `bibtex-predefined-strings' and `bibtex-string-files'.") -(make-variable-buffer-local 'bibtex-strings) (put 'bibtex-strings 'risky-local-variable t) -(defvar bibtex-reference-keys +(defvar-local bibtex-reference-keys (lazy-completion-table bibtex-reference-keys (lambda () (bibtex-parse-keys nil t))) "Completion table for BibTeX reference keys. The CDRs of the elements are t for header keys and nil for crossref keys.") -(make-variable-buffer-local 'bibtex-reference-keys) (put 'bibtex-reference-keys 'risky-local-variable t) (defvar bibtex-buffer-last-parsed-tick nil -- cgit v1.2.3 From 96e371b44aa7aab13c559a908b48711364264213 Mon Sep 17 00:00:00 2001 From: Harald Jörg Date: Thu, 29 Oct 2020 22:06:56 +0100 Subject: cperl-mode: Make timeout test more robust * test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-test-bug-10483): Increase the timeout to 2 seconds and mark the test as expensive. Also, suppress it for Emacs versions below 28, where the test times out though the function works in manual tests. (Bug#44317) --- test/lisp/progmodes/cperl-mode-tests.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index e67678cf6bb..9b486ae2e2c 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -108,8 +108,10 @@ This verifies that indenting a piece of code that ends in a paren without a statement terminator on the same line does not loop forever. The test starts an asynchronous Emacs batch process under timeout control." + :tags '(:expensive-test) (interactive) (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; FIXME times out + (skip-unless (not (< emacs-major-version 28))) ; times out in older Emacsen (let* ((emacs (concat invocation-directory invocation-name)) (test-function 'cperl-mode-test--run-bug-10483) (test-function-name (symbol-name test-function)) @@ -118,7 +120,7 @@ under timeout control." (process-connection-type nil) runner) (with-temp-buffer - (with-timeout (1 + (with-timeout (2 (delete-process runner) (setq ran-out-of-time t)) (setq runner (start-process "speedy" -- cgit v1.2.3 From d7a2d7250d74ab91dc7fb21325b39ea801b0796b Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Thu, 29 Oct 2020 23:33:29 +0000 Subject: Modify only local send hook in submit-emacs-patch * lisp/mail/emacsbug.el (submit-emacs-patch): Don't modify global message-send-hook. --- lisp/mail/emacsbug.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index e48c25436ee..6a3c98746b9 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -520,7 +520,7 @@ Message buffer where you can explain more about the patch." (lambda () (message-goto-body) (insert "Tags: patch\nthanks\n\n")) - t) + nil t) (message-add-action (lambda () ;; Bury the help buffer (if it's shown). -- cgit v1.2.3 From e9af1ed44ec50ae2384946bb81ee2f86fa6f1431 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Fri, 30 Oct 2020 00:05:10 +0000 Subject: Remove Debbugs 'thanks' from submit-emacs-patch * lisp/mail/emacsbug.el (submit-emacs-patch): Remove unneeded 'thanks' following Debbugs pseudo-header, which leaves other pseudo-headers entered by the user unprocessed (bug#44322). --- lisp/mail/emacsbug.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 6a3c98746b9..d524b26f1b9 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -519,7 +519,7 @@ Message buffer where you can explain more about the patch." (add-hook 'message-send-hook (lambda () (message-goto-body) - (insert "Tags: patch\nthanks\n\n")) + (insert "Tags: patch\n\n")) nil t) (message-add-action (lambda () -- cgit v1.2.3 From 3e63213a1fef16ffe38a5024a83d8782e98aabe1 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 29 Oct 2020 22:40:03 -0400 Subject: * lisp/mail/binhex.el (binhex-char-int): Add missing release --- lisp/mail/binhex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/mail/binhex.el b/lisp/mail/binhex.el index 431c681be01..035bb32fa12 100644 --- a/lisp/mail/binhex.el +++ b/lisp/mail/binhex.el @@ -317,7 +317,7 @@ If HEADER-ONLY is non-nil only decode header and return filename." (binhex-decode-region-external start end) (binhex-decode-region-internal start end))) -(define-obsolete-function-alias 'binhex-char-int #'identity) +(define-obsolete-function-alias 'binhex-char-int #'identity "28.1") (provide 'binhex) -- cgit v1.2.3 From 4f6b7a0149bf6bb37dc157a52c028b2fc91fc865 Mon Sep 17 00:00:00 2001 From: Hugh Daschbach Date: Fri, 30 Oct 2020 08:59:11 +0100 Subject: * test/lisp/net/dbus-tests.el (dbus-test09-get-managed-objects): Expand test. --- test/lisp/net/dbus-tests.el | 130 +++++++++++++++++++++++++++----------------- 1 file changed, 79 insertions(+), 51 deletions(-) diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index d630f80706e..3cfb4b7d9e7 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -1896,72 +1896,100 @@ The argument EXPECTED-ARGS is a list of expected arguments for the method." (dbus-register-service :session dbus--test-service) (unwind-protect - (let ((path1 (concat dbus--test-path "/path1")) - (path2 (concat dbus--test-path "/path2")) - (path3 (concat dbus--test-path "/path3"))) + (let ((interfaces + `((,(concat dbus--test-interface ".I0") + ((,(concat dbus--test-path "/obj1") + (("I0Property1" . "Zero one one") + ("I0Property2" . "Zero one two") + ("I0Property3" . "Zero one three"))) + (,(concat dbus--test-path "/obj0/obj2") + (("I0Property1" . "Zero two one") + ("I0Property2" . "Zero two two") + ("I0Property3" . "Zero two three"))) + (,(concat dbus--test-path "/obj0/obj3") + (("I0Property1" . "Zero three one") + ("I0Property2" . "Zero three two") + ("I0Property3" . "Zero three three"))))) + (,(concat dbus--test-interface ".I1") + ((,(concat dbus--test-path "/obj0/obj2") + (("I1Property1" . "One one one") + ("I1Property2" . "One one two"))) + (,(concat dbus--test-path "/obj0/obj3") + (("I1Property1" . "One two one") + ("I1Property2" . "One two two")))))))) (should-not (dbus-get-all-managed-objects :session dbus--test-service dbus--test-path)) - (should - (equal - (dbus-register-property - :session dbus--test-service path1 dbus--test-interface - "Property1" :readwrite "Simple string one.") - `((:property :session ,dbus--test-interface "Property1") - (,dbus--test-service ,path1)))) - - (should - (equal - (dbus-register-property - :session dbus--test-service path2 dbus--test-interface - "Property1" :readwrite "Simple string two.") - `((:property :session ,dbus--test-interface "Property1") - (,dbus--test-service ,path2)))) - - (should - (equal - (dbus-register-property - :session dbus--test-service path3 dbus--test-interface - "Property1" :readwrite "Simple string three.") - `((:property :session ,dbus--test-interface "Property1") - (,dbus--test-service ,path3)))) - - (should - (equal - (dbus-get-property - :session dbus--test-service path1 dbus--test-interface - "Property1") - "Simple string one.")) - - (should - (equal - (dbus-get-property - :session dbus--test-service path2 dbus--test-interface - "Property1") - "Simple string two.")) - - (should - (equal - (dbus-get-property - :session dbus--test-service path3 dbus--test-interface - "Property1") - "Simple string three.")) + (dolist (interface interfaces) + (pcase-let ((`(,iname ,objs) interface)) + (dolist (obj objs) + (pcase-let ((`(,path ,props) obj)) + (dolist (prop props) + (should + (equal + (dbus-register-property + :session dbus--test-service path iname + (car prop) :readwrite (cdr prop)) + `((:property :session ,iname ,(car prop)) + (,dbus--test-service ,path))))))))) (let ((result (dbus-get-all-managed-objects :session dbus--test-service dbus--test-path))) (should (= 3 (length result))) - (should - (assoc-string path1 result)) + (dolist (interface interfaces) + (pcase-let ((`(,iname ,objs) interface)) + (dolist (obj objs) + (pcase-let ((`(,path ,props) obj)) + (let* ((object (cadr (assoc-string path result))) + (iface (cadr (assoc-string iname object)))) + (should object) + (should iface) + (dolist (prop props) + (should (equal (cdr (assoc-string (car prop) iface)) + (cdr prop)))))))))) + (let ((result (dbus-get-all-managed-objects + :session dbus--test-service + (concat dbus--test-path "/obj0")))) (should - (assoc-string path2 result)) + (= 2 (length result))) + + (dolist (interface interfaces) + (pcase-let ((`(,iname ,objs) interface)) + (dolist (obj objs) + (pcase-let ((`(,path ,props) obj)) + (when (string-prefix-p (concat dbus--test-path "/obj0/") path) + (let* ((object (cadr (assoc-string path result))) + (iface (cadr (assoc-string iname object)))) + (should object) + (should iface) + (dolist (prop props) + (should (equal (cdr (assoc-string (car prop) iface)) + (cdr prop))))))))))) + (let ((result (dbus-get-all-managed-objects + :session dbus--test-service + (concat dbus--test-path "/obj0/obj2")))) (should - (assoc-string path3 result)))) + (= 1 (length result))) + + (dolist (interface interfaces) + (pcase-let ((`(,iname ,objs) interface)) + (dolist (obj objs) + (pcase-let ((`(,path ,props) obj)) + (when (string-prefix-p + (concat dbus--test-path "/obj0/obj2") path) + (let* ((object (cadr (assoc-string path result))) + (iface (cadr (assoc-string iname object)))) + (should object) + (should iface) + (dolist (prop props) + (should (equal (cdr (assoc-string (car prop) iface)) + (cdr prop)))))))))))) ;; Cleanup. (dbus-unregister-service :session dbus--test-service))) -- cgit v1.2.3 From 122ace858ba94e11d1b2713d0816b3a7d7e2a323 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 28 Oct 2020 16:43:32 +0100 Subject: Add shortdoc navigation commands * lisp/emacs-lisp/shortdoc.el (text-property-search): Require. (shortdoc-mode): New major mode. (shortdoc-mode-map): New variable. (shortdoc--goto-section): New macro. (shortdoc-next, shortdoc-previous, shortdoc-next-section) (shortdoc-previous-section): New commands. (shortdoc-display-group): Use new shortdoc-models. Propertize section header. (shortdoc--display-function): Propertize function header. --- lisp/emacs-lisp/shortdoc.el | 56 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 59c8c7794cf..ebc7e3f61b1 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -25,6 +25,7 @@ ;;; Code: (require 'seq) +(require 'text-property-search) (eval-when-compile (require 'cl-lib)) (defgroup shortdoc nil @@ -1065,7 +1066,7 @@ There can be any number of :example/:result elements." (let ((inhibit-read-only t) (prev nil)) (erase-buffer) - (special-mode) + (shortdoc-mode) (button-mode) (mapc (lambda (data) @@ -1076,7 +1077,8 @@ There can be any number of :example/:result elements." (insert "\n")) (insert (propertize (concat (substitute-command-keys data) "\n\n") - 'face '(variable-pitch (:height 1.3 :weight bold))))) + 'face '(variable-pitch (:height 1.3 :weight bold)) + 'shortdoc-section t))) ;; There may be functions not yet defined in the data. ((fboundp (car data)) (when prev @@ -1091,7 +1093,8 @@ There can be any number of :example/:result elements." (start-section (point)) arglist-start) ;; Function calling convention. - (insert "(") + (insert (propertize "(" + 'shortdoc-function t)) (if (plist-get data :no-manual) (insert (symbol-name function)) (insert-text-button @@ -1201,6 +1204,53 @@ Example: (setq slist (cdr slist))) (setcdr slist (cons elem (cdr slist)))))) +(defvar shortdoc-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "n") 'shortdoc-next) + (define-key map (kbd "p") 'shortdoc-previous) + (define-key map (kbd "C-c C-n") 'shortdoc-next-section) + (define-key map (kbd "C-c C-p") 'shortdoc-previous-section) + map) + "Keymap for `shortdoc-mode'") + +(define-derived-mode shortdoc-mode special-mode "shortdoc" + "Mode for shortdoc.") + +(defmacro shortdoc--goto-section (arg sym &optional reverse) + `(progn + (unless (natnump ,arg) + (setq ,arg 1)) + (while (< 0 ,arg) + (,(if reverse + 'text-property-search-backward + 'text-property-search-forward) + ,sym t) + (setq ,arg (1- ,arg))))) + +(defun shortdoc-next (&optional arg) + "Move cursor to next function." + (interactive "p") + (shortdoc--goto-section arg 'shortdoc-function)) + +(defun shortdoc-previous (&optional arg) + "Move cursor to previous function." + (interactive "p") + (shortdoc--goto-section arg 'shortdoc-function t) + ;; FIXME: Why is this needed? + (backward-char 1)) + +(defun shortdoc-next-section (&optional arg) + "Move cursor to next section." + (interactive "p") + (shortdoc--goto-section arg 'shortdoc-section)) + +(defun shortdoc-previous-section (&optional arg) + "Move cursor to previous section." + (interactive "p") + (shortdoc--goto-section arg 'shortdoc-section t) + ;; FIXME: Why is this needed? + (forward-line -2)) + (provide 'shortdoc) ;;; shortdoc.el ends here -- cgit v1.2.3 From ff3838ecc3f5c913675ca935e047dc6952d79f50 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 30 Oct 2020 11:41:47 +0100 Subject: ; Remove spurious FIXMEs in my last commit --- lisp/emacs-lisp/shortdoc.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index ebc7e3f61b1..dd9cbd5d55a 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -1236,7 +1236,6 @@ Example: "Move cursor to previous function." (interactive "p") (shortdoc--goto-section arg 'shortdoc-function t) - ;; FIXME: Why is this needed? (backward-char 1)) (defun shortdoc-next-section (&optional arg) @@ -1248,7 +1247,6 @@ Example: "Move cursor to previous section." (interactive "p") (shortdoc--goto-section arg 'shortdoc-section t) - ;; FIXME: Why is this needed? (forward-line -2)) (provide 'shortdoc) -- cgit v1.2.3 From 617f70bc7d6402872faa7621ce20fd3a573518b8 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 30 Oct 2020 12:10:17 +0100 Subject: `format-time' can now do sub-second times * doc/lispref/os.texi (Time Parsing): Document it. * lisp/calendar/time-date.el (format-seconds): Allow formatting sub-second times. --- doc/lispref/os.texi | 5 ++++- etc/NEWS | 5 +++++ lisp/calendar/time-date.el | 40 ++++++++++++++++++++++++++++------- test/lisp/calendar/time-date-tests.el | 9 +++++++- 4 files changed, 49 insertions(+), 10 deletions(-) diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 504f0dfb23e..2c30d8ad892 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1901,7 +1901,10 @@ The integer number of hours. The integer number of minutes. @item %s @itemx %S -The integer number of seconds. +The number of seconds. If the optional @samp{,} parameter is used, +it's a floating point number, and the number after the @samp{,} +specifies how many decimals to be used. @samp{%,2s} means ``use two +decimals''. @item %z Non-printing control flag. When it is used, other specifiers must be given in the order of decreasing size, i.e., years before days, hours diff --git a/etc/NEWS b/etc/NEWS index 4b1272d18bb..8504186208c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1204,6 +1204,11 @@ list. ** Miscellaneous ++++ +*** 'format-seconds' can now be used for sub-second times. +The new optional "," parameter has been added, and +(format-seconds "%mm %,1ss" 66.4) will now result in "1m 6.4s". + --- *** 'global-display-fill-column-indicator-mode' skips some buffers. By default, turning on 'global-display-fill-column-indicator-mode' diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index f60c9c2ffd3..cf6c20afbd2 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -278,6 +278,10 @@ Lower-case specifiers return only the unit. optional leading \".\" for zero-padding. For example, \"%.3Y\" will return something of the form \"001 year\". +The \"%s\" spec takes an additional optional parameter, +introduced by the \",\" character, to say how many decimals to +use. \"%,1s\" means \"use one decimal\". + The \"%z\" specifier does not print anything. When it is used, specifiers must be given in order of decreasing size. To the left of \"%z\", nothing is output until the first non-zero unit is encountered." @@ -289,10 +293,11 @@ is output until the first non-zero unit is encountered." ("s" "second" 1) ("z"))) (case-fold-search t) - spec match usedunits zeroflag larger prev name unit num zeropos) - (while (string-match "%\\.?[0-9]*\\(.\\)" string start) + spec match usedunits zeroflag larger prev name unit num zeropos + fraction) + (while (string-match "%\\.?[0-9]*\\(,[0-9]\\)?\\(.\\)" string start) (setq start (match-end 0) - spec (match-string 1 string)) + spec (match-string 2 string)) (unless (string-equal spec "%") (or (setq match (assoc (downcase spec) units)) (error "Bad format specifier: `%s'" spec)) @@ -307,12 +312,17 @@ is output until the first non-zero unit is encountered." (push match usedunits))) (and zeroflag larger (error "Units are not in decreasing order of size")) - (setq seconds (time-convert seconds 'integer)) + (unless (numberp seconds) + (setq seconds (float-time seconds))) + (setq fraction (mod seconds 1) + seconds (round seconds)) (dolist (u units) (setq spec (car u) name (cadr u) unit (nth 2 u)) - (when (string-match (format "%%\\(\\.?[0-9]+\\)?\\(%s\\)" spec) string) + (when (string-match + (format "%%\\(\\.?[0-9]+\\)?\\(,[0-9]+\\)?\\(%s\\)" spec) + string) (if (string-equal spec "z") ; must be last in units (setq string (replace-regexp-in-string @@ -327,9 +337,23 @@ is output until the first non-zero unit is encountered." (setq zeropos (unless (zerop num) (match-beginning 0)))) (setq string (replace-match - (format (concat "%" (match-string 1 string) "d%s") num - (if (string-equal (match-string 2 string) spec) - "" ; lower-case, no unit-name + (format (if (match-string 2 string) + (concat + "%" + (and (match-string 1 string) + (if (= (elt (match-string 1 string) 0) ?.) + (concat "0" (substring + (match-string 1 string) 1)) + (match-string 1 string))) + (concat "." (substring + (match-string 2 string) 1)) + "f%s") + (concat "%" (match-string 1 string) "d%s")) + (if (= unit 1) + (+ num fraction) + num) + (if (string-equal (match-string 3 string) spec) + "" ; lower-case, no unit-name (format " %s%s" name (if (= num 1) "" "s")))) t t string)))))) diff --git a/test/lisp/calendar/time-date-tests.el b/test/lisp/calendar/time-date-tests.el index 3f8954a8ff9..76a5641f34d 100644 --- a/test/lisp/calendar/time-date-tests.el +++ b/test/lisp/calendar/time-date-tests.el @@ -81,7 +81,14 @@ (ert-deftest test-format-seconds () (should (equal (format-seconds "%y %d %h %m %s %%" 0) "0 0 0 0 0 %")) (should (equal (format-seconds "%y %d %h %m %s %%" 9999999) "0 115 17 46 39 %")) - (should (equal (format-seconds "%y %d %h %m %z %s %%" 1) " 1 %"))) + (should (equal (format-seconds "%y %d %h %m %z %s %%" 1) " 1 %")) + (should (equal (format-seconds "%mm %ss" 66) "1m 6s")) + (should (equal (format-seconds "%mm %5ss" 66) "1m 6s")) + (should (equal (format-seconds "%mm %.5ss" 66.4) "1m 00006s")) + + (should (equal (format-seconds "%mm %,1ss" 66.4) "1m 6.4s")) + (should (equal (format-seconds "%mm %5,1ss" 66.4) "1m 6.4s")) + (should (equal (format-seconds "%mm %.5,1ss" 66.4) "1m 006.4s"))) (ert-deftest test-ordinal () (should (equal (date-ordinal-to-time 2008 271) -- cgit v1.2.3 From 02ecbf58e460e2d63f489d8e348f3d7d58acee04 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 30 Oct 2020 12:10:48 +0100 Subject: Make list-timers do sub-second times * lisp/emacs-lisp/timer-list.el (list-timers): Do sub-second times (bug#39956). --- lisp/emacs-lisp/timer-list.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/timer-list.el b/lisp/emacs-lisp/timer-list.el index 725ca312fca..4bda9acebf7 100644 --- a/lisp/emacs-lisp/timer-list.el +++ b/lisp/emacs-lisp/timer-list.el @@ -50,7 +50,7 @@ (aref timer 2) (aref timer 3)))) (format "%12s" - (format-seconds "%dd %hh %mm %z%ss" + (format-seconds "%dd %hh %mm %z%,1ss" (float-time (if (aref timer 7) time @@ -61,7 +61,8 @@ (cond ((numberp repeat) (propertize - (format "%12s" (format-seconds "%dd %hh %mm %z%ss" repeat)) + (format "%12s" (format-seconds + "%dd %hh %mm %z%,1ss" repeat)) 'help-echo "Repeat interval")) ((null repeat) (propertize " -" 'help-echo "Runs once")) -- cgit v1.2.3 From f018cffca0098ad1b82c51730a6d6cf146e3c488 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Fri, 30 Oct 2020 13:13:31 +0100 Subject: Use nobreak-space on all non-ASCII whitespace characters * doc/emacs/display.texi (Text Display): Document it. * src/xdisp.c (get_next_display_element): Use blankp to test whether to use the nobreak_space face (bug#44236). --- doc/emacs/display.texi | 3 ++- etc/NEWS | 6 ++++++ src/xdisp.c | 5 +++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index dd2c6e2cd86..02859d522e3 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -1608,7 +1608,8 @@ can cause problems if they are entered into a buffer without your realization, e.g., by yanking; for instance, source code compilers typically do not treat non-@acronym{ASCII} spaces as whitespace characters. To deal with this problem, Emacs displays such characters -specially: it displays @code{U+00A0} (no-break space) with the +specially: it displays @code{U+00A0} (no-break space) and other +characters from the Unicode horizontal space class with the @code{nobreak-space} face, and it displays @code{U+00AD} (soft hyphen), @code{U+2010} (hyphen), and @code{U+2011} (non-breaking hyphen) with the @code{nobreak-hyphen} face. To disable this, change diff --git a/etc/NEWS b/etc/NEWS index 8504186208c..11783ef3192 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -163,6 +163,12 @@ your init file: (setq frame-title-format '(multiple-frames "%b" ("" invocation-name "@" system-name))) ++++ +** 'nobreak-char-display' now also affects all non-ASCII space characters. +Previously, this was limited only to NO-BREAK-SPACE and hyphen +characters. Now it also covers the rest of the non-ASCII Unicode +space characters. + * Editing Changes in Emacs 28.1 diff --git a/src/xdisp.c b/src/xdisp.c index 5c80e375810..0e5dffbe007 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7555,7 +7555,7 @@ get_next_display_element (struct it *it) non-ASCII spaces and hyphens specially. */ if (! ASCII_CHAR_P (c) && ! NILP (Vnobreak_char_display)) { - if (c == NO_BREAK_SPACE) + if (blankp (c)) nonascii_space_p = true; else if (c == SOFT_HYPHEN || c == HYPHEN || c == NON_BREAKING_HYPHEN) @@ -34747,7 +34747,8 @@ If the value is t, Emacs highlights non-ASCII chars which have the same appearance as an ASCII space or hyphen, using the `nobreak-space' or `nobreak-hyphen' face respectively. -U+00A0 (no-break space), U+00AD (soft hyphen), U+2010 (hyphen), and +All of the non-ASCII characters in the Unicode horizontal whitespace +character class, as well as U+00AD (soft hyphen), U+2010 (hyphen), and U+2011 (non-breaking hyphen) are affected. Any other non-nil value means to display these characters as an escape -- cgit v1.2.3 From daa21fb895c378674238f0f0a2492d93234901db Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 30 Oct 2020 13:18:47 +0100 Subject: Tweak the gdb-mi error message * lisp/progmodes/gdb-mi.el (gdb--check-interpreter): Make the error message less misleading (bug#40279). --- lisp/progmodes/gdb-mi.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index f0262c23151..8ff094ffe88 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -737,8 +737,10 @@ NOARG must be t when this macro is used outside `gud-def'." (unless (zerop (length string)) (remove-function (process-filter proc) #'gdb--check-interpreter) (unless (memq (aref string 0) '(?^ ?~ ?@ ?& ?* ?=)) - ;; Apparently we're not running with -i=mi. - (let ((msg "Error: you did not specify -i=mi on GDB's command line!")) + ;; Apparently we're not running with -i=mi (or we're, for + ;; instance, debugging something inside a Docker instance with + ;; Emacs on the outside). + (let ((msg "Error: Either -i=mi wasn't specified on the GDB command line, or the extra socket couldn't be established. Consider using `M-x gud-gdb' instead.")) (message msg) (setq string (concat (propertize msg 'font-lock-face 'error) "\n" string))) -- cgit v1.2.3 From b295174210465c4285729c67ec014e0f5b53f741 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 30 Oct 2020 12:48:30 +0100 Subject: Clarify point position after text-property-search * lisp/emacs-lisp/text-property-search.el (text-property-search-forward, text-property-search-backward): Doc fix to clarify placement of point after search. * test/lisp/emacs-lisp/text-property-search-tests.el (text-property-search--pos-test): New defun. (text-property-search-forward-point-at-beginning) (text-property-search-backward-point-at-end): New test. --- lisp/emacs-lisp/text-property-search.el | 12 ++++++------ test/lisp/emacs-lisp/text-property-search-tests.el | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/lisp/emacs-lisp/text-property-search.el b/lisp/emacs-lisp/text-property-search.el index 61bd98d3cfe..d7dc7da7c18 100644 --- a/lisp/emacs-lisp/text-property-search.el +++ b/lisp/emacs-lisp/text-property-search.el @@ -34,11 +34,11 @@ "Search for the next region of text whose PROPERTY matches VALUE. If not found, return nil and don't move point. -If found, move point to end of the region and return a `prop-match' -object describing the match. To access the details of the match, -use `prop-match-beginning' and `prop-match-end' for the buffer -positions that limit the region, and `prop-match-value' for the -value of PROPERTY in the region. +If found, move point to the start of the region and return a +`prop-match' object describing the match. To access the details +of the match, use `prop-match-beginning' and `prop-match-end' for +the buffer positions that limit the region, and +`prop-match-value' for the value of PROPERTY in the region. PREDICATE is used to decide whether a value of PROPERTY should be considered as matching VALUE. @@ -125,7 +125,7 @@ that matches VALUE." "Search for the previous region of text whose PROPERTY matches VALUE. Like `text-property-search-forward', which see, but searches backward, -and if a matching region is found, moves point to its beginning." +and if a matching region is found, place point at its end." (interactive (list (let ((string (completing-read "Search for property: " obarray))) diff --git a/test/lisp/emacs-lisp/text-property-search-tests.el b/test/lisp/emacs-lisp/text-property-search-tests.el index 83d4b95b76b..278155006c2 100644 --- a/test/lisp/emacs-lisp/text-property-search-tests.el +++ b/test/lisp/emacs-lisp/text-property-search-tests.el @@ -153,6 +153,24 @@ 46 57 nil (point-max))) + +;;;; Position after search. + +(defun text-property-search--pos-test (fun pos &optional reverse) + (with-temp-buffer (:name "position") + (insert (concat "foo " + (propertize "bar" 'x t) + " baz")) + (goto-char (if reverse (point-max) (point-min))) + (funcall fun 'x t) + (should (= (point) pos)))) + +(ert-deftest text-property-search-forward-point-at-beginning () + (text-property-search--pos-test #'text-property-search-forward 5)) + +(ert-deftest text-property-search-backward-point-at-end () + (text-property-search--pos-test #'text-property-search-backward 8 t)) + (provide 'text-property-search-tests) ;;; text-property-search-tests.el ends here -- cgit v1.2.3 From 101a3b78309dff5a7466094a893c5582093a6533 Mon Sep 17 00:00:00 2001 From: Harald Jörg Date: Fri, 30 Oct 2020 13:23:52 +0100 Subject: Suppress a misleading message when closing a paren in a regex * lisp/progmodes/cperl-mode.el (cperl-forward-re): Suppress an error message about "End of string/RE not found" when we are at the end of a narrowed buffer where the end of a RE is temporarily unavailable (Bug#37127). * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127): Add a test to verify that the message is suppressed when inappropriate, but appears when the RE *is* incomplete. --- lisp/progmodes/cperl-mode.el | 7 +++++++ test/lisp/progmodes/cperl-mode-tests.el | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ebbea6bed92..94f42cb2bc4 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3225,6 +3225,13 @@ modify syntax-type text property if the situation is too hard." (and cperl-brace-recursing (or (eq ostart ?\{) (eq starter ?\{))) + ;; If we are at the end of a narrowed buffer, then a + ;; scan error should not be reported to the user. + ;; This situation actually happens when a closing + ;; paren is entered in a regular expression. + ;; Reported in Bug#37127. + (and (eobp) (buffer-narrowed-p) + (equal (car bb) 'scan-error)) (message "End of `%s%s%c ... %c' string/RE not found: %s" argument diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index 9b486ae2e2c..75010f7d0f3 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -220,4 +220,33 @@ point in the distant past, and is still broken in perl-mode. " (should (equal (nth 3 (syntax-ppss)) nil)) (should (equal (nth 4 (syntax-ppss)) t)))))) +(ert-deftest cperl-bug37127 () + "Verify that closing a paren in a regex goes without a message. +Also check that the message is issued if the regex terminator is +missing." + (let (collected-messages) + ;; Part one: Regex is ok, no messages + (ert-with-message-capture collected-messages + (with-temp-buffer + (insert "$_ =~ /(./;") + (cperl-mode) + (goto-char (point-min)) + (search-forward ".") + (let ((last-command-event ?\))) + (cperl-electric-rparen 1) + (cperl-find-pods-heres (point-min) (point-max) t))) + (should (string-equal collected-messages ""))) + ;; part two: Regex terminator missing -> message + (ert-with-message-capture collected-messages + (with-temp-buffer + (insert "$_ =~ /(..;") + (goto-char (point-min)) + (cperl-mode) + (search-forward ".") + (let ((last-command-event ?\))) + (cperl-electric-rparen 1) + (cperl-find-pods-heres (point-min) (point-max) t))) + (should (string-match "^End of .* string/RE" + collected-messages))))) + ;;; cperl-mode-tests.el ends here -- cgit v1.2.3 From 32c5f1c7a8da0c0dd9de126c966af8c7cd382970 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 30 Oct 2020 13:50:49 +0100 Subject: Fix fontifying of ::= in Makefiles * lisp/progmodes/make-mode.el (makefile-match-dependency): Don't fontify the POSIX immediate assignment operator ::= as a dependency (bug#44319). --- lisp/progmodes/make-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 01cc330dc2e..ac3d0817097 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -1721,7 +1721,9 @@ matched in a rule action." (while (progn (skip-chars-forward makefile-dependency-skip bound) (< (point) (or bound (point-max)))) (forward-char) - (or (eq (char-after) ?=) + ;; The GNU immediate assignment operator is ":=", while the + ;; POSIX operator is "::=". + (or (looking-at ":?=") (get-text-property (1- (point)) 'face) (if (> (line-beginning-position) (+ (point-min) 2)) (eq (char-before (line-end-position 0)) ?\\)) -- cgit v1.2.3 From 0836335cdff727142a8a2831942f42b18cb5c780 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Fri, 30 Oct 2020 14:04:06 +0100 Subject: Add a new command to regenerate a hunk in diff-mode * lisp/vc/diff-mode.el (diff-refresh-hunk): New function (bug#44312). (diff-mode-map): Bind C-c C-l. --- doc/emacs/files.texi | 4 ++++ etc/NEWS | 15 +++++++++++---- lisp/vc/diff-mode.el | 25 +++++++++++++++++++++---- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 51e8bd1382f..eb4353b6784 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1629,6 +1629,10 @@ Convert the entire buffer to unified diff format unified format to context format. When the mark is active, convert only the hunks within the region. +@item C-c C-l +@findex diff-refresh-hunk +Re-generate the current hunk (@code{diff-refresh-hunk}). + @item C-c C-w @findex diff-ignore-whitespace-hunk Re-generate the current hunk, disregarding changes in whitespace diff --git a/etc/NEWS b/etc/NEWS index 11783ef3192..4cc66aef6bc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1208,6 +1208,17 @@ them, using the DEL and INS buttons respectively. This is useful in Custom buffers, for example, to change the order of the elements in a list. +** Diff + +--- +*** New 'diff-mode' font locking face 'diff-error'. +This face is used for error messages from diff. + ++++ +*** New command 'diff-refresh-hunk'. +This new command (bound to 'C-c C-l') regenerates the current hunk. + + ** Miscellaneous +++ @@ -1308,10 +1319,6 @@ number [10]", or not have the default displayed at all, like "Enter a number". (This requires that all callers are altered to use 'format-prompt', though.) ---- -*** New 'diff-mode' font locking face 'diff-error'. -This face is used for error messages from diff. - +++ *** New global mode 'global-goto-address-mode'. This will enable 'goto-address-mode' in all buffers. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 7c9ad25eb31..5aeb8feb990 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -208,6 +208,8 @@ and hunk-based syntax highlighting otherwise as a fallback." ;; `d' because it duplicates the context :-( --Stef ("\C-c\C-d" . diff-unified->context) ("\C-c\C-w" . diff-ignore-whitespace-hunk) + ;; `l' because it "refreshes" the hunk like C-l refreshes the screen + ("\C-c\C-l" . diff-refresh-hunk) ("\C-c\C-b" . diff-refine-hunk) ;No reason for `b' :-( ("\C-c\C-f" . next-error-follow-minor-mode)) "Keymap for `diff-mode'. See also `diff-mode-shared-map'.") @@ -244,6 +246,8 @@ and hunk-based syntax highlighting otherwise as a fallback." :help "Split the current (unified diff) hunk at point into two hunks"] ["Ignore whitespace changes" diff-ignore-whitespace-hunk :help "Re-diff the current hunk, ignoring whitespace differences"] + ["Recompute the hunk" diff-refresh-hunk + :help "Re-diff the current hunk, keeping the whitespace differences"] ["Highlight fine changes" diff-refine-hunk :help "Highlight changes of hunk at point at a finer granularity"] ["Kill current hunk" diff-hunk-kill @@ -2045,8 +2049,15 @@ For use in `add-log-current-defun-function'." (defun diff-ignore-whitespace-hunk () "Re-diff the current hunk, ignoring whitespace differences." (interactive) + (diff-refresh-hunk t)) + +(defun diff-refresh-hunk (&optional ignore-whitespace) + "Re-diff the current hunk." + (interactive) (let* ((char-offset (- (point) (diff-beginning-of-hunk t))) - (opts (pcase (char-after) (?@ "-bu") (?* "-bc") (_ "-b"))) + (opt-type (pcase (char-after) + (?@ "-u") + (?* "-c"))) (line-nb (and (or (looking-at "[^0-9]+\\([0-9]+\\)") (error "Can't find line number")) (string-to-number (match-string 1)))) @@ -2057,7 +2068,12 @@ For use in `add-log-current-defun-function'." (file1 (make-temp-file "diff1")) (file2 (make-temp-file "diff2")) (coding-system-for-read buffer-file-coding-system) - old new) + opts old new) + (when ignore-whitespace + (setq opts '("-b"))) + (when opt-type + (setq opts (cons opt-type opts))) + (unwind-protect (save-excursion (setq old (diff-hunk-text hunk nil char-offset)) @@ -2066,8 +2082,9 @@ For use in `add-log-current-defun-function'." (write-region (concat lead (car new)) nil file2 nil 'nomessage) (with-temp-buffer (let ((status - (call-process diff-command nil t nil - opts file1 file2))) + (apply 'call-process + `(,diff-command nil t nil + ,@opts ,file1 ,file2)))) (pcase status (0 nil) ;Nothing to reformat. (1 (goto-char (point-min)) -- cgit v1.2.3 From 0f1f795fc8b72bfa0381089d1ff60f8801e394b0 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 30 Oct 2020 14:15:45 +0100 Subject: ; Fix typo in my last commit * test/lisp/emacs-lisp/text-property-search-tests.el (text-property-search--pos-test): Fix typo. --- test/lisp/emacs-lisp/text-property-search-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lisp/emacs-lisp/text-property-search-tests.el b/test/lisp/emacs-lisp/text-property-search-tests.el index 278155006c2..f643e49aa5e 100644 --- a/test/lisp/emacs-lisp/text-property-search-tests.el +++ b/test/lisp/emacs-lisp/text-property-search-tests.el @@ -157,7 +157,7 @@ ;;;; Position after search. (defun text-property-search--pos-test (fun pos &optional reverse) - (with-temp-buffer (:name "position") + (with-temp-buffer (insert (concat "foo " (propertize "bar" 'x t) " baz")) -- cgit v1.2.3 From c5611bfc4216da1a4515284b6ed47acab8026696 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 30 Oct 2020 16:07:21 +0100 Subject: Fix copying symbolic links in eshell * lisp/eshell/em-unix.el (eshell-shuffle-files): Don't bug out when copying symbolic links (bug#38577). --- lisp/eshell/em-unix.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index fd4cd6716d2..68aa6803278 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -439,7 +439,10 @@ Remove the DIRECTORY(ies), if they are empty.") (setq link (file-symlink-p source))) (progn (apply 'eshell-funcalln 'make-symbolic-link - link target args) + link target + ;; `make-symbolic-link' doesn't have + ;; KEEP-TIME; just OK-IF-ALREADY-EXISTS. + (list (car args))) (if (eq func 'rename-file) (if (and (file-directory-p source) (not (file-symlink-p source))) -- cgit v1.2.3 From bb60887b0d92a0c0d8583b200e56ae40c94b4b3a Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 30 Oct 2020 16:10:57 +0100 Subject: Revert "Adjust python tests after fix for bug#39398" This reverts commit c6fb23873a594b6a4fc57fa107869a2e82159d07. The code is tweaked to be more backwards-compatible. --- test/lisp/progmodes/python-tests.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 186290593e6..64626333c44 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -3481,7 +3481,7 @@ def foo(): (point-max)) "if True: -print ('a') + print ('a') ")))) (ert-deftest python-shell-buffer-substring-11 () @@ -3499,7 +3499,7 @@ def foo(): (point-max)) "if True: - print ('a') + print ('a') ")))) (ert-deftest python-shell-buffer-substring-12 () @@ -3518,7 +3518,7 @@ def foo(): "if True: -# Whitespace + # Whitespace print ('a') ")))) -- cgit v1.2.3 From 0d8c6df6c1f5e1150b34d4a57acee25471b47340 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 30 Oct 2020 16:15:42 +0100 Subject: Tweak previous python-mode region fix * lisp/progmodes/python.el (python-shell-buffer-substring): Tweak the previous fix for bug#39398 to behave somewhat more like it used to. --- lisp/progmodes/python.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 53542a75f58..53b654001e3 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3138,7 +3138,18 @@ the python shell: coding cookie is added. 4. Wraps indented regions under an \"if True:\" block so the interpreter evaluates them correctly." - (let* ((substring (buffer-substring-no-properties start end)) + (let* ((start (save-excursion + ;; If we're at the start of the expression, and + ;; there's just blank space ahead of it, then expand + ;; the region to include the start of the line. + ;; This makes things work better with the rest of + ;; the data we're sending over. + (goto-char start) + (if (string-blank-p + (buffer-substring (line-beginning-position) start)) + (line-beginning-position) + start))) + (substring (buffer-substring-no-properties start end)) (starts-at-point-min-p (save-restriction (widen) (= (point-min) start))) -- cgit v1.2.3 From 3f1dd62a0c87aa9b1a7243c1604bdbd5a29dd138 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 30 Oct 2020 20:40:49 +0100 Subject: Fix Bug#44289 * lisp/files.el (directory-listing-before-filename-regexp): Support DD-MMM-YYYY format. (Bug#44289) --- lisp/files.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index fdf758ad927..59bcc3e8a78 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6954,6 +6954,9 @@ If DIR's free space cannot be obtained, this function returns nil." s "+" "\\(" HH:MM "\\|" yyyy "\\)")) (western-comma (concat month s "+" dd "," s "+" yyyy)) + ;; This represents the date in strftime(3) format "%e-%b-%Y" + ;; (aka "%v"), as it is the default for many ls incarnations. + (DD-MMM-YYYY (concat dd "-" month "-" yyyy s HH:MM)) ;; Japanese MS-Windows ls-lisp has one-digit months, and ;; omits the Kanji characters after month and day-of-month. ;; On Mac OS X 10.3, the date format in East Asian locales is @@ -6981,7 +6984,8 @@ If DIR's free space cannot be obtained, this function returns nil." ;; This is not supported yet. (purecopy (concat "\\([0-9][BkKMGTPEZY]? " iso "\\|.*[0-9][BkKMGTPEZY]? " - "\\(" western "\\|" western-comma "\\|" east-asian "\\)" + "\\(" western "\\|" western-comma + "\\|" DD-MMM-YYYY "\\|" east-asian "\\)" "\\) +"))) "Regular expression to match up to the file name in a directory listing. The default value is designed to recognize dates and times -- cgit v1.2.3 From 7500abaa8ef1cec772b197d28d3c3c47b4bc5a86 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 30 Oct 2020 18:10:06 -0400 Subject: * lisp/simple.el (blink-matching-open): Fix bug#37127 Don't call `syntax-propertize` from within narrowing * lisp/progmodes/cperl-mode.el (cperl-forward-re): Revert last patch, since it is now redundant. * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127): Remove unused var; fix test so it really catches the previous bug; tweak the code to use mode-agnostic commands so it also works in `perl-mode`. --- lisp/progmodes/cperl-mode.el | 7 ------ lisp/simple.el | 2 +- test/lisp/progmodes/cperl-mode-tests.el | 39 +++++++++++++++++++-------------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 94f42cb2bc4..ebbea6bed92 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3225,13 +3225,6 @@ modify syntax-type text property if the situation is too hard." (and cperl-brace-recursing (or (eq ostart ?\{) (eq starter ?\{))) - ;; If we are at the end of a narrowed buffer, then a - ;; scan error should not be reported to the user. - ;; This situation actually happens when a closing - ;; paren is entered in a regular expression. - ;; Reported in Bug#37127. - (and (eobp) (buffer-narrowed-p) - (equal (car bb) 'scan-error)) (message "End of `%s%s%c ... %c' string/RE not found: %s" argument diff --git a/lisp/simple.el b/lisp/simple.el index 2e40e3261c9..a9d79d031e8 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8014,6 +8014,7 @@ The function should return non-nil if the two tokens do not match.") (blinkpos (save-excursion (save-restriction + (syntax-propertize (point)) (if blink-matching-paren-distance (narrow-to-region (max (minibuffer-prompt-end) ;(point-min) unless minibuf. @@ -8024,7 +8025,6 @@ The function should return non-nil if the two tokens do not match.") (not blink-matching-paren-dont-ignore-comments)))) (condition-case () (progn - (syntax-propertize (point)) (forward-sexp -1) ;; backward-sexp skips backward over prefix chars, ;; so move back to the matching paren. diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index 75010f7d0f3..9a7b5e4d6dd 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -224,28 +224,35 @@ point in the distant past, and is still broken in perl-mode. " "Verify that closing a paren in a regex goes without a message. Also check that the message is issued if the regex terminator is missing." - (let (collected-messages) - ;; Part one: Regex is ok, no messages - (ert-with-message-capture collected-messages - (with-temp-buffer - (insert "$_ =~ /(./;") - (cperl-mode) - (goto-char (point-min)) - (search-forward ".") - (let ((last-command-event ?\))) - (cperl-electric-rparen 1) - (cperl-find-pods-heres (point-min) (point-max) t))) - (should (string-equal collected-messages ""))) - ;; part two: Regex terminator missing -> message + ;; Part one: Regex is ok, no messages + (ert-with-message-capture collected-messages + (with-temp-buffer + (insert "$_ =~ /(./;") + (funcall cperl-test-mode) + (goto-char (point-min)) + (search-forward ".") + (let ((last-command-event ?\)) + ;; Don't emit "Matches ..." even if not visible (e.g. in batch). + (blink-matching-paren 'jump-offscreen)) + (self-insert-command 1) + ;; `self-insert-command' doesn't call `blink-matching-open' in + ;; batch mode, so we need to call it explicitly. + (blink-matching-open)) + (syntax-propertize (point-max))) + (should (string-equal collected-messages ""))) + ;; part two: Regex terminator missing -> message + (when (eq cperl-test-mode #'cperl-mode) + ;; This test is only run in `cperl-mode' because only cperl-mode + ;; emits a message to warn about such unclosed REs. (ert-with-message-capture collected-messages (with-temp-buffer (insert "$_ =~ /(..;") (goto-char (point-min)) - (cperl-mode) + (funcall cperl-test-mode) (search-forward ".") (let ((last-command-event ?\))) - (cperl-electric-rparen 1) - (cperl-find-pods-heres (point-min) (point-max) t))) + (self-insert-command 1)) + (syntax-propertize (point-max))) (should (string-match "^End of .* string/RE" collected-messages))))) -- cgit v1.2.3 From 2e1ab3e583d911afc7e263922f0672d0299bd515 Mon Sep 17 00:00:00 2001 From: JoĂŁo TĂĄvora Date: Fri, 30 Oct 2020 18:43:20 +0000 Subject: Bring back elisp-eldoc-documentation-function, marked obsolete Fixes: bug#43609 It's not useful for ElDoc's eldoc-mode mechanism in Elisp, and nothing in Emacs uses it, but it wasn't strictly marked internal, so it's best to bring it back. * lisp/progmodes/elisp-mode.el (elisp--documentation-one-liner): New helper. (elisp-eldoc-documentation-function): New function, with obsoletion warning. --- lisp/progmodes/elisp-mode.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index c7ff351845e..ce2b924d514 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1413,6 +1413,30 @@ which see." or argument string for functions. 2 - `function' if function args, `variable' if variable documentation.") +(defun elisp--documentation-one-liner () + (let* (str + (callback (lambda (doc &rest plist) + (setq str + (format "%s: %s" + (propertize (prin1-to-string + (plist-get plist :thing)) + 'face (plist-get plist :face)) + doc))))) + (or (progn (elisp-eldoc-var-docstring callback) str) + (progn (elisp-eldoc-funcall callback) str)))) + +(defalias 'elisp-eldoc-documentation-function 'elisp--documentation-one-liner + "Return Elisp documentation for the thing at point as one-line string. +This is meant as a backward compatibility aide to the \"old\" +Elisp eldoc behaviour. Consider variable docstrings and function +signatures only, in this order. If none applies, returns nil. +Changes to `eldoc-documentation-functions' and +`eldoc-documentation-strategy' are _not_ reflected here. As such +it is preferrable to use ElDoc's interfaces directly.") + +(make-obsolete 'elisp-eldoc-documentation-function + "use ElDoc's interfaces instead." "28.1") + (defun elisp-eldoc-funcall (callback &rest _ignored) "Document function call at point. Intended for `eldoc-documentation-functions' (which see)." -- cgit v1.2.3 From 3758be484e0a3f54eab968a0ee8bec31b9cd92c3 Mon Sep 17 00:00:00 2001 From: JoĂŁo TĂĄvora Date: Fri, 30 Oct 2020 21:47:44 +0000 Subject: Don't make ElDoc doc buffer visible in buffer list by default Fixes: bug#44334 * lisp/emacs-lisp/eldoc.el (eldoc-doc-buffer): No longer take INTERACTIVE arg. Show buffer if invisible. (eldoc--format-doc-buffer): Don't change buffer visibility. (eldoc-display-in-buffer): Show buffer if invisible if by calling eldoc-doc-buffer. --- lisp/emacs-lisp/eldoc.el | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 922de18743d..10dc3be44da 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -450,20 +450,27 @@ directly from the user or from ElDoc's automatic mechanisms'.") (defvar eldoc--doc-buffer-docs nil "Documentation items in `eldoc--doc-buffer'.") -(defun eldoc-doc-buffer (&optional interactive) - (interactive (list t)) +(defun eldoc-doc-buffer () "Display ElDoc documentation buffer. + This holds the results of the last documentation request." + (interactive) (unless (buffer-live-p eldoc--doc-buffer) - (setq eldoc--doc-buffer (get-buffer-create "*eldoc*"))) - (when interactive - (display-buffer eldoc--doc-buffer))) + (user-error (format + "ElDoc buffer doesn't exist, maybe `%s' to produce one." + (substitute-command-keys "\\[eldoc]")))) + (with-current-buffer eldoc--doc-buffer + (rename-buffer (replace-regexp-in-string "^ *" "" + (buffer-name))) + (display-buffer (current-buffer)))) (defun eldoc--format-doc-buffer (docs) "Ensure DOCS are displayed in an *eldoc* buffer." (interactive (list t)) - (eldoc-doc-buffer) ;; ensure buffer exists - (with-current-buffer eldoc--doc-buffer + (with-current-buffer (if (buffer-live-p eldoc--doc-buffer) + eldoc--doc-buffer + (setq eldoc--doc-buffer + (get-buffer-create " *eldoc*"))) (unless (eq docs eldoc--doc-buffer-docs) (setq-local eldoc--doc-buffer-docs docs) (let ((inhibit-read-only t) @@ -482,14 +489,19 @@ This holds the results of the last documentation request." ": " this-doc)) do (insert this-doc) - when rest do (insert "\n")) - ;; Maybe rename the buffer. - (rename-buffer (if things-reported-on - (format "*eldoc for %s*" - (mapconcat (lambda (s) (format "%s" s)) - things-reported-on - ", ")) - "*eldoc*"))))) + when rest do (insert "\n") + finally (goto-char (point-min))) + ;; Rename the buffer, taking into account whether it was + ;; hidden or not + (rename-buffer (format "%s*eldoc%s*" + (if (string-match "^ " (buffer-name)) " " "") + (if things-reported-on + (format " for %s" + (mapconcat + (lambda (s) (format "%s" s)) + things-reported-on + ", ")) + "")))))) eldoc--doc-buffer) (defun eldoc--echo-area-substring (available) @@ -595,9 +607,9 @@ Honor `eldoc-echo-area-use-multiline-p' and (defun eldoc-display-in-buffer (docs interactive) "Display DOCS in a dedicated buffer. If INTERACTIVE is t, also display the buffer." - (let ((buf (eldoc--format-doc-buffer docs))) - (when interactive - (display-buffer buf)))) + (eldoc--format-doc-buffer docs) + (when interactive + (eldoc-doc-buffer))) (defun eldoc-documentation-default () "Show first doc string for item at point. -- cgit v1.2.3 From 74c45a62e1e48d7c52dc513b6911e65dcc38aa23 Mon Sep 17 00:00:00 2001 From: JoĂŁo TĂĄvora Date: Fri, 30 Oct 2020 22:09:36 +0000 Subject: Shoosh byte-compilation warning in lisp/emacs-lisp/eldoc.el Per bug#43609, elisp-eldoc-documentation-function is again in master, but since it's now officially obsoleted, this backward compatibility shim in eldoc--eval-expression-setup shouldn't unnecessarily trigger warnings in master's code. * lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Shoosh by-compilation warning. --- lisp/emacs-lisp/eldoc.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 10dc3be44da..78cb8f08c34 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -241,8 +241,9 @@ expression point is on." :lighter eldoc-minor-mode-string ;; `emacs-lisp-mode' itself? (cond ((<= emacs-major-version 27) (declare-function elisp-eldoc-documentation-function "elisp-mode") - (add-function :before-until (local 'eldoc-documentation-function) - #'elisp-eldoc-documentation-function)) + (with-no-warnings + (add-function :before-until (local 'eldoc-documentation-function) + #'elisp-eldoc-documentation-function))) (t (add-hook 'eldoc-documentation-functions #'elisp-eldoc-var-docstring nil t) (add-hook 'eldoc-documentation-functions -- cgit v1.2.3 From 73bc7b543bfad54d50eb15943800dce12834efd6 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 30 Oct 2020 22:40:11 -0400 Subject: Make hideshow.el work with Mhtml mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested by Ian Williams . * lisp/textmodes/mhtml-mode.el: Require ‘pcase’ when compiling. (mhtml-forward): New func. * lisp/progmodes/hideshow.el (hs-special-modes-alist): Add entry for ‘mhtml-mode’. --- lisp/progmodes/hideshow.el | 5 ++++- lisp/textmodes/mhtml-mode.el | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 625e08e4d79..2ad66ccc5e0 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -264,7 +264,10 @@ This has effect only if `search-invisible' is set to `open'." (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) - (js-mode "{" "}" "/[*/]" nil))) + (js-mode "{" "}" "/[*/]" nil) + (mhtml-mode "{\\|<[^/>]*?" "}\\|]*[^/]>" " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From ecec9a259b13d88fa23dde078fba99ae78ef79c7 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Sun, 1 Nov 2020 10:10:08 -0300 Subject: Fix saving a face setting with Customize * lisp/cus-edit.el (custom-face-save): Make sure we back up into the :shown-value property what the user has edited so far, if we are going to recreate the custom-face widget. (Bug#44331) --- lisp/cus-edit.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 769a69a50f2..3eef4468394 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -3931,7 +3931,12 @@ Optional EVENT is the location for the menu." (custom-face-mark-to-save widget) ;; The user is working on only a selected terminal type; ;; make sure we save the entire spec to `custom-file'. (Bug #40866) + ;; If recreating a widget that may have been edited by the user, remember + ;; to always save the edited value into the :shown-value property, so + ;; we use that value for the recreated widget. (Bug#44331) + (widget-put widget :shown-value (custom-face-widget-to-spec widget)) (custom-face-edit-all widget) + (widget-put widget :shown-value nil) ; Reset it after we used it. (custom-face-mark-to-save widget) (if (eq form 'selected) (custom-face-edit-selected widget) -- cgit v1.2.3 From 2a4b0da28c3d25f2eea17c9dc95f7a244bdf4535 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 1 Nov 2020 15:00:36 +0100 Subject: Make minor mode ARG work as documented * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Clarify when minor modes are switched on/off when called from lisp (bug#44341). (define-minor-mode): Make calls from Lisp switch the mode on/off as documented. --- lisp/emacs-lisp/easy-mmode.el | 28 +++++++++++++++++++--------- test/lisp/emacs-lisp/easy-mmode-tests.el | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index a707d204f8b..a5a971a6981 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -84,10 +84,13 @@ replacing its case-insensitive matches with the literal string in LIGHTER." (defconst easy-mmode--arg-docstring " -If called interactively, enable %s if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, -also enable the mode if ARG is omitted or nil, and toggle it -if ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `%s'. If the prefix argument is +positive, enable the mode, and if it is zero or negative, disable +the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. +Enable the mode if ARG is nil, omitted, or is a positive number. +All other values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled.") @@ -301,13 +304,20 @@ or call the function `%s'.")))) ,(easy-mmode--mode-docstring doc pretty-name keymap-sym) ;; Use `toggle' rather than (if ,mode 0 1) so that using ;; repeat-command still does the toggling correctly. - (interactive (list (or current-prefix-arg 'toggle))) + (interactive (list (if current-prefix-arg + (prefix-numeric-value current-prefix-arg) + 'toggle))) (let ((,last-message (current-message))) (,@setter - (if (eq arg 'toggle) - (not ,getter) - ;; A nil argument also means ON now. - (> (prefix-numeric-value arg) 0))) + (cond ((eq arg 'toggle) + (not ,getter)) + ((and (numberp arg) + (> arg 0)) + t) + ((eq arg nil) + t) + (t + nil))) ,@body ;; The on/off hooks are here for backward compatibility only. (run-hooks ',hook (if ,getter ',hook-on ',hook-off)) diff --git a/test/lisp/emacs-lisp/easy-mmode-tests.el b/test/lisp/emacs-lisp/easy-mmode-tests.el index 4d7fe9444fb..4a448200a2b 100644 --- a/test/lisp/emacs-lisp/easy-mmode-tests.el +++ b/test/lisp/emacs-lisp/easy-mmode-tests.el @@ -44,6 +44,27 @@ '(c-mode (not message-mode mail-mode) text-mode)) t)))) +(ert-deftest easy-mmode--minor-mode () + (with-temp-buffer + (define-minor-mode test-mode "A test.") + (should (eq test-mode nil)) + (test-mode t) + (should (eq test-mode nil)) + (test-mode nil) + (should (eq test-mode t)) + (test-mode -33) + (should (eq test-mode nil)) + (test-mode 33) + (should (eq test-mode t)) + (test-mode 0) + (should (eq test-mode nil)) + (test-mode 'toggle) + (should (eq test-mode t)) + (test-mode 'toggle) + (should (eq test-mode nil)) + (test-mode "what") + (should (eq test-mode nil)))) + (provide 'easy-mmode-tests) ;;; easy-mmode-tests.el ends here -- cgit v1.2.3 From ed70be7a187f211d366312e1c6b04b1dbcbffd06 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 1 Nov 2020 06:28:38 -0800 Subject: ; Auto-commit of loaddefs files. --- lisp/ldefs-boot.el | 2900 +++++++++++++++++----------------------------------- 1 file changed, 924 insertions(+), 1976 deletions(-) diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index d611293546c..f5ae3adf2eb 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -511,10 +511,13 @@ Return t if `allout-mode' is active in current buffer." nil t) (autoload 'allout-mode "allout" "\ Toggle Allout outline mode. -If called interactively, enable Allout mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Allout mode'. If the prefix argument +is positive, enable the mode, and if it is zero or negative, disable +the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -829,10 +832,13 @@ See `allout-widgets-mode' for allout widgets mode features.") (autoload 'allout-widgets-mode "allout-widgets" "\ Toggle Allout Widgets mode. -If called interactively, enable Allout-Widgets mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Allout-Widgets mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1246,15 +1252,17 @@ Entering array mode calls the function `array-mode-hook'. ;;;### (autoloads nil "artist" "textmodes/artist.el" (0 0 0 0)) ;;; Generated autoloads from textmodes/artist.el -(push (purecopy '(artist 1 2 6)) package--builtin-versions) (autoload 'artist-mode "artist" "\ Toggle Artist mode. -If called interactively, enable Artist mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Artist mode'. If the prefix argument +is positive, enable the mode, and if it is zero or negative, disable +the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1528,7 +1536,7 @@ ENTRY is the name of a password-store entry. The key used to retrieve the password is the symbol `secret'. The convention used as the format for a password-store file is -the following (see https://www.passwordstore.org/#organization): +the following (see http://www.passwordstore.org/#organization): secret key1: value1 @@ -1586,10 +1594,13 @@ or call the function `autoarg-kp-mode'.") (autoload 'autoarg-kp-mode "autoarg" "\ Toggle Autoarg-KP mode, a global minor mode. -If called interactively, enable Autoarg-Kp mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Autoarg-Kp mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1645,10 +1656,13 @@ or call the function `auto-insert-mode'.") (autoload 'auto-insert-mode "autoinsert" "\ Toggle Auto-insert mode, a global minor mode. -If called interactively, enable Auto-Insert mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Auto-Insert mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1696,14 +1710,29 @@ The function does NOT recursively descend into subdirectories of the directory or directories specified. In an interactive call, prompt for a default output file for the -autoload definitions, and temporarily bind the variable -`generated-autoload-file' to this value. When called from Lisp, -use the existing value of `generated-autoload-file'. If any Lisp -file binds `generated-autoload-file' as a file-local variable, -write its autoloads into the specified file instead. +autoload definitions. When called from Lisp, use the existing +value of `generated-autoload-file'. If any Lisp file binds +`generated-autoload-file' as a file-local variable, write its +autoloads into the specified file instead. \(fn &rest DIRS)" t nil) +(make-obsolete 'update-directory-autoloads 'make-directory-autoloads '"28.1") + +(autoload 'make-directory-autoloads "autoload" "\ +Update autoload definitions for Lisp files in the directories DIRS. +DIR can be either a single directory or a list of +directories. (The latter usage is discouraged.) + +The autoloads will be written to OUTPUT-FILE. If any Lisp file +binds `generated-autoload-file' as a file-local variable, write +its autoloads into the specified file instead. + +The function does NOT recursively descend into subdirectories of the +directory or directories specified. + +\(fn DIR OUTPUT-FILE)" t nil) + (autoload 'batch-update-autoloads "autoload" "\ Update loaddefs.el autoloads in batch mode. Calls `update-directory-autoloads' on the command line arguments. @@ -1720,10 +1749,13 @@ should be non-nil)." nil nil) (autoload 'auto-revert-mode "autorevert" "\ Toggle reverting buffer when the file changes (Auto-Revert Mode). -If called interactively, enable Auto-Revert mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Auto-Revert mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1750,10 +1782,13 @@ This function is designed to be added to hooks, for example: (autoload 'auto-revert-tail-mode "autorevert" "\ Toggle reverting tail of buffer when the file grows. -If called interactively, enable Auto-Revert-Tail mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Auto-Revert-Tail mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1794,10 +1829,13 @@ or call the function `global-auto-revert-mode'.") (autoload 'global-auto-revert-mode "autorevert" "\ Toggle Global Auto-Revert Mode. -If called interactively, enable Global Auto-Revert mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Global Auto-Revert mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1928,10 +1966,13 @@ or call the function `display-battery-mode'.") (autoload 'display-battery-mode "battery" "\ Toggle battery status display in mode line (Display Battery mode). -If called interactively, enable Display-Battery mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Display-Battery mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -2907,10 +2948,13 @@ columns on its right towards the left. (autoload 'bug-reference-mode "bug-reference" "\ Toggle hyperlinking bug references in the buffer (Bug Reference mode). -If called interactively, enable Bug-Reference mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Bug-Reference mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -2920,10 +2964,13 @@ disabled. (autoload 'bug-reference-prog-mode "bug-reference" "\ Like `bug-reference-mode', but only buttonize in comments and strings. -If called interactively, enable Bug-Reference-Prog mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Bug-Reference-Prog mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -2998,11 +3045,14 @@ that already has a `.elc' file. Compile a file of Lisp code named FILENAME into a file of byte code. The output file's name is generated by passing FILENAME to the function `byte-compile-dest-file' (which see). -With prefix arg (noninteractively: 2nd arg), LOAD the file after compiling. The value is non-nil if there were no errors, nil if errors. +See also `emacs-lisp-byte-compile-and-load'. + \(fn FILENAME &optional LOAD)" t nil) +(set-advertised-calling-convention 'byte-compile-file '(filename) '"28.1") + (autoload 'compile-defun "bytecomp" "\ Compile and evaluate the current top-level form. Print the result in the echo area. @@ -3293,14 +3343,6 @@ See Info node `(calc)Defining Functions'. (register-definition-prefixes "calc" '("calc" "defcalcmodevar" "inexact-result" "math-" "var-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "calc-aent" "calc/calc-aent.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from calc/calc-aent.el - -(register-definition-prefixes "calc-aent" '("calc" "math-")) - ;;;*** ;;;### (autoloads nil "calc-alg" "calc/calc-alg.el" (0 0 0 0)) @@ -3336,14 +3378,6 @@ See Info node `(calc)Defining Functions'. (register-definition-prefixes "calc-cplx" '("calc" "math-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "calc-embed" "calc/calc-embed.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from calc/calc-embed.el - -(register-definition-prefixes "calc-embed" '("calc-")) - ;;;*** ;;;### (autoloads nil "calc-ext" "calc/calc-ext.el" (0 0 0 0)) @@ -3442,14 +3476,6 @@ See Info node `(calc)Defining Functions'. (register-definition-prefixes "calc-menu" '("calc-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "calc-misc" "calc/calc-misc.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from calc/calc-misc.el - -(register-definition-prefixes "calc-misc" '("math-iipow")) - ;;;*** ;;;### (autoloads nil "calc-mode" "calc/calc-mode.el" (0 0 0 0)) @@ -3560,14 +3586,6 @@ See Info node `(calc)Defining Functions'. (register-definition-prefixes "calc-vec" '("calc" "math-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "calc-yank" "calc/calc-yank.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from calc/calc-yank.el - -(register-definition-prefixes "calc-yank" '("calc-" "math-number-regexp")) - ;;;*** ;;;### (autoloads nil "calcalg2" "calc/calcalg2.el" (0 0 0 0)) @@ -4499,7 +4517,6 @@ from which to start. ;;;### (autoloads nil "chart" "emacs-lisp/chart.el" (0 0 0 0)) ;;; Generated autoloads from emacs-lisp/chart.el -(push (purecopy '(chart 0 2)) package--builtin-versions) (register-definition-prefixes "chart" '("chart")) @@ -4692,10 +4709,13 @@ Prefix argument is the same as for `checkdoc-defun'." t nil) (autoload 'checkdoc-minor-mode "checkdoc" "\ Toggle automatic docstring checking (Checkdoc minor mode). -If called interactively, enable Checkdoc minor mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Checkdoc minor mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -4786,14 +4806,6 @@ and runs the normal hook `command-history-hook'." t nil) (register-definition-prefixes "chistory" '("command-history-" "default-command-history-filter" "list-command-history-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "cl-extra" "emacs-lisp/cl-extra.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/cl-extra.el - -(register-definition-prefixes "cl-extra" '("cl-")) - ;;;*** ;;;### (autoloads nil "cl-font-lock" "progmodes/cl-font-lock.el" @@ -4813,10 +4825,13 @@ or call the function `cl-font-lock-built-in-mode'.") (autoload 'cl-font-lock-built-in-mode "cl-font-lock" "\ Highlight built-in functions, variables, and types in `lisp-mode'. -If called interactively, enable Cl-Font-Lock-Built-In mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Cl-Font-Lock-Built-In mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -5028,10 +5043,13 @@ This can be needed when using code byte-compiled using the old macro-expansion of `cl-defstruct' that used vectors objects instead of record objects. -If called interactively, enable Cl-Old-Struct-Compat mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Cl-Old-Struct-Compat mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -5040,14 +5058,6 @@ disabled. (register-definition-prefixes "cl-lib" '("cl-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "cl-macs" "emacs-lisp/cl-macs.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/cl-macs.el - -(register-definition-prefixes "cl-macs" '("cl-")) - ;;;*** ;;;### (autoloads nil "cl-print" "emacs-lisp/cl-print.el" (0 0 0 @@ -5104,14 +5114,6 @@ limit. (register-definition-prefixes "cl-print" '("cl-print-" "help-byte-code")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "cl-seq" "emacs-lisp/cl-seq.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/cl-seq.el - -(register-definition-prefixes "cl-seq" '("cl--")) - ;;;*** ;;;### (autoloads nil "cmacexp" "progmodes/cmacexp.el" (0 0 0 0)) @@ -5480,10 +5482,13 @@ Runs `compilation-mode-hook' with `run-mode-hooks' (which see). (autoload 'compilation-shell-minor-mode "compile" "\ Toggle Compilation Shell minor mode. -If called interactively, enable Compilation-Shell minor mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Compilation-Shell minor mode'. If +the prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -5498,10 +5503,13 @@ See `compilation-mode'. (autoload 'compilation-minor-mode "compile" "\ Toggle Compilation minor mode. -If called interactively, enable Compilation minor mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Compilation minor mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -5538,10 +5546,13 @@ or call the function `dynamic-completion-mode'.") (autoload 'dynamic-completion-mode "completion" "\ Toggle dynamic word-completion on or off. -If called interactively, enable Dynamic-Completion mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Dynamic-Completion mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6102,10 +6113,13 @@ or call the function `cua-mode'.") (autoload 'cua-mode "cua-base" "\ Toggle Common User Access style editing (CUA mode). -If called interactively, enable Cua mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Cua mode'. If the prefix argument is +positive, enable the mode, and if it is zero or negative, disable the +mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6153,10 +6167,13 @@ Enable CUA selection mode without the C-z/C-x/C-c/C-v bindings. Toggle the region as rectangular. Activates the region if needed. Only lasts until the region is deactivated. -If called interactively, enable Cua-Rectangle-Mark mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Cua-Rectangle-Mark mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6179,10 +6196,13 @@ By convention, this is a list of symbols where each symbol stands for the (autoload 'cursor-intangible-mode "cursor-sensor" "\ Keep cursor outside of any `cursor-intangible' text property. -If called interactively, enable Cursor-Intangible mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Cursor-Intangible mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6197,10 +6217,13 @@ where WINDOW is the affected window, OLDPOS is the last known position of the cursor and DIR can be `entered' or `left' depending on whether the cursor is entering the area covered by the text-property property or leaving it. -If called interactively, enable Cursor-Sensor mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Cursor-Sensor mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6523,7 +6546,7 @@ The format is suitable for use with `easy-menu-define'. \(fn SYMBOL &optional NAME)" nil nil) -(register-definition-prefixes "cus-edit" '("Custom-" "custom" "widget-")) +(register-definition-prefixes "cus-edit" '("Custom-" "cus" "widget-")) ;;;*** @@ -6580,10 +6603,13 @@ Mode used for cvs status output. (autoload 'cwarn-mode "cwarn" "\ Minor mode that highlights suspicious C and C++ constructions. -If called interactively, enable Cwarn mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Cwarn mode'. If the prefix argument +is positive, enable the mode, and if it is zero or negative, disable +the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6618,7 +6644,9 @@ ARG is omitted or nil. Cwarn mode is enabled in all buffers where `turn-on-cwarn-mode-if-enabled' would do it. -See `cwarn-mode' for more information on Cwarn mode. + +See `cwarn-mode' for more information on +Cwarn mode. \(fn &optional ARG)" t nil) @@ -6824,8 +6852,7 @@ Variables controlling indentation style and extra features: dcl-imenu-label-call Change the text that is used as sub-listing labels in imenu. -Loading this package calls the value of the variable -`dcl-mode-load-hook' with no args, if that value is non-nil. +To run code after DCL mode has loaded, use `with-eval-after-load'. Turning on DCL mode calls the value of the variable `dcl-mode-hook' with no args, if that value is non-nil. @@ -6971,7 +6998,6 @@ The most useful commands are: ;;;### (autoloads nil "delim-col" "delim-col.el" (0 0 0 0)) ;;; Generated autoloads from delim-col.el -(push (purecopy '(delim-col 2 1)) package--builtin-versions) (autoload 'delimit-columns-customize "delim-col" "\ Customize the `columns' group." t nil) @@ -7032,10 +7058,13 @@ or call the function `delete-selection-mode'.") (autoload 'delete-selection-mode "delsel" "\ Toggle Delete Selection mode. -If called interactively, enable Delete-Selection mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Delete-Selection mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -7204,10 +7233,13 @@ or call the function `desktop-save-mode'.") (autoload 'desktop-save-mode "desktop" "\ Toggle desktop saving (Desktop Save mode). -If called interactively, enable Desktop-Save mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Desktop-Save mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -7600,10 +7632,13 @@ a diff with \\[diff-reverse-direction]. (autoload 'diff-minor-mode "diff-mode" "\ Toggle Diff minor mode. -If called interactively, enable Diff minor mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Diff minor mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -7781,22 +7816,6 @@ Like \\[dired-jump] (`dired-jump') but in other window. (register-definition-prefixes "dired" '("dired-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "dired-aux" "dired-aux.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from dired-aux.el - -(register-definition-prefixes "dired-aux" '("dired-" "minibuffer-default-add-dired-shell-commands")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "dired-x" "dired-x.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from dired-x.el - -(register-definition-prefixes "dired-x" '("dired-" "virtual-dired")) - ;;;*** ;;;### (autoloads nil "dirtrack" "dirtrack.el" (0 0 0 0)) @@ -7805,10 +7824,13 @@ Like \\[dired-jump] (`dired-jump') but in other window. (autoload 'dirtrack-mode "dirtrack" "\ Toggle directory tracking in shell buffers (Dirtrack mode). -If called interactively, enable Dirtrack mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Dirtrack mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -7979,10 +8001,13 @@ in `.emacs'. Toggle display of fill-column indicator. This uses `display-fill-column-indicator' internally. -If called interactively, enable Display-Fill-Column-Indicator mode if -ARG is positive, and disable it if ARG is zero or negative. If called -from Lisp, also enable the mode if ARG is omitted or nil, and toggle -it if ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Display-Fill-Column-Indicator mode'. +If the prefix argument is positive, enable the mode, and if it is zero +or negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -7990,6 +8015,8 @@ disabled. To change the position of the column displayed by default customize `display-fill-column-indicator-column'. You can change the character for the indicator setting `display-fill-column-indicator-character'. +The globalized version is `global-display-fill-column-indicator-mode', +which see. See Info node `Displaying Boundaries' for details. \(fn &optional ARG)" t nil) @@ -8014,10 +8041,31 @@ ARG is omitted or nil. Display-Fill-Column-Indicator mode is enabled in all buffers where `display-fill-column-indicator--turn-on' would do it. -See `display-fill-column-indicator-mode' for more information on Display-Fill-Column-Indicator mode. + +See `display-fill-column-indicator-mode' for more information on +Display-Fill-Column-Indicator mode. + +`global-display-fill-column-indicator-modes' is used to control which modes +this minor mode is used in. \(fn &optional ARG)" t nil) +(defvar global-display-fill-column-indicator-modes '((not special-mode) t) "\ +Which major modes `display-fill-column-indicator-mode' is switched on in. +This variable can be either t (all major modes), nil (no major modes), +or a list of modes and (not modes) to switch use this minor mode or +not. For instance + + (c-mode (not message-mode mail-mode) text-mode) + +means \"use this mode in all modes derived from `c-mode', don't use in +modes derived from `message-mode' or `mail-mode', but do use in other +modes derived from `text-mode'\". An element with value t means \"use\" +and nil means \"don't use\". There's an implicit nil at the end of the +list.") + +(custom-autoload 'global-display-fill-column-indicator-modes "display-fill-column-indicator" t) + (register-definition-prefixes "display-fill-column-indicator" '("display-fill-column-indicator--turn-on")) ;;;*** @@ -8030,10 +8078,13 @@ See `display-fill-column-indicator-mode' for more information on Display-Fill-Co Toggle display of line numbers in the buffer. This uses `display-line-numbers' internally. -If called interactively, enable Display-Line-Numbers mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Display-Line-Numbers mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -8064,7 +8115,9 @@ ARG is omitted or nil. Display-Line-Numbers mode is enabled in all buffers where `display-line-numbers--turn-on' would do it. -See `display-line-numbers-mode' for more information on Display-Line-Numbers mode. + +See `display-line-numbers-mode' for more information on +Display-Line-Numbers mode. \(fn &optional ARG)" t nil) @@ -8168,10 +8221,13 @@ to the next best mode." nil nil) (autoload 'doc-view-minor-mode "doc-view" "\ Toggle displaying buffer via Doc View (Doc View minor mode). -If called interactively, enable Doc-View minor mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Doc-View minor mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -8233,10 +8289,13 @@ Switch to *doctor* buffer and start giving psychotherapy." t nil) (autoload 'double-mode "double" "\ Toggle special insertion on double keypresses (Double mode). -If called interactively, enable Double mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Double mode'. If the prefix argument +is positive, enable the mode, and if it is zero or negative, disable +the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -8252,7 +8311,6 @@ strings when pressed twice. See `double-map' for details. ;;;### (autoloads nil "dunnet" "play/dunnet.el" (0 0 0 0)) ;;; Generated autoloads from play/dunnet.el -(push (purecopy '(dunnet 2 2)) package--builtin-versions) (autoload 'dunnet "dunnet" "\ Switch to *dungeon* buffer and start game." t nil) @@ -8297,6 +8355,10 @@ appear in DOC, a paragraph is added to DOC explaining usage of the mode argument. Optional INIT-VALUE is the initial value of the mode's variable. + Note that the minor mode function won't be called by setting + this option, so the value *reflects* the minor mode's natural + initial state, rather than *setting* it. + In the vast majority of cases it should be nil. Optional LIGHTER is displayed in the mode line when the mode is on. Optional KEYMAP is the default keymap bound to the mode keymap. If non-nil, it should be a variable name (whose value is a keymap), @@ -8354,18 +8416,21 @@ For example, you could write (autoload 'define-globalized-minor-mode "easy-mmode" "\ Make a global mode GLOBAL-MODE corresponding to buffer-local minor MODE. TURN-ON is a function that will be called with no args in every buffer - and that should try to turn MODE on if applicable for that buffer. -Each of KEY VALUE is a pair of CL-style keyword arguments. As - the minor mode defined by this function is always global, any - :global keyword is ignored. Other keywords have the same - meaning as in `define-minor-mode', which see. In particular, - :group specifies the custom group. The most useful keywords - are those that are passed on to the `defcustom'. It normally - makes no sense to pass the :lighter or :keymap keywords to - `define-globalized-minor-mode', since these are usually passed - to the buffer-local version of the minor mode. +and that should try to turn MODE on if applicable for that buffer. + +Each of KEY VALUE is a pair of CL-style keyword arguments. :predicate +specifies which major modes the globalized minor mode should be switched on +in. As the minor mode defined by this function is always global, any +:global keyword is ignored. Other keywords have the same meaning as in +`define-minor-mode', which see. In particular, :group specifies the custom +group. The most useful keywords are those that are passed on to the +`defcustom'. It normally makes no sense to pass the :lighter or :keymap +keywords to `define-globalized-minor-mode', since these are usually passed +to the buffer-local version of the minor mode. + BODY contains code to execute each time the mode is enabled or disabled. - It is executed after toggling the mode, and before running GLOBAL-MODE-hook. +It is executed after toggling the mode, and before running +GLOBAL-MODE-hook. If MODE's set-up depends on the major mode in effect when it was enabled, then disabling and reenabling MODE should make MODE work @@ -9074,10 +9139,13 @@ or call the function `global-ede-mode'.") (autoload 'global-ede-mode "ede" "\ Toggle global EDE (Emacs Development Environment) mode. -If called interactively, enable Global Ede mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Global Ede mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -9104,38 +9172,6 @@ an EDE controlled project. (register-definition-prefixes "ede/autoconf-edit" '("autoconf-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/base" "cedet/ede/base.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/base.el - -(register-definition-prefixes "ede/base" '("ede-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/config" "cedet/ede/config.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/config.el - -(register-definition-prefixes "ede/config" '("ede-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/cpp-root" -;;;;;; "cedet/ede/cpp-root.el" (0 0 0 0)) -;;; Generated autoloads from cedet/ede/cpp-root.el - -(register-definition-prefixes "ede/cpp-root" '("ede-cpp-root-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/custom" "cedet/ede/custom.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/custom.el - -(register-definition-prefixes "ede/custom" '("ede-" "eieio-ede-old-variables")) - ;;;*** ;;;### (autoloads nil "ede/detect" "cedet/ede/detect.el" (0 0 0 0)) @@ -9143,62 +9179,6 @@ an EDE controlled project. (register-definition-prefixes "ede/detect" '("ede-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/dired" "cedet/ede/dired.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/dired.el - -(register-definition-prefixes "ede/dired" '("ede-dired-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/emacs" "cedet/ede/emacs.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/emacs.el - -(register-definition-prefixes "ede/emacs" '("ede-emacs-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/files" "cedet/ede/files.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/files.el - -(register-definition-prefixes "ede/files" '("ede-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/generic" -;;;;;; "cedet/ede/generic.el" (0 0 0 0)) -;;; Generated autoloads from cedet/ede/generic.el - -(register-definition-prefixes "ede/generic" '("ede-generic-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/linux" "cedet/ede/linux.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/linux.el - -(register-definition-prefixes "ede/linux" '("ede-linux-" "project-linux-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/locate" "cedet/ede/locate.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/locate.el - -(register-definition-prefixes "ede/locate" '("ede-locate-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/make" "cedet/ede/make.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/make.el - -(register-definition-prefixes "ede/make" '("ede-")) - ;;;*** ;;;### (autoloads nil "ede/makefile-edit" "cedet/ede/makefile-edit.el" @@ -9316,14 +9296,6 @@ an EDE controlled project. (register-definition-prefixes "ede/project-am" '("project-am-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/shell" "cedet/ede/shell.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/shell.el - -(register-definition-prefixes "ede/shell" '("ede-shell-run-command")) - ;;;*** ;;;### (autoloads nil "ede/simple" "cedet/ede/simple.el" (0 0 0 0)) @@ -9338,14 +9310,6 @@ an EDE controlled project. (register-definition-prefixes "ede/source" '("ede-source")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/speedbar" -;;;;;; "cedet/ede/speedbar.el" (0 0 0 0)) -;;; Generated autoloads from cedet/ede/speedbar.el - -(register-definition-prefixes "ede/speedbar" '("ede-")) - ;;;*** ;;;### (autoloads nil "ede/srecode" "cedet/ede/srecode.el" (0 0 0 @@ -9354,14 +9318,6 @@ an EDE controlled project. (register-definition-prefixes "ede/srecode" '("ede-srecode-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/util" "cedet/ede/util.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/util.el - -(register-definition-prefixes "ede/util" '("ede-make-buffer-writable")) - ;;;*** ;;;### (autoloads nil "edebug" "emacs-lisp/edebug.el" (0 0 0 0)) @@ -9829,7 +9785,6 @@ To change the default, set the variable `ediff-use-toolbar-p', which see." t nil ;;;### (autoloads nil "edmacro" "edmacro.el" (0 0 0 0)) ;;; Generated autoloads from edmacro.el -(push (purecopy '(edmacro 2 1)) package--builtin-versions) (autoload 'edit-kbd-macro "edmacro" "\ Edit a keyboard macro. @@ -9979,14 +9934,6 @@ BUFFER is put back into its original major mode. (register-definition-prefixes "eieio-base" '("eieio-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "eieio-compat" -;;;;;; "emacs-lisp/eieio-compat.el" (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/eieio-compat.el - -(register-definition-prefixes "eieio-compat" '("eieio--generic-static-symbol-specializers" "generic-p" "next-method-p" "no-")) - ;;;*** ;;;### (autoloads nil "eieio-core" "emacs-lisp/eieio-core.el" (0 @@ -10006,14 +9953,6 @@ It creates an autoload function for CNAME's constructor. (register-definition-prefixes "eieio-core" '("class-" "eieio-" "inconsistent-class-hierarchy" "invalid-slot-" "unbound-slot")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "eieio-custom" -;;;;;; "emacs-lisp/eieio-custom.el" (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/eieio-custom.el - -(register-definition-prefixes "eieio-custom" '("eieio-")) - ;;;*** ;;;### (autoloads nil "eieio-datadebug" "emacs-lisp/eieio-datadebug.el" @@ -10022,14 +9961,6 @@ It creates an autoload function for CNAME's constructor. (register-definition-prefixes "eieio-datadebug" '("data-debug-insert-object-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "eieio-opt" "emacs-lisp/eieio-opt.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/eieio-opt.el - -(register-definition-prefixes "eieio-opt" '("eieio-")) - ;;;*** ;;;### (autoloads nil "eieio-speedbar" "emacs-lisp/eieio-speedbar.el" @@ -10042,7 +9973,7 @@ It creates an autoload function for CNAME's constructor. ;;;### (autoloads nil "eldoc" "emacs-lisp/eldoc.el" (0 0 0 0)) ;;; Generated autoloads from emacs-lisp/eldoc.el -(push (purecopy '(eldoc 1 10 0)) package--builtin-versions) +(push (purecopy '(eldoc 1 11 0)) package--builtin-versions) ;;;*** @@ -10062,10 +9993,13 @@ or call the function `electric-pair-mode'.") (autoload 'electric-pair-mode "elec-pair" "\ Toggle automatic parens pairing (Electric Pair mode). -If called interactively, enable Electric-Pair mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Electric-Pair mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -10083,10 +10017,13 @@ To toggle the mode in a single buffer, use `electric-pair-local-mode'. (autoload 'electric-pair-local-mode "elec-pair" "\ Toggle `electric-pair-mode' only in this buffer. -If called interactively, enable Electric-Pair-Local mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Electric-Pair-Local mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -10180,142 +10117,6 @@ displayed." t nil) (register-definition-prefixes "elp" '("elp-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-alias" "eshell/em-alias.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-alias.el - -(register-definition-prefixes "em-alias" '("eshell" "pcomplete/eshell-mode/alias")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-banner" "eshell/em-banner.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-banner.el - -(register-definition-prefixes "em-banner" '("eshell-banner-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-basic" "eshell/em-basic.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-basic.el - -(register-definition-prefixes "em-basic" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-cmpl" "eshell/em-cmpl.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-cmpl.el - -(register-definition-prefixes "em-cmpl" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-dirs" "eshell/em-dirs.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-dirs.el - -(register-definition-prefixes "em-dirs" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-glob" "eshell/em-glob.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-glob.el - -(register-definition-prefixes "em-glob" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-hist" "eshell/em-hist.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-hist.el - -(register-definition-prefixes "em-hist" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-ls" "eshell/em-ls.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-ls.el - -(register-definition-prefixes "em-ls" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-pred" "eshell/em-pred.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-pred.el - -(register-definition-prefixes "em-pred" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-prompt" "eshell/em-prompt.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-prompt.el - -(register-definition-prefixes "em-prompt" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-rebind" "eshell/em-rebind.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-rebind.el - -(register-definition-prefixes "em-rebind" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-script" "eshell/em-script.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-script.el - -(register-definition-prefixes "em-script" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-smart" "eshell/em-smart.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-smart.el - -(register-definition-prefixes "em-smart" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-term" "eshell/em-term.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-term.el - -(register-definition-prefixes "em-term" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-tramp" "eshell/em-tramp.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-tramp.el - -(register-definition-prefixes "em-tramp" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-unix" "eshell/em-unix.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-unix.el - -(register-definition-prefixes "em-unix" '("eshell" "nil-blank-string")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-xtra" "eshell/em-xtra.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-xtra.el - -(register-definition-prefixes "em-xtra" '("eshell/")) - ;;;*** ;;;### (autoloads nil "emacs-lock" "emacs-lock.el" (0 0 0 0)) @@ -10439,10 +10240,13 @@ Minor mode for editing text/enriched files. These are files with embedded formatting information in the MIME standard text/enriched format. -If called interactively, enable Enriched mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Enriched mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -10701,10 +10505,13 @@ Encrypt marked files." t nil) (autoload 'epa-mail-mode "epa-mail" "\ A minor-mode for composing encrypted/clearsigned mails. -If called interactively, enable epa-mail mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `epa-mail mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -10768,10 +10575,13 @@ or call the function `epa-global-mail-mode'.") (autoload 'epa-global-mail-mode "epa-mail" "\ Minor mode to hook EasyPG into Mail mode. -If called interactively, enable Epa-Global-Mail mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Epa-Global-Mail mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -10882,14 +10692,6 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL. (register-definition-prefixes "erc" '("define-erc-module" "erc-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-autoaway" -;;;;;; "erc/erc-autoaway.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-autoaway.el - -(register-definition-prefixes "erc-autoaway" '("erc-auto")) - ;;;*** ;;;### (autoloads nil "erc-backend" "erc/erc-backend.el" (0 0 0 0)) @@ -10897,54 +10699,6 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL. (register-definition-prefixes "erc-backend" '("erc-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-button" "erc/erc-button.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-button.el - -(register-definition-prefixes "erc-button" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-capab" "erc/erc-capab.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-capab.el - -(register-definition-prefixes "erc-capab" '("erc-capab-identify-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-dcc" "erc/erc-dcc.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-dcc.el - -(register-definition-prefixes "erc-dcc" '("erc-" "pcomplete/erc-mode/")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-desktop-notifications" -;;;;;; "erc/erc-desktop-notifications.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-desktop-notifications.el - -(register-definition-prefixes "erc-desktop-notifications" '("erc-notifications-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-ezbounce" -;;;;;; "erc/erc-ezbounce.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-ezbounce.el - -(register-definition-prefixes "erc-ezbounce" '("erc-ezb-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-fill" "erc/erc-fill.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-fill.el - -(register-definition-prefixes "erc-fill" '("erc-")) - ;;;*** ;;;### (autoloads nil "erc-goodies" "erc/erc-goodies.el" (0 0 0 0)) @@ -10959,30 +10713,6 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL. (register-definition-prefixes "erc-ibuffer" '("erc-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-identd" "erc/erc-identd.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-identd.el - -(register-definition-prefixes "erc-identd" '("erc-identd-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-imenu" "erc/erc-imenu.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-imenu.el - -(register-definition-prefixes "erc-imenu" '("erc-unfill-notice")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-join" "erc/erc-join.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-join.el - -(register-definition-prefixes "erc-join" '("erc-")) - ;;;*** ;;;### (autoloads nil "erc-lang" "erc/erc-lang.el" (0 0 0 0)) @@ -10990,46 +10720,6 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL. (register-definition-prefixes "erc-lang" '("erc-cmd-LANG" "iso-638-languages" "language")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-list" "erc/erc-list.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-list.el - -(register-definition-prefixes "erc-list" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-log" "erc/erc-log.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-log.el - -(register-definition-prefixes "erc-log" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-match" "erc/erc-match.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-match.el - -(register-definition-prefixes "erc-match" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-menu" "erc/erc-menu.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-menu.el - -(register-definition-prefixes "erc-menu" '("erc-menu-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-netsplit" -;;;;;; "erc/erc-netsplit.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-netsplit.el - -(register-definition-prefixes "erc-netsplit" '("erc-")) - ;;;*** ;;;### (autoloads nil "erc-networks" "erc/erc-networks.el" (0 0 0 @@ -11046,118 +10736,6 @@ Interactively select a server to connect to using `erc-server-alist'." t nil) (register-definition-prefixes "erc-networks" '("erc-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-notify" "erc/erc-notify.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-notify.el - -(register-definition-prefixes "erc-notify" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-page" "erc/erc-page.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-page.el - -(register-definition-prefixes "erc-page" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-pcomplete" -;;;;;; "erc/erc-pcomplete.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-pcomplete.el - -(register-definition-prefixes "erc-pcomplete" '("erc-pcomplet" "pcomplete")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-replace" -;;;;;; "erc/erc-replace.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-replace.el - -(register-definition-prefixes "erc-replace" '("erc-replace-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-ring" "erc/erc-ring.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-ring.el - -(register-definition-prefixes "erc-ring" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-services" -;;;;;; "erc/erc-services.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-services.el - -(register-definition-prefixes "erc-services" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-sound" "erc/erc-sound.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-sound.el - -(register-definition-prefixes "erc-sound" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-speedbar" -;;;;;; "erc/erc-speedbar.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-speedbar.el - -(register-definition-prefixes "erc-speedbar" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-spelling" -;;;;;; "erc/erc-spelling.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-spelling.el - -(register-definition-prefixes "erc-spelling" '("erc-spelling-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-stamp" "erc/erc-stamp.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-stamp.el - -(register-definition-prefixes "erc-stamp" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-status-sidebar" -;;;;;; "erc/erc-status-sidebar.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-status-sidebar.el - -(register-definition-prefixes "erc-status-sidebar" '("erc-status-sidebar-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-track" "erc/erc-track.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-track.el - -(register-definition-prefixes "erc-track" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-truncate" -;;;;;; "erc/erc-truncate.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-truncate.el - -(register-definition-prefixes "erc-truncate" '("erc-max-buffer-size")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-xdcc" "erc/erc-xdcc.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-xdcc.el - -(register-definition-prefixes "erc-xdcc" '("erc-")) - ;;;*** ;;;### (autoloads nil "ert" "emacs-lisp/ert.el" (0 0 0 0)) @@ -12067,11 +11645,11 @@ Render FILE using EWW. \(fn FILE)" t nil) (autoload 'eww-search-words "eww" "\ -Search the web for the text between BEG and END. +Search the web for the text in the region. If region is active (and not whitespace), search the web for -the text between BEG and END. Else, prompt the user for a search -string. See the `eww-search-prefix' variable for the search -engine used." t nil) +the text between region beginning and end. Else, prompt the +user for a search string. See the variable `eww-search-prefix' +for the search engine used." t nil) (autoload 'eww-mode "eww" "\ Mode for browsing the web. @@ -12380,10 +11958,13 @@ a top-level keymap, `text-scale-increase' or (autoload 'buffer-face-mode "face-remap" "\ Minor mode for a buffer-specific default face. -If called interactively, enable Buffer-Face mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Buffer-Face mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -13299,10 +12880,13 @@ region is invalid. (autoload 'flymake-mode "flymake" "\ Toggle Flymake mode on or off. -If called interactively, enable Flymake mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Flymake mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -13384,10 +12968,13 @@ Turn on `flyspell-mode' for comments and strings." t nil) (autoload 'flyspell-mode "flyspell" "\ Toggle on-the-fly spell checking (Flyspell mode). -If called interactively, enable Flyspell mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Flyspell mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -13412,7 +12999,7 @@ invoking `ispell-change-dictionary'. Consider using the `ispell-parser' to check your text. For instance consider adding: -\(add-hook \\='tex-mode-hook (function (lambda () (setq ispell-parser \\='tex)))) +\(add-hook \\='tex-mode-hook (lambda () (setq ispell-parser \\='tex))) in your init file. \\[flyspell-region] checks all words inside a region. @@ -13464,10 +13051,13 @@ Turn off Follow mode. Please see the function `follow-mode'." nil nil) (autoload 'follow-mode "follow" "\ Toggle Follow mode. -If called interactively, enable Follow mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Follow mode'. If the prefix argument +is positive, enable the mode, and if it is zero or negative, disable +the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -13587,15 +13177,17 @@ selected if the original window is the first one in the frame. ;;;### (autoloads nil "footnote" "mail/footnote.el" (0 0 0 0)) ;;; Generated autoloads from mail/footnote.el -(push (purecopy '(footnote 0 19)) package--builtin-versions) (autoload 'footnote-mode "footnote" "\ Toggle Footnote mode. -If called interactively, enable Footnote mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Footnote mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -14026,7 +13618,6 @@ Interactively, reads the register using `register-read-with-preview'. ;;;### (autoloads nil "gamegrid" "play/gamegrid.el" (0 0 0 0)) ;;; Generated autoloads from play/gamegrid.el -(push (purecopy '(gamegrid 1 2)) package--builtin-versions) (register-definition-prefixes "gamegrid" '("gamegrid-")) @@ -14057,10 +13648,13 @@ being transferred. This list may grow up to a size of `gdb-debug-log-max' after which the oldest element (at the end of the list) is deleted every time a new one is added (at the front). -If called interactively, enable Gdb-Enable-Debug mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Gdb-Enable-Debug mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -14238,10 +13832,13 @@ regular expression that can be used as an element of (autoload 'glasses-mode "glasses" "\ Minor mode for making identifiers likeThis readable. -If called interactively, enable Glasses mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Glasses mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -14850,10 +14447,13 @@ If FORCE is non-nil, replace the old ones. (autoload 'gnus-mailing-list-mode "gnus-ml" "\ Minor mode for providing mailing-list commands. -If called interactively, enable Gnus-Mailing-List mode if ARG is -positive, and disable it if ARG is zero or negative. If called -from Lisp, also enable the mode if ARG is omitted or nil, and -toggle it if ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Gnus-Mailing-List mode'. If the +prefix argument is positive, enable the mode, and if it is zero +or negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. +Enable the mode if ARG is nil, omitted, or is a positive number. +All other values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -15304,10 +14904,13 @@ Also fontifies the buffer appropriately (see `goto-address-fontify-p' and (autoload 'goto-address-mode "goto-addr" "\ Minor mode to buttonize URLs and e-mail addresses in the current buffer. -If called interactively, enable Goto-Address mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Goto-Address mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -15334,17 +14937,22 @@ ARG is omitted or nil. Goto-Address mode is enabled in all buffers where `goto-addr-mode--turn-on' would do it. -See `goto-address-mode' for more information on Goto-Address mode. + +See `goto-address-mode' for more information on +Goto-Address mode. \(fn &optional ARG)" t nil) (autoload 'goto-address-prog-mode "goto-addr" "\ Like `goto-address-mode', but only for comments and strings. -If called interactively, enable Goto-Address-Prog mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Goto-Address-Prog mode'. If the +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -15678,10 +15286,13 @@ or call the function `gud-tooltip-mode'.") (autoload 'gud-tooltip-mode "gud" "\ Toggle the display of GUD tooltips. -If called interactively, enable Gud-Tooltip mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Gud-Tooltip mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -16388,14 +15999,6 @@ This discards the buffer's undo information." t nil) (register-definition-prefixes "hexl" '("dehexlify-buffer" "hexl-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "hfy-cmap" "hfy-cmap.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from hfy-cmap.el - -(register-definition-prefixes "hfy-cmap" '("hfy-" "htmlfontify-unload-rgb-file")) - ;;;*** ;;;### (autoloads nil "hi-lock" "hi-lock.el" (0 0 0 0)) @@ -16404,10 +16007,13 @@ This discards the buffer's undo information." t nil) (autoload 'hi-lock-mode "hi-lock" "\ Toggle selective highlighting of patterns (Hi Lock mode). -If called interactively, enable Hi-Lock mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Hi-Lock mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -16494,7 +16100,9 @@ ARG is omitted or nil. Hi-Lock mode is enabled in all buffers where `turn-on-hi-lock-if-enabled' would do it. -See `hi-lock-mode' for more information on Hi-Lock mode. + +See `hi-lock-mode' for more information on +Hi-Lock mode. \(fn &optional ARG)" t nil) @@ -16598,6 +16206,9 @@ Interactively added patterns are those normally specified using `highlight-regexp' and `highlight-lines-matching-regexp'; they can be found in variable `hi-lock-interactive-patterns'." t nil) +(autoload 'hi-lock-find-patterns "hi-lock" "\ +Add patterns from the current buffer to the list of hi-lock patterns." t nil) + (register-definition-prefixes "hi-lock" '("hi-lock-" "turn-on-hi-lock-if-enabled")) ;;;*** @@ -16608,10 +16219,13 @@ be found in variable `hi-lock-interactive-patterns'." t nil) (autoload 'hide-ifdef-mode "hideif" "\ Toggle features to hide/show #ifdef blocks (Hide-Ifdef mode). -If called interactively, enable Hide-Ifdef mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Hide-Ifdef mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -16659,7 +16273,7 @@ Several variables affect how the hiding is done: ;;;### (autoloads nil "hideshow" "progmodes/hideshow.el" (0 0 0 0)) ;;; Generated autoloads from progmodes/hideshow.el -(defvar hs-special-modes-alist (mapcar 'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil))) "\ +(defvar hs-special-modes-alist (mapcar 'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil) (mhtml-mode "{\\|<[^/>]*?" "}\\|]*[^/]>" "