From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Holst Subject: Re: [gnorb] completion for `gnorb-gnus-incoming-do-todo' Date: Sun, 16 Aug 2015 16:37:38 +0200 Message-ID: <87si7jfgel@gmx.de> References: <87io8ksnix@gmx.de> <8737zosjan.fsf@ericabrahamsen.net> <87wpwzmbb3@gmx.de> <87k2sxxir6.fsf@ericabrahamsen.net> <87pp2o1sbb@gmx.de> <877fovvqh9.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=Multipart0o0o0o0o0o0o0o" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQz4H-0000Xl-U7 for emacs-orgmode@gnu.org; Sun, 16 Aug 2015 10:37:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZQz4C-00080b-Ql for emacs-orgmode@gnu.org; Sun, 16 Aug 2015 10:37:49 -0400 Received: from mout.gmx.net ([212.227.17.20]:51575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQz4C-00080X-Du for emacs-orgmode@gnu.org; Sun, 16 Aug 2015 10:37:44 -0400 In-Reply-To: <877fovvqh9.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 16 Aug 2015 11:53:22 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Abrahamsen Cc: org mode mailing list --=Multipart0o0o0o0o0o0o0o Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit · Eric Abrahamsen wrote: >> >> [ ... snip ... ] >> >> [ ... snip completion issue with gnorb ... ] > > No worries, glad it's sorted! > >> But maybe someone can give me a hint how to get helm working here. >> >> As mentioned above I have >> >> #+begin_src emacs_lisp >> (setq org-refile-use-outline-path 'file) >> #+end_src >> >> Because I can travel along the path in steps >> >> file >> 1. Heading >> ... >> n. heading >> >> with completion working for each step. With helm enabled for `org-goto' >> and `org-refile' I see canditates for completion, but neither nor >> M-j have any effect. Minibuffer does not change. When I set >> `org-refile-use-outline-path' to nil, I get tons of candidates for >> completion but has also no effect. And if I hit with an >> incomplete input I get an error. This behaviour was the reason why I >> disabled helm for `org-refile' and `org-goto' to begin with. >> >> So has anyone helm working for `org-refile' and `org-goto'? I would >> appreciate any help here. Thanks. > > It works fine here! Have you started from "emacs -Q"? That's usually the > best first step. ok here is what I did to reproduce behavior with ECM emacs -Q -l "minimal.el" with minimal.el: #+begin_src emacs_lisp ;; minimal.el to test org-refile helm ;; most recent org-mode from git (add-to-list 'load-path "/home/thommy/git-emacs/org-mode/lisp") (require 'org) (setq org-use-speed-commands t) ;; `g' on begining of heading calls `(org-refile t)' (setq org-refile-use-outline-path 'file) (find-file "/home/thommy/git-emacs/gnorb/gnorb.org") ;; just any org-file works ;; most recent helm from git (add-to-list 'load-path "~/git-emacs/helm") (require 'helm-config) (helm-mode 1) #+end_src Now when I hit `g' at begining of a headline I get "gnorb.org" as a candidate for first step. But no key (, C - i, C - z) does completion. If I hit with partial or complete input for first step (e.g. "gn" or "gnorb.org") I get an error: progn: Wrong type argument: integer-or-marker-p, nil Backtrace: --=Multipart0o0o0o0o0o0o0o Content-Type: text/plain Content-Disposition: inline; filename=backtace Content-Transfer-Encoding: quoted-printable Content-Description: backtrace Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) goto-char(nil) (progn (org-pop-to-buffer-same-window nbuf) (goto-char pos) (org-show-con= text (quote org-goto))) (if (and arg (not (equal arg 3))) (progn (org-pop-to-buffer-same-window n= buf) (goto-char pos) (org-show-context (quote org-goto))) (if regionp (prog= n (org-kill-new (buffer-substring region-start region-end)) (org-save-marke= rs-in-region region-start region-end)) (org-copy-subtree 1 nil t)) (save-cu= rrent-buffer (set-buffer (setq nbuf (or (find-buffer-visiting file) (find-f= ile-noselect file)))) (setq reversed (org-notes-order-reversed-p)) (save-ex= cursion (save-restriction (widen) (if pos (progn (goto-char pos) (looking-a= t org-outline-regexp) (setq level (org-get-valid-level ... 1)) (goto-char (= if reversed ... ...))) (setq level 1) (if (not reversed) (goto-char (point-= max)) (goto-char (point-min)) (or (outline-next-heading) (goto-char ...))))= (if (not (bolp)) (newline)) (org-paste-subtree level nil nil t) (if org-lo= g-refile (progn (org-add-log-setup (quote refile) nil nil (quote findpos) o= rg-log-refile) (if (eq org-log-refile ...) nil (save-excursion ...)))) (and= org-auto-align-tags (let ((org-loop-over-headlines-in-active-region nil)) = (org-set-tags nil t))) (let ((bookmark-name (plist-get org-bookmark-names-p= list :last-refile))) (if bookmark-name (progn (condition-case err ... ...))= )) (if (and (boundp (quote org-refile-for-capture)) org-refile-for-capture)= (progn (let (...) (if bookmark-name ...)) (move-marker org-capture-last-st= ored-marker (point)))) (if (fboundp (quote deactivate-mark)) (deactivate-ma= rk)) (run-hooks (quote org-after-refile-insert-hook))))) (if org-refile-kee= p nil (if regionp (delete-region (point) (+ (point) (- region-end region-st= art))) (delete-region (and (org-back-to-heading t) (point)) (min (1+ (buffe= r-size)) (org-end-of-subtree t t) (point))))) (if (featurep (quote org-inli= netask)) (progn (org-inlinetask-remove-END-maybe))) (setq org-markers-to-mo= ve nil) (message (concat actionmsg " to \"%s\" in file %s: done") (car it) = file)) (progn (setq file (nth 1 it) re (nth 2 it) pos (nth 3 it)) (if (and (not = arg) pos (equal (buffer-file-name) file) (if regionp (and (>=3D pos region-= start) (<=3D pos region-end)) (and (>=3D pos (point)) (< pos (save-excursio= n (org-end-of-subtree t t)))))) (error "Cannot refile to position inside th= e tree or region")) (setq nbuf (or (find-buffer-visiting file) (find-file-n= oselect file))) (if (and arg (not (equal arg 3))) (progn (org-pop-to-buffer= -same-window nbuf) (goto-char pos) (org-show-context (quote org-goto))) (if= regionp (progn (org-kill-new (buffer-substring region-start region-end)) (= org-save-markers-in-region region-start region-end)) (org-copy-subtree 1 ni= l t)) (save-current-buffer (set-buffer (setq nbuf (or (find-buffer-visiting= file) (find-file-noselect file)))) (setq reversed (org-notes-order-reverse= d-p)) (save-excursion (save-restriction (widen) (if pos (progn (goto-char p= os) (looking-at org-outline-regexp) (setq level ...) (goto-char ...)) (setq= level 1) (if (not reversed) (goto-char ...) (goto-char ...) (or ... ...)))= (if (not (bolp)) (newline)) (org-paste-subtree level nil nil t) (if org-lo= g-refile (progn (org-add-log-setup ... nil nil ... org-log-refile) (if ... = nil ...))) (and org-auto-align-tags (let (...) (org-set-tags nil t))) (let = ((bookmark-name ...)) (if bookmark-name (progn ...))) (if (and (boundp ...)= org-refile-for-capture) (progn (let ... ...) (move-marker org-capture-last= -stored-marker ...))) (if (fboundp (quote deactivate-mark)) (deactivate-mar= k)) (run-hooks (quote org-after-refile-insert-hook))))) (if org-refile-keep= nil (if regionp (delete-region (point) (+ (point) (- region-end region-sta= rt))) (delete-region (and (org-back-to-heading t) (point)) (min (1+ (buffer= -size)) (org-end-of-subtree t t) (point))))) (if (featurep (quote org-inlin= etask)) (progn (org-inlinetask-remove-END-maybe))) (setq org-markers-to-mov= e nil) (message (concat actionmsg " to \"%s\" in file %s: done") (car it) f= ile))) (if (or (and (equal arg 2) org-clock-hd-marker (marker-buffer org-clock-h= d-marker) (prog1 (setq it (list (or org-clock-heading "running clock") (buf= fer-file-name (marker-buffer org-clock-hd-marker)) "" (marker-position org-= clock-hd-marker))) (setq arg nil))) (setq it (or rfloc (let (heading-text) = (save-excursion (if (and arg ...) nil (org-back-to-heading t) (setq heading= -text ...)) (org-refile-get-location (cond ... ... ...) default-buffer (and= ... org-refile-allow-creating-parent-nodes) arg)))))) (progn (setq file (n= th 1 it) re (nth 2 it) pos (nth 3 it)) (if (and (not arg) pos (equal (buffe= r-file-name) file) (if regionp (and (>=3D pos region-start) (<=3D pos regio= n-end)) (and (>=3D pos (point)) (< pos (save-excursion ...))))) (error "Can= not refile to position inside the tree or region")) (setq nbuf (or (find-bu= ffer-visiting file) (find-file-noselect file))) (if (and arg (not (equal ar= g 3))) (progn (org-pop-to-buffer-same-window nbuf) (goto-char pos) (org-sho= w-context (quote org-goto))) (if regionp (progn (org-kill-new (buffer-subst= ring region-start region-end)) (org-save-markers-in-region region-start reg= ion-end)) (org-copy-subtree 1 nil t)) (save-current-buffer (set-buffer (set= q nbuf (or (find-buffer-visiting file) (find-file-noselect file)))) (setq r= eversed (org-notes-order-reversed-p)) (save-excursion (save-restriction (wi= den) (if pos (progn ... ... ... ...) (setq level 1) (if ... ... ... ...)) (= if (not ...) (newline)) (org-paste-subtree level nil nil t) (if org-log-ref= ile (progn ... ...)) (and org-auto-align-tags (let ... ...)) (let (...) (if= bookmark-name ...)) (if (and ... org-refile-for-capture) (progn ... ...)) = (if (fboundp ...) (deactivate-mark)) (run-hooks (quote org-after-refile-ins= ert-hook))))) (if org-refile-keep nil (if regionp (delete-region (point) (+= (point) (- region-end region-start))) (delete-region (and (org-back-to-hea= ding t) (point)) (min (1+ ...) (org-end-of-subtree t t) (point))))) (if (fe= aturep (quote org-inlinetask)) (progn (org-inlinetask-remove-END-maybe))) (= setq org-markers-to-move nil) (message (concat actionmsg " to \"%s\" in fil= e %s: done") (car it) file)))) (if (equal arg (quote (16))) (org-refile-goto-last-stored) (if (or (and (= equal arg 2) org-clock-hd-marker (marker-buffer org-clock-hd-marker) (prog1= (setq it (list (or org-clock-heading "running clock") (buffer-file-name ..= .) "" (marker-position org-clock-hd-marker))) (setq arg nil))) (setq it (or= rfloc (let (heading-text) (save-excursion (if ... nil ... ...) (org-refile= -get-location ... default-buffer ... arg)))))) (progn (setq file (nth 1 it)= re (nth 2 it) pos (nth 3 it)) (if (and (not arg) pos (equal (buffer-file-n= ame) file) (if regionp (and (>=3D pos region-start) (<=3D pos region-end)) = (and (>=3D pos ...) (< pos ...)))) (error "Cannot refile to position inside= the tree or region")) (setq nbuf (or (find-buffer-visiting file) (find-fil= e-noselect file))) (if (and arg (not (equal arg 3))) (progn (org-pop-to-buf= fer-same-window nbuf) (goto-char pos) (org-show-context (quote org-goto))) = (if regionp (progn (org-kill-new (buffer-substring region-start region-end)= ) (org-save-markers-in-region region-start region-end)) (org-copy-subtree 1= nil t)) (save-current-buffer (set-buffer (setq nbuf (or ... ...))) (setq r= eversed (org-notes-order-reversed-p)) (save-excursion (save-restriction (wi= den) (if pos ... ... ...) (if ... ...) (org-paste-subtree level nil nil t) = (if org-log-refile ...) (and org-auto-align-tags ...) (let ... ...) (if ...= ...) (if ... ...) (run-hooks ...)))) (if org-refile-keep nil (if regionp (= delete-region (point) (+ ... ...)) (delete-region (and ... ...) (min ... ..= . ...)))) (if (featurep (quote org-inlinetask)) (progn (org-inlinetask-remo= ve-END-maybe))) (setq org-markers-to-move nil) (message (concat actionmsg "= to \"%s\" in file %s: done") (car it) file))))) (let* ((actionmsg (cond (msg msg) ((equal arg 3) "Refile (and keep)") (t = "Refile"))) (cbuf (current-buffer)) (regionp (org-region-active-p)) (region= -start (and regionp (region-beginning))) (region-end (and regionp (region-e= nd))) (filename (buffer-file-name (buffer-base-buffer cbuf))) (org-refile-k= eep (if (equal arg 3) t org-refile-keep)) pos it nbuf file re level reverse= d) (setq last-command nil) (if regionp (progn (goto-char region-start) (or = (bolp) (goto-char (point-at-bol))) (setq region-start (point)) (if (or (org= -kill-is-subtree-p (buffer-substring region-start region-end)) (prog1 org-r= efile-active-region-within-subtree (let (...) (org-toggle-heading) (setq re= gion-end ...)))) nil (user-error "The region is not a (sequence of) subtree= (s)")))) (if (equal arg (quote (16))) (org-refile-goto-last-stored) (if (or= (and (equal arg 2) org-clock-hd-marker (marker-buffer org-clock-hd-marker)= (prog1 (setq it (list ... ... "" ...)) (setq arg nil))) (setq it (or rfloc= (let (heading-text) (save-excursion ... ...))))) (progn (setq file (nth 1 = it) re (nth 2 it) pos (nth 3 it)) (if (and (not arg) pos (equal (buffer-fil= e-name) file) (if regionp (and ... ...) (and ... ...))) (error "Cannot refi= le to position inside the tree or region")) (setq nbuf (or (find-buffer-vis= iting file) (find-file-noselect file))) (if (and arg (not (equal arg 3))) (= progn (org-pop-to-buffer-same-window nbuf) (goto-char pos) (org-show-contex= t (quote org-goto))) (if regionp (progn (org-kill-new ...) (org-save-marker= s-in-region region-start region-end)) (org-copy-subtree 1 nil t)) (save-cur= rent-buffer (set-buffer (setq nbuf ...)) (setq reversed (org-notes-order-re= versed-p)) (save-excursion (save-restriction ... ... ... ... ... ... ... ..= . ... ...))) (if org-refile-keep nil (if regionp (delete-region ... ...) (d= elete-region ... ...))) (if (featurep (quote org-inlinetask)) (progn (org-i= nlinetask-remove-END-maybe))) (setq org-markers-to-move nil) (message (conc= at actionmsg " to \"%s\" in file %s: done") (car it) file)))))) (if (member arg (quote (0 (64)))) (org-refile-cache-clear) (let* ((action= msg (cond (msg msg) ((equal arg 3) "Refile (and keep)") (t "Refile"))) (cbu= f (current-buffer)) (regionp (org-region-active-p)) (region-start (and regi= onp (region-beginning))) (region-end (and regionp (region-end))) (filename = (buffer-file-name (buffer-base-buffer cbuf))) (org-refile-keep (if (equal a= rg 3) t org-refile-keep)) pos it nbuf file re level reversed) (setq last-co= mmand nil) (if regionp (progn (goto-char region-start) (or (bolp) (goto-cha= r (point-at-bol))) (setq region-start (point)) (if (or (org-kill-is-subtree= -p (buffer-substring region-start region-end)) (prog1 org-refile-active-reg= ion-within-subtree (let ... ... ...))) nil (user-error "The region is not a= (sequence of) subtree(s)")))) (if (equal arg (quote (16))) (org-refile-got= o-last-stored) (if (or (and (equal arg 2) org-clock-hd-marker (marker-buffe= r org-clock-hd-marker) (prog1 (setq it ...) (setq arg nil))) (setq it (or r= floc (let ... ...)))) (progn (setq file (nth 1 it) re (nth 2 it) pos (nth 3= it)) (if (and (not arg) pos (equal ... file) (if regionp ... ...)) (error = "Cannot refile to position inside the tree or region")) (setq nbuf (or (fin= d-buffer-visiting file) (find-file-noselect file))) (if (and arg (not ...))= (progn (org-pop-to-buffer-same-window nbuf) (goto-char pos) (org-show-cont= ext ...)) (if regionp (progn ... ...) (org-copy-subtree 1 nil t)) (save-cur= rent-buffer (set-buffer ...) (setq reversed ...) (save-excursion ...)) (if = org-refile-keep nil (if regionp ... ...)) (if (featurep ...) (progn ...)) (= setq org-markers-to-move nil) (message (concat actionmsg " to \"%s\" in fil= e %s: done") (car it) file))))))) org-refile(t) eval((org-refile t)) (cond ((commandp org-speed-command) (setq this-command org-speed-command)= (call-interactively org-speed-command)) ((functionp org-speed-command) (fu= ncall org-speed-command)) ((and org-speed-command (listp org-speed-command)= ) (eval org-speed-command)) (t (let (org-use-speed-commands) (call-interact= ively (quote org-self-insert-command))))) (cond ((and org-use-speed-commands (let ((kv (this-command-keys-vector)))= (setq org-speed-command (run-hook-with-args-until-success (quote org-speed= -command-hook) (make-string 1 (aref kv ...)))))) (cond ((commandp org-speed= -command) (setq this-command org-speed-command) (call-interactively org-spe= ed-command)) ((functionp org-speed-command) (funcall org-speed-command)) ((= and org-speed-command (listp org-speed-command)) (eval org-speed-command)) = (t (let (org-use-speed-commands) (call-interactively (quote org-self-insert= -command)))))) ((and (org-table-p) (progn (and (featurep (quote org-table))= org-table-auto-blank-field (memq last-command (quote (org-cycle org-return= org-shifttab org-ctrl-c-ctrl-c))) (if (or (equal ... 32) (looking-at "[^|\= n]* |")) (let (org-table-may-need-update) (org-table-blank-field)) (org-ta= ble-blank-field))) t) (eq N 1) (looking-at "[^|\n]* |")) (let (org-table-m= ay-need-update) (goto-char (1- (match-end 0))) (backward-delete-char 1) (go= to-char (match-beginning 0)) (self-insert-command N))) (t (setq org-table-m= ay-need-update t) (self-insert-command N) (org-fix-tags-on-the-fly) (if org= -self-insert-cluster-for-undo (if (not (eq last-command (quote org-self-ins= ert-command))) (setq org-self-insert-command-undo-counter 1) (if (>=3D org-= self-insert-command-undo-counter 20) (setq org-self-insert-command-undo-cou= nter 1) (and (> org-self-insert-command-undo-counter 0) buffer-undo-list (l= istp buffer-undo-list) (not (cadr buffer-undo-list)) (setcdr buffer-undo-li= st (cddr buffer-undo-list))) (setq org-self-insert-command-undo-counter (1+= org-self-insert-command-undo-counter))))))) org-self-insert-command(1) call-interactively(org-self-insert-command nil nil) command-execute(org-self-insert-command) --=Multipart0o0o0o0o0o0o0o Content-Type: text/plain Same happens if I open two org-files and set `org-refile-targets' accordingly. Thanks for looking into this - although it has nothing to do with gnorb. -- Thomas --=Multipart0o0o0o0o0o0o0o--