diff options
Diffstat (limited to 'lisp/org')
40 files changed, 230 insertions, 217 deletions
diff --git a/lisp/org/ob-clojure.el b/lisp/org/ob-clojure.el index df2d691f68b..9834509fb03 100644 --- a/lisp/org/ob-clojure.el +++ b/lisp/org/ob-clojure.el @@ -38,7 +38,7 @@ ;; For SLIME, the best way to install these components is by following ;; the directions as set out by Phil Hagelberg (Technomancy) on the -;; web page: http://technomancy.us/126 +;; web page: https://technomancy.us/126 ;;; Code: (require 'ob) diff --git a/lisp/org/ob-comint.el b/lisp/org/ob-comint.el index 18d4f3c9388..b14849df691 100644 --- a/lisp/org/ob-comint.el +++ b/lisp/org/ob-comint.el @@ -44,7 +44,7 @@ BUFFER is checked with `org-babel-comint-buffer-livep'. BODY is executed inside the protection of `save-excursion' and `save-match-data'." - (declare (indent 1)) + (declare (indent 1) (debug t)) `(progn (unless (org-babel-comint-buffer-livep ,buffer) (error "Buffer %s does not exist or has no process" ,buffer)) @@ -53,7 +53,6 @@ executed inside the protection of `save-excursion' and (save-excursion (let ((comint-input-filter (lambda (_input) nil))) ,@body)))))) -(def-edebug-spec org-babel-comint-in-buffer (form body)) (defmacro org-babel-comint-with-output (meta &rest body) "Evaluate BODY in BUFFER and return process output. @@ -67,7 +66,7 @@ elements are optional. This macro ensures that the filter is removed in case of an error or user `keyboard-quit' during execution of body." - (declare (indent 1)) + (declare (indent 1) (debug (sexp body))) (let ((buffer (nth 0 meta)) (eoe-indicator (nth 1 meta)) (remove-echo (nth 2 meta)) @@ -112,7 +111,6 @@ or user `keyboard-quit' during execution of body." string-buffer)) (setq string-buffer (substring string-buffer (match-end 0)))) (split-string string-buffer comint-prompt-regexp))))) -(def-edebug-spec org-babel-comint-with-output (sexp body)) (defun org-babel-comint-input-command (buffer cmd) "Pass CMD to BUFFER. diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index 1343410792a..b1fd6943716 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -1100,7 +1100,7 @@ end-header-args -- point at the end of the header-args body ------------- string holding the body of the code block beg-body --------- point at the beginning of the body end-body --------- point at the end of the body" - (declare (indent 1)) + (declare (indent 1) (debug t)) (let ((tempvar (make-symbol "file"))) `(let* ((case-fold-search t) (,tempvar ,file) @@ -1139,7 +1139,6 @@ end-body --------- point at the end of the body" (goto-char end-block))))) (unless visited-p (kill-buffer to-be-removed)) (goto-char point)))) -(def-edebug-spec org-babel-map-src-blocks (form body)) ;;;###autoload (defmacro org-babel-map-inline-src-blocks (file &rest body) @@ -1354,7 +1353,7 @@ the `org-mode-hook'." (goto-char (match-beginning 0)) (org-babel-hide-hash) (goto-char (match-end 0)))))) -(add-hook 'org-mode-hook 'org-babel-hide-all-hashes) +(add-hook 'org-mode-hook #'org-babel-hide-all-hashes) (defun org-babel-hash-at-point (&optional point) "Return the value of the hash at POINT. @@ -1372,7 +1371,7 @@ This can be called with `\\[org-ctrl-c-ctrl-c]'." Add `org-babel-hide-result' as an invisibility spec for hiding portions of results lines." (add-to-invisibility-spec '(org-babel-hide-result . t))) -(add-hook 'org-mode-hook 'org-babel-result-hide-spec) +(add-hook 'org-mode-hook #'org-babel-result-hide-spec) (defvar org-babel-hide-result-overlays nil "Overlays hiding results.") @@ -1443,11 +1442,11 @@ portions of results lines." (push ov org-babel-hide-result-overlays))))) ;; org-tab-after-check-for-cycling-hook -(add-hook 'org-tab-first-hook 'org-babel-hide-result-toggle-maybe) +(add-hook 'org-tab-first-hook #'org-babel-hide-result-toggle-maybe) ;; Remove overlays when changing major mode (add-hook 'org-mode-hook (lambda () (add-hook 'change-major-mode-hook - 'org-babel-show-result-all 'append 'local))) + #'org-babel-show-result-all 'append 'local))) (defun org-babel-params-from-properties (&optional lang no-eval) "Retrieve source block parameters specified as properties. @@ -3075,8 +3074,7 @@ Emacs shutdown.")) (defmacro org-babel-result-cond (result-params scalar-form &rest table-forms) "Call the code to parse raw string results according to RESULT-PARAMS." - (declare (indent 1) - (debug (form form &rest form))) + (declare (indent 1) (debug t)) (org-with-gensyms (params) `(let ((,params ,result-params)) (unless (member "none" ,params) @@ -3093,7 +3091,6 @@ Emacs shutdown.")) (not (member "table" ,params)))) ,scalar-form ,@table-forms))))) -(def-edebug-spec org-babel-result-cond (form form body)) (defun org-babel-temp-file (prefix &optional suffix) "Create a temporary file in the `org-babel-temporary-directory'. @@ -3136,7 +3133,7 @@ of `org-babel-temporary-directory'." org-babel-temporary-directory "[directory not defined]")))))) -(add-hook 'kill-emacs-hook 'org-babel-remove-temporary-directory) +(add-hook 'kill-emacs-hook #'org-babel-remove-temporary-directory) (defun org-babel-one-header-arg-safe-p (pair safe-list) "Determine if the PAIR is a safe babel header arg according to SAFE-LIST. diff --git a/lisp/org/ob-hledger.el b/lisp/org/ob-hledger.el index 3d2f46cdce2..48dcb8cea1a 100644 --- a/lisp/org/ob-hledger.el +++ b/lisp/org/ob-hledger.el @@ -1,4 +1,4 @@ -;; ob-hledger.el --- Babel Functions for hledger -*- lexical-binding: t; -*- +;;; ob-hledger.el --- Babel Functions for hledger -*- lexical-binding: t; -*- ;; Copyright (C) 2010-2021 Free Software Foundation, Inc. diff --git a/lisp/org/ob-lilypond.el b/lisp/org/ob-lilypond.el index fbdd905a5fe..47397e66259 100644 --- a/lisp/org/ob-lilypond.el +++ b/lisp/org/ob-lilypond.el @@ -220,7 +220,7 @@ If error in compilation, attempt to mark the error in lilypond org file." FILE-NAME is full path to lilypond (.ly) file." (message "Compiling LilyPond...") (let ((arg-1 org-babel-lilypond-ly-command) ;program - (arg-2 nil) ;infile + ;; (arg-2 nil) ;infile (arg-3 "*lilypond*") ;buffer (arg-4 t) ;display (arg-5 (if org-babel-lilypond-gen-png "--png" "")) ;&rest... @@ -231,10 +231,10 @@ FILE-NAME is full path to lilypond (.ly) file." (arg-10 (concat "--output=" (file-name-sans-extension file-name))) (arg-11 file-name)) (if test - `(,arg-1 ,arg-2 ,arg-3 ,arg-4 ,arg-5 ,arg-6 + `(,arg-1 ,nil ,arg-3 ,arg-4 ,arg-5 ,arg-6 ;; arg-2 ,arg-7 ,arg-8 ,arg-9 ,arg-10 ,arg-11) (call-process - arg-1 arg-2 arg-3 arg-4 arg-5 arg-6 + arg-1 nil arg-3 arg-4 arg-5 arg-6 ;; arg-2 arg-7 arg-8 arg-9 arg-10 arg-11)))) (defun org-babel-lilypond-check-for-compile-error (file-name &optional test) diff --git a/lisp/org/ob-mscgen.el b/lisp/org/ob-mscgen.el index 999d4f4140b..79c9f8702eb 100644 --- a/lisp/org/ob-mscgen.el +++ b/lisp/org/ob-mscgen.el @@ -1,4 +1,4 @@ -;;; ob-msc.el --- Babel Functions for Mscgen -*- lexical-binding: t; -*- +;;; ob-mscgen.el --- Babel Functions for Mscgen -*- lexical-binding: t; -*- ;; Copyright (C) 2010-2021 Free Software Foundation, Inc. @@ -78,4 +78,4 @@ mscgen supported formats." (provide 'ob-mscgen) -;;; ob-msc.el ends here +;;; ob-mscgen.el ends here diff --git a/lisp/org/ob-ocaml.el b/lisp/org/ob-ocaml.el index 0aa91afdb24..5fd6d1e09ff 100644 --- a/lisp/org/ob-ocaml.el +++ b/lisp/org/ob-ocaml.el @@ -32,7 +32,7 @@ ;;; Requirements: -;; - tuareg-mode :: http://www-rocq.inria.fr/~acohen/tuareg/ +;; - tuareg-mode :: https://www-rocq.inria.fr/~acohen/tuareg/ ;;; Code: (require 'ob) diff --git a/lisp/org/ob-tangle.el b/lisp/org/ob-tangle.el index 3c3943c8fa9..aa0373ab88e 100644 --- a/lisp/org/ob-tangle.el +++ b/lisp/org/ob-tangle.el @@ -150,7 +150,7 @@ represented in the file." "Open FILE into a temporary buffer execute BODY there like `progn', then kill the FILE buffer returning the result of evaluating BODY." - (declare (indent 1)) + (declare (indent 1) (debug t)) (let ((temp-path (make-symbol "temp-path")) (temp-result (make-symbol "temp-result")) (temp-file (make-symbol "temp-file")) @@ -164,7 +164,6 @@ evaluating BODY." (setf ,temp-result (progn ,@body))) (unless ,visited-p (kill-buffer ,temp-file)) ,temp-result))) -(def-edebug-spec org-babel-with-temp-filebuffer (form body)) ;;;###autoload (defun org-babel-tangle-file (file &optional target-file lang-re) diff --git a/lisp/org/ol-eshell.el b/lisp/org/ol-eshell.el index 769e7ee5225..8920e0afb0d 100644 --- a/lisp/org/ol-eshell.el +++ b/lisp/org/ol-eshell.el @@ -1,4 +1,4 @@ -;;; ol-eshell.el - Links to Working Directories in Eshell -*- lexical-binding: t; -*- +;;; ol-eshell.el --- Links to Working Directories in Eshell -*- lexical-binding: t; -*- ;; Copyright (C) 2011-2021 Free Software Foundation, Inc. diff --git a/lisp/org/ol-gnus.el b/lisp/org/ol-gnus.el index 71051bc6830..2d51447e0c4 100644 --- a/lisp/org/ol-gnus.el +++ b/lisp/org/ol-gnus.el @@ -198,11 +198,11 @@ If `org-store-link' was called with a prefix arg the meaning of (to (mail-fetch-field "To")) (from (mail-fetch-field "From")) (subject (mail-fetch-field "Subject")) - newsgroup xarchive) ;those are always nil for gcc + ) ;; newsgroup xarchive ;those are always nil for gcc (unless gcc (error "Can not create link: No Gcc header found")) (org-link-store-props :type "gnus" :from from :subject subject :message-id id :group gcc :to to) - (let ((link (org-gnus-article-link gcc newsgroup id xarchive)) + (let ((link (org-gnus-article-link gcc nil id nil)) ;;newsgroup xarchive (description (org-link-email-description))) (org-link-add-props :link link :description description) link))))))) diff --git a/lisp/org/ol-irc.el b/lisp/org/ol-irc.el index e3d7651c1a1..df62dd06257 100644 --- a/lisp/org/ol-irc.el +++ b/lisp/org/ol-irc.el @@ -39,9 +39,9 @@ ;; ;; Links within an org buffer might look like this: ;; -;; [[irc:/irc.freenode.net/#emacs/bob][chat with bob in #emacs on freenode]] -;; [[irc:/irc.freenode.net/#emacs][#emacs on freenode]] -;; [[irc:/irc.freenode.net/]] +;; [[irc:/irc.libera.chat/#emacs/bob][chat with bob in #emacs on Libera.Chat]] +;; [[irc:/irc.libera.chat/#emacs][#emacs on Libera.Chat]] +;; [[irc:/irc.libera.chat/]] ;; ;; If, when the resulting link is visited, there is no connection to a ;; requested server then one will be created. diff --git a/lisp/org/ol-w3m.el b/lisp/org/ol-w3m.el index f1f3afd764d..ebb11ce3d54 100644 --- a/lisp/org/ol-w3m.el +++ b/lisp/org/ol-w3m.el @@ -7,13 +7,13 @@ ;; Homepage: https://orgmode.org ;; ;; This file is part of GNU Emacs. -;; -;; This program is free software: you can redistribute it and/or modify + +;; 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/lisp/org/ol.el b/lisp/org/ol.el index 994e30f4f43..38e2dd6a02c 100644 --- a/lisp/org/ol.el +++ b/lisp/org/ol.el @@ -591,7 +591,7 @@ handle this as a special case. When the function does handle the link, it must return a non-nil value. If it decides that it is not responsible for this link, it must return -nil to indicate that that Org can continue with other options like +nil to indicate that Org can continue with other options like exact and fuzzy text search.") @@ -1467,7 +1467,7 @@ non-nil." (move-beginning-of-line 2) (set-mark (point))))) (setq org-store-link-plist nil) - (let (link cpltxt desc description search custom-id agenda-link) + (let (link cpltxt desc search custom-id agenda-link) ;; description (cond ;; Store a link using an external link type, if any function is ;; available. If more than one can generate a link from current @@ -1598,7 +1598,7 @@ non-nil." 'org-create-file-search-functions)) (setq link (concat "file:" (abbreviate-file-name buffer-file-name) "::" search)) - (setq cpltxt (or description link))) + (setq cpltxt (or link))) ;; description ((and (buffer-file-name (buffer-base-buffer)) (derived-mode-p 'org-mode)) (org-with-limited-levels diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 99e5464c2b9..3acc18715dd 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -2090,6 +2090,7 @@ Note that functions in this alist don't need to be quoted." If STRING is non-nil, the text property will be fetched from position 0 in that string. If STRING is nil, it will be fetched from the beginning of the current line." + (declare (debug t)) (org-with-gensyms (marker) `(let ((,marker (get-text-property (if ,string 0 (point-at-bol)) 'org-hd-marker ,string))) @@ -2097,7 +2098,6 @@ of the current line." (save-excursion (goto-char ,marker) ,@body))))) -(def-edebug-spec org-agenda-with-point-at-orig-entry (form body)) (defun org-add-agenda-custom-command (entry) "Replace or add a command in `org-agenda-custom-commands'. @@ -3205,7 +3205,7 @@ s Search for keywords M Like m, but only TODO entries (delete-window) (org-agenda-get-restriction-and-command prefix-descriptions)) - ((equal c ?q) (error "Abort")) + ((equal c ?q) (user-error "Abort")) (t (user-error "Invalid key %c" c)))))))) (defun org-agenda-fit-window-to-buffer () @@ -3224,6 +3224,15 @@ s Search for keywords M Like m, but only TODO entries (defvar org-agenda-overriding-cmd nil) (defvar org-agenda-overriding-arguments nil) (defvar org-agenda-overriding-cmd-arguments nil) + +(defun org-let (list &rest body) ;FIXME: So many kittens are suffering here. + (declare (indent 1)) + (eval (cons 'let (cons list body)))) + +(defun org-let2 (list1 list2 &rest body) ;FIXME: Where did our karma go? + (declare (indent 2)) + (eval (cons 'let (cons list1 (list (cons 'let (cons list2 body))))))) + (defun org-agenda-run-series (name series) "Run agenda NAME as a SERIES of agenda commands." (org-let (nth 1 series) '(org-agenda-prepare name)) diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el index f40f2b335ef..7ae8fae3aab 100644 --- a/lisp/org/org-capture.el +++ b/lisp/org/org-capture.el @@ -521,7 +521,7 @@ for a capture buffer.") "Minor mode for special key bindings in a capture buffer. Turning on this mode runs the normal hook `org-capture-mode-hook'." - nil " Cap" org-capture-mode-map + :lighter " Cap" (setq-local header-line-format (substitute-command-keys diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index 2073b33380b..1283970bc2b 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el @@ -539,8 +539,8 @@ of a different task.") "Marker pointing to the task that has been interrupted by the current clock.") (defvar org-clock-mode-line-map (make-sparse-keymap)) -(define-key org-clock-mode-line-map [mode-line mouse-2] 'org-clock-goto) -(define-key org-clock-mode-line-map [mode-line mouse-1] 'org-clock-menu) +(define-key org-clock-mode-line-map [mode-line mouse-2] #'org-clock-goto) +(define-key org-clock-mode-line-map [mode-line mouse-1] #'org-clock-menu) (defun org-clock--translate (s language) "Translate string S into using string LANGUAGE. @@ -911,17 +911,17 @@ If CLOCK-SOUND is non-nil, it overrides `org-clock-sound'." (defmacro org-with-clock-position (clock &rest forms) "Evaluate FORMS with CLOCK as the current active clock." + (declare (indent 1) (debug t)) `(with-current-buffer (marker-buffer (car ,clock)) (org-with-wide-buffer (goto-char (car ,clock)) (beginning-of-line) ,@forms))) -(def-edebug-spec org-with-clock-position (form body)) -(put 'org-with-clock-position 'lisp-indent-function 1) (defmacro org-with-clock (clock &rest forms) "Evaluate FORMS with CLOCK as the current active clock. This macro also protects the current active clock from being altered." + (declare (indent 1) (debug t)) `(org-with-clock-position ,clock (let ((org-clock-start-time (cdr ,clock)) (org-clock-total-time) @@ -932,8 +932,6 @@ This macro also protects the current active clock from being altered." (org-back-to-heading t) (point-marker)))) ,@forms))) -(def-edebug-spec org-with-clock (form body)) -(put 'org-with-clock 'lisp-indent-function 1) (defsubst org-clock-clock-in (clock &optional resume start-time) "Clock in to the clock located by CLOCK. @@ -1416,12 +1414,12 @@ the default behavior." (setq org-clock-mode-line-timer (run-with-timer org-clock-update-period org-clock-update-period - 'org-clock-update-mode-line))) + #'org-clock-update-mode-line))) (when org-clock-idle-timer (cancel-timer org-clock-idle-timer) (setq org-clock-idle-timer nil)) (setq org-clock-idle-timer - (run-with-timer 60 60 'org-resolve-clocks-if-idle)) + (run-with-timer 60 60 #'org-resolve-clocks-if-idle)) (message "Clock starts at %s - %s" ts org--msg-extra) (run-hooks 'org-clock-in-hook)))))) @@ -1718,7 +1716,7 @@ to, overriding the existing value of `org-clock-out-switch-to-state'." (unless (org-clocking-p) (setq org-clock-current-task nil))))))) -(add-hook 'org-clock-out-hook 'org-clock-remove-empty-clock-drawer) +(add-hook 'org-clock-out-hook #'org-clock-remove-empty-clock-drawer) (defun org-clock-remove-empty-clock-drawer () "Remove empty clock drawers in current subtree." @@ -2014,7 +2012,7 @@ Use `\\[org-clock-remove-overlays]' to remove the subtree times." (when time (org-clock-put-overlay time))))) ;; Arrange to remove the overlays upon next change. (when org-remove-highlights-with-change - (add-hook 'before-change-functions 'org-clock-remove-overlays + (add-hook 'before-change-functions #'org-clock-remove-overlays nil 'local)))) (let* ((h (/ org-clock-file-total-minutes 60)) (m (- org-clock-file-total-minutes (* 60 h)))) @@ -2065,7 +2063,7 @@ If NOREMOVE is nil, remove this function from the (setq org-clock-overlays nil) (unless noremove (remove-hook 'before-change-functions - 'org-clock-remove-overlays 'local)))) + #'org-clock-remove-overlays 'local)))) ;;;###autoload (defun org-clock-out-if-current () @@ -2241,7 +2239,7 @@ have priority." ((>= month 7) 3) ((>= month 4) 2) (t 1))) - m1 h1 d1 month1 y1 shiftedy shiftedm shiftedq) + h1 d1 month1 y1 shiftedy shiftedm shiftedq) ;; m1 (cond ((string-match "\\`[0-9]+\\'" skey) (setq y (string-to-number skey) month 1 d 1 key 'year)) @@ -2344,7 +2342,7 @@ have priority." (`interactive (org-read-date nil t nil "Range end? ")) (`untilnow (current-time)) (_ (encode-time 0 - (or m1 m) + m ;; (or m1 m) (or h1 h) (or d1 d) (or month1 month) @@ -2391,7 +2389,7 @@ the currently selected interval size." (user-error "Line needs a :block definition before this command works") (let* ((b (match-beginning 1)) (e (match-end 1)) (s (match-string 1)) - block shift ins y mw d date wp m) + block shift ins y mw d date wp) ;; m (cond ((equal s "yesterday") (setq s "today-1")) ((equal s "lastweek") (setq s "thisweek-1")) @@ -2416,7 +2414,7 @@ the currently selected interval size." (cond (d (setq ins (format-time-string "%Y-%m-%d" - (encode-time 0 0 0 (+ d n) m y)))) + (encode-time 0 0 0 (+ d n) nil y)))) ;; m ((and wp (string-match "w\\|W" wp) mw (> (length wp) 0)) (require 'cal-iso) (setq date (calendar-gregorian-from-absolute @@ -2934,12 +2932,12 @@ PROPERTIES: The list properties specified in the `:properties' parameter (save-excursion (org-clock-sum ts te (when matcher - `(lambda () - (let* ((todo (org-get-todo-state)) - (tags-list (org-get-tags)) - (org-scanner-tags tags-list) - (org-trust-scanner-tags t)) - (funcall ,matcher todo tags-list nil))))) + (lambda () + (let* ((todo (org-get-todo-state)) + (tags-list (org-get-tags)) + (org-scanner-tags tags-list) + (org-trust-scanner-tags t)) + (funcall matcher todo tags-list nil))))) (goto-char (point-min)) (setq st t) (while (or (and (bobp) (prog1 st (setq st nil)) diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el index 75056d45a7e..2f039064404 100644 --- a/lisp/org/org-colview.el +++ b/lisp/org/org-colview.el @@ -162,20 +162,20 @@ See `org-columns-summary-types' for details.") (org-overview) (org-content)) -(org-defkey org-columns-map "c" 'org-columns-content) -(org-defkey org-columns-map "o" 'org-overview) -(org-defkey org-columns-map "e" 'org-columns-edit-value) -(org-defkey org-columns-map "\C-c\C-t" 'org-columns-todo) -(org-defkey org-columns-map "\C-c\C-c" 'org-columns-toggle-or-columns-quit) -(org-defkey org-columns-map "\C-c\C-o" 'org-columns-open-link) -(org-defkey org-columns-map "v" 'org-columns-show-value) -(org-defkey org-columns-map "q" 'org-columns-quit) -(org-defkey org-columns-map "r" 'org-columns-redo) -(org-defkey org-columns-map "g" 'org-columns-redo) -(org-defkey org-columns-map [left] 'backward-char) -(org-defkey org-columns-map "\M-b" 'backward-char) -(org-defkey org-columns-map "a" 'org-columns-edit-allowed) -(org-defkey org-columns-map "s" 'org-columns-edit-attributes) +(org-defkey org-columns-map "c" #'org-columns-content) +(org-defkey org-columns-map "o" #'org-overview) +(org-defkey org-columns-map "e" #'org-columns-edit-value) +(org-defkey org-columns-map "\C-c\C-t" #'org-columns-todo) +(org-defkey org-columns-map "\C-c\C-c" #'org-columns-toggle-or-columns-quit) +(org-defkey org-columns-map "\C-c\C-o" #'org-columns-open-link) +(org-defkey org-columns-map "v" #'org-columns-show-value) +(org-defkey org-columns-map "q" #'org-columns-quit) +(org-defkey org-columns-map "r" #'org-columns-redo) +(org-defkey org-columns-map "g" #'org-columns-redo) +(org-defkey org-columns-map [left] #'backward-char) +(org-defkey org-columns-map "\M-b" #'backward-char) +(org-defkey org-columns-map "a" #'org-columns-edit-allowed) +(org-defkey org-columns-map "s" #'org-columns-edit-attributes) (org-defkey org-columns-map "\M-f" (lambda () (interactive) (goto-char (1+ (point))))) (org-defkey org-columns-map [right] @@ -187,7 +187,7 @@ See `org-columns-summary-types' for details.") (while (and (org-invisible-p2) (not (eobp))) (beginning-of-line 2)) (move-to-column col) - (if (eq major-mode 'org-agenda-mode) + (if (derived-mode-p 'org-agenda-mode) (org-agenda-do-context-action))))) (org-defkey org-columns-map [up] (lambda () (interactive) @@ -198,20 +198,20 @@ See `org-columns-summary-types' for details.") (move-to-column col) (if (eq major-mode 'org-agenda-mode) (org-agenda-do-context-action))))) -(org-defkey org-columns-map [(shift right)] 'org-columns-next-allowed-value) -(org-defkey org-columns-map "n" 'org-columns-next-allowed-value) -(org-defkey org-columns-map [(shift left)] 'org-columns-previous-allowed-value) -(org-defkey org-columns-map "p" 'org-columns-previous-allowed-value) -(org-defkey org-columns-map "<" 'org-columns-narrow) -(org-defkey org-columns-map ">" 'org-columns-widen) -(org-defkey org-columns-map [(meta right)] 'org-columns-move-right) -(org-defkey org-columns-map [(meta left)] 'org-columns-move-left) -(org-defkey org-columns-map [(shift meta right)] 'org-columns-new) -(org-defkey org-columns-map [(shift meta left)] 'org-columns-delete) +(org-defkey org-columns-map [(shift right)] #'org-columns-next-allowed-value) +(org-defkey org-columns-map "n" #'org-columns-next-allowed-value) +(org-defkey org-columns-map [(shift left)] #'org-columns-previous-allowed-value) +(org-defkey org-columns-map "p" #'org-columns-previous-allowed-value) +(org-defkey org-columns-map "<" #'org-columns-narrow) +(org-defkey org-columns-map ">" #'org-columns-widen) +(org-defkey org-columns-map [(meta right)] #'org-columns-move-right) +(org-defkey org-columns-map [(meta left)] #'org-columns-move-left) +(org-defkey org-columns-map [(shift meta right)] #'org-columns-new) +(org-defkey org-columns-map [(shift meta left)] #'org-columns-delete) (dotimes (i 10) (org-defkey org-columns-map (number-to-string i) - `(lambda () (interactive) - (org-columns-next-allowed-value nil ,i)))) + (lambda () (interactive) + (org-columns-next-allowed-value nil i)))) (easy-menu-define org-columns-menu org-columns-map "Org Column Menu" '("Column" @@ -490,7 +490,7 @@ for the duration of the command.") (org-add-props " " nil 'display `(space :align-to ,linum-offset)) (org-add-props (substring title 0 -1) nil 'face 'org-column-title))) (setq org-columns-previous-hscroll -1) - (add-hook 'post-command-hook 'org-columns-hscroll-title nil 'local))) + (add-hook 'post-command-hook #'org-columns-hscroll-title nil 'local))) (defun org-columns-hscroll-title () "Set the `header-line-format' so that it scrolls along with the table." @@ -519,7 +519,7 @@ for the duration of the command.") (when (local-variable-p 'org-previous-header-line-format) (setq header-line-format org-previous-header-line-format) (kill-local-variable 'org-previous-header-line-format) - (remove-hook 'post-command-hook 'org-columns-hscroll-title 'local)) + (remove-hook 'post-command-hook #'org-columns-hscroll-title 'local)) (set-marker org-columns-begin-marker nil) (when (markerp org-columns-top-level-marker) (set-marker org-columns-top-level-marker nil)) @@ -782,7 +782,7 @@ around it." (setq time-after (copy-sequence time)) (setf (nth 3 time-before) (1- (nth 3 time))) (setf (nth 3 time-after) (1+ (nth 3 time))) - (mapcar (lambda (x) (format-time-string fmt (apply 'encode-time x))) + (mapcar (lambda (x) (format-time-string fmt (apply #'encode-time x))) (list time-before time time-after))))) (defun org-columns-open-link (&optional arg) diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index 1f4e2e8308f..b68e5b58fca 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -1151,8 +1151,8 @@ key." ((guard (not (lookup-key calendar-mode-map "c"))) (local-set-key "c" #'org-calendar-goto-agenda)) (_ nil)) - (unless (and (boundp 'org-agenda-diary-file) - (eq org-agenda-diary-file 'diary-file)) + (when (and (boundp 'org-agenda-diary-file) + (not (eq org-agenda-diary-file 'diary-file))) (local-set-key org-calendar-insert-diary-entry-key #'org-agenda-diary-entry))) diff --git a/lisp/org/org-crypt.el b/lisp/org/org-crypt.el index caf9de91b98..103baeb49e0 100644 --- a/lisp/org/org-crypt.el +++ b/lisp/org/org-crypt.el @@ -284,6 +284,8 @@ Assume `epg-context' is set." nil))) (_ nil))) +(defvar org--matcher-tags-todo-only) + ;;;###autoload (defun org-encrypt-entries () "Encrypt all top-level entries in the current buffer." diff --git a/lisp/org/org-ctags.el b/lisp/org/org-ctags.el index 1fca873c159..dc2b3be6326 100644 --- a/lisp/org/org-ctags.el +++ b/lisp/org/org-ctags.el @@ -1,5 +1,5 @@ -;;; org-ctags.el - Integrate Emacs "tags" Facility with Org -*- lexical-binding: t; -*- -;; +;;; org-ctags.el --- Integrate Emacs "tags" Facility with Org -*- lexical-binding: t; -*- + ;; Copyright (C) 2007-2021 Free Software Foundation, Inc. ;; Author: Paul Sexton <eeeickythump@gmail.com> diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index b7319d638ed..31f5f78eae0 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el @@ -4206,6 +4206,7 @@ looking into captions: (lambda (b) (and (org-element-map b \\='latex-snippet #\\='identity nil t) b)) nil nil nil t)" + (declare (indent 2)) ;; Ensure TYPES and NO-RECURSION are a list, even of one element. (let* ((types (if (listp types) types (list types))) (no-recursion (if (listp no-recursion) no-recursion @@ -4299,7 +4300,6 @@ looking into captions: (funcall --walk-tree data) ;; Return value in a proper order. (nreverse --acc))))) -(put 'org-element-map 'lisp-indent-function 2) ;; The following functions are internal parts of the parser. ;; diff --git a/lisp/org/org-indent.el b/lisp/org/org-indent.el index c6bf416564e..3475cadc42d 100644 --- a/lisp/org/org-indent.el +++ b/lisp/org/org-indent.el @@ -167,7 +167,7 @@ properties, after each buffer modification, on the modified zone. The process is synchronous. Though, initial indentation of buffer, which can take a few seconds on large buffers, is done during idle time." - nil " Ind" nil + :lighter " Ind" (cond (org-indent-mode ;; mode was turned on. diff --git a/lisp/org/org-install.el b/lisp/org/org-install.el index 58359597363..d521d819db2 100644 --- a/lisp/org/org-install.el +++ b/lisp/org/org-install.el @@ -1,4 +1,4 @@ -;;; org-install.el --- backward compatibility file for obsolete configuration +;;; org-install.el --- backward compatibility file for obsolete configuration -*- lexical-binding: t -*- ;; ;;; Code: ;; diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el index 39122e7ce41..f97164ee33b 100644 --- a/lisp/org/org-list.el +++ b/lisp/org/org-list.el @@ -2304,7 +2304,7 @@ is an integer, 0 means `-', 1 means `+' etc. If WHICH is ;;;###autoload (define-minor-mode org-list-checkbox-radio-mode "When turned on, use list checkboxes as radio buttons." - nil " CheckBoxRadio" nil + :lighter " CheckBoxRadio" (unless (eq major-mode 'org-mode) (user-error "Cannot turn this mode outside org-mode buffers"))) diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index 56afdf6ef19..58d3fd39922 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -627,18 +627,10 @@ program is needed for, so that the error message can be more informative." (let ((message-log-max nil)) (apply #'message args))) -(defun org-let (list &rest body) - (eval (cons 'let (cons list body)))) -(put 'org-let 'lisp-indent-function 1) - -(defun org-let2 (list1 list2 &rest body) - (eval (cons 'let (cons list1 (list (cons 'let (cons list2 body))))))) -(put 'org-let2 'lisp-indent-function 2) - (defun org-eval (form) "Eval FORM and return result." (condition-case error - (eval form) + (eval form t) (error (format "%%![Error: %s]" error)))) (defvar org-outline-regexp) ; defined in org.el @@ -877,7 +869,8 @@ delimiting S." (let ((width (plist-get props :width))) (and (wholenump width) width))) (`(image . ,_) - (ceiling (car (image-size spec)))) + (and (fboundp 'image-size) + (ceiling (car (image-size spec))))) ((pred stringp) ;; Displayed string could contain invisible parts, ;; but no nested display. @@ -1241,31 +1234,29 @@ Return 0. if S is not recognized as a valid value." When ADDITIONAL-KEYS is not nil, also include SPC and DEL in the allowed keys for scrolling, as expected in the export dispatch window." - (let ((scrlup (if additional-keys '(?\s 22) 22)) - (scrldn (if additional-keys `(?\d 134217846) 134217846))) - (eval - `(cl-case ,key - ;; C-n - (14 (if (not (pos-visible-in-window-p (point-max))) - (ignore-errors (scroll-up 1)) - (message "End of buffer") - (sit-for 1))) - ;; C-p - (16 (if (not (pos-visible-in-window-p (point-min))) - (ignore-errors (scroll-down 1)) - (message "Beginning of buffer") - (sit-for 1))) - ;; SPC or - (,scrlup - (if (not (pos-visible-in-window-p (point-max))) - (scroll-up nil) - (message "End of buffer") - (sit-for 1))) - ;; DEL - (,scrldn (if (not (pos-visible-in-window-p (point-min))) - (scroll-down nil) - (message "Beginning of buffer") - (sit-for 1))))))) + (let ((scrlup (if additional-keys '(?\s ?\C-v) ?\C-v)) + (scrldn (if additional-keys `(?\d ?\M-v) ?\M-v))) + (pcase key + (?\C-n (if (not (pos-visible-in-window-p (point-max))) + (ignore-errors (scroll-up 1)) + (message "End of buffer") + (sit-for 1))) + (?\C-p (if (not (pos-visible-in-window-p (point-min))) + (ignore-errors (scroll-down 1)) + (message "Beginning of buffer") + (sit-for 1))) + ;; SPC or + ((guard (memq key scrlup)) + (if (not (pos-visible-in-window-p (point-max))) + (scroll-up nil) + (message "End of buffer") + (sit-for 1))) + ;; DEL + ((guard (memq key scrldn)) + (if (not (pos-visible-in-window-p (point-min))) + (scroll-down nil) + (message "Beginning of buffer") + (sit-for 1)))))) (provide 'org-macs) diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el index 5c222ea70d5..57281dd68c0 100644 --- a/lisp/org/org-mouse.el +++ b/lisp/org/org-mouse.el @@ -167,14 +167,12 @@ indirectly, for example, through the agenda buffer.") (defcustom org-mouse-punctuation ":" "Punctuation used when inserting text by drag and drop." - :group 'org-mouse :type 'string) (defcustom org-mouse-features '(context-menu yank-link activate-stars activate-bullets activate-checkboxes) "The features of org-mouse that should be activated. Changing this variable requires a restart of Emacs to get activated." - :group 'org-mouse :type '(set :greedy t (const :tag "Mouse-3 shows context menu" context-menu) (const :tag "C-mouse-1 and mouse-3 move trees" move-tree) @@ -292,19 +290,19 @@ argument. If it is a string, it is interpreted as the format string to (format ITEMFORMAT keyword). If it is neither a string nor a function, elements of KEYWORDS are used directly." (mapcar - `(lambda (keyword) + (lambda (keyword) (vector (cond - ((functionp ,itemformat) (funcall ,itemformat keyword)) - ((stringp ,itemformat) (format ,itemformat keyword)) + ((functionp itemformat) (funcall itemformat keyword)) + ((stringp itemformat) (format itemformat keyword)) (t keyword)) - (list 'funcall ,function keyword) + (list 'funcall function keyword) :style (cond - ((null ,selected) t) - ((functionp ,selected) 'toggle) + ((null selected) t) + ((functionp selected) 'toggle) (t 'radio)) - :selected (if (functionp ,selected) - (and (funcall ,selected keyword) t) - (equal ,selected keyword)))) + :selected (if (functionp selected) + (and (funcall selected keyword) t) + (equal selected keyword)))) keywords)) (defun org-mouse-remove-match-and-spaces () @@ -344,12 +342,12 @@ string to (format ITEMFORMAT keyword). If it is neither a string nor a function, elements of KEYWORDS are used directly." (setq group (or group 0)) (let ((replace (org-mouse-match-closure - (if nosurround 'replace-match - 'org-mouse-replace-match-and-surround)))) + (if nosurround #'replace-match + #'org-mouse-replace-match-and-surround)))) (append (org-mouse-keyword-menu keywords - `(lambda (keyword) (funcall ,replace keyword t t nil ,group)) + (lambda (keyword) (funcall replace keyword t t nil group)) (match-string group) itemformat) `(["None" org-mouse-remove-match-and-spaces @@ -416,7 +414,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:" (let ((kwds org-todo-keywords-1)) (org-mouse-keyword-menu kwds - `(lambda (kwd) (org-todo kwd)) + #'org-todo (lambda (kwd) (equal state kwd)))))) (defun org-mouse-tag-menu () ;todo @@ -424,14 +422,14 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:" (append (let ((tags (org-get-tags nil t))) (org-mouse-keyword-menu - (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp) - `(lambda (tag) + (sort (mapcar #'car (org-get-buffer-tags)) #'string-lessp) + (lambda (tag) (org-mouse-set-tags - (sort (if (member tag (quote ,tags)) - (delete tag (quote ,tags)) - (cons tag (quote ,tags))) - 'string-lessp))) - `(lambda (tag) (member tag (quote ,tags))) + (sort (if (member tag tags) + (delete tag tags) + (cons tag tags)) + #'string-lessp))) + (lambda (tag) (member tag tags)) )) '("--" ["Align Tags Here" (org-align-tags) t] @@ -500,7 +498,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:" ["Check TODOs" org-show-todo-tree t] ("Check Tags" ,@(org-mouse-keyword-menu - (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp) + (sort (mapcar #'car (org-get-buffer-tags)) #'string-lessp) #'(lambda (tag) (org-tags-sparse-tree nil tag))) "--" ["Custom Tag ..." org-tags-sparse-tree t]) @@ -510,16 +508,16 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:" ["Display TODO List" org-todo-list t] ("Display Tags" ,@(org-mouse-keyword-menu - (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp) + (sort (mapcar #'car (org-get-buffer-tags)) #'string-lessp) #'(lambda (tag) (org-tags-view nil tag))) "--" ["Custom Tag ..." org-tags-view t]) ["Display Calendar" org-goto-calendar t] "--" ,@(org-mouse-keyword-menu - (mapcar 'car org-agenda-custom-commands) + (mapcar #'car org-agenda-custom-commands) #'(lambda (key) - (eval `(org-agenda nil (string-to-char ,key)))) + (org-agenda nil (string-to-char key))) nil #'(lambda (key) (let ((entry (assoc key org-agenda-custom-commands))) @@ -594,10 +592,10 @@ This means, between the beginning of line and the point." (defun org-mouse-match-closure (function) (let ((match (match-data t))) - `(lambda (&rest rest) - (save-match-data - (set-match-data ',match) - (apply ',function rest))))) + (lambda (&rest rest) + (save-match-data + (set-match-data match) + (apply function rest))))) (defun org-mouse-yank-link (click) (interactive "e") @@ -631,7 +629,7 @@ This means, between the beginning of line and the point." ((save-excursion (beginning-of-line) (looking-at "[ \t]*#\\+STARTUP: \\(.*\\)")) (popup-menu `(nil - ,@(org-mouse-list-options-menu (mapcar 'car org-startup-options) + ,@(org-mouse-list-options-menu (mapcar #'car org-startup-options) 'org-mode-restart)))) ((or (eolp) (and (looking-at "\\( \\|\t\\)\\(\\+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$") @@ -857,21 +855,21 @@ This means, between the beginning of line and the point." (add-hook 'org-mode-hook #'(lambda () - (setq org-mouse-context-menu-function 'org-mouse-context-menu) + (setq org-mouse-context-menu-function #'org-mouse-context-menu) (when (memq 'context-menu org-mouse-features) (org-defkey org-mouse-map [mouse-3] nil) - (org-defkey org-mode-map [mouse-3] 'org-mouse-show-context-menu)) - (org-defkey org-mode-map [down-mouse-1] 'org-mouse-down-mouse) + (org-defkey org-mode-map [mouse-3] #'org-mouse-show-context-menu)) + (org-defkey org-mode-map [down-mouse-1] #'org-mouse-down-mouse) (when (memq 'context-menu org-mouse-features) - (org-defkey org-mouse-map [C-drag-mouse-1] 'org-mouse-move-tree) - (org-defkey org-mouse-map [C-down-mouse-1] 'org-mouse-move-tree-start)) + (org-defkey org-mouse-map [C-drag-mouse-1] #'org-mouse-move-tree) + (org-defkey org-mouse-map [C-down-mouse-1] #'org-mouse-move-tree-start)) (when (memq 'yank-link org-mouse-features) - (org-defkey org-mode-map [S-mouse-2] 'org-mouse-yank-link) - (org-defkey org-mode-map [drag-mouse-3] 'org-mouse-yank-link)) + (org-defkey org-mode-map [S-mouse-2] #'org-mouse-yank-link) + (org-defkey org-mode-map [drag-mouse-3] #'org-mouse-yank-link)) (when (memq 'move-tree org-mouse-features) - (org-defkey org-mouse-map [drag-mouse-3] 'org-mouse-move-tree) - (org-defkey org-mouse-map [down-mouse-3] 'org-mouse-move-tree-start)) + (org-defkey org-mouse-map [drag-mouse-3] #'org-mouse-move-tree) + (org-defkey org-mouse-map [down-mouse-3] #'org-mouse-move-tree-start)) (when (memq 'activate-stars org-mouse-features) (font-lock-add-keywords @@ -1086,11 +1084,11 @@ This means, between the beginning of line and the point." (defvar org-agenda-mode-map) (add-hook 'org-agenda-mode-hook (lambda () - (setq org-mouse-context-menu-function 'org-mouse-agenda-context-menu) - (org-defkey org-agenda-mode-map [mouse-3] 'org-mouse-show-context-menu) - (org-defkey org-agenda-mode-map [down-mouse-3] 'org-mouse-move-tree-start) - (org-defkey org-agenda-mode-map [C-mouse-4] 'org-agenda-earlier) - (org-defkey org-agenda-mode-map [C-mouse-5] 'org-agenda-later) + (setq org-mouse-context-menu-function #'org-mouse-agenda-context-menu) + (org-defkey org-agenda-mode-map [mouse-3] #'org-mouse-show-context-menu) + (org-defkey org-agenda-mode-map [down-mouse-3] #'org-mouse-move-tree-start) + (org-defkey org-agenda-mode-map [C-mouse-4] #'org-agenda-earlier) + (org-defkey org-agenda-mode-map [C-mouse-5] #'org-agenda-later) (org-defkey org-agenda-mode-map [drag-mouse-3] (lambda (event) (interactive "e") (cl-case (org-mouse-get-gesture event) diff --git a/lisp/org/org-pcomplete.el b/lisp/org/org-pcomplete.el index 29d9d58482a..d8a4937b95a 100644 --- a/lisp/org/org-pcomplete.el +++ b/lisp/org/org-pcomplete.el @@ -239,11 +239,11 @@ When completing for #+STARTUP, for example, this function returns (require 'ox) (pcomplete-here (and org-export-exclude-tags - (list (mapconcat 'identity org-export-exclude-tags " "))))) + (list (mapconcat #'identity org-export-exclude-tags " "))))) (defun pcomplete/org-mode/file-option/filetags () "Complete arguments for the #+FILETAGS file option." - (pcomplete-here (and org-file-tags (mapconcat 'identity org-file-tags " ")))) + (pcomplete-here (and org-file-tags (mapconcat #'identity org-file-tags " ")))) (defun pcomplete/org-mode/file-option/language () "Complete arguments for the #+LANGUAGE file option." @@ -264,13 +264,13 @@ When completing for #+STARTUP, for example, this function returns (require 'ox) (pcomplete-here (and org-export-select-tags - (list (mapconcat 'identity org-export-select-tags " "))))) + (list (mapconcat #'identity org-export-select-tags " "))))) (defun pcomplete/org-mode/file-option/startup () "Complete arguments for the #+STARTUP file option." (while (pcomplete-here (let ((opts (pcomplete-uniquify-list - (mapcar 'car org-startup-options)))) + (mapcar #'car org-startup-options)))) ;; Some options are mutually exclusive, and shouldn't be completed ;; against if certain other options have already been seen. (dolist (arg pcomplete-args) @@ -340,7 +340,8 @@ When completing for #+STARTUP, for example, this function returns "Complete against TeX-style HTML entity names." (require 'org-entities) (while (pcomplete-here - (pcomplete-uniquify-list (remove nil (mapcar 'car-safe org-entities))) + (pcomplete-uniquify-list + (remove nil (mapcar #'car-safe org-entities))) (substring pcomplete-stub 1)))) (defun pcomplete/org-mode/todo () diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el index 74043f8340b..726c1ca2bae 100644 --- a/lisp/org/org-protocol.el +++ b/lisp/org/org-protocol.el @@ -535,7 +535,7 @@ The location for a browser's bookmark should look like this: encodeURIComponent(location.href)" ;; As we enter this function for a match on our protocol, the return value ;; defaults to nil. - (let ((result nil) + (let (;; (result nil) (f (org-protocol-sanitize-uri (plist-get (org-protocol-parse-parameters fname nil '(:url)) :url)))) @@ -586,7 +586,7 @@ The location for a browser's bookmark should look like this: (if (file-exists-p the-file) (message "%s: permission denied!" the-file) (message "%s: no such file or directory." the-file)))))) - result))) + nil))) ;; FIXME: Really? ;;; Core functions: diff --git a/lisp/org/org-refile.el b/lisp/org/org-refile.el index 1e0c339f7b2..8b42f817c1a 100644 --- a/lisp/org/org-refile.el +++ b/lisp/org/org-refile.el @@ -7,18 +7,18 @@ ;; ;; This file is part of GNU Emacs. -;; This program is free software; you can redistribute it and/or modify +;; 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 <https://www.gnu.org/licenses/>. +;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. ;;; Commentary: diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el index 20acee4e662..cabedecb689 100644 --- a/lisp/org/org-src.el +++ b/lisp/org/org-src.el @@ -682,7 +682,7 @@ This minor mode is turned on in two situations: \\{org-src-mode-map} See also `org-src-mode-hook'." - nil " OrgSrc" nil + :lighter " OrgSrc" (when org-edit-src-persistent-message (setq header-line-format (substitute-command-keys diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 1248efabc15..0e93fb271f3 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -495,7 +495,7 @@ This may be useful when columns have been shrunk." ;;;###autoload (define-minor-mode org-table-header-line-mode "Display the first row of the table at point in the header line." - nil " TblHeader" nil + :lighter " TblHeader" (unless (eq major-mode 'org-mode) (user-error "Cannot turn org table header mode outside org-mode buffers")) (if org-table-header-line-mode @@ -1976,7 +1976,7 @@ lines." When this mode is active, the field editor window will always show the current field. The mode exits automatically when the cursor leaves the table (but see `org-table-exit-follow-field-mode-when-leaving-table')." - nil " TblFollow" nil + :lighter " TblFollow" (if org-table-follow-field-mode (add-hook 'post-command-hook 'org-table-follow-fields-with-editor 'append 'local) @@ -5149,7 +5149,7 @@ When LOCAL is non-nil, show references for the table at point." ;;;###autoload (define-minor-mode orgtbl-mode "The Org mode table editor as a minor mode for use in other modes." - :lighter " OrgTbl" :keymap orgtbl-mode-map + :lighter " OrgTbl" (org-load-modules-maybe) (cond ((derived-mode-p 'org-mode) diff --git a/lisp/org/org-tempo.el b/lisp/org/org-tempo.el index 36b8614fe1c..c121b8e7aca 100644 --- a/lisp/org/org-tempo.el +++ b/lisp/org/org-tempo.el @@ -65,7 +65,7 @@ just like `org-structure-template-alist'. The tempo snippet \"<KEY\" will be expanded using the KEYWORD value. For example \"<L\" at the beginning of a line is expanded to \"#+latex:\". -Do not use \"I\" as a KEY, as it it reserved for expanding +Do not use \"I\" as a KEY, as it is reserved for expanding \"#+include\"." :group 'org-tempo :type '(repeat (cons (string :tag "Key") diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el index b6802fe8b04..852d18579a4 100644 --- a/lisp/org/org-timer.el +++ b/lisp/org/org-timer.el @@ -366,7 +366,7 @@ VALUE can be `on', `off', or `paused'." (setq org-timer-mode-line-timer nil)) (when org-timer-display (setq org-timer-mode-line-timer - (run-with-timer 1 1 'org-timer-update-mode-line)))))) + (run-with-timer 1 1 #'org-timer-update-mode-line)))))) (defun org-timer-update-mode-line () "Update the timer time in the mode line." @@ -456,14 +456,15 @@ using three `C-u' prefix arguments." "Start countdown timer that will last SECS. TITLE will be appended to the notification message displayed when time is up." - (let ((msg (format "%s: time out" title))) + (let ((msg (format "%s: time out" title)) + (sound org-clock-sound)) (run-with-timer - secs nil `(lambda () - (setq org-timer-countdown-timer nil - org-timer-start-time nil) - (org-notify ,msg ,org-clock-sound) - (org-timer-set-mode-line 'off) - (run-hooks 'org-timer-done-hook))))) + secs nil (lambda () + (setq org-timer-countdown-timer nil + org-timer-start-time nil) + (org-notify msg sound) + (org-timer-set-mode-line 'off) + (run-hooks 'org-timer-done-hook))))) (defun org-timer--get-timer-title () "Construct timer title. diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 25b3354bdd7..8871ef798d5 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -1,4 +1,4 @@ -;;; org-version.el --- autogenerated file, do not edit +;;; org-version.el --- autogenerated file, do not edit -*- lexical-binding: t -*- ;; ;;; Code: ;;;###autoload diff --git a/lisp/org/org.el b/lisp/org/org.el index e6a5cca9391..f560c65dc4f 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -4757,8 +4757,8 @@ This is for getting out of special buffers like capture.") ;; Other stuff we need. (require 'time-date) (unless (fboundp 'time-subtract) (defalias 'time-subtract 'subtract-time)) -(require 'easymenu) -(require 'overlay) +(when (< emacs-major-version 28) ; preloaded in Emacs 28 + (require 'easymenu)) (require 'org-entities) (require 'org-faces) @@ -15584,7 +15584,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved This mode supports entering LaTeX environment and math in LaTeX fragments in Org mode. \\{org-cdlatex-mode-map}" - nil " OCDL" nil + :lighter " OCDL" (when org-cdlatex-mode (require 'cdlatex) (run-hooks 'cdlatex-mode-hook) @@ -20318,7 +20318,7 @@ unless optional argument NO-INHERITANCE is non-nil." (defun org-point-at-end-of-empty-headline () "If point is at the end of an empty headline, return t, else nil. -If the heading only contains a TODO keyword, it is still still considered +If the heading only contains a TODO keyword, it is still considered empty." (let ((case-fold-search nil)) (and (looking-at "[ \t]*$") diff --git a/lisp/org/ox-beamer.el b/lisp/org/ox-beamer.el index 1a1732b6836..6ed95e84d6b 100644 --- a/lisp/org/ox-beamer.el +++ b/lisp/org/ox-beamer.el @@ -895,14 +895,16 @@ holding export options." ;;; Minor Mode -(defvar org-beamer-mode-map (make-sparse-keymap) +(defvar org-beamer-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-c\C-b" 'org-beamer-select-environment) + map) "The keymap for `org-beamer-mode'.") -(define-key org-beamer-mode-map "\C-c\C-b" 'org-beamer-select-environment) ;;;###autoload (define-minor-mode org-beamer-mode "Support for editing Beamer oriented Org mode files." - nil " Bm" 'org-beamer-mode-map) + :lighter " Bm") (when (fboundp 'font-lock-add-keywords) (font-lock-add-keywords diff --git a/lisp/org/ox-man.el b/lisp/org/ox-man.el index 6cace7e6989..27d2dedb8ed 100644 --- a/lisp/org/ox-man.el +++ b/lisp/org/ox-man.el @@ -1,4 +1,4 @@ -;; ox-man.el --- Man Back-End for Org Export Engine -*- lexical-binding: t; -*- +;;; ox-man.el --- Man Back-End for Org Export Engine -*- lexical-binding: t; -*- ;; Copyright (C) 2011-2021 Free Software Foundation, Inc. diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el index 2d550d92774..a076d15978d 100644 --- a/lisp/org/ox-odt.el +++ b/lisp/org/ox-odt.el @@ -2111,7 +2111,8 @@ SHORT-CAPTION are strings." (caption (let ((c (org-export-get-caption element-or-parent))) (and c (org-export-data c info)))) ;; FIXME: We don't use short-caption for now - (short-caption nil)) + ;; (short-caption nil) + ) (when (or label caption) (let* ((default-category (cl-case (org-element-type element) @@ -2159,7 +2160,7 @@ SHORT-CAPTION are strings." "<text:sequence text:ref-name=\"%s\" text:name=\"%s\" text:formula=\"ooow:%s+1\" style:num-format=\"1\">%s</text:sequence>" label counter counter seqno)) (?c . ,(or caption ""))))) - short-caption)) + nil)) ;; short-caption ;; Case 2: Handle Label reference. (reference (let* ((fmt (cddr (assoc-string label-style org-odt-label-styles t))) @@ -2362,14 +2363,14 @@ used as a communication channel." ;; If yes, note down its contents. It will go in to frame ;; description. This quite useful for debugging. (desc (and replaces (org-element-property :value replaces))) - width height) + ) ;; width height (cond ((eq embed-as 'character) - (org-odt--render-image/formula "InlineFormula" href width height + (org-odt--render-image/formula "InlineFormula" href nil nil ;; width height nil nil title desc)) (t (let* ((equation (org-odt--render-image/formula - "CaptionedDisplayFormula" href width height + "CaptionedDisplayFormula" href nil nil ;; width height captions nil title desc)) (label (let* ((org-odt-category-map-alist diff --git a/lisp/org/ox-texinfo.el b/lisp/org/ox-texinfo.el index cf080549a6a..6e8d0d62141 100644 --- a/lisp/org/ox-texinfo.el +++ b/lisp/org/ox-texinfo.el @@ -1627,6 +1627,22 @@ Return output file's name." (org-export-to-file 'texinfo outfile async subtreep visible-only body-only ext-plist))) +(defun org-texinfo-export-to-texinfo-batch () + "Export Org file INFILE to Texinfo file OUTFILE, in batch mode. +Overwrites existing output file. +Usage: emacs -batch -f org-texinfo-export-to-texinfo-batch INFILE OUTFILE" + (or noninteractive (user-error "Batch mode use only")) + (let ((infile (pop command-line-args-left)) + (outfile (pop command-line-args-left)) + (org-export-coding-system org-texinfo-coding-system) + (make-backup-files nil)) + (unless (file-readable-p infile) + (message "File `%s' not readable" infile) + (kill-emacs 1)) + (with-temp-buffer + (insert-file-contents infile) + (org-export-to-file 'texinfo outfile)))) + ;;;###autoload (defun org-texinfo-export-to-info (&optional async subtreep visible-only body-only ext-plist) diff --git a/lisp/org/ox.el b/lisp/org/ox.el index 050a8094d07..36ecf014830 100644 --- a/lisp/org/ox.el +++ b/lisp/org/ox.el @@ -2706,9 +2706,9 @@ a list of footnote definitions or in the widened buffer." (and (or (eq (org-element-type f) 'footnote-definition) (eq (org-element-property :type f) 'inline)) (org-element-property :label f))))) - seen) + ) ;; seen (dolist (l (funcall list-labels tree)) - (cond ((member l seen)) + (cond ;; ((member l seen)) ((member l known-definitions) (push l defined)) (t (push l undefined))))) ;; Complete MISSING-DEFINITIONS by finding the definition of every |