summaryrefslogtreecommitdiff
path: root/modules/org-webclipper.el
Commit message (Collapse)AuthorAgeFilesLines
* refactor(webclipper): scope clip URL/title to dynamic bindingsCraig Jennings13 days1-16/+19
| | | | | | org-webclipper passed the org-protocol URL and title through globals cj/webclip-current-url / cj/webclip-current-title: the protocol handler setq them, and the "W" capture template plus its handler read them, with the handler clearing them afterward. An aborted or erroring capture left the stale values for the next clip. Renamed them to cj/--webclip-url / cj/--webclip-title and let-bind them around the org-capture call in the protocol entry point instead of mutating globals. The template %(identity ...) forms and the handler run within that dynamic extent, so they see the values while the capture runs, and an abort/error unwinds the binding automatically — no stale state, no manual clear. This mirrors the quick-video-capture fix. Tests updated to the new contract: URL/title visible during the capture, nothing left bound after, and an aborted capture leaves no stale state.
* refactor(org-workflow): four hygiene fixes from the module-by-module re-reviewCraig Jennings2026-05-161-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - org-roam-config.el: extract `cj/--org-roam-should-copy-completed-task-p' and gate the `org-after-todo-state-change-hook' on it. Skips fileless buffers (org-capture, indirect, temp Org) where `buffer-file-name' is nil and the downstream copy used to crash. Same gcal.org skip preserved. Five existing tests updated to bind `buffer-file-name' inside `run-hooks' so the positive-case hook still fires. - org-webclipper.el: drop the redundant `org-protocol-protocol-alist' registration inside `cj/webclipper-ensure-initialized'. The `with-eval-after-load 'org-protocol' block at the bottom of the module is the single registration site now; comment in the initializer explains why. Split the matching test into two: one for template registration (the initializer's actual job) and one for protocol registration (which now fires from the after-load block when `org-protocol' provides). - org-webclipper.el: validate `:url' and `:title' in `cj/org-protocol-webclip'. `:url' must be a non-empty string; `:title' must be a string when provided. Signals `user-error' with the unexpected value instead of silently setting the globals to nil and failing downstream in the capture handler. - mu4e-org-contacts-integration.el: declare `contacts-file' (via `eval-when-compile (defvar ...)') and `cj/get-all-contact-emails' (via `declare-function') near the top of the file. Byte-compile in isolation no longer warns about free variables / unknown functions; the cross-module dependency is explicit at the top.
* refactor(org-webclipper): use setq, not setopt, for pandoc sleep timeCraig Jennings2026-05-151-2/+8
| | | | | | | | | | | | | | | | | | | `org-web-tools-pandoc-sleep-time' is a plain float with no custom-set handler that needs to fire. `setopt' adds the entire customize-variable validation machinery -- which, lazily, depends on wid-edit being loaded. The handler's tests stub `require' so org-web-tools never really loads, then mock `setopt' via `cl-letf' on the function cell. That mock has no effect on byte-compiled code because `setopt' is a macro: the production handler has already expanded to a call into `setopt--set'. When `setopt--set' runs, it walks into the customize machinery and hits an unbound `widget-field-keymap' (wid-edit not loaded), and the test fails with a confusing wrong-type-argument. `setq' has identical runtime effect for this variable and dodges the customize machinery entirely. Tests now pass without contorted mocking.
* feat:org-webclipper: Add smart heading adjustmentCraig Jennings2025-10-261-17/+29
| | | | | | | Introduce `cj/--process-webclip-content` to enhance webclip processing by removing the first heading and demoting subsequent headings, preserving page structure. Includes tests for thorough validation of the new functionality.
* fix:webclipper:fixed org-web-tools not loading when neededCraig Jennings2025-10-261-25/+9
|
* maint: org-roam: moved org-branch-to-org-roam-node from webclipperCraig Jennings2025-10-181-90/+0
|
* no need to define keymap for webclipperCraig Jennings2025-10-151-11/+13
|
* feat: webclipper): Add web clipping with org-protocol integrationCraig Jennings2025-10-121-107/+268
| | | | | | | - Reworked the org-webclipper.el module to support a "fire-and-forget" workflow using org-protocol and org-web-tools. - Added feature to handle web clipping directly from the browser with a bookmarklet, converting content to Org format using Pandoc. - New functions ensure lazy loading of necessary packages and setup of capture templates. - Enhanced keymap setup to integrate with custom keymaps, facilitating easier user interaction.
* changing repositoriesCraig Jennings2025-10-121-0/+145