emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Christopher M. Miles" <numbchild@gmail.com>
To: Org Mode (org-mode) <emacs-orgmode@gnu.org>
Subject: [QUESTION] Add advice on command org-add-note not working
Date: Fri, 20 Aug 2021 09:22:22 +0800	[thread overview]
Message-ID: <PAXPR08MB66405CA0BEB51487EA8EBDF4A3C19@PAXPR08MB6640.eurprd08.prod.outlook.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 627 bytes --]

<#secure method=pgpmime mode=sign>

I have following advice code:

#+begin_src emacs-lisp
(defun my/org-add-note--auto-add-tag ()
  "Auto add tag 'LOG' when add note log."
  (org-back-to-heading)
  ;; DEBUG: the following code is not executed.
  (message "DEBUG")
  (require 'seq)
  (org-set-tags (seq-uniq (cons "LOG" (org-get-tags nil t)))))

(advice-add 'org-add-note :after #'my/org-add-note--auto-add-tag)
#+end_src

With Emacs Edebug, I found it only executed to ~(org-back-to-heading)~, then stopped. The following
"DEBUG" message is not printed and tag "LOG" is not added.

Does anybody have some clue for this issue?


[-- Attachment #1.2: Type: text/html, Size: 2713 bytes --]

[-- Attachment #2: Type: text/plain, Size: 246 bytes --]

-- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

             reply	other threads:[~2021-08-20  1:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20  1:22 Christopher M. Miles [this message]
2021-08-20  8:45 ` [QUESTION] Add advice on command org-add-note not working Samuel Loury
2021-08-20 15:16   ` [SOLVED] " stardiviner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PAXPR08MB66405CA0BEB51487EA8EBDF4A3C19@PAXPR08MB6640.eurprd08.prod.outlook.com \
    --to=numbchild@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).