diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-06-26 23:38:23 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-06-26 23:38:23 +0200 |
commit | 6c498f13375574db873d3d5da100235cfe09a190 (patch) | |
tree | 8f2e985ae8963ba70494c1c4a5574fada0b71941 | |
parent | bc1d6aadfd0f0a84f5dcc4681370b14b5d3fbb1c (diff) | |
download | org-mode-6c498f13375574db873d3d5da100235cfe09a190.tar.gz |
Forbid empty string as org-ellipsis value
* lisp/org.el (org-ellipsis): Harden :safe value.
(org-display-table): Fix typo.
(org-mode): Only change ellipsis if `org-ellipsis' is a non-empty
string. Remove obsolete checks.
Reported-by: Michael Ax <michaelax@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/114283>
-rw-r--r-- | lisp/org.el | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/org.el b/lisp/org.el index d9b6489..96fe4eb 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -1119,8 +1119,8 @@ Or return the original if not disputed." (defcustom org-ellipsis nil "The ellipsis to use in the Org mode outline. -When nil, just use the standard three dots. -When a string, use that string instead. +When nil, just use the standard three dots. When a non-empty string, +use that string instead. The change affects only Org mode (which will then use its own display table). Changing this requires executing `\\[org-mode]' in a buffer to become @@ -1128,10 +1128,10 @@ effective." :group 'org-startup :type '(choice (const :tag "Default" nil) (string :tag "String" :value "...#")) - :safe #'string-or-null-p) + :safe (lambda (v) (and (string-or-null-p v) (not (equal "" v))))) (defvar org-display-table nil - "The display table for org-mode, in case `org-ellipsis' is non-nil.") + "The display table for Org mode, in case `org-ellipsis' is non-nil.") (defgroup org-keywords nil "Keywords in Org mode." @@ -5582,15 +5582,13 @@ The following commands are available: (setq-local outline-regexp org-outline-regexp) (setq-local outline-level 'org-outline-level) (setq bidi-paragraph-direction 'left-to-right) - (when (and org-ellipsis - (fboundp 'set-display-table-slot) (boundp 'buffer-display-table) - (fboundp 'make-glyph-code)) + (when (and (stringp org-ellipsis) (not (equal "" org-ellipsis))) (unless org-display-table (setq org-display-table (make-display-table))) (set-display-table-slot org-display-table 4 (vconcat (mapcar (lambda (c) (make-glyph-code c 'org-ellipsis)) - (if (stringp org-ellipsis) org-ellipsis "...")))) + org-ellipsis))) (setq buffer-display-table org-display-table)) (org-set-regexps-and-options) (org-set-font-lock-defaults) |