Mercurial > emacs
annotate lisp/electric.el @ 87828:41248ae03f06
(org-entry-properties): Include the CLOCKSUM special
property.
(org-columns-edit-value): Do not allow to edit the special
CLOCKSUM property.
(org-flag-drawer): Use the original value of `outline-regexp'.
(org-remember-handler): Add invisible-ok flag to call to
`org-end-of-subtree'
(org-agenda-highlight-todo): Respect
`org-agenda-todo-keyword-format'.
(org-agenda-todo-keyword-format): New option.
(org-infile-export-plist): No restriction while searching for
options.
(org-remember-handler): Remove comments at the end of the buffer.
(org-remember-use-refile-when-interactive): New option.
(org-table-sort-lines): Make sure sorting works on link
descritions only, and ignores the link.
(org-sort-entries-or-items): Make sure the end of the subtree is
included.
(org-refile-use-outline-path): New allowed values `file' and
`full-file-path'.
(org-get-refile-targets): Respect new values for
`org-refile-use-outline-path'.
(org-agenda-get-restriction-and-command): DEL goes back to initial
list.
(org-export-as-xoxo): Restore point when done.
(org-open-file): Allow multiple %s in command.
(org-clock-in-switch-to-state): New option.
(org-first-list-item-p): New function.
(org-last-remember-storage-locations): New variable.
(org-get-refile-targets): Interpret the new maxlevel setting.
(org-refile-targets): New option `:maxlevel'.
(org-copy-subtree): Include empty lines before but not after
subtree.
(org-back-over-empty-lines, org-skip-whitespace): New functions.
(org-move-item-down, org-move-item-up): Include empty lines before
but not after item.
(org-first-sibling-p): New function.
(org-remember-apply-template): Defaults, completions and history
for template prompts. Also, interpret new `%!' escape.
(org-context-choices): New constant.
(org-bound-and-true-p): New macro.
(org-imenu-depth): New option.
(org-imenu-markers): New variable.
(org-imenu-new-marker, org-imenu-get-tree)
(org-speedbar-set-agenda-restriction): New functions.
(org-agenda-set-restriction-lock)
(org-agenda-remove-restriction-lock, org-agenda-maybe-redo): New
functions.
(org-agenda-restriction-lock): New face.
(org-agenda-restriction-lock-overlay)
(org-speedbar-restriction-lock-overlay): New variables.
(org-open-at-point): Removed obsolete way to do redirection in
shell links.
(org-imenu-and-speedbar): New customization group.
(org-entry-properties): Return keyword-less time strings.
(org-clock-heading-function): New option.
(org-clock-in): Use `org-clock-heading-function'.
(org-calendar-holiday): Try to use `calendar-check-holidays'
instead of the obsolete `check-calendar-holidays'.
(org-export-html-special-string-regexps): New constant.
(org-massive-special-regexp): New variable.
(org-compute-latex-and-specials-regexp)
(org-do-latex-and-special-faces): New functions.
(org-latex-and-export-specials): New face.
(org-highlight-latex-fragments-and-specials): New option.
(org-link-escape-chars): Use characters instead of strings.
(org-link-escape-chars-browser, org-link-escape)
(org-link-unescape): Use characters instead of strings.
(org-export-html-convert-sub-super, org-html-do-expand): Check for
protected text.
(org-emphasis-alist): Additional `verbatim' flag.
(org-set-emph-re): Handle the verbatim flag and compute
`org-verbatim-re'.
(org-cleaned-string-for-export): Protect verbatim elements.
(org-verbatim-re): New variable.
(org-hide-emphasis-markers): New option.
(org-additional-option-like-keywords): Add new keywords.
(org-get-entry): Renamed from `org-get-cleaned-entry'.
(org-icalendar-cleanup-string): New function for quoting icalendar
text.
(org-agenda-skip-scheduled-if-done): New option.
(org-agenda-get-scheduled, org-agenda-get-blocks): Use
`org-agenda-skip-scheduled-if-done'.
(org-prepare-agenda-buffers): Allow buffers as arguments.
(org-entry-properties): Add CATEGORY as a special property.
(org-use-property-inheritance): Allow a list of properties as a
value.
(org-eval-in-calendar): No longer update the prompt.
(org-read-date-popup-calendar): Renamed from
`org-popup-calendar-for-date-prompt'.
(org-read-date-display-live): New variable.
(org-read-date-display): New function.
(org-read-date-analyze): New function.
(org-remember-apply-template): Define `remember-finalize' if it is
not yet defined.
(org-remember-insinuate): New function.
(org-read-date-prefer-future): New option.
(org-read-date): Respect the setting of
`org-read-date-prefer-future'. Use `org-read-date-analyze'.
(org-set-font-lock-defaults): Use `org-archive-tag' instead of a
hardcoded string.
(org-remember-apply-template): Use `remember-finalize' instead of
`remember-buffer'.
(org-columns-compute, org-column-number-to-string)
(org-columns-uncompile-format, org-columns-compile-format)
(org-columns-compile-format): Handle printf format specifier.
(org-columns-new, org-column-number-to-string)
(org-columns-uncompile-format, org-columns-compile-format):
Support for new currency summary type.
(org-tree-to-indirect-buffer): Do not kill old buffer when
`org-indirect-buffer-display' is `new-frame'.
(org-indirect-buffer-display): Document that `new-frame' leads to
indiret buffer proliferation.
(org-agenda-list): Use `org-extend-today-until'.
(org-extend-today-until): New option.
(org-format-org-table-html): Use lower-case for <col> tag.
(org-agenda-execute): New command.
(org-agenda-mode-map): Keybindings of "g" "G", "e" modified.
(org-select-remember-template): New function.
(org-remember-apply-template): Use `org-select-remember-template'.
(org-go-to-remember-target): New function.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Fri, 18 Jan 2008 15:07:17 +0000 |
parents | 73661ddc7ac7 |
children | 606f2d163a64 1e3a407766b9 |
rev | line source |
---|---|
38412
253f761ad37b
Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents:
14941
diff
changeset
|
1 ;;; electric.el --- window maker and Command loop for `electric' modes |
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
2 |
74439 | 3 ;; Copyright (C) 1985, 1986, 1995, 2001, 2002, 2003, 2004, |
79721 | 4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
845 | 5 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
778
diff
changeset
|
6 ;; Author: K. Shane Hartman |
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
778
diff
changeset
|
7 ;; Maintainer: FSF |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
807
diff
changeset
|
8 ;; Keywords: extensions |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
778
diff
changeset
|
9 |
35 | 10 ;; This file is part of GNU Emacs. |
11 | |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
13 ;; it under the terms of the GNU General Public License as published by | |
78236
9355f9b7bbff
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75347
diff
changeset
|
14 ;; the Free Software Foundation; either version 3, or (at your option) |
35 | 15 ;; any later version. |
16 | |
17 ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
14169 | 23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64091 | 24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
25 ;; Boston, MA 02110-1301, USA. | |
35 | 26 |
2229
bd3c525fa6fc
Added standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1821
diff
changeset
|
27 ;;; Commentary: |
35 | 28 |
584 | 29 ; zaaaaaaap |
35 | 30 |
2229
bd3c525fa6fc
Added standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1821
diff
changeset
|
31 ;;; Code: |
bd3c525fa6fc
Added standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1821
diff
changeset
|
32 |
35 | 33 ;; This loop is the guts for non-standard modes which retain control |
13260
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
34 ;; until some event occurs. It is a `do-forever', the only way out is |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
35 ;; to throw. It assumes that you have set up the keymap, window, and |
35 | 36 ;; everything else: all it does is read commands and execute them - |
37 ;; providing error messages should one occur (if there is no loop | |
38 ;; function - which see). The required argument is a tag which should | |
13260
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
39 ;; expect a value of nil if the user decides to punt. The second |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
40 ;; argument is the prompt to be used: if nil, use "->", if 'noprompt, |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
41 ;; don't use a prompt, if a string, use that string as prompt, and if |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
42 ;; a function of no variable, it will be evaluated in every iteration |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
43 ;; of the loop and its return value, which can be nil, 'noprompt or a |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
44 ;; string, will be used as prompt. Given third argument non-nil, it |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
45 ;; INHIBITS quitting unless the user types C-g at toplevel. This is |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
46 ;; so user can do things like C-u C-g and not get thrown out. Fourth |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
47 ;; argument, if non-nil, should be a function of two arguments which |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
48 ;; is called after every command is executed. The fifth argument, if |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
49 ;; provided, is the state variable for the function. If the |
35 | 50 ;; loop-function gets an error, the loop will abort WITHOUT throwing |
51 ;; (moral: use unwind-protect around call to this function for any | |
52 ;; critical stuff). The second argument for the loop function is the | |
53 ;; conditions for any error that occurred or nil if none. | |
54 | |
55 (defun Electric-command-loop (return-tag | |
56 &optional prompt inhibit-quit | |
57 loop-function loop-state) | |
13260
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
58 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
38412
diff
changeset
|
59 (let (cmd |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
38412
diff
changeset
|
60 (err nil) |
13260
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
61 (prompt-string prompt)) |
35 | 62 (while t |
13260
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
63 (if (not (or (stringp prompt) (eq prompt nil) (eq prompt 'noprompt))) |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
64 (setq prompt-string (funcall prompt))) |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
65 (if (not (stringp prompt-string)) |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
66 (if (eq prompt-string 'noprompt) |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
67 (setq prompt-string nil) |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
68 (setq prompt-string "->"))) |
a10616f0ad17
(Electric-command-loop): Don't display a prompt
Richard M. Stallman <rms@gnu.org>
parents:
3439
diff
changeset
|
69 (setq cmd (read-key-sequence prompt-string)) |
35 | 70 (setq last-command-char (aref cmd (1- (length cmd))) |
14941
7e8ee35d0fb9
(Electric-command-loop): Set universal-argument-other-key to 0.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
71 this-command (key-binding cmd t) |
35 | 72 cmd this-command) |
14941
7e8ee35d0fb9
(Electric-command-loop): Set universal-argument-other-key to 0.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
73 ;; This makes universal-argument-other-key work. |
7e8ee35d0fb9
(Electric-command-loop): Set universal-argument-other-key to 0.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
74 (setq universal-argument-num-events 0) |
35 | 75 (if (or (prog1 quit-flag (setq quit-flag nil)) |
3439
13660e63d8f0
(Electric-command-loop): Use eq to compare events.
Richard M. Stallman <rms@gnu.org>
parents:
2540
diff
changeset
|
76 (eq last-input-char ?\C-g)) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1609
diff
changeset
|
77 (progn (setq unread-command-events nil |
35 | 78 prefix-arg nil) |
79 ;; If it wasn't cancelling a prefix character, then quit. | |
80 (if (or (= (length (this-command-keys)) 1) | |
81 (not inhibit-quit)) ; safety | |
82 (progn (ding) | |
83 (message "Quit") | |
84 (throw return-tag nil)) | |
85 (setq cmd nil)))) | |
86 (setq current-prefix-arg prefix-arg) | |
87 (if cmd | |
88 (condition-case conditions | |
89 (progn (command-execute cmd) | |
703
e2780d9a814c
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
90 (setq last-command this-command) |
35 | 91 (if (or (prog1 quit-flag (setq quit-flag nil)) |
3439
13660e63d8f0
(Electric-command-loop): Use eq to compare events.
Richard M. Stallman <rms@gnu.org>
parents:
2540
diff
changeset
|
92 (eq last-input-char ?\C-g)) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1609
diff
changeset
|
93 (progn (setq unread-command-events nil) |
35 | 94 (if (not inhibit-quit) |
95 (progn (ding) | |
96 (message "Quit") | |
97 (throw return-tag nil)) | |
98 (ding))))) | |
99 (buffer-read-only (if loop-function | |
100 (setq err conditions) | |
101 (ding) | |
102 (message "Buffer is read-only") | |
103 (sit-for 2))) | |
104 (beginning-of-buffer (if loop-function | |
105 (setq err conditions) | |
106 (ding) | |
107 (message "Beginning of Buffer") | |
108 (sit-for 2))) | |
109 (end-of-buffer (if loop-function | |
110 (setq err conditions) | |
111 (ding) | |
112 (message "End of Buffer") | |
113 (sit-for 2))) | |
114 (error (if loop-function | |
115 (setq err conditions) | |
116 (ding) | |
117 (message "Error: %s" | |
118 (if (eq (car conditions) 'error) | |
119 (car (cdr conditions)) | |
120 (prin1-to-string conditions))) | |
121 (sit-for 2)))) | |
122 (ding)) | |
123 (if loop-function (funcall loop-function loop-state err)))) | |
124 (ding) | |
125 (throw return-tag nil)) | |
126 | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
38412
diff
changeset
|
127 ;; This function is like pop-to-buffer, sort of. |
35 | 128 ;; The algorithm is |
129 ;; If there is a window displaying buffer | |
130 ;; Select it | |
131 ;; Else if there is only one window | |
132 ;; Split it, selecting the window on the bottom with height being | |
133 ;; the lesser of max-height (if non-nil) and the number of lines in | |
134 ;; the buffer to be displayed subject to window-min-height constraint. | |
135 ;; Else | |
136 ;; Switch to buffer in the current window. | |
137 ;; | |
138 ;; Then if max-height is nil, and not all of the lines in the buffer | |
778 | 139 ;; are displayed, grab the whole frame. |
35 | 140 ;; |
141 ;; Returns selected window on buffer positioned at point-min. | |
142 | |
143 (defun Electric-pop-up-window (buffer &optional max-height) | |
144 (let* ((win (or (get-buffer-window buffer) (selected-window))) | |
145 (buf (get-buffer buffer)) | |
146 (one-window (one-window-p t)) | |
147 (pop-up-windows t) | |
59315
c5ee87e89147
(Electric-pop-up-window): Use fit-window-to-buffer
Richard M. Stallman <rms@gnu.org>
parents:
54575
diff
changeset
|
148 (pop-up-frames nil)) |
35 | 149 (if (not buf) |
150 (error "Buffer %s does not exist" buffer) | |
151 (cond ((and (eq (window-buffer win) buf)) | |
152 (select-window win)) | |
153 (one-window | |
154 (pop-to-buffer buffer) | |
59315
c5ee87e89147
(Electric-pop-up-window): Use fit-window-to-buffer
Richard M. Stallman <rms@gnu.org>
parents:
54575
diff
changeset
|
155 (setq win (selected-window))) |
35 | 156 (t |
157 (switch-to-buffer buf))) | |
59315
c5ee87e89147
(Electric-pop-up-window): Use fit-window-to-buffer
Richard M. Stallman <rms@gnu.org>
parents:
54575
diff
changeset
|
158 (fit-window-to-buffer win max-height) |
35 | 159 (goto-char (point-min)) |
160 win))) | |
584 | 161 |
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
162 (provide 'electric) |
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
163 |
52401 | 164 ;;; arch-tag: dae045eb-dc2d-4fb7-9f27-9cc2ce277be8 |
2229
bd3c525fa6fc
Added standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1821
diff
changeset
|
165 ;;; electric.el ends here |