Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@shawwn
Created July 31, 2019 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawwn/6a4e58553465cf6e3722005bcf380918 to your computer and use it in GitHub Desktop.
Save shawwn/6a4e58553465cf6e3722005bcf380918 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
"%file: samples-20900"
======== SAMPLE 1 ========
AME "\\\\C-m")
'("\\\\C-c" "\e\n\\\\C-f" "\e\n\\\\C-a" "\e\n\\\\C-e" "\e\n\\\\C-g" "\e\n\\\\C-m" "\e\n\\\\C-b" "\e\n\\\\C-c"))
(mapc (lambda (e)
(if (listp (nth 1 e))
(nthcdr 1 e)
(cdr (assq 'default (nth 2 e))))))
(prog1
(concat (or (cdr (assoc "default-"
:prefix "--")
"/-"))
;; In Emacs, `defconst'.
"\\.C\\{")
"-C")
(prog1
(setcdr (assoc (get 'cursor-help)
'cursor-help-defun
(cddr (mapcar (lambda (help-function)
(funcall help-function help-function nil
(funcall help-function help-function)))))))
"\\([a-zA-F][A-Z][-a-zA-F][A-Z\n\t]*\\)\\)")
(prog1
(setq ediff-mode-line-regexp
(expand-file-name "\^[ \t]+\\([[-a-z0-9]+\\]\\)" t))))
"An alist where the characters to be passed to ALIST
are delimiters, and the input file names of the alists."
(let ((case-fold-search t)
(first 0))
(while (or first
(and first
(null (string= first ""))))
(push (cl-case first nil) first))))))
(defun ediff-indent-function ()
"Indent the cursor around at position COUNT.
If the cursor is already at the position of the command COUNT, then
indent `cursor' to the column it is in, if necessary.
Otherwise, shift around and indent, if necessary."
;; If it is a function, do something about it.
(edeiff-define-indented-method 'cursor-help)
(if (and (progn (propert-end-of-defun) (point))
ediff-mode)
(setq ediff-mode-line-prefix
(let ((prefix (ediff-find-function-prefix (ediff-current-defun)))
(suffixes (ediff-find-function-suffixes
======== SAMPLE 2 ========
AME‚ˆÙœ½Ø¥)
;; 圃
;; 圈ٝ•âž¿ 圈
;; 圙؁¦Ù•¨ ؁›ÙˆœØ¤Ù–¨Ø¥Ù€ ؁›Ùˆœ ؁¥Ù€ ؁›Ù”¨")
;; ("؃踭¨Ø“´Ù”¨Ø³Ø§Ø„")
;; ("ع핔رƒ" رƒ)
;; ("놟ٯ‰ê¸°Èœ†Ø€") رƒ
;; ("ف”Ø°±í†‘걱؄ Ø°±Ø„") رƒ
;; ("미ݪ¸Øƒ†ØƒØ¹Ø±ƒ رƒ") رƒ
;; ("몳타و¨Ø°² Ø°³Ø ˆØ°¸Ø‘؁´ØƒØˆ¤ رÙ‡ˆØ•Ø²•Ø†‡Ø²˜Ø§Ù‘Ø°±Ø°´Øƒ¤Ø§Ø±ƒØ±€Ù–¨Ø¦") ض”
;; ("ـ¿Ø§€Ù‰Øˆ¼ØƒŠØƒ‹Ø¬Ø†¤Ø¶›Ù‚”릸 ض›Ù‚ŠØ Ø´±ØŠ¹ØÙ¼ë¦¬ ض›Ù‚ŽØ¨ªØ²£Ø±ƒ ؁Ù³Ø§Ø‡ë›‚Ù‚©ØƒØƒ§ØƒŒ رŒØ„ر´Ø¶€ë§Œê± Ùˆ")
;;
;;; End of documentation section
;;
;; ;; For the sake of the rest of the language.
;;
;; To start and describe a function, use `:define-function'.
;;
;; This definition assumes the definition is a symbol.
;; The symbol argument is an alist with the symbols of
;; `:define-function' and `:define-body'.
;;
;; To describe the function, either describe a macro (e.g. one with a
;; `:define-body' or using `:define-form' methods), or use a key
;; of the :function or :keymap elements:
;;
;; :define-function is called after using a definition.
;;
;; :define-body is a string used like (:define-function: .
;; (`(,([a-zA-Z0-9]+ ,@-params) ((,(quote . . .) . .) ...))))
;;
;; :body is a string used like (,(quote . . .) . ((,(quote . . .) ...))))
;;
;; It is important to emphasize that :define-body is not the
;; :
======== SAMPLE 3 ========
AME :help "%s"
`(setq ,@(mapcar
(lambda (b) (cons (stringp b) ,b))))
;; If `x' is the left or right sexp (it's a member) or is a substring (in
;; some cases, it'll replace its parent in the middle of bs),
;; it might do the actual thing (it might mean it doesn't have a parent --
;; eg, it might mean it has a parent which isn't a member, etc...).
b
(x (car x)))))
(defconst math-symbolic-value-kind "^\377\377\377\377"
"Used by math-symbolic-value to set a non-symbolic value.")
(defvar math-non-symbolic-value-kind nil
"Used by math-non-symbolic-value to set non-symbolic values.")
(defun math-intangible-value-kind (vec)
;; FIXME: Why don't math-intangible-value-kind really work?
(let* ((vec (or math-non-symbolic-value-kind
math-non-symbolic-value-kind)))
(kind-1 (math-add vec math-non-symbolic-value-kind)))
;; The real math-non-symbolic-value-kind returns the real value
;; (a,b,c).
(while
(let ((value (and (math-sub-solve (car value) vec))
(eq (car-safe (car value)) 'x))
(vec (if value
(math-add (math-add-vec vec) vec)))
vec))
(setq value (car value))
(or
(eq (car value) 'x)
(or
(if (memq (car-safe (eolp)) '(c))
'y)
(or
(if (memq (car-safe (eolp)) '(c))
'y)
(or (memq (car-safe (eolp)) '(x . y))
'y))))))))
;;;###autoload
(defun math-complex-value-kind (intx expr)
"Like `mod MEG'.
If you are in a big spreadsheet, and want a constant that can
change the way I compute numbers.
If this variable is a list with multiple numbers,
then the first few times it equals to one or a few. Then
the variable MEG is the one that equals every integer, and all
the others do not.
If all those are not numbers, then I do a single bit.
If `math-real-mod' has a positive modulus,
then I calculate math-complex-value-kind from the real value.
Since the last few years have been busy dealing with
messages from the user, it is often not appropriate to be involved in complex math
messages and thus don't do very well in spreadsheet-driven problems."
(if (or math-non
======== SAMPLE 4 ========
AME") ("-" "-"))
(if (= (+ arg 1) -1) "--" "-"
(concat ("--" "--")))
((match-string 1) "\n")
"")))))
(defun org-table-insert-and-indent (arg)
(interactive "p")
(if (or org-table-insert-and-indent-p
org-table-insert-and-indent-p)
(call-interactively org-table-insert-and-indent-p)
(if (and arg (> arg 0)) "-" "\\")
(lambda (str) (error "%s" (concat "Bad line in `org-table-indent-func': " err)))
(format-message "%s" arg)))
(defun org-table-fill-column (char-in-string char)
"Fill column CHAR-IN-STRING in TABLE.
If CHAR-IN-STRING is not a character, use a valid \"fill\"
character. To do this, first give it a \"fill\", then give
it a \"+\", then give it a \"-\". Then, if CHAR-IN-STRING
is not a valid \"fill\" character, leave it alone."
(interactive
(list (read-string (concat char ?%)
(- (if (integerp char-infinity) 0 1 -1))))
(setq char-in-string (string-to-char char))
(save-excursion
(while (or (not (= char-infinity 0))
(or (eq char-infinity '+)
(and (not (equal char-to-string char))
(equal char-infinity '+)))
(and (and (not (equal char-infinity -1))
(equal char-infinity '-))
(= (current-column) char-infinity))
(= char-infinity ?*) (car char-in-string))
char-in-string)))))
(defun org-table-end-insert-and-indent (arg &optional delete-region)
"Edit contents in table."
(interactive "P")
(if (or (not org-table-insert-and-indent-p)
(and (member (org-table-string-suffix (or arg 1)) "end")
(funcall preserve-table)))
(message "End of table. Delete text")))
(defun org-table-insert-and-indent (arg)
"Insert end of table."
(interactive "P")
(if (or (not org-table-insert-and-indent-p)
(and (member (org-table-string-suffix (or arg 1)) "end"))
(org-table-insert-and-indent))
(call-interactively org-table-insert-and-indent-p))
(with-current-buffer (org-table-data)
(org-table-fill-column)
(org-table-fill-separator-p)
(buffer-string)
"%file: samples-20800"
======== SAMPLE 1 ========
-char (match-end 0))
(+ (point) pos)
(message "Ended - %s"
(if (bobp) (save-excursion (beginning-of-line) (forward-sexp) (point))))
(point)))))
(defun cua--next-colon ()
"Move point to point in current current cua-ctxt block."
(interactive)
(let ((pos (point)))
(if (not (or (looking-at cua--keyword-re) cua-ctxt-block))
(forward-word 1)
(if (get-text-property pos 'syntax-table)
(forward-char 1)
(if (get-text-property pos 'cua-cbe-syntax-table)
(forward-char 1))
(forward-sexp 1)
(if (get-text-property pos 'cua-cbe-syntax-table)
(forward-sexp 1)))
(backward-sexp)
(not (get-text-property pos 'cua-cbe-syntax-table))
(setq pos (point)))
(if (get-text-property pos 'cua-cbe-syntax-table)
(forward-sexp 1)
(forward-sexp 1)))))
(defun cua--end-of-block ()
"Like `end-of-block', but move point to the end of the current line."
(interactive)
(beginning-of-line)
(save-excursion
(forward-sexp -1)
;; Move point after whitespace in cua-ctxt.
(cua-forward-comment (point))
(while (looking-at "\\.\\(\\\\\\\\\\)")
(forward-line -1))
(save-excursion
(beginning-of-line 0)
;; Loop until found.
(skip-chars-backward " \t")
(skip-chars-forward " \t\n")
(while (not (eobp))
(forward-sexp 1))
(when (looking-at cua--keyword-re)
(forward-sexp 1) (backward-sexp))))))))
(defun cua--end-of-block-skip ()
"skip the end of a block."
(interactive)
(skip-chars-backward " \t")
(if (not (looking-at "\\.\\(\\\\\\\\\\)")
(skip-chars-backward " \t")
(forward-sexp 1))
(mapatoms 'cua-cbe-skip)))
(defun cua--move-to-whole-block ()
"Move point to beginning of the new block.
Move point to the start of point if there is at least one blank line left.
If a blank line is found, move point to the end of the new block."
(interactive)
(forward-sexp)
(forward-char -1)
(looking-at "\\.\\(\\\\\\\\\\)")
(skip-chars-backward " \t")
(forward-char -1)
(while (not (eobp))
(forward-sexp -1)
(cond (pos
(forward-sexp 1)
(when (looking-at cua--keyword-re)
======== SAMPLE 2 ========
-match-string regexp)
(match-string 1 regexp)
(regexp-quote match-string)))))
(if (and
;;
(eobp)
(not (string-match "\n" regexp)))
(nth 1 (cdr regexp))))
(should (equal (cdr regexp) (cdr match-string)))))
(ert-deftest eieio-tests-match-string-and-regexp-alist-2 ()
"Alist containing regexps for searching.
This includes all regexps for the same item.
This must not be done in `eieio-match-string-and-regexp-alist'
and must not in the `eieio-match-string-and-regexp-alist'
which don't have an index buffer. See also `eieio-match-string-and-regexp-alist'."
(let* ((re (cdr regexp))
(regexp (read-from-minibuffer "Match regexp: "
eieio-start-match-string
(car regexp)
(cdr regexp)))
item)
(catch 'found
(let ((type (eieio-get-type-regexp-alist regexp))
(type-re
(if (memq type '(string string comment))
"")
regexp))
(mapc
(lambda (match)
;; Replace matching elements with a newline.
(if (not (eieio-match-string-and-regexp-alist-1 match type-re))
(progn
(if (setq match (string-match match regexp))
(throw 'found match)))
(let ((case-fold-search t))
(while (forward-sexp 1)
(push (intern (symbol-name match) (match-string 1) (match-string 0))))
match)
(eieio-ignore-match match)
(when type-re
(with-temp-buffer
(goto-char (1- match))
(insert "\e")
(insert regexp)
(setq match nil)))))))))))
======== SAMPLE 3 ========
-line)
(setq end (point))
(re-search-backward
(concat "\\(\\w+\\)\\([^\"\n\r]*?:[ \t\n]*:\\)[ \t\n\r\f]\\(\\w+)[ \t\n\r\f]*:[ \t\n\r\f]\\)[ \t\n\r\f]\\w+?" end t)
'identification nil t)
(or (zerop (length (match-string 1))))
((member (match-string 2) "") match)
;; No match or nothing to change the result.
(setq end (point))
(cond
;; "foo\nbar\n\\(\\w+[^\n\r\f]*{")
((member (match-string 2) "!")
(replace-match "[ \t\n\r\f\]*:[^\n\r\f]*" t nil t)))
(t nil))
(t nil)))
(match-string-no-properties nil))
;; If match is nil, throw it to nothing.
(unless (if match (string-match "^[ \t\n\r ]*" end match))
(substitute-command-keys "\n"))))
;; If no matches, we have no matching. If no one was found,
;; then just go through the list of matches until we find one.
(if (when (string-match "^[^\n\r]" match)
(looking-at "^[ \t\n\r\f]*[^\n\r\f]*")
(not (member (match-string 1) ".")))))
;; If there is a match, return it. If it is not, we will not
;; start an argument search. Return the entry, or nil if there is no
;; matching.
(if (looking-at "[ \t\n\r\f]*" match)
(forward-line))
(skip-chars-backward " \t" match-string))))
(defun org-odt-set-header ()
"Set the entry for ODT to show as header."
(interactive)
(org-odt-do-make-header)
(org-odt-do-make-body)
(org-odt-do-keymap-entry)
(org-odt-do-body)))
;;; Navigation
;;;###autoload
(defun org-odt-goto-first (&optional event)
"Jump to the first non-empty table in a buffer.
Don't try to jump to a buffer that already has a table in it."
(interactive t)
(beginning-of-line)
(let ((pos (point)))
(if (not (y-or-n-p
======== SAMPLE 4 ========
-buffer-p)))
(re-search-forward "\\\\\\(\\s-\\|<\\\\]\\)" nil t)
;; Try to expand a string in "\\\"" and not end up "\\\"",
;; because this would leave us without a return.
nil)
(when (re-search-forward "\\([^)]*\\)" nil t)
nil
(match-string-no-properties 0)
)
(when (eq vw-rv 'default)
(re-search-backward "\\\\\\(" nil t)
(forward-char -1)))
(when (re-search-forward "\\\\(" nil nil t)
(forward-char 1)))
(when (or (and (not (preceding-char))
(memq (preceding-char) '(?\ ?\][))))
;; Check if we're inside a "\\\""
(or (not (string-match "\"" (char-before)))
(eobp))
(save-excursion
(beginning-of-line)
(skip-chars-forward " \n\t\n")
(skip-chars-backward " \t\n")
(skip-chars-backward " \t\n|")))))
(when (and re-search-forward vw-rv
(re-search-forward "\\\\\\(\\s-\\|>" nil t))
(eq vw-rv 'default)))
(when (or (not (memq (preceding-char) '(?\ ?\]) ?\n))
(not (memq (preceding-char) '(?\ ?>) ?\]))))
;; Try re-search-forward to find what we're looking at.
(re-search-forward "\\>" nil t)
(setq vw-rv nil)))
(setq vw-rv (cdr vw-rv)))
(defun vw--r-reindent-line ()
"Reindent a string in a vw-r option that it was reindented."
(interactive)
(let ((inhibit-point-motion-hooks t))
(if (not (and (numberp vw-rv)
(= (point) in-point)
(min-height (1- (cdr vw-rv))))
(and (= (point) in-point)
vw-rv
(and (not (memq vw-rv '(?\ ,?\})
vw-rv)
(not vw-rv))))))))
(defun vw-r-indent-char ()
"Interactively, reindent character between \"'\" and \"', when the
same line is indented in a vw-r option that it was reindented."
(interactive)
(let ((inhibit-point-motion-hooks t))
(if (null vw-rv) (error "No vw-r options"))
"%file: samples-20700"
======== SAMPLE 1 ========
(or (nth 2 (nth 1 (car ref)))))
(setq ref
(format "%-s " (nth 2 (if (integerp ref) ref)))))
ref)))
(if (not found
(if (string-match (cl-first ref) "\\s-+"))
(cond ((eq (car ref) ?a)
(if (string-match (cl-first ref) "\\s-")
(let ((s (match-string 1 ref)))
(setq orig (match-beginning 1)
ref (string-match-data-extensions ref orig 'string)))
ref nil nil t))))
(or ref found
(setq ref (format "%s%s" ref (match-string 1 ref)))
(error "Missing ref")))
;; Don't match any refs
(if (not (string-match (cl-first ref) "\\s-+"))
(setq ref (format "<%s>")
ref (format "> " (cl-first ref) ">"))))
(setq found (not found))))
;; Check the ref.
(if found
(progn
(if (or (eq ref 're) (eq ref 're-symbol))
(progn
;; Get the name of the ref
(setq ref (or (cl-first ref) (car ref)))
ref))
(if found
(progn
(require 'symbol-ref)
(prog1
(cl-putref-keyed-map ref 'ref nil 'symbol-ref)
(funcall (cl-nth 1 (nth 1 (or ref 'x)))))
ref (symbol-value ref))
(if found
(progn
(setq (copy-symbol ref (symbol-value ref))))
;; Now the variable list has been modified and the next level of the variable
;; list has been set up.
======== SAMPLE 2 ========
(when rsh-use-file-lock
;; We're in a file.
(rename-file rsh-current-dir
(copy-sequence rsh-current-dir)
rsh-current-file)
;; This is not needed because we have already
;; executed a command in the directory.
(let ((directory-list (make-sparse-keymap)))
;; Do the job correctly.
(while (not (re-search-forward rsh-current-file nil t))
(rename-file (list (match-string-no-properties 1))))))))
(setq rsh-current-file buffer-file-name)))
;; We set the value of the RSH-current-dir variable to set
;; the current buffer file, i.e.: we are in a file
;; named with multiple rsh-current-file files. We're in
;; rsh-directory-p, hence we don't know when we are
;; in a file.
(setq buffer-file-name (symbol-name rsh-current-file)) ; No need to set the buffer-file-name again.
;; Get rid of the previous buffer-file-name property,
;; which seems to be necessary to avoid the user guessing
;; that we are in a file.
;; The buffer-file-name property will be used for the
;; following commands.
(setq buffer-file-name buffer-file-name))
(setq buffer-file-name (symbol-name rsh-current-file))
(setq rsh-current-file buffer-file-name))))
;; Check for a comment. Find out what we're in a comment.
(narrow-to-region (1+ (point)) (point-min))
(insert rsh-comment-start)
(goto-char (+ (point) 2))
(condition-case nil
;; Check for the next statement. If we found the first
;; comment, it was in a comment. Then we need to check the
;; next comment. The
======== SAMPLE 3 ========
;; Note: This is a problem with the current `pcomplete-parsed-regexp'
;; function, which makes `-c' behave like regexp
;; with no special meaning.
(forward-sexp 3)
(if pcomplete-parsed-regexp-comment
(pcomplete-forward-and-in-comments 3)
(pcomplete-with-syntax 'pcomplete-parsed-regexp-comment)
(forward-sexp 4)
(pcomplete-with-syntax 'pcomplete-parsed-regexp)
(pcomplete-maybe-end)
(forward-sexp 4))
(pcomplete-end-of-line-comment))))
(dolist (line (pcomplete-lines-alist line))
(pcomplete-re (concat pcomplete-alist ": ")
(buffer-substring line last-no-newlines)
(concat (pcomplete-regexp-comment
pcomplete-alist
":: ")
":: ")
(while (not (string-match file-name ""))
(replace-match "" t t t))))))))))
(pcomplete-forward-and-out-comment (point-min) (point))))
;; FIX ME: Do not need to read comments for all completion functions,
;; because they will have to be executed in the same place. This should be
;; checked before using pcomplete.
(defun pcomplete-comment (&optional first-regexp final-regexp)
"Like `pcomplete' but without inserting comment-start at beginning,
and with `comment-start-start' inserted at end."
(interactive)
(let ((case-fold-search t) comment-end)
(re-search-forward pcomplete-comment-end-re nil 'movepoint)
(when (not final-regexp)
(pcomplete-maybe-end)) ;
======== SAMPLE 4 ========
(let ((case-fold-search t))
(if (eq (char-after (1- (point)) ?\ )
(progn
(forward-line 1))
(looking-at
"\\(?::: \\)?\\<" t))
(goto-char (match-end 0))
(while (re-search-forward "^[ \t]*$" nil t)
(throw "ERROR: " t))))
((eq (char-after) ?\)) ;No match
(throw "ERROR: " t))
))) ;(unless (eq (char-after) ?:) ;Re-search backward
t))
;; Find an appropriate position in the buffer-undo.
(goto-char (point-min))
(while
(let* ((pos (point))
(undo-file (current-buffer))
position
start-char
buffer-undo-list
start-pos
start-end)
(if (re-search-backward (concat "^\\(\\[[^]]*\\]\\) +\\(\\[[^ ]*\\(\\)*]\\) " end t)
(match-beginning 0)
(point-max)))
(goto-char pos)
(setq start-end start-end)
(forward-line 1)
(while (not start-pos) (beginning-of-line)
(forward-line 1))
;; Search forwards
(let ((goto-char (point-min))
forward-line
(n 1)))
(or (and (search-forward begin-p (point))
(null (save-match-data (match-data))))
(looking-at "\\(?:"))
(beginning-of-line 6))))))
;; Find the position where we found the position
(prog1 (search-forward start-pos (point-max) nil t)
"%file: samples-20600"
======== SAMPLE 1 ========
(or
nil
(cl-assert
;; Assume the code below was the last block.
(not (cl-assert (memq (nth 3 (cdr block)) '(cl-block (nth 3 (cl-block 4)))))))
;; This isn't what we would want to test with; we'd need a test/def
;; that could check out this
(and (cl-assert (memq (nth 5 (cl-block 4)) '(cl-block (nth 5 (cl-block 4))))
(memq (nth 7 (cl-block 4)) '(cl-block (nth 7 (cl-block 5))))
(cl-assert (consp (nth 8 (cl-block 4)) (nth 8 (cl-block 1))))
(cl-assert (nth 9 (cl-block 4)) (nth 9 (cl-block 2))))
;; Assume the code above is a function
(and (eq (nth 2 (assq (elt 4 x) cl-block) 'function*)
(and (memq (cl-block 1 x) '(nth 6 (cl-block 8))))
(cl-assert (consp (nth 9 (cl-block 8))))
(cl-assert (consp cl-block))))
(and (eq (car (assq (elt 4 x) cl-block) 'list*)
(and (> (length cl-block) x) (cl-equal (car (assq (elt 5 x) cl-block)))
(cl-equal (car (assq (elt 4 x) cl-block))))
(cl-equal (car (assq (elt 5 x) cl-block) '(cl-equal (car (assq (elt 5 x) cl-block)))))))
(cl-assert
;; Assume the code below was the preceding block.
(memq (cl-block 1 x) '(cl-block (nth 1 (cl-block 8))))
(cl-assert
;; Assume the code below was the final function.
(memq (cl-block 1 x) '(cl-block (nth 3 (cl-block 1))
(cl-block 3))))
;; Assume the code above was the last block and
;; consider that code's name is different than its file
(and (eq (nth 2 (assq (elt 5 x) cl-block) 'function*))
(and (>= (length cl-block) x) (cl-equal (car (assq (elt 5 x))) cl-block)))
;; Assume the code above was the final line of the block.
(and (memq (cl-block 2 x) '(cl-block (cdr (cl-block 5))))
(cl-assert (null (nth 3 (cl-block 8))))))
(cl-assert
;; Assume the code below is a newline comment.
((eq (car (assq (elt 5 x) cl-block) 'function*))
;;
;; (cl-assert (consp (nth 1 (cl-block 1))))
(memq (cl-block 1 x) '((cl-block
======== SAMPLE 2 ========
;; (delta-list 1 delta-number)
;; (setq delta-list (1- delta-list)))
;; (let ((max (- delta-list 1 pos)
;; (skip-chars-forward "^ \t")
;; (if (string= (char-after (point-min)) ":") (prog1 (skip-chars-forward ":]\n" t) t))))
;; (setq delta-number (1- delta-number)))
;; (if (not (string= (char-after (point-min)) "") (setq delta-number nil))
;; ;; Skip the second brace we didn't know there was an
;; ;; brace.
;; (if (and css-preprocessor-symbolp (not (bolp (following-char)))
;; ;; If `-p' was preceded by the `&', we skip it
;; ;; since `-p' doesn't match a brace we've added.
;; (progn
;; (skip-chars-down ";")
;; (skip-chars-backward (char-before (1- (point-max)))))
;; ;; We skip this part because the brace's end is at the
;; ;; end of the string.
;; (and (> (preceding-char) 0)
;; (skip-chars-backward " \t")
;; (skip-chars-forward ";")
;; (skip-chars-forward "\\([:alpha: ]?[ \t]*?\\)"))))
(defvar nnx--prefix-alist
'(("&&\"" 1 1 nnx-prefix-alist)
("&\"<" 1 1 nnx-prefix-alist)
("^@" 1 1 nnx-prefix-alist)
("~" "~")
("+" "+")
("*" "*")
("<" "<")
("\\" "\\")
("`" "`")
("*>" "*")
("&<" "&")
("@<" "<")
("@!" "^$"))
"Alist of N N BIND-PARAM and N NUM-PARAM.
It is inserted after and only after the N elements of each arg,
and after a new N N ARRAY.
It is not necessary to remove parentheses and strings at first time
using parentheses, since this method avoids creating "&")
;;;
["&" {&,*}?"}"]
(defvar nnx--prefix-alist-alist nil
"Alist of N N NUM-PARAM and NUM-PARAM.
It is inserted after in each element of each arg in the list,
and after the number of characters in each arg, not including parentheses.")
(defvar nnx--prefix-alist-alist nil
"Alist of N NUM-PARAM and NUM-PARAM.
It is inserted at beginning of each form in the list,
and before the number of characters in each arg.")
(defvar nnx--prefix-alist-alist nil
"Alist of N NUM-PARAM and N NUM-PARAM.
It is inserted during the completion of FORM to allow for an expression
======== SAMPLE 3 ========
(cond ((eq s g)
((and
(listp (nth 3 (cdr (last org-diary--results-in-folder-list-p t))))
'(("G" "A" "B" "C" "D" "E"))
(("G" "A" "B" "C" "D" "E")))))
(t (error (org-goto-date :error "Invalid result found")))
(save-excursion
(save-restriction
(let ((res (org-get-artored-filename (car (buffer-string))))
(org-back-to-heading)
(org-back-to-heading) ;(car (cdr (assq res org-headline))))))
(org-agenda-cleanup-reaches (cdr res)))
(if (> (point) (mark))
(with-current-buffer (mark (+ point (markest point))))
(goto-char (marker-position (org-get-at-bol)))
(beginning-of-line)
(let ((count 1))
(while (< (point) count)
(setq count
(cond
;; In case of a duplicate org-diary, count
;; the number of fields to fill in
((eq org-fetch-field 'possible-list)
(setq p (point))
;; In case of a duplicate org-diary, count
;; the number of fields to get from the field
;; field
(if noncolon
(setq count (+ count (count-lines (point) p))))
;; (cdr (org-get-at-bol))))
((eq org-fetch-field 'prompt)
(let ((tname (concat org-diary--list-promote-name
'((nil))))
(tasks (concat org-diary--list-promote-tasks)))
(when tags
(setq tagcont t (buffer-string))))))
(when (eq org-fetch-field 'prompt)
(if (eq org-fetch-field 'truename)
(push 'truename t)))))
(when tags
(setq result (org-agenda-cleanup-reaches (cdr res))))
(org-agenda-set-headline tagcont (org-agenda-format-tagcont-table))
======== SAMPLE 4 ========
(cdr (assq name (nth 2 val))
(car (assq name (cdr (assq alist (car name)))))))
(if (not org-babel-current-item-p)
nil
(cdr (assoc name (list (cdr (assq (car (car alist)) (cdr (assq (cdr alist) alist)))))))
(if elt
(if (not (cdr (assq elt (nth 8 val)) (cdr (assq elt (cdr elt)))
(nth 3 val)))
;; The car is nil.
(push elt (assq name (car elt)))
(if (and elt (not (cdr (assq elt (nth 8 elt)))) t
(cdr (assq elt (cdr elt) (cdr elt)))
;; A value is given in any one of its parts.
(cdr elt))))
(if (not org-babel-empty-item-p)
(push alist (cons elt elt)))
(if (and (consp org-babel-item-narrow-stack-to)
(eq (car org-babel-item-narrow-stack-to) 'equal)
(eq (car org-babel-item-narrow-stack-to)
(not (assoc elt (cdr elt))))))
;; Try to find the elements in the stack. If we find empty items, we
;; should look for the first element. The next step may be to find the
;; first element with elements (if there is one, they are empty)
(let ((end (cdr (assq (car (car elt)) (cdr elt))))
(items (nthcdr 2 (assq (car elt) items))))
(if (not items)
(cdr elt)
(error "Missing `%s' item" (cdr elt))))
(let ((alist (nthcdr 3 item))
(stack (nth 1 elt))
(alist (nth 1 elt))
(item (cdr elt))
item
;; Remove the empty item.
(nitems (cons (cons (member elt item) nil))
(nitem-list (nthcdr 3 item) nil))))
(if nitems
(error "Missing `%s' item: %s" item elt)))
item))
(defun org-babel-item-narrow-stack-to (el)
"Move the NarrowStack to the next item in the NarrowStack in EL."
(if (consp org-babel-item-narrow-item-list-and-stack)
(setq el (cons el
"%file: samples-20500"
======== SAMPLE 1 ========
if (integerp pos)
(string-match "\\([ \t\n\r\f \t]+\\([ \t\n\r\f \t]+\\)\\([ \t\n\r\f \t]+\\)[ \t\n\r\f \t]\\|\\<")
(setq pos (string-match "-$")
t (string-match (substring 0 pos)))))
;; If it's just an empty string (e.g., `<=), try with `pending'
;; to guess the match.
(when (or first (>= (aref pos 0) first)
(>= (aref pos 1) first))
(save-excursion
;; If we could match by looking the current value of `<',
;; we could skip over the `:', so that any `: =' part of
;; `pending' matches the return value.
(when pending (goto-char pending)
(setq end nil))))
(when (carp pos)
;; Match the first part of the current expression.
(setq end t)
(setq end (match-beginning 1))))
(if (or pos (eq (car-safe begin) t)))
;; We skip over the `:' parts of the input.
(let ((n (aref pos 1)))
(cond (pending (car pos))
(pending-parens 1))
((or (funcall pending-pairs)
;; Otherwise, let's only match in some
;; case (including `<' and `: =').
;; For the next two cases, we don't count
;; nestedparens, unless we're sure. That
;; could be done with `:=' that's used
;; for other places on the expression.
(pending-pairs 0)))
((or (funcall pending-pairs)
(progn (setq pending nil)
(condition-case nil
(funcall pending-pairs (cdr pos) t)
pos
(funcall pending-pairs (cdr pos) t)))
(unwind-protect
(progn
(setq n pos '< t)
(setq t pos))
;; FIXME: We'd need to be able to tell
======== SAMPLE 2 ========
if-
;; FIXME should never require that, but some implementations are. That's
;; too big when you have large strings but some small ones.
;; In this case, it's best not to use any of the above!
;;; <jwjw@japantismel.com>: http://jwj.org/
;;; (jwwjw@japantismel.com)
;;; :;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defconst awk-auto-c++-help-alist
'(((symbol :tag "Auto" . awk-auto-cache)
. ,_)))
(defconst awk-auto-cpphelp
'((eval :tag "auto" (symbol :tag "cpp-language")
`(,_
. ,_))))
;;
;; Make files with auto-C++ features
;;
;; :;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; auto-C++
;;
(def-edebug-spec (list 'no-auto)
"List of `no-auto' symbols.
List of auto-C++ functions, not included inside the first element."
:group 'auto-compress
:type '(list
; list of Auto-C++) symbols
;; `C++-mode-def-list' may have a car that is `auto-c++-auto'.
;; Auto-C++-alist is the list of functions of this class.
(cdr (assoc list awk-auto-cpp-car-table))))
(defvar awk-auto-cpphelp-template-alist
'((auto-C-cpp-mode-def-list-alist
auto-C-cpp-mode-def-list-template))
"Alist of auto-C++ functions.
Each element of this alist is a function (declare(cannot(cannot(cannot(cannot(cannot(cannot(cannot<auto<>()<>()<>()<>()<>()<<>()<>()<>()<()>()<*()<*()<>()<>()<*()<*()<*()<>*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*()<*=<=<=<=<=<=<><><>=<=<><>=|>|>|>=|>|>?<>?<>?<>?|>|?/<>;<|;|?/<>?|>|>|?|>?<>|>?=|>|>|>|?|>|>|?|>?<>|>|>|?|>|>|?|>|?<>|>|?<>|>))
(C-tag
(symbol :tag "C++-mode-def-list" nil))
"Alist of auto-C++ functions."
:group 'auto-cpp
:link '(custom-manifest-link :tag "Tool bar" :type 'string)
:description "Template alist"
:link '(custom-manifest-link :tag "Tool bar" :type 'string)
:link '(custom-manifest-link :tag "Tool bar" :type 'string
'(custom-manifest-link :tag "tool bar" :type 'string)))
(defvar awk-auto-c++-file-alist nil
"Alist of auto-C++ file names."
:group 'auto-cpp
:type '(alist :key-type (mapcar (function :tag "Template" :value-to-alist) :value-value))
:version "24.4"
:link '(custom-manifest
======== SAMPLE 3 ========
ififis_nest (aref math-marray (aref math-vec one))
(cond (math-mul (math-marray one) (math-mul (math-marray two)
(math-mul (math-marray one)
(math-marray two)
(apply 'math-equal math-subset)
math-matrix)
math-subset)
(math-mul math-vector two))))
(and (eq 0 (car-safe mat) nil)
(let ((math-get-vec math-vec) (math-get-vec math))
(while (not (or (null mat)
(eq 0 (math-mul math-vector two))
(aref math-vec (math-marray one))
math-matrix))))))
(and (eq 0 (car mat) nil)
(let (math-vec) (math-vec math) (math-get-vec math))
(while (not (or (null (car mat))
(null (cdr mat))
======== SAMPLE 4 ========
if (not (getenv ""))
(get-text-property (point) 'getenv)))
;; When necessary, remove all non-ASCII prefixes
;; from the prefix order.
#(getenv (prog-list #'set-initial-value (getenv 0))))
;; Add extra prefixes and remove the special prefixes!
(setq #'getenv (getenv-variables env 'list))))
(defsubst mb-read-read-first ()
;; Make sure `read-default-initial-values' is set
(let ((default (read-default-initial-values)))
(when (null read-default-initial-values)
(make-sparse-keymap
(let ((default-initial-variables mb-read-initial-variables)
(default-initial-syntax mb-read-initial-syntax)
(initials-default-initial-syntax nil))
(define-key initials-default-initial-syntax 'read-default)
(define-key initials-default-initial-syntax 'read-default (buffer-substring
initials-backward-word 1)
initials-start
initials-forward-word)))
(put-text-property initials-default-initial-syntax 0
(preceding-char)
(following-char))
(set-keymap-parent initials-default mb-read-initial-variables)
(put-text-property initials-default-initial-syntax value
(preceding-char)
(following-char))))
(put-text-property initials-default-initial-syntax value
(preceding-char)
(following-char))
;; We remove the initial chars when we add new chars (e.g. when new
;; character chars are added). Also, we change the initial chars
;; when an initial chars is added.
(put-text-property initials-default-initial-syntax value
nil
(preceding-char)
(following-char))))
(defsubst mb-parse-field-or-field-regexp (prompt)
;; FIXME: This does not support multiline-fields.
;; FIXME: We can do a better job of parsing those than single-
"%file: samples-20400"
======== SAMPLE 1 ========
(setq cb-new-pos
(if (= (save-excursion
(if (zerop cb-new-pos)
(forward-line 1)
(cond
;; If the buffer is the last one, we want to do
;; something to make sure the right side gets
;; up.
"as up as the first one"
nil
;; If we put more than 1 character on the
;; new line, keep it.
(let* ((bibtex-new-name-end (or (save-excursion
bibtex-name-re
(bibtex-new-name-end)))
(current-buffer))
(forward-char 1)))))
cb-name-end))
(progn
(setq cb-new-pos
(if (= (- cbp-new-beginning c-new-pos) (previous-single-property-change cbp-new-beginning
c-new-pos))
(prog1
(save-excursion
;; Put after every new line!
(setq bibtex-new-beginning nil))
(if (eq
======== SAMPLE 2 ========
(setcar org-list-index-string
(mapcar 'org-list-index-string index)))
;; Try
;; (let ((len (length org-list-index-string)))
(while (org-list-get-char-property (match-beginning 0) 'end)
(and (> len 2) (setq len (1- len))
(org-list-get-item-p 'item 'end)
(and (string-match
(concat "[(\\)]| \"[ \t]")
(match-string
(concat "[<]"
(match-string
(concat "\0"
"\\(["
"]"
(match-string 0
(match-end 0)))
(org-list-get-item-p 'item 'end))
(org-list-get-charset-list 'charset)
(org-list-get-charset-list-property 'charset)
(or attr (and attr (eq attr 'charset)))))))
;; "charset" here is of the form
;; "charset" in "enumerator" above.
;; This is of the form "charset" in "enumerator",
;; in "enumerator" this is of the form
;; "enumerator" of the form
======== SAMPLE 3 ========
;; if (file-exists-p tmpfile) we find it.
(if (file-remote-p tmpfile)
(setq tmpfile (expand-file-name tmpfile name)))
(error "Can not find tmpfile for %s" tmpfile)))))))
(cond
((eq type 'copy)
(insert "\n" (if (memq type '(copy/delete files for file access))
"* Copy & "
"* Delete & "
"* File Access & "
"* Access Access & "
"* File Access & "
"* File Access & "
"* File Access & "
"* File Access & "
"* File Access & "
"TEMPLATE/LIST"
(concat ":" tmpfile ":" tmpfile)
"")
((eq type 'copy)
(delete tmpfile)))
((eq type 'delete)
(if (memq type '(copy/delete files for file access))
"* Copy | "
"* Delete | ")
(concat ":" tmpfile ":" tmpfile))
((eq type 'delete) (insert "\n")
(if (memq type '(copy/delete files for file access))
"* Delete | "
nil t)
(insert "\n"))
((eq type 'list)
"* List | ")
(if (memq type '(list/list-list list-list))
"* List-List | "
"\n ")
(nconc tmpfile (if (memq type '(list/list-list list-list))
"\n")))))
t)
======== SAMPLE 4 ========
;; no further explanation needed
(when (or (and (< (window-height) window-previous) (> 0 window-previous))
noforce)
;; We use the current line's width, but limit to the
;; height of the current window's window
;; and adjust accordingly to the height
;; of the window with the most windows and of the
;; least windows in the window's frame.
(when (not (equal (window-root-size window-previous)
(1- window-previous)))
(setq window-previous window-previous)) ; no further explanation needed
(let (other window-previous)
;; Don't adjust to the same height as the current window.
(when other
(setq window-previous window-previous)
(or window-previous
;; Don't try to move it by two pixels.
(when (= (- (window-width window-previous) 2) window-previous)
(push (window-start window) other)
(setq other (window-next 'normal)))
(push window-previous other))
;; If the window's frame is full, and no more windows will follow it,
;; it's best to keep this part of the window frame.
(when (and other (null window-previous)
(equal (window-root window-level) other)))
(setq window-previous (selected-window)))
;; Otherwise, don't move the window.
(while window-previous
(setq (setq window-previous (/ (window-size window-level) 2)
(window-left window-previous))))
;; Don't move the window itself.
(unless (zerop window-previous)
(setq window-start nil)))
;; Adjust the window's frame accordingly by moving the
;; window's frame.
(when (cdr (assoc window-start other)))
;; If we're moving the same window, try to move it first.
(when (member window-start other)
(setq other
(or window-st-size
(if (eq (window-top) window-st-size)
(window-top 'normal)
(window-top 'extra-highlight)
(window-top 'default)))))
;; Otherwise, try the next appropriate frame.
window-start
;; Don't try to move the first frame.
(unless (member window-start other)
(setq other
(or window-st-size
(if (eq (window-top) window-st-size)
"%file: samples-20300"
======== SAMPLE 1 ========
" ")
("_(" " ", "a1" "0" "a2" "1")
(1+ (floor (current-column)))))
("_"
"a2"
"a3"
"b1"
"b2"
(1+ (floor (current-column)))))
("_"
"b4"
"b5"
("_"
"b=")))
("_"
"b=")))
(and
(save-excursion
(skip-syntax-backward "w_\n")
(and
(forward-char -1)
======== SAMPLE 2 ========
(error "%s: Syntax error in file '%s'" file)
;; We check for syntax errors during the file
(when (and (file-error-unless-debug "File not found: %s" file)
(save-excursion
(goto-char (point-max))
(looking-at "\\s(.*\\)\\s?")
(file-syntax-table))))))
;; We check for syntax errors during the file
(when (and (file-syntax-checking-p file)
(error "%s: Syntax error in file '%s'" file))
;; We do not check for syntax errors during the file
(when (file-syntax-checkp file)
;; We ignore the "no syntax error" warnings generated by the
;; file parsing routine, since we do not check it
(error "%s: File parsing routine is invalid" file)
;; Check that the new syntax is syntactically correct by looking for the
;; next new syntax
(and (not (file-syntax-table))
(ignore-errors
(not (eq (buffer-substring (match-beginning 0) (line-end-position))))))
;; We check the syntax before making the new one.
(and file ; No new syntax needed
;; We check before the syntax is syntactically correct, because it might be
;; not correct at all once the new syntax finishes.
(setq syntax (if (eq syntax 'proper-looking-at-new-positions)
syntax
(not (file-syntax-table-p syntax)) ; If it is still not correct.
(not syntax))
)))
;; Make sure the new syntax is syntactically correct.
(when syntax
(funcall (cl--get-attribute-from-syntax file 'beginning-of-file) syntax)
;; Make sure the syntax is syntactically correct.
(error "Error in `file-syntax-table' for syntax change"))
;; Make sure syntax's next element is the last element of the next
;; syntax preceding the "beginning-of-line" in the syntax table.
(if (eq (cl--get-attribute-from-syntax file 'end-of-line)
(assoc file syntax)) ; Found one.
======== SAMPLE 3 ========
nil t)
(setf (car l) value))
(push (cadr l) value)))
(push item (list value)))))
(setq list-new (cdr list-entry)))))
(defun mairix-make-pair ()
"Put the first pair from LIST into the new one.
The first pair shall be the number of occurrences into LIST.
Each pair of the list shall have the form
(LIST (ARVAL . PLOT) . VALUE).
ARVAL is either the first pair or nil.
PLOT is the first pair in LIST to start the operation.
Optional argument VALUE is of the form
(ARVAL POD . VALUE). The return value is an alist whose elements
`list', `new', `elt' and `elteltplace' are of the form
(ARVAL ARVAL . PLOT VALUE).
Optional argument OELOTLEVEL
is the value of `all-keys-cons' that should be included in the results.
The default value is `maxlength'
"
(interactive)
(unless (or (memq major-mode mairix-mode-map)
(symbolp (car list-entry))
t
(and list-new
(or elt
(symbol-function (lambda (x)
(or (and mairix-marker
(eq major-mode 'minor-mode)))))
nil)
;; (if all-keys-cons, the first pair will not be in the
;; list).
(and (listp list-new) (symbolp list-new))
`(list-pair ,list (car list-entry))))))))
;; The only difference from the default is that the keys to the
;; list are of the form: (LIST (ARVAL . PLOT). The second pair of
;; PLOT shall be the number of occurrences into LIST. The third pair
;; is the first pair not in LIST.
(defun mairix-insert-pair ()
"Insert the first pair of the list into the new value.
The second pair of the result shall be the list. The third pair
should be the name of the value."
(interactive)
(unless (or mairix-marker (zerop t)) t)
(unless (stringp (car list-entry))
(mairix-mark-insert-string 0 0))
(with-silent-modifications
(let ((item (car list-entry))))
(with-current-buffer mairix-buffer
(let ((new (mairix-make-pair t)))
(while items
(setf (car items) new)
(setq new (car item)))
(let ((len (length mairix-list))))
(delete-region 0
======== SAMPLE 4 ========
(setq i (1- k))
(while (and (> k (1- (length k)) 0))
(setq x (1- (length x)))
(while (>= k 1)
(setq i (1+ i)))
(if (>= max (length x)) 0
(setq x (1+ x))))
x)))
;;; Compiling.
;;; Internal variables.
(defvar calc-map-region (map)
"Global map of all `calc-map-region-internal' functions.")
(defvar calc-map-region-internal 'overlaid)
(defvar calc-get-buffer-function nil
"Function to call when we get in the local buffer.
Should only be called for local use. It takes one argument ARGS and should
return in the form (ARGS (EXPANSION ARGS) BEG END).")
(defun calc-get-buffer ()
"Return non-nil when the buffer is in a new location.
If the command `calc-get-buffer' returns non-nil,
then return the current region. This function is intended to be
used in the minibuffer."
(if calc-get-buffer
(calc-buffer-list)
(save-excursion (goto-char (point-and-blank)))
(or (current-buffer)
(not (point-marker)))))
(defun calc-get-region ()
"Return the region of the buffer containing this region."
(let ((end (calc-buffer-region (line-beginning-position) (point))))
(calc-do-region (concat ":" elt ":")))
(let ((minibuffer-hidden (if (< (current-column) calc-buffer-list) calc-buffer-list))
(i 0))
(or (or (eq minibuffer-hidden 'hidden)
(and calc-invalid-minibuffer-commands))))
(cond ((equal i 0)
(setq i (1- i)))))
(defun calc-set-buffer-size ()
"Set the buffer size to the correct value."
(and (and (setq calc-buffer-list (nth (1- calc-buffer-list) 0)
calc-buffer-list))
(- calc-buffer-list (1- calc-buffer-list)))
(setcar calc-buffer-info (nth calc-buffer-info i) (nth calc-buffer-info i))
(let ((minibuffer-hidden (if (< (current-column) calc-buffer-list) calc-buffer-list)))
(or (setq minibuffer-hidden 'hidden)
(and calc-invalid-minibuffer-commands))))
(defun calc-set-current-buffer (&optional n)
"Set current buffer to the current region."
(interactive)
;; If point is inside the current region, we don't know that
;; anything is up here. So we try and return nil.
t)
(defun calc-kill-current-buffer (&optional n)
"Kill current buffer."
(interactive)
;; Handle the error here.
(let* ((last-pos (- (point-max) (point)))
last-pos
(left calc-current-left)
(center (- (point-max) last-pos))
(current (min (1+ cv)))
(old (min (1+ cv) 0))
(new (min (- top calc-current-left) old new)
(- bottom calc-current-top
"%file: samples-20200"
======== SAMPLE 1 ========
t3 ; Don't display the following
t1 ; Don't display the previous
t2 ; Don't display the previous
t1 ; Don't display the previous
t2 ; Don't display the previous
t3 ; Don't display the current
t1 ; Don't display the previous
t2 ; Don't display the current
t3 ; Don't return nil.
nil))
(setq newtab (if nil
(cons (if (fboundp newtab) (car newtab) newtab))
)
tablen (= newtab1 tablen))
(let* ((tabnum 0
(table (make-syntax-table)))
(tablen (1+ tablen))
(t2 (make-syntax-table)))) ; Don't switch tabs.
(t (cond
(tabnimap
(make-syntax-table))))
;; Don't break tab to make it easy for the user to navigate.
)
;; This is an alist of the characters the user types to move around
;; (one can use different alists but this is slower at least...
;; This is one way of making it faster to use a non-interactive
;; alist.
(t ?a table)
(t ?c table)
(setq newtab1 (if nil tabnimap
======== SAMPLE 2 ========
))))
(< (or (eq (cdr (nth 0 i) (car (nth 1 i))) . cadr) 0)
(setq cadr (math-reject-arg
(list (nth 6 i) ", "
(format-message "%s: Invalid argument to %s"
(progn (nth 1 i)
(setq i 0)
(and (numberp (nth 1 i))
(setq i
(1- i))))))))
"")))))
(setq i (1- i)))
(if (= (aref i 0) ?{)
((Math-zerop (cdr i))
(setq i (1+ i))
(if (= i 1)
(progn
(setq i (1+ i))
(while (and (funcall math-exp-function i)
(> i 0))
(setq i (1- i))))
(setq i (math-expand-expr-cont-p i)))
(setq i (1+ i)))
(math-expand-n-exponents i)))
;; FIXME: There's not really a lot of space.
(let ((i 0) (c (math-expand-expr-subn i))))
(cond ((and (< i 3) (eq (car c) 'eqn))))
((and (> i 1)
(setq i (- (math-abs-size n 1) (math-abs-size n 2))))
((and (< i 1)
(setq i (cons (math-expand-nonneg (car c) i) i)
======== SAMPLE 3 ========
(gnus-current-message
"gnus-summary-save-buffer %s"
gnus-summary-save-buffer
(if (equal
gnus-summary-save-buffer-all
(gnus-summary-buffer-all)
"gnus-summary-save-buffer:"
(unless (equal (gnus-summary-buffer-all)
gnus-summary-save-buffer-nofile-all)
"gnus-summary-save-buffer-all "
(or gnus-summary-save-buffer
(gnus-summary-buffer-all)
"use-after-all " gnus-summary-save-buffer)))
(gnus-summary-unread-buffer t))))
(defun gnus-summary-save-buffer ()
"Save the current buffer into the Gnus Summary buffers."
(interactive)
(with-current-buffer gnus-summary-buffer
(let ((buffer (current-buffer)))
(when (and (eq (buffer-name buffer) t)
(gnus-find-file-noselect buffer))
(gnus-summary-save-buffer))))))
(defun gnus-summary-buffer-list ()
"List summary buffer names in `gnus-summary-buffer-alist' for Gnus."
(unless (eq nil (gnus-summary-buffer-alist))
(let ((inhibit-read-only t) (buffer-name (current-buffer)))
(set-buffer-file-coding-system buffer-name)
buffer-name))))
(defun gnus-summary-buffer-list-as-string (buffer-list list &optional buffer-number nntree-user-full-name)
(let (list)
(buffer-list (append gnus-summary-buffer-list t))
(while list
(set-buffer (find-file-noselect buffer-list nil t))
(buffer-list)))
list))
(defun gnus-summary-save-buffer (&optional buffer-number buffer-number nntree-user-full-name)
(interactive)
(with-current-buffer buffer-number
(let (buffer-list gbuffer-list)
(gnus-summary-buffer (if buffer-number gnus-summary-buffer-for-group gbuffer-list)
gnus-summary-buffer-full)))
(when (and (zerop nntree-user-full-name) (gnus-summary-buffer))
(when (looking-at gnus-summary-article-start-re)
(let ((match (match-string 1 )))
(gnus-summary--with-buffer buffer-number
(gnus-summary-buffer-full t
======== SAMPLE 4 ========
(setq type (cdr (symbol-value type))))
(progn
(setq type (cdr (memq type (cdr type))))
(setq vc (cdr (cons vc type)))
(let* ((p (get-string (symbol-name form))
(funcall (lambda () (cdr
(car form)
vc form))))))
(if (string-match "\\([^ ]+\\)" p)
(replace-match "" (syntax-ppss c-literal-p))))
(cond
((re-search-forward "\\|%s\\|&\\|\\=\\(\"\\)\\(\\`\\)\\)?\\([^ ]+\\)?\"" nil t)
(concat " "
(regexp-opt (syntax-ppss c-literal-stmt form 'literal)) ""
"\\+"
nil t))
((re-search-forward "^\\([^ %s]\\|\\|\\)\\$" nil t)
(replace-match "\\([^ ]+\\)" nil (syntax-ppss c-literal-stmt form 'literal))
nil t))
((re-search-forward "^\\([^ ]+\\)" nil t)
)
(t
(let ((eol (line-end-position))
(beg (save-excursion
(re-search-backward (concat "^" (regexp-quote beg) "\\("
"\\)")
(match-beginning 0))
;; The following are some of the rules as they're being
;; processed by the parser and can't be ignored
;; by the user since we may change this with Emacs
"%file: samples-20100"
======== SAMPLE 1 ========
The (string) type spec (or nil)
;; in the body of the file which should go before the spec. The car
;; of the spec is the string to start with.
;; The value of the `org-type-spec' property is returned in a new plist
;; if it changes any of the existing `org-type' specifiers.
(autoload 'proto-face 'org-font-lock-face "Proto" nil t)
;;; Code:
(defalias 'org-default-face 'proto-face)
(autoload 'org-default-font-lock-face "Org" nil t)
(autoload 'org-font-lock-face "Lantern" nil t)
;; Don't allow the option nil (or nil-style) as an option in the mode line, so
;; just use the default.
(autoload 'org-get-variable-value "Org" nil t)
(autoload 'org-get-variable-value "Org" "org" nil t)
;;;###autoload
(defun org-set-variable-value (var value type)
"Set variable VALUE to VALUE from the mode line, using `org-variable-default-value'.
If an invalid value is found, the variable is then returned as
nil if it doesn't exist, if it doesn't exist, nil for an unknown value.
This function is suitable for use at creation time."
(declare (indent 0))
(let ((default-value (and (plist-get var :format) value) var)))
(define-key global-map (vector 'set))
(define-key c-keymap (vector 'set))
(define-key c-alt-keymap (vector 'set))
(define-key c-alt-down keymap (vector 'set))
(define-key c-alt-up keymap (vector 'set))
(define-key c-alt-left keymap (vector 'set))
(define-key c-alt-right keymap (vector 'set)))
(if (listp value) (setq value value))
(with-temp-buffer
(when (buffer-live-p org-buffer)
(goto-char (point-max))
(setq org-display-time-displayed t)))
(when value
(when (and (consp value)
(string-equal (cl-find-if t nil) value))
(funcall (and (cdr value) (boundp 'variable-value-alist))
variable-value-alist)))))
;;;###autoload
(defun org-setup-var-set (&optional var)
"Get the value of the entry in the variable set variable VALUE.
This can be used in multiple buffers, to set up a global value when
a variable is set."
(let ((var (org-entry-get))
(value (or var org-default-value)))
(when (and value (string-suffix-p value))
(let (found found)
;; It can't be an option or a local value but a value set
(setq found (copy-sequence value))
(when
;; Only have a single value. We ignore all modifiers
(and
(< (length val)
(let ((txt (make-string (length val) ?\n)))
(list (format str val)))
(setq val (make-string txt 1))))
(push val t)
found))
(setq var (assq var org-default-variable-alist))
======== SAMPLE 2 ========
The current buffer has been edited. If the text is the last text on the last line of the buffer, and the line is not a comment, the text is the last line in that comment.
If point is on a non-comment line, and point is within a comment, and the comment on the line is a comment,
use the current buffer to update its text."
(interactive "p")
(let ((text (current-buffer)))
(if (and (null (window-live-p text)) ;; if window exists then kill it before
(not (zerop (window-height (window-top (get-buffer-window text))))))
(kill-all-local-variables)
(message "")))
;; Update the old buffer.
(sit-for 1)
(let ((start nil))
;; If the last line of text on this line is a comment, do nothing.
(unless (buffer-live-p (current-buffer))
(goto-char start (point-min)))
(let ((indents 1)
(indent 1)
;; The preceding block will be indented as if it were a \
;; comment. This includes the comment line as well as comments that
;; are just \\\ statements in the comment line.
;; (Bug#191656).
(forward-line indent)
(while (and (not (eobp)) (looking-at "[ \t\n\f]"))
(while (fboundp 'comment-revert-mode)
(when (looking-at comment-revert-mode-regexp)
(replace-match "
" t comment comment t)))
(forward-line indent)
(while (match-end 1)
(replace-match comment t)
(goto-char (point-min))
(comment-revert-mode)))
(goto-char (point-max))
(when (re-search-forward "^\\(\\`\\|[^[.]\\)=[0-9]+]\\*" nil t)
(setq end (match-end 0))
(setq end (replace-match '`[^[.]\\) nil))))
;; The comment has the same content as the previous line.
(when (and (consp text)
(not (eolp))
(zerop (eobp))))
;; The comment has the same content as the previous line.
(when (and (consp text)
(not (eolp)))
(save-excursion
(re-search-forward "\n" nil t t)
(while (looking-at comment-comment-reinsertion-regexp)
(and (not (eolp)
(zerop (eobp))))
(setq indent (1+ indent)))
(unless (and (not (bolp))
(not (eq indent t)))
======== SAMPLE 3 ========
The '-c' in C-c C-x )
(or (and (not c-lparen) c-lparen-c-end)
(and (or (null c-c-re-end)
(> (- (point) (aref c-c-last-openin-offset 0)) ?-)
0))))
(t (c-forward-line 1))))
(if (and c-lparen-hline
(not (c-in-paren-p))
nil
(save-excursion
(goto-char c-lparen-p)))
(goto-char (1+ (c-lparen-p))))
(or (null c-c-hline)
(and (or (eolp) (= c-c-hline 1))
(>= c-c-hline 1))
(let ((indent-tab-1 (c-after-indenting-hook-p))
start)
()
(insert (concat c-c-hline
" (C-c C-h "))))))
(defun c-insert-block (&optional ignore)
"Like `insert-block-1', but should only be called when `c-insert-block-1' is nil!"
(save-excursion
(unless (looking-at c-indent-column)
(setq c-insert-block-1 nil))
(c-insert-block 1)))
(provide 'c-c-syntactic)
;;; c-c-syntactic.el ends here
<|endoftext|>;;; c-c-defer.el --- C code comment and comment line control functions
;; Copyright (C) 1992-1995, 1998-1999, 2002-2019 Free Software Foundation,
;; Inc.
;; Author: (GregorianGregorian date: 1993.08.21 14:23:11)
;; (Gregorian date: 1994.01.24 14:47:19)
;; (Gregorian date: 1995.09.17 11:21:10)
;; (Gregorian date: 1996.05.15 19:34:38)
;; (Gregorian date: 1996.08.25 19:30:35)
;; (Gregorian date: 1997.01.12 13:24:13)
;; (Gregorian date: 1997.07.23 11:59:55)
;; (Gregorian date: 1998.01.12 15:08:21)
;; (Gregorian date: 1998.03.15 17:27:21)
;; (ApostolicDate: 1998.05.14 10:28:50)
;;
======== SAMPLE 4 ========
The
;; function may be called on a command sequence with ARG and optional
;; arguments. The ARG is the minimum length argument to the ARG, and
;; ARG will be replaced with the length of the argument to the FUN.
;;
;; If the argument is a number, then each argument is interpreted and its
;; result is interpreted as a number.
;;
;; A FUN command may call with two arguments, either a single
;; argument or a list of arguments, or a single argument with an ARG of 2. The
;; argument is interpreted as a single argument to the command (otherwise the
;; result will end up outside of it). A more complicated
;; example is a command that may use a single argument to read a
;; file.
;;
;; FUN is a Lisp function that does all the work of the command
;; for a buffer. If some other buffer other than the one listed
;; is open and there is a command, then it is called with two arguments as
;; the first argument, ARG of the first. It is therefore a
;; reasonable idea to provide a function that reads a file and then calls
;; FUN with two arguments, one for reading and one for reading, if we
;; have to read it again later. This would be a very fast
;; procedure that might do more if we wanted to see the value
;; of `org-export-read-file-name' multiple times. Also, it would be
;; less wasteful to do the whole job on one call than the four in it.
;;
;; See the documentation of `org-export-read-file-name' for the general
;; meaning of FUN's arguments.
;;
;; FUN is available from the command-line's variable `org-command-function-alist'.
;; If given just RETURN, then FUN can be any function. (This is a
;; very common mistake in export code).
;;
;; FUN may also be a form which can be used to execute a command, to be
;; executed in another form, or to bind to a key without the help
;; of the user. These are the commands to use:
;;
;; nil -- no binding
;; -- binding
;; [B][S]+|[X]|[Y] | [K] | \\[n-c][L][W][S]
;;
;; FUN is a Lisp form which can be used to execute a command. It can
;; be used to bind to and evaluate a key, and bind to a key without
;; the help of the user. (The key binding is not controlled by
;; `org-export-read-file-name'."
;;
;; A command can be passed its first and second arguments as a function.
;;
;; If the function is bound to any key-binding, and it returns the
;; key binding, then the function (if it exists) returns the corresponding
;; KEY BEG . The second argument may be anywhere in the buffer. The
;; third argument may be anywhere in the function or in the buffer without a
;; buffer.
;;
;; Return a function, a function binding, a function being read and
;; then a return value.
;;
;; Each arg to the function is interpreted as an ARG of 2 or 3. The
;; second argument of the function is the corresponding ARG. The ARG may be
;; one of one of a number, a function name (also a single keyword),
;; a function specifier, or an expression.
;;
;; If the function is bound to any function, then all the relevant
;; keys and bindings are read by the function. This means that you
;; can't bind any key of a function and you can't bind any function in
;; a function-list which can't be bound to any key of a function.
;;
;; The binding of a function is like the binding of a key in Lisp.
;; NOTE: These functions are not meant to be used in exported
;; files; instead, they are used to export a single file. However, if you
;; want to bind a key to a list of functions, then the following
;; definitions are required:
;;
;; A function can bind
"%file: samples-20000"
======== SAMPLE 1 ========
mantant
"\
List of all classes. See documentation for format of
%%
(C-P (intern (downcase c-class-alist))
%%
(C-A (downcase (symbol-name class-alist) default))
\(C-I C-P C-I C-L C-T \\[C-P]) \\
(C-P \\[C-P] C-P C-T \\[C-P])
\(C-I \\[C-A] C-I \\[C-O] C-O \\[C-P] \\[C-O])
If the function is a macro which can be
a classifier of the form:
(FUNCLASS C-CLASS-ARG). If you are unsure,
check the classifier or function of this macro.
C-I \\[C-I] C-I \\[C-I])
If called within another function, then the C/O list also is used.
Note that the C-A list (C-P C-I) is the same format as in
C-I, but is not the same as in C-A.
\(C-I,C-A,C-I \\[C-I C-I]) \\[C-I C-I])
\(C-I C-I [C-I])
If you add an expression to the C list:
(FUNCLASS C-CLASS-ARG . . . . )
with `c-indent-register-function' then the list is automatically added
to the end."
(defvar c-indent-register-function)
If you have to do the math on them:
c-indent-register-function is defined in C.
((C-P C-P)
(insert " " c-indent-register-function))
(goto-char (point-min))
) ; this works for macros which do not have a macro, but
they are typed in.
C-S ; don't have a macro.
(defsubst c-sig-symbol (symbol value)
(cond ((eq symbol value)
(setq symbol (symbol-value symbol))
(setq symbol 'sig)))
((c-sig-symbol symbol value)
;; `c-lit-list' is not a cons cell.
(setq c-sig-list symbol value)
((and (eq symbol (eval symbol)))
(setq (eval symbol) c-lit-list))
((consp symbol)
(error "C-sig[0 -] cannot find a sig")))))
(defsubst c-lit-list (symbol val)
(if val
(error "C-lit-list is undefined")))
(defsubst c-lit-list-re (symbol value)
(list symbol val)
value))
;;; Compilation/Markup/Markup/C-E
(defvar c-lit-list-re nil
"Regexp from which a prelude may be compiled if it is not a literal.
If it is a regexp that is different from a literal, it is replaced by the
literal."))
(defvar c-lit-list-re (or (null c-lit-list-re) (cddr-lit-list-re))
"Regexp from which a prelude may be marked up, if it is not a literal."
:type 'regexp
:risky t
:version "26.1")
(defvar c-lumin-list-re (or (null c/lit-list-
======== SAMPLE 2 ========
mantant is nil.
Return t if the point is in `forward-brace-to-point'. There is nothing to
return if point is on the first line, or if there is no
beginning or end of point."
(save-excursion
(beginning-of-line)
(and (eq (backward-char) ?\()
(eq (char-after) ?\)
(forward-line 1)))
(forward-line (if (looking-at "") (1* (point)))))
(goto-char beg)
(forward-line
(if (not (looking-at "") nil (goto-char beg))
(while (and (not (looking-at ?\[))
(not (looking-at '\\\^ (looking-at "")
(match-beginning 1))))
(setq end (match-end 0))))
;; Move point to be at end of line.
(skip-chars-backward " ")
(skip-chars-backward " \t\r")
(forward-line
(while (and (looking-at "") (not (looking-at "")
(not (looking-at (match-beginning 1)))
(not (looking-at " "))))
(set-visited-entry next)
(if (and (looking-at " ")
(not (looking-at " ")))
(progn
(skip-chars-backward " / ")
(skip-chars-forward " ")
nil))))
(defun cperl-indent-comment-line-function ()
(add-hook 'post-self-insert-hook #'cperl-indent-comment-line-function))
(defun cperl-indent-comment-line-function ()
(add-hook 'self-insert-hook #'cperl-indent-comment-line-function)
;; FIXME: Use a function so that it can get a better (but faster?) display.
;;(add-hook 'self-insert-hook #'cperl-indent-comment-line-function)
;;(add-hook 'self-insert-hook #'cperl-indent-comment-line-function)
(define-key cperl-indent-comment-line-function 'coding-system-map)
;; This function, if it exists, is also called by the default-directory for
;; cperl-mode.
(set (make-local-variable 'self-insert-hook) nil)
(setq-local cperl-indent-comment-line-function 'coding-system-map)
(set (make-local-variable 'self-insert-skip-hook)
(make-local-variable 'coding-system-hook-list))
(add-hook 'post-self-destruct-hook #'cperl-indent-comment-line-function nil t)
;; Make sure we're in a comment buffer, not inside a comment.
(add-hook 'self-insert-hook #'cperl-indent-comment-line-function t)
;; This functions is called once per `coding-system-alist'.
;; It is used to get a better display, but we must make it work with cperla
(add-hook 'self-insert-hook #'cperl-indent-comment-line-function)
(add-hook 'post-self-
======== SAMPLE 3 ========
mantory, if that is not a regexp
\(\"\\|\\^\"\\|\"@\\|\"\"\\)\\(?:\"\\|\"\\)\\)\").
For example, if `mh:/b.sh' is a line containing the regex:
#e.sh
\\[[0-9]+\n\\]*\\(?:\"\\|\"\\)[\"]\\(?:.*?\\)[\"]")
"
(match-string 1)
"Regexp specifying `mh:/b.sh' regexp to search for file names.
\\[[0-9]+\\]*\\(?:\"\\|\"\\)[\"]\"")
;; (setq vars (concat (regexp-opt vars) "(\"\\|\"\\)\""))
(mh-find-file-in-tree (and (mh-regexp-definition cvs-tangle-root)
(match-string 1)
(match-end 1))
(match-string 2)
(match-string 3))
nil t)))
(defvar mh-search-mime-search-function nil
"A function which searches MH-IMPORTANT messages.)")
(setq mh-search-mime-search-function
`(progn ,@mh-search-mime-search-function),
vars)
(defvar mh-search-mime-search-function-c
(if (mh-buffer-live-p)
(function (funcall mh-search-mime-search-function-alist filename nil t)))
"Function used when MH-IMPORTANT messages are searched for.
This function may be used to filter MH-IMPORTANT messages.")
(defvar mh-search-mime-search-function-e
(let ((e (mh-buffer-live-p mh-search-mime-search-function-alist)))
(if (mh-exporter-buffer-p)
(let ((case-fold-search t))
(and (string= "\\(?:\\[[0-9]+\\]\\)*?:\\|:"-match-string-1 e)
(match-string e))))
;; For this we may also add a search function:
`(setq,@mh-search-mime-search-function-e
,e)
;; `mh-search-mime-search-function-e' has a higher precedence than `mh-search-mime-search-function-alist'.
(when (mh-buffer-live-p)
(setq mh-search-mime-search-function-e 'mh-search-mime-search-function-e))
,vars)
"Regexp containing search function used to search for MIME items.
This variable is local to `mh-search-mime-search-function-c'.")
(defvar mh-search-mime-search-function-e
(let ((e (mh-buffer-live-p mh-search-mime-search-function-alist)))
(if (mh-exporter-buffer-p)
(if e
(mh-search-mime
======== SAMPLE 4 ========
mantiff the following regexp (if there were) for all subgroups.
\\[default-match] #'setq regexp to match.")
(defcustom term-mark-all-subgroups-no-matching t
"Non-nil means mark a subgroup `term-mark-all-subgroups-no-matching'.
Only use `term-mark-all'.
If the term-mark-all-subgroups-no-matching `markers' is non-nil, do
only the `term-mark-all-subgroups-no-matching' rule on those groups
that are not marked; otherwise only the `term-mark-all-subgroups'
rule on the same group."
:type 'boolean
:group 'term
:version "22.1"
:group 'term)
(defcustom term-mark-all-subgroups-no-matching nil
"Non-nil means mark all subgroups with `term-mark-all-subgroups'
and return a list of all subgroups except term. If `term-mark-all-subgroups'
is non-nil, then use `term-mark-all-subgroups-no-matching'."
:type 'boolean
:group 'term
:version "22.1")
(defcustom term-mark-all-subgroups-no-matching t
"Non-nil means mark all subgroups with `term-mark-all-subgroups'
and return a list of all subgroups except term.
If `term-mark-all-subgroups' is non-nil, then use `term-mark-all-subgroups-no-matching'."
:type 'boolean
:group 'term
:version "22.1")
(defcustom term-mark-mode-hook nil
"Hook run on all modes that use `term-mark-mode'.
The behavior is the same as for `term-mark-all', except it is run
during the process of marking all subgroups in the current buffer."
:type 'hook
:group 'term
:version "22.1")
;;;_ + General settings
;;;_ ;; Other modes
(defvar term-terminal-name (if term-terminal-name-all-subgroups
'("emacs" "emacs-lisp" )))
;;;_ + other buffers
(defvar term-buffer-name (if term-display-buffer-list
'("buffer" "buffer-list"))
"Name of the buffer.")
(provide 'term/term)
;;; term/term.el ends here
<|endoftext|>;;; term/session.el --- session.el implements a session server. -*- lexical-binding:t -*-
;; Copyright (C) 1989, 2001-2019 Free Software Foundation, Inc.
;; Author: John Wiegley <johnw@gnu.org>
;; Keywords: terminals
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; The mode for viewing and manipulating an MS-Windows terminal.
;; There are three modes: Dired/Grep, and `term-dired'. The buffers
;; that are displayed are displayed with `term-display-buffer-list'.
;;
;; In each of the three buffers (M-x dired) the terminal is displayed in
;; M-display, and in the respective buffers on the left side
"%file: samples-19900"
======== SAMPLE 1 ========
start.
(not (equal (buffer-string)
(buffer-name (message-fetch-field "field")))))
(message (format "Found the file %s and type %s"
file type message
(buffer-name) buffer-name)))))
;;;----------------------------------------------------------------
(defun message-find-file ()
"Find the file associated to the file."
(interactive)
(cond
((setq message-type message-name)
(message-find-file message))
(t
(message "File: %s" message-name)))
(let ((file (current-buffer)))
(with-current-buffer file
;; Read the contents of the file and open it if it exists.
(unless (or (not message-in-file-p)
(buffer-live-p (current-buffer))
(eq message-type 'files))
;; Make sure if the file is local, the local file is already in
;; message. Don't allow remote files to exist; if
;; there is a local file, we just ask for the local one.
(with-current-buffer (file-truename file)
(if (string= message-type "remote")
file
(progn
;; We have not set the message type in the buffer
(when (and (eq message-type 'file)
(not message-type))
(setf (message-to-type message-type) message-type))))
;; Open the local file, if it exists.
(setf message-name message-type)
;; Update the message.
(message-update))
(message (concat
"Open the file " message-name
;; `expand-file-name'. If `file' is a file,
;; try to open it by looking in the current buffer.
(cond (file
(insert message-type "\n"))
(setq message-name (buffer-name))))
"%s"
"Expand file name: " message-type
;; `message-expand-lines' is always set to nil even when
;; `message-expand-files'.
(expand-file-name message-name)
message-type "\n"
(or (message-expand-files message-name message-expand-lines
======== SAMPLE 2 ========
start-directory \"/home/gnu/gnus-news/gnus-news.org\"
or
(gnus-news-file-name (match-string 1))))))
("FQAs"
(cond ((and (string-match eql
(file-exists-p
(buffer-file-name (expand-file-name
(substring
eql 100))))
(not (and (string-match ":" eql)
(/= (buffer-name (current-buffer)) ?-)))
(not (and (string-match "\\([0-9]+\\) \\(.+\\)" eql)
(buffer-file-name (buffer-base-buffer))))))
(setq buffer-read-only t)
(buffer-unmodified
(save-match-data
(save-selected-buffers (point-min) (point-max)))
(goto-char (point-min)))
(setq gnus-news-cited t)
(setq gnus-news-buffer
(if gnus-cite-flag (find-file-noselect
gnus-feed-file-name)
(gnus-article-cite-header
(file-name-domain (expand-file-name (file-name-directory
gnus-news-file-name)))))
gnus-news-cite-headers))
(goto-char (point-min)))
(cond ((and (string-match "-" eql)
(expand-file-name "./gnus-news/" (buffer-file-name)) nil))
(setq gnus-news-buffer
(if gnus-cite-flag (find-file-noselect
======== SAMPLE 3 ========
start))
(setq buffer-read-only t
buffer-local-delete-and-unload-functions
(with-current-buffer buf
(if buf
(funcall buf (current-buffer))
(buffer-string))
(kill-buffer buf)
(forward-line)
(setq buffer-read-only t)))
(setq buf-file-name nil)))))
;; Cleanup functions:
(defun vhdl-hierarchical-edit ()
"Undo editing in directory `/', including newlines."
(interactive)
(setf (or (or mode-line-process-buffer
vhdl-mode-line-process-buffer)
(let ((entry nil)
(current-buffer nil))
(if (string= entry vhdl-hierarchical-edit-command)
(format "%s"
(buffer-local-value 'vhdl-hierarchical-edit-flag t)))
;; This runs vhdl-hierarchical-edit
;; without user interaction.
(if (and (memq vhdl-hierarchical-edit-status '(empty))
(< (point) vhdl-hierarchical-edit-status)
(point-min))
(re-search-forward "^\\([-a-z_]+\\):\\(.*\\)"
(point-min) t))
(forward-line)
(setq buffer-read-only nil)))))))
;;;###autoload
(defun vhdl-hierarchical-create-command (command flags)
"Create and create a command specified as a hired command on the current
frame. With one exception, the command passed as argument is
a `comint-hierarchical-command' command. It's stored in a temporary
buffer."
(interactive "D\nP")
(with-current-buffer vhdl-current-buffer (posn-window (current-buffer)))
(let* ((file (get-file-buffer (current-buffer)))
(command (format "hierarchical-command-string: " file
(mapcar
(lambda (vhdl-command)
(buffer-substring
(buffer-substring (point-min)
======== SAMPLE 4 ========
start to
;; all-out.
(put 'all-out-mode 'mode-class 'special)
(defconst all-out-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [move] 'allout-move)
(define-key map [next] 'allout-previous)
(define-key map [setq-default] 'allout-set-default)
(define-key map [exit] 'allout-exit)
(define-key map [quit] 'allout-quit)
(define-key map [next] 'alarm-flag)
(define-key map [exit] 'allout-exit)
(define-key map [next] 'allout-kill-emacs)
(define-key map [delete] 'allout-delete-emacs)
(define-key map [kill] 'allout-kill-emacs)
(define-key map [newallout-inactive-prompt] 'allout-inactive)
(define-key map "\e\n" 'allout-new-allout-cmd-prompt)
(define-key map [kill] 'allout-kill-allout-prompt)
(define-key map "*_<" 'allout-last-command-event)
(define-key map "^" 'allout-last-command-event)
(define-key map ":" 'allout-last-command-event)
(define-key map ">>" 'allout-last-command-event)
(define-key map "[M-x move]" 'allout-last-command-event)
(define-key map "[C-u] " 'allout-command-event)
(define-key map "=" 'allout-command-event)
(define-key map "\\" 'allout-command-event)
(define-key map "\C-c\C-m" 'allout-mismatch)
(define-key map "=" 'allout-mismatch-unprocessable)
(define-key map "\M-\C-m" 'kill-all-buffer)
(define-key map "\\[\\]\\[" 'allout-toggle-completion-and-change)
(define-key map "\C-q" 'allout-complete-for-one)
(define-key map "\C-e" 'allout-executable-command-event)
(define-key map "\C-g" 'allout-executable-command-event)
(define-key map "\C-n" 'allout-new-allout-cmd-event)
(define-key map "\M-\C-p" 'allout-make-command-error)
(define-key map "\C-s" 'allout-show-other-window/exit)
)
"Face used for help and prompts in the `allout' modemap.
If `allout-mode' is non-nil, this function is called instead of the
func `allout-setup-funcall'."
(or
(let ((func (when allout-mode
(make-sparse-keymap
(if (featurep 'tst)
(overlay-put func 'allout-context)))
(overlay-put func 'kill-all-buffers)
(overlay-put func 'kill
"%file: samples-19800"
======== SAMPLE 1 ========
input-file-p
(file-directory-p file))))))
(defun org-list-pre-blank-line ()
"Non-nil when not in a list."
(interactive)
(unless (and (eq 'current org-edit-list-pre-blank-line 'only)
org-list-pre-blank-line)
(when (and (eq 'current org-edit-list-pre-blank-line 'only)
(string= org-edit-list-pre-blank-line 'string))
(when (and (not empty-list) (eq 'current org-edit-list-pre-blank-line empty-list))
(when (string-match "^$" (format org-edit-list-blank-line-format))
(insert " "))))
(when (string-match
(concat
"^"
(file-name-directory (file-name-nondirectory file)))
"<html><head> <link to=\\`\\(%s\\)\" href=\"%s\">"
(concat "http%s://"
(file-name-nondirectory
org-edit-list-prefix-prefix-string "\\`\\'"))
" <head> <link to=\\`\\(%s\\)\" href=\"<%s&coding='c=%s%s',%s%s>"
(concat "\\'" (file-name-nondirectory file))))
(if empty-list
"<head>"
"<head>" ""))))
(let ((last-buffer (or current-buffer (org-list-unbuffered-p)))
last-buffer-others org-list-pre-blank-line)
(with-current-buffer last-buffer
(funcall org-list-pre-blank-line
"[" (format org-list-pre-blank-line "") org-list-pre-blank-line-format)
(when beg end)))))
(defun org-list-pre-blank-line (&optional last-buffer)
"Do a list of blank lines before point.
When last-buffer is empty, it is removed from the buffer list."
(when (memq last-buffer
(and org-list-pre-blank-line-alist
(not org-list-pre-blank-line-mode))
org-list-pre-blank-line-alist
(save-excursion
(org-back-to-heading)
(org-remove-from-kill-ring (current-kill-ring) 'blank-line)
(re-search-forward org-list-pre-blank-line 'move)
(goto-char (point-min)))))
(when (and (= beg end)
(not (memq last-buffer
======== SAMPLE 2 ========
input-cache))))))
(defun gnus-newsgroup-summary-update-all-tasks ()
"Update the summary of all groups currently read, in the current buffer.
The summary is not actually updated, but is a buffer's current buffer and is
changed if the user changes it before saving."
(with-current-buffer (gnus-summary-buffer)
(gnus-summary-read-all-tasks))
(when newsgroups
(gnus-article-goto-summary-buffer))))
(defun gnus-summary-read-all-tasks ()
"Read all messages from all newsgroups in a specific group."
(interactive)
(let (s (gnus-summary-messages))
(message "Reading all messages, %s" s))
(gnus-summary-put-point s 'point)
s)
(defalias 'gnus-summary-summary-read-all-tasks 'gnus-summary-read-all-tasks-1)
(defun gnus-summary-read-all-tasks' (all)
"In summary mode, read all messages for all groups in the current group.
If ALTERNATE means `any' means read all messages as well, otherwise.
The summary is updated if the user changes it before saving."
(gnus-summary-save-buffer (current-buffer))
(gnus-summary-update-all-tags)
(or gnus-summary-article-goto-summary-buffer
(gnus-summary-possibly-update-all-tasks))
(gnus-summary-save buffer
(gnus-summary-save-buffer
(current-buffer)
gnus-summary-article-goto-summary-buffer))
(let (s (gnus-summary-messages))
;; Get rid of gnus-summary-goto-state-keywords
(gnus-summary-goto-state-keywords)
s))
(defun gnus-summary-read-all-tasks ()
"In summary mode, read all topics in groups in a specified group.
Uses `gnus-summary-summary-read-all-tasks-alist' to select articles.
If any of the articles for which the query has been processed are not
in summary mode, the message is lost."
(let (message articles)
(delq 'nil message)
(gnus-summary-print-all))
(gnus-summary-write-all)))
;;; User variables
(defvar gnus-article-buffer
(make-local-variable 'gnus-summary-buffer)
(make-variable-buffer-process nil t gnus-article-buffer))
;;; Usage
(defvar gnus-summary-buffer nil)
;; We need to check the state of the current buffer in order to determine
;; if it is still alive
(defun gnus-summary-read-all-tasks (&optional no-save)
"Read all summary message threads and ask for confirmation.
If NO-SAVE is `ask' then the current buffer is only shown if an article
is still in the buffer. If STARTUP-ON-SEND is nil then all
words in the previous article are saved by default.
If NO-SAVE is `ask' then all words in the previous article are
removed. If STARTUP-ON-SEND is t then all words are
removed from the summary buffer and the next article is just
the result of prompting for confirmation.
If STARTUP-ON-SEND is t then all words are saved by default, if STARTUP
resumes then the next word in the previous article is just the result of
asking for confirmation.
If no action is needed then the topic buffer is shown in the \" * * *
\" section if current article is still alive (but no articles
are saved, if the article was already saved then there's no need to
refresh the buffer). In that way the subject line is saved even if the subject
line has been hidden."
(interactive "P"); Gnus mode
(remove-hook 'gnus-summary-post-hook 'gnus-summary-save-text-only ())
(
======== SAMPLE 3 ========
input (nth 3 (car l))))))
(defvar mairix-auto-save-functions nil
"If non-nil, Mairix save functions always save (and reload) buffers.")
(defun mairix-send-command (command &optional new-cmd)
"Execute COMMAND, MATCH, NEW-CMD and send an outgoing message with Mairix.
Mairix does no interactively but only if the buffer `mairix-buffer' is
changed."
(interactive "C: mairix: ")
(save-buffer))
;;;###autoload
(defvar mairix-font-lock-enable-font-lock-keywords nil
"List of font lock keywords to be enabled in `mairix-font-lock-mode'.
This list defines the font lock keywords for the mode. Some have
different meanings in different buffers."
:group 'mairix
:version "24.1")
(defvar mairix-font-lock-ignore-comments t
"Non-nil if Mairix ignores comment comments after the `.'."
:group 'mairix
:version "24.1")
(defvar mairix-enable-mairix-help nil
"Non-nil means Mairix will enable the use of `mairix-font-lock-keywords'."
:group 'mairix
:version "24.1")
(eval-when-compile (require 'cl-lib))
;;;###autoload
(defun mairix (function &rest forms)
"Put Mairix in the current buffer.
The buffers specified in FUNCTION must be located within the current buffer.
This applies when `mairix-mode' is enabled or disabled in Mairix buffers. In
this case one takes care of the normal customization of variables
for Mairix buffers, so that Mairix buffers and buffer groups cannot change
the `default' settings of `mairix-enable-mode' (in an Emacs Lisp buffer).
See `mairix-font-lock-variable' for a list of variables with a default
variable. The variables are also added to `enable-font-lock-keywords'
and `enable-auto-save-buffer-defaults'.
The last `default' or `default-variant' variable of FUNCTION is used.
If the variable has the same `mairix-font-lock-keywords'
\(symbol-value `mairix-font-lock-keywords') as the current buffer,
and the variable isn't currently in the `default' or `default-mode'
variables, it would be ignored.
When called interactively, non-nil means the variable is the one
that is used. If the variable has the symbol `font-lock-face',
then it is a default face; nil or t means only that symbol is
used in Mairix buffers."
(interactive "^p\nP")
(and (functionp (cdr forms))
(save-sexp-excursion
(mairix-disable-font-lock-keywords
(looking-at (concat "\n$(" (regexp-quote (mairix-font-lock-variable 'font-lock-keywords)) ") ") ")
(regexp-quote (mairix-font-lock-variable "font-lock-face"))))
(with-current-buffer (mairix-get-buffer)
(setq forms nil)))
(run-hooks 'mairix-mode-hook))))
;;;
;;; Help support
;;;
(defvar mairix-mode-map
(let ((map (make-sparse-keymap)))
(define-key map key1 "m" 'mouse-face)
(unwind-protect
(if mairix-mode
(setq t mairix-help-menu) ; The function could be set
(define-key map "-" 'mairix-help-menu) ; Menu
======== SAMPLE 4 ========
input buffer)))
(while (re-search-forward
"^\\(?:[^ \t]*[a-zA-Z0-9]*\\)*\\.\\$\\(?:<\
.|[0-9]+\\)?\\(?:" (line-beginning-position 0) "\\)\\>\\(?:[0-9]+\\):\\)?" nil t)
(beginning-of-line 5)
(current-kill-buffer))
(let* ((old-pos (match-beginning-of-line 0))
(old-list (buffer-string)))
(save-restriction
(narrow-to-region old-pos (point))
(goto-char (or old-pos (match-end 1)))
(let ((buff (process-buffer buff))
(old-list (buffer-list)))
(while (re-search-forward "^\\[^ \n]\\|[^ \n]\\)*[^ \u-0-9]+\\$" nil t)
(setq old-pos (match-beginning-of-line (- 1 (match-end 1))))
;; If the buffer is empty, create a new one.
;; First, call `mark-marker' in batch mode.
;; Delete the new mark in batch mode.
(setq old-pos (buffer-marker))
(if (not (zerop (window-edges)))
(select-window window)))
(select-window old-pos t)
;; Create a new buffer.
(make-local-variable 'buffer-name)
(if (eq old-pos new-position)
(setq new-position old-pos))
(apply #'make-local-variable old-pos old-pos))))))
(defun message--buffer-name-to-buffer ()
"Return the string in a buffer of the same name as sender.
The first command on this line is `message-send-string'."
(message-message-to-buffer)
(let ((inhibit-read-only t))
(setq message-send-string nil nil)))
(defun message--buffer-display (buffer-name buffer-list nil)
"Display BUFFER-NAME."
(or (cadr buffer-list) (message-display-buffer-name buffer-list))
(message--display-text))))
(defun message-buffer-name-from-message-string ()
"Say whether BUFFER-NAME is to be used for display."
(if message-buffer-name (car buffer-list) (cddr buffer-list))
(prog1 (message-buffer-name BUFFER-NAME)
(message-buffer-name-to-display
;; Buffer name. Make a temporary buffer-name as
;; displayed in the buffer. Put the message-buffer-name
;; as `message-display-text' and `message-buffer-name'.
;; This is the `buffer-name' value.
;; It is not displayed by default on non-message buffers.
((= msg-buffer-name buffer-name)
(message-display-text)))
(setq buffer-list (list buffer-list)))
buffer-list))
(defun message--display-text
"%file: samples-19700"
======== SAMPLE 1 ========
999
nil
"List of strings to highlight in XEmacs."
:version "24.1"
:group 'tramp)
(defvar tramp-local-file-suffixes nil
"Each suffixes suffixes in `tramp-local-file-suffixes'.")
(defvar tramp-default-processes nil
"Name of processes being added to the list of default.
If `tramp-default-processes', don't set it. Instead use
`tramp-default-processes-alist', which defaults to the list."
:version "25.1"
:type '(repeat
(list
(const :tag "Yes" t)
(const :tag "No" t)
(const :tag "Limit" limit)
(const :tag "Empty" nil)
(string :tag "Limit String")
(function :tag "Function")
(integer :tag "Integer (default 1)" :value nil)))
"The default processes to highlight.")
(defvar tramp-default-processes
(list
(`((,(car process) ,(cadr process))
(delete-process body)
(setq tmpfile
(let ((tramp-processes (cadr process)))
(tramp-set-processes (cdr process))))
,(nreverse process))
(`((,(car process) ,(car process))
(delete-process body)
(setq tmpfile
(let* ((tramp-processes (cadr process)))
(tramp-set-processes (cdr process))))
,(nreverse process))
(`((,(car process) ,(cadr process))
(delete-process body)
(setq tmpfile
(let ((tramp-processes (cadr process)))
(tramp-set-processes (cdr process))))
,(nreverse process))
(`((,(car process) ,(cadr process))
(delete-process body)
(setq tmpfile
(let ((tramp-processes (cadr process)))
(tramp-set-processes (cdr process))))
,(nreverse process))
(`(,(car process) ,(cadr process))
(delete-process body)
(cond
((and (boundp 'tramp-tramp-processes)
(local-variable-p 'tramp-tramp-processes))
(setq tramp-processes
(delq 'tramp-processes 't nil))))
((or (null (cadr (cadr (car (car process))))))
(setq body (cdr (car
(cddr (cadr (cadr process))))
(nth 2 process
======== SAMPLE 2 ========
999/\\.\\)\"\",0)
"
(format "[%s]" (file-attribute-modification-time file-attribute-modification-time
(file-attribute-modification-time file-attribution-modification-time
last-command-event
(file-attribute-modification-time
last-command-event
last-command-event)))
" " t " ")))
(cons (format "%s/%d" (substring-no-properties last-command-message-prefix
org-at-top-level-modification-time
last-command-event)))
(cons (format "%s/%d" (substring-no-properties last-command-message-prefix
org-at-top-level-modifications-time
org-at-minor-mode-flag))
(or (and org-at-top-level-modification-time
(= (length (abbreviate-file-name last-command-event))
'file-attribute-modification-time)))
(t (format "" (file-attribute-file-name 'file-attribution-modification-time
(file-attribute-modification-time last-command-event))))))))
(provide 'eldoc)
;;; eldoc.el ends here
<|endoftext|>;;; egide.el - Integrate GNU Emacs to GNU Emacs.
;; Copyright (C) 1999-1999, 2002, 2004-2019 Free Software
;; Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
;; Keywords: lisp, Emacs
;; Package: eshell
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public
======== SAMPLE 3 ========
999 (1 1 2 3 4 5 6 7)
(1 (1 3 4 5 6 7)
(1 (1 3 4 5 6 7)
(1 (1 3 4 5 6 7)
(1 (1 3 4 5 6 7)
(1 3 1 (0 -1) (0 -1)))
(1 (1 3 4 5 6 7)
(1 (1 0 1) (0 -1)
(1 (1 0 1) (0 -1)
(1 0 0)
(0 -1)
(1 0 0)
(8 1)
(1 0 1)
(0 -1)
(9 1)
(1 0 1)
(9 0)
(0 -1)
(10 (5))))))
(defun rng-do-post-read (&rest _ignore)
"Read a string to the file."
(let ((rng-file-name-or-path rng-file-path)
(name (oref rng-name-or-path rng-path))
(type (if (string-match "\\`\\(\\s_\\|\\)\\'" name)
(expand-file-name rng-file-name-or-path name)
(replace-regexp-in-string ",\\'"
"%")))
(if (string-match "^" name)
(concat
("^" (match-string 1 name) ?.)
("\n")) " *:")
(if (string-match "\^@" type)
(concat
("^@" (match-string 1 type) ?.)
("\n"))))))
(defun rng-make-directory-of-range ()
"Return a directory containing the current working directory."
(let ((pos (point))
(dir1 (format "%s[%s]" (regexp-opt rng-temp-dir-format-list)))
(dir2 (format "%s[%s]" (regexp-opt rng-temp-dir-format-list)))
(directory (rng-make-directory-of-range))
(dir3 (format "%s[%s]" dir1 dir2)))
(concat dir dir1 dir2))
rng-temp-dir-format-list))
(defun rng-set-current-directory (temp-file &optional temp-part)
"Set directory named for work directory.
WINDOW should be the current working directory."
(interactive "D-Copy files to temp-file: ")
(let ((temp-p (current-buffer)))
(with-current-buffer temp-p
(with-current-buffer temp-part
(let ((file (current-buffer))))
(with-temp-buffer
(insert
======== SAMPLE 4 ========
999) (x y))
(if (= (setq w (cdr (list (x y))))
'("#x01" #x01)
(setq x (make-text-button 1))
(setq y (make-text-button 1)))
(setq x2 (make-text-button 1))
(text-button-make-button 1))
)
;; The above list should take care of displaying the text.
(when (setq x (cdr x))
(let ((w (car (pop x)))
(x- (cdr x)))
(if (consp x-) (setq x- (cons (car x) (1- (car x)))))
(if (<= (setq y (cdr (cdr x)) w) (setq w y))
(setq x- (car y-))))
))))
(defun text-button-create-button ()
"Generate a button with the value `text-button' for the current buffer."
(let ((res (copy-marker text-button-create-marker)))
(when res
(if (consp res)
(setq res (concat xt (cdr res)))
(setq res (cdr res)))
(if (memq res text-button-insert-regexp)
(replace-regexp-in-string "[\n]" text-button-insert-regexp)
(replace-regexp-in-string "\\<" res))
;; Update the text, if any, of the current button.
(if (y-or-n-p "Update the text of the current button: ")
(delete-region (point) (save-excursion (beginning-of-line) (end-of-line)))
(if (and res (memq text-button-insert-regexp text-button-insert-regexp)))
(insert " " "")
(beginning-of-line)
(insert "[\n]" text-button-insert-regexp))
(replace-regexp-in-string "\\<" text-button-insert-regexp)
(setq text-button-insert-regexp
(append " " text-button-insert-regexp))))
text-button-add-button res)))
(defun text-button-toggle-button ()
"Toggle button display for next event."
(let ((res (copy-marker text-button-insert-marker)))
(when res "text"))))
(defun text-button-remove-button ()
"Remove button that has the value `text-button'."
(and (memq text-button-insert-regexp text-button-insert-regexp)
(and (y-or-n-p "Remove button with prefix argument text-button-replace-regexp"))
(let ((list t))
(delete-region (point) (point-at-eol))
(setq list (cdr list))
(narrow-to-region
"%file: samples-19600"
======== SAMPLE 1 ========
string")
"ѐ")
"List of strings with possible completion for the input stream.
This is a syntactically correct format for strings of the format \"\\\\`~\\s-*\"
\"\\\\~\"."
:group 'latin-srecode
:type '(repeat function))
(defun lpr-read-string-1
(input-string)
"Read a string from the prompt that is `lpr'.
If the user wants this, ask the user before starting Emacs.
Otherwise, ask only the user immediately after typing \"hello\"."
(interactive "sRead string: ")
(let ((start (match-end 0)))
(if (re-search-forward
(concat "\\(\\^ \\)\n\\([ \t]+\\):\\(.*\\)\\|\\("
"\\s+\\)?"
(lpr-current-input-substring 1)
"\\)")) ; do nothing, and return nil.
(message "Reading keystroke from prompt"))
(let ((start (+ (current-column) (match-end 0)))
(length (length input-string))
input-string)
(if nil
(goto-char start)
;; This command can only have a single-byte string, so we
;; check if we have multiple strings.
(unless (or (listp input-string) (null input-string))
(princ " (" input-string) ?\n)
(setq input-string (car (if (= (aref input-string x) ?x) 0 1)))
(lpr-read input-string)
(princ " " x)))
input-string))
(defun lpr-read-string-1 (input-string)
"Read a string from the prompt specified by ELEMENT.
If the user wants this, ask the user before starting Emacs.
Otherwise, ask only the user immediately after typing \"hello\"."
(interactive "sRead string: ")
(let ((start (match-end 0)))
(if (re-search-forward
(concat "^" lpr-current-input-substring "\\(\\^ \\)?"
(lpr-current-input-substring -1) lpr-current-input-substring)
"\\")) ; do nothing, and return t.
(message "Reading keystroke from prompt"))
(let ((from (and lpr-current-input-substring ?\C-c
(list 'lpr-current-input-substring)))
(substr (1+ (match-end 0)))
input-string)
(save-excursion
(beginning-of-line)
(while (and to (> from lpr-current-input-substring)))
(when (eq (aref lpr-current-input-substring 1) ?\C-c)
(if (or (lpr-get-input-property lpr-current-substring 'keyword)
(get-text-property lpr-current-input-
======== SAMPLE 2 ========
string nil)
(when (eq (car (car-safe (car-safe c)))))
(if idx
(if (cdr (car-safe (car-safe c)) c
;; if the buffer was modified, get the value
(car-safe (cdr (car-safe (car-safe c)))))
(list idx idx))))
(defvar idx (idx-to-hash-cache :test 'equal))
;; (defvar idx-to-safe-cache :test 'equal)
(cl-defmethod idx-safe-cache ((a b))
(let ((d-hash-cache (idx-safe-cache a b)))
(dolist (c idx-safe-cache)
(let ((c-hash 0))
(dolist (f f-safe-cache) ...)
(cl-efido (idx-to-safe-cache-default-hash-cache f c)
idx-safe-cache)
(let ((h (idx-safe-cache-hunk idx-safe-cache))
(z (idx-safe-cache-hash idx-safe-cache)))
(nreverse h)
(while (and f (not (eq (car f) idx-safe-cache)))
(push z h)
(push f (nreverse z))))))
(dolist (c (list (list (car c) (cdr c))
(cl--idx-safe-cache-default (idx-to-safe-cache-default idx-safe-cache)))))
(dolist (c (cons (car c) (cdr c))
(cl--idx-safe-cache-default (idx-to-safe-cache-default c idx-safe-cache)))
(dolist (f (idx-safe-cache-hash idx-safe-cache)) ...)
(and (consp f)
(cl--idx-safe-cache-default f idx-safe-cache)))))
)
(cl-defmethod idx{
"Return a hash of the IDX cache hash."
idx)
(defclass idx-cache ((cl-defmethod cl--idx))
(idx-cache (cl-make-vector idx-safe-cache))
(idx-cache-key nil)
(idx-cache-stack 0)
)
(cl-defmethod idx-safe-cache-setup ((a,b)
&key
&idx
&x
&name
======== SAMPLE 3 ========
string (org-trim
(concat "{"
"("
org-noselect-file-name (org-trim-unmatched-regexp
(regexp-quote org-noselect-file-name)
"[ \t]")
""))
""))
""
"{"
(replace-match ""))
'string "<>")
(if (looking-at "<[a-zA-Z]*>\\([[:alpha:]]+\\)")
;; If a real filename, make a new one on newline.
(let ((new-filename (match-string 1)))
(replace-match "<" nil))))))
(and (match-end 1) (string-match "/[a-zA-Z][a-zA-Z0-9_$]" new-filename))))))
;;;; Fontification
(defvar org-src-font-lock-keywords)
;; We try to keep as much code that is in our style files as possible. The
;; only place where we need to go is in the doc string of the file.
(defvar org-font-lock-keywords)
(defun org-add-font--version (name file)
"Add version to BODY."
(unless (plist-get (plist-get (plist-get (plist-get (plist-get (plist-get name) 'org-default-version) 'org-version-alist)
'org-font-lock-version))
(org-add-font--version
org-font-lock-version-alist file))
(defvar org-font-lock-keywords-alist
(append
(mapcar 'list 'org-style-face
org-style-face
org-font-lock-version-alist
'org-version-alist)
(plist-get (plist-get
'org-default-version
(plist-get (plist-get
'org-default-version
'org-font-lock-version nil
'org-default-version)
'org-version-alist))
(substring org-font-lock-version-alist
org-style-face org-font-lock-version-alist)
(or (plist-get (plist-get
======== SAMPLE 4 ========
string-match "\\'" "\\'"))
"\\'")))
(defun org-element-get-contents-at (node string literal)
"Return the new contents containing NODE, VALUE."
(unless (listp (memq string org-element-contents))
(set (intern (org-element-property :value node)
(get-text-property (list 'org-element :value node))))
string))
(defun org-element-after-contents-at (element object value)
(org-element-with-property-not-inherit
(lambda (var value)
(org-element-put-property-both (org-element-property :VAR value)
;; Make sure object is unchanged from `org-element-contents'.
(org-element-get-contents-at
element
(format "%d of %s" (match-string 1 value))))))
(defun org-element-get-contents-at-endof (element object)
"Return the end of object as STRING, nil if OBJECT is not a list.
For a list, return the end of object rather than the beginning of
the first argument of the list."
(cond ((or (equal (org-element-property :value element)
(org-element-property :value object))
(and (numberp (org-element-contents (org-element-property :value object))))
(replace-match
"/"
(concat "/" (org-element-contents element)))))
`(t ,value)))
(defun org-element-get-contents-at-end (element object)
"Return the end of object as STRING, nil if OBJECT is not a list.
For a list, return the end of object rather than the beginning of
the first argument of the list."
(cond ((< (org-element-property :value element) object)
(let ((start (point))
end)
(replace-match 'string "" end))
(t ,end)))
(t `(lambda (element)
(format "%s" start start end))
(t ,end)))
(org-element-put-contents-at
object
(replace-match ":" (org-element-property :contents-start object)))
(org-element-set-value object)
(let ((element (org-element-normal-data)))
(org-element-set-value object (or attr (org-element-name-get-attrs-at-point elem))))))))
(defun org-element-dispose-of-contents (element &optional buffer)
"Dispose of the contents of the ELEMENT.
When nil, also remove the current contents from the current
buffer."
(if (eq buffer (current-buffer))
nil
(let ((data (get-text-property pos 'org-element)))
(org-element-dispose
(if (cdr (assq 'org-element element))
(let ((last-data (org-element-property :value element)))
(if (match-beginning 1)
"%file: samples-19500"
======== SAMPLE 1 ========
forward-window is t.
\(fn UNKNOWN-VALUE-LIST)
\(fn)" t nil)
(when (and (integerp p) (not (stringp (cdr p)))
(if (integerp (cdr p)))
(car (cdr (cddr p))))
(let ((window (window-dedicated-p proc)))
(let ((p (car (cdr p))))
(cond (p
;; if buffer is already marked unallowed, we don't need to
;; delete the mark.
(if (and (or (null p) (not (stringp p)))
(eq (caar (cdr p)) 'unallocated))
(delete-other-windows)
(setq p (1+ (frame-point)))
(condition-case nil (progn
(cond
((null (buffer-live-p p))
(setq p (point))
t))
((not (eq p 'unallocated))
(setq p (1+ (frame-point)))
t))
(delete-other-windows)
(setq p (1+ p))))
(cond (p
(kill-all-local-variables)
(setq p (1+ p))))
(setq p (2- (window-buffer p)))
(when mark
(unless (null mark)
(setq mark nil)))
(goto-char (- (- (window-width) 2 p))
(or (nth 2 (window-buffer p))
(setq p (1- (frame-point))))
(throw 'quit mark)))
(when (eq (frame-point) (point))
(throw 'quit 1)))
(goto-char (- (- (window-width) 2 p))
;; if a window of a certain size, remove its value
;; then restore it.
(when (not window) (setq frame-point (point))
(other-window (display-minibuffer-prompt
(format "%s.%s"
(car (cdr (c
======== SAMPLE 2 ========
forward-window-cursor-function'.
Return a `mouse-2' click event, and `mouse-2' point.
Arguments DONE: `mouse-2': mouse-2, `next-window': `previous-window'.
Also, `narrow-window-function' adds the text property to
the `mouse-cursor-event' function."
(interactive)
(or (mouse-setup-function))
(goto-char (point-marker)))
(defun mouse-mouse-move-to-event ()
;; `mouse-move-to-event-function'.
(unless (or (eq last-command-event) (called-interactively-p t))
;; Return a drag event for the mouse.
;; In the event handler, if the user types something, make sure
;; the mouse hits the mouse button and a scroll event is displayed.
(let (mousedown)
(when mouseup
(setq mouseup (min (mouse-event-p event) (1- (point))))
(mouse-set-event event mouseup)))
(let (eventmousep)
(mouse-cursor-event))
(let ((key (mouse-event-key event)))
(unless mouseup
(setq mouseup (min (mouse-event-p event) (1- (point))))
(mouse-set-event event mouseup))))
(defun mouse-mouse-move-overlay-handler ()
;; "mouse-move-to-overlay."
;; "mouse-move-to-overlay" has two properties:
(mouse-mouse-mode -1)
;; See the relevant `mouse-mouse-mode' documentation for details
(mouse-mouse-mouse-mode 3))
(defsubst mouse-mouse-move-back-to-event ()
"Move to the previous event in the event list of the mouse.")
;;;###autoload
(defun mouse-mouse-mouse-move-down-to-event ()
"Move backward to the previous event in the event list of mouse.
This is useful for things like mouse events in the middle of a
buffer. Returns a cursor event where the mouse moved one step."
(interactive) (backward-char 2)
;; We only give this function two arguments: the event, and the type.
(with-selected-window (event-point event)
(mouse-move-forward-event t)
(if (or (c-maybe-mouse-overlay-p mouse-overlay-face)
(c-maybe-mouse-overlay-predicate mouse-overlay-predicate)))
(mouse-set-event event mouse-overlay mouse-overlay))))
;;;###autoload
(define-minor-mode mouse-mouse-mouse-map
'((mouse . mouse-mouse-mouse-event) t)
"Mapping keyboard keys for mouse events."
:file-tag-name mouse-mouse-mouse-map)
(define-abbrev-table 'mouse-mouse-abbrev-table
'((b,c ,a))
(setq mouse-mouse-mouse-mouse-events (cons mouse-mouse-mouse-events))
(add-hook 'mouse-mouse-hook
'mouse-mouse-move-down-to-event
'mouse-mouse-move-down-to-event)
;; We also set `mouse-mouse-mouse-mouse-event' with an
;; argument that returns the new event, and then try and
;; display it in the next window.
)
(define-obsolete-function-alias #'mouse-mouse-action-activate
'mouse-mouse-action-apply-on-action "24.1")
;;;###autoload
(defun mouse-mouse-event-map (mouse-mouse-event list-keys
======== SAMPLE 3 ========
forward-mouse-drag))
(when (setq frame
(setq window (make-frame :height t t))
(make-frame :mouse-drag " " :width 0)))
(when (setq frame
(make-frame :left-arrow "1" "right")
(make-frame :center-arrow (1- (frame-width frame)))
(make-frame :mouse-drag " " frame nil "mouse"))))))
t t t)
(defun menu-bar-mouse-drag-back ()
(save-excursion
(let ((inhibit-read-only t))
;; Move forward if there is a new mouse event.
(while (< (setq window (window-mouse-drag)) 0)
(mouse-drag-back (cons (cons (point) window) tail))
(forward-line (- frame 1))
(forward-line -1))
(save-excursion
;; Scroll backward the frame for a frame we are at.
(let ((c (frame-start window)))
(if (not
(when (eq c (frame-left t))
(forward-line -1)
(setq frame (cdr c)))
(window-window (set-frame-start c 1)))))))
(unless (eq c (window-point t t))
(mouse-drag-back (cons (cons c c))))
(forward-line -1))
(nconc (list (cons c c))))
;; Move out to the mouse event's location.
(let (end)
(while (eq last-command (setq end (selected-window)))
;; Move to start of next window, if point was a single frame.
(if (eq (window-buffer (selected-window)) end) (setq end (max (- (point-max) (point-min)) end)))
(forward-line (- c)))
(when mouse-drag-back
(let ((inhibit-read-only t))
(while (and (not (consp (window-point t))
(save-excursion
(forward-window (1- (window-end t)))
(not (markerp (window-buffer (window-list (selected-window)))))))
(if (not (cdr c))
(kill-buffer (car c))
(setf (nth 1 c) (window-point) (max (- (point-min) (point-min)) max))
(or (nth 2 c) (setq c (cdr c)))
(while (not (cdr c))
(move-overlay
======== SAMPLE 4 ========
forward-char)))
(funcall (make-char-table buf) buffer)
(when (symbolp (car (funcall (cdr buf)))
(funcall (cdr buf))))))
(defun org-element-table-create-keyword (table)
"Create the table (TABLE) which has elements related to the current
element. This is called with four arguments: the name of the key
table to use as the template, the element type, and the text to insert
for the element type."
(cond
((or (not (listp table))
(listp (cdr table))
(not (cdr table)))
table))
(defun org-element-table-create-keyword-function (table)
"Create the table (TABLE) which has elements related to the definition of
the key that will be the template. This is called with
one argument: the name of the key to use as the template, the
element type, and the text to insert for the element type. If it is
not an element, this entry is used instead. If it is
not an element, the entry is used instead."
(let ((name (if (nth 2 table) (nth 2 table))
(data (car table))
buffer
buffer-read-only)
(save-restriction
(widen)
(save-excursion
(when (and (eq cdr-char-syntax (nth 2 table))
(looking-at org-element-key-regexp-regexp))
;; FIXME: Can't do it with 'key:
(unless (org-element-key-template-p table)
(throw :key table)
(setq buffer-read-only nil))))
;; The key, which is the current value of the variable's
;; value, and the entry, which is the value that will be
;; used for the key, should have the string "this key" in it.
;;
;; The template is saved. If it might otherwise have "this key", the
;; entry should be taken as the value. The next time the table is
;; created, update the template.
(when (orgp-element-key-template-p table)
(let ((name (if (not (org-element-element-p table))
(or (nth 1 table) ""))
last-value (org-element-property
entry (nth 2 table) (nth 1 table))))
(or (null name) (throw :key name)
(cond ((numberp name) (car name) value)))
(when (org-element-key-template-p table)
(setq buffer-read-only t)
(setq last-value (org-element-property
entry (nth 2 table) (nth 1 table))))
(and (org-element-key-template-p table)
(setq buffer-read-only nil)
"%file: samples-19400"
======== SAMPLE 1 ========
;; check if `gv' is valid.
(if (eq system-type 'darwin)
;; We have gv, there's a workaround to the case where
;; we want gv: in CVS if all other modes in the directory do
;; have the same format
(setq command (gnus-summary-make-command-list 'gnus-gnus-summary
`(gnus-gnus-command-prefix-string
gnus-gnus-control-prefix-string
gnus-command-prefix-string
gnus-summary-mode)
(gnus-user-dirname-prefix)
"")
(gv)))
(setq command (car gv)))))
(goto-char (point-max))
;; `gnus-summary-save-file' is the original command, so
;; it's the one to save it somewhere. We keep it if we use it.
(gnus-summary-save-file
(if (derived-mode-p 'gnus-edit-group-mode)
"gnus-edit-file: \\[gnus-edit-group-mode]")
command
(setq command (cdr gv) gnus-custom-group-command)
(let* ((inhibit-read-only t)
(command (gnus-method-get command 'gnus-command-prefix)))
(let ((gnus-user-file-coding-system
(or gnus-user-file-coding-system
(gnus-default-method-hash))))))))
;; (gv? nil ?s)
(progn
;; Ignore the user-modified file.
(
======== SAMPLE 2 ========
(match-string 1 string))
(match-string 2 string))
(if (and regexp (match-string 1)))
(cond
((stringp regexp)
;; The result of the search is a regexp
;; and the regexp is in a string. We can use
;; `match-string 2' in this case.
((match-string 1)
;; The result is a string. The user didn't have the
;; `match-string 2' for
;; `match-string 1' as the first match of 'string'
;; and the user didn't have the regexp for
;; `match-string 2' as the second match of 'string's
;; name.
(setq regexp (substring regexp 0
(match-beginning 2)
?')))
(user-error "Cannot match a number. Use `%s' for matches"
(match-string 3 string))
(if regexp
(if (search-forward regexp nil t)
(match-string 3 string))
(user-error
======== SAMPLE 3 ========
(if (/= (prefix-numeric-value n) 2) "")))
""
t)
(if (not (eolp))
""
t)))
(defun shr-make-extract-from-substring (substring)
"Like `substring-nth-nth-substring', but `nth-nth-time-stamp' returns an exact
substring."
(let ((substring (- (or nsubstring (substring-no-properties (string-add (prefixed-name sym) 0 0)
(substring-no-properties (string-add (following-char) 0 0)
t) 0) 0)
(substring
(substring 0 1) ; 'nth-time-stamp
(propertize "-v" 0 1))
(t
(propertize "-^" 1)))
(concat (cdr (assoc "nth-extract" shr-substring-alist))
;; For absolute values.
(cdr (assoc "-nth-extract--index" shr-substring-alist)))
substring))
(defmacro shr-extract-from (substring-nth 2)
> (lambda (string)
; for compatibility with rsh.el
(setq shr-substring-alist (cons (prefix-numeric-value string) (assq-delete-dups
shr-substring-alist-symbol ws))
shr-substring-alist-symbol))
(defun shr-make-extract-from (substring-nth 2)
"Like `substring-nth-nth-substring', but `nth-nth-time-stamp' returns an exact
substring."
(let ((substring (if (string-match "[^ \t]*/\\(?:" substring 1)
(concat (substring-no-properties (match-string 2))))
(substring (match-string 3)
(concat (substring-no-properties (match-string 2)
,substring-nth 1)))
?-))
(end (substring-no-properties (match-string 1) (match-end 2)))
(sym (match-string 1))
======== SAMPLE 4 ========
(if (not (eq tilde-flag (char-after last-char)))
(setq last-char charsp))))))))
(defun c-texvs-comment-after-expand-or-delete-comment (&optional arg)
"Comment after the last C-style comment and `.' or `,' to begin a new
string.
If optional argument ARG is non-nil, move up or down the line (see
`c-block-charsets-forward-comment').
Otherwise return the end of the first comment or `!' to begin a new string;
see `c-block-charsets-back-comment'."
(if (>= (point-to-comment) end)
;; Skip old comment if this comment starts right after the
;; `new-comment'.
(save-excursion
(c-forward-comment (- (point-max) 2) (point))
(skip-chars-forward "/"))
(if arg (<= 0 (point-to-text))
(if (equal last-char ",")
(if (equal first-line ",")
(c-forward-comment (- (point-min) 2)))
new-comment))))
(if (and arg (< (point-to-string) end) end)
(if (>= (point-min) end)
(progn
(goto-char (point-min))
(while (not (> (point-max) end))
(cond
((< (point) end)
(forward-char 6))
((< (point) end)
;; No line, not at beginning of string. It is at end of buffer.
(if (re-search-forward "\\s-*[^&*]\\w+\\)" end t)
(replace-match "\n\\w+"))))
(save-excursion
(goto-char (match-beginning 0))
(while (<= (point) end)
(beginning-of-line)
(and (looking-at c-macro-comment-start)
(progn
(goto-char end)
(skip-chars-backward "w")
(not (looking-at c-macro-comment-end)))
(c-beginning-of-defun))
(setq line (match-string-no-properties 0)))
(setq end (match-end 0)))))))
(save-excursion
"%file: samples-19300"
======== SAMPLE 1 ========
"Toggle printing of the whole document."
(interactive)
(set-mode-line-buffer buffer-name)
(set-buffer-name (format "-a %S" (if (not (equal (buffer-string)
'x-dvi-file-name)
nil)
nil)
(set-buffer-file-name buffer-name))))
(defun x-dvi-read-document-buffer (command)
"Execute CMD-command CMD-function COMMAND and return a list of
DOCUMENTS."
(let* ((string (if (x-display--x-display-command command) "x-dvi-dvi" "x")
(x-dvi-read-buffer command))
(x-dvi-xemacs-syntax-error)
(x-dvi-read-buffer command)
new
;; If we have a command for the current document, the
;; commands from the previous command are the same as the
;; command from the previous command. We have to get `buffer-file-name'
;; before inserting the buffer.
(x-dvi-read-buffer command)
text)
(condition-case ()
(progn
(x-dvi-xemacs-syntax-error)
(x-dvi-read-buffer command)
(set-buffer-file-name command)
x-dvi-emacs-syntax-error))
(error (if text
(set-buffer-file-name "*DOCUMENTS*" command)
;; Don't handle prompts properly with "*" in prompts
(progn
(message cmd))
(message "No prompts on this document.")))))
(defun x-dvi-get-backend (backend)
(let ((command (if (string-match "\\(?:" (match-string 1 backend))
; or `dvi'
"--backend")))
(backend
(setq command
(concat "\n--backend\n" command))
command)))
(defun x-dvi-get-file-name (backend file &optional last-p)
(and (if (string-match "\\([^_]+\\)"
file)
(string-match-p "file" file))
======== SAMPLE 2 ========
(and (numberp (nth a)))
(number-to-string (nth a 3)))
(let* ((i 2))
(s (nnmail-send-string-to-nnmail
(nnheader-make-cite-article id string nil
nnmail-nn-current
'nnmail))
i))
(nnmail-decode-citation-string string)
(setq s (nthcdr two))))
(nnmail-set-citation-format string)
(shouldn't (nconc
(nnmail-format-citation string
nnmail-nn-current
'nnmail)))))
(nnmail-write-region (point) (point-max) s)
;; If the buffer is not closed, it
;; can be made to be closed.
(nnmail-set-citation-buffer string)
(nnmail-make-cited-article string))))))
======== SAMPLE 3 ========
(gnus-summary-remove-from-head)
(gnus-summary-summary-to-head org-agenda-last-done)
nil)
nil))
(gnus-summary-article-to-head org-agenda-last-done
(list 'archive org-agenda-last-done)))
(t org-agenda-last-done)))
(setcar org-agenda-last-done-to-head (cdr org-agenda-last-done))
(gnus-add-agenda-list
(gnus-make-gnus-article-command-method
(car org-agenda-last-done-to-head)
(let* ((n (caar org-agenda-last-done-to-head))
(name (cdr org-agenda-last-done-to-head))
(subdir (cdr org-agenda-last-done-to-head))
(head (cdr org-agenda-last-done-to-head))
(article (cdr org-agenda-last-done-to-head))
, (cons
;; Add a heading to the buffer.
(gnus-goto-header 'head)
(funcall
(mapcar
(lambda (head)
(gnus-get-heading)
(gnus-summary-gnusenct-name-tag head)))))
;; Add a heading to the buffer.
(gnus-goto-header 'head))
(when org-agenda-last-done
;; There is just one item to the article with the head,
;; and heading from the previous article,
;; and the heading from the current headline.
(gnus-goto-heading org-agenda-last-done)
======== SAMPLE 4 ========
"Goto item at point.")
(defvar minibuffer-current-item nil
"Current item at point.")
(defvar minibuffer-search-list nil
"List of `minibuffer-search-function' expressions.
Each element may contain a key that can be used to find
or highlight the given item.
Each element is a string that can also contain
`:group', if no group is defined, and a symbol if no
one is defined.
The `search-forward' command may be used to move
point or to search for an item.
The following example shows how to use a search-forward
on a new listing item. It takes one space at the top right
and returns either the item containing the comment or
the current line comment.
A valid search-forward may look like this:
(dont-comment-list) :comment :line :line-in-block :line-in-column :before-line
This can also look like this:
[1:comment :comment: :line :column:] :line-in-column:
The match for `match-beginning' looks like this:
\\[match-beginning-of-command-1]
This matches the previous command line, which matches the
current line, so that a search string may be found that
uses just the beginning of the text. If the current line is not
beginning, then only one argument is used, so that the
comment is not followed by the `$' (a string)."
:type '(choice string
(const :tag "Match beginning" nil)
(repeat :tag "End match" :value regexp))
:group 'minibuffer-default-minibuffer)
(defvar minibuffer-search-list nil
"List of search words used to find item on `minibuffer-search-list'.
Each element is a list (P, H, END), where P may be the current
line or start position, H may be the current line or start
position, END may be the end position, if there exists one, or
;; `:group ', if no group specified. Look for the list of matches
;; that end with the current line at the end of this list and go
;; backwards.
(or (and (stringp search-forward)
(string-prefix-p ":group")
(and (string= ":" search-forward) ; No group -- start and end
(not (string= (downcase search-forward) "?"))
(match-string search-forward))
(setq search-forward nil))))
"List of search words that match the specified line to find a line comment.
This is a good way to show if a line is missing the item before or
after a comment, or to match a single item. If
it is missing, then check against that line and return 0.")
(defvar minibuffer-end-function nil
"Function to call when `minibuffer-insert-comment-line' is called.
This function is called on the end of line, and does nothing after
inserting a comment line. For comments, it is used as a
safe replacement for `save-excursion'.")
(defun minibuffer-end-position ()
"Move over and insert a comment line at the end of the buffer.
If a comment is matched, that is removed from the buffer.
Then `minibuffer-search' must move to that line at point.
If the point is not moved out of or past a comment, that
comment is not moved.
On `minibuffer-end-section-string', this function calls `minibuffer'
to end the section string. You can remove that string with
\\[dwimple-remove-minibuffer].
If the item is not specified, `save-excursion' specifies
the position of the item. `save-excursion', a function
that returns a list of the form (PREDICATE . STRING),
"%file: samples-19200"
======== SAMPLE 1 ========
(lambda (a b)
(or (< (nth 3 a) (nth 2 b)))
(let* ((name (nth 2 a))
(name (nth 3 a)))
;; Get a string or list from `comint-find-string'.
(if (numberp name)
(if (>= (setq name (cdr name)) 1) ?\s ?\n))
name))
(if (consp name)
(let ((name (format "comint-find-string: %S" (nth 0 a)))
(if (<= (setq name (cdr name)) 1) ?\s ?\n))
names)))
(if (member name '("\\.el\\'""\\"\"\\[\\].el\\'"\""\\'`\\'\""\\'\"\\'\"\\'"\"\\'`\\'"\"\\'`\\'\""`\\'"\"\\'`)))
(if (<= (setq name (cdr thelem)) 1) ?\s ?\n))))))
;;;###autoload
(defun comint-find-string (arg)
"Return the location of the end position in STRING.
Returns t if no location could be found or nil if no finding was found,
if STRING was found."
(interactive "p")
(comint-find-string 'comint-find-string (or arg nil))))
;; Local variables:
;; generated-autoload-file: "org-util.el"
;; generated-autoload-load-name: "org"
;; End:
(with-local-autoload 'org-comint-find-tag-line "org")
(defvar org-comint-find-tag-line nil)
(defvar org-comint-find-tag-line-as-string nil)
(defvar org-comint-comint-command nil)
(defvar org-comint-comint-last-action nil)
(defvar org-comint-comint-command-fun nil)
(defvar org-comint-comint-history nil)
(defvar org-comint-log-format nil)
(defvar org-comint-log-line-display-string
org-comint-log-format-help-string org-comint-log-line-history
org-comint-log-show-log org-comint-log-line-history
org-comint-log-show nil)
(defvar org-comint-log-text t)
(defvar org-comint-log-regex nil)
(defvar org-comint-log-text-regexp nil)
(defvar org-comint-log-matching org-comint-log-matching-string)
(defvar org-comint-log-regex-functions nil)
(defvar org-comint-log-tables nil)
(defvar org-comint-log-in-tables nil)
(defvar org-comint-log-out-tables nil)
(defvar org-comint-log-out-table nil)
(defvar org-comint-log-
======== SAMPLE 2 ========
;; Now let the window be selected and the window fill-rectangle property set.
(t
(select-window window start)
(fill-rectangle
(save-restriction
(narrow-to-region start end)
(while (and end (< (window-end) start))
(let ((rectangle (frame--get-rectangle start end)))
(if (or fill-rectangle (equal rectangle 2))
(setq rectangle (buffer-substring-no-properties start end))))
(setq start end)))))))
(defun window-mode-line-end (start end &optional ignore)
(let* ((start (point))
(end (if (setq end (char-after))
(1- (point))))
(lines (current-buffer))
(buffer-list (window-buffer start end)))
`((window . ,start)
(window . ,end))
(unwind-protect
(buffer-modified-p)
(widen))
(widen)
(unless (eq window-mode-line-end window) (setq start ""))
(widen)
(buffer-read-only)
(switch-to-buffer to-buffer))))
(provide 'window-mode)
;;; window-mode.el ends here
<|endoftext|>;;; w32-mode.el --- enable the MS-Windows display of WDDL (Windows-32) -*- lexical-binding: t -*-
;; Copyright (C) 1998-2006-2019 Free Software Foundation, Inc.
;; Author: Eric H. Ludlam <zappo@gopher.freedesktop.org>
;; Created: 8/25/98
;; Package: gml
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; If you use Emacs, please provide the full set of functions, which will
;; enable the MS-Windows display of WDDL.
;; If you use other MS-Windows programs, please support their distribution and
;; use MS-Windows in the future.
;;; Code:
(require 'ms-disks)
(declare-function smie-ms-display "smie")
(declare-function smie-mime-format "smie-mime")
(put 'window-setup-hook 'force)
(put 'window-setup-inhibit-quit 'force)
(put 'window-edit-if-in-window-mode-hook 'force)
(put 'window-edit-if-in-mime-mode-hook 'force)
(put 'mime-set-buffer 'force)
(put 'mime-unset-mime-string-functions 'force)
;;; Code:
(if (fboundp 'register-definition-prefixes)
======== SAMPLE 3 ========
(format "%%" (buffer-string)
"")
;; If not an article buffer then it has not been created yet, so we have to
;; create it now.
(push (list 'completion-files)
org-project-project-alist))
(org-get-at-bol "%%")))
(provide 'org-time-h)
;;; org-time-h.el ends here
<|endoftext|>;;; org-time-parse.el --- Parsing time-dependent file names in Org mode.
;; Copyright (C) 1997-2019 Free Software Foundation, Inc.
;; Authors: Anders Lindgren
;; Home: http://orgmode.org
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(require 'ert)
(require 'org)
(require 'cite)
(require 'time-parse)
(require 'dired)
(require 'time)
(require 'pending-output)
(require 'idle-mode)
(autoload 'org-dired-get-user-id "org")
(autoload 'org-date-format "org" nil nil nil nil nil nil)
(autoload 'org-create-time "org" nil nil t)
(autoload 'org-french-format "org" nil nil nil nil nil)
(autoload 'org-french-format "org" nil nil nil nil nil)
(defvar org-time-dont-overlay nil)
(custom-autoload 'org-time-dont-overlay "org" 'org-time-dont-overlay)
(defgroup org-clock-table nil
"Table for agenda and clocks."
:prefix "org-"
:group :tag "List of clock tables"
:group :tag "Clock tables"
:type table
:version "24.4")
(defgroup org-clock-table-file nil
"File for a file to be made into a clock table.")
(defcustom org-time-display-clock
(widget "<%s...>" org)
"Clock widget at top of the current time line."
:group 'org-time)
(custom-boolean-display-clock t)
(custom-attribute-display-clock 'org-time-display-clock 'all)
(defcustom org-time-clock-type 'org-clock
"Org-clock type."
:group 'org-clock-table-file)
(custom-variable-definition 'org-clock-clock-type 'org-clock)
(defcustom org-time-display-time-p nil
"Whether show time as a time stamp.
The default is t if the value is `org-clock-date'."
:group 'org-clock-table
:type '(choice (string :tag "Time stamp")
(regexp :tag "Time stamp"))
:version "25.1")
(custom-define-obsolete-variable-alias 'org-clock-time-p 'org-clock-time-display-time-p
; obsolete in 2.10.
:tag ""
:version "25.1")
(def
======== SAMPLE 4 ========
(defun c-get-string-1 (n)
(when (eq cn-string-function-p 'c-symb)))
(define-c-local-overloadable-p t "function")
(defconst c-syntax-table cntl-syntax-table)
(defclass c-basic-wisent-syntactic-context nil
((class c-basic-wisent-wisent-context))
"List of basic contexts used by C-basic-wisent.")
(defclass c-basic-wisent-syntactic-context-1 nil
((type c-basic-wisent)
(name (c-header-headings-generic 'c-basic-wisent-var cntl-syntax-table))
(key (if cntl-syntax-table " \n" "n"))
(value-type (if cntl-syntax-table "\\n" "\\n"))
(type (if cntl-syntax-table " \\\(" "\\)")
(if cntl-syntax-table "\\| \\|\\\")
(if cntl-syntax-table " \\\(\\<[^\n]*\\>")
(if cntl-syntax-table "\\\\\\[[-a-zA-Z0-9_A_][+]"))
(if cntl-syntax-table (if (c-is-in-string "\\(?:[^:]+\\|[^:]+\\)" "\\\\\\)?")
cntl-syntax-table ?>
cntl-syntax-table ?<))
"Symbol class defining `c-basic-wisent-syntactic-context'.")
(defun c-get-syntax-property (obj)
(if (eq (c-basic-class-p obj) 'c++-style)
""
(setq type obj)
obj)))
(define-c-local-overloadable-p cntl-syntax-function-p 'c-basic-wisent-wisent-syntactic-context)
(put 'c-syntax-action
(function cntl-syntax-method-name 'c-basic-wisent-wisent-syntactic-context-1)
"Function to use for C-basic-wisent-syntactic-context.
It takes point and calls function C-symbol-name as a template."
(function-name
'c-symb-action-function)))
(defclass c-basic-wisent-syntactic-context-2 nil
:type '(repeat function))
(provide 'c-wisent)
;;; c-wisent.el ends here
<|endoftext|>;;; c-wisent-macro.el --- The macro definitions for c++.
;; Copyright (C) 1990-1993, 2001-2019 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Maintainer: emacs-devel@gnu.org
;; Keywords: tools c c++
;; Package: c
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received
"%file: samples-19100"
======== SAMPLE 1 ========
(if (match-beginning 2) 1 'm2 nil 'm3)))
(save-excursion
(goto-char (point-at-eol))
(when (looking-back "[w]" t) (forward-char 1)
(let ((case-fold-search nil))
(search-bol nil)
(while (and (< (setq i (1+ i)) 0)
(zerop (1+ i))
(forward-char -1))))
(skip-syntax-backward "\f")))
(setq i (1+ i)))
(unless (or (looking-at
(format "[%s]" i)
(equal (match-string-no-properties 1)
(read-from-minibuffer
"The beginning of the current line: ")
(point-marker))
'm2))))
(progn
(let* ((beg (point-at-bol))
(end (save-excursion
(goto-char beg)
======== SAMPLE 2 ========
(let ((pos (point-max)))
;; In case it is not on the cursor, mark it with a
;; string marker, so we can search for it.
(if (and (bufferp buffer)
(eq mode-name 'xemacs-win-mode))
(or (looking-at-p "^[w]h$" mode-name)
(string-equal mode-name "^[0-3][0-9][0-9]")
(buffer-string))
(throw 'found nil))
(setq result (concat "^" (buffer-string)))
(when (string-match-p "\\'" nil)
(setq result (concat "\\\\.\\(?:\\\\\\?\\>[-+]\\)\\|$" (buffer-string))))
;; The line number is the number of occurrences.
;; (number-to-string (min (not (string-match-p "\n+" 0)
":")))
;; = ""
(throw 'found nil))
(setq idx
(match-string 1 idx))
(let* ((last '(?\( ?\( ?{ ?\{)))
(buf (nth 2 idx))))
(when (string-match "^\\(?:::\\{2\\}\\|\\'\\([^ \t\n]+\\)\\)")
(unwind-protect
(setq result (concat idx "^"
(buffer-string)))))))
(if (integerp count)
(> count 0)
(setq count (float count) count
idx (1+ idx)))
;; There was no line number.
(when (string-match-p "(\\(\\s *\\)\\s *\\(\\.\\|[^ \t\n]+\")")
(throw 'found result))))
;; Don't do the exact same thing again... If we found a
;; other value there are no problems. We simply create new
;; buffer variables, and run the same operation again.
(setq default-processing-directory (file-name-as-directory
======== SAMPLE 3 ========
default-directory default-prefix-string))))
((string= default-prefix-string default-prefix-string)
(setq default-prefix-string (cadr default-prefix-string))
(should (equal default-prefix-string ""))
(should
(list default-prefix-string
(cons nil (cadr default-prefix-string))
(cons default-prefix-string nil))))
(should
(list default-prefix-string
(cons default-prefix-string (cadr default-prefix-string))
(cons default-prefix-string
(- (cadr default-prefix-string)))))))
(error
(with-current-buffer
(symbol-value default-prefix-string)
(current-buffer))))
(unwind-protect
(setq entry
(list default-prefix-string default-prefix-string)))
(let ((default-prefix-string default-prefix-string))
(when (string-match org-prefix-string-regexp-regexp default-prefix-string)
(setq default-prefix-string default-prefix-string))))
(setq default-prefix-string nil)
(run-at org-prefix-buffer
(expand-file-name name default-prefix-string)
default-prefix-string)))))
;;;###autoload
(defun org-parse-title-after (title &optional pos)
"Parse TAG from HEAD.
The prefix arg specifies STRING to parse."
(let ((org-element-element p))
(org-plain-text-to-string title)
(setq org-element-p (string-match "\\`<\\(\\|\\)>" title))
(setq org-element-type 'plain
'org-element-type-alist))
(org-with-wide-buffer
(goto-char (point-min))
(let ((org-pre-title org-element-at-point t))
(org-with-extra-width
(org-element-property :before-empty (point-at-eol) 'org)
(org-with-completion org-html-regexp-as-search t))
(goto-char (point-min))
(let ((org-element-property
======== SAMPLE 4 ========
(if (eq (car-safe (cclass-sym-defs-class parent)) 'class)
(car (apply #'progn
(member parents classes))
(cdr classes))))
(nreverse (cons parents
(make-symbol "C"
(car classes)
(cdr classes))))
(push parents classes)
(mapc (funcall class-desc (cadr parents))))
classes))
(defun c-newline (&optional p)
(unless p
(setq p nil))
(c-newline p)
(or (c-maybe-newline)
(setq p nil))
(when (consp p)
(when (memq p c-syntactic-contexts)
(let ((state t))
(setq parent (car (c-pop-children-in-class-p p)))
(setq child-name t state)
(setq c-current-class (car (c-pop-children-in-class-p parent))))
(when (memq child-name c-syntactic-contexts)
(setq c-syntactic-contexts n nil))
(unless c-contexts
(setq n 1))
(setq c-current-class c-syntactic-contexts)
(setq c-current-type (car c-syntactic-contexts))
(setq c-newtype c-syntactic-contexts)
(setq c-syntactic-contexts-or-special (cdr c-newtype c-syntactic-contexts))
(setq c-contexts (cdr-list (reverse c-syntactic-contexts)))))
(defun c-contexts-with-context (col)
(if (equal (car-safe (car-maybe-type-class c-syntactic-contexts)) "")
(let* ((context (car context))
(syntactic-context-info (cadr context))
(syntactic-context-syntax (cadr context)))
(cond ((eq sym (car context)) 'syntactic-context)
((and sym
(eq (nth 2 context) '("class-")))
(syntax-syntax-function (nth 1 context)) 'syntactic-context)
(t
;; Can't have both classes, since we
;; cannot use cdr-get-sym (i.e.
;; 'context-syntactic-context-error).
(cdr context)
"%file: samples-19000"
======== SAMPLE 1 ========
;; and if the window-system returns nil, throw away its
and continue with the rest process
; else, we're dead.
))
(throw 'exit nil)))
(window-system
(and (eq gnus-window-system window -1)
(with-selected-window (selected-window)
(window-display-size))
))))
;; A window has ended (as a result of a scroll event) that isn't nil.
nil)))
(defun gnus-check-window-start-time (&optional _event)
"Check BUFFER-START-TIME EVENT to be the time for which it was used."
(interactive "P")
(let* ((win (selected-window)))
(progn
(cond
(window (car win))
;; If we have `window-start' selected, then we may as well return the
;; selected window. If we have `window-start-window', then set window's
;; window size (preferably a bit lower).
(nth (window-start window)
(if (get-buffer-window win '*))))
((window-minibuffer-p win)
(set-window-start win nil)) ; if there is no window, return this
(t (setq win (window-to-window window)))
;; This doesn't do any useful work; we must be
;; smart here.
(t (select-window win))))
(gnus-check-window-start :checkwin win)
(when window
(set-window-start win nil
(or gnus-window-system
(if window-system
(list gnus-win-windows)
gnus-window-start)))
(with-selected-window
(let ((win "win")
(win-system (if window (window-system win))))
(cons (current-window-system) (window-start win)))
nil)))
;;--------------------------------------------------------------------
;;; Interface functions:
;;--------------------------------------------------------------------
;;;###autoload
(defun gnus-menu-window-find-window (window)
;; "Display the windows in WINDOW on the current frame and return to WINDOW's window."
;; (interactive "P")
;; (interactive "P")
;; (require 'gnus-window)
;; (interactive "p")
;; (
======== SAMPLE 2 ========
(car file-list)))
;; FIXME: make the file name a directory.
;; FIXME: let`s assume some more, like `make-directory'.
(cdr file-list)))
))
;; If all the above is true, then this file is the
;; original one. We can't go back (x-get-buffer-create))))
(t
(set-buffer buffer))
(setq file (concat "*file: " (symbol-name file))
name ;; This
;; is an original file name. We must be sure the
;; file is actually a directory string. Shouldn't we
;; look for the name inside an alias? Maybe not.
(when (cdr (assoc file name-extension)))
(setq file-subdir1 'default)
(setq file-subdir2 'default)
(setq name-extension name-extension-extensions)
(if (and file-subdir2
(or (and file-subdir1
(setq name-extension (string-match-p
"\\`/"
file)))
directory)
(setq file-subdir2 'default)))
(t
t)))
;; Don't use `find-file-dirs-by-dir-name' here since
;; it won't work with the directory-files argument, even in Emacs 24.
;; (This variable has been removed since Emacs 23.1.1.)
(defvar file-name-extension-alist)
(defun file-name-extension-extension-to-dir (file)
"Extension or extension to the given FILE."
(setq file (directory-file-name (car file)))
(unless (string-match-p (concat "\\`\\(~\\):" file) file)
(setq file-name-extension-to-dir (substring file 1)))
;; Don't use files. Only the directory-file-name argument works,
;; and in Emacs 20.2.1.
======== SAMPLE 3 ========
(nth 0 b))
(nth 10 b))
(goto-char start)
(when (eq last-sexp-flag t)
;; If we match one or more
;; sexp-prefix-delims or suffix-delims.
(if (not (eq start t))
(progn
;; Replace all
(setq t (nth 11 (length b)) (nth 9 (length b))))
(if predicatep (nth 6 predicate)
(setq t (nth 13 (length b)) (nth 9 (length b))))
beg
end
(cond ((eq first-sexp-flag t)
(if (not (assq b t))
(unless (eq first-sexp-flag t)
(cons (cons (cons first-sexp-flag t)
(cons first-sexp-flag t))
(cons first-sexp-flag t))))))
(t
(cons (cons (cons first-sexp-flag t)
(cons first-sexp-flag t))))))
(set-match-data start b))))))))
;;; This is the original, but it is more of a hack to work without
;; compatibility for older versions of Emacs
;;; this one doesn't work as we are going to need a few lines of code
;;; to get to the right spot
; -
;;; which would be better to make a separate buffer from the original
;;;###autoload
======== SAMPLE 4 ========
(t
"foo")
(format "foo: %s"
(car org-agenda-table-format)))))
(defun org-agenda-insert-time ()
"Insert date, time of the current time into diary entry."
(interactive)
(org-agenda-insert-time)
(when (org-agenda-p)
(when (looking-at
"[0-9 o]\\([_[0-9]+\\).*\\([^]*\\)"))
(forward-line))
(format
;; (if (string-match-p ".*\\(" date)
("+%d ")
(format-time-string
org-time-zone-string)
" " (org-agenda-add-date
org-time-zone-string "[0-9 o]"))
;; (if (org-agenda-p)
("-%d")
(format "%s" date)
;; (unless org-agenda-insert-time
(concat
;; (concat org-agenda-last-time
'("+%d" "\n+%s.*")))
("<%s?%s.* %s"
"\\(\n[^>]*\\([[^>]*\\]\\|") ;; %s
"\\)" (propertize org-agenda-regexp
(org-get-time-string "*\\(\n)"))
;; (concat (org-agenda-time-string "^\n" org-agenda-time-string)
"\\(\n" "^" "\\)" "\\(\n)"
("\\s-* "))
;; (concat "\\s-*" ,org-agenda-time-string)
(format "%s" time)))
(when (string-match "\\$\\(" date)
(org-agenda-add-time
(format "
\\(%s[0-9,9]+\\)"
(mapconcat
(lambda (x)
(let ((val '( " ", " "")
( "#" "," "\\([^]" "")))
"%"))
(setq org-agenda-latex-time value))
time))
;; (if (string-match "")
"\\s-*")
(prog1
"%file: samples-18900"
======== SAMPLE 1 ========
?s)))))
(not (y-or-n-p (format-message "Quit, now just return %d" (car args)))))))))
(defun reftex-re-make-tex-style ()
(let ((symbolic-style (reftex-symbols-style))))
(cond
((< reftex-symbols-style reftex--symlinking-style)
(setq reftex--symlinking-style
reftex--symlinking-style)))
(reftex-set-symlinkable
string reftex--symlinking-style)
(or (memq reftex--symlinking-style
reftex--symlinking
(make-symbol "stddb")))
(syntax-table reftex--symlinkedify))
(defun reftex-symlink-sexp (_string res)
"Define res and return it with sexp SYMBOL SYMBRAS."
(reftex-symlink-to-symbols (reftex--symlink-to-symbols res)))
;; FIXME: use defvar for this (defvar reftex-symlink-sexp can't return a
;; syntactic variable).
;;
;; We're not trying to be strict, heretics and fools: a defun's definition
;; must contain at least (re)create a reference to a reference or
;; a class. There will be no problem with a defun's definition on a
;; plain definition! However, it's very bad to call defun
;; on a reference, because it would only return the definition itself! So we
;; return the definition itself!
(def-defun reftex--symlink-to-symbols (res)
(cond ((memq res '(stddb))
((defvar reftex-symlink-sexp))
(t (let ((reftex--symref-default-definition-re
reftex--symlink-to-symbols reftex--symlink-to-symbols))
(define-abbr)))
((memq res '(stddc))
(unless (memq res '(stddd)) reftex-symlink-sexp res))
(t (define-abbr
'defun
res reftex-symlink-sexp))))))
(defun reftex-symlink-to-symbols (res)
"Sets the definition of all the symbols in REPEAT.
See `reftex-symlink-to-symbols' and `reftex-symlink-to-symbols'
for their syntax equivalents."
(defsubst reftex--symlink-to-symbols (res)
(concat reftex-symlink-symbols
(or reftex-symlink-symbols
(intern-soft (concat rel-token res)))))
(reftex-set-symlinked-style (symbols reftex--symlinkedify))
res))
;;; ----------------------------------
;;; Internal stuff:
;;
;; <reftex-symlink-symbols> ; this code was based on a
;;
======== SAMPLE 2 ========
(const :tag "Redisplay" t t)))
(if (eq (char-before) ?\ )
(insert "\n"))))))
(define-derived-mode vc-mode ctlm-mode "Vc" (regexp)
"Major mode for displaying VCR files with C-like syntax.
VCR commands are defined in the ctlm-mode.el file."
(setq comment-start " ;")
(setq comment-end " ;")
(setq ctl-mode-map (make-keymap comment-start comment-end "#")
(make-keymap comment-end "[" comment-start "]")))
;; `insert-file-contents' to insert a comment at the end of the file.
(if replace-file-contents (insert " ;^ " comment-start))
(insert "\n"))
(define-derived-mode vc--mode ctl-mode "Vc"
"Major mode for displaying VCDL files with C-like syntax.
VCDL files are defined by `ctl-mode-map'.
That is, they can be represented as
`viper-file',
`hks-file' and other files. VCDL mode
indicates which VCDL mode they are in by
a \"\\b\\\\c\". This is used to make the \"^:"
arguments
(defconst ctl-mode-map "\^{%s}\n"
"Variable that indicates which C-like syntax to use.
This variable is used for VCDL files with comments only. It is
a symbol that makes a non-comment character and non-quote character
equal to one or more of those symbols.
To add a new comment (such as \\b[ \t\n\t]") using C-like syntax,
use \\C-x RET or \\C-x RET RET to insert the following comment.
A comment (as opposed to \") must be a comment character.
By default, the \"^" can be entered with \\[universal-argument]
or (substitute "\^{%s}\n" for `viper-file') and it is always
indicated by \"^\" when the default is not a non-comment string. (If
some of these variables are omitted, the comment should be inserted
instead.) This is used in VCDL files with comments only
when there is an appropriate VMDK command to insert the comment.
The default value is non-nil when the comment is followed by
a `;' as in `viper-file' (see `viper-emacs-comment).
Each line in a VCDL file should appear in the file
and not directly in the directory (i.e., in the region that is
not on each line). VCDL mode calls the
current buffer `viper-file' if the line number is greater than
the current line number (that is, the region in which you want
comments to appear in), and VCDL mode calls `viper-emacs-comment'
to find the line number in a directory or file (the
last that you see the VCDL file on that file). When
C-x RET is non-nil the comment is ignored.")
(defvar ctl-edit-comment-columns)
(defvar ctl-file-line-format nil
"List of file names which are valid (inclusive-of-most-enclosing-quotes) in V CDL.
This variable applies only when the file was moved at the point
of a line; it should only be set for vi-mode. When one
non-local variable is used for a comment, it is also set
otherwise for vi-mode.
By convention, such a thing is specified in an integer format,
where integer-valued format has to be set as first
character of each line. `viper-file' is the default value for which
`viper-file' is the first argument of the
`viper-file' argument of a file (such as for the Vi file).")
(defun mule-file-line-format ()
(interactive)
======== SAMPLE 3 ========
"ัมมม์"
;; "ัม์กึน"
;; "ัม์พะหน"
;; "ัม์ทัย"
;; "ัม์ทัยะหทัย"
;; "ัม์มาด"
;; "ัม์ทัศัทะหทัยปหงะหม์ส"
;; "ัม์ททะหหมยม"
(defvar font-lock-function-keywords
`("\\$" "aัม์มาง"
"ัม์มาด"
"ัม์มาบ"
"ัม์มำด"
"ัม์ม์มีน"
"ัม์ม์มเานาตอ"
"ัม์ม์าตอบ"
"ัม์ม์ม์มเานํสยัม"
"ัม์ยกานาต"
"ัม์ยเานาต์"
"ัม์ยแานาตะ"
"ัม์หมรษพม฻"
"ัม�
======== SAMPLE 4 ========
(let* ((default (caar themes)
(current-local-map)
(caar themes)
(current-local-alist))
(t (setq c (point))))))
(and c
(progn
(setq contents nil)))))
(setq all-local-atoms
(cons c contents nil))))
(defmacro widget--all-local-atoms (from from-local))
(defcustom widget--all-local-atoms 4
"A set of rules for how to make the widget local in FROM.
See `widget-local'. It makes `widget-local' the first
`widgets-local' object at the top of the tree. If
you use the `minibuffer-option' of a list, the minibuffer
option for the same object is used, if applicable. The
option is \"widgets\" if it was defined as a widget, \"widgetsdwidgets\"
if it is one of \"widgets\" and \"widgetsdwidgets\", \"widgets\"
if it was defined as an object."
:type '(choice (const none) (const all))
:group 'widgets
:version "24.3")
(defun widget--all-local-atoms-default (&optional from-local)
"Display all local atoms in FROM.
When nil, just return the list of local atoms. If optional
HELP is non-nil, that means only return the local atoms if
inHERC can.
When optional argument FROM-LOCAL is non-nil, returns the local
atoms, instead of the object of the top of the tree.
See `widget-local' for local atoms.
`grep'
Return non-nil if FROM-LOCAL is a Gnu widget, or nil if it is not."
(interactive "P")
(widget-letunps
'((default :name "Gnus Tree")
(< 2 (widget-name from-local)))
(unless from-local
(and from-local
(not (string= (widget-name) 'local-todo-list)))))
widget-local)
(defcustom widget-local (widget-local))
(defcustom widget--local (widget-local))
(defcustom widget-dwim (widget-name))
(defun widget-select-object (widget)
"Choose a WIDGET from which to select."
(setf (widget-get widget 'default-widget) widget)
(widget-apply widget 'initial-buffer-function))
(defun widget-goto (object)
"Return t if HORIZONTAL is a local at point."
(cond
((not (widget-get object 'function)))
(t
(goto-char (widget-get object 'function)))))
(defun widget-get (object)
"Return non-nil value of OBJECT."
(let ((value (widget-get object 'function)))
(widget-apply widget 'create-function-object value))
value)
(defun widget--dwim (object)
"Return t if HORIZONTAL is a local at point."
(while property
(setf (widget-get object 'default-property) property)
(widget-apply widget 'create-function-property property))))
(defun widget-select (object)
"Select OB
"%file: samples-18800"
======== SAMPLE 1 ========
is (nconc (1- (length (car t))) (progn (nreverse (nth 3 t))) 'symmetric))
(defvar gnus-article-mode-alist)
(defvar gnus-article-mode-hook nil)
(defvar gnus-article-mode-history)
(defvar gnus-article-mode-files)
;;;###autoload
(define-derived-mode gnus-article-mode gnus-article-mode-alist
"Mode for editing newsgroups."
"Gnus mode mode for editing newsgroups (1.2).
The mode allows you to:
- To edit, copy, copy, copy, create links, add & hide groups and
- Create a buffer list, and select the text that is already in
`gnus-article-mode-buffer'.
- To edit a group of news articles, do what `gnus-group-edit'
should do, and you can delete it or copy it yourself.
- To edit an article, move to the article buffer, and change
`gnus-group-edit' to delete it.
- To edit group of articles and copy them to your favorite
`gnus-group-copy-this-folder' package.
This mode works well for any Gnus distribution, but for those who want to use
the new features, you still need to:
- Toggle in-group mode
- Find a newsgroup, and select that.
- Use `gudt-gnus-article-mode'.
- Set a new file name to the newsgroup, and customize the group.
If you have some fancy article editing programs, like the ones for Org or XEmacs,
you can create `gnus-article-mode-alist' which controls the mode and
and lets you copy any article you want to make."
"A mode for editing Newsgroups.
This is the basic configuration for editing (or recording) a gnus group.
This is called the "gnus-article-mode-alist" and uses the existing `gnus-mode-alist'
to build a new one, if any. The configuration file is written from
`gnus-article-mode-map', so you can copy it to a file and then create
`gnus-article-mode-alist' to change how it is used.
The customization settings are as follows:
(narrow-to-region)
For each article in `gnus-article-mode-alist' select either
(beginning-of-line 1) (bottom-of-bar-in-comment-column)
(forward-line -1)
If the group you are editing is in `gnus-group-files' and
you enter the list with the article, if any, then select it.
If the group you are editing is not in `gnus-group-files' then select
`gnus-group-edit' and edit the default group.
To customize the customization variables or add a new one for it:
(setq gnus-article-mode-alist
(let ((default-set 'gnus-article-mode-alist))
(add-to-list 'gnus-group-files
'gnus-article-name)))
You can use this to copy newsgroups and groups of articles to a different location.
You can use `gnus-article-add-to-list' or `gudt-gnus-article-mode' and
`gmconfig-create' to make the list, or create a new one by
clicking on the group's name in `gnus-group-files'.
If any group you prefer is not in `gnus-group-files' then it will be
ignored in the list of articles you can be added to.
You can use commands `gnus-article-copy-to-list', `gnus-article-copy-to-list-1',
`gnus-article-add-to-list-2', `gnus-article-copy-to-list-3' or
`gnus-article-add-to-list-4' to make an article copy to that group.
The customization set does not modify the list of articles you want to edit.
Note that you can't delete the articles you just want to copy from
`gnus-group-files' without saving them on your
======== SAMPLE 2 ========
is (car bb))
(setf (cdr bb) bb-list))))
(defun cperl-list-contents-in-place ()
(let ((b (car b)))
(if (cperl-list-member b 'c++-include-contents-regexp)
nil
(let (c-defs-to-string c--substrings c++-include-contents-re
c++-include-contents-re
c++-include-contents-re
(eq c (cdr c-defs-to-string c++-include-contents-re)))
(eq (overlay-get c-defs-to-string c++-include-contents-re)
'car))
(mapcar
(lambda (overlay &optional not-done)
(add-text-properties (point-min) (point-max)
'c-declare-convert c--substrings c++-include-contents-re
c-declare-conversion-flag
c-declare-convert-flag))
'c-declare-substring-regexp))
(mapcar
(lambda (overlay)
(let (overlay)
(mapcar (lambda (overlay) (and not-done (not c-defs-to-string not-done))))
(cperl-list-sublist c-defs-to-string c++--substrings))))
)
;; This does not provide a single argument to be filled in by default, so
;; it's not clear if that's actually true, or if `eq' is actually
;; true. But it's useful to have this, since c++-include-contents is
;; much faster than c++-include-contents.
(defun c-def-all-list ()
(let ((c++-include-contents nil))
(setf (c-overlay-start c-overlay-start) c-def-all-list-re)
(mapcar
(lambda (overlay)
(mapcar (lambda (symbol)
(cdr c-def-all-list-re))
(cddr c-def-all-list-re))))
(cl-dolist (c '())
(cl-backward-to-token "")
(cl-assert (not (> (overlay-get c-def-all-list-re (point)) 0)))))
(let ((c-defs-to
======== SAMPLE 3 ========
is an empty string.
\\{cc-cc-src-dir}
\(fn DOCTYPE &key KEYS)" nil nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "cc-" '("cc-")))
;;;***
;;;### (autoloads nil "css-cite-" "css.cite-" nil
;;;;;; "css.el" (0 0 0 0))
;;; Generated autoloads from ccss-cite:
(autoload 'css-cite-start "css-cite-" "css-cite-" "\
Start CSS based citation in current buffer.
\\{css}
\(fn &optional ARG)" nil nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "css-" '("css-")))
;;;***
;;;### (autoloads nil "css-compress" "css-compress.el" (0 0 0 0))
;;; Generated autoloads from ccss-compress:
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "css-compress" '("css-")))
;;;***
;;;### (autoloads nil "css-header" "css-header.el" (0 0 0 0))
;;; Generated autoloads from ccss-header:
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "css-header" '("css-")))
;;;***
;;;### (autoloads nil "css-header.el" "css-header.el" (0 0 0 0))
;;; Generated autoloads from ccss-header:
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "css-header.el" '("css-")))
;;;***
;;;### (autoloads nil "css-gcc" "css-gcc.el" (0 1 1 0))
;;; Generated autoloads from ccss-gcc:
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "css-gcc" '("css-")))
;;;***
;;;### (autoloads nil "css-font-lock" "css-font-lock.el" (0 0 0 0))
;;; Generated autoloads from ccss-font-lock:
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "css-font-lock" '("css-")))
;;;***
;;;### (autoloads nil "css-font-lock'" "css-font-lock.el" (0 0 0 0))
;;; Generated autoloads from ccss-font-lock:
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "css-font-lock" '("css-")))
;;;***
;;;### (autoloads nil "css-compress-fontify" "css-compress-fontify.el" nil
;;;;;; (0 0 0))
;;; Generated autoloads from ccss-compress:
(autoload 'css-compress-fontify-face "css-compress-fontify" "\
Fontify the current buffer into a buffer whose name begins with \"%.\".
Fontify a file with \"%.\".
If you create it and fontify, the current buffer is
in a fontified state.
To display a list of files in a buffer, type the following command
\\[help-toggle-fontify] or call C-b \\[help-show-fontify] in the C-c major mode keymap." nil nil 'fontification)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "css-compress-fontify" '("css-")))
;;;***
;;;### (autoloads nil "css-fonts-regexp"
;;;;;; "css-fonts-regexp.el" (0 0 0 0))
;;; Generated autoloads
======== SAMPLE 4 ========
is not nil. It might be true."
(interactive "P")
(list (completing-read "Default value for Emacs: " nil nil) (lambda (name buffer-name)
(let ((buffer-name (buffer-name buffer)))
(let ((this-function (lambda (_name buffer) nil)))
(if (and this-function
(string-match-p "\\`\\'" name))
(let ((name (match-string-match "\\'" string))))
(if (string-match-p "\\`\\'" name)
(= (string-width (nth 1 name))
?\; last-prompt-regexp)
string))
(org-list--get-list-prompt-name name)
(org-list--find-prompt-regexp name))))
(if string "" string)
(stringp new)
new)))
(setq nil (not result))))
(setq result nil))))
((and (> result 0) (stringp result))
;; `this-function' does not know if the result is a string.
;; Try to find a function for the purpose of calling it. If `stringp'
;; is not non-nil, try and find a function.
(let ((list (org-list--get-list-prompt form)))
(if (functionp list)
list
;; `this-function' might return nil. For the sake of
;; `list', try again.
(call-function (concat (string-to-list result) 'stringp)))
result nil)
(concat
buffer-name (if (stringp string) string) nil
"%file: samples-18700"
======== SAMPLE 1 ========
information for the first time. If it still can't complete, this command sends an error.
You are prompted for the name of the project,
and this may be on one of the files in your local project. This can
include anything
directory and project names that don't appear in the project list.
AUTHORNAME is the author in your project and is the name of the
file to be used on the printer, directory, or project. See
`mml-manual-directory-author'.
This may also be specified as the remote/remote-path value for
the project that corresponds to that value.
See `mml-manual-directory-remote-path'.
See also the `mml-manual-user-directory' section for the
parameters to specify the remote/remote-path and remote/remote-target.
Otherwise, if this file is the main name of the main printer/fringe and
the project name uses the same local name as `default'.
This command attempts to read the file and return an error if the
file does not provide a valid file name. If the file does not provide a
valid file name, it exits."
(let* ((progn (mml-manual-directory-author "manual-name"))
(mh-print-info (format "%s" progn)))
(when (> progn mh-proj-filename)
(let (filename)
(with-temp-buffer
(insert-file-contents filename)
(goto-char mh-proj-re)
(cond ((and mml-project-alist
(re-search-backward (concat mh-proj-file-regexp "\\.pro\\'"))
(not (looking-at mm-manual-dont-need-source-file-regexp)))
(mml-file-name-as-directory
(match-string 1) "manual-dont-need-source-file-regexp"))
(setq mh-proj-directory (directory-file-name mh-manual-dont-need-source-file))
(goto-char mh-proj-re)
(unless (search-backward (concat "-" mh-proj-re) nil t)
(insert-file-contents filename))
(goto-char mh-proj-re)
(mml-error
""
(insert-file-contents filename))))
(if (search-forward (concat mh-proj-file-regexp "\\.pro" nil t) mh-proj-re)
(progn (goto-char (point-min))
(funcall mh-program-string progn
(point-min)))))))))
(provide 'mail-x)
;;; mail-x.el ends here
<|endoftext|>;;; mail-x.el --- mail-x.el package for X
;; Copyright (C) 2001-2003, 2007-2019 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: comm, hypertext, mail, xterm, mail
;;
======== SAMPLE 2 ========
information.
(defgroup srecode-dns-dns-protocols nil
"DNS Protocols for using the Relevant Dns Protocols."
:version "24.1"
:group 'srecode)
(defcustom srecode-dns-dns-method "dns://"
"Name of the Srecode dns method to use.
See the relevant manual for more information.
This value can also be nil, and is used as a default for other
dns methods, if this is defined, i.e., if the dns:// is defined
and `srecode-dns-dns' has defined it, this will be called
as such."
:group 'srecode
:prefix "srecode-dns-dns-" t
:link '(custom-manual "(srecode)dns")
:version "24.1")
(defcustom srecode-dns-prevent-dns-file (or (and (not srecode-dns)
(sor dns-in-file))
(sconc dns-in-file (sfile srecode-dns-in-file)))
"DNS Prevention option for Dns methods.
It is recommended that you use this method to prevent problems such as:
/dns dns://
/dns dns://:// (srecode)dns://
/dns dns://"
:group 'srecode-dns-dns-protocols
:version "24.1"
:package-version '(srecode-dns-dns-protocols
:init-value :version "24.1"))
(defcustom srecode-dns-dns-header
(save-window-excursion
(srecode-goto-header)
(let* ((file (or (srecode-dns-header-name srecode-dns-in-file)
(or srecode-dns-in-file (file-absolute-name srecode-dns-in-file)))
(file-extension dns-in-file (file-name-directory srecode-dns-in-file)))
(file-remote-name file)
file
(file-symbol-name (file-symbol-name (cdr file)))
(file-name-coding-system srecode-dns-dns-file-name-coding-system))
(cond
((not (and (file-symbol-all-completions (symbol-name file)))
(file-remote-name file)
file)
(t
(error "File in which srecode's files are being processed doesn't exist; try again")
(let* ((dns (srecode-dns-dns-encode-dns file dns))
(exp
(srecode-dns-make-file (file-name-nondirectory file) file))
(dns (srecode-dns-dns-decode-dns file dns))))
(t
(srecode-dns-dns
======== SAMPLE 3 ========
information is
(condition-case nil
(let ((case-fold-search t))
(and (< (point) start)
(prog1
;; Check, and not for interactive use, whether our
;; previous entry was inside
(when (< (point) end)
(setq return
(and (eql (cddr info-begin-prefix-list) (point))
(point)))
;; Return the index that we've found.
(prog1
(setq return (when (consp return)
(cons (cons 'end
(cadr info-end-prefix-list))
(save-excursion
(narrow-to-substring
(point) (progn (bobp) (bobp))))))
return))))))))))
;; A valid index.
`((id (point-min))
(count (1+ count))
(id)
(save-excursion
(if (not count)
(beginning-of-line)
;; Check the return value, if any. Otherwise,
;; the return is not a known index-value and is
;; probably a bad one...
list-for-index start end end)
;; No such index anywhere.
(if (and (= count 4) (= count 5))
(setq return
(and list-for-index (not (if count (= count 3))))
(while (< (point) end)
======== SAMPLE 4 ========
information and an echo-command.
Function `comint-insert-command' is called when the echo-command is invoked."
:type 'file
:group 'comint)
(defcustom comint-find-and-edit-file-contents
(if (and (stringp buffer-file-name)
(string-match "\\`\\(\\([^\\]\\)\\)" buffer-file-name))
(string-match "\\'" buffer-file-name)
"\\`\\(" buffer-file-name "\\)\\1"))
"String containing the contents of a file under Org Mode.")
;;; The `gcc-cmds' command to execute cc-mode commands on the command line.
;;; `gcc-set-command' to invoke the cc-mode command on the command line,
;;; but also to set the value of `gcc-mode-flag' on the command line.
(defun gcc-get-command ()
"Get a new process running at startup time."
(interactive)
(setq last-command-event (comint-get-context 'name))
(goto-char (point-min))
(when (re-search-forward "^$" nil t)
;; Try to send a message about this problem to the server:
(with-current-buffer t ; don't run this by yourself.
(message (comint-send-string 0)))
(setq last-command-event 0
(save-excursion
(goto-char (point-max)) ; get the first command
(forward-line 1))
(cond ((looking-at "^@s")
(set-marker (re-search-forward "^@s" nil t)
(point-at-bol))))
((looking-at ": \\(\\S\\|\\\\w\\)"))
(t ; the last line is the "\\<"
; separator to ignore
; line number
nil nil nil nil
; string to use when outputting
(looking-at ";")) ; line number for output
(looking-at "0 \\)"))
(t ; line number for outputting
t)))
(goto-char last-command-event)
;; In case of error, find the file whose name matches.
(goto-char start)
(forward-line))
(error "No such file: %s" last-command-event))))
(defun gud-gud-setup-command-info ()
"Create a command line tool-bar that knows how to manage commands.
This will be in gud's command menu, where `comint-gdb-mode
"%file: samples-18600"
======== SAMPLE 1 ========
277 (0)
"Alignment of a string with the `-' and `.' separators.")
(defun font-locking--goto-next ()
"Visit next line and move it to the nearest indentation line
instead of the current indentation."
;; We don't want to move the current indentation
(interactive)
(unless (bolp)
(char-after (get-char-property 0 (1- (point))))
(list 'previous-line (get-char-property (1- (point) 'previous-line)))
(error "Don't know how to indent a line")))
(defun font-lock-newline ()
"Return the completion list on the next line."
(if (and (bolp) (< (point) (font-lock-re-search-forward "^*#\\*?+:[0-9]+:[^:<]*\\(")))
(looking-at font-file-name-extension)
'(forward-line 1))
(forward-line -1)))
(defun font-lock-completion-mark-type ()
"Return t if point is on the first newline or the
first occurrence of \"[-+]+" on top of the \"[-+>]" heading.
If point is on the first headline, we return t.
Otherwise we return nil."
(save-excursion
(beginning-of-line)
(when font-lock-completion-mark-type
;; Do nothing if font-lock-type is not nil, or
;; it could be a function, like it's not called yet.
(let ((case-fold-search t)
(completion-mark-type-string))
(funcall compilation-completion-table-function completion-mark-type nil nil t))
completion-mark)
;; Set the value of the completion table so that it gets active
;; in the next compilation.
(if compilation-completion-table-function
(set t nil)))
(if completion-table-function
(set-mark (point-marker))
(point-max))))
(defun font-lock-keywords ()
"Return `:'s for all `:'s in the current keyword name."
(ignore-errors
;; Do not add any other type of keywords to `global-keywords'.
(if (> (length keywords) 2)
(cdr keywords)
(list :global ":" keyword)))
(save-excursion
(beginning-of-line)
(and font-lock-keywords
(looking-at font-lock-keywords))
(backward-char)
(if (not (looking-at ":\\([^\\]*\\)"))))
(goto-char (max 1 (read-only-mode-word)))))
(defun set-font-lock-keywords ()
"Set the `:`s here for all `:'c's and [^[^[^[^]]+]*'.
You may also add another `:'s here to `global-keywords' for
symbol names like `c' or `c++' and `c++' which are not at
`global-keywords'."
;; Note: this function looks only at all keyword names
;; because it is the most important keyword in a keyword list, and we use
;; `font-lock-keywords' for the whole list. (see
;; for more context on font-lock-keywords)
(goto-char (max max-lines 20))
(let ((font-lock-function (font-lock-keywords))
(global-keyword-list nil))
(if global-keyword-list
(set-keymap global-keyword-list)
======== SAMPLE 2 ========
277))
(save-match-data (match-end 0) (point-min))
(goto-char (match-end 1))
(end-of-line)
(forward-line)
(message "%s" (if (search-forward "\\<" t) "-[\n]" nil t t) t))
(message "%s" (if (search-forward "\\<") nil t)))))
(defun pcase (caar a)
"Faces inserted by `case'.
Case (or a value with an alist of cases) is assumed.
Optional argument AAT should be a non-nil predicate."
(ignore-errors
(when (or (and (equal a #x00000) (equal a 1))
(and (eq a #x00000) (equal a 1))
(and (equal a #x00000) (equal a 1))
(or (not (bobp))
(looking-at "\\<\\(.*\\)"))))))))
(defun pcase-nondefault (pos)
"Non-nil if NADDCARVES is encountered in all non-identifiers with a non-string
number."
(not (equal pos #xFFFFFF)))
(defmacro pcase-match (c a &optional value)
"Non-nil if C should be matched in a pcase context.
With prefix argument non-nil, `macro' matches the current input context."
(cons '(or (bobp) #xFFFFFF)
nil))
(defmacro pcase-value (c a &optional value)
"Non-nil if the current input context is the current value.
With prefix argument non-nil, `macro' matches the current value.
If the value is non-nil, non-nil will be inserted into buffer."
(cons '(or (bobp) #xFFFFFF)
(or (bobp)
(looking-at pcase-nondefault)
(looking-at "\\<\\([ \t\n]*\\)\\(?:\\(?:[ \t\n]*\\)?")))))
;;;###autoload
(defun pcase (c a &optional value)
"Non-nil if the C value matches one of pcase's non-identifier expressions.
If optional argument VALUE is non-nil, a value of this form will be inserted.
If value is a string, that string value will be inserted.
A numeric value means to call `define-match-pcase'."
(or (and (memq (following-char)
'(pcase pcase-match-match-noref
(eq 'numeric (char-after))
'(equal (capitalize) 'mime-chars-alibri))))
(let (result)
(or (bobp)
(looking-at pcase-nondefault-re)))))
;; FIXME check that the user wants this
(when (string= value "")
;; Use a new keyword to match.
(let ((case-fold-search t))
(if (and (memq value pcase-pred))
(if (and (setq pred (cdr (assq c pcase-pred)))
======== SAMPLE 3 ========
277
(let ((end (length tmp-1)))
(while end
(and
(let ((s (cdr (cdr tmp-1))))
(push
s tmp-1)
;; Return the value of the tmp-1 we got.
(if tmp-1
(substring (match-beginning 0) (match-end 0) (match-beginning 1)))))
s)))
(nreverse (mapcar 'car tmp-1)))))))))
(defun mml (filename)
"Return the name of the file for FILE under the cursor.
FNAME is either the filename or `mml-file-name-regexp' if FILENAME
is either non-nil or a string."
(let alist
;; In these cases, try to read the file name
(if (fboundp 'read-file-name-format-function)
(let ((temp (read-file-name-internal filename)
(file-name-name filename))))
(and temp
(or (file-exists-p file-name)
(with-temp-file temp
(dolist (file temp) ; Don't try to read the first
;; file name
(read-file-name-internal file file)
(read-file-name-internal file)))))
(setcdr (assoc-string
(concat filename alist) t)
nil nil filename alist)
(nnml-to-file filename)
(nnml-read-regexp
filename))))))
(defun mml4 (filename)
"Read FILENAME from disk.
If there is an explicit match for a name or for the current directory,
it can be done either in the `nnml-file-name-regexp'
argument or by calling the function given the same name/french-name regexp as
`mouse-face' by giving an explicit match for the name or directory."
(if (eq (mouse-char-property-boundp 'mouse-face filename) 'mouse-face)
(car filename)
(apply function (mml-save-filename filename) filename))
;;;###autoload
(defun mml-write (&optional filename)
"Write FILE to disk with point at end, just like mml-make-write."
(let ((start (buffer-base-buffer)))
(mml-get-filename filename)
(cond
(buffer-modified-p)
======== SAMPLE 4 ========
277
; FIXME? Does it matter what language is a mode name?
(lambda ()
(let ((inhibit-read-only t))
(dolist (inhibit-message in-revision)
(if (fboundp in-revision-p)
(when (eq in-revision-p 'taboo)
(forward-char)
(forward-sexp)
(re-search-forward "^[0-9]+" nil t)))))))
(unless (= (point) (point-max))
;; Don't let the value of the
;; (current-buffer) buffer change determine whether the
;; value should be moved to the new position.
(not (eolp))
(forward-char 1)))))))
(set-buffer-modified-p nil
(if (or (not (search-forward (format "^\\s-*$" nil nil) t))
(eq (current-buffer) file-name)
(forward-line)
(match-beginning 1))))
(kill-buffer (current-buffer))))
(if update-active (or current-buffer-modified-p
buffer-file-name (buffer-file-name))
(with-current-buffer buffer-file-name
(mapcar (lambda (f1) (apply f1 f2)) f1
(setq value f1)
value (buffer-file-name))))))
;;;###autoload
(defun semantic-spp-mode ()
"Minor mode for spp mode."
(interactive)
(save-excursion
(beginning-of-line)
(and (looking-at "\\s\\s(\\s-+\\|\\s.-\\s-*\\)\\s-*")
(progn
(forward-char 1)
(forward-comment 1)
(skip-chars-forward " \t")
(let* ((old (symbol-function semantic-spp-mode))
(new
;; FIXME? Maybe this is a mode line which must
"%file: samples-18500"
======== SAMPLE 1 ========
(cperl-electric-pair-if-not-as-intro))
(cperl-punctuation-function nil))))
(if (and c-langing-overlay-pos
(cperl-electric-pair-in-constants))
(cperl-electric-pair-is-at-point nil)
(cperl-electric-pair-should-end-of-prefix-start 1)))))
(defun cperl-electric-pair-start-predicate-1 (predicate &optional arg)
"Try to make a \"first\" pair of matches for a predicate.
This is the `cperl-electric-pair' method from C or Lisp (where `@' is optional.)
ARG is the number of matches to try to make. It's an integer if the
first match is greater than ARG, nil otherwise.
PREDICATE has the same meaning as `cperl-electric-pair', see
the comment around the definition of `cperl-electric-pair-1', see
the `cperl-pair-start-predicate' function for a description."
(let ((last-predicate (cperl-electric-pair-start-predicate
(lambda (pos)
(if (and (eq pos (car pos))
(eq last-predicate last-predicate-start))
(eq last-predicate last-predicate-start)
last-predicate-start))
last-predicate-start))
(last-predicate (if (and c-langing-overlay-pos
(and c-dank (zerop (cdr pos)))
(not (memq (char-before (cdr pos))
'(nil t))
'(1 (or (char-after (or (cdr pos)) char)))
(and (cdr pos)
(and (eq (char-after (or (char-before (char-after)) ?-))))
(and (null char-before-chars) char-end)))))
(when c-dank
(if (> c-dank last-predicate-start)
last-predicate
======== SAMPLE 2 ========
"X-S-*X-1"
"1" "G-G-3" "C-c" 'font-lock-string-face
"-C" 'font-lock-warning-face
"@face:" nil 'font-lock-string-face);
"G-g" "G" "M-g" "H0" "M-h" 'font-lock-fontify-formats
"-H" "[^-]*"
"-t" '(0 'font-lock-function-face name name-face
'mouse-face face-face))))
;;;###autoload
(define-minor-mode font-lock-comment-mode
"Toggle comment mode according to the major mode of the font lock buffer.
This mode is for the font-lock buffer, and defaults to major mode.
It displays text which is different from `font-lock-mode',
in this case only by font-locking-function is followed by the major mode value."
;; Make this font lock buffer font-lock-comment-mode
;; Use this buffer to indent and set highlighting by default
(if font-lock-mode
;; Do not use an empty fontification buffer if fontifying has been turned on
(if (null font-lock-comment-mode)
(progn (setq font-lock-default-fontify-function
(font-lock-fontify-fontification-function)
font-lock-default-fontify-function)
(error "Can't fontify the fontification buffer"))
(set-font-lock-default-face font-lock-comment-face))
;; Set up fontification
(setq font-lock-default-face current-prefix-arg
font-lock-variable-name-face (face-names-regexp)))
;;;###autoload
(defun font-lock-setup (font-lock-get-default-face value
&optional font-lock
&variable-default-fontification
&optional font-lock-keyword-face
&variable font-lock-keyword-face-face
&rest font-lock-keywords))
"Initialize `font-lock-face'.
The `highlighting' property is set by default. This function sets it
in the font-lock buffer."
(interactive (font-lock-keywords t))
(if (null value)
(error "Could not set `highlighting' property for %s" value))
(set-font-lock-variable value 'highlighting))
;; Fontification mode
;; Fontification mode is basically the same as font-lock-mode, except for using
;; all the variables it sets in the last line of the buffer to specify
;; the font lock fontification feature.
(define-overloadable-function font-lock-fontify-key
======== SAMPLE 3 ========
(goto-char (1+ n))
(beginning-of-line 'syntax-table))
(should (syntax-table-p (syntax-table-get)))
(should (syntax-table-get
(syntax-table-get) (intern (aref syntax-table-list 4)) '(nil)))))))
(ert-deftest highlight-regexp-list-with-regexp ()
(dolist (regexp (lighter-list '(nil nil))
(regexp-quote ref)
(regexp-quote (car ref)))
`(,@regexp-quote
"\\|"
:regexp regexp
,(concat regexp "\\" ref))
(let ((match (lighter-list-comma ref)))
(dolist (ref ref '(nil nil nil nil))
(setq ref (syntax-table-get ref)))
`(,ref (syntax-table-get ref)))
(dolist (ref ref '(nil nil nil nil nil))
(when (numberp ref)
(let (,ref (syntax-table-get ref))
(while (re-search-forward ref match (syntax-table-get ref 'syntax-table))
(setq match (match-string-no-properties 0 ref))
(setq ref (syntax-table-get ref (match-beginning 0) match)))
`(,ref ,ref))))
)
(provide 'ert-deftest-refine)
;;; refine.el ends here
<|endoftext|>;;; refincl.el --- Regexp-based search functions for refine buffers.
;; Copyright (C) 2018-2019 Free Software Foundation, Inc.
;; Author: Nicolas Mackenzie <namaz@gnu.org>
;; Keywords: internal
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Refine is used for finding refine buffers.
;;; Code:
(require 'refine)
(require 'font-lock)
(defgroup refine nil (widget)
"Find out what type is on this page.
To find out what's going on on this page, use the `find-refine'
function in your .emacs."
:type '(radio (funcall widget-type) (function widget-type))
:group 'refine)
(defvar refine-buffer-name "[ \t\n]*refine*"]
(defun refine (widget &rest props)
"Find out the contents of the current buffer.
This is done with a \"refine\" function. With a prefix arg, it
gives a list of text properties. In each element of the list there are
a string with that prefix, where one of the properties is `refine',
where `refine' is an internal searchable string."
(get widget 'refine)
======== SAMPLE 4 ========
(+ n -1)))
;; (1+ n))
;; (1+ n))
(let* ((first (+ n 1))
(first-n (car first)))
(aref math-sqrt -1))
(setq math-sqrt (1+ (cdr first)))
(setq math-sqrt (+ (* math-sqrt (* math-sqrt n)) 2)))
(if (math-expr-table-p math-sqrt first-n)
(setq first (cdr (math-vector-get n math-sqrt)))
(cond
;; (1+ first-n))
((math-expr-table-p first-n)
(setq math-sqrt 1))))
(t (and math-sqrt (math-expr-expr-list first-n first-n))
(math-vector-look (length math-sqrt) (vector (1+ (car (cdr first)))))
(math-vector-look (length math-sqrt) (vector (1+ (cdr (cdr first)))))
(math-vector-to-float "mpl")
(let ((calc-float-mode 0))
(if (eq 'calc-literal (car math-sqrt))
(cons (list (list calc-float-mode)))
math-sqrt
calc-float-mode))
(if (eq 'calc-hyped-int)
(car calc-int)
(calc-normalize-expr-map '(float float float expr)))))
(let* ((calc-float-mode 0)
(calc-math-normalize-expr-map (list math-sqrt 2))
(calc-inverter-mode -1)
(calc-intangible-mode (cons math-sqrt (1+ 2)) calcc-real)
(calc-integer-mode calcc-integer)
)
(mapc (lambda (a b)
(let* ((calc-inverter-mode 0)
calc-math-simplify)
(calc-math-modifier-mode calcc-real))
(list (math-vector-map 2 calcc-simplify))))
(cl-incf (cons calc-simplify 1)
(
"%file: samples-18400"
======== SAMPLE 1 ========
;; The `diary' method allows two forms :
;;
;; ;; 1. You can get a list of dates and times of the day/month
;; ;; 2. and time of the hour/minute/hour/day
;; ;; `diary' method. Note that this is only used if an
;; ;; date or number is specified by user.
;; (file (and (file-exists-p (concat file date &optional full-time-p)) `(t))
;; (file-attribute-nonslash-p date full-time-p)))
;; 2. You can have a list of time stamps of the day/day/hour
;; `time' and time of the hour/minute/hour/day
;; time of the hour/minute/hour/day
;; `day-of-month-and-year'
;; `year-of-the-week'
;; `year-of-the-month'
;; and other time tables that can be used
;; respectively.
;;
;; 3. There are two ways to record the results of the time stamps
;; `diary' method:
;; ;; 1 : time-of-day-of-month-from-date,
;; ;; `diary' method. Note that this is only used if an
;; ;; `diary' date or number is specified by user.
;; (date-of-month date-of-year)
;; nil) ; nil: "nil"
;; "nil"
;; nil))
;;
;; 4. Deduplication. Deduplication is a variable to use for
;; the current DTD.
;; (var DTD)
;; nil)
;; The variable `diary-dormant' contains date/day to use for that one
;; day/month/year.
(eval-when-compile (require 'org-time)))
;;
;; The file `Org.Diff.svn' contains files from several different
;; languages that support splitting the major diffs.
(defvar old-file-name-handler-alist nil
"The names of these files when `diary-dormant-handler' is called.")
;; The 'file-name' function allows you to specify the timezone in
;; addition to the real time for files in that language to be displayed.
======== SAMPLE 2 ========
(let ((val (intern (completing-read "Valve Key: "
emulated-version))))
(dolist (c '("--version " "--version "") c c "--version.el" "--version.el" "--version.xpm" "--version.el" "--version.el" "--version.bin")
(cond
((not (featurep emulated-version)) "--version.xpm" "--version.xam" "--version.bin")
((featurep emulated-file) "--version.xpm" "--version.bin")
((featurep emulated-file) "--version.bin" "--version.bin.el" "--version.bin.xpm")
((featurep emulated-file) "--version.bin")
((featurep emulated-version) "--version.xpm" "--version.bin.bin.xpm"
"--version.bin.xam" "--version.bin.bin.bin.xam" "--version.bin.xam")
(t c)))
(when (equal val "foo") ;foo.el
(let ((val (format "%s:%s" (car c)))
(val) (cdr c))))))
(when val
(let ((val (if (stringp val)
(format "%s:%s\n" (car val) (cdr c))
(cdr val)))
val)
(when (and (string= val "")
(eq (car a) (car b)))
a)
(if (string= val a)
(let ((beg (car (cdr a))))
(concat val (make-string (car beg) 10000) b))
(if (string= val a)
(concat (make-string val (1- b)) (1- a) a))
a))))))))
(defvar version
("version2<version3><version4"
"a<b>b"
"2<3>b"
"4<4<5>.el>b"
"5<6>b.el">b.el </version2></version> </version3> ")
(defvar version
("version1<version2>"
"A<B>B.el"
"B<C>C.el">C.el </version2> </version3> ")
(defvar version2<version1>"
"A<B>B.el"
"B<C>C.el</version2> ")
(defvar version<version3>"
(let ((val (concat "A<B>B.el" (if (equal version2 'version3) 'version3) "B<C>C.
======== SAMPLE 3 ========
"List of functions available in `semantic-find-backend-in-tree'.")
(defvar semantic-find-backend-in-tree-functions nil)
(defvar semantic-find-backend--backend-in-tag-functions nil)
"List of functions available in `semantic-find-backend-in-backend'.")
;;;###autoload
(defun semantic-find-backend-in-tag-functions ()
(and semantic-tag-file
semantic-tag-mode
(or (and org-babel-backend-buffer-name (not (semantic-tag-of-class 'type 'tag))))
(not (semantic-tag-of-class))
(not (and org-babel-rerender-in-block (not (semantic-tag-of-class 'type 'block)))))
"List of functions available in the TAGFILE object.
This calls `semantic-tag-at-point', `semantic-find-backend-in-tag-function'
and `semantic-find-backend-in-tag-function' with
an asterisk; when called with a non-nil argument, use the old
class variable for that function in the BACKEND."
(cond
(org-babel-find-backend-functions
;; There may be an element of a nested tags file in the tagfile, but be
;; careful to preserve the tag's class. The file should be at the ends of
;; tags.el, not inside a compilation file.
(org-babel-tag-class
;; The tag's class. Each subclass of this tag contains one or more
;; subclasses of this (or the parent class).
(org-babel-tag-class
;; The tag's class, and their class is a tag. Each subclass of
;; this tag also contains all children of its children.
(org-babel-tag-class
;; The tag's class. All subclasses of this tag also contain children of
;; their children. These children are also members of this subclass of this
;; class. This class may or may not contain children of child.
(org-babel-tag-class
;; The class. These subclasses contain all children of all children of
;; this tag.
(let ((completion-ignore-case
'(("tags" . "all") (:type tag . "class"))
(when org-babel-tags-completion-ignore-case-is-empty
(org-babel-find-tag-function org-babel-tag-of-class)
completion-ignore-case)))
;; List of methods to call.
(function
(let ((methods (make-list 1 (car elt)))))
(mapcar
(lambda (class) (apply (car elt) methods))
;; Each class in this class has a type that should be a (CLASS . NODOC)
(list
;; The class does not currently have a class of NODOCs, but the
;; parent class that owns this tag will be the same as the parent class.
;; The class has to be found during a tag lookup.
"nil" (car elt))
;; If the class has NODOC, and the parent class that owns this
;; tag has a class that also owns this tag, it is still the same.
(and methods
======== SAMPLE 4 ========
(defun xmltok-decode-keyword (xmltok-prompt)
;; This function is an implementation of the same functionality
;; but for a special reason, so must be used everywhere - see
;; [XEmacs].
(setq xmltok-prompt-prompt prompt)
(when (fboundp 'xmltok-revert-prompt) (error "xmltok: Redisplaying invalid xmltok-prompt"))
(let* ((promptx (if xmltok-revert-prompt "\\(key-value\\)\\'" "\\)\\'"))
(prompts (if (xmltok-is-symbol) "keyword")
(if xmltok-prompt "\\("
;; Make a user-defined xmltok-prompt string to
;; match keymap and user defined keymap.
(cond
((stringp xmltok-prompt)
(xmltok-make-prompt "key-" (point) t))
((stringp xmltok-prompts)
(xmltok-make-prompt "\\("
(xmltok-prompt "\\)\\'" "(key-value\\)"))
(xmltok-make-prompt "\\("
(xmltok-prompt "\\)\\'" "(key-value\\)"))
(xmltok-make-prompt "\\(" (xmltok-prompt "\\'") "\\"
(xmltok-prompt "\\)\\'")))
(xmltok-make-prompt "\\" (xmltok-prompt "\\'") t)))
(saved (xmltok-prompts-keymap xmltok-prompts-prompts)
((stringp xmltok-prompts) (xmltok-make-prompt "\\(key-value\\)\\'" (0 0 0)))))
(setq saved (xmltok-make-prompts-keymap saved t)))
(if xmltok-prompts-keymap
(funcall xmltok-prompts-keymap)
(let* ((promptx (get xmltok-prompts-prompts-object-function 'string-p)))
(prompts (xmltok-prompts-keymap (get xmltok-prompts-keymap 'xmltok-prompts) t))
"%file: samples-18300"
======== SAMPLE 1 ========
shadow=x-height '(0)))))))
(mapc (lambda (elt)
;; FIXME: This function is not autoloadable.
(let (height)
(narrow-to-region (elt elt) 0 width height)))
(dotimes (i (length height))
(if (not (equal width i))
height
(progn
(switch-to-buffer buf)
(kill-all-records)
(insert (format " height (%d) x: height (%s)" (nthcdr (1- height) height) width)
(nth 0 height)
(if (and (< width n) (< height n))
;; A-to-C++: if the height in the
;; region is smaller than the width,
;; we want to add the height to the end, if at
;; the specified end.
;; we are at a non-intrinsic region between
;; the specified end.
(mapcar (lambda (x) (string-to-number x))
(length (nth 1 x)))
(if (= (length (file-name-extension filename))
0)
(cadr (split-string (nth 1 x)))))
" "))))))
(if (or (not (equal width i))
(equal height i))
height)))
(lambda (elt)
(let* ((height (cond ((
======== SAMPLE 2 ========
shadow 'nocase)
(if (member (list nil) ; Maybe NIEUR search
(if (string-match "-c" ?c) ; NIEUR search
'(nil nil))
(list 'string-match "-c" ?c))) ; search
(while (member (list nil) ; Maybe NIEUR
(if (string-match "-c" ?c) ; NIEUR search
(string-match "-n" ?n) ; NIEUR search
nil))
(list 'if (string-match -c '(nil . n)) ?c)))
(setq l nil)
(set (make-local-variable 'noconfirm-search)
;; It's ok to try, but it's not
;; sufficient to perform any `N-UP' on the region.
(while (> l 0)
(if (listp (car l))
(push (car l) l)
(nconc l (cdr l)))))))))
(push (cons (nreverse search) l)
(push (cons l l) l))))
(delete-region
(setq l nil)
(if (and l
(listp l))
(or (and (not l)
(string-match "^\\(^.\\) "
?$
(nth 1 l)
(nth 2 l)))
(string-match "\\`" l))))
(_ 0)))
(if dl
;; There are three possible searches in this case.
(if l (funcall (list (car search) l)))
l))))
(defun f90-coding-string-from-end (
======== SAMPLE 3 ========
shadow-2d-fontify"
'org-fontify-3d-color)
(and
(or
(or (eq org-fontify-3d-fontify 'no-fontification)
(eq org-fontify-3d-fontify 'no-fontification)))
;; We cannot determine if a color or face must be
;; included in a line when the style of the entire
;; file is
;; consistent with the above definition. It's in that
;; case: \"navy grey\" (in "text/bold\\text+#x11C")
(and
;; If the "text/italic" style is used, we need to
;; provide appropriate fontification for the actual text.
(and
org-fontify-fontify 'navy
(or (and (equal "line: gray00" (org-string-nw-string
(org-parse-line)))
t))))
(or (equal "line: darkgrey" (org-string-nw-string
(org-parse-line)))
(or (equal "line: darkgray" (org-string-nw-string
(org-parse-line)))
t))))))
((equal "line: lightgrey" (org-string-nw-string t 'no-fontification))
(and
(or
(or (not (equal "line: darkgrey" (org-string-nw-string
org-parse-line
======== SAMPLE 4 ========
shadow-backward 1)
((c-mode-variable nil)
(save-excursion
;; Make sure we are in the same buffer.
(goto-char c-point)
(setq c-mark-point (point))
(goto-char c-mark-marker))
(if (c-get-buffer-window texinfo-buffer)
(save-window-excursion
(save-excursion
(goto-char (window-point texinfo-window))
(set-window-point
texinfo-window
(window-frame texinfo-window))
(* (c-get-buffer-windows texinfo-window) (point-marker))
texinfo-mark))
;; Now the cursor is within a texinfo buffer and set the
;; window-point value point-marker at
;; point-marker.
(cond
(start-nbsp)
(set-window-point texinfo-buffer)
(set-marker
texinfo-marker (point-marker) (point-marker))
(set-marker
texinfo-window (window-frame texinfo-window) point-marker nil)))
;; This is an error if we are in a texinfo buffer but it
;; is not an error in c-mode, so we quit here.
(save-excursion
(save-window-excursion
(message "C-moto-point: Point is not a texinfo buffer. Try to move to the
boundary.
You may also press C-moto-point interactively. Do not enter the
frame,
as long as the text is in texinfo buffer.")
(set-window-point texinfo-window texinfo-marker nil))
;; FIXME: When this is used in c++ comments it does in c
;; comments as well, and this is not always correctly
;; done. See bug#1192.
(when (and (memq (current-buffer)
(>=
"%file: samples-18200"
======== SAMPLE 1 ========
frame-file-name :modes '(:inline :tag "LightEmacs" "\\w+")
:files '(:inline :tag "Files" "\\w+")))
(defun org-ctags-find-bbox-file (&optional file)
"Find the current inline file in the buffer.
This command will search if file in the file list in file FILE is
directory of the current inline file, not nil."
(interactive)
(find-file-other-window :type 'file)
(let ((buffer (find-file-other-window
(if file
(re-search-backward
(concat "^$" file) t)
buffer
dir) nil 'ignore))
(found nil))
(find-file-other-window :visibility t :visible (or buffer (not found t))))
(if (and (eq file org-ctags-bbox-file)
(or (get-file org-ctags-bbox-file)
(get-buffer-visited-p file)) (error org-ctags-bbox-file))))
;; Set `org-ctags-bbox-file-file'."
"The file of the inline block file."
:type '(radio (if file "file" "file"))
:group 'latex)
(defcustom org-ctags-bbox-buffer-name '*-*** org-ctags-bbox-buffer-name
"Name of buffer to use when listing inline blocks."
:type 'string
:group 'latex)
(defcustom org-ctags-bbox-file-file
'*-*** org-ctags-bbox-file
"Name of file to use when listing inline blocks."
:type name
:group 'latex)
(defcustom org-ctags-bbox-buffer-string-name '.*-** org-ctags-bbox-buffer-string-name
"String used to specify the buffer string name when listing block files."
:type string
:group 'latex)
(defcustom org-ctags-bbox-buffer-file-conversion-flag
'*-*** org-ctags-bbox-buffer-file-conversion-flag
"Which value to use when listing block buffers when converting to buffer."
:type 'boolean
:group 'latex)
(defcustom org-ctags-bbox-buffer-conversion-flag
nil '*-*** org-ctags-bbox-buffer-conversion-flag
"Which value to use when listing buffer files when converting to buffer."
:type 'boolean
:group 'latex)
(defcustom org-ctags-bbox-buffer-convert-flag
'*-*** org-ctags-bbox-buffer-conversion-flag
"Which value to use when converting the buffer file to buffer."
:type 'boolean
:group 'latex)
(defcustom org-ctags-bbox-buffer-convert-flag
'*-*** org-ctags-bbox-buffer-convert-flag
"Which value to use when converting the buffer file buffer to buffer."
:type 'boolean
:group 'latex)
(defcustom org-ctags-beyond-block nil
"The maximum number of characters a block can contain when converting to buffer."
:type 'integer
:group 'latex)
(def
======== SAMPLE 2 ========
frame)
(insert "\\end{props}"))
(if (semantic-tagp tag)
(insert (format "\\end{props}"))
(semantic-tag-insert-field 1 tag)
(if (semantic-tagp tag)
tag
(replace-regexp-in-string "\n" ""))))
;;;
;;; Tag management and handling functions.
(defun describe-tag-customize (tag &optional custom-ignore-errors)
"Display customization information in TAG.
TAG is the type or value of the custom tag of the current tag."
(interactive "P")
(let ((tag-name (semantic-tag-name tag))
(tag-customization-list (semantic-tag-customize-by-default-name tag 'custom-custom)
(semantic-tag-customize-by-default-name 'tag custom-custom))))
(semantic-customize-do-customizations (list tag custom-ignore-errors) t)))
;;;
;;; Tags management functions.
(require 'semantic/tag)
;;; Tags for semantic tags.
(defun semanticdb-tag-describe-tags (tag &optional comment)
"Describe TAG in SPECS and return that tag.
TAG is a tag class for the semantic tags. It has information
about the type of tags and their tags. If comment is non-nil, the
description is displayed in a file TAGs\ (semanticdb). If optional
arg 'tags-describe-tags is non-nil, the entry is displayed in
a special tag that has information about the tags and/or
tags-specific tags."
(cond
((string-match "\\<tags\\>" tag)
(let ((case-fold-search t))
(if-not
(setq tags-describe-tags tags-describe-tags)
(if comment
(progn
;; Display TAG's description
(when (or (semantic-tagp comment)
(semantic-tag-get-tag comment)))
;; Check if TAG has a description
(calcFunc-get-value (semantic-tag-value tag))
(message "TAG description %d" (symbol-value tag)))
;; Display TAG's documentation
(calcFunc-get-doc (semantic-tags-name tag))
(message "TAG documentation %d" (semantic-tags-name tag)))
(if comment
(progn
;; Display TAG's description in comment and tag-category
(message "Tag description %d" (symbol-value tag)))
;; Look up the tags
(calcFunc-get-tag tag-category)
(message "Tag description %d" (symbol-value tag)))
;; Check if tag has a description
(message "TAG description %s" (symbol-value tag)))
;; Check if tag's
======== SAMPLE 3 ========
frame)))))
(when (and (symbolp mode)
(equal mode "emacs"))))
(if init
(if (or (eq (car minor-mode-specific-flag) t)
;; Emacs minor mode only
(if mode 'global
(vector '(((major-mode . "el-3") (local-mode . "el-7")
((local-mode . "emacs") (default-graphic . "b3"))
((local-mode . "emacs")))
(cons 'mode mode)))))
modes)
;; This does not take into account the minor mode being
(setq minor-mode-for-emacs (or mode minor-mode-for-emacs))))
(let ((inhibit-read-only t))
(with-rcs-session
;; We have a session-main-frame and the key bindings on a
;; RCS buffer. If we have a key on the keymap
(rcs-update-buffer-and-display-keymap window)
(if (not in-client)
;; RCS buffer is not showing.
(setq mode-line-process (get-buffer-process buffer))
(apply 'rcs-switch-to-buffer-in-mode-line-process frame)))
;; This does not remove the usual bindings that are handled
;; by minor-mode-mode-hook.
(rcs-update-buffer-and-display-default-hook
frame modes t '(mode-line-name mode-line-name
mode-line-name
mode-line-name
mode-line-name
nil
nil))
,@(if modes (list 'mode major-mode-for-emacs nil))
(push (cons mode modes) buffers)
;; This is called by `rcs-setup-buffer-hook', which
;; creates all the hooks for those major modes.
;; `rcs-setup-buffer-hook' is called for modes with no
;; major-mode.
(setq modes (cdr modes)))))
,@(when modes (list 'mode minor-mode-for-emacs
======== SAMPLE 4 ========
frame")) is nil.
(defcustom x-last-window-width 11
"Default that the width of the window displayed in the first window.
See `x-last-window-width' (the default). See also `x-last-window-height'."
:group 'lazy-compose #x-last-window-width
:type 'integer)
(defcustom x-last-window-size 7
"X-last-window-size of the window displayed in the window."
:group 'lazy-compose
:type '(choice (integer :tag "Width")
integer)
:type 'integer)
(defcustom x-last-window-size-1 nil
"Default value for `x-last-window-size'.
When X is a large window, this defaults to the minimum possible frame.
When X is a small window, it defaults to the maximum possible frame
that is capable of displaying the frame displayed in the window.
When X is a fixed number, the default width for X will be the window width.
When X is a floating point number, it defaults to the maximum length.
When X is a number between 0 and 1, or multiple, it defaults to the
maximum size."
:group 'lazy-compose
:type '(choice (integer :tag "Default Frame")
(const :tag "Default frame" nil)
(number :tag "Frame (or maximum length)")))
(defcustom x-last-window-height 2
"Value to specify if the window displayed by the first `x-last-window-row'
is a fixed width or not. The default is used.
The value may be nil for the fixed width and the value may be any other
value (see `x-last-window-height'). See also `x-last-window-height' (the default)."
:group 'lazy-compose
:type '(choice (integer :tag "Fixed-Width" nil)
(const :tag "Fixed-Width" nil)
(integer :tag "Fixed" nil)
(const :tag "Fixed width" nil)
"float")))
;;; Other frames
;; - windows
(defcustom x-last-window-window-height 1
"Value to specify if the window displayed by the first `x-last-window-window'
frame is a fixed height."
:group 'lazy-compose
:type '(choice (const :tag "Fixed-Height" nil)
(integer :tag "Fixed-Width" "float")
(const :tag "Fixed width" "float")
(const :tag "Fixed width" "float")
"fixed")))
(defcustom x-last-window-window-size 16
"Value to specify if the window displayed by the first `x-last-window-window'
frame is a fixed size."
:group 'lazy-compose
:type '(choice (const :tag "Fixed-Size" size)
(const :tag "Fixed size" "float")
(const :tag "Fixed size" "float")
"float")))
(defcustom x-last-window-frame 8
"Value to specify if the frame displayed by the first `x-last-window-frame'
frame has `x-last-frame-window-height' or `x-last-frame-window-height'."
:group 'lazy-compose
:type '(choice (const :tag
"%file: samples-18100"
======== SAMPLE 1 ========
(error "No such buffer"))
(buffer-string)) ; no buffer
(setq buffer-undo-list (nreverse buffer-undo-list))
(setq buffer-undo-list (delq buffer-undo-list buffer-undo-list)))
(defun org-org-mode-line ()
"Line buffer, adjusting `org-show-undo-buffer-list'."
(interactive)
(goto-char (point-min))
(let ((text (org-export-get-text-property (current-column) 'current-line))))
(unless (looking-at org-show-undo-buffer-list)
(let ((line (+ (current-column) 1)
(point))))
(or (looking-at org-show-undo-buffer-list)
(user-error "Not in a buffer"))
(if (looking-at org-show-undo-buffer-list)
(user-error "Missing output line"))
(org-show-undo-buffer-list)))))
(defun org-mode-line-1 ()
"Set up an external undo list."
(interactive)
(org-edit-buffer (org-export-get-buffer-undo) 'org-show-undo-buffer-list))
(defvar org-hide-undo-list-invisible t)
(defvar org-hide-undo-list-invisible-buffer nil
"If non-nil, show the undo list in a buffer visible to the user.")
(defun org-hide-undo-buffer (buffer status)
"Hide buffer at point after undoing. Wants a buffer to appear before
undo status, with the buffer selected.
This command can be used on other buffer types. See `org-toggle-undo-list-for-buffer'."
(org-mode-line-1 buffer "Show"
'org-hide)))
(defun org-hide-undo-buffer (buffer contents)
"Hide the undoing portion of BEG END, and show BUFFER.
The buffer shown in BEG END may be hidden if BUFFER is nil."
(org-hide-undo-buffer buffer)
(condition-case ()
(save-excursion
(save-selected-window
(cond ((null buffer) (point))
;; This causes the text to appear hidden
(if (eq org-mode-line-mode t)
;; (goto-char (car contents))))
(t
(replace-match " "))))))
(goto-char beginning-point)
(if (save-excursion
(org-toggle-beginning-of-buffer-undo))
(let ((end (funcall (if (eq org-edit-mode 'org-edit)
'end 'visible))
(count (- count (org-edit-current-item)))
(last-start (point))
(pos (+ (region-beginning) (region-end))))
(if (save-excursion (goto-char (save-excursion (org-end-of-item)
'end '
======== SAMPLE 2 ========
(list
;; The current buffer (in all buffers), which is
;; what we are doing.
(buffer-name)))
(save-current-buffer
(if org-agenda-show-tags-buffer
(with-current-buffer org-agenda-show-tags-buffer
(org-with-buffers (marker-buffer (mark t)) org-agenda-show-tags-buffer)))
(with-current-buffer (marker-buffer (mark t))
(mapc
(lambda (buffer)
(when (and (bufferp buffer)
(eq (marker-buffer buffer) org-agenda-show-tags-buffer)))
(org-with-drawers buffer))))))
(org-agenda-remove-subtags))))))
(defun org-agenda-do-refresh ()
"Determines when a refile will be requested.
With prefix N, refile will be requested when N days earlier
was the maximum number of references to file that the file had with
that group, unless `org-agenda-refile-files-max' was nil, otherwise
refile will be requested when N days earlier is the maximum number of images in the
filament that this file had with that group."
(org-with-wide-buffer
(let ((inhibit-read-only t))
(and (symbolp org-agenda-refile-file)
(not (org-in-tags-inhibit-filament-p))
(or (bufferp org-agenda-refile-file)
(or org-agenda-refile-file
(progn
(when (and
(progn
(with-no-warnings
(goto-char (org-element-at-point))))
(reparse-failed))))))))
(org-agenda-request-refile org-agenda-refile-files-max
(if (and org-agenda-refile-filament
org-agenda-refile-files-max)
nil
======== SAMPLE 3 ========
;; For any other error and errors, the user of
;; XEmacs knows the answer, and it takes no time to fix it.
(define-minor-mode xemacs-xemacs-check-function-inter-minor-mode
"Return non-nil if the check function has already been run.
This is usually a function that is called with one parameter
`error-check-function'."
(mapc (lambda (fname) (if test "")) test-function-inter-minor-mode))
(define-minor-mode xemacs-xemacs-check-function-local-minor-mode
"Return non-nil if the check function is locally run.
This is usually a function that is called with one parameter
`error-check-function'."
`(when (eq major-mode 'xemacs-x-mode) 0 (error error-check-function-local-minor-mode))
`(when (eq minor-mode 'xemacs-x-mode) (error error-check-function-local-minor-mode)))))
(define-minor-mode xemacs-xemacs-check-mode
"Check for errors and failures.
For XEmacs and MS-Windows systems, this only considers
windows which are capable of handling such errors."
(setq xemacs-xemacs-check
" -- check "
(cons (make-local-variable 'error-check-function)
(if (xemacs-check-function-local-minor-mode)
(call-minor-mode (xemacs-x-minor-mode))
(call-minor-mode xemacs-x-minor-mode))
xemacs-x-minor-mode)
`((xemacs-error-mark-marker-mode nil ,error-check-function-local-minor-mode nil)
(error-check-function-local-minor-mode . t)
(error-check-function-local-minor-mode . t)))
(set-marker (marker-position xemacs-error-marker) (point))))
(provide 'xemacs-check)
;;; xemacs-check.el ends here
<|endoftext|>;;; yaml.el --- yaml.el --- YAML files
;; Copyright (C) 1992, 1994-1995, 2001-2019 Free Software Foundation,
;; Inc.
;; Maintainer: emacs-devel@gnu.org
;; Keywords: hypermedia, hypermedia, hyper-media
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; This library provides a file-based yaml viewer, and some other
;; features. Its purpose as such is to allow use of yaml files in
;; Emacs, with minimal overhead. Its goal is to provide a
;; simple UI for viewing yaml files; this also allows you to customize
;; the visualizations of yaml files; it also allows you to create
;; customizations for how yaml files interact with Emacs.
;;
;; Author: Eric J. Ludlam <edward@gnu.org>
;; Version: 0.1.
;;; Code:
(require 'semantic/xemacs)
======== SAMPLE 4 ========
(and (string-equal (car type) type) (cdr type) (cdr type))))))))
(defun darwin-make-default-file (filename file)
"Make the default file filename for the current DARWIN binary.
FILE is a plist holding all the major, minor and/or sub-directories in
FILE. Use of an absolute file name is discouraged.
If FUNC is non-nil, this function creates a directory name based
on its primary file name. Otherwise use FUNC."
(let (orig-dir-map dir-cont)
(setq dir-map (make-sparse-keymap
(delete nil (darwin-default-entry-list d) ""))
default-directory dir-cont)
(and type (or (null (symbolp (car dir-map)))) "is"
nil (or (intern "file-exists-p") "is"))
(let ((type (format (darwin-make-dir-relative filename))
(file (darwin-make-default-file file)))
(files (darwin-make-default-files file))
(type (or (null (intern type))
(intern (format "dired:%s"
(if (string-equal (nth 1 type) type)
file)
(intern (format "dired:%s"
type)))))
file))))
(defun darwin-file-type (filename)
"Return value of TYPE for FILE."
(cond
((or (file-directory-p filename)
(file-directory-p darwin-default-dir))
(file-directory-p darwin-default-dir))
((or (and (file-directory-p darwin-default-dir)
(file-readable-p darwin-default-dir))
(file-readable-p darwin-default-file))
;; Set default directory (default-directory for DARWIN-BUFFER).
(file-name-directory file))
((and file-directory-p (file-directory-p file))
(file-relative-name file))
(t
(or (file-exists-p file)
(file-writable-p file)))
((file-extension file)
;; Add directory and file name.
(file-name-as-directory file))
((files (darwin-files))
(file-rename-coding-system directory t file))
;; Set default type.
(file-file-name-directory file))
(t
(let ((default-file (intern dir)))
(and default-file
(file-exists-p default-file))
default-file)))
(defun darwin-default-entry-list (entry)
"Make entry list, the files which follow the current darwin
"%file: samples-18000"
======== SAMPLE 1 ========
ul (regexp))
(if (re-search-forward regexp nil t)
(goto-char (match-beginning 1))
(end-of-line)
(forward-word-strictly 1)))
(setq ctxt (match-beginning 1)))
(setq ctxt (point))))))
(defun org-odt-show-cpt (axt)
"Show CPT using axt. This function can be used by `org-odt-show-cpt'
for editing of CPT fields."
(interactive "P")
(with-output-to-temp-buffer "*Org Edt*"
(let (data)
(org-with-wide-buffer
(let ((o (org-table-buffer-table)))
(with-output-to-temp-buffer "*Ot*"
(org-odt-show-cpt
(org-table-format 'org-odt-show
:label o (cpt axt)
:format 'raw-text
:file-coding-system 'w64-w32c)
:line-end nil
:buffer 'raw-text
:position (cdr axt) (cdr o) (cdr o)))))
(let ((c (car axt)))
(org-with-wide-buffer
(and org-odt-get-table (not org-outfile-string-cache))
(let ((o (org-table-format-from-raw
:label org-odt-get-columns nil
:abbrev-list (match-data))
:in-file axt
:line-start t
:file-coding-system 'w32c))
(org-odt-show-cpt
(org-table-format 'org-odt-show
:label o (cpt axt)
:format 'raw-text
:file-coding-system 'w32c)
:line-start nil
:abbrev-list (match-data))
(org-odt-show-cpt
(org-table-format 'org-odt-show
:label o (cpt axt)
:format 'raw-text
:file-coding-system 'w32c)
:line-end nil
:abbrev-list (match-data)))))
(org-with-wide-buffer
(org-table-format 'org-odt-show
:label o (cdr axt)
:format 'raw-text
======== SAMPLE 2 ========
ul-font-lock-keywords-face '(font-lock-keyword-face)))
(if font-lock-keyword-face
;; Keyword highlighting should occur in Emacs
(setq font-lock-keywords-face (char-to-string (match-beginning 16))
(char-to-string (match-end 16)))
(if font-lock-keyword-face
(setq font-lock-keywords-face (+ font-lock-keywords-face (1+ font-lock-keywords-face)))
(if font-lock-keyword-face
(setq font-lock-keywords-face
(1+ font-lock-keywords-face)))))))
(defun set-default-face-functions (min-major-mode)
"Set default functions, and make them read-only if they appear in an
interactive mode. If a function-specific function is called
(or is a function), it is called with three arguments, the
argument LIST containing a list of variables and the parameter TYPE, the
name of the function or the name of its argument
for that function. If TYPE is a list, the function is called
with the argument `t' or TYPE a single argument."
(let ((s (lambda (&rest nil nil) (list-functions min-major-mode nil nil nil nil)))
(t nil) (fun nil) nil)
(cond ((< (length (char-after)) ?f)
(if (char-after ?\[)
(progn
;; `fun' is an integer: if
;; a positive integer is entered, nil is assumed to be a
;; function.
(setq s (char-after ?\))
(setcdr s (if t 0 1)
nil)))
((< (length s) ?\[)
(if (+ (length (char-after s)) ?\])
(progn
(setq s (char-after s))
nil
;; `fun' is a list with one argument, TYPE, and the
;; parameter TYPE.
(setq s (or (char-after s) ?\)))
nil)))
((> (length s) ?\))
(if (or (> (length s) (char-after s)) 1)
(setq s s) nil)))))
;;; Miscellaneous stuff.
;;;###autoload
(defun tex-mode (&optional ignore-mode)
"Set `tex-mode' state.
This runs `font-lock-set-mode' only if `tex-indent-region' is
======== SAMPLE 3 ========
ul-compute-key-id (key)))
(setq key (org-babel-assoc-key
`(:name c-sym),
(match-string 1)))
(funcall key)))
(if (not (eq org-babel-check-default-type 'check)
(ignore-errors (gnus-completing-read
"Can't check for: " nil org-babel-check-default-type))))
(let* ((alist alist)
(check-function (gnus-completing-read
"Check function " nil org-babel-check-default-type))))
(if check-function
(mapcar #'gnus-babel-check-default-type check-function)
(gnus-babel-warn-warn
`(:name c-sym (gnus-completing-read
"$(" nil ,org-babel-check-default-type))))
(org-babel-make-default check-function t)))
(or key
(gnus-babel-warning
`(:name (gnus-completing-read
check-function (gnus-completing-read
nil nil
(gnus-completing-read
"Check function " nil
nil nil
list
function)))))
(when check-default-type
(let ((alist (cons `(:name c-sym, ,default-type) nil))
(key (symbol-function key))
(default (make-list nil nil
(funcall key ,alist
(format
(gnus-completing-read
======== SAMPLE 4 ========
ul-goto-end nil)
(let ((m (funcall fmap 'funcall)))))
((cdr (memq (cdr cdr) m))
(cond ((and m (or (null m) (cdr (assoc m (cdr m))))
(cdr (assoc x (cdr m))))
;; We have to check if M is a symbol. We might
;; need to call `goto-end' to get a new beginning or
;; end.
(goto-end (cadr cdr)))))
((x . x)
(if (eq (cdr (assoc x (cdr x))))
(setq x (assoc x x))))
((cldr (assoc (intern x) 'csh-decl-re))
(let ((res (cl-case x
(x (intern (intern (subintern (xim "xim")) "x"))
(car x 'xemacs)))
;; Return the value of x if `res' is non-nil in some other
;; XEmacs case. In this condition, XEmacs
;; uses an explicit xim: a symbol (not `x')
;; must have a symbol (not `x').
(cons x res))))
(let ((res (cl-case x
(ximap `("emacs" "ximap" "emacd")
"foo" "bar" "csh"))
(x (intern (intern (xim "xim")))))))
(if res (goto-char (char-after))))))
(defmacro fmap (&rest map)
(declare (debug nil) (indent 1))
`(map ,(progn (fmap) (goto-char (if (fboundp 'eval-after-load-function) (fboundp))
(fboundp ,mode ) ,mode))
(let ((x (intern (get-char-property (1- (length x))) 'x)))
(when (and (get-char-property (car (car x)) 'font-lock-variable-name)
(get-char-property (1- (length x)) 'font-lock-default-font-lock-default-face)
(get-char-property x 'font-lock-variable-name))
(when (setq x (cadr x))
(error "Cannot find `face' in `(fmap)' mode: %s" x))
(if (and (not (fboundp 'eval-after-load-function))
(fboundp (get-char-property x 'font-lock-variable-name))
(get-char-property (car (car x)) 'font-lock-default-font-lock-default-face)))
(error "Cannot find `face' in `(fmap)' mode: %s" x))))
(defmacro gadd-decl-re () ;; Remove the old function from the symbol `guntab-babel-decl-re'
;; because we are not going to make any changes in `look-at-decl-pos
"%file: samples-17900"
======== SAMPLE 1 ========
€† "찀느이끈이뀜 봁랤 봁, 밄냁 사밀 봁, 엓운만 봁"
"밀텁 봁랤")
(defface red)
(enchant-defface 'red)
(enchant-defface 'red))
(defface red1)
(make-invisible 'red)
(goto-char red)
(let ((red1 (substring red1 1))))
(unless (bolp)
(beginning-of-line)
(if (= (point) (point-max))
(insert " "))
(beginning-of-line 1))
(unless (bolp)
;; There is a comment; replace it for this.
(setq red (if (match-beginning 1)
(match-string 1))
(insert " ")
"")
;; There's no comment yet.
(if (setq red (match-string 1))
(insert red)
(let* ((beg1 red-re 'indent)
(end1 (point-max))
(begin1 (car red-re)))
(nconc red-re (/ red-beg beg) (cons end1 (point)))
(forward-line 1)
nil)
retval (c-next-error 1)))
;; A previous error is an indication that we found the first error.
;; (let ((red-reg (nth 1 red-re))
(re (nth 2 red-re)))
(cond
((looking-at re)
;; Don't go off the "first error" line. The error
;; below could not occur because the code above did not
;; define (but it appears elsewhere), so we don't check the
;; code above ourselves.
(setq retval red))
((looking-at re)
;; Don't try to find any errors. We have to use a
;; special case here, so the code below will never use a
;; special case.
(error
;; We didn't find the first error; skip it.
(while (and red (c-forward-line 1))
(setq retval red)
(setcdr (car red-reg) (cdr red-reg))
(if red (setcdr red (cdr red-reg)))))))
;; We found the first error and a repeat.
(t
(while retval
======== SAMPLE 2 ========
"๪คมอา"
"๪คยอาว"
"๪คยอาว"
"๪คยà¸^าอ"
"๪คอน"
"๪คอยน"
"๪คภิน"
"๪คภิล"
"๪คภาว"
"๪ค฻น"
"๪คุ"
"๪คุกัก"
"๪คุก่ยะ"
"๪คุก์ม"
"๪คุ่"
"๪คุ้ิ"
"๪คุ้"
"๪คุ๊"
"๪คุ๊กาสกร"
"๪คุ๊งพาส"
"๪คู"
"๪คูกิร"
"๪ครง"
"๪ครงร"
"๪ครด"
"๪ครดี"
"๪ครน"
"๪ครยิร"
"๪คยว"
"à�
======== SAMPLE 3 ========
(concat "\\|\\(\\+\\)\\>" nil)
(insert " " word-before-column)))))
))
(deffoo erc-mode-change-point ()
(when (looking-at erc-current-function)
(ignore-errors (forward-line (1- (point))) (point)))
(let ((inhibit-read-only t))
(when (and erc-prompt-regexp
(setq erc-prompt-regexp "\\|\\$")
(not (eobp)))
(not (eolp)))
(let ((buffer-read-only t))
(save-restriction
;; Ignore the "*" prefix.
(when (eq (char-after) ?\n)
(setq text (read-from-string erc-prompt-regexp " * "))
(while (not (eobp))
(or (eolp)
(not (eobp)))
(not (eolp))))
(while (not (or (eq (char-after) ?\{)) (not (point-max)))))
;; Don't skip this line (note that it is a line. )
(if (not erc-prompt-regexp)
(delete-char -1)
(set-text-properties 0 (point) (point-max)))))))
;;; Completion:
(defvar erc--completion-alist nil
"List of regular expressions to complete current document.
Each element in this list is a keyword or the token character
with which it is matched. By default, the `*' to the string
at point is treated as '*', and the token is not considered to do anything.
To be used as the completion engine `**'.")
(put 'erc-completion-alist
(funcall (list "*" ,token) "*" elt))
(put 'erc-completion-alist 'safe-local-variable 'integerp)
;;;###autoload
(defun erc-complete-keyword (keyword)
"Completion keyword for KEYWORD's KEYWORD element."
(insert "^\t")
(let ((len (length erc--completion-alist)))
(insert "^\t")
(let (in (length erc--completion-alist))
(insert "|" (if (member keyword '(" "")))
(insert ")" ?/))
(insert ")\n")
(let ((len (length erc--completion-alist)))
(insert "")
(let (in (length erc--completion-alist)))
(insert ")[ \n\t\r]" elt))
(insert "'")
(let (in (length erc--completion-alist))
(insert "\n"))
(insert "@")
(insert "@")
(insert "@")
(insert "@")
(insert "@")
(insert "@")
(insert "@")
(insert "@") (gethash keyword '((?|) "[^]+")))))
(deffoo erc-get-context ()
'erc--completion-context
"Get the context for context."
(format " %S %S
======== SAMPLE 4 ========
("X" . "BH") ["M" . "EH\^-nF"]
("X" . "F"]) ["N" . "D"]]
;; FIXME: it's not clear what kind of names of files can be
;; changed through the various tools.
("A" . "H") ["A.H.S.S" org-backend:org-backend]
("B" . "H") ["H.H.S.S" org-backend:org-backend]
("D" . "$") [",@(,%s@\\$(") (?@) (?@) (?@)
("S" . "F") ["F.S.S.S" org-backend:org-backend]
["E" . "M"] [",E.S.S.S" org-backend:org-backend]
["U" . "R"] [",U.S.S.S" org-backend:org-backend]
. ("C" . "C") ["C.C.S.S" org-backend:org-backend]
"~" . "C"]]
("C" . "C") ["C.C.S.S" org-backend:org-backend]
"~x" . "C"]) ["[" . "x]\", ["" . "y]\".\"]
"A" . "X") ["G." . "G.H"]) ["H.H.S.S." org-backend:org-backend]]
;;; Code:
(add-hook 'org-backend--after-change-functions #'org-backend--after-change-function)
(defun org-backend--after-change-function (&optional buffer-file-handles)
"If called outside a backend, run a backend without a default setting."
(unless org-mode-line-process-p
(let ((backend (org-backend-to-backend buffer-file-handles))))
(unless (string= org-mode-line-process-p backend)
(setq backend
(org-backend-to-backend
(completing-read
"Function to be called to run a backend for a file.
See `org-backend-functions'."
nil t t (completing-read
"Function to be called to call the backend.
See `org-backend-functions'." nil t))))))
;;; Hooks
(defun org-backend-functions (_)
"Run a BACKEND in the context of the current buffer, as in the normal
backends."
(cond ((stringp org-backend) (string-match "[\][\][\/\]]" backend))
((file-exists-p org-backend) (file-exists-p org-backend))
((file-exists-p org-backend) (file-exists-p org-backend))
(t (find-file-noselect org-backend))))
(defun org-backend--in-backend (backend _name _args)
"Insert a backend under the current buffer. Return it.
Assumes the default back-end is the one defined in the back
function that is called to evaluate the back-function of
the back-end."
(unless org-backend-functions
(set (make-local-variable 'org-backend) org-backend))
(goto-char (point-min))
(unless (
"%file: samples-17800"
======== SAMPLE 1 ========
(cl-case (car-safe (cadr (nth 2 expr)) (nth 1 expr)))
'(1 2))
"" "" ; case 1
(dolist (s (cdr s)
(car-safe (cdr s)))
(push (eval (format "*Class-Type: %s (%s): "
(mapcar (lambda (x y)
(and (memq x y)
(memq (car x) '(class class))
(not (or (symbolp (car x))))
(memq (car x)
(if (eq 2 'class) (symbolp 2)
(or class class))))))
(or (cadr x)
(if (memq 2 'class)
(or class class)
(and (eq 2 'class) (symbolp 2)
(not (eq 2 'class)))
======== SAMPLE 2 ========
(concat
(+ gnus-news-header-regexp
org-group-regexp
(/ (gnus-group-name) gnus-news-header-regexp)
(car gnus-news-header-regexp)))))
(defun org-tokens-incomplete (group)
(let ((start (point))
pos)
(when beginning
(setq start (point))
(marker-insert (if org-tag-start
org-tag-stop-start
org-tag-end-start))
(marker-insert-and-marker start (buffer-substring-no-properties start (marker-position start)))
(when (string-match "\\`[ \t]*\\'" start pos)
(let ((re (replace-match "^\\(\\(\\s-\\|\\)\\|\\) \\|" start pos))
(re (replace-match "^\\(\\(\\s-\\|\\)\\)\\|\\|\\)\\'" start pos)))))))
(defun org-tokens-regexp ()
(concat
;; Use a space after the group name to highlight the group we want
(concat
(if (string-match "\\`\\([^ \t=][ \t=.]+[ \t=.]+\\'" group)
(concat (substring group (match-beginning 1) (match-end 1))
(substring group (match-beginning 1) (match-end 1))))
(if (string-match "\\`\\([^ \t=][ \t=.]+[ \t=.]+\\'" group)
(substring group (match-beginning 1) (match-end 1)))))
'("org-group" . "^\\(\\(\\s-\\|\\)\\`\\|\\)")))
(defun org-article-article-regexp ()
(concat
;; Make the group name bold.
(if (string-match "^[^ \t=.]+\\'" group)
(concat (substring group (match-beginning 3) 3))
org-article-regexp)
(concat
;; Use a space after the article name.
(if (string-match "\\`\\([^ \t=.,.]+\\'" group)
(substring group (match-beginning 4) (match-end 4)))))
(defun org-article-reline (str)
(if (string-match "\\`re \\([^ \t=.]+\\'" str)
(concat (substring str (match-beginning 5) 7))
(substring str (match-end 5) (match-end 5))))
'("org-article"))
(defun org-article-re-regexp ()
(concat (substring str (match-beginning 6) (match-end 6)))
nil
(save-excursion
(beginning-of-line)
(when (string-match "^ \
======== SAMPLE 3 ========
(file-name-nondirectory file) ; non interactive file, if any
(file-local-copy file)))))
(defvar babel-doc-doc-format
(append
(let ((doc-file (format "BETA-DOC-BUFFER: %s" doc-file))
(doc-doc-format
(format "[%m]
%s . %s"
;; `babel' doc-files are local to the
;; `babel-doc-print' buffer, so `babel-doc-print'
;; should be a local variable (in
;; Emacs).
(make-local-variable 'babel-doc-print-format))))
'("bounds" "/usr/share/babel")
'("files" "/usr/share/doc/babel")
'("index" "index")
'("comp"
"file" "/usr/share/doc/babel")
'("name"
"/path/to/babel-doc-doc.doc")
'(("doc-file"
t (concat "<babel-doc-doc_doc-file=\"%s\"" doc-file))
("<doc--doc-" doc-file (1- (current-column)) "-")))
(let ((babel-doc-format (format "BETA-DOC-BUFFER: %s %s"
doc-file))
(doc-build-build-doc-format "document"
(format "Create a `%s' document file in `Babel' doc file.")
,@doc-build-build-doc-format)
(dolist (name doc-build-build-doc-build_doc)
(if (string= name (car name))))
(put 'babel-doc-build-build-doc-format
(concat name (apply #'babel-doc-build-build-build-doc-format
(directory-file-nondirectory
,babel-doc-doc-name)))))
(dolist (doc-build-build-build-doc-format)
(if (file-regular-p doc-build-build-build-build-build)
(let ((doc-file (format "BETA-DOC-BUFFER: %s" doc-file)))
(if (string= doc-file (car doc-build-build-build-build-build_doc-format))
(concat
(file-local-copy doc-file)
======== SAMPLE 4 ========
,@ (match-string 1 name) nil)
(goto-char start)
(if (re-search-backward name nil t)
,@
(goto-char (match-end 3)))
(if (not (looking-at "^\\S-+^" (match-string 3 name)))
;; We don't just use the name, it is an abbreviation, so we keep the
;; name as a list.
(progn
;; Don't search for a group of words; this is not possible
(ignore-errors
(save-excursion
(goto-char (match-end 0))
(let ((last (match-beginning 0)))
(and (stringp last) last
(setq match-start (point)
match-end (point)))
(and (looking-at "^\\S-+\\([-+]]+\\)[\"']\\(\\sw\\|/\\|()\\)") (not (file-file-name-sans-extension name))))))))))
(defun mail/mail++--parse-attributes ()
(let ((data (mail/mail++--parse-attributes)))
(with-temp-file mail-file-name
;; If the file does not exist, use it.
(save-excursion
(let ((file (mail-extract-attribution
(mail-compress-string data data))))
(message "Use `%s'." filename))
))
(dolist (type mail-list)
(when (or
(and (stringp type)
(file-readable-p type)
(equal
`(,type
,(file-name-sans-extension type)))))))))
(defun mail/mail--parse-attributes-maybe ()
(let ((data (mail/mail++--parse-attributes)))
(with-temp-buffer mail-file-name
(prog1 `(goto-char (point-min))
(with-temp-buffer
(insert-file-contents mail-file-name)
(goto-char mail-file-name)
(when (looking-at "^\\S-+^" (match-string 4 name))
(let ((last (match-string 4 name)))))))))
;; The `mail/mail' variable can be either a list of filenames to parse, or a regex
"%file: samples-17700"
======== SAMPLE 1 ========
of the following variables will be removed,
the variables should be replaced according to the command."
(when (member (if (memq (process-type server) '(python2 mh2b2)) 'chown
(file-exists-p server)))
(let ((name (process-name server))
(coding-system-for-read
(process-name server))))
(unless type
(unless (process-live-p type)
(setf (process-status-type type) '(error))
(setf (process-status-type type) 'unknown))))
(set-buffer-modified-p nil)
))
;;;###autoload
(defun python2-command-with-chown (server &optional server)
"Run the python2 command on SERVER.
If `server-sentinel' does not recognize that environment, create a new
virtual host named CHANNEL.
If the variable `python2-server-sentinel-value' is non-nil,
use that value instead of this function instead."
(interactive "sServer sent"))
(defun python2-command-with-chor (server &optional server)
"Run the python2 command on SERVER, the value of the optional
variable `python2-server-sentinel-value' in DISTANCE.
If the variable `python2-server-sentinel-value' is non-nil,
use that value instead of this function instead."
(interactive "sServer sent"))
;;;###autoload
(defun python2-command-with-charset (&optional server)
"Run the python2 command on SERVER and charsET.
If argument is t, use default to charset; do not specify a
default value for charset."
(interactive "sChannel = ")
(let* ((charset (python-make-charset))
(charset-list (nthcdr 5 (if (stringp "chkp-")
(symbol-name parsed-charset)
(symbol-name parsed-charset)))))
(when (python-shell-argument-list)
(set-char-table-extra-syntax (caar parsed-charset) calc-string-coding-system-alist)
(python-shell-quote-commands)))
;;;###autoload
(defmacro python-command-with-symbol (name message-string &rest body)
"Run python commands on NAME with the command SYMBOL.
DESCRIPTION is the output of `symbol-symbol-p' or `message-string'.")
(defun python2-command-with-symbol (_name args)
"Run python2 commands on NAME with the command SYMBOL.
DESCRIPTION is the output of `symbol-symbol-p', or `python2-command-with-symbol',
or a list of the two symbols."
(let ((name (python-shell-argument-list))
(coding-system-for-read
(process-name))
(coding-system
(process-charset)))
(unless (eq coding-system 'mime-charset)
(setq message-string message-string))
(python-shell-quote-commands)))
(defconst python2-command-name
"python2-command-program_name"))
(defconst python2-command
======== SAMPLE 2 ========
of line 3
(define-key global-map [key-map] 'global-map)
(defun cperl-forward-line-list ()
(interactive)
(if (eq (current-indentation) (current-column))
(cperl-forward-line-list))))
(defun cperl-backward-line-list ()
(interactive)
(if (eq (current-indentation) (current-column))
(cperl-forward-line-list)))
(defun cperl-indent-region ()
(interactive)
(if (> (line-end-position) cperl-forward-line-list-forward)
(beginning
(move-to-right (line-position 2))
(re-search-forward cperl-backward-line-list-forward)
(cperl-next-to-begin-line)))
(if (eq (current-indentation) (> (current-column) cperl-forward-line-list-forward))
(cperl-backward-line-list)))
(defun cperl-continuation-function (function)
"Return a function to continue the current line if it is at end of line.
FUNCTION is called with zero or `-' as argument."
(let* ((first-buffer (point))
(last-buffer (point-at-eol))
(start-point (point)))
(save-excursion
(goto-char (point-at-eol))
(end-of-line)
(and (re-search-forward
(concat cperl-forward-line-list-forward "\n") nil t)
(point-at-eol))
(skip-chars-forward cperl-backward-line-list-forward)
(if (> (point-at-eol) (point)) (point-at-eol))))
(defmacro cperl-comment (&rest body)
"Function called between BODY.
The comments are not added to comments.
Otherwise, when BODY calls `comment-function' for comments, those
*are* added to `current-defcustom-list' and `current-defcustom-indentation'.
This is used during normal editing of the current line;
`comment-function' is called with no args but the current point.
The last argument of the function is the argument to the previous
expression, which is returned first.
If `comment-function' is called interactively, a value of
`comment-function' is used instead of this `begin-comment', or the variable
`current-indentation', as if the function had been called from the
previous expression (or it had been bound by a function argument). If there is a
non-nil `begin-comment', the variable can only be used if an
expression matching `begin-comment' is bound (since this function always returns t)
and a value of `current-indentation' is returned as if the function had returned
it."
(let ((indent (if (eq cperl-comment-function 'comment-function)
(let ((last-indentation (current-indentation)))
(if (looking-at cperl-comment-function)
(progn (beginning-of-line)
(if (setq indent (- indent)))
======== SAMPLE 3 ========
of "\\([^ \t]*\\)" in its input
(if (or (eq (car-safe (nth 1 the)) "\\(?0[0-9][^\n]*\\)")
(eq (car-safe (nth 1 the)) (cdr (nth 2 the)))
(mapconcat 'comma (car elt) " ")
(setq elt (cdr elt))
(delete-char 1)
(setq this-command
(mapconcat 'comma 'caddr (car elt)) "\\>")))
(add-to-list 'subr-advance-current
'subr-advance-current
'subr-advance-current
'subr-advance-current
'subr-advance)
(add-to-list 'subr-advance 'add-to-list)
(make-subr-list 'add-to-list))))
(defun subr-advance-current (&optional arg)
"Advance the current `subr-advance'"
(interactive)
(save-excursion
(rassq arg (subr-advance-current arg)))
(interactive "P")
(save-excursion
(rassq arg (subr-advance-current arg)))
(define-key subr-advance
'subr-advance-current-char 'subr-forward-char)
(when subtletree
(goto-char subr-advance)
(delete-char -4)
(insert (subr-subr-char (length subtletree)))
(if (null subtletree)
'subr-advance 'subr-forward-char
(add-to-list 'subr-advance '(0 0))
(setq subr-advance (sublist subtletree))
(message "Advance %d subtletrees" (+ subtletree 20))))
(defun subr-advance-current-char (count-char)
"Advance the current character of the current subroutine, or nil."
(interactive "P")
(cl-remove-overlays (- count-char 2 "\n"))
(insert (subr-char (1- (length subtletree)))
(let ((oldcount 0))
(save-excursion
(rassq count-char subtletree))))
(insert (subr-char (sublist subtletree t))
(let ((newcount (- newcount 6)))
(delete-region (sublist subtletree) (+ 0 count-char)))
;; Make sure the next two characters are not shifted.
(when (> count (length subtletree)))
(rassq count subtletree))
(setq subtletree
(rassq count subtletree))))
(defun subr-at-current-arg ()
"Return the next character to be aligned with the current subroutine."
(interactive)
(when (> count (length subtletree))
(rassq subtletree)))
(defun subr-at-current-symbol ()
"Return the next character to be aligned with the current subroutine."
(interactive)
(rassq subtletree)))
(defun subr-forward-char ()
"Reorient point to the next character of the current subroutine."
(interactive)
(
======== SAMPLE 4 ========
of completion (otherwise, the completion list is
inherited according to `completion-tree' and thus will be changed in future).
This makes it better to use `org-c-complete' instead.
Instead of using completion:
(c-use-completion t)
(c-use-completion c-mapping)
(c++-mode)
(let ((completion-tree (assq :complete-completion-pcomplete completion-tree)))
(cond
((and (not completion-tree)
completion-alist-list)
;; if it's a block with a default value, use completion.
((eq completion-alist-list completion-tree-default-value)
(setq completions-tree-default-value (gethash completions-tree completions-alist-list))
(setq completions-dict (cons
completions-dict
completion-tree-value-list))
(setq completions-alist-list (cons (substitute-command-keys
completions-alist-list)
completions-dict))))
;; (if completion-tree-default-value
;; the function called by the completion tree is
;; not called yet for completion-tree :D)
;; (if (not completion-tree-default-value) (use-completion -n))
(if (eq completion-tree-default-value completion-alist-list)
;; return the completion trees that were present for this completion.
completion-alist-list))
(unless completion-tree-default-value
(c-use-completion nil))
(if completion-dict-default-value
;; the function was called before, but is not called yet, so this function
;; cannot be called yet. We can save, for now, the value of
;; this function's state in `completion-tree' for later use.
(if completion-dict-default-value
(let ((completion-dir (completion-getcompletion
completion-alist-list)))
;; use completion-command-keys to determine the name of
;; the special completion command.
(if (not (memq completion-default-value completion-command-keys)))
;; if it is a block, do not include the special name.
completions-dict))
;; if it is a completion menu, insert the items into that menu.
(let ((completion-prefix (c-remove-or-add-completion
completions-dict
completion-directory-alist))))
;; if it really is a block, do nothing:
"%file: samples-17600"
======== SAMPLE 1 ========
";
";
"; ")
(calc-lang-defconst macro)
;; If we are running under Java, but without a package, use the
;; "package-defvar-*" macro. It's used by `define-key c-define-key t' to
;; compile a macro, without any syntactic documentation, in the same
;; manner as if the Java interpreter was compiled.
;; It appears to work in some cases as well.
(save-excursion
(let ((x (progn (interactive)
(if (boundp 'c-decl-member-p)
"member-decl-member"
nil))
macro)
(eval (car (assq-func x '(lambda))
`(lambda ,(cadr x)
,(cadr x))))))
(i x)
(c (intern (concat "C-h " macro))))
(when (eq (cadr x) 'package)
(cond
((listp (cadr x)) ; (list 1. 2. 3)
;; Check if the symbol can be used.
t)
((and (listp (cadr x)) (not c-find-macro))
(error "Package name found as a symbol (list)")
(listp (cadr x))
";"))
;; Do the compiler's work.
(while
(let ((c-version 'unknown)
(code '(C) ))
(c-decl-name-cache-add
(lambda (s)
;; If S, then add 2 and 3 by itself for our "name".
(setq s (list 'name s))))
;; This would be useful but it doesn't work here, because C compilers
;; don't check if a "name" macro can be used. The compiler can't find a
;; macro if "name" isn't already taken care of as part of the source
;; name for the macro in question.
;; But we still know that the "name" macro can't be used
;; because we don't know that "name" is used for the "c"
======== SAMPLE 2 ========
(cdr (assq 'bmp-format-list avec))
'bmp-format-list avec 'bmp-format-list)))
(and (re-search-forward (format "\\.$" nil t) a)
(setq a (match-string 0))))
((and (not bmp-list)
(re-search-forward a nil 'move)
(bmp-format-list (cdr a))))
((memq 'parsed (cdr a))
(if (memq 'parsed :parsed) (parsed bmp-list))
(dolist (a (or (if (consp bb) (consp bc) (cons bb bc)) (cons bc cmp bb))
(and (eq 1 t) (cons 1 t)))))
((memq 'list (cdr b))
(cdr (assq 'list (cdr (assq 'list b))))
(if (and (consp bn) (cdr bn))
(setq bn (copy-sequence bn))))
((consp bp)
(cdr (assq bp bn)))
((null bp)
(or (null bp) ; no lists
(null bps) ; no list
bps))))
((null a) ; no list
;; (setq a (cons 'list (list a))
a)
((and (nth 2 a) (nth 2 bp))
(setq a (nth 2 bp)))
(t ; no list
(let ((b (car a)))
(if (member b '("") . (car (assq 'bmp-list a)))
(setq a (list (cons b '(""))))
;; (setq b (list (list b (list b))))
(while b
(cons 'b (cons b (list (cons (car a) (car b)))) (car b))))
;; If a list is already active, skip it.
(if (consp bp)
(setq bp bp (cdr bp)))
(or (eq ?# bp) ; do nothing
======== SAMPLE 3 ========
'("orgtblob"
`((?\u "gnus" "orgtblob")
(?/("" "org")))))))
(defun orgtblob-insert (name,info)
"Delete the current group or current headline.
NAME and info can be set by `orgtblob-remove-current-heading-at (default)."
(orgtblob-insert "\\`[:link:]*" name info)
(orgtblob-insert "\\`[a-zA-Z][a-z]:[{:link:type ;:link#1;:link#2;}"
(?\u "gnus" "orgtblob")
(?/("" "org")))))))
;;;; Text Editing
(defun orgtblob-move-region (beg end)
"Move to the beginning of the current line with `move-hook'. If END is nil, try to move."
(save-window-excursion
(goto-char (bobp))
(let* ((g (and (member g '(:move . ,else)) (:end . ,else)))
(g (org-element-at-point)))
(when g (setq g (org-element-contents nil g)))
(push (cons g g))
(goto-char beg)
(goto-char end)
(goto-char end)
(save-excursion
(org-goto-line 1)
(sit-for (org-element-property :begin gnus-group-text-property) (length org-group-text))
(org-move-heading-start-p (point))
(org-agenda--aggressively-todo-p))
(org-move-hook-with-args orgtblob-move-hooks)))
(defun orgtblob-move-marker-end ()
"Move to the position which marks the end of mark. Move-hook is called if
no point is left after mark. Move forward with prefix argument; nil is nil."
(goto-char beg)
(org-element-property :begin gnus-group-mark-position)
(goto-char (progn (org-element-property :end gnus-group-mark)))
(when (org-at-table)
(cond
;; For this, skip the "preferred" tags.
((eq (org-element-type nxml-element-type) 'preferred) "\"preferred\"")
((eq (org-element-property :begin prop) '(:end-tag))
(when (org-element-type prop) (point)
(move-marker prop prop))
(or (looking-at-p org-element-property)
(setq org-element-tod-preferred t))
(and (eq prop t) (setq org-element-tod-preferred nil))
(org-indent-according-to-mode 'all-org))
;; Don't change the "preferred" tag in any way. It's a temporary tag which can't get
;; updated.
;; If there are marks (see `org-mark-marks-marker'), don't change the
;; original tag in any way.
((not org-mark-marks-marker) (replace-regexp-in-string "[0-9]+\""
======== SAMPLE 4 ========
)
(let ((inhibit-point-motion-hooks t))
(erase-buffer)))
(error "Not yet loaded: %s" nndir))
buffer)
(setq buffer (assoc buffer
(and iswitchb-list-flag
iswitchb-list-flag))))))))
(setq num (1+ num))
(erase-buffer)
(setq num (1+ num))
(erase-buffer))
(put-text-property 0 (length nndir) 'length #'(lambda (node) #'set (char-equal (char-is-integer (char-evenp node))))))
(ert-deftest iswitchb-compat-warn-p ()
(test-with-temp-buffer
(insert #'def-string)
(should (string-equal (substring iswitchb-compat-string 1)
'(4 4 4 4)))))
(ert-deftest iswitchb-test-declare-assert ()
(with-temp-buffer
(with-temp-buffer (insert #'warn)
(erase-buffer)
(should (equal (substring iswitchb-test-declare-assert 1)
'(4 4 4 4 4 4 4 4)))
(should (equal (substring iswitchb-test-declare-assert 1))
(list '(declare-fct nil
1 (lambda (l)
(lambda ((p) (car l))
(let ((p2p (cadr p2p))
p3p)))
3 nil)
(if (eq (aref p2p 2) ?n)
(string= "[\"\"]" (regexp-quote p2p))
(buffer-substring p2p 0 (length p)))
(setq p2p (cons p1p
(cons p3p (concat (car-safe p2p) ?\.) (cadr p2p)))
p3p)))))
(should (string-
"%file: samples-17500"
======== SAMPLE 1 ========
set-last-buffer)
(insert "\n;; nil;
;; nil
;; :start nil)
(insert ");\n;; ; ;\n;;
;; (insert "\n;;\n;; ")
(prin1-to-string (file-name-as-directory buffer-file-name))
(setq-local start (file-name-nondirectory buffer-file-name))
(beginning-of-line)
(delete-file buffer-file-name)
(revert-buffer))))))
;;;###autoload
(defun goto-forward ()
"Forward the previous line."
(interactive)
(goto-char (point-min))
(forward-char 1)
(forward-line 1))
(defun goto-backward ()
"Go back to previous line."
(interactive)
(save-excursion
(beginning-of-line)
(skip-chars-backward "\n")
(forward-char 1)
(skip-chars-backward " " t))
(goto-char (point-min))
(forward-char -1) ; 1+0=1.
(forward-char 2)
(if (and (save-excursion
nil
(looking-at goto-backward-re (- (point)))
(not (looking-at goto-backward-re)))))
(backward-char 4))
(forward-char 2)))
(defun goto-forward ()
"Go forward one line."
(interactive)
(save-excursion
(beginning-of-line)
(skip-chars-forward " \n")
(skip-chars-backward " \t")
(forward-char 1)
(skip-chars-backward " " t))
(goto-char (point-min))
(forward-char 2)
(if (and (save-excursion
(re-search-backward goto-forward-re nil t))
(and (looking-at goto-backward-re (- (point)))
(not (looking-at goto-backward-re)))))
(goto-char (point-max))
(forward-char 1)
(backward-char 1)
))
;;;###autoload
(defun goto-backward-word ()
"Go forward one line."
(interactive)
(save-excursion
(beginning-of-line)
(skip-chars-backward " \n")
(skip-chars-backward " "))
(goto-char (point-min))
(move-char 1)))
;;;###autoload
(
======== SAMPLE 2 ========
set-buffer
(setq-local semantic-auto-select-tag-buffer)
(let ((tagname (funcall semantic-tag-table semantic-symbols))
(semantic-table-value (semantic-table-value-class)))
(semantic-enter-tag-with-tag-form tagname
(semantic-enter-tag-with-tag-form
"Tag " (semantic-enter-tag-name tagname)))
;; Don't handle nil tag, if this tag has no parent.
(setq-local semantic-auto-select-tag-buffer))
;; Find the name of the tag to use
(and (string< (semantic-tag-parent tagname) (list)))
;; We can't match this, since a tag in another language
;; might also be matching on the same parent.
(progn
;; Scan this tags table, as part of the parser.
(if (not semantic--auto-select-tag-p)
;; This is an arbitrary tag, and we should not have this on the tree.
(let ((match-string (semantic-tag-string tagname)))
(setf (cdr (semantic--search-table-string-for-tag match-string))
semantic-type))
(semantic--find-tag-match-string tagname))))
;; Make sure this tag is one of the tag names and not just a tag.
(progn
;; Do not reuse tags on the tree.
;; If this tag has a parent, it is not a parent to us.
(if (and (not (stringp match))
(not (semantic-tag-type-member tagname match-string))
(let ((match-string (match-string-no-properties tagname)))
(setf (cdr (semantic-type-tag-p match)))
;; If there is a type-class match, we should not need to
;; match in this tag.
(setf (cdr (semantic-tag-get-type-class match-string)))
;; This does not appear on the tag, but it may have
;; been referenced on the tree and is probably needed in
;; the name itself.
(setf (semantic-type-type match-string))
;; We do not include a parent tag, this is likely to get
;; ignored.
;; It works fine with the semantic-tag-type-class.
(
======== SAMPLE 3 ========
set-buffer)
(setq buf-read-only t)
(buffer-substring
(minibuffer-find-file-name (if buf-only t " ") t buf-read-only)))
(setcar buf-read-only ">")))
(if (and buf-read-only
;; Make the read-only buffer if no buf.
(not (member buf-read-only '("read" "read"))))
(progn
(buffer-substring-no-properties
(minibuffer-find-file-name (if buf-read-only " ") nil buf-read-only))
;; Don't print text if no name.
(if (file-exists-p buf-read-only) buf-read-only))
; Not the name
(delete-file buf-read-only))))
(defun file-name-sans-extension-p (file)
"If FILE says to do a full extension for this file, then return value."
;; The user can then add a user option. So set the default "full-directory".
;; But the user will be prompted for that option.
(let ((dont-comment-with-ancestor
;; We don't put comment at the beginning of a line, we get around this with
;; case-insensitive-macros which can give the wrong extension for
;; cases. The user will get a warning, otherwise a blank line.
(unless (and (file-exists-p file)
(or (= (length file) 1)
(not (file-directory-p file)))
(error "%C never defined a full-directory" (concat "\\(Directory |" (regexp-quote file)
"\\)"))))
(with-temp-buffer
(insert-file-contents file))
(unless (and buf-file-name
(equal (file-name-directory file)
"\\.extension/")
(zerop (file-expand-wildcards (file-name-all-names file)))
(< (file-name-nondirectory file) max-depth)))
(cond
;; If we didn't add a user option in a comment
((and (boundp 'comment-with-ancestor) (or (and comment-with-ancestor t) "inline")
comment-with-ancestor)
;; If the comment-with-ancestor user option,
======== SAMPLE 4 ========
set)
(if (match-beginning 2) (throw 'noerror 'nofile)
(user-error "No file on current line")))
;; If no file is found and the command isn't open, close it.
(setq file-open-inhibit-noninteractive nil)
(setq file-opened-on t)
;; If possible, use file from previous open file (if it's not already open)
;; Otherwise, just let current file open before moving from previous file.
(setq file-opened-on t))
;; We call `list-or-throw'
;; If we don't find a valid file or open it, don't call
;; `save-excursion'.
(unless file-opened-on (goto-char (point-max)))
(user-error "Unrecognized file %s in %s" file-open-inhibit-noninteractive))
(setq file-opened-on (file-name-from-absolute file))
(setq file-opened-on t)))
(if killfile
(progn
(user-error "No killfile on current line")))
;; Now go back to previous open file.
(if recent-file
(user-error "No recent file on current line"))))
(defun find-file-async (name, type)
"Read from the file name TABLE into a read-file for the given name, type and
type and return non-nil if the file name matches that name.
TYPE is a cons cell of `read-file-name-function' and `read-file-pattern'. The
same is true for TABLE as set in `open-file-recognizer'."
(let ((file-name-history (or type name))
(file-name-separator-no-regexp
(substring name
(let* (1 (+ type 0)
(length (match-beginning 0)))))
(list name type
name type (read-file-name-predicate)))
(file-name-nondirectory-no-regexp
(substring name type)
(file-directory-p
(read-file-name-predicate
(if (string-match "^." name) nil name))))
(file-name-extension
(file-name-as-directory user-specified-length)
(read-file-name-predicate
(if (and (integerp type)
(< type (length (car type)))))
(if (not (looking-at ".*?$"))
(string-to-number (match-string 1 name)))
(if (equal type "")
(if (not (file-exists-p file-name-directory))
"%file: samples-17400"
======== SAMPLE 1 ========
(cons (or (not (and (listp (car a) (cdr a)))
(cdr a)))
'calcFunc-standard
(cons (or (car a) (cdr a)))
'calcFunc-standard)
(c-setq 'calcFunc-sig-format
(concat (calc-simul-sig-format
(or (car a)
(cdr a) (length (cadr a)))))))
'calcFunc-standard)
(list (concat "^\\(.*\\)$"
'calcFunc-standard
(mapconcat (lambda (x)
(if (consp x)
(concat "\\b"
(substring x
(length
(mapcar
(lambda (string)
(format "\\b\\n"
(car char)
(concat
======== SAMPLE 2 ========
(format-buffer "TOC: %s: %s" voutag
(car voutag) (cdr voutag))
(format "%s, %d"
(if (numberp voutag)
(format "%c" (string-to-number voutag))))
(t (setq voutag (car voutag)))))
(if (and (featurep 'xemacs) (= (length voutag) 1))
(if (integerp (string-to-number voutag))
(format "%c"
(or (memq (char-after) '(2 ?\s))
(string-to-number voutag))))
(substitute-command-keys start end nil
(if (>= start (point))
(setq start (- start (point)))
(format "%s" start)))))))
(defun vhdl-dsl-format-file-name (filename)
"Convert file NAME to some format.
For example, the following code converts
<truncate> to .toffile. The value will be used on
the %s buffer to select the file. The `%' is usually the prefix,
and any text around it means a file name.")
(defun vhdl-dsl-convert-file-name (filename)
"Convert filename to some format."
(buffer-string)
(and
(or (null vhdl-dsl-dsl-current-directory)
(getenv "MACHINE") (getenv "VIRTUAL_DIR") nil)
(not (null vhdl-dsl-dsl-current-directory))
(or (eq vhdl-dsl-dsl-current-directory (current-buffer))
(getenv "VCMANAGER") (getenv "VCMANAGER") nil)
(and (eq vhdl-dsl-dsl-current-directory (nth 1 vhdl-dsl-current-directory))))
(let (string1)
(while (and (not (= vhdl-dsl-dsl-current-directory voutag)))
(concat
(substitute-command-keys (concat "~:" (car voutag) "~#\\[%s]" "")))
" " string2)))
(defun vhdl-dsl-dsl-convert-file-name (filename)
"Convert file NAME to some format."
(buffer-string)))
(defun vhdl-dsl-dsl-current-directory (nth n l)
(unless (nth n l)
(error "Not in %d directories"))
(let ((start (point)))
(save-excursion
(save-restriction
(narrow-to-region start (point))
(goto-char (point-min))
(while (re-search-forward "^/([0-9]+\\)$" end t)
(if (re-search-forward
(concat "^\\(.*\\)\\(.*\\)" first word)
======== SAMPLE 3 ========
(quail-define-package qjax-keypad-map
"Keymap used by the `quail-mode-map'.")
(quail-define-package qjax-map
"Keymap for Quail mode.")
(quail-define-package qjax-keypad-map-mode-map
"Keymap for Quail mode.")
(quail-define-package qjax-map-mode-map
"Keymap for Quail mode.")
(quail-define-package qjax-map-highlight-map
"Keymap for Quail mode.")
(quail-define-package qjax-keypad-map
"Keymap for Quail mode.")
(quail-define-package qjax-highlight-map-mode-map
"Keymap for Quail mode.")
(quail-define-package quail-keypad-map-map
"Keymap for Quail mode.")
(quail-define-feature 'interfaces '("Quail" "Quail", "X")
"Major mode for editing Scheme files.
Normally, `quail-highlight-mode' sets a major mode
to highlight any Scheme mode, and vice versa, but
it can also be configured directly. The default
setting is `quail-use-interfaces-only', so `quail-default-highlight-mode' will
also set this to t. If you change the default
setting in your init file, edit it again and revert
in the future. You can have a full description of the changes
using the Quail documentation."
:type '(repeat regexp))
(defvar quail-current-file-name nil
"The name of your current file.")
(defcustom quail-current-file-name nil
"The file name of your current file.")
(defvar quail-default-file-name
"The name of your current file.")
(defvar quail-current-directory
"The directory for your current file.
If it's omitted, it can also be omitted if `quail-dir-name'
is non-nil.")
(defconst quail-initial-buffer-name 'quail-current-file-name
"The name of the current file (which was last modified by me).
This is the default file name.")
(defvar quail-current-filename)
(defvar quail-program)
(declare-function qjax-program "qjax-mode"
"QJAX mode for Emacs"
"qjax-mode.el"
(make-sparse-keymap "")))
(defun quail-show-command ()
"Move point to the line in the current buffer, and display the commands
they take time to complete in order to display the message.
You can also specify the line number (default 4) and the line number
from which we start at.
You may scroll to either of those lines. In any case, display the commands
you've completed in the current buffer, and the lines will be
saved in your file."
(interactive)
(if (save-window-excursion
(let* ((buf (current-buffer))
(buf-read-only t)
(x nil)
(grep (or (null gnus-program-command)
(read-string "Command %s complete: " proc)
(read-string "Command line" proc)))
(lines (nth (1- lines) buffer-read-only t))
lines)
(list 'quit (gnus-message-quit proc lines nil t
======== SAMPLE 4 ========
\"#ticker-text-face
\n\n\"
(require 'cl-generic)
(autoload 'makefile-ticker "makefile-ticker" "\
Create a `makefile-ticker' for a generated file.
A file starts with a string or a \"name\" field in its
filename. The name is one of a range of characters. Each
character in a field is given the symbol ARG-BEG . If
ARGS is nil, only ARGES is used.
\(fn (&rest ARGS) ARGES)" t nil)
(declare-function auto-mode-hook "auto" (&optional arg))
(define-error semantic-syntax-error-errors
"Use `semantic-do-file-format-error-function' to do a syntax error in the
file."
(interactive)
(require 'semantic/find-file))
(define-type 'file-type 'file-truename)
(define-type 'buffer-file-name "")
(define-type 'symbol 'file-truename)
(define-type 'file-extension 'file-file-name)
(define-type 'file-name-extension 'file-truename)
(defmacro semantic-do-syntax-error-with-format-change (tagname &rest args)
"Like `semantic-do-file-format-error-function' but prints error to the
form TABLE . TABLE should not be a symbol. This functions should be
called with BODY as the initial argument."
(let ((truename (car TAGNAME))
(beg (car TAGNAME))
(tag (car TAGNAME)))
(cond ((eq (car-safe truename) 'default)
truename)
((eq (car-safe (semantic-tag-of-class-p tagname)) 'default)
)
;; Now, if TAGNAME has a non-zero entry, do a lexical
;; check. This is needed by `semantic/find-file-truename'.
;; We could always create a sub-class instead.
;; Instead, create a class to use.
(truename (cdr TAGNAME))
))
nil)
(define-type 'file-name-extension 'file-truename)
(declare-function semantic-do-format-error-function "semantic/find-file-error">format"))
(declare-function semantic-do-lexical-match-regexp "semantic/find-file-truename"
(parser &rest args))
(defvar semantic-lexical-regexp-function-name-alist
(let ((f (make-symbol "syntax-table-match-string")))
;; Use `semantic' to write our regexp's.
(setf (semantic--lexical-regexp-match-string
'stringp "syntax"
`(lambda () (semantic-lexical-match-regexp-p)))
(setq f (cons (concat
'syntax-table
'(4 1 4 3))
f))))
"Syntax table text used when trying to match a tag.
This can be set to a tag name, like `semantic-tag-name-string' but
not so as to match a type spec. This may be the name specified by your
syntax system or by a
"%file: samples-17300"
======== SAMPLE 1 ========
-1))))))
(defun org-element-reftex-get-element-class (element)
(cond
((boundp 'org-element-reftex-get-class) (org-element-get-class element)))
((boundp 'org-element-reftex-get-type) (org-element-reftex-get-type element)))
((boundp 'org-element-reftex-get-element-type) (org-element-reftex-get-type element)))
((= (length org-element-reftex-current-subclass) 13)
(org-element-define-definition 'reference
(org-element-regexp
(org-element-value 'reference) 'reference
(org-element-type 'reference))))
(if (string-match "\\`\\([0-9]+\\)\\([0-9]+\\)" element)
(insert-before-markers element "\n")
(let (lst)
(cond ((member element '(subtypes . subclasses))
;; We need to avoid having to do anything special in the parent class.
;; because `completion-ignore-case' will let us find
;; any `<' here.
((member element '(, etc))
;; If we're inside a function, we need to return the first
;; value in the list, and don't expect any further subclasses to
;; appear from here. We'll leave ourselves
;; free to just run this function ourselves.
(funcall element nil))))
;; We can't really use it in the subclasses because they could
;; become the objects of this function in future-buffer, so
;; we need to return a cons cell whose value is `completion-ignore-case'.
(goto-char pos))))
;; (defun org-element--get-element-type (element)
;; ;; (error "Missing element reference: %S" (org-element-re-search-forward
;; ;; "\\([0-9]+\\)\\([0-9]+\\)" element))))
(put 'org-reference-regex (concat "^[0-9]+" t)))
;; (defcustom org-element-type-reference
;; 'org-reference
;; "type reference reference"
;; nil
;; (make-string (org-element-type-descriptor) ?r) ?R)
;; (make-string (org-element-type-description) ?R)
;; (make-string (org-element-type-description) ?T)
;; (make-string (org-element-type-type) ?t t)
;; (make-string (org-element-type-type) ?f)
;; (make-string (org-element-type-type) ?a)
;; (make-string (org-element-type-type) ?A)
;; (make-string (org-element-type-type) ?D)
;; (make-string (org-element-type-type) ?N)
;; (goto-char (org-element--end-of-subclass))
;;
======== SAMPLE 2 ========
-p 'font-lock-add-lock-lock
;; We must define a new face so it doesn't look like this
;; after (and after-paren-style).
(add-hook 'next-to-prev-name-hook #'font-lock-do-before-name-change
(list 'face (cons 'face (cdr font-lock-fixed-face-list)))
font-lock-def-list)
(setq font-lock-fixed-face-list nil))
(if (derived-mode-p 'font-lock-mode)
(setq font-lock-fixed-face-list
(make-weight 1 font-lock-variable-assignments))
(setq font-lock-variable-assignments
(list 'face (cons 'face (car font-lock-variable-assignments)))
font-lock-fixed-face-list nil))
(make-local-variable 'keymap-font-lock-keywords)
(setq font-lock-fontify-keywords-mode
(cons 'font-lock-fontify-keywords-mode
(list 'face font-lock-fontify-keywords-mode)))
(modify-variable font-lock-fontify-keywords-mode
"Keywords: #" 'menu-item)
(modify-variable font-lock-fontify-keywords-mode
"Inline Lock" 'menu-item)
(modify-variable font-lock-fontify-keywords-mode
"Inlinetask: Keywords: #" 'menu-item)
(modify-variable font-lock-fontify-keywords-mode
"Inlinetask: Keywords: #" 'menu-item)
(modify-variable font-lock-fontify-keywords-mode
"Lockface: Keywords: #" 'menu-item)
(modify-variable font-lock-fontify-keywords-mode
"Lockface: Keywords: #" 'menu-item)
(modify-variable font-lock-fontify-keywords-mode
"Lockface: Keywords: #" 'menu-item)
(modify-variable font-lock-fontify-keywords-mode
:selected
:help
"Font Lock: Keywords: #" 'menu-item))
(modify-variable font-lock-fontify-keywords-mode
"Keywords" 'menu-item))
======== SAMPLE 3 ========
-macs-file-or-kill-file nil)
(delete-directory "~/.emacs") ; remove the default
(delete-directory "org"
(org-export--export-get-filename)
"~/.emacs"))))
(funcall :name-and-group (or org-export-list-regex-only org-export-list-regex-name)))
(defun org-export--export-set-file-or-kill-file ()
(when (file-directory-p org-export-list-regex-only)
(org-backup-directory-p org-export-list-regex-only)
(setq org-export-list-regex-only nil)
(when (and org-export-list-regex-only
(file-directory-p org-export-list-file-or-kill-file))
(delete-file org-export-list-file-or-kill-file))
(set-buffer-disable-undo nil))
(save-excursion
(org-export-set-current-file-or-kill-file)))
(defun org-export-get-filename ()
"Return a filename from FILE-DIR in export.
This should do the same as `expand-file-name' in export.
Note that `org-export--create-directory-alist'.
See `org-export-get-filename' for more details of the export
function, and its interface."
(let* ((org-export-list-regex-only nil)
(org-export-get-filename (org-table-name-directory)
(org-export-create-directory-alist
org-export-list-regex-only org-export-list-regex-name
org-export-list-regex-name)
(org-export-filename-file-or-kill-file nil))
(org-export-set-file-or-kill-file (org-export-get-filename) (org-table-name-directory)
(org-export--create-directory-alist
org-export-list-regex-only
org-export-list-regex-name
org-export-list-regex-name)))
(dolist (file (org-export-export-get-filename :tag "filename"))
(delete-directory (expand-file-name (file-name-directory file))))
(goto-char (point-min))
(error "Invalid export file: %s" (buffer-substring
(line-beginning-position)
(line-end-position)))))
(defclass org-export--export-get-filename (expand-file-name value)
(let* ((file (file-newer
======== SAMPLE 4 ========
-name "x"))
(math-normalize
(calc-simplify-int (math-normalize-int (math-float (1- (length
(math-mul
calc-normal-symbols)
0)))))
":"
(list (concat (list (list 'calcFunc-expr
(math-normalize
(math-sqr
(math-mul
(calcFunc-expr
calcFunc-result))
(list (calc-mul
(math-mul (calcFunc-result
(list 'math-div
calcFunc-result))
(math-math-add
"%file: samples-17200"
======== SAMPLE 1 ========
list-buffer (buffer-list)))
,(gethash filehash)
(delete-file t)
(insert (buffer-string)))))))))
(when old-buffer
(unwind-protect
(progn
(with-current-buffer buffer
(save-excursion (not (eq (buffer-name old-buffer) '*)))))
(with-current-buffer filebuf
(write-region (regexp-quote (current-buffer)) (point) to)
buffer-list)
;; If the current buffer contains a file, just rename it.
(rename-buffer filebuf)
nil))
(defun insert-file-contents (&optional arg)
"Insert a file name at point or after point with contents.
Argument is the buffer value of `expand-file-name', or nil if empty."
(interactive "fInsert file name")
(goto-char (point-min))
(while (progn
(insert-file-contents)
(if (or (null (expand-file-name (cadr arg)) string))
;; First, if there's no file that `expand-file-name' wants,
;; don't delete it. Otherwise, just delete the file:
(delete-file arg))
(if (null (buffer-file-name))
(delete-file arg))
(or (string= (buffer-file-name)
(expand-file-name filebuf (current-buffer))))
(delete-file arg)))))
(defun insert-file-contents-with-extra-expand (&optional arg)
"Insert a new buffer of the same file name as the current one.
The first argument ARG specifies how the file should be inserted at point.
Note that `expand-file-name' means to insert contents from the file
that is not the current buffer.
Argument ARG is an integer, positive means insert content at point,
negative means insert it in a different buffer from the one it was inserted."
(interactive "FInsert new buffer as filename: ")
(cond (new-buffer default-expanded-directory)
(new-buffer-default-directory))
(unless (file-expand-all-buffers nil arg)
;; Don't make any more arguments given to `insert-file-contents' if the mode
;; buffer is a buffer-local one.
;; In buffers that don't care about filename, we'll always insert a
;; filename (this means not modifying existing buffers).
(let ((expand-file-name (file-name-name arg))
(file (expand-file-name filebuf-contents))))
(when beg (insert beg end))
(unwind-protect
(condition-case err
(insert-file-contents filebuff-contents "\n"))
(when (and arg not-empty-lines)
(delete-region beg beg end))
(if
======== SAMPLE 2 ========
list:keymap-alist keymap [?\[]]
"
;; No `keymap'. No more `keymap-alist' or `keymap-alist'.
(cond ((setq keymap (cons keymap))
(goto-char (point-min))
(if (stringp keymap)
(setq keymap (if (boundp keymap)
(list keymap)
(cons keymap keymap))
(setq keymap (mapcar keymap)
keymap (copy-keymap keymap))
(keymap-copy (cons keymap))))
;; The following is the syntax in use within Emacs Lisp -
;; it is a hack used by the Emacs user by default...
(define-key map [menu-bar text search] 'lisp-mode)
(define-key map [menu-bar font-lock-mode] 'lisp-mode)
(define-key map [menu-bar highlight-buffer] [menu-bar highlight-buffer]
'lisp-mode)
(define-key map [menu-bar highlight-file]
'lisp-mode)
(define-key map [menu-bar highlight-files] [menu-bar highlight-fileset]
'lisp-mode)
;; The following is the syntax in use within Emacs Lisp -
;; it is a hack used by the Emacs user by default.
(define-key map [menu-bar highlight-revert] [menu-bar highlight-revert]
'lisp-mode)
;; The following is the syntax in use within Emacs Lisp -
;; it is a hack used by the Emacs user by default.
(define-key map [menu-bar highlight-revert-mode]
'lisp-mode)
;; The following is the syntax in use within Emacs Lisp -
;; it is a hack used by the Emacs user by default...
(define-key map [menu-bar highlight]
'lisp-mode)
(define-key map [menu-bar highlight-revert-mode]
'lisp-mode)
(setq menu-bar-font-lock-keymap
;; (define-key menu-bar-font-lock-keymap "--")
keymap)
(make-local-variable 'window-config-font-lock-keymap)
(add-to-list 'window-config-font-lock-keymap
'(feature 'face
'font))
(declare-function font-lock-mode-hook "font-lock" ())
(modify-variable font-lock-mode-hook nil t))
(defun menu-bar-fontify ()
"Flatten the window display at the current buffer.
See `font-lock-mode'."
(interactive)
(let ((font-lock
(if (get-buffer-window (point-min) 'no-fontify nil)
(list font-lock-mode-hook t)))
font-lock-mode-map))
(unless (get-buffer-window (current-buffer))
(set-buffer (get-buffer-create (marker-buffer (marker-buffer 1))))
(font-lock-mode -1))
(if (and (featurep 'xemacs) (> width 0))
(set-marker (marker-position (marker-buffer 1))))
(font-lock-mode 0)
(if (get-buffer-window (current-buffer))
======== SAMPLE 3 ========
list-buffer
(when (buffer-modified-p)
(kill-newsticker--buffer t))
(defun kill-newsticker--from-point ()
"Insert a newsticker button at point.
If point is inside an existing buffer and the old one was not
available, kill that buffer instead."
(interactive)
(buffer-enable-undo)
(kill-all-local-variables)
(kill-region (point-min) (point-max))
(unless newsticker--is-buffer-p
(kill-buffer (current-buffer))
(save-current-buffer
(kill-buffer nil))
(if (setq n (current-buffer))
(setq n newsticker--buffer-names))
(unless (buffer-modified-p)
(kill-buffer)
(when (number-match-p newsticker--name (match-end 0))
(setq n t)
(setq newsticker--name t)))))
(defun newsticker--set-newsticker ()
"Set up a newsticker to use the old one.
The newsticker button at point is the name of a newsticker."
(interactive)
(setq newsticker--newsticker
(newsticker--make-newsticker 'newsticker--set-newsticker))
(apply 'add-hooks '(newsticker-hook "-mouse-1" 'mouse-2)
'(newsticker-button newsticker-button))))
(defun newsticker--insert-newsticker ()
"Insert a newsticker at point.
Insert the old one. The new one can be used in any
alternative context, just as on a mouse click and keyboard
binding."
(interactive)
(setq newsticker--newsticker "")
(setq newsticker--newsticker
(newsticker--make-newsticker 'newsticker--get-newsticker))
(bindings--define-key vcom-mode-map
'(lambda (&rest _)
; Use the new version
(newsticker--insert-newsticker)
; Don't overwrite the original.
;; Create a new button at the start of the new menu.
(let ((button-name (assoc button newsticker--newer-button-alist)))
(if (re-search-forward button-name nil t)
(newsticker--insert-newsticker))
(bindings--insert-entry _ (make-string (1- (length newsticker--sticker-alist))))))))
(defun newsticker-menu-bar-add-item ()
"Add a newsticker menu item at the top of the menu."
(interactive)
(remove-from-invisibility-tests
(bindings--define-key vcom-mode-map
(lambda (item)
(bindings--listitem vcom-mode-map item)
(bindings--listitem toggle-item)))
(bindings--set-keymap vcom-mode-map bindings--listitem toggle-item)
(bindings--setup-bindings (narrow-to-region t))
(bindables--add-hook
(bindings--add-hook
"-g" 'newsticker-update-button-menu-bar-value)
(bindings--add-hook
"f" (newsticker--get-list)
(bindings-insert-in-buffer-p nil))
(bindings--add-
======== SAMPLE 4 ========
list
;; '(nil)))
(cond
((consp org-agenda-category-name) ; ...
(org-agenda-category-name)) ; ...
((member org-agenda-category-name '(nil nil)) ; ...
(org-agenda-category-name)) ; ...
((consp org-agenda-category-name)
(org-agenda-category-name)) ; ...
((consp org-agenda-item-line) ; ...
(org-agenda-item-line)) ; ...
(t (and (org-element-property :tag "Line" entry) ; ...
(cl-prin1-to-string entry))))
((consp org-agenda-entry-name)
(let ((org-agenda-category-name (org-element-property :category entry))
(org-agenda-item-line (org-element-property :item entry))))
(if (string-match-p "^ \n\\(.*\\)" entry)
(car org-agenda-line)
(setq entry (read (current-buffer)))
(push entry (list (cons (match-string 1 entry) org-agenda-category-name) nil))))))
(when org-agenda-list
(and (org-agenda-group-p org)
(org-agenda-group-p org))
(org-agenda-list))
(when (not (org-agenda-category (org-element-type entry)))
(org-agenda-remove (org-element-contents entry)
(not (org-agenda-category (org-element-contents entry))))))
(delete-region (point-min) (point-max))
(when (and (looking-at-p (pop-to-buffer "*Called items*"))
(eq (nconp org-agenda-item-line) org-agenda-category-name)
(setq org-agenda-line (nconc org-agenda-entry-name (nreverse org-agenda-entry-name))))
(delete-region (point) (point-max)))
(org-agenda--refresh-item
org-agenda--refresh-item (cl-sort-keys (cdr org-item-line))
(org-agenda-item-line))))
(when
"%file: samples-17100"
======== SAMPLE 1 ========
-
(let ((old-list nil))
(unless (or (eq (car old-list) 'list)
(eq (char-before) ?w))
(setq old-list (length old-list)))
(unless (equal old-list (pop old-list)))
(let ((new-list nil))
(unless (or (eq (char-after) ?w)
(eq (char-before) ?w))
(setq new-list (append list new-list)))))
;; For more efficient code, the previous two methods provide some
;; other options. Therefore, we need to override the function name
;; in the middle (instead of the list). Thus, we add
;; the new list to the list of existing options, as shown below.
(if (car old-list)
;; This is not as efficient as it sounds
(let ((new-list nil))
(or new-list (setq new-list (pop old-list)))
(if new-list
(setcar new-list (append new-list list))))
(if (eq old-list new-list)
(setcar new-list 0))
;; The old function is not really needed in this case.
;; For more performance reasons, let's do it in the same way that
;; any other normal function does, in which case we'll modify the
;; old functions and try again.
(let (list old-list))
(if (not old-list)
(if (consp old-list)
;; Replace old values with their new values
(cond ((listp old-list) (= (length new-list) ?w))
((consp old-list) (= (length new-list) ?w))
(t (member new-list new-list))))
((setq old-list (cdr old-list))
;; We must not replace the value of the old list
(setq old-list (cdr old-list))
(if (null old-list)
(setcar old-list (cdr old-list))
(consp (cddr old-list)))
;; We should replace the old value
;; with the new value, since new value will be
;; inserted at the beginning of the list. And in
;; case 4:
(setcar old-list (car old-list))
;; If the old values match, then we replace new values
;; with the new values, in case any of the old values
======== SAMPLE 2 ========
- nil
(let ((value '())
(value 0)))
(cond
((eq value t)
(condition-case nil
(push '())
(error nil)))
(t
))))
;;;_ > all-out : all-out-all-out-all-out
(condition-case nil
(goto-char (point-min))
(forward-line 1)
(point-at-eol)
(if (looking-at "^[0-9A-A-A]+[0-9A-A-A]+[0-9A-A-A-A]")
(delete-outside-space)))
(t
(cond
((member '("[" = ""))
(delete-outside-space))))))
(defconst eshell-mode-line-regexp `((?# . ,(prefix . "\\|<\\(\\w\\|+\\)>"))) ;[#(:,(:,(:@)]$]$]$]$
(mapconcat 'regexp-quote
(subst-char-in-string ?< ?> ?\\) "\\\"")))
(defun eshell-mode (arg)
;; Don't put all this in a macro.
(when (and (stringp arg)
(string-match "[^]\\(?:$\\)[ \t]*" arg)
(equal arg 1)))
(let ((arg (current-prefix-arg)))
(if command
(setq arg (prefix-numeric-value arg)))
(if (eq command 'exit)
(error "Not at a command"))
(if command nil
(if arg
(message "Not at a command"))
(if arg
(setq default-line nil))
(message "Not at a command"))
(while (eq (char-before arg) ?\n)
(if default-line
(save-match-data
(push arg default-line)
(save-restriction
(narrow-to-region arg (match-beginning 0)))
(setq arg (point)))
(and default-line
(equal default-line 1)))
(when (stringp arg)
(setq arg (prefix-numeric-value arg)))
(if command
(setq default-line nil))
(if arg
(message "Arg not found"))
(if (stringp arg)
(setq arg (prefix-numeric-value arg)))
(if arg
(error
(message "Not at a command")))))
(unless command
(setq arg (prefix-numeric-value arg))
(if command
(error "Not at a command"))
(unless arg (error "Not at a command"))
(while arg
(setq arg (prefix-numeric-value arg)))
(unless arg (message "Not
======== SAMPLE 3 ========
-
;;; Code:
(eval-when-compile (require 'cl-lib))
(autoload 'cl-lib-incomplete "cl-lib" "\
Test any `incomplete-form' that `cl-lib-form' may fail with `always-complete'.
This command is meant for systems where only the standard
form has been implemented. If you want to fix
this, send this command with a `\"` followed by
a valid completion form (`re'). In order to get good behavior, you need a
function to call on an empty string. The function must accept at
regexp as argument.
You can also set the variable `try-with-failed-completion' in
the init file with the
\"/`\" in the prefix argument and then use
`try-with-failed-completion-hook' on the current line." t nil)
(autoload 'cl-lib-form "cl-lib" "\
Check if a form should be checked for completions.
This is an example of an argument list. See `cl-lib-form' for a description
of every other form that should be checked.
The function should call `always-complete' to remove the \"false\"
indicator, and that is a good thing.
As the function might change, the following changes
should be taken into account.
You don't need to change `try-with-failed-completion'.
There are several things to keep in mind:
`always-complete-for-all' and
`always-check-completion'.
These will need to be removed for the entire list, so you would
probably want to remove `try-with-failed-completion'.
Also, the `never-complete' part of the form doesn't work with
cases where the completion code is a function. When you
are adding these constructs to the list, you need to ensure this
function returns the form that the user is interested in. This
variable can be used to control the way the user
responds.
(let* ((form (intern-soft tty
(lambda (_form)
(cond
((eq (intern-soft 'cl-lib-form-regexp) 're)
(let ((try-completion t))
(cond ((and tried-completion
(not (eq (intern-soft
(symbol-name form))
(symbol-name default-value))
('always-complete t)))
nil))
((eq (intern-soft 'cl-lib-form-regexp) 're) t)
((eq (intern-soft 'cl-lib-form-regexp) 're) t))
(t (error "Wrong syntax for `try-re'")))
(t (error "Wrong syntax for `always-complete'"
======== SAMPLE 4 ========
- This line is a prefix argument -- it may be set from the command line.")
(defvar eshell-command-args nil
"List of command args you need for each buffer.
This is a function which will set a variable, set a property, etc.
This function can then be used as a function to change the value of
`eshell-command-args'. This variable can be set and can be put in it again in
`ebx.el'.
This will be used as in `elpa'.el' to provide the actual `defgroup'
`eshell-command-args' variable and add the variable as follows in
`ebx.el':
(defgroup eshell-command-args nil
"List of `defgroup' variables to set.")
(defvar eshell-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\C-c" 'eshell-mode)
(define-key map "\C-c" 'eshell-command-args)
(define-key map "\C-c{" 'eshell-command-args)
(define-key map "\C-c}" 'eshell-command-args)
(define-key map "\C-c}" 'eshell-command-args)
(define-key map "\C-c}" 'eshell-command-args)
(define-key map "\C-c}" 'eshell-subcommand-args)
(define-key map "\C-c-" 'eshell-subcommand-args)
(define-key map "\\[" 'eshell-subcommand-args)
(define-key map "\C-c=" 'eshell-subcommand-args)
(define-key map "\C-c=" 'eshell-subcommand-args)
(define-key map "\C-cx" 'eshell-subcommand-args)
(define-key map "^" 'eshell-subcommand-args)
(define-key map "a" 'eshell-subcommand-args)
(define-key map "f" 'eshell-subcommand-args)
(define-key map "b" 'eshell-subcommand-args)
(define-key map "c" 'eshell-subcommand-args)
;; This is `elpa-mode' and has to do with the use of "escaped-char" characters inside
;; the commands that are executed.
(define-key map "a" 'eshell-subcommand-args)
(define-key map "b" 'eshell-subcommand-args)
(define-key map "^" 'eshell-subcommand-args)
(define-key map "_" 'eshell-subcommand-args)
(define-key map "_" 'eshell-command-args)
;; Set the variable `eshell-mode-map' if needed.
(setq eshell-mode-map (make-sparse-keymap)))
(define-key map "\C-c\C-d "\C-c\C-t\C-c" 'eshell-mode)
(define-key map "\C-c\C-l\C-f\C-m" 'eshell-mode)
(define-key map "\C-c\C-p\C-x\C-i" 'eshell-mode)
(define-key map "\C-c\C-s\C-y\C-z" 'eshell-mode)
(define-key map "\C-c\C-c\C-c" 'eshell-mode)
(define-key map "\C-c\C-s\C-w 'escaped-char)
(define-key map "\C-c-c\C-r\\<"))
;; This is a function set by `eshell-mode', to set the properties of
"%file: samples-17000"
======== SAMPLE 1 ========
;;
(format "<%s-%s>" (caar elt)) ; "file"
"filetype=\"included\" type=\"\"")))
(setq ncursor-type nil) ; t
(set-visited-file-modtime)))
nil))
(if (not ncursor-type)
(if (> ncursor-type 0)
(progn
(setq ncursor-type (nth 1 ncursor-type))
(setq ncursor-type 1))
;; FIXME: If the cursor is at a buffer that doesn't have a mouse click
(nnheader-read-event)
(set-visited-file-modtime)))
t)
((eq ncursor-type 1) ;
(error
"Cursor may not have a window type"))
(message
;; This is a bit hack, but it should not cause too much of a problem.
(nth 8 info-window-type)
(delete-other-windows-if-included))
((eq ncursor-type 0) #'error
(setf (nth 2 info-window-type)
(list (car (nth 3 info-window-type)))))
(message (format "<%s-%s>" (car (nth 2 info-window-type)) " ")))
;; We have a file type. Go to the nnml and read it.
(let*
((buf (car (window-buffer window)))
;; Check that the buffer has been seen by the user.
(window-buffer (and (buffer-live-p buf)
(buffer-name buf))
(or (and (eq buffer (buffer-name buf))
(not window-goto-auto-extended-display t)))
(nth 2 info-buffer-type))
(set-buffer buffer--mark))
;; This is used to check that the filename is the source of
;; that is expected. Use the usual way of doing this in
;; nnml's `symlist'; note that this check doesn't try
;; `gv' or `cg'.
;; (when (and nnml (memq (car (car (nth 8 info-window-type))
======== SAMPLE 2 ========
(if (not (string-equal "default" (car parens)))
(let ((nxml-default-nxml-marker nxml-default-nxml-marker))
(if (> nxml-default-nxml-default "s")
(nxml-default-make-empty-string nxml-default-nxml-default-nxml-marker ?\s )
(concat (nxml-default-make-marker
nxml-default-nxml-marker ?\s)
nxml-default-nxml-marker)
;; If paren-p is already in the current line
(cond (nxml-default-paren-paren-mark)
(setq nxml-default-nxml-marker (nxml-default-nxml-marker)))
(let ((nxml-default-nxml-default-nxml-marker nxml-default-nxml-default-nxml-default-nxml-default-default)))
(if nxml-default-mark-in-default-group
(nxml-default-nxml-mark-marker
nxml-default-nxml-default-nxml-default-default)))
(if nxml-default-paren-mark
;; If nested, nest line, replace with N.
(setq nxml-default-nxml-default-nxml-marker
(string-to-symbol (car parens)))
(nxml-default-nxml-default-nxml-default-nxml-default-default))
(setq org-element-nxml-marker (nxml-default-nxml-marker)
org-element-insert-markers))
(nxml-default-populate-nxml-nxml))
;; Insert N-LIST, if needed.
(nxml-insert-nxml)
(or (and org-element-list (nxml-element-children))
(list org-element-nxml-element-list))
(push (nxml-element-children) pop)))
(setq
======== SAMPLE 3 ========
(cdr (assq name
(mapcar #'purecopy expr)))
(cadr (cddr expr))))
(if name
(dolist (string name)
(let ((name (split-string name expr)))
(if (file-name-absolute-p (expand-file-name
(car string) t t))))
(setq expr (nconc (list (split-string name expr)))))
(if (eq (car (nth 1 name)) 'type) (pop expr))
(when (string-match-p (nth 1 name) name)
(let ((start (point)))
(when start
(while (progn (setq expr (nth 4 start) (nth 1 start))
(setq suffix (substring name
(match-end 0))))
(setq suffix (substring name 0 (- start suffix)))
(setq suffix (substring string (1+ start)))
(setq end (1- (match-end 1))))
(goto-char start)
(push (concat suffix suffixname)
"")))))))
(list prefix suffixname suffix)
(cond
((and
;; If a prefix
======== SAMPLE 4 ========
(if current
(setq new-pos (point))
(if current
(setq new-pos (point))
(setq old-pos (point))
(if current
(setq old-pos (point))
(setq old-pos (point)))
(if old-pos
(setq old-pos (point-max))
(setq new-pos (point))
(while (and (not current-pos) new-pos
(not old-pos))
(if (not (funcall (pop old-pos)) current-pos))
(setq new-pos (point)))
(setq new-pos (point))
(setq new-pos (point-min))
(while old-pos
(let ((new-pos (current-buffer))
(old-pos (point)))
(if old-pos (setq new-pos old-pos)
(goto-char new-pos)
(setq new-pos old-pos))
(while old-pos
(if (not (funcall (pop old-pos)) current-pos))
(setq new-pos old-pos)
(setq new-pos (point))
(when new-pos
(setq new-pos (point)))
(delete-region new-pos new-pos)
(setq new-pos old-pos)))))
old-pos))
(dolist (new-pos new-pos old-pos new-pos)
(setq new-pos (point))
(setq new-pos (point))
(dolist new-pos
(setq new-pos (point-min))
(setq old-pos (point)))
(if new-pos
(setq old-pos old-pos))
(setq new-pos new-pos)))))
((equal old-pos value)
new-pos
"%file: samples-16900"
======== SAMPLE 1 ========
"\\2[0-9+/\n\r?][\r\\][][1-9]\\(?: ?\\?[0-9][0-9]\\(?:" ?\\([[:alpha 0-9]\\(?:" ?\\([[:alpha 0-9]+\\): "[[:alpha 0-9]+\\): "$]\\)[[:alpha 0-9]+>:;$][[::@]\\)+?")
["^[:]+" t t] nil t])))
"Keyword to highlight as regexp.")
(defvar eldoc-matching ?c
"Face for matching a region between expressions.")
:keymap eldoc-mode-map
(let ((map (if (fboundp 'eldoc-match-buffer)
map '(eldoc 1 2))
'(map [menu-bar eldoc-match-map] eldoc-match-map))
(eldoc-context-keyword (oref eldoc-match-keyword menu menu)))
(key (if (fboundp 'eldoc-match-context)
(list 'menu-item menu-item)
menu)
menu
(eldoc-match-buffer map
'match-buffer
t
:bold
:foreground (or eldoc-match-mode-face
(selected-frame)))
key)))
(declare-function eldoc-begin "eldoc" (region state))
(declare-function eldoc-end "eldoc" (mark))
(declare-function eldoc-begin "eldoc" (start))
;;;###autoload
(defcustom eldoc-mode-map
'("M4"
"eldoc-mode"
(map-keys-type 'eldoc-parse-macros
'(lambda (elem)
(let ((case-fold-search t))
(define-key ,eldoc-parse-macros nil t)
(define-key ,eldoc-parse-macro nil 'setpoint)
(define-key ,eldoc-prefix-function "P" 'setpoint))
function)
"M4 keys"
(map-keys-type '(eldoc-mode-map) '("M4" . "f")
(nth 0 eldoc-parse-macros)
:background
======== SAMPLE 2 ========
((eq mbuf 'xmltok) nil)
((member mbuf 'xmltok) nil) ""
nil nil "")))
mbuf ; ignore other values
(mapcar (lambda (v) (string-to-number (car v))))
(or (or (mh-stringp-p mbuf) "") "")
(mapcar 'car mbuf t)))
(pcase (nth 1 mbuf)
(kwd-case (nth 1 mbuf) 'kwd-case)
(kwd-case (nth 1 mbuf) 'kwd-case)))
(eq (car (nth 2 mbuf)))
(nth 1 vmbuf))
))
(pcase (kwd-case (nth 1 vbuf))))
(dolist (n nil) (let ((val (car n)))
(or (cdr (assq n (cdr (car val)))
(setcar (cdr (car val))))
val)))
(dolist (m '(xmltok mqm) vvhms)
(cond ((equal (nth 7 vhms) 'supersede)
(nreverse t) '(supersede))))
(pcase (nth 5 vhms)
(cdr (car (mh-string-to-number mbuf))))
;; This seems to work, but if the "s" part of the
;; sequence is nil, nil is inserted at the beginning of the
;; sequence.
((gnus-article-type 'xmltok) `((mh-string-p mbuf) `(,(car-safe (cadr mbuf))))))
((and (eq (car-safe (nth 1 mbuf)) 'y))
;; We can't find any Y at the start of a sequence, this
;; simply means a function call's error.
(
======== SAMPLE 3 ========
(dolist (symbol (cdr symbols)) (nreverse))))))
;; The file extension property can be used to make changes to the
;; headers in a way that may not be possible otherwise.
;;; Code:
(defconst org-element-header-path
"<meta name=\"%s\">\n" "<head><meta name=\"%s\">\n"
org-item-header
(concat (regexp-quote (org-element-property :value)))
"<span type=\"document\">%s\n" type "</span> <header><meta name=\"%s\">\n"
(concat (regexp-quote (org-element-property :value)))
"</header>"))))
;;; Internal functions.
(defun org-item-footer-end ()
"Insert an end element of an item body at the end of an item."
(interactive)
(let* ((footer (if (org-in-item-footer)
(substring footer 1))
(> (org-in-item-footer) end))
(footer-end (org-element-property :footer))
(footer (org-element-property :end footer))
)
(when header (concat footer "[\n\t]+")) ; `footer'
(org-element-map `(lambda (_widget)
(concat "</div>"
:tag "Headers "
(concat "</"
(org-element-property :reference widget))))))
(when (and (equal footer 'org-element-footer)
(or (equal footer 'org-element-footer)
(org-element-property :item-property
(not (org-element-property :element footer)))))))
(let ((body (plist-get (org-element-property :end item) :value))))
(when body
;; Insert body.
(org-item-body)))
body))
(defun org-item-footer-body ()
"Insert element of an item body at the end of an item."
(interactive)
(org-with-wide-buffer
(goto-char (point-min))
(org-element-property :element item))
(org-remove-item-header
header-body
(with-current-buffer (current-buffer)
(insert (org-element-property :line :value)))))
(defun org-item-footer-body ()
"Insert element of an item body at the end of an item."
(interactive)
(org-element-property :element item)))
;;; The item-body property can use the property map.
(org-element-property :element org-item-header-body)
(defun org-item-footer-body (header-body)
"Insert element of an item at the end of an item."
======== SAMPLE 4 ========
:tag (:custom-tag ,@(mapcar #'cdr elt cl))
:selected (overrides (cdr cl))))
(if (not (memq cl '(:custom-variable ,cl :custom-tag ,cl)))
(list cl t))))
(defcustom cl-toggle-default-frame-hook nil
"Hook run to toggle the overlay for other frames.
The first time a user type something in the overlay, the toggle button
calls that item."
:group 'cl-toggle
:type 'hook
:options '(:custom-tag ,cl 'cl-toggle))
(defcustom cl-toggle-selected 0
"Indicates whether to toggle the overlay when displaying on a selected frame."
:group 'cl-toggle
:type 'integer)
(defcustom cl-toggle-frame 1
"Indicates whether to toggle the overlay when displaying on a selected frame."
:group 'cl-toggle
:type 'integer)
(defcustom cl-toggle-overlay-size 90000
"Number of times the overlay should be deleted."
:group 'cl-toggle
:version "22.1"
:set 'cl-toggle-overlay-size
:help "Overlay should be deleted")
(defcustom cl-toggle-frame-timer-function 0
"Function run to toggle the overlay for the specified frame.
This function needs no arguments.
The value is a list of commands, the remaining one is what
`cl-hide-deleted-frames' does."
:group 'cl-toggle
:type '(alist action defcustom))
(defcustom cl-hide-deleted-frames '(:overlay-undo,*))))
;;; Interactive buttons
;;;###autoload
(defcustom cl-show-display t
"Possible display modes for the current buffer.
This is a list of commands, which are defined when `cl-toggle-mode'
pays attention. These are the commands to be shown in that frame.
See a manual for further information."
:group 'cl-toggle
;; This is a list of commands available in the buffer
;; and any other buffer
(if (eq t (car cl-show))
(or (eq t (cadr cl-show))
(cddr cl-show))
(list 'cl-show cl 'face 'face))
(if cl-show-decoration 'cl-show
(if cl-show-shadow 'display-shadow)
(if (eq (minibuffer-window) (window-sized-buffer))
(cl-show)
(cl-face-face (minibuffer-window)))
(cons 'cl-show cl 'display-display)
;; `cl-show' is defined as an effect which can change the
;; current window, even if there is none.
(or (cl-show-face t)
(make-local-variable 'cl-show-decoration))
(cons 'cl-show cl 'display-display)
(cons key
(cond ((eq t (nth 1 (cdr cl-show)))) ; we need a major-mode to do this.
((eq (car cl-show) 'keyword)
nil) ; maybe we should use a minor-mode.
((eq (car cl-show) 'hide-display)
:help "Hide display or comment")
((nth 3 (cdr cl-show)) :help "Hide or highlight comment")))))
;;;###autoload
(defcustom cl-hide-decoration nil
"Con
"%file: samples-16800"
======== SAMPLE 1 ========
"[x" ?\] "")
(x)
(math-realp (car x)))
(if (and calc-texinfo-current-window
(>= calc-texinfo-current-window
(min (current-window-start) (point)))
(calc-graph-min-texinfo-window nil)
calc-graph-current-texinfo-window))
(not (eq calc-texinfo-current-window t))))
(calc-enter-result 3 "calcFunc-current-texinfo-frame"
nil nil (list x)))
(let ((inhibit-quit t)))
(when x
(let ((inhibit-read-only t))
(calc-enter-result 0 "calcFunc-current-texinfo-frame"
nil nil (list x)))
(setq calc-texinfo-current-frame win t))))
(let ((inhibit-quit t)))
(set-window-dedicated (point) (point-max))
(math-resolve-x-pro
(if (math-get-x-propoint)
x (progn (calc-top-n (- math-cplx-top 1 0) (aref math-cplx-top 1)))
(progn
(calc-top-n x))
(calc-top-n win nil))
(calc-enter-result 1 "calcFunc-top-n" 1
(list x))))))
)
(defun calc-x-solution (x)
"Eval x s using the sieve."
(let ((x-solution 1))
(while (> (point) x)
(let ((solver (calc-enter-result x)))
(if (symbolp solver)
(funcall solver)
(if (listp (symbolp solver))
(if (calc-sieve-sieve-solver-rolver-as 2)
(if (listp (symbolp solver))
(if (listp (symbolp solver))
(<= (symbolp solver) 0))
(if (car solver)
(if (listp (symbolp solver))
(if (car solver)
(if (
======== SAMPLE 2 ========
"[var alist]
["Find a matching alist" function-find-tag-for-tag
"tag.c" val)
"--"
;; Check whether any value has a match for t.
(t
(let ((tags ; Check whether tag matches
(l t alist)) ; Look through the tree and
;; `tags' is the tag that is in the
;; alist.
ctl)))
(error "Lack of `tags' matching item `%s'..." (l t))
;; All symbols matching alist (i.e. matching in the same
;; order, and not in the same direction).
(while
(if (setq val
(funcall (list val))
val nil))
(setcdr val (funcall tag val)))
(setq l (cdr l))
;; Check the lst element for alists matching alist
(if (listp l)
(list l (list (list '+ l t
(list 'a l t
(list 'b l t
(list b t
(list 'c l t))))))
(if (listp (cdr (cdr l))
(and (not (math-add-matches-p l)))
l (list (list 'a (list 'b l)) l)))
;; Check lst element, and check alist.
(if (listp (car l))
(listl (list l (list l val)) l nil)
;; Check alist.
(setcdr (car l) (nth
======== SAMPLE 3 ========
"[ ?"
(setq mh-lastpoint " "))
(or ncom mh-current-buffer-type) ; buffer type
(nconc
(nreverse mh-current-buffer-type) ; previous buffer
(error "mh-insert-old-line does not exist"))
(nconc (nreverse buffer-list) buffer-list))
(goto-char (point-min))
(while (setq mh-lastpoint (pop buffer-list))
(replace-match "--")
(setq mh-lastpoint (point-max)))
(insert ": ")
(forward-line 1) ; mark position - not used here
(delete-region start end))))
(insert " ("
t mh-current-line start end))
(goto-char mh-point-max)
((= (match-beginning 1) (match-end 1))
(insert
(format (nth 3 (list mh-mark-marker '("--mark" "--mark" "--"))))
(list mh-mark-marker '("--mark"
mh-mark-marker
mh-mark-marker)))
((= t (nth 1 (list '("--" (nth 2 (list '("--mark" "--")))))))
(nnheader-insert-text "\n("
"\n--")
(format "[ \t]*$ "
(nth 1 (nth 2 (list '("--" "--" ""))))
(nth 2 (list '("--" 0 "---" "")))))
;; For backward compatibility, we don't need to change the point-min-marker in here.
(insert "\n")
(narrow-to-region mh-point-min-marker)
(list '(point-min (- mh-point-min-marker (nth 1 mh-point-min-marker)))))
;; Make a line number, or a word, if no such symbol.
(setq mh-current-line
(let* ((mh-beginning-marker (point))
(mh-beginning-marker mh-current-line (point))
(mn-start-marker nil))
(substring-no-properties (point))
(and (search-forward "\n\r" nil t)
(search-backward "\n\r\n"))
(re-search-forward "\n\t\t" nil t)))
nil)
(setq mh-current-line (+ mh-beginning-marker)))
======== SAMPLE 4 ========
"[¸´"
"ลรรมธิ้าัก์"
"ลร่า้ะ"
"ลรา้ก์"
"ลรา้ก์๊ิทม"
"ลรา้ก"
"ลร้ก์"
"ลลัด"
"ลลัดพฝรร์"
"ลลัง"
"ลลังลมงปตภ์"
"ลรา่น"
"ลรา้จรร์"
"ลริ"
"ลริวน"
"ลริะ"
"ลร้จนุ๗ังก์"
"ลร้่ากด"
"ลร้่า"
"ลร้่าก์"
"ลร้่ย"
"ลร้่าตร์"
"ลร้่า"
"ลร้่าตà
"%file: samples-16700"
======== SAMPLE 1 ========
to the right side of the window.
(window-top (max (window-level pos) (window-top (- width 2)))
;; It is possible to change the height of top-to-bottom windows.
(max (window-height (window-level pos))))
(window-right (min (frame-height (window-height pos))))
(window-left (min (window-height (frame-height pos))))
(window-bottom (min (window-height pos)))))
;;;###autoload
(defun window.preferred-window ()
"Select the selected window and return a list of windows."
(let ((win (window-next)))
(select-window win)))
;;;###autoload
(defun window.preferred-window--top-to-bottom ()
"Select the selected window and return a list of windows."
(let ((win (window-next)))
(select-window win)))
;;;###autoload
(defun window.preferred-window--left-to-top ()
"Select the selected window and return a list of windows."
(let ((win (window-next)))
(select-window win)))
;;;###autoload
(defun window.preferred-window--top-to-bottom ()
"Select the selected window and return a list of windows."
(let ((window (window-next))))
;;;###autoload
(defun window.preferred-window--bottom-to-bottom ()
"Select the selected window and return a list of windows."
(let ((window (window-next)))
;; The leftmost window that is displayed in the window hierarchy.
;; This has the added benefit for non-special windows.
;; It means showing only what is already available for selection, or
;; if the window is on the left of the window hierarchy.
(let ((window-lineup window-lines))
(select-window window-lines-with-extra-p)
window))
(defun window-select ()
"Select text from buffer WINDOW at top/bottom."
(cond
(select-window (selected-window) nil)
(select-window-left
(- (window-lines-width (window-height window-lines)))))
(setq window-lines-with-extra-p (point-min))))
;;;###autoload
(defun window-select--top-to-bottom ()
"Select text at a leftmost window."
(interactive)
(cond
;; If window's top or bottom positions are displayed, then select.
;; As long as the window is shown in the window hierarchy.
(select-window (window-left windows-lineup)))
;;;###autoload
(provide 'window)
;;; window.el ends here
<|endoftext|>;;; browse.el --- browse library for Emacs 21 (Hook)
;; Copyright (C) 2008-2019 Free Software Foundation, Inc.
;; Author: Martin Stoddard <msstoddard@gnu.org>
;; Keywords: GNU Emacs
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Commands for browsing the contents of buffer HOOK.
;;
;; This package makes simple commands for browsing the contents of a buffer. For example
======== SAMPLE 2 ========
to be the same as
;; ;; this one.
(if (save-excursion (bobp)
(re-search-forward "\\s *\\(\\w*;\\|\\s *\\)\\(\\w*\\|\\s *\\)"
nil t)
(goto-char (match-beginning 2))
(forward-line 1)
;; This is the end of the buffer.
(and (looking-at "[^>]*+\n") (1- (current-buffer))))))))
;; FIXME: Can't use this, but I hope this will be better.
(defun auto-re-search--find-all-words (search-backward list-start search-backward-point)
"Search all words matching a regexp with `auto-re-search'.
This returns all possible words in the current buffer, including regexp
words starting with `regexp' or the last match. Return t if there
is no match."
(setq search-backward-point (point))
(auto-re-search--find-all-words
search-backward list-start search-backward-point)
(save-excursion (forward-line 1) (forward-sentence 1) (point)))
(defun auto-re-search--forward-sexp (&optional stop-point)
"Go forward if searching for a line containing a regular expression.
If START-POINT is point, move forward if not.
If STOP-POINT is point, move backward if not."
(interactive "*")
(forward-line 1 (min search-backward-point t))))
(provide 'auto-re)
;;; auto-re.el ends here
<|endoftext|>;;; auto-search.el --- Autoload information
;; Copyright (C) 1999-2019 Free Software Foundation, Inc.
;; Author: David Gillespie <daveg@synaptics.com>
;; Maintainer: emacs-devel@gnu.org
;; Keywords: mail
;; Keywords: e mail, languages, e mail, regexp
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;; Commentary:
;;
;; This package provides a way to automatically recognize regexps and
;; keywords that are not in any of them, and generate the full
;; dictionary
;;
;; When the auto-re package is loaded, `auto-re' will see those word
;; names in the dictionary, but not those that look like they
;; are part of any of them. `auto-re-match-face' is
;; automatically generated when this variable is bound.
;; See `auto-re-match-help' for further help.
;;; Bugs:
;;
;;; Code:
(require 'comint)
(require 'autoload)
;;;###autoload (autoload 'auto-search-find-all-words "search" "\
Run the autoload in Emacs buffer and search for a word that's in the search
book.
(defgroup auto-re nil
"Autoload information about a word or regexp.")
;;;###autoload (autoload 'auto-search "find-all" "\
For all words of the searchbook, find a word beginning in the search
history.
Here
======== SAMPLE 3 ========
to the file name, and the path to a local file.
If the user wants `nfs-backup-directory', just do the following code:
;; `gnus-backup-directory', if non-nil.
;;
;; Also, use nfs-find a local file with a directory in it;
;; if you are using a remote file, do it. The directory is
;; called `nfs-directory'.
;;
;; For a particular system, NFS-backup-directory may be set to NFS_SYSTEM.
;;
;; You might want to set this variable in your init file:
;;
;; (add-to-init-file (&optional nfs-backup-directory) nfs-backup-directory)
;;
;; If you need to move files, change the NFS_SYSTEM parameter in
;; your system's `user-rc' (via `nfs-load-file-name').
;;
;; (if (not nfs-backup-directory)
;; (setq nfs-backup-directory local))
;;
;; Set `nfs-directory', if you want to store a temporary file in a temporary file
;; (i.e. a file not named fzipped).
;;
;; The user's preferred way to set it (other than via
;; `gnus-update-remote') is to put the file name to a temporary file
;; instead of just naming it, unless you are specifically making the file
;; local (e.g. with `gnus-update-remote' set to t).
;;
;; `user-rc' variable may also be a string. This string is used to specify
;; `custom-file-name' mode.
;;
;; The option `custom-file-name' does not take into account local
;; directories, unless the variable `user-rc' is specified and the mode
;; is specified. The option `user-rc' is a buffer-local setting of the file
;; name, so make the buffer buffer-local (unless it is already in
;; nfs-mode).
;;
;; The option `user-rc' may specify special characters, e.g. `:
;; (user-init-file).
;;
;; `custom-file-name' and `user-rc' may also be special characters. If
;; there are any, use the `custom-command' character to invoke the
;; command that specifies it.
;;
;; `custom-file-name' also determines whether the file is named
;; like `full-name', so set it to \\[custom-file-name] instead.
;;
;; `custom-file-name' and `user-rc' may also be special characters.
;; To enable them (with setting `custom-file-name', `custom-line-properties'
;; and `custom-line-separator'), invoke `custom-file-name'.
;;
;; `custom-line-properties' may also be one of the characters set by
;; `custom-line-properties' (see `custom-set-syntax-table').
;;
;; `custom-line-separator' and `user-rc' may also be special characters. There
;; may be additional characters.
;; `custom-line-properties' is intended to be used by `custom-file-name',
;; `custom-file-name' and `user-rc' to provide file names that are compatible
;; with any user defined file name name specified by the file.
;; Other file names like `fzipped' are excluded. See the
;; documentation of `custom-file-name' for more documentation.
;;
;; `custom-file-path' is also intended to be used by `custom-file-name',
;; `custom-line-properties' and `custom-line-separator' to provide file names that
;; are compatible with any file name name. See the
;; documentation of `custom-line-properties' for more documentation.
;; These files provide directories/caches/files/files/files/files/files/files/files/files/files/files/files/files/files/files/files/files/files for
;; files with non-standard directories; i.e. those which
;; contain external file names.
;; The variables `custom-file-names' are used to determine the default
;; name for `custom-file-name'. See the documentation of `custom-file-name'
;; for more details on how to specify custom file names.
;;
======== SAMPLE 4 ========
to run in the echo area; we are prompted to enter the buffer
and we need a prefix if it is not available; use \\[rc-beginning-of-message] or \\[rc-end-of-message] to turn off this.
This is a buffer local variable which is added to
`rc-start-point' with the current message's start-point.
The buffer is then set to the message name that `rfc2022-unescape-char'
consies and the value of `rc-start-point' is inserted into the message.
This causes one to be entered in a separate window and, after typing a prefix,
the value of `rfc2022-unescape-char' becomes available.
Regexp matching an escape character will cause this buffer to
change its message. To set this, set \"rc-start-point\" to the start-point
when `rfc2022-unescape-char' is nil.
Return nil if it is not an escape character, or a string of no escape.
The string will be sent to Emacs if it doesn't work."
(let ((regexp (if (equal prefix "") regexp regexp 1))
(cond
((member prefix rfc2022-unescape-char)
(setq regexp 'rc-parse-message)))
(rfc2022-unescape-char regexp))
(let* ((default-prefix-arg (point-min))
(default-line (current-buffer))
(rfc2022-local-string (save-excursion (rfc2022-normal-message
rfc2022-start-point)))))
(defun rfc2022-end-of-message ()
"Return t if the last Rfc2022 message on the message buffer can be viewed by the current Rfc2022 Emacs window."
;; A non-nil value will cause the rfc2022 window to not be visible
;; the framebuffer.
;; This is a buffer local variable.
;;
;; Return nil if it is not an escape character, or a string of no escape.
(if (> rfc2022-unescape-char 3)
(error "Rfc2022 can be seen by the `rfc2022-start-point' framebuffer"))
;; If there is one but none (e.g., an escape character or a string of no escape), then the default
;; Rfc2022 buffer will be read. This is so that if any of
;; `rc-parse-message' is encountered in the same buffer that Rfc2022 was read from),
;; `rc-parse-message' gets the text it wants (rather than being read).
;; This is so that when a `rc-parse-message' is encountered it does not
;; get read (as it would if the string of no escape were read to the current Rfc2022 buffer,
;; and instead gets sent to the current buffer). A Rfc2022 message is sent when
;; the following `rc-parse-message' text is shown in the message buffer. This message
;; should appear to appear in the message buffer before the current buffer.
;; This is for backwards compatibility and so is not affected by
;; `rc-mode' commands.
;; (rc-parse-message-buffer (save-excursion
;; (rfc2022-buffer)
;; (if (/= (save-excursion (rfc2022-buffer) 2)
;; (rfc2022-buffer-local-from))
;; r
"%file: samples-16600"
======== SAMPLE 1 ========
list"
:tag "Keymap for MQM"
:version "27"
:package-version '(1.2)))
(defun org-latex-latex-set-key-map (keymap)
"Set keymap for KEYMAP to PLACE-SYMBOL-SYMBOL."
(let ((keymap (make-symbol "Keymap")
(keymap-alist (mapcar 'org-latex-key-map-alist-alist keymap))))
(add-to-list 'org-latex-key-map-keymap keymap)
(org-locate-key-table org-latex-latex-region-keymap))
(org-latex-set-key-map (copy-keymap))
(org-latex--unmap-keymap (delete-keymap #'org-latex-unmap-keymap))
(org-latex-unbind-keymap keymap))
(defun org-latex-unbind-keymap (keys)
"Unbind KEYMAP in KEYMAP."
(if (org-latex-map-function-p keys)
(let ((keymap (make-symbol "Keymap"))
(keymap (make-symbol "Keymap..."))
(plist nil))
(org-latex--unmap-key-map keymap)
(remove-from-list 'org-latex-key-map keys)
(delete-region keys))
(when (and (not keys) (symbolp key))
(let ((localist (mapcar (org-element-at-point 'key-at))
(org-locate-key-table keys))
(loc-alist key)))
(org-latex--unbind-keymap keys)))
(defun org-latex--unmap-key-table (keymap)
"Remove KEYMAP with the table of the same key it's being bound in."
(let ((table (make-symbol "Keymap"))))
(org-locate-key-table org-latex-key-table table))
(let ((plist nil))
(org-latex--unbind-keymap keys)
(unbind-keymap (make-symbol "Keymap")))
(when org-latex-binding-table
(setq org-latex-binding-table
(copy-sequence org-latex-binding-table))
;; Set the table of keys in the map to the same key.
(org-latex--unbind-keymap keys)))
(defun org-latex--unbind-key (keymap)
"Remove the value of KEYMAP from the value of KEYMAP."
(let ((key (make-symbol "Keymap")))
(org-latex-binding-table key))
(defun org-latex-bind-key ()
(insert ";;;;;;;;")
(let ((loc (make-symbol "Keymap")))
(org-latex--unbind-key map)
(delete-region "q")
(delete-region "`[a-zA-Z\\]*'")
(insert symbol))
(insert (format ";;;;;;;;;; ")
" (org-latex--unbind-key key)))
;; Use the global value of key-at-point.
(let ((table (make-symbol "Key Map")))
(org-latex--unbind-keymap keys)))
(defun org-latex-unfold-key (key map)
"Undo binding of KEYMAP.
BINDING is a keymap mapping (with keywords as
======== SAMPLE 2 ========
list of functions which have their own function to call, see below.
`file-readable-p'
(defvar default-directory)
(defvar file-readable-p nil)
(defun files-find-file-name
(&optional file-var default-directory)
"Find the file being visited.
This function is called on a file being visited, unless it is nil."
(with-current-buffer (get-buffer-create " *Tests.*" nil t))
(let ((default-directory (file-name-directory default-directory)))
(when default-directory
(apply #'find-functions-function (directory-files-p default-directory)
"\n"))
(funcall file-directory file-var default-directory))
(defalias 'find-file-functions-function 'find-file-functions)
(define-error "find-file-function cannot find directory"
"File found in this program.
Useful for debugging and error codes, when this buffer was never made to use file-var.
Normally this function will not look into the
`inherited-from-functions' and, if any, its argument will be a function name.
Use this for debugging when the `file-var' variable was set."
;; FIXME: should we make the function name (which are
;; necessary for debugging a `compiled-file-truename' function) into a string (which
;; would be a lot simpler? This function needs to be recognized by
;; the user).
(while files-found
(with-temp-buffer
(dired-buffer (if (not (buffer-file-name-directory)) ;File is already visited with buffer
(setq files-found-buffer)
file-var)))
(unless files-found-buffer
;; Do the right thing and keep the `file-var' variable.
(when (and files-found-buffer (not (buffer-file-name-directory)))
(buffer-disable-undo
(or (find-buffer-visiting files-found-buffer)
(find-file-name-no-properties))))
((setq files-found-buffer (buffer-file-name))
(if (or (stringp files-found-buffer)
(and (file-exists-p file-var)
(ignore-errors
(string-equal files-found-buffer nil))))
(funcall files-found-buffer "Find/Find/Find" nil t))))
(while files-found-buffer
(if (not (or (stringp files-found-buffer)
(files-find-file-name file-var default-directory))
(file-readable-p files-found-buffer))
(buffer-disable-undo files-found-buffer)))
(let ((default-file (make-temp-file
'("Locate")
files-found-buffer
auto-detection (not auto-detection))
pred-file)
(with-current-buffer (find-file-name default-directory)
;; If we have found one of these, and the default file is not a file.
(delete-file (expand-file-name default-
======== SAMPLE 3 ========
list is an object for the
;; definition of `gnus-agent-mode', `gnus-agent-mode-alist', and `gnus-agent-mode'. If the
;; object is for the mode, it is put into the mode list specified in
;; `gnus-agent-mode-alist'.
;;
;; These elements are taken from `gnus-agent-mode-alist'.
(gnus-agent-mode-add-alist mode-1: gnus-agent-mode-alist'
type 'if
'("" "nil" "nil") ; default for the agent.
'("No" nil ; default for gnus
gnus-agent-mode-alist)
article
;; The following element is the basic article in `gnus-agent-mode'.
;; This article is used in gnus-agent-mode. This is probably a
;; obsolete article.
;; This list of articles is a list of gnus-agent-mode articles
;; and any articles with `gnus-agent-mode-alist'.
(append (gnus-agent-mode-articles gnus-agent-mode-alist)
(cons (nreverse article) '((nil nil , t nil))))
list
article)
(defun gnus-agent-get-group-function (gnus-agent)
"Return a function for using Gnus in the agent configuration.
FN is the name of the agent, and GND is the generic string.
This function may also be called from gnus-agent.el, which uses the
gnus-agent.el file. This article will be put into Gnus on
gnus-agent.el."
(interactive
(gnus-agent--with-directory gnus-agent-group-path "gnus")
(if (and gnus-agent-agent-directory (not (file-readable-directory
(expand-file-name gnus-agent-group-path))
(gnus-agent-user-login-name))
'gnus-agent
nil
(let ((dir gnus-agent-directory)
gnus-agent-group-alist)
;; If gnus-agent-directory has a directory to its name, we must use
;; gnus-agent-directory-alist.
(if (string-match "\\`\\(?:agent\\|group\\|user\\|group\\)?\\`\\(?:" gnus-agent-group-path)
(regexp-quote gnus-agent-group-path))
(setq gnus-agent-group-alist
(cons (string-to-number (file-directory-p server))
gnus-agent-group-alist))
;; if the server is a machine, we don't use the
;; generic string.
(gnus-agent-server-accept-source
(format "agent=%s" type
gnus-agent-group-name
(file-attribute-modification-time
======== SAMPLE 4 ========
list (if (eq (nth 2 a) i-next-item) nil n-next-item
(car c)
(setq n-next-item (cdr c)))
;; The end of the list is not there.
(while (and (equal (nth 3 a) "nil") (setq c-next-item (nth 3 a)))
(setq a (nth 2 a)))
(setq c-next-item
(nconc a (1- n-next-item) b-append))
(goto-char c)
(while (and (< (+ i-next-item c-prev-item) i-next-item)
(not (assoc (car a) '((nil (nil ,(car a)))))
(set c-prev-item (nth 3 a)))
(setq c-prev-item nil))))
(setq i-next-item i-next-item)
(setq c-prev-item (nthcdr i-next-item)
next-next-item c-prev-item)
(while next-item
(setq i-next-item
(if (car next-item)
(car next-next-item) nil
(car (nthcdr i-next-item)))
(setq i-next-item (car next-item))
(and (eq (car next-next-item) 'string) (car next-item)))
;; We were looking for the next item and we could not find it
(funcall (nth 1 next-next-item) c-prev-item nil)))
(and (natnump a-prev-item)
(< (length a-prev-item) i-prev-item-list))
(while (< i-next-item-start-end-marker-count t)
(setq i-prev-item-start-end-marker-count
(1- i-prev-item-start-end-marker-count)
(if (equal n-next-prev-item a-prev-item-list)
;; It is not in the first element of this list, it is
;; there.
(assoc next-prev-item a-prev-item-list)))
(funcall (nth 1 next-prev-item) a-prev-item i-next-item-list)))
(setq i-prev-item-start-end-marker-
"%file: samples-16500"
======== SAMPLE 1 ========
\" ; We must not insert the character
(setq string (if (cdr (assq 'char-position (cdr item) (assq 'char-position
string))
string))
string-pos
; The string that points
; to the left of the first column.
)))
)
(let ((pos (point))
(old-char (car item))
(pos (cdr item)) ; This contains nothing before the newline.
(new-char (car item)) ; Same as above, but we need to wait
; in cases when it has already been
; inserted.
,(cons pos
(cons old-char nil)))))
(setq old-char nil)
(unless (memq 'string-pos old-char-char-table-alist-alist)
(progn t)))
(setq pos (point)))
======== SAMPLE 2 ========
\"
(cond
;;
((eq (car-safe (cdr-safe t)) 'lambda)
(setq idlwave-current-task t))
((and (assoc-default (car idlwave-current-task))
(memq idlwave-current-task-idles '(t 1)))
(setq idlwave-current-task-idles '(t 1))
'lambda
;;
((and (assoc-default (car idlwave-current-task-idles))
(memq idlwave-current-task-idles '(0 1)))
(let (task-id)
(while (and task-idles found)
(setq idlwave-current-task-idles t)
(setq idlwave-current-task-idles t))))
;; Don't touch the lambda if it does not occur.
(let ((task-id (car idlwave-current-task-idles))))
;; Make sure we have an idlwave-task-idles binding bound.
(idlwave-setup-idles-key-map
(let ((idl-current-task-idles nil))))
;; Update task idles in the current task.
(setq idlwave-current-task-idles 0)
(idlwave-update-task-idles))))
))
(defun idlwave-setup-idles-key-map ()
;; update the idlwave-table-function-alist of the idlwave-task-idles list.
(let ((key-idl-table '((idl-current-task-idles-seq . "t")))
(key-idl-table nil))
(set (make-local-variable 'idlwave-task-idles-seq) idlwave-task-idles-seq)
(add-to-list 'dired-current-task-idles-seq key-idl-table)
(when idlwave-task-idles-seq
(when idlwave-task-idles-seq-seq nil)
(when idlwave-task-idles-seq-map (let ((key-idl-class (idlwave-task-idles-seq-seq idlwave-current-task-idles)))
(idlwave-task-ids key-idl-class idlwave-task-idles-seq)))
;; If it's a task, do things.
(when idlwave-task-idles-seq-map-for-idlwave-job (put idlwave-task-idles-seq-map 'face 'red))
(when idlwave-task-idles-seq-map-for-idlwave-idlestack
======== SAMPLE 3 ========
\"\\S-+\\)"))
(cons "")
(gid (read-string "Identity for :%s. Type \"%s\" \"\"\\s-+\"\") org-id)
(name (completing-read "Name of :%s. Type \"%s\" \" \"\"\\s-+\"\") org-id)
(type (insert "[[:blank:]]+" type)))))))
(if (and org-babel-get-identity org-babel-identity-types)
(if (and org-babel-identity-types "identity")
(progn (dolist (elt org-babel-identity-types)
(let ((identity (or (cons 'coding-system-type identity-type)
(coding-system-equal org-identity-type)
identity))))
;; Only check if this is the IDentity type.
(org-entry-get-key-identity table org-identity-types))
(set-marker org-babel-identity-type nil org-babel-identity-types))
(set-marker org-babel-identity-type nil))))
(defun org-get-id-entity-type (entity type field &optional type pred)
"Convert TYPE in a list into a TYPE field in START if TID is non-nil.
The value for START is the position after which TYPE should receive TYPE."
(cond
((memq type '(?q ?r ?t nil))
(or pred
(let ((type (org-id-type-base-to-entity entity type)))
(and type
(cons (org-element-property :value type) type))))
(org-identity-to-field type type field info)
(org-babel-set-identity-type type field type 'nil)
(format "%s:%s" type info)
(goto-char (org-at-table-head entity-type field)))
(defun org-identity-to-field-type (_type field info)
"Convert TYPE in a list into a TYPE field in START if START is nil.
The value for START is the position of START and what type that is.
If START is nil, convert START to a string if it is non-nil.
The value is the position of the field field."
(let ((type (org-id-type-base-to-field type field info)))
(if type
(or pred
(if (eq (car type) 'type) "" nil "")
(and pred
(cons " " type))) ; no match
(let ((type (org-element-property :type type info))
(type (member type types))
(typeinfo (or type (org-identity-type type info))
======== SAMPLE 4 ========
\" (or type 'pgg-message-filter-list
;; If the prefix of this message doesn't specify or the
;; value is not specified, we want to search in the
;; message instead.
(let ((name (format "%s-new mail %s" type
"")
message-prefix-alist)
(mapc (function (lambda (x)
(let ((s (concat mail-header-name x))))
(if (stringp s)
(cond
((stringf x) s)
(t (car s))
((stringf x)
(let ((s (concat mail-header-name x)))
(t (car s)))))))
(t (cdr s)))))
(t (cdr s))))))))
(defun pgg-message-filter-message ()
(format "%s"
(cond
((consp pgg-message-filter-list)
(pgg-delete-all-headers (car pgg-message-filter) nil t))
((listp pgg-message-filter-list)
(delete-region pgg-message-filter-list nil nil t))
((and (consp pgg-message-filter-list)
(listp pgg-message-filter-list)
(equal (car pgg-message-filter-list
"%file: samples-16400"
======== SAMPLE 1 ========
(mapcar (lambda (x) (string-match x (cl-case x (+ (length x) (length x)))
(string-match (match-string 4 x) (match-string 17 x))
(string-match (match-string 1 x)
(match-string 0 x)))
(cl-do-notation)))
(if (not (eq (setq old-lineage (length old-lineage)) 'old))
;; Use the old lineage.
(setq lineage (1- old-lineage)))
(error "Maintainer: Invalid lineage for %s"
lineage))
(setq old-lineage (current-current-lineage)))
(setq old-lineage (save-excursion
(and old-lineage (not (get-text-property)))
(and (eq old-lineage 'newlineage) (not (eq old-lineage 'old))))
(and new-lineage (not (eq old-lineage 'old))))
(cl-incf lineage)
(while (< lineage old-lineage)
(and (equal old-lineage (current-current-lineage) lineage)
(setq old-lineage (substring lineage 0
(1+ old-lineage))
(or (eq old-lineage 'old-lineage)
(eq (car lineage)
(number-to-string old-lineage))))
(message "(Maintainer: Invalid lineage for %s")
(if (or (setq lineage old-lineage)
(> (car lineage) lineage)))
(progn
(setq old-lineage (current-current-lineage))))
;; Find newlineage.
(if old-lineage
(progn
(setq lineage (if old-lineage (1+ old-lineage))
======== SAMPLE 2 ========
(or isinstance (car t)
;; A function which calls `set', as opposed to
;; `set-apply', can do a lot more than just return value
;; which is actually the only function which does not call
;; `set-apply' (see below).
(and (numberp (car type) (car type))
(not (nth 1 (car type)))
(and (eq ctype 'type)
(apply-on-the-fly (car type) nil t)))))))
(defvar set-apply-on-the-fly nil
"On the fly where the function can be called with some `set' properties.
The properties are those for which `set-apply' is called.")
(defun set-apply-on-the-fly (prop list &optional _ignore)
(let ((value (car list))
(value-type (cadr list))
(value-apply (make-symbol 'apply-on-the-fly prop list)))
(condition-case (and value-type
(cl-every (cl-dolist (:type (list prop nil)) :value 'value
(or (not (y-or-n-p
(apply :value prop))))))
(value-apply-on-the-fly (apply prop)))))
(prog1 (setq prop list) (setq list (cons list prop)))
(goto-char (setq prop (car list)) (point-min))))
(defvar set-apply-on-the-fly-p nil
"Controls what the value-processing routine should do when a value is applied.
Normally called before a function has performed a value-initialization
before starting `set-apply-on-the-fly', so that we don't call it.
It's useful while a value-initialization function
has executed a value-initialization function and is called.
It would be nice if we could do it on each call and then use it only
when `set-apply' would return an error. As set-apply only does this when
value processing is not called, it's also good if set-apply-initializes
the value before we're called."
:type 'set
:group 'makefile)
(defun set-apply-on-the-fly (prop-list &optional _ignore)
(if (assq arg prop-name)
(if (eq prop-type 'value)
(if (eq prop-value 'copy)
(with-temp-buffer
(goto-char (point-min))
(eq prop-value 'value))
(if (equal (aref prop-value (point))))
(setq arg
(and (not (eq prop-value 'value))
(apply prop-value prop-name))))
(when (or val list)
======== SAMPLE 3 ========
(goto-char (mark t))
(re-search-backward
(concat "^\\(\\(\\(\\|\\\\\\)\\)\\(\\|\\|\\)\\)?\\(\\) *\\($\\):"
"[ \t\n\r]*\\(\
\(^\\(\*\\)$\\)\\)?\\([a-zA-Z0-9]\\|[ \t\n\r]*\\(\
$:/)\\^:[ \t\n\r]+\\([a-zA-Z]\\)\
+ "
(let ((f (match-beginning 1))
(inhibit-read-only t))
"*")
"^")))
(defun mail-goto-region (start end &optional force)
"Find the region starting on start of point and return the region.
The optional argument FORCE is a condition bound to t, otherwise return the
point on which the goto command performed."
(interactive
(let ((region-start
;; Make sure we don't stop point on a newline
(point)))
(save-match-data
(if (re-search-forward region-end end) (point-at-eol) t))
(save-excursion
;; Skip forward over the current region.
(if (re-search-forward (match-beginning 0)
end t)
(setq start (match-beginning 0))
(forward-line)
(skip-chars-backward (substring start 0)))))
"")
;; Skip past the point at the end of the previous region.
(let ((start (point)))
(skip-chars-forward
(progn
(skip-chars-backward start)
(skip-chars-backward start)
(progn
(if (re-search-forward
(concat "^\\(\\|\\\\\\)\\(\\|\\|\\\\\\) *\\(")
"\\(.*\n")
"\\(.*\n\\)?$\\)")
(goto-char (match-end 1))
(re-search-forward (concat "^\\(.*\\)") start t)
t))))))
;; Skip past the end of the previous line...
(skip-chars-forward
(backward-char))
;; Skip past the beginning of the current line.
(skip-chars-backward (1- start)))
;; Skip past the end of the preceding line.
(skip-chars-backward (1- start)))
(defun mail-skip-word ()
"Skip to the most recent word as it appears in this buffer."
(interactive)
(if (save-excursion
(backward-char 1)
(re-search-backward
(concat "^\\([ \t]+[ \t]+\\)'[ \t]*\\([^\t]+\\)"
======== SAMPLE 4 ========
(if (eieio-object-get-children
children end
children)
end (or end (point-max))))
(throw 'found found))
(and (progn
(goto-char (point-min))
(when (c-go-to-object-body-p)
(goto-char (point-min))))
(and (c-go-to-object-body-p)
found
(c-go-to-obj)))))
;; (defun c-go-to-object-body-p ()
;; "Go to the object's head. Return T if there is no head."
;; (let ((obj (assoc-string (get-byte-sequence obj)
;; '(nil nil (c-go-to-object-body-p)
;; nil (c-go-to-head obj)
;; 0)
;; nil))))
(defun c-go-to-obj ()
"Go to the object's head. Return T if there is no head."
;; (let ((obj (assoc-string (get-byte-sequence obj)
;; '(nil nil (c-go-to-obj-head obj)
;; 0)
;; nil (c-go-to-head obj)
;; 0)))
(defun c-go-to-obj-head ()
"Go to the object's head, return nil if there is no head."
;; (if (not (c-go-to-obj-head-p))
;; nil
;; (error "obj %s" (or (car obj) (c-go-to-obj-head)))))
(defun c-go-to-obj-head-p ()
"Go to the object's head. Return N if there is no head."
; (let (obj)
(while (and (c-go-to-head-p)
(or (= 0 (c-go-to-body-p)))
(eieio-object-get-children
(c-go-to-obj-head obj) nil)))
(cond
((eq c-go-to-obj-head obj) nil)
((eq c-go-to-obj-head-p nil)
; nil)
((eq (car-safe (caar obj) '*) nil)
; (setcar obj (* (car obj)))
; ((eq nil 'c-go-to-obj-head-p) nil
"%file: samples-16300"
======== SAMPLE 1 ========
(line-height))
(setq ctl (cdr ctl))))))
(mapc 'cdr ctl)
(let ((p1 (assoc l2 ctl))
(p2 (assoc l3 ctl))))
(mapc 'cdr ctl)
;; Convert the symbol vector to a single byte-compiler type name
(unless (fboundp 'decode-coding)
(let* ((c (pop alist))))
(setcdr c (cons (intern-soft p1) (intern-soft p2))
(decode-coding (intern-soft ctl) (intern-soft p1)))
(define-coding-table ctl encoding)
;; Set the coding mode according to the type name,
;; so that ctl can be used as a decoder for any coding-language.
;; This needs to be done for `macro-mode' (which see) and
;; `coding-environment-alist'.
(setq encoding '(encode-coding (quote opcomp opcode)))))
(map-let ((coding-name coding-mode)
(key (downcase coding-function))
(lisp-indent-function coding-function))
(while coding-name
(setq coding-mode (make-local-variable coding-mode)
coding-mode (make-local-variable key-spec coding-mode))
(setq coding-mode (or coding-mode (cdr coding-mode)))
(setq key-spec key-spec))
(while (setq coding-mode (setq coding-mode coding-mode key-spec))
(setq key-spec nil)
(setq key-spec encoding-name coding-code-environment-alist)
(if coding-mode
(progn
(define-coding-system coding-mode
coding-function coding-environment-alist)
(define-coding-options coding-mode
ctl '((coding-priority . 5)
(defaults-default . 3)
(no-decoding-trailing-whitespace nil)
(default-safe nil))
[(regexp)))
;; This variable needs to be set at the time this command comes
(setq coding-mode 'encode)
(setq coding-code-environment-alist (delq nil coding-code-environment-alist)
coding-code-environment-alist 'list)))
(map-let ((key (downcase coding-function))
(type (key-type coding-function)))
(when
======== SAMPLE 2 ========
(1- (log 2 (math-div (log 2 (mh-mh-vec 0))))))
(x (nth 1 x) (point-marker)))))
((setq x (mh-vec-intvp c-neg (1+ c-neg)))
x)))
(calc-do-recommodate x)
(t
;; Set the vector's first element to c-neg.
(setq x (progn
(mh-vec-intvp c-neg (1+ c-neg))
(mh-mh-vec x (math-pow (point) (1+ (/ 2 x))))))
x))
(defun mh-mh-vector (x)
"Vector to use for input vector X (i.e., vector whose index is equal to
min (X). This vector should be either a vector of index 0 or a
vector whose index is equal to min (X). This is only meaningful if
vector n is 0, and the vector is 0. "
(let ((m (if (Math-integerp (nth 1 x))
(if (= m -1) (nth 1 x) x))))
(w (mh-mh-vec (if (nth 2 x)
(+ m -1) (if (= m -2) (if (= m -3) x)))))))
(or w (error "No mh vectors except min")))
(defun mh-mh-vector-index (x)
"Vector of index x found in matrix X."
(let* ((max (or max 0))
x)
(while (setq x (cond ("A"
(mh-mh-vec-intvp (1- x))
(< x max)))
(and (> max mh-mh-vector-index-1)
(> max mh-mh-vector-index-1)
(> mh-mh-vec-intvp-1 (1+ max))))
(setq max (car w)
x (mh-vec-intvp c-neg c-neg)))
(while (> max max)
(setq max (+ w max)
x (+ max x)))
(while (> max max)
(setq max (- max x))
(cond ((and (<= max max) (cons '+ max)))
((and (nth 1 x) (= mh-mh-index-1 1)))
(cons '+ x))))))
(defun mh-mh-vector-indexed (x)
"Indexed vector for matrix X in matrix C."
(let* ((min (or max 0))
(max (or max -1))
(x (mh-vec-intvp (1+ x)))))
(math-div (math-mul max min))
(and (> min max) 0)))
(defun mh-vector-indexed-min (x)
"Indexed vector for matrix X in matrix C."
(let ((min (or max 0))
(max (or max 1))))
(if
======== SAMPLE 3 ========
(with-current-buffer (erc-find-match-regexp org-match-regexp target))
(goto-char (point-max))
(while (and (not (get-text-property target '(1 2)))
(while (re-search-forward "^@" nil t)
(setq- (read (current-buffer)))
(forward-line 1)
(setq- (point)))
(point)))
(not (looking-at "[ \t]"))
(with-current-buffer (erc-find-match-regexp org-match-regexp target))
(goto-char (point-max))
(while (and (not (get-text-property target '(1 2)))
(while (re-search-forward "^" nil t)
(setq- (read (current-buffer)))
(forward-line 1)
(setq- (point)
'no-match))))))
;; if this is a match: return anything
(prog2 (goto-char (point-max))
(replace-match (current-buffer))))))))))))
(defun org-match-regexp-no-match ()
"Non-nil if there is no match.
If nil, then only matches the matchable file.
This function may return a regexp only if the file
are matched by searching for a match for more than one line
of a regexp. It may search for any match of itself as
similar as a full string matching file. Note that this
is not guaranteed to be correct for all file types; most
file types will be correct for one type."
(when (string-match-p org-match-regexp)
(ignore-errors
(if (match-string 2 org-match-regexp)
(match-string 1 org-match-regexp)
(match-string 1 (string-to-number org-match-regexp))))))
(defun org-match-match-ignore ()
"Ignore the matching file."
(ignore-errors
(ignore-region (point)
======== SAMPLE 4 ========
(file-name-as-directory dir)
(file-remote-p dir)))
(t (gnus-info-file-name
(directory-file-name dir)))
(gnus-message 1
(format "%s - %s" file-name-directory dir)))))))))
(defun gnus-info-load-article-at-point (&optional pos)
"Return t if current article is loaded at POS relative to BOOKER.
Passes POS to the file name (or nil if empty), as a single argument.
If optional optional-prefix argument POS is non-nil, POS
is treated differently from the prefix argument. That is, if
POS, POS is treated equal or greater than the file name after point,
and point is at the same point as that file.
If at least one directory is present, the file is visited.
If at least two arguments are provided (one relative and a
directive), it is used if there are no files to find.
If no explicit value follows the normal \"find\" command, this is a good one;
if there's more than one directory, this is a bad one.
If optional-prefix argument POS is non-nil, the prefix argument
is treated as \"in\", and the `^' means to quote the prefix argument
arguments in the first column of `gnus-article-search-function'."
(interactive
"r\nP")
(if pos
(gnus-message 1 "From %s; using %s. Posting."
(format "Archiving article: %s%s (Archived %s)\n"
(line-to-string (org-trim (current-line)))))))
(if (or (and (> pos 0)
(not (equal (symbol-name (org-trim (substring pos (1 - pos)) 1)))
(file-expand-file-name
(car-safe (last-non-interactive-frame t)))
org-trim (symbol-value org-trim)))
(not (org-trim
(list "Archived" ""))))
(message "Archiving article (Archived article): %s%s %s"
org-trim (split-string org-trim)
(if first
;; Use `find' for a proper match.
"Archived")
;; Try to ignore the argument used by the first `find'.
(if first
(mapc (lambda (v)
(let* ((last-non-interactive-frame t)
(archive-alist v)
(archive-data v))
(archive-last-file (save-excursion
"%file: samples-16200"
======== SAMPLE 1 ========
(setq-local mode-line-format filename)
files-directory)))
((setq modes-alist '((,file ,mode-line-format ) file)
files-directory))
((setq modes-alist '((,file ,mode-line-format ,files-directory-directory)) files-directory)
;; Do the files-directory-files and files-directory-files
t)
((or (not files-directory-files)
(null modes-alist))
(setq t
(lambda ()
(setq mode-line-format
files-directory-files)
(cond ((null files-directory-files)
; File's name is already present in the buffer, and it's
; an empty list.
(delete-file files-directory-files)))
((not modes-alist))
((string= file "")
(file-name-nondirectory filename)
(setq files-directory-files
(delq files-directory-files
files-directory-files)
nil))
;; Don't count the first file; put it into the same buffer as
;; the files-directory-files.
(setq files-directory-files
(delq files-directory-files
files-directory-files)
;; Get the file's full file name and the directory
;; file-name-nondirectory for it
;; Note: If the file's file-name and directory-file
;; names don't match, Emacs will do the same
;; if its directory and file-name does.
(while (not files-directory-files)
(setq files-directory-files (delq files-directory-files
files-directory-files)
======== SAMPLE 2 ========
(setq idlwave-interactive "Jump to current line")
(and (looking-at "\\[\\([1-9][0-7][0-90][0-9][0-9]\\)\\([-+]\\)[[0-9][0-9][0-9]\\)\\([1-9][0-9][0-9]\\)[\n]+\\([0-9]+\\)"
(1- (match-string-no-properties 1)))))
(when (or (not idlwave-auto-jump-to-line) (idlwave-auto-update-current-block-current-line-interval))
(setq idle-state nil)
(if (> n 0)
(throw 'idlwave-auto-jump-to-line nil t t t nil))
(setq idlwave-start-point-function
function idlwave-auto-jump-to-line-function
function idlwave-auto-jump-to-line
function idlwave-auto-jump-to-line-interval
(or (string= idlwave-auto-jump-to-line-interval idlwave-auto-jump-to-line-current-line-interval)
(string= idlwave-auto-jump-to-line-interval idlwave-auto-jump-to-line-current-line-interval)))
(setq idlwave-start-point-function
function (list idlwave-auto-jump-to-lines-at-point))))))
(insert "\\[?[-a-zA-Za-z_]\\(?\\(?:[[:digit:]()-[:digit:]]\\)?\\([a-zA-Z0-9_]+\\)?")
idle-state)
;; Get the current block, if we have one.
(idlwave-loop for line idlwave-start-point-function
(if idle-state
(setq idlwave-next-line idlwave-start-point-interval)
(while (< line idlwave-line-start-point-interval)
;; This is a repeat clause block where the lines are
;; inserted before the start of line.
(setq idlwave-end-line (if (< idlwave-line-line-start-point-interval (1- idlwave-line-line-line-line-int))))))
idlwave-line-line-int)))
(while idle-state
(unless idle-state
(setq idlwave-next-line idlwave-start-point-interval)
(setq idlwave
======== SAMPLE 3 ========
;; This is the `progn' argument.
(if (math-vectorp exp (cdr elt)))
'progn
(if (= 1 (length edt))))
(setq idx (format "%d:%d" idx idx)))
(format "\n\
\n %s\n" idx idx))))))
(defun math-cite-preprint (form &rest args)
"Convert a number from a vector to a string or binary number.
FORM is the string or argument to format.
ARGS is just a cons cell with an argument, and should be a list
of numbers. Return form."
(list 'vector 'integer
'float
'const 'double
'integer
'const 'double
'float
`(lambda (a ,b)
(math-cite-insert-number c a b)
(math-cite-insert-number a a b))
`(lambda (a ,b)
(if (equal (or a b) 'float)
(cons (if (integerp arg)
(car arg)
(math-trunc a b))))))
;;;###autoload
(defun math-cite-print (form)
"Print this number together with a number in a list.
FORM is a list of integers. Return form."
(list 'integer
'float
'integer-or-integer
'float-or-float
'integer-or-integer)))
(defun math-cite-precision (form &rest args)
"Convert a number from a vector to a string or binary number.
FORM is the string or argument to format.
ARGS is just a cons cell with an argument, and should be a list
of numbers. Return form."
(list 'vector 'integer
'float
'integer-or-integer
'float-or-integer
'float
'float-or-float
'float-or-float
'float-or-float
'float-or-float
'float-or-float
'float-or-float
'float-or-float
'float-or-float
'float (calcFunc-normalize
(apply #'math-cite-precision 1
(list 'float))))))
(defun math-cite-invert-vector (form &rest args)
"Convert a number from a number using the vector SICLARGE-INDEX.
FORM is `vector', and `vector-or-vector' are the vectors of integers.
ARGS is just a cons cell with an argument, and should be a list
of integers. Return form."
(list 'vector
'float
'float-or-float
'float-or-float
'vector-or-vector
'float-
======== SAMPLE 4 ========
(concat " *") "")))
(defgroup edt-insert-prettify nil
"Indentation of comments."
:group 'edt-insert-comment)
(defgroup edt-insert-skip nil
"Indentation of comments."
:group 'edt-insert-comment)
(defgroup edt-insert-commenting nil
"Comments in comment buffer."
:group 'edt-insert-comment)
(defgroup edt-insert-mark-list nil
"Mark up to `start': `start' and `end': `end' lines."
:group 'edt-insert-commenting)
(defgroup edt-insert-newline nil
"Inserts newline."
:group 'edt-insert
:version "20"
:package-version '(Org . "8.0")
:type 'string)
(defgroup edt-insert-non-unnecessary nil
"Non-unnecessary comments."
:group 'edt-insert)
(defcustom edt-insert-after-commenter-in-face '(;;; END = " *")
"Face for user-defining comments.
This faces is needed to distinguish good vs. bad comments.
Some users see user-defining comment styles as "bad" if they use any of the following
- if the user doesn't have multiple comments at all:
+ +
- `comment-start'
This faces is needed to distinguish good comments
This faces is also needed to distinguish bad comments.
This face is also used to recognize new comments."
)
(defcustom edt-insert-other-window-other t
"Non-nil means Emacs insert other window on display."
:type 'boolean
:version "20"
:group 'edt-insert-other-windows)
(defcustom edt-insert-comment-backward-1 nil
"Non-nil means insert backward and forward comments.
This is needed if point and mouse click are used.
If the user inserts the comments backward from a window,
the user is not prompted if they want to undo or push to undo."
:type 'boolean)
(defgroup edt-insert-non-unnecessary nil
"Non-unnecessary new comments."
:group 'edt-insert
:type 'string)
(defcustom edt-insert-sub-start-regexp '("/"))
(defcustom edt-insert-post-post-string "\"\\`.*$")
(defgroup edt-insert-commenting-fun nil
"Functions for putting newline comments in comments buffer."
:tag "Emacs comments buffer"
:type 'string)
(defgroup edt-insert-commenting-fun-at-point nil
"Functions for putting newline comments at point."
:tag "Emacs comments buffer"
:type '(radio (function :tag "Argument"))
:version "20")
;; This is an additional variable for XEmacs mode to make it easy to edit it
(defcustom edt-insert-extra-sub-end-regexp '("\"\\`\\|\\(.*\\|\\)"))
(defcustom edt-insert-extra-sub-end-regexp '("\"\\\\[\\]"))
(defvar edt-insert-extra-sub-end-regexp-1 nil
"Regexp used to parse newline comments.
This is necessary for XEmacs mode to make it easy to edit. See `edt-insert-custom-substrings'
for more.")
(defcustom edt-insert-extra-sub-end-regexp-1 edt-post-post-string "\"\\\\[\\]"
"Regexp used to parse newline comments.
This is necessary for XEmacs mode to make it easy to edit. See `edt-insert-custom-substrings'
for more.")
(defcustom edt-insert-extra-sub-end-regexp-2 ""
"Regexp used to parse newline comments.
This is necessary for XEmacs mode to make it easy to edit.
See `edt-insert-custom-substrings'
for more.")
"%file: samples-16100"
======== SAMPLE 1 ========
'font-lock-type 'font-lock-variable-name)
(if (equal (list '((bold-mode 'face "bold-mode:"))))
(string-match "[%C]" font-lock-default-name))))
(substring font-lock-default-name 1)))))
(cl-defmethod org-babel-babel-bovinate-conversion-fun ((ob class ...) &optional n))
(cl-defmethod org-babel-bovinate-conversion-function ((ob class ...) ...) fun)
(c-lang-defconst org-babel-bovinate-conversion-func nil)
(c-lang-defvar org-babel-bovinate-conversion-func (lambda () fun))
(cl-defmethod org-babel-bovinate-conversion-function ((ob class ... 'boolean))
"Return FUNC function of OB CLASS."
(and n (lambda (op)
(if (funcall ob class) ob
(funcall (intern (car ob)
(if (org-babel-current-class)
(org-babel-get-ob 'ob class)))))))))
(cl-defmethod org-babel-bovinate-conversion-fun ((ob class ...) function)
"Return FUNC function of OB CLASS."
(let* ((result (plist-get (nth 1 (if (org-babel-compile-form
'babel-compile-form
(nth 2 (org-babel-bovinate-current-class))))))
;; Make a function, if there are any :
;; which do not contain a :! (with no symbol)
(lambda (op)
(funcall op (concat (car op)))
(lambda (op)
(let ((case-fold-search t))
(setq result (append result (delq ob ob)))))
(cl-typep result))))))
(cl-defmacro org-babel-find-computed-variables-by-class (name)
`(let ((class ,(org-babel-current-class)))
((= (length name) 0) (concat name :style "org-babel-bovinate-conversion"))
(table (plist-get (nth 1 name) class :property name) :visible (org-babel-get-ob :style 'outline))))
(cl-defmethod org-babel-bovinate (name class))
(cl-defgeneric org-babel-bovinate-fun ((pred class ...) fun)
"Return FUNC function of CLASS."
(and n (lambda (op)
(if (funcall prop class)
(funcall (intern (car prop)) 'font-lock-type 'font-lock-variable
======== SAMPLE 2 ========
(if (not (zerop (length dndl-keywords))
(or csh-dcl-auto-index-array
(cl-const
(cl-const :inline #'((,name . "name")))))
dndl-index-array-function))
(let* ((l (cl-incf dndl-keywords-alist 1))
(key 1)))
(setq dndl-keywords 1)
(cl-loop for i = 0 in dndl-keywords-alist
for al in dndl-keywords-alist
if (cl-loop for name in dndl-keywords-alist
dndl-index
al)
(cl-loop
(lambda (s) (append
(if (cl-loop for t in dndl-keywords-alist
dndl-index
?/
name))
name))))
t))))
;; When the result is not a list, move it into a new file.
(setq dndl-keywords-alist
(dcl-copy-sub-keywords
dndl-keywords dndl-index-array
(progn (dcl-delete-match dndl-keywords-alist dndl-keywords))
(dcl-index-array-set t 0)))
(dcl-do-auto-index)))
;;; Search:
;; - `pr-search' will search for function arguments
;; - `pr-search-function', which searches for the first char in a
;; - `pr-search-function
======== SAMPLE 3 ========
t (cdr (if (listp x) x -1 -1))
(x-n (if (listp x) x -1 0)
(1- (setq x-n (1- (length y-coord)))
(setq x-n (1- (length y-coord)))
(push (list x-n) x-n)
(nreverse x-n))))
(defvar x-coord-1
(x-coord-2 "X")
`(let ((y-coord-1 (nthcdr 5 (length y-coord)))
(z-coord-1 (nthcdr 5 (length z-coord)))
(coord-1 (nthcdr 3 (length x-coord)))
(coord-2 (nthcdr 1 (length x-coord)))
(coord-1 2 (nthcdr 1 (length x-coord))))
(while (and y-coord-1
(= y-coord-1 1))
(aset x-coord-1 z-coord-1 (match-end 0))
(setq z-coord-1 coord-1 z-coord-1)
(setq coord-1 x-coord-1 coord-1)
(setq coord-2 y-coord-2 coord-2 z-coord-2)
(let ((coord (x-coord-1 (nth 2 (get-text-property (1- (length y-coord)))
nil)))
(coord-1 (nth 1 (get-text-property (1- (length z-coord)))
nil)))
(aset coord-1 z-coord-1 (match-end 0))))
(if (consp coord-1))
(let* ((coord (x-coord-1 (nth 2 (get-text-property (1- coord)))
nil)))
(setq coord-1 y-coord-1 (1+ (nth 1 coord)))
(aset coord-2 z-coord-1 (1+ coord)))
(if x-coord-1
(cond ((setq y-coord-1 (car coord))
nil)
((>= (length y-coord-1) (length y-coord-1))
nil)
((>= (length z-coord-1) (length z-coord-1))
nil)
((= (length y-coord-2) (length z-coord-2))
nil)
((>= (length z-coord-2) (length z-coord-2))
nil)
((<= (length z-coord-2) (length z-coord-2))
nil)
((= (length z-coord-2) (length z-coord-2))
======== SAMPLE 4 ========
;; Don't use an alias.
(if (<= index end-point)
(setq index end-point))))) ; else just set end of list for now (set index index in-limit)
(and (and (string-match "[--<>" index)
(= (substring index 1) (match-beginning 0)))
;; If there is an index that can't be modified (i.e.
;; in-limit is set to zero) it doesn't need to be
;; set later, since we are done.
(setq here index)
;; We need to remove the end of the list
;; for the sake of consistency.
(progn
(setq index end-point
(setq index-index index))
(setq end-point index)
(setq index-limit index)
(setq index-limit index)
(setq index-limit index-index))
;; Set in-limit and then set index.
(if (< (= index end-point) 0)
(setq index-limit nil))
))
(save-restriction
(narrow-to-region start)
(goto-char (point-min))
;; FIXME we now hit a regexp!
(while (>= (point) index)
(let ((start-re (save-excursion (nth (match-beginning 0)
index
(point)))
(match-end 0))
(point)
(string-match "\n" end-re))))))
"%file: samples-16000"
======== SAMPLE 1 ========
uffer (point)
((string-match "\\(.*\\)*\\(.*\\)\\|[^\n]*.*\\)")
(let ((match (match-string 1))
(case-fold-search t))
(while (and (memq (match-string 2) (match-end 0))
(not beg)
beg)
(when (string-match "\\<.*$\\>" match)
(setq beg (match-beginning 1))
(while (let ((case-fold-search t))
(looking-at match)
(setq beg (match-beginning 1))))
(let ((inhibit-read-only t))
(setq beg (point))
(when (and (eq (point-max) (save-excursion
(skip-chars-backward "^ \t\n\r\f")
(point))
(zerop (skip-chars-backward " \t\n\r\f") t)))
(skip-chars-backward " \t\n\r\f"))
(when (zerop (skip-chars-backward " \r\f") t)
(setq beg t)
(while (re-search-forward "^\\(.*\\)\\|[^\n]*.*\\|[^\n]*.*"
end t))
(setq beg (match-end 0))))))))
(if (and no-x-p beg)
(setq beg (point))
(setq beg (or beg t t)))
(goto-char beg)
(while (and no-x-p (not (looking-at "^[ \t\n]+[^\n]+\\|$+\\|$+\\|$+\\|$+\\|$+\\|$-\\|$"))))
(setq no-x-p (nthcdr 1 beg))
(when (and beg (not beg))
(goto-char beg)
(if (< beg (nth beg beg)) (setq beg nil t)))
;; Do nothing if we're not in a block, because the block is
;; first in the buffer, and then on the first char, but we haven't just
;; entered a block.
(while (< beg (nth beg beg))
(when (member beg (nth 2 beg))
(setq beg (point)))
(setq beg (point)))))
;; The first char is in the block.
(setq beg (car beg))
(car beg))))
(defun rmail-copy-datal
======== SAMPLE 2 ========
uffer-string-from-file (list &optional first-command)
"List of file names to make from (string. *vars from) to file name.
If no file is found, return nil. The optional third arg
`tbl' sets this to an exact match."
(interactive (list last-command)))
(autoload 're-search-backward "res-browse" "\
Search for match in all previous windows back to the beginning of their
browse region.
The search order can be changed by `re-search-backward (or
\\[moveto-next-window]) or `re-search-forward (or
\\[moveto-previous-window]). If the match
begins on the first non-matching window of the two, it is
called with the leading space remaining.
If `scroll-down' is non-nil, `scroll-up'-move windows to previous
window's end instead of all-windows of the other window.
If `scroll-below' or `scroll-up-to-bottom' is non-nil, move backward by one window."
(interactive
(list last-command
(and (numberp last-command)
(equal (regexp-quote (window-system-p)) last-command))))
(setq window-width (1+ window-width))
(setq last-command 'scroll-windows))
;; This function may be renamed to reflect the `re-search-backward'
;; function.
;; We used to call this function with two arguments:
;; (window-system-p) - move to next window, not to previous or
;; (in the order in which windows are visited)
;; (re-search-backward 'scroll-windows '(window-width)))
(defun un-replace-all-windows-with-window (window)
"Delete all windows displaying WINDOW from the current buffer."
(cond ((numberp window-height)
(unless (bolp)
(when (get-buffer-window window)
;; In a non-default-window, window was narrowed.
(if window-win-height
(save-excursion
(unless (eq window-win-height t)
(if (or (not (eq window-win-height t)))
(goto-char window-win-height) (point-max)))
(window-start window)
(save-excursion
(sit-for 0))
(forward-window 0))
(set-window-buffer window)))))
(remove-overlay window (nth 2 windows))
(window-edges))
;; The following variable sets the `window-win-visible' property of the
;; buffer to nil, if it isn't already set in the buffer-local
;; value of `window-window-resize-function'.
(defcustom un-replace-all-windows-with-windows-only t
"Non-nil if windows should be replaced with windows.
Treat windows in the `window-window-resize-function' as if
`window-window-resize-function' had been set to `window-window-resize'.
If t, use an existing `window-window-resize-function' and
`window-window-resize-function'-function for windows to be replaced with windows
from windows to windows."
:group 'windows-resize
:type 'boolean
:set (
======== SAMPLE 3 ========
uffer-in-file "foo" nil t)
(defalias 'files 'files)
(defalias 'mode "default" 'mode-specific)
(if (memq system-type '(system/emulator windows))
;; (setq file (find-file-noselect file-name))
;; (goto-char (point-min))
;; (let ((pos (point-min))
;; (inhibit-read-only t))
;; ;; FIXME: Use GNU Emacs' manual of directories.
;; (unwind-protect
;; (progn
;; (force-mode-line-update)
;; (if (string-match "\n" file)
;; (setq pos (match-end 0))
;; (setq pos (1+ pos))
;; (if (string-match "\\$" file)
;; pos
;; (progn
;; (push pos files nil)
;; (push pos files))
;; (unwind-protect
;; (progn
;; (forward-list 1))
;; (push pos files nil)
;; (setq pos (1+ pos))))))
(save-buffer)))))
(defalias 'directory-file-name "default" 'dirname-nolong)
(defalias 'file-directory-nolong-n-or-not-n-or-not 'nolong)
(defalias 'directory-file-nolong-n-or-not 'nolong)
(defalias 'file-directory-file-name "default" 'filenobox)
(defalias 'file-directory-file-name "default" 'filetype-nolong)
(defalias 'dir-directory-file-name "default" 'dirname-nolong-nolong)
(defalias 'file-directory-file-list "default" 'filelist-mode)
(defalias 'file-directory-file-list "default" 'directory-type-file)
(defalias 'files 'files)
(defalias 'files 'files)
(defalias 'files 'files)
(defalias 'files 'files)
(defalias 'files-other-window 'files-other-window)
(defalias 'files-other-window 'files-other-window)
(defalias 'file 'ls-file)
(defalias 'ls-files 'ls-file)
(defalias 'lsh 'lsh-load)
(defalias 'load 'lsh-load)
(defalias 'load 'nload-files-all)
(defalias 'load 'ls-load)
(defalias 'run
======== SAMPLE 4 ========
uffer-if-not-equal
(and (not (or (boundp 'gnu-ftp-pcm-buffer) (stringp pcm)))
(let ((coding-system-for-write 'undecided)
cb-name mh)
(if (stringp coding-system)
(setq msg (format "%s" sender)
smm (format "%s: %s" (buffer-file-name smm) (buffer-file-name fm))))
;; This is the default. Use the function below.
;; <sender>
(propertize "^[ \t\n]\\" smm mh))
nil
((and (consp sender) (string-match-p "$" sender)
(looking-at "$"))
(setq sender (replace-match "$" (match-string 1 sender) " "))
(if (match-end t) sender nil))))
'smm nil))))
(define-obsolete-function-alias
'gnu-ftp-pcm-buffer "24.3")
(defconst gnus-ftp-server-buffer-name
"\\|"
"\\(.*\\|\\Src\\|\\Src\\|\\Src\\|\\Src\\|\\Src\\+\\)+")
(defconst gnus-ftp-server-buffer-name
(concat
(regexp-opt gnus-ftp-server-buffer-name "\\'\\'"
gnus-ftp-server-buffer-name
""))))
(provide 'ftp)
;;; ftp.el ends here
<|endoftext|>;;; gmail.el --- GNU Mailing Group ------------------
;; Copyright (C) 1988, 2001-2019 Free Software Foundation, Inc.
;; Copyright (C) 1997, 2001-2019 Free Software Foundation, Inc.
;; Keywords: wp, data
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;;
"%file: samples-15900"
======== SAMPLE 1 ========
(save-excursion
(when (not (string-match "^\\(\\s-*\\)\\s-* \\(.*\\|\\s-*\\)\\s-*\\(\\$\\|\\s-*\\)*"
(match-string 5 1)))
(let ((beg (point))
(end nil)))
(cond ((or (get-text-property beg end)
(get-text-property beg end))))
((get-text-property beg end)) (funcall fun beg)))
(t (funcall fun end)))))
(t (funcall fun end)))))))
(dolist (w paren-in-string)
(dolist (line (buffer-name))
(message
"Buffer %s found in buffer %s!" paren-char endp)
;; Check point.
(let ((point (point)))
(if (looking-at "[ \t]?[{]&\n")
;; "\\(\\(?:\n *\\)[ *\\\\][ \t|]+" or ".")
;; "\"\\*\\(?:\n +\\)?\\>[ \t|])+"
(skip-chars-forward " \t\n\t")
(skip-chars-forward " \t\n\t")
;; " \\[^:]*\\|[^:]" or "\\(" or "^\\)[\\]" or "\\]"
;; " \\([-_:]+\\).*" or "\\([-_]+\\).*"
(if (not (or (= start (1- start)) ?-))
;; " *[\t]+"
(concat "[:]" (= start ?-))
(if (= start 0)
'((string (match-string 5)) ";$"))
(if (= end 0)
(progn
(setq found (match-string-no-properties start end)))
(setq end (+ end found))))
======== SAMPLE 2 ========
(> x)))))))
(math-equal x (math-mul (- (nth 1 x) (nth 1 x))))))
(math-div x (math-expr-subr x))))))))
(if sum
(math-multiply-result sum n)
(list (cons '(1 1) '(2 1) (cons 'vec (math-sub x) (math-sub x))))
(list (cons '(vec 1 1)) 1)
'(math-sub (math-div x 2) (or (< ,x 2) . 1) ; 1 to all
; (1+ x)
; [1][0][1][0] to zero
)
(list '(1 2 1 1))
'(math-mul (math-sub (car (nth 1 x)))
sum)
'(math-multiply (math-div (nth 1 x))))
t))
(defun math-mul-result (x)
(math-mul x 2)
(cons '(1 2) (list 'vec 1 1))
(list '(1 2) (cons 'vec (1+ x))))
(list '(1 2 1 1))
(list '(1 0))
(list '(1 0))
(list '(0))
(list '(1 0)))
"Constraints of the form `Math-mul' with result.
The result is the result of the math-mul operation.
Argument NUM is the number of the result.")
(defun math-mul-max-result (x)
(let ((max 1) (len (length x)))
(cond
((= (number-or-marker max) max) ; 1 to the sum of two
(math-multiply-result (car x) max (cdr x)))))
(math-div (math-add (+ (/ (1+ max) (* (1- (+ min (length x))) 2)))) 1)
(list '(1 0)
(list '(1 1) (1 1) (1 1 1))
(list '(math-div (math-add max 1) x)))
(math-mul (math-mul x 3))
(list '(1 0) (list '(1 1) (1 1 1))
(list '(1 0) (list '(1 1))) (list '(1 1)) (list '(1 0)) (list '(0)))))
(math-mul (list '(math-mul x 3))
'(1
(math-div (math-mul x 3))
(math-mul x 3)))
(list '(1 0) (list '(1 1) (1 1 1))
(list '(1 0) (list '(1 0) (1 0)))))
(list '(1 5 3)
(list '(1 0))
======== SAMPLE 3 ========
(setq result (cons (make-hash-table (make-hash-table))))
result)
;; (set (make-hash-table) (list result))
(cond ((eq (car-safe result) 1)
(set (make-hash-table) (list result)))
((natp (car result))
(t (format "<%+%s>" (char-after (car result))))
(t (format "<%d>%s</%s>"
(char-after (car result)))
(cadr result))))
((eq (car result) 1)
(set (make-hash-table) (list result))
(cadr result)
(cadr result)))))
string))
str result))
"."
(cons "." result)))
(t "!"
(cons "a" result)))
summary)
(defun gobject-debug-summary (str &optional _info)
(with-current-buffer (or (get-buffer str) gobject-debug-mode-buffer))
(with-current-buffer (or (get-buffer str) gobject-debug-mode-buffer))
((let ((inhibit-read-only t)
(with-current-buffer vhdl-buffer
(gud-log-message
(expand-file-name
(cons "-" (buffer-name)) "/")
;; FIXME: make "gobject-debug-summary-" the gUD mode name.
)
)
;; FIXME: use a function called by gud-mode-hook to
;; save the buffer to disk, rather than to a gud file.
(save-buffer "*gobject-debug-summary*"))
======== SAMPLE 4 ========
vc-delete-current-category-tag)
(with-current-buffer vc-buffer
(insert-text-button (prog1 (point)
(forward-line 1))
(move-to-column (current-column))
(cond ((and (> vc-buffer-height 0) (string-match "\\\\%\\'" vc-current-category-tag))
(insert "\n\n"))
((looking-at "\\(\\t\\|\\s[a-z].+\\)") ; no newline found here
(insert "\n{%s}")
(set-text-properties vc-current-category-tag nil)
(goto-char (match-beginning 1)))
(t ; just insert the whole thing
(insert-and-invert))
(delete-region (point) (progn (forward-line -1) (point))))
(insert "\\n")
)))
;; delete current category name from point
((looking-at "^\\(\\t\\|\\s\\|\\s[^a-zA-Z][a-zA-Z0-9_][A-Z][a-zA-Z0-11_-_][a-zA-Z0-5_].+\\)$"))
(unless
(and
(not (string-match "\\\\\\(\\(\\s_>" (symbol-name vc-current-category-tag))))
(message "No current category named \"%s\""))
(delete-region (point) (progn (forward-line 1) (1+ (line-end-position)))
(skip-chars-forward " \r\t\n")
(point))))
(insert "^" (concat
"\\(\\sw+\\|\\x-"
(1+ (substring vc-current-category-tag 0 -1))
"\\(\\\\\\)?")
"\\(\\sw+\\)"))
(goto-char (point-min))
(looking-at "\\n\\.\\([a-zA-Z%-9-__][a-zA-Z0-9_]+_\\)")
(setq vc-current-category-tag nil))))
;; else if this entry should look like a newline, we just
;; make sure we don't put the empty space between
;; we inserted, and we don't do the space-comment with the
;; text string. This
"%file: samples-15800"
======== SAMPLE 1 ========
(let ((coding-system-for-write
(list (list
'*
(string-match
(concat
"\nThis is the coding system for the file, and must be done before
\\`write-file'
\n is used."))
'file))
(when (called-interactively-p 'any)
(message "Sending file to %s...done" file)))
(let ((coding-system-for-write
(list
(if buf (symbol-value buf)
(concat
"("
(symbol-name buf) "sender=" (or (coding-system-to-coding-system)
'read-only))
")")))
(read-string cmd)
;; Set c-use to be 'read-only and set this to 'write-file,
;; and set it to nil.
(setq read-only t)
;; Set this to nil, so we can't use 'write-file if `write-file'
;; returns read-only.
(setq write-file nil)
(setq write-file 'always)
(unless (fboundp 'save-window-configuration)
default-frame-configuration))
(when (or (bobp)
(not (window-minibuffer-p))
======== SAMPLE 2 ========
(org-clock-update-pending-update nil event 'force))))
(defun org-clock-update-pending-update (&optional event)
"Update the clock pending updates in the current buffer."
(save-restriction
(widen)
(let ((event (buffer-substring (point) (org-entry-get event :display)))
(widen)
event-buffer)
(setq org-clocking-update-message t)
(and (buffer-modified-p) (org-remove-buffer event))))))
(defun org-clock-update-pending-update ()
"Update the clock pending updates in the current buffer."
(let ((time (dired-current-buffer)))
(setq org-clocking-update-time 0)
(and (> (length time) 1)
org-clock-clock-update-value 1))
(org-remove-clocking-update org-clock-clock-clock-value nil)
(org-remove-clock-clock-clock-update-time 2)
(org-remove-clock-clock-clock-value nil)))
(defun org-clock-update-pending-update-count ()
"Update the clock pending updates in the current buffer."
(let ((time (dired-current-buffer)))
(setq org-clock-clock-clock-update-value 1)
(and (> (length time) 1)
org-clock-clock-clock-update-value 1))
(org-remove-clock-clock-clock-update-time 2)
(org-remove-clock-clock-clock-update-time 3))
(defun org-clock-clock-update ()
"Update the clock pending updates in the current buffer."
(let ((time (dired-current-buffer)))
(setq org-clock-clock-clock-update-value 1)
(and (> (length time) 1)
org-clock-clock-clock-adjustments-remaining-days-with-in
org-clock-clock-clock-clock-clock-clock-clock-update-time
org-clock-clock-clock-clock-clock-clock-clock-clock-clock-clock-clock-clock-clock-clock-clock
org-clock-clock-clock-clock-clock-clock-clock-clock-clock-clock-clock-clock-clock-clock
1))
time))
(defun org-clock-clock-update-count ()
"Update the clock pending updates in the current buffer."
(let ((time (dired-current-buffer)))
(setq org-clock-clock-clock-update-value 1)
(and (> (length time) 1)
org-clock-clock-clock-update-value 1))
(org-remove-clock-clock-clock-clock-update-time 2)
(org-remove-clock-clock-clock-clock-clock-date-with-in)
;;;###autoload
;;;###autoload
(defun org-clock-clock-update-time (t)
"Update the clock clock clock in a non-interacting clock to the time of the
current time."
(interactive "P")
(let ((time (dired-current-buffer))
(cnt 0))
(if (save-excursion
(let ((time (buffer-substring (point) (org-entry-get event :display))))
(cdr (assq event org-
======== SAMPLE 3 ========
(setq gnus-store-store-number nil)
(setq gnus-regexp gnus-store-regexp)
(setq gnus-store-prefix prefix) ; Remove `:' if not found.
;; If at start: add the regexp
(if (string-match
gnus-match-start-regexp
(concat gnus-match-start-regexp
"\\s *\\(\\*\\)\\(\\s *\\)";
(format
(if (re-search-forward gnus-match-start-regexp nil t)
t
(concat
gnus-match-start-regexp
":\\(\\s *\\)\\(\\s *\\)); "
(concat gnus-match-start-regexp "\\(\\w+ +#+\\w"))
"\\s *\\(\\(\\s *\\)")
)))
(setq gnus-regexp gnus-store-regexp)
;; If `:' is found, replace the first line with a
;; regexp that matches the start of the string.
(unless (zerop (length gnus-store-prefix nil))
(setq gnus-store-prefix nil)
(setq gnus-store-number
(read-string
"Match \"%s\": "
(substring gnus-store-regexp nil -1))
nil ?\n)))
(goto-char (- (point-max))))
(setq gnus-store-number 2)
(setq gnus-store-prefix nil)
(setq gnus-store-prefix nil)
gnus-store-prefix)))
(provide 'gnus-store)
;;; gnus-store.el ends here
<|endoftext|>;;; gnus-parse.el --- parser functions to parse Gnus
;; Copyright (C) 1997, 2000-2005, 2006-2019 Free Software Foundation,
;; Inc.
;; Maintainer: emacs-devel@gnu.org
;; Created: 2000-12-14; Sun Jan 26 19:30:00
;; Keywords: i18n, gnus, nnemonic, text
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
======== SAMPLE 4 ========
(goto-char (1+ k))
t)))
(goto-char k)
(when (re-search-forward
"\\(\\sw\\|\\s_\\|\\s_\\|\\s_\\=\\)?"
'(nil t comment t)
" *\*")))
(goto-char (match-beginning 0))
(or (looking-at "[ \t]*\\([A-Za-z0-9_:_].*\\([\\.]\\):+\\)?")
(error "Can't find any other match"))
(search-forward "^\\([^ \t]*\\(\\|\\W*\\):*[ \t]*\\(\\W*\\):+\\)?" 'move)
(setq k (match-beginning 0)
b (match-beginning 1)
t (match-beginning 2)
k (match-beginning 3)
t (match-beginning 4)
k (match-substring t 1))))
))
;;;###autoload
(defun icalendar--with-all-timers (&optional time)
"With all other things scheduled, create an entry if possible, and display its timestamp."
(interactive "P")
(let* ((calendar (nth 0 time))
(timestamp (nth 1 time))
(time-list (cons (calendar-time) timestamp))
(timestamp-cache (cons (calendar-time) time-list))
(timestamp-entry (calendar-time)))
(when timestamp
(with-current-buffer nth (window-width)
(let ((timestamp (if (not buffer-invisable)
'nesting-error
'nesting-error-timestamp))))
(with-current-buffer (window--last-buffer
(with-current-buffer
(window-buffer-live-p
(frame-buffer-get-selected-frame timestamp) nil t)
timestamp))))
(aset time (buffer-string) (buffer-string))
(aset time (window-height) (window-width))
(if (not (eq (frame-parameter
'selected-frame-parameters) (selected-frame)) 'nesting-error))
;; The timestamp entry is cached, and will be updated
;; even if buffer is not visited.
"%file: samples-15700"
======== SAMPLE 1 ========
path-find-file)
(defun org-agenda-add-files (expand-file-name org-agenda-files)
"Add the files to the current agenda buffer, without moving them."
(org-agenda-add-files
(expand-file-name (concat
"^\\s-*\r\n"
"^[ \t]*")
expand-file-name (concat (substring org-agenda-files 0 -1) ""))
(org-agenda-add-files
org-agenda-files (expand-file-name (concat
"\\s-*\r\n"
"^[ \t]*)$ "
org-agenda-files)))))
(defun org-agenda-build-files ()
"Build all current calendar items from the source files."
(unless (org-agenda-files)
(error "No previous year"))
(let* ((files nil)
(files (save-excursion
(skip-chars-backward " \t\n")
(skip-chars-forward " \t\n")
(numberp (length files)))))
(when tags
(setq files (file-attributes (directory-files (expand-file-name files))))
(when (file-exists-p files)
(setq files (copy-tree files nil nil nil nil)))
(if (equal files "")
files
(list files)))))
(defun org-agenda-build-tags (files files)
(let ((attrs (append files
(mapcar
(lambda (file)
(let ((entry
(concat "^\\s-* \\(?:" (regexp-quote entry))
"^[ \t]* "
;; Search for first "^$" element
;; at some level
(completing-read
"Tags at "
"\\([a-zA-Z][a-zA-Z][a-zA-Z_$]*/#?\\|\\s-+")
======== SAMPLE 2 ========
path
:group 'logic)
(defcustom logi-mode-toggle-inhibit-comments t
"Non-nil means don't display comments in logi mode.
If this is set, you can toggle the text properties of the region.
You can set this option to t in the \"logi-mode-toggle-inhibit-comments\" file.
You can also edit the local variables `logi-mode-auto-indicator' and
`logi-mode-indicator-mode'.
Default value `nil' means don't show comments.
Use the following command as a prefix argument:
-h -l -r -c %v"
:type 'boolean
:group 'logic)
(defcustom logi-mode-auto-indicator-mode-menu
"\\.\\.Logi Mode's Manual"
"List of variables that control how logi-mode will display commented comments:
The variable `display-comment-prefix-chars' is used while displaying commented comment
in logi. However, the other variables cannot be used. Use `display-comment-prefix-chars'.
Use only `display-comment-prefix-chars'. See the entry for the
following configuration variables:
| Display comment before and after the current line"
:type 'integer
:group 'logic)
(defcustom logi-mode-auto-indicator-mode
;; The `mode' variable is not an indicator of the auto-indicator
"Set for all logi modes to be disabled at the command line."
:type 'integer
:group 'logic)
(defcustom logi-mode-auto-indicator-mode ""
"For Logi mode only."
:type 'integer
:group 'logic)
(defcustom logi-mode-auto-indicator-mode-item
'((t . "logi")))
(defcustom logi-mode-auto-indicator nil
"Don't display commented comment in logi mode. For logging in, it always
plays the appropriate default key-keys."
:type '(choice integer
(const :tag "No comment" nil)
(function :tag "Use the current key as the display key")
(repeat :tag "Set to :default"
(const :tag "Don't display comment at all" nil)))
:group 'logic)
(defun log-indent-to-comment (indent)
"Indent the entire current comment indentation.
Indent to comments only if `comment-indent-flag' is non-nil."
(let* ((indent (or (string-width (min (point-max) (min (point-max))))
(number (string-width (min (point-max) (min (point-max)))))))
(when (string-syntax-p indent)
(setq indent (string-width (min (point-max) (min (point-max))))))
(when (string-syntax-p indent)
(setq indent (string-width (min (point-max))))))
(when (string-syntax-p indent)
(setq comment
(read-only-mode 0)
(unless indent (set-syntax-table comment-table)))
(delete-region indent (point))))
(defun log-indent-case ()
"Indent current line as case-sensitive."
(interactive)
(let ((indent-tabs-to-default 0))
(save-excursion
(if (re-search-forward "^[^ \t]*" nil t)
(goto-char (match-beginning 1)))
(when (re-search-forward " " t t)
(goto-
======== SAMPLE 3 ========
path-list))
(goto-char (or (not (search-forward "\r\nBufs=%s" nil t))))))
;; We need the first (non-regexp)
(if (equal (rmail-mail-address-list mail-list)
"Cred@cc.gnu.org")
(setq rmail-mail-address-list
(expand-file-name "-mail/" mail-list))
rmail-mail-address-list)
(goto-char (or (not (search-forward "\r\nBufs=%s" t))))))
))))
;;; Mailing
;;
(define-mailer 'mailer "mailer.el"
(lambda (file)
(with-temp-buffer
buffer-file-name
(and (not (derived-mode-p 'org-mode))
(file-name-as-directory
(expand-file-name
`(org-with-output-to-mime
"freetype" "newsype.eug")
(setq mailer-mail-subject
buffer-file-name)))
mailer-mail-subject))
(save-buffer)))
;; If the last message was the header, just skip past that one
(let* (:headers
(:body
(buffer-substring-no-properties (match-beginning 0) (match-end 0))))
(unless (setq mailer-newsletter-head
(mapcar
(lambda (head)
(setq mailer-newsletter-head
(mapcar #'equal "News" "Uglyface" nil t)))
(
======== SAMPLE 4 ========
path))
((cdr (get symbol 'custom-keywords)))
((cuser (cdr (get symbol 'custom--format-keys))
(let ((keyboard (get symbol 'custom--help-keywords))))
(call-process shell)))
(t (with-current-buffer
shell
(with-current-buffer
(gcc-debug-on-input)
file-name)))
(goto-char (point-min)))
(list (buffer-substring-no-properties (point-min) (point-max)))
'sender t
'sender name t
'sender nil)))))
(message "%s" (if (not (symbolp (nth (setq mode-line-name-format
(if shell-path
(symbol-name mode-line-name)
(if shell-path
(symbol-name mode-line-name)
(if shell-path
(symbol-name
"%file: samples-15600"
======== SAMPLE 1 ========
const-mode)) ; make `vc-current-buffer' a consed variable
(vc-file-buffer
(vc-file-get-file-name)
(vc-file-buffer-keep-inhibit-quit t)))
(dolist (case-fold-search)
(dolist (buffer (vc-file-buffer-p))
(vc-file-buffer-save-buffers-kill-buffer buf)
(vc-file-buffer-keep-inhibit-quit t)
(vc-file-buffer-kill-buffer buf)))
(vc-set-buffer-name "VCC" buffer)
(vc-set-buffer-size "-50 bytes")
(vc-set-buffer-file-name buffer)
(vc-put-text-property (vc-file-data)
(make-vector (length vc-file-data)
'size 'size)))
(when (and (not (eq 'vc-current-buffer 'vc-current-buffer))
(equal file (make-temp-name "vc-current-buffer" :test 'equal))
(equal buffer (make-temp-file "vc-current-buffer" :test 'equal)))
(when (vc-file-mode
(and (vc-file-get-file-name buffer)
(file-exists-p buffer)
(when (not (vc-mode))
(not (vc-shell-file-buffer-p buffer)))
(vc-file-buffer (apply 'append
(cdr (vc-file-buffer-file-name buffer)))
nil nil nil nil nil 'visible)
(unless (equal file file-alist)
(setq file-alist vc-file-alist)))))
(when (or (called-interactively-p 'any)
(not (vc-file-buffer-local-p buffer))
(vc-file-buffer-get-buffer buffer)))
(let ((vc-default-buffer-name (custom-buffer-name (custom-buffer-file)))
(switch-to-buffer-other-window vc-default-buffer-name)
(or vc-default-buffer-name
(when vc-mode
(set-window-buffer vc-default-buffer-name
(min frame-width
(window-normalize-p desktop-window-resize-function
(append vc-default-buffer-name)))
(pop-to-buffer (custom-buffer-name vc-default-buffer-name)
======== SAMPLE 2 ========
const)))
(t (format "Moved to %s? "
(cons (concat text-directory
(buffer-name (cdr b)))
b)))))
(defun rmail-file-directory-prefix (arg)
"Return current directory for the current file.
Assumes nil if the file name is not local."
(let ((directory (expand-file-name "rmail-" current-directory))
(cdr (assoc "rmail-" ctl-file-attributes)))
;; The directory name has to be local, in order to get from current file.
;; So return the same directory if it is.
;; Otherwise, set to 0.
(cond
;; `rmail-file-directory-prefix' says "directory for file or directory".
((and directory (string-prefix arg)))
;; A string could be passed as argument to `rmail-file-directory-prefix'.
((and (memq "-g" (concat rmail-file-directory-prefix
(or arg (file-name-directory (file-name-directory arg))))
"-g"))
(rmail-file-directory)
;; No directory on file. There is one on file, just return it.
;; FIXME: Can't use the same name on file, since the file name
;; also should be local. Maybe we should call rmail-file-directory-prefix?
(and
(null arg)
(string-equal (file-local-name (car arg)))
(save-excursion
(save-restriction
(widen)
;; Is the file file name?
;; `rmail-file-directory-prefix' says so.
(if (integerp arg)
(setq arg (1- arg)))
;; The file file name isn't local either.
(if (file-readable-p file)
(rmail-file-directory-prefix
arg))
(if rmail-file-directory-prefix
(setq rmail-file-directory
(- (match-beginning 0) (match-end 0))
rmail-file-directory-prefix))))
arg))
(defun rmail-file-directory-prefix (arg)
"Return current directory for the current file."
(let ((directory (expand-file-name "rmail-" current-directory)))
(cond
;; A string could be passed as argument to `rmail-file-directory-prefix'.
((and (string-prefix arg) (string-to-number
======== SAMPLE 3 ========
const-auto-load-path
"~/autoload/elisp/autorepose.el -1"
(let ((path (downcase (downcase (nth 1 (erc-get-file-name)))))))
(let ((path (downcase (nth 2 (erc-get-file-name)))
(path-backend (or path "")))
(if (or (eq (nth 1 path) 're)
(not (cl-reporter-file-exists-p (nth 2 path) t)))
path
(let* ((type (erc-get-file-type path)))
(if (eq type 'erc-file-directory)
(setq path
(erc-get-file-type path -1)
(cdr (assq type erc-file-directory)))
(unless (and type (null path))
(setq paths (copy-path path)
erc-file-directory
path (list :size
(length paths))
erc-file-directory
(or (upcase-substring path) path))))))
paths)))))
(defun erc-open-file-from-directory (file)
"Open FILE file from the directory of FILE to find file.
The optional arguments FILE are strings of all file names in the
\(natively) recognized directory. If FILE is directory, then the
command `insert' inserts the file, otherwise `insert' inserts the
directory. Also, if FILE is not in a running Emacs process,
either `insert-directory' or `update-directory' deletes the file.
The command then inserts itself to its own file."
(interactive (list
(let ((erc-get-new-file-function
erc-get-new-file-function)
(list "expand" (erc-expand file 'erc-expand-file)))
(erc-get-new-file-type erc-get-new-file-type)
(erc-expand-file-name (file-name-directory file) t)
======== SAMPLE 4 ========
constวจฃวย"
"ฮัก"
"ึจง"
"ษฉ"
"ึช"
"หวพด"
"หุ"
"ฯก"
"ฯง"
"ะน"
"ษด"
"ัธ"
"ับ"
"าส"
"าส"
"าลา"
"าลาบ"
"าลี"
"ำลาค"
"ำลี"
"ำลย"
"าลว"
"าลวบ"
"าลํ"
"าล็"
"าล้"
"าล้า"
"าล์"
"าลํ"
"าวน"
"าวนะ"
"าหณาง"
"าววล"
"าหท"
"าหน"
"าหนย"
"าหนะ"
"าห่ง"
"าห้ห"
"าห้า"
"าเก"
"าเกาง"
"า�
"%file: samples-15500"
======== SAMPLE 1 ========
target-p vhdl-group-key)
(setq group (match-data)))
(if (eq (buffer-string vhdl-group-buffer) 'no-save)
(kill-buffer vhdl-group-buffer))
(unless vhdl-group-key
(setq group (copy-sequence vhdl-group-key))
(unless vhdl-group-key 'no-save)
(setq vhdl-group-key 'no-save)))
(setq buffer-read-only t))
nil)
(defun vhdl-group-delete (&optional group)
"Delete all group keys in GROUP."
(interactive)
(setq vhdl-group-key (buffer-substring (point)
(match-end 0)))
(if (and (not group) (numberp group))
(let ((vhdl-group-key (car vhdl-group-key)))
vhdl-group-key)
(delete-region group
vhdl-key (if (not (string= group "") ":")) 0)))
nil)
(defun vhdl-group-get-group (&optional group)
"Get group keys in GROUP."
(interactive)
(if (listp group)
(let ((vhdl-group-key (car vhdl-group-key)))
(when (and (not (string= group "") "no"))
(let ((vhdl-group-key (car vhdl-group-key)))
(when (and (not (string= group "-")) "")
(let* ((key (and (memq key vhdl-group-key)
(symbol-value vhdl-group-key)
key)) (newv hdl-group-key))
(s (vconcat key vhdl-group-key " ")))))))
(if newv
(list (list
(or vhdl-group-key (buffer-substring (point)
(point-max))))
(list (list key newv hdl-group-key) newv)
(list vhdl-group-key newv)
(if (memq vhdl-group-key '(vhdl-group-key 1))
vhdl-group-key)
(copy-sequence vhdl-group-key)
newv))
(insert newv))
(setq vhdl-group-key
======== SAMPLE 2 ========
target buffer for this file instead."
;; If we have a buffer, then it is in a list of two submenus which
;; should be a continuation of the first one. This is usually not the best
;; way to handle case-sensitive submenus.
(let* ((case-fold t)
(sublist "" "")
(buf-be-in-list nil)
(buffer "")
(pos 0)
(buf-end nil)
(buf-be-back nil)
(funcall (if (eq buffer-name 'C-symbol) nil nil 'funcall 'C-symbol-and-name)))))
(defun c-submenu-toggle-continuations (&optional arg)
"Toggle whether `c-submenu-continue' is active or inactive, in which case it
is a continuation of a previous one, for the next submenu.
When called interactively:
(cl-callp arg) or
(setq c-use-continuations t)
Non-nil when `c-use-continuations' is t, also enable using
`c-submenu-continue' if and only if the submenu ends in a buffer, otherwise
it should begin with the buffer if not.
This command assumes the currently executing submenus are current
and not any previous commands have been executed; that is, no
submenus is executing."
;; If `c-use-continuations' is t, only call the submenus that
;; are currently being activated, and only call `c-submenu-continue' if
;; you want to continue activation. This is typically good enough and
;; helpful, but you may prefer to use something else to do the
;; same thing: do some other minor tasks. Do not call
;; this command again without checking that the submenus
;; are activated and not before completing them; it can still
;; be handy to have such a check here if you wish to continue activation
;; for the same submenu as it was activated.
;;
;; Note to self: If you change the name of the command to `c-use-continuations
;; or to `c-submenu-activate-interactive-flag', then some commands are
;; different from their counterparts, and so on. For example
;; for `c-use-continuations' (c-activate-interactive-flag),
;; `c-submenu-continue' is an autoconf switch which can switch between
;; active and inactive commands. For example if you call
;; `eol', c-use-continuations would then invoke `eol' when the submenus
;; were activated, and you could now call `eol', for example. If
;; you wish to do this for all available submenus, you may call
;; `c-use-continuations' with the same name, but use the non-active
;; submenus that was activated and activated all available submenus. If this
;; is needed, you may use this option for the following commands:
;; - C-<> RET RET RET RET RET RET
;; - C-S C-<> RET RET RET RET RET RET RET RET - or C-<> RET RET RET RET RET RET
;; - C-^ RET RET RET RET RET RET RET RET RET RET RET RET - RET RET RET RET RET RET RET RET
(let* ((symbol
(if (eq (char-before) ?<)
(funcall 'switch-to-c-submenu-mode start-char)))
(c-use-continuations
(call-interactively
c-use-continuations-mode (point) 'toggle)
nil t))))
((eq arg ?E)
(when (eq (sub-menu-buffer c-use-continuations) 'inactive)
(setq start-char (c-symbol-or-
======== SAMPLE 3 ========
target-active-p 'pending-reload))
(goto-char marker-active-p)
(unless (eobp)
(dolist (x (eotp))
(insert "\n"))
(if (eq tag-active-p 'previous-action)
(beginning-of-line 5)
(move-to-column marker-active-column))
(progn
(setq marker-active-column marker-active-column
marker-active-active-column nil)
(setq marker-active-column nil)))))
(_ (pending-reload 'message-show)))
(setq idlwave-buffer-local-map
(let ((map (file-map-all)))
(when map (with-current-buffer map idlwave-local-map)
;; If idlwave-get-info from the buffer (the last thing after
;; being called in the file) and it returns, let's
;; do it again with an appropriate IDL-INFO object. It
;; might be called with idlwave-get-info from the last thing
;; before the file.
(with-current-buffer map
(dolist (idlwave-global-entry-name map)
(push '("*IDL-INFO" x x t) (list (current-buffer)
(+
idlwave-global-entry-name
(-
idlwave-data-info
nil))))))
map)))
(list (current-buffer)
(+
idlwave-global-entry-name
======== SAMPLE 4 ========
target)
(setq e (format "%s" (c-get-buffer "emacs-tests-data"))
(dolist (test e)
(let ((s (read-string " %s \"%s\" (?:%s %.*"
test
"--")
" --"
(cons s "--")))
test)))
(cond
(tests--unwind-protect
(message "Enexpected test, %s (%s)"
test)
(user-error "Unknown test, %s (%s)" test))))))
(defun c--tests-warn-and-revert (tests)
"Call `c-warn-with-revert' to report problems with tests."
(if (null (c-get-buffer "emacs-tests-data")
(let* ((buf (get-buffer-create "*test results*"))
(tests-data (read-from-minibuffer
"Test results: "
(call-process c--tests-data)
"\"%s\" \"%s\" \"%-s\""
(read-from-minibuffer
"Bug#: "
nil t "%g"
(read-string
"Test results: (\"%s %v\"): "
t nil nil "\"" nil
c--tests-data t
"Buffer name: "
"Buffer file type: "
(read-file-name
file-name nil t nil
(read-file-name
(format "Buffer name: "'
"%file: samples-15400"
======== SAMPLE 1 ========
from 'gnus-group-method))
(defun gnus-article-with-in-groups-p ()
"Return non-nil if article mode supports GROUP."
(and (or (not (member groups gnus-article-groups))
(gnus-group-group-active))
(gnus-group-group-active))
(or (and gnus-article-in-groups-p)
(gnus-group-type-error)
(gnus-group-group-type_error))
)
(defun gnus-article-with-active-buffers (&optional server)
"Return non-nil if some headers exist in some server.
If `gnus-header-coding-system' exists in a buffer, this is done.
With a prefix argument, the server's coding system and the value
of 'mml-compress are stored in this buffer.
When optional argument NICK is non-nil, it is used to calculate
the minibuffer value of this buffer if possible."
(setq gnus-header-coding-system
(if (eq server gnus-server-coding-system)
(gnus-coding-system-get gnus-header-coding-system)
(eq nicksort-minibuffer-minibuffer)))
(gnus-group-group-func server 'header)
(if (eq server gnus-server-coding-system)
(gnus-group-server-to-group server)
(gnus-group-group-func server 'group-mode)))
(defun gnus-article-with-active-buffer (&optional server prefix-group)
"Return non-nil if some buffer-local articles are also active.
With a prefix argument, the server's coding system and the value
of 'mml-compress are stored in this buffer.
A buffer in this buffer is active if in any of the following
groups. The server may also also use its own buffer-local headers."
(if (eq server gnus-server-coding-system)
(gnus-group-mode)
prefix-group))
;;; Miscellaneous
;;
;;;###autoload
(defun gnus-gmap-article-mapping (&optional server)
"Return the full set of mappings for MH-E articles."
(let* ((groups (gnus-get-group-or-buffer-create))))
(dolist (m (eos)
(gnus-group-mapping m))
(gnus-summary-find "gnus-article-read-mapping" '("m" . gnus-newsgroup-mapping)
gnus-article-read-msgs))
(with-current-buffer gnus-summary-buffer
(gnus-summary-add-header-for-group m "group")))))
;;;###autoload
(defun gnus-article-read-mapping ()
"Return the full set of mappings for MH-E articles."
(when (gnus-summary-find "gnus-mapping-read-mapping" '("read"))
(while (gnus-summary-get-new-mapping-function)
(and (setq gnus-mapping-changed (gnus-group-mapping m))
(not (gnus-article-new-mapping t)))
(gnus-summary-add-header-for-mapping)
(gnus-summary-add-item "read" m t)
(gnus-summary-add-header-for-mapping M)
(gnus-summary-add-header
======== SAMPLE 2 ========
from-file t)
(insert "\n")
(funcall setq start new-mode default-start
(save-excursion
(goto-char (point-max))
(forward-line 1))))
(error "%s failed: `%s' did not begin in buffer %s" file name
(setq start-mode t)
(let ((mode (org-agenda-mode-file-name start-mode))
n)
(set-char-table n (1- n)))
(funcall setq n (point))
(insert new-mode default-start)
(funcall setq start-mode nil))
(funcall insert-file n)
(kill-buffer (find-file-noselect nil)))
(unless gnus-agenda-mode-map
(gnus-update-map "gnus-agenda-mode" t)))
(let ((default
#'(if (not (cdr gnus-adore-default-map))
#'(if (not (cdr gnus-adore-default-map))
#'(if (not (cdr gnus-adore-default-map))
#'(if (cdr gnus-adore-default-map))
#'(if (not (cdr gnus-adore-default-map)))))
`(gnus-adore-directory ,default . ,new-mode)))
(gnus-adore-default-default))) ; insert default
(when (gnus-read-string gnus-agenda-default-map)
(gnus-add-to-group gnus-agenda-default-map (list 'gnus-agenda-add-group 'group))
(gnus-add-group
gnus-agenda-group
gnus-agenda-group
======== SAMPLE 3 ========
from ((cadr mh-mh-sw) mh-header-line-face-highlight-face-in-hms)
(:foreground "black-black"))
;;;###mh-autoload
(defun mh-header-line ()
"Insert a header line on current line."
(interactive)
(when mh-header-line-face-highlight-face (re-search-forward "<%s>\\("
(propertize (point)
(line-beginning-position t)
(overlay-start)))
(line-end-position nil))))
(defface mh-header-line
'((((class color)
(:foreground "white")
(((class color)
(:text-background "green")
(:text-font-family "red")
(:text-header-line-face "Black">" (:background black)))
(((class color) (min-colors 88) (class color))
(:foreground "black")
(:text-background "tan75")
(:text-font-family "red")) ;
;; FIXME: should this feature be removed? The font-weighted
;; font-change-regexp is not used in the above but should be
;; in the default case. In M-x header-line-mode,
;; but the font-change-regexp is also used in the
;; following font-change-regexp, but that should be
;; removed from the default case.
(:foreground "black")
(((class color) (min-colors 88) (class color))
(:text-body-face "white"> (:foreground "white") (:text-header-line-face "Blue">" (:background blue)))
(:text-font-style "italic")
(((class color) (min-colors 88) (class color))
(:text-font-style "italic"))
;; FIXME: should this feature be removed? In M-x header-line-mode,
;; but the font-change-regexp is also used in the
;; following font-change-regexp, but that should be
;; removed from the default case.
(:foreground "white")
(((class color) (min-colors 88) (class color))
(:text-body-face "white"> (:foreground "white") (:text-header-line-face "Blue">" (:background blue)))
;; FIXME: should this feature be removed? In M-x header-line-mode,
;; but the font-change-regexp is also used in the
;; following font-change-regexp, but that should be
;; removed from the default case.
(:foreground "white"))
;; FIXME: should this
======== SAMPLE 4 ========
from-file-charset (buffer-file-name))))
(goto-char (point-min))
(search-for-defun-function nil))
(t
(setq-local
(if pwd-file-alist
(or pwd-file-alist
(setq-default pwd-file-alist t))
(setq-default pwd-file-alist
pwd-file-alist)
;; Save the pwd-file-alist for future use.
(save-excursion
(save-restriction
(widen)
(when (and pwd-file-alist
(file-exists-p pwd-file-alist)
(looking-at pwd-file-alist)))
(set (make-local-variable
(concat
"\\`%s\\'" (get-text-property (point) 'paren) "\\]?"
(if (get-text-property (1- pwd-file-alist) 'paren)
"-")
pwd-file-alist)
(set (make-local-variable
'syntax-ppss-font-lock-face)
(concat
"[:%s; " (setq-local org-dired-font-lock-face
(if (or (fboundp 'font-lock-default)
font-lock-default-face)
")")
")")
(set (make-local-variable org-dired-font-lock-face) (format ";; [\\[?\\]" nil) ;Font Lock Faces and Fontify
'(";")
"\ ")))
";; [\C-f]{}")
(if pwd-file-alist
;; This is for all occurrences of `\\[font-lock-keyword-face]'.
(setq-default pwd-file-alist t)
(set (make-local-variable
"%file: samples-15300"
======== SAMPLE 1 ========
(regexp (substring file-name))
(match-string 1))))
(when regexp
;; `regexp-quote' has been renamed from \"^[ \t\n\r]+\\'" to \"^[\n\r].
(cons (regexp--search-forward regexp-quote nil)
(regexp-quote--expanded-text-1 t)
(regexp--read-string)))))
;;;###autoload
(defun regexp--replace-start-regexp-with-last-regexp (regexp--line-number)
"Insert a regexp string substring REGEXP-LINES, replacing point with point.
Return a newline. REGEXP-LINES has the form (REVS OFFSET . NODENUM),
and NODENUM may be an integer or (integer) or (string) or (number).
The match must be within the first line of a file.
Replace file with REGEXP-LINES matches that the previous line of file would have matched without
a confirmation.
\(The first case is ignored.)
The result is a string whose starting position is the current matched
line string.
In a newline the match is broken if it is before or after the
start of a newline. In a newline preceding or following a comment, the
match is broken as for a comment, and then back through any other regexp."
(let ((match nil)
(start-regexp (cond ((equal start-regexp
regexp--line-number)
((= (following-char) ?\()
(regexp--start-regexp-regexp-1 regexp-line-number))))
(t regexp-nonmatch-re no-match))
(regexp--replace-text re nil nil t nil
(regexp-quote-re
regexp--line-number regexp--mark-regexp nil re
regexp--mark-nonmatch-re no-match-re
(regexp-regexp-1
(concat
(regexp--line-number
(regexp-quote-re
(regexp-quote-re regexp--mark-regexp nil re)
nil
no-match-re no-match-re re
======== SAMPLE 2 ========
(or is-not
;; No such file.
(push (list 'xen-1 'xen 1 t)
'x-end-1 xen-1))
(setq n 0))
(while (<= n xen-1)
(let ((i 0))
(when (and (consp n)
(listp (car n))
(nth 2 is-not)
(consp j))))
(forward-line)))
(setq is-not 'xen-1))
(if (not (string-match "\\`[ \t]*$" n))
(setq n (down-list 1))
(while (<= n (setq j 1))
(setq j (1+ j))
(if (equal is-not 'xen-1)
(setq j (+ j 1))
(if (equal xen-1 'xen-1)
;; A better solution for the above case.
(setq j nil)
(if (> j 0)
(with-current-buffer n
(while (and (> j 0)
(consp (car j))
(not (equal xen-1 'xen-1)))
(setq j (1+ j))
(while (<= j 1)
(let ((xen-1 j))
(while (and (> j 0) (looking-at "[ \t]*$"))
(xen-1 (match-beginning 1) (match-end 1) xen-1))))
(setq p (point))
(while (not p)
(setq
(cons (cons xen-1 (car p)
(+ xen-1 (caadr p))))
(when (> j (point))
(when (car (aref p xen-1)))
(setq p nil))
(setq p t))))
(setq
j (cons p j))
v
(cl-incf v)
(when (or (null j
======== SAMPLE 3 ========
(if (and (not (eq arg (char-syntax (char-after))) ? )
(funcall 'append append
(1+ (length (propertize
(char-after (match-end 0)))))))
(and (= (- arg 0) (+ arg 1))
(= arg (+ ?! (+ arg 2)))))
(forward-char)
nil)
(if (null arg)
(progn
;; Note: In the middle of the line, we must be careful to move past the point,
;; which is also the end of a block of input. Don't move past one unless
;; there's at least a reasonable amount of input to go.
(forward-char -1)
(let ((begin (/ (line-beginning-position) ? )
(end (- (point) arg)))
(begin (+ (point) arg) 0)
(end (- (line-beginning-position) ? %)))
(throw 'exit nil))))
(forward-line -1 nil))))
;;; ;; `c-mode'
(defconst c-c-mode-alist
(cond
;; `C-mode' is only for `C-mode', which has the same features as in
;; `mode-abstract-p':
((eq (c-char-after (point)) ?\0)
(setq c-mode-table-default)))
(if (looking-at "\\$\\(\\$\\|?\\) + $\\)?\\(.+\\)")
;; We want the same value to be a symbol (and the symbols are
;; "positive, nil, `s', `g' or nil).
(let ((c-symb (match-string 2))
(s-symbol (c-newer-than-bol (+ c-c-min-syntax (+ c-c-c-max-syntax))))))
(setq arg 0)
(t
(setq c-mode-tables nil)
;; `C-mode' returns a list of symbols. It can have one element each, so
;; it's a `list' with symbols that are one of those symbols.
(setq c-mode-table-default nil)
(setq c-mode-table-default
(if (integerp arg)
(let ((c-point-before (point))
(c-point-before (1+ arg)))
;; Don't throw an error if the c-point-before
======== SAMPLE 4 ========
(unless (zerop
(> (get-buffer "*GnuErds*") (or (symbol-value 1)
(buffer-file-name))))
(setq gnus-gnus-buffer-name
(get-buffer gnus-gnus-buffer-name)))
(setq gnus-gnus-buffer-name nil
gnus-gnus-buffer-name)))
(gnus-message 5 "GnuErds%s has a valid Gnus buffer" gnus-server))
(gnus-read-attribute-from-server 1))))))
(deffoo gnus-edit-find-file-other-window (org-latex-server &optional file buffer)
(if gnus-edit-file-other-window
(org-with-wide-buffer
(let ((buf (buffer-base-buffer gnus-file-coding-system)))
(setq gnus-user-login-string nil
gnus-user-login-suffix nil
(and (string-match "\\`\\([^:]+\\) \\(.*\\)" org-use-gnus-split-regexps)
(replace-match "^:;$")
(delete-file "http://<.gnus.org>")
(insert-file-contents (symbol-name gnus-file-coding-system) t t)
;; This file exists already, so just kill it.
;; Remove some junk.
(gnus-delete-file gnus-user-login-string t)
(kill-buffer gnus-user-login-string))
(user-error "Unterminated buffer for editing: %s" (point-marker)))
(let ((inhibit-read-only t))
(if buffer
(progn
(gnus-run-hooks nil nil gnus-group-kill-functions)
(gnus-delete-file gnus-user-login-string)
(gnus-message 5 "GnuErds%s has a valid Gnus buffer"
gnus-server (buffer-file-name))
(if (string-match "^\\([^:]+\\) \\(.*\\)\\'" buffer-file-name)
(delete-file gnus-confirm-confirmation)
(setq buffer-file-name t
"%file: samples-15200"
======== SAMPLE 1 ========
c)
(and (string-equal
(setq r (plist-get info :ranges)
d (plist-get info :dns)
c (plist-get info :cls)
c (plist-get info :csts)
d (plist-get info :ds)
d (plist-get info :dses)
d (plist-get info :dseses)
c (plist-get info :cfs)
c (plist-get info :cfs-names)
d (plist-get info :cfds)
d (plist-get info :ns-names)
d (plist-get info :ns-names-p)
d (plist-get info :ns-names-p-calls))
(when (stringp r)
(throw 'no-match
(mm-unescape-region (point-min) (point-max)
(progn (forward-line 1) (point-max)))))
(setq type (make-face (org-list-type-to-range info))
type))
;;; Acknowledgments
;;;###autoload
(defun org-list-files (file &optional type)
"Fetch information on the current buffer from a file in the list.
\(fn FILENAME FILE)"
(or
(org-list-files t type type file)
(let ((files (org-list-files t type file)))
(save-excursion
(while (string-match "\\($\\+\\)$" file)
(cond ((numberp (car files)))
((numberp (car files)) nil)
((= (length (char-after)) 27)
(dolist (file files))
(org-list-files-to-all
(if (car (cdr (cdr files))))
files
(when (cdr (cdr files)))))))
(org-list-files-to-all 'name)))))
;;;###autoload
(defun org-list-files-to-all (file &optional type)
"Fetch information on the current buffer from a file in the list.
\(fn FILE)"
(or
(and (org-list-files t type file)
;; FIXME: Can't use type to save the list with `eval'.
(let* ((rhs (plist-get info :rhs))
(rhs (plist-get info :hts))
(type (plist-
======== SAMPLE 2 ========
c-find-tag-in-backend-p (line-end-position) (point) 'c-forward-syntactic-ws))
(should (equal (c-syntax-syntax (line-beginning-position) 'c-forward-syntactic-ws))
(string-match "^\"\\'" (match-string 1))
(string-match "^" (match-string 2))
(string-match ">" (match-string 3))
(string-match 'c-cursor-face 'bol (point-min)))))
(ert-deftest gnus-lex-get-completion-type ()
(beginning-of-line)
(gnus-check-case-fold ()
"\\{[0-9]+:\\}")
(should (equal (c-in-syntax (1- line-beginning)) "\\`\\'")
"\\`\\'")
(should (equal (c-in-syntax (line-end-position) 'c-forward-syntactic-ws))
"\\`\\'")
(should (equal (c-in-syntax (line-beginning-position) 'c-forward-syntactic-ws))
"\\`\\'")
(should (equal (c-in-syntax (line-end-position) 'c-forward-syntactic-ws))
"\\`\\'")
(should (equal (c-in-syntax (line-beginning-position) 'c-backward-syntactic-ws))
"\\`\\'")
(should (equal (c-in-syntax (line-beginning-position) 'c-backward-syntactic-ws))
"\\`\\'")
(should (equal (c-in-syntax (line-end-position) 'c-backward-syntactic-ws))
"\\`\\'")
(should (equal (c-in-syntax (line-beginning-position) 'c-forward-syntactic-ws))
"\\`\\'")
(should (equal (c-in-syntax (line-end-position) 'c-backward-syntactic-ws))
"\\`\\'")
(should (equal (c-in-syntax (line-beginning-position) 'c-forward-syntactic-ws))
"\\`\\'")
(should (equal (c-in-syntax (line-beginning-position) 'c-backward-syntactic-ws))
"\\`\\'")
(should (equal (c-in-syntax (line-beginning-position) 'c-forward-syntactic-ws))
"\\`\\'")
(should (equal (c-in-syntax (line-beginning-position) 'c-backward-syntactic-ws))
"\\`\\'"))
(ert-deftest gnus-lex-check-case-fold ()
(mm-check-case-fold ()
"\\{[0-9]+:\\}")
(should (equal (c-in-syntax (line-beginning-position) 'c-backward-syntactic-ws))
"\\")))
;;; gnus-lex-check-cursor-face
(ert-deftest gnus-lex-check-case-fold ()
(mm-check-case-fold ()
(c-in-sy
======== SAMPLE 3 ========
c. For the sake of future tests, the values (C-g), (X-q), (O-e) are not used here.
(autoload 'clib-cache-find-file "clib" "\
If `clib-cache-get-file' is nil: use found file in the cache.
If you only know the file name in `cache-files', use find file (as returned by
`clib-parse-file-name'), otherwise see info at the end of this file.
This function assumes the `cl-cache-get-file' attribute is non-nil,
the current file should be found in a directory (with *cl-cache-find* in order)
instead of in the current buffer.
The default for a cache is the file name found when `cl-cache-find-file' is t.
Use of the cache should not be restricted; the default for a directory is that of
its own file; in this case cache files should in no way be modified.
The default for a cache is the type of file; `cl-cache-type' is also
considered. By default, this type is `file (otherwise ignored).
For the sake of future tests, the values (Q--, Q-e), `cl-cache-value' and
`cl-cache-value' are not used here.
Each element of the `cl-cache-get' function should also use cache data as
a cache value.
This is a convenience function. It provides a way of checking
any part of the data that might be used for subsequent compilation of
cl-cache information.
`cl-cache-entry' must be a symbol which is a string, a cons of the form
`files-or-comments-or-comments' if not nil, `cached-all-files' if present, 'files'
if nothing was found, `cl-cache-files' if found in cl-cache-files
or `cl-cache-buffer-list' if no file-cache is specified.
`cl-cache-entry' must begin with `[Q-e].
`cl-cache-file-name' will be a plist of all files in `cache.cache'."
:type `(let ((,(cl-default (mapcar
(append
(function (lambda (file)
(cl-incf (cl-intify (or file (list file (or nil 1)))) t))
nil
(append
(function (lambda (file)
(cl-intify
(cl-intify
(or file (list file (or nil 1)))) t))
file nil)))
files-or-comments-or-comments)))
:group 'cl-cache-entry)
(defcustom cl-cache-entry nil
"If nil, all file or file references are treated as found.
If `cl-cache-entry' is nil, the cache is also considered to contain
files in the directory specified on the file. This information is collected from
`cached-all-files'."
:
======== SAMPLE 4 ========
c:font=2782,1st5#0000009:1"))
(if font-lock-fixed-font-lock
(nxml-fontify-text)
(insert "@text:" 'fontname-face 'sans-shades-white))
(let ((font-name
(or (symbol-value font-name) (symbol-value font))
;; FIXME ";; = = = = = = = =" in this case seems more appropriate
(font-lock-concat-name font-name)
(string= font-name "\\([a-zA-Z0-9]+\\): \.+\\'")))
(nxml-fontify-text))
(nxml-font-lock-comment (nxml-get-text-property)))))
(defun nxml-get-text-property (text-property)
"Return a text-property from TEXT-PROPERTY from the current line.
WINDOW must be a w32 window."
(let ((default (make-sparse-keymap buffer-file-name))
(buffer-local-value ""))
(nxml-insert-text-property text-property)
(when (and (eq (car text-property) nxml-current-line)
(and (< (point) (/ (point-max) (point-min))))
(point))
(nxml-display-text-property)))
(defconst nxml-nominal-line-width
(nxml-nominal-line-width nxml-nominal-line-height))
(provide 'nxml-insert-text)
;;; nxml-insert-text.el ends here
<|endoftext|>;;; nxml-noconf-indirect.el -- Non-constant noconf input code for nxml's indirect file.
;; Copyright (C) 2001-2005, 2007-2019 Free Software Foundation, Inc.
;; Author: John Wiegley <w@gnu.org>
;; Maintainer: emacs-devel@gnu.org
;; Created: Mon Jun 15 22:00:58 2008
;; Old-Version: 1.4
;; Keywords: multilingual, indirect, nxml, indirect3, nxml-ntoc-table
;; Homepage: http://www.nongnu.org/node/nxml-noconf
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; nxml noconf-indirect and nnoconf-non-conforming-infofile nxml-noconf
;; are written for nxml, and also support indirect types like:
;;
;; -N-<char> and
;; -X-<char >.
;; -<char> is now an indirect type, like -x and -X:".
;;
;; Indirect classes are not available for nxml code, but for indirect2.c
;; because they only need to return value.
;;
;; nxml-nocate-coding-system nxml-indirect-code-system is a list of coding
;; modes. We could build nxml-indirect-coding-system from this entry
;; because that is useful for debugging; i.e. for building nxml code that has a
;; different coding system
"%file: samples-15100"
======== SAMPLE 1 ========
(gnus-summary-find-tags)
(t)
(nth 2 nnfetch-articles-flag-lists))))))
(setq nnfetch-articles-flag-commands
(lambda ()
(list (cons nnfetch-articles-flag-commands)
(concat "*" (gnus-summary-find-tags)
nnfetch-tags))))))
(if (or type-string nnfetch-tags)
nnfetch-tags))
(gnus-summary-check-articles t nil))
(when (mailing-address-p nnfetch-users)
(while (zerop nnfetch-user-name)
(push (cons user-name (car nnfetch-users))
nil t))
(push (cons user-name nnfetch-articles)
mnfetch-articles)))
(when (and nnfetch-articles
(gnus-read-all-headers (prefix-numeric-value
(nth 2 nnfetch-articles-flag-list))))
(push (cons user-name nnfetch-articles)
mnfetch-articles)))
nil)))
(t
(gnus-summary-check-articles t))))))))))
(defun nnfetch-all-articles (articles-flag)
"Remove all articles from this list.
Remove any groups that will be removed from this list
because a group named `gnus-summary-articles-flag' will create an `
======== SAMPLE 2 ========
(eq (car-safe e) 'delete)))))
(cdr (nthcdr 5 (1+ (car e)))))
((eq (car-safe e) 'delete)
(let ((entry (car e))))
(while (setq entry (nthcdr 5 entry))
(setq nc (cdr entry))
(setq e (car-safe e)))
(setq nc (car-safe nc))))))
((and (eq 'delete t)
(function-call 'delete-file-name-hook entry))
(if (memq 'delete-file-name-type t)
(progn
(if (funcall 'directory-file-name-function)
(if (string= (cdr entry) 'directory)
(delete-directory entry)))))
(setq nc (cdr nc)))
((eq 'delete t)
(delete-directory entry nc))
(t (error "Could not remove directory file: %s" user)))
(t (let ((file-directory-p file-directory-p)
(file-directory-absolute-p file-directory-p))
(file-name-as-directory)
(file-name-name (car file-directory-p))
(file-truename
(and dir (car (file-truename dir))))
(file-name-attributes
(and dir (file-name-attributes dir))
(and (setq file-directory-p
(cons (file-name-directory dir) file-directory-p))
file-directory-p)))
(if (not (or (and file-directory-p
(funcall 'delete-directory-file-name-function)) (file-directory-p file-directory))
(error "Dirs can be created with %S, %S" file-directory-p))
(delete-directory file-directory-p)
(if (or (and (and file-directory-p
(funcall 'directory-file-name-function))
(and (file-directory-p (nth 1 (list file-directory-p)))
(funcall 'delete-directory-file-name-functions)))
(setq file-directory-p (delq nil file-directory-p))
======== SAMPLE 3 ========
(if (match-beginning 2)
(match-end 2)))
(set-match-data
(match-end 0)
(if (looking-at "\\`[ \t\n\p]+\\'"))
nil)))))))
;; FIXME? The regexp should be the same for each match.
(dolist (g regexp)
(cond
((eq (match-beginning 0) (match-end 0))
nil)
((eq g (buffer-string))
t)
((not (zerop (setq cmp-chars ()
(buffer-substring
(match-end 0) (match-end 1))))
(let ((posp (match-beginning 0))
(pos (match-end 0)))
(if (string-match (cadr cmp-chars) (syntax-ppss))
(setq p (match-end 0)
vhdl-chars nil))))
(setq cmp-chars nil))))
;; FIXME? This matches at least one matching
;; line. The rest of the lines should be unquoted
;; before the match for this one.
(let ((match (string-match-p match (syntax-ppss)))
(pos (match-end 0)))
(if (equal (cdr (assoc new-match-prefix (line-beginning-position)))
regexp)
(setq p (match-end nil)))
(if vhdl-chars
(setq pos (make-string pos (match-end t)))
(setq p (match-end nil))))
(cond
((eq (car-safe (nth 2 (syntax-ppss)) (nth 1 (syntax-ppss))
'match-end) nil)
((eq (car-safe (nth 2 (syntax-ppss)) (nth 2 (syntax-ppss))
'match-end))
(setq match (mapconcat #'identity
======== SAMPLE 4 ========
(error "The Emacs debugger can't debug the Emacs project")))
(list nil "Debugged" t)
(list nil "Incorrect" not-debug nil t))
(t
(error "Debugging all projects using Emacs")))
;; (setq list nil "\n"))
(defun ebnf-compile-process-files (paths)
(with-current-buffer
(setq path (ebnf-compile-process-file-directories (or path ""))
path (ebnf-compile-process-file-args (or path ""))))
(set-process-filter process 'ebnf-compile-processes nil)
(ebnf-compile-process-files
0 nil nil nil nil path paths)
(cond
((stringp path)
(or (string-equal path "")
(error "The Emacs debugger cannot debug the Emacs project"))
(error "EBNF can't debug the Emacs project"))
((equal path "\"" nil)
(ebnf-compile-process-file-directories nil path)
(t
(error "No compiled process names found"))
nil))
(t
(error "EBNF can't debug the Emacs project"))
(let ((entry path))
(dolist (directory directory1)
(let ((args (ebnf-compile-process-file-directories directory dir) )
(count 0))
(ebnf-compile-process-file-directories directory directory2))
)
(ebnf-compile-process-file-directories directory directory1 dir))))
(defvar ebnf-file-directory) ; default value
;; If directory is not local file, return nil.
(defcustom ebnf-directory nil
"Directory to search for files.
The list of directories and files to search for.
If ebnf-directory and `ebnf-get-directory-and-directory-regexp' are
equal, those directories must be in the ebnf/directory package
for the file to be searched relative to ebnf-get-directory-and-directory."
:type '(choice (const :tag "EBNF only" nil)
(const :tag "Do not use ebnf"
:value ebnf-directory))
:version "25.1")
(defun ebnf-compile-directory (file)
(with-current-buffer (or file
(ebnf-compile-directory file))
(error "Invalid directory specified for %s" (buffer-name)))
(ebnf-compile-directory
(cdr (assq 'directory file)))
(let ((dir (ebnf-compile-directory file)))
(and (not (file-executable-p dir))
(set-process-query-on-exit 'ebnf-compile-compile-directory dir)))
(set-process-query-on-exit 'ebnf-compile-directory 'exit
(buffer-file-name dir))))
;; This function uses the ebnf/directory module. It cannot
;; be customized. See doc for ebnf/directory.
(defvar ebnf-file-directory-regexp ""
"Regexp matching ebnf/directory names.")
(
"%file: samples-15000"
======== SAMPLE 1 ========
";; GNU Emacs: `\\[universal-argument]' is ignored, because \"\\+\\'" is not supported.\"
;; For more details and to check the value, see `emacs-lisp-version-check'."
;;
;; (message "You can use :set to set the Emacs version, but it's not really supported.")
;; (when (string-prefix-p "version" (aref system-version 1)))
;; (setq system-version 1))
;; (cond
;; ((file-remote-p "*emacs*" file)
;; (require 'xemacs)
;; (xemacs-tests "emacs-xemacs" nil t t "emacs")))
;;; User Variables:
(defgroup emacs-test nil
"Customization for Emacs test builds and tests."
:group 'tools)
(defvar c-tests-test-folder nil)
(defcustom c-tests-test-folder nil
"The folder in which Emacs tests run."
:type '(choice (const :tag "None" nil)
(string :tag "Other" )
(string :tag "Other" )
(repeat :tag "Set"
(string :tag "Variables" ))
(repeat :value (copy-symbol
(file-name-nondirectory file) ".emacs")))
"Vectors for testing Emacs."
:type 'string)
(make-obsolete-variable 'c-tests-test-folder "24.1")
(defcustom c-tests-test-folder '(("emacs" . Emacs 23) (("/usr/share/emacs" . emacs 24) (("/usr/local/share/emacs" . emacs 5) (.emacs 6))))
(defcustom c-tests-test-folder (make-local-variable 'c-tests-folder)
"Variable to use for testing CVS tests."
:type 'variable)
(make-variable-buffer-local 'c-tests-test-folder)
(defcustom c-tests-test-folder nil
"An alias for C-tests-folder.")
(defcustom c-tests-test-folder-name "test"
"Name of Emacs test folder."
:type 'string)
(make-variable-buffer-local 'c-tests-test-folder)
(make-variable-buffer-local 'c-tests-test-folder-name)
(defcustom c-tests-test-folder-variables nil
"The names of variables for testing test builds and tests."
:type 'string)
(make-variable-buffer-local 'c-tests-test-folder)
(make-variable-buffer-local 'c-tests-test-folder-variables)
(make-variable-buffer-local 'c-tests-test-folder-variables)
;; For additional documentation:
(defcustom-c-tests-test-folder-version "21.1"
"Version number of Emacs test folder to test."
:type '(choice (const "27.1") (const "27.1.1") (const "26.6.7.2") (const "26.9.3.5") (const "26.9.3.4")
(const "26.9.8.1") (const "26.9.4.1") (const "22.9.4.2") (const "24.1.9.1")
(const "23.1.3.1") (const "21.1.3.1") (string "_a")))
"Vectors for testing CVS tests."
:type 'string)
(make-variable-local-hook 'c-tests-test-folder-version
'(("26.1") ("26.1.2") ("26.9.
======== SAMPLE 2 ========
(dolist (char charc)
(when (memq (char) '(nil char))
(let ((cnt 0))
(if (< (car char) cnt)
(throw 'exit nil))
(condition-case-if-debug nil
(throw 'exit nil))
(throw 'exit nil))))))
(setq cnt 0)
(setq charc (char-to-string charc))
(if (< char0 cnt)
(throw #'exit) ; error: a non-nil char
charc)))
;;; Internal variables.
(defvar org-babel-babel-list-hook nil
"Hook run after `org-babel-list-hook' is activated.")
(defvar org-babel-list-hook nil
"Hook run after \\[org-babel-list-hook]' is activated.")
; Functions
;
(defun org-babel-complete-babel-object-p ()
"Return a list of all objects with the same name as `current' buffer.
Return a list of the object names in the current buffer.
Return its argument list with empty args, e.g \"babel\".
If there is no argument list return nil."
(save-excursion
(goto-char (point-min))
(while (and (not (eobp))
;; We're in a complete object
(skip-syntax-forward "b:w:\\([^ \t\n]+\\)"))
(let ((obj (babel-object-at-pos (point)))
(object (babel-object-at-pos (point)))
(object (obarray-or-list object))
(object (ebrowse-object-at-point)))
(while (and object
(looking-at "[ \t\n]+\\(\\)[^ \t\n]+\\*\\(\\\\( \t-+*\\)\\{1,\\(\\(\\<\\|\\<\\|\\<\\|\\<\\|\\<\\|\\<\\|\\<\\|\\<\\|\\<\\|\\<\\|\\<\\|\\<\\|\\<\\|\\<\\|\\<[ \t]\\)[ \t+]+\\s")
(save-excursion
(forward-char 1)
(if (and (null obj) obj)
(throw 'exit obj))
(move-marker obj nil))
(setq obj (progn (forward-sexp 1)
(list object)))))
(when (not (eq (downcase obj) 'bol)
(list 'quote (car object))))
(setq object nil))))
(if (and (eq (following-char) ?+)
(or (string-match
(regex
======== SAMPLE 3 ========
;; Don't make "file-exists" (see the note on this), because it does not really resolve
;; in the directory structure. (fn f)
;; FIXME, it seems, it seems there's an explicit conflict with tty.
(t
;; When the current buffer is not in a directory, make the current one in
;; the "directory". If the "directory" can be defined, that must be
;; created automatically. Note that it's a directory, not a buffer.
"buffer" nil nil nil)
(setq f (or (buffer-list) ""))
(when (and file
(file-exists-p f)
(not (equal f file)) ; don't override anything
(eq file file-exists-p)))
(set-buffer-modified-p nil)
(make-directory buffer-file-name nil t t t))))
(defun mh-mode-name ()
"Find the corresponding buffer name in the current buffer.
If the variable MODE-NAME was set, the buffer may only exist if
it has the corresponding name."
(interactive)
(save-excursion
(let ((file-name-completion-ignore-case nil))
(when (or (and (not f) (not (stringp filename nil))) (not (stringp filename nil)))
(cond
;; Don't try to find the name
(mh-mode-find-named-buffer (file-name-as-directory filename t t))
(mh-mode-name
(if (file-name-directory filename) (setq filename nil))))))
(set-buffer-modified-p nil)
(mh-mode-name)
(file-name-as-directory))
t)
(defun mh-set-named-buffer (name buffer name)
"Set that buffer to NAME if named in that buffer."
(interactive
(list (mh-set-named-buffer (buffer-name))))
(let* ((name (buffer-name))
(buffer (buffer-name))))
(put buffer name (point-marker)))
;;;###autoload
(defun mh-set-named-parent ()
"Set the named parent to the buffer named NAME in BUFFER."
(interactive)
(let ((parent (read-buffer "Select a file for named buffer: ")
(buffer (read-file-name "Name of file name: ")))
(if (buffer-file-name name)
(or (mh-read-named-buffer parent)
(error "No named buffer")
(let ((buffer (read-file-name "Default buffer for named buffer: ")))
;; Buffer name doesn't exist in `mh-toggle-buffer' because
;; the variable `buffer-name' has been set.
(setq buffer-name (buffer-name)))))))
(defun mh-toggle-buffer (buffer)
"Set BUFFER to be one of the named buffers in BUFFER.
Calls `mh-toggle-buffer' to toggle selected buffers. If CALLED is non-nil, call
BUFFER to toggle the selected buffers. If NOT-FULL-BLOCK is non-nil, call
BUFFER to set up the buffer's size to reflect this value."
(interactive "*P")
(mh-switch-to-buffer buffer)
(mh-set-new-local-variable nil 'm
======== SAMPLE 4 ========
(setq lsh-regexp "\^[\n;]"
"("
lsh-regexp lsh-regexp-regexp-regexp)
"\
\; \; ; \; \; \; \; \; %")
(or lsh-regexp-regexp (getenv "SHR-REPLACE_HISTEMP_SRC")))))
lsh-regexp-regexp))
(defun lsh-regexp-regexp (regexp-list &optional case-fold-search)
"Return RSH-REPLACE_HISTEMP_SRC.
When called from Lisp, return the RSH-REPLACE_HISTEMP_SRC value."
(mapcar
(lambda (l sh-regexp-regexp)
(let ((case-fold-search)
(case-fold-suffix)
(suffix-p t)
(suffix-p (list (char-to-string (symbol-name (car sh-regexp-regexp))
lsh-regexp-regexp)))
case-fold-search)
(if (and (stringp suffix-p)
(string-match "\\(\\S-+\\)*" suffix-p nil))
(if (string-match
"\\s-*\\([+-]+\\(\\S-+\\)+\\)"
suffix-p
case-fold-match-regexp t)
(match-string 1)
(match-string -1))
(catch (string-match (substring suffix-p 1)
(let* ((regexp (substring suffix-p 1
lsh-regexp-regexp t 1))
(match-string 2)
(if (equal (substring suffix-p 1 string) (length re))
(while (and
(not (eolp))
"%file: samples-14900"
======== SAMPLE 1 ========
range-line
;; or nil, in both cases a "line"
;; will be displayed in the buffer, but only one line of
;; code.
(and (memq (c-next-defun) '(start-line b))))
(save-excursion
(goto-char (1- pos))
(when (re-search-backward "^[ \t]*\\(\\[[0-9]+\\]\\|[^:]*\\*\n\\)+\\([ \t]+[a-zA-Z][\\]\\|[[0-9]+\\]\\|[[1-9]\\]" end t)
(match-string-no-properties 5)))
;; The line before the start/end position will always be
;; shown.
(goto-char (max (point-min) pos))
(cond
((equal ?[ "") "")
((equal ?[ "") "")
(t
(setq pos (point))
(if (re-search-forward "^[ \t]*\\([0-9]+\\)" end t)
(match-end 1))
(if (and not-backward (re-search-forward ?[ start-line 1 nil t))))
;; This line has to begin at the same beginning as the
;; following (in some circumstances. The line is always
;; (but not including a newline) and the following
;; line might not (it could be a blank line)
;; in a text-mode function, such as "\\v<a-zA-Z0-9_]" or
;; "\\w[\n]*\\([^\\]*\\)$.
;; It's the exact same line as the first case,
;; and there might be another line already
;; left if one was before the line.
(let ((newline
======== SAMPLE 2 ========
range) are also allowed to
(while (< (point) (next-line))
(forward-char 1)
(save-excursion
(beginning-of-line)
(insert "\n") (setq prev-line to-prev-line)
(next-heading)
(insert (format " [?\n] ; %s %s\n")
" ")
(beginning-of-line)
(insert "\n; ")
(when to-next-line
(setq prev-line (line-number-at-pos (point)))
(insert "\n ")
(setq prev-line to-prev-line)
(forward-line 1)))
(insert "\n"))
(defun org-babyl-edit-heading (&optional buffer)
"Edit the previous body.
With prefix argument BUFFER, edit the heading."
;; This hook is for backward compatibility with org-babyl's use
;; of the obsolete "backward-paragraph" or "blank line" functionality.
(if org-babyl-edit-heading
;; (let* ((p (current-column))
(c (point))
(org-babyl-line-cursor)
(g (current-column)
(last-line)
(t (end-of-line)
;; "beginning-of-paragraph"))
(b (org-babyl-backward-invisible-thing))
(b (save-excursion
(backward-char 1)
(if (org-babel-overlay-visible-p)
(goto-char (< (point) (point-max)))
(point)
(progn
(or (bobp)
(cline-end-of-line))
(goto-char (point-max))
(not end-of-heading)
(beep)
(point))
(point))))
(babyl (current-column))
(babyl nil)
(org-babyl-beginning-of-heading)))
`(progn
(progn
(end-of-body)
(setq b (next-heading) ; go back into current heading to
======== SAMPLE 3 ========
range-list-list)
(if (listp val)
(setq-local viper-val (list-values val))
(if (listp value)
(condition-case ()
(list val)
(error (cons (apply 'append val
(list 'append val))
value)))
(error (funcall func (mapcar (lambda (viper-val) viper-val (list viper-viper)))))
(error (error viper-val))))))
(defcustom viper-val-inhibit-invisible nil
"If non-nil, hide the effect of invisible variables and methods in viper buffers.
If this variable has an invisible value, it has zero visibility unless the value
has an override clause."
:group 'viper-buffers
:type 'boolean)
(defun viper-inhibit-invisible ()
"Disregard the function `inhibit-invisible-variable' to prevent it from showing in one buffer."
(interactive)
(let ((buffer (current-buffer)))
(kill-buffer buffer)
(if viper-invisible-on-unmap-p (message "%s %s" (symbol-name viper-invisible-on-unmap-p) 'map)))
(setq viper-invisible-on-unmap-p nil))))
;;;###autoload
(defun viper-invalid-keywords ()
"Return t if the list of keywords of the symbol \"MOUSE\" includes keywords
in that prefix (`MOUSE1') and a valid keyword (`MOUSE2').
This is an error if there is no valid prefix in MOUSE1,
and a valid keyword in MOUSE2. In fact there is only valid
prefix in MOUSE2 if the list contains the symbol \"``."
(when (not (re-search-backward viper-prefix-regexp nil t))
(setq keywords (search-backward viper-prefix-regexp nil t))
(when (null keywords)
(message "%s: List is invalid.")
(setq keywords
(replace-match "" " ")))
(when viper-matching-p (ignore-errors (pop warnings)))
(while keywords
(and (not keywords)
(string-equal (split-string keywords ": ") (point-max)))
(funcall (aref keywords 0) (setq keywords (aref keywords 0)))))
(when keys
(setq keys (intern keys))
;; Make sure we have an unibyte prefix if `MOUSE' is a ": ".
(when (string-match (intern keys) keys)
(error "Unibyte prefix does not work"))))
(while keys
(let ((unibyte (intern keys)))
(when (eq (intern (abbrev-list (car keys)) (cdr keys)) unibyte)))
(if (nth 3 unibyte)
(setq keys unibyte))
(let* ((unis (list unis 0))
(inherited (intern (length keys))))
(closest-list unis t)
(setq keys (intern
======== SAMPLE 4 ========
range or a range
(t (cons nil)
(sort '("range" `((i-range)
(lambda (i range)
(setq range (1+ (car i))))))
range)))
((eq (car i) 'integer-limits)
("default" nil)
(sort '("range" `((i-range) (lambda (i range), 'integer t)
(lambda (i range)
(setq range (1+ (car i))))))
range))))
((eq (car i) 'integer-limits)
(or (eq (cadr i) 0)
(error ""))
(sort '("range" `((i-range) (lambda (i range)
(setq range (1+ (car i)))))))
(sort '("range" `((i-range) 0
; A range with no limit.
; A range with a limit.
(default 0))
(integer t)
(if (null range) range
(setq default (1- (car range))
range nil))))
range)))))
(defvar range-range nil
"The number of characters in a character range.")
(defun range-range (arg1 arg2)
"Return the range of arg1 and arg2 of the range arg1 and arg2.
The range can be sorted by the number of characters to move.
It defaults to the current range (i.e., the current range to
move as well as the range range that it came from)."
(* 0 (* arg1 arg2) range))))
(defun range-range-list (arg1 arg2)
"Return list of range arg1 and arg2 range."
(* 0 (* arg1 arg2) range)
(if (null arg1)
(error "Must be a range"))
arg)
(defun range-range-range-list (&optional range)
"Return list of range arg1 and range arg2 in the range arg1 and arg2."
(save-restriction
(list arg1 range)
(while (and (not arg1) arg2)
(setq arg1 (1- arg2))
(setq range
"%file: samples-14800"
======== SAMPLE 1 ========
et
(save-excursion
(let ((s (point-max)))
(beginning-of-buffer)
(dolist (buffer-string)
(with-current-buffer buffer
(push buffer s)
;; This region is unterminated, so the point must be
;; the first buffer in the buffer list.
(push buffer (cons (buffer-string) buffer-list)))))
;; This region should be terminated by a newline, i.e., the line's
;; line is not delimited by an empty line,
;; so the region itself should be terminated by a newline.
(goto-char (point-min))
;; Loop over the remaining region after beginning.
(forward-line -1))
))
(defun make-marker-region (&optional force)
"Make the point at the beginning of every new marker in the region.
The marker is always positioned on either the left or right side of
the current buffer."
(interactive "P")
(if (looking-at "\\([^]\\|_\\)"))
(goto-char (point-min))
(delete-region (line-beginning-position) (point)) (insert-marker (point-min) t))
(let ((buffer-list t))
(push-marker fill-buffer-list nil t)
(message "Making marker region")))
;;
;; Enduring marker;
(defun replace-marker (point &optional force)
"Split the buffer between marker and end of current marker.
This is used in the mode line for finding the first keystroke.
The marker is at the start of the current buffer.
If not at the start of the buffer, the cursor is moved to point by
one, unless point is at the beginning of one or more commands, such
as M-x marker, then the marker is shifted by one keystroke.
If the region does not exist, or if it does not have a marker, then
it won't create one."
;; If there is none, copy point to it; otherwise use the region.
(delete-region (point-min) (point-max))
(if (looking-at "\\[^]\\|_\\)" t)
(save-excursion
(goto-char (point-min))
(erase-buffer)))))
(defun mark-buffer (prefix)
"Mark region as BUFFER.
The mark must mark the region as a keystroke REGEXP.
If it's already marked buffer and the keypad is not set, and
it has a non-nil keycap for `mark' then mark that region.
For instance,
let ((s 0))
(beginning-of-buffer)
(forward-char 1))
(defun mark-region (prefix)
"Mark region as BODY in the buffer.
The region is then marked as a keystroke REGEXP.
If it's already marked buffer, mark it as a region."
(kill-buffer prefix)
(mark-region (point-min) (point-max))
(save-excursion
(goto-char (point-min))
(forward-char -1)
(goto-char (point-min))
(end-of-line)
(goto-char (point-min))
(delete-region (point-min) (point-max))
(forward-char 1))
;; Else mark buffer empty
(kill-buffer (current-buffer)))
;;
;; A common buffer, if it exists, it may be found
;; in the mode line or in another Emacs mode, or in a special
;; buffer
(defvar marker-
======== SAMPLE 2 ========
et-delete-and-rename)))))))
"Function used to delete a file in this buffer.
It takes one argument, an object (a file name), and
expects a name where it has been deleted.
A file's name is assumed to be in the same directory as the file it
is in; it's assumed to point to the same directory."
(function
`(lambda () (delete-directory-p 'directory-descriptive . . . tmp)) ; delete file with directory-descriptive
(while (setq file (get-file-buffer tmp 'dir)) ; rename
;; If the file's directory is not a directory, call delete-file-handler
(while file
(delete-file-handler tmp 'file-notify)) ; check if the file is a temporary file
(while (setq file (get-file-buffer tmp 'tempfile)) ; do not overwrite local file
;; If this file does need to be created -- create one; if
;; it doesn't, make sure it is a temporary file, and then delete it.
(rename-file (org-file-name-to-file tmp 'FILE-NAME)) ; rename file
;; If it doesn't exist -- delete the file -- create a new one. It should
;; be a temporary file, not a directory -- it should still be
;; an object, so if it gets created, then delete it as well --
;; delete-file may return some error -- make sure the file
;; has the proper name.
(if (and files (not (equal (file-name-directory tmp 'file-non-writable)
(org-file-name-directory-p tmp)))
(not (string= filename "temp")))))
(setq org-delete-file-handler
(mapcar (lambda (f)
(cond
((eq (car f) 'org-file-name-directory-function)
(let ((case-fold-search t))
(org-delete-file-for-temp-dir)
(org-file-name-directory-p tmp 'file-non-writable))))
(org-delete-file-handler
(let ((file-other-file nil))
(org-file-name-nondirectory tmp)))
;; We found a temporary file and the file's directory is
;; the same as tempfile.
(let ((tempdir (funcall delete-file-handler file temp))))
(push file temporary-file)
(with-temp-buffer
(goto-char (point-min))
(
======== SAMPLE 3 ========
et' and any of the modifiers that it does.
"b' (default -4, 1)
"f' -3, 11)
"i' (default 1)
"k' -4, 9)
"m' (* 4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4)
"q' (default 3 -4 -4 1")
"p' (* 1 -4 -4 -5 -4 -5")
"e' (* 4 -4 -4 -5 8)")
"p* (default -1 -2))
;;;###autoload
(defun mnemonics-edit (&optional comment mode-line-read)
"Edit this buffer to display a new message.
Like mpc, but don't send it to the mail reader."
(interactive)
(set-buffer-modified-p nil)
(defun message-edit ()
"Save new data between sessions."
(interactive)
(message-in-buffer
(m (with-current-buffer (erase-buffer)
(buffer-name (generate-new-buffer buffer-name)))
(message-in-buffer
t (m (with-current-buffer (erase-buffer)
(buffer-name (goto-char (point-min)) (point-max)))
(buffer-modified-p nil))))
(defun message-in-buffer (&optional buffer-name mode-line-read)
"Save data between sessions.
Like mpc, but don't send it to the mail reader."
(interactive)
(message-in-buffer (buffer-name (generate-new-buffer buffer-name)))
;;;###autoload
(defun mpc-in-message-buffer (name)
"Find the name of the current Mpc communication interface."
(interactive
(with-current-buffer mpc
(mapcar (lambda (m) (insert-buffer-substring (m m) (point-min)))) mpc)
nil t)
(setq mpc-buffer-name message-in-list-string)
;; Note that this calls `message-in-buffer' to avoid a bug like
;; a buffer-undo-when-pending-buffers in mpc.
(condition-case error
(message-in-buffer)
(error (message-error-with-errors
error "" mpc-buffer-name))))
(defun message-in-buffer-unmatched (name)
"Re-read the text of NAME."
;; This buffer-local copy of the current message gets the
;; message back in the current buffer.
(let ((buf (current-buffer)))
(with-current-buffer buf
(when (re-search-forward message-in-buffer-file-p nil t)
(insert-buffer-substring (process-buffer (current-buffer) (current-buffer))))
(replace-match ""))
;; Remove `message-in-buffer-end' from the list
;; (c-remove-from-history-filter 'message-in-buffer-history)
(insert (function 'message-in-buffer-end 'rehash t))
;; Remove `message-in-buffer-end' from the list
;; (c-remove-from-history-filter 'message-in-buffer-history)
(set-buffer-modified-p nil)
(message-in-buffer (c-buffer-live-p (current-buffer) 'goto-x-or-y-patch t)
nil t)
;; Check buffer-local copies in buffer-list format (c-check-buffer-list-format 'message-in-buffer-list-format)
;; `message-in-buffer-list-format' is not set to non-nil here
(goto-char (point-
======== SAMPLE 4 ========
etet/c-b-s):
(setq char1 (c-lang-const c-b-s)) (c-lang-string c-b-s))
(setq char2 (c-lang-const c-b-s))
;; C-B-s only allows case-insensitive chars because "[ \d]" has a case-insensitive prefix-chars
;; option.
(setq char1 (c-lang-const char1)) (setq char2 (c-lang-const char2))))
(defun c-b-s-to-c-g-and-c-g-and-g-and-g-and-g-and-g
(prefix-chars-in-prefix-chars c-b-s-to-c-g-and-g
c-b-s-to-c-g-and-g
c-b-s-to-c-g)))
(defun c-b-s-to-b-s-to-b-s (prefix-chars arg)
"Return a bs to bs prefix, the string, or nil."
(let ((prefix-chars t)
(prefix-g-int t))
(while
(memq prefix-chars (list prefix-chars))
;; Check case-insensitive prefix-chars.
(c-b-s-to-c-g t)
(cond
((c-b-s-to-c-g)
(setq prefix-chars
(cons prefix-chars
(cons (cons (apply prefix-chars (c-lang-const c-b-s-to-c-g) prefix-chars)))))
((and (setq arg (c-lang-const arg)) (c-lang-const (c-lang-const c-b-s-to-c-g))))
(/= 0 prefix-chars)
((eq prefix-chars 'case-insensitive)
;; In case of case-insensitive case-insensitive case ins:
;; (c-b-s-to-c-g)
((and (setq arg (c-lang-const arg)) (c-lang-const (c-lang-const c-b-s-to-c-g))))
;; In case of case-insensitive case-insensitive case ins:
(or (null (c-lang-const c-b-s-to-c-g)))) (error nil))
(if (c-b-s-to-c-g)
(c-b-s-to-c-g))))
;;; C-B-plus
;;;###autoload
(define-derived-mode c-b-plus-mode c-b-plus
"Major mode for editing the C-B.++ code snippets."
'default-value-table)
(defun c-b-plus ()
"Save the list of C-B.
The result should be a list where the first element will be the C-B code
in the buffer, and the second in the c-b-s-plus."
(let (code)
(while (and c-b-s-plus
(not (string= c-b-s-plus (car code)))))
(if c-b-s-
"%file: samples-14700"
======== SAMPLE 1 ========
set_arglist"
'semantic-complete-key)
(semantic-complete:tag (current-buffer)
'semantic-completion-arglist))))))
(set-semantic-tags-function tag 'tags-functions))
(semantic-compat-remove-tags (list tag 'tag-tag)
tag-tag)
t))
(defcustom semantic-syntax-test-fancy-syntax (make-keymap-keymap)
:version "22.1" ;; NO VARIABLE, DONE
"Minor mode for testing syntax in syntax-tests.
\(fn TAGS)" t nil)
(defvar semantic-syntax-mode nil)
(defvar semantic-syntax-tests nil
"Alist consisting of a list of semantic definitions and a keyword.
Each element represents a valid declaration. Each element is of the type `keyword'."
:tag "Keyword" :tag-id semantic :tag-name sym :value semantic-syntax
:group 'semantic-keywords
(let ((keysymbol semantic-syntax-tests) :keyword
(syntax sym-keyword
(append (semantic-check-syntax-mode semantic-syntax-mode))
semantic-syntax-tests))
(when (and semantic-symntax-tests
(setf (semantic-keyword-syntax sym) semantic-syntax-tests))
(setq sym-keyword (semantic-syntax-mode sym) es-keyword sym)
(semantic-update-syntax-tests)
(setq semantic-symntax-tests (list sym)))
(semantic-find-keywords-internal 'keyword sym))
:version "22.1" ;; NO VARIABLE, DONE
(defvar semantic-mode-hook nil)
(defvar semantic-tests-mode-hook nil)
(defun semantic-syntax-mode-hook ()
(let ((syntax)
(subst-char-type
(concat "\\`\\" (regexp-quote semantic-syntax-syntax-type)
"\\_`\\'" tag))
(subst-char-type
(concat "\\`\\(?:\\<\\|\\[ \t]\\|\\(?:\\<\\)\\([^\n]*\\)?\\)\\'\\(\\[\\(?:\\)[^\n]*)\\)"
"\\`\\+\\'"
"\\'"
"$\\]*\\'"
"\\?\\\\'" ; #\\()
"@"
======== SAMPLE 2 ========
set-marker 'font-lock-global-keywords)))
(defgroup font-lock-global-keywords nil
"Major mode for highlighting CSS syntax."
:group 'font-lock)
;;;###autoload
(defun font-lock-compose (name &optional name-optional mark-prefix)
"Compose CSS to a name.
Assume NAME is a symbol with prefix ARG and mark-prefix is ARG.
See `font-lock-compose-composition' and
`font-lock-compose-custom-composition'."
;; `font-lock-compose' is an autoloaded function so only a
;; `font-lock-compose' should run.
(let (startpos, endpos, start-column)
(when font-lock-compose-composition
(load-file-composite font-lock-compose-file)
(unless font-lock-compose-composition
(set-font-lock-keyword-face font-lock-compose-composition 'font-lock-keyword)
(set-marker startpos endpos 'font-lock-keyword)
(setq font-lock-compose-composition font-lock-compose-fontify))
(font-lock-compose-composition)
(font-lock-compose-fontify))))
(defcustom font-lock-complete-composite-or-composition-composition nil
"Composite or Composition to include in a `composite-or-composition'
commands.
When called from a file, the initial value of the variable is
used in `font-lock-compose-composition' and `font-lock-compose-command'
before calling font-lock on the file. It should always be a symbol."
:version "24.1"
:type 'boolean
:group 'composite)
(defcustom font-lock-compose-composition-fontify '("Composite" "Composition" "Composition")
"How to compose CSS fontified text."
:help-regexps "fontifies CSS fontified text: \\[fontify-regexp]")
(defvar font-lock-compose-command
(concat "sfontify-regexps: " (if (> (length (font-lock-compose-completion)) 0) " sfontify-regexps)))
(defun font-lock-compose-composition-function (name string
&optional)
"Function of `font-lock-compose-composition-command'.
See `font-lock-compose-composition'."
(save-pattern (current-buffer))
(cond
((looking-at "\\(?:\n\\)") (forward-line (- (match-beginning 2) 2))
(forward-line 0))
(t (error "Font Lock Composition Command %d" name))
(forward-line 2))))
(defun font-lock-compose-composition-composition (regexp name-nonp)
"Compose CSS to `font-lock-compose-composition' REGEXP.
REGEXP is a regular expression that matches text to be fontified.
If REGEXP is the same as `font-lock-compose-composition', this creates a
matching character so that `font-lock-compose-compose-composition'
is true if the `font-lock-compose-composition' value is nil."
(save-excursion
(let* ((regexp (save-excursion (following-char))))
(when (and regexp
(re-search-forward regexp nil t))
(let ((case
======== SAMPLE 3 ========
set-string (nth 0 this) stringp))
((string-match "&\"$" nil)
(concat (nth 0 this) "\n"))
((string-match "\"#\\(.*\\)?\\$" nil)
(nth 0 this) "\n"))
(t
;;
(concat (nth 0 this) "\n"))
(t (concat (nth 0 this) "\n"))))
(or (nth 1 this) "" t)
(error (car (nth 1 this))))
(if (and (or (cdr (cdr (nth 1 this)) ; we want a new line
(cdr (nth 1 this)) ; for "string"
(eq (nth 2 this) cdr) (nth 2 this))))
(save-excursion
(goto-char
(cadr this)
(cadr (if (< cdr (setq p (next-single-char-property-length (car this))))
(cdr (nth 2 this))))
(while (cdr (cdr (nth 1 this)))
(setq p (point)))
(forward-char -1)
(if (or (= (cadr this) p) (eolp)) ; we want a new text instead
(setq stringp (cadr (nth 0 this))))
(concat (nth 1 this) "\n")))
(if (string-match (nth 1 this) ?\s)
(setq stringp (cadr (nth 1 this))))
(setq p (point))
(while (cdr p)
(setq stringp (cadr (nth 1 p))))
;; If we are at p in this case, just return (list)
======== SAMPLE 4 ========
set-font (list '("C" . "b" . "c"))
t
(t
(list
(nconc
(append
(gnus-summary-current
(nreverse gnus-summary-current-header)
(list
gnus-summary-current-header)
(cons (list
(nth 2 (assoc t gnus-current-header))
(assoc t gnus-current-header)
(list gnus-current-header)))))
(and gnus-summary-current-header
(list "M" gnus-current-header)
gnus-summary-current-header))))
(goto-char (point-min))
(or (search-forward " " nil 'move)
(forward-line 1)
(let ((start (point))
(end (or (forward-line 1)
(skip-chars-forward " \t")
(point))
(max-column (if (<= (point) max-column)
(+ max-column
"%file: samples-14600"
======== SAMPLE 1 ========
"\\("
"\\)")
("/(" (cdr (assoc name nls-file-path)))
((cdr (assoc nls-file-path nls-directory-path))
((cdr (assoc (assoc directory-name
(cdr nls-file-path))))
(:filename nls-file-path)))))
"Options for ls files of mode-line, directory or local name.
If NOFILE is true, the file being visited normally will be
tracked separately. It always uses the local file system's default filename
or directory. When non-nil, no one can change this.
Note that the following command must be run twice for this value to work."
(if (and (fboundp 'ls-mode-line)
(fset (process-get proc 'ls-mode-line)
"ls-mode-line"))
(and (process-get proc 'ls-mode-line)
(list (car (rassoc (assoc 'regexp n ls-file-options-by-casing))))
(or (assq 'regexp (assoc (assoc 'regexp n) ls-mode-line-options))))
(let ((prefix (list "-l" "") nls-command-prefix)
(prefix nil))
(list (concat
(format "%3$" (if (assq "*" prefix "-l") "-l"))
"$" (if (assq "" prefix "-l") "-l")
"-d" "") (if (assq "*" prefix "-l") "-d")
;; Add a non-nil prefix option for this variable
(cons "prefix-" (mapcar
(lambda (x) (= (car x) (cdr x)))
(if (assoc "" prefix "-r" "?")) "-r"))
"-r" "") (mapconcat (lambda (x) (symbol-name (car x)) "-r" " "-a")))
(nth 2 prefix))
(setq nls-command-prefix (car prefix))
(list prefix (cond
(if (and (consp (car nls-command-prefix))
(consp (cdr nls-command-prefix))
(consp (cdr nls-command-prefix))
(list '("--- "
(list (car (list (cdr prefix))))
"--- ")))
(nth 2 suffix))
(if (and (>= prefix 0) (consp (car prefix))
(> (car (nth 2 prefix)) prefix))
"--- "
(nth 2 suffix))
======== SAMPLE 2 ========
"„º¡, 휚, 흨")
(21179 . "쁴") (20067 . "핿") (20942 . "섈픾 넙")
(20918 . "긼 뵙" (18073 . "사娳字字, 굼 신字")
(33996 . "묢엗") (35018 . "벐뽓 친") (30986 . "揌樔´ 빔안双泼 빔")
(20697 . "해위 샐일 낼의릴 돌걄릴미의 샐의 샐실일 샐사샐 샐일 길일 同字字, 갼칠 샐의 샐일 샐칠 óŒë¯¹ 샐을 샐을 샐을 샐잌할 샐을 샐았댴 빐할 샐았변는둑 셝어 낼구 각날 솵래 뀜 쌑할 샐스 톿 샐ḣ일 샐삄 샐쁴 핁찠릤찜나뎬 샐사사 샐­
솀놌할 샐에샐 샌삼 샐사 샌사 나도 샌사 샌사 샌사 맄질밌 샌마밀 돌 샌사 대 샜 실짬 사홴류 생파 생팢들 샙")
======== SAMPLE 3 ========
"format(arg) nil nil nil)"
"<table class=\"tr\" width=\"1\"><tr><td col=\"us\" text=\"")
(\"width=\"3\"\" id=\"top/bottom\" align=\"center\">\"
<td align=\"center\">\"
\"width=\"3\">height=\"1\"><div id=\"bottom\">\"
<td col=\"us\">\"
\"width:\" (?= (?0 . "")) "">\n</td></table><br/>\n"
"<table class=\"tr\" width=\"1\"><td align=\"right\">\"
<td col=\"us\">\"
\"height:\" (?0 . t) "<p><h4 col=\"1\">\"</h4>\n"
;; When used in Org mode; it adds the name of the
;; region to the tag's description.
(`(,class ,info-label))
(`(,class ,info-label))
(`(,class ,info-label))
(`(,class ,info-label))
(`(,class ,info-label))))
;; Set the `:label' property.
semantic-edit-tag-property))
;; The `:tag-name'
(when (save-current-buffer
(setq semantic-edit-tag-name
(cons `(:title . "\\". "Tag Name" ""))
tag-name)
(setq semantic-edit-tag-name (buffer-name))
(semantic-edit-tag-name))
semantic-edit-tag-value)))
(defun semantic-edit-tag-value (tag)
"The value of TAG with semantic-edit-tag-name.
TAG can be used inside Org mode."
(let ((tag (if (semantic-tag-p tag)
(semantic-tag-string tag)))
(value (semantic-tag-value tag)))
;; Set the `:tag-name' property. Note that the value of the
;; tag-name must be a string.
(semantic-edit-tag-string tag)
(condition-case nil
(let ((string (semantic-tag-property tag 'string)))
(if (stringp string)
(setq semantic-edit-tag-name (string string))
(semantic-edit-tag-name (semantic-tag-string tag)))
(error
(when (semantic-tag-is-active tag) (error "Tag %s not present" tag))
(unless (symbolp tag) (error "\nUnknown tag with current buffer"))
(let ((res (semantic-tag-rename tag res)))
;; Set the `:tag-name' property to `:tagname', if applicable.
======== SAMPLE 4 ========
"This program is intended to be run on your system, without any customization. It will provide
a means of setting up your GNU Emacs to make it customizable. You might get
the option to try out the variable and make it available for
the distribution of the GNU Emacs, if you are not already a member of
this list. If you do not have an existing GNU Emacs, this program
may be useful (e.g., with a minor mode) to make your
program available. If you really want someone to make your program easier
to use, this is the program you should try out.")
(defvar-local sessmine-interactive nil
"This special function can be used to inhibit the editing of Emacs Lisp.
If this option is used, Emacs will inhibit editing of Lisp by
setting this variable to t. The function will thus inhibit all Emacs Lisp
interactive commands.")
(defvar-local sessmine-mode-map nil
"The menu containing modes.
See the variable `sessmine-mode-map' for a directory or file name of
where to find the mode.")
(defvar sessmine-syntax-buffer-name nil
"This must be absolute before a substitution buffer name.
The buffer name must not contain a special character syntax which
will make it harder to customize a value of sessmine-syntax
and hence customize different buffer names.")
(add-hook 'after-hook 'sessmine-add-to-init-hook)
(defvar sessmine-menu-buffer-name nil
"The default name of the buffer of the buffer specified by `sessmine-mode'.
The buffer must be specified in a menu before `sessmine-show-buffer-name-alist'
returned.")
(defun sessmine-add-to-init-hook ()
"If non-nil, add a new buffer to the menu that contains the buffer
specified by nil which might be the name Sessmine mode already
supports.
It's a good idea to make the list in the minibuffer.
Here is the value of:
- `sessmine-mode' \"sessmine\")
When called after editing a buffer, it is used to add to this menu
the buffer specified by `sessmine-mode' and add some other buffer
name specified by nil, such as \"kill-em' \" to add,
this should be a buffer named \"\" with the current name,
that is a buffer, not a string, so it is not modified by any
inferior buffer, if any other buffer with the name \"kill\" appears in
that buffer.
As with buffer names, this variable is set to t when
`sessmine-add-to-init-hook' is called from the minibuffer.
If you are using Emacs or Lisp, you might want to customize this behavior
before you use Emacs by using the normal customization
command. See `lisp-mode' for the documentation of what this
variable does.")
;;;###autoload
(defcustom sessmine-mode "sessmine"
"The Emacs version of `sessmine'.
Sessmine mode adds mode lines to the minibuffer that are only
accessible by typing \"s\\|s\\|s:\"
These mode lines are inserted as text when the buffer name
of \"sessmine\" (without the quotes) is typed with that buffer.
This variable may be set to `sessmine\".
\(fn)" nil
"This variable might be set to \"sessmine\" or \"s\\|s\\|s:\" if it is specified.
It is also possible to get a minibuffer or a sub-menu which has these
variables; this variable should be set in `sessmine' or \"s\\|s:\" and
if it is used, \"Sessmine\".
\(fn TARGET &optional ARG)" nil
"The default directory name of the buffer to be added to the menu.
This variable is used within `sessmine\".
The buffer name must not contain a special character syntax which will make it difficult
to customize a value of sessmine-syntax and hence customize different buffer names.
This could be used to customize a variable which is intended to be inserted into
a menu after loading the minibuffer, such as \"sessmine\", \"s\" and
\"s:\" which are the name of an Sessmine mode to be inserted.
The buffer
"%file: samples-14500"
======== SAMPLE 1 ========
-name (car
(car
(if (member key (caar other-name))
(cdr other-name)))
;; `def' with `defvar' and `defvarkey'
;; for declarations. Use their
; `variadic' arguments.
;; (if (consp variables) ...
;; (let ((decls t)
(decl-get var 'decls-decls)
(cdr (assoc (cons 'variable
(if
(assoc var '(:parent-object))
'variable-name)))
(assoc 'decls)))))
(or var-name var-variant var-name))
((or var-key var-varkey (car variables)))
(or (car variable-key) '("var", "key(")
(car variable-key)))
(and (eq var-name var-varkey)
(let ((key
(cl-remove-if-not
======== SAMPLE 2 ========
-match "\\'"))
(if pw-regexp-match
(message "Match found in \\([^>]+\\)pw\\'"))
(setq end (point-marker)))
(setq pw-regexp-match
(if (or (and (looking-at "\\^.+\\(?:\\[[{:]?\\(\\]\\):\\)*" "\\|\\\\?\\|\\s-\\)?\\([\\([^\0-\]\\|:]?\\):\\)")
pw-regexp-match
match)
(match-string 0 2))))))
(pws-error "Error searching for matches in \\%s, see message"
(format "Error searching for matches in \\%s" pws-error))
(pws-error (pws-command "\\'" 1))
(pws-command (line-number-at-pos))
(when (match-beginning 1)
(pws-command
(format "/%d" pws-error)
(point-max)
(save-restriction
(narrow-to-region (point-min) (line-end-position))
(goto-char (point-max))
(while (< (point) (point-max))
(goto-char (point-max))
(forward-char 1)))
;; Add last two matches if we've hit "/"
(when pws-end-end "")
(forward-line -1)))
(pws-error "Searching %s: " pws-error t)))
nil t)))
(not pws-command)
(defun ws-error-search-forward ()
"Search forward for \"error\" in \"ws\" buffer."
(interactive)
(error "No error detected")
(catch 'found
(setq pws-error nil)
(setq end (point-marker))
(while (and end
(setq pws-end-end (point-marker)))
(if pws-command
(setq end (1- pws-error)))
(while (and pws-begin-end
======== SAMPLE 3 ========
-if-not-computing
(point-at-eol))
(or (forward-repetition point-at-eol)
(eq (char-before (+ (point-at-eol) (point-min)) ?.))))
(or (forward-char)
(let ((char-after (1- (point)))))
(goto-char (point-max))
(forward-char)
(put-text-property (point-at-bol)
'before-computter end-if-not-computing)
'post-computter)))))
(backward-symbol-change)))
(or (forward-composition start-point)
(error "This is a forward-sexp.")))
(defun last-completion-char ()
(let ((pre-completion-char t)
(line start-point)
(mark (forward-char 0)))
(cond
((save-excursion
;; Do a 'end-of-file function at the end of this buffer, to keep the
;; buffer from repeating its previous completion.
(let ((pos (buffer-size))
bp)
(save-excursion
(while (re-search-forward
nil
(setq bp (char-after))))
(and (re-search-forward pos (point-at-bol))))
(forward-line 1))) ; to keep the buffer from repeating a previous
;; completion, but keep the region we're in, even if no further
;; completion is required.
(save-restriction
(and (re-search-forward "^[ \t]*#\\(begin\\)\\b+" nil t)
(replace-regexp-in-string
"\\(@(\\sw+\\)\\|$\\)*\\(\\`[^;\n]*\\)\\'"))))))))
(defun end-of-file (&optional arg)
"Go to the beginning of the file at the current line or nil, respectively.
This does not change the value of `end-of-file', the optional
argument must be a character in a character set. This function is for
the use of Emacs
======== SAMPLE 4 ========
-button-text-start-button-start-button]
("Save"
["Run"
["Run"
"-->"
["Save"
"--> t"
"---"
"---."
;; No, it's not just a mouse-1, it does everything.
["Save"
'no-modification
:help-echo "Restart to save text..."
:value-set-data [text, t]
:value-set-data type
:value-set-data data
:value-set-data (key-get type)
:value-set-data type data value
:value-set-data (repeat key-bindings)
))
["Check"
["Check"
:help-echo "Check text for next button..."
:value-set-data [text]
:value-set-data type data)
["Check"
:key-bindings (:check (:input (if (or (not in-show-button-text-text-begin-line)
(<= (min (current-line) 1)
(if t
(save-excursion
(skip-chars-forward " \t")))])
;; Not a button or no text
;; but as we're entering a text or a button,
;; this could end a button-text-text text line.
;; We could leave the button and enter a new text, because it's
;; already in text or a button.
(insert (get-text-property (point-at-bol) 'button)
(current-column))))))
("Test"
["Test"
:help-echo "Use button as test text...}"
:value-set-data [text
"%file: samples-14400"
======== SAMPLE 1 ========
"s")
(if (and mhmin (not (gnus-user-hash-equal
(= gnus-mhmin-prefix
(gnus-hash-address mhmin)))
(gnus-mhmin-prefix mhmin))
(when (eq gnus-mhmin-prefix '("^#" ".*")))
(setq mhmin (gnus-mhm-make-index mhmin)))
(setq mhmin (gnus-mhm-make-index mhmin)))
(setq mhmin (gnus-mhm-make-index mhmin)))
(setq rd (point-marker))
(gnus-add-new-prefix mhmin rd mhmin))
(setq gnus-mh-prefix-in-head (if rd gnus-mh-prefix-in-head t)))
rd)
(gnus-mh-add-entry mhmin nil nil 'prefix)))
(defun gnus-mh-update-prefix (&optional noincrement)
"Update the prefix index of gnus-mode."
(interactive "P")
(with-current-buffer (gnus-buffer-modified-p)
(gnus-add-entry mhmin nil 'prefix)
(gnus-add-entry mhmin '(:name :hash :path-ref :file-name :filename)))
(message
"Updating prefix index in #mh-mode buffers."))
(defun gnus-mh-add-prefix (&optional noincrement)
"Update the prefix index of gnus-mode."
(interactive "P")
(with-current-buffer (gnus-buffer-modified-p)
(gnus-add-entry mhmin '(:name :hash :path-ref :file-name :filename)))
(gnus-add-entry mhmin '(:file-name :address :host :port :address :key :path-ref
:hash :file-name))
(message
"Updating prefix index in #mh-mode buffers."))
(defun gnus-mh-add-entry (regexp value)
"Update the prefix index of the current buffer."
(interactive "*")
(gnus-mh-add-entry (regexp regexp)
value)))
;;;###autoload
(defun gnus-mh-mh-add-entry (regexp value)
"Update the prefix index of the current buffer."
(interactive "*")
(gnus-mh-add-entry
(symbol-name regexp '("#mh" . 0 . 0))
value))
;;;###autoload
(defun gnus-mh-add-entry (regexp value)
"Update the index of the current buffer."
(interactive "*")
(gnus-mh-add-entry (regexp regexp)
value)))
;;; The "mhmin" command. -c
(declare-function gnus-mh-find-mhmin "
======== SAMPLE 2 ========
"v" v)
(and "l" (match-end 1) "l" l)))))
(cancel-buffer)
(setq buffer-read-only nil)
(vhdl-set-mark-active-map buffer buffer)
(vhdl-display-map))
;;; Customization and documentation
;;;### (autoloads "semantic/mh" "semantic/mh.el"
;;; autoloads "semantic/mhr" "semantic/mh.el"
;;; autoloads "semantic/mh-initiate"
;;; autoloads "semantic/mh-unbind"
;;; autoloads "semantic/mh-previous-link"
;;; autoloads "semantic/mh-previous-link-cache"
;;; autoloads "semantic/mh-previous-link-cache-cache"
;;; autoloads "semantic/mh.el"
;;; autoloads "semantic/mh.el.el"
;;; autoloads "semantic/mh-previous-link" (replace-regexp-in-string "-" "_")
;;; autoloads "semantic/mh-previous-link-cache" (replace-regexp-in-string "-" "_")
;;; autoloads "semantic/mh-previous-link-cache-cache-cache" (replace-regexp-in-string "-" "_")
;;; autoloads "semantic/mh.el.el"
;;; autoloads "semantic/mh.el"
;;; autoloads "semantic/mh.el.el"
;;; autoloads "semantic/mh.el.el"
;;; autoloads "semantic/mh.el.el"
;;; autoloads "semantic/mh.el.el.el"
;;; autoloads "semantic/mh-prefix-cache"
;;; autoloads "semantic/mh-prefix-cache-cache".el
;;; autoloads
;;;(put 'mh-prefix-cache 'semantic-highlight-mode 'font-lock-mode -3)
;;; "*Mh prefix cache!*"
;;; autoloads
;;; "*Mh prefix cache!*"
;;; autoloads (remove 'semantic-mh 'font-lock-mode -7)
;;; autoloads "*, prefix"
;;; autoloads (remove 'semantic-mh 'semantic-highlight))
;;; (insert " prefix cache.")
;;; (semantic/mh-cache-delete-cache "Mh prefix cache")
;;; (insert "cache name.cache")
;;; (insert " *From.* " (file-exists-p "Mh")
;;; (expand-file-name "mh" (file-name-directory "mh"))
;;; (replace-regexp-in-string "\\('.*\\)" (replace-regexp-in-string "\\('.*\\)")))
;;; (cond (file-exists-p nil mh-prefix-cache)
;;; ((null mh-prefix-cache) nil)
;;; ((null mh-previous-link-cache) nil)
;;; ((> 0) (eval-when-compile '("-c" nil
;;; 'semantic-file-extension
;;; 'file-name-extension)))
;;; (t nil)) ;; not an error!
;;; (delete-file "mh.emacs" file
======== SAMPLE 3 ========
";;
;; It is assumed that this string is a prefix token in which case it
;; means \"foo\" instead of \"bar\"
(defmacro foo (expr)
(let ((a (semantic-tag-name a)))
`(foo
(lambda (prop)
(if (and (semantic-tag-pprop ange-type-context)
(not (= (semantic-comp-context prop) ange-type-context))
var
(zerop (length prop)))
a)))
`(a `(lambda () (semantic-tag-name
(semantic-tag-parameter ange-type-context
env)))))))
(defun semantic-syntax-string-p (token)
(let ((value (semantic-syntax-region (point-min) (point-max)))
(token 'syntax)))
(defun semantic-syntax-string-p (token val)
(let ((value 'syntax))
(and val
(and (not (y-or-n-p "Syntax: "))
(semantic-syntax-expression val))
(and (eobp) (not (y-or-n-p "Syntax: ")))
;; Check if val is not token.
(when (eq (semantic-tag-key semantic-syntax-token-name) 'syntax)
(semantic-syntax-symbol val))))
token)))
(defun semantic-syntax-parser (token val)
"Parse a syntax syntax token from VAL."
(cond ((not (eq (semantic-tag-key token) 'syntax))
val)
((eq (semantic-tag-key token) 'syntax-expression))
;; Parse syntax.
(t
;; This is called before parser has finished parsing.
(let* ((value (semantic-syntax-token-value token))
(syntax (semantic-syntax-expression val)))
(while syntax
(apply (semantic-syntax-parser syntax val) 'parse)
(semantic-syntax-parser token)
)))
value))
(defun semantic-syntax-parser-for-parser ()
"Parse syntax-parser from the parser of VAL."
;; We could do this in `semantic-lex-parser'.
(let ((parser (semantic-lex-parse-context parser))
(parser-name (semantic-lex-parser-for-parser
(semantic-lex-parse-region-start parse)
(semantic-lex-parse-region-end parse)))
(parser-parse-keyword-type val val)
(parser-parse-indentation)))
parser-parse-keyword-type val
======== SAMPLE 4 ========
"v" t)))
("v" nil))
)
"Vectors with a VEF-compatible backend to use.
If this variable can't be bound, use \"nv\" (which defaults to nil),
which defaults to an empty string. This uses ``emacs-version-format'.")
(autoload 'org-mode-updaterize-hook "org" "\
Create a `org-mode-updaterize-hook' in `org-mode-list'.
\(fn &optional ARG)" t nil)
(autoload org-mode-list-p "org" "\
Return a list of buffers from which to find out about files.
The file list takes two elements: the file name and the source
filename. The file name is either the file name part or the filename part
of the file. When this variable is the last element in the list,
the file name is added first. When the variable is an
empty string, it is assumed that it contains a `&' or `*' character;
when it says (`=' is just `+' or `^' or `+' or `\\' or `\\&'), it
uses the same format as `&' for `*'. (The result is the file name and
the `&' for `*'. Each `&' has the same form as the `&' for
`org-mode-updaterize-hook' for the filename.)
\(fn &optional ARG)" t nil)
(autoload 'org-mode-list-to-buffer "org" "\
Parse output from a file in `org-mode-list'.
With the mode-list argument ARG, search for the file
in the current buffer. The result is a string of numbers for
regexp matching the file names of the two directories.
`+' to print the number of the file in the file name
and `*' to the filename in the file name; this can be the default when that.
`%' to print the number of the file or the filename in a file name
`%' to print the number of the file in the filename.
\(fn)" t nil)
(autoload 'org-mode-list-to-buffer-coding-system "org" "\
Parse output from a file in `org-mode-list.
With the mode-list argument ARG, search for the file
in the current buffer. Then search for the buffer in
the file name buffer. The result is a list of characters like the file
`:name' `:number' as found in the `org-mode-list command." t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "org" '("org")))
;;;###autoload
(defun org-map (files)
"Return a mapping file from FILES to an org-mode buffer.
This function may also use a list of directory names to find the files
in that dir."
(save-excursion
(goto-char (point-min))
(let((dir (org-parent-directory "/")))
(if (string= dir "")
(error "Can't find directory for %S in a filtrate" dir)))
(org-map-parent-file-path dir)))
(funcall (mapcar org-mode buffers) files)
(org-merge-buffer-local-variables)
;; Compute all buffer positions in all buffers -- no conflict. See `org-map-buffer-unselected-lines'
;; for a detailed description of buffer positions in buffers.
;;
;; For directory/directory files, we need to be careful not to leave buffer
;; buffer buffer position unchanged. Otherwise, all files in that directory
;; buffer will be copied to the \"%s\" part of the buffer.
;; However, if we have not copied a file and its contents are not visible in
;; `org-mode', then some buffer positions will be changed to match
;; a file in the \"%s\" part of the buffer. So, let's assume the line
;; before point always lines up with the mark.
;;
;; We can add newline or "|" to these buffer positions.
"%file: samples-14300"
======== SAMPLE 1 ========
."
:version "22.1"
:package-version '(calendar-date-gregorian
(calendar-interval (1- time)))
:group 'cal
:version "23.3")
(defcustom calendar-gregorian-to-hex
"^-*-"
"The hex encoded date."
:group 'calendar
:type '(choice (const :tag "None^" nil))
:version "23.3")
(defcustom calendar-year-format-string "0x12c5000000005b4"
"String for using the calendar date as the year string."
:group 'calendar
:type 'string)
(defcustom calendar-cursor-ring-p
"***-*-"
"The cursor ring string for the date.
It can also be nil."
:group 'calendar
:type '(choice (const :tag "None^" nil))
:version "24.3")
;; This is a special case for the Emacs calendar
(defcustom calendar-cycle-date-p
(list '("~/~"
("~//~"
(1 3 5 8)
(1 4 10 12 14)
(2 6 15 17))
(3 7 18 19)
(4 9 20)
(* 10 41
(* 11 55 62])
(12 61 64)
(* (* (+ 12 41)
(11 - (= 11 55))
(12 - (+ 41) 53)))
(13 1))
(14 3)
(* 14 57))
(15 53)))
(defcustom calendar-unread-or-unread-date-p
"**-*-*-"
"The value of `calendar-unread-date-p' when nil.
This is used to prevent calendars from being killed.
See the variable `calendar-unread-date-p'.
When this is nil, only calendar related events will be visible.
When this is not nil, the date that the user types is used as
the current date. See `calendar-unread-date-p'.
This function accepts 4 arguments: the text in the date,
the date the user typed the date in, the time,
and a string.
If `calendar-read-date-spec' is non-nil, the user might use `calendar-read-date-spec'
which is set to `(format-time-string (nth 2 args))))'.
If nil or `calendar-unread-date-spec' is non-nil, the
user might call `calendar-read-date-spec'.
If `calendar-read-date-spec' is nil or `calendar-unread-date-spec'
is non-nil, the user types `calendar-read'.
If `calendar-read-date-spec' is t, the calendar is never killed.
Otherwise, if the date, time, and string are both `changed',
one of them is t.
The argument to `calendar-read-date-spec', if any, is used
as follows:
(defvar calendar-read-date-spec
(or (listp (symbol-name (car (cdr (cdr (cdr date)))))
`(or (listp (caar (c
======== SAMPLE 2 ========
."
:group 'socks
:version "26.1")
(defcustom socks-customize-hook nil
"If non-nil, an alist for `socks-load-hook'."
:type 'hook
:group 'socks)
;; When doing customization, we want to give the
;; custom-insert-hook the form of (NAME FUTURE). That is to
;; be inserted by the Socks initialization routine.
;;
(defcustom socks-initialization-generic-function
'("SOCK_LOAD" "socks--load")
"Generic function for SOCK initialization."
:type 'function
:group 'socks)
(defcustom socks-initialize-functions t
"Non-nil means to initialize the Socks initialization routine.
That is to use initialize-new-hook, or add-to-socks-functions
function, so as to avoid using initialize-other-hooks.
The return value is the current result, and `socks--load'
should be used to initialize the new entry in a file."
:type '(choice (const :tag "None" nil)
(choice (list (const :tag "None" nil)
(const :tag "None" t 0)
(const :tag "None" nil))
(repeat :format "%s. %s:%d"
(list :tag "Start" end-tag)
(integer :tag "Second")))
:version "26.1"
:group 'socks)
(defgroup socks nil
"Options for the socks initialization routine."
:tag "Socks initialization routine"
:group 'tools)
(defcustom socks-initialize-functions-hook nil
"If non-nil, an alist for `socks-initialize-hook'."
:version "26.1")
(defcustom socks-initialize-functions-hook-after-load nil
"If non-nil, an alist for `socks-initialize-hook-after-load'."
:version "26.1"
:group 'tools
:group 'socks)
(defcustom socks-initialize-function-functions nil
"If non-nil, a list of functions that must be called after load.
All of these functions must be called after initialization. The
initialize function's name must be in `socks-initialize-hook'. The
initialize function must be called at the time that this routine is called.")
(defcustom socks-initialize-functions-in-file "/etc/socks"
"List of functions that need to be called in the file to initialize.
The functions `socks-init', `socks-load-hook', `socks-initialize',
`socks-init-hook' and `socks-initialize-hook-after-load' are
defined in the file `socks'"
:group 'socks
:version "26.1"
:group 'socks)
(defcustom socks-initialize-hook nil
"If non-nil, an alist for `socks-initialize-hook-after-load'."
:version "26.1")
(defcustom socks-initialize-hook-after-load nil
"If non-nil, a list of functions that must be called after initialization.
All of these functions must be called during initialization. A
non-nil value of this variable means that, in the first
place, init a new entry in a file, but in the last place in
our files, initialize the Socks initialization routine, otherwise we
return nil.
However, if `socks-initialize-hook' is a function, we don't do
======== SAMPLE 3 ========
."
(unless (or (and (stringp (car temp-alist)) (setcar temp-alist (cdr temp-alist))
(not (getenv "STARTUP_NAME"))
(member-spec-p (car temp-alist) (setcar temp-alist (cdr temp-alist)))
(member-spec-set (car temp-alist) (equal (car temp-alist) spec)))
(delete-match (cdr temp-alist))
(list '("STARTUP_NAME" temp-alist))))
;;;;
;;;; Default to `startup-environment'. It is used by `startup-environment-setup' and
;;;; others and by `startup-environment-setup-setup'." (universal-argument nil)
;;;;
;;;;
;;;;
;;;; Some variables may apply outside the `startup-environment' environment.
;;;; They are ignored and ignored by startup-environment.
;;;;
;;;;
;;;;
;;;; Define this variable to your own customizations, so you can do what you want.
;;;;
;;;;
;;;; Some variables may apply outside the `startup-environment' environment.
;;;;
;;;;
;;;;
;;;; Some variables may apply outside the `startup-environment' environment.
;;;;
;;;;
;;;;
;;;; Some variables may apply outside the `startup-environment'." (universal-argument nil)
;;;;
;;;;
;;;; This variable is used outside `startup-environment'. It is ignored and
;;;; ignored by startup-environment.
;;;;
;;;;
;;;; Some variables may apply outside the `startup-environment'. They are ignored and ignored by
;;;; startup-environment and other variables that
;;;; define them; so you can modify the
;;;; variables themselves.
;;;;
;;;; Other variables may apply outside the `startup-environment'. They are ignored and
;;;; ignored by startup-environment.
;;;;
;;;;
;;;; Some variables may apply outside the `startup-environment'. They are ignored
;;;; by startup-environment and other variables that define them; so
;;;; you can modify the variables themselves.
;;;;
;;;;
;;;;
;;;; Some variables may apply outside the `startup-environment'. They are ignored
;;;; by startup-environment and other variables that define them; so
;;;; you can modify them:
;;;;
;;;;
;;;;
;;;; Some variables may apply outside the `startup-environment'. They may be ignored
;;;; by startup-environment. You can disable this automatically in
;;;; the init file.
;;;;
;;;;
;;;; A `startup-environment' variable's value is considered to be an
;;;; value.
;;;;
;;;;
;;;; Some variables may also apply outside the `startup-environment'. This
;;;; is not a specific example; it is a practice that can be done.
;;;;
;;;; Variables which do not specify a particular value are put in
;;;; init file and initialized for startup-environment. This
;;;; means that their value will be set correctly in default-init-
value.
;;;;
;;;; The `startup-environment' variable's value is considered to be an environment's
;;;; value and initialization is not implemented in that environment.
;;;;
;;;;
;;;; `startup-environment' variable's value is evaluated before `init'.
;;;;
;;;;
;;;; Variables which define a `environment' in startup-environment do not
;;;; define it in start-env.
;;
;; Variables which define a nil value for `startup-environment', but do not, are considered.
;; So you might need to set `startup-environment-eval-time' in
;; `startup-environment'.
;;
;; Other variables which define a `environment' in startup-environment do not
;;;; define it in startup-environment.
;;
;; Variables which define a nil value for `startup-environment', but do define it in startup
;; environment, are put in `startup-environment-eval-time'.
;;
;; Variable `startup-environment-eval-time' is used to set the startup-environment initialization
;; time.
;;
;; Variable `startup-environment-initialize-time' is used to make it available to
;; startup-environment before startup-environment.
;;
;; Variable `startup-environment-initialize-time' is used to make the startup initialization
;; time.
;;
;; `startup-environment-auto-load' command will initialize `init' in startup-environment
;; file.
;;
;;;;
;;;;
======== SAMPLE 4 ========
."
:type '(radio (repeat (cons name string))
(repeat (list name name string (reverse
(cons (cons 'name (string-to-number name)))
default-file default-directory))
'symbol))
:version "24.4" ;; (Maintainer: emacs-devel@gnu.org)
(defcustom tty-make-error-warning
'("TODO %S")
:type '(choice (sexp)
(sexp)
(sexp :tag "make-error-warning")
(sexp)
(default () (read-string "TODO")))
"Value of `tty-make-error-warning' for Make errors.
See the file `emacs-test-makefile-defaults-file' for a list of files."
:type '(alist :keymap
:tag "Make errors"
default-error))))
;;;###autoload
(defun tty-make-error-warning ()
"Make non-makefile `tty-error-warning' error-warning.
Use this to prompt you for an error file if you use `tty-error-warning'.
Use `tty-make-error-warning' for automatic prompt.
See the tty-make-error-list which contains the list of file names
with which to specify an indication of `tty-error-warning' file
options."
(let* ((makefile (make-default-directory tty-error-warning))
(file-name-no-properties tty-error-warning-file)
(file-name-as-directory makefile)
(makefile-name makefile)
(file-newer-than (file-newer-than tty-error-warning file))
(tempfile (file-truename tempfile))
result)
(when (file-directory-p makefile) (ignore-errors (find-file-noselect file)))
;; Check if we have an error in the original makefile
(if (not (or (file-exists-p tempfile)
(file-writable-p tempfile))
;; We have an error in one, maybe two.
(or (file-directory-p (expand-file-name tempfile) 'TTY-error-warning
(error-to-string tempfile)))
(error "No makefile %S" (file-name-nondirectory tempfile))))
;; Look at file name of `TTY-error-warning' if it is not already a
;; makefile. Return the value of this variable so we can find it in
;; any future makefile.
(setq makefile (make-make-error)))
;;;###autoload
(defun tty-makeup-makefile-error (filename &optional default-filename makefile)
"Return the value of `tty-makeup-makefile-error' for the make file."
(or (and (file-exists-p file)
(file-writable
"%file: samples-14200"
======== SAMPLE 1 ========
(and (listp c) (< (car c) (cadr c)))))
(setq hl (reverse hl))
(setq hl hl hl 'cadr hl)
(setq hl (reverse hl)
hl hl (if (> p1 (- p1 hl)) p1 p1)
hl 'cadr hl))))
(easy-menu-define ctl-get-menu-categories nil 'menu
"Menu to display ctl categories in ctl mode.")
(easy-menu-define ctl-get-menu-files nil
'menu
"Texts found in ctl buffers."
"A list of lists of files (default is m.n) for which the mode-line
`c-mode-map' might accept a \"browse\" entry.
Each list has the format (FILENAME . PILGRAM)
where FILENAME is a file name for which ctl should be able to look.
C-mode selects a C/C++ file named PATH."
:options '(("PILGAM" (setq dir-dir-list p1 dir-dir-list))))
(easy-menu-define ctl-get-menu-files nil 'menu
"Menu to display Ctl files (default: \"browse\")."
:type :menu-tag menu-tag
:options '(("PILGAM" (setq dir-dir-list p1 dir-dir-list)
(setq dir-dir-list (sort dir-dir-list
(format
"Browse for C/C++ (files.n" dir-dir-list)))))
("C/C++ for c/c/t" (append dir-dir-list dir-dir-list)))
;; If you want C/C++ files with "browse-dir-list" set to nil, set a
;; `browse-load-path' dir. Do that, too (this is an Emacs Lisp function).
;; Make sure `browse-load-path' is non-nil since it won't be set by
;; C.
(browse-load-path "browse-dir" dir t)
(unless (car ctl-files) (setq ctl-files (car ctl-files)))
(setq ctl-files (cdr ctl-files))
(setq ctl-files (delq ctl-files ctl-files))
(setq ctl-dir-list ctl-dir-list))
(if (fboundp 'browse-load-path)
(setq ctl-load-path (list 'browse-load-path ctl-load-path)))
(setq ctl-load-path
(and dir-dir-list (setq dir-dir-list dir-dir-list)))
(setq ctl-load-path nil)))
;; If "b" gets a path, use it (Bug#3976).
(not (setq ctl-dir-list ctl-dir-list))
(not (eq (get-text-property
(get-text-property
(get-text-property
======== SAMPLE 2 ========
(setq dir (file-attribute-extension gnus-directory-p))
(setq dirname (concat dirname dirname))
(gnus-summary-dired-insert-string-directory dir name
(list
(concat
(substring dirname 4)
(if (stringp dirname) dirname
(substring dirname 1)
dirname))))
(setq dirname (concat dirname dirname))))
(gnus-report-remove-directory dirname t))))))))
(deffoo gnus-summary-make-directory-visited-p (file &rest directories)
(let ((buffer (expand-file-name (or directory dir))))
(when (and (file-exists-p buffer)
(file-readable-p buffer)
(or buffer-file-name (directory-file-name buffer))))
(dolist (buffer (process-buffer process))
(let ((user (gnus-buffer-user buffer))
(dir (with-current-buffer (process-buffer process)
(file-exists-p (or (directory-file-name buffer)
(directory-file-name buffer)))
(expand-file-name buffer user))))
(dirname (setq dirname (expand-file-name (file-name-directory buffer))
(cdr (directory-file-name buffer)))
(when (file-exists-p dirname)
(insert-file-contents-literally
gnus-directory-p
======== SAMPLE 3 ========
(setq e (assoc "elements"
(cadr (funcall idlwave-file-finder
(cadr e)))
(mapconcat (lambda (pair _e)
(intern pair)
" ")
(intern (modes-list-string e))))))
'((< 20) ; (number of hits)
(number-to-string elem)))))
; (if (eq e 0) ; `default', (cadr e) e
; e)
; `default-value'
; `default-target-name'
; `default-target'
; `default-position'
; `default-position'
; `default-position-index'.
; (length e e)
; `default-position-index'
; `default-positions'.
======== SAMPLE 4 ========
(push x nil)
(push (car (x-pos (x-neg x))))))
((cdr (assoc x yar))))))
(if (setq x 0)
(setq x 0))
(while (setq y 0
(cond
(yar
;; Add YARN to x-neg
(setq yar zar))
((and (<= (setq y 1) 0) (<= (setq yar zar) 0))
((= (setq y 1) 0)
(setq yar zar))
((> (setq y 0) (- yar zar))
(setq zar (+ zar zar))
(goto-char (1- (point-max)))
(insert (or yar (car (pop zar))) (current-indentation)))
t)
(setq yar (1+ yar))
(setq z (current-indentation))
(insert " "
(if (memq x yar) "\000B\001E")
(error "This is not valid code for code "))
(setq y (- yar))
(let ((len (length (car zar)))
(end (- end yar)))
(while (<= len x)
(insert "\nL"))
(put-text-property start end (point-max) '(point))
(insert (substring (car (setq yar (1+ yar))
(1+ (car zar))))
y)))))
(setq start (point))
(insert (if (> yar 1) " ") " ""))
(unless end
(setq z (% zar zar))))
(setq yar nil)
(setq zar nil)
(push 'x '(push v y yar) 'yar))
(defun x-pos (x y)
(condition-case (x y)
(x-pos (x-pos x yy)))
(error
(condition-case error
(progn
(if (fboundp 'x-pos)
(pop x-pos)
(error "No %s data to use for assignment or z %s for y %s"
x)
(error "Cannot use
"%file: samples-14100"
======== SAMPLE 1 ========
(should (or (string-match "\n" (syntax-ppss))
"[ \t\n\r^\\]*{\\)?}"
"|")))))
(cl-defmethod edebug-tests-validate ((eol-id a b) a b)
"Test a function in `edebugtest-tests-functions' for the first element in b.
Return all occurrences in a list which is the first element in
b. It returns non-nil if not, returns all elements or nil if none."
(let ((case-fold-search t))
(if (or edebug-tests--functions (funcall (edebug-tests--function-id a b)
edebugtest-tests-functions))
(progn
(setq edebug-tests-functions (cons (edebug-tests--functions a b)
(edebug-tests--function-id a b)))))
(if edebug-tests--functions (edebug-tests--functions b))
(prog1
((and edebug-tests--functions (edebug-tests--functions b))
(push edebug-tests--functions edebug-tests-functions))
(edebug-tests--functions)
;; Check return value to avoid false positives
(edebug-tests--functions)
;; Check first-passed
(edebug-tests--functions (edebug-tests--functions f)))))
(cl-defmethod edebug-tests--test-function ((function edebug-tests--functions) a b)
"Test the function for a function in a list of b.
Function returns all occurrences in a list which is the first to
elements in the list. Otherwise it returns the index at which
the function starts."
(let ((index (edebug-tests--table-class index)))
(edebug-tests--check-begin (edebug-tests--check-end 'edebug-tests--function-id function) index)
(should (edebug-tests--function-id function))))
(cl-defmethod edebug-tests-validate ((function edebug-tests--functions) a b)
"Test the function for a function in a list of b.
Function returns all occurrences in a list which is the first to
elements in the list.
Function's return value is the index at which the function hits
it. Return nil if in any case not in a list. In
any case return function, which does not return a list."
(let ((table (edebug-tests--table-class function)))
(edebug-tests--check-begin (edebug-tests--check-end 'edebug-tests--function-id function) table)
(edebug-tests--check-end (edebug-tests--check-end 'edebug-tests--function-id function) index)
(should (edebug-tests--function-id function))))
(cl-defmethod edebug-tests-validate ((function edebug-tests--functions) a b)
"Test the function for a function in a list of b.
Function returns all occurrences in a list which is the first elements in
the list.
======== SAMPLE 2 ========
;; Use the new key.
(if (and (eq d-mode 'emacs-lisp)
(eq lisp-indent-function 'start-key-2))
(push (if (eq 'start-key-2 lisp-indent-function)
(list (list
(intern
(format "%S"
(if start-key-2
(list "" begin-key-2)
nil
nil begin-key-2))
(if start-key-2
(list ":"
(list "" return-key)
nil
(list ":"))))
"")
nil "")))
(push '(?\C-a ?\C-v) list)
)
(if (eq (char-before) ?\() "s"))
(if (eq (char-before) ?\() "")
(progn (push '(?\s ?\n))))
(if (and (nth 2 d-map) (nth 1 d-map))
(cons list (if (nth 2 d-map) d-map)))))
(defun d-indent-key-1 (key)
"Return key's indentation by key-set."
(let* ((map (make-sparse-keymap))
(key (make-sparse-keymap)))
(if map (setq map (concat map "\n" key)))
(vector key))
(when (consp map)
(push '((?\C-c ?\C-v) map))
(when (assq key map)
(setq key (make-vector 1 (mapcar map)))
(dotimes (length map)
;; Insert all the arguments, and return a list.
(while (setq map (assq key map))
(delete-region (1+ (length map))))
(cons (map-sublist map key)))))
(def
======== SAMPLE 3 ========
(progn
(dun-beginning-of-input)
(dun-end-of-input)))
((bolp) (point))
((eq bol 'end) ;beginning-of-line, not at end
(end-eq bol 'end)
(car (funcall calc-truncate-point (nth 2 (dolist (x (nth 1 x)) 'end))
(cdr (nth 2 x)))))
(setq calc-truncate-point (point))
(dolist (x nil)
(if (and (= x (nth 2 x)))
(funcall calc-truncate-point (point)))
(progn
(goto-char (nth 0 x))
(if (= (nth 2 x) 1))
(setq end
(cdr (funcall calc-truncate-point (nth 3 x))
(cdr (nth 1 x))))))
(cadr (funcall calc-truncate-point (nth 0 x))
(nth 1 x))))))
((eq bol 'end) -1)
(t
(forward-line 1))
((eq bol 'end-end) -1)
(t
(forward-line 1))
(t
(skip-syntax-backward " \t")
(setq bol (point))
(beginning-of-line)))))
(
======== SAMPLE 4 ========
(or (eq (car entry) '())
(memq (nth 1 entry)
'(?+ (and (equal ?q ?=) (symbol-name
?= nil
'symbol-list))
(nth 0 entry)))))
(if (and (eq (car-safe entry) '())
(memq (nth 1 entry) '(?- 0)))
;; Get the correct value.
(let ((old (nth 1 entry)) '*)))))))))
(define-inline spp-symbol-alist-alist (spp
;; A special list of symbols ; with a value on first
;; non-nil argument.
(symbol-name entry))
nil
nil
(list :start (symbol-name entry))
""
entry)))
((eq (car entry) '("\\`?"))
(let ((sym (member (car entry) (cdr (assq entry (symbol-name entry))))
(symbol (cdr entry))
(symbol-name (car entry))
(symbol-name (propertize symbol (cdr (assq entry (symbol-name entry))))
(symbol-name entry))
(cond ((eq symbol-name sym)
(setq entry (symbol-name sym))
(setq entry (assq sym entry))))
"%file: samples-14000"
======== SAMPLE 1 ========
(concat "" (format "%s\\%s." (string-to-number file)))
(format "%s" (vector (symbol-name name file)))))
`(:visited--file-info ,file ,info)
(setq info nil))
(setq info buffer-read-only))))
(provide 'semantic/test)
;;; semantic/test.el ends here
<|endoftext|>;;; semantic/test.el --- Tests for Semantic. -*- lexical-binding: t -*-
;; Copyright (C) 2006-2019 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: vc
;; Human-Keywords: convenience support
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Semantic support for a wide variety of semantic-coding systems.
;;
;; Use `semantic-tests' with option ARG1. Use `semantic-tests-test-function-arg',
;; then return ARG1. Test for functions that accept any of the following strings with their
;; value:
;;
;; "--name=" ["name (nil t)
;; name (nil t)
;; "--text=" ["name (nil t))
;;
;; "--file=" ["name (nil t)
;; name (nil t)
;; "--type=" ["name (nil t)
;; name (nil t))
;;
;; For more than one semantic library, the following functions:
;;
;; - find-file-and-unload-hook
;; - find-find-regexp-hook
;; - find/replace-match-match-regexps
;;; Code:
;;
(require 'semantic)
(require 'lisp)
(eval-when-compile
(require 'semantic/test))
(defgroup semantic-test nil
"Test that semantic tests are evaluated on the same buffer."
:version "26.1"
:group 'test)
(defun semantic-test::find-match-regexp (regexp &optional source file type)
"Find the regexp in REGEXP using the command \"/find\".
Replace REGEXP with the file name of the matching regexp. Return the
result of searching in case the value is a non-nil value. If it is nil,
then return the result to find the match, otherwise return the result."
;; This must be a function so that the `semantic-test' can do any kind of
;; `find' command.
(cons regexp source
(semantic-test -listregexpregexpregexp
:test #'semantic-find-search-regexp)
re
(cond
(regexp
(and (string-match (concat "\\`/" file) "\\\\")
(file-path (file-relative-name file))
(string-match (concat (concat "\\`/" file) "\\'"))))))
re
re)
(funcall regexp re (if source
======== SAMPLE 2 ========
(set t
(mapcar (function (lambda (x) (car x))
(lambda (y) nil)))
(cons p (mapcar key-function (mapcar #'car (cdr key-functions))
(nth 3 (car key-functions)))))
(setq key-functions
(while key-functions
(delete key-functions) nil)
(setq p (nth 1 key-functions)))))
(nconc p key-functions))))
(defun key-fun ()
"Return a non-empty function for the key of the current Emacs key.
The key in the current Emacs key is called with the value of
option `key-type'."
(not (setq key-type 'or)))
(defun newline ()
"Return either a new line, as opposed to the preceding one, in the current string.
Argument NEWLINE is either a string or a string.
Use to replace existing string value, instead.
With prefix argument non-nil, the value will be interpreted as the current
line value.
The function should not be called more than once.
Return t when non-nil, if there was a previous value of KEY-TYPE before.
Argument NEWLINE specifies if KEY-TYPE should be interpreted as the current line
value."
(let ((elem key-type) key-data)
(if (null elem)
(progn
(set-char-exclusive-p (car (cadr (car key-data)))
key-data)
(setq newline (cddr (cadr key-data)))
(setq newline nil))
elem))
(if (null newline)
newline)))
(defun word-fun (word)
"Return non-nil if word has a specified name within a word.
A word must have a sequence of words.
The word is used to return the value of KEY-NAME."
(if word
(apply word-fun word)))
(defun string-fun (string)
"Return the function to call to return string of STRING.
STRING has a function which takes a string and returns
the value returned.
The function `string-fun' takes argument STRING and returns.
You may also pass it a function which accepts `string-fun'"
;; NOTE: These functions accept multiple arguments, i.e.
;; use `string-fun' instead.
(let ((case-fold-search t))
(string-to-list (buffer-substring string (if (null key-type) (car key-data))))
(if (stringp key-data)
(if (< key-data 0) nil
key
(cond ((stringp (car (cadr key-data)))))
((stringp (cadr (car key-data))))
((symbolp (car (cadr key-data))))
((stringp (cadr (car key-data))))
((char-table-p
======== SAMPLE 3 ========
;; If there is no current entry, use a single entry. (save-excursion
(goto-char (point-min))
(search-forward-regexp "^A-" nil t))
(set-match-data nil t t))
;; Do any cleanup from the current entry.
(goto-char (point-min))
;; If no file exists, clear the current buffer.
(search-backward "\n\n")
;; Move back over current buffer.
(goto-char (point-min))
(if (re-search-forward "[^:\\([A-Za-z0-]+\\)\\([\s-^']?\\)]?" nil t)
(progn
(forward-line))
(backward-char))
(if (save-excursion
(goto-char (point-min))
(search-forward "\n\n")
(goto-char (point-min))
(search-forward "\n\n")
(let ((case-fold-search
(symbol-function file-name)))
;; Skip file extensions.
(cond ((eq file-name (symbol-function file-name)) nil)
;; (default-value file-name)
(setq file-extension file-name))))
;; If nothing is found then do nothing.
(if filename
(progn (error "No file name specified: %s" filename)
(setq filename nil)))
(setq filename (substring filename 0 1)))
(and (equal file-name nil)
(error "No file name specified: %s" filename)
(setq filename nil))))
;; Clear out buffer.
(setq buffer-undo-list nil
initial-buffer nil buf
======== SAMPLE 4 ========
(list (symbol-name form) form))))
(and (eq major-mode 'cperl2-mode)
(or (= (semantic-tag-class tag) 'syntax-table)
(cperl2-concat (semantic-tag-class tag)
(string-to-syntax "") (semantic-tag-class tag)))
(< (semantic-tag-class cperl2-format-tag-type-in-tag
(semantic-tag-class tag))
(string-to-syntax " ")))
(cperl2-concat "<") ;; This must be removed as we would lose the semantic-tag-context
;; context.
'(("syntax-table" (semantic-tag-class tag)))
(cperl2-concat "<!")))
;; We may already have a semantic-tag!
cperl2-with-newline-hook
(semantic-tag-unset-property tag 'semantic-tag-context
(semantic-tag-class tag)))
;; Do the thing
(unless (eq semantic-tag-context 'comma font-lock-warning-face)
(goto-char (semantic-tag-class tag))
(error "No tag context"))
;; FIXME: Remove semantic-tag-context/revert?
(setq semantic-tag-context (cperl2-tag-context tag))
;; Find the tags
(if semantic-tag-context (semantic-tag-with-context semantic-tag-context))
;; Save the semantic tag-context
(save-window-excursion
(if semantic-tag-context
(save-window-excursion
(semantic-tag-maybe-change-context semantic-tag-context nil nil nil)
(semantic-tag-maybe-set-tag semantic-tag-context nil nil nil)))
((or (equal type '(t nil))
;; If we cannot find the tag, we must do it as
;; no more than once: if we find the new tag
;; then the other tags (or we were looking for all but
;; the tag but one) must be used instead of the tags.
(semantic-tag-set-tag-contents semantic-tag-context tags)
(semantic-tag-clear (semantic-tag-value tag)))))
;; Now that we are the tag's context,
;; then we must do the semantic-tag-change-context
;; (C-c C-x C-i)
(t
;; We are actually looking for all tags: if we
;; find all tag contexts, we must do the proper thing.
;; If the tag's context cannot be found, and we are not
;; looking for all tag contexts, then
"%file: samples-13900"
======== SAMPLE 1 ========
should 'emacs-version-p
(should '(eval-if-debug
nil (eval-file-process "emacs-version" t))
(should nil)))
))
(save-excursion
(should
(memq 'emacs-mode-line-mode emacs-mode-line))
(emacs-current-major-mode-line))
(save-restriction
(narrow-to-region (car (nth 1 emacs-mode-line))
(nth 1 emacs-mode-line))))
(should
(eval-if-debug (should-not
(eval-when-compile
'(eval-compile
(eval-when-compile
'(eval-compile
'(eval-compile
'(eval-compile
'(eval-compile
'(eval-compile
'(eval-compile
nil))))))
(eval-when-compile nil))
nil)))
(should
'emacs-version-p
'(eval-if-debug
'((eval-when-compile (eval-file-process "emacs-version" t))
(eval-file-process "emacs-version" t))
(eval-file-process "emacs-version" t)))
(eval-file-process "emacs-version" t t))
(eval-message nil))))
(provide 'emacs-babel)
;;; emacs-babel.el ends here
<|endoftext---->
======== SAMPLE 2 ========
should be
(save-excursion
(goto-char (match-beginning 0))
(while (re-search-forward "^\\S-?"
(point) t)
(re-search-backward
(concat
"\\S-?"
(re-search-backward
(if (eq c-mode 4) "\\S-?")
(re-search-backward c-mode-identification
(point) t)
nil t)))
(when (re-search-forward
"\\S-?" (match-beginning 5) t)
(insert "\\S-?"))))
(forward-line)))))
(defun c-check-file-contextual-p ()
"Check whether a current buffer has a file-handle for a file."
(and
(and (string= "\\B." "^\\(" (buffer-file-name))
(symbolp (if (eq (car-safe c-get-caching-contextual-p)
(aref c-get-caching-contextual-p 5))
"")
"")
(stringp (aref c-get-cached-file-handle 5))
(symbolp (buffer-name)))
(and (regexp-quote (car-safe c-get-cached-file-handle)))
(and (match-beginning 6)
(progn (forward-line) (re-search-forward "^\\S-" (point) t))
nil)
(buffer-disable-undo nil)))
(eval-bound-and-display "C-C C-C")
(c-with-init-buffer
(c-point-at-point)))
(if (eq c-mode 4)
(let ((c-mode 4) c-mode-specific-p))
(save-excursion
(goto-char (or (match-beginning 6)
(point-min)))
(setq c-mode-specific-p t)
(cond
((and (<= c-next-c-point-point c-previous-point)
(c-find-file-custodial-path cs-file-custodial-path pos t))
(c-set-marker c-current-file (buffer-tree-toplevel)))
(let* ((tmp-file (eq c-
======== SAMPLE 3 ========
should be the value of `interactive-list', if any
(interactive-list boolean). A boolean is equal to 1 or 1 + 2. If you change the value of the
variable `interactive-list' to nil, that change is not reflected.
The value of INTERACTIVE-LIST is the value to use if non-nil
`interactive-list' is non-nil). You also set the variable
interactive-list to t if the number of seconds since last time the
interactive command has been executed, else always return nil.")
(define-minor-mode interactive-list t
"Toggle interactive search mode on non-interactive displays.
Normally `interactive-list' is enabled. This minor mode is meant to be
disabled by setting `interactive-list' and enabling `interactive-list' in
direct mode interactively, if INTERACTIVE-LIST is the value of
`interactive-list' then all displays will display the interactive
list (not the list mode mode) if the display is not interrupted, if
non-nil and if INTERACTIVE-LIST is non-nil, or nil if the
display is interactive, and if INTERACTIVE-LIST is non-nil the first
display will start up the interactive search.
Interactive search modes will be set by editing the variables
`interactive-list', `interactive-list-mode' or `interactive-list-mode'.
You can change those variables directly using the variable
`interactive-list-mode'."
(interactive-list t)
(interactive-list t)
(interactive-list nil (save-excursion
(interactive-list-change-list :interactive)
(goto-char (point-max)))))
(defconst interactive-list--pre-d-saved-hook nil
"Function to hook up to save the interactive-list buffer with a saved
intermediate value in the file or sub-file.
This hook is called for commands to save the interactive-list
buffer as is.
A value of `interactive-list-pre-saved-hook' means do not save the
intermediate value."
(interactive-list t)
(interactive-list t)
(interactive-list t)
(interactive-list nil (save-excursion
(interactive-list-change-list :interactive)))
(interactive-list :pre-d-saved-hook nil interactive-list-save-current-file-buffer-hook))
(defconst interactive-list--pre-d-saved-buffer-hook nil
"Function to hook up to save the interactive-list buffer with a saved
intermediate value in the file or sub-file.
This hook is called for commands to save the interactive-list
buffer as is.
A value of `interactive-list-pre-d-saved-hook' means do not save
the interactive value of the buffer as is.
A value of `interactive-list-pre-d-saved-hook' means do not save
the interactive value of the buffer as is."
(interactive-list t)
(interactive-list t)
(interactive-list nil (save-excursion
(interactive-list-change-list :interactive)))
(interactive-list t (save-excursion
(interactive-list-change-list :interactive)))
;; FIXME!!! Use this here in case you are lazy and want to save a file!
(interactive-list t))
(defun interactive-list--save-current-file-buffer ()
"Save the current buffer in a file or sub-file at the prompt.
It is a global variable, called when the current buffer
is modified by others.
If you use `eval-protect' on a Lisp code, insert an
interactive prompt so as to make it work with interactive
list commands by calling the same command on a different line
as defined in `interactive-list-save-buffer-line'. You
======== SAMPLE 4 ========
should do this even if you want to edit it."
(declare (obsolete term-of-month "24.1"))
(easy-menu-define term-of-month-menu term-of-week "1)"
\\='((1 "Wisentz") (2 "Eunice") (3 "Slovenia") (4 "Finland")
("Slovenia" 4 ;; 3 1 2 3 4 5 6 7 8 9) ;; 2 1 2 3 4 5 6 7 8 9)
("Finland" ;; 2 1 2 3 4 5 6 7 8 9)
("Slovenia" ; 1 1 2 3 4 5 6 7
("Finland" 5 ( ;; 2 1 2 3 4 5 6 7
;; 7 8 9 9 ;; ;; 5 " 4 0 6 7 8 9) )
("Finland" ;; 1 1 2 3 4 5 6 7
("Finland" ;; 1 1 2 3 4 5 6 7
("Finland" 7 1 ( ;; 2 1 2 3 4 5 6 7
;; 7 8 9 9 9) )
("Finland" ;; 1 1 2 3 4 5 6 7
("Finland" ;; 2 1 2 3 4 5 6 7
("Finland" ;; 4 1 2 3 4 5 6 7
("Finland" ;; 5 2 1 2 3 4 5 6 7
("Finnland") (6 "Finland") (8 "Finland"))
("Finland" ;; 1 1 2 3 4 5 6 7
("Finland" ;; 2 1 2 3 4 5 6 7
("Finland" ;; 5 2 1 2 3 4 5 6 7
("Finland" ;; 6 1 1 2 3 4 5 6 7
("Finland" ;; 7 2 1 3 4 5 6 7)))
("Finland" ;; 3 1 2 3 4 5 6 7
;; ;; (1)
("Finland" ;; 2 3 1 4 5 6 7
("Finland" ;; 5 2 1 2 3 4 5 6 7
("Finland" ;; 6 1 1 2 3 4 5 6 7
("Finland" ;; 7 2 1 2 3 4 5 6 7)
("Finland" ;; 8 3 1 2 4 5 6 7
("Finland" ;; 9 7 7 7 7 7 8)
("Finland" ;; 10 7 7 7 8 8 9)
("Finland" ;; 11 7 7 8 8 9)
("Finland" (or (aref (semantic-tag-tag tag-
"%file: samples-13800"
======== SAMPLE 1 ========
dr=1" "")
"Helvetica black" "")
"Grave of Ghol" "")
"Gundam chalet" "")
"Gulf Teflon" "")
"Gothic font" "")
"Indian font" "")
"Indian sans serif" "")
"Ira" "")
"Jill-Mannian" "")
"Jill-Mannian" "")
"Kannada" "")
"Kannada" "")
"Lavish font" "")
"Lavish font" "")
"Lebanon color" "")
"Louisian font" "")
"Louisian sans serif" "")
"L'Alphabets" "")
"Latin plain" "")
"Latin plain" "")
"Latin plain color" "")
"Latin plain font" "")
"Latin font" "")
"Latin plain face" "")
"Latin plain face" "")
"Latin plain face font" "")
"Latin plain face face color" "")
"Latin plain face face color" "")
"Latin plain font" "")
"Latin plain face
")
"Latin tau" "")
"Latin tau" "")
"Latin tau" "")
"Li" "")
"Laurel" "")
"Latin dulcim" "")
"Lambda" "")
"Lebanon-type font" "")
"Lebanon-type font" "")
"Lebanon-type font face" "")
"Lebanon-type font face color" "")
"Lebanon-type font face face font color" "")
"Laurel font" "")
"Lafayette plain" "")
"Lafayette plain" "")
"Lambertan-type font" "")
"Lambertan-type font" "")
"Lafayette-type font" "")
"Lafayette blank" "")
"Lavish" "")
"Lang" "")
"Lao" "")
"Lao" "")
"Lao-type font" "")
"Lao-type font" "")
"Lao-type font face" "")
"Lao-type font face color" "")
"Lao-type font face face font color" "")
"Lao-type font face face color" "")
"Lao-type font face face font color" "")
"Lao-type font face face face" font color")
"Lao-type font face face font color")
"Lao-type font face face font color" "")
"Lao-type font face face face color" "")
"Lao-type font face face face face color" "")
"Lao-type font face face face face color" "")
"Lao-type font face face face face color" "")
"Lao-type font face face face face face color" "-1"
"Lao-type font face face face face face color" "-0"
"Lao-type font face face face face face color" "-1"
"Lao-Type font face face face face face color" "-0"
"Lao-Type font face face face face face color" "-1"
"Lao-Type font face face face face face face color" "-2"
"Lao-Type font face face face face face face color" "-3"
"Lao-Type font face face face face face face color" "")
"Lao-Type font face face face face face face color" "")
"Lao-Type font face face face face face face color" "-1"
"Lao-Type font face face face face face face color" "-2"
"Lao-Type font face face face face face face color" "")
"Lao-Type font face face face face face face color" "")
"Lao-Type font face face face face face color" "")
"Lao-Type font face face face face face face color
======== SAMPLE 2 ========
dr]
(defvar cua-bob-print-indentation "B"
"Indentation used to highlight the BibTeX buffer.")
;; This function does nothing when all is quiet except for stuff
;; that might go wrong.
;; The variables `cua-bob-indentat' and `cua-bob-mode' determine
;; what we should indent after.
(defvar cua-bob-indentat "B"
"Indentation used to highlight the BibTeX buffer.")
(defvar cua-bob-indentat-min-column-1
"Minimum number of columns to indent at column 1.")
(defvar cua-bob-indentat-min-column-2
"Minimum number of columns to indent at column 2.")
(defvar cua-bob-indentat-min-column-3
"Minimum number of columns to indent at column 3.")
(defvar cua-bob-indentat-min-column-4
"Minimum number of columns to indent at column 4.")
(defvar cua-bob-indentat-min-column-5
"Minimum number of columns to indent at column 5.")
(defvar cua-bob-indentat-min-column-6
"Minimum number of columns to indent at column 6.")
(defvar cua-bob-indentat-min-column-7
"Minimum number of columns to indent at column 7.")
(defvar cua-bob-indentat-min-column-8
"Minimum column to indent at column 8.")
(defvar cua-bob-indentat-min-column-9
"Minimum column to indent at column 9.")
(defvar cua-bob-indentat-min-column-10
"Minimum column to indent at column 10.")
;; Now this code should be removed.
;;;###autoload
(defcustom cua-bob-mode 1
"Indentation of BibTeX file.
The first value is the indentation level,
the second is the indentation percentage of end of line
and the third is the indentation depth of the buffer. The default value is
to the right."
:group 'cua
:group 'cua-bob
:type 'boolean)
(defvar cua-bp-endofline-1
"Indentation of the BibTeX file if end of line of buffer."
:group 'cua-bp)
(defcustom cua-branch-endofline-1
(if (markerp cua-bp-endofline-1)
'("")
(forward-char 1)
(backward-char 1)
(forward-sentence 2)
(forward-column 2)
(backward-char -1)
(if (and (marker-char cua-bp-endofline-1)
(= (marker-char cua-bp-endofline-1)
(char-after (point)))
(= (marker-char cua-bp-endofline-1)
(char-after (point)))
(= (char-after (point)) (char-after (point)))
(= (marker-char cua-bp-endofline-1)
(char-after (marker-char cua-bp-endofline-1)))
(= (point) (marker-char cua-bp-endofline-1)))
(= cua-bp-endofline-1 cua-bp-endofline-1))
"Line starting bibtex file before `endofline-1'."
:group 'cua-bp
:type 'integer)
(defvar cua-bp-endofline-2
"Time column after `endofline-2
======== SAMPLE 3 ========
drab "" ?Ł)
"Alive at this place.
Move to beginning and end of the code block."
:type '(repeat (choice (const :tag "begin of code block" nil)
(integer :tag "integer")
(const :tag "end of code block" nil))))
;;;###autoload
(defmacro pcase-mode (&rest body)
"Define a mode for printing a string or string.
A function bound to the body of a macro call must return the buffer
with which the print was performed. Calling this with a prefix function
requires no argument.
A function bound to the body of a macro or a macro-expansion
function must also create a new buffer, if any, to hold
the printable string or string. A function that uses this function may
print the string or the string of the printing and the string of the
expansion. To create a new buffer, it may be necessary to initialize
any existing one, and then do the same for the string or string.
A function that does not use a prefix function must do `print' with a
substitution argument; if this condition is non-nil, a function that
uses `print' does not print the string, nor can it print a
substitution, if it wants.
The prefix argument is a string that can be used to indicate how much
string to print. It is used whether the function was called from the global
or the global-variant of the current buffer or from a buffer
that contains this string. When this is both the global variable and an
variable, either the global or the global-variant has a lower
number of arguments than that of the current buffer."
;; A default for `file-name-nondirectory' is to have to add a
;; prefix or a prefix-argument just to insert the string itself.
(let ((file-name-nondirectory
(and (stringp file-name-nondirectory)
(if (and file-name-file-number file-name-file-number)
(let* ((buffer-name-nondirectory buffer-name-nondirectory))
(save-excursion
;; Do not print this string.
(while (and buffer-name-nondirectory
(not (memq file-name-name-directory file-name-nongratulations))))
(cond
((not file-name-nondirectory)
;; We're not printing any string, just like
;; if
;; `filename' (which is called with a prefix arg).
(file-name-concat file-name-nondirectory filename)))
((not file-name-nondirectory)
;; (stringp file-name-nondirectory)
======== SAMPLE 4 ========
dr 'todo)
;; FIXME: I could do "done" in `todo-mode' instead of "done-at-point".
(autoload 'todo-edit-hook "todo-edit" "\
Visit any of the buttons in a buffer at point.
The cursor is moved to the end of the buffer and the function
`todo-edit-hook' is called.
A mouse hook is run after entering the buffer.
If a function is called it returns the buffer containing the
function. A special character is called, called the value.
Each hook function should return a string."
(interactive)
(let* ((beg1 (point)))
(save-excursion
(dolist (todo (or (buffer-undo-list)
(list 'kill (or (buffer-modified-p (current-buffer))
(buffer-modified-p (current-buffer))))
(mapconcat (lambda (e)
(function (or (null (car e))
(function-if (listp e)
(list 'lambda
(function-if (listp e)
(list 'lambda
(list 'lambda
(function-if
(list 'lambda
(function-if
(list 'lambda
"%file: samples-13700"
======== SAMPLE 1 ========
;; In the following example, we set the buffer to the value of the
;; default-directory in the minibuffer. This may or may not give
;; an error. If non-nil, the minibuffer is the default in
;; Emacs mode. This behavior is expected in many
;; applications, so the buffer has to be changed.
(when (and (buffer-local-value
(expand-file-name minibuffer t)
(file-name-directory minibuffer))
(expand-file-name (buffer-file-name minibuffer) t)
;; The minibuffer has been set to the default-directory when
;; we have exited that mode, so we don't get a
;; error. In this case, the following line says:
;; If Emacs only calls `set-mode-hook', this file has
;; been killed, but not changed. So we set a different
;; file, which doesn't have an explicit minibuffer.
(set-mode-hook-next-hook))))
;; Exit the minibuffer.
(while (not (eolp))
(let ((reporter-id (match-string 0)))
;; Kill the minibuffer: we need to do this so that the `set-mode-hook'
;; hook doesn't get modified when we exit Emacs!
(setq minibuffer-flag-flag
(if (null reporter-id)
(set-marker reporter-id nil))
(let ((start (point))
(inhibit-quit t))
(setq reporter-id t)
(unwind-protect
(progn (goto-char start)
(push (forward-char 15) reporter-id)
reporter-id nil)
(kill-local-variable reporter-id)
(setq reporter-id reporter-id-alist))
(unwind-protect
(progn (goto-char (point-min))
(push (or (forward-char 1)
(progn (back-to-indentation)
(skip-chars-forward " \t0-9")
======== SAMPLE 2 ========
(dired-set-auto)))
(unwind-protect
(let ((val (/ (* (setq eudc-type-level 1) 3) nil)
(eudc-display-error t)))
(dired-reset
(unless val
(dired-goto val))
(when (and (eq (car-safe eudc-user-mode-map) 'use)
(stringp eudc-user-mode-map))
(setq val (list eudc-user-mode-map))
(unless (not val) eudc-mode
(setq val 'emacs)
(setq eudc-default-map nil)))
(setq eudc-default-init-map nil))
(dired-set-defaults-map)
(setq eudc-default-mode-map (list eudc-default-map))))
val))))
(defun dired-dictionary-name-default (&optional eudc-user-mode-map)
"Read character default name from the minibuffer.
This is normally used to create a temporary buffer and record the
default name. If it is nil, it defaults to `dired-default-default'.
This function assumes that the user should have the minibuffer set up."
(interactive
(list (read-file-name "Default name" (file-name-nondirectory eudc-user-mode-map))))
(dired-set-defaults-map defaults)
(let ((minibuffer-buffer (current-buffer))
(current-buffer))
;; This function is needed for the minibuffer but not all people
;; want to be saved anyway.
(dired-dictionary-name-default
(mapconcat
(expand-file-name
(narrow-to-region (minibuffer-find-file-name eudc-user-mode-map)
start-minibuffer-name))
(mapconcat
(expand-file-name
(narrow-to-region (minibuffer-find-file-name eudc-user-mode-map)
start-minibuffer-name))
(mapconcat
(expand-file-name
(narrow-to-region (minibuffer-find-file-name eudc-user-mode-map)
start-minibuffer-name))
(mapconcat
(expand-file-name
(minibuffer-find-file-name eudc-user-mode-map))
(mapconcat
(expand-file-name
(minibuffer-find-file-name eudc-user-mode-map)
(minibuffer-find-file-name
(minibuffer-find-file-name (current-buffer)
======== SAMPLE 3 ========
(car (nth 2 (nth 2 the-new-list)))))
;; The same as above (make-list ,1) is used to evaluate
;; the rest of this line.
(if (bolp)
(progn
(while (re-search-forward "\\.$[0-9A-F]+\\(!\\\\\\)*" nil 'move)
(delete-region (match-beginning 0) (1- (match-end 0)))
(setq cml-insert-sub-paragraph s)
(setq cml-insert-sub-paragraph (cursor-minibuffer-flag t))
(setq cml-insert-sub-paragraph (nth 2 cml-insert-sub-paragraph))
(goto-char (match-beginning 0))
(when (re-search-forward "^" nil 'move)
(replace-match nil))))))
;;; Hooking up
(defalias 'gcc-insert-region 'gcc-insert-defun)
;;;; Cleanup
(defun cml-insert-state (state)
"Like `cc-insert-region' but insert all the state information."
(interactive "d")
(cml-beginning-of-sub-paragraph
(prog1
(looking-at cml-sub-paragraph) (setq state 1)
(error "No CCL-E input syntax"))))
(defun cml-insert-state-line (state &optional _ignore _key)
"Like `cc-insert-state' but insert the state LINE."
(interactive "e")
(message "Enter command to be executed:")
(re-search-forward ":?$" nil t))
(defun cml-insert-defun ()
"Insert the state at point.
Deferred state changes after `cc-insert-region' is run.
With optional argument EXIT-MODE-COOKIES, see the variable `cc-insert-state'."
(interactive)
(goto-char cml-state)
(let ((cml-state (car cml-state)))
(goto-char cml-defun))
(cancel-function cml-insert-defun)
(unless (bolp)
(message "Cannot insert state: %s" (cadr cml-state))
(error "Cannot insert at end of buffer"))
(let ((state-state (cdr cml-state))
(state-code (nth 1 state-state))
(state-region (nth 2 state-state))
(state-start nil))
(while (re-search-backward "^\\`\\([a-zA-Z0-9_]+\\).*\\|\\(?:" (regexp-quote state-code) t)
(if (or (fboundp 'c-lspace) (looking-at cml-region-regexp))
(cancel-hookup t)
(cancel-hookup)))
(cond ((string-match cml-insert-state-regexp state-code) t)
((or c-lspace (match-string 1 state-code))
(goto-char (match-beginning 0))
(while (re-search-forward "\\(.*\\)\\([a-zA-Z0-9_]+\\
======== SAMPLE 4 ========
(not (< (point-max) (progn (>= (point) last-entry) 0)))))
(error "Unknown text for category: %s" category))))))
(defvar nndoc-incoming-prompt-regexps (if (re-search-forward "[ \t]" nil t)
""
?]
"Strictly case-insensitive list of regexps to make it easier to identify specific classes of messages.")
(defsubst nndoc-incoming-prompt (prompt beg end)
"Return a plist used by Nndoc to prompt users.
BEG, END do not count as a list, but it is used to look up a new message after it.
This predicate is needed for the `nndoc-incoming-messages' function to
do it right."
(let ((prompt (concat prompt " ")) beg end)
;; The function just called by `nndoc-input-hook' should return a plist
;; that might be used in a future call to `nndoc-input-hook'; see
;; the hook function of `nndoc-input-file-alist'.
(cond
((null prompt) (message-with-line-format
(concat (file-name-directory prompt)
" " beg end) nndoc-input-error-str beg end))
;; We must do it for new messages.
;; We cannot do it for older ones - it is only a small step
(if (>= beg (point-max))
(progn
(setq message-with-line-format prompt)
(let (char-to-string)
(when (string-match "\n" prompt)
(list char-to-string)))
(nndoc-input-hook 'message-with-line-format beg end)))))
(while (not (eobp))
(if (eobp)
(user-error "No mail header at %s" prompt beg end))
(if (not beg) (message "Bad error to send to %s" prompt beg end))
(setq nndoc-error-str beg end (if nndoc-incoming-prompt-regexps
(match-string 1 prompt)
(mapconcat 'identity nndoc-incoming-prompt-regexps
(substring beg beg t t beg)))
(user-error "No error to pass to %s" prompt beg)))))
(setq nndoc-error-str beg end
nndoc-error-str nil nil beg))
(defvar nndoc-prompt-regexps
(if (re-search-forward "\\(#\\+\\(@\\)\\([0-9]\\)*\\)" nil t)
"\\(current-buffer \\(?[0-9]\\)\\)\\("
(match-string 1 t))
(let ((prompt
"%file: samples-13600"
======== SAMPLE 1 ========
forms to be run."
(interactive)
(let (fn-bindings)
(mapcan-apply #'map-fun
(lambda (arg)
(setq arg nil
;; A simple command to specify the binding value. Note that if we
;; use this value, then the user will be queried
;; directly.
(or (and (member arg #'apply)
(not (and #'lambda-bindings
(<= arg 4)))
(eq (assoc (cdr arg)
;; The symbol `apply' is used as a generic binding
;; parameter.
(assoc (cdr arg)
(cdr arg)))))
(when fn-bindings
(and (not #'apply)
(not (member fn-bindings (cdr fn-bindings)))))
(let ((cdr (assoc-default fn-bindings (cdr fn-bindings))))
(setq fn-bindings (cons fn-bindings cdr)))
(push (cons fn-bindings cdr)
(kill-buffer-kill-hook (cdr fn-bindings))))))))
(call-interactively #'mapcar-define-local #'mapcar-mapcar)
(should (or (eq ?\ ] (symbolp (cdr (assq 'mapcar mapcar)))
mapc-mapcar)
(mapcar-define-local #'mapcar-mapcar)
mapc-mapcar)))
(ert-deftest mapcar-mapcar-define-local ()
(mapcar-define-local "foo" "bar" "foo")
(mapcar-define-local "foo_foo" "bar_bar_" "foo")
(mapcar-define-local "bar" "bar_foo_foo_bar_" "bar_bar_foo_bar")
(mapcar-define-local "bar_bar_foo_bar_" "bar"))
(ert-deftest mapcar-mapcar-define-local-internal ()
(mapcar-define-local "foo" "bar")
(mapcar-define-local "foo_foo" "bar_bar_bar_" "bar_bar_foo_bar")
(mapcar
======== SAMPLE 2 ========
forms at point.
Use \\[universal-argument] `universal-argument' to give `org-link-command' an
exclamation-point prefix."
(save-excursion
(goto-char (if org-link-command 'link-at 'link-at)
com-link-command (list (point) (forward-line)))
(and org-link-command
(looking-at org-link-command))
(org-link-command org-link-command)
(org-add-info 'end (point)))
(org-mode-line-update)
(let (org-file-name)
;; This should be a string rather than a file name.
(while (and (string-match
(concat "^\\(.*\\)?\\("
(regexp-opt 'org-path-name)
(regexp-opt 'org-link-command))
(file-name-nondirectory (regexp-opt 'org-root-directory))))
(setq file-name-directory (file-name-directory
org-file-name)))
(setq org-file-name
(substring file-name-directory file-name-directory)
org-file-name))));;;----------------------------------------------------------------;
;;;###autoload
(defun org-lineup ()
"Parse or return a Lineup string."
(org-forward-line -1)
(org-forward-line 1)
(save-excursion
(setq org-lineup-after-insert-function (cons org-lineup-after-insert))))
;;;###autoload
(define-derived-mode org-lineup-mode special-mode "All Lineups"
"Major mode for editing Lineup string."
(declare (indent 2))
(let* ((lineup (org-list-get-lineup)))
(if lineup (org-insert ",") (org-lineup (org-list-get-lines))))
(if (re-search-forward org-lineup-backward-regexp nil t t) (save-excursion
(end-of-line) (goto-char (match-end 1))
(re-search-forward org-lineup-forward-regexp nil t t)
(re-search-forward org-lineup-backward-regexp nil t
(let ((lineup (match-string 1)))))))))
;;;###autoload
(defun org-lineup-begin-line ()
"Insert line of this string at point."
(beginning-of-line)
(org-indent-to-region (point-min))
(skip-chars-forward " \t")
(skip-chars-forward " \t")
;; If lineup doesn't already have this, move to the next line.
(beginning-of-line)
(skip-chars-forward " \t")
(skip-chars-forward "\n")
(skip-chars-backward " \t")
;; Insert this with point at the beginning
======== SAMPLE 3 ========
forms of a group of symbols; for example, `c-n ', which is the symbol of a function, the symbol of a function is the symbol of a function.
When any symbol is a subexpression of a symbol on the left side of a group,
that symbol is a substitute of the subexpression on the right side.
For an expression:
(setq e (nreverse e))
(eq e 'C' \"\". ; the left side of an expression with `c'
(setq e (cons '(n 1) e)))
(setq e (cdr e)))
(when (and (eq (car e) 's-0)
(eq (car e) -0)
;; For a `b' operator. If the symbol is a BOL, then just add the
;; singleton to the left of the symbol's parent
;; function if the parent is a subexpression. And add
;; the last part of the subexpression to the left of it
;; if it contains a double.
(eq major-mode 'symbol-table)
t)
(setq e (nreverse e)))
(when (null e)
(or (vectorp e) (member e `(lambda ...))
(progn (setq e (cdr e)))
(setq e (point-max))))
(forward-char 1))
(defun c-x-or-c-maybe-eql (subexpression &optional nonempty)
"Return non-nil if a C syntax expression matching this SUBPROPERTY is valid."
(gsubexpression '(1 2 3 4))
(let* ((subsubexpression
(cons (symbol-name (abbreviate-file-name subexpression)) (abbreviate-file-name subexpression)))
(propertize subexpression nonempty subsubexpression)
(+ (- (point-max) 14) (- (point-max) 2))))
(defun c-x-maybe-eval-eql (subexpression)
"Return non-nil if a C syntax expression matching THIS SUBPROPERTY is valid."
;; If the subexpression can't be called with a prefix at point, it'll be called
;; directly from BODY, so in that case we'll assume that if a subexpression matches
;; SUBPROPERTY directly, the subexpression will do the right thing for that
;; prefix. The return value is always nil.
(cond
((eq (car-safe (zerop (cdr subexpression))) t)
;; A subexpression is a symbol whose parents are C's and whose parent
;; is the value of SUBPROPERTY of a symbol. If BODY is in range, the
;; result is the symbol of that subexpression.
t)
((consp b)
(car b))
(t
;; Find subexpression's parent and return true, otherwise not enough.
(if (> subsubexpression 0)
(setq subsubexpression (1- subsubexpression))))
((eq (car-safe (cdr subexpression)))
(c-clear-syntax-table))
(setq b (cdr b)))
((eq (car-safe (cdr subexpression)) 'C)
(c-delete-syntax-table)
(car (cdr b))))
(
======== SAMPLE 4 ========
forms
(append
(lambda ()
(cond
((progn
(goto-char (car-safe (car-safe (cdr-safe (cdr-altp)))))))
t)
((match-end 3)
(insert "\n"))
((equal "yay")
(insert "yay"))
((eq "yay") t))
(t
(forward-line)))
((not match-end)
(concat ": "
(point-max) "; ")))
(t
(forward-line))))))
(defun rng-forward-comment (string) (if (equal string "*")
""
"*")
"Forward the current line to the current text.
STRING is a list of strings, each of which should
be one of them as a string; in this case, the \"*\"
string is the string to insert before or after."
(save-excursion
(save-restriction
(let ((buf (read-from-string string)))
(erase-buffer) nil)
(goto-char (point-min)))))
(defun rng-back-comment (string)
"Move the current line to the current text.
STRING is a list of strings. When the second arg
non-nil, use "\" as the character name."
(save-excursion
(move-to-buffer-other-frame
(save-excursion
(goto-char (point-max))
(let ((str (buffer-substring string (point)))
(buf (read-buffer (current-buffer)))
(inhibit-modifications t)
(bufargs (read-from-minibuffer string))
(string (buffer-substring string t t)))
(message "Beginning \"\" comment...done")))
(message "Beginning \"\" comment...")
;; Skip a comment.
(let ((buf (read-from-minibuffer string)))
(goto-char (point-min)))))
(defun rng-current-comment (string)
"Move the current line to the current text in the current buffer.
STRING is a list of strings, each of which should be a comment,
starting with a space. When the second arg "\" is non-nil, use \"\"
equally as character name."
(save-excursion
(goto-char (point-min))
(goto-char (point-min)))))
(defun rng-parse-comment ()
"<"
"<"
"<"
"\n"
"\n"
(let ((
"%file: samples-13500"
======== SAMPLE 1 ========
ªm» "Е°¨ "
"Є°¯ì‚°í•ˆì–¨‘覨") (2389 . "세사蕰")
"膣³ì–‘覨 얱¨ö†¡à¹Œå‘蟐얠덓 뾬覇酥햨½í€¶ ë°´ 윰 슨"
"픝사 얱์妴띴 쁄필 ì–´à¹Œå¦·à„‰í—ˆ 쀹할돈띴 사물 싈와 줐둴 읜거릤두욠 사물")
("í¥ŒåŠ·å¦„ì§ˆì¼ì§… 일할능 세 첨솄첨 조욻툐있탕할할할할할얼볠 아릴필")
("짊에 캛리필리앂 삠찔 소를숤") (2499 . "Ɋ“을 은묨 은문 줐니알밡양 줐니알밡양 아는 은묨아엠기 아는 삠의령롐지양 줐령롐凔턕嗑嘭을妗冧旼 은에 은령양 줐니앰밡양 줐니알밡양 아할할할할얼묠질을톌 얼에수길 소를싖")
(3540 . "섰 삠할닣 얲길 섰") (3203 . "
======== SAMPLE 2 ========
‹à³Šà¸¢à¹Œà¸€à¸°à¸¯à¸à¸°"
"สะย์สะหอง"
"สะเะสะเะแะสะแา"
"สะแา่ลอา"
"สะ่าทศ์"
"สะ๊า"
"สะ๋า"
"สะ๒กะ"
"สะ็ารั่"
"ส็าาาระนคาดษชะ"
"ส่าาทศงิฐกะส่าะาาณ"
"ส่าะาาำ"
"ส่าะาำสะส๲ะาาัิุà¡"
"ส่าะำสะะะ์"
"ส่าาำำคาะส๲ะะะ์"
"à¸§à¸à†…à¹Œ"
"วกà‡èˆˆà¸¹à¸«à¸¢à¹Œ"
"วกà‡Ã¼à¸‡à¸£à¸£à¹Œà¸à¸²à¸©à¸™à¸Šà¸±à¸‡à¸²à¸°à¸ªà¸°à¸žà¸±
======== SAMPLE 3 ========
¤»–")
(2032 . "ᕸ㌣¨ 칰딬 하")
(2035 . "앸 핖객 칰내 칰")
(2036 . "실 금 깛")
(2038 . "쯸 ꧈ 땄")
(20716 . "Ǘ‰ 뺈 붻폗핲 칰내 ì¹°")
(20717 . "한닶 마 녜 칰내 칰")
(20722 . "밿 마 녜 칰")
(20727 . "빛울 헂강 깛맕 칰")
(20386 . "실 몳")
(20736 . "바 죄 죄솝새 칰내 칰질질 칌윧엜 칰내 칰")
(20742 . "모 늄먨할 칰")
(20393 . "눘려뛄 칰내 칰")
(20739 . "늖람를 늀갗 뷀내 칰")
(20631 . "실 확쓄 효할 칰내 칰질 칰내 칰질질뇈질 칰내 칰")
(20638 . "찠성품 마할 칰내 칰내 칰내 칰환 칰내 칰")
(20743 . "슍을 칰내 칰내 칰내 칰 칰내 칰 칰")
(20639 . "실리질 칰뜨우리촦 칰로할 칰")
(20640 . "배마 칰릴 칰 칰짠 칰 칰질듦할 칰
======== SAMPLE 4 ========
¤­£éŒ£éŒ§.")
("hใu콜„¼ìƒ¬ê±°")
("hใu콀€ìƒ¬é§é”™" "釀途邘邚")
("hใu콂ȵ˜ì–¸")
("hใu콂ȵ™ì—¸ìƒ¹, 엸얫올릴밀집집줈실게")
("h๻ì¶(니 지샥릴리 지니지먹왼 지니 지먹왼 지돍ɏì–¸ 지駈릌어를할할 지할 지뇤숸 지슸할 지할 지마릌 지멍리랑 지할할 지槪언 지먹지항항 지항 지항 지를딨­ì°¨")
("hใu콉엠샪 얨얼얰곱나늊 첔슬 야 첔햾섉름 첔갑실화룈")
("hใu콈슓싐 울얩륨레필엩 언를모연갌짖 옄륩묩물 엳짌킠옅묖´í–¸ë´ 좜릧아문 지 ì—¸ë‹”ëŒí¥¼ 울엸")
("hใu콊직첲킴엸니리의룝ì´ì§í¯ 읜기 처읬말 섓 챰엸덩 언를묱눘눗할 숽이륄 솜강랑얝할 쬰며팔
"%file: samples-13400"
======== SAMPLE 1 ========
)
(when (or (null (car (cadr-alist))))
(funcall (cadr calc-trunc-p (cadr-alist) 'calcFunc-fancy))
(funcall (cadr calc-trunc-p
(cadr-alist) nil t)))))
(defun calc-trunc-function (arg)
(let (arg-list)
(while (or (not (setq arg (or (and (<= (car arg) 5) 0)) (car arg))
(< (car arg) 7) 20))
(setq arg (cons (cons (car arg) (cdr arg)) arg-list)))
(calc-remove-infos)
(calc-set-operand-offset)
(setq arg-list
(expand-abbrev map
(let ((arg-list (list args))))
(or map #'append))))))
(provide 'calc-generic)
;; Local Variables:
;; coding: utf-16-enc-char-code-string
;; End:
;;; calc.el ends here
<|endoftext|>;;; lisp.el --- C code analysis and outputting functions -*- lexical-binding: t; -*-
;; Copyright (C) 1985-1987, 1992, 1994-1996, 1997, 2001-2019 Free Software
;; Foundation, Inc.
;; Author:
;;
;; John Mackenzie <john-mackenzie at rmdeebs.org>
;; Keywords:
;; This file is part of GNU Emacs.
;;
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; See `calc-generic-compilation-defs'. Use this from
;; calc-standard.
;; * Locate the main function on the left-hand side of a file for
;; `lisp'.
;; * Go to the directory for which lisp-defs is invoked and
;; * search for `lisp-defs-directory' in the current buffer and
;; * return it to calc-generic-compilation-defs for a listing
;; * of the files in the current directory.
;;
;; ********************************----------
(defvar bacile-file-header lisp-defs-directory (make-hash-table :safe ,t :initarg)
"Directory to load lisp defs as a buffer's file header.
This is a directory to build this library library.")
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;
;; ;###autoload
(easy-mmode-define-lisp-defs
"Define Lisp defs in the lisp shell if they have an old version of
;; lisp shell. Define a function after each defusing expression in
;; lisp. The function will accept two arguments, a value
;; describing the function being used (which must be a
;; non-lisp shell function call) and a variable
;; to define the function being used (which must be a
;; Lisp expression call). Define a function if one is passed
;; and defalias it using the same defpackage as defs.
;;
;; The defcustom function (i.e. `if-let*'
======== SAMPLE 2 ========
)
;; First check whether we're in the middle of a command
(if (string-match "[\\.\\\\]" x)
(setq x (concat "[\\.\n]*\\(.\\)" x "$")))
;; We now have a function that returns something which works
;; on Emacs, we want to find something that would work on other
;; systems. If, though, it works, then we could either
;; just let the function do it ourselves, and do that by hand, or use
;; a custom function, and give the function some specific input
;; commands.
(let ((action x))
(while (setq action (assq action x))
(let ((command (get-text-property x 'action (1- (mapcar #'symbol-function
'symbol-function))))
(when command
(set-text-properties
(cdr (assq command x))
(cdr (assq command x)))))))
(if action
(setq action (assq action x))))))
(defun command-symbol--symbol-function
(symbol-function-symbol symbol-file x)
"Return list of symbols in BUFFER which are known to be defined by command.
BUFFER is an input/output buffer."
(if (and (stringp symbol) (+ (get symbol 'symbol-function) (get x 'symbol-function))
(assq (1+ (symbol-function-symbol symbol))) ; We're not in a special buffer
x ; There's another one.
(let ((action
(assq (1+ x) (assq x))))
(symbol-function-symbol symbol-file))))))
;;;###autoload
(defun newline ()
"Mark the next non-ASCII character."
(interactive)
(when (re-search-forward "^\\(" nil t)
(prefix-numeric-value 0))
(newline))))
;;;###autoload
(defun newline ()
"Mark the next non-ASCII character as POSITIVE."
(interactive)
(when (re-search-forward "^\\= " nil t)
(prefix-numeric-value 0))
(newline)))
;;;###autoload
(defun newline ()
"Mark the preceding non-ASCII character as POSITIVE."
(interactive)
(when (re-search-forward "^\\(" nil t)
(prefix-numeric-value 0))
(newline))))
;;;###autoload
(defun newline ()
"Mark the next non-ASCII char as POSITIVE."
(interactive)
(when (re-search-forward "^\\(" nil t)
(prefix-numeric-value 0))
(newline)))
;;;###autoload
(defun newline ()
"Mark the preceding non-ASCII character as POSITIVE."
(interactive)
(when (re-search-forward "^\\(" nil t
======== SAMPLE 3 ========
)
(cond ((stringp (nth 3 (org-element-property :format
:type category
:style (org-list . "data") :value group) :type (org-element-list style)))
(t alist)))))
(defun org-element-property-format (type category group custom &optional group-flag)
"Format a new item using type TYPE in the elements of the given BODY.
If GROUP and GROUP-FLAG are non-nil, return the property name for TYPE in
the groups, in the groups (if any), and return the value.
This function can be called by either of the following forms:
(START : STATEMENT-ARGEMENT)
(END : STATEMENT-ARGEMENT)
(FUNC)
(FUNC-FUNC)
(FUNC-FLAG)
(REGEXP)
(FUNCTION-REGEXP)
(FUNCTION-FLAG)
(HANDLEN)
(FUNCTION-HANDLEN)
(FONTHANDLE)
(FONT-HANDLE)
(START : ARTICLE-DATA)
(END : ARTICLE-DATA)
(FONT-HANDLE)
(FUNCTION-FUNCTION)
(FUNCTION-FLAG)
(TEST-START : HEADERS)
(HEADERS)
(HARD-START)
(HARD-HEADER)
(FUNCTION-FUNCTION)
(FUNCTION-FLAG)
(FONT-STRING)
(HEADER)
(HEADER-HIDDEN-HANDLE)
(HEADER-SPECIFIC-HANDLE)
(HEADERS)
(HEADER-STATUS)
(HEADER-CATEGORY)
(HEADER-STATIC-HANDLE)
(HEADER-HIGHLIGHT)
(HIGHLIGHT-HEADER)
(START : LINK)
(START-MARK)
(START-STATUTE)
(TAGNAMENT)
(TAG-TYPE)
(START-STATUTE)
(START-STATUTE-HEADER)
(START-STATUTE-HIGHLIGHT)
(ARTICLE)
(ARTICLE-STATUS)
(STARTERS)
(TAG-TYPE-STATUS-HEADERS)
(TAG-UNDO-BY-TAGS)
(TAG-STATUS-STATUS-HEADERS)
(START-STATUTE)
(START-STATUTE-HEADER)
(START-STATUTE-HIGHLIGHT)
(START-STATUTE-STATIC-HANDLE)
(START-STATUTE-STATIC-HIGHLIGHT)
(START-STATUTE-STATIC-HIGHLIGHT-HEADER)
(START-STATUTE-STATIC-HIGHLIGHT-HEADER-STATUS)
(STATUS-STATUS)
(STATUS-STATUS-STATUS)
(STATUS-STATUS-STAT)
Here is the first level of this function, but I have found it very useful to add functionality to it.
(defvar org-element-format-formulas
'("\\(" \t")
;; If the FORM-LIST is empty, return nil .
(if (and (stringp (nth 4 org-element-format-function))
(> (nth 1 org-element-format-function) 0))
(< (nth 1 org-element-format-function) 0)))
#'concat
;; If the result of FORM-LIST is a string,
======== SAMPLE 4 ========
) (set (lambda (x) (string= (substring x 0 1)) (string= (substring x -1) 1)))))
;; The function 'buffer-pairs-contents' was made to work with the
;; `window-pixels' variable, rather than with (window-pixels t)
;; `window-number-pixels'. The value of (window-pixels t) can be
;; changed. The function 'window-pixels (function)) was
;; re-implemented to handle multiple display sizes. Since that
;; was not a part of the default, it makes sense to use the
;; `frame-positions' variable for making it more robust. On a
;; level of generalizability, the `frame-locate-bounds' setting is still
;; worth considering.
;;; Code:
(eval-when-compile (require 'cl-lib)
"Compile Emacs Lisp code using the new display-pixels mode."
(declare (debug (format "(font-lock-mode) %s") (font-spec '(:foreground "Black" :background "Dark green"))
(font-spec '(:foreground "Black" :background "Dark green")
(or t t))
(frame-positions '((:overline) t t))
(window-pixels '(:foreground "Dark green" :background "Dark green"))
(frame-positions '(:horizontal-only (:height 0 :right)
:underline)
:line-break-function
nil)
(display-pixels '(3)))))
(eval-when-compile
(require 'font-lock-keywords)
(let ((locate-bounds (font-spec '(:background:black :foreground :foreground "Dark green") :underline)
(window-pixels '((:horizontal-only (x :height))
:underline)
:line-break-function
:line-break-function
:line-break-function)))))
(when locate-bounds (set (make-local-variable 'buffer-file-coding-system)
(if (bufferp buffer)
buffer
(concat (
"%file: samples-13300"
======== SAMPLE 1 ========
gramg-font-lock-keywords)))
((syntax-propertize
`(:font ":bold" ,@(math-parse-calcFunc-from-syntax)
,@[(math-parse-calcFunc-from-syntax) ":]")
(:font ":bold" ,@(math-parse-calcFunc-from-syntax)
,@[(math-parse-calcFunc-from-syntax) ":]")
;;:math-expr-table:t
,@(math-parse-calcFunc-from-syntax)
(:font ":bold" ,@(math-parse-calcFunc-from-syntax)
,@(math-parse-calcFunc-from-syntax) ":]")
;;:math-expr-table:t
,@(math-parse-calcFunc-from-syntax)
(:font ":bold" ,@(math-parse-calcFunc-from-syntax)
(:font ":bold" ,@(math-parse-calcFunc-from-syntax)
":]")
;;:math-expr-table:t
,@(math-parse-calcFunc-from-syntax)
(:font ":bold" ,@(math-parse-calcFunc-from-syntax)
(:font ":bold" ,@(math-parse-calcFunc-from-syntax)
":]")
(:font ":bold" ,@(math-parse-calcFunc-from-syntax)
(:font ":bold" ,@(math-parse-calcFunc-from-syntax)
":]"))
(+ 1
(math-parse-calcFunc-from-syntax)
(math-parse-calcFunc-from-syntax)))
(math-read-input "#*From:" math-prec-output-1 nil)
;;:math-expr-table:t
;;(if (called-interactively-p 'interactive)
(math-expr-table
======== SAMPLE 2 ========
gramn-c-invisible-on-display))
;; FIXME: This function must be removed
;; from `c-deftest-c-fontify-symbols'.
(c-font-lock-type-face c-font-lock-type-face 'font-lock))
)
(c-cache-display-function 'c-cache-show-cache-name))
(defun c-cache-display-function (a)
"Return the display table `c-cache-display' for that table."
(if (eq (c-car-vector a) 'font-lock-case)
(c-cache-cache-name (c-getc-cache-name "c-cache-display"))
(if (< a 0)
(error "Cannot display an entire entry: %s" a)
(c-cache-display-function "c-cache-display" :data t)
(or c-cache-cache-cache-name c-cache-cache-c-cache-cache-name)
(error "Cannot display any entry: %s" a))))
(defun c-cache-set-file (c &optional file)
"Set the CURRENT FILENAME to FILE. This function has no effect if the current file
is not a file."
(let ((cache (c-getc-cache-name "cache"))
(c-name (car cache)))
(if (or file name)
(error "Cannot set: %s" name)
(c-cache-cache-name
(car (cdr cache)))
(let ((c (assoc c c-cache-cache-cached-alist))
(i 0)
(tmp-list (nthcdr (1- (length tmp-list)))
(tmp-list-no-properties 0)))
(setcdr (assoc tmp-list c) t)))
(if cache
(error "Cannot set: nil" 'c-cache-cache-no-properties)))
(or (eq (cdr c) c)
(error "Cannot set: 'c-cache-list-no-properties"))
(dolist (tmp-list tmp-list)
(setq tmp-list
(apply (cdr tmp-list) (concat tmp-list-alist)))))
(or (eq (cdr tmp-list) c)
(error "Cannot set: 'c-default-cache-list-no-properties"))
(dolist (tmp-list tmp-list)
(setq tmp-list (concat tmp-list-alist)))))
(defun c-cache-get-cache-name (name)
"Return the cache name for THIS NAME."
(concat "c:/" name)))
(defun c-cache-get-cache-name-all (name)
"Return number of caches in THIS NAME in a list.
This function cannot be called with a prefix argument."
(let ((cache-list (c-getc-cache-name "cache-list"))
cache-list-no-properties)
(dolist (name cache-list)
(if (nthcdr (1- (length name)) cache-list-no-properties)
(error "Cannot use %s" name (nth 1 cache-list)))
(goto-char beg)
(unless (eobp)
======== SAMPLE 3 ========
gramm-define-default-map
[^0-9]+... [A-Za-z0-9_]+ {3,}"
"\\|"
[^0-9]+...[0-9]\\{1,}"
"\\|"
(let ((map (make-sparse-keymap)))
(if (eobp)
(error "Invalid map: [A-Za-z0-9_]+"))
(define-key map [A-Za-z0-9-2] 'define)
(define-key map "\C-cC-c" 'define-maphash-map)
map)
;; If we are trying to parse a buffer, use this to put that buffer into the
;; definition.
(pcomplete-define-map (mapc 'define-map (make-sparse-keymap)))
`("\\{define-key \".define}"
("\\|" (define-define-key map [A-Za-z0-9_]+
'define-maphash-map)
["#define-[A-Za-z0-9-1] Xcode C#]"
(define-key map [A-Za-z0-9-2] 'define-maphash-map)
"\C-cC-c" "define-maphash-map"))
"Keymap for `pcomplete-define-define'.")
(defvar pcomplete-define-map) ;(make-sparse-keymap 'pcomplete-define-map)
(defun pcomplete-define-map (list)
"Return the `pcomplete-define' map.
It is also searched for by `pcomplete-set-default-map'."
(let ((map (pcomplete-define-map list)))
(pcomplete-define-map))
(define-key map "\M-[%s]"
(lambda (s)
(let ((map (make-sparse-keymap s)))
(define-default map)))
map))
(defun pcomplete-define-map (keylist &optional no-warn)
(let ((map (make-sparse-keymap keylist)))
(pcomplete-define-map (list keylist) t)))
(declare-function pcomplete-define-setup "pcomplete" ())
(defun pcomp-define-map (&optional let-alias)
(let ((map (make-sparse-keymap)))
(pcomplete-define-map (let ((var (or (aref pcomplete-define-map
(list "\\\"" 'font-lock-keywords)))
(set-keymap-parent let-alias 'font-lock-keywords)))))
(pcomplete-define-map (list var) "\\s-+")
(mapc #'define-key map "" nil t)))
(defun pcomplete-define-set-default-map ()
(let ((map (make-sparse-keymap)))
(pcomplete-define-map (make-sparse-keymap)))
;; set-default-after-kill-buffer is a hack for making sure pcomplete will check
;; for the name of the macro, and also to handle an "default" macro
;; that is defined. It is also useful for setting up the variables to
;; override the value of variable and macro values.
(if (null pcomplete-define-map)
======== SAMPLE 4 ========
gram.el)
(setq c-c-block-list t
(goto-char (or (eobp) 0))
(goto-char (point-max))))
(cl-defmethod b-table ((elem &optional column)
'paragraph)
"Return TABLE as a list-line for the current buffer.
Optional argument column is a number.
A table may contain two elements: a block of text and
a column. A table should have an empty string before the
number. Column must be one of 0, 1 or 2. The argument can also be an
element, which must be a list."
(cl-defmethod (b-table (nth 1 entry))
(nthcdr 2 entry))
(cl-defmethod (b-table (nth 3 entry))
(nth 1 entry))
(let ((table (append table column)))
(if column 0
(if b-list
(message "Table %d: " (or b-list
(nth 1 entry) " contains one line"))
(while (and b-list
(> row-count (list column) (length table)))
(setq table table)
(error "No more entries for %s than %d lines in B-list"))
(if b-list
(message "Table %d: " (or b-list
b-list
(nth 2 entry))
(setq table c c-list)
(setq c c-lst-table table c c-lst-table)
(error "Cannot find entry for %d of B-list" row-count number)))))
(cl-defmethod b-table (table)
"Return TABLE containing the line width, column and row values of TABLE."
(setq b-list
table)
(let ((column (if (member table column) table -1 column))
(row-count (if (member table row)
(- row-count
(- row-count
(- row-count (+ row-count 1)))))
;; Table of 3, 2, + or (a-a-n-w-e) blocks.
(r-size (if (member table col) (member table row))))
;; Table of 3, 2, + or (a-a-n-w-e) blocks.
;; (if row < col, then row will change column.)
;; Column of row.
"%file: samples-13200"
======== SAMPLE 1 ========
"Align point to column in a window"
["Invisibility" ; Non-nil means invert the message.
(:vert "Invisibility"))))
(defun ebrowse-display-frame (window)
(set-frame ebrowse-display-frame window)
(let ((x (window-point window)))
(set-frame ebrowse-frame window)
(if x
(set-window window x)
(if (< x 0)
(window-visible window)
(set-window window x))))
(defun ebrowse-display-frame-left (window t)
;; This is the `invisible-window.
;; FIXME: This doesn't work when the parent window is
;; not visible in the frame, or when the parent window is
;; not visible at all.
;; When window is visible, it's best to make point visible on the
;; parent window. (I.e., point is the first non-nil position in the
;; window.)
(setq window-min-size (ebrowse-invisible window '(1))))
;; FIXME: This doesn't work when the parent window is
;; not visible in the frame.
(setq window-indent (- (ebrowse-invisible window)
(- window-max-size))
(window-size (- window-min-size))
window-min-frame-count x)
(set-frame window-indent
(max (window-size window-min-frame-count))
(window-size (window-size window-min-frame-count))
window-size (window-size window))))
(defun ebrowse-show-frame (window)
(set-frame ebrowse-show-frame window)
(let (invisible-window (ebrowse-frame-invisible window))
(while (eobp))
(if (and (progn (window-live-p window)
(< window-max-size window)
(= window-min-size window))))
(let ((win (window-size window-min-window-count))
(win-frame (window-frame window))
(window (selected-window)))
;; Set the old frame and the new frame to reflect the
;; contents of the current window.
(unless (eobp)
(set-window-dedent nil)
(set-window-start window))
;; Invert the message, then display the frame
(if (and (eobp)
(ebrowse-invisible window)
(= window-min-window window)
(> (window-size window)
(display-not 0))
(if (> window-max-width (- window-max-width))))
(if window-start
(1min window (- window
======== SAMPLE 2 ========
("^" ?\177) (")
("^" ?\177))
(defvar wisent-current-display nil)
(defvar wisent-display-help nil)
;;;###autoload
(defun wisent-set-display (display list)
"Set/edit display list in WISENT-mode to the current display."
(interactive "P")
(setq wisent-current-display nil)
(wisent-remove-display-help-help)
(wisent-set-display-help)
(let ((win (make-frame--display-mode win)))
(if (+ (length wisent-current-display) 2) ; 0
(let (win win)
(while (cdr (assoc wisent-display-alist win)))
(wisent-add-display-help-help win nil nil)
(setqwin win)
(setqlist nil)))
(when (get-buffer-window wisent-current-display)
(wisent-display-help win "Display %d" (car list)))
(wisent-add-display-help list wisent-current-display)
(wisent-set-display-help-help))
;; When we do a simple toggle, then some menu and window.
(if wisent-toggle (wisent-remove-display-help-help)))
;; Set display mode after WISENT-mode is called.
(wisent-set-display-help)
;; Create a new wisent-current-display and add it to the current list.
(wisent-add-display-help-help (- (length wisent-current-display)))
(wisent-set-current-list win nil)))
(defun wisent-add-display-help-regexp (arg)
"Replace a regexp in the current entry of the WISENT display list with
the new regexp in the current entry of the list, as an absolute string."
(interactive (list (if arg (funcall (format "^\\(.*\\)"))))
(wisent-add-display-help-regexp arg)))
(defmacro wisent-add-display-help-regexp (&rest args)
"Efface `display' to another display."
(declare (intern (intern "help")) (intern (intern (intern "help"))) (intern (intern (intern (intern "help"))))))
(defun wisent-add-display-help-regexp (arg)
"Efface `display' again to another display."
(interactive (list (if arg (funcall (format "^\\(.*\\)")))
(wisent-add-display-help-regexp arg)))
(defmacro wisent-add-display-help-regexp-start (arg)
"Efface `display' to another display."
(declare (intern (intern "help")) (intern (intern (intern "help"))))))
(defmacro wisent-add-display-help-regexp-start (arg)
"Efface `display' to another display."
(declare (intern (intern "help"))))
(add-hook 'defun-yank 'wisent-make-argument-hook
(lambda ()
(yank))
"Efface `display' to another display run again."
(if wisent-toggle (wisent-add-display-help-regexp arg)
(if wisent-toggle (wisent-insert-display-help-regexp arg "")
(wisent-remove-display-
======== SAMPLE 3 ========
(and (not (stringp c)) :file))
(when (file-exists-p c)
(setq file-properties-used (cons (file-relative-name (car c)) file-properties-used)))
(let ((coding-system-for-write 'sha1))
(cond
((and (file-exists-p c)
(or (file-readable-p c)
(file-writable-p c)))
(set-file-modes file-properties-used)
(setq file-files-coding-system
(cons file-properties-used file-files-coding-system)))
(setq file-process-local-cache (cons file-process-local-cache
(directory-files file-process-local-cache)))))
(when file-process-local-cache
(set (make-local-variable 'file-process-local-cache) 0))
(when file-process-local-cache
(set (make-local-variable 'file-process-remote-function) new-file))
(make-local-variable 'file-process-local-cache)))
(prog1
,(when (not (file-writable-p c))
(file-exists-p c))
(condition-case nil
(save-excursion
(goto-char (point-min))
(set-visited-file-modtime (current-buffer))
(while (not (not (file-exists-p c)))))
(file-error)
(file-error))))
(defvar file-process-file-name)
(defvar file-process-local-cache)
(defvar file-process-local-cache-name)
(defvar file-process-last-input-file-name)
(defvar file-process-local-cache-name)
(defun file-process-parse-process ()
(setq file-process-local-cache (cons (file-local-cache) file-process-local-cache))
(unless file-process-parse-process
(run-hook-with-args
:require 'file-monitor
(custom-set-variable 'file-process-local-cache t))
(modify-syntax-entry ?^ (match-beginning 0) t))
(defun file-process-exit-unless-finally ()
(let ((inhibit-read-only t))
;; Otherwise, if any process failed, `file-process-exit'
;; can handle that as well.
(when file-process-remote-function
(make-local-variable 'file-process-local-cache)
(setq file-process-local-cache (find-file-noselect file-process-remote-function))))
(file-process-exit-unless-finally)
;; Otherwise, make sure the exit code is non-nil before the process process
;;
;; ;; will exit before using this file-process-local-cache.
(make-local-variable 'file-process-local-cache)
;; Otherwise, if there was a chance of something happen, the
;; process process was not connected, the exit code was non-nil, the
;; process exited at the correct time
;; nil)
(or (process-send-string
(concat "\\<input\\(?:"
nil
(file-name-nondirectory file-process-local-cache)
======== SAMPLE 4 ========
(diary-date-to-date-string
(diary-date-to-date-from-string
(or date-extension (date-extension
(diary-date-to-date-string
diary-date-to-date-from-string))))))
date-extension)
'function-list))
;;; User variables:
;;
;; The following variables are not actually user variables;
;; they appear as they look
(defvar calendar-time-stamp-p nil) ; in the calendar
(defconst calendar-time-stamp-timestamp-format "")
(defvar calendar-time-stamp-year nil
"String representing the year in days.")
(put 'calendar-time-stamp (lambda (year y &optional y t date)) 'calendar-time-stamp-timestamp-format)
(put 'calendar-time "")
(put 'calendar-time-in "")
'calendar-time-stamp-timestamp-date '(0 0 0 0))
(put 'calendar-time-stamp-time "")
(put 'calendar-time-name "")
;;; Variables:
;;
;; This variable contains the name of the diary file to use.
;; To convert the file to a file, you must make a temporary file before
;; doing this.
(defvar diary-dir)
(defvar calendar-dir-default-file
(convert-standard-filename
(concat "*" calendar-dir-name "*")
(concat (concat
(get-buffer-create "*calendar-diary*")
(get-buffer-process "calendar.exe"))
(concat (if diary-dir-default-file "Calendar-Diary-File" "")))))
(defvar calendar-file-name nil) ; in the file calendar-time-stamp
(defvar diary-time-list nil) ; in the file diary-time-file
(defvar calendar-time-string nil
"String representing the time value in days and hours and/or minutes.")
(defvar date-time-list nil) ; in the file datetime
(defvar date-format-list nil) ; in the file datetime-format
(defvar date-time-string nil) ; in the file datetime-format" tbv"))
;; Bug fixing: Don't change the date in DATE, but always change the format.
(defun diary-date-to-date (&optional no-extension diary-date-to-date)
"Transcode an old diary from user-defined time into the current time with
DATE as argument. The user can call `calendar-time' instead of
using `diary-date-from-time' here so that the buffer used by the
diary file can be reused. The time returned by `calendar-time-to-date-reuse'
will also have the name of the old one.
The user can call `calendar-time' instead of dnd-date-to-date,
or it does not care. If the time returned by `calendar-time-to-date-reuse'
is the same, the user can use `date' instead of `diary
"%file: samples-13100"
======== SAMPLE 1 ========
FCF=
;;;;;;; XHTML
;; http://www.w3.org/TR/Xhtml/XHTML.html
;; http://www.w3.org/1999/02/08 "HTML3")
;;; Code:
(require 'calc-mode)
;;;###cal-autoload
(defun calc-calc-indent-keyword (keyword)
"Indent a word with point at the beginning. For every word at the start of the word, add the following:
+---------------+
+-------+
+-------+
+ "--"
+ "--"
+ "-------"
+ "--"
+ "----"
+ "----"
+ "----"
+ "----"
+ "----"
+ "--"
+ "----"
+ "-----"
+ "--"
+ "--"
+ "----"
+ "----"
+ "----"
+ "--"
+ "--"
+ "------"
+ "------"
+ "----"
+ "----"
+ "--"
+ "-----"
+ "-----"
+ "--"
+ "--"
+ "--"
+ "-------"
+ "--"
+ "--"
+ "--"
+ "--"
+ "---------"
+ "---------"
+ "--"
+ "--"
+ "-----------"
+ "----"
+ "----------------"
+ "----"
+ "------"
+ "------"
+ "---------"
+ "----------------"
+ "--"
+ "--"
+ "--"
+ "------"
+ "------"
+ "---------"
+ "-------------:"
+ "------~")
;;;###cal-autoload
(defun calc-calc-indent-subword (prefix keyword)
"Indent a subword with point at the beginning.
This will also indent to the beginning of each word in the word. For every word at the beginning of the word,
add the following:
+--------------- "--"
+--------------- "--"
+--------------- "----"
+--------------- "----"
+--------------- "----"
This function is used to set the Calc mode key bindings for a number of keywords.
For instance, the following keys will be defined:
- X-TAB-STRINGS-DELAY
- Halt - Delete key binding without waiting for a confirmation; with X-TAB
- C-X C-X RET
You will have to type in each of these modifiers by hand, and the
number of modifiers will depend on the number of keys
pressed.
These keys will bind to `halt', or `dalt', if their corresponding key
function is used as the input method.
The keys will also be set to the symbols `halt' and `c-x RET'.
This command is useful for adding various modifiers to the
current frame or to adding new modifiers as needed.
You can also set this variable to change when `emacs-lisp-mode'
is used to execute these keys."
(interactive "P")
(cond (prefix
======== SAMPLE 2 ========
FC(n) nil)
(error "Lisp-X: Error: No such file or directory")))
(defun lisp-x/xemacs-lisp-emacro-function ()
"Execute an Emacs Lisp emacro function.
This may be used to run an Emacs Lisp file, e.g., an Emacs Lisp file with
the .emacs-lisp.el file extension applied to it, e.g. that
it generates an Emacs Lisp file.")
(defun mml-defmacro-macro-function (function)
(setq mml-defmacro-macro-function
'foo (lambda () (funcall function))
mml-defmacro-macro-function
(let* ((macro (oref (concat "emacs-lisp" "") " " (match-string)))
(macro-args (oref (concat "macro" ")" macro))
(macro-comps (oref macro "--")
'foo 'bar (function (intern (concat "function\\".com" function)))))
(define-key mml-macro-function 'foo fmap)
(define-key mml-macro-macro-macro-macro-macro-macro ()
"*"))
(defun mml-defmacro-macro-macro (macro)
"Execute an Emacs Lisp macro function.
Macro MACRO is a Lisp function name whose Lisp name
contains any argument functions as defined by the variable
mml-macro-macro. The function will be called with two arguments:
the name or `name' of the MACRO's argument, which is to be
called with the optional argument FINDING-ATTRIBUTES."
(mml-defmacro-macro-macro macro)
(message "`macro' macro"))
(defun mml-defmacro-macro-macro-macro ()
"Execute an Emacs Lisp macro macro, without argument.
Macro MACRO is a Lisp function name whose Lisp name
contains any argument functions as defined by the variable
mml-macro-macro. The macro's function will have two arguments: the
name or the argument list of the macro's argument or its Lisp
name."
(interactive "*r")
(let* ((macro-file (oref (if (= (length macro-file) ?*)
(oref (car (last macro-file) ?*))))
;; Macro files with `macro-file-macro' syntax can be executed
;; through Lisp macros; we have to be careful to include
;; `lazy-macro-load-path' in this case.
;; We want to prevent macro compilation, so the function will
;; return t.
(macro-file-name-if-debug nil)
(lazy-macro-load-path (macro-file-name-file (car macro-file))
)))
(error "`macro' nil not found"))
(let* ((macro-info (oref (car (re-search-forward "^[0-9]+\\" nil
nil t)))))
(message "`macro-info' [macro-macro
======== SAMPLE 3 ========
FC (goto-char pos)
;; If the current line is too long, use space.
(save-restriction
(widen)
(while (and lines (/= pos 1))
(if (and (not (memq charset '(charset t))
(looking-at "^[a-zA-Z0-9_]+[0-9]")
(looking-at "\\.\\.\\{\\.\\}([a-zA-Z0-9_]+[0-9]\\)")
(setq chars-length chars-to-length))
(cond
;; FIXME: What is a space?
((and (memq charset '(charset t)) ; [0-9.];[^@]{^@}]*
(setq chars-length
(cons (get-char-property (point)
'charset) chars-to-length))))
(memq charset (match-string-no-properties 0)
(string))
(save-restriction
(widen)
(if (and (stringp chars-to-length first-chars)
(= chars-length chars-to-length)
(and (memq first char-start chars-end)
(string-match (concat "^[^* \t]*" first char-start) chars-to-length chars-to-length))))
(forward-char))
;; FIXME: Must specify an opening char.
((looking-at "^\\?\\|\\(\\(\\^#\\)"))
;; FIXME: Don't be afraid to remove spaces here.
(setq chars-length (string-to-char chars-length))
;; FIXME: We must use spaces after the spaces.
(goto-char pos)
(let* ((charset-length (or chars-length chars-to-length))
(char-to-
======== SAMPLE 4 ========
FC&S1&S2&S3&S4&S5&S6&S7&S8&S9&S0&S10&S11&S12&S13&S14&S0&S15&S16&S17&S18&S19&S20&S21&S2"))
(setcdr (nthcdr 2 (car v))))))
(if (and v1 (> nth v1)))
(if (not (eq (car v1) 'v1))
(v1 v1))))
;;;###autoload
(defun vhdl-mode-script-mode ()
(interactive)
(beginning-of-line)
(viper-save-buffer-state (current-buffer) (point) nil '(vhdl-show-script-mode 0))
(should (buffer-string-no-properties (current-buffer))))
;;;###autoload
(defun vhdl-mode-script-update ()
(interactive)
(beginning-of-line)
(viper-save-buffer-state (current-buffer) (point) nil '(viper-show-script-mode 0))
(should (buffer-string-no-properties (current-buffer))))
(defun vhdl-mode-script-setup (&optional save-history)
"Setup vhdl version history.
If you install it, it will be run only once. See `viper-mode-script-setup' for
specific instructions."
(interactive "P")
(vhdl-show-script-mode vhdl-mode-script-setup vhdl-show-script-mode-history))
;;;###autoload
(defun vhdl-mode-script-setup (history)
"Install vhdl version history."
(interactive
(or (looking-at "^\\([^\\]*?\\([^\\]\\|?[^\\]*?\\)[ \t\n\r]*:[ \t\n\r]+\\(\\(\\[[-?[^]*]\\)?"))
;; Insert a message that reads:
(message "Setting %s..."
(replace-regexp-in-string "^" "\\(\\*\\\\\\) "
(replace-regexp-in-string
;; "//[^//]+\\(\\([^ ]*\\) *\\)")) "\\) "
vhdl-mode-script-setup " \\(?" t (replace-regexp "^" "\\(\\([^ ]*\\)*[ *[ ]*\\)+" "
"\\) "
vhdl-mode-script-setup 'show-script-setup)))))
(provide 'viper-mode)
;;; vhdl-mode.el ends here
<|endoftext|>;;; vhdl-info-history.el --- vhdl info library backend for vhdl-mode
;; Copyright (C) 1995-2019 Free Software Foundation, Inc.
;; Author: James Clark <james.c.h@mh.ca>
;; Keywords: news, info, hypermedia
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version
"%file: samples-13000"
======== SAMPLE 1 ========
-goto-char (char-begin-before-sexp ?a)
(point-max))))))
(let ((goto-char (org-babel-get-entry beg end beg-start t))
(org-babel-skip-comint start end beg-start t))
(when (< beg-end (+ 6 n)))
(save-excursion
(org-babel-back-to-table org-babel-inlinetask)
(skip-chars-forward " \r\t\n")
(goto-char beg-end)
(mapc #'org-babel-inlinetask
(lambda (a b)
(when (memq a '(previous-command ?p))
(end-of-line)
(unless (org-lisp-boundp 'babel-comint-table)
(org-babel-forward-babel-table (comint beg end b)))))
(when (< beg-end (+ n)))
(let ((goto (org-babel-forward-babel-table (comint beg end b)
'font-lock-warning-face "Goto a, don't")))
(when (> beg-end (+ 6 n)))
(org-babel-backward-comint-to-column beg end)
(and (org-element-property :headline 'comint-table)
(org-babel-skip-comint beg end ":" 'font-lock-warning-face
org-babel-back-to-table
org-babel-inlinetask
org-babel-last-comint-table-p))))))))))
(if (assq 'babel-comint-table org-babel-cominc)
(org-babel-insert-pre-indentation
"babel"
(goto-char (org-babel-get-entry beg end t))
(org-babel-backward-to-table (copy-marker (1- beg))))))
(defmacro org-babel-forward-comint (&rest body)
"Forward BODY; return point; or return nil.
LIMIT 2. The point is now at beginning of line. Return point
and point."
(declare (indent 2) (debug t))
`(let ((goto-in-buffer-movemove nil)) ; move to end of line
(and (or (skip-chars-forward " \t\n") ; don't look back at the text before
======== SAMPLE 2 ========
-map
"\\[universal-argument] ?? \\[universal-argument-map] \
insert "\n" to toggle mode-line mode, and search for the file
directory (\"/home\")."
:group 'files
:version "24.1"
:type '(choice (const :tag "Disable" t)
(const :tag "Enable" t)
(const :tag "Disable" nil)
(list :key-type '("\\[universal-argument].*?\\)[ \t]*<.*" :value :help "Insert mode line and search"
:format "%s\n" :map :tag 'string)
:value (string :tag "File"))))
(put 'read-read-only 'help-display-multiple-options
(unless read-only
(put 'read-only #'read-only))
(set-window-buffer 0)
(set-window-buffer nil)
(insert "\n"))
(put 'window-up 'help-display-multiple-options
(unless window-up
(put 'window-up #'window-up))
(set-window-buffer 0))
(put 'window-up-or-delete 'help-display-multiple-options "No windows are up.")
(put 'window-dont-kill-windows 'help-display-multiple-options t)
(put 'window-dont-kill-window 'help-display-multiple-options "No windows are dntkilled.")
(put 'window-dont-kill-windows 'help-display-multiple-options "No windows are die and dntkilled.")
(set-window-display-mode-2
(window-buffer 0) (window-previous-window 0))
(put 'window-set-all-parameters 'help-display-multiple-options
(if window-set-all-parameters "Set/delete all parameters" "Disables on/off"))))
(put 'window-set-parameters 'help-display-multiple-options "Set/delete parameters")))
(put 'window-set-parameters 'help-display-multiple-options "The number of windows we display.")
;;;###autoload
(defcustom window-mode-hook 'window-mode-mode
"List of functions to call whenever the Emacs window is killed."
:group 'windows
:type '(hook (function-group (nreverse function-group))
(function (list (function :tag "Function") function)))
(put 'window-set-parameters 'help-display-multiple-options
(let ((window-buffer (get-buffer-window window-buffer)))
(when window-buffer
(window-on-quit-flag nil)))
(let ((inhibit-point-motion-hooks t)
(window-display-mode-button 'window-set-parameters
(when window-buffer "Dead window with current buffer"
(condition-case nil
(window-live-p window-buffer "Dead"))))
(window-display-window (window-buffer window))
(button-set-face window 'help-display-multiple-options #'window-dont-kill-windows)
(if window-dont-kill-windows "Kill window")))
(put 'window-set-parameters 'help-float
(let ((window-buffer (get-buffer-window window-buffer)))
(when window-buffer
======== SAMPLE 3 ========
-goto-region-beginning)
(defun rng-x-x-goto-region-beginning ()
"Return point in current region.
Return non-nil if point was moved to the beginning of a
`regexp-negotiator' (or more commonly, `regexp-quote'),
`line-width') and non-nil if point is just outside a
marker string."
(or (and
(eq (char-before) ?\(
;; If the region starts with a leading space, the regex
;; should match the leading space and this is the only
;; region in which we found a valid word, we may skip this
;; region with some other word.
(setq rng-string (concat (char-to-string
(if (re-search-forward rng-goto-region-beginning
(char-after) ""))) ; the string is not a string.
; there is nothing to skip. This is for
;; the case where the whitespace was preceded
;; by spaces/tbl, or we have a double ":". See
;; RNN and RRRGGG for more details.
(or (assq (char-before) (char-after))))
(cond ((and (looking-at regexp)
(prog1 (forward-sexp)
(setq end (match-beginning (match-end 0))))
((eq (char-before (match-beginning 0)) ?>)
(cond ((not (looking-at regexp)) ; end can be space-like?
(setq end (point)))
((and (re-search-forward regexp end t)
(looking-at "\\s ")))) ; line must be a string that starts
(t `(let ((match-start (match-end 0)))) ; end has spaces.
(rng-goto-region-beginning
(or
(let ((start (match-beginning 1)))
======== SAMPLE 4 ========
-char,
;; use `delete-region' for deletions if needed.
(prin1 (car eldoc-region))
(princ "\n#\n[*\n] *[\n,\r]*\n")
(princ "\n")))
;;; The first thing that needs to be done is setting up the buffer
;;; for the various commands. We need to do this while the buffer is
;;, as you may have guessed, already open.
;; (defun eldoc-read-command (start end)
;; ;; Read the command at start of the current buffer.
;; (if (and (>= start (/ (point)) end))
;; (progn
;; (let (command)
;; ;; If we are read the command, we are about
;; ;; to read the first line of the buffer. It is important that
;; ;; the first part of the command we read
;; ;; be followed by the rest of the line.
;; ;; This can happen a lot and it can lead to
;; ;; some unexpected output.
;; (let ((file-name (file-name-nondirectory
;; (expand-file-name file-name))))
;; (read-file-name name)
;; (if not (null command) prompt))
;; (if (>= end (/ (point) start))
;; ;; If we are read, we may be asked to type
;; (if (or (eolp) (looking-at "[ \t]*\n[ \t]*[ \t]*$")))
;; (setq start (1- start))))
;; ;; This should cause an error if read is open.
;; (if (and (derived-mode-p 'eldoc-mode)
;; (goto-char start)
;; (eldoc-back-to-command beg end))
;; (eldoc-send 'emacs-eldoc 'open 'not-open))
;; (if (eq start end)
;; (setq start (point)))
;; (when (search-forward-regexp
;; (regexp-quote (format-message
;; "Type `eldoc-type' into a text buffer."))
;; (buffer-sub
"%file: samples-12900"
======== SAMPLE 1 ========
(unless (integerp pdata)
(and (integerp cdata)
(integerp pdata)
(zerop cdata)))
((listp idx)
;; FIXME: Should we set a special idx
;; on the result to an ID-SYM list or do this
;; with no extra data?
idx)))))
(apply #'customize-customize-custom-p
#'customize-customize ((and idx (integerp idx) (integerp cdata)
(integerp pdata)))))
;;: A list of symbols. All of them are valid names, as long
;; but the names are not bound to elements of strings. When they are
;; bound, only return names, and not structures, except in
;; case `listp-idx' is non-nil, which is true when a name
;; symbol must be `x' and names are `x'.
(defun listp-default-idx (args)
(listp-idx 'listp (listp-type x)))
;; - If a list item was defined for a `list' or `listp',
;; `listp-listp-listp' creates the first element of that list pair and
;; `listp-listp-listp' moves to that element.
;; The function `listp-listp-listp' can have two arguments: one is a symbol
;; name and another is a list element. The first element has to be a symbol that would
;; be used instead of a list element, and the second element is a
;; list element.
(defun listp-default-get-list (s1 &optional x)
(listp-listp-list-listp-list (or x
(listp-types 'listp 'listp))
(listp-types 'listp-list-listp))))
;; - For a list in a buffer, `listp-alist' is used to construct
;; the list, when not an element of list.
(defun listp-listp-listp-list '(listp x)
(listp-listp-listp-list x nil nil t)
(listp-alist (listp-listp t (listp-names 'listp-listp x)))
(listp-listp-listp-list-list (listp-lists 'listp-listp x))
(listp-listp-listp-list-list (listp-lists 'listp-list p)))
;;: A list in a file.
(defun listp-listitem-open (x)
(save-excursion
(if (and x (or (save-excursion (listp-list itemp-
======== SAMPLE 2 ========
'nolist (c-list-tables itemlist)
(t 'nesting "")
:set keyword (nolist (c-list-tables itemlist)
(cons 'tag tags t)
(cons 'parent
'(nil nil)))))
'nolist (delq nil '(nil nil c-list-traits)))
(make-coding-system (or coding-system 'utf-8))
(unless coding-system 'utf-8 nil 'coding-system))
;; Allow `nreverse'.
(unless 'last-flag
(error "Do not allow C=N %S" t)))
(if last-flag (setq last-flag 'nreverse)))
(if coding-system 'utf-8 nil 'coding-system)))
(if last-flag 'nreverse)))))))
;; FIXME: This would look strange if the code we're working on didn't work!
((and coding-system 'utf-8) ;; C=P. Theoretically, coding-system should have a different
;; design. I've tried to find a good one, but none of the
;; implementations I've seen has been implemented very well.
;; I'd definitely like to see these be fixed.
;; This one just makes the code work on an 8-bit computer
;; that has C=P. The coding system seems to have had a different
;; design. I could go further and say there might be a
;; bug where there's a code that's very complex; perhaps the c/o/c
;; was coded differently.
(setq nolist nil)
(setq coding-system 'C+N
coding-system 'coding-system
coding-system 'coding-system)))
((and coding-system 'cnt-v ;; C-\\=C-? "C=P" would be better (nolist (c)
coding-system 'cnt-case 'cnt-case
======== SAMPLE 3 ========
(setq p (point)))
(let* ((x (list :before
:after ;; `p', `j', `v', `c', 'c-c'), `o'
(?\{
(?\\ (* 3 4) (* 8)))
(?^ (* 9) (* 10)))
(?\? ^ (* 11)))
(if (and (>= p x) (>= j x))
(let ((f (setq x (1+ x)))))
;; Now start to check each line in the same column.
(setcdr (nthcdr 3 f)
(if (cdr l1)
;; If the column is unchanged, then we
;; have found all the columns that
;; should be new. If so, then we look
;; for the columns that have already
;; been found.
(nth 4 f))
(cons (cdr l1) (nth 9 f)))))
;; Find new columns.
(goto-char (nth 2 f))
(if p
(if (>= (or (cdr l1) (nth 1 f)) (nth 2 f)))
p
(if (cdr l1)
(goto-char (* 2 (length f)))
(if (= (count-lines (nth 1 (downcase (car l1)) (nth 1 (car l1))))
p))
f)))))))
;; Find the starting positions of the columns before.
(setq x (1+ x))))
(if (setq f (cdr-safe g) (cdr l))
;; Now insert a new line, otherwise just insert a new line.
(if (or (nth 2 f) (nth 3 f))
(cons (cdr l1) (nth 9 f))
(setq f t t nil))
======== SAMPLE 4 ========
(unless (consp x) (funcall
x))
(error "%s is not a function" error)))
(cdr x)))
(push (cons 'function (copy-sequence x))))
(or (integerp x)
(error "")))
(prin1 x '(nil nil nil nil) :help "Compile X"))
(lambda (x y)
(setq x (cdr x))
(setq y (cdr x)))
(prin1 x '(nil nil nil nil 'lambda y)))
(and (integerp x)
(equal (file-name-sans-extension x 'file-attributes) (length x)))
(or (integerp y)
(error "")))
(pcase x:
((file-name-extension x 'file-attributes)
v)
((file-name-extension y 'file-attributes)
v)
((file-name-extension ov 'file-attributes)
v)
(t v)
(t v))))
(defun file-attributes-extend (file-name)
"Extend attributes using file-name."
(interactive (plist-get file-name :test #'equal))
(let ((attributes :test #'equal)))
(or (plist-get file-name :test)
(or (file-name-sans-extension file-name)
(or (file-name-extension ov file-name)
(file-name-extension ov ov))))))
(defvar file-name "")
(defvar file-name-extra-attributes
'("".format
(file-name-extension file-name)))
(defun file-name-extend (x)
(condition-case nil
(dolist (name attributes)
(let* ((v (file-name-extension name)))
(if (assoc v (cons (file-name-extension x) attributes)))
(if (or (not (nth 1 x))
(not v)))
(setcdr v (cdr name)))
(cdr x)
(nth 3 x)))))
(file-error x (message "File is not an X-Romex")))
(or (plist-get x 'file-attributes)
(if (not (file-name-sans-extension file-name))
(error "%s is not an absolute file-name" x))))
(or (plist-get x 'file-attributes)
(error "%s is not an absolute file-name" x)))
(or (plist-get x 'file-attribute-extensions t)
(error "%s = x %s" x))))
(defun file-file-attributes-extend (file-name-extra-attributes)
(interactive)
(if (file-name-extension file-name)
"%file: samples-12800"
======== SAMPLE 1 ========
:
"Name of the document's body."
(semantic-set-variable semantic-name-format (aref semantic-header-names
'body)))
;;;_ (semantic-set-variable semantic-name-format (aref semantic-header-names
'body)
(semantic-type-name-string)))
;;;_ `semantic-body-format' ;; `semantic-type-name-format'.
;; In a context where it could be a type
;; or a name with a name
(semantic-set-variable semantic-text-format (semantic-type-name-string)))
;; We have to convert the `semantic-body-format' value
;; into a type.
;;
;; The value used by this function is the form
;; (VAR . FUNC). . . . . PARAMETER . COOKIE)
;; that returns (VAR . FUNCTION), and if FUNCTION is nil
;; the value of the variable in the body
;; (VAR . FUNC). . . . . . PARAMETER). . COOKIE,
;; if any.
;;;_ ; (semantic-get-text-property)
;; ; (semantic-set-variable semantic-body-format (semantic-text-property
;; 'body)
(semantic-set-variable semantic-text-format (semantic-text-property)))
(defun semantic-body-format (start end val)
"Return the body format of the current buffer.
If VAR is negative, `semantic-body-format' will be applied as a value
of `semantic-body-format-format'. The type will be a string.
If VAR is a `string', an optional (ARCHIVE . ARCHIVE-REASON) value
for this variable is returned."
(semantic-set-variable semantic-body-format)
(let ((result nil))
(or (null result)
(error "The style string %s is not currently accepted (%s)"
(numberp start val))
(semantic-body-format-string (numberp start)))))
(defvar-local semantic-var-key-name
(semantic-format-find-name (key-type))
"String to be inserted at the body of the document.
The value is taken from `semantic-body-format-find-name', which takes the
key value of such a keyword."
(if (looking-at "[^>]+\":))
(semantic-format-make-value (semantic-text-property))
;; Remove trailing whitespace.
(if (looking-at "[-+?-=]") (format-warning "\n")
(if (looking-at "[<>#]>") "[<>#]>")
(format-warning "Unknown value to set in the body of a document: %s"
======== SAMPLE 2 ========
: [
(concat (buffer-name (cddr e)
e))
nil
"")))
; this is for e in al
; (e in al
(car e))
; al is al
; al = al
; el in el
;
; el = el
; el = el
; el.
; el.
======== SAMPLE 3 ========
: 2)
(table-insert-column 1 1) 2)
(table-insert-column 2 2)
(table-insert-column 1 2)))))
(setpt-left 0)
(set-char-property 0 0 (1+ (point))))
;; Don't insert a list of char-properties at the end of
;; the current line or in a region where they're not
;; set up.
(t (insert "\n")
(set-char-table nil nil nil
\n)))
;; Insert the region if necessary.
(t
(setq-local indent-string nil))
((looking-at "\n")
(delete-region (point) (1+ (point)))))
(skip-chars-forward " \t")
;; Use all whitespace.
(cond
((null tab-width)
(insert-region-and-branch (1+ tab-width))
(insert-char))
((null indent-string)
(insert-char))
(t
(delete-region indent-string (point))))))))
;; Insert a list of char charset, but no indent.
(let ((table-indent (table-to-string indent-string))
(t
(setq t nil))
(while tables (setq indent-string (make-string tab-width indent-string)))
(let ((list '(t bold
t \n \u \t .2 ; 0 indent
t c \r\v t indent-string)))))
(table-remove-characters nil)
t)))))
;;;###autoload
(defun tab (list)
"Tab a sequence of characters from TABLE.
FORMAT-TYPE is the format string `tab-width',
default is \"tab\". FUNCTION is the result function, which is called
and used to update the column boundaries. COUNT is a
number of columns. A positive count
======== SAMPLE 4 ========
: * (if (memq (car kv) '( ?x ?x ?x ))
;; this could be something
(concat (char-after)
1 (if (stringp kv) '(?x ?x))))))))))))))
(defun wisent-forward (&optional arg)
;; Back up if there is no space on the screen after this command.
(when (> arg 1)
(progn
(if (not (eq (char-after (point-min)) ?\n))
(forward-char))
(if (and (eq arg ?\n)
(> 0 arg)
(looking-at "\n")
(throw 'end-of-line))
(if (not (= arg ?+))))
(if (< arg 0)
nil
(list (if (> arg ?\n)
(subst-char-in-region (point-at-bol) (point-at-eol)))
nil
(setq arg (1+ arg)))
(while (> arg 0)
(unless (> arg ?\#)
;; We have a text boundary in this line.
(goto-char (point-at-bol) (point-at-eol))))
(when (not (eq arg ?\%)
(looking-at "\\$")
(if (eq arg ?\()
(throw 'end-of-line))
nil)))
(setq
(or arg (setq arg (list "\\\\")))
(save-excursion
(wisent-forward))
(goto-char (point-min))
(when (< arg ?\#)
(goto-char (point-at-bol))
;; Move point there is no space
(goto-char (point-max))
(throw 'end-of-line))
(if (> arg ?\#) ; This line isn't in line
;; Line should be in indentation style.
"%file: samples-12700"
======== SAMPLE 1 ========
gnus-newsgroup-prefixed-header-color)
((eq major-mode 'gnus-newsgroup-mode)
(setq gnus-group-highlight-enabled t))
(;; On gnus-newsgroups-mode-hook, the next two lines
will cause the user to be prompted for a regexp to use.
(setq gnus-newsgroup-mode-message nil)
(setq gnus-newsgroup-current-re t)))
((string= nntp-current-command-line "<")
(setq nntp-current-command-line "")
(setq nntp-current-newsgroup nil))
((setq nntp-current-command-line "")
(setq gnus-newsgroup-set-last-command nntp-current-newsgroup-command-line))))
((setq nntp-current-newsgroup nil))
(t (gnus-message 6 "Message %s in %s area is: " nntp-message t)))
(t (gnus-message 6 "Message %s in %s area is: " nntp-message t)))
"The current message format."
(set-buffer nntp-buffer)
nil))
(defun gnus-group-highlight-mode ()
"Highlight the message in the current group."
(interactive)
(save-excursion
(let* ((gnus-newsgroup-header-color (gnus-group-highlight-message-header-color)))
(mapcar
(lambda (header)
(set-text-properties (symbol-name header)
(symbol-name (car (cadr mt)))
(cl-mapcar 'gnus-newsgroup-highlight-marker
(symbol-name (cadr mt)))
headers))
gnus-newsgroup-highlight-message-header-color) (gnus-newsgroup-highlight-message headers)
gnus-newsgroup-highlight-message-header-color headers))
(gnus-group-highlight-mode 1)
((or (eq major-mode 'gnus-newsgroup-mode-mode)
(and
(and (eq major-mode 'gnus-newsgroup-mode-mode)
,gnus-newsgroup-highlight-message-headers))
(gnus-group-highlight-mode 1)
(or
(or
(if (car (cadr mt))
(car (cadr mt))
(cl-cadadr mt)))
======== SAMPLE 2 ========
(when (not (eolp))
(insert ?\
"
" [<] ")
"\
\
\
\
\
\
"
" ?\
" [<] " ; to be inserted
[\n] " ; to be inserted
" " ; to be inserted
"\
\(\\|[*]\\{1:[<<>]*|\\|[<>]*|\\|[<>]*)\\)
\\{\\<{1:[<>>]*\\>\\)?"
"\
\ [\N] " " ; to be inserted
"[0-9A-ZA-Z_]\n")
(gpr-with-local-map '(eol 'word) (eol 'start) begp beg))
(pow p2))
(while (pow p0)
(let (p)
(while (and (zerop (marker-position begp))
(setq p (point)))
(goto-char (car p))
(forward-line)
(setq begp (point-marker))
(while (not (eolp))
(insert ?\
"
[<][<>]: ")
"\n")
(skip-chars-forward "\n")
(while (not (eolp))
(insert ?
"
" " " ; to be inserted
" " ; to be inserted
"\n\
\
[<<>]*\n " [[:_] "] " .=
"
" " ?\
\
[<>]\n "
======== SAMPLE 3 ========
'font-lock-variable-name))
(defmacro cl-parse-ignore-case-properties (spec beg end)
"Return non-nil when `set-font-lock-case-properties' does not include a case-sensitive
element. It returns t if `font-lock-case-properties' should also include this
element. Only nil when `font-lock-case-properties' includes `font-lock-case-property'.
\\{cl-parse-info}
\\{cl-bar-info}\n
" (length spec)
"Hexadecimal case property list to highlight."
(cl-find-property beg end 'ignore-case-value)
;; Use t-valued for non-matching
:group 'cl-cl-info
`(if ,cl-cased-case . ,(if ,cl-case . ,(lambda ,(match ,spec) ,spec))))
`(if ,if' . ,(lambda ,(match ,spec))))
(defstruct brace-start-re
(brace-start brace-end brace-start)
beg end)
;; Use rsh-ignore-case instead of `ignore' or `ignore-case'
`(let ((case-conversion-table-list t)
,@(save-excursion (dolist (def nil #'(:set . ,(cons nil :set)))
`(ignore . ,@(append ,def)))))
(brace-start-re (save-excursion (dolist (def nil #'(:restore . ,(propertize ,@(cons ,def) . ,@(cons ,def))))))))
,@(dolist (case-if-not (case ,cl-case ,@(cadr ,@(cadr-if-not-case))))))
.@(append ,cl-case . ,@(cadr-if-not )))
(defmacro cl-do-case-overlay (spec &rest body)
"Provide a context to `cl-case-overlay'.
This defines the cl--case-overlay body."
`(defcustom cl--case-overlay t
,@body)
,@(defvar cl--case-overlay #'cl-case-overlay
'(set ,prolog . ,(cadr ,cl--case-overlay)))))
(defmacro cl-do-case-keyword (macro symbol &rest body)
"Provide a context to `cl-case-keyword'.
This defines the cl--case-keyword body."
`(pragma cl--case-keyword scala-case-define-function cl--case-keyword)
,@(cl--case-keyword (lambda ,macro))))
(defmacro cl-do-case-macro (macro symbol &rest body)
"Provide a context to `cl-case-macro'."
`(let ((case-or-fold nil)
(prolog (lambda ,macro)
,@body)
(cl-do-case ,macro ,@body))
`(progn ,cl-case . ,@(lambda , (assoc ,prolog ,cl--case-macro))
(if ,prolog ,cl-case . ,(regexp-quote ,cl--case-case))
(cadr ,cl--case-def)))
;;
:set
;; `cl-do-prepend-prefix-list' `(cl-do-prepend
======== SAMPLE 4 ========
:type '(choice (const nil)
(sexp :tag "String of strings")
:value nil)
:group 'string-lessp)
\[defconst string-equal-formats
:type '(choice (const :tag "^[ \t]*"
:value nil)
:group 'string-lessp))
\[defunion string-width
:type '(choice (const nil)
(string :tag "String length for %s")
:group 'string-lessp)
\[defcustom string-width-string
:version "22.5")
"The width of a string width string."
:initialize `string-width-list'
:set 'equal-p-all
:risky t
:use 'equal-p-any
:initialize-hooks
:version "22.1")
\[defconst string-width-map
:type '(repeat (cons :tag "Other widths" :value (:tag "String"))))
\[defconst string-x-width-map
:type '(repeat (cons :tag "x-width" :value (:tag "Default X-width"))))
\[defconst string-x-height-map
:type '(repeat (cons :tag "X-height" :value (:tag "Default X-height"))))
\[defconst string-width-map
:type '(repeat (cons :tag "X-width" :value (:tag "Width"))))
\[defconst string-width-map
:type '(repeat (cons :tag "X-width" :value (:tag "Gestalt"))))
\[defcustom string-width-map
:version "22.1")
\[defvar string-width-map
:version "22.1")
\[eval `string-width-matching-string' nil t]
\[defconst string-width-matching-string
:type '(repeat (cons :tag "Match text" :tag "None"))))
\[defconst string-width-matching-regexp
:version "22.1")
\[defconst string-width-matching-regexp :version "22.1")
\[defconst string-width-matching-regexp (intern)
(cons ?@ regexp))
\[defconst string-width-matching-regexp
:type '(repeat (cons :tag "Regexp" :tag "stringwidth")))
\[defconst string-width-matching-regexp
:type '(repeat (cons :tag "Match text" :tag "None")))
* string-width-matching-regexp:
(defcustom string-width-matching-regexp
(concat "\\(\\(" ?\n)\\)?"
"[#t\"]\\(\\[?\t\\]+\\)?\\([a-zA-Z]+\\)[#t\n']+\\)"
nil nil
"[#t\n']+\\([a-zA-Z]+\\)[#t\n']+")
"Regular expression matching the width and height of elements in string-width-map.
Note that this regexp is used to match the text in the first element in string-width-map.
The length of the initial matched text and the number of elements in the map will
be normalized to the value of (float) string-width-matching-regexp."
:type '(repeat :tag "Regular expression matching length to string-width-map"
"%file: samples-12600"
======== SAMPLE 1 ========
set back the \"+b\" part. With a prefix of "" (or the empty string), only return that part of the symbol.
Called from a `comint-parse-string', if `comint-parse-paren' returns no such item, nil
then return the empty string.
Return the first matching item in the form (or list if empty) of the
argument LIST."
(let ((beg (line-beginning-position 0)))
(if (= beg (point))
(if (eq arg 'match-data)
(progn
(when (> beg (point))
(concat (ash "[[-a-zA-Z ]]+" beg a t)
" " word)
(substring (ash "-" beg start)))))
(org-beg-pos beg 2)
(mapc (lambda (symbol) (list (1- (car symbol)) (list (cdr symbol))))
(cons (and comint-displayable
(comint-parse-symbol :help "Display a token")
(org-babel-displayable-symbol :help "Display a symbol"))
symbol))))
(comint-display-sorted-item-list)))
(defun org-babel-decode-string (&optional delimit)
"Decode a string from Org to Orm."
(org-latex-to-string org-babel-string-escn)
(unless org-babel-decode-regexp-function-name-map
(let* ((comint-string-escn-regexp
(org-latex-to-regexp
;; There are some cases where `org-babel-string-escn-regexp' might
;; fail to identify the regexp in the file. For that
;; reason we don't try to use `org-babel-regexp'.
(org-babel-char-to-regexp
(org-babel-string-to-string org-babel-string-escn))
(org-babel-char-to-regexp (org-babel-char-to-regexp org-babel-string-escn))))
(comint-string (org-get-string-at-eol org-babel-char-to-regexp) delimit))
(org-babel-char-to-regexp org-babel-string-escn))))
(defun org-latex-to-string (string)
"Return the string to decode."
(let ((encoding (org-latex-to-name string))
(lame-string-size 0 0))
(while (string-match-p "@" string)
(setq string (match-string 1 string)))))
(defun org-latex-parse-string-to-prefixed (string)
"Parse the string (if any) that should be used for decoding."
(substitute-in-coding-system
'latex-special-case "@"
string org-babel-string-to-prefixed))
(defun org-latex-
======== SAMPLE 2 ========
set-buffer-modified-p)
(insert ?\n))))
;; Save buffer that should be deleted.
(or (set-buffer-modified-p (get-buffer buffer-modified-p))))
;; Remove the old buffer.
(delete-file file))
(set-buffer-modified-p nil))
;;;###autoload
(defun tmenu-toggle-undo ()
"Toggle undo mode.
Toggle undo on/off via TTY, `mouse-2', C-m or `C-c'
Toggle undo on/off via the TTY keystroke on/off."
(interactive)
(if (get-buffer-process buffer-file-name)
;; We want TTY-style undo to not be called by default.
(tty-mode 0))
(or (tty-mode 0)
(and (tty-mode 1)
(t (t (t (t (current-window))))))))
;;;###autoload
(defun tmenu-toggle-tutorial-undo ()
"Toggle TOUCHDOWN toggle on/off."
(interactive)
;; When a menu item is already t, use it instead.
(let ((t (car nil))) (car t))
(tmenu-toggle-undo t)
(tmenu-toggle-tutorial t)))
;;;###autoload
(defun tmenu-hide-overlay (overlay)
"Toggle undo hidden overlay of overlay.
If OVERLAY is at bottom level and is not an overlay of this list
overlay, toggle its overlay on/off. If at top level and is not an overlay
of this list, undo its overlay (both with and without) on/off."
(setq overlay (cond ((car overlay) (tmenu-toggle-overlay t)))
((eq (car overlay) tmenu-toggle-overlay)
(t (t (t (overlay-to (marker-position overlay) (marker-position t))))))
(setq overlay (cdr overlay)))
(overlay-put overlay 'menu-interface t))
(defun menu-toggle-overlay-tutorial (overlay)
"Toggle undo hidden overlay of overlay.
If OVERLAY is at bottom level and is not an overlay of this list
overlay, toggle's overlay on/off."
(setq overlay (cond ((car overlay) (tmenu-toggle-overlay t)))
(t (t (t (overlay-to (marker-position overlay) (marker-position t))))))
(if (eq (car overlay) tmenu-toggle-overlay-tutorial)
(overlay-put overlay 'menu-interface t))
(overlay-put overlay 'menu-interface t))
;;;###autoload
(defun menu-enable (&optional force-mode)
"Toggle menu with force enabled."
(interactive
(if force-mode
(message "Menu: Force switching...")
(setq menu-enable
(cons (let ((menu-enable-menu-map
(cons (menu-menu-list (get-buffer-create menu-menu-menu-map))))
list)
menu-enable-menu t)))
(if force-mode
(let ((map (cons (get-buffer-create menu-menu-map)
'menu))
(cons (>= (list nil) (mapcar (nth 1 list) menu-menu))))
======== SAMPLE 3 ========
set)
(when (buffer-live-p nntp-server-buffer)
(message-list "You are in Internet-Draft %s"
(buffer-string)
(buffer-string-no-properties
(buffer-substring-no-properties (point)
;; at end of line
" ")))))))
(setq nntp-server-buffer nntp-server-buffer-name)))
;; Check whether this is a draft.
(if (string-match "RFC1345 draft" draft)
(if (memq nstype '(text-property-any))
(match-string 1 draft)
(if (equal "" draft)
(error "Couldn't find draft `%s'" draft)))))
(if (and nntp-draft-list
(or (zerop nntp-draft-list)
(not (zerop nntp-draft-list)))
(nreverse nntp-draft-list))))
(defmacro nntp-keep-draftup (n1 n2 n3)
"Retrieve draft data from all pending NNTP servers.
If there are no pending NNTP servers, `nntp-keep-draft' is
called."
(setq n1 (nconc n2 n1 n2)))
(defvar nntp-draft-list--list ()
"List of items to keep in Draftup buffer.")
(defcustom nntp-keep-draft-buffer-name
(concat "\\([ \t\n]*" draftup-buffer-name)
"Name for a draft buffer to be kept in the draftup buffer.
There is no such name yet; the value defaults to "draftup-buffer".
It is not a list; there are a number of functions to be executed
depending upon this function.)
Note that the default value of the default variable `nntp-draft-list--list'
is:
(setq (cons (if (not nntp-draft-list)
"Draft up")
nntp-draft-list--list)
(concat nntp-draft-list--list)
(
======== SAMPLE 4 ========
set-buffer-process)
(with-temp-buffer
(insert-buffer-substring (point-min) (point-max) "\nPaste")
(goto-char (point-min)))))
(defun edebug-mark-forward (start end)
"Execute point-to-mark at START and END."
(interactive "P")
(let ((n (buffer-substring-no-properties start end))
(n-1 (point))))
(point)))
(defun edebug-set-buffer-format (buffer-name buffer-format)
(if (null buffer-name)
(format "%s %s" (car (car buffer-name)))
(list buffer-format buffer-name))
(if (eq current-prefix-arg 0)
(setq buffer-name buffer-format))
(if (eq current-prefix-arg 1)
;; FIXME: When the second arg is a string, we don't want to use
;; `delete-region' for a delete buffer.
(setq erc-read-region erc-buffer-stop)
buffer-name))
(defun edebug-mark-backward (start end)
"Execute point-to-mark at START and END."
(interactive "P")
(let ((n (buffer-substring-no-properties start end))))
(if (let ((pos (point)) (point)
(pos2 (point-min-pos))
(pos1 (point-min-pos))
(pos2 (point-min-pos))
(pos-1 (point-min-pos)))))
;; The user needs to clear the mark to do it. That is why
;; it's nice to have the prefix arg clear it before we leave the buffer-
;; buffer. (Bug#23100)
(progn
;; Update the user's options and start with the prefix argument. Then
;; revert point. The user is advised to make it clear
;; that this may be the only way to save any current
;; behavior and to make sure it's handled correctly.
(when user-options-changed (setq edebug-mark-backward
edebug-mark-forward (point))))
(with-temp-buffer
t
(let ((end (marker-position end))
(point (point-min)))
(if (eq (preceding-char-property -1) ?\s)
(progn
(indent-region (point) (point-max))
(end-of-line -1))
(setq point
begin (point)))))
(let ((pos (point)) (pos2 (point-min-pos))
;; Find point. This is an attempt to get the previous start
;; if point is within the buffer-paged area.
(pos2 (point-max-pos2))
;; Insert the new start here.
(start (point))
;; Find the position in where point was.
(setq pos (point)))))
(let ((p (point)))
(if point
"%file: samples-12500"
======== SAMPLE 1 ========
brow-recompile
(if edev-save-state
(if (< (epg-context-start epg-get-state) 0)
(epg-context-state-get epg-get-state)
(epg-context-state-get epg)))
(progn
(message "Called `save-state' to save state. Save state if it is saved.")
(kill-buffer edev-state-kill-buffer)
(if (epg-context-set-value epg-save-state)
(progn (epg-context-set-value epg-save-state)
(kill-buffer edev-state-kill-buffer))
(epg-context-set-value epg-save-state))))
(kill-buffer edev-state-kill-buffer)
(narrow-to-region epg-select-save-state-nicks))))
(save-excursion
(skip-chars-backward " \r\t")
(skip-chars-forward "^[ \t]*$"))
(if (< (epg-context-start epg-get-state) 0)
(progn
(message "Called `save-state'"))))))
;;;(defun ep-select-save-window (&optional _window nn)
;;; ;; The same trick as above, but to avoid overwriting the list
;;; ;; of the list (which can have multiple windows) using the same
;;; ;; variable.
;;;(put 'select-window 'error (list 'window-error))
(defun ep-select-window-after-kill (&optional _window nn)
(cond
((eq arg 'save-region-p)
(setq nn (1- nn))
(set-window-point nn t)))
(defun ep-select-window-after-save (rest _window _nargs)
(epg-create-frame (get-buffer-create epg-context-frame))
(save-buffer-state (if nn (get-buffer-state (ebnf-get-window-property) nn)))))
(provide 'ebnf)
(defun ep-select-window-after-kill (&optional _buffer _nargs)
`(select-window ,(ebnf-get-window-property
(ebnf--buffer-read-only))))
;; Check that `window-mark' is the correct window:
;; (unless nn (ebnf--window-new-window n))
(cond
(window-new-window
(window-new-minior 0)
(save-window-excursion (set-window-buffer
(ebnf--buffer-read-only))))))
(provide 'ebn-select)
;; Local Variables
;; Generated dynamically.
;;; ep-select.el ends here
<|endoftext|>;;; ep-select.el --- fast edit menu with fast select -*- lexical-
======== SAMPLE 2 ========
brow-definit-text (nth 1 entry))
;; TODO if a single-character text must be included in each
;; line
(or (eobp)
(let ((string (org-element-property :type symbol))
(n (match-beginning 1))
(text (match-string 1 text)))
(org-element-set-body (nth 1 entry))
(org-element-set-object (nth 2 entry))
(when (eq (org-element-type symbol) 'string)
;; Just use text directly after the symbol
(org-element-set-body-property n (nth 3 entry))
(org-element-get-body-property n (1+ n))
(org-at-babel-function nil 'body))
(org-element-get-body-property n))))
(defun org-element-set-object (element element object)
"Set the body of a FORM in ITERATION as a VALUE.
This should be bound as a property list if required."
(let* ((object (org-element-create-property element))
(list nil)
(elt (org-element-property element :elt)))
(org-element-put-body (org-element-property object))
(let ((data (org-element-read-data object))))
(or (org-element-property element)
;; Check whether entry is a value object
(and (string= (org-element-get-body object) object)
(equal data (org-element-get-body-property element))))))
(org-element-property :value :key (:type :after key))))
(cl-defmethod org-element-set-object (element &optional element)
"Create an object object in ELEMENT.
For each element, set the object object body as a property list.
The property list is an associative list of properties.
For this purpose, the first object in the item list is
touched as the body of the property list. The element will have a
property list of properties. For example, the following property
: `org-element-list-item-properties' creates a list of this
property:
`org-element-list-item-properties'
that is inherited by the `org-element'.
`org-element-list-item-properties' is also a list.
For an additional property to be used as the body of the object,
the property list should be an object object, or the
key-binding `org-element' object."
(org-make-item :property :key :after (cl-destructuring-bind (lambda (item) element) :key "key" :after (cl-destructuring-bind item))))))
(provide 'xml/org-element-property)
;; Local variables:
;; generated-autoload-file: "xml/org-element-property.el"
;; End:
;;; xml/org-element-property.el ends here
<|endoftext|>;;; xml/org-extension-generic.el --- XML extension generic generic
;; Copyright (C) 1985-1987, 1994, 2000-2019 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Bill Gillespie <greg@saint.uft.nl>
;; Keywords: extensions, languages
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version
======== SAMPLE 3 ========
brow-revert-in-mode-line" t))
(goto-char (match-beginning 0))
(forward-sexp 1))
(goto-char (match-beginning 0)))
(save-excursion
(beginning-of-line)
(if (match-beginning 1) (forward-sexp 1))
(forward-char 1))))))
(when buffer-file-name
(let ((buf (expand-file-name buf)))
(when (and (file-directory-p buf)
(or (zerop (current-buffer))
(directory-file-name-directory-p buf)))
(setq buf (file-name-as-directory
(directory-file-name-other-directory-p 0))))
(with-current-buffer buf
(let ((buf-file-name-exp-1 t)))
(when buf-file-name-exp-1
(widen)
(setq buf-file-name-exp-1 (+ 1 buf-file-name-exp-1))))
(unless (file-exists-p buf-file-name-exp-1)
(setf (file-extract-name buf-file-name-exp-1) nil)))
(when (null buf-file-name-exp-1)
;; Create a new buffer and create the file.
(when file-name-directory
(save-excursion
(forward-line 1)
(let ((buf (file-exists-p file-name)))
;; Make sure we don't delete the file name!
(dolist (buf-file-name-exp-1 buffer-file-name-name
buf-file-name-exp-1
;; Don't delete the file name!
buffer-file-name-filename
(file-name-directory buf-file-name-exp-1))
(insert (expand-file-name " " buffer-file-name-name-exp-1)))
(goto-char (point-min))
(let ((buf-file-name-exp-1 (file-name-directory
======== SAMPLE 4 ========
brow
(error "No match found in $n")))
(defun gnus-publish-server-string (string server)
"Return the PostScript-style URL as a string STRING (string=string 1?1).
Returns a number of tokens. If STRING has a name (like \"\\S--\"),
the output is a list containing all the regexps and the server string.
If STRING includes \"\\(?:\\)\" or no server, only strings will be generated.
If STRING includes \"\\{nofurn}\\(\\[~?*]?\\w\\)?\\r\", results will be
used instead.
This function assumes that `gnus-publish-server-function' accepts
a non-nil \"/\\(?::\\)\", \"\" and \"\\(~\\\\\\)\" prefixes, and that
gnus-publish-server-function is called
with \[universal-argument] prefix arguments."
(let ((tokens
(substitute-command-keys (string-match "\\$")
gnus-publish-server-string))
(current-prefix-arg nil)
(prefix-suffix ":\\s-" prefix-suffix)
(type (string-match "\\([^@~?~?\\{$~}\\|~\\{$~}$\\}\\)~\\|\\s-*\\)?[~?~?\\{$~}$\\|~\\{$~}%\\)?" nil tokens))
(substitute-command-keys
"\\(?\\{0-9\\}^[-a-zA-Z0-9$]+: \\([0-9]+\\|[0-9]+\\)?"
gnus-publish-server-string subst-format t t
"?([^@~?~?\\{$~}\\|~\\{$~}\\|~\\{$~}\\|~\\{$~}\\|~\\{$~}\\|~\\{$~}%\\)?")))
(defvar gnus-publish-server-string)
(unless gnus-publish-server-string
(let* ((token (substring token 1))))
(when token ;Necessary for `gnus-subscribe' or `gnus-publish-server-function'.
(process-property (process-parameter process (gnus-publish-server-function token))
'gnus-publish-server-string))
(catch :exit
(gnus-publish-server-string "" token))))
(defvar gnus-publish-server-function
(dolist (f gnus-publish-server-string)
(if gnus-publish-server-string-p (gnus-publish-server-function f)))
"Function to be called with a match to a PostScript-style URL.")
;;;###autoload
(defun gnus-publish-server-string (string info-only)
"Return the PostScript-style URL as an expression STRING (string=string STRING).
See also \"/^<text:file>\\(?[0-9]?\\)?\\\\"
(let* ((string (file-name-as-directory (file-name-sans-extension string))
(match-data (or (file-name-nondirectory string)
(if (string-match "^\\s-+$\\(.+?\\)")
"%file: samples-12400"
======== SAMPLE 1 ========
" nil " nil " nil " nnf" " nnf"
" nil ".pdf" "pdf" t)))
(setq dir (file-attribute-type 'archive-extract-from-bakam)
(c-gensym "pdf" "pdf" nil (file-attributes (file-attributes
archive-extract-from-bakam)
".archive" "archive")))
(setq dir (extract-buffer "*pdf*"
(file-name-sans-extension buffer-file-name "*pdf*")))
(setq dir (file-attribute-type 'archive-extract-archive-archive nil))
(provide 'extract-archive)
;;; extract-archive.el ends here
<|endoftext|>;;; extract-pdf.el --- Utility functions to manipulate the PDF file contents -*- lexical-binding: t -*-
;; Copyright (C) 2003-2005, 2007-2019 Free Software Foundation, Inc.
;; Author: Marko Kornak <marko@kornak.czerka.dk>
;; Created: 24 Dec 2003
;; Keywords:
;;
;; Extract the contents of the current document (the current line) as a series.
;; Extract all files, including the current line in each directory. This
;; is currently not supported using the standard "gzip+bzip2" command.
;; Extract the content of the current buffer using the 'mpr-handle' option.
;; Read a chunk number by calling the `write-to-page-number' function
;; `mpr-buffer' in `mpr-read-buffer'. This function should return
;; a list of all the files, or nil if none of them has been read
;; or the previous page number has been read. For example, if we have a
;; document called "XAML.txt" and it has not yet been read in any
;; way, and the buffer isn't read, it will be "read" to be inserted in the
;; *extract* buffer and this will return nil.
(defun mpr-handle (file)
(let* ((proc ; Return the buffer contents from FILE.
(mpr-extract-file (file-attribute-prec file "extract-to-file-name"))
;; Insert the corresponding file as the last line.
(file-name-nondirectory file)
;; If we're reading text in a buffer, and mpr-handle
(write-to-page-number 'extract-from-bakam file 1)
(mpr-extract-file nil))
(goto-char (point-max)) ; Skip any previous lines or if no buffer,
;; ; or insert the current line as the text or file name
;; ; from the table where the table was extracted
;; ; or insert no lines at all in each buffer.
(forward-line (number-to-string (point-min))))
;; If the current file is not a pdf, insert a \"\" in the current buffer.
(and (or (bound-
======== SAMPLE 2 ========
(let ((b8 (length b)))
(while (< b8 b)
(let* ((x (car b8))
(x1 (car x)))
(while (< x1 x1)
(setqx (cdr x)
y (cdr x))
(setqb (cdr x)
x (cdr y)
x2 (cdr x2)
x2 (+ x)))
(setqx2 (cdr x2)
y2 (cdr x2)
x2 x1 y x1 x2 x1 x2 x1 y)
(while (< x2 x2)
(setqx2 (cdr x)
y (cdr x2)
x1 (cdr x2))
(setqb (cdr x1)
y (cdr x1))
(while (< x2 x2)
(setqx2 (cdr x2)
x1 (cdr x1))
x1 y1 y1 x1 w1 y1 x1 w1 x1)))
(setqb2 (cdr y2)
x2 (cdr y2)
x2 x1 y x1 y x1 x1 x1 x1 w1 y1 x1 x1)
(setqx2 (cdr y2)
x2 (cdr y2)
x2 (+ x) (cdr y2))
(if (not x1)
(let ((x2 (+ (length b)))
x1 x2 y x1 x2)
(while (< x2 x2)
(setqx (cdr y2)
x1 (cdr y1))
(setqx1 (cdr x)
x2 (cdr x2)))
(setqx2 (cdr y2)
x1 (cdr x1))
(while (< x2 x2)
(setqx1 (cdr y1)
x2 (cdr y1))
(setqx2 (cdr x1)
x2 (cdr y2)))
(setqx11 (cdr y1)
x1 (cdr x1))
======== SAMPLE 3 ========
(defun math-n-narrow ()
(let* ((i (1+ i))
(c (math-n-div (numbers--get-calcFunc 1 3))
(c-num-i (numbers--get-calcFunc 1)))
(k (math-setq i
(math-sort math-n-narrow
(+ 2 (/ c (calcFunc-exp (numbers--get-calcFunc 1))))))
(/= c (numbers--get-calcFunc 1) 1)))
(b (math-get-calcFunc -1)))
(push (list 'math-div (numbers--get-calcFunc c) pn)))
(defun math-n-nrow ()
(let ((c 1))
(while (and c (not (and (- 1 (calcFunc-exp c 2)) 1))
(and (< c
(math-lessp c (math-mul (math-mul c 1) 1)))
(> c
(math-mul (math-mul c 2) 1))))
(when (Math-lessp math-nrow)
(with-temp-file (format "%d" (nth 1 math-nrow))))
(goto-char c)
(beginning-of-line)
(while (and (<= c 1) (< (point) c))
(unless (or (get-text-property (point) 'math-column-p)
(and (< (Math-vectorp (progn (beginning-of-line) 2)
(point-max))
(setq p (point)))))
(beginning-of-line)
(when (and (>= c (numbers--get-calcFunc 1)) (< (math-numberp (numbers-narrow '2)))
(not (or (fboundp 'math-nrows))
(>= c (numbers--get-calcFunc 1))
(or (fboundp 'math-nrow))
(math-multiply-p (numbers-narrow 1)
(math-nrows-p 1))
(math-multiply-p (numbers-narrow 2)
(math-nrow 2)))
======== SAMPLE 4 ========
"List of symbols for Emacs Lisp support.
The symbol system is defined by `macro-mode-alist'."
(concat
"Key symbol list"
(let ((symbol
;; A new face is defined.
(read-face "Regexp to use with macro name in %d characters.
See `macro-mode-alist' for examples.")
nil))
;; A macro is defined, and the current symbol is
;; changed.
(format "%s (\\|\\s-*\\(\\s *\\)\\{1\\}\\[.0f\\]?"
nil (expand-file-name macro-name nil t))
(list (format "Regexp `%s'." (expand-file-name macro-name))))
(while (or (consp (car symbol)) (< (car (car (car symbol))) 0))
(unless (car-safe (cdr (car (car symbol)))
(throw 'exit
(macroexp-goto-symbol (car symbol)))))
(setq symbol (cons "Macro" symbol))
(setq symbol (macroexp-goto-symbol symbol)))
;; (if macro-name
;; All the symbols must use the function which should get the
;; value.
;; The symbol should be defined in the variable `progn', which is
;; defined in the macro system by `macro-mode-alist'."
(let* ((symbol (car (car symbol)))
(lispp (cdr (car (car "lisp-regexp")))
(name (match-string 1)))
(exp (concat "`" (regexp-quote symbol)))
(sym nil)) #'macro-table)
(list (format "%s: "
(cond
((listp name) name) ; Macro does not exist
(t
(expand-file-name name)))
((symbolp name) ; Macro does not exist
(t (expand-file-name name))))
(t (list "name")))
(t (list "lisp"))))
(setq symbol (cons "" symbol)))
;; Don't use lisp-regexp, it does not recognize lisp-local-defaults.
(setq symbol (and (car (car symbol))
(member symbol
(funcall macro
"%file: samples-12300"
======== SAMPLE 1 ========
(let ((cnt (1+ cnt)))
(if (eq (setq cnt (1+ (cddr cnt)))
(not (member char cnt)))
(setq pos (1+ pcl1))
(setq cnt (1+ cnt))
(setq pcl (cddr cnt))
(put-text-property cnt cnt pos (marker-position cnt))
(setq cnt (cddr cnt)))
(put-text-property cnt cnt pos (marker-position cnt))
t))))))
;; Prevent the display from being confused.
(and (not (eq arg 'no-show)
(eq (setq char char-display-key)
'no-show))
;; We don't want to have to use multi-line char conversion.
(setq char-display-key nil
char-display-key nil
char-display-key-p nil))
(defun char-display-key (key)
"Return value of `char-display-key' for the given key."
(cdr char-display-key)
(not (string-match "[[:alpha:]] *[[:[:end:]][:alpha:]][:end:]" key))
;; If we didn't display-key, we return nil.
(or (eq char-display-key key)
(error "No such key"))
;; Add a function to the next function list. The first function
;; in the list is called with a non-nil `display-key' argument, so that we
;; can display it. If there is a previous function in the list, and a function that
;; is called from `display-key'
;; then there is no need for an append function to be called as
;; it should be done.
(if (member char-display-key
(lambda (key)
(let ((char-display-key 'face char-display-key))
(unless (string-match "\C-*" char-display-key))
(setq char-display-key char-display-key))
(unless display-key
(set-text-properties 0 char-display-key 'face)))))
(if display-key
(save-window-excursion
(while (not (string-match "\C-*" char-display-key))
(with-temp-buffer
;; Put back the text property to the current buffer.
(when (string-match
(concat "|" (replace-match
"\\(.*|\\)[ \r\n?\C-*\n]\\'"
======== SAMPLE 2 ========
"*"
"-"
"\\(c\\|c\\)\\|\\(C\\|C\\|c\\|C\\|C\\|c\\|c\\)\\|")))
"\\.t"
(c-list (c-list (funcall c-sublist-function
(list (if c-sublist-index 'symbol-spec 'symbol-type 'symbol)))
c-sublist-index
c-sublist-index)
"\\|[~]?\\(c[:~]+\\([~]" ?\\|")
"~")))
(c-list (if c-list-in-list
(list "~") nil)
(if c-list-in-list
(if c-list-out-list
(list "[~]?\\(c[:~]+\\[~]?\\)")))
)
;; The list of possible strings.
(cons c-list '(:~])
(c-list (if c-list-index
(list "[~]?\\(c[:~]+\\([~]" ?\\|)
(if c-index '~'
(substring (c-string-substring c-index) (point))
c-index t))))))
;; FIXME: add function to the macro list?
(c-macro-eval c-list)
(c-list '(:~ "~" "(:< " (" (* c-list c-list) 2))))
(c-list-in-list '(:~ nil c-list-index nil)
(if (not (c-list-index 'c-list-index c-list-index)))
(list "~")))
(c-list-out-list '(:~ nil c-list-index nil)
(c-list-in-list '(:~ nil c-list-index nil)
(list "~") nil))
nil)
(defvar c-list-index nil)
(defvar c-list-index-in-list nil)
(defvar c-list-in-list-index-in-list nil)
(defvar c-list-index-in-list-index-in-list nil)
(defvar c-list-index nil)
(defun c-list-index-in-list (c-list-index-index-in-list-type c-list-index)
;; FIXME: add function to the macro list?
(c-macro-eval c-list)
(c-list-in-list (:~ "~" '(:<)) (list
======== SAMPLE 3 ========
(t (format org-agenda-agenda-regexp
"|\\s-+\\'")))
(or (null date)
(setq date (org-babel-agenda-create-date))
date (org-babel-agenda-create-date)))
(mapc (lambda (f)
(format org-agenda-agenda-regexp
"|\\s-+\\'")))
(if (eq org-newsgroups-defaults "newsgroups")
date
'((org-agenda-show-date
(or org-agenda-newsgroups-defaults
org-agenda-show) t))
'((org-agenda-show-date
(or org-agenda-newsgroups-defaults
org-agenda-show)))
1))))
(t (format org-agenda-agenda-regexp
"|\\s-+\\"))))
org-babel-agenda-summary
org-agenda-summary
(t (org-agenda-analyze-summary-summary-completion
======== SAMPLE 4 ========
'(?f . ?m ?n))
;; See also `makefile'.
(cl-incf bb) ;(:file . ;<br-name ;;;
(file-name-nondirectory
(and arg (prefix-numeric-value arg)))
(file-name-nondirectory
(string-match
name
(file-name-nondirectory name)
(string-match
t
(file-name-nondirectory
name))))
;; In case the file name changes.
"%file: samples-12200"
======== SAMPLE 1 ========
(if (or (<= num-sig-count num-sig-count)
(eq num-sig-list (num-sig-num num-sig-list))
(eq num-sig-id (num-sig-num num-sig-id))
num-sig-id))
num-sig-id)
(goto-char (1+ num-sig-char))
(skip-chars-forward " \t\r")
(let ((list (nth 3 num))
name)
(while list
(setq name (car list))
(while (setq name (cdr list))
(setq name (car list)
(eq name '(".+" . ".)" . ">")))
(if (not name) ; Not needed. This is only useful for sorting
(not (listp name) '("%") (eq name '("%1")))
(message "%s sorting now done")))
(setq nn-sig-list
(sort name (1+ num-sig-char size))
(if (not (listp nn-sig-list))
(setcdr nn-sig-list
(nndir (nth 1 nn-sig-char) (cdr nn-sig-list))))
(nndir (cdr nn-sig-list)))
(setq nn-sigs-list (cdr nn-sigs-list)))))
(cl-destructuring-mark nn-sig-char size num-sig count last-n-sig-size))
;;;; New list
(defun nndir-add-in-list '(list (nndir name string)))
(defun nndir-pop-nndir (nndir name)
(cons nndir nndir-name name))
(define-derived-mode nndir-mode dired-mode "Dired"
"Major mode for editing Dired.
This entry is for users who prefer editing in buffers named `~/.emacs',
and don't want to type \\[dired-mode] or the like. This is the default for
dired."
(let ((list (or (string-equal nndir 1)
(function-call-with-args nnndir
(list "~/.emacs" nil))))
name))
(and (string-match "\\`" list)
(progn
;; If `~/.emacs', but without the ";" in the prefix
;; keyword, use "~/.emacs" instead.
"~/.emacs")))
t)
new)
(defun nnd
======== SAMPLE 2 ========
(let* ((name (buffer-name)))
(name-list
(lambda (start end)
(if (or (eq name-list-p 'all)
(consp start t))
(car name-list)
(name-p end nil)))
name
t))
(or name-list "")))
(defun smerge-smerge-dictionaries-regexps (regexp)
"Get the list of citations and the corresponding revision by looking through entries."
(let* ((doc (get-text-property (point) 'smerge-doc-re-doc)
(id (get-text-property (point) 'smerge-id-re-doc))
title
(bib-entry-number (id-entry-start id-entry-number)
(id-entry-end id-entry-number)))
(if (not (get-text-property (get diff-id title-references) 'smerge-dictionaries-regexp))
;; Don't rely on this function.
(or (get-text-property (get diff-id title-references) 'smerge-dictionaries-regexp)
(funcall diff-id title-references (id-entry-start id)))))
(if (not (get-text-property (get diff-id title-references) 'smerge-dictionaries-regexp))
bib-entry-number
result-repo)
(smerge-dictionaries-regexp (id name-references id-references)
(doc-entry-name title-references :format "\\(id\\).txt") ? "")))))
;; --------------------------------------------------------------
;; --------------------------------------------------------------
;; --------------------------------------------------------------
;; The above function takes the entries for `id-references' and
;; `id-ref-number' and returns them. It passes
;; 'smerge-smerge-references-regexps-function into `smerge-dictionaries-regexps'
;; to make sure the results are correct so that they are displayed
;; on the display in smerge-references buffers.
(defun smerge-dictionaries-regexps-function
(regexp prefix
(concat "\\'" 'smerge-d-ref-type)
"\\(ref\\s-+\\)\\'"
(get-text-property
======== SAMPLE 3 ========
(substring (ltrim 4) '(0 1)) (substring (ltrim 5) '(1 1)) ;; FIXME: The function used here has no `ltrim' in it so this is a good thing!
nil)
(ltrim 4 3))
(apply #'apply (lambda (var var-var-bindings) var-binding (list var-var-bindings))))
(defun ltrim-list-formulas (formulas)
"Get a lambda expression for each formula we add to the list. Add one for each formula we do add."
;; Use this for lambda functions, which we already do.
(let ((formulas nil)) ; These formulas are just lists.
(apply #'apply #lisp-lambda-list
(list (list-subst (ltrim 2) (ltrim 0)))
(apply (funcall forms (ltrim (list 3 2))))
(apply (nth 1 forms) form)
(list forms formulas t nil))
form)
"List of formulas to make a lambda list."
(let ((forms nil)) ; These formulas are just lists.
(apply #'apply #nforms))
(cond ((nth 2 forms) form)
((and (listp forms) (listp (car forms) "")
(member (car forms) (listp (car forms))
(listp (cadr forms))))
((nth 2 forms) (nth 1 forms) (nth 1 forms)) ;; FIXME: If a function is passed in, but in a list (like a function list) it
;; doesn't have the form that it's supposed to come from.
(when (and (listp forms) (car forms))
(when (nth 2 forms)
(car (list (apply 'car forms)))
(list 'list))))
((listp forms) form)
(t
(nth 3 forms))))
(apply #'apply nil
(lambda () (car forms)))
(let ((forms (nth 1
(listp forms))
(count 0))
(if (listp forms)
(append forms (list (listn (list-subst forms 0)))
(list (list 'lists '(nil nil)))))
(list forms count)))
(defun ltrim-list-formulas-by-args (arglist form)
"List of formulas for selecting FUN and TAB from args to form."
(nconc form 4)
(nconc (lambda (form)
(list `(cl-funcall ,form 1)
(calc-formula #'car-cdr (listcar form)))
(list (listn #'calc-formula
(listn t))))))
(defun ltrim-list-formulas-by-directive (&rest forms)
"Get terms of a lambda expression.
A list of names. If the list of names has the form
`forms', then they form elements. For example (as in
a
======== SAMPLE 4 ========
(nreverse c)))
(if (and (consp result) (null result))
(progn
(setq result
(car (setq result (cdfit-to-string
(car (caar result)))
(append result (list (cdfit-to-string
(car (car result)))
(car result)))))
result))
(if (member result result-noms) result-noms
(if (consp result-noms)
(member result-noms (cdr result)))
(setq result-noms nil
result-nil nil
result-noms nil
(car result))))
(setq result (cdr result)))
result)
(defun c-defs-defn (args args-1 &optional noms-2)
(interactive "P")
(if (eq (cadr args) 'defn)
(cl-assert (eq (cdr args) "defn_" 'defname-table))
(if (not (eq (cadr args) 'defn) 'defspec-table))
(c-cadr args))))
(defun c-make-defunc (arg)
"Make a definition for `defunc-from' to a specific defdecl-function.
Otherwise, create a new one."
(cond
((symbolp arg) (car arg))
((cdr arg) (cdr arg))
((c-cadr arg))
((or (symbolp arg-noms)
(symbolp (car arg)))
(if noms
(funcall (cddr arg-noms) (cddr arg-noms)))
(cl-destructuring-bound
(setf (cadr arg) (cadr arg))
(cl-destructuring-bound (cadr arg))
(cl-fstruct
'ccontainer nil 'components))
(t nil))
;; There are two ways to create a new one.
(if (eq (car-safe args) 'defn)
(setq args (cdr args))))
nil)))
(defun c-make-convert (str (car-safe str))
"Make `c-default-conversion' in place of the defaults given by `c-default-conversion'."
(if str
(concat (make-string (length str)) ?\n (concat str " " str))))
(define-obsolete-function-alias 'default-conversion
'default-conversion "30.1")
(defun c-define-default (arg)
"Set the default for the current function, if any."
(declare (indent 1) (debug (list ',arg)))
(declare (debug (symbolp (list ',arg)))
"%file: samples-12100"
======== SAMPLE 1 ========
(with-modes
(format (concat "^" (buffer-name) " :instrument: "
(format "strument: "))))
(while (setq mode (cdr modes))
(cond
((string-equal "^" mode)
(string-to-number mode))
((string-equal "c" mode)
'car (string-to-number mode)))
(if (string-equal "\\(^ \\[/]+\\|^\\[/]+\\)/" mode)
(setq mode (cdr (cdr modes))))))))))
(setq mode (cons (cons "c" mode)))
(with-modes
(modes
(add
(cond
(setq mode nil)
(setq mode 'instrument)
(cond
((string-equal "^" mode)
(setq mode (cdr modes))
(unless (assq 'inc (mod 'inc mode)))
(when (string-match "\\^" mode)
(setq mode (cdr modes)))))))))))
;;;###mh-autoload
(put 'mh-mode 'mh-mode-flag '((mh-mode . mh-mode) (mh-auto . mh-mode))
"Switch between the Mh mode buffer and `mh-mode-flag'."
(if (mh-mode-p) (mh-mode 1) (setq mode 'mh-mode))
;; We need the buffer-local variables.
(funcall mode 'mh-mode-flag))
(defun mh-mode-flag ()
;; We want to take advantage of the `mh-flag' variable.
;; Otherwise it forces us to do a `mh-instrument' test.
(let ((mh-mode '(mh-minor-mode-flag (mh-minor-mode-flag (and mh-minor-mode
'mh-mode))))
(if (null mh-flag)
(setq mh-flag (mh-minor-mode-flag (and mh-minor-mode
'mh-minor-mode))))
(if (null mh-flag)
(progn (when mh-instrument
(when mh-instrument-flag (if mh-flag (and mh-instrument
(set-default (mh-minor-mode-flag (and mh-minor-mode
======== SAMPLE 2 ========
:init-active t )))
(t
(setq c (math-sub c 1)
g (math-trunc g))))
(if (eq (aref a 1) 'math-mult-div2)
(math-reject-arg a 'math-mult-div2 3)
(math-reject-arg a 'multifract
(math-mul a 1)
(math-rng (math-mul a 1)
(math-mul a 2)
(math-mul a 3))))
(math-mul a (math-mul (math-mul (math-mul
'math-mult-div2)))
(math-mul a 2)
(math-mul g (math-mul g))))
(math-div g '(math-mul a 2)
(math-mul a 1) '(math-mul g 3) (math-mul (math-mul g 2) '(math-mul g 3)
(math-mul g 3)))
(math-reject-arg a 'calm-constant-form 3)))
(let ((g (math-div a 1)))
(and (setq g (math-div a 2))
(setq g (math-div a 3)))
(and (setq g (math-div a 4))
(setq g (math-div a 5)))
(if g
(math-reject-arg a 'calm-constant-form g))
g))))
(defmacro math-mul (a b)
(math-div a b (math-mul a 1)
(math-mul a 2)
(math-mul a 3)))
(defconst math-div-1
"Math-divisible-pi."
(cond ((let ((n 0)
(math-expand-integers
(math-neg
(list 'math-div n))
t))))
((and (listp b) (not (integerp b))
(listp c)
(math-div
(list 'math-div
======== SAMPLE 3 ========
(* 4.7 (make-string (+ 6.0 7.0 6.0 7.0 6.0)) ?x))
;; FIXME: this might be an odd number.
(t
(let ((minor-mode (list-of-windows-mode-keys
(/ (% 5.0 0.0 5.0 0.0))
nil)))
(mapc (function (list (list-windows-mode (list-windows-mode)) min-mode))))
(dolist (windows minor-mode)
(if (< (length windows minor-mode)
(length windows) (= 0 (car (car windows)) ?x))
(dolist (windows (apply 'max-widths (nth 1 (car windows))))
(apply 'max-heights (cons (length windows) window)
(apply 'max-widths size (setq windows nil)))))
(dolist (windows (funcall minor-mode (list (+ 7.1 (length windows) size))))
(funcall minor-mode size (list (car windows)) nil)))
(let ((minor-mode (list-of-windows-mode-keys min-mode))))
(dolist (windows (make-windows-windows-windows))
(dolist (windows (funcall minor-mode (list min-mode 0)))))
(list (make-window-all windows)))))
(defun make-windows-windows-windows-windows (&optional mode)
"Make each window of the selected system in BUFFER of a different kind.
The windows are selected with the new value of BUFFER, and are those
in which you wish to display them. If `minor-mode' does not allow
displaying of the same window of the system from a different
frame, the new value of all the windows is returned as a list.
With a prefix argument MODE the mode can be specified using a list of
windows, and the mode name is taken as a string to represent
it. For example, if you want to display the following window:
\\*windows-mode.el\\*\\*\\*
\\\\*windows.el\\*\\*
\\* \\*window-buffer-name.el*
For Emacs and UNIX platforms, call `windows-mode on `setq-mode'.
MODE allows windows to be displayed in several different window buffers,
using the same `setq-buffer-name' (called
`setq-window-alist') that `windows-mode' provides.
The returned list is a list of the different kinds of windows.
\\*windows.el*
\\*windows.hx*
\\*windows.lx*
\\*windows.m*
\\*window.o*
The list of modes for which `windows-mode' is the key
`window-alist' (the default of each window) is returned."
(push-local-variables
'(if (string-match "-l" (symbol-name window-alist))
(if (equal (length window-alist) (string-match window-alnum-string windows-alist))
(match-string 0 (symbol-name window-alnum
======== SAMPLE 4 ========
(save-excursion
(goto-char (point-min))
(not (eobp))))))
(and (bolp)
(save-excursion
(goto-char start)
(not (cdr (assq 'forward-char-if-in-region start-regexp-alist)))
(re-search-forward
?\n (save-restriction
(widen)
(line-end-position)
(point))))
(eq (match-beginning 0) (match-end 0))
(setq end (match-beginning 0))
(cprincl "\\([.]_}[^_]\\|[^_]\\|[^_]+>\\)"))
;; `\\([^_]\\|[^_]\\|[^_]\\|[^_]+>\\)" should contain
;; one match, so we can sort here by only the first.
(cprincl "\\([.+\\([_a-zA-Z__]\\)?\\)\n[_a-zA-Z_]+\\)\\(\\([.+\\([_a-zA-Z_]\\)?\\)[\n\r\r]+\\)?"))
(regexp-opt (goto-char (line-beginning-position 2))
(match-string-no-properties 1))))
(when (and (re-search-forward regexp-regexp start-regexp-alist)
(save-excursion
(forward-sentence 1)
(not (bobp))))
nil)
(t (insert regexp-opt nil 1))
(insert (match-end 1) (point)))
(defsubst match-index (match-type match-start &optional start-end)
(let* ((match-type (car match-start))
(start (match-beginning 0), match-end (match-end 0)))
;; The match-style is set by `match-start-regexp', `match-end-regexp'.
(if start (> (length match-start) match-start)
;; match-end is the end of the `end' part.
match-end))
)
;; Support for a different display format.
(defun match-style-type (char ?\; &optional start-end match-start-regexp)
"Compute a style-specific version of match-start.
When non-nil use this style format, the characters which match
the start of the range in CHAR become character by character.
Otherwise CHAR is treated as a non-character
character. So a charset of characters which match CHAR becomes
character at beginning of range, then CHAR becomes character until
the range with charsets.
CHAR is treated as a non-character character
"%file: samples-12000"
======== SAMPLE 1 ========
(let (result)
(setq result
(if (and (numberp (car (reverse (car result)))))
(setq result (cdr (assoc
(funcall
;; Return the returned value
(or (memq method '(symbol (mapcar 'symbol (lambda (symbol)
;; return them all
nil))
(cadr result)))))))
result))
(defun cpl-set-coding-region (start end cpl-keyword-coding-table-function-kwds)
;; This calls CPL-EXAMPLE-RETURN-FOR-KEYWORD and
;; we then return the keyword.
(let* ((p (cpl-read-keyword-command
(or cpl-keyword-coding-table-function-kwds p))
(start end)
(last (not (equal (cadr (mapcar (cdr p) end))))))
)))
(defun cpl-set-coding-table-function-kwds (start end)
;; This calls CPL-EXAMPLE-RETURN-FOR-KEYWORD and
;; we then return the keyword.
(or (pl-insert-keyword start end "^ " nil))
;; This calls CPL-EXAMPLE-RETURN-FOR-KEYWORD and
;; we then return the key.
(and (listp end)
(or start
(not (equal (cadr (cdr end))))))))
(defun cpl-set-coding-table-function-kwds (start end)
;; This calls CPL-EXAMPLE-RETURN-FOR-KEYWORD and
;; we then return the keyword.
======== SAMPLE 2 ========
(nth 2 the-name)
(nth 0 the-name)
(nth 3 the-name)
(nth 4 the-name))))))
(nth 1 the-name)
(nth 2 the-name)
(nth 3 the-name)
(setq nth 2 (- dt 2))
(while (and (= nth 5 the-name) (< nth 3 t))
(setq t t t)
(while (and (< nth 6 the-name) (< nth 3 t))
(setf (cons 'nth 3 t) nil t))
(setq the-name t)
(when (> nth 4 the-name)
;; FIXME: If the name in the list of the last 5 entries
;; from point is the last name but in a "todo"
;; list, add a line after the nil in this case
;; to the list of the last 5 entries from point
(let* ((new-list (read-string (pop the-names))
(list nil))
(new (copy-marker old)))
(if (and (consp new-list) new-list)
(concat (make-string t) ; empty line at end
(+ nth 5 (1+ nth 2))
(1+ nth 6))
(1+ nth 3)))
(nth 6 new-list)))))))))
;; The same as (intern-add (list (list the-name (concat t ""))))
(defun nth 1 (int-n))
;; A sequence of the following characters that appears as a comment or
;; string can be ignored; they're not necessary.
;; We want to put those characters at point in the same way
;; that strings with space are left-justified to ensure
;; the same look.
(defun nth 2 (int-n))
(defun nth 3 (int-n))
(defun nth 4 (int-n))
(defun nn 3 (int-n)
;; Make an entry in the minibuffer for ints that we think are
;; interesting.
;; The minibuffer
======== SAMPLE 3 ========
(nth 2 args)))
(push
(buffer-substring-no-properties
(if (not (eq is-empty-p 'is-first))
(message "Error %s" is-empty-p)
(error "Unknown non-empty argument to is-first-argument %s" arg))))
(concat args
;; FIXME: this function can have different arguments.
(if (not has-empty-args)
(if arg (null found)
"")
(nth 2 args))))
;; For instance, is not set as an argument for an empty
;; empty statement. Instead, it has an empty argument.
(if empty-arg
(if (eq is-empty-arg empty-arg)
;; If this is the first argument, the rest of
;; is empty.
(string-equal arg ""))
(throw 'found t))))))
;; For example, `:foo' can't be empty because one is, but
;; there is no empty argument. We use the first. This
;; function can do the same for non-empty argument.
;; However, if is-empty-arg then the arguments for the current
;; program will be the arguments for the last call, i.e.
;; `:foo' won't work if it's not empty.
(setq args (if is-empty-arg (nth 2 args)
(nth 1 args))))
;; For other cases of `:foo', we could have something else.
(let ((orig-arg (nth 2 args))
(result-list (with-temp-buffer
(condition-case err
:type is-empty
nil
(error
(buffer-substring-no-properties
(if is-empty-arg (funcall args) (funcall result-list)
======== SAMPLE 4 ========
;; Not at all, just in case
;; if (and (consp buffer-list) (consp buffer-list))
;; We have a buffer, try again
;; and just end up with another empty list.
(let ((creds-read 0))
(witness nil))
;; If no buffer exists, and no buffer-list
(while (and rcons (not bcc-list))
(and (not rcons (eq buffer-list 'ignore))
;; It isn't a buffer yet, check for it later.
;; And it isn't in a buffer yet, just to get it
;; in. If it isn't in a buffer yet, do what?
(let ((d-buffer (aref rcons buffer-list)))
(setq bcc-list '(ignore buffer-string))
(set-buffer bcc-list)
(if (zerop (length bcc-list))
(set-marker (marker-position nil) (point)))
bcc-list))
;; There are already a buffer, but this one is empty
(goto-char bcc-list))))))))
;; ======================================================================
;;; Buffer management functions
(defun bcc-handle-buffer-p (value &optional value)
"Like `get-buffer-local-variables'."
(unless (or value (derived-mode-p 'mode))
(error "Invalid value at the beginning of buffer ")
(let ((found-buffer nil) (buffer nil)
buffer-list)
(while (and found-buffer (not (bcc-p value))
(set-buffer found-buffer))
(setq found-buffer buffer)
(setq found-buffer-keyword nil)
(unless (looking-at "[ \t]*\n\".*\"$" nil)
(setq buffer-list
(cons (cdr (assoc value bcc-buffer-local-variables))))
(if t
(progn
(setq buffer-list (cons (car buffer-list) value)
buffer-list buffer-list)
(setq found-buffer-keyword nil)))))
(setq found-buffer-keyword nil)
(if found-buffer-keyword
(progn
(set-buffer found-buffer-keyword nil)
(goto-char (car found-
"%file: samples-11900"
======== SAMPLE 1 ========
(error "You have to visit multiple files in different directories"))
(eval-when-compile
(require 'cl-lib))
;; Completing functions
(define-compose-or-make-comint-function
(comint :function "comint" :name "A-FUNCTION (FUNCTION ...)"
:arguments '("TODO" "BAR" "DEF"))
(lambda (p)
(funcall
(let ((start (comint-get-props 'start p)))
(comint-make-comint-function start p)))
(error "No file names at point"))
(message "This file is incomplete"))))
(define-compose-or-make-comint-function
(comint :function "comint"
:arguments '("INTO-COMINT" "INTO-COMM"
:arguments '("TOLISTAN" "TRUE" "CONDITION"))
:arguments '("INTO-PROTECT" "INTO-PROTECT"
:arguments '("UNINTERACTIVE" "UNINTERACTIVE"))
:arguments '("STOPTEMPT " . start))
(lambda (p)
(funcall
(let ((s (comint-get-props 'start p)))
(comint-make-comint-function start p)))
(message "File is incomplete"))
(define-compose-or-make-comint-function-list
(comint :function "comint"
:arguments '("CONDITION" "TOCOPITATION")))
(define-compose-or-make-comint-function-list-name
(comint :function "comint"
:arguments '("INTO-COMINT" "INTEGRITY"))
(lambda (p)
(funcall
(let ((s (comint-get-props 'start p)))
(comint-make-comint-function start p)))
(message "File is incomplete")
(user-error "You have to visit multiple files in different directories"))
(condition-case error
(progn
(error "Not in a comint file"))
(error "It is possible to complete a completion and not know the name")))))
;;; Completion and list
(define-compose-or-make-comint-function
(comint :function "comint"
:arguments '("TODO" "TOCOPITATION")))
(cond ((and (not comint-completion-at-point)
(progn
(comint-complete-all))
(message)))
((eq comint-completion-at-point 'comint)
;; We want to do a completion,
;; otherwise we may be asked
(error "This completions need to be added from comint.el"))
(let ((vals
(comint-get-completion-at-point))
(comint
======== SAMPLE 2 ========
(format "\\|[^.+]\\|%d/\\([_,.]+\\)\\|\
" (match-string 1 last-charset))
(push (cons 'match-string last-charset)
'\\([[^.]\\)\\|[^.+:][^.[0-9.]+][^[^.+]\\)\\|%d/\\([.+:]|[^.+:\\]"))
string))
;; Don't check any trailing trailing space, so it matches
;; the following: "\\(\\)?\\'"
(skip-chars-backward "$")
(unless (equal (subexpression "\\|" regexp) "\\)")
(insert string)
(forward-char (if (equal (subexpression "\\|" regexp) 7))
(if (string= (subexpression "\\|" regexp) 2)
(concat (subexpression "\177") "\^\\(\\|" (subexpression " ")))
(subexpression "\\|" regexp))
"")))
;; Check if trailing space is "\\.[^ \t]*\\(:=\\|[ \t]*\\)".
(if (looking-at "[ \t]*$" regexp) (looking-at "[?-][-=0-9%]$"))
;; If the leading space matches, then check whether the
;; next match belongs to "\\<match\\>" or not.
(cond ((?q "\\<match:\\>[ \t]*\\\\\\?\\))
((?d "\\<match:\\>[ \t ]*")
(while (string-match '("\\*\\|[^.+.]+>" regexp string)
(and (stringp (match-end 1) (match-string 1 string))
(save-excursion (cdr (match-beginning 1)) (if (matchp string)
(string-to-number (match-end 1)))
(string-to-number (match-end 1)) string)))
(list (match-string 0 string)
(cons 'match-string string))))))))
(let (result)
;; If match was "", return a string, but don't check that the
;; next one belongs to "\\[.*/]\\[.*/\(.]+\\)".
(if (looking-at "^." regexp)
(push (list (match-string 0 regexp)
(if 'string (1+ (match-end 0))
(let (result)
======== SAMPLE 3 ========
(setq default (symbol-name default)))
(condition-case ()
(cons `((default ,(cons def-default-functions
def-default-functions `(let ,@prolog-fun,
def-default-functions)))))
(fun
(when (>= def-default-function def-default-functions)
(narrow-to-region
def-default-functions
(concat (substring def-default-function def)
(substring def-default-functions
def-default-functions))))
;; Define this function as a cons cell,
;; and return it.
(t (mapcar (lambda(x) (cons x (symbol-name x)))
(cons
(car (assq def-default-functions (cdr x)) x))
def)))
def-default-functions)))
;; Define this function as a cons cell,
;; and set that as the default (so we don't need to know which one's
;; not the default, so just return.
(when (or (not def-default-functions)
def-default-function))
;; Determine the default function on def-defs,
;; of the same form as below, and return it.
(let* ((def-fn (symbol-function def-fn)))
(if (or def-fn (or def-def def-default-function)))
def-fn
def-fn)
;; Set this function in the `default' list
;; so def-defs are not expanded.
(let ((def (symbol-name def)))
(set* (mapcar (lambda (x) (symbol-name x)) x))
(if def-fn
def
def))
;; If that is not true, return nil.
(with-current-buffer def
(apply #'call-process def nil)))
;; Check that each def is not just a default!
;; If it's a function, set it.
(unless (featurep 'def-global)
;; Check if it's a list.
(let ((def-fn def-fn) (def-fun def-fun))
(when (>= def-fn def-fun)
======== SAMPLE 4 ========
(unless file-info
(setq file-id file-file-p
(copy-file file))
(find-file file)))
(set-directory file file))
(put-text-property (point) :style file)
(move-to-header-line line)
(set-text-properties :inherit font-lock-keywords 'ignore)
(setq line (point) (convert-standard-filename file-info))
(set-file-buffer line))
(setq file-info)
(insert "Table")
(unless (file-exists-p file)
(delete-file file)
(put-text-property :type 'plain-text 'org-backend-table)
(write-region 'blank))
;; If nothing is found, add it to the buffer.
(unless (string-equal file-info '("\fF" . ""))
(set-buffer-modified-p nil))
;; Make sure we have a clean line.
(unless (file-readable-p file)
(delete-file file)
(write-region "0-11" line t t)
(goto-char (point-min))
(backward-char 1)
(insert-file file))
(setq file-info)
(insert "\n\t")
(insert string-of-number " "))
;; If file exists yet, remove all whitespace.
(unless file-readable-p
(set-file-noselect (if file-readable-p
(concat file-readable-p "\n")))
(setq file-info (replace-regexp-in-string
"( ". (match-string 1))))
;; For a number of lines, add the number to the file.
(when (or (equal file-included-p file-included-p)
(equal file-included-p file-included-p))
(set-file-noselect (replace-regexp-in-string
(replace-regexp-in-string " " "")))))
;; Set the filename, if the number is smaller than the file.
(set-file-noselect (replace-regexp-in-string
" ( ". "))))
(provide 'org-mode-list)
;;; org-mode-list.el ends here
<|endoftext|>;;; org-texinfo.el --- Custom Texinfo format for PostScript editing
;; Copyright (C) 2004 - 2006, 2007-2019 Free Software Foundation, Inc.
;; Author: Stefan Josefski
;; Keywords: Texinfo, PostScript
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; The following functions are used for Texinfo.
;;
;; A function for choosing a Texinfo-style editor
;;
;; (
"%file: samples-11800"
======== SAMPLE 1 ========
child to the start of the file if the current buffer contains one.
Otherwise, it is used to insert a newline between the old file name and the new one
The value is updated as appropriate.
* Variables for editing on Emacs 24.4 (see
tabulated mode) in `org-mode-map-hook' are copied from
the global `org-mode-map'.
For convenience, `org-buffer-current-file' returns the file name,
and any other properties of the file if they are properties of a file.
See also `org-mode-map-group-line-history' and `org-mode-map-string-history'.
* The old file format is used in the case that Emacs does not
have an Emacs-related buffer."
(interactive)
(org-at-mode-line-point)
(org-beginning-of-line)
(org-insert-file-contents file-name name)
(org-put nil 'org-mode-filter-functions 'funcall))
(org-define-mode-local org-mode-map org-mode-map-functions)
(defvar org-show-group (and (or (not org-group)
org-group-buffer)
org-group-buffer)
"Keymap to use for showing group text in the current buffer.
`org-mode-map-group-line-history' or `org-mode-map-string-history'
is inserted as appropriate.")
(defcustom org-toggle-group-mode 't
"Set to toggle GROUP to inhibit the highlighting of the current buffer.
In use, it is a list specifying what's been inserted."
:version "24.1" ;; obsolete because of bugs in Org 19.1
:group org-mode-toggle-map
:type 'set)
(defun org-mode-map-group-file-revision (file)
"Save the current file into a temporary file.
The buffer is the buffer in which the temporary file has been created.
When the file is visited again it will be saved in the buffer, but
the file contents may be modified by other users. When the buffer is
visited again, it will be overwritten.
Return t if the temporary file has been generated and not
in the buffer. If the temporary file has not been created, then
if we're on a temporary file and the buffer is in a temporary file
the file name of it should be saved in the file-name buffer before
setting the buffer. If we're on a temporary file and none of the local
file name matches the buffer name the buffer name, like an Emacs
buffer of the form: buffer-name."
(setq file (file-name-directory file '("file-name.%s.f"
(buffer-file-name))))
(with-temp-buffer (set-buffer-multibyte nil) (find-buffer-visiting temp-file))
(if file
(with-temp-buffer
(find-buffer-visiting file)
(delete-region (point-min) (point-max) (point-max) (point-min)))
(save-buffer)
;; We can't save the temporary file now, so we restore the buffer
;; only one file at a time.
(org-mode-map-group-file file))))
(defun org-mode-map (entry file-name &optional special-file-alist)
"Edit the current buffer as a group text.
Entry should be a list or the form:
(NEW-FILE-ONLINE-FLAGS NEW-GROUP-MODE COMMAND-FILE)
where NEW-FILE-ONLINE-FLAGS (defaults to a string) and NEW-GROUP-MODE (defaults to the key map)
NOTE: if THIS-FILENAME does not start with a group buffer then the entry may be
a group file name that is in the mode list, or a file name
======== SAMPLE 2 ========
child to an
;; ;; position of the buffer (before or after `buffer-name'),
;; ;; (unless the buffer-name is the current buffer)
;; ;; (setcdr (symbol-value buffer-name) current-buffer))))
;;;###autoload
(defcustom hfyj-toggle-buffer-name-function 'hfyj-hfy-change-buffer-name-function
"Interactively changing the buffer name in some buffer.
The function is called with one argument:
- the buffer name.
- the buffer name (and its text)
- the value displayed."
:type (const :tag "Buffer" :value buffer-name)
:options 'hfyj-toggle)
(defun hfyj-change-buffer-name (buffer)
(or (functionp buffer)
(not (hfyj-hfy-change-buffer-name-and-buffer-name (symbol-value buffer)))
buffer))
(defun vhfyj-hfy-change-buffer-name (buffer function)
"Hfyj update the buffer name in some buffer; FUNC should evaluate to (FUNC variable)
Hfyj buffers. The returned buffer must match the current buffer."
(let ((hdef-name buffer-name)
(func (function-called-at-point))
(buffer-name function))
(error "Not in buffer %s" (buffer-name buffer))
(if (not function)
(error "Can't update buffer %s" function)
(with-tramp-connection-property
nil
(set-buffer-name (symbol-value buffer))))
(when (and (bufferp (buffer-identity-p))
(not (eq (char-before) ?\n t)))
(progn
(unless (equal func (car (nth 1 (list variable list))) 'vhfyj-current-buffer)
(error "Can't update buffer %s? ")))
;; update the buffer name to the value of the variable list
(unless (and (nullfunc (cdr (symbol-value vhfyj-current-buffer)))
(not (equal (string-to-number (symbol-value vhfyj-current-buffer))) nil))
(with-tramp-connection-property vhfyj-current-buffer
(setq vhfyj-current-buffer (symbol-value vhfyj-current-buffer)))
(let ((buffer-name (and (bound-and-true-p hfyj-hfy-buffer-name)
(condition-case error
(progn (goto-char (point-min))
(error (if nil
hfyj-hfy-variable-name)))
(error (if (funcall function function) nil )))))
(
======== SAMPLE 3 ========
child for this region, so don't use it.")
(/= (*- (char-after (regexp-quote char)))
(/= (/= (+ (* (char-after (point) char))) (+ (* (point) (1- (point))) char)))
(+ (+ (* (point) (1- char)) (- (* char (point) (- char (point) (point) (+ 0 char))
(- 0 char) (+ char (point) 0))))))
(/= (/= (- char (- char 0)))
(+ (* char (point) (- char 0)))
(c-syntactic-skip-to-region)
(c-syntactic-skip-to-char-after)
(+ (* (char-after (point) (+ char (+ 0 char)))
(if (re-search-forward "^[ \t]*")
(point-max)
0)
(if (c-goto-char (+ (- (point) char)) (+ 1)))
(if (c-goto-char (+ (point) char)) (+ - 1))))))
(/= (/= (- (+ char 0))))
(/ (+ (char-after (point)) (+ (- (+ (* (* (+ (+ (char-after (point) char)
(point) (point-max)
(point-max)) ?+)
(c-syntactic-skip-to-char-after)
(if (re-search-forward "^[ \t]*/*" nil)
("^[ \t]*" nil)
("^[ \t]*" nil))
(c-goto-char (+ (- (point) (- (1+ c-syntactic-c-back-p)) 2)
(point 0)
(+ (- (point) (- (- c-syntactic-c-forward-p)))
(point-max)))))))))
(/= (+ (* 0 (* char 0))))
(/= (?\r (c-syntactic-skip (+ (- (+ (1- (char-after) ?*)) ?*)) (1
======== SAMPLE 4 ========
child-id-entry-type entry)
(and (semanticdb-get-current-type 'ttype) entry))
(or entry
(not (member (cdr entry) tag-alist)
tag-alist))
entry)))
;;; Internal variables
(defvar semantic-auto-save-documentation-text
((semanticdb-get-current-buffer)
(set-buffer semantic-auto-save-buffer)
"Buffer used in semantic buffer list.")
)
;;;###autoload
(defconst semantic-auto-save-regexp
"\C-u"
(concat "\\(" (regexp-quote tag-alist "\\)"))
"Regexp to use in semantic semantic buffer list")
;;;###autoload
(define-semantic-tag-alias 'semantic-auto-save-documentation-text
semantic-auto-save-string
"Auto-save the tag description for the current buffer.")
;;;###autoload
(define-semantic-tag-alias 'semantic-auto-save-documentation-marker-alist
semantic-auto-save-marker-alist
"Auto-save the buffer in marker list.")
(defvar semantic-auto-save-documentation-text
"Type in the current buffer's definition.")
;;;###autoload
(define-semantic-tag-alias 'semantic-auto-save-marker-p
semantic-auto-save-marker-alist
"Auto-save the buffer definition.)
;; Font-lock font lock
;;;###autoload
(defvar semantic-font-lock-keywords
"Keywords to associate with a font lock font. Set it.
If set interactively, set the variable `semantic-font-lock-keywords'.
See `semantic-font-lock-keywords'."
:group 'semantic)
;;;###autoload
(define-semantic-tag-alias 'semantic-font-lock-keywords
semantic-font-lock-keywords
"Keywords to associate with a font lock font. Set it.
See `semantic-font-lock-keywords'."
:group 'semantic)
;;;###autoload
(define-semantic-tag-alias 'semantic-font-lock-keywords
semantic-font-lock-keywords
"Keywords to associate with a font lock font. Set it.
See `semantic-font-lock-keywords'."
:group 'semantic)
;;;###autoload
(define-semantic-tag-alias 'semantic-font-lock-keywords-to-list
semantic-font-lock-keywords-to-list
"Keywords to associate with a font lock font. Set it.
See `semantic-font-lock-keywords-to-list'."
:group 'semantic)
;;;###autoload
(defconst semantic-font-lock-keywords
"Tag keyword words
\(.+ . +)"
semantic-font-lock-keywords-to-list
semantic-font-lock-defaults)
(define-global-type 'semantic-font-lock-font-lock-face
'semantic-font-lock-font-lock-face
'semantic-font-lock-font-lock-key-map
"Face for font locking face for C/C++ declarations.")
;;;###autoload
(defvar semantic-font-lock-font-lock-face
'semantic-font-lock-font-lock-face
"Face used in font locking face for C/C++ declaration")
;;;###autoload
(defvar semantic-font-lock-keywords-to-list
'semantic-font-lock-font-lock-face)
(defvar semantic-font-lock-font-lock-fkeys
"Face used in font lock font name.")
(defcustom semantic-font-lock-fkeys :format "(text)")
(defcustom semantic-font-lock-fkeys-to-list :format "(text)")
(defun Semantic-font
"%file: samples-11700"
======== SAMPLE 1 ========
(setq result nil))))
result)))
(and (consp string) (not (string< (car-safe result)) (car result))))
(let (res
(concat (org-split-string string) "\n")
(match-string-no-properties (cdr (car string)))
(if (re-search-forward (concat (regexp-quote (car result)))) ; check for match
(progn
(push (car result) res) res)
(cperl-string-split string res))
(cperl-string-split (nth 1 result)))))
(goto-char (point-min))
(goto-char (point-max))))
(defun org-html-to-formats ()
(let ((completion-ignore-case nil)
(composition nil))
(save-excursion
(if (re-search-backward "<</" ">" nil t)
(org-html-parse-text)
(org-html-display)
(insert (format-message "\\([^@]+\\)")))))
(with-current-buffer (org-list-split org-list-re)
(cond
;; FIXME: Should we set cperl's buffer to the original
;; buffer (or the list that contains it) so that cperl can view the list
;; contents of the modified file?
((org-string-nw-p string)
(let ((buffer-undo)
(info (org-with-wide-buffer (current-buffer)
nil (org-string-nw-p string))
(org-agenda-check-files (or org-agenda-link-link org-agenda-link-link))
(list org-agenda-link-link (or org-agenda-link-link string))
(org-agenda-add-link org-list-header))
(if composition
(progn
(add-text-properties (org-table-get-property :document-contents)
(table-get-header))))
(if org-agenda-link-link
(progn
(org-agenda-display)
(org-agenda-display))))))))
(defun org-html-parse-formats ()
(org-html-parse-formats)
======== SAMPLE 2 ========
(narrow-to-region (progn
(goto-char (match-end 0))
;; For a full list and buffer selection, consider
;; only one buffer.
(point-at-bol)))))
(save-excursion
(re-search-forward "^\\s-*:[^ ]\\s-*\\s-*$" nil t)
nil t)
(goto-char (match-end 0)))
(narrow-to-region (progn
(goto-char (match-end 0))
(forward-word-strictly 1))
(if (or (or (and (re-search-backward "^\\(?:" nil nil t)
(match-beginning 1))
(match-string-no-properties 1))
(re-search-forward
nil t (point-at-bol) nil t))))
(when (> (point) (1- start))))
(forward-line)))
(goto-char (point-min)))))
(defvar org-export-revision-hook nil)
(defun org-export-revision-set (entry &optional old)
"Non-nil if the current revision should be of the same name as entry with ERI.
For example: \"%{org-version-keys}\" means that version 2.5 is the version number.
If ERI is non-nil, use its version number to create a new revision.
If ERI is nil, use its version number to add any new entries to the
list."
(let ((old (get-text-property (point) 'org-list-old)))
(if (and entry (< entry version))
(progn
(save-excursion
(message "Eri version %s (%s): %s; "
(match-string-no-properties 1))
(goto-char (if (and old (match-end 0))
(match-end 0))
(re-search-forward "#*!" nil t)))
(goto-char
======== SAMPLE 3 ========
;; don't force it on non-default configurations
;; that can be found through the "\\." syntax.
(concat "\\$" (regexp-quote " ")))))
;; `-`' for `and' and `equal' means \\<let`<\\|equal_>='s is used to
;; bind the regexps
(unless (fboundp 'match-case-fold-search)
(let* ((match-type (oref regexp t))
(start (match-string 2))
;; Replace the first match with the expected string.
(case-fold-search nil)
(case-fold-search t))
;; If the match matches a function, it's put on a submatch
;; string so that regexp-* can make the matches match their substrings.
(if (match-string 0)
(progn
(when (string-match (oref regexp start t) match)
(progn
(setq match (string-to-signal match-string))))
(setq match (match-string 1))
(setq match-string nil)))
;; There's nothing to match.
(unless (string= match "")
(goto-char (match-end 0)))
(progn
(let ((result-type (match-string 0 pattern))
(case-fold-search nil))
(if (match-string 0 pattern)
(progn
(goto-char (match-end 0))
;; Regexp that matches an element of a non-default
(let ((case-fold-search nil)
(concat match-type
;; (`and' nil)
(concat ";"))
(concat "[%s]" pattern)
(setq match (concat match pattern)))
;; Regexp with case matching.
(let ((case-fold-search nil))
(dolist (v (oref v type)
(push v result-type))
(when (not match-type)
(push re (regexp-quote v start))
;; Look for an entry with the same argument as the
;; matching function, and use that as the result of the
;; match
(push (match-string 0 pattern) reval)
;; There's one that matches one, and that's matched
======== SAMPLE 4 ========
;; FIXME? Maybe add that?
(gnus-message-set-action
(concat "Add action for %s? "
(gnus-summary-articles-string))))
nil)))))
(defun gnus-summary-make-article-default (news &optional info)
(unless info (setq news gnus-summary-files))
(gnus-message "Making a summary...")
(let ((articles gnus-summary-articles)))
(if (stringp news)
(gnus-group-set-article info :user-mail-address)
(gnus-group-set-article gnus-summary-contents)
(list news articles))
(or gnus-summary-files
(gnus-summary-files (gnus-article-get-contents gnus-summary-files)))))
(defun gnus-summary-set-actions (articles)
"Set the functions and actions that are needed by the summary.
See `gnus-summary-actions' in gnus-summary."
(setq articles (delq nil articles))
(let* ((articles (with-current-buffer (get-buffer-create articles)
(gnus-summary-make-article-default
gnus-summary-files nil
gnus-summary-files))))
(when (file-exists-p articles)
(setq articles (delq nil articles)))
(gnus-summary-get-article article)
(delq nil articles))
(apply #'set-articles articles))
(defun gnus-summary-get-article (article)
"Return list of articles."
(mapcar (lambda (article)
(with-current-buffer
gnus-summary-files
(file-name-sans-extension (cons article gnus-summary-files)))
(goto-region (point-min) (line-end-position))))
(glist article gnus-summary-article)))
(defun gnus-summary-get-article-header (body)
"Return the article header for the current buffer."
(let ((headers
(concat
"\^[ \t]"
(format gnus-summary-article-header ":")))
(or headers
(let ((header (mapcar
(lambda(x) (get (car x) ":"))
":"))))
headers))
(let* ((name (gnus-file-attributes body)))
(and
(eq (car name) (car body))
(equal (format "(%08d) \t" name "\C-x")
(equal (format "(%c %03d) \t)")
(equal (format "(%c %04d) \t)")
(equal (format "(%u %a %l")
(format "(%r
"%file: samples-11600"
======== SAMPLE 1 ========
p.p.c++)
(defvar font-lock-variable-name-face-re
(font-lock-map-keywords
"*%b*" font-lock-default-function--symbol
"*" font-lock-def-list-face font-lock-def-list-face-" face font-lock-def-function-face font-lock-def-function-"
font-lock-face "bold" font-lock-font-lock-face--face font-lock-def-faces font-lock-face--face " font-lock-face+faceface-"
font-lock-dict-face font-lock-font-lock-dict-face font-lock-dict-face-" font-lock-dict-p-face-p font-lock-font-lock-dict-face-p
font-lock-max-string-face font-lock-max-face font-lock-max-face-p
font-lock-face-def nil font-lock-face-face-p font-lock-face-face-face-p
font-lock-face-max-face font-lock-face-face-p-face font)))
(defconst font-lock-dict-face-face font-lock-dict-face-face
"Font-lock dictionary faces.")
(defmacro font-lock-get-face (&rest forms)
"Replace face definitions or font-lock definitions and return faces.
Returns non-nil if face was used. Returns nil when face
was modified or replaced."
(dolist (form forms)
(cond ((car form)
;; Fontifier and font-lock.
;; If the font-lock-face is set to the face (so this face
;; can be easily changed to a font-lock face), returns nil.
(font-lock-define-face font-lock-face-face forms))))
(font-lock-face-default form))
(defmacro font-lock-get-face-list (&rest forms)
"Return faces of the list or nil if face was used."
(dolist (forms forms)
(cond ((cdr forms)
(font-lock-set-face-list forms nil nil font-lock-face-list
nil nil nil)))
((font-lock-font-list-default form)
(t form)
(add-hook 'font-lock-font-list-change-functions t nil form)))
(when font-lock-face-definitions
(goto-char from-point)
(while (and (not from-point) (not font-lock-definitions))
(if (re-search-forward font-lock-face-definitions until no-regexp)
nil ; look for font-lock-like defalias entries
(search-forward "|" nil)) ; look for font-lock-style defalias.
(when font-lock-style-face-definitions
(font-lock-font-set-face-list forms))
(let* ((face-defname
(save-excursion (insert face-defname))
(font-lock-font-set-face-list forms)))
(setq font-lock-face-definitions font-lock-face-definitions))
======== SAMPLE 2 ========
p (math-sub 2 3))))
(math-expand-pos (nth 1 math-expr-matches)))))
(defvar math-expand-pos) ;; variable set at position 0
(define-key math-expand-pos-function 'math-forward-symbol)
(define-key math-expand-pos-function 'math-point-symbol)
(defun math-expand-left (pos)
(math-forward-left)
(setq math-expr-matches math-expr-matches))
(defun math-expand-top (pos)
(setq math-expr-matches math-expr-matches))
;;; Indentation symbols
;;;
;;;
(defun math-extend-indent (expr)
(if (Math-read-expr) (setq expr (nthcdr expr math-expr-matches)))
(if (not (math-neg-indent-expr expr)) (math-expand-indent expr math-expr-matches)
(math-extend-indent expr)))))
(defun math-expand-precedence (string val)
(math-extend-indent string val)
(or (math-expr-matches
(math-lookup-var val '(nil val)))
(and (not (math-neg-indent-expr val)))
(math-extend-indent string val)
(let* ((val (math-extend-indent val math-expr-matches))
(valval (math-add-var val 'math-expr-matches)))
(or (math-expr-matches (nth 3 math-token))
(math-lookup-var val math-expr-matches)))
(setq math-expr-matches
(or val math-expr-matches))
(if math-match-1
(prog1 (math-div-expr math-match-1 val)
(math-div-expr math-match-1 val)))
(when (math-matches-expr val)
(math-expander math-matches)
(setq val (math-extend-indent val math-expr-matches))
(if (Math-read-expr) (setq val (nth 2 math-expr-matches)))
(nth 3 math-expr-matches))
(while (and
(math-expression-matches (list (nth 3 math-expr-matches)))
(math-expr-matches val))
(or (math-expression-matches
(math-string-matches (car math-expr-matches))))
(error "No indentation found"))
(if (not (math-expr-matches math-expr-matches))
(setq val (nth 2 math-expr-matches)))
val)))
(defun math-sub (x)
(if (math-expr-matches x)
(progn
(setq math-expr-matches (nth 2 math-token)))
1)
x))
(defun math-neg-indent (symbol)
(if (or (math-expr-matches math-expr-matches)
(math-equal (math-sub math-neg-indent (nth 2 math-token
======== SAMPLE 3 ========
p.i)
(setq kwd nil)
(goto-char (1+ 1))
(when (string-match-p "(\\([0-9][[]:)]\\)")
((eq (re-search-forward "\n\\([^$][:.*\\]\\)"
(char-to-string (match-end 0)))
(if (save-match-data (not (eobp))))
(if (string-match-p
"\\([0-9][[]:]" nil t)
(buffer-substring-no-properties
(progn (nth 2 (symbol-name (buffer-substring (point)))))
buffer-read-only t)))
(setq kwd nil)
(when (string-match-p "!" kwd)
(goto-char (1+ (symbol-name (buffer-substring (point)))))
(setq kwd nil)
(when (string-match-p
(char-to-string (match-end 0)))
(goto-char (1+ (symbol-name (buffer-substring (point)))))
(setq kwd nil)
(when (or (not vcursor-at-point)
(< (point-max) vcursor-at-point))
(goto-char (1+ pos))))
(setq pwd (buffer-substring pwd (point)))
pwd))))
(setq pos 'p (point))
(setcdr pos (if (eq (point) t)
(point-min) t))
pos))
;;;###autoload
(defun vcursor-at-point (pos start)
"Test that point is at POS at START.
This test is for `insert-buffer' and for `insert-buffer-continued'.")
;;;###autoload
(defun vcursor-at-line (&optional start)
"Run `insert-buffer-continued' during insertion."
(interactive)
(insert (or start " " (buffer-substring start))))
;;;###autoload
(defun vcursor-at-buffer-continued (&optional start end)
"Run `insert-buffer' in the current buffer without asking if the buffer
has already been inserted.
Start is either nil or a string
======== SAMPLE 4 ========
p)
(goto-char (point-max))
(unless (and (nth 1 (car (cdr (nth 2 (car (cdr (cdr (car (cdr (cdr (cdr (cdr (car (car (car x))))))))))))))
(cdr (cdr (cdr (cdr (car (cdr (car x))))))))))))
(point))
(forward-line -1))))
;;; Change from t to `line'.
(defun t-line (char-pos)
"Treat CHAR-POS as the current character or line."
(interactive "d\nP")
(or (buffer-substring-no-properties (point) (point-max)))
(beginning-of-line)
(indent-to (1- t))
(beginning-of-line)
(indent-to (1- t))
(forward-char)
(comment-ind
((looking-at "[ \t\n\r\f]*[-a-zA-Z]")
(cond ((looking-at "\\*^*\n[ \t\n\p>"))
((looking-at "^")))))
;;; t-line
;;; lisp-indent-indoc
;;; c-def
;;; d-def
(cl-defmethod make-indent-column ((column 1))
(if (eq (char-after (char-after (1- column))) ?\C-\n)
(add-to-list 'column-def
(list
(dired-define-indent
(save-excursion
(goto-char (1+ column)))
(point-min))
nil) "indent"))
(dired-get-char-indent nil 'indent))
(declare-function vhdl-indent-col (col &optional first-word last-word)
"Handle the character at point."
(line-end-position))
(save-excursion
(beginning-of-line)
(unless last-word (goto-char (point-min))
(forward-line (min (2- (point)))
(save-excursion (beginning-of-line) (if (memq last-word last-word-re)
(1- (point)))))))
(if (assq last-word last-word-re alist) (forward-line))
(setq first-word (buffer-substring (point-max)
first-word)
first-word (point)))
(let ((column (make-indent 1))
(old-offset (point)))
(dired-set-indent-mode)
(beginning-of-line 1))
(let ((old-offset nil) old-offset)
(while old-offset
(goto-char
"%file: samples-11500"
======== SAMPLE 1 ========
|
(nth 2 (car newtype)))
(* (nth 1 (car newtype)))
(* (nth 1 (car newtype))))))
(defun vhdl-completiontable--complete-completion-field ;
"Completion table for vhdl-completion table.
Completions will be completions to be
complemented. As a prefix argument, a valid completion prefix can also be
-- todo if a given prefix argument is not a prefix.
-- todo if the given prefix argument
includes the specified file.
It is a list of completions and a symbol, the string corresponding
to the item being complemented.
When in the buffer, the command `vhdl-completions'
will complete this completions.
The optional argument TOOB is a symbol representing the default todo
and also the current todo; if any of the symbols is not a
symbol, the `vhdl-completions' command returns nil.
The `vhdl-completions' command will return nil instead of listing."
(mapc
`(define-key map [nil] [nil] ...] 'vhdl-completions))
"Vhdl completion buffer."
nil nil t)
(provide 'vhdl)
;; Local Variables:
;; define-key map "C-y" prefix keymap
;; End:
;;; vhdl.el ends here
<|endoftext|>;;; vhdl.el --- vhdl implementation
;; Copyright (C) 2002-2005, 2008, 2006, 2009 Free Software Foundation,
;; Inc.
;; Author: David Gillespie <goddag@idge.com>
;; Maintainer: emacs-devel@gnu.org
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; This file defines various features and utilities
;; to handle vhdl (VHDL2). It also provides for a VHDL interface
;; from VHDL.
;;; History:
;; FIXME: Why does this require a global variable? A VHDL2, VHDL3
;; ; `vhdl-vhdl-p' is used in the vhdl2.el files.
;; To override the global value of `vhdl-vhdl-p' a value of
;; `var-value-default', in the file `vhdl-key.el', is needed.
;;
;; A set of variables that describes vhdl features is defined
;; in `vhdl-defstruct'. If you set this variable after this
;; entry in a buffer, you can edit the entry in `vhdl-key.el'.
;; The following variables are provided
======== SAMPLE 2 ========
|||
;;;###mh-autoload
;;
;; M-h: :help Help string to call to interactively, or nil.
;; Also available in the mode's mode-specific
;; file, under `mh-mode'. By default, the line-number and the prefix,
;; and/or a
;; ;; <:help (t): this is a handy function for finding
;; comments, etc. By prefixing the
;; line-number with
;; (when (eq (regexp-opt t) 'tbl)) this function searches for
;; <:help <:level <:prefix The line number
;; or `:help Specifies exactly where the line number
;; really starts, so that you can
;; not need to enter comments as this
;; can sometimes appear near a comment.
;; Note that this function will usually return nil when it returns a
;; interactive expression.
;;
;; The rest of this function defines how it will interactively
;; find the right comment or symbol and also some other way to
;; query the user.
;;
;; The variables `mh-ignore-comment-indications' and
;; `mh-ignore-function-comment' define special ways to set
;; `mh-indirect-comment-handling', `mh-indirect-comment-start' and
;; `mh-indirect-comment-end' to ignore comment lines or symbol lines or
;; `mh-indirect-comment-begin', in order to give us a quicker way to tell
;; exactly where the point-line is, and what message should be sent.
;;
;; Note that these variables are useful only if you set them here, but
;; they don't have any direct effect in any way, see the footnote
;; for details.
;;
;; To specify how to use this function to do some other things, such as the
;; most specific function, you may
;; set the variable `mh-function-symbols' and the variable
;; `mh-symbols-only' or set `mh-symbols-only' to nil to not
;; do the exact thing that `mh-symbols' does, such as `mh-comment'.
;;
;; The variables `mh-indirect-comment-handling' and
;; `mh-indirect-function-comment' define special ways to
;; query the user.
;;
;; However, you should never specify this function so that
;; the user will never be able to access any comment lines.
;;
;; I can't even put the value of `mh-indirect-comment-handling'
;; to nil, since this will not set any variable `mh-indirect-comment-handling'
;; and the value of `mh-indirect-function-symbols', so don't get confused
;; for it.
;; For example, see:
(defun mh-ignore-comment-indications (line-number)
(when (eq (car line-number) 'int-only)
(cond
((null (car
======== SAMPLE 3 ========
|\n")
"[&\""] "[]")
(message "\n")
(message "\n")
(narrow-to-region (point))
(let (p) (goto-char beg) (while (<= p (point) nil t))
(setq p (point))
(while (<= (= (point) beg) (point-max))
(recenter t) (message "--%s" (nth 2 arg)))
(goto-char beg) (while (<= (point) beg)
(while (<= (point) p)
(unless (<= p (point))
(narrow-to-region (point))))
(when (and (eq t arg) (nth 1 arg))
(message "The following: ")
(set-buffer arg)
(kill-region (point) (1+ arg))
(forward-line 1) (setq p (point)))
(message "--- " p))))))
(defun c-backward-sexp (&optional arg n)
"Move forward to the beginning of line, not `c-bounds'."
(interactive "r")
(if (and (not c-bounds)
(= (line-beginning-position) c-bounds))
(error "Can't move to beginning of bib")
(if (not (bib-search-forward 'line-beginning t 'backward-sexp))
;; In a c-backward-sexp c-search-forward, this line must end
;; before point.
(error "Could not move to beginning of c-bounds"))
(if (and (not c-bounds)
(< (line-end-position) t))
(error "Can't move to beginning of c-bounds"))
(if (and (not c-bounds) (= (line-end-position) bib-search-bounds))
(error "Can't move to beginning of c-bounds"))
(if (< (line-end-position) 1)
(error "Cannot move to beginning of c-bounds"))
(with-silent-modification 2
(let (n)
(kill-region (point) (- (marker-position (point))) c-bounds))
(goto-char (point-max))
(while (<= (point) (point-max))
(setq n (point-marker)))
(goto-char (point-max))
(delete-region (point) (- (marker-position (point))) c-bounds)
(move-to-heading c-bounds (- n (marker-position (point))))
(forward-line n)))
(when org-bib-search-forward
(while (- (point) (/ (marker-position (marker-position))) c-bounds))
(delete-region (point) c-bounds)
(goto-char (point-max))
(delete-region (/ (marker-position (marker-position))) c-bounds)
(goto-char (point-
======== SAMPLE 4 ========
|)
(save-excursion
(goto-char (point-min))
(if (looking-at "[-]")
(forward-char 1)
(setq-char-if-paragraph t))))
(forward-char 1)
(c-forward-line (point))
(setq-char-if-paragraph t))))))
;;; User command line
;; Note: It is the same command code that Emacs sets if the user
;; enters the user file
;; ;; sets `interior-mode'. This sets all the Emacs variables
;; ;; as `interior-mode'.
;;
;; The variable MODE variables are all for a given mode
;; ;; except that mode variables are only set if they are in the Emacs
;; ;;
;;
;; mode. the variables set by the user.
;;
;; The user commands are those functions specified by a
;; comment.
;;
;; You can use the variable `interior-mode' to customize the
;; mode in Emacs Lisp mode. The following commands are
;; ;; available to you, but they are not needed in Emacs Lisp mode.
;;
;; This command sets MODE to use the mode for all commands (unless specified by
;; \"interior-mode\" argument if the user leaves MODE). It also
;;
;; emacs-mode defines modes for `interior-mode'
;; for variables (e.g. variable-completion-mode); e.g. this
;;
;; can run Emacs Lisp in a way that MODE and MODE-C/MES will
;; be not the same. A variable called \"interior-mode\" can be the same
;; thing if either of them sets MODE, E.g. if the user enters
;; \"interior-mode\".
;;
;; Note that MODE is also a symbol; it is used,
;; as follows:
;;
;; t
;; (interior-show)
;; Use MODE-C/MES to view the buffer.
;;
;; `interior-mode-setup' will start the default Emacs mode
;;
;; setting of the environment variables if MODE is set.
;;
;; (This is only used if MODE-C/MES is set to use `interior-mode')
(defvar interior-mode-list nil
"List of minor modes that Emacs sets to use the current buffer.
This is used automatically.")
(defvar interior-mode-mode-list
'((mode . "M")
(sub-mode . "M")
(mod-mode . "M")
(mode-symbol . "M")
(mode-sexp . "M")
(mode-if . "M")
(mode-local . "M")
(mode-local-symb . "M")
;; Use of M-B
(mode . "M-B")
(mod-mode . "M-B")
(mod-if-if . "M-B")
(mode-local . "M-B")
(mode-local-symb . "M-B")
(mode-local-if-if-if-if-if-if-if-if-if-if-if-if-if-if-if-if-if-if-if
;; :style toggle
;; (:fore
"%file: samples-11400"
======== SAMPLE 1 ========
the source code may have changed. This is an error."
(setq norec-mode-line (cdr norec-mode-line))
(setq file-name (cdr file-name))
(setq file (cdr (assq 'file-name file-name)))
(if (re-search-forward "(\\s *\\(d\\)\\)?[0-9]" nil t)
(setq file-name (match-string 1))))
(defun norec-set-buffer-file-name-or-dir (filename)
"Set a buffer from FILE in the current process."
(interactive)
(setq filename (concat filename "-" nil))
(gnus-set-mode-line 'inhibit-point)
(setq file (cdr file-name)))
(make-variable-buffer-local 'norec-mode-line)
(make-variable-buffer-local 'norec-buffer-file-name-or-file-name)
(make-variable-buffer-local 'norec-file-name-or-file-name)
(make-variable-local 'norec-mode)
;;;###autoload
(defun norec-set-buffer-filename (filename)
"Create a buffer from FILE in the current buffer."
(interactive)
(goto-char (point-min))
(replace-match "^\\0-*" nil t c)
(set-buffer "*norec*")
(make-directory "Norec\n")
(norec-set-buffer))
(defun norec-set-buffer-directory (filename)
"Set a directory from FILE.
A `default' directory is created from the file in the current process. If you want to
make this file or copy the existing buffer, add the `norec-file-directory-alist'
variable to your init file."
(interactive "P")
(and (setq filename (cd /path/to/dired-file)
(directory-files (expand-file-name filename)))
(setq directory (expand-file-name filename)
default (directory-file-name (concat directory (expand-file-name filename))))))
(defun norec-dir-to-directory (files)
"Make `directory-files' or `directory-files' and use the file.
FILES can be directories, namespaces, subdirectories such as .*,
or local variables, etc."
(interactive)
(let ((directory-files (expand-file-name (file-name-directory files)))
(dir (car directories))
(args (nreverse directory-files))
(file-name-full-name (cdr directory))
(args2)
(files (file-name-nondirectory file)))
(when files
;; Do directory change
(let* ((mode-name (file-name-directory (cdr files))))
(setq buffer-file-name (file-name-nondirectory file)))
(while (not (eobp))
;; Directory directory must have this file
(or (directoryp directory)
;; The default can be a number of "~/.*/usr/local/bin/" suffixes
;; which are all useful, in that order.
;; Let's set up one of them and try to copy over
;; the directory.
(setq args2 (list (concat filename files))))
(if (and (string-match "~@" args2) (string-equal (substring args1 args2))
======== SAMPLE 2 ========
the file.
Some of them:
- * Fax file. The name can contain space, as in
- * Gnus, which allows the user to add an image from a source file
* * Gnus
- * Gnus URL URL. When `gnus-show-image-urls' is set,
* images can also be shown as URLs by
- * Faxfile. Gnus does not allow this, because
* Faxfile is a directory."
:group 'gnus-view-file
:type 'regexp)
(defcustom gnus-image-files-p-alist
nil
"Non-nil means Gnus will search for the file that has an image file extension (e.g.
`image-url-extended' or `image-url-extended-p'). An optional value of t means
to allow the user to alter this variable in the init file.
If the argument TAB is non-nil and this is a prefix, then Gnus will
search for images for an additional prefix, using the corresponding file name,
instead of searching either for an image file extension, or
for the extension of the file.
Note how the argument to TAB is not treated as non-nil; Gnus will
search for images for an image file.
This variable will be used to specify whether to use image filtering on images, and
whether to treat images as PNG images or not.
If nil, Gnus will search for images in the specified file name.
If the argument SELF-EXTENSED specifies a path for the image file,
use it instead of specifying an image extension.
To define the argument for this variable:
(define-key gnus-cache-argument 'image-url-extended)
(define-key gnus-cache-argument 'gif-url-extended)
`(define-key ,default-function ',(mapcar 'lambda e (image-url-ext)
image-url-ext)))
(or (and 'image-url-extended "")
(error "The image extension `gnus-image-files-p' doesn't exist"))
;; If you use an image file extension (like a PNG image,
;; or a .iso image), then use the file path rather than the file name,
;; since it is easier to see if there is an image file for images when
;; the extension is not a file name. Note that an image file extension
;; may not appear if the file path, with the same default file name or directory
;; as the argument list, is different. If your file is a .png (or
;; a .jpeg file) then the .jpg or .jmp images are included in
;; `gnus-image-file-expansion-alist'.
;; If the image file extension is a file name, you can use it as a prefix
;; name; see `gnus-image-file-name-regexp' and `gnus-image-file-expansion-alist
;; entries.
;; These entries are inserted at the end of the file.
(if (and gnus-image-path
(= (length image-url-extended)
(not (memq (car image-url-regexp) '(< . .>))
gnus-image-path))
(gnus-image-file-name (gnus-image-path image-url-extended))
image-url-path)
(and gnus-image-directory
gnus-image-path image-url-extended)))
;;; Variables used for `gnus-show-image-properties'."
;; ============================================================================
;;; Code:
(dolist (group (plist-get (make-list "gnus-show" 'list))
(let* ((default gnus-image-alist)
======== SAMPLE 3 ========
the title with this line:
" title ")
where t is a \"#'\" character. Note: The list of arguments to \"#<string>\" also includes \"#<string>\" (if any)."
;; Don't bother with \"#<char>\" in front of the text, as it is too long.
(let* ((string (car (cdr (cdr (setq string (car string))))))
(c-string-to-string string "[#<char>]")))
(c-make-char c-word-list
"#<char>] " string)))
(defun c-c-forward-word (n)
"Convert C-C-X forwardword to its corresponding C-X word.
This function looks for a sequence of numbers which have `number' in the
symbol name,
and compares the number at the left or right positions
and the number at the right and left position."
(interactive "^v\nP\
begin C-x\nP")
(c-move--nreverse c-c-word-regexp t)
(cond ((not (c-isearch-on-previous-word)) ; non-nil means the
(or (eq (car (car n)) c-isearch-on-next-word) ; false.
nil)
(c-isearch-on-previous-word))
(t ))
(c-forward-word t)
(c-c-forward-whitespace s)
(c-isearch-on-whitespace
(c-c-point-in-region c-c-word-regexp nil)))
(defun c-c-forward-whitespace (n)
"Convert C-C-Y forwardword to its corresponding C-Y word.
This is probably a mistake, as the `number' argument is only one character.
However, this function looks for a sequence of numbers which should not be
converted to the following C-Y word,
using a different argument, and compared to such
number. (This does not use C-symbol when comparing to a string; in
that case it's a mistake.")
;;;###autoload
(define-minor-mode c-c-forward-word-hook
(interactive "^v\nP\
begin C-x\nP")
(c-c-forward-word nil)
(c-c-forward-whitespace t) ; false in MS-Windows
(c-c-forward-whitespace nil nil c-c-end-of-whitespace))
(defvar c-c-c-lisp-indent-info (&optional arg)
"If non-nil, `c-c-lisp-indent-info' is put at the beginning of an entry in
the Emacs Lisp Language Specification. Otherwise use `c-c-lisp-indent-set'.
A value of `c-c-lisp-indent-set' controls how the language's indent code is used.
A value less than this is used to define the language (e.g. to edit it with another
function or with a macro rather than using a function). You can't use this
variable unless you know how to use the language.
For more information, see `c-c-lisp-indent-mode' in the manual.")
(define-minor-mode c-c-c-defalias-p "c-c-"
"Possible values: t (if `c-c-indent-set' is also nil), `c-c-defalias-mode' (not `c-c-defalias-mode'),
`c-c-defalias-region' or `c-c-start-with-defgeneric'.")
;;;
======== SAMPLE 4 ========
the
(while (< (1 d)
(setq buf (get-file-buffer (car d))))
(if (eq (car buf) 'pending)
;; We might delete the file that's already been
;; written, or if the file has changed, create another
;; `pending' file (if there was one)
(setq n (if (eq (car buf) "delete") buf nil)
;; No need for changing the file name.
buf (cons (cons (cons (buffer-name) (current-buffer)) buf)
nil ))
;; If there were no files to write, leave the file list alone.
(if new (delete-file buf))
buf
(setq n (buffer-nondir-list)))
(message "No new files to write")
(erase-buffer)
(kill-buffer buf)
(setq n (1+ n)))))))
(setq n (1+ n))))
(declare-function org-babel-show-end-tag "org-babel-insert-end-tag" ())
(declare-function org-babel-beginning-of-element "org-babel-set-element")
;;;***
;;;### (autoloads nil "comint" "org/comint.el" (0 0 0 0))
;;; Generated autoloads from comint
(push (purecopy '(org-babel-comint-mode-map org-babel-comint-map))
(push (purecopy '(org-babel-comint-mode-map (org-babel--mode-map)) "org-babel")
(defvar org-babel-comint-map nil)
(provide 'org-babel)
;; Local variables:
;; generated-autoload-file: "org-loaddefs.el"
;; End:
;;; org-babel.el ends here
<|endoftext|>;;; org-babel.el -- Customize `org-babel.el' file
;; Copyright (C) 2002-2019 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten.dominik@gmail.com>
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://
"%file: samples-11300"
======== SAMPLE 1 ========
modification-context-map [list]
(let* ((map (make-sparse-keymap)))
(define-key map "g\x2[\t]*" 'cperl-menu-menu-map)
(define-key map "c\x2[\t]*" 'cperl-menu-keys-map)
(define-key map "\t" 'cperl-menu-mouse-2-line-mouse-mouse-map)
(define-key map [down] 'setq-menu
'cperl-menu-mouse-3-line-mouse-mouse-mouse-map)
(define-key map "\t" 'cperl-menu-mouse-3-line-mouse-mouse-map)
(define-key map "\r" 'cperl-menu-mouse-mouse-map)
map)
"Keymap used in keyboard menus.")
(defvar cperl-mode-map
"An alist of keymap and state-specific state definitions.
They should contain one or more arguments, and not have the same
keymap definitions."
:vars
(let ((map (make-sparse-keymap)))
(define-key map [down] 'setq-menu
'cperl-menu-mouse-mouse-map)
map)
"Map used in keyboard menus.")
(define-derived-mode cperl-mode mode-local-map
"Keymap for cperl mode.")
;;;; Utility functions
;;;; (convert-keymap-parent-keymap-to-cperl-map-key-map)
;;;###autoload
(put 'convert-conversion-conversion-options 'menu-bar-define-generic-variable
;;;###autoload
(define-derived-mode cperl-mode mode-local-map
"Major mode for editing Perl mode's conversion routine.
This buffer is used as a window.
If you use a mouse or keyboard for Emacs, this will help you.
If called interactively, this buffer will display the message
prompting you to enter a different format to where you'd rather go.
See the \"Multiturpose Usage\" section in `cperl-mode' for more
depth and a description of this buffer."
(require 'convert-conversion)
(set (make-local-variable 'cperl-mode-map)
(cons (progn
(insert (format "%s %S/%s"
'(?\t ?\ ]) (concat " *" (substitute-key-definition
"[" "" "" "]")) t)
(display-buffer display-buffer))
(setq converted-conversion-conversion-options
(cons '("" (match-string 1) "")) t)
(kill-buffer converted-conversion-conversion-options))))))
(defun cperl-mode-setq-modes (functions)
"Set FUNCTION-DESCRIPTOR-MAPs and MODE-MODE-CONTROL-MAPs to defaults in FUNC-DESCRIPTOR-MAP.
FUNCTION-DESCRIPTOR-MAPS can be set via `cperl-keymap' or `locate-keymap'
in a key-binding."
(interactive "P")
(let ((cperl-use-local-map-functions 'menu-bar-if-keymap)))
(funcall
======== SAMPLE 2 ========
mod-save-selected nil
"Save the Emacs buffer using this list."
(mapcar (function :key-spec 'list
(mapcar (function :tag "list") list))
(car list))
list)
(if (save-excursion
(goto-char (point-min))
(search-forward "\\(" nil t)
(replace-match "\n\t" t nil nil))))
(if (and (eq (current-buffer) (buffer-name))
(not (eq (car-safe (cdr (car (car (buffer-name)))))))
(not (car (car (cdr (car (car (car (cdr (car))))))))))
nil
(error "This buffer does not include buffer "))))
list))
(defun org-mode--modes-list-regexps (parts parts)
"Return all matches for `org-mode-prog-regexp'."
(when (or (listp parts)
(< parts 4))
(nconc (match-string 1 parts) (substring parts 0 -2))
parts))
(defun org-mode--modes-find-regexp (match)
"Find the next match for `org-mode-grep' regexp matching regexps.
The process of searching all matches for `org-mode-grep' regexps
will be started by replacing them with the correct match to use. With
`org-mode-restore-regexp-face', replace a single match with a regexp matching
the same regexp as the current face. This function is needed if
`org-mode-" is nil, otherwise `org-mode-grep' is t."
(cons match (format "%s%s" matches 1 (org-mode-grep))))
(defun org-mode-grep-regexp (match)
"Find regexp matching `org-mode-grep' regexp matching
previous match to use for `org-mode'."
(cons match (setq match nil))
(when (assoc matches org-mode-grep-regexp-alist)
(dolist (match (lambda (x) (org-mode-grep (car x))))
(setq match (cons match (mapcar
(mapcar 'car x) match))))
;; Match is not set yet.
(let (f)
(when (and (assoc match org-mode-grep-regexp-alist)
'string-matching)
;; Add match if match matched, then delete regexp.
(rename-match match t))))))
(defun org-mode-rebuild-regexps (&rest matches)
"Rebuild regexps in Emacs."
(save-excursion
(let (e (save-restriction
(let* ((f (car (cdr (car matches)))
(or (not (eq (car (nth 2 f))) "!"))
(setq regex
======== SAMPLE 3 ========
mod-find-next-function
"Return the current line number for the next search.
The search is in a mode line, which will be shown on mouse
press. If the current line number is greater than the current window position
of the next search window or point at point, then it is narrowed
down to the level of this line number so it is shown on the next window.
If the current window is less than the level of window
of the next search window or point at point, then it will be shown
on that window.
Note that for each window in the current window, the depth
of the buffer or cursor position of the next search window is
not affected. The search must be expanded in that window.")
(autoload 'srecode-compile-search-functions "recode-compile")
(autoload 'srecode-compile-command "recompile")
(autoload 'srecode-compile-help-functions "recode-compile")
(autoload 'srecode-compile-string-functions "recode-compile")
(autoload 'srecode-compile-string-args "recode-compile")
(autoload 'srecode-compile-in-menu "recode-compile")
(autoload 'srecode-comint-init "recode-compile")
(autoload 'font-lock-keywords "(^ \\)\\([^ \t]*\\(.+\\)/\\([^ \t]+\\)\\'" nil "font-lock-keywords-regexp: \")
;;;###autoload
(defvar srecode-mode-specific-variables nil
"For each variable in the `standard-mode-alist', return a list of them.
Variables can be used to set `srecode-current-display-mode' and `srecode-current-display-font-lock'
variables. If these are set multiple times and they are set in a single file
or buffer, their lists are sorted by default, which is a good
pattern.
If you add a new line with `("\n" at the beginning or at the end") to the `srecode-current-display' and
returnnil", you can then edit the `current-display' variable."
:type 'set
:group 'srecode-mode
:group 'srecode-font-lock-keywords)
;;;###autoload
(defvar srecode-regexp-alist
(concat srecode-regexp-alist (list "{" "[\\([0-9]+\\(\\)\\]*\\(\\[[0-9]+\\]\\)\\]"))
"The entries for regexp-alist variable srecode mode variables.
`srecode-mode-alist' uses `srecode-default-regexp',
`srecode-default-regexp', `srecode-global-regexp',
`srecode-all-comments-only-mode', and
`srecode-mode-alist' uses `srecode-use-local-regexp'.
(defvar srecode-mode--tag-symbol (substring-no-properties nil t))
;;;###autoload
(defcustom srecode-mode-symbol nil
"If the default syntax of a symbol is `symbol', then it must be set directly
through srecode-mode-alist.
If the default syntax of a variable is `symbol',
then it must be set directly through srecode-mode-alist.
The syntax of a variable and its variable-local variable is
the property symbol (which is then used to set variables in SREcode files.
When srecode uses the `default-syntax' property as the syntax of
a symbol, then
it sets `default-syntax' to what it uses. This way, srecode
will check whether it has a property. In particular, if it does not, it
should set that variable.")
:type 'symbol
:group 'srecode-mode
:group 'srecode)
(defvar srecode-mode-defs nil)
(defvar srecode-mode-function nil)
(defvar srecode-mode-mode-symbol nil)
(defconst s
======== SAMPLE 4 ========
mod))))
(setq (cdr (assoc (get-text-property (point) c-default-display-buffer)
(window-property-mouse-pos
(point))
visible-font-lock-keywords)))
text)
;; FIXME: this should not be called on a function which is called
;; before the value of the variable has been set.
buffer-before-goto-edit-arguments)))
(message nil (point))))
;; Do some sort of display.
(set-minibuffer-output buffer-undo-list)
(setq buffer-undo-list nil))
(message "%s: buffer %s has deleted file %s" buffer-undo-list)
(set-buffer (get-buffer-create buffer-undo-list) buffer-undo-list nil))
(defalias 'window (with-selected-buffer buf)
"Change what window currently displays.
If nil (a buffer whose value is `scroll-up') it is removed. If a buffer with a
preferences variable has no value, then it is used instead.
When called after some type of operation, it is applied to the same
environment and so on. After this it is not used during the rest of the
buffer.
\(fn &optional EVENT EVENT &rest ARGLIST &rest WINDOW DATABASE)"
(unless (eq (window-parent buffer) ?#)
(push-mark)
;; Try to save the window with current value from this buffer.
(save-window-excursion
(narrow-to-region (point-min) (point))
(let ((overlay-at-point-change t))
(overlay-insert
(substitute-command-keys
'call-interactively 'buffer-name (window-buffer)
text nil t overlay-at-point-change t))
,@header buffer-name) ;; Insert the text here as a string
;; or just replace that. This will save the frame
;; from the current buffer. It is also better to use
;; the buffer `overlay-insert' instead.
(replace-with-text-property overlay-at-point-change text overlay-at-point-change))
;; Don't replace any existing text. If it can be saved by
;; `overlay-insert-text' there is no reason not to use the overlay.
(overlay-insert overlay text overlay-at-point-change (overlay-get overlaid-at-point)))
;; Else save the frame if it can be saved by `overlay-insert'.
(overlay-insert overlay text overlay overlay-at-point-change overlay (overlay-get overlay-at-point-change)))
;; If we cannot find a window which has the value
;; from this buffer and cannot replace the text it has saved,
;; use `window' as the buffer.
(if (equal overlay 'buffer)
(setq overlay (get-text-property
"%file: samples-11200"
======== SAMPLE 1 ========
(if (eq (char-before) ?\s)
`(?\s . ?s)
(mapconcat 'number (number-to-string ?\s)) " "))
"")
(if (string-match (substring char 1))
(setq b t)
(mapc (lambda (s)
(setq b t))))
(if (not (eq (char-before) ?\])
(progn
(delete-char 2)
(delete-char 3)
; ``(,`,
(when (or arg (eq (char-before) ?\s)
(char-to-string ?\s)))
(insert " "
(current-buffer))))
(save-excursion
(delete-region (point) (progn (beginning-of-line)
(if (and (looking-at-p (char-to-string))
(char-to-string ?\s)))
(current-buffer)))))
(goto-char (match-end 0))
(message "Buffer: %s" (buffer-name))))))
;; Check if we can make a string on the right-hand side.
(save-excursion
(let ((buf (current-buffer)))
(delete-region (point) (progn (forward-char)) (not (bobp)))
(unless (null buf))
(insert "\n")
(switch-to-buffer buf)))
(insert " ")))
;;(math-def-macro math-find-math-result (expr test1 mathp)
;;
======== SAMPLE 2 ========
(pcase (cadr (oref (nth 2 entry)))))
(list '(?a . ,(nth 1 entry) ; . ,(oref (oref (nth 2 entry)))))
;;; TAB
(defsubst gnus-tag-to-delete-to-marker (tag)
"Return t if TAG is t at point.
See `gnus-tag-to-delete-to-marker-function' for a description for the
method."
(if (vectorp (car (gnus-trim tag))) (gnus-tag-to-delete-to-marker tag))))
;;;
;;;
;;;
;;;
(defun gnus-tag-update-to-marker (tag)
"Update `tag' tag to mark the tag at point.
Note that if a tag has been deleted from `gnus-tag-to-delete-to-marker',
it is also updated."
(interactive "@e")
(let ((new (car (tag-to-delete-from-marker tag)))
(old nil))
(while (not old)
(push (list (car (gnus-tag-to-marker new)))
gnus-tag-to-deletion-flag))
(and (equal old gnus-tag-to-delete-to-marker)
(equal old gnus-tag-to-delete-to-marker)
(equal old gnus-tag-to-disassociate-flag))
(when (gnus-tag-to-delete-to-marker "")
(let ((old (car (gnus-tag-to-delete-from-marker tag)))
gnus-tag-to-delete-to-marker))))
;;;
;;;
;;;
(defun gnus-tag-to-get ()
"Get TAG at point."
(let ((current (car current)))
(and gnus-tag-to-delete-to-marker
(not (eq gnus-tag-to-get-flag gnus-tag-to-get))))
(and gnus-tag-to-get-flag
(eq gnus-tag-to-get-flag gnus-tag-to-get))
(push (car current) gnus-tag-to-get)))
;;;
;;;
;;;
(defun gnus-tag-to-delete-from-marker (new gnus-tag-to-get-flag)
"Delete TAG which has been marked with `gnus-tag-to-get-flag'.
A tag which has been changed is restored as well."
(cond ((not new) nil)
((gnus-tag-to-delete-from-marker nil) nil)
(t nil))
(while (not (eq gnus-tag-to-get-flag gnus-tag-to-get))
(push (list gnus-tag-to-get-flag gnus-tag-to-get-flag)
gnus-tag-to-to-get-flag))
(setq gnus-tag-to-get-flag gnus-tag-to-get-flag)
(gnus-tag-to-do-delete
gnus-tag-to-do-delete)
(gnus-remove-from-marker gnus-tag-to-do-delete))
(when (or gnus-tag-to-get-flag
(and (eq gnus-tag-to-get-flag gnus-tag
======== SAMPLE 3 ========
(defgroup viper-help-regex-regex "Regexp Help"
"A Lisp Regex which reuses help elements in a specific search, regardless of
the current value.
The function returns one `string' regex to search using.
See `viper-help-regex-alist'."
:type '(repeat symbol)
:group 'viper-help-regex)
(defcustom viper-regex-search-buffer "*EUR*"
"The string to use the regexp searching for the current search."
:type '(choice (const :tag "no match, save search buffer" "All of a match")
(const :tag "Save buffer" "Include match")
(repeat :tag "Save buffer" "Exclude match and search for match")
(const :tag "None match, save search buffer" "Only match")))
(defcustom viper-regex-buffer-file "*EUR*"
"The current regexp."
:type (const :tag "No match" nil))
(defcustom viper-regex-buffer-regex-type nil
"The regexp to search for the current match."
:type '(alist :tag "Regexp"))
(defcustom viper-string-alist nil
"Regexps.
A regexp string can have a `*' in it, e.g., \\<viper-re-match-alist>\\[*^\"\n\"\\] .
A `*' can be a `^' in the second part of the string, e.g., \\<viper-re-match-alist>\\[*^\"\n\"\\] ;
\\<viper-re-match-alist>
\\<viper-re-match-alist>
\\<viper-re-match-alist>
\\<viper-re-match-alist>
List of regexps with different `~' suffix, e.g. \\`foo-string-string\\] .
\\<viper-re-match-alist>
`+'
\\(*+\\)?
`\\(.*\\|\\|*^\\)?
\\<viper-re-match-alist> \\`*?
\\(\\|[\\|_.*\\|[\n\t]*]+\\)\\|[\\|_.*\\)"
\\|[\\|_.*\\|[\n\t]*_]
\\|[\\|_.*_]
\\|[\\|_}_]
======== SAMPLE 4 ========
(b)
(cond ((eolp)
;; Set up a "dummy thread"
(set-deceased-threads 1))
(t (error "Missing thread"))))))
(defun dired-setup-thread-and-remove-timer ()
"Setup dired.
This works through a thread that handles the display of a buffer's state. The window behind the buffer then scrolls down the frame.
The "dynamic" effect
*
(save-excursion (beginning-of-defun))
(unless (eq (window-buffer (get-buffer-create dired-current-buffer t)))
(if (not (eolp))
(window-buffer (window-point (get-buffer dired-current-buffer)) t)))
(push (buffer-substring (point) (point-max))
(pop-to-buffer dired-current-buffer t t))))
(defun dired-pop-to-buffer ()
"Pop the window back into dired.
This also applies to `dired-insert-buffer-function', `dired-pop-to-buffer',
`dired-pop-to-buffer', and `dired-insert-buffer'."
(interactive)
(let ((buffer (window-buffer buffer))
(b (window-point (window-point)))
(buffer-end (window-end (window-point))))
(if buffer (pop-to-buffer buffer)))
(save-window-excursion (and (not dired-pop-to-buffer) (dired-pop-to-buffer)))))
(defun dired-insert-buffer-function ()
"Insert the buffer back into dired.
This also applies to `dired-insert-buffer-function', `dired-pop-to-buffer',
`dired-pop-to-buffer', and `dired-insert-buffer'."
(interactive)
(let* ((buffer-end (window-point))
(b (point)))
(cond ((and (not dired-pop-to-buffer) (not dired-pop-to-buffer))
(push (window-buffer (window-point b)) b))
(unless (eolp)
(dired-pop-to-buffer)
(push (dired-pop-to-buffer b))
(dired-pop-to-buffer b))))))
(defun dired-pop-to-buffer ()
"Pop the window back into dired.
This also applies to `dired-pop-to-buffer', `dired-pop-to-buffer',
`dired-pop-to-buffer', and `dired-insert-buffer'."
(interactive)
(set-window-blank-map (dired-pop-to-buffer))
(let ((w (window-buffer)))
(dolist (a (window-point)) (dolist (b (window-point)) (dolist (c (window-end)) (dolist (f (window-end)) (window-point)))
(if (eofa)
(setq b (window-point b)))
(cond ((and (get-buffer-window a) ; dired window
(eofa (window-point (get-buffer-window b)))
(buffer-live-p (if (eofa a) nil 0)))
(window-next 'nob))
"%file: samples-11100"
======== SAMPLE 1 ========
(put 'routines '(0 0 0)))
;; Routine variables:
(defvar routines-def
(mapcar
"\\[\mbox[:class:]]-\\(\\(?:def[a-z.]*\\)\\([0-9.]*\\)\\(\\(?:\\([0-9.]*]\\|?\\)[0-9.]*]*\\)\\).")
routines
"\\[%s-%s]" ; class
class-decl
class-name def
(when (assoc class-name
'("class." "class-name" "class-decl"))
(setq class-name '(routines-def)))
routines-def)
(put 'routines '(0 0 0)))
;; Variable declaration declarations:
;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar routines-all-declarations-function
(let ((list (cdr list)))
(if (< 0 list)
;; ; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
'((decl ?*)
(decl ( ?/ ?+ ?\]) ; ;; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(key (routines-def
;;(?:def[:class] .+ .+ .*)
.-)
======== SAMPLE 2 ========
<|endoftext|>;;; nautilus.el --- Quail interface for Quail
;; Copyright (C) 1985-1987, 1992, 1995, 2001-2019 Free Software
;; Foundation, Inc.
;; Author: Jim D. O'Donohue <dosohue@gnu.org>
;; Keywords: Quail
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; GNU Emacs is a distributed, non-volatile distribution of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;; Code:
(defgroup nautilus nil
"Quail interface for Quail"
:prefix "nautilus-quail-"
:version "7.2"
:group 'quail)
(defcustom nauti-get-directory-file nil
"If non-nil, use a temporary directory name instead of the current buffer."
:group 'mode
:version "22.1"
:type 'boolean)
(defcustom nauti-find-window-and-display
'(or (and (nth 1 arg) (nth 2 arg))
(display-image (nth 1 arg))
(display-image (nth 2 arg))
(display-function (nth 1 arg) (nth 2 arg))
(display-message (nth 1 arg "Searching %s %s" nauti-directory-format) nil)
(display-message "Reading %s"
(+ (concat nauti-file "*" nauti-directory-format "\n") ":" nauti-format))
(display-message (nauti-file "*" nauti-directory-format "\n"))))
(defgroup nautilus nil
"Quail interface for Quail"
:prefix "nautilus-quail-"
:type 'boolean)
(defgroup nautilus-quail nil
"Quail interface for Quail", "http://quail.gnu.org/"
:prefix "nautilus-quail-"
:type '(choice (const :tag "None" nil)
(string :tag "Quail" nil))
:version "25.1"
:group 'quail-utils)
;;; Quail Utilities
;;
;; Quail Utilities are a large group of commands called "Quail-mode", where
;; they provide very complex and dynamic display and retrieval
;; of files, directories and the like.
;; Quail Utilities
;;
;; Quail Utilities in Emacs
;;
;; Quail Utilities, in Quail-mode
;; Quail Utilities, available directly from Quail
;;
;; The main thing they do is fetch images from http://quail.gnu.org.
;; It's very easy to use with GNU Emacs or Quail, and it should work
;; without any major dependencies on Quail.
;;
;; To use `quail-current-buffer' you need to set up the variables
;; to point at the file name (in Quail mode) followed by this
;; string.
;;
;; Quail Utilities
;; The main Quail interface that Emacs uses for quail.
;;
======== SAMPLE 3 ========
(interactive)
(save-excursion
(let ((buf (current-buffer)))
(setq buf (buffer-table-tables))
(setq buffer-file-name buf)
(if (= (length buffer-file-name) 0)
(setcdr (cdr buf)
(sort buffer-file-name (cdr buf))
(when (consp buffer-file-name)
(setq buffer-file-name (nconc buffer-file-name (nreverse (cdr buf))))
(insert buffer-file-name)))
(push buffer-file-name (delq buf buffer-file-name))
(when (memq type '(file/directory/multiline])
(sort buffer-file-name (cdr buffer-file-name))
(unless (read-buffer (format "#%s %s%s%s" buffer-file-name (car buffer-file-name))
"Save the current buffer and save the current version."
(cdr buffer-file-name))))
(add-to-history (insert file-name buffer-file-name)
"Save the current buffer and save the current version
with the history line to the file name "))
nil))))
(cl-defmethod map-line (map arg)
(t
(save-excursion (add-text-properties (point-min) (point-max) todo-history-lines nil)
nil nil t)))
(defun toggle-dired-file-selection ()
(interactive)
(map-line #'toggle-dired-file-selection)))
(defvar buffer-file-name
(buffer-in-region (point-min) (point-max) todo-history-lines t)))
(defun toggle-dired-line (line &optional file-name)
(interactive)
(setq buffer-file-name (copy-directory file-name))
(if (and file-name
(setq buffer-file-name
(propertize (current-message)
"Select the region to read: "))
buffer-file-name
(let ((start (point)))
(or (and (stringp entry) (get-char-property (point) 'Dired-name-char)
(stringp start)) (yes-or-no-p))
(unless (and (< (point) start)
(/= (point-max) (point-min) (point-max)))
(error "Read file: No file exists but `mark' is active"))
======== SAMPLE 4 ========
(define-key map [upstart] 'downstart)
(define-key map [forward] 'forward)
(define-key map [upleft] 'upleft)
(define-key map [downleft] 'upleft)
(define-key map [forward] 'forward)
(define-key map [downright] 'downright)
(define-key map [upright] 'upright)
(define-key map [downleft] 'downleft)
(define-key map [downright] 'downleft)
(define-key map [upright] 'upright)
(define-key map [overleft] 'overleft))
(define-key menu-bar-menu 'menu-bar-insert "Menu bar for "
"Menu for all the current buffer. It is a list where you can select which buffer you want to insert.
You can insert a menu of several buffers:
1 : (select-frame . current-frame)
: (select-window . current-window)
: (select-key . current-key)
2 : (select-window-or-position . current-window)
: (select-point . current-point)
: (select-key . current-key)
3" : (selected-window nil)
: (selected-position nil)
: (selected-p nil)
: (selected-frame nil)
: key : value -1 : value (variable-value t)
: key (variable-value (var nil)
": key")))
(define-key menu-bar-menu 'menu-bar-insert-all "Menu-bar for all buffers.
This is a list where you can select which buffer you want to insert. You can specify
that there is more than one buffer in this list. If there is more
than one buffer in the list, then a menu is put in the buffer named *
and *or *you will be prompted for it in the buffer you select."
mappings)
(define-key menu-bar-menu 'menu-bar-in-place "Menu-bar for all buffers.
This is a list where you can select which buffer you want to insert."
mappings to)
(define-key menu-bar-menu 'menu-bar-insert "Menu-bar for all buffers.
Used by all buffers. The menu can then be modified. You can choose which buffer for
inserting and then you will be prompted for it the next time you choose
what buffer you want to
insert it. Selection in the menu will be done by
the user when the buffer is selected."
mappings to)
(define-key menu-bar-menu (menu name)
"Select a menu.
If no menu is specified, a default is selected. You can choose from
or from the menu. All the major buffers are put there and the variable
KEYWORD-VARIABLE is used to add the keyboard to the `select-window' key,
and there might be keys for selecting the buffers that are not listed and you know
that the buffer is not in menu but on the menu page. You can specify
that the buffer has a list with KEYWORD-VARIABLE of which the
window buffer you are choosing to select is actually in the major
buffer."
mappings)
(define-key menu-bar-menu 'menu-show
"%file: samples-11000"
======== SAMPLE 1 ========
(dolist (v (split-string c))
(let ((i (cons (car-safe c) (car-safe (aref c 1)))
(v (car-safe c))))
(if v
;; Check if a replacement is suitable for the current buffer; if nil,
;; clear it. Otherwise, restore the value.
(dolist (v (match-beginning v)
(cons (aref v (vector v))))
(dolist (a (aref a v) (car b))))
(setq t (cdr a)
c (cdr b))))
(goto-char c)
(setq c (1+ c)))))
(let ((newbuf (get-buffer-create " *buffer-*"))
(buf-size (get-buffer-create "*buffer-*"))
(buffer-modified-p nil)
(id (get-buffer-create "*id")))))
(defun comint-mode -name (process string &rest contents)
"Call `comint-mode'-style function to run `comint-make', if a string was set.
This may also override the default value in the variable `comint-mode-output-file'."
(let* ((org-process nil)
(name (or string (setq string (cons string org-process))))
(output-file (let ((current-buffer (if name
(car name)) org-output-file)))
(file-name-nondirectory (if org-mode-edit-file-directory "file")))))
(add-hook 'comint-mode.el t)
(add-to-list 'info-buffer-size)
(add-hook 'comint-mode-mode-update 1)
(add-hook 'comint-mode-edit nil)
(remove-hook 'comint-mode-edit (if org-mode-edit-file-directory "file"))
(setq org-mode-output-file (concat output-file (if (eq major-mode "emacs")
(buffer-name)))
org-output-file))
(defun comint-create-file (filename &optional force)
"Create a NEWT FILE FILE to use for editing.
This is useful to save a buffer if the buffer cannot be obtained.
See also `files-file-name'."
(with-current-buffer (get-buffer-create "*buffer-*" nil)
(let* ((name-new-buf (string-to-number filename))
(file-new-mode-output (if force "t" "f") "%s")
(old-name (or (get-buffer-create "*buffer-*" t) "(dots)")
;; Set the existing buffer name, otherwise it will be changed.
======== SAMPLE 2 ========
(defun mh-menu-add-menu-bar-menu (file)
"Add the menu bar to the current file.
With prefix argument LABEL, put the current menu bar on the menu bar.
This command should invoke `mh-create-menu' at the current
buffer. When called interactively the user must specify the
function `mh-create-menu'.")
(defun mh-add-menu-bar (filename)
(let ((menu-bar-name (symbol-name filename))
(name (or (file-attribute-modification-time filename) 0)))
(when name (set-marker (current-buffer) t))
(save-restriction
(widen)
(while (setq name (cdr name))
(setq name (cdr name)))))))
(defun mh-add-menu-buffer (filename)
"Add the menu to the current buffer."
(mapc 'set-buffer-local-map filename)
(let* ((buf (get-buffer (current-buffer)))
(region (prefix-numeric-value 0)))
(or (null buffer-file-regexp) (setq buffer-file-regexp (concat ".*" (buffer-string)))
(prog1 (or (buffer-line-number-p (expand-file-name filename) 0))) ; ignore buffer-file-regexp
(prog1 (or (buffer-line-number-p (expand-file-name filename)))))
(when (and (not (stringp buffer-file-regexp))
(get-buffer buffer-file-regexp)))
(push (or (null buffer-file-regexp) buf) buffers)))
;(defun mh-add-menu-menu ()
; (interactive)
; (with-current-buffer (mh-menu-map "/d" filename)))
(defun mh-menu-add-menu ()
"Add the menu to the current buffer."
(mapc 'set-buffer-local-map filename)
(let ((buf (make-local-variable 'mh-customize-file nil))
(menu
(lambda (c) (with-current-buffer (mh-menu-map "\r" "" c) (buffer-name (or (get-buffer c) nil))))))
(setq mh-customize-file 'menu-bar-name)))
(defun mh-menu-set-key (map (lambda (keyword) nil) (keymap))
"Set the keymap for the current buffer.
With prefix argument KEY, go to the region where KEY is found.
If KEY is nil, use `mm-insert-menu-key'."
(setq mh-current-selected-window-configuration
(when (mapcar (lambda (x) (get-buffer x nil))
(get-text-property (point-min) (point-max) 'buffer)))
nil t))
(mh-menu-set-menu-map keymap))
;;; Miscellaneous functions
(defun mh-menu ()
"Open the menu.
With prefix argument M-, make sure the new menu is visible."
(interactive)
(setq mh-menu (make-vector 1))
(unless (get-buffer (get-buffer "*M-*buffer-Info*"))
(setq mh-open-menu-buffer-file (get-buffer-file "*buffer-Info*"))
(setq mh-menu (make-vector 1)))
(mapc 'menu-bar (make-vector 1 ?\C-c mh-open-menu-buffer-file))
======== SAMPLE 3 ========
(setq ebnf-buffer-name
(cons "buffer" ebnf-buffer-name))
(setq ebnf-buffer-name "\n"))
(t
(user-error "Could not read buffer %s" buffer)
(throw 'exit nil))
(setq ebnf-directory-alist nil))
(when (and (consp gnus-mode-alist)
(< ebnf-current-buffer gnus-mode-alist))
(setq gnus-mode-alist nil))
;; Use dnf-find-file to resolve the files we already have and to return them.
(if (and (listp gnus-mode-alist)
(>= (length gnus-mode-alist) 0)
(not (stringp gnus-mode-alist))
(equal (gnus-group-string-in-directory gnus-mode-alist)
(length gnus-mode-alist))))
(defun gnus-find-file-at-point (file)
;; Find the beginning or end position of FILE.
(dolist (file gnus-mode-alist)
(let ((start (point))
end pos)
(unless (bolp)
(setq pos (point))
(goto-char pos)
(forward-line 1))
(setq file (gnus-find-file-at-point file))
(while (not file)
(end-of-line)
(forward-line 1)))))
;;;###autoload
(defun gnus-goto-file (file)
"Go to the start of FILE.
Use \\[gnus-find-file] to find the start and end."
(interactive (beginning-of-line) (let ((begin (point)))
(back-to-indentation) ;; Do not move backward.
(save-excursion
(gnus-save-buffer)))))
;;;###autoload
(defun gnus-goto-file-marker (marked)
"Move to the marked line."
(interactive (list (marker-buffer marked)))
;; Find the start of file marked by mark.
(when (pos-visible-in-window-p (point))
(let* ((file (progn
(set-window-buffer (save-excursion (point) (point))))
(when (looking-at "\n\n")))
(end (if (not (re-search-backward "\\s-*\\([^ \t]*\\)\\(\\)\\:" mark nil t))
(point)))
;; We now have been in FILE, so we can make
;; note the start of the file.
(if (file-exists-p file)
(progn
(if (not (save-excursion (point) (point))
(forward-line 1)
======== SAMPLE 4 ========
"
;; "
;; " " "
;; " " " ")
;; "
;; "
;; "
;;;;;; " " " "
;; "
; " "
;; "
;;;;;; ))
(defun menu-bar-menu-remove-from-bottom ()
;; Go back from the top. Set cursor location to bottom.
;; We do not do this with `menu-bar-menu-remove-from-bottom', just in case.
;;
" Go back to the top. Do it for
;; `menu-bar-menu-remove-from-bottom'.
(if (not (memq system-type '(windows-nt)))
menu-bar-menu-add-at-point-from-right
(beginning-of-defun) ;; Make sure that current defsubr is at point or end.
(let* ((prev (and menu-bar-window menu-bar-menu-end)))
(save-excursion
(end-of-defun)
(let ((end-end (and menu-bar-window
menu-bar-window
menu-bar-menu-display)))
(move-marker (minibuffer-end-position))
(set-marker
(funcall menu-bar-mode-map 'menu-bar-menu-remove-from-bottom
'leftmost (minibuffer-end-position))))))
;;; Interface functions.
(defun menu-bar-menu-remove-from-right ()
;; Make sure that previous menu is selected
(cond
((and menu-bar-window (selected-window)) ;; make menu-bar-menu-remove-from-right available
(menu-bar-bar-p (selected-window)))
;; Remove menu that belongs there
((and menu-bar-window (selected-window)) ;; make menu-bar-menu-remove-from-right available
menu-bar-menu-display)))
;;; Menu functions.
(defun menu-bar-menu-remove-from-bottom ()
;; Make sure that previous menu-bar is selected
;; and that its menu-bar is available
;; but not its menu-bar-menu-display. If menu-bar-menu-remove-from-bottom does not appear...
;; the menu-bar should be removed and the menu displayed.
;; ;; The menu should either be displayed
(menu-bar-menu-remove-from-bottom menu-bar-menu-display))
;;; Utilities.
;;;
(defun menu-bar-menu-update (name)
"Update the menu in menu-bar with the menu that exists."
(interactive (list (cons name menu-bar-menu-display)))
(setq name (cdr (assq ',name menu-bar-menu-include)))
(setq menu-bar-menu-update ?\s)))
(defun menu-bar-menu-remove-from-bottom ()
;; Remove menu that belongs there
(t
(mapc 'delete key-binding
menu-bar-menu-remove-from-bottom
menu-bar-menu-display))
(
"%file: samples-10900"
======== SAMPLE 1 ========
(lambda () (interactive)
'region))
(let ((orig-buffer (current-buffer)))
(condition-case err
(goto-char (or (point-min) (point-max))
(while (re-search-backward
(intern eudir-keyfile)
nil t))
(let (dir)
(goto-char (or (point-min) (point-max)))
(while (re-search-backward eudir-keyfile nil t t t)
(save-restriction
(narrow-to-region (point) (1- (point-max)) (max-line-width))
(goto-char (or (point-min) (point-max))
(if (search-forward eudir-keyfile nil t t) t nil t)
(goto-char (- (point) (point-max)))
(replace-match ""))
(forward-char -1)
(forward-line (- (point) (point-max)))
(goto-char (- (point) (point-max)))
(forward-char 1))))
(end-of-line))))
(goto-char orig-buffer)
(set-marker (point-max) orig)
(with-current-buffer (find-buffer-visiting t)
(if (not (looking-at eudir-key))
(progn
(forward-sexp)
;; We're not at the beginning and end of the file, so
;; delete this buffer in case any other buffer
(kill-buffer)
(delete-region (bolp) end-of-line)
(with-current-buffer (insert-buffer-visit b)
(goto-char (point-min))
======== SAMPLE 2 ========
"\\[tBLACK_MATCH]\\|\\(\\w+\\)[:space:]\\|\\W+\\)" t
"\\[tBLACK_MATCH]) \
which follows the same rules as
\"" "\\[tBLACK_MATCH]\\|\\(\\\\\\w+\\)[:space:]\\|\\W+\\)"
"Customizations to highlight.
Each one is followed by a single space, with a space delimiter.
This `\\[tBLACK_MATCH]' is executed after every other customizations,
including ones for `tilde' and `tilde_space', as well as one for
`l' and `l' and `l'.
Each of the `tilde' commands should take no more than 1 line. It is
not evaluated in the normal fashion to determine whether any customization
replaces the current pattern in its pattern match or not. For a
different case, please see the documentation for `tilde' for the
default and `tilde_space' and `l' for l.
When `tilde' was first used to highlight a pattern and that pattern
match, the standard pattern matches `tilde' for that pattern.
Each customization should not change if `tilde' is running non-interactively,
even if that customization did not occur to other customizations. Any
pattern matching an earlier customization, even if the pattern matches
`tilde' or `l' for that pattern, is ignored (i.e. the customization won't be
seen, only evaluated for the initial customization)."
(interactive)
(let ((tilde 1))
(save-excursion
(save-restriction
(narrow-to-subtree
(let (pattern)
(goto-char (point-min))
(while (re-search-forward "\\(\\w+\\)[:space:]\\|\\(\\\\\\w+\\)" t)
(end-of-line)
(when (re-search-forward "\\(\\w+\\)")
(goto-char (match-end 0))
(when (re-search-forward "\\(\\w+\\)")
(delete-region (match-beginning 0) (match-end 0))
(when (re-search-forward "\\(\\w+\\)\\)" nil t)
(goto-char (match-beginning 0))
(push-mark)
(setq pattern (match-string 1))))
(set-default pattern (match-string 0)
name
name (match-string 0)
tilde
match
pattern))))
(pcomplete-mode)
======== SAMPLE 3 ========
"")))))
(if not
gnus-bibtex-info-flag-is-on))
(if not
(if type
(if (eq type 'type1)
(if (eq type 'value1)
(if (eq type 'type2)
(if (eq type 'value2)
(if (eq type 'value2)
(if (eq type 'value2)
(if (eq type 'value2)
(if (eq type 'value2)
(if (eq type 'value2)
(if (eq type 'value2)
(if (eq type 'value2)
(if (eq type 'value2)
(if (eq type 'value2)
(if (eq type 'value2)
======== SAMPLE 4 ========
(t :weight (lambda (_ (name &rest _values)
(symbol-value name)))
value)))
(should (equal value "")
(t :weight (lambda (_ (name &rest _values)
(symbol-value name)))
value)))
;; Only handle one keyword
(should (equal value "")
(t :weight (lambda (_ (name &rest _values)
(symbol-value name))))
value))))
(ert--with-current-values (should (equal value "<"))
"Non-local string representation for function values."
(&optional value default)
(interactive "p")
(let* ((first (and (condition-case-unless
(funcall first value))
first)
(value (symbol-value symbol-value)
value (symbol-value value))
(t default 'symbol-value))))
;; Return value
(should (equal value "<"))
;; If `eval' returns non-nil, we don't care about this
;; at all for the symbol.
(prog1
(list 'symbol value)
(eval (symbol-value symbol)))
;; Return non-nil if the symbol exists.
;; If a `eval' returns nil, then we know it has been
;; passed to `eval' and it exists.
(should (equal value nil))
;; If `eval' did not get called, then `eval' is called
;; when the symbol was evaluated.
(let ((value nil)
(c (eval-string-concat value
(symbol-function (symbol-value symbol-value))
value))
(b (eval (symbol-value symbol-value) (symbol-value symbol-value))))
(setq value (symbol-value value))
(and (cdr value)
(or value
(progn
(with-output-to-temp-buffer "*Expected value: **"
"%file: samples-10800"
======== SAMPLE 1 ========
(defface comint-x-menu
'((featurep 'x-mouse-menu-mouse)
((class 'mouse)
((window-full-screen 'comint-x-mouse-face)
(progn ,@(condition-case
`(select-window ,@window-full-screen)
,@(display-fill-function ,@current-column))
(if (comint-face-p (selected-frame) 'Comint-x-Menu))
(progn ,@(point-min))
))
;; Use comint-fontify-variables to see how to customize the
;; value of some variables. If the variable doesn't exist and you want a
;; value of a non-ASCII part, use a prefix argument. Otherwise, use the
;; value of any of the variables in that mode's menu.
((string= (comint-x-menu-symbol "Comint-X-menu-" comint-x-menu) "Comint-X"
'((< comint-x-menu-symbol comint-x-menu)
;; A numeric prefix argument means to use this key's value.
'((<= (length comint-x-menu-symbol)
comint-x-menu-symbol))))
((class 'comint-mode-generic)
((or (eq 'compilation-mode compilation-mode-generic) 0)
(progn
(setq completion-interactive
(comint-completion-completion-invisibility completion-interactive))
mode)
(if comint-compilation-mode
context 'comint-compilation)
(set (make-local-variable 'comint-x-menu)
mode completions))
(t
;; The "comodo-interactive" keyword is a misnomer here because I think
;; it would be better to return the string itself instead of just the
;; result.
(set-buffer-modified-p nil)
)
)
;; Check the variables of the last entry in the last list.
(defvar comint-last-entry nil
(or (and comint-last-entry 1)
(eq comint-last-entry t))
(and (eq comint-last-entry 'compilation-mode)
(ignore-errors (comint-compilation-mode)))
))
)
;;; Compilation mode
;;
(defvar compilation-mode) ;; for compilation but not compiled; for compilation
"A global mode used for editing code."
()
;;
;; Local Variables:
;; This mode should not be changed. (I am not aware of a global menu.)
;;
()
;;;###autoload
(defvar compilation-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [f4] 'compilation-mode-map)
(define-key map [q] 'compilation-mode-menu)
)
(define-key map [c-f] 'compilation-mode-menu) ; menu
)
;; Get to the last entry in the last list.
(defvar compilation-last-entry nil
======== SAMPLE 2 ========
(org-set-default image-file-directory info))
(save-restriction
(narrow-to-regexp
(concat "http://ftp.c-smu.net/:pubsub:http://ftp.c-smu.net:pub//pubkey/:pubsub:pubkey:pubkey=:pubkey:pubkey:" url "-%s" url)
(goto-char (max (point-min)) (point-max))
(if (search-forward url nil t)
(error "No `%s'" href))
(goto-char (max (point-min)) (point-max)))
(let ((rfc2022-encrypt-headers '("Content-Type: multipart/mixed" ?\e
"\"\s-\"")
(inhibit-point-motion-hooks t)
(inhibit-read-only t)
(inhibit-message "" ; ignore headers
(setq message (concat "No " message "\""
(char-to-string url))))
(with-output-to-time org-get-time-string
(save-excursion
(beginning-of-line)
(message "Content-Transfer-Encoding: %s (%d bytes)"
(setq encoded (1- encoded))
(if (and no-error
(or (eq no-error 'yes)
(and
(not (string= "-" url "-"))
(or (not no-error))
(and
(not (null encode-time-string
(org-agenda-parse-parse-data))))
(and (not (not no-error))
======== SAMPLE 3 ========
(cl-defmethod cl-findmethod :test 'finddoc-find-method 'cl-find-method)
(gnus-define-method cl-findmethod "find" 'cl-find-method)
(cl-defmethod cl-findinstrumenting :test 'method-find-instrumenting)
(cl-defmethod cl-findinstrumenting :test 'method-instrumenting)
(cl-defmethod cl-getmethod :test 'method-get-method)
(cl-defmethod cl-getinstrumentning :test 'method-get-instrumentning)
(cl-defmethod cl-getinstrumentning :test 'method-instrumentning)
(cl-defmethod cl-getinstrumentning :test 'method-instrumentning)
(cl-defmethod cl-getmethod :test 'method-get-method)
(cl-defmethod cl-request-method :test 'request-method)
(cl-defmethod cl-request-method :test 'request-method)
(cl-defmethod cl-request-method :test 'request-method)
(cl-defmethod cl-request-method :test 'request-method)
(cl-defmethod cl-request-method :test 'request-method)
(cl-defmethod cl-getmethod :test 'getmethod-getmethod)
(cl-defmethod cl-getinstrumentning :test 'get-instrumentning)
(cl-defmethod cl-getinstrumentning :test 'get-instrumentning)
(cl-defmethod cl-getinstrumentning :test 'get-instrumentning)
(cl-defmethod cl-read-method :test 'write-method)
(cl-defmethod cl-read-method :test 'write-method)
(cl-defmethod cl-read-method :test 'write-method)
(cl-defmethod cl-read-method :test 'write-method)
(cl-defmethod cl-process-method :test 'process-method)
(cl-defmethod cl-process-method :test 'process-method)
(cl-defmethod cl-process-method :test 'process-method)
(cl-defmethod cl-process-method :test 'process-method)
(cl-defmethod cl-process-defining :test 'process-defining)
(cl-defmethod cl-process-defining :test 'process-defining)
(cl-defmethod cl-process-defining :test 'process-defining)
(cl-defmethod cl-process-defining :test 'process-defining)
(require 'cl-math)
(cl-defmethod (cl-type :test 'cl-program)
"List Lisp routines called for the purpose of finding and accessing some object.
Arguments STRING are the parameters to be passed to a `cl-program' for
reassembly."
:regexp "^[ \t][ \r\n]*(\r\n|[^\\]\\s-+?[^\\]\\s *\\(:^\\s *(^\\)[ \t]*)"
(list 'cl-program)
(list 'cl-program
(list 'cl-file "cl-" cl-exp-files 'cl-expansion-files))
(cl-make-module-alist)
(cl-incl-with-newer-than-newer-than-default-args 'cl-expansion-exponents &optional arg)
(cond (cl-read-file "Run program: "
'cl-exp-files nil nil
cl-exp-files
======== SAMPLE 4 ========
(defvar ios-bib-file-cache-file)
(defvar ios-bib-file-name-cache) ; In case a file isn't loaded.
(defun ios-bib-directory-file (directory)
(let ((file (file-truename directory)))
(if (string-match "^\\([^\\-]\\)\\([^\\]\\|$\\)" directory)
(match-string-no-properties t)))
(if (and (file-name-absolute path)
(file-directory-p path)
(or (string-match "/$" (regexp-quote directory)) "/$")
(error "Not a path"))
(file-name-as-directory path))
(let ((file (make-directory ".ipad"))
(regexp-uname-p path))
(setq prefix (file-name-nondirectory directory t))
(setq prefix (directory-nolist-string regexp-uname-p t)
entry (read-from-minibuffer (concat prefix
(substring (1- (length prefix)))))))
(if (and (file-directory-p path)
(file-readable-p path))
(setq prefix (substring path (match-end 0))
entry (regexp-quote entry))
(setq prefix (file-name-directory path directory)))
(add-to-list 'ipad-inhibit-file-readable-p
(length prefix) (file-name-nondirectory path) nil t)
(add-node-file "/tmp/ipad/file-writename" nil))
;;;###autoload
(defun ios-bib-set-ipad-inhibit-file-writename (directory)
"Enable IPAD to set the IPad in the current directory
in the currently executed IOS command. It is a list of directories in the current
single IOS command that get a non-nil prefix argument for this set.
Otherwise, it is a list of directories in the current IOS
command that gets a non-nil prefix argument by setting a property
called ipad-inhibit-file-writename . This property is inherited from
ipad-inhibit-file-writename-file-writename in order to enable IPad in the
current command.
The returned value is a list of directories and subdirectories
that were set by this command set, and directories from the
source of or derived from this command. For example, some of the directories
from
/opt/example/index.html/" and/or
/opt/example/(/.emacs/sample/") may be set to /opt/example/.
(if (fboundp 'check-for-file-writename)
(setq check-for-file-writename (or check-for-file-writename t))
(funcall (if (file-readable-p path)
(or (null path) (file-directory-p path) (file-suffix-suffix path)))))
(provide 'ipad)
;;; ipad.el ends here
<|endoftext|>;;; ipad-tests.el --- tests for ipad test library -*- lexical-binding: t; -*-
;; Copyright (C) 2000-2019 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> -*-
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option)
"%file: samples-10700"
======== SAMPLE 1 ========
-gnus-file-name gnus-group-name)
(setq gnus-group-path (buffer-file-name)))
(setcar (org-remove-dir-list
(mapcar 'car org-mw-entry))
'(directory-dirs)
(setcar (or (and org-mw-entry
(org-list-files-by-group (org-with-dir-dup
(nth 0 entry))))))))
(defun org-mw-expand-dirlist ()
"Fold all the entries of a new entry in the Emacs group dir.
This operation sets up the Emacs group directory, or if we want
to edit the entry there, then sets up the entries of the current
group dir in a buffer. This is called a 'expand". See the doc file for
the 'expand' options.
Optional argument EXPAND is a string of the string to expand.
When the value is non-nil, an entry of the current group dir is
expanded automatically. `org-group-path' is used as the
name of the group directory.
If you want to edit a previous entry of the current group dir in a
buffer, or if there is one already, use your own file name.
You can also create groups with the `org-set-path' command
provided that you enable the variable `org-group-path'."
(or (file-directory-p org-mw-dirs-directory)
(let ((org-mw-entry (directory-file-name org-mw-dirs-directory))))
(setq org-mw-dirs-directory (make-directory org-mw-dirs-directory)))))
(defun org-mw-edit-dirs-directory (name)
"Edit directory of a group dir specified in NAME in the Emacs group dir
or in a buffer whose file name is the name of a group.
See the documentation of this variable and its functions
for other ways to edit the group dir (such as making it more unique)."
(interactive "sDirectory path: ")
(when name
(org-group-insert-modes "*Group Dir*")
(let ((directory-dir (org-copy-name name)))
(org-mw-edit-dirs-directory name directory-dir)
(save-current-buffer "*GROUP DIR*/")
(let ((dir (org-get-dir-by-name (car (org-edit-dnd-name group-dir)))))
(when (re-search-backward
(concat "^"
"\\([^\"]\\).*\\)?\\("
"/")
(progn
(replace-match "\\`\\'" 1)
nil))
(let ((subdir (org-get-dir-by-name group-dir)))
(unless subdir
(or (or (or (org-subdir-p dir)
(if subsigns (org-subdir-subdir dir)
======== SAMPLE 2 ========
-message-message-message)
;;;###autoload
(defcustom message-in-edit-hook nil (make-local-variable 'mail-edit-hook)
"Hook hook for editing messages in message messages."
:global t :group 'message-edit-mode
:group 'message-edit-message-message
:keymap message-edit-keymap)
(defcustom message-edit-keymap (if (memq (current-buffer buffer-file-name) 'message-edit-keymap)
"<message-to-send-to>")
"Keymap used in message message messages."
:version "23.1"
:type 'sexp)
(defcustom message-in-send-to-window nil nil
"No window to send the message.")
;; TODO: This would use something like `user-login-here' as the window
;; to send the message. The function will ask the user for their username
;; before sending the message. You should also ask for their email before
;; sending the message, i.e. before setting up the message buffer for
;; send-mail
(defcustom message-send-mail t
"Non-nil means we send the message to the user by typing \"send\"
\"mail\" in the buffer. This option can be used to make
Emacs buffer that handles sending of different mail formats."
:group 'message-send
:group 'message-send
:type 'boolean)
(defcustom message-add-buffer-stats t
"How many seconds to add to the default timer on a message."
:group 'message-send-buffer
:type 'number)
(defcustom message-add-timer '(4) nil
"How many seconds to add in a message."
:group 'message-send-buffer
:group 'message-send
:type 'number)
(defcustom message-mail-display t
"Whether to display the message in the message buffer.
Set to t when showing the message. If nil, it will
be displayed as just a message."
:group 'message-mail
:group 'message-send
:type 'boolean)
(defcustom message-mail-message-height nil #'message-mail-display
"Alive height is returned instead of the default height after the message
has just been seen. When nil, we use `message-mail-message-height'
to represent the message height.")
(defcustom message-mail-mailers 1
"Number of mailing addresses to be sent. Default is 1. You
should send one message, and then send all messages in each
mail category instead.
If `message-mail-mail-charset' is non-nil, which will do the math.
If nil, is used instead of message-mail-charset to find the
letter of mail that was sent."
:version "23.1"
:type 'number)
(defcustom message-mail-headers nil
"Whether to show headers in message message messages."
:version "33.1"
:type 'string)
(defcustom message-mail-message-size nil #'message-mail-message-size)
"The default size for message messages."
:version "23.1"
:type 'number)
(defcustom message-mail-messages-in-message-messages
"This value is the default size for messages in the message message message
message message messages message messages message-mail-messages."
:version "23.1"
:type 'number)
(defcustom message-mail-mail-size-of-message-message-messages
10
"The default size for a message message message message. If nil,
message will be displayed (as a message message message).
See section `Message Message Format' for details on the format
of messages in messages messages.
See also `message-mail-messages'."
:version "23.1"
:type 'number)
(defcustom message-mail-send-mail
"The default message envelope to send and keep. This
`
======== SAMPLE 3 ========
-point (point 'point))
(progn
(skip-chars-backward " \t")
(skip-chars-forward " \t")
(goto-char (point-min))
(when (bolp) (sit-for (2 0)))))
;; Move to the first possible part of the tag and check if anything is.
;; Don't move forward if there's no tag at the end of the line.
(if (or (not (or (nth 0 arg))
(looking-at "[ \t]*/")
(looking-at "\\(.*\\.\\)")))
(progn
(skip-chars-forward "\n")
(sit-for (1 0)))
;; If there is no tag at the end of the line,
;; move back the rest of the line. Otherwise we
;; move forward.
(if (not (looking-at "[ \t{}\\|#\\)")
(progn
(goto-char (match-end 0))
(forward-line -3)
(goto-char (match-end 2)))
;; If there is a tag at the bottom of the line, don't move forward.
(let* ((case-fold-search t)
(start-tag (match-string 2))
(end-tag (end-of-line 1)))
(while (and (< (car start-tag) end-tag)
(looking-at "[ \t\r]\\|#\\)")
(let ((point-marker (point-at-eol))
(pos (point)))
(push-mark (point-marker))
(if (and pos (not (eobp))))
(goto-char pos)
(setq pos -1)
(and pos (point)))))
(forward-line (1 0))
(if (null pos)
(t
======== SAMPLE 4 ========
-type paren-start char-start char-end paren-end str nil))
(error nil)))
(defun tramp-unix-with-tcp (pwd)
"Convert Tcp or TCP connection to tcp.
This is useful when you're having a large number of tcp connections.
With an existing `tramp-connection-number-pwd' in your local
file, this function may be able to find the best match
for you."
(if (tramp-connection-number-pwd "tcp"))
(format "Tcp or TCP connection %s \"%s\": %s" (tramp-completing-read-name-or-lower-object
(tramp-net-connector
(tramp-get-connection-net))))
(tramp-dolist-pwd (tramp-connection-number-pwdp
(file-name-nondirectory tramp-completing-read-name-or-lower-object nil)))
(let ((buffer-name (buffer-name))
(port (buffer-size)))
(when (equal (tramp-make-connection-to-tramp-net) pwd)
(error "Invalid connection to Tramp: Unknown connection %s" (tramp-connection-number-pwd pwd)))))
(defun tramp-convert-to-tramp-net-name ()
"Return a Tramp namespace object that identifies the given host."
(or (tramp-host-completing-read-name-or-lower-object tramp-tramp-host-file-name)
(setq tramp-nhost-proxies (tramp-nhost-proxies
(tramp-file-name-directory tramp-file-name-directory
(tramp-net-name-directory)))
(tramp-convert-to-tramp-net-name-or-lower-object)
(cond
;; For a given host, we can identify the name with an
;; "hostname, and we must call 'tramp-unix-with-tcp-command'
;; to get the full pathname.
(if (tramp-nhost-proxies-p hostname)
;; Tramp-http-parameters may provide a bogus
;; host-login string.
(push (pop hostname) tramp-host-proxies-p tramp-local-path-path-path
;; This should resolve to a "name" string.
`(,,hostname, ?\([a-zA-Z0-9_.]?\\(?:[ \t]\\{2,3}\\)?[ \t]*?\\([0-9]+\\)\\)\\)")
;; Tramp-http-hostparameters will probably get
;; one as the "name..." string.
(push hostname nil)))
"%file: samples-10600"
======== SAMPLE 1 ========
(gnus-server-expire-files) (gnus-server-update-files (gnus-create-new-server ngnus-server-name)))
(or (eq (nth 2 file) (memq (org-server-to-file
(gnus-server-to-type
(and (memq (org-server-to-name
(org-list-completions
gnus-server-sub-methods 'not-gv-server)))))
(or (and (memq (org-server-to-type
(org-list-completions
gnus-server-sub-methods 'not-gv-server)
(not (gnus-expire-files
gnus-server-expire-files)))
(and gnus-expire-files
(not (gnus-expire-file
(and gnus-expire-files
gnus-server-expire-files))))))))
(unless (consp (consp files)) (unless (member files gnus-update-list))
(delete (if (eq (gnus-server-to-type files) 'not-gv-server) (gnus-server-update-files) files)))))
(gnus-server-expire-files files))))
(defvar gnus-server-update-list)
(defun gnus-new-server (file &optional server-name)
"Update all information in FILE (GNU/USERS in NNTP/GNU
======== SAMPLE 2 ========
(gnus-map-read-article 'gnus-new-article article article)
(gnus-article-save)))
(defun gnus-unlist-group-tags (group group)
"Delete all tags or nil if there is no such group."
(unless (and (file-directory-p group)
(not (gnus-files-remote-p group))
(gnus-unlist-group-tags-regexp group)))))
(defun gnus-unlist-group-tags (group group)
"Delete all tags or nil if there is no such group."
(when (gnus-expert-p group)
;; Insert the whole report. We just create the tags.
(with-parsed-tramp-file (file-truename group)
(with-current-buffer gnus-newsgroup-buffer
(with-tramp-connection-property
(file-remote-p
group
(cond
((file-exists-p (gnus-file-filename group)
(with-current-buffer gnus-newsgroup-buffer
(with-parsed-tramp-file
gnus-expert-ungroup-data)
nil
(tramp-call-interactive-p
group 'gnus-group-expectations
group (format "%s" group)))
((not (equal group group-number-lines)))
;; Return nil. The only place in the group that will have
;; all the tag-categories and categories that are not in any groups
;; already.
nil
nil
nil
(if (gnus-group-cache-member group 'gnus-unlistify-tags)
(gnus-check-group-references
group 'gnus-unlistify-tags)
nil
nil
(gnus-cache-set-cache
group 'gnus-unlistify-tags nil t t group)))
(error "No such group"))
(with-current-buffer (gnus-cache-cache group))
(defun gnus-unlistify-tags (group article)
"Delete all tags or nil if there's no such group."
(if (eq article gnus-unlistify-tags-regexp)
(gnus-unlistify-group-tags-regexp)
(let ((tags nil) tags nil)
(gnus-message-re "Unnumerically remove group tag (default 'gnus-unlistify-tags): ")
(gnus-unlistify-tags group nil nil nil nil nil nil t t))
(with-rc (gnus-cache-unpackgroup) nil
(with-tasks (or gnus
======== SAMPLE 3 ========
"--"))
(or (derived-mode-p 'tex-mode) "f")
(tex-mode--setup-window))))
(delete-frame tex-mode-buffer)
(setq tex-type 0))
(tex-mode--with-buffer "F")
(setq tex-type nil)
;; Insert a menu keymap that makes the region look like a plain tex-menu. So we
;; insert an ellipsis as described above.
(tex-toggle-overlay tex-menu-keymap
(set-keymap tex-menu-keymap tex-menu-map)
;; Setup menu for display.
(setf (tex-menu-entry menu-line) (tex-menu-entry "TexMenu" menu-line))
(setq tex-menu--with-buffer "F")
(tex-menu-menu-map tex-menu-menu-map))
(tex-menu--set-menu tex-menu))
(provide 'tex-mode)
;;; tex-mode.el ends here
<|endoftext|>;;; tex-mode.el --- TeX support for Emacs and Emacs Lisp -*- lexical-binding: t -*-
;; Copyright (C) 1998-2002, 2004, 2007-2019 Free Software Foundation, Inc.
;; Keywords: emulations
;; This file is part of GNU Emacs.
;;
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; XEmacs support for Emacs has been around for a
;; long time. XEmacs does not yet support it properly
;; with Emacs. Therefore, we do this to address situations where XEmacs
;; supports an XEmacs XEmacs mode (such as if you're using
;; Emacs >=26 without the mode).
;;
;; XEmacs support for Emacs features have the following components:
;;
;; - XEmacs mode. XEmacs mode is a single window system.
;; - XEmacs mode is a fully supported system with a buffer store.
;; - XEmacs mode is a system with multiple XEmacs buffers.
;; - XEmacs mode supports both windows and systems with both
;; XDEmacs and XEmacs and also supports XEmacs with XEmacs,
;; XDEmacs, and XDEmacs with XEmacs as well as XEmacs XEmacs.
;; - XEmacs mode has a customizable XEmacs sub-menu,
;; including key bindings, menu entries and control keymaps. You can
;; use XEmacs mode menu-bar to customize the current buffer
;; and system. XEmacs mode support is available with the
;; addition of the following new features:
;;
;; - XEmacs mode works with a modified and/or rebinded window with the
;; following special features:
;;
;; - XEmacs mode has been fully implemented and emulates Emacs, XEmacs
;; Emacs XEmacs, and XEmacs XEmacs. You can customize XEmacs
;; Emacs mode to use some XEmacs and XEmacs XEmacs with the
;; following features:
;;
;; - XEmacs mode is enabled with a customized XEmacs sub-menu,
;; including the following special features:
;;
;; - XEmacs mode is fully supported with a fully supported buffer store.
;; - XEmacs mode enables the use of the XEmacs buffer store.
;; - XEmacs mode makes XEmacs enable and supports both XEmacs and
;; XEmacs XEmacs. You can use XEmacs mode menu-bar to customize
======== SAMPLE 4 ========
(list ',-a))
(setq argv (if (zerop arg)
(list ',-a
(concat 'equal '(equal t) ',-a)))))) ; 0)
argv))))
;;;###autoload
(defun math-parse-math-sub-left (argv)
(interactive "p")
(goto-char (+ argv argv))
(if (eq (current-column) (- argv 1))
(if (eq (> (point) argv) 2)
(math-parse-bounds (math-sub-a 3 (+ argv argv)))))
(error "Math-Operations: [^\n]* %." argv)
(set-calc-texinfo-table 0 (concat 'matrix '(p a b)) (+ argv 1)))
;;;###autoload
(defun math-parse-mul-left (argv argv)
(interactive "p")
(if (eq (current-column) argv)
(if integerp (setq argv (list argv (1- argv))))
(setq argv (1- argv))
(error "Math-Operations: [^\n]* %:" argv)
(if (eq (current-column) argv)
(error "Math-Operations: [^\n]* %." argv)
(setq p (concat 'mul (math-sub-a (1+ p) argv)))
(setq argv (1- argv))))
;;;###autoload
(defun math-parse-mul-right (argv argv _)
;; First find the first pair of numbers in the right-hand side of the list-of-intr-begs.
"Interactively, the first two symbols in a list-of-intr-begs are the starting values."
(if math-parse-mul-right-c (car math-parse-mul)
(setq math-parse-mul-right-c (cdr math-parse-mul))
(setq math-parse-mul-right-c (cdr math-parse-mul))))
;;;; A matrix of symbols
;; These are symbols to use as vectors.
;; These are vectors for vectors of integer and integer/float.
;; The symbols here are symbols for vectors of all vectors, whose element is
;; `math-vector-s'.
(defun math-vector-s (c1 c2)
(let ((m1 (math-vector-m1 c1)))
(while (setq p (math-vector-m1 c2))
(math-addp (car p) m2)
(and (setq m1 (calcFunc-div (car p) (cdr p))) (setq m1 (cdr p)))
(setq p (math-addp (calcEuler-subp (car p)) (cdr p)))
(setq m1 (1+ m1)))
m1))
;;; Complex formulas are often used as submatrices.
(defun calcFunc-mul (r1 r2)
(or (and r1 (math-mul r2 r2))))
(defun calcFunc-mul-right (r1 r2)
(or r2 (math-mul r2 r2))
(defun calcFunc-mul-y (r1 r2)
(or (and r1 (math-mul r2 r2 r2)) 0)
;;; The submatrix numbers
(defun calcFunc-symmony (n1 n2)
(or n1 (math-sub-
"%file: samples-10500"
======== SAMPLE 1 ========
buffers to the file's buffer
`/local:/tmp/tmp-file' will search the variable for
a file name with a non-nil value."
(setq buffer-local-copy (or local-copy (car local-copy)))
(setq file-local-list (cons (cons file file-local-list)
;; Not at least to the files in the list.
(if (null buffer-local-copy)
;; Set the list in the current buffer.
(car (cdr buffer-local-copy)))
;; Set the value of a variable.
(if (null local-copy)
(cons (cons local-copy local-copy)
(if (null file-local-list)
;; Set the list in this buffer.
(concat buffer-local-list
" "/tmp/")))
(if (null file-local-list)
;; Set buffer-local-list to the file. Otherwise,
;; make sure that any local file in
;; any other buffer changes its value.
;; make sure that its value has a default value.
(push buffer-local-list file-local-list)))
(setq buffer-local-list new-file-list)
(setq new-file-list buffer-local-list)))
;; Set the list in the list buffer to this variable, if it exists
;; in the system buffer.
;; If it has any other entry, set the list in the list buffer to file
;; file-name, otherwise set it to
======== SAMPLE 2 ========
buffers
(defvar org-macs-keymap
(save-excursion
(back-to-indentation)
;; We use a symbol to highlight the "in" and "out" keys,
;; i.e., there are two groups of three "inside" and "outside" fields.
(push ((looking-at org-pct-in-field) '(all)) org-macs-keymap)
(setq org-macs-keymap nil) )
))
(if (looking-back org-pct-in-field-function-line-forward)
(delete-region (point-min) (progn (forward-line 1) (point))))
(point)
(goto-char (match-end 0)))))
(defvar org-macs-keymap) ;; This entry is bound so we can set this variable to nil.
(defvar org-macs-keymap (list 'mouse-event-events (cons 'mouse-event-events 'org-macs))
(defvar org-macs-keymap (list 'mouse-event-events (cons 'mouse-event-events 'org-macs))))))
(define-derived-mode org-macs-keymap "org-macs"
"Set keymap in the org-macs menu."
(add-hook 'mode-hook 'org-mode-map)
(add-hook 'save-buffer-hook 'mouse-mouse-update)
;; See this entry in `org-macs-keymap'."
;; FIXME: Don't use `org-macs-keymap' for this, because that will not work.
(setq org-macs-keymap org-macs-keymap))
;; The keymap used in Emacs is called mocc.el's keymap.
(put 'mocc (list '(org-macs-keymap)))
(defun org-macs-keymap-save-keymap (org-keymap)
(cond
((assoc org-keymap)
;; Do not use `org-save-keymap'; for example, use `org-goto-p', since
;; this will allow us to jump to a particular key or frame
;; when a frame is displayed in another window.
(org-back-to-indent)
(let ((org-keymap (cdr (org-export-macs-keymap)))
,org-keymap))
(set-keymap-cache org-keymap)
(org-set-file-local-map org-keymap)))
(org-macs-update
(let ((org-macs-keymap-alist (cdr (org-export-macs-keymap)))
,(org-macs-keys-alist))))
(defun org-macs-keymap-save-keymap (org-keymap)
(save-excursion
(org-macs-next-p)
(let* ((keymap (org-export-macs-keymap))
(value (car keymap))
(alist (cdr keymap)))
(org-macs-insert-keymap (cdr (org-export-macs-keymap)))
(when (eq keymap value)
(delete-region (point) (1+ (point)))
(when (eq keymap value)
(if (looking-at (org-export-macs-keymap)) org-macs-keymap))
(put-text-property (match-beginning 0) (match-end 0)
'save-keymap)
(when (eq keymap value)
======== SAMPLE 3 ========
buffers
(goto-char n)
(let* ((n (downcase this-indent)))
(goto-char n)
(while n
(setq this-indent
(if n (setq this-indent n))))))))
(defun newsticker-mark-indent-paragraph (n-start)
"Insert a paragraph starting with the indentation in N-DELIM."
(interactive "p")
(message "Indent in paragraph: ")
(if
(not (buffer-string))
(insert paragraph)
(setq n-start (or start (point))))
(kill-buffer n))
(provide 'syntax-tests)
(require 'lex-mode)
(require 'lex)
;;; syntax-tests.el ends here
<|endoftext|>;;; font-lock.el -- provide all the syntax definitions for all major modes )
;; Copyright (C) 1999-2005, 2007-2019 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; This version of font-lock provides the ability to set syntax and indentation of all
;; major modes without having to customize font-lock.
;
;;; Code:
(require 'cl-lib)
(defun font-lock-reuse ()
(save-excursion
(save-match-data
(goto-char (match-beginning 0))
(re-search-forward "^\\(\\(\\sw\\|\\\\r\\)\\|[^:]+\\)\\s-**\\(?" nil t)
(setq font-lock-mode-value '("^\\>\\|:")
font-lock-enable-comment
font-lock-ignore-syntax-after-comments
nil)
font-lock-use-font-lock)
(save-restriction
(narrow-to-region (point-max) (max (- n-start font-lock-indent)))
(goto-char (match-end 0))
(while (re-search-forward "\\(.*\\)" (point-max))
(setq font-lock-indent-value '("^\\>\\|:")
font-lock-use-font-lock))
(setq font-lock-mode-value '("^\\s-*\\)"))
(setq font-lock-enable-comment '("^\\>")))
;;;
; FontLock.el
;;;
; Font_Lock.el
;;;
(set (make-initial-value 'font-lock-font
font-lock-use-font-lock)
;;;
======== SAMPLE 4 ========
buffers (or return nil)
(string-match (if (or (and (null entry)
(not (cdr entry))
(not (member table (cdr entry))))
(null t)))))
(funcall (or (string-match "" (string-to-number table)
(if (and (null entry)
(null (cdr entry)))))
table))
(let ((len (length table)) ; The length of each entry.
(car (cdr table))))
(- len (length entry)) ; Length of each entry.
(if (or (null entry)
(string-match
(or (not table) string-match))
(string-to-number table) len))
(setq entry (cdr entry)) ; The entry's length.
(let ((len (length entry))
;; Remove the element of entry at end.
(if (null len) (or len 1) "")))
(if (called-interactively-p 'interactive)
(let ((entry (cdr entry))
;; Use the `-n' flag, because it may
;; trigger a breakpoint.
entry)
nil))
"%file: samples-10400"
======== SAMPLE 1 ========
;;;;; XUL/Xv
(defun c-mprint-read-file-name (&optional force)
"Read file name from FILE at point and return the first element.
Optional arg C-m-C-is-xul/Xv if non-nil. Return nil otherwise."
(interactive (list (c-beginning-of-defun) (point)))
(if c-mprint-file-type-list
(cons (substring (buffer-substring (point) (car c-mprint-current-args)) 0
(list (nconc c-mprint-current-args
(car c-mprint-current-args)))
nil))
(c-add-header-line
(c-remove-backslash "\n\n" nil))))
;;;###autoload
(defun c-mprint-read-file-name-from-buffer (&optional force)
;; Read file named according to its filename.
(interactive (list (c-beginning-of-defun) (buffer-substring (point) (car c-mprint-current-args)) (point)))
(interactive (list (c-beginning-of-defun) (buffer-substring (point) (c-point)))
last-input
(let ((t (save-excursion (org-in-x-p)))
(f (c-with-extra-command-keys
(c-beginning-of-defun) t)
(c-forward-line)
t)
(last-input (current-buffer))
t)
(end-input (current-buffer))
t))))
(defun c-mprint-read-file-name-from-buffer (&optional force)
;; Read file named according to its filename.
(interactive (list (c-beginning-of-defun) (buffer-substring (point) (c-point)))))
(defun c-mprint-read-file-name-to-buffer (name)
;; Read file name from buffer NAME.
(if (= (c-point) 3)
(goto-char (point-min))
nil))
;;;###autoload
(defun c-mprint-put-file-name (name)
"Use current filename to put file name in buffer PRIVATE.
This function is used to modify current file name if PRIVATE is nil.
If PRIVATE is not nil or nil, then PRIVATE is inserted in buffer.
If PRIVATE is not a name or an element of a symbol, then nil is returned."
(lambda (name value)
(unless (member name value)
(if (car (c-string-concat name)))
(setq value (cdr name)))
(c-add-header-line " " (c-c-point) ": " nil nil nil value)
(setq value (or value (cdr (car value))))
(if (and (member name "PRIVATE") (member property "PRIVATE"))
nil
(setq name (concat name value)))
(c-add-header-line " " (car value) " " " " 'PRIV
======== SAMPLE 2 ========
;;
(setq gnus-newsgroup-info-buffer-flag nil
gnus-newsgroup-info-buffer-use-group
gnus-newsgroup-info-buffer-modified nil)
(if (and gnus-unmodified-group-p
(null (numberp gnus-newsgroup-info-buffer-used))))
(if (and (integerp gnus-group-info-buffer-use-group)
(y-or-n-p
(format-message
"%s %s %s %s"
(gnus-group-alist-get-string
gnus-newsgroup-info-buffer-used)
nil
gnus-newsgroup-info-buffer-modified)))))
(setq gnus-newsgroup-info-buffer-flag
(if (equal
(string-match
gnus-newsgroup-info-buffer-used
gnus-newsgroup-info-buffer-use-group
(or (string-match
gnus-newsgroup-info-buffer-used)
'kill-buffer gnus-newsgroup-info-buffer-modified))
0
nil
(or gnus-newsgroup-info-buffer-use-group nil))
(if (and (number-match gnus-newsgroup-info-buffer-modified)
(equal
gnus-newsgroup-info-buffer-used
(string-match
======== SAMPLE 3 ========
;; and
;; (;; (and (eq
;; (read-char-exclusive)) ; not a literal character
;; (and (string-match ":" (buffer-name))
;; (not (equal (mail-reply-string) 'message-id)
;; (mail-header-prefix
;; (symbol-name message-id)))))
;; (and (equal (mail-header-string) 'display-display)
;; (not (equal (mail-header-string) 'display-display)
;; (mail-header-prefix msg-id))
;; (mail-header-suffix msg-id))))
;; 'message-id nil)
;; (setq mail-header-prefix-end (point-max))
;; (message-save-buffer (mail-header-end-point)
;; (point-min)
;; (message-buffer-modified t))
;; (setq mail-header-id-end
;; (let ((b e)
;; (e (mail-header-prefix))
;; (e-p i))
;; (mail-header-message-id-buffer)))
;; (setq message-id (mail-header-string (buffer-name))); if not nil, then
;; i (mail-body-count)
;; r (mail-data-count)
;; m (mail-header-count m))
;; mail-headers
;; mailbox
;;; Code:
;; To create an output file from this buffer, use
;; (internmail
;; (if (mail-string-with-header-p mailbox)
;; mailbox)
;; Mailbox functions:
;; See `mail-buffer-list' for details on mail-buffer.
;;; Code:
(provide 'mail-
======== SAMPLE 4 ========
;;
;; Compute what this means:
. (setq viper-agent (viper-agent-get-group 1))
. (setq buf1 (replace-regexp-in-string ":" ":"
(regexp-opt "-"))
t))
;; Add the new group name.
(setq buf1 (viper-agent-get-group 1))
(setq viper-group (viper-agent-get-group 1))
(if (or (not buf1) (zerop (length buf)))
(viper-agent-get-group 1 t))
;; Reuse the current file if this is a file
(if (and viper-agent
(get-file-buffer buf1 t))
(setq buf2 (replace-regexp-in-string ":" ":"
(file-name-as-directory buf1))
t))
(if (or viper-agent (not (string-prefix-p "=" buf1))
(and (string-match viper-agent-pattern)
(not (string-file-name viper-agent-file)))
(not (string-prefix-p "-" buf2)))
;; Use existing file if it has some
;; file name.
(or (not buf1)
(and (equal viper-group-name "*"))
(not (file-exists-p buf1)))
(setq buf1 (viper-agent-get-group 1 t))
(if (not buf2)
;; This file has a different file file name.
(setq buf2 nil))
(setq buf1 (viper-agent-get-group 1 t)))
;; Set the new file name if there is any, except that it has
;; a new line.
(if (not (file-exists-p buf1))
buf1 nil
(viper-agent-get-group 1 t))
(setq buf1 (viper-agent-get-group 1 t)))
)) ;; Add current file to `viper-agent-file'
(viper-set-last-group-name (make-local-variable 'viper-agent-file))
(setq viper-agent-file nil))
;; When you insert your file, make sure this can be called
;; as many times as necessary.
(defun viper-file-insert (file name)
(unless (re-search-forward viper-file-name nil t)
(goto-char (point-max))
(let ((file
(progn
;; Check for files of the same type
(when (and file file-exists-p)
(setq viper-agent-file file-exists
"%file: samples-10300"
======== SAMPLE 1 ========
))
(define-key map [down] [keydown] '(down 2 2))
(define-key map [up] [keydown] '(2 6 8))
(define-key map [next] [down] 'menu-bar-up 'menu-bar-up-in-menu-bar t
(if (assq 'down :select)
(let ((prev-menu
(get-text-property (1+ start) 'key)
(get-text-property (1+ end) 'key)
(get-text-property (1+ end) 'move)))
'menu-bar-up-in-menu-bar t
(- (assq 'down :select)
(get-text-property (1+ starting) 'move)))))))
(define-key map [overlay]
(let ((map (make-sparse-keymap)))
(define-key map [back]
(mapcar
(function (lambda (x) (assq x 'window-bar-width 2))
(define-key map (nth 1 x) x 'window-bar-end-width))
(define-key map (nth 2 x) x 'window-bar-end-height)) t)
))
(define-obsolete-function-alias 'font-lock-fontify-region "27.1")
(defvar font-lock-fontify-region nil)
(defun fontify-region (start end &optional region &optional start end &optional region local)
"Apply the face in region to the current buffer.
With prefix argument ARGS, apply the face to ALL elements.
If ARGS is a string, apply the face to ALL elements when that is
the first element. If ARGS is non-a, apply only the face to
all the elements. If ARGS is a single string, just apply it to the
first element, and only after the first element is changed.
Optional argument REGION can be used to override region."
;; Fixup here if we have a font file of a fixed size like vn.el
;; http://fontify.org/face-size-alist/
(with-temp-buffer
(fontify-mode)
(insert (make-vector 32 0)))
)
(defvar fontify-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [down] [keydown] 'font-lock-fontify)
)
"Keymap to fontify regions."
(or (org-export-keymap
(org-export-register 'fontify-region-map)
'(default-directory-dir global-font-lock-default-directory-directory-prefix-map))
(org-export-keymap 'fontify-region (mapcar :keys "c")
font-lock-fontify-map fontify-mode-map)
;; Make sure the face is not visible when we don't have a font
;; file in the current buffer.
("font/" font-lock-fontify
"fontify" ,(org-export-keymap :tag "Use Fontify" fontify-map))
("org-default"
======== SAMPLE 2 ========
)))))
((or (= (consp (nth 0 p) (nth 1 (nth 1 p))))
((and (= (consp (nth 0 p) (nth 2 (nth 2 p)) 3))))
t)
(setq p (1- (nth 2 p)))))
((and (<= (nth 3 p) (nth 2 p)) 0)
(setq p 1)
(setq p (1+ (nth 1 p)))
(while (and (<= (nth n) (nth 2 p))
(setq p (1+ (nth n) (nth 2 p))))
(setq p (1- (nth n))))))))
(defvar org-babel-show-error-list t
"List of error messages that should be displayed
per the following format:
NAME NAME NAME NAME NAME NAME NAME NAME NAME INFO
NAME INFO
(message-message
org-babel-show-error-list `("NAME" nil "NAME ")
(or
(and (org-show-warning-message-regexp
(org-get-message "Show Warning Message" 'org-message-list))
)
(let* ((error (org-babel-show-error-list
(org-get-message "Show Error"
'(org-export-type-category error org-export-type-category)
(org-export-type-type-function error)
(org-export-type-function `(error ,error)
'(,(list :name :label :value :start ,(lambda :value :start))))
(:group error :summary :line ,(lambda :name :line)))))
(org-message
;; (org-babel-show-warning-message-regexp
nil nil "NAME NAME INFO
(nth 0 (error-message
(nth 1 error))) ))
(message-message
(message-message
======== SAMPLE 3 ========
))
;; -3:
(- 2 (get 'vec1 'vec2))
;; -3:
(- 1 (get 'vec2 'vec3)))
(defmacro vec1 (s,s,s++)
"Return the result (s,s++) pair of s."
`(cons ... ,(get 'vec1 ',(if (< (1- s) 0) (< (1- s)))
(vector . 6 (if (consp (nth 1 s))
(nth 2 s))))
`(let ((s (nth 1 s)) ... ,(cons . 6) ,(get 'vec1 ',(if (>= (1- s) 0) (> (1- s)))
(cons . 6))))
(list . 6 (progn
(with-no-warnings
(setq s (copy-sequence s))
(nop (setq s (nreverse s))
(cons . 6))))
,s)))
(defmacro vec1 '(",,a,b" ",a,b"))
(defmacro vec1 (s , s++)
"Return the result (s, S++) pair of s."
`(cons (cons ,(get 'vec1 ',(if (> (1- s) 0) (< (1- s)))
(nth 1 s)))
,s)))
(defmacro vec1 '("")
;; -4:
(- (get 'vec1 'vec2))
;; -4:
(- 1 (get 'vec2 'vec3)))
(defmacro vec2 (s++)
"Return the result (s, S++) pair of s.
The second argument must be of the form (S++), where is the result.
The result is an alist which defines the `cdr' and `vec'. The last
argument represents the alist returned by `sapply' (here we call
`sapply2' and `vec2' together).
This alist is only used for `vec1' and `vec2' when
the first argument is `vec', and is only valid for `vec1' and
`vec2'.")
(defmacro vec2 (s++)
"Return the result (s, S++) pair of s."
`(cons . 7 'vec2)
;; -3:
(- 6 (get 'vec2 'vec3)))
(defmacro vec2 (s++)
"Return the result (s, S++) pair of s."
`(nreverse . 7 'vec2)))
(defmacro vec2 (s++)
"Return the result (s, S++) pair of s."
`(nreverse . 7 'vec2)))
(defmacro vec1 (s++)
"Return the result (s, s++) pair of s.
For `s', `cdr', this is the result (1) of `vec2', `polar(2) and
`vec2' if both of the `cdr' and the
`polar' objects are non-negatives."
`(mapcar #' (lambda (c)
(lambda (i)
;; (let ((c0 (aref (nreverse c
======== SAMPLE 4 ========
)))))
;; `(,(,(?\n ,(?\n (:background "darkgray" :bold "white"))
(?:(? (?\n '(:background "lightgrey" :bold "gray"))
:weight "red"))
;; `((,(? \n ,(?\n (:background "green" :bold "black")
:weight "yellow"))
(?:color "aqua" :foreground "<a href=\"/@%d\" alt=\"?\n alt=\"?\n \n" "
(?\n "red"))
:weight "sable"))
;; `((,(?:\n ,(?\n (:background "spruce" :weight bold :inverse :weight t t)
:weight "blue"))
(?:(?:color "blue" :foreground "<a href=\"/@%d\" alt=\"?\n alt=\"?\n \n" "
(?\n "red"))
:weight "red"))
;; `((,(? \n ,(?\n (:background "aqua" :weight bold :inverse :weight t t)
:weight "blue"))
(?:color "orange"))
;; `((,(?\n ,(?\n (:background "spruce" :weight bold :inverse :weight t t)
:weight "blue"))
(?:color "aqua"))
;; `((,(?\n ,(?\n (:background "sprucegreen" :weight bold :inverse :weight t t)
:weight "green"))
(?:color "lime"))
;; `((,(?\n ,(?\n (:background "green" :weight bold :inverse :weight t t)
:weight "yellow" :weight "red"))
(?:color "lime"))
;; `((,(?\n ,(?\n (:background "grayblue" :weight bold :inverse :weight t t)
:weight "grayblue"))
(?:color "yellow"))
;; `((,(?\n ,(?\n (:background "green" :weight bold :inverse :weight t t)
:weight "grayblue"))
(?:color "lime"))
(put 'org/hkv-mime/mime-mime-extensions 'languages 'risky-flag)
(defvar org-hk-mime-extension-citation
(if (not org-hk-mime-extension-citation) (setq org-hk-mime-extension-citation
:format "hkv-mime-extension.html?\n" :weight bold :background "black"
:weight "white"))
"Citation string for Hkv mode Emacs extensions.")
(put 'org/hkv-mime-extensions 'languages 'risky-flag)
(defvar org-hk-extension-citation org-hk-mime-extensions)
(defvar org-hk-mime-extension-citation org-hk-sftree-extension-citation)
(defvar org-hk-extension-citation org-hk-s
"%file: samples-10200"
======== SAMPLE 1 ========
-table-position)))
(or (and (consp table-nodes)
(eq position 0))
(progn
(setq table-state-table 1)
(setq table-state-table-size (1- (or (car table-nodes)
(cdr table-nodes)))
table-state-table-width (1- (or table-nodes)))
(if (or (eq (car table-nodes)
(or (bobp) (cadr table-nodes))))
(vector-char-table-count (cadr table-nodes))
(make-string str (1- str))
(vector-char-table-depth (cddr table-nodes))
(make-string str0 (1- str)))
;; Don't fill in the region of the map!
(cons str str)
(cdr table-nodes))
(setq table-state-table-count (1- (if table-nodes 0 (cdr table-nodes)))))
;; Add the map entry.
(nthcdr (1+ table-nodes) (cdr table-nodes)))))
(defun table-table-position ()
"The table position of the last buffer."
(interactive)
(unless (buffer-modified-p)
(setq buffer-modified-p (current-buffer))
(dolist (buffer buffer-modified-p
(insert " ")
(forward-line -1)
(setq buffer-npos-active-column 0)))
(insert-buffer-substring buffer (current-buffer)))))
;;;; Local Variables
(defvar table-mode-line-mode-syntax)
(custom-add-to-list 'table-mode-line-syntax t)
;; FIXME TODO: Add the variable to the list of variables in the `table-mode-line-p'
(declare-function table-mode-hook (&optional arg)
(hook))
(defcustom table-mode-line-extra-syntax "\\|\\[table-mode-line][ ]+"
"Toggle table-mode-line-mode text syntax, using the default.
\\<table-mode-syntax-table>
\\[table-mode-line-mode-syntax]
\\<table-mode-line-mode>
\\<table-mode-line-syntax-table>
\\[table-mode-line-mode]
\\<table-mode-line-syntax-table>
\\[no-hook] \\='table-mode-line-mode-syntax' t")
(message c-lisp-mode-todo)
(declare-function table-mode-syntax-table)
(declare-function table-mode-line-syntax)
(declare-function table-mode-line-syntax-table)
(declare-function table-mode-face-alist "table-mode"
(syntax-table-name-table)))
(defvar table
======== SAMPLE 2 ========
-clocking
; "clocking routines" for GNU Emacs (e.g. GNU Emacs for
; ;; GNU Emacs for GNU Emacs >=.26, with GNU
; ;; >=.25.4) with "clocking tools" to be run
;; on a minibuffer.
(read-file-name "clocking")))
;; See a function that uses this code
(if (or (symbolp clocking-common-clocking-function)
(symbolp clocking-common-buffer-object))
(let (clocking-common-clocking-function)
(dolist (elt clocking-common-clocking-function)
(setq clocking-common-clocking-function (list (pop elt))
clocking-common-clocking-function)))
;; The variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment