Commit Graph

25 Commits

Author SHA1 Message Date
Stefan Monnier 6d73cd34a0 Replace all uses of the old `defadvice` with the new `advice-add`
* lisp/org.el (org-run-like-in-org-mode): Strength reduce `eval`
to `cl-progv`.
(org--check-org-structure-template-alist): Strength reduce `eval`
to `symbol-value`.
(org-map-entries, org-eval-in-calendar, org-diary-sexp-entry):
Make sure we use the new lexically scoped dialect.
(org--math-always-on): New function, extracted from advice.
(org-cdlatex-mode): Use it with `advice-add`.
(org-self-insert-command): Simplify `and`+`listp` into `consp`.
(org-submit-bug-report):
Make sure we use the new lexically scoped dialect.

* lisp/org-protocol.el (org-protocol-convert-query-to-plist):
Use `cl-mapcan`.
(org--protocol-detect-protocol-server): New function, extracted
from advice.
(server-visit-files): Use it with `advice-add`.

* lisp/org-mouse.el (org--mouse-dnd-insert-text): New function, extracted
from advice.
(dnd-insert-text): Use it with `advice-add`.
(org--mouse-dnd-open-file): New function, extracted from advice.
(dnd-open-file): Use it with `advice-add`.
(org--mouse-open-at-point): New function, extracted from advice.
(org-mode-hook): Advise `org-open-at-point` with `advice-add`.

* lisp/org-ctags.el (org--ctags-load-tag-list): New function, extracted
from advice.
(visit-tags-table): Use it with `advice-add`.
(org--ctags-set-org-mark-before-finding-tag): New function, extracted
from advice.
(xref-find-definitions): Use it with `advice-add`.

* lisp/org-compat.el (org-bookmark-jump-unhide): Accept (unused) args.
(save-place-find-file-hook): Use `advice-add`.
(org--ecb-show-context): New function, extracted from advice.
(ecb-method-clicked): Use it with `advice-add`.
(org-mark-jump-unhide): Accept (unused) args.
(pop-to-mark-command, exchange-point-and-mark, pop-global-mark):
Use `advice-add`.

Along the way, remove some redundant `:group` args
(redundant because they specify the same group as would be used by
default anyway) and make a few other simplifications.
Also don't bother putting `advice-add` within an eval-after-load
since the advice machinery already takes care of handling it.
2022-04-01 07:50:01 +02:00
Kyle Meyer 5a229cbc44 Update copyright year to 2022 2022-01-01 15:17:08 -05:00
Mattias Engdegård f771d205cc Backport commit a0854f939 from Emacs
; Fix typos in doc strings
a0854f939ce3a1de2c8cbc5e38b106a8df4480f6
Mattias Engdegård
Fri Mar 12 12:12:14 2021 +0100
2021-03-14 17:57:07 -04:00
Kyle Meyer 99eafe3787 Update copyright year to 2021 2021-01-01 14:59:01 -05:00
Stefan Kangas 47bf6005b3 Backport commit dd16e46bb from Emacs
; Prefer https to http in more URLs
dd16e46bb9d0099baea06d780ad8f62728addc2e
Stefan Kangas
Sat Oct 24 20:23:27 2020 +0200
2020-10-25 01:10:16 -04:00
Bastien 298d633222 org-tempo.el: Fix bug
* lisp/org-tempo.el (org-tempo-add-block): Remove the '>
element of the template to avoid editing the source block
while inserting it through tempo.

Thanks to Ihor and Bram for reporting this and suggesting
the proper fix.
2020-02-03 18:22:55 +01:00
Kyle Meyer ff5fc050d3 Update copyright year to 2020 2020-01-01 13:38:46 -05:00
Bastien f584d37a67 Update copyright year 2019-01-01 11:50:56 +01:00
Nicolas Goaziou 1704a25b98 org-tempo: Fix docstring
* lisp/org-tempo.el (org-tempo-keywords-alist): Fix docstring.
2018-06-14 16:39:28 +02:00
Rasmus 7ac46c52b7 Check format of org-structure-template-alist
* org.el (org--check-org-structure-template-alist): New function
  yielding user-error if using old org-structure-template-alist
  format.
  (org--insert-structure-template-mks):
* org-tempo.el (org-tempo-add-templates): Use new function
2018-05-28 23:44:51 +02:00
Bastien 4e97d8621e org-tempo.el: Enhance a few docstrings
* lisp/org-tempo.el (org-tempo, org-tempo-keywords-alist)
(org-tempo-setup, org-tempo-add-templates)
(org-tempo--include-file): Enhance docstrings.
2018-04-28 00:46:25 +02:00
Rasmus e5f6cb6c8b org-tempo: Various improvements
* lisp/org-tempo.el (org-tempo-keywords-alist): Improve docstring.
(org-tempo--update-maybe):
(org-tempo--keys): New function.
(org-tempo-complete-tag):
(org-tempo-setup):
(org-tempo-add-templates): Use new functions.
(org-tempo-add-block): Smarter position of point.
* testing/lisp/test-org-tempo.el (test-org-tempo/cursor-placement):
 (test-org-tempo/space-first-line): New tests.
* testing/lisp/test-org-tempo.el (test-org-tempo/completion): Adapt
  test to changes.

Org Tempo more carefully checks for new definitions.  When inserting
blocks point will differ depending on whether it is source block.
2018-04-08 12:47:12 +02:00
Rasmus b56df737b7 org: org-structure-template-alist uses string keys
* lisp/org-tempo.el (org-tempo-keywords-alist):
  (org-tempo-setup):
  (org-tempo-add-templates):
* testing/lisp/test-org-tempo.el (test-org-tempo/add-new-templates):
* lisp/org.el (org-structure-template-alist): Use string keys.
  (org--insert-structure-template-mks):
  (org--insert-structure-template-unique-keys): New functions for block selection.
  (org-insert-structure-template): Use new functions.
* etc/ORG-NEWS:
* doc/org-manual.org: Reflect changes.
2018-04-08 12:47:12 +02:00
Nicolas Goaziou 834f6d100b org-tempo: Require `org' 2018-03-31 08:51:10 +02:00
Nicolas Goaziou 2c93a0b2d7 org-tempo: Fix TAB behaviour
* lisp/org-tempo.el (org-tempo-complete-tag): Use a different trick to
  handle failed completions.

Reported-by: Brent Goodrick <bgoodr@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-02/msg00164.html>
2018-02-27 02:02:56 +01:00
Nicolas Goaziou da78ccc690 org-tempo: Do not activate Org Tempo in export output buffers and agenda
* lisp/org-tempo.el (b): Do not activate Org Tempo in export output
  buffers and agenda.
2018-02-11 12:06:42 +01:00
Nicolas Goaziou 6791fd29d3 org-tempo: Fix obnoxious `ding' when expanding templates
* lisp/org-tempo.el (org-tempo-complete-tag): New function.

Reported-by: Brent Goodrick <bgoodr@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-02/msg00080.html>
2018-02-11 12:03:15 +01:00
Nicolas Goaziou 878f2ae68b org-tempo: Small refactoring
* lisp/org-tempo.el (org-tempo-add-templates): Small refactoring.
2018-02-04 08:56:15 +01:00
Nicolas Goaziou a2471b1bb6 Silence byte-compiler 2018-02-04 00:51:00 +01:00
Nicolas Goaziou 222a65bdee org-tempo: Silence byte-compiler 2018-02-04 00:24:01 +01:00
Kyle Meyer 34bb61bf81 Update master-only copyright years 2018-01-07 00:28:44 -05:00
Nicolas Goaziou bbf39576f4 org-tempo: Fix typo
* lisp/org-tempo.el (org-tempo-tags): Fix typo
2017-12-14 00:25:59 +01:00
Nicolas Goaziou a34431f6ea org-tempo: Tiny refactoring
* lisp/org-tempo.el (org-tempo--include-file): Tiny refactoring.
2017-12-10 17:11:24 +01:00
Rasmus 3efb000739 org-tempo: Enable Tempo in all Org buffers after load
* lisp/org-tempo.el: Enable Org Tempo in all buffers after load.

Reported-by: Charles Berry <ccberry@ucsd.edu>
http://lists.gnu.org/archive/html/emacs-orgmode/2017-12/msg00172.html
2017-12-10 12:01:09 +01:00
Rasmus 94f1a58438 org-tempo.el: New file for expansion of templates
* lisp/org-tempo.el: New file.
* doc/org.texi (Structure templates):
* lisp/org.el (org-modules): Add org-tempo.
* testing/lisp/test-org-tempo.el: New file.
2017-12-08 00:29:08 +01:00