Commit Graph

24 Commits

Author SHA1 Message Date
Bastien c5573bdf4c Merge branch 'maint' 2021-05-25 02:13:55 +02:00
Bhavin Gandhi 37f69bf86d org-refile: Fix double slashes in the refile targets
* org-refile.el (org-refile-get-location): When we generate the `tbl'
variable, we add extra slash depending on the value of
`org-refile-use-outline-path'.  This patch updates some locations which
add another extra slash assuming the target did not have it.

`org-refile--get-location' does lookup for entries with and without
slash, so it was not causing any issues before.  It works as it is now
as well.

Thanks to Gustavo Barros for a very detailed bug report.

TINYCHANGE
2021-05-25 02:13:43 +02:00
Adam Spiers 33027f992d New command `org-refile-reverse' bound to C-c C-M-w
* lisp/org-refile.el (org-refile-reverse): New command.

* lisp/org-keys.el (org-mode-map): Bind C-c C-M-w to
`org-refile-reverse'.

* doc/org-manual.org (Refile and Copy): Document
`org-refile-reverse'.

* etc/ORG-NEWS (New command ~org-refile-reverse~ (=C-c C-M-w=)):
Announce the new command.

Link: https://orgmode.org/list/20200830001047.21362-1-orgmode@adamspiers.org/
2021-05-15 16:13:49 +02:00
satotake f00ad09e25 org-refile.el: Fix the case of emtpy buffer name
* lisp/org-refile.el (org-refile-get-targets): Ensure that the
arguments of `file-name-nondirectory' and `file-truename' are not nil.

This prevents errors from being raised when calling `org-refile' in a
buffer that is not visiting a file.

TINYCHANGE
2021-05-15 16:13:49 +02:00
satotake d285831af3 org-refile.el: Fix the case of emtpy buffer name
* lisp/org-refile.el (org-refile-get-targets): Ensure that the
arguments of `file-name-nondirectory' and `file-truename' are not nil.

This prevents errors from being raised when calling `org-refile' in a
buffer that is not visiting a file.

TINYCHANGE
2021-05-15 10:19:19 +02:00
Bastien 0f2ece647b Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
Kyle Meyer e0fb2339f4 Merge branch 'km/from-emacs-master'
Porting from Emacs's master to Org's maint branch has been on hold
leading up to the Emacs 27.2 release to avoid any required fixup syncs
carrying those commits into the emacs-27 branch.  This merge brings
those changes into master.  The km/from-emacs-master branch should be
merged to maint when Emacs 27.2 has been released (assuming Org 9.5
hasn't been released, in which case maint will be tracking 9.5.x and
already include these changes).
2021-02-14 18:06:23 -05:00
Stefan Kangas b7b52aa888 Backport commit ce35760b1 from Emacs
; Minor license statement fixes
ce35760b19315b634e62e2c64988018189dcdbdc
Stefan Kangas
Mon Feb 8 09:10:57 2021 +0100
2021-02-14 17:38:07 -05:00
Kyle Meyer 5b5c420da5 Merge branch 'maint' 2021-01-07 00:14:37 -05:00
Kyle Meyer 33de2bd8ef org-compat: Take in obsolete org-copy
* lisp/org-compat.el (org-copy): Move from org-refile.el.
* lisp/org-refile.el (org-copy): Move to org-compat.el.

Suggested-by: Marco Wahl <marcowahlsoft@gmail.com>
Ref: https://orgmode.org/list/87o8i2cpb2.fsf@gmail.com
2021-01-07 00:14:27 -05:00
Stefan Monnier 248dfcd711 Backport commit 5ada3eece from Emacs
* lisp/org-refile.el (org-copy): Fix missing obsoletion version.

5ada3eecec79703a84e2f2c38cae16ef4b2600cc
Stefan Monnier
Thu Dec 17 18:21:47 2020 -0500
2021-01-07 00:13:50 -05:00
Kyle Meyer 291993888d Merge branch 'maint' 2021-01-01 15:02:10 -05:00
Kyle Meyer 99eafe3787 Update copyright year to 2021 2021-01-01 14:59:01 -05:00
Kyle Meyer e04aa83309 refile: Update remaining spots that use obsolete org-copy
* lisp/org-refile.el (org-refile): Update docstring to refer to
org-refile-copy rather than obsolete alias org-copy.
2020-12-10 00:49:15 -05:00
Kevin J. Foley 2d1e2606e7 org-refile.el (org-refile): Add description of RFLOC to docstring
* lisp/org-refile.el (org-refile): Document structure of RFLOC
parameter.
2020-10-20 00:35:10 -04:00
Kyle Meyer 3c31941139 Fix loading issues related to org-refile.el move
* lisp/org-refile.el (org-directory):
(org-default-notes-file):
(org-reverse-note-order):
(org-outline-path-cache):
(org--get-outline-path-1):
(org-get-outline-path):
(org-format-outline-path):
(org-display-outline-path): Move back to org.el.
* lisp/org-id.el: Require org-refile.
* lisp/org-refile.el: Require org.

f636cf91b (New org-refile.el file with refile definitions, 2020-02-05)
moved refile-related code into a new file, org-refile.el.  This
introduced several dependency issues, which can be seen by running
`make single'.

Many of these issues could be solved by loading org.el in
org-refile.el and loading org-refile in several libraries that depend
on moved functionality.  However, there would still be a circular
dependency because org.el depends on three variables now defined in
org-refile.el.  Also, conceptually there is the problem that the
outline path functionality, despite being used primarily for refile
internally, is now used more generally in third-party code and in a
couple of spots within this repo.

Resolve the above situation by moving the three org-refile.el
variables that org.el needs and the outline path bits back to org.el.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<CAFyQvY1VR5t_a=JO01+QWbUQk_9i8+2XG6W2-mg-DpFzjz9seg@mail.gmail.com>

Reported-by: Ihor Radchenko <yantar92@gmail.com>
<878sj74lfp.fsf@localhost>

Reported-by: Ryan C. Thompson <rct@thompsonclan.org>
<8861c9e9-6c19-ea8f-6a90-7a466782096f@thompsonclan.org>
2020-04-26 01:29:33 -04:00
Bastien fae16ed8f5 Add `generated-autoload-file' buffer local variable
* lisp/org.el:
* lisp/org-num.el:
* lisp/org-macs.el:
* lisp/org-list.el:
* lisp/org-lint.el:
* lisp/org-keys.el:
* lisp/org-goto.el:
* lisp/org-duration.el:
* lisp/org-compat.el:
* lisp/org-colview.el:
* lisp/org-capture.el:
* lisp/org-agenda.el:
* lisp/ol.el: Add `generated-autoload-file' buffer local variable.

This is needed when compiling Org files within GNU Emacs.
2020-02-18 23:37:24 +01:00
Bastien 273a7775cd Various minor fixes
* mk/eldo.el: Update copyright year and fix formatting.

* lisp/ox-man.el: Don't set generated-autoload-file as a
buffer local variable.

* lisp/org-refile.el: Place ;;;###autoload correctly.

* lisp/ob-lilypond.el (org-babel-lilypond-switch-extension):
Formatting fix.
2020-02-18 23:24:09 +01:00
Bastien 6a1f6ee1f8 Tiny formatting fixes
* lisp/ox.el (org-export-table-dimensions):
* lisp/ox-texinfo.el (org-texinfo-template):
* lisp/ox-md.el (org-md-link):
* lisp/ox-icalendar.el (org-icalendar-use-UTC-date-time-p):
* lisp/ox-ascii.el (org-ascii-fixed-width):
* lisp/org.el (org-context):
* lisp/org-table.el (org-table-eval-formula)
(org-table-export):
* lisp/org-refile.el:
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data):
* lisp/org-num.el (org-num):
* lisp/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org-macro.el (org-macro):
* lisp/org-lint.el (org-lint):
* lisp/org-keys.el (org-keys):
* lisp/org-duration.el:
* lisp/org-clock.el (org-clock-get-last-clock-out-time)
(org-clock-update-mode-line, org-find-open-clocks):
* lisp/org-agenda.el (org-diary)
(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)
(org-agenda-highlight-todo, org-cmp-alpha)
(org-agenda-filter-by-category):
* lisp/ol.el (org-link-expand-abbrev, ol):
* lisp/ol-docview.el (ol-docview):
* lisp/ol-bibtex.el (org-execute-file-search-in-bibtex)
(org-bibtex, org-bibtex-read):
* lisp/ol-bbdb.el (org-bbdb-anniversary-description):
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org):
* lisp/ob-table.el (org-babel-table-truncate-at-newline):
* lisp/ob-stan.el:
* lisp/ob-sqlite.el (org-babel-sqlite-table-or-scalar):
* lisp/ob-sql.el:
* lisp/ob-shen.el:
* lisp/ob-shell.el (org-babel-prep-session:shell)
(org-babel-prep-session:shell):
* lisp/ob-sed.el (org-babel-execute:sed)
(org-babel-execute:sed):
* lisp/ob-screen.el:
* lisp/ob-sass.el:
* lisp/ob-ruby.el (org-babel-prep-session:ruby)
(org-babel-prep-session:ruby):
* lisp/ob-ref.el (org-babel-ref-resolve, ob-ref):
* lisp/ob-python.el (org-babel-prep-session:python)
(org-babel-prep-session:python):
* lisp/ob-plantuml.el:
* lisp/ob-picolisp.el:
* lisp/ob-perl.el:
* lisp/ob-org.el:
* lisp/ob-octave.el (org-babel-prep-session:octave)
(org-babel-prep-session:octave)
(org-babel-octave-evaluate-session):
* lisp/ob-ocaml.el:
* lisp/ob-mscgen.el (org-babel-execute:mscgen)
(org-babel-execute:mscgen):
* lisp/ob-maxima.el:
(ob-maxima):
* lisp/ob-matlab.el:
* lisp/ob-makefile.el:
* lisp/ob-lua.el (org-babel-prep-session:lua)
(org-babel-prep-session:lua):
* lisp/ob-lisp.el:
* lisp/ob-ledger.el:
* lisp/ob-latex.el (org-babel-expand-body:latex)
(org-babel-expand-body:latex, ob-latex):
* lisp/ob-js.el:
* lisp/ob-java.el:
* lisp/ob-io.el (org-babel-prep-session:io)
(org-babel-prep-session:io):
* lisp/ob-hledger.el:
* lisp/ob-haskell.el:
* lisp/ob-groovy.el (org-babel-groovy-wrapper-method)
(org-babel-groovy-evaluate):
* lisp/ob-gnuplot.el:
* lisp/ob-fortran.el (org-babel-expand-body:fortran)
(org-babel-expand-body:fortran):
* lisp/ob-forth.el (org-babel-forth-session-execute):
* lisp/ob-exp.el (ob-exp):
* lisp/ob-eval.el:
* lisp/ob-emacs-lisp.el:
* lisp/ob-ebnf.el:
* lisp/ob-dot.el:
* lisp/ob-ditaa.el:
* lisp/ob-css.el:
* lisp/ob-core.el (org-babel-put-rownames):
* lisp/ob-coq.el:
* lisp/ob-comint.el:
* lisp/ob-calc.el:
* lisp/ob-awk.el:
* lisp/ob-asymptote.el:
* lisp/ob-abc.el:
* lisp/ob-R.el (org-babel-prep-session:R): Formatting fixes.
2020-02-18 22:57:37 +01:00
Bastien 937ac9b777 lisp/org-refile.el (org-refile-get-location): Small refactoring
* lisp/org-refile.el (org-refile-get-location): Small refactoring.
2020-02-13 11:44:10 +01:00
Bastien da97799a1d org-refile.el: Fix commit 63fd0c09ca
* lisp/org-refile.el (org-refile-get-location): Set
`org-refile-history' correctly.
2020-02-13 08:45:01 +01:00
Bastien 63fd0c09ca org-refile.el: Small refactoring, fix a minor bug
* lisp/org-refile.el (org-refile-get-location): Small
refactoring and fix a minor bug, duplicating refile targets
available for completion.

Thanks to Gustavo Barros for the detailed explanations about
this bug.
2020-02-13 00:28:51 +01:00
Bastien b694c2fd7a Fix org menu initialization
* lisp/org-mobile.el: Add mobile commands to org menu.

* lisp/org-refile.el: Add refile commands to org menu.

* lisp/org.el (org-mode): Remove `org-menu-define'.
(org-org-menu): Delete.
2020-02-07 16:26:31 +01:00
Bastien f636cf91b6 New org-refile.el file with refile definitions
* lisp/org-refile.el: New file.

* lisp/org.el (org-refile, org-directory)
(org-default-notes-file, org-reverse-note-order)
(org-log-refile, org-refile-targets)
(org-refile-target-verify-function, org-refile-use-cache)
(org-refile-use-outline-path)
(org-outline-path-complete-in-steps)
(org-refile-allow-creating-parent-nodes)
(org-refile-active-region-within-subtree)
(org-refile-target-table, org-refile-cache)
(org-refile-markers, org-refile-marker)
(org-refile-cache-clear, org-refile-cache-check-set)
(org-refile-cache-put, org-refile-cache-get)
(org-outline-path-cache, org-refile-get-targets)
(org--get-outline-path-1, org-get-outline-path)
(org-format-outline-path, org-display-outline-path)
(org-refile-history, org-after-refile-insert-hook)
(org-capture-last-stored-marker, org-refile-keep, org-copy)
(org-refile, org-refile-goto-last-stored)
(org-refile--get-location, org-refile-get-location)
(org-refile-check-position, org-refile-new-child)
(org-olpath-completing-read): Move to org-refile.el.
(org-menu-define): Display Org refile comands only when
'org-refile is featured.

* lisp/org-keys.el (org-refile-copy, org-mode-map): Declare
functions.

* lisp/org-capture.el: Require 'org-refile.

* lisp/org-agenda.el: Require 'org-refile.
2020-02-05 15:34:06 +01:00