aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/calendar (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use single-arg form of `signal` to re-throw an errorStefan Monnier2026-03-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/smerge-mode.el (smerge-extend): * lisp/vc/diff-mode.el (diff-beginning-of-file-and-junk): * lisp/transient.el (transient--with-emergency-exit): * lisp/textmodes/tex-mode.el (latex-forward-sexp): * lisp/tar-mode.el (tar-mode): * lisp/savehist.el (savehist--reload): * lisp/progmodes/octave.el (inferior-octave-resync-dirs): * lisp/progmodes/js.el (js--re-search-forward): * lisp/plstore.el (plstore--decrypt): * lisp/net/dbus.el (dbus-ignore-errors, dbus-register-signal) (dbus-handle-event): * lisp/mouse.el (mouse-drag-track, mouse-drag-region-rectangle): * lisp/minibuffer.el (completion-pcm--find-all-completions): * lisp/mail/rfc2231.el (rfc2231-parse-string): * lisp/mail/rfc2047.el (rfc2047-encode-region): * lisp/jit-lock.el (jit-lock-fontify-now): * lisp/international/ja-dic-utl.el (skkdic-lookup-key): * lisp/gnus/nnselect.el (nnselect-generate-artlist): * lisp/gnus/mml-sec.el (mml-secure-epg-encrypt, mml-secure-epg-sign): * lisp/gnus/mail-source.el (mail-source-fetch-pop) (mail-source-check-pop): * lisp/gnus/gnus-art.el (gnus-article-read-summary-keys): * lisp/files.el (basic-save-buffer-2, files--ensure-directory) (files--force, copy-directory): * lisp/eshell/esh-io.el (eshell-output-object-to-target): * lisp/epa.el (epa-decrypt-file, epa-verify-file, epa-sign-file) (epa-encrypt-file, epa-decrypt-region, epa-verify-region) (epa-sign-region, epa-encrypt-region, epa-delete-keys) (epa-export-keys, epa-insert-keys): * lisp/emacs-lisp/package.el (package--unless-error): * lisp/emacs-lisp/multisession.el (multisession--read-file-value): * lisp/emacs-lisp/lisp.el (up-list-default-function): * lisp/desktop.el (desktop-kill): * lisp/calendar/time-date.el (date-to-time): * lisp/calendar/appt.el (appt-display-message): * lisp/calc/calc.el (calc-do): * lisp/bookmark.el (bookmark-handle-bookmark): * src/fileio.c (report_file_errno): * lisp/vc/vc.el (vc-checkout, vc-pull): Use `(signal err)` instead of `(signal (car err) (cdr err))`.
* ; * lisp/calendar/icalendar-recur.el (eval-when-compile): Fix a typo.Eli Zaretskii2026-02-281-1/+1
|
* Fix `diary-rrule' recurrence rule calculation (Bug#80460)Richard Lawrence2026-02-262-6/+8
| | | | | | | | | | | | | | | Thanks to TAKAHASHI Yoshio for reporting and for fixing one of the typos. In addition to the reported bug involving :include/:exclude, testing revealed that the provided RRULE COUNT clause was also not being handled correctly; this change also fixes that. * lisp/calendar/diary-icalendar.el (diary-rrule): Handle recurrence rules with a COUNT clause. * lisp/calendar/icalendar-recur.el (icalendar-recur-recurrences-in-interval): Fix a couple of typos that caused RDATE/EXDATE calculations to fail. * test/lisp/calendar/diary-icalendar-tests.el (diary-icalendar-test-rrule-bug-80460): New test for this bug.
* calendar-check-holidays: Call calendar-increment-monthLiu Hui2026-02-251-0/+1
| | | | | * lisp/calendar/holidays.el (calendar-check-holidays): Call calendar-increment-month (bug#80476).
* Support displaying more months in the calendarLiu Hui2026-02-2212-613/+767
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/calendar/calendar.el (calendar-month-edges): Fix typo. (calendar-total-months): New variable. (calendar-get-month-range, calendar-get-date-range) (calendar--month-overlap-p, calendar-month-visible-p) (calendar-nongregorian-date-visible-p): New functions. (calendar-nongregorian-visible-p): Declare obsolete. (calendar-recompute-layout-variables, calendar-generate): Replace fixed month numbers with 'calendar-total-months'. (calendar-cursor-to-date, calendar-date-is-visible-p): Support the calendar with more than three months. (calendar-mode): Make some variables buffer-local to allow calendar-mode buffers showing different number of months. (calendar-mode-map): Use new command names. * lisp/calendar/cal-move.el (calendar-goto-today): Always move the cursor to today's date. (calendar--show-month-at-edge): New function. (calendar-recenter, calendar-forward-day): Support the calendar with more than three months. (calendar-forward-month, calendar-end-of-month) (calendar-beginning-of-year, calendar-end-of-year): Place the new month at the edge instead of the second month segment, to prevent the cursor from jumping back and forth. This is consistent with the behavior of calendar-forward-day/week. (calendar-scroll-left): Maintain the relative position of the cursor with respect to the window, when the old date is out of view. (calendar-scroll-left-three-months) (calendar-scroll-right-three-months): Replace the fixed month number with the actual number of months. Rename ... (calendar-scroll-calendar-left, calendar-scroll-calendar-right): ... to new commands. Make old names as aliases and mark them obsolete. (calendar-show-more-months, calendar-show-fewer-months): New commands. * lisp/calendar/cal-menu.el (cal-menu-holiday-window-suffix): Use the actual date range instead of three months. (cal-menu-scroll-menu, cal-menu-global-mouse-menu): Use new command names and update description. * lisp/calendar/holidays.el (holidays, list-holidays) (calendar-check-holidays, holiday-in-range): Use calendar-total-months. (calendar-list-holidays, holiday-fixed, holiday-float) (holiday-sexp): Replace displayed-year/month with the actual calendar range. (holiday-after, holiday-easter-etc-abs) (holiday-greek-orthodox-easter-abs): New functions. (holiday-advent, holiday-easter-etc) (holiday-greek-orthodox-easter): Look up holidays in all visible years instead of current displayed-year. * lisp/calendar/solar.el (solar-equinoxes-solstices): Search equinoxes and solstices in all visible months. (solar-equinoxes-solstices-1): New function. * lisp/calendar/lunar.el (lunar-phase-list): Add optional argument. (calendar-lunar-phases): Use visible calendar range. * lisp/calendar/cal-china.el (holiday-chinese-new-year) (holiday-chinese-winter-solstice, holiday-chinese-qingming) (holiday-chinese): Replace displayed-year/month with the actual calendar range, and look up holidays in all visible years. * lisp/calendar/cal-julian.el (holiday-julian): Use calendar-nongregorian-date-visible-p because there may exist more than one corresponding dates when the calendar shows more months. * lisp/calendar/cal-bahai.el (holiday-bahai): Support calendar with more than three months. (holiday-bahai-new-year, holiday-bahai-twin-holy-birthdays): Look up holidays in all visible years. (holiday-bahai-new-year-1, holiday-bahai-twin-holy-birthdays-1): New functions. * lisp/calendar/cal-hebrew.el (calendar-hebrew-date-is-visible-p) (holiday-hebrew, calendar-hebrew-mark-date-pattern): Support calendar with more than three months, in which more than one holidays may exist. (holiday-hebrew-rosh-hashanah-1, holiday-hebrew-hanukkah-1) (holiday-hebrew-passover-1): New functions. (holiday-hebrew-rosh-hashanah, holiday-hebrew-hanukkah) (holiday-hebrew-passover, holiday-hebrew-tisha-b-av): Look up holidays in all visible years. * lisp/calendar/cal-islam.el (holiday-islamic): Support calendar with more than three months. (holiday-islamic-new-year): Find holidays in all visible years. * lisp/calendar/diary-lib.el (diary-mark-sexp-entries) (calendar-mark-days-named, calendar-mark-date-pattern) (calendar-mark-complex): Use the displayed range instead of the three-month range. (calendar-mark-1): Fix marking dates in calendar with more than three months. * test/lisp/calendar/holidays-tests.el (holidays-test-holiday-easter-etc, holidays-test--get-holidays) (holidays-test-more-months): New test file. * doc/emacs/calendar.texi: Mention new commands and update related description. * etc/NEWS: Announce new commands. (bug#80099)
* Fix failing iCalendar tests when TZ=UTCRichard Lawrence2026-02-151-7/+15
| | | | | | | | | | | | * lisp/calendar/diary-icalendar.el (diary-icalendar--tz-is-utc-p): New function. (diary-icalendar-convert-time-via-strategy): Don't expect a VTIMEZONE for UTC times. (diary-icalendar-export-region): Don't generate a VTIMEZONE for 'local export strategy in UTC. * test/lisp/calendar/diary-icalendar-tests.el (diary-icalendar-test-entry-parser): Don't generate a VTIMEZONE for 'local export strategy in UTC.
* lisp/calendar/diary-icalendar.el (di:summary-regexp): Fix `:type`Stefan Monnier2026-02-121-2/+2
|
* lisp/calendar: Style changesStefan Monnier2026-02-0824-366/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix some misuses of `defconst` and `%s`, avoid uses of the old dynbound dialect of `eval`, delete redundant `:group` arguments, and prefer #' to quote function names. And stop creating alists for completion tables since lists of strings work just as well. * lisp/calendar/appt.el: Delete redundant `:group` arguments. Prefer #' to quote function names. * lisp/calendar/cal-hebrew.el (solar-time-string): Declare function. (calendar-hebrew-read-date, calendar-hebrew-list-yahrzeits): * lisp/calendar/cal-persia.el (calendar-persian-read-date): * lisp/calendar/cal-mayan.el (calendar-mayan-read-haab-date) (calendar-mayan-read-tzolkin-date): * lisp/calendar/cal-julian.el (calendar-julian-goto-date): * lisp/calendar/cal-islam.el (calendar-islamic-read-date): * lisp/calendar/cal-coptic.el (calendar-coptic-read-date): * lisp/calendar/cal-bahai.el (calendar-bahai-read-date): Completion tables can be lists of strings for decades. * lisp/calendar/cal-china.el: Delete redundant `:group` arguments. (calendar-chinese-zodiac-sign-on-or-after) (calendar-chinese-new-moon-on-or-after): Use lexical dialect also for `eval`. * lisp/calendar/cal-dst.el: Delete redundant `:group` arguments. Use lexical dialect also for `eval`. * lisp/calendar/cal-html.el: Delete redundant `:group` arguments. * lisp/calendar/cal-menu.el: Prefer #' to quote function names. * lisp/calendar/cal-tex.el: Delete redundant `:group` arguments. (cal-tex-weekly-common): Use lexical dialect also for `eval`. * lisp/calendar/calendar.el (calendar-mode-map): Prefer #' to quote function names. * lisp/calendar/diary-icalendar.el (di:rrule-sexp-to-recurrence) (di:other-sexp-to-recurrence): Use lexical dialect also for `eval`. * lisp/calendar/diary-lib.el: Delete redundant `:group` arguments. Prefer #' to quote function names. (diary-sexp-entry, diary-offset, diary-remind): Use lexical dialect also for `eval`. * lisp/calendar/icalendar-macs.el (ical:define-param): Fix misuse of `%s` in `format`. * lisp/calendar/icalendar-parser.el (ical:value-types) (ical:param-types, ical:property-types, ical:component-types): Don't use `defconst` on variables we mutate. * lisp/calendar/icalendar-recur.el (icr:current-tz-to-vtimezone) (icr:current-tz-to-vtimezone): Use lexical dialect also for `eval`. * lisp/calendar/icalendar.el: Delete redundant `:group` arguments. * lisp/calendar/lunar.el: Prefer #' to quote function names. * lisp/calendar/solar.el (solar-sunrise-sunset-string) (calendar-sunrise-sunset-month): Use lexical dialect also for `eval`. * lisp/calendar/timeclock.el: Prefer #' to quote function names.
* Merge branch 'main' into icalendarStefan Monnier2026-02-0828-275/+57
|\
| * Fix inconsistent definition and usage of 'calendar-buffer'Liu Hui2026-01-242-2/+2
| | | | | | | | | | | | | | * lisp/calendar/calendar.el (calendar-buffer): Define it as a variable. * lisp/calendar/diary-lib.el (diary-mark-entries): Set 'calendar-buffer' as a string. (bug#79994)
| * ; calendar-bahai: Move tests and convert to ERTJacob S. Gordon2026-01-241-226/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/calendar/cal-bahai.el (calendar-bahai--nawruz-reference-dates) (calendar-bahai--twin-birthdays-reference-dates): Move to test file. (calendar-bahai--verify-nawruz) (calendar-bahai--verify-twin-birthdays): Remove and adapt contents in test file. (calendar-bahai-verify-calculations, calendar-bahai-run-tests): Remove. * test/lisp/calendar/cal-bahai-tests.el: Add file. (calendar-bahai--nawruz-reference-dates) (calendar-bahai--twin-birthdays-reference-dates): Add test data. (calendar-bahai-verify-nawruz, calendar-bahai-verify-twin-birthdays): Create ERT tests. (Bug#80207)
| * ; 'holiday-float': Improve documentation of edge caseJacob S. Gordon2026-01-101-4/+11
| | | | | | | | | | | | | | | | When MONTH DAY falls on DAYNAME the holiday may be closer to MONTH DAY than expected. Describe this situation in the function's doc string. (Bug#00000) * lisp/calendar/holidays.el (holiday-float): Improve documentation.
| * Fix cursor position in calendar-generate-window (bug#80069)Liu Hui2026-01-101-3/+6
| | | | | | | | | | * lisp/calendar/calendar.el (calendar-generate-window): Move cursor to today before running calendar-today-visible-hook.
| * ; Add 2026 to copyright years.Sean Whitton2026-01-0128-28/+28
| |
| * Fix the date in the calendar mode line (bug#80069)Liu Hui2025-12-292-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/calendar/calendar.el (calendar-redraw) (calendar-other-month): Make sure that the mode line is updated after cursor motion in case 'date' is used in 'calendar-mode-line-format'. (calendar-set-date-style): Delete call to calendar-update-mode-line because it is called in calendar-draw. (calendar-generate-window): Delete calls to calendar-update-mode-line and calendar-cursor-to-visible-date. It's better for the caller to do it. (calendar-basic-setup): Update cursor position and mode line. * lisp/calendar/cal-move.el (calendar-goto-today): Delete calendar-update-mode-line because calendar-move-hook is called last. This is consistent with other cal-move commands. * test/lisp/calendar/calendar-tests.el (calendar-test-date-in-mode-line): New test.
* | Fix iCalendar macro (debug ...) forms and indentationscratch/icalendarRichard Lawrence2026-02-014-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in Bug#74994. * lisp/calendar/icalendar-ast.el (icalendar-make-param) (icalendar-make-property, icalendar-make-component) (icalendar-make-node-from-templates) * lisp/calendar/icalendar-macs.el (icalendar-with-node-children) (icalendar-with-node-value, icalendar-with-param) (icalendar-with-child-of, icalendar-with-property-of): Remove extraneous arguments in (debug ...) forms. * lisp/calendar/icalendar-recur.el * lisp/calendar/diary-icalendar.el: Fix indentation of calls to them. Plus one other minor fix: * lisp/calendar/diary-icalendar.el (diary-icalendar-current-tz-to-vtimezone): Ignore unused error variable (fixes a byte compiler warning).
* | Some minor code improvements in iCalendar libraryRichard Lawrence2026-01-037-156/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/calendar/icalendar-mode.el: Update file header. Fix error display in 'icalendar-errors-mode': * lisp/calendar/icalendar.el (icalendar-error-regexp): Fix to allow " *UNFOLDED:" prefix in buffer names. (Extra colon was breaking match.) (icalendar-format-error): Suppress this prefix preferentially in long buffer names. Add declarations to some iCalendar macros: * lisp/calendar/icalendar-macs.el (icalendar-with-node-value) (icalendar-with-child-of) (icalendar-with-param-of) (icalendar-with-node-children) (icalendar-with-node-value) (icalendar-with-param) * lisp/calendar/icalendar-ast.el (icalendar-make-property) (icalendar-make-component) (icalendar-make-node-from-templates): Add (declare ...) forms. Add `icalendar-trimp' to icalendar-utils.el: * lisp/calendar/icalendar-utils.el (icalendar-trimp): New function. * lisp/calendar/diary-icalendar.el (diary-icalendar-format-entry) (diary-icalendar-parse-attendees-and-organizer) (diary-icalendar-parse-location) (diary-icalendar-parse-url) (diary-icalendar-parse-uid): Use it to replace diary-icalendar--nonempty. (diary-icalendar--nonempty): Remove. Move VTIMEZONE creation to icalendar-recur.el: The following changes move `diary-icalendar-current-tz-to-vtimezone' and associated code to icalendar-recur.el. Library users are likely to need this function, so it makes sense to keep it with other time zone-related code in that file, instead of having them depend on diary-icalendar. * lisp/calendar/icalendar-recur.el (icalendar-tz-data-insufficient) (icalendar-tz-unsupported): New error types. (icalendar-recur-current-tz-to-vtimezone): Rename from `diary-icalendar-current-tz-to-vtimezone'; signal new error types. (icalendar-recur--tz-warning): Rename from `diary-icalendar--tz-warning'. (icalendar-recur--emacs-local-tzid): Rename from `diary-icalendar--emacs-local-tzid'. (icalendar-recur--tz-info-sexp-p): Rename from `diary-icalendar--tz-info-sexp-p'. * lisp/calendar/diary-icalendar.el (diary-icalendar-current-tz-to-vtimezone): Reimplement with `icalendar-recur-current-tz-to-vtimezone'. (diary-icalendar--tz-warning) (diary-icalendar--emacs-local-tzid) (diary-icalendar--tz-info-sexp-p): Renamed and moved; see above. (diary-time-zone-export-strategy): Update validation function name.
* | Change the format function calling conventions in diary-icalendar.elRichard Lawrence2025-12-291-426/+310
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids `calendar-dlet' and unprefixed dynamic variable bindings when calling user format functions, as discussed in Bug#74994. * lisp/calendar/diary-icalendar.el (diary-icalendar-time-format): Fix whitespace. (diary-icalendar-format-attendee) (diary-icalendar-format-entry): Use fewer dynamic variables, prefix them, replace `calendar-dlet' with `dlet', and call user format functions with the node to be formatted. (diary-icalendar-attendee-format-function) (diary-icalendar-vevent-format-function) (diary-icalendar-vjournal-format-function) (diary-icalendar-vtodo-format-function): Document these changes. (diary-icalendar-attendee-skeleton) (diary-icalendar-vevent-skeleton) (diary-icalendar-vjournal-skeleton) (diary-icalendar-vtodo-skeleton): Use `defun' with `skeleton-insert' instead of `define-skeleton'. Update variable references. (diary-icalendar-import-buffer-to-buffer) (diary-icalendar-add-valarms): Replace `calendar-dlet' with `dlet'. * doc/emacs/calendar.texi (Diary iCalendar Import): Update example in manual.
* | iCalendar code improvementsRichard Lawrence2025-12-298-192/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks to Stefan Monnier for the comments in Bug#74994 leading to most of these changes. Improvements in diary-icalendar.el and related changes: * lisp/calendar/diary-icalendar.el (icalendar-save-binary-atttachment): Rename to `diary-icalendar-save-binary-attachment'. Document internal require. (diary-icalendar-attendee-skeleton-command): Rename to `diary-icalendar-attendee-format-function'. (diary-icalendar-vevent-skeleton-command): Rename to `diary-icalendar-vevent-format-function'. (diary-icalendar-vjournal-skeleton-command): Rename to `diary-icalendar-vjournal-format-function'. (diary-icalendar-vtodo-skeleton-command): Rename to `diary-icalendar-vtodo-format-function'. * doc/emacs/calendar.texi (Diary iCalendar Import) * lisp/calendar/icalendar.el (icalendar-import-format) (icalendar-import-format-summary, icalendar-import-format-description) (icalendar-import-format-location, icalendar-import-format-organizer) (icalendar-import-format-url, icalendar-import-format-uid) (icalendar-import-format-status, icalendar-import-format-class): Update references to renamed functions. (diary-icalendar-attendee-format-function): Fix quoted function name. (diary-icalendar-attendee-format-function) (diary-icalendar-vevent-format-function) (diary-icalendar-vjournal-format-function) (diary-icalendar-vtodo-format-function) (diary-icalendar-after-mailcap-viewer-hook): Improve docstrings. (diary-icalendar-skip-addresses-regexp): Ensure default value is a regexp. (diary-icalendar-description-regexp): Fix :type declaration to agree with default. (diary-icalendar-format-date): Replace unnecessary `calendar-dlet' with `dlet'. (diary-icalendar-vevent-format-function) (diary-icalendar-vjournal-format-function) (diary-icalendar-vtodo-format-function) (diary-icalendar-format-entry) (diary-icalendar-import-buffer-to-buffer) (diary-icalendar--entry-import) (diary-icalendar-import-buffer) (diary-icalendar-import-file): Change "non-marking" to "nonmarking" in variable names for consistency (cf. `diary-nonmarking-symbol'). (diary-icalendar-attendee-skeleton): Remove unnecessary call to `skeleton-insert'. (diary-icalendar-vevent-skeleton) (diary-icalendar-vjournal-skeleton) (diary-icalendar-vtodo-skeleton): Don't insert return values of `let' forms. (diary-icalendar-parse-entry): Call `diary-icalendar-other-properties-parser' with type and properties as arguments, instead of dynamic binding. (diary-icalendar-other-properties-parser): Document the new calling convention. * test/lisp/calendar/diary-icalendar-tests.el (diary-icalendar-test-parse-@-location): Accept the new arguments. Clarify `declare-function' usage: * lisp/calendar/icalendar-parser.el (icalendar-read-time) (icalendar-period-end, icalendar-parse-calendar) (icalendar-index-insert, icalendar-index-get) * lisp/calendar/icalendar-ast.el (icalendar-printable-value-type-symbol-p) (icalendar-ast-node-valid-value-p) * lisp/calendar/icalendar-utils.el (icalendar-date-time-add) (icalendar-dates-until, icalendar-date-time-variant): Move `declare-function' forms to corresponding `require' forms. Improve debugging with icalendar-ast.el macros: * lisp/calendar/icalendar-ast.el (icalendar-make-value-node-of): Add explanatory comment to require. (icalendar--make-param--list, icalendar--make-param--nonlist) (icalendar--make-property--list, icalendar--make-property--nonlist): New functions. (icalendar-make-param, icalendar-make-property): Use them to reduce code generated by these macros. Add (declare (debug ...)) forms. (icalendar-make-component, icalendar-make-node-from-templates): Add (declare (debug ...)) forms. * test/lisp/calendar/icalendar-ast-tests.el: New file. Various other minor changes: * lisp/calendar/icalendar-macs.el (icalendar-define-type): Improve docstring. (icalendar-define-property): Fix deprecation warning: replace 'any' with 'not-newline' in rx definition. * test/lisp/calendar/icalendar-recur-tests.el (icalendar-test-rrule-test): Pass tags on to `ert-deftest' and mark several tests as expensive. * lisp/calendar/calendar.el (diary-date-insertion-form): Remove constants from :set-after list. * lisp/calendar/diary-lib.el (diary-time-regexp): Clarify FIXME comment. * lisp/calendar/icalendar-parser.el (icalendar-x-name): Fix indentation. (icalendar-cal-address): Improve docstring.
* | Add full support for iCalendar (RFC5545) dataRichard Lawrence2025-12-2012-97/+14825
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fix for Bug#74994 that replaces the existing support in icalendar.el. It implements a full parser, recurrence rule and time zone calculations, diary import and export, and a major mode with syntax highlighting for iCalendar data. It obsoletes most of the code in icalendar.el. In addition to Bug#74994, the proposal to update Emacs' iCalendar support was discussed on emacs-devel in this thread: https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00425.html icalendar.el pre-dates the current standard (RFC5545), contains numerous bugs, is not well documented, and could not easily be updated or extended; starting fresh was the simplest path to creating an iCalendar library that other Emacs applications and packages can rely on. It was decided to leave icalendar.el's code in place for posterity, but declare it obsolete. Most of the changes in icalendar.el simply consist of such declarations. The old To Do list has also been deleted. A few changes in icalendar.el, however, consist of new code for library-wide functions and options, especially error handling. In particular: * lisp/calendar/icalendar.el: Log iCalendar library errors in a single buffer. (icalendar-errors-mode): New mode for it. (icalendar-uid-format): Change the default value to "%h", a hash value (for privacy). (icalendar-make-uid): New function, to replace 'icalendar--create-uid'. (icalendar-debug-level, icalendar-vcalendar-prodid): New option. (icalendar-vcalendar-version): New constant. * lisp/calendar/icalendar.el (icalendar-import-format) (icalendar-import-format-summary, icalendar-import-format-description) (icalendar-import-format-location, icalendar-import-format-organizer) (icalendar-import-format-url, icalendar-import-format-uid) (icalendar-import-format-status, icalendar-import-format-class) (icalendar-recurring-start-year, icalendar-export-hidden-diary-entries) (icalendar-export-sexp-enumerate-all, icalendar-export-alarms, icalendar-debug, icalendar--weekday-array, icalendar--dmsg) (icalendar--get-unfolded-buffer icalendar--clean-up-line-endings) (icalendar--rris, icalendar--read-element) (icalendar--get-event-property, icalendar--get-event-properties) (icalendar--get-event-property-attributes) (icalendar--get-children, icalendar--all-events, icalendar--split-value) (icalendar--convert-tz-offset, icalendar--parse-vtimezone) (icalendar--get-most-recent-observance) (icalendar--convert-all-timezones, icalendar--find-time-zone) (icalendar--decode-isodatetime) (icalendar--decode-isoduration, icalendar--add-decoded-times) (icalendar--datetime-to-american-date) (icalendar--datetime-to-european-date, icalendar--datetime-to-iso-date) (icalendar--datetime-to-diary-date, icalendar--datetime-to-colontime) (icalendar--get-month-number, icalendar--get-weekday-number) (icalendar--get-weekday-numbers, icalendar--get-weekday-abbrev) (icalendar--date-to-isodate, icalendar--datestring-to-isodate) (icalendar--diarytime-to-isotime, icalendar--convert-string-for-export) (icalendar--convert-string-for-import, icalendar-export-file) (icalendar-export-region, icalendar--create-uid) (icalendar--parse-summary-and-rest, icalendar--create-ical-alarm) (icalendar--do-create-ical-alarm, icalendar--convert-ordinary-to-ical) (icalendar-first-weekday-of-year, icalendar--convert-weekly-to-ical) (icalendar--convert-yearly-to-ical, icalendar--convert-sexp-to-ical) (icalendar--convert-block-to-ical, icalendar--convert-float-to-ical) (icalendar--convert-date-to-ical, icalendar--convert-cyclic-to-ical) (icalendar--convert-anniversary-to-ical, icalendar-import-file) (icalendar-import-buffer, icalendar--format-ical-event) (icalendar--convert-to-ical, icalendar--convert-ical-to-diary) (icalendar--convert-recurring-to-diary) (icalendar--convert-non-recurring-all-day-to-diary) (icalendar--convert-non-recurring-not-all-day-to-diary) (icalendar--add-diary-entry, icalendar-import-format-sample): Mark them as obsolete. In addition to the changes above, the new iCalendar library consists of the following: * lisp/calendar/diary-icalendar.el: * lisp/calendar/icalendar-ast.el: * lisp/calendar/icalendar-macs.el: * lisp/calendar/icalendar-mode.el: * lisp/calendar/icalendar-parser.el: * lisp/calendar/icalendar-recur.el: * lisp/calendar/icalendar-utils.el: New files A few changes were made to existing files dealing with the calendar and diary: * lisp/calendar/calendar.el (calendar-date-from-day-of-year): New function, extracted from calendar-goto-day-of-year. * lisp/calendar/cal-move.el (calendar-goto-day-of-year): Use it. * lisp/calendar/cal-dst.el (calendar-dst-find-data): Improve docstring. * lisp/calendar/calendar.el (diary-date-insertion-form): New option. (diary-american-date-insertion-form, diary-european-date-insertion-form) (diary-iso-date-insertion-form): New constants. * lisp/calendar/diary-lib.el (diary-insert-entry): Use the new 'diary-date-insertion-form' option. (diary-time-regexp): Add FIXME to an existing comment. The user-facing aspects of the above changes are documented in the Emacs manual and the NEWS file: * doc/emacs/calendar.texi (Diary Conversion): Update manual section to describe the new importer and exporter. * doc/emacs/emacs.texi (Detailed node listing): Update to include the new nodes in docs/emacs/calendar.texi. * etc/NEWS: Briefly describe the new library, major mode, and options. The remainder of the changes apply to test files. The following changes introduce new test files related to the new diary importer and exporter: * test/lisp/calendar/diary-icalendar-tests.el (Diary import and export): Tests for diary-icalendar. In addition to new tests for the exporter, the existing import tests for icalendar.el have been ported here; these use the existing iCalendar files in test/lisp/calendar/icalendar-resources. (A few new input .ics files have also been added to this directory; see below.) * test/lisp/calendar/diary-icalendar-resources: New directory containing expected outputs for the import tests in diary-icalendar-tests.el. (These have the same or similar names to the output files for the old importer, in test/lisp/calendar/icalendar-resources, but different contents. Thus they live in a new directory.) * test/lisp/calendar/icalendar-resources/import-legacy-function.ics: New input file to test backward compatibility of the new importer with a function as the value of 'icalendar-import-format', now obsolete. * test/lisp/calendar/icalendar-resources/import-legacy-vars.ics: New input file to test backward compatibility of the new importer with values for options provided by icalendar.el which are now obsolete. * test/lisp/calendar/icalendar-resources/import-with-attachment.ics: New input file to test import of base64-encoded attachments. * icalendar-resources/import-time-format-12hr-blank.ics: New input file to test import with a custom value of 'diary-icalendar-time-format'. Two other new test files provide unit tests for the main functions of the library: * test/lisp/calendar/icalendar-parser-tests.el (Parser): Tests for icalendar-parser. Most of these are derived from examples in RFC5545, to ensure the parser implements the standard. * test/lisp/calendar/icalendar-recur-tests.el (Recurrence rules): Tests for icalendar-recur. Most of these are derived from examples in RFC5545, to ensure the recurrence rule interpreter implements the standard. A few of the existing test files for icalendar.el have also been modified. Besides the specific changes mentioned below, the modified .ics files also now use CR-LF line endings, as required by RFC5545: * test/lisp/calendar/icalendar-tests.el (icalendar-deftest-obsolete): New macro. * test/lisp/calendar/icalendar-resources/import-non-recurring-all-day.ics: Correct a malformed VALUE parameter. * test/lisp/calendar/icalendar-resources/import-rrule-anniversary.ics: Correct representation of a recurring event. * test/lisp/calendar/icalendar-resources/import-rrule-daily-with-exceptions.ics: Add a required VALUE parameter. * test/lisp/calendar/icalendar-resources/import-rrule-daily.ics: * test/lisp/calendar/icalendar-resources/import-rrule-monthly-no-end.ics: * test/lisp/calendar/icalendar-resources/import-rrule-monthly-with-end.ics: * test/lisp/calendar/icalendar-resources/import-rrule-weekly.ics: Correct a malformed RRULE property.
* calendar-mode-line-format: Fix regexpLiu Hui2025-12-172-5/+7
| | | | | | | | * lisp/calendar/calendar.el (calendar-mode-line-format): Replace '*' with '\\*'. (calendar-get-buffer, calendar-exit): * lisp/calendar/diary-lib.el (diary-mark-entries): Improve comment and doc string.
* Improve support for non-default calendar buffer (bug#79994)Liu Hui2025-12-163-40/+54
| | | | | | | | | | | | | | | | | | * lisp/calendar/calendar.el (calendar-get-buffer): New function. (calendar-mode-line-format): Support displaying non-default calendar buffer name. (calendar-exit): Handle non-default calendar buffer separately. (calendar-generate-window): Update mode-line after cursor motion (bug#79994). (calendar-redraw, calendar-update-mode-line, calendar-unmark) (calendar-mark-visible-date): * lisp/calendar/cal-hebrew.el (calendar-hebrew-mark-date-pattern) (calendar-hebrew-list-yahrzeits): * lisp/calendar/diary-lib.el (diary-mark-sexp-entries) (calendar-mark-days-named, calendar-mark-date-pattern) (calendar-mark-1): Replace 'calendar-buffer' with the new function or current calendar buffer. (diary-mark-entries): Record current calendar buffer (bug#79994).
* ; (calendar-bahai--twin-birthdays-reference-dates): Fix quoting.Eli Zaretskii2025-12-061-1/+1
|
* Update Bahá'í calendar for 2014 calendar reformJohn Wiegley2025-12-062-49/+518
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2014, the Universal House of Justice announced modifications to the Badí' calendar to bring it more in line with its original design. >From 172 BE (Naw-Rúz 2015) onwards, Naw-Rúz is determined by the vernal equinox as observed from Tehran, and the Twin Holy Birthdays are calculated from the eighth new moon after Naw-Rúz. * doc/emacs/calendar.texi (Calendar Systems): Update Bahá'í calendar description to mention the 2014 reform, Ayyám-i-Há, and the astronomical basis for Naw-Rúz and Twin Holy Birthday calculations. * lisp/calendar/cal-bahai.el: Require 'solar' and 'lunar' for astronomical calculations. (calendar-bahai-tehran-latitude) (calendar-bahai-tehran-longitude) (calendar-bahai-tehran-timezone) (calendar-bahai-reform-year): New constants for Tehran-based astronomical observations and reform year (172 BE). (calendar-bahai-nawruz-for-gregorian-year): New function to calculate Naw-Rúz from vernal equinox relative to Tehran sunset. (calendar-bahai-nawruz): New function returning absolute date of Naw-Rúz for a given Bahá'í year. (calendar-bahai-twin-holy-birthdays-for-year): New function to calculate Birth of the Báb and Birth of Bahá'u'lláh from the eighth new moon after Naw-Rúz. (calendar-bahai-leap-year-p): Handle post-reform years based on gap between successive Naw-Rúz dates. (calendar-bahai-to-absolute, calendar-bahai-from-absolute): Rewrite to use astronomical Naw-Rúz dates for years >= 172 BE. (holiday-bahai-new-year): Calculate variable Naw-Rúz date. (holiday-bahai-twin-holy-birthdays): New function for lunar-based Twin Holy Birthday dates. (holiday-bahai-ridvan): Use Bahá'í calendar dates instead of fixed Gregorian dates. (calendar-bahai--nawruz-reference-dates) (calendar-bahai--twin-birthdays-reference-dates): New constants with official dates from Bahá'í World Centre for 2015-2064. (calendar-bahai--verify-nawruz) (calendar-bahai--verify-twin-birthdays) (calendar-bahai-verify-calculations): New verification functions to test calculations against official reference data. * lisp/calendar/holidays.el (holiday-bahai-holidays): Use 'holiday-bahai' with Bahá'í calendar dates instead of 'holiday-fixed' with Gregorian dates. Add 'holiday-bahai-twin-holy-birthdays' for lunar-calculated dates.
* ; Fix last change (bug#79629)Eli Zaretskii2025-10-251-8/+32
| | | | | | | | * lisp/calendar/holidays.el (holiday-general-holidays) (holiday-oriental-holidays, holiday-local-holidays) (holiday-other-holidays, holiday-hebrew-holidays) (holiday-christian-holidays, holiday-islamic-holidays) (holiday-bahai-holidays, holiday-solar-holidays): Doc fixes.
* Recompute calendar-holidays when its components are set (bug#79629)Amin Bandali2025-10-251-7/+16
| | | | | | | | | | | | | | * lisp/calendar/holidays.el (holidays--set-calendar-holidays): New function for recomputing the 'calendar-holidays' user option for use as the :set function of the following user options, using 'custom-reevaluate-setting' to avoid overwriting the user's customization of 'calendar-holidays'. (holiday-general-holidays, holiday-oriental-holidays) (holiday-local-holidays, holiday-other-holidays) (holiday-hebrew-holidays, holiday-christian-holidays) (holiday-islamic-holidays, holiday-bahai-holidays) (holiday-solar-holidays): Use 'holidays--set-calendar-holidays' as the :set function to recompute 'calendar-holidays' as needed.
* decoded-time-add: Use 'floor'Ilya Chernyshov2025-10-071-1/+1
| | | | | | | * lisp/calendar/time-date.el (decoded-time-add): Use 'floor' to count new year field value. Copyright-paperwork-exempt: yes
* Use variables to store marking stateManuel Giraud2025-08-073-9/+18
| | | | | | | | | | | | | Bug#78967. (calendar-mode): Init new variables with user options. * lisp/calendar/calendar.el (calendar-generate-window) (calendar-unmark): * lisp/calendar/diary-lib.el (diary-mark-entries) (diary-redraw-calendar): * lisp/calendar/holidays.el (calendar-mark-holidays): Use new variables. * etc/NEWS: Document the change.
* Fix mode-line string width in diary viewManuel Giraud2025-08-021-11/+14
| | | | | | | | Bug#78957 * lisp/calendar/calendar.el (calendar-in-read-only-buffer): Select the buffer window because, for example, `calendar-set-mode-line' needs it.
* Saner defaults for `calendar-read-sexp' (Bug#78964)Manuel Giraud2025-07-1911-17/+25
| | | | | | | | | | | | | | | | | | | * lisp/calendar/cal-bahai.el (calendar-bahai-read-date): * lisp/calendar/cal-china.el (calendar-chinese-goto-date): * lisp/calendar/cal-coptic.el (calendar-coptic-read-date): * lisp/calendar/cal-french.el (calendar-french-goto-date): * lisp/calendar/cal-hebrew.el (calendar-hebrew-read-date): * lisp/calendar/cal-islam.el (calendar-islamic-read-date): * lisp/calendar/cal-iso.el (calendar-iso-read-date): * lisp/calendar/cal-julian.el (calendar-julian-goto-date) (calendar-astro-goto-day-number): * lisp/calendar/cal-mayan.el (calendar-mayan-read-haab-date) (calendar-mayan-read-tzolkin-date): * lisp/calendar/cal-persia.el (calendar-persian-read-date): * lisp/calendar/diary-lib.el (diary-insert-cyclic-entry): Use first day as default. * lisp/calendar/cal-hebrew.el (calendar-hebrew-list-yahrzeits): Set the default of end-year as start-year plus ten years.
* Avoid flicker when marking diary entries (bug#78861)Manuel Giraud2025-06-281-4/+2
| | | | | * lisp/calendar/calendar.el (calendar-generate-window): Remove historical and not really understood `sit-for' calls.
* Avoid rebuilding a static alist inside a loopManuel Giraud2025-06-211-12/+10
| | | | | * lisp/calendar/diary-lib.el (diary-mark-entries-1): Build months-alist outside of the loop. (Bug#78779)
* Add simpler binds for calendar month/year navigationPaul Nelson2025-06-121-0/+4
| | | | | | | | * lisp/calendar/calendar.el (calendar-mode-map): Add keybindings '{' and '}' for month navigation, '[' and ']' for year navigation (bug#78753). * doc/emacs/calendar.texi (Calendar Unit Motion): Document them.
* Merge from origin/emacs-30Eli Zaretskii2025-05-311-4/+4
|\ | | | | | | | | | | | | | | 9dc6c21b414 ; * lisp/subr.el (setq-local): Doc fix (bug#78644). 1bb88a86cb3 Revert "; * lisp/subr.el (setq-local): Doc fix (bug#78644)." cb9556d669c ; * lisp/subr.el (setq-local): Doc fix (bug#78644). 8881dca81c9 ; * doc/lispref/searching.texi (Char Classes): Add speedu... 4507b6a9c75 Fix bug in 'todo-jump-to-category' (bug#78608)
| * Fix bug in 'todo-jump-to-category' (bug#78608)Stephen Berman2025-05-281-4/+4
| | | | | | | | | | | | | | | | | | * lisp/calendar/todo-mode.el (todo-jump-to-category): Eliminate comparison of the number of Todo categories before and after specifying the category to jump to and replace it by a check of whether there are any items in the category, since an existing category should always have at least one item (perhaps done or archived).
* | Merge from origin/emacs-30Eli Zaretskii2025-05-241-1/+7
|\ \ | |/ | | | | | | | | | | | | | | df9636f8927 ; * doc/misc/use-package.texi (Hooks): Fix typo (bug#77609). 36afdd2f6f9 Fix documentation of use-package's ':hook' keyword d0c90bc9bfe * test/infra/gitlab-ci.yml (.job-template): Make it more ... b8f24cbdbb0 ; * lisp/emacs-lisp/find-func.el (find-function): Doc fix. e0c6f3e7656 Fix todo-mode item insertion bug (bug#78506) 328b316764f Add support for Pyrefly LSP for Python
| * Fix todo-mode item insertion bug (bug#78506)Stephen Berman2025-05-201-1/+7
| | | | | | | | | | | | * lisp/calendar/todo-mode.el (todo-insert-item--next-param): Unset transient keymap on completing default or copy item insertion command, to ensure that the next Todo mode key is recognized.
* | Fix DTSTART date when exporting `diary-float'Richard Lawrence2025-05-171-21/+18
| | | | | | | | | | | | | | | | | | | | Instead of using current date as DTSTART and then excluding it when it doesn't match the `diary-float' rule, just use the first date which matches the rule in `icalendar-recurring-start-year'. * lisp/calendar/icalendar.el (icalendar--convert-float-to-ical): Compute the correct date. * test/lisp/calendar/icalendar-tests.el: Add a test for the reported test case. (Bug#78085)
* | Scroll with mouse wheel in calendar (bug#78298)Manuel Giraud2025-05-141-0/+6
| | | | | | | | | | | | * lisp/calendar/calendar.el (calendar-mode-map): Add scrolling with mouse wheel. * etc/NEWS: Announce the change.
* | Recenter for the calendar (bug#78205)Manuel Giraud2025-05-082-0/+34
| | | | | | | | | | | | | | | | | | | | | | * lisp/calendar/cal-move.el (calendar-recenter-last-op): New variable to track last recenter operation. (calendar-recenter): New command to recenter the calendar. * lisp/calendar/calendar.el (calendar-mode-map): Keybinding for this command. * doc/emacs/calendar.texi (Scroll Calendar): Document this command. * etc/NEWS: Announce this command.
* | Reuse calendar temporary facesManuel Giraud2025-04-261-6/+8
| | | | | | | | | | * lisp/calendar/calendar.el (calendar-make-temp-face): Reuse temporary face produced by calendar. (Bug#78036)
* | Recenter calendar-chinese-year-cache on 2028Stefan Kangas2025-03-201-33/+32
| | | | | | | | | | * lisp/calendar/cal-china.el (calendar-chinese-year-cache): Recenter on 2028.
* | Recommend using 'keymap-set' in CommentariesStefan Kangas2025-03-151-6/+6
| | | | | | | | | | | | | | | | | | | | | | * lisp/calendar/timeclock.el, lisp/comint.el, lisp/ehelp.el: * lisp/gnus/gnus-bookmark.el, lisp/gnus/smiley.el, lisp/ido.el: * lisp/isearchb.el, lisp/mail/mailabbrev.el, lisp/net/ange-ftp.el: * lisp/net/goto-addr.el, lisp/play/fortune.el, lisp/saveplace.el: * lisp/shell.el, lisp/term.el, lisp/textmodes/makeinfo.el: * lisp/textmodes/refer.el, lisp/textmodes/remember.el: * lisp/textmodes/table.el, lisp/woman.el: Recommend using 'keymap-set' instead of 'define-key' in Commentaries.
* | Fix handling of delta values with negative month fieldŁukasz Stelmach2025-03-011-1/+1
| | | | | | | | | | | | | | | | * lisp/calendar/time-date.el (decoded-time-add): If the new variable is less then zero, the year needs to be decremented by quotient of new and 12 increased by one. * test/lisp/calendar/time-date-tests.el (test-decoded-add): Add applicable test cases. (Bug#68969)
* | Prefer incf to cl-incf in remaining filesStefan Kangas2025-02-262-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/syncdoc-type-hierarchy.el (syncdoc-make-type-table): * admin/unidata/unidata-gen.el (unidata-gen-table-word-list): * lisp/arc-mode.el (archive--summarize-descs): * lisp/auth-source.el (auth-source-forget+): * lisp/battery.el (battery-linux-proc-acpi, battery-linux-sysfs): * lisp/calendar/parse-time.el (parse-time-tokenize): * lisp/calendar/time-date.el (decoded-time-add) (decoded-time--alter-month, decoded-time--alter-day): * lisp/cedet/semantic/ede-grammar.el (project-compile-target): * lisp/dired.el (dired-insert-set-properties): * lisp/edmacro.el (edmacro-format-keys): * lisp/epa-file.el (epa-file--replace-text): * lisp/eshell/esh-cmd.el (eshell-for-iterate): * lisp/eshell/esh-io.el (eshell-create-handles) (eshell-duplicate-handles, eshell-protect-handles) (eshell-copy-output-handle, eshell-buffered-print): * lisp/font-lock.el (font-lock-fontify-keywords-region): * lisp/help-fns.el: * lisp/ibuf-ext.el (ibuffer-generate-filter-groups) (ibuffer-insert-filter-group-before): * lisp/ibuffer.el (ibuffer-confirm-operation-on, ibuffer-map-lines): * lisp/image/image-dired-external.el (image-dired-thumb-queue-run): * lisp/image/image-dired.el (image-dired-display-thumbs) (image-dired-line-up): * lisp/imenu.el (imenu--split): * lisp/info-xref.el (info-xref-check-node, info-xref-check-all-custom): * lisp/international/quail.el (quail-insert-decode-map): * lisp/international/rfc1843.el (rfc1843-decode): * lisp/mail/ietf-drums-date.el (ietf-drums-date--tokenize-string): * lisp/mail/ietf-drums.el (ietf-drums-token-to-list): * lisp/mail/rfc2047.el (rfc2047-qp-or-base64): * lisp/mail/rfc2231.el (rfc2231-encode-string): * lisp/mail/yenc.el (yenc-decode-region): * lisp/mh-e/mh-e.el (mh-xargs): * lisp/mh-e/mh-folder.el (mh-recenter): * lisp/mh-e/mh-mime.el (mh-mime-part-index): * lisp/mh-e/mh-search.el (mh-search): * lisp/mh-e/mh-thread.el (mh-thread-current-indentation-level): * lisp/mh-e/mh-utils.el (mh-sub-folders-parse): * lisp/minibuffer.el (minibuffer--sort-by-position) (completion-pcm--pattern-point-idx): * lisp/mpc.el (mpc-cmd-find, mpc-cmd-move, mpc-select-extend) (mpc-songs-refresh, mpc-songpointer-score) (mpc-songpointer-refresh-hairy): * lisp/msb.el (msb--mode-menu-cond, msb--most-recently-used-menu) (msb--split-menus-2, msb--make-keymap-menu): * lisp/net/pop3.el (pop3-send-streaming-command): * lisp/net/puny.el (puny-encode-complex, puny-decode-string-internal): * lisp/net/shr-color.el (shr-color-hue-to-rgb): * lisp/net/soap-client.el (soap-encode-xs-complex-type) (soap-decode-xs-complex-type, soap-resolve-references-for-operation) (soap-wsdl-resolve-references): * lisp/play/5x5.el (5x5-made-move, 5x5-down, 5x5-right): * lisp/play/decipher.el (key, decipher-mode-syntax-table) (decipher-add-undo, decipher-complete-alphabet, decipher--analyze) (decipher--digram-counts, decipher--digram-total): * lisp/play/hanoi.el (hanoi-move-ring): * lisp/play/snake.el (snake-reset-game, snake-update-game): * lisp/profiler.el (profiler-calltree-depth, profiler-calltree-build-1) (profiler-calltree-build-unified) (profiler-calltree-compute-percentages): * lisp/registry.el (registry-reindex): * lisp/simple.el (completion-list-candidate-at-point): * lisp/strokes.el (strokes-xpm-to-compressed-string): * lisp/term.el (term-emulate-terminal, term--handle-colors-list): * lisp/treesit.el (treesit-node-index, treesit-indent-region): * lisp/url/url-cookie.el (url-cookie-parse-file-netscape): * lisp/url/url-dav.el (url-dav-file-name-completion): * lisp/url/url-queue.el (url-queue-setup-runners) (url-queue-run-queue): * lisp/wdired.el (wdired-finish-edit): * lisp/wid-edit.el (widget-move): * lisp/window-tool-bar.el (window-tool-bar-string): * lisp/winner.el (winner-undo): * lisp/xwidget.el (xwidget-webkit-isearch-forward) (xwidget-webkit-isearch-backward): Prefer incf to cl-incf.
* | Fix diary not displaying some entries in european styleMichael Heerdegen2025-02-231-3/+4
| | | | | | | | | | * lisp/calendar/calendar.el (diary-european-date-forms): Correctly recognize times using a dot as separator. (Bug#53702)
* | Prefer decf to cl-decfStefan Kangas2025-02-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/auth-source-pass.el (auth-source-pass--find-match-many): * lisp/calendar/time-date.el (decoded-time-add) (decoded-time--alter-month, decoded-time--alter-day): * lisp/dired.el (dired--move-to-next-line): * lisp/dom.el (dom-pp): * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): * lisp/emacs-lisp/cl-print.el (cl-print-to-string-with-limit): * lisp/emacs-lisp/cl-seq.el (cl-fill, cl-replace, cl-substitute): * lisp/emacs-lisp/comp-cstr.el (comp--range-union) (comp--range-intersection): * lisp/emacs-lisp/comp.el (comp-vec-prepend, comp--emit-narg-prologue): * lisp/emacs-lisp/edebug.el (edebug--strip-instrumentation): * lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): * lisp/emacs-lisp/pp.el (pp--format-definition): * lisp/emacs-lisp/smie.el (smie-config--guess-1): * lisp/eshell/esh-io.el (eshell-close-handle, eshell-set-output-handle): * lisp/gnus/gnus-async.el (gnus-async-prefetch-article): * lisp/gnus/gnus-group.el (gnus-group-mark-group) (gnus-group-yank-group): * lisp/gnus/gnus-salt.el (gnus-tree-forward-line): * lisp/gnus/gnus-score.el (gnus-decay-scores): * lisp/gnus/gnus-srvr.el (gnus-browse-toggle-subscription-at-point): * lisp/gnus/gnus-sum.el (gnus-build-sparse-threads, gnus-parent-headers) (gnus-update-marks, gnus-summary-work-articles) (gnus-summary-refer-parent-article, gnus-summary-next-thread) (gnus-read-header, gnus-summary-insert-new-articles): * lisp/gnus/gnus-topic.el (gnus-topic-forward-topic): * lisp/gnus/gnus.el (gnus-short-group-name): * lisp/gnus/message.el (message-remove-first-header) (message-shorten-references, message-insert-screenshot): * lisp/gnus/mm-url.el (mm-url-insert): * lisp/gnus/nnselect.el (nnselect-push-info): * lisp/ibuffer.el (ibuffer-backward-line, ibuffer-forward-line) (ibuffer-map-lines): * lisp/icomplete.el (icomplete--render-vertical): * lisp/image/image-dired-external.el (image-dired-create-thumb-1): * lisp/image/image-dired.el (image-dired-delete-char): * lisp/mail/ietf-drums-date.el (ietf-drums-date--tokenize-string): * lisp/mh-e/mh-utils.el (mh-sub-folders-parse): * lisp/minibuffer.el (minibuffer-completion-help): * lisp/mpc.el (mpc-cmd-move, mpc-songpointer-refresh-hairy): * lisp/net/eww.el (eww-process-text-input): * lisp/net/pop3.el (pop3-wait-for-messages, pop3-uidl-stat) (pop3-uidl-dele): * lisp/net/shr-color.el (shr-color-hue-to-rgb): * lisp/play/5x5.el (5x5-up, 5x5-left): * lisp/play/decipher.el (decipher-read-alphabet, decipher--digram-total) (decipher-analyze-buffer): * lisp/play/hanoi.el (hanoi-insert-ring, hanoi-move-ring): * lisp/profiler.el (profiler-format-number) (profiler-calltree-build-unified): * lisp/progmodes/antlr-mode.el (antlr-next-rule, antlr-indent-line): * lisp/progmodes/c-ts-common.el (c-ts-common-statement-offset): * lisp/progmodes/ebrowse.el (ebrowse-cyclic-display-next/previous-member-list): * lisp/progmodes/hideif.el (hif-backward-comment): * lisp/progmodes/js.el (js-beginning-of-defun, js-end-of-defun) (js-ts--syntax-propertize): * lisp/progmodes/typescript-ts-mode.el (tsx-ts--syntax-propertize-captures): * lisp/rect.el (rectangle--*-char): * lisp/term.el (term-emulate-terminal): * lisp/textmodes/reftex-cite.el (reftex-do-citation): * lisp/textmodes/reftex-index.el (reftex-index-next-phrase): * lisp/textmodes/reftex-parse.el (reftex-init-section-numbers): * lisp/textmodes/reftex-sel.el (reftex-select-unmark): * lisp/textmodes/reftex.el (reftex-silence-toc-markers): * lisp/treesit.el (treesit-navigate-thing): * lisp/vc/diff-mode.el (diff-sanity-check-context-hunk-half, (diff-sanity-check-hunk): * lisp/vc/pcvs-util.el (cvs-first): * lisp/vc/smerge-mode.el (smerge-get-current): * lisp/vc/vc-hg.el (vc-hg--glob-to-pcre): * test/lisp/net/socks-tests.el (socks-tests-perform-hello-world-http-request): * test/src/buffer-tests.el (test-overlay-randomly): Prefer decf to cl-defc in all code where we can.
* | ; Fix typosStefan Kangas2025-02-221-1/+1
| |
* | Prefer '(oddp A)' to '(= 1 (logand A 1))'Stefan Kangas2025-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/calendar/todo-mode.el (todo-padded-string): * lisp/emacs-lisp/gv.el (setf): * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): * lisp/hexl.el (hexl-insert-hex-string): * lisp/play/gamegrid.el (gamegrid-xbm): * lisp/play/hanoi.el (hanoi-internal): * lisp/progmodes/ebnf2ps.el (ebnf-end-of-string): * lisp/progmodes/elisp-mode.el (elisp--highlight-function-argument): * lisp/progmodes/ruby-mode.el (ruby-backward-sexp): * lisp/ps-print.el (ps-print-page-p): (ps-print-sheet-p): Prefer '(oddp A)' to '(= 1 (logand A 1))' and variations thereof.
* | Prefer '(evenp A)' to '(= 0 (% A 2))'evenp-oddpStefan Kangas2025-02-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/calc/calc-comb.el (math-prime-test): * lisp/calc/calc-keypd.el (calc-keypad-press): * lisp/calc/calc-math.el (math-sqrt): (math-sqrt-raw): * lisp/calc/calc-misc.el (math-iipow): (math-iipow-show): * lisp/calc/calc-stat.el (calcFunc-vmedian): * lisp/calendar/cal-tex.el (cal-tex-cursor-filofax-2week): (cal-tex-cursor-filofax-daily): * lisp/elec-pair.el (electric-pair-post-self-insert-function): * lisp/emacs-lisp/checkdoc.el (checkdoc-in-example-string-p): * lisp/emacs-lisp/eieio.el (defclass): * lisp/emacs-lisp/ert-x.el (ert-propertized-string): * lisp/emacs-lisp/ert.el (ert--significant-plist-keys): (ert--plist-difference-explanation): * lisp/emacs-lisp/helper.el (Helper-help-scroller): * lisp/emacs-lisp/pcase.el (pcase-setq): * lisp/files-x.el (setq-connection-local): * lisp/gnus/gnus-uu.el (gnus-uu-post-encoded): * lisp/gnus/message.el (message-make-in-reply-to): * lisp/gnus/nndiary.el (nndiary-last-occurrence): (nndiary-next-occurrence): * lisp/mail/rfc2047.el (rfc2047-decode-region): * lisp/play/5x5.el (5x5-draw-grid): * lisp/play/gametree.el (gametree-compute-reduced-score): (gametree-insert-new-leaf): (gametree-break-line-here): * lisp/play/zone.el (zone-fret): * lisp/vc/ediff-ptch.el (ediff-get-patch-buffer): * lisp/yank-media.el (yank-media--utf-16-p): Prefer '(evenp A)' to '(= 0 (% A 2))' and variations thereof.