lisp/org.el (org-ctrl-c-ctrl-c): Set tags for headlines whose text is a link

* lisp/org.el (org-ctrl-c-ctrl-c): 'C-c C-c' on a link is usually a
  no-op. If that link is in a headline, act as if the 'C-c C-c' was
  called on the headline, not the link.
This commit is contained in:
Eric Abrahamsen 2013-04-21 17:32:26 +08:00 committed by Carsten Dominik
parent 83b6cfcaec
commit e45701beff
1 changed files with 6 additions and 0 deletions

View File

@ -20171,6 +20171,12 @@ This command does many different things, depending on context:
(when (and (eq (org-element-type parent) 'item)
(= (point-at-bol) (org-element-property :begin parent)))
(setq context parent type 'item))))
;; When heading text is a link, treat the heading, not the link,
;; as the current element
(when (eq type 'link)
(let ((parent (org-element-property :parent context)))
(when (and (eq (org-element-type parent) 'headline))
(setq context parent type 'headline))))
;; Act according to type of element or object at point.
(case type
(clock (org-clock-update-time-maybe))