aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMountain Man <43313373+MountainMan1312@users.noreply.github.com>2023-11-21 01:44:32 -0500
committerMountain Man <43313373+MountainMan1312@users.noreply.github.com>2023-11-21 01:44:32 -0500
commit8a0aaca5c969eb33f01f3cb54803bc30a1ba5c87 (patch)
tree707cd9c2f748b45b50de156ea7a0890661816893
parentSet keybind for pdf-occur (diff)
downloadmmosmacs-8a0aaca5c969eb33f01f3cb54803bc30a1ba5c87.tar.gz
mmosmacs-8a0aaca5c969eb33f01f3cb54803bc30a1ba5c87.tar.bz2
mmosmacs-8a0aaca5c969eb33f01f3cb54803bc30a1ba5c87.zip
Undo commit a few commits back, or maybe just get rid of most of it
-rw-r--r--init.el121
1 files changed, 0 insertions, 121 deletions
diff --git a/init.el b/init.el
index a213686..d8ddbcf 100644
--- a/init.el
+++ b/init.el
@@ -1269,127 +1269,6 @@
1269 :todo "NEXT") 1269 :todo "NEXT")
1270 (:discard (:anything t))))))))))) 1270 (:discard (:anything t)))))))))))
1271 1271
1272;; Make all time-grid entries, including ones from :LOGBOOK:, look the same
1273(defun org-agenda-get-progress ()
1274 "Return the logged TODO entries for agenda display."
1275 (with-no-warnings (defvar date))
1276 (let* ((props (list 'mouse-face 'highlight
1277 'org-not-done-regexp org-not-done-regexp
1278 'org-todo-regexp org-todo-regexp
1279 'org-complex-heading-regexp org-complex-heading-regexp
1280 'help-echo
1281 (format "mouse-2 or RET jump to org file %s"
1282 (abbreviate-file-name buffer-file-name))))
1283 (items (if (consp org-agenda-show-log-scoped)
1284 org-agenda-show-log-scoped
1285 (if (eq org-agenda-show-log-scoped 'clockcheck)
1286 '(clock)
1287 org-agenda-log-mode-items)))
1288 (parts
1289 (delq nil
1290 (list
1291 (when (memq 'closed items) (concat "\\<" org-closed-string))
1292 (when (memq 'clock items) (concat "\\<" org-clock-string))
1293 (when (memq 'state items)
1294 (format "- +State \"%s\".*?" org-todo-regexp)))))
1295 (parts-re (if parts (mapconcat #'identity parts "\\|")
1296 (error "`org-agenda-log-mode-items' is empty")))
1297 (regexp (concat
1298 "\\(" parts-re "\\)"
1299 " *\\["
1300 (regexp-quote
1301 (substring
1302 (format-time-string
1303 (org-time-stamp-format)
1304 (org-encode-time ; DATE bound by calendar
1305 0 0 0 (nth 1 date) (car date) (nth 2 date)))
1306 1 11))))
1307 (org-agenda-search-headline-for-time nil)
1308 marker hdmarker priority category level tags closedp type
1309 statep clockp state ee txt extra timestr rest clocked inherited-tags
1310 effort effort-minutes)
1311 (goto-char (point-min))
1312 (while (re-search-forward regexp nil t)
1313 (catch :skip
1314 (org-agenda-skip)
1315 (setq marker (org-agenda-new-marker (match-beginning 0))
1316 closedp (equal (match-string 1) org-closed-string)
1317 statep (equal (string-to-char (match-string 1)) ?-)
1318 clockp (not (or closedp statep))
1319 state (and statep (match-string 2))
1320 category (org-get-category (match-beginning 0))
1321 timestr (buffer-substring (match-beginning 0) (line-end-position))
1322 effort (save-match-data (or (get-text-property (point) 'effort)
1323 (org-entry-get (point) org-effort-property))))
1324 (setq effort-minutes (when effort (save-match-data (org-duration-to-minutes effort))))
1325 (when (string-match "\\]" timestr)
1326 ;; substring should only run to end of time stamp
1327 (setq rest (substring timestr (match-end 0))
1328 timestr (substring timestr 0 (match-end 0)))
1329 (if (and (not closedp) (not statep)
1330 (string-match "\\([0-9]\\{1,2\\}:[0-9]\\{2\\}\\)\\].*?\\([0-9]\\{1,2\\}:[0-9]\\{2\\}\\)"
1331 rest))
1332 (progn (setq timestr (concat (substring timestr 0 -1)
1333 "-" (match-string 1 rest) "]"))
1334 (setq clocked (match-string 2 rest)))
1335 ;; THIS IS CHANGED from a single dash "-" to "CLOCKED"
1336 (setq clocked "CLOCKED")))
1337 (save-excursion
1338 (setq extra
1339 (cond
1340 ((not org-agenda-log-mode-add-notes) nil)
1341 (statep
1342 (and (looking-at ".*\\\\\n[ \t]*\\([^-\n \t].*?\\)[ \t]*$")
1343 (match-string 1)))
1344 (clockp
1345 (and (looking-at ".*\n[ \t]*-[ \t]+\\([^-\n \t].*?\\)[ \t]*$")
1346 (match-string 1)))))
1347 (if (not (re-search-backward org-outline-regexp-bol nil t))
1348 (throw :skip nil)
1349 (goto-char (match-beginning 0))
1350 (setq hdmarker (org-agenda-new-marker)
1351 inherited-tags
1352 (or (eq org-agenda-show-inherited-tags 'always)
1353 (and (listp org-agenda-show-inherited-tags)
1354 (memq 'todo org-agenda-show-inherited-tags))
1355 (and (eq org-agenda-show-inherited-tags t)
1356 (or (eq org-agenda-use-tag-inheritance t)
1357 (memq 'todo org-agenda-use-tag-inheritance))))
1358 tags (org-get-tags nil (not inherited-tags))
1359 level (make-string (org-reduced-level (org-outline-level)) ? ))
1360 (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
1361 (setq txt (match-string 1))
1362 ;; MAYBE DELETE NEXT 5 LINES
1363 (when extra
1364 (if (string-match "\\([ \t]+\\)\\(:[^ \n\t]*?:\\)[ \t]*$" txt)
1365 (setq txt (concat (substring txt 0 (match-beginning 1))
1366 " - " extra " " (match-string 2 txt)))
1367 (setq txt (concat txt " - " extra))))
1368 (setq txt (org-agenda-format-item
1369 (cond
1370 ;; CHANGES ARE HERE
1371 (closedp (concat "Closed: " "CLOSED" (spaces-string 6)))
1372 (statep (concat "State: " state (spaces-string (- 12 (length state)))))
1373 (t (concat "Clocked: " clocked (spaces-string (- 12 (length clocked))))))
1374 ;; END CHANGES
1375 (org-add-props txt nil
1376 'effort effort
1377 'effort-minutes effort-minutes)
1378 level category tags timestr)))
1379 (setq type (cond (closedp "closed")
1380 (statep "state")
1381 (t "clock")))
1382 (setq priority 100000)
1383 (org-add-props txt props
1384 'org-marker marker 'org-hd-marker hdmarker 'face 'org-agenda-done
1385 'urgency priority 'priority priority 'level level
1386 'effort effort 'effort-minutes effort-minutes
1387 'type type 'date date
1388 'undone-face 'org-warning 'done-face 'org-agenda-done)
1389 (push txt ee))
1390 (goto-char (line-end-position))))
1391 (nreverse ee)))
1392
1393;; Update agenda periodically every `mm/refresh-agenda-time-seconds' seconds. 1272;; Update agenda periodically every `mm/refresh-agenda-time-seconds' seconds.
1394;; This was taken from https://emacs.stackexchange.com/a/68767/38877 1273;; This was taken from https://emacs.stackexchange.com/a/68767/38877
1395;; (defvar mm/refresh-agenda-time-seconds 15) 1274;; (defvar mm/refresh-agenda-time-seconds 15)