otherwise the background is changed to the candidate's color.
@end deffn
- See also the functions @code{read-coding-system} and
-@code{read-non-nil-coding-system}, in @ref{User-Chosen Coding Systems},
-and @code{read-input-method-name}, in @ref{Input Methods}.
+ See also the functions @code{read-coding-system} in @ref{User-Chosen
+Coding Systems}, and @code{read-input-method-name}, in @ref{Input
+Methods}.
@node Reading File Names
@subsection Reading File Names
to return. It should be a symbol or a string.
@end defun
-@defun read-non-nil-coding-system prompt
-This function reads a coding system using the minibuffer, prompting with
-string @var{prompt}, and returns the coding system name as a symbol. If
-the user tries to enter null input, it asks the user to try again.
-@xref{Coding Systems}.
-@end defun
-
@node Default Coding Systems
@subsection Default Coding Systems
@cindex default coding system
(defvar find-coding-system-regexp
(concat "^\\s-*(define-coding-system" find-function-space-re "%s\\(\\s-\\|$\\)"))
-(defvar find-widget-regexp
- (concat "^\\s-*(define-widget" find-function-space-re "%s\\(\\s-\\|$\\)"))
+(defvar find-charset-regexp
+ (concat "^\\s-*(define-charset" find-function-space-re "%s\\(\\s-\\|$\\)"))
(defcustom find-face-regexp
(concat"^\\s-*(defface" find-function-space-re "%s\\(\\s-\\|$\\)")
(define-error . find-error-regexp)
(define-icon . find-icon-regexp)
(define-coding-system . find-coding-system-regexp)
+ (define-charset . find-charset-regexp)
(define-symbol-type . find-symbol-type-regexp))
"Alist mapping definition types into regexp variables.
Each regexp variable's value should actually be a format string
:imenu "Coding system"
:namespace 'coding)
+(scope-define-symbol-type charset ()
+ :doc "Charset names."
+ :face 'font-lock-type-face
+ :help (lambda (beg end _def)
+ (if-let ((sym (intern (buffer-substring-no-properties beg end))))
+ (lambda (&rest _)
+ (if-let ((doc (charset-description sym)))
+ (format "Charset `%S'.\n\n%s" sym doc)
+ "Charset"))
+ "Charset"))
+ :completion (constantly #'charsetp)
+ :namespace 'charset)
+
+(scope-define-symbol-type defcharset ()
+ :doc "Charset definitions."
+ :face 'font-lock-type-face
+ :help (constantly "Charset definition")
+ :imenu "Charset"
+ :namespace 'charset)
+
(defvar scope-counter nil)
(defvar scope-local-functions nil)
(when-let ((q (scope--unqoute (cadr props)))) (scope-report-s q 'defun))))
(setq props (cddr props))))
+(scope-define-function-analyzer define-charset
+ (&optional name _docstring &rest _props)
+ (when-let ((quoted (scope--unqoute name))) (scope-report-s quoted 'defcharset)))
+
+(scope-define-function-analyzer define-charset-alias
+ (&optional alias charset)
+ (when-let ((quoted (scope--unqoute alias))) (scope-report-s quoted 'defcharset))
+ (when-let ((quoted (scope--unqoute charset))) (scope-report-s quoted 'charset)))
+
+(scope-define-function-analyzer charset-chars
+ (&optional charset &rest _)
+ (when-let ((quoted (scope--unqoute charset))) (scope-report-s quoted 'charset)))
+
+(dolist (sym '(charset-description charset-info charset-iso-final-char
+ charset-long-name charset-plist
+ charset-short-name
+ get-charset-property put-charset-property
+ list-charset-chars
+ set-charset-plist
+ set-charset-priority
+ unify-charset
+ locale-charset-to-coding-system))
+ (put sym 'scope-analyzer #'scope--analyze-charset-chars))
+
(scope-define-function-analyzer define-coding-system
(&optional name _docstring &rest _props)
(when-let ((quoted (scope--unqoute name))) (scope-report-s quoted 'defcoding)))
INITIAL-INPUT, if non-nil, is a string inserted in the minibuffer initially.
See the documentation of the function `completing-read' for the detailed
meanings of these arguments."
- (let* ((table (mapcar (compf list symbol-name) charset-list))
- (charset (completing-read prompt table
+ (let* ((charset (completing-read prompt
+ (completion-table-with-metadata
+ charset-list '((category . charset)))
nil t initial-input 'charset-history
default-value)))
(if (> (length charset) 0)
(plist-put props :long-name (plist-get props :short-name)))
(plist-put props :base name)
(setcdr (assq :plist attrs) props)
-
+ (add-to-list 'current-load-list `(define-charset . ,name))
(apply 'define-charset-internal name (mapcar 'cdr attrs))))
(defvar hack-read-symbol-shorthands-function nil
;; FIXME: Implement it.
nil)
+(cl-defmethod loadhist-unload-element ((_x (head define-charset)))
+ ;; FIXME: Implement it.
+ nil)
+
;;;###autoload
(defun unload-feature (feature &optional force)
"Unload the library that provided FEATURE.
(condition '(condition))
(icon '(deficon icon))
(coding '(defcoding coding))
+ (charset '(defcharset charset))
(variable '(defvar variable constant))
(symbol-type '(symbol-type symbol-type-definition))
(function '(defun function macro special-form major-mode)))))
('icon '(define-icon))
('symbol-type '(define-symbol-type))
('coding '(define-coding-system))
+ ('charset '(define-charset))
('oclosure '(oclosure))
('widget-type '(define-widget)))))
(cl-loop for d in definitions
;; FIXME: advised function; list of advice functions
;; FIXME: aliased variable
- ;; Coding system symbols do not appear in ‘load-history’,
- ;; so we can’t get a location for them.
-
(when (and (symbolp symbol)
(symbol-function symbol)
(symbolp (symbol-function symbol)))
(when-let ((file (find-lisp-object-file-name symbol 'define-coding-system)))
(push (elisp--xref-make-xref 'define-coding-system symbol file) xrefs)))
+ (when (charsetp symbol)
+ (when-let ((file (find-lisp-object-file-name symbol 'define-charset)))
+ (push (elisp--xref-make-xref 'define-charset symbol file) xrefs)))
+
(when (scope-symbol-type-p symbol)
(when-let ((file (find-lisp-object-file-name symbol 'define-symbol-type)))
(push (elisp--xref-make-xref 'define-symbol-type symbol file) xrefs)))
}
else
{
- args[i]
- = Fread_non_nil_coding_system (callint_message);
+ args[i] = Fread_coding_system (callint_message, Qnil);
visargs[i] = last_minibuf_string;
}
break;
return Qt;
}
-DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system,
- Sread_non_nil_coding_system, 1, 1, 0,
- doc: /* Read a coding system from the minibuffer, prompting with string PROMPT.
-Return the symbol of the coding-system. */)
- (Lisp_Object prompt)
-{
- Lisp_Object val;
- do
- {
- val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil,
- Qt, Qnil, Qcoding_system_history, Qnil, Qnil);
- }
- while (SCHARS (val) == 0);
- return (Fintern (val, Qnil));
-}
-
DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0,
doc: /* Read a coding system from the minibuffer, prompting with string PROMPT.
If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.
defsubr (&Scoding_system_p);
defsubr (&Sread_coding_system);
- defsubr (&Sread_non_nil_coding_system);
defsubr (&Scheck_coding_system);
defsubr (&Sdetect_coding_region);
defsubr (&Sdetect_coding_string);