diff options
Diffstat (limited to 'lisp/org')
-rw-r--r-- | lisp/org/ob-core.el | 5 | ||||
-rw-r--r-- | lisp/org/ob-eval.el | 2 | ||||
-rw-r--r-- | lisp/org/org-agenda.el | 34 | ||||
-rw-r--r-- | lisp/org/org-attach.el | 2 | ||||
-rw-r--r-- | lisp/org/org-clock.el | 14 | ||||
-rw-r--r-- | lisp/org/org-ctags.el | 5 | ||||
-rw-r--r-- | lisp/org/org-element.el | 4 | ||||
-rw-r--r-- | lisp/org/org-footnote.el | 2 | ||||
-rw-r--r-- | lisp/org/org-id.el | 4 | ||||
-rw-r--r-- | lisp/org/org-indent.el | 25 | ||||
-rw-r--r-- | lisp/org/org-macro.el | 3 | ||||
-rw-r--r-- | lisp/org/org-macs.el | 2 | ||||
-rw-r--r-- | lisp/org/org-pcomplete.el | 20 | ||||
-rw-r--r-- | lisp/org/org-protocol.el | 15 | ||||
-rw-r--r-- | lisp/org/org.el | 38 | ||||
-rw-r--r-- | lisp/org/ox-html.el | 3 | ||||
-rw-r--r-- | lisp/org/ox-odt.el | 4 | ||||
-rw-r--r-- | lisp/org/ox-publish.el | 13 |
18 files changed, 119 insertions, 76 deletions
diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index 3649d6666c8..93b8c13aa2d 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -2310,10 +2310,9 @@ INFO may provide the values of these header arguments (in the (lambda (r) ;; Non-nil when result R can be turned into ;; a table. - (and (listp r) - (null (cdr (last r))) + (and (proper-list-p r) (cl-every - (lambda (e) (or (atom e) (null (cdr (last e))))) + (lambda (e) (or (atom e) (proper-list-p e))) result))))) ;; insert results based on type (cond diff --git a/lisp/org/ob-eval.el b/lisp/org/ob-eval.el index 0587851e8bd..8d5b7ed2674 100644 --- a/lisp/org/ob-eval.el +++ b/lisp/org/ob-eval.el @@ -120,7 +120,7 @@ function in various versions of Emacs. (delete-file input-file)) (when (and error-file (file-exists-p error-file)) - (when (< 0 (nth 7 (file-attributes error-file))) + (when (< 0 (file-attribute-size (file-attributes error-file))) (with-current-buffer (get-buffer-create error-buffer) (let ((pos-from-end (- (point-max) (point)))) (or (bobp) diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index f1335a50668..6f66807ab57 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -1401,6 +1401,9 @@ current display in the agenda." :group 'org-agenda-daily/weekly :type 'plist) +(defvaralias 'org-agenda-search-view-search-words-only + 'org-agenda-search-view-always-boolean) + (defcustom org-agenda-search-view-always-boolean nil "Non-nil means the search string is interpreted as individual parts. @@ -1429,9 +1432,6 @@ boolean search." :version "24.1" :type 'boolean) -(defvaralias 'org-agenda-search-view-search-words-only - 'org-agenda-search-view-always-boolean) - (defcustom org-agenda-search-view-force-full-words nil "Non-nil means, search words must be matches as complete words. When nil, they may also match part of a word." @@ -1873,6 +1873,9 @@ Nil means don't hide any tags." (const :tag "Hide none" nil) (string :tag "Regexp "))) +(defvaralias 'org-agenda-remove-tags-when-in-prefix + 'org-agenda-remove-tags) + (defcustom org-agenda-remove-tags nil "Non-nil means remove the tags from the headline copy in the agenda. When this is the symbol `prefix', only remove tags when @@ -1883,8 +1886,7 @@ When this is the symbol `prefix', only remove tags when (const :tag "Never" nil) (const :tag "When prefix format contains %T" prefix))) -(defvaralias 'org-agenda-remove-tags-when-in-prefix - 'org-agenda-remove-tags) +(defvaralias 'org-agenda-align-tags-to-column 'org-agenda-tags-column) (defcustom org-agenda-tags-column 'auto "Shift tags in agenda items to this column. @@ -1902,8 +1904,6 @@ character screen." :package-version '(Org . "9.1") :version "26.1") -(defvaralias 'org-agenda-align-tags-to-column 'org-agenda-tags-column) - (defcustom org-agenda-fontify-priorities 'cookies "Non-nil means highlight low and high priorities in agenda. When t, the highest priority entries are bold, lowest priority italic. @@ -2067,9 +2067,9 @@ works you probably want to add it to `org-agenda-custom-commands' for good." ;;; Define the org-agenda-mode +(defvaralias 'org-agenda-keymap 'org-agenda-mode-map) (defvar org-agenda-mode-map (make-sparse-keymap) "Keymap for `org-agenda-mode'.") -(defvaralias 'org-agenda-keymap 'org-agenda-mode-map) (defvar org-agenda-menu) ; defined later in this file. (defvar org-agenda-restrict nil) ; defined later in this file. @@ -2205,10 +2205,14 @@ The following commands are available: (add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local) (add-hook 'pre-command-hook 'org-unhighlight nil 'local) ;; Make sure properties are removed when copying text - (add-hook 'filter-buffer-substring-functions - (lambda (fun start end delete) - (substring-no-properties (funcall fun start end delete))) - nil t) + (if (boundp 'filter-buffer-substring-functions) + (add-hook 'filter-buffer-substring-functions + (lambda (fun start end delete) + (substring-no-properties (funcall fun start end delete))) + nil t) + ;; Emacs >= 24.4. + (add-function :filter-return (local 'filter-buffer-substring-function) + #'substring-no-properties)) (unless org-agenda-keep-modes (setq org-agenda-follow-mode org-agenda-start-with-follow-mode org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode @@ -7005,15 +7009,15 @@ When TYPE is \"scheduled\", \"deadline\", \"timestamp\" or \"timestamp_ia\", compare within each of these type. When TYPE is the empty string, compare all timestamps without respect of their type." - (let* ((def (if org-sort-agenda-notime-is-late most-positive-fixnum -1)) + (let* ((def (and (not org-sort-agenda-notime-is-late) -1)) (ta (or (and (string-match type (or (get-text-property 1 'type a) "")) (get-text-property 1 'ts-date a)) def)) (tb (or (and (string-match type (or (get-text-property 1 'type b) "")) (get-text-property 1 'ts-date b)) def))) - (cond ((< ta tb) -1) - ((< tb ta) +1)))) + (cond ((if ta (and tb (< ta tb)) tb) -1) + ((if tb (and ta (< tb ta)) ta) +1)))) (defsubst org-cmp-habit-p (a b) "Compare the todo states of strings A and B." diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el index db8b61b3d51..f430cd5ed3e 100644 --- a/lisp/org/org-attach.el +++ b/lisp/org/org-attach.el @@ -352,7 +352,7 @@ This checks for the existence of a \".git\" directory in that directory." (shell-command-to-string "git ls-files -zmo --exclude-standard") "\0" t)) (if (and use-annex - (>= (nth 7 (file-attributes new-or-modified)) + (>= (file-attribute-size (file-attributes new-or-modified)) org-attach-git-annex-cutoff)) (call-process "git" nil nil nil "annex" "add" new-or-modified) (call-process "git" nil nil nil "add" new-or-modified)) diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index a9b933c8e37..9d05c836da7 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el @@ -2239,8 +2239,18 @@ have priority." (let* ((start (pcase key (`interactive (org-read-date nil t nil "Range start? ")) ;; In theory, all clocks started after the dawn of - ;; humanity. - (`untilnow (encode-time 0 0 0 0 0 -50000)) + ;; humanity. However, the platform's clock + ;; support might not go back that far. Choose the + ;; POSIX timestamp -2**41 (approximately 68,000 + ;; BCE) if that works, otherwise -2**31 (1901) if + ;; that works, otherwise 0 (1970). Going back + ;; billions of years would loop forever on Mac OS + ;; X 10.6 with Emacs 26 and earlier (Bug#27736). + (`untilnow + (let ((old 0)) + (dolist (older '((-32768 0) (-33554432 0)) old) + (when (ignore-errors (decode-time older)) + (setq old older))))) (_ (encode-time 0 m h d month y)))) (end (pcase key (`interactive (org-read-date nil t nil "Range end? ")) diff --git a/lisp/org/org-ctags.el b/lisp/org/org-ctags.el index 7dc8dd5b16a..111be379fd4 100644 --- a/lisp/org/org-ctags.el +++ b/lisp/org/org-ctags.el @@ -137,6 +137,7 @@ ;;; Code: +(eval-when-compile (require 'cl-lib)) (require 'org) (defgroup org-ctags nil @@ -235,7 +236,7 @@ buffer position where the tag is found." (with-current-buffer (get-file-buffer tags-file-name) (goto-char (point-min)) (cond - ((re-search-forward (format "^.*%s\\([0-9]+\\),\\([0-9]+\\)$" + ((re-search-forward (format "^.*\^?%s\^A\\([0-9]+\\),\\([0-9]+\\)$" (regexp-quote tag)) nil t) (let ((line (string-to-number (match-string 1))) (pos (string-to-number (match-string 2)))) @@ -260,7 +261,7 @@ Return the list." (visit-tags-table-buffer 'same) (with-current-buffer (get-file-buffer tags-file-name) (goto-char (point-min)) - (while (re-search-forward "^.*\\(.*\\)\\([0-9]+\\),\\([0-9]+\\)$" + (while (re-search-forward "^.*\^?\\(.*\\)\^A\\([0-9]+\\),\\([0-9]+\\)$" nil t) (push (substring-no-properties (match-string 1)) taglist))) taglist))) diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index 6458335704e..75d46e2312c 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el @@ -4856,7 +4856,7 @@ table is cleared once the synchronization is complete." (defun org-element--cache-generate-key (lower upper) "Generate a key between LOWER and UPPER. -LOWER and UPPER are integers or lists, possibly empty. +LOWER and UPPER are fixnums or lists of same, possibly empty. If LOWER and UPPER are equals, return LOWER. Otherwise, return a unique key, as an integer or a list of integers, according to @@ -4950,6 +4950,7 @@ A and B are either integers or lists of integers, as returned by (defsubst org-element--cache-root () "Return root value in cache. This function assumes `org-element--cache' is a valid AVL tree." + ;; FIXME: Why use internal functions of avl-tree? (avl-tree--node-left (avl-tree--dummyroot org-element--cache))) @@ -4978,6 +4979,7 @@ the cache." (aref (car org-element--cache-sync-requests) 0))) (node (org-element--cache-root)) lower upper) + ;; FIXME: Why use internal functions of avl-tree? (while node (let* ((element (avl-tree--node-data node)) (begin (org-element-property :begin element))) diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el index dee127a78ab..f8963184654 100644 --- a/lisp/org/org-footnote.el +++ b/lisp/org/org-footnote.el @@ -636,7 +636,7 @@ or new, let the user edit the definition of the footnote." (let* ((all (org-footnote-all-labels)) (label (if (eq org-footnote-auto-label 'random) - (format "%x" (random most-positive-fixnum)) + (format "%x" (abs (random))) (org-footnote-normalize-label (let ((propose (org-footnote-unique-label all))) (if (eq org-footnote-auto-label t) propose diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el index 4de99f363a6..670abad17f3 100644 --- a/lisp/org/org-id.el +++ b/lisp/org/org-id.el @@ -357,7 +357,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"." "Return string with random (version 4) UUID." (let ((rnd (md5 (format "%s%s%s%s%s%s%s" (random) - (current-time) + (encode-time nil 'list) (user-uid) (emacs-pid) (user-full-name) @@ -416,7 +416,7 @@ The input I may be a character, or a single-letter string." "Encode TIME as a 10-digit string. This string holds the time to micro-second accuracy, and can be decoded using `org-id-decode'." - (setq time (or time (current-time))) + (setq time (encode-time time 'list)) (concat (org-id-int-to-b36 (nth 0 time) 4) (org-id-int-to-b36 (nth 1 time) 4) (org-id-int-to-b36 (or (nth 2 time) 0) 4))) diff --git a/lisp/org/org-indent.el b/lisp/org/org-indent.el index 71d6658a56f..f6d6cd497f5 100644 --- a/lisp/org/org-indent.el +++ b/lisp/org/org-indent.el @@ -183,11 +183,15 @@ during idle time." org-hide-leading-stars) (setq-local org-hide-leading-stars t)) (org-indent--compute-prefixes) - (add-hook 'filter-buffer-substring-functions - (lambda (fun start end delete) - (org-indent-remove-properties-from-string - (funcall fun start end delete))) - nil t) + (if (boundp 'filter-buffer-substring-functions) + (add-hook 'filter-buffer-substring-functions + (lambda (fun start end delete) + (org-indent-remove-properties-from-string + (funcall fun start end delete))) + nil t) + ;; Emacs >= 24.4. + (add-function :filter-return (local 'filter-buffer-substring-function) + #'org-indent-remove-properties-from-string)) (add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local) (add-hook 'before-change-functions 'org-indent-notify-modified-headline nil 'local) @@ -211,10 +215,13 @@ during idle time." (when (boundp 'org-hide-leading-stars-before-indent-mode) (setq-local org-hide-leading-stars org-hide-leading-stars-before-indent-mode)) - (remove-hook 'filter-buffer-substring-functions - (lambda (fun start end delete) - (org-indent-remove-properties-from-string - (funcall fun start end delete)))) + (if (boundp 'filter-buffer-substring-functions) + (remove-hook 'filter-buffer-substring-functions + (lambda (fun start end delete) + (org-indent-remove-properties-from-string + (funcall fun start end delete)))) + (remove-function (local 'filter-buffer-substring-function) + #'org-indent-remove-properties-from-string)) (remove-hook 'after-change-functions 'org-indent-refresh-maybe 'local) (remove-hook 'before-change-functions 'org-indent-notify-modified-headline 'local) diff --git a/lisp/org/org-macro.el b/lisp/org/org-macro.el index b2399966dc7..7d04d02970c 100644 --- a/lisp/org/org-macro.el +++ b/lisp/org/org-macro.el @@ -159,7 +159,8 @@ function installs the following ones: \"property\", (format "(eval (format-time-string \"$1\" (or (and (org-string-nw-p \"$2\") (org-macro--vc-modified-time %s)) '%s)))" (prin1-to-string visited-file) (prin1-to-string - (nth 5 (file-attributes visited-file))))))))) + (file-attribute-modification-time + (file-attributes visited-file))))))))) ;; Initialize and install "n" macro. (org-macro--counter-initialize) (funcall update-templates diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index 9851168e970..3c768244331 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -31,6 +31,8 @@ ;;; Code: +(require 'cl-lib) + (defmacro org-with-gensyms (symbols &rest body) (declare (debug (sexp body)) (indent 1)) `(let ,(mapcar (lambda (s) diff --git a/lisp/org/org-pcomplete.el b/lisp/org/org-pcomplete.el index 7f944c5a765..b8a2f687598 100644 --- a/lisp/org/org-pcomplete.el +++ b/lisp/org/org-pcomplete.el @@ -194,7 +194,7 @@ When completing for #+STARTUP, for example, this function returns "Complete arguments for the #+LANGUAGE file option." (require 'ox) (pcomplete-here - (pcomplete-uniqify-list + (pcomplete-uniquify-list (list org-export-default-language "en")))) (defvar org-default-priority) @@ -219,7 +219,7 @@ When completing for #+STARTUP, for example, this function returns (defun pcomplete/org-mode/file-option/startup () "Complete arguments for the #+STARTUP file option." (while (pcomplete-here - (let ((opts (pcomplete-uniqify-list + (let ((opts (pcomplete-uniquify-list (mapcar 'car org-startup-options)))) ;; Some options are mutually exclusive, and shouldn't be completed ;; against if certain other options have already been seen. @@ -248,7 +248,7 @@ When completing for #+STARTUP, for example, this function returns (defun pcomplete/org-mode/file-option/options () "Complete arguments for the #+OPTIONS file option." (while (pcomplete-here - (pcomplete-uniqify-list + (pcomplete-uniquify-list (append ;; Hard-coded OPTION items always available. '("H:" "\\n:" "num:" "timestamp:" "arch:" "author:" "c:" @@ -267,7 +267,7 @@ When completing for #+STARTUP, for example, this function returns (defun pcomplete/org-mode/file-option/infojs_opt () "Complete arguments for the #+INFOJS_OPT file option." (while (pcomplete-here - (pcomplete-uniqify-list + (pcomplete-uniquify-list (mapcar (lambda (item) (format "%s:" (car item))) (bound-and-true-p org-html-infojs-opts-table)))))) @@ -283,7 +283,7 @@ When completing for #+STARTUP, for example, this function returns (defun pcomplete/org-mode/link () "Complete against defined #+LINK patterns." (pcomplete-here - (pcomplete-uniqify-list + (pcomplete-uniquify-list (copy-sequence (append (mapcar 'car org-link-abbrev-alist-local) (mapcar 'car org-link-abbrev-alist)))))) @@ -293,13 +293,13 @@ When completing for #+STARTUP, for example, this function returns "Complete against TeX-style HTML entity names." (require 'org-entities) (while (pcomplete-here - (pcomplete-uniqify-list (remove nil (mapcar 'car-safe org-entities))) + (pcomplete-uniquify-list (remove nil (mapcar 'car-safe org-entities))) (substring pcomplete-stub 1)))) (defvar org-todo-keywords-1) (defun pcomplete/org-mode/todo () "Complete against known TODO keywords." - (pcomplete-here (pcomplete-uniqify-list (copy-sequence org-todo-keywords-1)))) + (pcomplete-here (pcomplete-uniquify-list (copy-sequence org-todo-keywords-1)))) (defvar org-todo-line-regexp) (defun pcomplete/org-mode/searchhead () @@ -315,14 +315,14 @@ This needs more work, to handle headings with lots of spaces in them." (push (org-make-org-heading-search-string (match-string-no-properties 3)) tbl))) - (pcomplete-uniqify-list tbl))) + (pcomplete-uniquify-list tbl))) (substring pcomplete-stub 1)))) (defun pcomplete/org-mode/tag () "Complete a tag name. Omit tags already set." (while (pcomplete-here (mapcar (lambda (x) (concat x ":")) - (let ((lst (pcomplete-uniqify-list + (let ((lst (pcomplete-uniquify-list (or (remq nil (mapcar (lambda (x) (org-string-nw-p (car x))) @@ -339,7 +339,7 @@ This needs more work, to handle headings with lots of spaces in them." (pcomplete-here (mapcar (lambda (x) (concat x ": ")) - (let ((lst (pcomplete-uniqify-list + (let ((lst (pcomplete-uniquify-list (copy-sequence (org-buffer-property-keys nil t t t))))) (dolist (prop (org-entry-properties)) diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el index 3959a17cf4a..c31ac66bacb 100644 --- a/lisp/org/org-protocol.el +++ b/lisp/org/org-protocol.el @@ -349,17 +349,20 @@ returned list." ret) l))) -(defun org-protocol-flatten (list) - "Transform LIST into a flat list. +(defalias 'org-protocol-flatten + (if (fboundp 'flatten-tree) 'flatten-tree + (lambda (list) + "Transform LIST into a flat list. Greedy handlers might receive a list like this from emacsclient: \((\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\")) where \"/dir/\" is the absolute path to emacsclients working directory. This function transforms it into a flat list." - (if (null list) () - (if (listp list) - (append (org-protocol-flatten (car list)) (org-protocol-flatten (cdr list))) - (list list)))) + (if list + (if (consp list) + (append (org-protocol-flatten (car list)) + (org-protocol-flatten (cdr list))) + (list list)))))) (defun org-protocol-parse-parameters (info &optional new-style default-order) "Return a property list of parameters from INFO. diff --git a/lisp/org/org.el b/lisp/org/org.el index bce12956e23..ef45ee66158 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -230,8 +230,9 @@ file to byte-code before it is loaded." (let* ((age (lambda (file) (float-time (time-subtract (current-time) - (nth 5 (or (file-attributes (file-truename file)) - (file-attributes file))))))) + (file-attribute-modification-time + (or (file-attributes (file-truename file)) + (file-attributes file))))))) (base-name (file-name-sans-extension file)) (exported-file (concat base-name ".el"))) ;; tangle if the Org file is newer than the elisp file @@ -1071,6 +1072,8 @@ has been set." :group 'org-startup :type 'boolean) +(defvaralias 'org-CUA-compatible 'org-replace-disputed-keys) + (defcustom org-replace-disputed-keys nil "Non-nil means use alternative key bindings for some keys. Org mode uses S-<cursor> keys for changing timestamps and priorities. @@ -1095,8 +1098,6 @@ loading Org." :group 'org-startup :type 'boolean) -(defvaralias 'org-CUA-compatible 'org-replace-disputed-keys) - (defcustom org-disputed-keys '(([(shift up)] . [(meta p)]) ([(shift down)] . [(meta n)]) @@ -1490,6 +1491,8 @@ time in Emacs." :group 'org-edit-structure :type 'boolean) +(defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e) + (defcustom org-special-ctrl-a/e nil "Non-nil means `C-a' and `C-e' behave specially in headlines and items. @@ -1527,7 +1530,6 @@ This may also be a cons cell where the behavior for `C-a' and (const :tag "off" nil) (const :tag "on: before tags first" t) (const :tag "reversed: after tags first" reversed))))) -(defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e) (defcustom org-special-ctrl-k nil "Non-nil means `C-k' will behave specially in headlines. @@ -3005,6 +3007,8 @@ because Agenda Log mode depends on the format of these entries." (unless (assq 'note org-log-note-headings) (push '(note . "%t") org-log-note-headings)) +(defvaralias 'org-log-state-notes-into-drawer 'org-log-into-drawer) + (defcustom org-log-into-drawer nil "Non-nil means insert state change notes and time stamps into a drawer. When nil, state changes notes will be inserted after the headline and @@ -3036,8 +3040,6 @@ function `org-log-into-drawer' instead." (const :tag "LOGBOOK" t) (string :tag "Other"))) -(defvaralias 'org-log-state-notes-into-drawer 'org-log-into-drawer) - (defun org-log-into-drawer () "Name of the log drawer, as a string, or nil. This is the value of `org-log-into-drawer'. However, if the @@ -3342,6 +3344,9 @@ This display will be in an overlay, in the minibuffer." :group 'org-time :type 'boolean) +(defvaralias 'org-popup-calendar-for-date-prompt + 'org-read-date-popup-calendar) + (defcustom org-read-date-popup-calendar t "Non-nil means pop up a calendar when prompting for a date. In the calendar, the date can be selected with mouse-1. However, the @@ -3349,8 +3354,6 @@ minibuffer will also be active, and you can simply enter the date as well. When nil, only the minibuffer will be available." :group 'org-time :type 'boolean) -(defvaralias 'org-popup-calendar-for-date-prompt - 'org-read-date-popup-calendar) (defcustom org-extend-today-until 0 "The hour when your day really ends. Must be an integer. @@ -3798,6 +3801,9 @@ regular expression will be included." :group 'org-agenda :type 'regexp) +(defvaralias 'org-agenda-multi-occur-extra-files + 'org-agenda-text-search-extra-files) + (defcustom org-agenda-text-search-extra-files nil "List of extra files to be searched by text search commands. These files will be searched in addition to the agenda files by the @@ -3815,9 +3821,6 @@ scope." (const :tag "Agenda Archives" agenda-archives) (repeat :inline t (file)))) -(defvaralias 'org-agenda-multi-occur-extra-files - 'org-agenda-text-search-extra-files) - (defcustom org-agenda-skip-unavailable-files nil "Non-nil means to just skip non-reachable files in `org-agenda-files'. A nil value means to remove them, after a query, from the list." @@ -10056,7 +10059,7 @@ Note: this function also decodes single byte encodings like (cons 6 128)))) (when (>= val 192) (setq eat (car shift-xor))) (setq val (logxor val (cdr shift-xor))) - (setq sum (+ (lsh sum (car shift-xor)) val)) + (setq sum (+ (ash sum (car shift-xor)) val)) (when (> eat 0) (setq eat (- eat 1))) (cond ((= 0 eat) ;multi byte @@ -19324,6 +19327,9 @@ INCLUDE-LINKED is passed to `org-display-inline-images'." (org-toggle-inline-images) (org-toggle-inline-images))) +;; For without-x builds. +(declare-function image-refresh "image" (spec &optional frame)) + (defun org-display-inline-images (&optional include-linked refresh beg end) "Display inline images. @@ -22376,7 +22382,9 @@ returned by, e.g., `current-time'." ;; (e.g. HFS+) do not retain any finer granularity. As ;; a consequence, make sure we return non-nil when the two ;; times are equal. - (not (time-less-p (cl-subseq (nth 5 (file-attributes file)) 0 2) + (not (time-less-p (cl-subseq (file-attribute-modification-time + (file-attributes file)) + 0 2) (cl-subseq time 0 2))))) (defun org-compile-file (source process ext &optional err-msg log-buf spec) @@ -22922,7 +22930,7 @@ matches in paragraphs or comments, use it." (match-string 0) ""))))))))))) -(declare-function message-goto-body "message" ()) +(declare-function message-goto-body "message" (&optional interactive)) (defvar message-cite-prefix-regexp) ; From message.el (defun org-fill-element (&optional justify) diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el index b547c2181a5..1f98fcdd5cf 100644 --- a/lisp/org/ox-html.el +++ b/lisp/org/ox-html.el @@ -1935,7 +1935,8 @@ INFO is a plist used as a communication channel." (?c . ,(plist-get info :creator)) (?C . ,(let ((file (plist-get info :input-file))) (format-time-string timestamp-format - (and file (nth 5 (file-attributes file)))))) + (and file (file-attribute-modification-time + (file-attributes file)))))) (?v . ,(or (plist-get info :html-validation-link) ""))))) (defun org-html--build-pre/postamble (type info) diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el index 71fd02541a7..8deb6bd51ab 100644 --- a/lisp/org/ox-odt.el +++ b/lisp/org/ox-odt.el @@ -2192,6 +2192,10 @@ SHORT-CAPTION are strings." (org-odt-create-manifest-file-entry media-type target-file) target-file)) +;; For --without-x builds. +(declare-function clear-image-cache "image.c" (&optional filter)) +(declare-function image-size "image.c" (spec &optional pixels frame)) + (defun org-odt--image-size (file info &optional user-width user-height scale dpi embed-as) (let* ((--pixels-to-cms diff --git a/lisp/org/ox-publish.el b/lisp/org/ox-publish.el index 9af50fdac44..cd49cd0afc5 100644 --- a/lisp/org/ox-publish.el +++ b/lisp/org/ox-publish.el @@ -794,8 +794,8 @@ Default for SITEMAP-FILENAME is `sitemap.org'." ((or `anti-chronologically `chronologically) (let* ((adate (org-publish-find-date a project)) (bdate (org-publish-find-date b project)) - (A (+ (lsh (car adate) 16) (cadr adate))) - (B (+ (lsh (car bdate) 16) (cadr bdate)))) + (A (+ (ash (car adate) 16) (cadr adate))) + (B (+ (ash (car bdate) 16) (cadr bdate)))) (setq retval (if (eq sort-files 'chronologically) (<= A B) @@ -879,7 +879,8 @@ If FILE is an Org file and provides a DATE keyword use it. In any other case use the file system's modification time. Return time in `current-time' format." (let ((file (org-publish--expand-file-name file project))) - (if (file-directory-p file) (nth 5 (file-attributes file)) + (if (file-directory-p file) (file-attribute-modification-time + (file-attributes file)) (let ((date (org-publish-find-property file :date project))) ;; DATE is a secondary string. If it contains a time-stamp, ;; convert it to internal format. Otherwise, use FILE @@ -889,7 +890,8 @@ time in `current-time' format." (let ((value (org-element-interpret-data ts))) (and (org-string-nw-p value) (org-time-string-to-time value)))))) - ((file-exists-p file) (nth 5 (file-attributes file))) + ((file-exists-p file) (file-attribute-modification-time + (file-attributes file))) (t (error "No such file: \"%s\"" file))))))) (defun org-publish-sitemap-default-entry (entry style project) @@ -1348,8 +1350,7 @@ does not exist." (expand-file-name (or (file-symlink-p file) file) (file-name-directory file))))) (if (not attr) (error "No such file: \"%s\"" file) - (+ (lsh (car (nth 5 attr)) 16) - (cadr (nth 5 attr)))))) + (floor (float-time (file-attribute-modification-time attr)))))) (provide 'ox-publish) |