Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference string as symbol so %'s don't need to be escaped #7

Merged
merged 1 commit into from
Apr 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions org-sticky-header.el
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,16 @@
(defvar org-sticky-header-old-hlf nil
"Value of the header line when entering org-sticky-header mode.")

(defvar-local org-sticky-header-stickyline nil
"Value of header line")
(put 'org-sticky-header-stickyline 'risky-local-variable t)

(defconst org-sticky-header-header-line-format
'(:eval (list
(propertize " " 'display '((space :align-to 0)))
(org-sticky-header--fetch-stickyline)))
'(:eval (progn
(setq org-sticky-header-stickyline (org-sticky-header--fetch-stickyline))
(list
(propertize " " 'display '((space :align-to 0)))
'org-sticky-header-stickyline)))
"The header line format used by stickyfunc mode.")

(defgroup org-sticky-header nil
Expand Down Expand Up @@ -126,13 +132,7 @@ is enabled."
;; FIXME: Convert cond back to pcase, but one compatible with Emacs 24
((null org-sticky-header-full-path)
(concat (org-sticky-header--get-prefix)
;; Remove "%" from heading, which is a special
;; character in header lines.
;; `org-get-outline-path' already does this.

;; FIXME: It would be better to escape the "%" by doubling it, and apply
;; the text properties from the single "%" to the doubled one
(replace-regexp-in-string "%" "" (org-get-heading t) t t)))
(org-get-heading t t)))
((eq org-sticky-header-full-path 'full)
(concat (org-sticky-header--get-prefix)
(org-format-outline-path (org-get-outline-path t)
Expand Down