diff options
| author | Tom Tromey | 2013-01-16 11:48:32 -0700 |
|---|---|---|
| committer | Tom Tromey | 2013-01-16 11:48:32 -0700 |
| commit | 6f4de085f065e11f4df3195d47479f28f5ef08ba (patch) | |
| tree | 1211a00f1afc86c2b73624897993db02a4852943 /lisp | |
| parent | e078a23febca14bc919c5806670479c395e3253e (diff) | |
| parent | ffe04adc88e546c406f9b050238fb98a7243c7a0 (diff) | |
| download | emacs-6f4de085f065e11f4df3195d47479f28f5ef08ba.tar.gz emacs-6f4de085f065e11f4df3195d47479f28f5ef08ba.zip | |
merge from trunk
Diffstat (limited to 'lisp')
107 files changed, 3140 insertions, 1225 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f2c6b569126..f324ebbad51 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,480 @@ | |||
| 1 | 2013-01-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/nadvice.el (advice--tweak): Make it possible for `tweak' | ||
| 4 | to return an explicit nil. | ||
| 5 | (advice--remove-function): Change accordingly. | ||
| 6 | |||
| 7 | * emacs-lisp/advice.el (ad-preactivate-advice): Adjust the cleanup to | ||
| 8 | the use of nadvice.el. | ||
| 9 | |||
| 10 | * progmodes/which-func.el (which-function): Silence imenu errors | ||
| 11 | (bug#13433). | ||
| 12 | |||
| 13 | 2013-01-15 Michael R. Mauger <mmaug@yahoo.com> | ||
| 14 | |||
| 15 | * progmodes/sql.el: (sql-imenu-generic-expression): | ||
| 16 | (sql-mode-font-lock-object-name): Match schema qualified names. | ||
| 17 | (sql-connect): Use string keys. | ||
| 18 | (sql-product-interactive): Wait for interpreter prompt. | ||
| 19 | (sql-comint-oracle): Set process coding based on NLS_LANG. | ||
| 20 | |||
| 21 | 2013-01-15 Michael R. Mauger <mmaug@yahoo.com> | ||
| 22 | |||
| 23 | * progmodes/sql.el (sql-output-to-send): Remove, unused. | ||
| 24 | (sql-interactive-remove-continuation-prompt): | ||
| 25 | (sql-send-magic-terminator, sql-interactive-mode): Remove references. | ||
| 26 | |||
| 27 | 2013-01-14 Leo Liu <sdl.web@gmail.com> | ||
| 28 | |||
| 29 | * calendar/calendar.el (calendar-redraw): Sync window-point and point. | ||
| 30 | (Bug#13420) | ||
| 31 | |||
| 32 | 2013-01-14 Glenn Morris <rgm@gnu.org> | ||
| 33 | |||
| 34 | * progmodes/compile.el (compilation-error-regexp-alist-alist): | ||
| 35 | Fix interpretation of gnu line.col1-col2 format. (Bug#13335) | ||
| 36 | |||
| 37 | 2013-01-13 Fabián Ezequiel Gallina <fgallina@cuca> | ||
| 38 | |||
| 39 | * progmodes/python.el (python-nav-end-of-statement): | ||
| 40 | Fix cornercase when handling multiline strings. | ||
| 41 | |||
| 42 | 2013-01-13 Richard Stallman <rms@gnu.org> | ||
| 43 | |||
| 44 | * mail/sendmail.el (mail-position-on-field): Add doc string. | ||
| 45 | |||
| 46 | * mail/rmailmm.el (rmail-insert-mime-forwarded-message): | ||
| 47 | Get current message boundaries and pass them to | ||
| 48 | message-forward-make-body-mime. Minor style changes. | ||
| 49 | |||
| 50 | 2013-01-13 Eli Zaretskii <eliz@gnu.org> | ||
| 51 | |||
| 52 | * cus-start.el (all): Avoid warnings about | ||
| 53 | scroll-bar-adjust-thumb-portion on platforms where it is not defined. | ||
| 54 | |||
| 55 | 2013-01-11 Jan Djärv <jan.h.d@swipnet.se> | ||
| 56 | |||
| 57 | * cus-start.el (all): Add scroll-bar-adjust-thumb-portion. | ||
| 58 | |||
| 59 | 2013-01-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 60 | |||
| 61 | * jit-lock.el (jit-lock-debug-mode): New minor mode. | ||
| 62 | (jit-lock--debug-fontifying): New var. | ||
| 63 | (jit-lock--debug-fontify): New function. | ||
| 64 | * subr.el (condition-case-unless-debug): Don't prevent catching the | ||
| 65 | error, just let the debbugger run. | ||
| 66 | * emacs-lisp/timer.el (timer-event-handler): Don't prevent debugging | ||
| 67 | timer code and don't drop errors silently. | ||
| 68 | |||
| 69 | 2013-01-12 Michael Albinus <michael.albinus@gmx.de> | ||
| 70 | |||
| 71 | * autorevert.el (auto-revert-notify-watch-descriptor): Give it | ||
| 72 | `permanent-local' property. | ||
| 73 | (auto-revert-notify-handler): Use `file-equal-p'. | ||
| 74 | |||
| 75 | 2013-01-12 Eli Zaretskii <eliz@gnu.org> | ||
| 76 | |||
| 77 | * autorevert.el (auto-revert-notify-handler): Fix filtering of | ||
| 78 | file notification by ACTION. For filtering by file name, compare | ||
| 79 | only the non-directory part of the file name. | ||
| 80 | |||
| 81 | 2013-01-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 82 | |||
| 83 | * autorevert.el: Use cl-lib instead of cl. | ||
| 84 | |||
| 85 | * vc/vc-bzr.el (vc-bzr--sanitize-header): New function (bug#13307). | ||
| 86 | (vc-bzr-checkin): Use it. | ||
| 87 | * vc/log-edit.el (log-edit-extract-headers): Don't presume FUNCTION | ||
| 88 | will preserve match-data. | ||
| 89 | |||
| 90 | 2013-01-11 Felix H. Dahlke <fhd@ubercode.de> | ||
| 91 | |||
| 92 | * progmodes/js.el: Fix multiline declarations's indentation (bug#8576). | ||
| 93 | (js--declaration-keyword-re): New var. | ||
| 94 | (js--multi-line-declaration-indentation): New function. | ||
| 95 | (js--proper-indentation): Use it. | ||
| 96 | |||
| 97 | 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com> | ||
| 98 | |||
| 99 | * calc/calc.el (calc-highlight-selections-with-faces) | ||
| 100 | (calc-dispatch): | ||
| 101 | * comint.el (comint-history-isearch-message): | ||
| 102 | * emacs-lisp/edebug.el (edebug-read, edebug-eval-defun): | ||
| 103 | * ffap.el (ffap-string-at-point-region, ffap-next) | ||
| 104 | (ffap-string-at-point, ffap-string-around) | ||
| 105 | (ffap-copy-string-as-kill, ffap-highlight-overlay) | ||
| 106 | (ffap-literally): | ||
| 107 | * font-lock.el (font-lock-keywords-alist) | ||
| 108 | (font-lock-removed-keywords-alist): | ||
| 109 | * help-mode.el (help-xref-symbol-regexp): | ||
| 110 | * info.el (Info-find-emacs-command-nodes): | ||
| 111 | * international/mule.el (add-to-coding-system-list): | ||
| 112 | * isearch.el (isearch-message-function, isearch-fail-pos): | ||
| 113 | * misearch.el (multi-isearch-next-buffer-function): | ||
| 114 | * newcomment.el (comment-box): | ||
| 115 | * printing.el (pr-txt-printer-alist, pr-ps-printer-alist) | ||
| 116 | (pr-setting-database): | ||
| 117 | * progmodes/cc-fonts.el (c-font-lock-keywords-3) | ||
| 118 | (c++-font-lock-keywords-3, objc-font-lock-keywords-3) | ||
| 119 | (java-font-lock-keywords-3, idl-font-lock-keywords-3) | ||
| 120 | (pike-font-lock-keywords-3): | ||
| 121 | * progmodes/compile.el (compile): | ||
| 122 | * progmodes/etags.el (tags-table-files) | ||
| 123 | (tags-table-files-function, tags-included-tables-function): | ||
| 124 | * progmodes/gdb-mi.el (gdb, gdb-setup-windows) | ||
| 125 | (gdb-restore-windows): | ||
| 126 | * ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces) | ||
| 127 | (ps-n-up-filling-database): | ||
| 128 | * server.el (server-buffer, server-log): | ||
| 129 | * simple.el (newline, delete-backward-char, delete-forward-char) | ||
| 130 | (minibuffer-history-isearch-message, kill-line, track-eol) | ||
| 131 | (temporary-goal-column): | ||
| 132 | * textmodes/flyspell.el (flyspell-mark-duplications-flag) | ||
| 133 | (flyspell-default-deplacement-commands): | ||
| 134 | * textmodes/ispell.el (ispell-accept-output): | ||
| 135 | * textmodes/sgml-mode.el (html-tag-help): | ||
| 136 | * vc/compare-w.el (compare-ignore-whitespace) | ||
| 137 | (compare-ignore-case, compare-windows-dehighlight): | ||
| 138 | * vc/diff.el (diff): | ||
| 139 | * whitespace.el (whitespace-point) | ||
| 140 | (whitespace-font-lock-refontify, whitespace-bob-marker) | ||
| 141 | (whitespace-eob-marker): Fix ambiguous doc string cross-reference(s). | ||
| 142 | |||
| 143 | 2013-01-11 Michael Albinus <michael.albinus@gmx.de> | ||
| 144 | |||
| 145 | * autorevert.el (top): Require 'cl in order to pacify byte compiler. | ||
| 146 | (auto-revert-notify-rm-watch): Ignore errors. | ||
| 147 | (auto-revert-notify-add-watch): Ignore errors. Use '(modify) for | ||
| 148 | inotify, and '(size last-write-time) for w32notify. | ||
| 149 | Set buffer-local `auto-revert-use-notify' to nil when adding a file | ||
| 150 | watch fails - this is a fallback to the file modification check. | ||
| 151 | (auto-revert-notify-event-p, auto-revert-notify-event-descriptor) | ||
| 152 | (auto-revert-notify-event-action) | ||
| 153 | (auto-revert-notify-event-file-name): New defuns. | ||
| 154 | (auto-revert-notify-handler): Use them. Implement first | ||
| 155 | plausibility checks. | ||
| 156 | (auto-revert-handler): Handle also `auto-revert-tail-mode'. | ||
| 157 | |||
| 158 | 2013-01-11 Julien Danjou <julien@danjou.info> | ||
| 159 | |||
| 160 | * color.el (color-rgb-to-hsv): Fix conversion computing in case min and | ||
| 161 | max are almost equal. Also return the correct value for V which is | ||
| 162 | already between 0 and 1. | ||
| 163 | |||
| 164 | 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 165 | |||
| 166 | * emacs-lisp/ert.el (ert-run-test): Use point-max-marker. | ||
| 167 | |||
| 168 | 2013-01-11 Eli Zaretskii <eliz@gnu.org> | ||
| 169 | |||
| 170 | * autorevert.el (auto-revert-notify-rm-watch) | ||
| 171 | (auto-revert-notify-add-watch): Fix typos in w32notify function | ||
| 172 | names. | ||
| 173 | |||
| 174 | 2013-01-10 Michael Albinus <michael.albinus@gmx.de> | ||
| 175 | |||
| 176 | * autorevert.el (auto-revert-notify-enabled): Move up. | ||
| 177 | (auto-revert-use-notify): New defcustom. | ||
| 178 | (auto-revert-mode, global-auto-revert-mode) | ||
| 179 | (auto-revert-notify-add-watch, auto-revert-handler) | ||
| 180 | (auto-revert-buffers): Use `auto-revert-use-notify' instead of | ||
| 181 | `auto-revert-notify-enabled'. | ||
| 182 | |||
| 183 | 2013-01-10 Elias Pipping <pipping@exherbo.org> | ||
| 184 | |||
| 185 | * files.el (auto-mode-alist): Use doc-view for djvu files (bug#13164). | ||
| 186 | * doc-view.el (doc-view-document->bitmap): | ||
| 187 | Use doc-view-single-page-converter-function instead of | ||
| 188 | single-page-converter arg; adjust callers. | ||
| 189 | |||
| 190 | 2013-01-10 Feng Li <fengli@gmail.com> (tiny change) | ||
| 191 | |||
| 192 | * progmodes/which-func.el (which-function): Understand Semantic's use | ||
| 193 | of overlays in imenu--index-alist. | ||
| 194 | |||
| 195 | 2013-01-10 Wolfgang Jenkner <wjenkner@inode.at> | ||
| 196 | |||
| 197 | * man.el: Handle different "man -k" behaviors (bug#13160). Use utf-8. | ||
| 198 | (Man-man-k-use-anchor): New var. | ||
| 199 | (Man-parse-man-k): New function. | ||
| 200 | (Man-completion-table): Use it. | ||
| 201 | (man): Flush the completion cache between uses. | ||
| 202 | |||
| 203 | 2013-01-10 Michael Albinus <michael.albinus@gmx.de> | ||
| 204 | |||
| 205 | * autorevert.el: Add file watch support. | ||
| 206 | (auto-revert-notify-enabled): New defconst. | ||
| 207 | (auto-revert-notify-watch-descriptor-hash-list) | ||
| 208 | (auto-revert-notify-watch-descriptor) | ||
| 209 | (auto-revert-notify-modified-p): New defvars. | ||
| 210 | (auto-revert-notify-rm-watch, auto-revert-notify-add-watch) | ||
| 211 | (auto-revert-notify-handler): New defuns. | ||
| 212 | (auto-revert-mode, global-auto-revert-mode): Remove file watches | ||
| 213 | when mode is disabled. | ||
| 214 | (auto-revert-handler): Check for `auto-revert-notify-modified-p'. | ||
| 215 | (auto-revert-buffers): Add file watches for active buffers. | ||
| 216 | |||
| 217 | 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 218 | |||
| 219 | * cus-start.el (toplevel): Only allow float values for | ||
| 220 | scroll-up-aggressively and scroll-down-aggressively. | ||
| 221 | Allow any number for line-spacing. | ||
| 222 | |||
| 223 | 2013-01-10 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 224 | |||
| 225 | * doc-view.el (doc-view-pdfdraw-program): Allow "pdfdraw" name. | ||
| 226 | (doc-view-pdf->png-converter-function): Use mupdf if available. | ||
| 227 | (doc-view-djvu->png-converter-function) | ||
| 228 | (doc-view-ps->png-converter-function): Remove. | ||
| 229 | (doc-view--image-file-pattern): Replace doc-view--image-file-extension. | ||
| 230 | (doc-view-goto-page, doc-view-convert-current-doc, doc-view-display) | ||
| 231 | (doc-view-already-converted-p): Adjust accordingly. | ||
| 232 | (doc-view-mode-p): Simplify. | ||
| 233 | (doc-view-enlarge): Use setq-local. | ||
| 234 | (doc-view-pdf->png-converter-ghostscript) | ||
| 235 | (doc-view-djvu->png-converter-ddjvu) | ||
| 236 | (doc-view-pdf->png-converter-mupdf): Rework to call | ||
| 237 | doc-view-start-process directly. | ||
| 238 | (doc-view-pdf/ps->png): Simplify accordingly. | ||
| 239 | (doc-view-pdf->png-1, doc-view-djvu->png-1): Remove. | ||
| 240 | (doc-view-document->bitmap): Rename from doc-view-document->png. | ||
| 241 | (doc-view-convert-current-doc): Merge pdf and djvu cases. | ||
| 242 | (doc-view-set-slice-from-bounding-box): Fix completion table. | ||
| 243 | (doc-view-mode): Use add-hook for after-revert-hook. | ||
| 244 | |||
| 245 | 2013-01-10 Glenn Morris <rgm@gnu.org> | ||
| 246 | |||
| 247 | * emacs-lisp/authors.el (authors-ignored-files) | ||
| 248 | (authors-valid-file-names, authors-renamed-files-alist): | ||
| 249 | Add some more entries. | ||
| 250 | |||
| 251 | 2013-01-10 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 252 | |||
| 253 | * image-mode.el (image-mode-winprops): Don't throw away the fallback | ||
| 254 | `t' pseudo-window entry. | ||
| 255 | |||
| 256 | 2013-01-10 Alan Mackenzie <acm@muc.de> | ||
| 257 | |||
| 258 | Fix bugs in the c-parse-state mechanism. Reuse some markers | ||
| 259 | instead of continually generating new ones. | ||
| 260 | |||
| 261 | * progmodes/cc-engine.el (c-state-old-cpp-beg-marker) | ||
| 262 | (c-state-old-cpp-end-marker): New variables. | ||
| 263 | (c-append-lower-brace-pair-to-state-cache): Start a backward | ||
| 264 | search for "}" definitively outside CPP constructs. | ||
| 265 | (c-remove-stale-state-cache): Inform the caller of a need to | ||
| 266 | search back for a brace pair in certain circumstances. | ||
| 267 | (c-state-maybe-marker): New macro. | ||
| 268 | (c-parse-state): Reuse markers when appropriate. | ||
| 269 | |||
| 270 | 2013-01-10 Glenn Morris <rgm@gnu.org> | ||
| 271 | |||
| 272 | * simple.el (execute-extended-command): Doc fix. | ||
| 273 | Bind prefix-arg around read-extended-command, for prompt. (Bug#13395) | ||
| 274 | |||
| 275 | 2013-01-10 Chong Yidong <cyd@gnu.org> | ||
| 276 | |||
| 277 | * faces.el (read-face-name): Doc fix. | ||
| 278 | |||
| 279 | 2013-01-10 Roland Winkler <winkler@gnu.org> | ||
| 280 | |||
| 281 | * emacs-lisp/crm.el: Allow any regexp for separators. | ||
| 282 | (crm-default-separator): All spaces around the default comma separator. | ||
| 283 | (crm--completion-command): New macro. | ||
| 284 | (crm-completion-help, crm-complete, crm-complete-word): Use it. | ||
| 285 | (crm-complete-and-exit): Handle non-single-char separators. | ||
| 286 | |||
| 287 | 2013-01-09 Elias Pipping <pipping@lavabit.com> | ||
| 288 | |||
| 289 | * doc-view.el: Add support for DjVu (bug#13164). | ||
| 290 | (doc-view-djvu->png-converter-function): New config var. | ||
| 291 | (doc-view-single-page-converter-function, doc-view--image-type) | ||
| 292 | (doc-view--image-file-extension): New vars. | ||
| 293 | (doc-view-mode): Initialize them. | ||
| 294 | (doc-view-goto-page): Use them. | ||
| 295 | (doc-view-mode-p): Add support for ddjvu. | ||
| 296 | (doc-view-djvu->png-converter-ddjvu, doc-view-djvu->png-1) | ||
| 297 | (doc-view-set-up-single-converter): New funs. | ||
| 298 | (doc-view-pdf/ps->png): Extend for djvu. | ||
| 299 | (doc-view-document->png): Rename from doc-view-pdf->png. | ||
| 300 | (doc-view-convert-current-doc): Handle djvu. | ||
| 301 | (doc-view-insert-image, doc-view-display) | ||
| 302 | (doc-view-already-converted-p): Don't hardcode png. | ||
| 303 | (doc-view-set-doc-type): Recognize djvu docs. | ||
| 304 | |||
| 305 | 2013-01-09 Elias Pipping <pipping@lavabit.com> | ||
| 306 | |||
| 307 | * doc-view.el: Add support for mupdf converter (bug#13164). | ||
| 308 | (doc-view-pdfdraw-program, doc-view-pdf->png-converter-function) | ||
| 309 | (doc-view-ps->png-converter-function): New config vars. | ||
| 310 | (doc-view-pdf->png-converter-ghostscript) | ||
| 311 | (doc-view-ps->png-converter-ghostscript) | ||
| 312 | (doc-view-pdf->png-converter-mupdf): New functions. | ||
| 313 | (doc-view-pdf/ps->png, doc-view-pdf->png-1): Use them. | ||
| 314 | |||
| 315 | 2013-01-09 Jürgen Hötzel <juergen@archlinux.org> | ||
| 316 | |||
| 317 | * net/tramp.el (tramp-eshell-directory-change): Check remote-path | ||
| 318 | first in session cache: When `tramp-own-remote-path' is in | ||
| 319 | `tramp-remote-path', the remote path is only set in the session | ||
| 320 | cache. | ||
| 321 | |||
| 322 | 2013-01-09 Glenn Morris <rgm@gnu.org> | ||
| 323 | |||
| 324 | * emacs-lisp/trace.el (trace-function-foreground) | ||
| 325 | (trace-function-background): Doc fix. | ||
| 326 | |||
| 327 | 2013-01-09 Juri Linkov <juri@jurta.org> | ||
| 328 | |||
| 329 | * international/mule-cmds.el (read-char-by-name): Move let-binding | ||
| 330 | of completion-ignore-case around completing-read to fix regression | ||
| 331 | exhibited by the test case `C-x 8 RET *acc TAB' and caused by | ||
| 332 | `string-match-p' using the nil value of `case-fold-search' and | ||
| 333 | `completion-ignore-case' in `completion-pcm--all-completions'. | ||
| 334 | (Bug#12615). | ||
| 335 | |||
| 336 | 2013-01-09 Glenn Morris <rgm@gnu.org> | ||
| 337 | |||
| 338 | * progmodes/compile.el (compilation-parse-errors): | ||
| 339 | Fix typo. (Bug#13369) | ||
| 340 | |||
| 341 | 2013-01-09 Vitalie Spinu <spinuvit@gmail.com> (tiny change) | ||
| 342 | |||
| 343 | * comint.el (comint-send-input): Check size of buffer before | ||
| 344 | waiting for process output, in case already accepted. (Bug#13290) | ||
| 345 | |||
| 346 | 2013-01-09 Paul Eggert <eggert@cs.ucla.edu> | ||
| 347 | |||
| 348 | Spelling fixes. | ||
| 349 | * net/tramp-adb.el (tramp-adb-get-toolbox): | ||
| 350 | Fix misspelling of 'unknown'. | ||
| 351 | |||
| 352 | 2013-01-08 Juri Linkov <juri@jurta.org> | ||
| 353 | |||
| 354 | * textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate): | ||
| 355 | * progmodes/flymake.el (flymake-errline, flymake-warnline): | ||
| 356 | Use underline style wave on terminals that support it. (Bug#13000) | ||
| 357 | |||
| 358 | 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 359 | |||
| 360 | * emacs-lisp/pcase.el (pcase--split-equal): Also take advantage if | ||
| 361 | the predicate returns nil. | ||
| 362 | |||
| 363 | * simple.el: Use lexical-binding. | ||
| 364 | (primitive-undo): Use pcase. | ||
| 365 | (minibuffer-history-isearch-push-state): Use a closure. | ||
| 366 | |||
| 367 | 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com> | ||
| 368 | |||
| 369 | * simple.el (primitive-undo): Move from undo.c. | ||
| 370 | |||
| 371 | 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 372 | |||
| 373 | * vc/pcvs.el (cvs-cleanup-collection): Extend meaning of `rm-handled'. | ||
| 374 | (cvs-mode-remove-handled): Use it (bug#13380). | ||
| 375 | |||
| 376 | * emacs-lisp/nadvice.el (advice--tweak): New function. | ||
| 377 | (advice--remove-function, advice--subst-main): Use it. | ||
| 378 | |||
| 379 | * emacs-lisp/advice.el: Update commentary. | ||
| 380 | |||
| 381 | 2013-01-08 Michael Albinus <michael.albinus@gmx.de> | ||
| 382 | |||
| 383 | * net/tramp-adb.el (tramp-adb-file-name-handler-alist): | ||
| 384 | Remove spurious entry. | ||
| 385 | |||
| 386 | 2013-01-08 Glenn Morris <rgm@gnu.org> | ||
| 387 | |||
| 388 | * net/tramp.el (tramp-default-host-alist): Add :version. | ||
| 389 | |||
| 390 | 2013-01-08 Juri Linkov <juri@jurta.org> | ||
| 391 | |||
| 392 | * info.el (Info-read-node-name-2): Don't duplicate suffixes for | ||
| 393 | single completion. (Bug#12456) | ||
| 394 | (info--manual-names): Expand node completions into an explicit list | ||
| 395 | before appending it to another list. Filter out internal buffers | ||
| 396 | with the leading space in the buffer name. (Bug#10771) | ||
| 397 | |||
| 398 | 2013-01-08 Juri Linkov <juri@jurta.org> | ||
| 399 | |||
| 400 | * info.el (Info-read-node-name-1): Allow empty node name in (FILENAME) | ||
| 401 | that defaults to the Top node. | ||
| 402 | (Info-goto-node, Info-read-node-name): Doc fix to mention that | ||
| 403 | the short format (FILENAME) goes to the Top node. | ||
| 404 | (Info-build-node-completions): Rename arg `file' to `filename'. | ||
| 405 | (Bug#13365) | ||
| 406 | |||
| 407 | 2013-01-07 Bastien Guerry <bzg@gnu.org> | ||
| 408 | |||
| 409 | * menu-bar.el (menu-bar-search-documentation-menu): | ||
| 410 | Use `apropos-user-option' and fix the help message. | ||
| 411 | |||
| 412 | 2013-01-07 Bastien Guerry <bzg@gnu.org> | ||
| 413 | |||
| 414 | * apropos.el (apropos-do-all): Update docstring. | ||
| 415 | (apropos-user-option-button): New face. | ||
| 416 | (apropos-user-option): Rename from `apropos-variable' and update | ||
| 417 | docstring. | ||
| 418 | (apropos-variable): Rewrite, now show all variables by default. | ||
| 419 | (apropos-print): Mention "User option" instead of "Variable" when | ||
| 420 | printing doc for user options. (Bug#13276) | ||
| 421 | |||
| 422 | 2013-01-07 Jürgen Hötzel <juergen@archlinux.org> | ||
| 423 | |||
| 424 | * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): | ||
| 425 | Handle filename correctly, when parsing "source -> target" symlink | ||
| 426 | output. | ||
| 427 | (tramp-adb-handle-set-file-times): New defun. | ||
| 428 | |||
| 429 | 2013-01-07 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 430 | |||
| 431 | * emacs-lisp/advice.el (ad-activate-advised-definition): Refresh the | ||
| 432 | advice list when the interactive-spec of ad-Advice-* changes. | ||
| 433 | |||
| 434 | 2013-01-07 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 435 | |||
| 436 | * wid-edit.el (widget-default-get): Work for inlined elements. | ||
| 437 | (Bug#12670) | ||
| 438 | |||
| 439 | 2013-01-07 Michael Albinus <michael.albinus@gmx.de> | ||
| 440 | |||
| 441 | * net/tramp.el (tramp-default-host-alist): New defcustom. | ||
| 442 | (tramp-find-host): Use it. | ||
| 443 | (tramp-eshell-directory-change): Move from tramp-sh.el. Add to | ||
| 444 | `eshell-directory-change-hook'. | ||
| 445 | |||
| 446 | * net/tramp-adb.el (top): Add adb specific entry in | ||
| 447 | `tramp-default-host-alist'. | ||
| 448 | (tramp-adb-file-name-host): Remove function. | ||
| 449 | (tramp-adb-execute-adb-command, tramp-adb-maybe-open-connection): | ||
| 450 | Use `tramp-file-name-host' instead of `tramp-adb-file-name-host'. | ||
| 451 | |||
| 452 | * net/tramp-sh.el: Move eshell integration code to tramp.el. | ||
| 453 | |||
| 454 | 2013-01-06 Jürgen Hötzel <juergen@archlinux.org> | ||
| 455 | |||
| 456 | * net/tramp-adb.el (tramp-methods): Add `tramp-tmpdir' entry. | ||
| 457 | |||
| 458 | 2013-01-06 Michael Albinus <michael.albinus@gmx.de> | ||
| 459 | |||
| 460 | * net/tramp-adb.el (tramp-adb-ls-toolbox-regexp): The file size can | ||
| 461 | consist of more than one digit. | ||
| 462 | (tramp-adb-file-name-handler-alist): | ||
| 463 | Use `tramp-handle-file-exists-p' consistently. | ||
| 464 | (tramp-adb-file-name-handler): Don't tweak `tramp-default-host'. | ||
| 465 | (tramp-adb-handle-file-exists-p): Remove function. | ||
| 466 | (tramp-adb-file-name-host): New defun. | ||
| 467 | (tramp-adb-execute-adb-command, tramp-adb-maybe-open-connection): | ||
| 468 | Use it. | ||
| 469 | (tramp-adb-maybe-open-connection): Set "remote-path" property. | ||
| 470 | |||
| 471 | 2013-01-06 Chong Yidong <cyd@gnu.org> | ||
| 472 | |||
| 473 | * vc/vc.el (vc-next-action): Detect buffer modifications | ||
| 474 | conflicting with locking VCS operation (Bug#11490). | ||
| 475 | |||
| 476 | * vc/vc-hooks.el (vc-after-save): DTRT for locking VCSes. | ||
| 477 | |||
| 1 | 2013-01-05 Michael Albinus <michael.albinus@gmx.de> | 478 | 2013-01-05 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 479 | ||
| 3 | * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): | 480 | * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): |
| @@ -117,8 +594,8 @@ | |||
| 117 | (tramp-do-copy-or-rename-file): Ignore errors when calling | 594 | (tramp-do-copy-or-rename-file): Ignore errors when calling |
| 118 | `set-file-extended-attributes'. | 595 | `set-file-extended-attributes'. |
| 119 | 596 | ||
| 120 | * net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add | 597 | * net/tramp-smb.el (tramp-smb-file-name-handler-alist): |
| 121 | handler for `file-acl'. | 598 | Add handler for `file-acl'. |
| 122 | (tramp-smb-handle-file-acl): New defun. | 599 | (tramp-smb-handle-file-acl): New defun. |
| 123 | 600 | ||
| 124 | 2013-01-02 Jay Belanger <jay.p.belanger@gmail.com> | 601 | 2013-01-02 Jay Belanger <jay.p.belanger@gmail.com> |
| @@ -310,7 +787,7 @@ | |||
| 310 | 787 | ||
| 311 | * net/tramp-adb.el (tramp-adb-get-ls-command): New defun. | 788 | * net/tramp-adb.el (tramp-adb-get-ls-command): New defun. |
| 312 | Suppress coloring, if possible (required for BusyBox based systems like | 789 | Suppress coloring, if possible (required for BusyBox based systems like |
| 313 | CynagenMod). | 790 | CyanogenMod). |
| 314 | (tramp-adb-handle-file-attributes) | 791 | (tramp-adb-handle-file-attributes) |
| 315 | (tramp-adb-handle-insert-directory) | 792 | (tramp-adb-handle-insert-directory) |
| 316 | (tramp-adb-handle-file-name-all-completions): Use it. | 793 | (tramp-adb-handle-file-name-all-completions): Use it. |
| @@ -5754,7 +6231,7 @@ | |||
| 5754 | 6231 | ||
| 5755 | 2012-08-08 Fabián Ezequiel Gallina <fgallina@cuca> | 6232 | 2012-08-08 Fabián Ezequiel Gallina <fgallina@cuca> |
| 5756 | 6233 | ||
| 5757 | * progmodes/python.el Fixed defsubst warning. | 6234 | * progmodes/python.el: Fix defsubst warning. |
| 5758 | (python-syntax-context) Rename from python-info-ppss-context. | 6235 | (python-syntax-context) Rename from python-info-ppss-context. |
| 5759 | (python-syntax-context-type): Rename from | 6236 | (python-syntax-context-type): Rename from |
| 5760 | python-info-ppss-context-type. | 6237 | python-info-ppss-context-type. |
| @@ -11483,7 +11960,7 @@ | |||
| 11483 | 11960 | ||
| 11484 | 2012-03-16 Alan Mackenzie <acm@muc.de> | 11961 | 2012-03-16 Alan Mackenzie <acm@muc.de> |
| 11485 | 11962 | ||
| 11486 | Further optimise the handling of large macros. | 11963 | Further optimize the handling of large macros. |
| 11487 | 11964 | ||
| 11488 | * progmodes/cc-engine.el (c-crosses-statement-barrier-p): Use a | 11965 | * progmodes/cc-engine.el (c-crosses-statement-barrier-p): Use a |
| 11489 | limit to a call of `c-literal-limits'. | 11966 | limit to a call of `c-literal-limits'. |
| @@ -13135,7 +13612,7 @@ | |||
| 13135 | 13612 | ||
| 13136 | 2012-01-08 Alan Mackenzie <acm@muc.de> | 13613 | 2012-01-08 Alan Mackenzie <acm@muc.de> |
| 13137 | 13614 | ||
| 13138 | Optimise font locking in long enum definitions. | 13615 | Optimize font locking in long enum definitions. |
| 13139 | 13616 | ||
| 13140 | * progmodes/cc-fonts.el (c-font-lock-declarations): Add an extra | 13617 | * progmodes/cc-fonts.el (c-font-lock-declarations): Add an extra |
| 13141 | arm to a cond form to handle enums. | 13618 | arm to a cond form to handle enums. |
diff --git a/lisp/apropos.el b/lisp/apropos.el index 5f481f54e57..000d2d87d05 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el | |||
| @@ -69,7 +69,7 @@ | |||
| 69 | "Non nil means apropos commands will search more extensively. | 69 | "Non nil means apropos commands will search more extensively. |
| 70 | This may be slower. This option affects the following commands: | 70 | This may be slower. This option affects the following commands: |
| 71 | 71 | ||
| 72 | `apropos-variable' will search all variables, not just user variables. | 72 | `apropos-user-option' will search all variables, not just user options. |
| 73 | `apropos-command' will also search non-interactive functions. | 73 | `apropos-command' will also search non-interactive functions. |
| 74 | `apropos' will search all symbols, not just functions, variables, faces, | 74 | `apropos' will search all symbols, not just functions, variables, faces, |
| 75 | and those with property lists. | 75 | and those with property lists. |
| @@ -115,6 +115,12 @@ include key-binding information in its output." | |||
| 115 | :group 'apropos | 115 | :group 'apropos |
| 116 | :version "24.3") | 116 | :version "24.3") |
| 117 | 117 | ||
| 118 | (defface apropos-user-option-button | ||
| 119 | '((t (:inherit (font-lock-variable-name-face button)))) | ||
| 120 | "Button face indicating a user option in Apropos." | ||
| 121 | :group 'apropos | ||
| 122 | :version "24.4") | ||
| 123 | |||
| 118 | (defface apropos-misc-button | 124 | (defface apropos-misc-button |
| 119 | '((t (:inherit (font-lock-constant-face button)))) | 125 | '((t (:inherit (font-lock-constant-face button)))) |
| 120 | "Button face indicating a miscellaneous object type in Apropos." | 126 | "Button face indicating a miscellaneous object type in Apropos." |
| @@ -261,6 +267,15 @@ term, and the rest of the words are alternative terms.") | |||
| 261 | 'action (lambda (button) | 267 | 'action (lambda (button) |
| 262 | (describe-variable (button-get button 'apropos-symbol)))) | 268 | (describe-variable (button-get button 'apropos-symbol)))) |
| 263 | 269 | ||
| 270 | (define-button-type 'apropos-user-option | ||
| 271 | 'apropos-label "User option" | ||
| 272 | 'apropos-short-label "o" | ||
| 273 | 'face 'apropos-user-option-button | ||
| 274 | 'help-echo "mouse-2, RET: Display more help on this user option" | ||
| 275 | 'follow-link t | ||
| 276 | 'action (lambda (button) | ||
| 277 | (describe-variable (button-get button 'apropos-symbol)))) | ||
| 278 | |||
| 264 | (define-button-type 'apropos-face | 279 | (define-button-type 'apropos-face |
| 265 | 'apropos-label "Face" | 280 | 'apropos-label "Face" |
| 266 | 'apropos-short-label "F" | 281 | 'apropos-short-label "F" |
| @@ -461,15 +476,15 @@ This requires that at least 2 keywords (unless only one was given)." | |||
| 461 | This is used to decide whether to print the result's type or not.") | 476 | This is used to decide whether to print the result's type or not.") |
| 462 | 477 | ||
| 463 | ;;;###autoload | 478 | ;;;###autoload |
| 464 | (defun apropos-variable (pattern &optional do-all) | 479 | (defun apropos-user-option (pattern &optional do-all) |
| 465 | "Show user variables that match PATTERN. | 480 | "Show user options that match PATTERN. |
| 466 | PATTERN can be a word, a list of words (separated by spaces), | 481 | PATTERN can be a word, a list of words (separated by spaces), |
| 467 | or a regexp (using some regexp special characters). If it is a word, | 482 | or a regexp (using some regexp special characters). If it is a word, |
| 468 | search for matches for that word as a substring. If it is a list of words, | 483 | search for matches for that word as a substring. If it is a list of words, |
| 469 | search for matches for any two (or more) of those words. | 484 | search for matches for any two (or more) of those words. |
| 470 | 485 | ||
| 471 | With \\[universal-argument] prefix, or if `apropos-do-all' is non-nil, also show | 486 | With \\[universal-argument] prefix, or if `apropos-do-all' is non-nil, also show |
| 472 | normal variables." | 487 | variables, not just user options." |
| 473 | (interactive (list (apropos-read-pattern | 488 | (interactive (list (apropos-read-pattern |
| 474 | (if (or current-prefix-arg apropos-do-all) | 489 | (if (or current-prefix-arg apropos-do-all) |
| 475 | "variable" "user option")) | 490 | "variable" "user option")) |
| @@ -481,6 +496,17 @@ normal variables." | |||
| 481 | (get symbol 'variable-documentation))) | 496 | (get symbol 'variable-documentation))) |
| 482 | 'custom-variable-p))) | 497 | 'custom-variable-p))) |
| 483 | 498 | ||
| 499 | ;;;###autoload | ||
| 500 | (defun apropos-variable (pattern &optional do-not-all) | ||
| 501 | "Show variables that match PATTERN. | ||
| 502 | When DO-NOT-ALL is not-nil, show user options only, i.e. behave | ||
| 503 | like `apropos-user-option'." | ||
| 504 | (interactive (list (apropos-read-pattern | ||
| 505 | (if current-prefix-arg "user option" "variable")) | ||
| 506 | current-prefix-arg)) | ||
| 507 | (let ((apropos-do-all (if do-not-all nil t))) | ||
| 508 | (apropos-user-option pattern))) | ||
| 509 | |||
| 484 | ;; For auld lang syne: | 510 | ;; For auld lang syne: |
| 485 | ;;;###autoload | 511 | ;;;###autoload |
| 486 | (defalias 'command-apropos 'apropos-command) | 512 | (defalias 'command-apropos 'apropos-command) |
| @@ -1099,7 +1125,11 @@ If non-nil TEXT is a string that will be printed as a heading." | |||
| 1099 | 'apropos-macro | 1125 | 'apropos-macro |
| 1100 | 'apropos-function)) | 1126 | 'apropos-function)) |
| 1101 | (not nosubst)) | 1127 | (not nosubst)) |
| 1102 | (apropos-print-doc 3 'apropos-variable (not nosubst)) | 1128 | (apropos-print-doc 3 |
| 1129 | (if (custom-variable-p symbol) | ||
| 1130 | 'apropos-user-option | ||
| 1131 | 'apropos-variable) | ||
| 1132 | (not nosubst)) | ||
| 1103 | (apropos-print-doc 7 'apropos-group t) | 1133 | (apropos-print-doc 7 'apropos-group t) |
| 1104 | (apropos-print-doc 6 'apropos-face t) | 1134 | (apropos-print-doc 6 'apropos-face t) |
| 1105 | (apropos-print-doc 5 'apropos-widget t) | 1135 | (apropos-print-doc 5 'apropos-widget t) |
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index f491f2427be..c9180482cd9 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -48,6 +48,11 @@ | |||
| 48 | ;; Emacs. You should never even notice that this package is active | 48 | ;; Emacs. You should never even notice that this package is active |
| 49 | ;; (except that your buffers will be reverted, of course). | 49 | ;; (except that your buffers will be reverted, of course). |
| 50 | ;; | 50 | ;; |
| 51 | ;; If Emacs is compiled with file watch support, notifications are | ||
| 52 | ;; used instead of checking the time stamp of the files. You can | ||
| 53 | ;; disable this by setting the user option `auto-revert-use-notify' to | ||
| 54 | ;; nil. | ||
| 55 | ;; | ||
| 51 | ;; After reverting a file buffer, Auto Revert Mode normally puts point | 56 | ;; After reverting a file buffer, Auto Revert Mode normally puts point |
| 52 | ;; at the same position that a regular manual revert would. However, | 57 | ;; at the same position that a regular manual revert would. However, |
| 53 | ;; there is one exception to this rule. If point is at the end of the | 58 | ;; there is one exception to this rule. If point is at the end of the |
| @@ -92,6 +97,7 @@ | |||
| 92 | 97 | ||
| 93 | ;; Dependencies: | 98 | ;; Dependencies: |
| 94 | 99 | ||
| 100 | (eval-when-compile (require 'cl-lib)) | ||
| 95 | (require 'timer) | 101 | (require 'timer) |
| 96 | 102 | ||
| 97 | ;; Custom Group: | 103 | ;; Custom Group: |
| @@ -254,6 +260,28 @@ buffers. CPU usage depends on the version control system." | |||
| 254 | This variable becomes buffer local when set in any fashion.") | 260 | This variable becomes buffer local when set in any fashion.") |
| 255 | (make-variable-buffer-local 'global-auto-revert-ignore-buffer) | 261 | (make-variable-buffer-local 'global-auto-revert-ignore-buffer) |
| 256 | 262 | ||
| 263 | (defconst auto-revert-notify-enabled | ||
| 264 | (or (featurep 'inotify) (featurep 'w32notify)) | ||
| 265 | "Non-nil when Emacs has been compiled with file watch support.") | ||
| 266 | |||
| 267 | (defcustom auto-revert-use-notify auto-revert-notify-enabled | ||
| 268 | "If non-nil Auto Revert Mode uses file watch functions. | ||
| 269 | This requires Emacs being compiled with file watch support (see | ||
| 270 | `auto-revert-notify-enabled'). You should set this variable | ||
| 271 | through Custom only." | ||
| 272 | :group 'auto-revert | ||
| 273 | :type 'boolean | ||
| 274 | :set (lambda (variable value) | ||
| 275 | (set-default variable (and auto-revert-notify-enabled value)) | ||
| 276 | (if (symbol-value variable) | ||
| 277 | (add-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch) | ||
| 278 | (remove-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch) | ||
| 279 | (when auto-revert-notify-enabled | ||
| 280 | (dolist (buf (buffer-list)) | ||
| 281 | (with-current-buffer buf | ||
| 282 | (auto-revert-notify-rm-watch)))))) | ||
| 283 | :version "24.4") | ||
| 284 | |||
| 257 | ;; Internal variables: | 285 | ;; Internal variables: |
| 258 | 286 | ||
| 259 | (defvar auto-revert-buffer-list () | 287 | (defvar auto-revert-buffer-list () |
| @@ -276,6 +304,20 @@ the list of old buffers.") | |||
| 276 | (set (make-local-variable 'auto-revert-tail-pos) | 304 | (set (make-local-variable 'auto-revert-tail-pos) |
| 277 | (nth 7 (file-attributes buffer-file-name))))) | 305 | (nth 7 (file-attributes buffer-file-name))))) |
| 278 | 306 | ||
| 307 | (defvar auto-revert-notify-watch-descriptor-hash-list | ||
| 308 | (make-hash-table :test 'equal) | ||
| 309 | "A hash table collecting all file watch descriptors. | ||
| 310 | Hash key is a watch descriptor, hash value is the corresponding buffer.") | ||
| 311 | |||
| 312 | (defvar auto-revert-notify-watch-descriptor nil | ||
| 313 | "The file watch descriptor active for the current buffer.") | ||
| 314 | (put 'auto-revert-notify-watch-descriptor 'permanent-local t) | ||
| 315 | |||
| 316 | (defvar auto-revert-notify-modified-p nil | ||
| 317 | "Non-nil when file has been modified on the file system. | ||
| 318 | This has been reported by a file watch event.") | ||
| 319 | (make-variable-buffer-local 'auto-revert-notify-modified-p) | ||
| 320 | |||
| 279 | ;; Functions: | 321 | ;; Functions: |
| 280 | 322 | ||
| 281 | ;;;###autoload | 323 | ;;;###autoload |
| @@ -296,6 +338,7 @@ without being changed in the part that is already in the buffer." | |||
| 296 | (if auto-revert-mode | 338 | (if auto-revert-mode |
| 297 | (if (not (memq (current-buffer) auto-revert-buffer-list)) | 339 | (if (not (memq (current-buffer) auto-revert-buffer-list)) |
| 298 | (push (current-buffer) auto-revert-buffer-list)) | 340 | (push (current-buffer) auto-revert-buffer-list)) |
| 341 | (when auto-revert-use-notify (auto-revert-notify-rm-watch)) | ||
| 299 | (setq auto-revert-buffer-list | 342 | (setq auto-revert-buffer-list |
| 300 | (delq (current-buffer) auto-revert-buffer-list))) | 343 | (delq (current-buffer) auto-revert-buffer-list))) |
| 301 | (auto-revert-set-timer) | 344 | (auto-revert-set-timer) |
| @@ -399,9 +442,12 @@ It displays the text that `global-auto-revert-mode-text' | |||
| 399 | specifies in the mode line." | 442 | specifies in the mode line." |
| 400 | :global t :group 'auto-revert :lighter global-auto-revert-mode-text | 443 | :global t :group 'auto-revert :lighter global-auto-revert-mode-text |
| 401 | (auto-revert-set-timer) | 444 | (auto-revert-set-timer) |
| 402 | (when global-auto-revert-mode | 445 | (if global-auto-revert-mode |
| 403 | (auto-revert-buffers))) | 446 | (auto-revert-buffers) |
| 404 | 447 | (when auto-revert-use-notify | |
| 448 | (dolist (buf (buffer-list)) | ||
| 449 | (with-current-buffer buf | ||
| 450 | (auto-revert-notify-rm-watch)))))) | ||
| 405 | 451 | ||
| 406 | (defun auto-revert-set-timer () | 452 | (defun auto-revert-set-timer () |
| 407 | "Restart or cancel the timer used by Auto-Revert Mode. | 453 | "Restart or cancel the timer used by Auto-Revert Mode. |
| @@ -418,6 +464,83 @@ will use an up-to-date value of `auto-revert-interval'" | |||
| 418 | auto-revert-interval | 464 | auto-revert-interval |
| 419 | 'auto-revert-buffers)))) | 465 | 'auto-revert-buffers)))) |
| 420 | 466 | ||
| 467 | (defun auto-revert-notify-rm-watch () | ||
| 468 | "Disable file watch for current buffer's associated file." | ||
| 469 | (when auto-revert-notify-watch-descriptor | ||
| 470 | (ignore-errors | ||
| 471 | (funcall (if (fboundp 'inotify-rm-watch) | ||
| 472 | 'inotify-rm-watch 'w32notify-rm-watch) | ||
| 473 | auto-revert-notify-watch-descriptor)) | ||
| 474 | (remhash auto-revert-notify-watch-descriptor | ||
| 475 | auto-revert-notify-watch-descriptor-hash-list)) | ||
| 476 | (setq auto-revert-notify-watch-descriptor nil | ||
| 477 | auto-revert-notify-modified-p nil)) | ||
| 478 | |||
| 479 | (defun auto-revert-notify-add-watch () | ||
| 480 | "Enable file watch for current buffer's associated file." | ||
| 481 | (when (and buffer-file-name auto-revert-use-notify) | ||
| 482 | (auto-revert-notify-rm-watch) | ||
| 483 | (let ((func (if (fboundp 'inotify-add-watch) | ||
| 484 | 'inotify-add-watch 'w32notify-add-watch)) | ||
| 485 | (aspect (if (fboundp 'inotify-add-watch) | ||
| 486 | '(modify) '(size last-write-time)))) | ||
| 487 | (setq auto-revert-notify-watch-descriptor | ||
| 488 | (ignore-errors | ||
| 489 | (funcall | ||
| 490 | func buffer-file-name aspect 'auto-revert-notify-handler))) | ||
| 491 | (if auto-revert-notify-watch-descriptor | ||
| 492 | (puthash auto-revert-notify-watch-descriptor | ||
| 493 | (current-buffer) | ||
| 494 | auto-revert-notify-watch-descriptor-hash-list) | ||
| 495 | ;; Fallback to file checks. | ||
| 496 | (set (make-local-variable 'auto-revert-use-notify) nil))))) | ||
| 497 | |||
| 498 | (defun auto-revert-notify-event-p (event) | ||
| 499 | "Check that event is a file watch event." | ||
| 500 | (cond ((featurep 'inotify) | ||
| 501 | (and (listp event) (= (length event) 4))) | ||
| 502 | ((featurep 'w32notify) | ||
| 503 | (and (listp event) (= (length event) 3) (stringp (nth 2 event)))))) | ||
| 504 | |||
| 505 | (defun auto-revert-notify-event-descriptor (event) | ||
| 506 | "Return watch descriptor of notification event, or nil." | ||
| 507 | (and (auto-revert-notify-event-p event) (car event))) | ||
| 508 | |||
| 509 | (defun auto-revert-notify-event-action (event) | ||
| 510 | "Return action of notification event, or nil." | ||
| 511 | (and (auto-revert-notify-event-p event) (nth 1 event))) | ||
| 512 | |||
| 513 | (defun auto-revert-notify-event-file-name (event) | ||
| 514 | "Return file name of notification event, or nil." | ||
| 515 | (and (auto-revert-notify-event-p event) | ||
| 516 | (cond ((featurep 'inotify) (nth 3 event)) | ||
| 517 | ((featurep 'w32notify) (nth 2 event))))) | ||
| 518 | |||
| 519 | (defun auto-revert-notify-handler (event) | ||
| 520 | "Handle an event returned from file watch." | ||
| 521 | (when (auto-revert-notify-event-p event) | ||
| 522 | (let* ((descriptor (auto-revert-notify-event-descriptor event)) | ||
| 523 | (action (auto-revert-notify-event-action event)) | ||
| 524 | (file (auto-revert-notify-event-file-name event)) | ||
| 525 | (buffer (gethash descriptor | ||
| 526 | auto-revert-notify-watch-descriptor-hash-list))) | ||
| 527 | (ignore-errors | ||
| 528 | ;; Check, that event is meant for us. | ||
| 529 | ;; TODO: Filter events which stop watching, like `move' or `removed'. | ||
| 530 | (cl-assert descriptor) | ||
| 531 | (when (featurep 'inotify) (cl-assert (memq 'modify action))) | ||
| 532 | (when (featurep 'w32notify) (cl-assert (eq 'modified action))) | ||
| 533 | (cl-assert (bufferp buffer)) | ||
| 534 | (with-current-buffer buffer | ||
| 535 | (when (and (stringp file) (stringp buffer-file-name)) | ||
| 536 | ;; w32notify returns the basename of the file without its | ||
| 537 | ;; leading directories; inotify returns its full absolute | ||
| 538 | ;; file name. | ||
| 539 | (cl-assert (file-equal-p file buffer-file-name))) | ||
| 540 | |||
| 541 | ;; Mark buffer modified. | ||
| 542 | (setq auto-revert-notify-modified-p t)))))) | ||
| 543 | |||
| 421 | (defun auto-revert-active-p () | 544 | (defun auto-revert-active-p () |
| 422 | "Check if auto-revert is active (in current buffer or globally)." | 545 | "Check if auto-revert is active (in current buffer or globally)." |
| 423 | (or auto-revert-mode | 546 | (or auto-revert-mode |
| @@ -435,6 +558,8 @@ This is an internal function used by Auto-Revert Mode." | |||
| 435 | (let* ((buffer (current-buffer)) size | 558 | (let* ((buffer (current-buffer)) size |
| 436 | (revert | 559 | (revert |
| 437 | (or (and buffer-file-name | 560 | (or (and buffer-file-name |
| 561 | (or (not auto-revert-use-notify) | ||
| 562 | auto-revert-notify-modified-p) | ||
| 438 | (if auto-revert-tail-mode | 563 | (if auto-revert-tail-mode |
| 439 | ;; Tramp caches the file attributes. Setting | 564 | ;; Tramp caches the file attributes. Setting |
| 440 | ;; `remote-file-name-inhibit-cache' forces Tramp | 565 | ;; `remote-file-name-inhibit-cache' forces Tramp |
| @@ -456,6 +581,7 @@ This is an internal function used by Auto-Revert Mode." | |||
| 456 | (funcall buffer-stale-function t)))) | 581 | (funcall buffer-stale-function t)))) |
| 457 | eob eoblist) | 582 | eob eoblist) |
| 458 | (when revert | 583 | (when revert |
| 584 | (setq auto-revert-notify-modified-p nil) | ||
| 459 | (when (and auto-revert-verbose | 585 | (when (and auto-revert-verbose |
| 460 | (not (eq revert 'fast))) | 586 | (not (eq revert 'fast))) |
| 461 | (message "Reverting buffer `%s'." (buffer-name))) | 587 | (message "Reverting buffer `%s'." (buffer-name))) |
| @@ -561,7 +687,12 @@ the timer when no buffers need to be checked." | |||
| 561 | (memq buf auto-revert-buffer-list)) | 687 | (memq buf auto-revert-buffer-list)) |
| 562 | (setq auto-revert-buffer-list | 688 | (setq auto-revert-buffer-list |
| 563 | (delq buf auto-revert-buffer-list))) | 689 | (delq buf auto-revert-buffer-list))) |
| 564 | (when (auto-revert-active-p) (auto-revert-handler))) | 690 | (when (auto-revert-active-p) |
| 691 | ;; Enable file watches. | ||
| 692 | (when (and auto-revert-use-notify buffer-file-name | ||
| 693 | (not auto-revert-notify-watch-descriptor) | ||
| 694 | (auto-revert-notify-add-watch))) | ||
| 695 | (auto-revert-handler))) | ||
| 565 | ;; Remove dead buffer from `auto-revert-buffer-list'. | 696 | ;; Remove dead buffer from `auto-revert-buffer-list'. |
| 566 | (setq auto-revert-buffer-list | 697 | (setq auto-revert-buffer-list |
| 567 | (delq buf auto-revert-buffer-list)))) | 698 | (delq buf auto-revert-buffer-list)))) |
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 6f51be4b89b..c35e7650254 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el | |||
| @@ -435,9 +435,9 @@ when converting units." | |||
| 435 | (defcustom calc-highlight-selections-with-faces | 435 | (defcustom calc-highlight-selections-with-faces |
| 436 | nil | 436 | nil |
| 437 | "If non-nil, use a separate face to indicate selected sub-formulas. | 437 | "If non-nil, use a separate face to indicate selected sub-formulas. |
| 438 | If `calc-show-selections' is non-nil, then selected sub-formulas are shown | 438 | If option `calc-show-selections' is non-nil, then selected sub-formulas are |
| 439 | by displaying the rest of the formula in `calc-nonselected-face'. | 439 | shown by displaying the rest of the formula in `calc-nonselected-face'. |
| 440 | If `calc-show-selections' is nil, then selected sub-formulas are shown | 440 | If option `calc-show-selections' is nil, then selected sub-formulas are shown |
| 441 | by displaying the sub-formula in `calc-selected-face'." | 441 | by displaying the sub-formula in `calc-selected-face'." |
| 442 | :version "24.1" | 442 | :version "24.1" |
| 443 | :group 'calc | 443 | :group 'calc |
| @@ -1183,7 +1183,7 @@ Used by `calc-user-invocation'.") | |||
| 1183 | 1183 | ||
| 1184 | ;;;###autoload | 1184 | ;;;###autoload |
| 1185 | (defun calc-dispatch (&optional arg) | 1185 | (defun calc-dispatch (&optional arg) |
| 1186 | "Invoke the GNU Emacs Calculator. See `calc-dispatch-help' for details." | 1186 | "Invoke the GNU Emacs Calculator. See \\[calc-dispatch-help] for details." |
| 1187 | (interactive "P") | 1187 | (interactive "P") |
| 1188 | ; (sit-for echo-keystrokes) | 1188 | ; (sit-for echo-keystrokes) |
| 1189 | (condition-case err ; look for other keys bound to calc-dispatch | 1189 | (condition-case err ; look for other keys bound to calc-dispatch |
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 9b0eb3e9bff..74d3ce80338 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1562,11 +1562,13 @@ line." | |||
| 1562 | (defun calendar-redraw () | 1562 | (defun calendar-redraw () |
| 1563 | "Redraw the calendar display, if `calendar-buffer' is live." | 1563 | "Redraw the calendar display, if `calendar-buffer' is live." |
| 1564 | (interactive) | 1564 | (interactive) |
| 1565 | (if (get-buffer calendar-buffer) | 1565 | (when (get-buffer calendar-buffer) |
| 1566 | (with-current-buffer calendar-buffer | 1566 | (with-current-buffer calendar-buffer |
| 1567 | (let ((cursor-date (calendar-cursor-to-nearest-date))) | 1567 | (let ((cursor-date (calendar-cursor-to-nearest-date))) |
| 1568 | (calendar-generate-window displayed-month displayed-year) | 1568 | (calendar-generate-window displayed-month displayed-year) |
| 1569 | (calendar-cursor-to-visible-date cursor-date))))) | 1569 | (calendar-cursor-to-visible-date cursor-date)) |
| 1570 | (when (window-live-p (get-buffer-window)) | ||
| 1571 | (set-window-point (get-buffer-window) (point)))))) | ||
| 1570 | 1572 | ||
| 1571 | (defvar calendar-mode-map | 1573 | (defvar calendar-mode-map |
| 1572 | (let ((map (make-keymap))) | 1574 | (let ((map (make-keymap))) |
diff --git a/lisp/color.el b/lisp/color.el index 63326e7c5b3..50f6675bf4b 100644 --- a/lisp/color.el +++ b/lisp/color.el | |||
| @@ -130,7 +130,7 @@ inclusive." | |||
| 130 | (max (max r g b)) | 130 | (max (max r g b)) |
| 131 | (min (min r g b))) | 131 | (min (min r g b))) |
| 132 | (if (< (- max min) 1e-8) | 132 | (if (< (- max min) 1e-8) |
| 133 | (list 0.0 0.0 0.0) | 133 | (list 0.0 0.0 min) |
| 134 | (list | 134 | (list |
| 135 | (/ (* 2 float-pi | 135 | (/ (* 2 float-pi |
| 136 | (cond ((and (= r g) (= g b)) 0) | 136 | (cond ((and (= r g) (= g b)) 0) |
| @@ -146,7 +146,7 @@ inclusive." | |||
| 146 | (+ 240 (* 60 (/ (- r g) (- max min))))))) | 146 | (+ 240 (* 60 (/ (- r g) (- max min))))))) |
| 147 | 360) | 147 | 360) |
| 148 | (if (= max 0) 0 (- 1 (/ min max))) | 148 | (if (= max 0) 0 (- 1 (/ min max))) |
| 149 | (/ max 255.0))))) | 149 | max)))) |
| 150 | 150 | ||
| 151 | (defun color-rgb-to-hsl (red green blue) | 151 | (defun color-rgb-to-hsl (red green blue) |
| 152 | "Convert RGB colors to their HSL representation. | 152 | "Convert RGB colors to their HSL representation. |
diff --git a/lisp/comint.el b/lisp/comint.el index e797fe841d3..21bd732b43c 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -1521,7 +1521,7 @@ Intended to be added to `isearch-mode-hook' in `comint-mode'." | |||
| 1521 | If there are no search errors, this function displays an overlay with | 1521 | If there are no search errors, this function displays an overlay with |
| 1522 | the Isearch prompt which replaces the original comint prompt. | 1522 | the Isearch prompt which replaces the original comint prompt. |
| 1523 | Otherwise, it displays the standard Isearch message returned from | 1523 | Otherwise, it displays the standard Isearch message returned from |
| 1524 | `isearch-message'." | 1524 | the function `isearch-message'." |
| 1525 | (if (not (and isearch-success (not isearch-error))) | 1525 | (if (not (and isearch-success (not isearch-error))) |
| 1526 | ;; Use standard function `isearch-message' when not in comint prompt, | 1526 | ;; Use standard function `isearch-message' when not in comint prompt, |
| 1527 | ;; or search fails, or has an error (like incomplete regexp). | 1527 | ;; or search fails, or has an error (like incomplete regexp). |
| @@ -1847,9 +1847,9 @@ Similarly for Soar, Scheme, etc." | |||
| 1847 | (let ((echo-len (- comint-last-input-end | 1847 | (let ((echo-len (- comint-last-input-end |
| 1848 | comint-last-input-start))) | 1848 | comint-last-input-start))) |
| 1849 | ;; Wait for all input to be echoed: | 1849 | ;; Wait for all input to be echoed: |
| 1850 | (while (and (accept-process-output proc) | 1850 | (while (and (> (+ comint-last-input-end echo-len) |
| 1851 | (> (+ comint-last-input-end echo-len) | ||
| 1852 | (point-max)) | 1851 | (point-max)) |
| 1852 | (accept-process-output proc) | ||
| 1853 | (zerop | 1853 | (zerop |
| 1854 | (compare-buffer-substrings | 1854 | (compare-buffer-substrings |
| 1855 | nil comint-last-input-start | 1855 | nil comint-last-input-start |
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 9d2c2750987..62e91fafcbf 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -115,12 +115,12 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of | |||
| 115 | (const :tag "On the right" (down . right)))) | 115 | (const :tag "On the right" (down . right)))) |
| 116 | (other :tag "On left, no arrows" t))) | 116 | (other :tag "On left, no arrows" t))) |
| 117 | (scroll-up-aggressively windows | 117 | (scroll-up-aggressively windows |
| 118 | (choice (const :tag "off" nil) number) | 118 | (choice (const :tag "off" nil) float) |
| 119 | "21.1") | 119 | "21.1") |
| 120 | (scroll-down-aggressively windows | 120 | (scroll-down-aggressively windows |
| 121 | (choice (const :tag "off" nil) number) | 121 | (choice (const :tag "off" nil) float) |
| 122 | "21.1") | 122 | "21.1") |
| 123 | (line-spacing display (choice (const :tag "none" nil) integer) | 123 | (line-spacing display (choice (const :tag "none" nil) number) |
| 124 | "22.1") | 124 | "22.1") |
| 125 | (cursor-in-non-selected-windows | 125 | (cursor-in-non-selected-windows |
| 126 | cursor boolean nil | 126 | cursor boolean nil |
| @@ -513,6 +513,7 @@ since it could result in memory overflow and make Emacs crash." | |||
| 513 | (x-use-underline-position-properties display boolean "22.1") | 513 | (x-use-underline-position-properties display boolean "22.1") |
| 514 | (x-underline-at-descent-line display boolean "22.1") | 514 | (x-underline-at-descent-line display boolean "22.1") |
| 515 | (x-stretch-cursor display boolean "21.1") | 515 | (x-stretch-cursor display boolean "21.1") |
| 516 | (scroll-bar-adjust-thumb-portion windows boolean "24.4") | ||
| 516 | ;; xselect.c | 517 | ;; xselect.c |
| 517 | (x-select-enable-clipboard-manager killing boolean "24.1") | 518 | (x-select-enable-clipboard-manager killing boolean "24.1") |
| 518 | ;; xsettings.c | 519 | ;; xsettings.c |
| @@ -575,6 +576,9 @@ since it could result in memory overflow and make Emacs crash." | |||
| 575 | (symbol-name symbol)) | 576 | (symbol-name symbol)) |
| 576 | ;; Any function from fontset.c will do. | 577 | ;; Any function from fontset.c will do. |
| 577 | (fboundp 'new-fontset)) | 578 | (fboundp 'new-fontset)) |
| 579 | ((equal "scroll-bar-adjust-thumb-portion" | ||
| 580 | (symbol-name symbol)) | ||
| 581 | (featurep 'x)) | ||
| 578 | (t t)))) | 582 | (t t)))) |
| 579 | (if (not (boundp symbol)) | 583 | (if (not (boundp symbol)) |
| 580 | ;; If variables are removed from C code, give an error here! | 584 | ;; If variables are removed from C code, give an error here! |
diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 24434d294c6..fa54eef828d 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el | |||
| @@ -145,7 +145,7 @@ | |||
| 145 | ;;;; Customization Options | 145 | ;;;; Customization Options |
| 146 | 146 | ||
| 147 | (defgroup doc-view nil | 147 | (defgroup doc-view nil |
| 148 | "In-buffer viewer for PDF, PostScript and DVI files." | 148 | "In-buffer viewer for PDF, PostScript, DVI, and DJVU files." |
| 149 | :link '(function-link doc-view) | 149 | :link '(function-link doc-view) |
| 150 | :version "22.2" | 150 | :version "22.2" |
| 151 | :group 'applications | 151 | :group 'applications |
| @@ -158,6 +158,27 @@ | |||
| 158 | :type 'file | 158 | :type 'file |
| 159 | :group 'doc-view) | 159 | :group 'doc-view) |
| 160 | 160 | ||
| 161 | (defcustom doc-view-pdfdraw-program | ||
| 162 | (cond | ||
| 163 | ((executable-find "pdfdraw") "pdfdraw") | ||
| 164 | (t "mudraw")) | ||
| 165 | "Name of MuPDF's program to convert PDF files to PNG." | ||
| 166 | :type 'file | ||
| 167 | :version "24.4") | ||
| 168 | |||
| 169 | (defcustom doc-view-pdf->png-converter-function | ||
| 170 | (if (executable-find doc-view-pdfdraw-program) | ||
| 171 | #'doc-view-pdf->png-converter-mupdf | ||
| 172 | #'doc-view-pdf->png-converter-ghostscript) | ||
| 173 | "Function to call to convert a PDF file into a PNG file." | ||
| 174 | :type '(radio | ||
| 175 | (function-item doc-view-pdf->png-converter-ghostscript | ||
| 176 | :doc "Use ghostscript") | ||
| 177 | (function-item doc-view-pdf->png-converter-mupdf | ||
| 178 | :doc "Use mupdf") | ||
| 179 | function) | ||
| 180 | :version "24.4") | ||
| 181 | |||
| 161 | (defcustom doc-view-ghostscript-options | 182 | (defcustom doc-view-ghostscript-options |
| 162 | '("-dSAFER" ;; Avoid security problems when rendering files from untrusted | 183 | '("-dSAFER" ;; Avoid security problems when rendering files from untrusted |
| 163 | ;; sources. | 184 | ;; sources. |
| @@ -320,6 +341,19 @@ the (uncompressed, extracted) file residing in | |||
| 320 | "The type of document in the current buffer. | 341 | "The type of document in the current buffer. |
| 321 | Can be `dvi', `pdf', or `ps'.") | 342 | Can be `dvi', `pdf', or `ps'.") |
| 322 | 343 | ||
| 344 | (defvar doc-view-single-page-converter-function nil | ||
| 345 | "Function to call to convert a single page of the document to a bitmap file. | ||
| 346 | May operate on the source document or on some intermediate (typically PDF) | ||
| 347 | conversion of it.") | ||
| 348 | |||
| 349 | (defvar-local doc-view--image-type nil | ||
| 350 | "The type of image in the current buffer. | ||
| 351 | Can be `png' or `tiff'.") | ||
| 352 | |||
| 353 | (defvar-local doc-view--image-file-pattern nil | ||
| 354 | "The `format' pattern of image file names. | ||
| 355 | Typically \"page-%s.png\".") | ||
| 356 | |||
| 323 | ;;;; DocView Keymaps | 357 | ;;;; DocView Keymaps |
| 324 | 358 | ||
| 325 | (defvar doc-view-mode-map | 359 | (defvar doc-view-mode-map |
| @@ -458,24 +492,26 @@ Can be `dvi', `pdf', or `ps'.") | |||
| 458 | ;; We used to find the file name from doc-view-current-files but | 492 | ;; We used to find the file name from doc-view-current-files but |
| 459 | ;; that's not right if the pages are not generated sequentially | 493 | ;; that's not right if the pages are not generated sequentially |
| 460 | ;; or if the page isn't in doc-view-current-files yet. | 494 | ;; or if the page isn't in doc-view-current-files yet. |
| 461 | (let ((file (expand-file-name (format "page-%d.png" page) | 495 | (let ((file (expand-file-name |
| 462 | (doc-view-current-cache-dir)))) | 496 | (format doc-view--image-file-pattern page) |
| 497 | (doc-view-current-cache-dir)))) | ||
| 463 | (doc-view-insert-image file :pointer 'arrow) | 498 | (doc-view-insert-image file :pointer 'arrow) |
| 464 | (set-window-hscroll (selected-window) hscroll) | 499 | (set-window-hscroll (selected-window) hscroll) |
| 465 | (when (and (not (file-exists-p file)) | 500 | (when (and (not (file-exists-p file)) |
| 466 | doc-view-current-converter-processes) | 501 | doc-view-current-converter-processes) |
| 467 | ;; The PNG file hasn't been generated yet. | 502 | ;; The PNG file hasn't been generated yet. |
| 468 | (doc-view-pdf->png-1 doc-view-buffer-file-name file page | 503 | (funcall doc-view-single-page-converter-function |
| 469 | (let ((win (selected-window))) | 504 | doc-view-buffer-file-name file page |
| 470 | (lambda () | 505 | (let ((win (selected-window))) |
| 471 | (and (eq (current-buffer) (window-buffer win)) | 506 | (lambda () |
| 472 | ;; If we changed page in the mean | 507 | (and (eq (current-buffer) (window-buffer win)) |
| 473 | ;; time, don't mess things up. | 508 | ;; If we changed page in the mean |
| 474 | (eq (doc-view-current-page win) page) | 509 | ;; time, don't mess things up. |
| 475 | ;; Make sure we don't infloop. | 510 | (eq (doc-view-current-page win) page) |
| 476 | (file-readable-p file) | 511 | ;; Make sure we don't infloop. |
| 477 | (with-selected-window win | 512 | (file-readable-p file) |
| 478 | (doc-view-goto-page page)))))))) | 513 | (with-selected-window win |
| 514 | (doc-view-goto-page page)))))))) | ||
| 479 | (overlay-put (doc-view-current-overlay) | 515 | (overlay-put (doc-view-current-overlay) |
| 480 | 'help-echo (doc-view-current-info)))) | 516 | 'help-echo (doc-view-current-info)))) |
| 481 | 517 | ||
| @@ -659,14 +695,16 @@ OpenDocument format)." | |||
| 659 | (executable-find doc-view-dvipdf-program)) | 695 | (executable-find doc-view-dvipdf-program)) |
| 660 | (and doc-view-dvipdfm-program | 696 | (and doc-view-dvipdfm-program |
| 661 | (executable-find doc-view-dvipdfm-program))))) | 697 | (executable-find doc-view-dvipdfm-program))))) |
| 662 | ((or (eq type 'postscript) (eq type 'ps) (eq type 'eps) | 698 | ((memq type '(postscript ps eps pdf)) |
| 663 | (eq type 'pdf)) | 699 | ;; FIXME: allow mupdf here |
| 664 | (and doc-view-ghostscript-program | 700 | (and doc-view-ghostscript-program |
| 665 | (executable-find doc-view-ghostscript-program))) | 701 | (executable-find doc-view-ghostscript-program))) |
| 666 | ((eq type 'odf) | 702 | ((eq type 'odf) |
| 667 | (and doc-view-unoconv-program | 703 | (and doc-view-unoconv-program |
| 668 | (executable-find doc-view-unoconv-program) | 704 | (executable-find doc-view-unoconv-program) |
| 669 | (doc-view-mode-p 'pdf))) | 705 | (doc-view-mode-p 'pdf))) |
| 706 | ((eq type 'djvu) | ||
| 707 | (executable-find "ddjvu")) | ||
| 670 | (t ;; unknown image type | 708 | (t ;; unknown image type |
| 671 | nil)))) | 709 | nil)))) |
| 672 | 710 | ||
| @@ -683,13 +721,13 @@ OpenDocument format)." | |||
| 683 | ;; ImageMagick supports on-the-fly-rescaling. | 721 | ;; ImageMagick supports on-the-fly-rescaling. |
| 684 | (let ((new (ceiling (* factor doc-view-image-width)))) | 722 | (let ((new (ceiling (* factor doc-view-image-width)))) |
| 685 | (unless (equal new doc-view-image-width) | 723 | (unless (equal new doc-view-image-width) |
| 686 | (set (make-local-variable 'doc-view-image-width) new) | 724 | (setq-local doc-view-image-width new) |
| 687 | (doc-view-insert-image | 725 | (doc-view-insert-image |
| 688 | (plist-get (cdr (doc-view-current-image)) :file) | 726 | (plist-get (cdr (doc-view-current-image)) :file) |
| 689 | :width doc-view-image-width))) | 727 | :width doc-view-image-width))) |
| 690 | (let ((new (ceiling (* factor doc-view-resolution)))) | 728 | (let ((new (ceiling (* factor doc-view-resolution)))) |
| 691 | (unless (equal new doc-view-resolution) | 729 | (unless (equal new doc-view-resolution) |
| 692 | (set (make-local-variable 'doc-view-resolution) new) | 730 | (setq-local doc-view-resolution new) |
| 693 | (doc-view-reconvert-doc))))) | 731 | (doc-view-reconvert-doc))))) |
| 694 | 732 | ||
| 695 | (defun doc-view-shrink (factor) | 733 | (defun doc-view-shrink (factor) |
| @@ -826,6 +864,45 @@ Should be invoked when the cached images aren't up-to-date." | |||
| 826 | (list "-o" pdf dvi) | 864 | (list "-o" pdf dvi) |
| 827 | callback))) | 865 | callback))) |
| 828 | 866 | ||
| 867 | (defun doc-view-pdf->png-converter-ghostscript (pdf png page callback) | ||
| 868 | (doc-view-start-process | ||
| 869 | "pdf/ps->png" doc-view-ghostscript-program | ||
| 870 | `(,@doc-view-ghostscript-options | ||
| 871 | ,(format "-r%d" (round doc-view-resolution)) | ||
| 872 | ,@(if page `(,(format "-dFirstPage=%d" page))) | ||
| 873 | ,@(if page `(,(format "-dLastPage=%d" page))) | ||
| 874 | ,(concat "-sOutputFile=" png) | ||
| 875 | ,pdf) | ||
| 876 | callback)) | ||
| 877 | |||
| 878 | (defalias 'doc-view-ps->png-converter-ghostscript | ||
| 879 | 'doc-view-pdf->png-converter-ghostscript) | ||
| 880 | |||
| 881 | (defun doc-view-djvu->tiff-converter-ddjvu (djvu tiff page callback) | ||
| 882 | "Convert PAGE of a DJVU file to bitmap(s) asynchronously. | ||
| 883 | Call CALLBACK with no arguments when done. | ||
| 884 | If PAGE is nil, convert the whole document." | ||
| 885 | (doc-view-start-process | ||
| 886 | "djvu->tiff" "ddjvu" | ||
| 887 | `("-format=tiff" | ||
| 888 | ;; ddjvu only accepts the range 1-999. | ||
| 889 | ,(format "-scale=%d" (round doc-view-resolution)) | ||
| 890 | ;; -eachpage was only added after djvulibre-3.5.25.3! | ||
| 891 | ,@(unless page '("-eachpage")) | ||
| 892 | ,@(if page `(,(format "-page=%d" page))) | ||
| 893 | ,djvu | ||
| 894 | ,tiff) | ||
| 895 | callback)) | ||
| 896 | |||
| 897 | (defun doc-view-pdf->png-converter-mupdf (pdf png page callback) | ||
| 898 | (doc-view-start-process | ||
| 899 | "pdf->png" doc-view-pdfdraw-program | ||
| 900 | `(,(concat "-o" png) | ||
| 901 | ,(format "-r%d" (round doc-view-resolution)) | ||
| 902 | |||
| 903 | ,@(if page `(,(format "%d" page)))) | ||
| 904 | callback)) | ||
| 905 | |||
| 829 | (defun doc-view-odf->pdf (odf callback) | 906 | (defun doc-view-odf->pdf (odf callback) |
| 830 | "Convert ODF to PDF asynchronously and call CALLBACK when finished. | 907 | "Convert ODF to PDF asynchronously and call CALLBACK when finished. |
| 831 | The converted PDF is put into the current cache directory, and it | 908 | The converted PDF is put into the current cache directory, and it |
| @@ -835,13 +912,14 @@ is named like ODF with the extension turned to pdf." | |||
| 835 | callback)) | 912 | callback)) |
| 836 | 913 | ||
| 837 | (defun doc-view-pdf/ps->png (pdf-ps png) | 914 | (defun doc-view-pdf/ps->png (pdf-ps png) |
| 915 | ;; FIXME: Fix name and docstring to account for djvu&tiff. | ||
| 838 | "Convert PDF-PS to PNG asynchronously." | 916 | "Convert PDF-PS to PNG asynchronously." |
| 839 | (doc-view-start-process | 917 | (funcall |
| 840 | "pdf/ps->png" doc-view-ghostscript-program | 918 | (pcase doc-view-doc-type |
| 841 | (append doc-view-ghostscript-options | 919 | (`pdf doc-view-pdf->png-converter-function) |
| 842 | (list (format "-r%d" (round doc-view-resolution)) | 920 | (`djvu #'doc-view-djvu->tiff-converter-ddjvu) |
| 843 | (concat "-sOutputFile=" png) | 921 | (_ #'doc-view-ps->png-converter-ghostscript)) |
| 844 | pdf-ps)) | 922 | pdf-ps png nil |
| 845 | (let ((resolution doc-view-resolution)) | 923 | (let ((resolution doc-view-resolution)) |
| 846 | (lambda () | 924 | (lambda () |
| 847 | ;; Only create the resolution file when it's all done, so it also | 925 | ;; Only create the resolution file when it's all done, so it also |
| @@ -854,6 +932,7 @@ is named like ODF with the extension turned to pdf." | |||
| 854 | (cancel-timer doc-view-current-timer) | 932 | (cancel-timer doc-view-current-timer) |
| 855 | (setq doc-view-current-timer nil)) | 933 | (setq doc-view-current-timer nil)) |
| 856 | (doc-view-display (current-buffer) 'force)))) | 934 | (doc-view-display (current-buffer) 'force)))) |
| 935 | |||
| 857 | ;; Update the displayed pages as soon as they're done generating. | 936 | ;; Update the displayed pages as soon as they're done generating. |
| 858 | (when doc-view-conversion-refresh-interval | 937 | (when doc-view-conversion-refresh-interval |
| 859 | (setq doc-view-current-timer | 938 | (setq doc-view-current-timer |
| @@ -861,25 +940,10 @@ is named like ODF with the extension turned to pdf." | |||
| 861 | 'doc-view-display | 940 | 'doc-view-display |
| 862 | (current-buffer))))) | 941 | (current-buffer))))) |
| 863 | 942 | ||
| 864 | (defun doc-view-pdf->png-1 (pdf png page callback) | ||
| 865 | "Convert a PAGE of a PDF file to PNG asynchronously. | ||
| 866 | Call CALLBACK with no arguments when done." | ||
| 867 | (doc-view-start-process | ||
| 868 | "pdf->png-1" doc-view-ghostscript-program | ||
| 869 | (append doc-view-ghostscript-options | ||
| 870 | (list (format "-r%d" (round doc-view-resolution)) | ||
| 871 | ;; Sadly, `gs' only supports the page-range | ||
| 872 | ;; for PDF files. | ||
| 873 | (format "-dFirstPage=%d" page) | ||
| 874 | (format "-dLastPage=%d" page) | ||
| 875 | (concat "-sOutputFile=" png) | ||
| 876 | pdf)) | ||
| 877 | callback)) | ||
| 878 | |||
| 879 | (declare-function clear-image-cache "image.c" (&optional filter)) | 943 | (declare-function clear-image-cache "image.c" (&optional filter)) |
| 880 | 944 | ||
| 881 | (defun doc-view-pdf->png (pdf png pages) | 945 | (defun doc-view-document->bitmap (pdf png pages) |
| 882 | "Convert a PDF file to PNG asynchronously. | 946 | "Convert a document file to bitmap images asynchronously. |
| 883 | Start by converting PAGES, and then the rest." | 947 | Start by converting PAGES, and then the rest." |
| 884 | (if (null pages) | 948 | (if (null pages) |
| 885 | (doc-view-pdf/ps->png pdf png) | 949 | (doc-view-pdf/ps->png pdf png) |
| @@ -888,11 +952,11 @@ Start by converting PAGES, and then the rest." | |||
| 888 | ;; a single page anyway, and of the remaining 1%, few cases will have | 952 | ;; a single page anyway, and of the remaining 1%, few cases will have |
| 889 | ;; consecutive pages, it's not worth the trouble. | 953 | ;; consecutive pages, it's not worth the trouble. |
| 890 | (let ((rest (cdr pages))) | 954 | (let ((rest (cdr pages))) |
| 891 | (doc-view-pdf->png-1 | 955 | (funcall doc-view-single-page-converter-function |
| 892 | pdf (format png (car pages)) (car pages) | 956 | pdf (format png (car pages)) (car pages) |
| 893 | (lambda () | 957 | (lambda () |
| 894 | (if rest | 958 | (if rest |
| 895 | (doc-view-pdf->png pdf png rest) | 959 | (doc-view-document->bitmap pdf png rest) |
| 896 | ;; Yippie, the important pages are done, update the display. | 960 | ;; Yippie, the important pages are done, update the display. |
| 897 | (clear-image-cache) | 961 | (clear-image-cache) |
| 898 | ;; For the windows that have a message (like "Welcome to | 962 | ;; For the windows that have a message (like "Welcome to |
| @@ -900,8 +964,8 @@ Start by converting PAGES, and then the rest." | |||
| 900 | ;; not sufficient. | 964 | ;; not sufficient. |
| 901 | (dolist (win (get-buffer-window-list (current-buffer) nil 'visible)) | 965 | (dolist (win (get-buffer-window-list (current-buffer) nil 'visible)) |
| 902 | (with-selected-window win | 966 | (with-selected-window win |
| 903 | (when (stringp (get-char-property (point-min) 'display)) | 967 | (when (stringp (get-char-property (point-min) 'display)) |
| 904 | (doc-view-goto-page (doc-view-current-page))))) | 968 | (doc-view-goto-page (doc-view-current-page))))) |
| 905 | ;; Convert the rest of the pages. | 969 | ;; Convert the rest of the pages. |
| 906 | (doc-view-pdf/ps->png pdf png))))))) | 970 | (doc-view-pdf/ps->png pdf png))))))) |
| 907 | 971 | ||
| @@ -971,8 +1035,9 @@ Those files are saved in the directory given by the function | |||
| 971 | ;; preserves the horizontal/vertical scroll settings (which are otherwise | 1035 | ;; preserves the horizontal/vertical scroll settings (which are otherwise |
| 972 | ;; resets during the redisplay). | 1036 | ;; resets during the redisplay). |
| 973 | (setq doc-view-pending-cache-flush t) | 1037 | (setq doc-view-pending-cache-flush t) |
| 974 | (let ((png-file (expand-file-name "page-%d.png" | 1038 | (let ((png-file (expand-file-name |
| 975 | (doc-view-current-cache-dir)))) | 1039 | (format doc-view--image-file-pattern "%d") |
| 1040 | (doc-view-current-cache-dir)))) | ||
| 976 | (make-directory (doc-view-current-cache-dir) t) | 1041 | (make-directory (doc-view-current-cache-dir) t) |
| 977 | (pcase doc-view-doc-type | 1042 | (pcase doc-view-doc-type |
| 978 | (`dvi | 1043 | (`dvi |
| @@ -985,11 +1050,12 @@ Those files are saved in the directory given by the function | |||
| 985 | ;; ODF files have to be converted to PDF before Ghostscript can | 1050 | ;; ODF files have to be converted to PDF before Ghostscript can |
| 986 | ;; process it. | 1051 | ;; process it. |
| 987 | (let ((pdf (doc-view-current-cache-doc-pdf)) | 1052 | (let ((pdf (doc-view-current-cache-doc-pdf)) |
| 988 | (opdf (expand-file-name (concat (file-name-base doc-view-buffer-file-name) | 1053 | (opdf (expand-file-name |
| 989 | ".pdf") | 1054 | (concat (file-name-base doc-view-buffer-file-name) |
| 990 | doc-view-current-cache-dir)) | 1055 | ".pdf") |
| 1056 | doc-view-current-cache-dir)) | ||
| 991 | (png-file png-file)) | 1057 | (png-file png-file)) |
| 992 | ;; The unoconv tool only supports a output directory, but no | 1058 | ;; The unoconv tool only supports an output directory, but no |
| 993 | ;; file name. It's named like the input file with the | 1059 | ;; file name. It's named like the input file with the |
| 994 | ;; extension replaced by pdf. | 1060 | ;; extension replaced by pdf. |
| 995 | (doc-view-odf->pdf doc-view-buffer-file-name | 1061 | (doc-view-odf->pdf doc-view-buffer-file-name |
| @@ -997,10 +1063,10 @@ Those files are saved in the directory given by the function | |||
| 997 | ;; Rename to doc.pdf | 1063 | ;; Rename to doc.pdf |
| 998 | (rename-file opdf pdf) | 1064 | (rename-file opdf pdf) |
| 999 | (doc-view-pdf/ps->png pdf png-file))))) | 1065 | (doc-view-pdf/ps->png pdf png-file))))) |
| 1000 | 1066 | ((or `pdf `djvu) | |
| 1001 | (let ((pages (doc-view-active-pages))) | 1067 | (let ((pages (doc-view-active-pages))) |
| 1002 | ;; Convert PDF to PNG images starting with the active pages. | 1068 | ;; Convert doc to bitmap images starting with the active pages. |
| 1003 | (doc-view-pdf->png doc-view-buffer-file-name png-file pages))) | 1069 | (doc-view-document->bitmap doc-view-buffer-file-name png-file pages))) |
| 1004 | (_ | 1070 | (_ |
| 1005 | ;; Convert to PNG images. | 1071 | ;; Convert to PNG images. |
| 1006 | (doc-view-pdf/ps->png doc-view-buffer-file-name png-file))))) | 1072 | (doc-view-pdf/ps->png doc-view-buffer-file-name png-file))))) |
| @@ -1111,9 +1177,10 @@ much more accurate than could be done manually using | |||
| 1111 | (let* ((is (image-size (doc-view-current-image) t)) | 1177 | (let* ((is (image-size (doc-view-current-image) t)) |
| 1112 | (iw (car is)) | 1178 | (iw (car is)) |
| 1113 | (ih (cdr is)) | 1179 | (ih (cdr is)) |
| 1114 | (ps (or (and (null force-paper-size) (doc-view-guess-paper-size iw ih)) | 1180 | (ps (or (and (null force-paper-size) |
| 1181 | (doc-view-guess-paper-size iw ih)) | ||
| 1115 | (intern (completing-read "Paper size: " | 1182 | (intern (completing-read "Paper size: " |
| 1116 | (mapcar #'car doc-view-paper-sizes) | 1183 | doc-view-paper-sizes |
| 1117 | nil t)))) | 1184 | nil t)))) |
| 1118 | (bb (doc-view-scale-bounding-box ps iw ih bb)) | 1185 | (bb (doc-view-scale-bounding-box ps iw ih bb)) |
| 1119 | (x1 (nth 0 bb)) | 1186 | (x1 (nth 0 bb)) |
| @@ -1144,7 +1211,7 @@ ARGS is a list of image descriptors." | |||
| 1144 | (image (if (and file (file-readable-p file)) | 1211 | (image (if (and file (file-readable-p file)) |
| 1145 | (if (not (and doc-view-scale-internally | 1212 | (if (not (and doc-view-scale-internally |
| 1146 | (fboundp 'imagemagick-types))) | 1213 | (fboundp 'imagemagick-types))) |
| 1147 | (apply 'create-image file 'png nil args) | 1214 | (apply 'create-image file doc-view--image-type nil args) |
| 1148 | (unless (member :width args) | 1215 | (unless (member :width args) |
| 1149 | (setq args `(,@args :width ,doc-view-image-width))) | 1216 | (setq args `(,@args :width ,doc-view-image-width))) |
| 1150 | (apply 'create-image file 'imagemagick nil args)))) | 1217 | (apply 'create-image file 'imagemagick nil args)))) |
| @@ -1194,13 +1261,16 @@ have the page we want to view." | |||
| 1194 | (let ((prev-pages doc-view-current-files)) | 1261 | (let ((prev-pages doc-view-current-files)) |
| 1195 | (setq doc-view-current-files | 1262 | (setq doc-view-current-files |
| 1196 | (sort (directory-files (doc-view-current-cache-dir) t | 1263 | (sort (directory-files (doc-view-current-cache-dir) t |
| 1197 | "page-[0-9]+\\.png" t) | 1264 | (format doc-view--image-file-pattern |
| 1265 | "[0-9]+") | ||
| 1266 | t) | ||
| 1198 | 'doc-view-sort)) | 1267 | 'doc-view-sort)) |
| 1199 | (dolist (win (or (get-buffer-window-list buffer nil t) | 1268 | (dolist (win (or (get-buffer-window-list buffer nil t) |
| 1200 | (list t))) | 1269 | (list t))) |
| 1201 | (let* ((page (doc-view-current-page win)) | 1270 | (let* ((page (doc-view-current-page win)) |
| 1202 | (pagefile (expand-file-name (format "page-%d.png" page) | 1271 | (pagefile (expand-file-name |
| 1203 | (doc-view-current-cache-dir)))) | 1272 | (format doc-view--image-file-pattern page) |
| 1273 | (doc-view-current-cache-dir)))) | ||
| 1204 | (when (or force | 1274 | (when (or force |
| 1205 | (and (not (member pagefile prev-pages)) | 1275 | (and (not (member pagefile prev-pages)) |
| 1206 | (member pagefile doc-view-current-files))) | 1276 | (member pagefile doc-view-current-files))) |
| @@ -1265,7 +1335,7 @@ For now these keys are useful: | |||
| 1265 | (doc-view-kill-proc) | 1335 | (doc-view-kill-proc) |
| 1266 | (setq buffer-read-only nil) | 1336 | (setq buffer-read-only nil) |
| 1267 | (remove-overlays (point-min) (point-max) 'doc-view t) | 1337 | (remove-overlays (point-min) (point-max) 'doc-view t) |
| 1268 | (set (make-local-variable 'image-mode-winprops-alist) t) | 1338 | (setq-local image-mode-winprops-alist t) |
| 1269 | ;; Switch to the previously used major mode or fall back to | 1339 | ;; Switch to the previously used major mode or fall back to |
| 1270 | ;; normal mode. | 1340 | ;; normal mode. |
| 1271 | (doc-view-fallback-mode) | 1341 | (doc-view-fallback-mode) |
| @@ -1393,12 +1463,13 @@ If BACKWARD is non-nil, jump to the previous match." | |||
| 1393 | ;; the conversion is incomplete. | 1463 | ;; the conversion is incomplete. |
| 1394 | (file-readable-p (expand-file-name "resolution.el" | 1464 | (file-readable-p (expand-file-name "resolution.el" |
| 1395 | (doc-view-current-cache-dir))) | 1465 | (doc-view-current-cache-dir))) |
| 1396 | (> (length (directory-files (doc-view-current-cache-dir) | 1466 | (> (length (directory-files |
| 1397 | nil "\\.png\\'")) | 1467 | (doc-view-current-cache-dir) |
| 1468 | nil (format doc-view--image-file-pattern "[0-9]+"))) | ||
| 1398 | 0))) | 1469 | 0))) |
| 1399 | 1470 | ||
| 1400 | (defun doc-view-initiate-display () | 1471 | (defun doc-view-initiate-display () |
| 1401 | ;; Switch to image display if possible | 1472 | ;; Switch to image display if possible. |
| 1402 | (if (doc-view-mode-p doc-view-doc-type) | 1473 | (if (doc-view-mode-p doc-view-doc-type) |
| 1403 | (progn | 1474 | (progn |
| 1404 | (doc-view-buffer-message) | 1475 | (doc-view-buffer-message) |
| @@ -1406,7 +1477,7 @@ If BACKWARD is non-nil, jump to the previous match." | |||
| 1406 | (if (doc-view-already-converted-p) | 1477 | (if (doc-view-already-converted-p) |
| 1407 | (progn | 1478 | (progn |
| 1408 | (message "DocView: using cached files!") | 1479 | (message "DocView: using cached files!") |
| 1409 | ;; Load the saved resolution | 1480 | ;; Load the saved resolution. |
| 1410 | (let* ((res-file (expand-file-name "resolution.el" | 1481 | (let* ((res-file (expand-file-name "resolution.el" |
| 1411 | (doc-view-current-cache-dir))) | 1482 | (doc-view-current-cache-dir))) |
| 1412 | (res | 1483 | (res |
| @@ -1415,7 +1486,7 @@ If BACKWARD is non-nil, jump to the previous match." | |||
| 1415 | (insert-file-contents res-file) | 1486 | (insert-file-contents res-file) |
| 1416 | (read (current-buffer)))))) | 1487 | (read (current-buffer)))))) |
| 1417 | (when (numberp res) | 1488 | (when (numberp res) |
| 1418 | (set (make-local-variable 'doc-view-resolution) res))) | 1489 | (setq-local doc-view-resolution res))) |
| 1419 | (doc-view-display (current-buffer) 'force)) | 1490 | (doc-view-display (current-buffer) 'force)) |
| 1420 | (doc-view-convert-current-doc)) | 1491 | (doc-view-convert-current-doc)) |
| 1421 | (message | 1492 | (message |
| @@ -1467,6 +1538,8 @@ If BACKWARD is non-nil, jump to the previous match." | |||
| 1467 | ("pdf" pdf) ("epdf" pdf) | 1538 | ("pdf" pdf) ("epdf" pdf) |
| 1468 | ;; PostScript | 1539 | ;; PostScript |
| 1469 | ("ps" ps) ("eps" ps) | 1540 | ("ps" ps) ("eps" ps) |
| 1541 | ;; DjVu | ||
| 1542 | ("djvu" djvu) | ||
| 1470 | ;; OpenDocument formats | 1543 | ;; OpenDocument formats |
| 1471 | ("odt" odf) ("ods" odf) ("odp" odf) ("odg" odf) | 1544 | ("odt" odf) ("ods" odf) ("odp" odf) ("odg" odf) |
| 1472 | ("odc" odf) ("odi" odf) ("odm" odf) ("ott" odf) | 1545 | ("odc" odf) ("odi" odf) ("odm" odf) ("ott" odf) |
| @@ -1481,14 +1554,25 @@ If BACKWARD is non-nil, jump to the previous match." | |||
| 1481 | (cond | 1554 | (cond |
| 1482 | ((looking-at "%!") '(ps)) | 1555 | ((looking-at "%!") '(ps)) |
| 1483 | ((looking-at "%PDF") '(pdf)) | 1556 | ((looking-at "%PDF") '(pdf)) |
| 1484 | ((looking-at "\367\002") '(dvi)))))) | 1557 | ((looking-at "\367\002") '(dvi)) |
| 1485 | (set (make-local-variable 'doc-view-doc-type) | 1558 | ((looking-at "AT&TFORM") '(djvu)))))) |
| 1486 | (car (or (doc-view-intersection name-types content-types) | 1559 | (setq-local doc-view-doc-type |
| 1487 | (when (and name-types content-types) | 1560 | (car (or (doc-view-intersection name-types content-types) |
| 1488 | (error "Conflicting types: name says %s but content says %s" | 1561 | (when (and name-types content-types) |
| 1489 | name-types content-types)) | 1562 | (error "Conflicting types: name says %s but content says %s" |
| 1490 | name-types content-types | 1563 | name-types content-types)) |
| 1491 | (error "Cannot determine the document type")))))) | 1564 | name-types content-types |
| 1565 | (error "Cannot determine the document type")))))) | ||
| 1566 | |||
| 1567 | (defun doc-view-set-up-single-converter () | ||
| 1568 | "Find the right single-page converter for the current document type" | ||
| 1569 | (pcase-let ((`(,conv-function ,type ,extension) | ||
| 1570 | (pcase doc-view-doc-type | ||
| 1571 | (`djvu (list #'doc-view-djvu->tiff-converter-ddjvu 'tiff "tif")) | ||
| 1572 | (_ (list doc-view-pdf->png-converter-function 'png "png"))))) | ||
| 1573 | (setq-local doc-view-single-page-converter-function conv-function) | ||
| 1574 | (setq-local doc-view--image-type type) | ||
| 1575 | (setq-local doc-view--image-file-pattern (concat "page-%s." extension)))) | ||
| 1492 | 1576 | ||
| 1493 | ;;;###autoload | 1577 | ;;;###autoload |
| 1494 | (defun doc-view-mode () | 1578 | (defun doc-view-mode () |
| @@ -1513,8 +1597,7 @@ toggle between displaying the document or editing it as text. | |||
| 1513 | (unless (eq major-mode 'fundamental-mode) | 1597 | (unless (eq major-mode 'fundamental-mode) |
| 1514 | major-mode)))) | 1598 | major-mode)))) |
| 1515 | (kill-all-local-variables) | 1599 | (kill-all-local-variables) |
| 1516 | (set (make-local-variable 'doc-view-previous-major-mode) | 1600 | (setq-local doc-view-previous-major-mode prev-major-mode)) |
| 1517 | prev-major-mode)) | ||
| 1518 | 1601 | ||
| 1519 | (dolist (var doc-view-saved-settings) | 1602 | (dolist (var doc-view-saved-settings) |
| 1520 | (set (make-local-variable (car var)) (cdr var))) | 1603 | (set (make-local-variable (car var)) (cdr var))) |
| @@ -1522,10 +1605,11 @@ toggle between displaying the document or editing it as text. | |||
| 1522 | ;; Figure out the document type. | 1605 | ;; Figure out the document type. |
| 1523 | (unless doc-view-doc-type | 1606 | (unless doc-view-doc-type |
| 1524 | (doc-view-set-doc-type)) | 1607 | (doc-view-set-doc-type)) |
| 1608 | (doc-view-set-up-single-converter) | ||
| 1525 | 1609 | ||
| 1526 | (doc-view-make-safe-dir doc-view-cache-directory) | 1610 | (doc-view-make-safe-dir doc-view-cache-directory) |
| 1527 | ;; Handle compressed files, remote files, files inside archives | 1611 | ;; Handle compressed files, remote files, files inside archives |
| 1528 | (set (make-local-variable 'doc-view-buffer-file-name) | 1612 | (setq-local doc-view-buffer-file-name |
| 1529 | (cond | 1613 | (cond |
| 1530 | (jka-compr-really-do-compress | 1614 | (jka-compr-really-do-compress |
| 1531 | ;; FIXME: there's a risk of name conflicts here. | 1615 | ;; FIXME: there's a risk of name conflicts here. |
| @@ -1564,20 +1648,19 @@ toggle between displaying the document or editing it as text. | |||
| 1564 | 'doc-view-new-window-function nil t) | 1648 | 'doc-view-new-window-function nil t) |
| 1565 | (image-mode-setup-winprops) | 1649 | (image-mode-setup-winprops) |
| 1566 | 1650 | ||
| 1567 | (set (make-local-variable 'mode-line-position) | 1651 | (setq-local mode-line-position |
| 1568 | '(" P" (:eval (number-to-string (doc-view-current-page))) | 1652 | '(" P" (:eval (number-to-string (doc-view-current-page))) |
| 1569 | "/" (:eval (number-to-string (doc-view-last-page-number))))) | 1653 | "/" (:eval (number-to-string (doc-view-last-page-number))))) |
| 1570 | ;; Don't scroll unless the user specifically asked for it. | 1654 | ;; Don't scroll unless the user specifically asked for it. |
| 1571 | (set (make-local-variable 'auto-hscroll-mode) nil) | 1655 | (setq-local auto-hscroll-mode nil) |
| 1572 | (set (make-local-variable 'mwheel-scroll-up-function) | 1656 | (setq-local mwheel-scroll-up-function #'doc-view-scroll-up-or-next-page) |
| 1573 | 'doc-view-scroll-up-or-next-page) | 1657 | (setq-local mwheel-scroll-down-function |
| 1574 | (set (make-local-variable 'mwheel-scroll-down-function) | 1658 | #'doc-view-scroll-down-or-previous-page) |
| 1575 | 'doc-view-scroll-down-or-previous-page) | 1659 | (setq-local cursor-type nil) |
| 1576 | (set (make-local-variable 'cursor-type) nil) | ||
| 1577 | (use-local-map doc-view-mode-map) | 1660 | (use-local-map doc-view-mode-map) |
| 1578 | (set (make-local-variable 'after-revert-hook) 'doc-view-reconvert-doc) | 1661 | (add-hook 'after-revert-hook 'doc-view-reconvert-doc nil t) |
| 1579 | (set (make-local-variable 'bookmark-make-record-function) | 1662 | (setq-local bookmark-make-record-function |
| 1580 | 'doc-view-bookmark-make-record) | 1663 | #'doc-view-bookmark-make-record) |
| 1581 | (setq mode-name "DocView" | 1664 | (setq mode-name "DocView" |
| 1582 | buffer-read-only t | 1665 | buffer-read-only t |
| 1583 | major-mode 'doc-view-mode) | 1666 | major-mode 'doc-view-mode) |
| @@ -1586,7 +1669,7 @@ toggle between displaying the document or editing it as text. | |||
| 1586 | ;; canonical view mode for PDF/PS/DVI files. This could be | 1669 | ;; canonical view mode for PDF/PS/DVI files. This could be |
| 1587 | ;; switched on automatically depending on the value of | 1670 | ;; switched on automatically depending on the value of |
| 1588 | ;; `view-read-only'. | 1671 | ;; `view-read-only'. |
| 1589 | (set (make-local-variable 'view-read-only) nil) | 1672 | (setq-local view-read-only nil) |
| 1590 | (run-mode-hooks 'doc-view-mode-hook))) | 1673 | (run-mode-hooks 'doc-view-mode-hook))) |
| 1591 | 1674 | ||
| 1592 | (defun doc-view-fallback-mode () | 1675 | (defun doc-view-fallback-mode () |
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 7917b769ab8..3d03e894534 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el | |||
| @@ -589,13 +589,11 @@ | |||
| 589 | ;; Advice implements forward advice mainly via the following: 1) Separation | 589 | ;; Advice implements forward advice mainly via the following: 1) Separation |
| 590 | ;; of advice definition and activation that makes it possible to accumulate | 590 | ;; of advice definition and activation that makes it possible to accumulate |
| 591 | ;; advice information without having the original function already defined, | 591 | ;; advice information without having the original function already defined, |
| 592 | ;; 2) special versions of the built-in functions `fset/defalias' which check | 592 | ;; 2) Use of the `defalias-fset-function' symbol property which lets |
| 593 | ;; for advice information whenever they define a function. If advice | 593 | ;; us advise the function when it gets defined. |
| 594 | ;; information was found then the advice will immediately get activated when | ||
| 595 | ;; the function gets defined. | ||
| 596 | 594 | ||
| 597 | ;; Automatic advice activation means, that whenever a function gets defined | 595 | ;; Automatic advice activation means, that whenever a function gets defined |
| 598 | ;; with either `defun', `defmacro', `fset' or by loading a byte-compiled | 596 | ;; with either `defun', `defmacro', `defalias' or by loading a byte-compiled |
| 599 | ;; file, and the function has some advice-info stored with it then that | 597 | ;; file, and the function has some advice-info stored with it then that |
| 600 | ;; advice will get activated right away. | 598 | ;; advice will get activated right away. |
| 601 | 599 | ||
| @@ -2868,10 +2866,8 @@ advised definition from scratch." | |||
| 2868 | 2866 | ||
| 2869 | (defun ad-preactivate-advice (function advice class position) | 2867 | (defun ad-preactivate-advice (function advice class position) |
| 2870 | "Preactivate FUNCTION and returns the constructed cache." | 2868 | "Preactivate FUNCTION and returns the constructed cache." |
| 2871 | (let* ((function-defined-p (fboundp function)) | 2869 | (let* ((advicefunname (ad-get-advice-info-field function 'advicefunname)) |
| 2872 | (old-definition | 2870 | (old-advice (symbol-function advicefunname)) |
| 2873 | (if function-defined-p | ||
| 2874 | (symbol-function function))) | ||
| 2875 | (old-advice-info (ad-copy-advice-info function)) | 2871 | (old-advice-info (ad-copy-advice-info function)) |
| 2876 | (ad-advised-functions ad-advised-functions)) | 2872 | (ad-advised-functions ad-advised-functions)) |
| 2877 | (unwind-protect | 2873 | (unwind-protect |
| @@ -2885,10 +2881,9 @@ advised definition from scratch." | |||
| 2885 | (list (ad-get-cache-definition function) | 2881 | (list (ad-get-cache-definition function) |
| 2886 | (ad-get-cache-id function)))) | 2882 | (ad-get-cache-id function)))) |
| 2887 | (ad-set-advice-info function old-advice-info) | 2883 | (ad-set-advice-info function old-advice-info) |
| 2888 | ;; Don't `fset' function to nil if it was previously unbound: | 2884 | (advice-remove function advicefunname) |
| 2889 | (if function-defined-p | 2885 | (fset advicefunname old-advice) |
| 2890 | (fset function old-definition) | 2886 | (if old-advice (advice-add function :around advicefunname))))) |
| 2891 | (fmakunbound function))))) | ||
| 2892 | 2887 | ||
| 2893 | 2888 | ||
| 2894 | ;; @@ Activation and definition handling: | 2889 | ;; @@ Activation and definition handling: |
| @@ -2917,13 +2912,18 @@ If COMPILE is nil then the result depends on the value of | |||
| 2917 | "Redefine FUNCTION with its advised definition from cache or scratch. | 2912 | "Redefine FUNCTION with its advised definition from cache or scratch. |
| 2918 | The resulting FUNCTION will be compiled if `ad-should-compile' returns t. | 2913 | The resulting FUNCTION will be compiled if `ad-should-compile' returns t. |
| 2919 | The current definition and its cache-id will be put into the cache." | 2914 | The current definition and its cache-id will be put into the cache." |
| 2920 | (let ((verified-cached-definition | 2915 | (let* ((verified-cached-definition |
| 2921 | (if (ad-verify-cache-id function) | 2916 | (if (ad-verify-cache-id function) |
| 2922 | (ad-get-cache-definition function))) | 2917 | (ad-get-cache-definition function))) |
| 2923 | (advicefunname (ad-get-advice-info-field function 'advicefunname))) | 2918 | (advicefunname (ad-get-advice-info-field function 'advicefunname)) |
| 2919 | (old-ispec (interactive-form advicefunname))) | ||
| 2924 | (fset advicefunname | 2920 | (fset advicefunname |
| 2925 | (or verified-cached-definition | 2921 | (or verified-cached-definition |
| 2926 | (ad-make-advised-definition function))) | 2922 | (ad-make-advised-definition function))) |
| 2923 | (unless (equal (interactive-form advicefunname) old-ispec) | ||
| 2924 | ;; If the interactive-spec of advicefunname has changed, force nadvice to | ||
| 2925 | ;; refresh its copy. | ||
| 2926 | (advice-remove function advicefunname)) | ||
| 2927 | (advice-add function :around advicefunname) | 2927 | (advice-add function :around advicefunname) |
| 2928 | (if (ad-should-compile function compile) | 2928 | (if (ad-should-compile function compile) |
| 2929 | (ad-compile-function function)) | 2929 | (ad-compile-function function)) |
diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el index 6741094aa55..270badd53cb 100644 --- a/lisp/emacs-lisp/authors.el +++ b/lisp/emacs-lisp/authors.el | |||
| @@ -295,6 +295,14 @@ Changes to files matching one of the regexps in this list are not listed.") | |||
| 295 | "calc/INSTALL" "calc/Makefile" | 295 | "calc/INSTALL" "calc/Makefile" |
| 296 | "vms-pp.trans" "_emacs" "batcomp.com" "notes/cpp" ; admin/ | 296 | "vms-pp.trans" "_emacs" "batcomp.com" "notes/cpp" ; admin/ |
| 297 | "emacsver.texi.in" | 297 | "emacsver.texi.in" |
| 298 | "vpath.sed" | ||
| 299 | "Cocoa/Emacs.base/Contents/Info.plist" | ||
| 300 | "Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings" | ||
| 301 | "GNUstep/Emacs.base/Resources/Info-gnustep.plist" | ||
| 302 | "GNUstep/Emacs.base/Resources/Emacs.desktop" | ||
| 303 | "Cocoa/Emacs.base/Contents/Resources/English.lproj" | ||
| 304 | ;; Only existed briefly, then deleted: | ||
| 305 | "coccinelle/overlay.cocci" "coccinelle/symbol.cocci" | ||
| 298 | ;; MH-E stuff not in Emacs: | 306 | ;; MH-E stuff not in Emacs: |
| 299 | "import-emacs" "release-utils" | 307 | "import-emacs" "release-utils" |
| 300 | ;; Erc stuff not in Emacs: | 308 | ;; Erc stuff not in Emacs: |
| @@ -540,6 +548,7 @@ Changes to files in this list are not listed.") | |||
| 540 | "makedist.bat" | 548 | "makedist.bat" |
| 541 | "makefile.def" | 549 | "makefile.def" |
| 542 | "makefile.nt" | 550 | "makefile.nt" |
| 551 | "ns.mk" | ||
| 543 | "debug.bat.in" "emacs.bat.in" | 552 | "debug.bat.in" "emacs.bat.in" |
| 544 | ".gdbinit-union" | 553 | ".gdbinit-union" |
| 545 | "alloca.s" | 554 | "alloca.s" |
| @@ -553,15 +562,17 @@ Changes to files in this list are not listed.") | |||
| 553 | "ymakefile" | 562 | "ymakefile" |
| 554 | "permute-index" "index.perm" | 563 | "permute-index" "index.perm" |
| 555 | "ibmrs6000.inp" | 564 | "ibmrs6000.inp" |
| 556 | "b2m.c" "b2m.1" "b2m.pl" | 565 | "b2m.c" "b2m.1" "b2m.pl" "rcs-checkin.1" |
| 557 | "emacs.bash" "emacs.csh" "ms-kermit" | 566 | "emacs.bash" "emacs.csh" "ms-kermit" |
| 558 | "emacs.ico" | 567 | "emacs.ico" |
| 559 | "emacs21.ico" | 568 | "emacs21.ico" |
| 569 | "emacs.py" "emacs2.py" "emacs3.py" | ||
| 560 | "BABYL" "LPF" "LEDIT" "OTHER.EMACSES" | 570 | "BABYL" "LPF" "LEDIT" "OTHER.EMACSES" |
| 561 | "emacs16_mac.png" "emacs24_mac.png" | 571 | "emacs16_mac.png" "emacs24_mac.png" |
| 562 | "emacs256_mac.png" "emacs32_mac.png" | 572 | "emacs256_mac.png" "emacs32_mac.png" |
| 563 | "emacs48_mac.png" "emacs512_mac.png" | 573 | "emacs48_mac.png" "emacs512_mac.png" |
| 564 | "revdiff" ; admin/ | 574 | "revdiff" ; admin/ |
| 575 | "vcdiff" "rcs-checkin" "tindex.pl" | ||
| 565 | "mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/ | 576 | "mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/ |
| 566 | "mac-fix-env.m" | 577 | "mac-fix-env.m" |
| 567 | ;; Deleted vms stuff: | 578 | ;; Deleted vms stuff: |
| @@ -580,6 +591,7 @@ in the repository.") | |||
| 580 | ("s/windowsnt.h" . "s/ms-w32.h") | 591 | ("s/windowsnt.h" . "s/ms-w32.h") |
| 581 | ("s/ms-w32.h" . "inc/ms-w32.h") | 592 | ("s/ms-w32.h" . "inc/ms-w32.h") |
| 582 | ("winnt.el" . "w32-fns.el") | 593 | ("winnt.el" . "w32-fns.el") |
| 594 | ("emacs.manifest" . "emacs-x86.manifest") | ||
| 583 | ("config.emacs" . "configure") | 595 | ("config.emacs" . "configure") |
| 584 | ("configure.in" . "configure.ac") | 596 | ("configure.in" . "configure.ac") |
| 585 | ("config.h.dist" . "config.in") | 597 | ("config.h.dist" . "config.in") |
| @@ -616,6 +628,8 @@ in the repository.") | |||
| 616 | ("build-install" . "build-ins.in") | 628 | ("build-install" . "build-ins.in") |
| 617 | ("build-install.in" . "build-ins.in") | 629 | ("build-install.in" . "build-ins.in") |
| 618 | ("unidata/Makefile" . "unidata/Makefile.in") | 630 | ("unidata/Makefile" . "unidata/Makefile.in") |
| 631 | ("move-if-change" . "build-aux/move-if-change") | ||
| 632 | ("update-subdirs" . "build-aux/update-subdirs") | ||
| 619 | ;; Not renamed, but we only have the latter in the Emacs repo. | 633 | ;; Not renamed, but we only have the latter in the Emacs repo. |
| 620 | ("trampver.texi.in" . "trampver.texi") | 634 | ("trampver.texi.in" . "trampver.texi") |
| 621 | ("e/eterm" . "e/eterm-color") | 635 | ("e/eterm" . "e/eterm-color") |
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el index 5607c9b0698..f88cb0ef9bb 100644 --- a/lisp/emacs-lisp/crm.el +++ b/lisp/emacs-lisp/crm.el | |||
| @@ -30,12 +30,12 @@ | |||
| 30 | ;; a single prompt, optionally using completion. | 30 | ;; a single prompt, optionally using completion. |
| 31 | 31 | ||
| 32 | ;; Multiple strings are specified by separating each of the strings | 32 | ;; Multiple strings are specified by separating each of the strings |
| 33 | ;; with a prespecified separator character. For example, if the | 33 | ;; with a prespecified separator regexp. For example, if the |
| 34 | ;; separator character is a comma, the strings 'alice', 'bob', and | 34 | ;; separator regexp is ",", the strings 'alice', 'bob', and |
| 35 | ;; 'eve' would be specified as 'alice,bob,eve'. | 35 | ;; 'eve' would be specified as 'alice,bob,eve'. |
| 36 | 36 | ||
| 37 | ;; The default value for the separator character is the value of | 37 | ;; The default value for the separator regexp is the value of |
| 38 | ;; `crm-default-separator' (comma). The separator character may be | 38 | ;; `crm-default-separator' (comma). The separator regexp may be |
| 39 | ;; changed by modifying the value of `crm-separator'. | 39 | ;; changed by modifying the value of `crm-separator'. |
| 40 | 40 | ||
| 41 | ;; Contiguous strings of non-separator-characters are referred to as | 41 | ;; Contiguous strings of non-separator-characters are referred to as |
| @@ -96,14 +96,14 @@ | |||
| 96 | ;; first revamped version | 96 | ;; first revamped version |
| 97 | 97 | ||
| 98 | ;;; Code: | 98 | ;;; Code: |
| 99 | (defconst crm-default-separator "," | 99 | (defconst crm-default-separator "[ \t]*,[ \t]*" |
| 100 | "Default separator for `completing-read-multiple'.") | 100 | "Default separator regexp for `completing-read-multiple'.") |
| 101 | 101 | ||
| 102 | (defvar crm-separator crm-default-separator | 102 | (defvar crm-separator crm-default-separator |
| 103 | "Separator used for separating strings in `completing-read-multiple'. | 103 | "Separator regexp used for separating strings in `completing-read-multiple'. |
| 104 | It should be a single character string that doesn't appear in the list of | 104 | It should be a regexp that does not match the list of completion candidates. |
| 105 | completion candidates. Modify this value to make `completing-read-multiple' | 105 | Modify this value to make `completing-read-multiple' use a separator other |
| 106 | use a separator other than `crm-default-separator'.") | 106 | than `crm-default-separator'.") |
| 107 | 107 | ||
| 108 | (defvar crm-local-completion-map | 108 | (defvar crm-local-completion-map |
| 109 | (let ((map (make-sparse-keymap))) | 109 | (let ((map (make-sparse-keymap))) |
| @@ -173,13 +173,17 @@ Place an overlay on the element, with a `field' property, and return it." | |||
| 173 | (overlay-put ol 'field (make-symbol "crm")) | 173 | (overlay-put ol 'field (make-symbol "crm")) |
| 174 | ol)) | 174 | ol)) |
| 175 | 175 | ||
| 176 | (defmacro crm--completion-command (command) | ||
| 177 | "Make COMMAND a completion command for `completing-read-multiple'." | ||
| 178 | `(let ((ol (crm--select-current-element))) | ||
| 179 | (unwind-protect | ||
| 180 | ,command | ||
| 181 | (delete-overlay ol)))) | ||
| 182 | |||
| 176 | (defun crm-completion-help () | 183 | (defun crm-completion-help () |
| 177 | "Display a list of possible completions of the current minibuffer element." | 184 | "Display a list of possible completions of the current minibuffer element." |
| 178 | (interactive) | 185 | (interactive) |
| 179 | (let ((ol (crm--select-current-element))) | 186 | (crm--completion-command (minibuffer-completion-help)) |
| 180 | (unwind-protect | ||
| 181 | (minibuffer-completion-help) | ||
| 182 | (delete-overlay ol))) | ||
| 183 | nil) | 187 | nil) |
| 184 | 188 | ||
| 185 | (defun crm-complete () | 189 | (defun crm-complete () |
| @@ -188,19 +192,13 @@ If no characters can be completed, display a list of possible completions. | |||
| 188 | 192 | ||
| 189 | Return t if the current element is now a valid match; otherwise return nil." | 193 | Return t if the current element is now a valid match; otherwise return nil." |
| 190 | (interactive) | 194 | (interactive) |
| 191 | (let ((ol (crm--select-current-element))) | 195 | (crm--completion-command (minibuffer-complete))) |
| 192 | (unwind-protect | ||
| 193 | (minibuffer-complete) | ||
| 194 | (delete-overlay ol)))) | ||
| 195 | 196 | ||
| 196 | (defun crm-complete-word () | 197 | (defun crm-complete-word () |
| 197 | "Complete the current element at most a single word. | 198 | "Complete the current element at most a single word. |
| 198 | Like `minibuffer-complete-word' but for `completing-read-multiple'." | 199 | Like `minibuffer-complete-word' but for `completing-read-multiple'." |
| 199 | (interactive) | 200 | (interactive) |
| 200 | (let ((ol (crm--select-current-element))) | 201 | (crm--completion-command (minibuffer-complete-word))) |
| 201 | (unwind-protect | ||
| 202 | (minibuffer-complete-word) | ||
| 203 | (delete-overlay ol)))) | ||
| 204 | 202 | ||
| 205 | (defun crm-complete-and-exit () | 203 | (defun crm-complete-and-exit () |
| 206 | "If all of the minibuffer elements are valid completions then exit. | 204 | "If all of the minibuffer elements are valid completions then exit. |
| @@ -222,9 +220,10 @@ This function is modeled after `minibuffer-complete-and-exit'." | |||
| 222 | (setq doexit nil)) | 220 | (setq doexit nil)) |
| 223 | (goto-char (overlay-end ol)) | 221 | (goto-char (overlay-end ol)) |
| 224 | (delete-overlay ol)) | 222 | (delete-overlay ol)) |
| 225 | (not (eobp)))) | 223 | (not (eobp))) |
| 224 | (looking-at crm-separator)) | ||
| 226 | ;; Skip to the next element. | 225 | ;; Skip to the next element. |
| 227 | (forward-char 1)) | 226 | (goto-char (match-end 0))) |
| 228 | (if doexit (exit-minibuffer)))) | 227 | (if doexit (exit-minibuffer)))) |
| 229 | 228 | ||
| 230 | (defun crm--choose-completion-string (choice buffer base-position | 229 | (defun crm--choose-completion-string (choice buffer base-position |
| @@ -248,12 +247,12 @@ By using this functionality, a user may specify multiple strings at a | |||
| 248 | single prompt, optionally using completion. | 247 | single prompt, optionally using completion. |
| 249 | 248 | ||
| 250 | Multiple strings are specified by separating each of the strings with | 249 | Multiple strings are specified by separating each of the strings with |
| 251 | a prespecified separator character. For example, if the separator | 250 | a prespecified separator regexp. For example, if the separator |
| 252 | character is a comma, the strings 'alice', 'bob', and 'eve' would be | 251 | regexp is \",\", the strings 'alice', 'bob', and 'eve' would be |
| 253 | specified as 'alice,bob,eve'. | 252 | specified as 'alice,bob,eve'. |
| 254 | 253 | ||
| 255 | The default value for the separator character is the value of | 254 | The default value for the separator regexp is the value of |
| 256 | `crm-default-separator' (comma). The separator character may be | 255 | `crm-default-separator' (comma). The separator regexp may be |
| 257 | changed by modifying the value of `crm-separator'. | 256 | changed by modifying the value of `crm-separator'. |
| 258 | 257 | ||
| 259 | Contiguous strings of non-separator-characters are referred to as | 258 | Contiguous strings of non-separator-characters are referred to as |
| @@ -282,8 +281,8 @@ INHERIT-INPUT-METHOD." | |||
| 282 | (map (if require-match | 281 | (map (if require-match |
| 283 | crm-local-must-match-map | 282 | crm-local-must-match-map |
| 284 | crm-local-completion-map)) | 283 | crm-local-completion-map)) |
| 285 | ;; If the user enters empty input, read-from-minibuffer returns | 284 | ;; If the user enters empty input, `read-from-minibuffer' |
| 286 | ;; the empty string, not DEF. | 285 | ;; returns the empty string, not DEF. |
| 287 | (input (read-from-minibuffer | 286 | (input (read-from-minibuffer |
| 288 | prompt initial-input map | 287 | prompt initial-input map |
| 289 | nil hist def inherit-input-method))) | 288 | nil hist def inherit-input-method))) |
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 378ba9db9f4..52e12013fd3 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el | |||
| @@ -461,8 +461,8 @@ STREAM or the value of `standard-input' may be: | |||
| 461 | 461 | ||
| 462 | This version, from Edebug, maybe instruments the expression. But the | 462 | This version, from Edebug, maybe instruments the expression. But the |
| 463 | STREAM must be the current buffer to do so. Whether it instruments is | 463 | STREAM must be the current buffer to do so. Whether it instruments is |
| 464 | also dependent on the values of `edebug-all-defs' and | 464 | also dependent on the values of the option `edebug-all-defs' and |
| 465 | `edebug-all-forms'." | 465 | the option `edebug-all-forms'." |
| 466 | (or stream (setq stream standard-input)) | 466 | (or stream (setq stream standard-input)) |
| 467 | (if (eq stream (current-buffer)) | 467 | (if (eq stream (current-buffer)) |
| 468 | (edebug-read-and-maybe-wrap-form) | 468 | (edebug-read-and-maybe-wrap-form) |
| @@ -484,8 +484,8 @@ similarly. Reinitialize the face according to `defface' specification. | |||
| 484 | 484 | ||
| 485 | With a prefix argument, instrument the code for Edebug. | 485 | With a prefix argument, instrument the code for Edebug. |
| 486 | 486 | ||
| 487 | Setting `edebug-all-defs' to a non-nil value reverses the meaning of | 487 | Setting option `edebug-all-defs' to a non-nil value reverses the meaning |
| 488 | the prefix argument. Code is then instrumented when this function is | 488 | of the prefix argument. Code is then instrumented when this function is |
| 489 | invoked without a prefix argument | 489 | invoked without a prefix argument |
| 490 | 490 | ||
| 491 | If acting on a `defun' for FUNCTION, and the function was instrumented, | 491 | If acting on a `defun' for FUNCTION, and the function was instrumented, |
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 70d6a6a4a5f..dd849362228 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el | |||
| @@ -937,7 +937,7 @@ Returns the result and stores it in ERT-TEST's `most-recent-result' slot." | |||
| 937 | (cl-block error | 937 | (cl-block error |
| 938 | (let ((begin-marker | 938 | (let ((begin-marker |
| 939 | (with-current-buffer (get-buffer-create "*Messages*") | 939 | (with-current-buffer (get-buffer-create "*Messages*") |
| 940 | (set-marker (make-marker) (point-max))))) | 940 | (point-max-marker)))) |
| 941 | (unwind-protect | 941 | (unwind-protect |
| 942 | (let ((info (make-ert--test-execution-info | 942 | (let ((info (make-ert--test-execution-info |
| 943 | :test ert-test | 943 | :test ert-test |
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index b4d6fac92a2..b0711fed26c 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el | |||
| @@ -167,20 +167,27 @@ WHERE is a symbol to select an entry in `advice--where-alist'." | |||
| 167 | (setq definition (advice--cdr definition)))) | 167 | (setq definition (advice--cdr definition)))) |
| 168 | found)) | 168 | found)) |
| 169 | 169 | ||
| 170 | ;;;###autoload | 170 | (defun advice--tweak (flist tweaker) |
| 171 | (defun advice--remove-function (flist function) | ||
| 172 | (if (not (advice--p flist)) | 171 | (if (not (advice--p flist)) |
| 173 | flist | 172 | (funcall tweaker nil flist nil) |
| 174 | (let ((first (advice--car flist)) | 173 | (let ((first (advice--car flist)) |
| 174 | (rest (advice--cdr flist)) | ||
| 175 | (props (advice--props flist))) | 175 | (props (advice--props flist))) |
| 176 | (if (or (equal function first) | 176 | (let ((val (funcall tweaker first rest props))) |
| 177 | (equal function (cdr (assq 'name props)))) | 177 | (if val (car val) |
| 178 | (advice--cdr flist) | 178 | (let ((nrest (advice--tweak rest tweaker))) |
| 179 | (let* ((rest (advice--cdr flist)) | 179 | (if (eq rest nrest) flist |
| 180 | (nrest (advice--remove-function rest function))) | 180 | (advice--make-1 (aref flist 1) (aref flist 3) |
| 181 | (if (eq rest nrest) flist | 181 | first nrest props)))))))) |
| 182 | (advice--make-1 (aref flist 1) (aref flist 3) | 182 | |
| 183 | first nrest props))))))) | 183 | ;;;###autoload |
| 184 | (defun advice--remove-function (flist function) | ||
| 185 | (advice--tweak flist | ||
| 186 | (lambda (first rest props) | ||
| 187 | (cond ((not first) rest) | ||
| 188 | ((or (equal function first) | ||
| 189 | (equal function (cdr (assq 'name props)))) | ||
| 190 | (list rest)))))) | ||
| 184 | 191 | ||
| 185 | (defvar advice--buffer-local-function-sample nil) | 192 | (defvar advice--buffer-local-function-sample nil) |
| 186 | 193 | ||
| @@ -269,15 +276,8 @@ of the piece of advice." | |||
| 269 | ;;;; Specific application of add-function to `symbol-function' for advice. | 276 | ;;;; Specific application of add-function to `symbol-function' for advice. |
| 270 | 277 | ||
| 271 | (defun advice--subst-main (old new) | 278 | (defun advice--subst-main (old new) |
| 272 | (if (not (advice--p old)) | 279 | (advice--tweak old |
| 273 | new | 280 | (lambda (first _rest _props) (if (not first) new)))) |
| 274 | (let* ((first (advice--car old)) | ||
| 275 | (rest (advice--cdr old)) | ||
| 276 | (props (advice--props old)) | ||
| 277 | (nrest (advice--subst-main rest new))) | ||
| 278 | (if (equal rest nrest) old | ||
| 279 | (advice--make-1 (aref old 1) (aref old 3) | ||
| 280 | first nrest props))))) | ||
| 281 | 281 | ||
| 282 | (defun advice--normalize (symbol def) | 282 | (defun advice--normalize (symbol def) |
| 283 | (cond | 283 | (cond |
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 69834810d11..e000c343721 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el | |||
| @@ -431,30 +431,31 @@ MATCH is the pattern that needs to be matched, of the form: | |||
| 431 | (match ,symd . ,(pcase--upat (cdr qpat)))) | 431 | (match ,symd . ,(pcase--upat (cdr qpat)))) |
| 432 | :pcase--fail))) | 432 | :pcase--fail))) |
| 433 | ;; A QPattern but not for a cons, can only go to the `else' side. | 433 | ;; A QPattern but not for a cons, can only go to the `else' side. |
| 434 | ((eq (car-safe pat) '\`) (cons :pcase--fail nil)) | 434 | ((eq (car-safe pat) '\`) '(:pcase--fail . nil)) |
| 435 | ((and (eq (car-safe pat) 'pred) | 435 | ((and (eq (car-safe pat) 'pred) |
| 436 | (or (member (cons 'consp (cadr pat)) | 436 | (or (member (cons 'consp (cadr pat)) |
| 437 | pcase-mutually-exclusive-predicates) | 437 | pcase-mutually-exclusive-predicates) |
| 438 | (member (cons (cadr pat) 'consp) | 438 | (member (cons (cadr pat) 'consp) |
| 439 | pcase-mutually-exclusive-predicates))) | 439 | pcase-mutually-exclusive-predicates))) |
| 440 | (cons :pcase--fail nil)))) | 440 | '(:pcase--fail . nil)))) |
| 441 | 441 | ||
| 442 | (defun pcase--split-equal (elem pat) | 442 | (defun pcase--split-equal (elem pat) |
| 443 | (cond | 443 | (cond |
| 444 | ;; The same match will give the same result. | 444 | ;; The same match will give the same result. |
| 445 | ((and (eq (car-safe pat) '\`) (equal (cadr pat) elem)) | 445 | ((and (eq (car-safe pat) '\`) (equal (cadr pat) elem)) |
| 446 | (cons :pcase--succeed :pcase--fail)) | 446 | '(:pcase--succeed . :pcase--fail)) |
| 447 | ;; A different match will fail if this one succeeds. | 447 | ;; A different match will fail if this one succeeds. |
| 448 | ((and (eq (car-safe pat) '\`) | 448 | ((and (eq (car-safe pat) '\`) |
| 449 | ;; (or (integerp (cadr pat)) (symbolp (cadr pat)) | 449 | ;; (or (integerp (cadr pat)) (symbolp (cadr pat)) |
| 450 | ;; (consp (cadr pat))) | 450 | ;; (consp (cadr pat))) |
| 451 | ) | 451 | ) |
| 452 | (cons :pcase--fail nil)) | 452 | '(:pcase--fail . nil)) |
| 453 | ((and (eq (car-safe pat) 'pred) | 453 | ((and (eq (car-safe pat) 'pred) |
| 454 | (symbolp (cadr pat)) | 454 | (symbolp (cadr pat)) |
| 455 | (get (cadr pat) 'side-effect-free) | 455 | (get (cadr pat) 'side-effect-free)) |
| 456 | (funcall (cadr pat) elem)) | 456 | (if (funcall (cadr pat) elem) |
| 457 | (cons :pcase--succeed nil)))) | 457 | '(:pcase--succeed . nil) |
| 458 | '(:pcase--fail . nil))))) | ||
| 458 | 459 | ||
| 459 | (defun pcase--split-member (elems pat) | 460 | (defun pcase--split-member (elems pat) |
| 460 | ;; Based on pcase--split-equal. | 461 | ;; Based on pcase--split-equal. |
| @@ -462,7 +463,7 @@ MATCH is the pattern that needs to be matched, of the form: | |||
| 462 | ;; The same match (or a match of membership in a superset) will | 463 | ;; The same match (or a match of membership in a superset) will |
| 463 | ;; give the same result, but we don't know how to check it. | 464 | ;; give the same result, but we don't know how to check it. |
| 464 | ;; (??? | 465 | ;; (??? |
| 465 | ;; (cons :pcase--succeed nil)) | 466 | ;; '(:pcase--succeed . nil)) |
| 466 | ;; A match for one of the elements may succeed or fail. | 467 | ;; A match for one of the elements may succeed or fail. |
| 467 | ((and (eq (car-safe pat) '\`) (member (cadr pat) elems)) | 468 | ((and (eq (car-safe pat) '\`) (member (cadr pat) elems)) |
| 468 | nil) | 469 | nil) |
| @@ -471,7 +472,7 @@ MATCH is the pattern that needs to be matched, of the form: | |||
| 471 | ;; (or (integerp (cadr pat)) (symbolp (cadr pat)) | 472 | ;; (or (integerp (cadr pat)) (symbolp (cadr pat)) |
| 472 | ;; (consp (cadr pat))) | 473 | ;; (consp (cadr pat))) |
| 473 | ) | 474 | ) |
| 474 | (cons :pcase--fail nil)) | 475 | '(:pcase--fail . nil)) |
| 475 | ((and (eq (car-safe pat) 'pred) | 476 | ((and (eq (car-safe pat) 'pred) |
| 476 | (symbolp (cadr pat)) | 477 | (symbolp (cadr pat)) |
| 477 | (get (cadr pat) 'side-effect-free) | 478 | (get (cadr pat) 'side-effect-free) |
| @@ -479,21 +480,21 @@ MATCH is the pattern that needs to be matched, of the form: | |||
| 479 | (dolist (elem elems) | 480 | (dolist (elem elems) |
| 480 | (unless (funcall p elem) (setq all nil))) | 481 | (unless (funcall p elem) (setq all nil))) |
| 481 | all)) | 482 | all)) |
| 482 | (cons :pcase--succeed nil)))) | 483 | '(:pcase--succeed . nil)))) |
| 483 | 484 | ||
| 484 | (defun pcase--split-pred (upat pat) | 485 | (defun pcase--split-pred (upat pat) |
| 485 | ;; FIXME: For predicates like (pred (> a)), two such predicates may | 486 | ;; FIXME: For predicates like (pred (> a)), two such predicates may |
| 486 | ;; actually refer to different variables `a'. | 487 | ;; actually refer to different variables `a'. |
| 487 | (let (test) | 488 | (let (test) |
| 488 | (cond | 489 | (cond |
| 489 | ((equal upat pat) (cons :pcase--succeed :pcase--fail)) | 490 | ((equal upat pat) '(:pcase--succeed . :pcase--fail)) |
| 490 | ((and (eq 'pred (car upat)) | 491 | ((and (eq 'pred (car upat)) |
| 491 | (eq 'pred (car-safe pat)) | 492 | (eq 'pred (car-safe pat)) |
| 492 | (or (member (cons (cadr upat) (cadr pat)) | 493 | (or (member (cons (cadr upat) (cadr pat)) |
| 493 | pcase-mutually-exclusive-predicates) | 494 | pcase-mutually-exclusive-predicates) |
| 494 | (member (cons (cadr pat) (cadr upat)) | 495 | (member (cons (cadr pat) (cadr upat)) |
| 495 | pcase-mutually-exclusive-predicates))) | 496 | pcase-mutually-exclusive-predicates))) |
| 496 | (cons :pcase--fail nil)) | 497 | '(:pcase--fail . nil)) |
| 497 | ((and (eq 'pred (car upat)) | 498 | ((and (eq 'pred (car upat)) |
| 498 | (eq '\` (car-safe pat)) | 499 | (eq '\` (car-safe pat)) |
| 499 | (symbolp (cadr upat)) | 500 | (symbolp (cadr upat)) |
| @@ -502,8 +503,8 @@ MATCH is the pattern that needs to be matched, of the form: | |||
| 502 | (ignore-errors | 503 | (ignore-errors |
| 503 | (setq test (list (funcall (cadr upat) (cadr pat)))))) | 504 | (setq test (list (funcall (cadr upat) (cadr pat)))))) |
| 504 | (if (car test) | 505 | (if (car test) |
| 505 | (cons nil :pcase--fail) | 506 | '(nil . :pcase--fail) |
| 506 | (cons :pcase--fail nil)))))) | 507 | '(:pcase--fail . nil)))))) |
| 507 | 508 | ||
| 508 | (defun pcase--fgrep (vars sexp) | 509 | (defun pcase--fgrep (vars sexp) |
| 509 | "Check which of the symbols VARS appear in SEXP." | 510 | "Check which of the symbols VARS appear in SEXP." |
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 3eaacd24ec8..8b019d0a785 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el | |||
| @@ -307,13 +307,13 @@ This function is called, by name, directly by the C code." | |||
| 307 | ;; Run handler. | 307 | ;; Run handler. |
| 308 | ;; We do this after rescheduling so that the handler function | 308 | ;; We do this after rescheduling so that the handler function |
| 309 | ;; can cancel its own timer successfully with cancel-timer. | 309 | ;; can cancel its own timer successfully with cancel-timer. |
| 310 | (condition-case nil | 310 | (condition-case-unless-debug err |
| 311 | ;; Timer functions should not change the current buffer. | 311 | ;; Timer functions should not change the current buffer. |
| 312 | ;; If they do, all kinds of nasty surprises can happen, | 312 | ;; If they do, all kinds of nasty surprises can happen, |
| 313 | ;; and it can be hellish to track down their source. | 313 | ;; and it can be hellish to track down their source. |
| 314 | (save-current-buffer | 314 | (save-current-buffer |
| 315 | (apply (timer--function timer) (timer--args timer))) | 315 | (apply (timer--function timer) (timer--args timer))) |
| 316 | (error nil)) | 316 | (error (message "Error in timer: %S" err))) |
| 317 | (if retrigger | 317 | (if retrigger |
| 318 | (setf (timer--triggered timer) nil))) | 318 | (setf (timer--triggered timer) nil))) |
| 319 | (error "Bogus timer event")))) | 319 | (error "Bogus timer event")))) |
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el index d2566b8cb9f..fb1b995be2b 100644 --- a/lisp/emacs-lisp/trace.el +++ b/lisp/emacs-lisp/trace.el | |||
| @@ -38,11 +38,6 @@ | |||
| 38 | ;; generation of trace output won't interfere with what you are currently | 38 | ;; generation of trace output won't interfere with what you are currently |
| 39 | ;; doing. | 39 | ;; doing. |
| 40 | 40 | ||
| 41 | ;; Requirement: | ||
| 42 | ;; ============ | ||
| 43 | ;; trace.el needs advice.el version 2.0 or later which you can get from the | ||
| 44 | ;; same place from where you got trace.el. | ||
| 45 | |||
| 46 | ;; Restrictions: | 41 | ;; Restrictions: |
| 47 | ;; ============= | 42 | ;; ============= |
| 48 | ;; - Traced subrs when called interactively will always show nil as the | 43 | ;; - Traced subrs when called interactively will always show nil as the |
| @@ -55,17 +50,6 @@ | |||
| 55 | ;; + Macros that were expanded during compilation | 50 | ;; + Macros that were expanded during compilation |
| 56 | ;; - All the restrictions that apply to advice.el | 51 | ;; - All the restrictions that apply to advice.el |
| 57 | 52 | ||
| 58 | ;; Installation: | ||
| 59 | ;; ============= | ||
| 60 | ;; Put this file together with advice.el (version 2.0 or later) somewhere | ||
| 61 | ;; into your Emacs `load-path', byte-compile it/them for efficiency, and | ||
| 62 | ;; put the following autoload declarations into your .emacs | ||
| 63 | ;; | ||
| 64 | ;; (autoload 'trace-function "trace" "Trace a function" t) | ||
| 65 | ;; (autoload 'trace-function-background "trace" "Trace a function" t) | ||
| 66 | ;; | ||
| 67 | ;; or explicitly load it with (require 'trace) or (load "trace"). | ||
| 68 | |||
| 69 | ;; Usage: | 53 | ;; Usage: |
| 70 | ;; ====== | 54 | ;; ====== |
| 71 | ;; - To trace a function say `M-x trace-function' which will ask you for the | 55 | ;; - To trace a function say `M-x trace-function' which will ask you for the |
| @@ -183,6 +167,8 @@ some global variables)." | |||
| 183 | (mapconcat 'char-to-string (make-string (1- level) ?|) " ") | 167 | (mapconcat 'char-to-string (make-string (1- level) ?|) " ") |
| 184 | (if (> level 1) " " "") | 168 | (if (> level 1) " " "") |
| 185 | level | 169 | level |
| 170 | ;; FIXME: Make it so we can click the function name to jump to its | ||
| 171 | ;; definition and/or untrace it. | ||
| 186 | (cons function args) | 172 | (cons function args) |
| 187 | context))) | 173 | context))) |
| 188 | 174 | ||
| @@ -282,21 +268,17 @@ and return values will be inserted into BUFFER. This function generates the | |||
| 282 | trace advice for FUNCTION and activates it together with any other advice | 268 | trace advice for FUNCTION and activates it together with any other advice |
| 283 | there might be!! The trace BUFFER will popup whenever FUNCTION is called. | 269 | there might be!! The trace BUFFER will popup whenever FUNCTION is called. |
| 284 | Do not use this to trace functions that switch buffers or do any other | 270 | Do not use this to trace functions that switch buffers or do any other |
| 285 | display oriented stuff, use `trace-function-background' instead." | 271 | display oriented stuff, use `trace-function-background' instead. |
| 272 | |||
| 273 | To untrace a function, use `untrace-function' or `untrace-all'." | ||
| 286 | (interactive (trace--read-args "Trace function: ")) | 274 | (interactive (trace--read-args "Trace function: ")) |
| 287 | (trace-function-internal function buffer nil context)) | 275 | (trace-function-internal function buffer nil context)) |
| 288 | 276 | ||
| 289 | ;;;###autoload | 277 | ;;;###autoload |
| 290 | (defun trace-function-background (function &optional buffer context) | 278 | (defun trace-function-background (function &optional buffer context) |
| 291 | "Traces FUNCTION with trace output going quietly to BUFFER. | 279 | "Traces FUNCTION with trace output going quietly to BUFFER. |
| 292 | When this tracing is enabled, every call to FUNCTION writes | 280 | Like `trace-function-foreground' but without popping up the trace BUFFER or |
| 293 | a Lisp-style trace message (showing the arguments and return value) | 281 | changing the window configuration." |
| 294 | into BUFFER. This function generates advice to trace FUNCTION | ||
| 295 | and activates it together with any other advice there might be. | ||
| 296 | The trace output goes to BUFFER quietly, without changing | ||
| 297 | the window or buffer configuration. | ||
| 298 | |||
| 299 | BUFFER defaults to `trace-buffer'." | ||
| 300 | (interactive (trace--read-args "Trace function in background: ")) | 282 | (interactive (trace--read-args "Trace function in background: ")) |
| 301 | (trace-function-internal function buffer t context)) | 283 | (trace-function-internal function buffer t context)) |
| 302 | 284 | ||
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 3a625eb215e..bbe551c735d 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * erc-dcc.el (erc-dcc-send-file): Use point-min-marker. | ||
| 4 | (erc-dcc-chat-setup): Use point-max-marker. | ||
| 5 | |||
| 1 | 2013-01-04 Glenn Morris <rgm@gnu.org> | 6 | 2013-01-04 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * erc-backend.el (312): Fix typo. (Bug#13235) | 8 | * erc-backend.el (312): Fix typo. (Bug#13235) |
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index dc67d3b01df..c27bb629f9d 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el | |||
| @@ -897,7 +897,7 @@ other client." | |||
| 897 | (let* ((buffer (erc-dcc-find-file file)) | 897 | (let* ((buffer (erc-dcc-find-file file)) |
| 898 | (size (buffer-size buffer)) | 898 | (size (buffer-size buffer)) |
| 899 | (start (with-current-buffer buffer | 899 | (start (with-current-buffer buffer |
| 900 | (set-marker (make-marker) (point-min)))) | 900 | (point-min-marker))) |
| 901 | (sproc (erc-dcc-server "dcc-send" | 901 | (sproc (erc-dcc-server "dcc-send" |
| 902 | 'erc-dcc-send-filter | 902 | 'erc-dcc-send-filter |
| 903 | 'erc-dcc-send-sentinel)) | 903 | 'erc-dcc-send-sentinel)) |
| @@ -1166,7 +1166,7 @@ other client." | |||
| 1166 | (setq erc-dcc-from nick) | 1166 | (setq erc-dcc-from nick) |
| 1167 | (setq erc-dcc-entry-data entry) | 1167 | (setq erc-dcc-entry-data entry) |
| 1168 | (setq erc-dcc-unprocessed-output "") | 1168 | (setq erc-dcc-unprocessed-output "") |
| 1169 | (setq erc-insert-marker (set-marker (make-marker) (point-max))) | 1169 | (setq erc-insert-marker (point-max-marker)) |
| 1170 | (setq erc-input-marker (make-marker)) | 1170 | (setq erc-input-marker (make-marker)) |
| 1171 | (erc-display-prompt buffer (point-max)) | 1171 | (erc-display-prompt buffer (point-max)) |
| 1172 | (set-process-buffer proc buffer) | 1172 | (set-process-buffer proc buffer) |
diff --git a/lisp/faces.el b/lisp/faces.el index f78a4cb9e3d..60410733514 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -929,27 +929,29 @@ of the default face. Value is FACE." | |||
| 929 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 929 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 930 | 930 | ||
| 931 | (defun read-face-name (prompt &optional default multiple) | 931 | (defun read-face-name (prompt &optional default multiple) |
| 932 | "Read a face, defaulting to the face or faces at point. | 932 | "Read one or more face names, defaulting to the face(s) at point. |
| 933 | If the text at point has the property `read-face-name', that | 933 | PROMPT should be a prompt string; it should not end in a space or |
| 934 | overrides the `face' property for determining the default. | 934 | a colon. |
| 935 | 935 | ||
| 936 | PROMPT should be a string that describes what the caller will do | 936 | The optional argument DEFAULT specifies the default face name(s) |
| 937 | with the face; it should not end in a space. | 937 | to return if the user just types RET. If its value is non-nil, |
| 938 | it should be a list of face names (symbols); in that case, the | ||
| 939 | default return value is the `car' of DEFAULT (if the argument | ||
| 940 | MULTIPLE is non-nil), or DEFAULT (if MULTIPLE is nil). See below | ||
| 941 | for the meaning of MULTIPLE. | ||
| 938 | 942 | ||
| 943 | If DEFAULT is nil, the list of default face names is taken from | ||
| 944 | the `read-face-name' property of the text at point, or, if that | ||
| 945 | is nil, from the `face' property of the text at point. | ||
| 939 | 946 | ||
| 940 | This function uses `completing-read-multiple' with \",\" as the | 947 | This function uses `completing-read-multiple' with \",\" as the |
| 941 | separator character, i.e. | 948 | separator character. Thus, the user may enter multiple face |
| 942 | 949 | names, separated by commas. The optional argument MULTIPLE | |
| 943 | 950 | specifies the form of the return value. If MULTIPLE is non-nil, | |
| 944 | 951 | return a list of face names; if the user entered just one face | |
| 945 | 952 | name, the return value would be a list of one face name. | |
| 946 | 953 | Otherwise, return a single face name; if the user entered more | |
| 947 | The optional argument DEFAULT provides the value to display in the | 954 | than one face name, return only the first one." |
| 948 | minibuffer prompt that is returned if the user just types RET | ||
| 949 | unless DEFAULT is a string (in which case nil is returned). | ||
| 950 | |||
| 951 | If MULTIPLE is non-nil, return a list of faces (possibly only one). | ||
| 952 | Otherwise, return a single face." | ||
| 953 | (let ((faceprop (or (get-char-property (point) 'read-face-name) | 955 | (let ((faceprop (or (get-char-property (point) 'read-face-name) |
| 954 | (get-char-property (point) 'face))) | 956 | (get-char-property (point) 'face))) |
| 955 | (aliasfaces nil) | 957 | (aliasfaces nil) |
diff --git a/lisp/ffap.el b/lisp/ffap.el index dfb559f3f0d..c5b0784e5a2 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el | |||
| @@ -321,7 +321,7 @@ disable FFAP most of the time." | |||
| 321 | "Last value returned by `ffap-next-guess'.") | 321 | "Last value returned by `ffap-next-guess'.") |
| 322 | 322 | ||
| 323 | (defvar ffap-string-at-point-region '(1 1) | 323 | (defvar ffap-string-at-point-region '(1 1) |
| 324 | "List (BEG END), last region returned by `ffap-string-at-point'.") | 324 | "List (BEG END), last region returned by the function `ffap-string-at-point'.") |
| 325 | 325 | ||
| 326 | (defun ffap-next-guess (&optional back lim) | 326 | (defun ffap-next-guess (&optional back lim) |
| 327 | "Move point to next file or URL, and return it as a string. | 327 | "Move point to next file or URL, and return it as a string. |
| @@ -346,7 +346,7 @@ Optional argument BACK says to search backwards. | |||
| 346 | Optional argument WRAP says to try wrapping around if necessary. | 346 | Optional argument WRAP says to try wrapping around if necessary. |
| 347 | Interactively: use a single prefix to search backwards, | 347 | Interactively: use a single prefix to search backwards, |
| 348 | double prefix to wrap forward, triple to wrap backwards. | 348 | double prefix to wrap forward, triple to wrap backwards. |
| 349 | Actual search is done by `ffap-next-guess'." | 349 | Actual search is done by the function `ffap-next-guess'." |
| 350 | (interactive | 350 | (interactive |
| 351 | (cdr (assq (prefix-numeric-value current-prefix-arg) | 351 | (cdr (assq (prefix-numeric-value current-prefix-arg) |
| 352 | '((1) (4 t) (16 nil t) (64 t t))))) | 352 | '((1) (4 t) (16 nil t) (64 t t))))) |
| @@ -1028,14 +1028,14 @@ If a given RFC isn't in these then `ffap-rfc-path' is offered." | |||
| 1028 | "Alist of \(MODE CHARS BEG END\), where MODE is a symbol, | 1028 | "Alist of \(MODE CHARS BEG END\), where MODE is a symbol, |
| 1029 | possibly a major-mode name, or one of the symbol | 1029 | possibly a major-mode name, or one of the symbol |
| 1030 | `file', `url', `machine', and `nocolon'. | 1030 | `file', `url', `machine', and `nocolon'. |
| 1031 | `ffap-string-at-point' uses the data fields as follows: | 1031 | Function `ffap-string-at-point' uses the data fields as follows: |
| 1032 | 1. find a maximal string of CHARS around point, | 1032 | 1. find a maximal string of CHARS around point, |
| 1033 | 2. strip BEG chars before point from the beginning, | 1033 | 2. strip BEG chars before point from the beginning, |
| 1034 | 3. Strip END chars after point from the end.") | 1034 | 3. Strip END chars after point from the end.") |
| 1035 | 1035 | ||
| 1036 | (defvar ffap-string-at-point nil | 1036 | (defvar ffap-string-at-point nil |
| 1037 | ;; Added at suggestion of RHOGEE (for ff-paths), 7/24/95. | 1037 | ;; Added at suggestion of RHOGEE (for ff-paths), 7/24/95. |
| 1038 | "Last string returned by `ffap-string-at-point'.") | 1038 | "Last string returned by the function `ffap-string-at-point'.") |
| 1039 | 1039 | ||
| 1040 | (defun ffap-string-at-point (&optional mode) | 1040 | (defun ffap-string-at-point (&optional mode) |
| 1041 | "Return a string of characters from around point. | 1041 | "Return a string of characters from around point. |
| @@ -1043,7 +1043,8 @@ MODE (defaults to value of `major-mode') is a symbol used to look up string | |||
| 1043 | syntax parameters in `ffap-string-at-point-mode-alist'. | 1043 | syntax parameters in `ffap-string-at-point-mode-alist'. |
| 1044 | If MODE is not found, we use `file' instead of MODE. | 1044 | If MODE is not found, we use `file' instead of MODE. |
| 1045 | If the region is active, return a string from the region. | 1045 | If the region is active, return a string from the region. |
| 1046 | Sets `ffap-string-at-point' and `ffap-string-at-point-region'." | 1046 | Sets the variable `ffap-string-at-point' and the variable |
| 1047 | `ffap-string-at-point-region'." | ||
| 1047 | (let* ((args | 1048 | (let* ((args |
| 1048 | (cdr | 1049 | (cdr |
| 1049 | (or (assq (or mode major-mode) ffap-string-at-point-mode-alist) | 1050 | (or (assq (or mode major-mode) ffap-string-at-point-mode-alist) |
| @@ -1068,7 +1069,8 @@ Sets `ffap-string-at-point' and `ffap-string-at-point-region'." | |||
| 1068 | 1069 | ||
| 1069 | (defun ffap-string-around () | 1070 | (defun ffap-string-around () |
| 1070 | ;; Sometimes useful to decide how to treat a string. | 1071 | ;; Sometimes useful to decide how to treat a string. |
| 1071 | "Return string of two chars around last `ffap-string-at-point'. | 1072 | "Return string of two chars around last result of function |
| 1073 | `ffap-string-at-point'. | ||
| 1072 | Assumes the buffer has not changed." | 1074 | Assumes the buffer has not changed." |
| 1073 | (save-excursion | 1075 | (save-excursion |
| 1074 | (format "%c%c" | 1076 | (format "%c%c" |
| @@ -1082,7 +1084,7 @@ Assumes the buffer has not changed." | |||
| 1082 | 1084 | ||
| 1083 | (defun ffap-copy-string-as-kill (&optional mode) | 1085 | (defun ffap-copy-string-as-kill (&optional mode) |
| 1084 | ;; Requested by MCOOK. Useful? | 1086 | ;; Requested by MCOOK. Useful? |
| 1085 | "Call `ffap-string-at-point', and copy result to `kill-ring'." | 1087 | "Call function `ffap-string-at-point', and copy result to `kill-ring'." |
| 1086 | (interactive) | 1088 | (interactive) |
| 1087 | (let ((str (ffap-string-at-point mode))) | 1089 | (let ((str (ffap-string-at-point mode))) |
| 1088 | (if (equal "" str) | 1090 | (if (equal "" str) |
| @@ -1364,7 +1366,7 @@ which may actually result in an URL rather than a filename." | |||
| 1364 | :version "22.1") | 1366 | :version "22.1") |
| 1365 | 1367 | ||
| 1366 | (defvar ffap-highlight-overlay nil | 1368 | (defvar ffap-highlight-overlay nil |
| 1367 | "Overlay used by `ffap-highlight'.") | 1369 | "Overlay used by function `ffap-highlight'.") |
| 1368 | 1370 | ||
| 1369 | (defun ffap-highlight (&optional remove) | 1371 | (defun ffap-highlight (&optional remove) |
| 1370 | "If `ffap-highlight' is set, highlight the guess in this buffer. | 1372 | "If `ffap-highlight' is set, highlight the guess in this buffer. |
| @@ -1734,7 +1736,7 @@ Only intended for interactive use." | |||
| 1734 | (call-interactively 'ffap))) | 1736 | (call-interactively 'ffap))) |
| 1735 | 1737 | ||
| 1736 | (defun ffap-literally () | 1738 | (defun ffap-literally () |
| 1737 | "Like `ffap' and `find-file-literally'. | 1739 | "Like `ffap' and command `find-file-literally'. |
| 1738 | Only intended for interactive use." | 1740 | Only intended for interactive use." |
| 1739 | (interactive) | 1741 | (interactive) |
| 1740 | (let ((ffap-file-finder 'find-file-literally)) | 1742 | (let ((ffap-file-finder 'find-file-literally)) |
diff --git a/lisp/files.el b/lisp/files.el index ca5a415fb8e..b015b53db3c 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2357,7 +2357,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . archive-mode) | |||
| 2357 | ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) | 2357 | ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) |
| 2358 | ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG | 2358 | ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG |
| 2359 | ("\\.[eE]?[pP][sS]\\'" . ps-mode) | 2359 | ("\\.[eE]?[pP][sS]\\'" . ps-mode) |
| 2360 | ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) | 2360 | ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) |
| 2361 | ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) | 2361 | ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) |
| 2362 | ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode) | 2362 | ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode) |
| 2363 | ("BROWSE\\'" . ebrowse-tree-mode) | 2363 | ("BROWSE\\'" . ebrowse-tree-mode) |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 7a2577eabbb..f714eaab233 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -469,7 +469,7 @@ optimized.") | |||
| 469 | "Alist of additional `font-lock-keywords' elements for major modes. | 469 | "Alist of additional `font-lock-keywords' elements for major modes. |
| 470 | 470 | ||
| 471 | Each element has the form (MODE KEYWORDS . HOW). | 471 | Each element has the form (MODE KEYWORDS . HOW). |
| 472 | `font-lock-set-defaults' adds the elements in the list KEYWORDS to | 472 | Function `font-lock-set-defaults' adds the elements in the list KEYWORDS to |
| 473 | `font-lock-keywords' when Font Lock is turned on in major mode MODE. | 473 | `font-lock-keywords' when Font Lock is turned on in major mode MODE. |
| 474 | 474 | ||
| 475 | If HOW is nil, KEYWORDS are added at the beginning of | 475 | If HOW is nil, KEYWORDS are added at the beginning of |
| @@ -484,7 +484,7 @@ This is normally set via `font-lock-add-keywords' and | |||
| 484 | (defvar font-lock-removed-keywords-alist nil | 484 | (defvar font-lock-removed-keywords-alist nil |
| 485 | "Alist of `font-lock-keywords' elements to be removed for major modes. | 485 | "Alist of `font-lock-keywords' elements to be removed for major modes. |
| 486 | 486 | ||
| 487 | Each element has the form (MODE . KEYWORDS). `font-lock-set-defaults' | 487 | Each element has the form (MODE . KEYWORDS). Function `font-lock-set-defaults' |
| 488 | removes the elements in the list KEYWORDS from `font-lock-keywords' | 488 | removes the elements in the list KEYWORDS from `font-lock-keywords' |
| 489 | when Font Lock is turned on in major mode MODE. | 489 | when Font Lock is turned on in major mode MODE. |
| 490 | 490 | ||
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c1140c526f6..1f1b46c8532 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,62 @@ | |||
| 1 | 2013-01-16 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * smiley.el (smiley-style): Make the file loadable in batch mode. | ||
| 4 | |||
| 5 | 2013-01-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 6 | |||
| 7 | * nnimap.el (nnimap-keepalive): Don't throw an error if there's no more | ||
| 8 | imap process running. | ||
| 9 | |||
| 10 | 2013-01-14 Julien Danjou <julien@danjou.info> | ||
| 11 | |||
| 12 | * gnus-sum.el (gnus-summary-from-or-to-or-newsgroups): | ||
| 13 | Compare addresses against addresses, not against the full From field. | ||
| 14 | |||
| 15 | 2013-01-13 Richard Stallman <rms@gnu.org> | ||
| 16 | |||
| 17 | * message.el (message-forward-make-body-mime): New args BEG, END | ||
| 18 | specify what part of FORWARD-BUFFER to use. Do the work directly | ||
| 19 | instead of calling `mml-insert-buffer'. | ||
| 20 | |||
| 21 | 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com> | ||
| 22 | |||
| 23 | * gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string | ||
| 24 | cross-reference(s). | ||
| 25 | |||
| 26 | * gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string | ||
| 27 | cross-reference(s). | ||
| 28 | |||
| 29 | 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 30 | |||
| 31 | * gnus-art.el (gnus-mime-display-security): Use point-min-marker | ||
| 32 | and point-max-marker. | ||
| 33 | * gnus-async.el (gnus-async-article-callback): Use point-max-marker. | ||
| 34 | |||
| 35 | 2013-01-10 Uwe Brauer <oub@mat.ucm.es> (tiny change) | ||
| 36 | |||
| 37 | * mml-smime.el (mml-smime-encrypt-to-self): New user option analogous | ||
| 38 | to mml2015-encrypt-to-self. | ||
| 39 | (mml-smime-epg-encrypt): Respect mml-smime-encrypt-to-self. | ||
| 40 | |||
| 41 | 2013-01-09 Daiki Ueno <ueno@gnu.org> | ||
| 42 | |||
| 43 | * mml-smime.el (epg-sub-key-fingerprint): Autoload for | ||
| 44 | mml-smime-epg-find-usable-secret-key. | ||
| 45 | |||
| 46 | 2013-01-08 Glenn Morris <rgm@gnu.org> | ||
| 47 | |||
| 48 | * mml-smime.el (mml-smime-sign-with-sender): Add :version. | ||
| 49 | |||
| 50 | 2013-01-07 Daiki Ueno <ueno@gnu.org> | ||
| 51 | |||
| 52 | * mml-smime.el: Support signing by sender. | ||
| 53 | Requested by Uwe Brauer. | ||
| 54 | (mml-smime-sign-with-sender): New user option analogous | ||
| 55 | to mml2015-sign-with-sender. | ||
| 56 | (mml-smime-epg-sign): Respect mml-smime-sign-with-sender. | ||
| 57 | (mml-smime-epg-find-usable-secret-key): New helper function copied from | ||
| 58 | mml2015.el. | ||
| 59 | |||
| 1 | 2012-12-31 Lars Magne Ingebrigtsen <larsi@gnus.org> | 60 | 2012-12-31 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 61 | ||
| 3 | * gnus-msg.el (gnus-inews-insert-gcc): Don't insert Gcc headers if Gnus | 62 | * gnus-msg.el (gnus-inews-insert-gcc): Don't insert Gcc headers if Gnus |
| @@ -128,8 +187,8 @@ | |||
| 128 | the `face' property with a list whose car is the face specified in the | 187 | the `face' property with a list whose car is the face specified in the |
| 129 | format string and whose cdr is (nil). | 188 | format string and whose cdr is (nil). |
| 130 | * lisp/gnus-util.el | 189 | * lisp/gnus-util.el |
| 131 | (gnus-put-text-property-excluding-characters-with-faces): Change | 190 | (gnus-put-text-property-excluding-characters-with-faces): |
| 132 | accordingly. | 191 | Change accordingly. |
| 133 | (gnus-get-text-property-excluding-characters-with-faces): New function. | 192 | (gnus-get-text-property-excluding-characters-with-faces): New function. |
| 134 | * lisp/gnus-sum.el (gnus-summary-highlight-line): | 193 | * lisp/gnus-sum.el (gnus-summary-highlight-line): |
| 135 | * lisp/gnus-salt.el (gnus-tree-highlight-node): | 194 | * lisp/gnus-salt.el (gnus-tree-highlight-node): |
| @@ -177,8 +236,8 @@ | |||
| 177 | 236 | ||
| 178 | 2012-12-22 Philipp Haselwarter <philipp@haselwarter.org> | 237 | 2012-12-22 Philipp Haselwarter <philipp@haselwarter.org> |
| 179 | 238 | ||
| 180 | * gnus-sync.el (gnus-sync-file-encrypt-to, gnus-sync-save): Set | 239 | * gnus-sync.el (gnus-sync-file-encrypt-to, gnus-sync-save): |
| 181 | epa-file-encrypt-to from variable to avoid querying. | 240 | Set epa-file-encrypt-to from variable to avoid querying. |
| 182 | 241 | ||
| 183 | 2012-12-14 Akinori MUSHA <knu@iDaemons.org> (tiny change) | 242 | 2012-12-14 Akinori MUSHA <knu@iDaemons.org> (tiny change) |
| 184 | 243 | ||
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 1b4cddc5009..25a555f3d8b 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -8688,9 +8688,7 @@ For example: | |||
| 8688 | gnus-mime-security-button-end-line-format)) | 8688 | gnus-mime-security-button-end-line-format)) |
| 8689 | (gnus-insert-mime-security-button handle))) | 8689 | (gnus-insert-mime-security-button handle))) |
| 8690 | (mm-set-handle-multipart-parameter | 8690 | (mm-set-handle-multipart-parameter |
| 8691 | handle 'gnus-region | 8691 | handle 'gnus-region (cons (point-min-marker) (point-max-marker))) |
| 8692 | (cons (set-marker (make-marker) (point-min)) | ||
| 8693 | (set-marker (make-marker) (point-max)))) | ||
| 8694 | (goto-char (point-max)))) | 8692 | (goto-char (point-max)))) |
| 8695 | 8693 | ||
| 8696 | (defun gnus-mime-security-run-function (function) | 8694 | (defun gnus-mime-security-run-function (function) |
diff --git a/lisp/gnus/gnus-async.el b/lisp/gnus/gnus-async.el index 41b0cc25006..c5d64332547 100644 --- a/lisp/gnus/gnus-async.el +++ b/lisp/gnus/gnus-async.el | |||
| @@ -254,7 +254,7 @@ that was fetched." | |||
| 254 | gnus-async-article-alist | 254 | gnus-async-article-alist |
| 255 | (cons (list (intern (format "%s-%d" group article) | 255 | (cons (list (intern (format "%s-%d" group article) |
| 256 | gnus-async-hashtb) | 256 | gnus-async-hashtb) |
| 257 | mark (set-marker (make-marker) (point-max)) | 257 | mark (point-max-marker) |
| 258 | group article) | 258 | group article) |
| 259 | gnus-async-article-alist)))) | 259 | gnus-async-article-alist)))) |
| 260 | (if (not (gnus-buffer-live-p summary)) | 260 | (if (not (gnus-buffer-live-p summary)) |
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 42cc284a0ad..aa8b6bf2703 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el | |||
| @@ -110,7 +110,7 @@ ask the servers (primary, secondary, and archive servers) to list new | |||
| 110 | groups since the last time it checked: | 110 | groups since the last time it checked: |
| 111 | 1. This variable is `ask-server'. | 111 | 1. This variable is `ask-server'. |
| 112 | 2. This variable is a list of select methods (see below). | 112 | 2. This variable is a list of select methods (see below). |
| 113 | 3. `gnus-read-active-file' is nil or `some'. | 113 | 3. Option `gnus-read-active-file' is nil or `some'. |
| 114 | 4. A prefix argument is given to `gnus-find-new-newsgroups' interactively. | 114 | 4. A prefix argument is given to `gnus-find-new-newsgroups' interactively. |
| 115 | 115 | ||
| 116 | Thus, if this variable is `ask-server' or a list of select methods or | 116 | Thus, if this variable is `ask-server' or a list of select methods or |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 49b7e5930f6..ea68a6a2fa5 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -1167,7 +1167,7 @@ using `gnus-ignored-from-addresses'." | |||
| 1167 | 1167 | ||
| 1168 | (defcustom gnus-summary-newsgroup-prefix "=> " | 1168 | (defcustom gnus-summary-newsgroup-prefix "=> " |
| 1169 | "*String prefixed to the Newsgroup field in the summary | 1169 | "*String prefixed to the Newsgroup field in the summary |
| 1170 | line when using `gnus-ignored-from-addresses'." | 1170 | line when using the option `gnus-ignored-from-addresses'." |
| 1171 | :version "22.1" | 1171 | :version "22.1" |
| 1172 | :group 'gnus-summary | 1172 | :group 'gnus-summary |
| 1173 | :type 'string) | 1173 | :type 'string) |
| @@ -3651,17 +3651,18 @@ buffer that was in action when the last article was fetched." | |||
| 3651 | (or (car (funcall gnus-extract-address-components from)) | 3651 | (or (car (funcall gnus-extract-address-components from)) |
| 3652 | from)) | 3652 | from)) |
| 3653 | 3653 | ||
| 3654 | (defun gnus-summary-from-or-to-or-newsgroups (header gnus-tmp-from) | 3654 | (defun gnus-summary-from-or-to-or-newsgroups (header from) |
| 3655 | (let ((mail-parse-charset gnus-newsgroup-charset) | 3655 | (let ((mail-parse-charset gnus-newsgroup-charset) |
| 3656 | (ignored-from-addresses (gnus-ignored-from-addresses)) | 3656 | (ignored-from-addresses (gnus-ignored-from-addresses)) |
| 3657 | ; Is it really necessary to do this next part for each summary line? | 3657 | ;; Is it really necessary to do this next part for each summary line? |
| 3658 | ; Luckily, doesn't seem to slow things down much. | 3658 | ;; Luckily, doesn't seem to slow things down much. |
| 3659 | (mail-parse-ignored-charsets | 3659 | (mail-parse-ignored-charsets |
| 3660 | (with-current-buffer gnus-summary-buffer | 3660 | (with-current-buffer gnus-summary-buffer |
| 3661 | gnus-newsgroup-ignored-charsets))) | 3661 | gnus-newsgroup-ignored-charsets)) |
| 3662 | (address (cadr (gnus-extract-address-components from)))) | ||
| 3662 | (or | 3663 | (or |
| 3663 | (and ignored-from-addresses | 3664 | (and ignored-from-addresses |
| 3664 | (string-match ignored-from-addresses gnus-tmp-from) | 3665 | (string-match ignored-from-addresses address) |
| 3665 | (let ((extra-headers (mail-header-extra header)) | 3666 | (let ((extra-headers (mail-header-extra header)) |
| 3666 | to | 3667 | to |
| 3667 | newsgroups) | 3668 | newsgroups) |
| @@ -3680,9 +3681,7 @@ buffer that was in action when the last article was fetched." | |||
| 3680 | gnus-newsgroup-name)) 'nntp) | 3681 | gnus-newsgroup-name)) 'nntp) |
| 3681 | (gnus-group-real-name gnus-newsgroup-name)))) | 3682 | (gnus-group-real-name gnus-newsgroup-name)))) |
| 3682 | (concat gnus-summary-newsgroup-prefix newsgroups))))) | 3683 | (concat gnus-summary-newsgroup-prefix newsgroups))))) |
| 3683 | (gnus-string-mark-left-to-right | 3684 | (gnus-string-mark-left-to-right (gnus-summary-extract-address-component from))))) |
| 3684 | (inline | ||
| 3685 | (gnus-summary-extract-address-component gnus-tmp-from)))))) | ||
| 3686 | 3685 | ||
| 3687 | (defun gnus-summary-insert-line (gnus-tmp-header | 3686 | (defun gnus-summary-insert-line (gnus-tmp-header |
| 3688 | gnus-tmp-level gnus-tmp-current | 3687 | gnus-tmp-level gnus-tmp-current |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 8832899c55d..808e1edd6c3 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -7376,12 +7376,13 @@ Optional DIGEST will use digest to forward." | |||
| 7376 | (dolist (elem ignored) | 7376 | (dolist (elem ignored) |
| 7377 | (message-remove-header elem t)))))) | 7377 | (message-remove-header elem t)))))) |
| 7378 | 7378 | ||
| 7379 | (defun message-forward-make-body-mime (forward-buffer) | 7379 | (defun message-forward-make-body-mime (forward-buffer &optional beg end) |
| 7380 | (let ((b (point))) | 7380 | (let ((b (point))) |
| 7381 | (insert "\n\n<#part type=message/rfc822 disposition=inline raw=t>\n") | 7381 | (insert "\n\n<#part type=message/rfc822 disposition=inline raw=t>\n") |
| 7382 | (save-restriction | 7382 | (save-restriction |
| 7383 | (narrow-to-region (point) (point)) | 7383 | (narrow-to-region (point) (point)) |
| 7384 | (mml-insert-buffer forward-buffer) | 7384 | (insert-buffer-substring forward-buffer beg end) |
| 7385 | (mml-quote-region (point-min) (point-max)) | ||
| 7385 | (goto-char (point-min)) | 7386 | (goto-char (point-min)) |
| 7386 | (when (looking-at "From ") | 7387 | (when (looking-at "From ") |
| 7387 | (replace-match "X-From-Line: ")) | 7388 | (replace-match "X-From-Line: ")) |
diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index 3e769d396b0..6ea55377e02 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el | |||
| @@ -74,6 +74,18 @@ Whether the passphrase is cached at all is controlled by | |||
| 74 | :group 'mime-security | 74 | :group 'mime-security |
| 75 | :type '(repeat (string :tag "Key ID"))) | 75 | :type '(repeat (string :tag "Key ID"))) |
| 76 | 76 | ||
| 77 | (defcustom mml-smime-sign-with-sender nil | ||
| 78 | "If t, use message sender so find a key to sign with." | ||
| 79 | :group 'mime-security | ||
| 80 | :version "24.4" | ||
| 81 | :type 'boolean) | ||
| 82 | |||
| 83 | (defcustom mml-smime-encrypt-to-self nil | ||
| 84 | "If t, add your own key ID to recipient list when encryption." | ||
| 85 | :group 'mime-security | ||
| 86 | :version "24.4" | ||
| 87 | :type 'boolean) | ||
| 88 | |||
| 77 | (defun mml-smime-sign (cont) | 89 | (defun mml-smime-sign (cont) |
| 78 | (let ((func (nth 1 (assq mml-smime-use mml-smime-function-alist)))) | 90 | (let ((func (nth 1 (assq mml-smime-use mml-smime-function-alist)))) |
| 79 | (if func | 91 | (if func |
| @@ -323,6 +335,7 @@ Whether the passphrase is cached at all is controlled by | |||
| 323 | (autoload 'epg-encrypt-string "epg") | 335 | (autoload 'epg-encrypt-string "epg") |
| 324 | (autoload 'epg-passphrase-callback-function "epg") | 336 | (autoload 'epg-passphrase-callback-function "epg") |
| 325 | (autoload 'epg-context-set-passphrase-callback "epg") | 337 | (autoload 'epg-context-set-passphrase-callback "epg") |
| 338 | (autoload 'epg-sub-key-fingerprint "epg") | ||
| 326 | (autoload 'epg-configuration "epg-config") | 339 | (autoload 'epg-configuration "epg-config") |
| 327 | (autoload 'epg-expand-group "epg-config") | 340 | (autoload 'epg-expand-group "epg-config") |
| 328 | (autoload 'epa-select-keys "epa")) | 341 | (autoload 'epa-select-keys "epa")) |
| @@ -366,6 +379,24 @@ Whether the passphrase is cached at all is controlled by | |||
| 366 | (setq pointer (cdr pointer)))) | 379 | (setq pointer (cdr pointer)))) |
| 367 | (setq keys (cdr keys))))) | 380 | (setq keys (cdr keys))))) |
| 368 | 381 | ||
| 382 | ;; XXX: since gpg --list-secret-keys does not return validity of each | ||
| 383 | ;; key, `mml-smime-epg-find-usable-key' defined above is not enough for | ||
| 384 | ;; secret keys. The function `mml-smime-epg-find-usable-secret-key' | ||
| 385 | ;; below looks at appropriate public keys to check usability. | ||
| 386 | (defun mml-smime-epg-find-usable-secret-key (context name usage) | ||
| 387 | (let ((secret-keys (epg-list-keys context name t)) | ||
| 388 | secret-key) | ||
| 389 | (while (and (not secret-key) secret-keys) | ||
| 390 | (if (mml-smime-epg-find-usable-key | ||
| 391 | (epg-list-keys context (epg-sub-key-fingerprint | ||
| 392 | (car (epg-key-sub-key-list | ||
| 393 | (car secret-keys))))) | ||
| 394 | usage) | ||
| 395 | (setq secret-key (car secret-keys) | ||
| 396 | secret-keys nil) | ||
| 397 | (setq secret-keys (cdr secret-keys)))) | ||
| 398 | secret-key)) | ||
| 399 | |||
| 369 | (autoload 'mml-compute-boundary "mml") | 400 | (autoload 'mml-compute-boundary "mml") |
| 370 | 401 | ||
| 371 | ;; We require mm-decode, which requires mm-bodies, which autoloads | 402 | ;; We require mm-decode, which requires mm-bodies, which autoloads |
| @@ -376,29 +407,36 @@ Whether the passphrase is cached at all is controlled by | |||
| 376 | (let* ((inhibit-redisplay t) | 407 | (let* ((inhibit-redisplay t) |
| 377 | (context (epg-make-context 'CMS)) | 408 | (context (epg-make-context 'CMS)) |
| 378 | (boundary (mml-compute-boundary cont)) | 409 | (boundary (mml-compute-boundary cont)) |
| 410 | (sender (message-options-get 'message-sender)) | ||
| 411 | (signer-names (or mml-smime-signers | ||
| 412 | (if (and mml-smime-sign-with-sender sender) | ||
| 413 | (list (concat "<" sender ">"))))) | ||
| 379 | signer-key | 414 | signer-key |
| 380 | (signers | 415 | (signers |
| 381 | (or (message-options-get 'mml-smime-epg-signers) | 416 | (or (message-options-get 'mml-smime-epg-signers) |
| 382 | (message-options-set | 417 | (message-options-set |
| 383 | 'mml-smime-epg-signers | 418 | 'mml-smime-epg-signers |
| 384 | (if (eq mm-sign-option 'guided) | 419 | (if (eq mm-sign-option 'guided) |
| 385 | (epa-select-keys context "\ | 420 | (epa-select-keys context "\ |
| 386 | Select keys for signing. | 421 | Select keys for signing. |
| 387 | If no one is selected, default secret key is used. " | 422 | If no one is selected, default secret key is used. " |
| 388 | mml-smime-signers t) | 423 | signer-names |
| 389 | (if mml-smime-signers | 424 | t) |
| 390 | (mapcar | 425 | (if (or sender mml-smime-signers) |
| 391 | (lambda (signer) | 426 | (delq nil |
| 392 | (setq signer-key (mml-smime-epg-find-usable-key | 427 | (mapcar |
| 393 | (epg-list-keys context signer t) | 428 | (lambda (signer) |
| 394 | 'sign)) | 429 | (setq signer-key |
| 395 | (unless (or signer-key | 430 | (mml-smime-epg-find-usable-secret-key |
| 396 | (y-or-n-p | 431 | context signer 'sign)) |
| 397 | (format "No secret key for %s; skip it? " | 432 | (unless (or signer-key |
| 433 | (y-or-n-p | ||
| 434 | (format | ||
| 435 | "No secret key for %s; skip it? " | ||
| 398 | signer))) | 436 | signer))) |
| 399 | (error "No secret key for %s" signer)) | 437 | (error "No secret key for %s" signer)) |
| 400 | signer-key) | 438 | signer-key) |
| 401 | mml-smime-signers)))))) | 439 | signer-names))))))) |
| 402 | signature micalg) | 440 | signature micalg) |
| 403 | (epg-context-set-signers context signers) | 441 | (epg-context-set-signers context signers) |
| 404 | (if mml-smime-cache-passphrase | 442 | (if mml-smime-cache-passphrase |
| @@ -443,13 +481,17 @@ Content-Disposition: attachment; filename=smime.p7s | |||
| 443 | (goto-char (point-max)))) | 481 | (goto-char (point-max)))) |
| 444 | 482 | ||
| 445 | (defun mml-smime-epg-encrypt (cont) | 483 | (defun mml-smime-epg-encrypt (cont) |
| 446 | (let ((inhibit-redisplay t) | 484 | (let* ((inhibit-redisplay t) |
| 447 | (context (epg-make-context 'CMS)) | 485 | (context (epg-make-context 'CMS)) |
| 448 | (config (epg-configuration)) | 486 | (config (epg-configuration)) |
| 449 | (recipients (message-options-get 'mml-smime-epg-recipients)) | 487 | (recipients (message-options-get 'mml-smime-epg-recipients)) |
| 450 | cipher signers | 488 | cipher signers |
| 451 | (boundary (mml-compute-boundary cont)) | 489 | (sender (message-options-get 'message-sender)) |
| 452 | recipient-key) | 490 | (signer-names (or mml-smime-signers |
| 491 | (if (and mml-smime-sign-with-sender sender) | ||
| 492 | (list (concat "<" sender ">"))))) | ||
| 493 | (boundary (mml-compute-boundary cont)) | ||
| 494 | recipient-key) | ||
| 453 | (unless recipients | 495 | (unless recipients |
| 454 | (setq recipients | 496 | (setq recipients |
| 455 | (apply #'nconc | 497 | (apply #'nconc |
| @@ -462,6 +504,10 @@ Content-Disposition: attachment; filename=smime.p7s | |||
| 462 | (message-options-set 'message-recipients | 504 | (message-options-set 'message-recipients |
| 463 | (read-string "Recipients: "))) | 505 | (read-string "Recipients: "))) |
| 464 | "[ \f\t\n\r\v,]+")))) | 506 | "[ \f\t\n\r\v,]+")))) |
| 507 | (when mml-smime-encrypt-to-self | ||
| 508 | (unless signer-names | ||
| 509 | (error "Neither message sender nor mml-smime-signers are set")) | ||
| 510 | (setq recipients (nconc recipients signer-names))) | ||
| 465 | (if (eq mm-encrypt-option 'guided) | 511 | (if (eq mm-encrypt-option 'guided) |
| 466 | (setq recipients | 512 | (setq recipients |
| 467 | (epa-select-keys context "\ | 513 | (epa-select-keys context "\ |
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index ea579fa3a2b..9c18bc2cff0 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -339,7 +339,8 @@ textual parts.") | |||
| 339 | (nnimap-last-command-time nnimap-object))) | 339 | (nnimap-last-command-time nnimap-object))) |
| 340 | ;; More than five minutes since the last command. | 340 | ;; More than five minutes since the last command. |
| 341 | (* 5 60))) | 341 | (* 5 60))) |
| 342 | (nnimap-send-command "NOOP"))))))) | 342 | (ignore-errors ;E.g. "buffer foo has no process". |
| 343 | (nnimap-send-command "NOOP")))))))) | ||
| 343 | 344 | ||
| 344 | (defun nnimap-open-connection (buffer) | 345 | (defun nnimap-open-connection (buffer) |
| 345 | ;; Be backwards-compatible -- the earlier value of nnimap-stream was | 346 | ;; Be backwards-compatible -- the earlier value of nnimap-stream was |
| @@ -367,7 +368,7 @@ textual parts.") | |||
| 367 | (defun nnimap-open-connection-1 (buffer) | 368 | (defun nnimap-open-connection-1 (buffer) |
| 368 | (unless nnimap-keepalive-timer | 369 | (unless nnimap-keepalive-timer |
| 369 | (setq nnimap-keepalive-timer (run-at-time (* 60 15) (* 60 15) | 370 | (setq nnimap-keepalive-timer (run-at-time (* 60 15) (* 60 15) |
| 370 | 'nnimap-keepalive))) | 371 | #'nnimap-keepalive))) |
| 371 | (with-current-buffer (nnimap-make-process-buffer buffer) | 372 | (with-current-buffer (nnimap-make-process-buffer buffer) |
| 372 | (let* ((coding-system-for-read 'binary) | 373 | (let* ((coding-system-for-read 'binary) |
| 373 | (coding-system-for-write 'binary) | 374 | (coding-system-for-write 'binary) |
diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el index 6381f5bf9d9..eb71134457c 100644 --- a/lisp/gnus/smiley.el +++ b/lisp/gnus/smiley.el | |||
| @@ -59,7 +59,10 @@ | |||
| 59 | 59 | ||
| 60 | (defcustom smiley-style | 60 | (defcustom smiley-style |
| 61 | (if (or (and (fboundp 'face-attribute) | 61 | (if (or (and (fboundp 'face-attribute) |
| 62 | (>= (face-attribute 'default :height) 160)) | 62 | ;; In batch mode, attributes can be unspecified. |
| 63 | (condition-case nil | ||
| 64 | (>= (face-attribute 'default :height) 160) | ||
| 65 | (error nil))) | ||
| 63 | (and (fboundp 'face-height) | 66 | (and (fboundp 'face-height) |
| 64 | (>= (face-height 'default) 14))) | 67 | (>= (face-height 'default) 14))) |
| 65 | 'medium | 68 | 'medium |
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 662f431d3c3..b5aca1a4445 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -322,7 +322,7 @@ Commands: | |||
| 322 | 322 | ||
| 323 | (defconst help-xref-symbol-regexp | 323 | (defconst help-xref-symbol-regexp |
| 324 | (purecopy (concat "\\(\\<\\(\\(variable\\|option\\)\\|" ; Link to var | 324 | (purecopy (concat "\\(\\<\\(\\(variable\\|option\\)\\|" ; Link to var |
| 325 | "\\(function\\|command\\)\\|" ; Link to function | 325 | "\\(function\\|command\\|call\\)\\|" ; Link to function |
| 326 | "\\(face\\)\\|" ; Link to face | 326 | "\\(face\\)\\|" ; Link to face |
| 327 | "\\(symbol\\|program\\|property\\)\\|" ; Don't link | 327 | "\\(symbol\\|program\\|property\\)\\|" ; Don't link |
| 328 | "\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)" | 328 | "\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)" |
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 90eb5dfaec5..a95dde1d999 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el | |||
| @@ -63,8 +63,9 @@ otherwise it defaults to t, used for times when the buffer is not displayed." | |||
| 63 | (when cleanup | 63 | (when cleanup |
| 64 | (setq image-mode-winprops-alist | 64 | (setq image-mode-winprops-alist |
| 65 | (delq nil (mapcar (lambda (winprop) | 65 | (delq nil (mapcar (lambda (winprop) |
| 66 | (if (window-live-p (car-safe winprop)) | 66 | (let ((w (car-safe winprop))) |
| 67 | winprop)) | 67 | (if (or (not (windowp w)) (window-live-p w)) |
| 68 | winprop))) | ||
| 68 | image-mode-winprops-alist)))) | 69 | image-mode-winprops-alist)))) |
| 69 | (let ((winprops (assq window image-mode-winprops-alist))) | 70 | (let ((winprops (assq window image-mode-winprops-alist))) |
| 70 | ;; For new windows, set defaults from the latest. | 71 | ;; For new windows, set defaults from the latest. |
diff --git a/lisp/imenu.el b/lisp/imenu.el index 0bfee770094..f64d1afe951 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -447,6 +447,8 @@ Don't move point." | |||
| 447 | Simple elements in the alist look like (INDEX-NAME . POSITION). | 447 | Simple elements in the alist look like (INDEX-NAME . POSITION). |
| 448 | POSITION is the buffer position of the item; to go to the item | 448 | POSITION is the buffer position of the item; to go to the item |
| 449 | is simply to move point to that position. | 449 | is simply to move point to that position. |
| 450 | POSITION is passed to `imenu-default-goto-function', so it can be a non-number | ||
| 451 | if that variable has been changed (e.g. Semantic uses overlays for POSITIONs). | ||
| 450 | 452 | ||
| 451 | Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...). | 453 | Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...). |
| 452 | To \"go to\" a special element means applying FUNCTION | 454 | To \"go to\" a special element means applying FUNCTION |
diff --git a/lisp/info.el b/lisp/info.el index 8408e01efb5..e230ed0f82c 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -1703,7 +1703,9 @@ escaped (\\\",\\\\)." | |||
| 1703 | If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file | 1703 | If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file |
| 1704 | FILENAME; otherwise, NODENAME should be in the current Info file (or one of | 1704 | FILENAME; otherwise, NODENAME should be in the current Info file (or one of |
| 1705 | its sub-files). | 1705 | its sub-files). |
| 1706 | Completion is available, but only for node names in the current Info file. | 1706 | Completion is available for node names in the current Info file as well as |
| 1707 | in the Info file FILENAME after the closing parenthesis in (FILENAME). | ||
| 1708 | Empty NODENAME in (FILENAME) defaults to the Top node. | ||
| 1707 | If FORK is non-nil (interactively with a prefix arg), show the node in | 1709 | If FORK is non-nil (interactively with a prefix arg), show the node in |
| 1708 | a new Info buffer. | 1710 | a new Info buffer. |
| 1709 | If FORK is a string, it is the name to use for the new buffer." | 1711 | If FORK is a string, it is the name to use for the new buffer." |
| @@ -1740,6 +1742,7 @@ list of valid filename suffixes for Info files. See | |||
| 1740 | (when (file-name-absolute-p string) | 1742 | (when (file-name-absolute-p string) |
| 1741 | (setq dirs (list (file-name-directory string)))) | 1743 | (setq dirs (list (file-name-directory string)))) |
| 1742 | (let ((names nil) | 1744 | (let ((names nil) |
| 1745 | (names-sans-suffix nil) | ||
| 1743 | (suffix (concat (regexp-opt suffixes t) "\\'")) | 1746 | (suffix (concat (regexp-opt suffixes t) "\\'")) |
| 1744 | (string-dir (file-name-directory string))) | 1747 | (string-dir (file-name-directory string))) |
| 1745 | (dolist (dir dirs) | 1748 | (dolist (dir dirs) |
| @@ -1762,7 +1765,14 @@ list of valid filename suffixes for Info files. See | |||
| 1762 | ;; add the unsuffixed name as a completion option. | 1765 | ;; add the unsuffixed name as a completion option. |
| 1763 | (when (string-match suffix file) | 1766 | (when (string-match suffix file) |
| 1764 | (setq file (substring file 0 (match-beginning 0))) | 1767 | (setq file (substring file 0 (match-beginning 0))) |
| 1765 | (push (if string-dir (concat string-dir file) file) names))))) | 1768 | (push (if string-dir (concat string-dir file) file) |
| 1769 | names-sans-suffix))))) | ||
| 1770 | ;; If there is just one file, don't duplicate it with suffixes, | ||
| 1771 | ;; so `Info-read-node-name-1' will be able to complete a single | ||
| 1772 | ;; candidate and to add the terminating ")". | ||
| 1773 | (if (and (= (length names) 1) (= (length names-sans-suffix) 1)) | ||
| 1774 | (setq names names-sans-suffix) | ||
| 1775 | (setq names (append names-sans-suffix names))) | ||
| 1766 | (complete-with-action action names string pred))) | 1776 | (complete-with-action action names string pred))) |
| 1767 | 1777 | ||
| 1768 | (defun Info-read-node-name-1 (string predicate code) | 1778 | (defun Info-read-node-name-1 (string predicate code) |
| @@ -1784,16 +1794,19 @@ See `completing-read' for a description of arguments and usage." | |||
| 1784 | ((string-match "\\`(\\([^)]+\\))" string) | 1794 | ((string-match "\\`(\\([^)]+\\))" string) |
| 1785 | (let ((file0 (match-string 0 string)) | 1795 | (let ((file0 (match-string 0 string)) |
| 1786 | (file1 (match-string 1 string)) | 1796 | (file1 (match-string 1 string)) |
| 1787 | (node (substring string (match-end 0)))) | 1797 | (nodename (substring string (match-end 0)))) |
| 1788 | (completion-table-with-context | 1798 | (if (and (equal nodename "") (eq code 'lambda)) |
| 1789 | file0 | 1799 | ;; Empty node name is permitted that means "Top". |
| 1790 | (apply-partially | 1800 | t |
| 1791 | (lambda (string pred action) | 1801 | (completion-table-with-context |
| 1792 | (complete-with-action | 1802 | file0 |
| 1793 | action | 1803 | (apply-partially |
| 1794 | (Info-build-node-completions (Info-find-file file1)) | 1804 | (lambda (string pred action) |
| 1795 | string pred))) | 1805 | (complete-with-action |
| 1796 | node predicate code))) | 1806 | action |
| 1807 | (Info-build-node-completions (Info-find-file file1)) | ||
| 1808 | string pred))) | ||
| 1809 | nodename predicate code)))) | ||
| 1797 | ;; Otherwise use Info-read-node-completion-table. | 1810 | ;; Otherwise use Info-read-node-completion-table. |
| 1798 | (t (complete-with-action | 1811 | (t (complete-with-action |
| 1799 | code Info-read-node-completion-table string predicate)))) | 1812 | code Info-read-node-completion-table string predicate)))) |
| @@ -1802,7 +1815,9 @@ See `completing-read' for a description of arguments and usage." | |||
| 1802 | (defun Info-read-node-name (prompt) | 1815 | (defun Info-read-node-name (prompt) |
| 1803 | "Read an Info node name with completion, prompting with PROMPT. | 1816 | "Read an Info node name with completion, prompting with PROMPT. |
| 1804 | A node name can have the form \"NODENAME\", referring to a node | 1817 | A node name can have the form \"NODENAME\", referring to a node |
| 1805 | in the current Info file, or \"(FILENAME)NODENAME\"." | 1818 | in the current Info file, or \"(FILENAME)NODENAME\", referring to |
| 1819 | a node in FILENAME. \"(FILENAME)\" is a short format to go to | ||
| 1820 | the Top node in FILENAME." | ||
| 1806 | (let* ((completion-ignore-case t) | 1821 | (let* ((completion-ignore-case t) |
| 1807 | (Info-read-node-completion-table (Info-build-node-completions)) | 1822 | (Info-read-node-completion-table (Info-build-node-completions)) |
| 1808 | (nodename (completing-read prompt 'Info-read-node-name-1 nil t))) | 1823 | (nodename (completing-read prompt 'Info-read-node-name-1 nil t))) |
| @@ -1810,14 +1825,14 @@ in the current Info file, or \"(FILENAME)NODENAME\"." | |||
| 1810 | (Info-read-node-name prompt) | 1825 | (Info-read-node-name prompt) |
| 1811 | nodename))) | 1826 | nodename))) |
| 1812 | 1827 | ||
| 1813 | (defun Info-build-node-completions (&optional file) | 1828 | (defun Info-build-node-completions (&optional filename) |
| 1814 | (if file | 1829 | (if filename |
| 1815 | (or (cdr (assoc file Info-file-completions)) | 1830 | (or (cdr (assoc filename Info-file-completions)) |
| 1816 | (with-temp-buffer | 1831 | (with-temp-buffer |
| 1817 | (Info-mode) | 1832 | (Info-mode) |
| 1818 | (Info-goto-node (format "(%s)Top" file)) | 1833 | (Info-goto-node (format "(%s)Top" filename)) |
| 1819 | (Info-build-node-completions-1) | 1834 | (Info-build-node-completions-1) |
| 1820 | (push (cons file Info-current-file-completions) Info-file-completions) | 1835 | (push (cons filename Info-current-file-completions) Info-file-completions) |
| 1821 | Info-current-file-completions)) | 1836 | Info-current-file-completions)) |
| 1822 | (or Info-current-file-completions | 1837 | (or Info-current-file-completions |
| 1823 | (Info-build-node-completions-1)))) | 1838 | (Info-build-node-completions-1)))) |
| @@ -4298,7 +4313,7 @@ If the element is just a file name, the file name also serves as the prefix.") | |||
| 4298 | The `info-file' property of COMMAND says which Info manual to search. | 4313 | The `info-file' property of COMMAND says which Info manual to search. |
| 4299 | If COMMAND has no property, the variable `Info-file-list-for-emacs' | 4314 | If COMMAND has no property, the variable `Info-file-list-for-emacs' |
| 4300 | defines heuristics for which Info manual to try. | 4315 | defines heuristics for which Info manual to try. |
| 4301 | The locations are of the format used in `Info-history', i.e. | 4316 | The locations are of the format used in the variable `Info-history', i.e. |
| 4302 | \(FILENAME NODENAME BUFFERPOS), where BUFFERPOS is the line number | 4317 | \(FILENAME NODENAME BUFFERPOS), where BUFFERPOS is the line number |
| 4303 | in the first element of the returned list (which is treated specially in | 4318 | in the first element of the returned list (which is treated specially in |
| 4304 | `Info-goto-emacs-command-node'), and 0 for the rest elements of a list." | 4319 | `Info-goto-emacs-command-node'), and 0 for the rest elements of a list." |
| @@ -5167,13 +5182,16 @@ Otherwise, visit the manual in a new Info buffer." | |||
| 5167 | (with-current-buffer buffer | 5182 | (with-current-buffer buffer |
| 5168 | (and (eq major-mode 'Info-mode) | 5183 | (and (eq major-mode 'Info-mode) |
| 5169 | (stringp Info-current-file) | 5184 | (stringp Info-current-file) |
| 5185 | (not (string= (substring (buffer-name) 0 1) " ")) | ||
| 5170 | (push (file-name-sans-extension | 5186 | (push (file-name-sans-extension |
| 5171 | (file-name-nondirectory Info-current-file)) | 5187 | (file-name-nondirectory Info-current-file)) |
| 5172 | names)))) | 5188 | names)))) |
| 5173 | (delete-dups (append (nreverse names) | 5189 | (delete-dups (append (nreverse names) |
| 5174 | (apply-partially 'Info-read-node-name-2 | 5190 | (all-completions |
| 5175 | Info-directory-list | 5191 | "" |
| 5176 | (mapcar 'car Info-suffix-list)))))) | 5192 | (apply-partially 'Info-read-node-name-2 |
| 5193 | Info-directory-list | ||
| 5194 | (mapcar 'car Info-suffix-list))))))) | ||
| 5177 | 5195 | ||
| 5178 | (provide 'info) | 5196 | (provide 'info) |
| 5179 | 5197 | ||
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 03b88038dd7..35c303f0ea8 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -2946,14 +2946,14 @@ This function also accepts a hexadecimal number of Unicode code | |||
| 2946 | point or a number in hash notation, e.g. #o21430 for octal, | 2946 | point or a number in hash notation, e.g. #o21430 for octal, |
| 2947 | #x2318 for hex, or #10r8984 for decimal." | 2947 | #x2318 for hex, or #10r8984 for decimal." |
| 2948 | (let* ((enable-recursive-minibuffers t) | 2948 | (let* ((enable-recursive-minibuffers t) |
| 2949 | (completion-ignore-case t) | ||
| 2949 | (input | 2950 | (input |
| 2950 | (completing-read | 2951 | (completing-read |
| 2951 | prompt | 2952 | prompt |
| 2952 | (lambda (string pred action) | 2953 | (lambda (string pred action) |
| 2953 | (let ((completion-ignore-case t)) | 2954 | (if (eq action 'metadata) |
| 2954 | (if (eq action 'metadata) | 2955 | '(metadata (category . unicode-name)) |
| 2955 | '(metadata (category . unicode-name)) | 2956 | (complete-with-action action (ucs-names) string pred))))) |
| 2956 | (complete-with-action action (ucs-names) string pred)))))) | ||
| 2957 | (char | 2957 | (char |
| 2958 | (cond | 2958 | (cond |
| 2959 | ((string-match-p "\\`[0-9a-fA-F]+\\'" input) | 2959 | ((string-match-p "\\`[0-9a-fA-F]+\\'" input) |
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 6fa589a9622..995df2fb9a7 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -891,7 +891,7 @@ or one is an alias of the other." | |||
| 891 | (and (vectorp eol-type-1) (vectorp eol-type-2))))))) | 891 | (and (vectorp eol-type-1) (vectorp eol-type-2))))))) |
| 892 | 892 | ||
| 893 | (defun add-to-coding-system-list (coding-system) | 893 | (defun add-to-coding-system-list (coding-system) |
| 894 | "Add CODING-SYSTEM to `coding-system-list' while keeping it sorted." | 894 | "Add CODING-SYSTEM to variable `coding-system-list' while keeping it sorted." |
| 895 | (if (or (null coding-system-list) | 895 | (if (or (null coding-system-list) |
| 896 | (coding-system-lessp coding-system (car coding-system-list))) | 896 | (coding-system-lessp coding-system (car coding-system-list))) |
| 897 | (setq coding-system-list (cons coding-system coding-system-list)) | 897 | (setq coding-system-list (cons coding-system coding-system-list)) |
diff --git a/lisp/isearch.el b/lisp/isearch.el index b13881b208b..e16e3840d0d 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -176,7 +176,7 @@ is non-nil if the user quits the search.") | |||
| 176 | 176 | ||
| 177 | (defvar isearch-message-function nil | 177 | (defvar isearch-message-function nil |
| 178 | "Function to call to display the search prompt. | 178 | "Function to call to display the search prompt. |
| 179 | If nil, use `isearch-message'.") | 179 | If nil, use function `isearch-message'.") |
| 180 | 180 | ||
| 181 | (defvar isearch-wrap-function nil | 181 | (defvar isearch-wrap-function nil |
| 182 | "Function to call to wrap the search when search is failed. | 182 | "Function to call to wrap the search when search is failed. |
| @@ -1101,7 +1101,7 @@ nonincremental search instead via `isearch-edit-string'." | |||
| 1101 | 1101 | ||
| 1102 | (defun isearch-fail-pos (&optional msg) | 1102 | (defun isearch-fail-pos (&optional msg) |
| 1103 | "Return position of first mismatch in search string, or nil if none. | 1103 | "Return position of first mismatch in search string, or nil if none. |
| 1104 | If MSG is non-nil, use `isearch-message', otherwise `isearch-string'." | 1104 | If MSG is non-nil, use variable `isearch-message', otherwise `isearch-string'." |
| 1105 | (let ((cmds isearch-cmds) | 1105 | (let ((cmds isearch-cmds) |
| 1106 | (curr-msg (if msg isearch-message isearch-string)) | 1106 | (curr-msg (if msg isearch-message isearch-string)) |
| 1107 | succ-msg) | 1107 | succ-msg) |
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index 7be5df72c84..668f1ec963a 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el | |||
| @@ -257,6 +257,47 @@ the variable `jit-lock-stealth-nice'." | |||
| 257 | (remove-hook 'after-change-functions 'jit-lock-after-change t) | 257 | (remove-hook 'after-change-functions 'jit-lock-after-change t) |
| 258 | (remove-hook 'fontification-functions 'jit-lock-function)))) | 258 | (remove-hook 'fontification-functions 'jit-lock-function)))) |
| 259 | 259 | ||
| 260 | (define-minor-mode jit-lock-debug-mode | ||
| 261 | "Minor mode to help debug code run from jit-lock. | ||
| 262 | When this minor mode is enabled, jit-lock runs as little code as possible | ||
| 263 | during redisplay and moves the rest to a timer, where things | ||
| 264 | like `debug-on-error' and Edebug can be used." | ||
| 265 | :global t | ||
| 266 | (when jit-lock-defer-timer | ||
| 267 | (cancel-timer jit-lock-defer-timer) | ||
| 268 | (setq jit-lock-defer-timer nil)) | ||
| 269 | (when jit-lock-debug-mode | ||
| 270 | (setq jit-lock-defer-timer | ||
| 271 | (run-with-idle-timer 0 t #'jit-lock--debug-fontify)))) | ||
| 272 | |||
| 273 | (defvar jit-lock--debug-fontifying nil) | ||
| 274 | |||
| 275 | (defun jit-lock--debug-fontify () | ||
| 276 | "Fontify what was deferred for debugging." | ||
| 277 | (when (and (not jit-lock--debug-fontifying) | ||
| 278 | jit-lock-defer-buffers (not memory-full)) | ||
| 279 | (let ((jit-lock--debug-fontifying t) | ||
| 280 | (inhibit-debugger nil)) ;FIXME: Not sufficient! | ||
| 281 | ;; Mark the deferred regions back to `fontified = nil' | ||
| 282 | (dolist (buffer jit-lock-defer-buffers) | ||
| 283 | (when (buffer-live-p buffer) | ||
| 284 | (with-current-buffer buffer | ||
| 285 | ;; (message "Jit-Debug %s" (buffer-name)) | ||
| 286 | (with-buffer-prepared-for-jit-lock | ||
| 287 | (let ((pos (point-min))) | ||
| 288 | (while | ||
| 289 | (progn | ||
| 290 | (when (eq (get-text-property pos 'fontified) 'defer) | ||
| 291 | (let ((beg pos) | ||
| 292 | (end (setq pos (next-single-property-change | ||
| 293 | pos 'fontified | ||
| 294 | nil (point-max))))) | ||
| 295 | (put-text-property beg end 'fontified nil) | ||
| 296 | (jit-lock-fontify-now beg end))) | ||
| 297 | (setq pos (next-single-property-change | ||
| 298 | pos 'fontified))))))))) | ||
| 299 | (setq jit-lock-defer-buffers nil)))) | ||
| 300 | |||
| 260 | (defun jit-lock-register (fun &optional contextual) | 301 | (defun jit-lock-register (fun &optional contextual) |
| 261 | "Register FUN as a fontification function to be called in this buffer. | 302 | "Register FUN as a fontification function to be called in this buffer. |
| 262 | FUN will be called with two arguments START and END indicating the region | 303 | FUN will be called with two arguments START and END indicating the region |
| @@ -504,7 +545,8 @@ non-nil in a repeated invocation of this function." | |||
| 504 | pos (setq pos (next-single-property-change | 545 | pos (setq pos (next-single-property-change |
| 505 | pos 'fontified nil (point-max))) | 546 | pos 'fontified nil (point-max))) |
| 506 | 'fontified nil)) | 547 | 'fontified nil)) |
| 507 | (setq pos (next-single-property-change pos 'fontified))))))))) | 548 | (setq pos (next-single-property-change |
| 549 | pos 'fontified))))))))) | ||
| 508 | (setq jit-lock-defer-buffers nil) | 550 | (setq jit-lock-defer-buffers nil) |
| 509 | ;; Force fontification of the visible parts. | 551 | ;; Force fontification of the visible parts. |
| 510 | (let ((jit-lock-defer-timer nil)) | 552 | (let ((jit-lock-defer-timer nil)) |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index e32d3c608d4..c6385498dcd 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -4647,7 +4647,7 @@ With prefix argument N moves forward N messages with these labels. | |||
| 4647 | 4647 | ||
| 4648 | ;;;*** | 4648 | ;;;*** |
| 4649 | 4649 | ||
| 4650 | ;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "1f33964668345a1a1f3119fece148227") | 4650 | ;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "93951f748e43e1015da1b485088970ca") |
| 4651 | ;;; Generated autoloads from rmailmm.el | 4651 | ;;; Generated autoloads from rmailmm.el |
| 4652 | 4652 | ||
| 4653 | (autoload 'rmail-mime "rmailmm" "\ | 4653 | (autoload 'rmail-mime "rmailmm" "\ |
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 566dec1ad39..350e3dacbcf 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el | |||
| @@ -1365,14 +1365,15 @@ The arguments ARG and STATE have no effect in this case." | |||
| 1365 | (defun rmail-insert-mime-forwarded-message (forward-buffer) | 1365 | (defun rmail-insert-mime-forwarded-message (forward-buffer) |
| 1366 | "Insert the message in FORWARD-BUFFER as a forwarded message. | 1366 | "Insert the message in FORWARD-BUFFER as a forwarded message. |
| 1367 | This is the usual value of `rmail-insert-mime-forwarded-message-function'." | 1367 | This is the usual value of `rmail-insert-mime-forwarded-message-function'." |
| 1368 | (let ((message-buffer | 1368 | (let (contents-buffer start end) |
| 1369 | (with-current-buffer forward-buffer | 1369 | (with-current-buffer forward-buffer |
| 1370 | (if rmail-buffer-swapped | 1370 | (setq contents-buffer |
| 1371 | rmail-view-buffer | 1371 | (if rmail-buffer-swapped |
| 1372 | forward-buffer)))) | 1372 | rmail-view-buffer |
| 1373 | (save-restriction | 1373 | forward-buffer) |
| 1374 | (narrow-to-region (point) (point)) | 1374 | start (rmail-msgbeg rmail-current-message) |
| 1375 | (message-forward-make-body-mime message-buffer)))) | 1375 | end (rmail-msgend rmail-current-message))) |
| 1376 | (message-forward-make-body-mime contents-buffer start end))) | ||
| 1376 | 1377 | ||
| 1377 | (setq rmail-insert-mime-forwarded-message-function | 1378 | (setq rmail-insert-mime-forwarded-message-function |
| 1378 | 'rmail-insert-mime-forwarded-message) | 1379 | 'rmail-insert-mime-forwarded-message) |
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index e86229a5cfb..e1dee3295f2 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el | |||
| @@ -1493,6 +1493,9 @@ just append to the file, in Babyl format if necessary." | |||
| 1493 | (insert "\nMail-Followup-To: ")))) | 1493 | (insert "\nMail-Followup-To: ")))) |
| 1494 | 1494 | ||
| 1495 | (defun mail-position-on-field (field &optional soft) | 1495 | (defun mail-position-on-field (field &optional soft) |
| 1496 | "Move to the start of the contents of header field FIELD. | ||
| 1497 | If there is none, insert one, unless SOFT is non-nil. | ||
| 1498 | If there are multiple FIELD fields, this goes to the first." | ||
| 1496 | (let (end | 1499 | (let (end |
| 1497 | (case-fold-search t)) | 1500 | (case-fold-search t)) |
| 1498 | (setq end (mail-header-end)) | 1501 | (setq end (mail-header-end)) |
diff --git a/lisp/man.el b/lisp/man.el index b6a6c179374..93a67128de4 100644 --- a/lisp/man.el +++ b/lisp/man.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; man.el --- browse UNIX manual pages -*- coding: iso-8859-1 -*- | 1 | ;;; man.el --- browse UNIX manual pages -*- coding: utf-8 -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1993-1994, 1996-1997, 2001-2013 Free Software | 3 | ;; Copyright (C) 1993-1994, 1996-1997, 2001-2013 Free Software |
| 4 | ;; Foundation, Inc. | 4 | ;; Foundation, Inc. |
| @@ -276,7 +276,7 @@ Used in `bookmark-set' to get the default bookmark name." | |||
| 276 | :type 'hook | 276 | :type 'hook |
| 277 | :group 'man) | 277 | :group 'man) |
| 278 | 278 | ||
| 279 | (defvar Man-name-regexp "[-a-zA-Z0-9_+][-a-zA-Z0-9_.:+]*" | 279 | (defvar Man-name-regexp "[-a-zA-Z0-9_Â+][-a-zA-Z0-9_.:Â+]*" |
| 280 | "Regular expression describing the name of a manpage (without section).") | 280 | "Regular expression describing the name of a manpage (without section).") |
| 281 | 281 | ||
| 282 | (defvar Man-section-regexp "[0-9][a-zA-Z0-9+]*\\|[LNln]" | 282 | (defvar Man-section-regexp "[0-9][a-zA-Z0-9+]*\\|[LNln]" |
| @@ -780,6 +780,59 @@ POS defaults to `point'." | |||
| 780 | ;; but apparently that's not the case in all cases, so let's add a cache. | 780 | ;; but apparently that's not the case in all cases, so let's add a cache. |
| 781 | "Cache of completion table of the form (PREFIX . TABLE).") | 781 | "Cache of completion table of the form (PREFIX . TABLE).") |
| 782 | 782 | ||
| 783 | (defvar Man-man-k-use-anchor | ||
| 784 | ;; man-db or man-1.* | ||
| 785 | (memq system-type '(gnu gnu/linux gnu/kfreebsd)) | ||
| 786 | "If non-nil prepend ^ to the prefix passed to \"man -k\" for completion. | ||
| 787 | The value should be nil if \"man -k ^PREFIX\" may omit some man | ||
| 788 | pages whose names start with PREFIX. | ||
| 789 | |||
| 790 | Currently, the default value depends on `system-type' and is | ||
| 791 | non-nil where the standard man programs are known to behave | ||
| 792 | properly. Setting the value to nil always gives correct results | ||
| 793 | but computing the list of completions may take a bit longer.") | ||
| 794 | |||
| 795 | (defun Man-parse-man-k () | ||
| 796 | "Parse \"man -k\" output and return the list of page names. | ||
| 797 | |||
| 798 | The current buffer should contain the output of a command of the | ||
| 799 | form \"man -k keyword\", which is traditionally also available with | ||
| 800 | apropos(1). | ||
| 801 | |||
| 802 | While POSIX man(1p) is a bit vague about what to expect here, | ||
| 803 | this function tries to parse some commonly used formats, which | ||
| 804 | can be described in the following informal way, with square brackets | ||
| 805 | indicating optional parts and whitespace being interpreted | ||
| 806 | somewhat loosely. | ||
| 807 | |||
| 808 | foo[, bar [, ...]] [other stuff] (sec) - description | ||
| 809 | foo(sec)[, bar(sec) [, ...]] [other stuff] - description | ||
| 810 | |||
| 811 | For more details and some regression tests, please see | ||
| 812 | test/automated/man-tests.el in the emacs bzr repository." | ||
| 813 | (goto-char (point-min)) | ||
| 814 | ;; See man-tests for data about which systems use which format (hopefully we | ||
| 815 | ;; will be able to simplify the code if/when some of those formats aren't | ||
| 816 | ;; used any more). | ||
| 817 | (let (table) | ||
| 818 | (while (search-forward-regexp "^\\([^ \t,\n]+\\)\\(.*?\\)\ | ||
| 819 | \\(?:[ \t]\\(([^ \t,\n]+?)\\)\\)?\\(?:[ \t]+- ?\\(.*\\)\\)?$" nil t) | ||
| 820 | (let ((section (match-string 3)) | ||
| 821 | (description (match-string 4)) | ||
| 822 | (bound (match-end 2))) | ||
| 823 | (goto-char (match-end 1)) | ||
| 824 | (while | ||
| 825 | (progn | ||
| 826 | ;; The first regexp grouping may already match the section | ||
| 827 | ;; tacked on to the name, which is ok since for the formats we | ||
| 828 | ;; claim to support the third (non-shy) grouping does not | ||
| 829 | ;; match in this case, i.e., section is nil. | ||
| 830 | (push (propertize (concat (match-string 1) section) | ||
| 831 | 'help-echo description) | ||
| 832 | table) | ||
| 833 | (search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t))))) | ||
| 834 | (nreverse table))) | ||
| 835 | |||
| 783 | (defun Man-completion-table (string pred action) | 836 | (defun Man-completion-table (string pred action) |
| 784 | (cond | 837 | (cond |
| 785 | ;; This ends up returning t for pretty much any string, and hence leads to | 838 | ;; This ends up returning t for pretty much any string, and hence leads to |
| @@ -811,16 +864,15 @@ POS defaults to `point'." | |||
| 811 | ;; run differently in Man-getpage-in-background, an error | 864 | ;; run differently in Man-getpage-in-background, an error |
| 812 | ;; here may not necessarily mean that we'll also get an | 865 | ;; here may not necessarily mean that we'll also get an |
| 813 | ;; error later. | 866 | ;; error later. |
| 814 | (ignore-errors | 867 | (ignore-errors |
| 815 | (call-process manual-program nil '(t nil) nil | 868 | (call-process manual-program nil '(t nil) nil |
| 816 | "-k" (concat "^" prefix)))) | 869 | "-k" (concat (when (or Man-man-k-use-anchor |
| 817 | (goto-char (point-min)) | 870 | (string-equal prefix "")) |
| 818 | (while (re-search-forward "^\\([^ \t\n]+\\)\\(?: ?\\((.+?)\\)\\(?:[ \t]+- \\(.*\\)\\)?\\)?" nil t) | 871 | "^") |
| 819 | (push (propertize (concat (match-string 1) (match-string 2)) | 872 | prefix)))) |
| 820 | 'help-echo (match-string 3)) | 873 | (setq table (Man-parse-man-k))) |
| 821 | table))) | 874 | ;; Cache the table for later reuse. |
| 822 | ;; Cache the table for later reuse. | 875 | (setq Man-completion-cache (cons prefix table))) |
| 823 | (setq Man-completion-cache (cons prefix table))) | ||
| 824 | ;; The table may contain false positives since the match is made | 876 | ;; The table may contain false positives since the match is made |
| 825 | ;; by "man -k" not just on the manpage's name. | 877 | ;; by "man -k" not just on the manpage's name. |
| 826 | (if section | 878 | (if section |
| @@ -891,6 +943,7 @@ names or descriptions. The pattern argument is usually an | |||
| 891 | ;; ("man -k" is case-insensitive similarly, so the | 943 | ;; ("man -k" is case-insensitive similarly, so the |
| 892 | ;; table has everything available to complete) | 944 | ;; table has everything available to complete) |
| 893 | (completion-ignore-case t) | 945 | (completion-ignore-case t) |
| 946 | Man-completion-cache ;Don't cache across calls. | ||
| 894 | (input (completing-read | 947 | (input (completing-read |
| 895 | (format "Manual entry%s" | 948 | (format "Manual entry%s" |
| 896 | (if (string= default-entry "") | 949 | (if (string= default-entry "") |
| @@ -1395,7 +1448,7 @@ The following key bindings are currently in effect in the buffer: | |||
| 1395 | ;; Update len, in case a reference spans | 1448 | ;; Update len, in case a reference spans |
| 1396 | ;; more than two lines (paranoia). | 1449 | ;; more than two lines (paranoia). |
| 1397 | len (1- (length word)))) | 1450 | len (1- (length word)))) |
| 1398 | (if (memq (aref word len) '(?- ?)) | 1451 | (if (memq (aref word len) '(?- ?Â)) |
| 1399 | (setq hyphenated (substring word 0 len))) | 1452 | (setq hyphenated (substring word 0 len))) |
| 1400 | (and (string-match Man-reference-regexp word) | 1453 | (and (string-match Man-reference-regexp word) |
| 1401 | (not (member word Man--refpages)) | 1454 | (not (member word Man--refpages)) |
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 024e2237cae..60f2bc2999f 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -1637,8 +1637,8 @@ key, a click, or a menu-item")) | |||
| 1637 | '(menu-item "Find Options by Value..." apropos-value | 1637 | '(menu-item "Find Options by Value..." apropos-value |
| 1638 | :help "Find variables whose values match a regexp")) | 1638 | :help "Find variables whose values match a regexp")) |
| 1639 | (bindings--define-key menu [find-options-by-name] | 1639 | (bindings--define-key menu [find-options-by-name] |
| 1640 | '(menu-item "Find Options by Name..." apropos-variable | 1640 | '(menu-item "Find Options by Name..." apropos-user-option |
| 1641 | :help "Find variables whose names match a regexp")) | 1641 | :help "Find user options whose names match a regexp")) |
| 1642 | (bindings--define-key menu [find-commands-by-name] | 1642 | (bindings--define-key menu [find-commands-by-name] |
| 1643 | '(menu-item "Find Commands by Name..." apropos-command | 1643 | '(menu-item "Find Commands by Name..." apropos-command |
| 1644 | :help "Find commands whose names match a regexp")) | 1644 | :help "Find commands whose names match a regexp")) |
diff --git a/lisp/misearch.el b/lisp/misearch.el index 2584f8df77b..0c4cd4ea323 100644 --- a/lisp/misearch.el +++ b/lisp/misearch.el | |||
| @@ -73,7 +73,7 @@ end of the search space). | |||
| 73 | The first argument of this function is the current buffer where the | 73 | The first argument of this function is the current buffer where the |
| 74 | search is currently searching. It defines the base buffer relative to | 74 | search is currently searching. It defines the base buffer relative to |
| 75 | which this function should find the next buffer. When the isearch | 75 | which this function should find the next buffer. When the isearch |
| 76 | direction is backward (when `isearch-forward' is nil), this function | 76 | direction is backward (when option `isearch-forward' is nil), this function |
| 77 | should return the previous buffer to search. | 77 | should return the previous buffer to search. |
| 78 | 78 | ||
| 79 | If the second argument of this function WRAP is non-nil, then it | 79 | If the second argument of this function WRAP is non-nil, then it |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index fd8fdb51796..ab13d4cf442 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -61,12 +61,17 @@ | |||
| 61 | "^[[:space:]]*\\([-[:alpha:]]+\\)" ; \1 permissions | 61 | "^[[:space:]]*\\([-[:alpha:]]+\\)" ; \1 permissions |
| 62 | "[[:space:]]*\\([^[:space:]]+\\)" ; \2 username | 62 | "[[:space:]]*\\([^[:space:]]+\\)" ; \2 username |
| 63 | "[[:space:]]+\\([^[:space:]]+\\)" ; \3 group | 63 | "[[:space:]]+\\([^[:space:]]+\\)" ; \3 group |
| 64 | "[[:space:]]+\\([[:digit:]]\\)" ; \4 size | 64 | "[[:space:]]+\\([[:digit:]]+\\)" ; \4 size |
| 65 | "[[:space:]]+\\([-[:digit:]]+[[:space:]][:[:digit:]]+\\)" ; \5 date | 65 | "[[:space:]]+\\([-[:digit:]]+[[:space:]][:[:digit:]]+\\)" ; \5 date |
| 66 | "[[:space:]]+\\(.*\\)$")) ; \6 filename | 66 | "[[:space:]]+\\(.*\\)$")) ; \6 filename |
| 67 | 67 | ||
| 68 | ;;;###tramp-autoload | 68 | ;;;###tramp-autoload |
| 69 | (add-to-list 'tramp-methods `(,tramp-adb-method)) | 69 | (add-to-list 'tramp-methods |
| 70 | `(,tramp-adb-method | ||
| 71 | (tramp-tmpdir "/data/local/tmp"))) | ||
| 72 | |||
| 73 | ;;;###tramp-autoload | ||
| 74 | (add-to-list 'tramp-default-host-alist `(,tramp-adb-method nil "")) | ||
| 70 | 75 | ||
| 71 | ;;;###tramp-autoload | 76 | ;;;###tramp-autoload |
| 72 | (eval-after-load 'tramp | 77 | (eval-after-load 'tramp |
| @@ -95,8 +100,8 @@ | |||
| 95 | (file-directory-p . tramp-adb-handle-file-directory-p) | 100 | (file-directory-p . tramp-adb-handle-file-directory-p) |
| 96 | (file-symlink-p . tramp-handle-file-symlink-p) | 101 | (file-symlink-p . tramp-handle-file-symlink-p) |
| 97 | ;; FIXME: This is too sloppy. | 102 | ;; FIXME: This is too sloppy. |
| 98 | (file-executable-p . file-exists-p) | 103 | (file-executable-p . tramp-handle-file-exists-p) |
| 99 | (file-exists-p . tramp-adb-handle-file-exists-p) | 104 | (file-exists-p . tramp-handle-file-exists-p) |
| 100 | (file-readable-p . tramp-handle-file-exists-p) | 105 | (file-readable-p . tramp-handle-file-exists-p) |
| 101 | (file-writable-p . tramp-adb-handle-file-writable-p) | 106 | (file-writable-p . tramp-adb-handle-file-writable-p) |
| 102 | (file-local-copy . tramp-adb-handle-file-local-copy) | 107 | (file-local-copy . tramp-adb-handle-file-local-copy) |
| @@ -106,7 +111,6 @@ | |||
| 106 | (directory-files . tramp-handle-directory-files) | 111 | (directory-files . tramp-handle-directory-files) |
| 107 | (directory-files-and-attributes | 112 | (directory-files-and-attributes |
| 108 | . tramp-adb-handle-directory-files-and-attributes) | 113 | . tramp-adb-handle-directory-files-and-attributes) |
| 109 | (file-name-all-completions . tramp-sh-handle-file-name-all-completions) | ||
| 110 | (make-directory . tramp-adb-handle-make-directory) | 114 | (make-directory . tramp-adb-handle-make-directory) |
| 111 | (delete-directory . tramp-adb-handle-delete-directory) | 115 | (delete-directory . tramp-adb-handle-delete-directory) |
| 112 | (delete-file . tramp-adb-handle-delete-file) | 116 | (delete-file . tramp-adb-handle-delete-file) |
| @@ -118,7 +122,7 @@ | |||
| 118 | (vc-registered . ignore) ;no vc control files on Android devices | 122 | (vc-registered . ignore) ;no vc control files on Android devices |
| 119 | (write-region . tramp-adb-handle-write-region) | 123 | (write-region . tramp-adb-handle-write-region) |
| 120 | (set-file-modes . tramp-adb-handle-set-file-modes) | 124 | (set-file-modes . tramp-adb-handle-set-file-modes) |
| 121 | (set-file-times . ignore) | 125 | (set-file-times . tramp-adb-handle-set-file-times) |
| 122 | (copy-file . tramp-adb-handle-copy-file) | 126 | (copy-file . tramp-adb-handle-copy-file) |
| 123 | (rename-file . tramp-adb-handle-rename-file) | 127 | (rename-file . tramp-adb-handle-rename-file) |
| 124 | (process-file . tramp-adb-handle-process-file) | 128 | (process-file . tramp-adb-handle-process-file) |
| @@ -139,13 +143,7 @@ | |||
| 139 | "Invoke the ADB handler for OPERATION. | 143 | "Invoke the ADB handler for OPERATION. |
| 140 | First arg specifies the OPERATION, second arg is a list of arguments to | 144 | First arg specifies the OPERATION, second arg is a list of arguments to |
| 141 | pass to the OPERATION." | 145 | pass to the OPERATION." |
| 142 | (let ((fn (assoc operation tramp-adb-file-name-handler-alist)) | 146 | (let ((fn (assoc operation tramp-adb-file-name-handler-alist))) |
| 143 | ;; `tramp-default-host's default value is (system-name). Not | ||
| 144 | ;; useful for us. | ||
| 145 | (tramp-default-host | ||
| 146 | (unless (equal (eval (car (get 'tramp-default-host 'standard-value))) | ||
| 147 | tramp-default-host) | ||
| 148 | tramp-default-host))) | ||
| 149 | (if fn | 147 | (if fn |
| 150 | (save-match-data (apply (cdr fn) args)) | 148 | (save-match-data (apply (cdr fn) args)) |
| 151 | (tramp-run-real-handler operation args)))) | 149 | (tramp-run-real-handler operation args)))) |
| @@ -312,7 +310,9 @@ pass to the OPERATION." | |||
| 312 | (and is-symlink | 310 | (and is-symlink |
| 313 | (cadr (split-string name "\\( -> \\|\n\\)"))))) | 311 | (cadr (split-string name "\\( -> \\|\n\\)"))))) |
| 314 | (push (list | 312 | (push (list |
| 315 | name | 313 | (if is-symlink |
| 314 | (car (split-string name "\\( -> \\|\n\\)")) | ||
| 315 | name) | ||
| 316 | (or is-dir symlink-target) | 316 | (or is-dir symlink-target) |
| 317 | 1 ;link-count | 317 | 1 ;link-count |
| 318 | ;; no way to handle numeric ids in Androids ash | 318 | ;; no way to handle numeric ids in Androids ash |
| @@ -372,14 +372,14 @@ pass to the OPERATION." | |||
| 372 | "ls"))) | 372 | "ls"))) |
| 373 | 373 | ||
| 374 | (defun tramp-adb-get-toolbox (vec) | 374 | (defun tramp-adb-get-toolbox (vec) |
| 375 | "Get shell toolbox implementation: `toolbox' for orginal distributions | 375 | "Get shell toolbox implementation: `toolbox' for original distributions |
| 376 | or `busybox' for CynagenMode based distributions" | 376 | or `busybox' for CyanogenMod based distributions" |
| 377 | (with-tramp-connection-property vec "toolbox" | 377 | (with-tramp-connection-property vec "toolbox" |
| 378 | (tramp-message vec 5 "Checking shell toolbox implementation") | 378 | (tramp-message vec 5 "Checking shell toolbox implementation") |
| 379 | (cond | 379 | (cond |
| 380 | ((zerop (tramp-adb-command-exit-status vec "busybox")) 'busybox) | 380 | ((zerop (tramp-adb-command-exit-status vec "busybox")) 'busybox) |
| 381 | ((zerop (tramp-adb-command-exit-status vec "toolbox")) 'toolbox) | 381 | ((zerop (tramp-adb-command-exit-status vec "toolbox")) 'toolbox) |
| 382 | (t 'unkown)))) | 382 | (t 'unknown)))) |
| 383 | 383 | ||
| 384 | (defun tramp-adb--gnu-switches-to-ash | 384 | (defun tramp-adb--gnu-switches-to-ash |
| 385 | (switches) | 385 | (switches) |
| @@ -616,6 +616,19 @@ But handle the case, if the \"test\" command is not available." | |||
| 616 | v (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) localname) | 616 | v (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) localname) |
| 617 | "Error while changing file's mode %s" filename))) | 617 | "Error while changing file's mode %s" filename))) |
| 618 | 618 | ||
| 619 | (defun tramp-adb-handle-set-file-times (filename &optional time) | ||
| 620 | "Like `set-file-times' for Tramp files." | ||
| 621 | (with-parsed-tramp-file-name filename nil | ||
| 622 | (tramp-flush-file-property v localname) | ||
| 623 | (let ((time (if (or (null time) (equal time '(0 0))) | ||
| 624 | (current-time) | ||
| 625 | time))) | ||
| 626 | (tramp-adb-command-exit-status | ||
| 627 | ;; use shell arithmetic because of Emacs integer size limit | ||
| 628 | v (format "touch -t $(( %d * 65536 + %d )) %s" | ||
| 629 | (car time) (cadr time) | ||
| 630 | (tramp-shell-quote-argument localname)))))) | ||
| 631 | |||
| 619 | (defun tramp-adb-handle-copy-file | 632 | (defun tramp-adb-handle-copy-file |
| 620 | (filename newname &optional ok-if-already-exists keep-date | 633 | (filename newname &optional ok-if-already-exists keep-date |
| 621 | preserve-uid-gid preserve-extended-attributes) | 634 | preserve-uid-gid preserve-extended-attributes) |
| @@ -940,19 +953,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 940 | (tramp-set-connection-property v "process-name" nil) | 953 | (tramp-set-connection-property v "process-name" nil) |
| 941 | (tramp-set-connection-property v "process-buffer" nil))))) | 954 | (tramp-set-connection-property v "process-buffer" nil))))) |
| 942 | 955 | ||
| 943 | ;; Android < 4 doesn't provide test command. | ||
| 944 | |||
| 945 | (defun tramp-adb-handle-file-exists-p (filename) | ||
| 946 | "Like `file-exists-p' for Tramp files." | ||
| 947 | (with-parsed-tramp-file-name filename nil | ||
| 948 | (with-tramp-file-property v localname "file-exists-p" | ||
| 949 | (file-attributes filename)))) | ||
| 950 | |||
| 951 | ;; Helper functions. | 956 | ;; Helper functions. |
| 952 | 957 | ||
| 953 | (defun tramp-adb-execute-adb-command (vec &rest args) | 958 | (defun tramp-adb-execute-adb-command (vec &rest args) |
| 954 | "Returns nil on success error-output on failure." | 959 | "Returns nil on success error-output on failure." |
| 955 | (when (tramp-file-name-host vec) | 960 | (when (> (length (tramp-file-name-host vec)) 0) |
| 956 | (setq args (append (list "-s" (tramp-file-name-host vec)) args))) | 961 | (setq args (append (list "-s" (tramp-file-name-host vec)) args))) |
| 957 | (with-temp-buffer | 962 | (with-temp-buffer |
| 958 | (prog1 | 963 | (prog1 |
| @@ -1054,6 +1059,7 @@ Does not do anything if a connection is already open, but re-opens the | |||
| 1054 | connection if a previous connection has died for some reason." | 1059 | connection if a previous connection has died for some reason." |
| 1055 | (let* ((buf (tramp-get-connection-buffer vec)) | 1060 | (let* ((buf (tramp-get-connection-buffer vec)) |
| 1056 | (p (get-buffer-process buf)) | 1061 | (p (get-buffer-process buf)) |
| 1062 | (host (tramp-file-name-host vec)) | ||
| 1057 | (devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))) | 1063 | (devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))) |
| 1058 | (unless | 1064 | (unless |
| 1059 | (and p (processp p) (memq (process-status p) '(run open))) | 1065 | (and p (processp p) (memq (process-status p) '(run open))) |
| @@ -1061,21 +1067,17 @@ connection if a previous connection has died for some reason." | |||
| 1061 | (when (and p (processp p)) (delete-process p)) | 1067 | (when (and p (processp p)) (delete-process p)) |
| 1062 | (if (not devices) | 1068 | (if (not devices) |
| 1063 | (tramp-error vec 'file-error "No device connected")) | 1069 | (tramp-error vec 'file-error "No device connected")) |
| 1064 | (if (and (tramp-file-name-host vec) | 1070 | (if (and (> (length host) 0) (not (member host devices))) |
| 1065 | (not (member (tramp-file-name-host vec) devices))) | 1071 | (tramp-error vec 'file-error "Device %s not connected" host)) |
| 1066 | (tramp-error | 1072 | (if (and (> (length devices) 1) (zerop (length host))) |
| 1067 | vec 'file-error | ||
| 1068 | "Device %s not connected" (tramp-file-name-host vec))) | ||
| 1069 | (if (and (not (eq (length devices) 1)) | ||
| 1070 | (not (tramp-file-name-host vec))) | ||
| 1071 | (tramp-error | 1073 | (tramp-error |
| 1072 | vec 'file-error | 1074 | vec 'file-error |
| 1073 | "Multiple Devices connected: No Host/Device specified")) | 1075 | "Multiple Devices connected: No Host/Device specified")) |
| 1074 | (with-tramp-progress-reporter vec 3 "Opening adb shell connection" | 1076 | (with-tramp-progress-reporter vec 3 "Opening adb shell connection" |
| 1075 | (let* ((coding-system-for-read 'utf-8-dos) ;is this correct? | 1077 | (let* ((coding-system-for-read 'utf-8-dos) ;is this correct? |
| 1076 | (process-connection-type tramp-process-connection-type) | 1078 | (process-connection-type tramp-process-connection-type) |
| 1077 | (args (if (tramp-file-name-host vec) | 1079 | (args (if (> (length host) 0) |
| 1078 | (list "-s" (tramp-file-name-host vec) "shell") | 1080 | (list "-s" host "shell") |
| 1079 | (list "shell"))) | 1081 | (list "shell"))) |
| 1080 | (p (let ((default-directory | 1082 | (p (let ((default-directory |
| 1081 | (tramp-compat-temporary-file-directory))) | 1083 | (tramp-compat-temporary-file-directory))) |
| @@ -1111,7 +1113,19 @@ connection if a previous connection has died for some reason." | |||
| 1111 | vec 3 | 1113 | vec 3 |
| 1112 | "Connection reset, because remote host changed from `%s' to `%s'" | 1114 | "Connection reset, because remote host changed from `%s' to `%s'" |
| 1113 | old-getprop new-getprop) | 1115 | old-getprop new-getprop) |
| 1114 | (tramp-adb-maybe-open-connection vec))))))))) | 1116 | (tramp-adb-maybe-open-connection vec))) |
| 1117 | |||
| 1118 | ;; Set "remote-path" connection property. This is needed | ||
| 1119 | ;; for eshell. | ||
| 1120 | (tramp-adb-send-command vec "echo \\\"$PATH\\\"") | ||
| 1121 | (tramp-set-connection-property | ||
| 1122 | vec "remote-path" | ||
| 1123 | (split-string | ||
| 1124 | (with-current-buffer (tramp-get-connection-buffer vec) | ||
| 1125 | ;; Read the expression. | ||
| 1126 | (goto-char (point-min)) | ||
| 1127 | (read (current-buffer))) | ||
| 1128 | ":" 'omit-nulls)))))))) | ||
| 1115 | 1129 | ||
| 1116 | (provide 'tramp-adb) | 1130 | (provide 'tramp-adb) |
| 1117 | ;;; tramp-adb.el ends here | 1131 | ;;; tramp-adb.el ends here |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 79f8d82b02b..d83599a6662 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -5181,34 +5181,6 @@ function cell is returned to be applied on a buffer." | |||
| 5181 | (t | 5181 | (t |
| 5182 | (format "%s <%%s" coding))))))) | 5182 | (format "%s <%%s" coding))))))) |
| 5183 | 5183 | ||
| 5184 | ;;; Integration of eshell.el: | ||
| 5185 | |||
| 5186 | (eval-when-compile | ||
| 5187 | (defvar eshell-path-env)) | ||
| 5188 | |||
| 5189 | ;; eshell.el keeps the path in `eshell-path-env'. We must change it | ||
| 5190 | ;; when `default-directory' points to another host. | ||
| 5191 | (defun tramp-eshell-directory-change () | ||
| 5192 | "Set `eshell-path-env' to $PATH of the host related to `default-directory'." | ||
| 5193 | (setq eshell-path-env | ||
| 5194 | (if (file-remote-p default-directory) | ||
| 5195 | (with-parsed-tramp-file-name default-directory nil | ||
| 5196 | (mapconcat | ||
| 5197 | 'identity | ||
| 5198 | (tramp-get-remote-path v) | ||
| 5199 | ":")) | ||
| 5200 | (getenv "PATH")))) | ||
| 5201 | |||
| 5202 | (eval-after-load "esh-util" | ||
| 5203 | '(progn | ||
| 5204 | (tramp-eshell-directory-change) | ||
| 5205 | (add-hook 'eshell-directory-change-hook | ||
| 5206 | 'tramp-eshell-directory-change) | ||
| 5207 | (add-hook 'tramp-unload-hook | ||
| 5208 | (lambda () | ||
| 5209 | (remove-hook 'eshell-directory-change-hook | ||
| 5210 | 'tramp-eshell-directory-change))))) | ||
| 5211 | |||
| 5212 | (add-hook 'tramp-unload-hook | 5184 | (add-hook 'tramp-unload-hook |
| 5213 | (lambda () | 5185 | (lambda () |
| 5214 | (unload-feature 'tramp-sh 'force))) | 5186 | (unload-feature 'tramp-sh 'force))) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 7c393622ffc..2c4aac0ac8a 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -381,6 +381,23 @@ Useful for su and sudo methods mostly." | |||
| 381 | :group 'tramp | 381 | :group 'tramp |
| 382 | :type 'string) | 382 | :type 'string) |
| 383 | 383 | ||
| 384 | ;;;###tramp-autoload | ||
| 385 | (defcustom tramp-default-host-alist nil | ||
| 386 | "Default host to use for specific method/user pairs. | ||
| 387 | This is an alist of items (METHOD USER HOST). The first matching item | ||
| 388 | specifies the host to use for a file name which does not specify a | ||
| 389 | host. METHOD and HOST are regular expressions or nil, which is | ||
| 390 | interpreted as a regular expression which always matches. If no entry | ||
| 391 | matches, the variable `tramp-default-host' takes effect. | ||
| 392 | |||
| 393 | If the file name does not specify the method, lookup is done using the | ||
| 394 | empty string for the method name." | ||
| 395 | :group 'tramp | ||
| 396 | :version "24.4" | ||
| 397 | :type '(repeat (list (choice :tag "Method regexp" regexp sexp) | ||
| 398 | (choice :tag " User regexp" regexp sexp) | ||
| 399 | (choice :tag " Host name" string (const nil))))) | ||
| 400 | |||
| 384 | (defcustom tramp-default-proxies-alist nil | 401 | (defcustom tramp-default-proxies-alist nil |
| 385 | "Route to be followed for specific host/user pairs. | 402 | "Route to be followed for specific host/user pairs. |
| 386 | This is an alist of items (HOST USER PROXY). The first matching | 403 | This is an alist of items (HOST USER PROXY). The first matching |
| @@ -918,7 +935,7 @@ See `tramp-file-name-structure' for more explanations.") | |||
| 918 | This regexp should match partial Tramp file names only. | 935 | This regexp should match partial Tramp file names only. |
| 919 | 936 | ||
| 920 | Please note that the entry in `file-name-handler-alist' is made when | 937 | Please note that the entry in `file-name-handler-alist' is made when |
| 921 | this file (tramp.el) is loaded. This means that this variable must be set | 938 | this file \(tramp.el\) is loaded. This means that this variable must be set |
| 922 | before loading tramp.el. Alternatively, `file-name-handler-alist' can be | 939 | before loading tramp.el. Alternatively, `file-name-handler-alist' can be |
| 923 | updated after changing this variable. | 940 | updated after changing this variable. |
| 924 | 941 | ||
| @@ -1163,6 +1180,15 @@ This is USER, if non-nil. Otherwise, do a lookup in | |||
| 1163 | "Return the right host string to use. | 1180 | "Return the right host string to use. |
| 1164 | This is HOST, if non-nil. Otherwise, it is `tramp-default-host'." | 1181 | This is HOST, if non-nil. Otherwise, it is `tramp-default-host'." |
| 1165 | (or (and (> (length host) 0) host) | 1182 | (or (and (> (length host) 0) host) |
| 1183 | (let ((choices tramp-default-host-alist) | ||
| 1184 | lhost item) | ||
| 1185 | (while choices | ||
| 1186 | (setq item (pop choices)) | ||
| 1187 | (when (and (string-match (or (nth 0 item) "") (or method "")) | ||
| 1188 | (string-match (or (nth 1 item) "") (or user ""))) | ||
| 1189 | (setq lhost (nth 2 item)) | ||
| 1190 | (setq choices nil))) | ||
| 1191 | lhost) | ||
| 1166 | tramp-default-host)) | 1192 | tramp-default-host)) |
| 1167 | 1193 | ||
| 1168 | (defun tramp-dissect-file-name (name &optional nodefault) | 1194 | (defun tramp-dissect-file-name (name &optional nodefault) |
| @@ -3861,6 +3887,39 @@ Only works for Bourne-like shells." | |||
| 3861 | t t result))) | 3887 | t t result))) |
| 3862 | result)))) | 3888 | result)))) |
| 3863 | 3889 | ||
| 3890 | ;;; Integration of eshell.el: | ||
| 3891 | |||
| 3892 | (eval-when-compile | ||
| 3893 | (defvar eshell-path-env)) | ||
| 3894 | |||
| 3895 | ;; eshell.el keeps the path in `eshell-path-env'. We must change it | ||
| 3896 | ;; when `default-directory' points to another host. | ||
| 3897 | (defun tramp-eshell-directory-change () | ||
| 3898 | "Set `eshell-path-env' to $PATH of the host related to `default-directory'." | ||
| 3899 | (setq eshell-path-env | ||
| 3900 | (if (file-remote-p default-directory) | ||
| 3901 | (with-parsed-tramp-file-name default-directory nil | ||
| 3902 | (mapconcat | ||
| 3903 | 'identity | ||
| 3904 | (or | ||
| 3905 | ;; When `tramp-own-remote-path' is in `tramp-remote-path', | ||
| 3906 | ;; the remote path is only set in the session cache. | ||
| 3907 | (tramp-get-connection-property | ||
| 3908 | (tramp-get-connection-process v) "remote-path" nil) | ||
| 3909 | (tramp-get-connection-property v "remote-path" nil)) | ||
| 3910 | ":")) | ||
| 3911 | (getenv "PATH")))) | ||
| 3912 | |||
| 3913 | (eval-after-load "esh-util" | ||
| 3914 | '(progn | ||
| 3915 | (tramp-eshell-directory-change) | ||
| 3916 | (add-hook 'eshell-directory-change-hook | ||
| 3917 | 'tramp-eshell-directory-change) | ||
| 3918 | (add-hook 'tramp-unload-hook | ||
| 3919 | (lambda () | ||
| 3920 | (remove-hook 'eshell-directory-change-hook | ||
| 3921 | 'tramp-eshell-directory-change))))) | ||
| 3922 | |||
| 3864 | ;; Checklist for `tramp-unload-hook' | 3923 | ;; Checklist for `tramp-unload-hook' |
| 3865 | ;; - Unload all `tramp-*' packages | 3924 | ;; - Unload all `tramp-*' packages |
| 3866 | ;; - Reset `file-name-handler-alist' | 3925 | ;; - Reset `file-name-handler-alist' |
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index d55feaa3c1a..bcb5f721ae8 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el | |||
| @@ -1206,7 +1206,8 @@ changed with `comment-style'." | |||
| 1206 | (defun comment-box (beg end &optional arg) | 1206 | (defun comment-box (beg end &optional arg) |
| 1207 | "Comment out the BEG .. END region, putting it inside a box. | 1207 | "Comment out the BEG .. END region, putting it inside a box. |
| 1208 | The numeric prefix ARG specifies how many characters to add to begin- and | 1208 | The numeric prefix ARG specifies how many characters to add to begin- and |
| 1209 | end- comment markers additionally to what `comment-add' already specifies." | 1209 | end- comment markers additionally to what variable `comment-add' already |
| 1210 | specifies." | ||
| 1210 | (interactive "*r\np") | 1211 | (interactive "*r\np") |
| 1211 | (comment-normalize-vars) | 1212 | (comment-normalize-vars) |
| 1212 | (let ((comment-style (if (cadr (assoc comment-style comment-styles)) | 1213 | (let ((comment-style (if (cadr (assoc comment-style comment-styles)) |
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index b348d22d6de..56a76c7d680 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog | |||
| @@ -1,3 +1,380 @@ | |||
| 1 | 2013-01-13 Bastien Guerry <bzg@gnu.org> | ||
| 2 | |||
| 3 | * org-compat.el (org-condition-case-unless-debug): Delete. | ||
| 4 | |||
| 5 | * org-odt.el (org-odt-cleanup-xml-buffers): Use | ||
| 6 | `condition-case' instead of `org-condition-case-unless-debug', | ||
| 7 | which is now deleted. | ||
| 8 | |||
| 9 | * org-capture.el (org-capture-templates-contexts): | ||
| 10 | * org-agenda.el (org-agenda-custom-commands-contexts): | ||
| 11 | Docstring fix. | ||
| 12 | |||
| 13 | * org.el (org-get-tags-at): Remove duplicate inherited tags. | ||
| 14 | |||
| 15 | * org-agenda.el (org-agenda-show-inherited-tags): Allow to be set | ||
| 16 | to 'always or to a list of agenda types. | ||
| 17 | (org-agenda-finalize): Rework conditions under which inherited | ||
| 18 | tags should be made available even when not displayed. | ||
| 19 | (org-search-view, org-agenda-get-todos) | ||
| 20 | (org-agenda-get-timestamps, org-agenda-get-sexps) | ||
| 21 | (org-agenda-get-progress, org-agenda-get-scheduled) | ||
| 22 | (org-agenda-get-blocks): Use new possible values of | ||
| 23 | `org-agenda-show-inherited-tags'. | ||
| 24 | |||
| 25 | * org.el (org-open-at-point): Fix opening all links at point. | ||
| 26 | |||
| 27 | * org-agenda.el (org-get-entries-from-diary): Turn off | ||
| 28 | `diary-file-name-prefix' instead of | ||
| 29 | `diary-file-name-prefix-function', the former is checked before | ||
| 30 | the latter. | ||
| 31 | |||
| 32 | * org.el (org-edit-special): Check for table.el before checking | ||
| 33 | for Org tables. | ||
| 34 | |||
| 35 | 2013-01-13 Michael Albinus <michael.albinus@gmx.de> | ||
| 36 | |||
| 37 | * ob-eval.el (org-babel-shell-command-on-region): Use | ||
| 38 | `executable-find' for local `shell-file-name'. | ||
| 39 | |||
| 40 | 2013-01-09 Achim Gratz <Stromeko@Stromeko.de> | ||
| 41 | |||
| 42 | * org-faces.el: Define face alias mode-line for XEmacs (it's | ||
| 43 | called modeline there). | ||
| 44 | |||
| 45 | * org-compat.el (org-no-popups): New wrapper macro which let-binds | ||
| 46 | the correct variables to suppress popup windows depending on the | ||
| 47 | Emacs version in use. This is a compile-time decision when | ||
| 48 | byte-compiling. | ||
| 49 | |||
| 50 | * org.el (org-get-location, org-switch-to-buffer-other-window): | ||
| 51 | Use the wrapper `org-no-popups' to let-bind the correct variables | ||
| 52 | for suppression of popup windows. | ||
| 53 | |||
| 54 | * org-compat.el (user-error): Defalias to `error' for Emacsen that | ||
| 55 | don't have it. | ||
| 56 | |||
| 57 | * org-agenda.el (org-agenda-write): Use org-called-interactively-p | ||
| 58 | instead of called-interactively-p. | ||
| 59 | |||
| 60 | * org.el (org-find-invisible-foreground): Do not use the value of | ||
| 61 | variables `default-frame-alist', `initial-frame-alist' and | ||
| 62 | `window-system-default-frame-alist' when their symbol is not bound. | ||
| 63 | |||
| 64 | 2013-01-09 Bastien Guerry <bzg@gnu.org> | ||
| 65 | |||
| 66 | * org-src.el (org-edit-src-code): Fix bug when trying to edit a | ||
| 67 | table.el table. | ||
| 68 | |||
| 69 | * org-agenda.el (org-agenda-finalize): Inhibit readonly for the | ||
| 70 | whole function. | ||
| 71 | |||
| 72 | * org.el (org-entry-get): Speed up by let-binding some variables | ||
| 73 | only if needed. Also fix a bug: consider an empty drawer as no drawer. | ||
| 74 | |||
| 75 | * org-agenda.el (org-search-view, org-agenda-get-todos) | ||
| 76 | (org-agenda-get-timestamps, org-agenda-get-sexps) | ||
| 77 | (org-agenda-get-progress, org-agenda-get-deadlines) | ||
| 78 | (org-agenda-get-scheduled, org-agenda-get-blocks) | ||
| 79 | (org-agenda-change-all-lines): Get local tags only. | ||
| 80 | (org-agenda-use-tag-inheritance): New option. | ||
| 81 | (org-agenda-finalize): When `org-agenda-use-tag-inheritance' | ||
| 82 | is non-nil, possibly reset tags in the agenda buffer. | ||
| 83 | (org-agenda-check-type): Enhance docstring. | ||
| 84 | |||
| 85 | * org.el (org-use-tag-inheritance): Fix typo in docstring. | ||
| 86 | |||
| 87 | * org-agenda.el (org-float): Don't alias `org-float'. | ||
| 88 | |||
| 89 | * org.el (org-scan-tags): The skipper already checks for archived | ||
| 90 | entries. | ||
| 91 | |||
| 92 | * org.el (org-refresh-properties): Rename from | ||
| 93 | `org-refresh-effort-properties' and use two new parameters. | ||
| 94 | (org-agenda-prepare-buffers): Use `org-refresh-properties'. | ||
| 95 | Also refresh the 'org-appt-warntime text property. | ||
| 96 | |||
| 97 | * org-clock.el (org-clock-in): Use the renamed defun. | ||
| 98 | |||
| 99 | * org-icalendar.el (org-icalendar-print-entries): | ||
| 100 | Refresh the 'org-appt-warntime property. | ||
| 101 | (org-icalendar-print-entries): | ||
| 102 | * org-agenda.el (org-agenda-get-timestamps) | ||
| 103 | (org-agenda-get-sexps, org-agenda-get-deadlines) | ||
| 104 | (org-agenda-get-scheduled): Do not use `org-entry-get' to get the | ||
| 105 | "APPT_WARNTIME" property value. | ||
| 106 | |||
| 107 | * org.el (org-id-link-to-org-use-id): Fix compiler warning. | ||
| 108 | |||
| 109 | * org-agenda.el (org-agenda-format-item): Do not use | ||
| 110 | `org-get-effort' to get the effort text property. | ||
| 111 | (org-agenda-get-sexps): Use `org-back-to-heading' when setting tags. | ||
| 112 | |||
| 113 | * org-clock.el (org-clock-in): Refresh effort properties. | ||
| 114 | |||
| 115 | * org.el (org-refresh-effort-properties): New defun. | ||
| 116 | (org-get-effort): Delete. | ||
| 117 | (org-set-effort): | ||
| 118 | (org-property-next-allowed-value): Set the 'org-effort text property. | ||
| 119 | (org-agenda-prepare-buffers): Refresh effort properties. | ||
| 120 | |||
| 121 | * org.el (org-read-date): Let-bind `mouse-autoselect-window' to | ||
| 122 | nil so that the mouse doesn't jump when the option is set to t globally. | ||
| 123 | |||
| 124 | * org-agenda.el (org-agenda-dim-blocked-tasks): Default to nil. | ||
| 125 | (org-agenda-dim-blocked-tasks): Make interactive and allow an | ||
| 126 | optional parameter 'invisible to hide blocked tasks instead of | ||
| 127 | just dimming them. | ||
| 128 | (org-agenda-mode-map): Bind `org-agenda-dim-blocked-tasks' to "#". | ||
| 129 | |||
| 130 | * org-agenda.el (org-agenda-finalize): Don't try to align tags | ||
| 131 | when there are no tags. Only try to draw the habit consistency | ||
| 132 | graph when there is a habit in the buffer. Only mark clocking | ||
| 133 | task when there is one. | ||
| 134 | |||
| 135 | * org.el (org-adaptive-fill-function): DTRT in `message-mode'. | ||
| 136 | |||
| 137 | * org.el (org-get-priority): Save match data even when using | ||
| 138 | `org-get-priority-function'. | ||
| 139 | |||
| 140 | * org-mobile.el (org-mobile-create-index-file): | ||
| 141 | Possibly normalize `org-todo-keywords'. | ||
| 142 | |||
| 143 | * org-mobile.el (org-mobile-push): Use the correct agenda buffer names. | ||
| 144 | |||
| 145 | * org.el (org-store-link): Use `org-id-link-to-org-use-id' instead | ||
| 146 | of the obsolete variable name. | ||
| 147 | |||
| 148 | * org.el (org-fontify-meta-lines-and-blocks-1): | ||
| 149 | Fix bug when fontifying keywords with no value. | ||
| 150 | |||
| 151 | * org.el (org-goto-auto-isearch): Enhance docstring. | ||
| 152 | (org-goto-map): Make a defun, so that the customized value of | ||
| 153 | org-goto-auto-isearch is correctly initialized. | ||
| 154 | (org-goto): Initialize the keymap with `org-goto-map'. | ||
| 155 | (org-get-location): Use *Org Help* as a temporary buffer. | ||
| 156 | Tell whether auto-isearch is on or off. | ||
| 157 | |||
| 158 | * org-exp.el (org-export-as-org): Remove useless argument. | ||
| 159 | |||
| 160 | * org-docbook.el (org-export-as-docbook-batch) | ||
| 161 | (org-export-region-as-docbook, org-export-as-docbook-pdf): | ||
| 162 | Fix the number of arguments. | ||
| 163 | (org-export-as-docbook): Remove useless argument. | ||
| 164 | |||
| 165 | * org.el (org-speed-commands-default): Use ":" instead of ";" for | ||
| 166 | `org-set-tags-command', which is consistent with ":" in agenda | ||
| 167 | view. Use "=" for `org-columns". | ||
| 168 | |||
| 169 | * org.el (org-sparse-tree): Fix redundant information in prompt. | ||
| 170 | |||
| 171 | * org-exp.el (org-export-string): Fix number of arguments passed | ||
| 172 | to the org-export-as-* functions. | ||
| 173 | |||
| 174 | * org-latex.el (org-export-as-latex): Fix typo in docstring. | ||
| 175 | |||
| 176 | * org-list.el (org-cycle-include-plain-lists): Docstring enhancement. | ||
| 177 | |||
| 178 | * org.el (org-fontify-meta-lines-and-blocks-1): Fix fontification | ||
| 179 | bug when fontifying a keyword with no associated value. | ||
| 180 | (org-cycle-internal-local): Don't run hooks when cycling a plain | ||
| 181 | list before first headline. | ||
| 182 | (org-ctrl-c-ctrl-c): Throw a user error when trying to toggle a | ||
| 183 | blocked checkbox. | ||
| 184 | (org-indent-line): Fix table formulas indenting. | ||
| 185 | |||
| 186 | * org-agenda.el (org-agenda-open-link): Fix bug when no link is | ||
| 187 | matched. Return a message instead of an error. | ||
| 188 | (org-agenda-priority): Remove useless parameter and fix showing | ||
| 189 | priority in agenda buffers. | ||
| 190 | |||
| 191 | * org-macs.el (org-with-buffer-modified-unmodified): New macro. | ||
| 192 | |||
| 193 | * org.el (org-entry-blocked-p): Use the new macro. | ||
| 194 | |||
| 195 | * org-src.el (org-edit-src-exit): Don't comma-escape the content | ||
| 196 | of a fixed width region. | ||
| 197 | |||
| 198 | * org.el (org-blocker-hook): Update the docstring to mention that | ||
| 199 | functions in this hook should not modify the buffer. | ||
| 200 | (org-trigger-hook): Small docstring fix. | ||
| 201 | (org-entry-blocked-p): Use `with-buffer-modified-unmodified' | ||
| 202 | so that the function never modifies the buffer. | ||
| 203 | |||
| 204 | * org-agenda.el (org-agenda-open-link): Allow to open an internal | ||
| 205 | link by using the new `org-offer-links-in-entry' function. | ||
| 206 | |||
| 207 | * org.el (org-offer-links-in-entry): Do not open the link directly | ||
| 208 | through `org-open-link-from-string', only offer to select a link | ||
| 209 | and return a cons with the link (as a string) and the end of entry. | ||
| 210 | (org-open-at-point): Use `org-offer-links-in-entry' correctly. | ||
| 211 | |||
| 212 | * org.el (org-cycle-internal-local): | ||
| 213 | Fix bug: allow headings with leading blank characters. | ||
| 214 | |||
| 215 | * org-clock.el (org-clock-persist): | ||
| 216 | Docstring fix: document the 'history value. | ||
| 217 | |||
| 218 | * org.el (org-insert-link): Fix bug when inserting links to | ||
| 219 | headlines containing the ">" character. | ||
| 220 | |||
| 221 | * org-crypt.el (org-at-encrypted-entry-p): Fix search boundary. | ||
| 222 | |||
| 223 | * org-compat.el (org-delete-directory): New compatibility function | ||
| 224 | for Emacs 22, where `delete-directory' does not support recursive | ||
| 225 | deletion. | ||
| 226 | |||
| 227 | * org-odt.el (org-odt-cleanup-xml-buffers): | ||
| 228 | Use the new compatibility function. | ||
| 229 | |||
| 230 | * org.el (org-table-map-tables): Fix allowed blocks. | ||
| 231 | |||
| 232 | * org.el (org-edit-special): | ||
| 233 | * org-src.el (org-edit-src-code): Fix regression: allow editing | ||
| 234 | HTML and LaTeX source blocks again. | ||
| 235 | |||
| 236 | * org.el (org-nonsticky-props): Add `htmlize-link'. | ||
| 237 | (org-nonsticky-props): Add `htmlize-link'. | ||
| 238 | |||
| 239 | * org.el (org-edit-special): | ||
| 240 | * org-src.el (org-edit-src-code): Don't edit in verbatim blocks. | ||
| 241 | |||
| 242 | * org-table.el (org-table-fedit-lisp-indent) | ||
| 243 | (orgtbl-self-insert-command): Use `org-delete-backward-char' | ||
| 244 | instead of `backward-delete-char'. | ||
| 245 | |||
| 246 | * org-src.el (org-edit-src-code): Fix another bug about editing | ||
| 247 | special blocks "example" and "verbatim". | ||
| 248 | |||
| 249 | * org.el (org-structure-template-alist): Add verbatim. | ||
| 250 | (org-edit-special): Fix bug about editing special blocks | ||
| 251 | "example" and "verbatim". | ||
| 252 | |||
| 253 | * org.el (org-delete-backward-char, org-delete-char): | ||
| 254 | Save match data, `delete-backward-char' and `delete-char' don't. | ||
| 255 | |||
| 256 | * org.el (org-enable-table-editor, org-insert-heading) | ||
| 257 | (org-remove-timestamp-with-keyword, org-self-insert-command): | ||
| 258 | * org-table.el (org-table-fedit-lisp-indent) | ||
| 259 | (orgtbl-self-insert-command): | ||
| 260 | * org-latex.el (org-export-latex-subcontent): | ||
| 261 | * org-clock.el (org-clocktable-write-default): | ||
| 262 | * org-ascii.el (org-export-ascii-preprocess): | ||
| 263 | Use `delete-backward-char' instead of `backward-delete-char'. | ||
| 264 | |||
| 265 | * org.el (org-todo): Ignore the comment string when changing the | ||
| 266 | TODO state of a headline. | ||
| 267 | (org-edit-special): Fix docstring. | ||
| 268 | (org-in-src-block-p): Small enhancement. | ||
| 269 | |||
| 270 | * org-publish.el (org-publish-org-to): Call `org-export-as-*' | ||
| 271 | functions with the correct list of arguments. | ||
| 272 | |||
| 273 | * org-html.el (org-export-as-html): Delete obsolete arg `hidden'. | ||
| 274 | (org-export-as-html-and-open, org-export-as-html-batch) | ||
| 275 | (org-export-region-as-html): Don't use obsolete arg. | ||
| 276 | |||
| 277 | * org-ascii.el (org-export-as-ascii): Delete obsolete arg `hidden'. | ||
| 278 | (org-export-as-ascii-to-buffer): Don't use obsolete arg. | ||
| 279 | |||
| 280 | * org.el (org-in-fixed-width-region-p): Save match data. | ||
| 281 | (org-in-src-block-p): Use case-folding for searching the block | ||
| 282 | boundaries. | ||
| 283 | (org-activate-plain-links, org-activate-angle-links) | ||
| 284 | (org-activate-bracket-links): Prevent link activation in | ||
| 285 | source code blocks. | ||
| 286 | |||
| 287 | * org-odt.el (org-odt-cleanup-xml-buffers): Fix Emacs Bug#13197 by | ||
| 288 | setting the correct buffer before marking it unmodified to | ||
| 289 | silently kill him. | ||
| 290 | |||
| 291 | * org.el (org-set-font-lock-defaults): Don't activate links in | ||
| 292 | source code blocks and fixed-width regions. | ||
| 293 | |||
| 294 | * org-agenda.el (org-agenda-finalize): Fix links activation. | ||
| 295 | |||
| 296 | * org.el (org-open-at-point): Throw the correct error on | ||
| 297 | non-links. Use `user-error' instead of `error'. | ||
| 298 | |||
| 299 | * org.el (org-in-fixed-width-region-p): Define before use. | ||
| 300 | |||
| 301 | * org-src.el (org-in-src-block-p): Declare function. | ||
| 302 | |||
| 303 | * org-compat.el: Fix bug: don't use `eval-when-compile' when | ||
| 304 | aliasing `user-error'. | ||
| 305 | |||
| 306 | * org-agenda.el (org-agenda-skip): Only check if point is | ||
| 307 | inside a code block, not at a code block. | ||
| 308 | |||
| 309 | * org.el (org-in-fixed-width-region-p): | ||
| 310 | Rewrite using org-element.el. | ||
| 311 | |||
| 312 | * org.el (org-fill-paragraph): Fill correctly in source code block. | ||
| 313 | |||
| 314 | * org.el (org-in-fixed-width-region-p): New function. | ||
| 315 | (org-edit-special): Fix bug: make sure to DTRT in every | ||
| 316 | special environment. Also use the new function to check | ||
| 317 | against fixed-width environment. | ||
| 318 | |||
| 319 | * org-src.el (org-edit-src-code): Check if we are in a source code | ||
| 320 | block with `org-in-src-block-p'. Slightly reformat the docstring. | ||
| 321 | |||
| 322 | * org.el (org-in-src-block-p): Return t when point is at the | ||
| 323 | #+BEGIN_SRC/#+END_SRC lines unless the new optional parameter | ||
| 324 | 'inside is set to t. | ||
| 325 | |||
| 326 | * ob-exp.el (obe-marker): Delete useless var. | ||
| 327 | |||
| 328 | * org-src.el (org-edit-src-code): Fix bug triggered by the sexp | ||
| 329 | (copy-marker nil) on Emacs <24.1. | ||
| 330 | |||
| 331 | 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 332 | |||
| 333 | * org-agenda.el (org-agenda-get-restriction-and-command): | ||
| 334 | * org-capture.el (org-capture-place-template): | ||
| 335 | * org-colview.el (org-dblock-write:columnview): | ||
| 336 | * org-mobile.el (org-mobile-locate-entry): | ||
| 337 | * org-table.el (org-table-convert-region): | ||
| 338 | * org.el (org-update-statistics-cookies): Use `point-marker'. | ||
| 339 | |||
| 340 | 2013-01-09 Eric Schulte <eric.schulte@gmx.com> | ||
| 341 | |||
| 342 | * org-exp.el (org-export-string): Pass the dir option on through | ||
| 343 | to any subsequent export functions. | ||
| 344 | |||
| 345 | 2013-01-09 Henning Weiss <hdweiss@gmail.com> (tiny change) | ||
| 346 | |||
| 347 | * org-mobile.el (org-mobile-sumo-agenda-command): Remove match | ||
| 348 | description from block agendas when they have a title. | ||
| 349 | |||
| 350 | 2013-01-09 Jambunathan K <kjambunathan@gmail.com> | ||
| 351 | |||
| 352 | * org-odt.el (org-export-as-odt-batch): Init `org-odt-zip-dir'. | ||
| 353 | Fix Emacs Bug#13254. | ||
| 354 | |||
| 355 | * org-odt.el (org-odt-format-org-link): Add check for presence of | ||
| 356 | description in headline links. | ||
| 357 | |||
| 358 | 2013-01-09 Michael Gauland <mike_gauland@stanfordalumni.org> (tiny change) | ||
| 359 | |||
| 360 | * org-src.el: Create a marker to pass to copy-marker. | ||
| 361 | |||
| 362 | 2013-01-09 Nicolas Goaziou <n.goaziou@gmail.com> | ||
| 363 | |||
| 364 | * org.el (org-setup-filling): Set `auto-fill-inhibit-regexp' to | ||
| 365 | nil because `org-adaptive-fill-function' already determines which | ||
| 366 | lines should be filled. | ||
| 367 | |||
| 368 | * org.el (org-fill-paragraph): Small refactoring. | ||
| 369 | |||
| 370 | * org-element.el (org-element--parse-elements) | ||
| 371 | (org-element-at-point): Fix parsing of a list in a block in a list. | ||
| 372 | |||
| 373 | 2013-01-09 Sebastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> | ||
| 374 | |||
| 375 | * org.el (org-copy-subtree, org-paste-subtree): | ||
| 376 | Fix whitespace handling when copying/pasting a subtree. | ||
| 377 | |||
| 1 | 2012-12-20 Michael Albinus <michael.albinus@gmx.de> | 378 | 2012-12-20 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 379 | ||
| 3 | * ob.el (org-babel-temp-file): Fix setting of | 380 | * ob.el (org-babel-temp-file): Fix setting of |
| @@ -129,9 +506,8 @@ | |||
| 129 | * ob-haskell.el (org-export-as-latex): Don't use the obsoleted | 506 | * ob-haskell.el (org-export-as-latex): Don't use the obsoleted |
| 130 | argument `hidden'. | 507 | argument `hidden'. |
| 131 | 508 | ||
| 132 | * org.el (org-refile): Run within `with-demoted-errors' so | 509 | * org.el (org-refile): Run within `with-demoted-errors' so that a |
| 133 | that a corrupted bookmark file does not stop the refile | 510 | corrupted bookmark file does not stop the refile process. |
| 134 | process. | ||
| 135 | 511 | ||
| 136 | * org-capture.el (org-capture-bookmark-last-stored-position): | 512 | * org-capture.el (org-capture-bookmark-last-stored-position): |
| 137 | Ditto for the capture process. | 513 | Ditto for the capture process. |
diff --git a/lisp/org/ob-eval.el b/lisp/org/ob-eval.el index afa880bd90c..22d2bcf288e 100644 --- a/lisp/org/ob-eval.el +++ b/lisp/org/ob-eval.el | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | (eval-when-compile (require 'cl)) | 30 | (eval-when-compile (require 'cl)) |
| 31 | 31 | ||
| 32 | (defvar org-babel-error-buffer-name "*Org-Babel Error Output*") | 32 | (defvar org-babel-error-buffer-name "*Org-Babel Error Output*") |
| 33 | (declare-function org-babel-temp-file "ob-core" (prefix &optional suffix)) | ||
| 33 | 34 | ||
| 34 | (defun org-babel-eval-error-notify (exit-code stderr) | 35 | (defun org-babel-eval-error-notify (exit-code stderr) |
| 35 | "Open a buffer to display STDERR and a message with the value of EXIT-CODE." | 36 | "Open a buffer to display STDERR and a message with the value of EXIT-CODE." |
| @@ -136,12 +137,23 @@ specifies the value of ERROR-BUFFER." | |||
| 136 | t))) | 137 | t))) |
| 137 | (let ((input-file (org-babel-temp-file "input-")) | 138 | (let ((input-file (org-babel-temp-file "input-")) |
| 138 | (error-file (if error-buffer (org-babel-temp-file "scor-") nil)) | 139 | (error-file (if error-buffer (org-babel-temp-file "scor-") nil)) |
| 140 | ;; Unfortunately, `executable-find' does not support file name | ||
| 141 | ;; handlers. Therefore, we could use it in the local case | ||
| 142 | ;; only. | ||
| 139 | (shell-file-name | 143 | (shell-file-name |
| 140 | (if (file-executable-p | 144 | (cond ((and (not (file-remote-p default-directory)) |
| 141 | (concat (file-remote-p default-directory) shell-file-name)) | 145 | (executable-find shell-file-name)) |
| 142 | shell-file-name | 146 | shell-file-name) |
| 143 | "/bin/sh")) | 147 | ((file-executable-p |
| 148 | (concat (file-remote-p default-directory) shell-file-name)) | ||
| 149 | shell-file-name) | ||
| 150 | ("/bin/sh"))) | ||
| 144 | exit-status) | 151 | exit-status) |
| 152 | ;; There is an error in `process-file' when `error-file' exists. | ||
| 153 | ;; This is fixed in Emacs trunk as of 2012-12-21; let's use this | ||
| 154 | ;; workaround for now. | ||
| 155 | (unless (file-remote-p default-directory) | ||
| 156 | (delete-file error-file)) | ||
| 145 | (if (or replace | 157 | (if (or replace |
| 146 | (and output-buffer | 158 | (and output-buffer |
| 147 | (not (or (bufferp output-buffer) (stringp output-buffer))))) | 159 | (not (or (bufferp output-buffer) (stringp output-buffer))))) |
diff --git a/lisp/org/ob-exp.el b/lisp/org/ob-exp.el index c62a6a8211d..37a9f71cf59 100644 --- a/lisp/org/ob-exp.el +++ b/lisp/org/ob-exp.el | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | (eval-when-compile | 28 | (eval-when-compile |
| 29 | (require 'cl)) | 29 | (require 'cl)) |
| 30 | 30 | ||
| 31 | (defvar obe-marker nil) | ||
| 32 | (defvar org-current-export-file) | 31 | (defvar org-current-export-file) |
| 33 | (defvar org-babel-lob-one-liner-regexp) | 32 | (defvar org-babel-lob-one-liner-regexp) |
| 34 | (defvar org-babel-ref-split-regexp) | 33 | (defvar org-babel-ref-split-regexp) |
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index e6e6166ffe2..ca8459ca33d 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el | |||
| @@ -840,7 +840,7 @@ entry, the rest of the entry will not be searched." | |||
| 840 | :group 'org-agenda-daily/weekly | 840 | :group 'org-agenda-daily/weekly |
| 841 | :type 'boolean) | 841 | :type 'boolean) |
| 842 | 842 | ||
| 843 | (defcustom org-agenda-dim-blocked-tasks t | 843 | (defcustom org-agenda-dim-blocked-tasks nil |
| 844 | "Non-nil means dim blocked tasks in the agenda display. | 844 | "Non-nil means dim blocked tasks in the agenda display. |
| 845 | This causes some overhead during agenda construction, but if you | 845 | This causes some overhead during agenda construction, but if you |
| 846 | have turned on `org-enforce-todo-dependencies', | 846 | have turned on `org-enforce-todo-dependencies', |
| @@ -857,6 +857,7 @@ that is blocked because of checkboxes will never be made invisible, it | |||
| 857 | will only be dimmed." | 857 | will only be dimmed." |
| 858 | :group 'org-agenda-daily/weekly | 858 | :group 'org-agenda-daily/weekly |
| 859 | :group 'org-agenda-todo-list | 859 | :group 'org-agenda-todo-list |
| 860 | :version "24.3" | ||
| 860 | :type '(choice | 861 | :type '(choice |
| 861 | (const :tag "Do not dim" nil) | 862 | (const :tag "Do not dim" nil) |
| 862 | (const :tag "Dim to a gray face" t) | 863 | (const :tag "Dim to a gray face" t) |
| @@ -1647,9 +1648,53 @@ When non-nil, this must be the number of minutes, e.g. 60 for one hour." | |||
| 1647 | (const :tag "No default duration"))) | 1648 | (const :tag "No default duration"))) |
| 1648 | 1649 | ||
| 1649 | (defcustom org-agenda-show-inherited-tags t | 1650 | (defcustom org-agenda-show-inherited-tags t |
| 1650 | "Non-nil means show inherited tags in each agenda line." | 1651 | "Non-nil means show inherited tags in each agenda line. |
| 1652 | |||
| 1653 | When this option is set to 'always, it take precedences over | ||
| 1654 | `org-agenda-use-tag-inheritance' and inherited tags are shown | ||
| 1655 | in every agenda. | ||
| 1656 | |||
| 1657 | When this option is set to t (the default), inherited tags are | ||
| 1658 | shown when they are available, i.e. when the value of | ||
| 1659 | `org-agenda-use-tag-inheritance' has been taken into account. | ||
| 1660 | |||
| 1661 | This can be set to a list of agenda types in which the agenda | ||
| 1662 | must display the inherited tags. Available types are 'todo, | ||
| 1663 | 'agenda, 'search and 'timeline. | ||
| 1664 | |||
| 1665 | When set to nil, never show inherited tags in agenda lines." | ||
| 1651 | :group 'org-agenda-line-format | 1666 | :group 'org-agenda-line-format |
| 1652 | :type 'boolean) | 1667 | :group 'org-agenda |
| 1668 | :version "24.3" | ||
| 1669 | :type '(choice | ||
| 1670 | (const :tag "Show inherited tags when available" t) | ||
| 1671 | (const :tag "Always show inherited tags" 'always) | ||
| 1672 | (repeat :tag "Show inherited tags only in selected agenda types" | ||
| 1673 | (symbol :tag "Agenda type")))) | ||
| 1674 | |||
| 1675 | (defcustom org-agenda-use-tag-inheritance '(todo search timeline agenda) | ||
| 1676 | "List of agenda view types where to use tag inheritance. | ||
| 1677 | |||
| 1678 | In tags/tags-todo/tags-tree agenda views, tag inheritance is | ||
| 1679 | controlled by `org-use-tag-inheritance'. In other agenda types, | ||
| 1680 | `org-use-tag-inheritance' is not used for the selection of the | ||
| 1681 | agenda entries. Still, you may want the agenda to be aware of | ||
| 1682 | the inherited tags anyway, e.g. for later tag filtering. | ||
| 1683 | |||
| 1684 | Allowed value are 'todo, 'search, 'timeline and 'agenda. | ||
| 1685 | |||
| 1686 | This variable has no effect if `org-agenda-show-inherited-tags' | ||
| 1687 | is set to 'always. In that case, the agenda is aware of those | ||
| 1688 | tags. | ||
| 1689 | |||
| 1690 | The default value sets tags in every agenda type. Setting this | ||
| 1691 | option to nil will speed up non-tags agenda view a lot." | ||
| 1692 | :group 'org-agenda | ||
| 1693 | :version "24.3" | ||
| 1694 | :type '(choice | ||
| 1695 | (const :tag "Use tag inheritance in all agenda types" t) | ||
| 1696 | (repeat :tag "Use tag inheritance in selected agenda types" | ||
| 1697 | (symbol :tag "Agenda type")))) | ||
| 1653 | 1698 | ||
| 1654 | (defcustom org-agenda-hide-tags-regexp nil | 1699 | (defcustom org-agenda-hide-tags-regexp nil |
| 1655 | "Regular expression used to filter away specific tags in agenda views. | 1700 | "Regular expression used to filter away specific tags in agenda views. |
| @@ -2012,6 +2057,7 @@ The following commands are available: | |||
| 2012 | (org-defkey org-agenda-mode-map "\C-c\C-w" 'org-agenda-refile) | 2057 | (org-defkey org-agenda-mode-map "\C-c\C-w" 'org-agenda-refile) |
| 2013 | (org-defkey org-agenda-mode-map "m" 'org-agenda-bulk-mark) | 2058 | (org-defkey org-agenda-mode-map "m" 'org-agenda-bulk-mark) |
| 2014 | (org-defkey org-agenda-mode-map "*" 'org-agenda-bulk-mark-all) | 2059 | (org-defkey org-agenda-mode-map "*" 'org-agenda-bulk-mark-all) |
| 2060 | (org-defkey org-agenda-mode-map "#" 'org-agenda-dim-blocked-tasks) | ||
| 2015 | (org-defkey org-agenda-mode-map "%" 'org-agenda-bulk-mark-regexp) | 2061 | (org-defkey org-agenda-mode-map "%" 'org-agenda-bulk-mark-regexp) |
| 2016 | (org-defkey org-agenda-mode-map "u" 'org-agenda-bulk-unmark) | 2062 | (org-defkey org-agenda-mode-map "u" 'org-agenda-bulk-unmark) |
| 2017 | (org-defkey org-agenda-mode-map "U" 'org-agenda-bulk-unmark-all) | 2063 | (org-defkey org-agenda-mode-map "U" 'org-agenda-bulk-unmark-all) |
| @@ -2344,7 +2390,7 @@ For example, if you have a custom agenda command \"p\" and you | |||
| 2344 | want this command to be accessible only from plain text files, | 2390 | want this command to be accessible only from plain text files, |
| 2345 | use this: | 2391 | use this: |
| 2346 | 2392 | ||
| 2347 | '((\"p\" (in-file . \"\\.txt\"))) | 2393 | '((\"p\" ((in-file . \"\\.txt\")))) |
| 2348 | 2394 | ||
| 2349 | Here are the available contexts definitions: | 2395 | Here are the available contexts definitions: |
| 2350 | 2396 | ||
| @@ -2360,7 +2406,7 @@ accessible if there is at least one valid check. | |||
| 2360 | You can also bind a key to another agenda custom command | 2406 | You can also bind a key to another agenda custom command |
| 2361 | depending on contextual rules. | 2407 | depending on contextual rules. |
| 2362 | 2408 | ||
| 2363 | '((\"p\" \"q\" (in-file . \"\\.txt\"))) | 2409 | '((\"p\" \"q\" ((in-file . \"\\.txt\")))) |
| 2364 | 2410 | ||
| 2365 | Here it means: in .txt files, use \"p\" as the key for the | 2411 | Here it means: in .txt files, use \"p\" as the key for the |
| 2366 | agenda command otherwise associated with \"q\". (The command | 2412 | agenda command otherwise associated with \"q\". (The command |
| @@ -2664,7 +2710,7 @@ L Timeline for current buffer # List stuck projects (!=configure) | |||
| 2664 | (add-text-properties (match-beginning 2) (match-end 2) | 2710 | (add-text-properties (match-beginning 2) (match-end 2) |
| 2665 | '(face bold) header)) | 2711 | '(face bold) header)) |
| 2666 | header))) | 2712 | header))) |
| 2667 | (setq header-end (move-marker (make-marker) (point))) | 2713 | (setq header-end (point-marker)) |
| 2668 | (while t | 2714 | (while t |
| 2669 | (setq custom1 custom) | 2715 | (setq custom1 custom) |
| 2670 | (when (eq rmheader t) | 2716 | (when (eq rmheader t) |
| @@ -3194,7 +3240,7 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write." | |||
| 3194 | (kill-buffer (current-buffer)) | 3240 | (kill-buffer (current-buffer)) |
| 3195 | (message "Plain text written to %s" file)))))))) | 3241 | (message "Plain text written to %s" file)))))))) |
| 3196 | (set-buffer (or agenda-bufname | 3242 | (set-buffer (or agenda-bufname |
| 3197 | (and (called-interactively-p 'any) (buffer-name)) | 3243 | (and (org-called-interactively-p 'any) (buffer-name)) |
| 3198 | org-agenda-buffer-name))) | 3244 | org-agenda-buffer-name))) |
| 3199 | (when open (org-open-file file))) | 3245 | (when open (org-open-file file))) |
| 3200 | 3246 | ||
| @@ -3514,44 +3560,66 @@ generating a new one." | |||
| 3514 | (save-excursion | 3560 | (save-excursion |
| 3515 | (let ((inhibit-read-only t)) | 3561 | (let ((inhibit-read-only t)) |
| 3516 | (goto-char (point-min)) | 3562 | (goto-char (point-min)) |
| 3517 | (while (org-activate-bracket-links (point-max)) | 3563 | (save-excursion |
| 3518 | (add-text-properties (match-beginning 0) (match-end 0) | 3564 | (while (org-activate-bracket-links (point-max)) |
| 3519 | '(face org-link))) | 3565 | (add-text-properties (match-beginning 0) (match-end 0) |
| 3520 | (while (org-activate-plain-links (point-max)) | 3566 | '(face org-link)))) |
| 3521 | (add-text-properties (match-beginning 0) (match-end 0) | 3567 | (save-excursion |
| 3522 | '(face org-link))) | 3568 | (while (org-activate-plain-links (point-max)) |
| 3523 | (org-agenda-align-tags) | 3569 | (add-text-properties (match-beginning 0) (match-end 0) |
| 3570 | '(face org-link)))) | ||
| 3571 | (unless (eq org-agenda-remove-tags t) | ||
| 3572 | (org-agenda-align-tags)) | ||
| 3524 | (unless org-agenda-with-colors | 3573 | (unless org-agenda-with-colors |
| 3525 | (remove-text-properties (point-min) (point-max) '(face nil)))) | 3574 | (remove-text-properties (point-min) (point-max) '(face nil))) |
| 3526 | (if (and (boundp 'org-agenda-overriding-columns-format) | 3575 | (if (and (boundp 'org-agenda-overriding-columns-format) |
| 3527 | org-agenda-overriding-columns-format) | 3576 | org-agenda-overriding-columns-format) |
| 3528 | (org-set-local 'org-agenda-overriding-columns-format | 3577 | (org-set-local 'org-agenda-overriding-columns-format |
| 3529 | org-agenda-overriding-columns-format)) | 3578 | org-agenda-overriding-columns-format)) |
| 3530 | (if (and (boundp 'org-agenda-view-columns-initially) | 3579 | (if (and (boundp 'org-agenda-view-columns-initially) |
| 3531 | org-agenda-view-columns-initially) | 3580 | org-agenda-view-columns-initially) |
| 3532 | (org-agenda-columns)) | 3581 | (org-agenda-columns)) |
| 3533 | (when org-agenda-fontify-priorities | 3582 | (when org-agenda-fontify-priorities |
| 3534 | (org-agenda-fontify-priorities)) | 3583 | (org-agenda-fontify-priorities)) |
| 3535 | (when (and org-agenda-dim-blocked-tasks org-blocker-hook) | 3584 | (when (and org-agenda-dim-blocked-tasks org-blocker-hook) |
| 3536 | (org-agenda-dim-blocked-tasks)) | 3585 | (org-agenda-dim-blocked-tasks)) |
| 3537 | ;; We need to widen when `org-agenda-finalize' is called from | 3586 | ;; We need to widen when `org-agenda-finalize' is called from |
| 3538 | ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in') | 3587 | ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in') |
| 3539 | (save-restriction | 3588 | (when org-clock-current-task |
| 3540 | (widen) | 3589 | (save-restriction |
| 3541 | (org-agenda-mark-clocking-task)) | 3590 | (widen) |
| 3542 | (when org-agenda-entry-text-mode | 3591 | (org-agenda-mark-clocking-task))) |
| 3543 | (org-agenda-entry-text-hide) | 3592 | (when org-agenda-entry-text-mode |
| 3544 | (org-agenda-entry-text-show)) | 3593 | (org-agenda-entry-text-hide) |
| 3545 | (if (functionp 'org-habit-insert-consistency-graphs) | 3594 | (org-agenda-entry-text-show)) |
| 3546 | (org-habit-insert-consistency-graphs)) | 3595 | (if (and (functionp 'org-habit-insert-consistency-graphs) |
| 3547 | (let ((inhibit-read-only t)) | 3596 | (save-excursion (next-single-property-change (point-min) 'org-habit-p))) |
| 3548 | (run-hooks 'org-agenda-finalize-hook)) | 3597 | (org-habit-insert-consistency-graphs)) |
| 3549 | (setq org-agenda-type (org-get-at-bol 'org-agenda-type)) | 3598 | (setq org-agenda-type (org-get-at-bol 'org-agenda-type)) |
| 3550 | (when (or org-agenda-tag-filter (get 'org-agenda-tag-filter :preset-filter)) | 3599 | (unless (or (eq org-agenda-show-inherited-tags 'always) |
| 3551 | (org-agenda-filter-apply org-agenda-tag-filter 'tag)) | 3600 | (and (listp org-agenda-show-inherited-tags) |
| 3552 | (when (or org-agenda-category-filter (get 'org-agenda-category-filter :preset-filter)) | 3601 | (memq org-agenda-type org-agenda-show-inherited-tags)) |
| 3553 | (org-agenda-filter-apply org-agenda-category-filter 'category)) | 3602 | (and (eq org-agenda-show-inherited-tags t) |
| 3554 | (org-add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local)))) | 3603 | (or (eq org-agenda-use-tag-inheritance t) |
| 3604 | (and (listp org-agenda-use-tag-inheritance) | ||
| 3605 | (not (memq org-agenda-type | ||
| 3606 | org-agenda-use-tag-inheritance)))))) | ||
| 3607 | (let (mrk) | ||
| 3608 | (save-excursion | ||
| 3609 | (goto-char (point-min)) | ||
| 3610 | (while (equal (forward-line) 0) | ||
| 3611 | (when (setq mrk (or (get-text-property (point) 'org-hd-marker) | ||
| 3612 | (get-text-property (point) 'org-hd-marker))) | ||
| 3613 | (put-text-property (point-at-bol) (point-at-eol) | ||
| 3614 | 'tags (org-with-point-at mrk | ||
| 3615 | (delete-dups | ||
| 3616 | (mapcar 'downcase (org-get-tags-at)))))))))) | ||
| 3617 | (run-hooks 'org-agenda-finalize-hook) | ||
| 3618 | (when (or org-agenda-tag-filter (get 'org-agenda-tag-filter :preset-filter)) | ||
| 3619 | (org-agenda-filter-apply org-agenda-tag-filter 'tag)) | ||
| 3620 | (when (or org-agenda-category-filter (get 'org-agenda-category-filter :preset-filter)) | ||
| 3621 | (org-agenda-filter-apply org-agenda-category-filter 'category)) | ||
| 3622 | (org-add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local))))) | ||
| 3555 | 3623 | ||
| 3556 | (defun org-agenda-mark-clocking-task () | 3624 | (defun org-agenda-mark-clocking-task () |
| 3557 | "Mark the current clock entry in the agenda if it is present." | 3625 | "Mark the current clock entry in the agenda if it is present." |
| @@ -3607,15 +3675,18 @@ generating a new one." | |||
| 3607 | ((equal p h) 'bold))) | 3675 | ((equal p h) 'bold))) |
| 3608 | (overlay-put ov 'org-type 'org-priority))))) | 3676 | (overlay-put ov 'org-type 'org-priority))))) |
| 3609 | 3677 | ||
| 3610 | (defun org-agenda-dim-blocked-tasks () | 3678 | (defun org-agenda-dim-blocked-tasks (&optional invisible) |
| 3679 | (interactive "P") | ||
| 3611 | "Dim currently blocked TODO's in the agenda display." | 3680 | "Dim currently blocked TODO's in the agenda display." |
| 3681 | (message "Dim or hide blocked tasks...") | ||
| 3612 | (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-blocked-todo) | 3682 | (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-blocked-todo) |
| 3613 | (delete-overlay o))) | 3683 | (delete-overlay o))) |
| 3614 | (overlays-in (point-min) (point-max))) | 3684 | (overlays-in (point-min) (point-max))) |
| 3615 | (save-excursion | 3685 | (save-excursion |
| 3616 | (let ((inhibit-read-only t) | 3686 | (let ((inhibit-read-only t) |
| 3617 | (org-depend-tag-blocked nil) | 3687 | (org-depend-tag-blocked nil) |
| 3618 | (invis (eq org-agenda-dim-blocked-tasks 'invisible)) | 3688 | (invis (or (not (null invisible)) |
| 3689 | (eq org-agenda-dim-blocked-tasks 'invisible))) | ||
| 3619 | org-blocked-by-checkboxes | 3690 | org-blocked-by-checkboxes |
| 3620 | invis1 b e p ov h l) | 3691 | invis1 b e p ov h l) |
| 3621 | (goto-char (point-min)) | 3692 | (goto-char (point-min)) |
| @@ -3636,7 +3707,8 @@ generating a new one." | |||
| 3636 | (if invis1 | 3707 | (if invis1 |
| 3637 | (overlay-put ov 'invisible t) | 3708 | (overlay-put ov 'invisible t) |
| 3638 | (overlay-put ov 'face 'org-agenda-dimmed-todo-face)) | 3709 | (overlay-put ov 'face 'org-agenda-dimmed-todo-face)) |
| 3639 | (overlay-put ov 'org-type 'org-blocked-todo))))))) | 3710 | (overlay-put ov 'org-type 'org-blocked-todo)))))) |
| 3711 | (message "Dim or hide blocked tasks...done")) | ||
| 3640 | 3712 | ||
| 3641 | (defvar org-agenda-skip-function nil | 3713 | (defvar org-agenda-skip-function nil |
| 3642 | "Function to be called at each match during agenda construction. | 3714 | "Function to be called at each match during agenda construction. |
| @@ -3656,7 +3728,7 @@ A good way to set it is through options in `org-agenda-custom-commands'.") | |||
| 3656 | Also moves point to the end of the skipped region, so that search can | 3728 | Also moves point to the end of the skipped region, so that search can |
| 3657 | continue from there." | 3729 | continue from there." |
| 3658 | (let ((p (point-at-bol)) to) | 3730 | (let ((p (point-at-bol)) to) |
| 3659 | (when (org-in-src-block-p) (throw :skip t)) | 3731 | (when (org-in-src-block-p t) (throw :skip t)) |
| 3660 | (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) | 3732 | (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) |
| 3661 | (get-text-property p :org-archived) | 3733 | (get-text-property p :org-archived) |
| 3662 | (org-end-of-subtree t) | 3734 | (org-end-of-subtree t) |
| @@ -4251,7 +4323,7 @@ in `org-agenda-text-search-extra-files'." | |||
| 4251 | 'help-echo (format "mouse-2 or RET jump to location"))) | 4323 | 'help-echo (format "mouse-2 or RET jump to location"))) |
| 4252 | (full-words org-agenda-search-view-force-full-words) | 4324 | (full-words org-agenda-search-view-force-full-words) |
| 4253 | (org-agenda-text-search-extra-files org-agenda-text-search-extra-files) | 4325 | (org-agenda-text-search-extra-files org-agenda-text-search-extra-files) |
| 4254 | regexp rtn rtnall files file pos | 4326 | regexp rtn rtnall files file pos inherited-tags |
| 4255 | marker category category-pos tags c neg re boolean | 4327 | marker category category-pos tags c neg re boolean |
| 4256 | ee txt beg end words regexps+ regexps- hdl-only buffer beg1 str) | 4328 | ee txt beg end words regexps+ regexps- hdl-only buffer beg1 str) |
| 4257 | (unless (and (not edit-at) | 4329 | (unless (and (not edit-at) |
| @@ -4405,7 +4477,13 @@ in `org-agenda-text-search-extra-files'." | |||
| 4405 | (setq marker (org-agenda-new-marker (point)) | 4477 | (setq marker (org-agenda-new-marker (point)) |
| 4406 | category (org-get-category) | 4478 | category (org-get-category) |
| 4407 | category-pos (get-text-property (point) 'org-category-position) | 4479 | category-pos (get-text-property (point) 'org-category-position) |
| 4408 | tags (org-get-tags-at (point)) | 4480 | inherited-tags |
| 4481 | (or (eq org-agenda-show-inherited-tags 'always) | ||
| 4482 | (memq 'todo org-agenda-show-inherited-tags) | ||
| 4483 | (and (eq org-agenda-show-inherited-tags t) | ||
| 4484 | (or (eq org-agenda-use-tag-inheritance t) | ||
| 4485 | (memq 'todo org-agenda-use-tag-inheritance)))) | ||
| 4486 | tags (org-get-tags-at nil (not inherited-tags)) | ||
| 4409 | txt (org-agenda-format-item | 4487 | txt (org-agenda-format-item |
| 4410 | "" | 4488 | "" |
| 4411 | (buffer-substring-no-properties | 4489 | (buffer-substring-no-properties |
| @@ -4935,7 +5013,7 @@ of what a project is and how to check if it stuck, customize the variable | |||
| 4935 | (pop-up-frames nil) | 5013 | (pop-up-frames nil) |
| 4936 | (diary-list-entries-hook | 5014 | (diary-list-entries-hook |
| 4937 | (cons 'org-diary-default-entry diary-list-entries-hook)) | 5015 | (cons 'org-diary-default-entry diary-list-entries-hook)) |
| 4938 | (diary-file-name-prefix-function nil) ; turn this feature off | 5016 | (diary-file-name-prefix nil) ; turn this feature off |
| 4939 | (diary-modify-entry-list-string-function 'org-modify-diary-entry-string) | 5017 | (diary-modify-entry-list-string-function 'org-modify-diary-entry-string) |
| 4940 | entries | 5018 | entries |
| 4941 | (org-disable-agenda-to-diary t)) | 5019 | (org-disable-agenda-to-diary t)) |
| @@ -5211,7 +5289,7 @@ the documentation of `org-diary'." | |||
| 5211 | "\\|") "\\)")) | 5289 | "\\|") "\\)")) |
| 5212 | (t org-not-done-regexp)))) | 5290 | (t org-not-done-regexp)))) |
| 5213 | marker priority category category-pos tags todo-state | 5291 | marker priority category category-pos tags todo-state |
| 5214 | ee txt beg end) | 5292 | ee txt beg end inherited-tags) |
| 5215 | (goto-char (point-min)) | 5293 | (goto-char (point-min)) |
| 5216 | (while (re-search-forward regexp nil t) | 5294 | (while (re-search-forward regexp nil t) |
| 5217 | (catch :skip | 5295 | (catch :skip |
| @@ -5229,7 +5307,14 @@ the documentation of `org-diary'." | |||
| 5229 | category-pos (get-text-property (point) 'org-category-position) | 5307 | category-pos (get-text-property (point) 'org-category-position) |
| 5230 | txt (org-trim | 5308 | txt (org-trim |
| 5231 | (buffer-substring (match-beginning 2) (match-end 0))) | 5309 | (buffer-substring (match-beginning 2) (match-end 0))) |
| 5232 | tags (org-get-tags-at (point)) | 5310 | inherited-tags |
| 5311 | (or (eq org-agenda-show-inherited-tags 'always) | ||
| 5312 | (and (listp org-agenda-show-inherited-tags) | ||
| 5313 | (memq 'todo org-agenda-show-inherited-tags)) | ||
| 5314 | (and (eq org-agenda-show-inherited-tags t) | ||
| 5315 | (or (eq org-agenda-use-tag-inheritance t) | ||
| 5316 | (memq 'todo org-agenda-use-tag-inheritance)))) | ||
| 5317 | tags (org-get-tags-at nil (not inherited-tags)) | ||
| 5233 | txt (org-agenda-format-item "" txt category tags t) | 5318 | txt (org-agenda-format-item "" txt category tags t) |
| 5234 | priority (1+ (org-get-priority txt)) | 5319 | priority (1+ (org-get-priority txt)) |
| 5235 | todo-state (org-get-todo-state)) | 5320 | todo-state (org-get-todo-state)) |
| @@ -5356,7 +5441,8 @@ Do we have a reason to ignore this TODO entry because it has a time stamp? | |||
| 5356 | "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) | 5441 | "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) |
| 5357 | marker hdmarker deadlinep scheduledp clockp closedp inactivep | 5442 | marker hdmarker deadlinep scheduledp clockp closedp inactivep |
| 5358 | donep tmp priority category category-pos ee txt timestr tags | 5443 | donep tmp priority category category-pos ee txt timestr tags |
| 5359 | b0 b3 e3 head todo-state end-of-match show-all warntime habitp) | 5444 | b0 b3 e3 head todo-state end-of-match show-all warntime habitp |
| 5445 | inherited-tags) | ||
| 5360 | (goto-char (point-min)) | 5446 | (goto-char (point-min)) |
| 5361 | (while (setq end-of-match (re-search-forward regexp nil t)) | 5447 | (while (setq end-of-match (re-search-forward regexp nil t)) |
| 5362 | (setq b0 (match-beginning 0) | 5448 | (setq b0 (match-beginning 0) |
| @@ -5389,7 +5475,7 @@ Do we have a reason to ignore this TODO entry because it has a time stamp? | |||
| 5389 | clockp (and org-agenda-include-inactive-timestamps | 5475 | clockp (and org-agenda-include-inactive-timestamps |
| 5390 | (or (string-match org-clock-string tmp) | 5476 | (or (string-match org-clock-string tmp) |
| 5391 | (string-match "]-+\\'" tmp))) | 5477 | (string-match "]-+\\'" tmp))) |
| 5392 | warntime (org-entry-get (point) "APPT_WARNTIME") | 5478 | warntime (get-text-property (point) 'org-appt-warntime) |
| 5393 | donep (member todo-state org-done-keywords)) | 5479 | donep (member todo-state org-done-keywords)) |
| 5394 | (if (or scheduledp deadlinep closedp clockp | 5480 | (if (or scheduledp deadlinep closedp clockp |
| 5395 | (and donep org-agenda-skip-timestamp-if-done)) | 5481 | (and donep org-agenda-skip-timestamp-if-done)) |
| @@ -5408,7 +5494,14 @@ Do we have a reason to ignore this TODO entry because it has a time stamp? | |||
| 5408 | (assoc (point) deadline-position-alist)) | 5494 | (assoc (point) deadline-position-alist)) |
| 5409 | (throw :skip nil)) | 5495 | (throw :skip nil)) |
| 5410 | (setq hdmarker (org-agenda-new-marker) | 5496 | (setq hdmarker (org-agenda-new-marker) |
| 5411 | tags (org-get-tags-at)) | 5497 | inherited-tags |
| 5498 | (or (eq org-agenda-show-inherited-tags 'always) | ||
| 5499 | (and (listp org-agenda-show-inherited-tags) | ||
| 5500 | (memq 'agenda org-agenda-show-inherited-tags)) | ||
| 5501 | (and (eq org-agenda-show-inherited-tags t) | ||
| 5502 | (or (eq org-agenda-use-tag-inheritance t) | ||
| 5503 | (memq 'agenda org-agenda-use-tag-inheritance)))) | ||
| 5504 | tags (org-get-tags-at nil (not inherited-tags))) | ||
| 5412 | (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") | 5505 | (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") |
| 5413 | (setq head (or (match-string 1) "")) | 5506 | (setq head (or (match-string 1) "")) |
| 5414 | (setq txt (org-agenda-format-item | 5507 | (setq txt (org-agenda-format-item |
| @@ -5440,7 +5533,7 @@ Do we have a reason to ignore this TODO entry because it has a time stamp? | |||
| 5440 | (abbreviate-file-name buffer-file-name)))) | 5533 | (abbreviate-file-name buffer-file-name)))) |
| 5441 | (regexp "^&?%%(") | 5534 | (regexp "^&?%%(") |
| 5442 | marker category extra category-pos ee txt tags entry | 5535 | marker category extra category-pos ee txt tags entry |
| 5443 | result beg b sexp sexp-entry todo-state warntime) | 5536 | result beg b sexp sexp-entry todo-state warntime inherited-tags) |
| 5444 | (goto-char (point-min)) | 5537 | (goto-char (point-min)) |
| 5445 | (while (re-search-forward regexp nil t) | 5538 | (while (re-search-forward regexp nil t) |
| 5446 | (catch :skip | 5539 | (catch :skip |
| @@ -5458,10 +5551,16 @@ Do we have a reason to ignore this TODO entry because it has a time stamp? | |||
| 5458 | (setq marker (org-agenda-new-marker beg) | 5551 | (setq marker (org-agenda-new-marker beg) |
| 5459 | category (org-get-category beg) | 5552 | category (org-get-category beg) |
| 5460 | category-pos (get-text-property beg 'org-category-position) | 5553 | category-pos (get-text-property beg 'org-category-position) |
| 5461 | tags (save-excursion (org-backward-heading-same-level 0) | 5554 | inherited-tags |
| 5462 | (org-get-tags-at)) | 5555 | (or (eq org-agenda-show-inherited-tags 'always) |
| 5556 | (and (listp org-agenda-show-inherited-tags) | ||
| 5557 | (memq 'agenda org-agenda-show-inherited-tags)) | ||
| 5558 | (and (eq org-agenda-show-inherited-tags t) | ||
| 5559 | (or (eq org-agenda-use-tag-inheritance t) | ||
| 5560 | (memq 'agenda org-agenda-use-tag-inheritance)))) | ||
| 5561 | tags (org-get-tags-at nil (not inherited-tags)) | ||
| 5463 | todo-state (org-get-todo-state) | 5562 | todo-state (org-get-todo-state) |
| 5464 | warntime (org-entry-get (point) "APPT_WARNTIME") | 5563 | warntime (get-text-property (point) 'org-appt-warntime) |
| 5465 | extra nil) | 5564 | extra nil) |
| 5466 | 5565 | ||
| 5467 | (dolist (r (if (stringp result) | 5566 | (dolist (r (if (stringp result) |
| @@ -5510,7 +5609,6 @@ Do we have a reason to ignore this TODO entry because it has a time stamp? | |||
| 5510 | (org-no-warnings | 5609 | (org-no-warnings |
| 5511 | (let ((calendar-date-style 'european) (european-calendar-style t)) | 5610 | (let ((calendar-date-style 'european) (european-calendar-style t)) |
| 5512 | (diary-date day month year mark)))) | 5611 | (diary-date day month year mark)))) |
| 5513 | (defalias 'org-float 'diary-float) | ||
| 5514 | 5612 | ||
| 5515 | ;; Define the` org-class' function | 5613 | ;; Define the` org-class' function |
| 5516 | (defun org-class (y1 m1 d1 y2 m2 d2 dayname &rest skip-weeks) | 5614 | (defun org-class (y1 m1 d1 y2 m2 d2 dayname &rest skip-weeks) |
| @@ -5591,7 +5689,7 @@ please use `org-class' instead." | |||
| 5591 | 1 11)))) | 5689 | 1 11)))) |
| 5592 | (org-agenda-search-headline-for-time nil) | 5690 | (org-agenda-search-headline-for-time nil) |
| 5593 | marker hdmarker priority category category-pos tags closedp | 5691 | marker hdmarker priority category category-pos tags closedp |
| 5594 | statep clockp state ee txt extra timestr rest clocked) | 5692 | statep clockp state ee txt extra timestr rest clocked inherited-tags) |
| 5595 | (goto-char (point-min)) | 5693 | (goto-char (point-min)) |
| 5596 | (while (re-search-forward regexp nil t) | 5694 | (while (re-search-forward regexp nil t) |
| 5597 | (catch :skip | 5695 | (catch :skip |
| @@ -5629,7 +5727,14 @@ please use `org-class' instead." | |||
| 5629 | (setq txt org-agenda-no-heading-message) | 5727 | (setq txt org-agenda-no-heading-message) |
| 5630 | (goto-char (match-beginning 0)) | 5728 | (goto-char (match-beginning 0)) |
| 5631 | (setq hdmarker (org-agenda-new-marker) | 5729 | (setq hdmarker (org-agenda-new-marker) |
| 5632 | tags (org-get-tags-at)) | 5730 | inherited-tags |
| 5731 | (or (eq org-agenda-show-inherited-tags 'always) | ||
| 5732 | (and (listp org-agenda-show-inherited-tags) | ||
| 5733 | (memq 'todo org-agenda-show-inherited-tags)) | ||
| 5734 | (and (eq org-agenda-show-inherited-tags t) | ||
| 5735 | (or (eq org-agenda-use-tag-inheritance t) | ||
| 5736 | (memq 'todo org-agenda-use-tag-inheritance)))) | ||
| 5737 | tags (org-get-tags-at nil (not inherited-tags))) | ||
| 5633 | (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") | 5738 | (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") |
| 5634 | (setq txt (match-string 1)) | 5739 | (setq txt (match-string 1)) |
| 5635 | (when extra | 5740 | (when extra |
| @@ -5833,13 +5938,13 @@ See also the user option `org-agenda-clock-consistency-checks'." | |||
| 5833 | (not (= diff 0)))) | 5938 | (not (= diff 0)))) |
| 5834 | (setq txt nil) | 5939 | (setq txt nil) |
| 5835 | (setq category (org-get-category) | 5940 | (setq category (org-get-category) |
| 5836 | warntime (org-entry-get (point) "APPT_WARNTIME") | 5941 | warntime (get-text-property (point) 'org-appt-warntime) |
| 5837 | category-pos (get-text-property (point) 'org-category-position)) | 5942 | category-pos (get-text-property (point) 'org-category-position)) |
| 5838 | (if (not (re-search-backward "^\\*+[ \t]+" nil t)) | 5943 | (if (not (re-search-backward "^\\*+[ \t]+" nil t)) |
| 5839 | (setq txt org-agenda-no-heading-message) | 5944 | (setq txt org-agenda-no-heading-message) |
| 5840 | (goto-char (match-end 0)) | 5945 | (goto-char (match-end 0)) |
| 5841 | (setq pos1 (match-beginning 0)) | 5946 | (setq pos1 (match-beginning 0)) |
| 5842 | (setq tags (org-get-tags-at pos1)) | 5947 | (setq tags (org-get-tags-at pos1 t)) |
| 5843 | (setq head (buffer-substring-no-properties | 5948 | (setq head (buffer-substring-no-properties |
| 5844 | (point) | 5949 | (point) |
| 5845 | (progn (skip-chars-forward "^\r\n") | 5950 | (progn (skip-chars-forward "^\r\n") |
| @@ -5907,7 +6012,7 @@ FRACTION is what fraction of the head-warning time has passed." | |||
| 5907 | deadline-results)) | 6012 | deadline-results)) |
| 5908 | d2 diff pos pos1 category category-pos tags donep | 6013 | d2 diff pos pos1 category category-pos tags donep |
| 5909 | ee txt head pastschedp todo-state face timestr s habitp show-all | 6014 | ee txt head pastschedp todo-state face timestr s habitp show-all |
| 5910 | did-habit-check-p warntime) | 6015 | did-habit-check-p warntime inherited-tags) |
| 5911 | (goto-char (point-min)) | 6016 | (goto-char (point-min)) |
| 5912 | (while (re-search-forward regexp nil t) | 6017 | (while (re-search-forward regexp nil t) |
| 5913 | (catch :skip | 6018 | (catch :skip |
| @@ -5923,7 +6028,7 @@ FRACTION is what fraction of the head-warning time has passed." | |||
| 5923 | (match-string 1) d1 'past show-all | 6028 | (match-string 1) d1 'past show-all |
| 5924 | (current-buffer) pos) | 6029 | (current-buffer) pos) |
| 5925 | diff (- d2 d1) | 6030 | diff (- d2 d1) |
| 5926 | warntime (org-entry-get (point) "APPT_WARNTIME")) | 6031 | warntime (get-text-property (point) 'org-appt-warntime)) |
| 5927 | (setq pastschedp (and todayp (< diff 0))) | 6032 | (setq pastschedp (and todayp (< diff 0))) |
| 5928 | (setq did-habit-check-p nil) | 6033 | (setq did-habit-check-p nil) |
| 5929 | ;; When to show a scheduled item in the calendar: | 6034 | ;; When to show a scheduled item in the calendar: |
| @@ -5969,7 +6074,14 @@ FRACTION is what fraction of the head-warning time has passed." | |||
| 5969 | pastschedp)) | 6074 | pastschedp)) |
| 5970 | (setq mm (assoc pos1 deadline-position-alist))) | 6075 | (setq mm (assoc pos1 deadline-position-alist))) |
| 5971 | (throw :skip nil))) | 6076 | (throw :skip nil))) |
| 5972 | (setq tags (org-get-tags-at)) | 6077 | (setq inherited-tags |
| 6078 | (or (eq org-agenda-show-inherited-tags 'always) | ||
| 6079 | (and (listp org-agenda-show-inherited-tags) | ||
| 6080 | (memq 'agenda org-agenda-show-inherited-tags)) | ||
| 6081 | (and (eq org-agenda-show-inherited-tags t) | ||
| 6082 | (or (eq org-agenda-use-tag-inheritance t) | ||
| 6083 | (memq 'agenda org-agenda-use-tag-inheritance)))) | ||
| 6084 | tags (org-get-tags-at nil (not inherited-tags))) | ||
| 5973 | (setq head (buffer-substring-no-properties | 6085 | (setq head (buffer-substring-no-properties |
| 5974 | (point) | 6086 | (point) |
| 5975 | (progn (skip-chars-forward "^\r\n") (point)))) | 6087 | (progn (skip-chars-forward "^\r\n") (point)))) |
| @@ -6024,7 +6136,7 @@ FRACTION is what fraction of the head-warning time has passed." | |||
| 6024 | (regexp org-tr-regexp) | 6136 | (regexp org-tr-regexp) |
| 6025 | (d0 (calendar-absolute-from-gregorian date)) | 6137 | (d0 (calendar-absolute-from-gregorian date)) |
| 6026 | marker hdmarker ee txt d1 d2 s1 s2 category category-pos | 6138 | marker hdmarker ee txt d1 d2 s1 s2 category category-pos |
| 6027 | todo-state tags pos head donep) | 6139 | todo-state tags pos head donep inherited-tags) |
| 6028 | (goto-char (point-min)) | 6140 | (goto-char (point-min)) |
| 6029 | (while (re-search-forward regexp nil t) | 6141 | (while (re-search-forward regexp nil t) |
| 6030 | (catch :skip | 6142 | (catch :skip |
| @@ -6050,8 +6162,15 @@ FRACTION is what fraction of the head-warning time has passed." | |||
| 6050 | (if (not (re-search-backward org-outline-regexp-bol nil t)) | 6162 | (if (not (re-search-backward org-outline-regexp-bol nil t)) |
| 6051 | (setq txt org-agenda-no-heading-message) | 6163 | (setq txt org-agenda-no-heading-message) |
| 6052 | (goto-char (match-beginning 0)) | 6164 | (goto-char (match-beginning 0)) |
| 6053 | (setq hdmarker (org-agenda-new-marker (point))) | 6165 | (setq hdmarker (org-agenda-new-marker (point)) |
| 6054 | (setq tags (org-get-tags-at)) | 6166 | inherited-tags |
| 6167 | (or (eq org-agenda-show-inherited-tags 'always) | ||
| 6168 | (and (listp org-agenda-show-inherited-tags) | ||
| 6169 | (memq 'agenda org-agenda-show-inherited-tags)) | ||
| 6170 | (and (eq org-agenda-show-inherited-tags t) | ||
| 6171 | (or (eq org-agenda-use-tag-inheritance t) | ||
| 6172 | (memq 'agenda org-agenda-use-tag-inheritance)))) | ||
| 6173 | tags (org-get-tags-at nil (not inherited-tags))) | ||
| 6055 | (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") | 6174 | (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") |
| 6056 | (setq head (match-string 1)) | 6175 | (setq head (match-string 1)) |
| 6057 | (let ((remove-re | 6176 | (let ((remove-re |
| @@ -6212,12 +6331,7 @@ Any match of REMOVE-RE will be removed from TXT." | |||
| 6212 | (match-string 2 txt)) | 6331 | (match-string 2 txt)) |
| 6213 | t t txt)))) | 6332 | t t txt)))) |
| 6214 | (when (derived-mode-p 'org-mode) | 6333 | (when (derived-mode-p 'org-mode) |
| 6215 | (setq effort | 6334 | (setq effort (ignore-errors (get-text-property 0 'org-effort txt))) |
| 6216 | (condition-case nil | ||
| 6217 | (org-get-effort | ||
| 6218 | (or (get-text-property 0 'org-hd-marker txt) | ||
| 6219 | (get-text-property 0 'org-marker txt))) | ||
| 6220 | (error nil))) | ||
| 6221 | (when effort | 6335 | (when effort |
| 6222 | (setq neffort (org-duration-string-to-minutes effort) | 6336 | (setq neffort (org-duration-string-to-minutes effort) |
| 6223 | effort (setq effort (concat "[" effort "]"))))) | 6337 | effort (setq effort (concat "[" effort "]"))))) |
| @@ -6735,7 +6849,8 @@ in the file. Otherwise, restriction will be to the current subtree." | |||
| 6735 | 6849 | ||
| 6736 | (defun org-agenda-check-type (error &rest types) | 6850 | (defun org-agenda-check-type (error &rest types) |
| 6737 | "Check if agenda buffer is of allowed type. | 6851 | "Check if agenda buffer is of allowed type. |
| 6738 | If ERROR is non-nil, throw an error, otherwise just return nil." | 6852 | If ERROR is non-nil, throw an error, otherwise just return nil. |
| 6853 | Allowed types are 'agenda 'timeline 'todo 'tags 'search." | ||
| 6739 | (if (not org-agenda-type) | 6854 | (if (not org-agenda-type) |
| 6740 | (error "No Org agenda currently displayed") | 6855 | (error "No Org agenda currently displayed") |
| 6741 | (if (memq org-agenda-type types) | 6856 | (if (memq org-agenda-type types) |
| @@ -7890,29 +8005,45 @@ If this information is not given, the function uses the tree at point." | |||
| 7890 | (unless no-update (org-agenda-redo)))) | 8005 | (unless no-update (org-agenda-redo)))) |
| 7891 | 8006 | ||
| 7892 | (defun org-agenda-open-link (&optional arg) | 8007 | (defun org-agenda-open-link (&optional arg) |
| 7893 | "Follow the link in the current line, if any. | 8008 | "Open the link(s) in the current entry, if any. |
| 7894 | This looks for a link in the displayed line in the agenda. It also looks | 8009 | This looks for a link in the displayed line in the agenda. |
| 7895 | at the text of the entry itself." | 8010 | It also looks at the text of the entry itself." |
| 7896 | (interactive "P") | 8011 | (interactive "P") |
| 7897 | (let* ((marker (or (org-get-at-bol 'org-hd-marker) | 8012 | (let* ((marker (or (org-get-at-bol 'org-hd-marker) |
| 7898 | (org-get-at-bol 'org-marker))) | 8013 | (org-get-at-bol 'org-marker))) |
| 7899 | (buffer (and marker (marker-buffer marker))) | 8014 | (buffer (and marker (marker-buffer marker))) |
| 7900 | (prefix (buffer-substring | 8015 | (prefix (buffer-substring |
| 7901 | (point-at-bol) (point-at-eol)))) | 8016 | (point-at-bol) (point-at-eol))) |
| 8017 | (lkall (org-offer-links-in-entry buffer marker arg prefix)) | ||
| 8018 | (lk (car lkall)) | ||
| 8019 | (lkend (cdr lkall)) | ||
| 8020 | trg) | ||
| 7902 | (cond | 8021 | (cond |
| 7903 | (buffer | 8022 | ((and buffer (stringp lk)) |
| 7904 | (with-current-buffer buffer | 8023 | (with-current-buffer buffer |
| 7905 | (save-excursion | 8024 | (setq trg (and (string-match org-bracket-link-regexp lk) |
| 7906 | (save-restriction | 8025 | (match-string 1 lk))) |
| 7907 | (widen) | 8026 | (if (or (not trg) (string-match org-any-link-re trg)) |
| 7908 | (goto-char marker) | 8027 | (save-excursion |
| 7909 | (org-offer-links-in-entry arg prefix))))) | 8028 | (save-restriction |
| 8029 | (widen) | ||
| 8030 | (goto-char marker) | ||
| 8031 | (when (search-forward lk nil lkend) | ||
| 8032 | (goto-char (match-beginning 0)) | ||
| 8033 | (org-open-at-point)))) | ||
| 8034 | ;; This is an internal link, widen the buffer | ||
| 8035 | (switch-to-buffer-other-window buffer) | ||
| 8036 | (widen) | ||
| 8037 | (goto-char marker) | ||
| 8038 | (when (search-forward lk nil lkend) | ||
| 8039 | (goto-char (match-beginning 0)) | ||
| 8040 | (org-open-at-point))))) | ||
| 7910 | ((or (org-in-regexp (concat "\\(" org-bracket-link-regexp "\\)")) | 8041 | ((or (org-in-regexp (concat "\\(" org-bracket-link-regexp "\\)")) |
| 7911 | (save-excursion | 8042 | (save-excursion |
| 7912 | (beginning-of-line 1) | 8043 | (beginning-of-line 1) |
| 7913 | (looking-at (concat ".*?\\(" org-bracket-link-regexp "\\)")))) | 8044 | (looking-at (concat ".*?\\(" org-bracket-link-regexp "\\)")))) |
| 7914 | (org-open-link-from-string (match-string 1))) | 8045 | (org-open-link-from-string (match-string 1))) |
| 7915 | (t (error "No link to open here"))))) | 8046 | (t (message "No link to open here"))))) |
| 7916 | 8047 | ||
| 7917 | (defun org-agenda-copy-local-variable (var) | 8048 | (defun org-agenda-copy-local-variable (var) |
| 7918 | "Get a variable from a referenced buffer and install it here." | 8049 | "Get a variable from a referenced buffer and install it here." |
| @@ -8313,35 +8444,37 @@ If FORCE-TAGS is non nil, the car of it returns the new tags." | |||
| 8313 | (interactive) | 8444 | (interactive) |
| 8314 | (org-agenda-priority 'down)) | 8445 | (org-agenda-priority 'down)) |
| 8315 | 8446 | ||
| 8316 | (defun org-agenda-priority (&optional force-direction show) | 8447 | (defun org-agenda-priority (&optional force-direction) |
| 8317 | "Set the priority of line at point, also in Org-mode file. | 8448 | "Set the priority of line at point, also in Org-mode file. |
| 8318 | This changes the line at point, all other lines in the agenda referring to | 8449 | This changes the line at point, all other lines in the agenda referring to |
| 8319 | the same tree node, and the headline of the tree node in the Org-mode file." | 8450 | the same tree node, and the headline of the tree node in the Org-mode file. |
| 8451 | Called with a universal prefix arg, show the priority instead of setting it." | ||
| 8320 | (interactive "P") | 8452 | (interactive "P") |
| 8321 | (if (equal force-direction '(4)) (setq show t)) | 8453 | (if (equal force-direction '(4)) |
| 8322 | (unless org-enable-priority-commands | 8454 | (org-show-priority) |
| 8323 | (error "Priority commands are disabled")) | 8455 | (unless org-enable-priority-commands |
| 8324 | (org-agenda-check-no-diary) | 8456 | (error "Priority commands are disabled")) |
| 8325 | (let* ((marker (or (org-get-at-bol 'org-marker) | 8457 | (org-agenda-check-no-diary) |
| 8326 | (org-agenda-error))) | 8458 | (let* ((marker (or (org-get-at-bol 'org-marker) |
| 8327 | (hdmarker (org-get-at-bol 'org-hd-marker)) | 8459 | (org-agenda-error))) |
| 8328 | (buffer (marker-buffer hdmarker)) | 8460 | (hdmarker (org-get-at-bol 'org-hd-marker)) |
| 8329 | (pos (marker-position hdmarker)) | 8461 | (buffer (marker-buffer hdmarker)) |
| 8330 | (inhibit-read-only t) | 8462 | (pos (marker-position hdmarker)) |
| 8331 | newhead) | 8463 | (inhibit-read-only t) |
| 8332 | (org-with-remote-undo buffer | 8464 | newhead) |
| 8333 | (with-current-buffer buffer | 8465 | (org-with-remote-undo buffer |
| 8334 | (widen) | 8466 | (with-current-buffer buffer |
| 8335 | (goto-char pos) | 8467 | (widen) |
| 8336 | (org-show-context 'agenda) | 8468 | (goto-char pos) |
| 8337 | (save-excursion | 8469 | (org-show-context 'agenda) |
| 8338 | (and (outline-next-heading) | 8470 | (save-excursion |
| 8339 | (org-flag-heading nil))) ; show the next heading | 8471 | (and (outline-next-heading) |
| 8340 | (funcall 'org-priority force-direction show) | 8472 | (org-flag-heading nil))) ; show the next heading |
| 8341 | (end-of-line 1) | 8473 | (funcall 'org-priority force-direction) |
| 8342 | (setq newhead (org-get-heading))) | 8474 | (end-of-line 1) |
| 8343 | (org-agenda-change-all-lines newhead hdmarker) | 8475 | (setq newhead (org-get-heading))) |
| 8344 | (beginning-of-line 1)))) | 8476 | (org-agenda-change-all-lines newhead hdmarker) |
| 8477 | (beginning-of-line 1))))) | ||
| 8345 | 8478 | ||
| 8346 | ;; FIXME: should fix the tags property of the agenda line. | 8479 | ;; FIXME: should fix the tags property of the agenda line. |
| 8347 | (defun org-agenda-set-tags (&optional tag onoff) | 8480 | (defun org-agenda-set-tags (&optional tag onoff) |
diff --git a/lisp/org/org-ascii.el b/lisp/org/org-ascii.el index cf3f2d14d1d..c5a4b3775e8 100644 --- a/lisp/org/org-ascii.el +++ b/lisp/org/org-ascii.el | |||
| @@ -131,7 +131,7 @@ utf8 Use all UTF-8 characters") | |||
| 131 | "Call `org-export-as-ascii` with output to a temporary buffer. | 131 | "Call `org-export-as-ascii` with output to a temporary buffer. |
| 132 | No file is created. The prefix ARG is passed through to `org-export-as-ascii'." | 132 | No file is created. The prefix ARG is passed through to `org-export-as-ascii'." |
| 133 | (interactive "P") | 133 | (interactive "P") |
| 134 | (org-export-as-ascii arg nil nil "*Org ASCII Export*") | 134 | (org-export-as-ascii arg nil "*Org ASCII Export*") |
| 135 | (when org-export-show-temporary-export-buffer | 135 | (when org-export-show-temporary-export-buffer |
| 136 | (switch-to-buffer-other-window "*Org ASCII Export*"))) | 136 | (switch-to-buffer-other-window "*Org ASCII Export*"))) |
| 137 | 137 | ||
| @@ -183,23 +183,19 @@ in a window. A non-interactive call will only return the buffer." | |||
| 183 | (goto-char end) | 183 | (goto-char end) |
| 184 | (set-mark (point)) ;; to activate the region | 184 | (set-mark (point)) ;; to activate the region |
| 185 | (goto-char beg) | 185 | (goto-char beg) |
| 186 | (setq rtn (org-export-as-ascii | 186 | (setq rtn (org-export-as-ascii nil ext-plist buffer body-only)) |
| 187 | nil nil ext-plist | ||
| 188 | buffer body-only)) | ||
| 189 | (if (fboundp 'deactivate-mark) (deactivate-mark)) | 187 | (if (fboundp 'deactivate-mark) (deactivate-mark)) |
| 190 | (if (and (org-called-interactively-p 'any) (bufferp rtn)) | 188 | (if (and (org-called-interactively-p 'any) (bufferp rtn)) |
| 191 | (switch-to-buffer-other-window rtn) | 189 | (switch-to-buffer-other-window rtn) |
| 192 | rtn))) | 190 | rtn))) |
| 193 | 191 | ||
| 194 | ;;;###autoload | 192 | ;;;###autoload |
| 195 | (defun org-export-as-ascii (arg &optional hidden ext-plist | 193 | (defun org-export-as-ascii (arg &optional ext-plist to-buffer body-only pub-dir) |
| 196 | to-buffer body-only pub-dir) | ||
| 197 | "Export the outline as a pretty ASCII file. | 194 | "Export the outline as a pretty ASCII file. |
| 198 | If there is an active region, export only the region. | 195 | If there is an active region, export only the region. |
| 199 | The prefix ARG specifies how many levels of the outline should become | 196 | The prefix ARG specifies how many levels of the outline should become |
| 200 | underlined headlines, default is 3. Lower levels will become bulleted | 197 | underlined headlines, default is 3. Lower levels will become bulleted |
| 201 | lists. When HIDDEN is non-nil, don't display the ASCII buffer. | 198 | lists. EXT-PLIST is a property list with external parameters overriding |
| 202 | EXT-PLIST is a property list with external parameters overriding | ||
| 203 | org-mode's default settings, but still inferior to file-local | 199 | org-mode's default settings, but still inferior to file-local |
| 204 | settings. When TO-BUFFER is non-nil, create a buffer with that | 200 | settings. When TO-BUFFER is non-nil, create a buffer with that |
| 205 | name and export to that buffer. If TO-BUFFER is the symbol | 201 | name and export to that buffer. If TO-BUFFER is the symbol |
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el index 366dced717c..8a271b8d055 100644 --- a/lisp/org/org-capture.el +++ b/lisp/org/org-capture.el | |||
| @@ -451,7 +451,7 @@ For example, if you have a capture template \"c\" and you want | |||
| 451 | this template to be accessible only from `message-mode' buffers, | 451 | this template to be accessible only from `message-mode' buffers, |
| 452 | use this: | 452 | use this: |
| 453 | 453 | ||
| 454 | '((\"c\" (in-mode . \"message-mode\"))) | 454 | '((\"c\" ((in-mode . \"message-mode\")))) |
| 455 | 455 | ||
| 456 | Here are the available contexts definitions: | 456 | Here are the available contexts definitions: |
| 457 | 457 | ||
| @@ -467,11 +467,11 @@ accessible if there is at least one valid check. | |||
| 467 | You can also bind a key to another agenda custom command | 467 | You can also bind a key to another agenda custom command |
| 468 | depending on contextual rules. | 468 | depending on contextual rules. |
| 469 | 469 | ||
| 470 | '((\"c\" \"d\" (in-mode . \"message-mode\"))) | 470 | '((\"c\" \"d\" ((in-mode . \"message-mode\")))) |
| 471 | 471 | ||
| 472 | Here it means: in `message-mode buffers', use \"d\" as the | 472 | Here it means: in `message-mode buffers', use \"c\" as the |
| 473 | key for the capture template otherwise associated with \"d\". | 473 | key for the capture template otherwise associated with \"d\". |
| 474 | \(The template originally associated with \"q\" is not displayed | 474 | \(The template originally associated with \"d\" is not displayed |
| 475 | to avoid duplicates.)" | 475 | to avoid duplicates.)" |
| 476 | :version "24.3" | 476 | :version "24.3" |
| 477 | :group 'org-capture | 477 | :group 'org-capture |
| @@ -979,7 +979,7 @@ it. When it is a variable, retrieve the value. Return whatever we get." | |||
| 979 | (show-all) | 979 | (show-all) |
| 980 | (goto-char (org-capture-get :pos)) | 980 | (goto-char (org-capture-get :pos)) |
| 981 | (org-set-local 'org-capture-target-marker | 981 | (org-set-local 'org-capture-target-marker |
| 982 | (move-marker (make-marker) (point))) | 982 | (point-marker)) |
| 983 | (org-set-local 'outline-level 'org-outline-level) | 983 | (org-set-local 'outline-level 'org-outline-level) |
| 984 | (let* ((template (org-capture-get :template)) | 984 | (let* ((template (org-capture-get :template)) |
| 985 | (type (org-capture-get :type))) | 985 | (type (org-capture-get :type))) |
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index 9ff0ff3e6de..c043dd19e11 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | (declare-function calendar-absolute-from-iso "cal-iso" (&optional date)) | 35 | (declare-function calendar-absolute-from-iso "cal-iso" (&optional date)) |
| 36 | (declare-function notifications-notify "notifications" (&rest params)) | 36 | (declare-function notifications-notify "notifications" (&rest params)) |
| 37 | (declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label)) | 37 | (declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label)) |
| 38 | (declare-function org-refresh-properties "org" (dprop tprop)) | ||
| 38 | (defvar org-time-stamp-formats) | 39 | (defvar org-time-stamp-formats) |
| 39 | (defvar org-ts-what) | 40 | (defvar org-ts-what) |
| 40 | (defvar org-frame-title-format-backup frame-title-format) | 41 | (defvar org-frame-title-format-backup frame-title-format) |
| @@ -159,12 +160,15 @@ the clock can be resumed from that point." | |||
| 159 | The clock is resumed when Emacs restarts. | 160 | The clock is resumed when Emacs restarts. |
| 160 | When this is t, both the running clock, and the entire clock | 161 | When this is t, both the running clock, and the entire clock |
| 161 | history are saved. When this is the symbol `clock', only the | 162 | history are saved. When this is the symbol `clock', only the |
| 162 | running clock is saved. | 163 | running clock is saved. When this is the symbol `history', only |
| 164 | the clock history is saved. | ||
| 163 | 165 | ||
| 164 | When Emacs restarts with saved clock information, the file containing the | 166 | When Emacs restarts with saved clock information, the file containing |
| 165 | running clock as well as all files mentioned in the clock history will | 167 | the running clock as well as all files mentioned in the clock history |
| 166 | be visited. | 168 | will be visited. |
| 167 | All this depends on running `org-clock-persistence-insinuate' in .emacs" | 169 | |
| 170 | All this depends on running `org-clock-persistence-insinuate' in your | ||
| 171 | Emacs initialization file." | ||
| 168 | :group 'org-clock | 172 | :group 'org-clock |
| 169 | :type '(choice | 173 | :type '(choice |
| 170 | (const :tag "Just the running clock" clock) | 174 | (const :tag "Just the running clock" clock) |
| @@ -1078,6 +1082,7 @@ time as the start time \(see `org-clock-continuously' to | |||
| 1078 | make this the default behavior.)" | 1082 | make this the default behavior.)" |
| 1079 | (interactive "P") | 1083 | (interactive "P") |
| 1080 | (setq org-clock-notification-was-shown nil) | 1084 | (setq org-clock-notification-was-shown nil) |
| 1085 | (org-refresh-properties org-effort-property 'org-effort) | ||
| 1081 | (catch 'abort | 1086 | (catch 'abort |
| 1082 | (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness) | 1087 | (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness) |
| 1083 | (org-clocking-p))) | 1088 | (org-clocking-p))) |
| @@ -1199,7 +1204,7 @@ make this the default behavior.)" | |||
| 1199 | (setq org-clock-start-time | 1204 | (setq org-clock-start-time |
| 1200 | (apply 'encode-time | 1205 | (apply 'encode-time |
| 1201 | (org-parse-time-string (match-string 1)))) | 1206 | (org-parse-time-string (match-string 1)))) |
| 1202 | (setq org-clock-effort (org-get-effort)) | 1207 | (setq org-clock-effort (get-text-property (point) 'org-effort)) |
| 1203 | (setq org-clock-total-time (org-clock-sum-current-item | 1208 | (setq org-clock-total-time (org-clock-sum-current-item |
| 1204 | (org-clock-get-sum-start)))) | 1209 | (org-clock-get-sum-start)))) |
| 1205 | ((eq org-clock-in-resume 'auto-restart) | 1210 | ((eq org-clock-in-resume 'auto-restart) |
| @@ -1219,7 +1224,7 @@ make this the default behavior.)" | |||
| 1219 | (beginning-of-line 1) | 1224 | (beginning-of-line 1) |
| 1220 | (org-indent-line-to (- (org-get-indentation) 2))) | 1225 | (org-indent-line-to (- (org-get-indentation) 2))) |
| 1221 | (insert org-clock-string " ") | 1226 | (insert org-clock-string " ") |
| 1222 | (setq org-clock-effort (org-get-effort)) | 1227 | (setq org-clock-effort (get-text-property (point) 'org-effort)) |
| 1223 | (setq org-clock-total-time (org-clock-sum-current-item | 1228 | (setq org-clock-total-time (org-clock-sum-current-item |
| 1224 | (org-clock-get-sum-start))) | 1229 | (org-clock-get-sum-start))) |
| 1225 | (setq org-clock-start-time | 1230 | (setq org-clock-start-time |
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el index 30adf6a3f72..5a59196baa1 100644 --- a/lisp/org/org-colview.el +++ b/lisp/org/org-colview.el | |||
| @@ -1243,7 +1243,7 @@ PARAMS is a property list of parameters: | |||
| 1243 | :skip-empty-rows | 1243 | :skip-empty-rows |
| 1244 | When t, skip rows where all specifiers other than ITEM are empty. | 1244 | When t, skip rows where all specifiers other than ITEM are empty. |
| 1245 | :format When non-nil, specify the column view format to use." | 1245 | :format When non-nil, specify the column view format to use." |
| 1246 | (let ((pos (move-marker (make-marker) (point))) | 1246 | (let ((pos (point-marker)) |
| 1247 | (hlines (plist-get params :hlines)) | 1247 | (hlines (plist-get params :hlines)) |
| 1248 | (vlines (plist-get params :vlines)) | 1248 | (vlines (plist-get params :vlines)) |
| 1249 | (maxlevel (plist-get params :maxlevel)) | 1249 | (maxlevel (plist-get params :maxlevel)) |
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index bc13fa2c737..9292b994367 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el | |||
| @@ -195,9 +195,8 @@ passed through to `fit-window-to-buffer'. If SHRINK-ONLY is set, call | |||
| 195 | ignored in this case." | 195 | ignored in this case." |
| 196 | (cond ((if (fboundp 'window-full-width-p) | 196 | (cond ((if (fboundp 'window-full-width-p) |
| 197 | (not (window-full-width-p window)) | 197 | (not (window-full-width-p window)) |
| 198 | (> (frame-width) (window-width window))) | 198 | ;; do nothing if another window would suffer |
| 199 | ;; do nothing if another window would suffer | 199 | (> (frame-width) (window-width window)))) |
| 200 | ) | ||
| 201 | ((and (fboundp 'fit-window-to-buffer) (not shrink-only)) | 200 | ((and (fboundp 'fit-window-to-buffer) (not shrink-only)) |
| 202 | (fit-window-to-buffer window max-height min-height)) | 201 | (fit-window-to-buffer window max-height min-height)) |
| 203 | ((fboundp 'shrink-window-if-larger-than-buffer) | 202 | ((fboundp 'shrink-window-if-larger-than-buffer) |
| @@ -257,7 +256,6 @@ Works on both Emacs and XEmacs." | |||
| 257 | (when (boundp 'zmacs-regions) | 256 | (when (boundp 'zmacs-regions) |
| 258 | (setq zmacs-regions t))))) | 257 | (setq zmacs-regions t))))) |
| 259 | 258 | ||
| 260 | |||
| 261 | ;; Invisibility compatibility | 259 | ;; Invisibility compatibility |
| 262 | 260 | ||
| 263 | (defun org-remove-from-invisibility-spec (arg) | 261 | (defun org-remove-from-invisibility-spec (arg) |
| @@ -372,6 +370,20 @@ TIME defaults to the current time." | |||
| 372 | (time-to-seconds (or time (current-time))) | 370 | (time-to-seconds (or time (current-time))) |
| 373 | (float-time time))) | 371 | (float-time time))) |
| 374 | 372 | ||
| 373 | ;; `user-error' is only available from 24.2.50 on | ||
| 374 | (unless (fboundp 'user-error) | ||
| 375 | (defalias 'user-error 'error)) | ||
| 376 | |||
| 377 | (defmacro org-no-popups (&rest body) | ||
| 378 | "Suppress popup windows. | ||
| 379 | Let-bind some variables to nil around BODY to achieve the desired | ||
| 380 | effect, which variables to use depends on the Emacs version." | ||
| 381 | (if (org-version-check "24.2.50" "" :predicate) | ||
| 382 | `(let (pop-up-frames display-buffer-alist) | ||
| 383 | ,@body) | ||
| 384 | `(let (pop-up-frames special-display-buffer-names special-display-regexps special-display-function) | ||
| 385 | ,@body))) | ||
| 386 | |||
| 375 | (if (fboundp 'string-match-p) | 387 | (if (fboundp 'string-match-p) |
| 376 | (defalias 'org-string-match-p 'string-match-p) | 388 | (defalias 'org-string-match-p 'string-match-p) |
| 377 | (defun org-string-match-p (regexp string &optional start) | 389 | (defun org-string-match-p (regexp string &optional start) |
| @@ -384,7 +396,7 @@ TIME defaults to the current time." | |||
| 384 | (save-match-data | 396 | (save-match-data |
| 385 | (apply 'looking-at args)))) | 397 | (apply 'looking-at args)))) |
| 386 | 398 | ||
| 387 | ; XEmacs does not have `looking-back'. | 399 | ;; XEmacs does not have `looking-back'. |
| 388 | (if (fboundp 'looking-back) | 400 | (if (fboundp 'looking-back) |
| 389 | (defalias 'org-looking-back 'looking-back) | 401 | (defalias 'org-looking-back 'looking-back) |
| 390 | (defun org-looking-back (regexp &optional limit greedy) | 402 | (defun org-looking-back (regexp &optional limit greedy) |
| @@ -433,14 +445,26 @@ With two arguments, return floor and remainder of their quotient." | |||
| 433 | 'pop-to-buffer-same-window buffer-or-name norecord) | 445 | 'pop-to-buffer-same-window buffer-or-name norecord) |
| 434 | (funcall 'switch-to-buffer buffer-or-name norecord))) | 446 | (funcall 'switch-to-buffer buffer-or-name norecord))) |
| 435 | 447 | ||
| 436 | ;; `condition-case-unless-debug' has been introduced in Emacs 24.1 | 448 | ;; RECURSIVE has been introduced with Emacs 23.2. |
| 437 | ;; `condition-case-no-debug' has been introduced in Emacs 23.1 | 449 | ;; This is copying and adapted from `tramp-compat-delete-directory' |
| 438 | (defalias 'org-condition-case-unless-debug | 450 | (defun org-delete-directory (directory &optional recursive) |
| 439 | (or (and (fboundp 'condition-case-unless-debug) | 451 | "Compatibility function for `delete-directory'." |
| 440 | 'condition-case-unless-debug) | 452 | (if (null recursive) |
| 441 | (and (fboundp 'condition-case-no-debug) | 453 | (delete-directory directory) |
| 442 | 'condition-case-no-debug) | 454 | (condition-case nil |
| 443 | 'condition-case)) | 455 | (funcall 'delete-directory directory recursive) |
| 456 | ;; This Emacs version does not support the RECURSIVE flag. We | ||
| 457 | ;; use the implementation from Emacs 23.2. | ||
| 458 | (wrong-number-of-arguments | ||
| 459 | (setq directory (directory-file-name (expand-file-name directory))) | ||
| 460 | (if (not (file-symlink-p directory)) | ||
| 461 | (mapc (lambda (file) | ||
| 462 | (if (eq t (car (file-attributes file))) | ||
| 463 | (org-delete-directory file recursive) | ||
| 464 | (delete-file file))) | ||
| 465 | (directory-files | ||
| 466 | directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))) | ||
| 467 | (delete-directory directory))))) | ||
| 444 | 468 | ||
| 445 | ;;;###autoload | 469 | ;;;###autoload |
| 446 | (defmacro org-check-version () | 470 | (defmacro org-check-version () |
diff --git a/lisp/org/org-crypt.el b/lisp/org/org-crypt.el index fdfd1d326da..2dfc4addcc2 100644 --- a/lisp/org/org-crypt.el +++ b/lisp/org/org-crypt.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; org-crypt.el --- Public key encryption for org-mode entries | 1 | ;;; org-crypt.el --- Public key encryption for org-mode entries |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2007-2013 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Emacs Lisp Archive Entry | 5 | ;; Emacs Lisp Archive Entry |
| 6 | ;; Filename: org-crypt.el | 6 | ;; Filename: org-crypt.el |
| @@ -258,7 +258,7 @@ See `org-crypt-disable-auto-save'." | |||
| 258 | (save-excursion | 258 | (save-excursion |
| 259 | (org-back-to-heading t) | 259 | (org-back-to-heading t) |
| 260 | (search-forward "-----BEGIN PGP MESSAGE-----" | 260 | (search-forward "-----BEGIN PGP MESSAGE-----" |
| 261 | (save-excursion (org-end-of-subtree t)) t)))) | 261 | (save-excursion (outline-next-heading)) t)))) |
| 262 | 262 | ||
| 263 | (defun org-crypt-use-before-save-magic () | 263 | (defun org-crypt-use-before-save-magic () |
| 264 | "Add a hook to automatically encrypt entries before a file is saved to disk." | 264 | "Add a hook to automatically encrypt entries before a file is saved to disk." |
diff --git a/lisp/org/org-docbook.el b/lisp/org/org-docbook.el index ba03e3160b1..5253d9100a5 100644 --- a/lisp/org/org-docbook.el +++ b/lisp/org/org-docbook.el | |||
| @@ -274,14 +274,14 @@ For example: | |||
| 274 | $ emacs --batch | 274 | $ emacs --batch |
| 275 | --load=$HOME/lib/emacs/org.el | 275 | --load=$HOME/lib/emacs/org.el |
| 276 | --visit=MyOrgFile.org --funcall org-export-as-docbook-batch" | 276 | --visit=MyOrgFile.org --funcall org-export-as-docbook-batch" |
| 277 | (org-export-as-docbook 'hidden)) | 277 | (org-export-as-docbook)) |
| 278 | 278 | ||
| 279 | ;;;###autoload | 279 | ;;;###autoload |
| 280 | (defun org-export-as-docbook-to-buffer () | 280 | (defun org-export-as-docbook-to-buffer () |
| 281 | "Call `org-export-as-docbook' with output to a temporary buffer. | 281 | "Call `org-export-as-docbook' with output to a temporary buffer. |
| 282 | No file is created." | 282 | No file is created." |
| 283 | (interactive) | 283 | (interactive) |
| 284 | (org-export-as-docbook nil nil "*Org DocBook Export*") | 284 | (org-export-as-docbook nil "*Org DocBook Export*") |
| 285 | (when org-export-show-temporary-export-buffer | 285 | (when org-export-show-temporary-export-buffer |
| 286 | (switch-to-buffer-other-window "*Org DocBook Export*"))) | 286 | (switch-to-buffer-other-window "*Org DocBook Export*"))) |
| 287 | 287 | ||
| @@ -334,17 +334,14 @@ in a window. A non-interactive call will only return the buffer." | |||
| 334 | (goto-char end) | 334 | (goto-char end) |
| 335 | (set-mark (point)) ;; To activate the region | 335 | (set-mark (point)) ;; To activate the region |
| 336 | (goto-char beg) | 336 | (goto-char beg) |
| 337 | (setq rtn (org-export-as-docbook | 337 | (setq rtn (org-export-as-docbook nil buffer body-only)) |
| 338 | nil nil | ||
| 339 | buffer body-only)) | ||
| 340 | (if (fboundp 'deactivate-mark) (deactivate-mark)) | 338 | (if (fboundp 'deactivate-mark) (deactivate-mark)) |
| 341 | (if (and (org-called-interactively-p 'any) (bufferp rtn)) | 339 | (if (and (org-called-interactively-p 'any) (bufferp rtn)) |
| 342 | (switch-to-buffer-other-window rtn) | 340 | (switch-to-buffer-other-window rtn) |
| 343 | rtn))) | 341 | rtn))) |
| 344 | 342 | ||
| 345 | ;;;###autoload | 343 | ;;;###autoload |
| 346 | (defun org-export-as-docbook-pdf (&optional hidden ext-plist | 344 | (defun org-export-as-docbook-pdf (&optional ext-plist to-buffer body-only pub-dir) |
| 347 | to-buffer body-only pub-dir) | ||
| 348 | "Export as DocBook XML file, and generate PDF file." | 345 | "Export as DocBook XML file, and generate PDF file." |
| 349 | (interactive "P") | 346 | (interactive "P") |
| 350 | (if (or (not org-export-docbook-xslt-proc-command) | 347 | (if (or (not org-export-docbook-xslt-proc-command) |
| @@ -360,8 +357,7 @@ in a window. A non-interactive call will only return the buffer." | |||
| 360 | (org-combine-plists (org-default-export-plist) | 357 | (org-combine-plists (org-default-export-plist) |
| 361 | ext-plist | 358 | ext-plist |
| 362 | (org-infile-export-plist)))) | 359 | (org-infile-export-plist)))) |
| 363 | (docbook-buf (org-export-as-docbook hidden ext-plist | 360 | (docbook-buf (org-export-as-docbook ext-plist to-buffer body-only pub-dir)) |
| 364 | to-buffer body-only pub-dir)) | ||
| 365 | (filename (buffer-file-name docbook-buf)) | 361 | (filename (buffer-file-name docbook-buf)) |
| 366 | (base (file-name-sans-extension filename)) | 362 | (base (file-name-sans-extension filename)) |
| 367 | (fofile (concat base ".fo")) | 363 | (fofile (concat base ".fo")) |
| @@ -398,8 +394,7 @@ in a window. A non-interactive call will only return the buffer." | |||
| 398 | (defvar org-heading-keyword-regexp-format) ; defined in org.el | 394 | (defvar org-heading-keyword-regexp-format) ; defined in org.el |
| 399 | 395 | ||
| 400 | ;;;###autoload | 396 | ;;;###autoload |
| 401 | (defun org-export-as-docbook (&optional hidden ext-plist | 397 | (defun org-export-as-docbook (&optional ext-plist to-buffer body-only pub-dir) |
| 402 | to-buffer body-only pub-dir) | ||
| 403 | "Export the current buffer as a DocBook file. | 398 | "Export the current buffer as a DocBook file. |
| 404 | If there is an active region, export only the region. When | 399 | If there is an active region, export only the region. When |
| 405 | HIDDEN is obsolete and does nothing. EXT-PLIST is a | 400 | HIDDEN is obsolete and does nothing. EXT-PLIST is a |
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index 6b2a83de8bd..c8096aa3963 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el | |||
| @@ -3808,7 +3808,8 @@ Elements are accumulated into ACC." | |||
| 3808 | 'section)) | 3808 | 'section)) |
| 3809 | (plain-list 'item) | 3809 | (plain-list 'item) |
| 3810 | (table 'table-row)) | 3810 | (table 'table-row)) |
| 3811 | (org-element-property :structure element) | 3811 | (and (memq type '(item plain-list)) |
| 3812 | (org-element-property :structure element)) | ||
| 3812 | granularity visible-only element)) | 3813 | granularity visible-only element)) |
| 3813 | ;; ELEMENT has contents. Parse objects inside, if | 3814 | ;; ELEMENT has contents. Parse objects inside, if |
| 3814 | ;; GRANULARITY allows it. | 3815 | ;; GRANULARITY allows it. |
| @@ -4249,8 +4250,11 @@ first element of current section." | |||
| 4249 | (plain-list | 4250 | (plain-list |
| 4250 | (setq special-flag 'item | 4251 | (setq special-flag 'item |
| 4251 | struct (org-element-property :structure element))) | 4252 | struct (org-element-property :structure element))) |
| 4252 | (table (setq special-flag 'table-row)) | 4253 | (item (setq special-flag nil)) |
| 4253 | (otherwise (setq special-flag nil))) | 4254 | (property-drawer |
| 4255 | (setq special-flag 'node-property struct nil)) | ||
| 4256 | (table (setq special-flag 'table-row struct nil)) | ||
| 4257 | (otherwise (setq special-flag nil struct nil))) | ||
| 4254 | (setq end cend) | 4258 | (setq end cend) |
| 4255 | (goto-char cbeg))))))))))) | 4259 | (goto-char cbeg))))))))))) |
| 4256 | 4260 | ||
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el index 1cf4cb5e054..82b9003e4fd 100644 --- a/lisp/org/org-exp.el +++ b/lisp/org/org-exp.el | |||
| @@ -3047,12 +3047,11 @@ to the value of `temporary-file-directory'." | |||
| 3047 | (eval ;; convert to fmt -- mimicking `org-run-like-in-org-mode' | 3047 | (eval ;; convert to fmt -- mimicking `org-run-like-in-org-mode' |
| 3048 | (list 'let org-local-vars | 3048 | (list 'let org-local-vars |
| 3049 | (list (intern (format "org-export-as-%s" fmt)) | 3049 | (list (intern (format "org-export-as-%s" fmt)) |
| 3050 | nil nil nil ''string t)))) | 3050 | nil nil ''string t dir)))) |
| 3051 | (delete-file tmp-file)))) | 3051 | (delete-file tmp-file)))) |
| 3052 | 3052 | ||
| 3053 | ;;;###autoload | 3053 | ;;;###autoload |
| 3054 | (defun org-export-as-org (arg &optional hidden ext-plist | 3054 | (defun org-export-as-org (arg &optional ext-plist to-buffer body-only pub-dir) |
| 3055 | to-buffer body-only pub-dir) | ||
| 3056 | "Make a copy with not-exporting stuff removed. | 3055 | "Make a copy with not-exporting stuff removed. |
| 3057 | The purpose of this function is to provide a way to export the source | 3056 | The purpose of this function is to provide a way to export the source |
| 3058 | Org file of a webpage in Org format, but with sensitive and/or irrelevant | 3057 | Org file of a webpage in Org format, but with sensitive and/or irrelevant |
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el index 80e81349f6a..606db0814c2 100644 --- a/lisp/org/org-faces.el +++ b/lisp/org/org-faces.el | |||
| @@ -44,6 +44,9 @@ | |||
| 44 | (set-face-doc-string new-face docstring))))) | 44 | (set-face-doc-string new-face docstring))))) |
| 45 | (put 'org-copy-face 'lisp-indent-function 2) | 45 | (put 'org-copy-face 'lisp-indent-function 2) |
| 46 | 46 | ||
| 47 | (when (featurep 'xemacs) | ||
| 48 | (put 'mode-line 'face-alias 'modeline)) | ||
| 49 | |||
| 47 | (defgroup org-faces nil | 50 | (defgroup org-faces nil |
| 48 | "Faces in Org-mode." | 51 | "Faces in Org-mode." |
| 49 | :tag "Org Faces" | 52 | :tag "Org Faces" |
diff --git a/lisp/org/org-html.el b/lisp/org/org-html.el index 91df2ebcc4e..493d8a28afb 100644 --- a/lisp/org/org-html.el +++ b/lisp/org/org-html.el | |||
| @@ -328,7 +328,7 @@ You can also customize this for each buffer, using something like | |||
| 328 | * @licstart The following is the entire license notice for the | 328 | * @licstart The following is the entire license notice for the |
| 329 | * JavaScript code in %PATH. | 329 | * JavaScript code in %PATH. |
| 330 | * | 330 | * |
| 331 | * Copyright (C) 2012 MathJax | 331 | * Copyright (C) 2012-2013 MathJax |
| 332 | * | 332 | * |
| 333 | * Licensed under the Apache License, Version 2.0 (the \"License\"); | 333 | * Licensed under the Apache License, Version 2.0 (the \"License\"); |
| 334 | * you may not use this file except in compliance with the License. | 334 | * you may not use this file except in compliance with the License. |
| @@ -793,7 +793,7 @@ If there is an active region, export only the region. | |||
| 793 | The prefix ARG specifies how many levels of the outline should become | 793 | The prefix ARG specifies how many levels of the outline should become |
| 794 | headlines. The default is 3. Lower levels will become bulleted lists." | 794 | headlines. The default is 3. Lower levels will become bulleted lists." |
| 795 | (interactive "P") | 795 | (interactive "P") |
| 796 | (org-export-as-html arg 'hidden) | 796 | (org-export-as-html arg) |
| 797 | (org-open-file buffer-file-name) | 797 | (org-open-file buffer-file-name) |
| 798 | (when org-export-kill-product-buffer-when-displayed | 798 | (when org-export-kill-product-buffer-when-displayed |
| 799 | (kill-buffer (current-buffer)))) | 799 | (kill-buffer (current-buffer)))) |
| @@ -806,14 +806,14 @@ emacs --batch | |||
| 806 | --load=$HOME/lib/emacs/org.el | 806 | --load=$HOME/lib/emacs/org.el |
| 807 | --eval \"(setq org-export-headline-levels 2)\" | 807 | --eval \"(setq org-export-headline-levels 2)\" |
| 808 | --visit=MyFile --funcall org-export-as-html-batch" | 808 | --visit=MyFile --funcall org-export-as-html-batch" |
| 809 | (org-export-as-html org-export-headline-levels 'hidden)) | 809 | (org-export-as-html org-export-headline-levels)) |
| 810 | 810 | ||
| 811 | ;;;###autoload | 811 | ;;;###autoload |
| 812 | (defun org-export-as-html-to-buffer (arg) | 812 | (defun org-export-as-html-to-buffer (arg) |
| 813 | "Call `org-export-as-html` with output to a temporary buffer. | 813 | "Call `org-export-as-html` with output to a temporary buffer. |
| 814 | No file is created. The prefix ARG is passed through to `org-export-as-html'." | 814 | No file is created. The prefix ARG is passed through to `org-export-as-html'." |
| 815 | (interactive "P") | 815 | (interactive "P") |
| 816 | (org-export-as-html arg nil nil "*Org HTML Export*") | 816 | (org-export-as-html arg nil "*Org HTML Export*") |
| 817 | (when org-export-show-temporary-export-buffer | 817 | (when org-export-show-temporary-export-buffer |
| 818 | (switch-to-buffer-other-window "*Org HTML Export*"))) | 818 | (switch-to-buffer-other-window "*Org HTML Export*"))) |
| 819 | 819 | ||
| @@ -865,9 +865,7 @@ in a window. A non-interactive call will only return the buffer." | |||
| 865 | (goto-char end) | 865 | (goto-char end) |
| 866 | (set-mark (point)) ;; to activate the region | 866 | (set-mark (point)) ;; to activate the region |
| 867 | (goto-char beg) | 867 | (goto-char beg) |
| 868 | (setq rtn (org-export-as-html | 868 | (setq rtn (org-export-as-html nil ext-plist buffer body-only)) |
| 869 | nil nil ext-plist | ||
| 870 | buffer body-only)) | ||
| 871 | (if (fboundp 'deactivate-mark) (deactivate-mark)) | 869 | (if (fboundp 'deactivate-mark) (deactivate-mark)) |
| 872 | (if (and (org-called-interactively-p 'any) (bufferp rtn)) | 870 | (if (and (org-called-interactively-p 'any) (bufferp rtn)) |
| 873 | (switch-to-buffer-other-window rtn) | 871 | (switch-to-buffer-other-window rtn) |
| @@ -1171,14 +1169,12 @@ OPT-PLIST is the export options list." | |||
| 1171 | (defvar org-heading-keyword-regexp-format) ; defined in org.el | 1169 | (defvar org-heading-keyword-regexp-format) ; defined in org.el |
| 1172 | 1170 | ||
| 1173 | ;;;###autoload | 1171 | ;;;###autoload |
| 1174 | (defun org-export-as-html (arg &optional hidden ext-plist | 1172 | (defun org-export-as-html (arg &optional ext-plist to-buffer body-only pub-dir) |
| 1175 | to-buffer body-only pub-dir) | ||
| 1176 | "Export the outline as a pretty HTML file. | 1173 | "Export the outline as a pretty HTML file. |
| 1177 | If there is an active region, export only the region. The prefix | 1174 | If there is an active region, export only the region. The prefix |
| 1178 | ARG specifies how many levels of the outline should become | 1175 | ARG specifies how many levels of the outline should become |
| 1179 | headlines. The default is 3. Lower levels will become bulleted | 1176 | headlines. The default is 3. Lower levels will become bulleted |
| 1180 | lists. HIDDEN is obsolete and does nothing. | 1177 | lists. EXT-PLIST is a property list with external parameters overriding |
| 1181 | EXT-PLIST is a property list with external parameters overriding | ||
| 1182 | org-mode's default settings, but still inferior to file-local | 1178 | org-mode's default settings, but still inferior to file-local |
| 1183 | settings. When TO-BUFFER is non-nil, create a buffer with that | 1179 | settings. When TO-BUFFER is non-nil, create a buffer with that |
| 1184 | name and export to that buffer. If TO-BUFFER is the symbol | 1180 | name and export to that buffer. If TO-BUFFER is the symbol |
diff --git a/lisp/org/org-icalendar.el b/lisp/org/org-icalendar.el index f13f46d68b9..12cd0584fa0 100644 --- a/lisp/org/org-icalendar.el +++ b/lisp/org/org-icalendar.el | |||
| @@ -327,6 +327,7 @@ When COMBINE is non nil, add the category to each line." | |||
| 327 | tmp pri categories location summary desc uid alarm alarm-time | 327 | tmp pri categories location summary desc uid alarm alarm-time |
| 328 | (sexp-buffer (get-buffer-create "*ical-tmp*"))) | 328 | (sexp-buffer (get-buffer-create "*ical-tmp*"))) |
| 329 | (org-refresh-category-properties) | 329 | (org-refresh-category-properties) |
| 330 | (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime) | ||
| 330 | (save-excursion | 331 | (save-excursion |
| 331 | (goto-char (point-min)) | 332 | (goto-char (point-min)) |
| 332 | (while (re-search-forward re1 nil t) | 333 | (while (re-search-forward re1 nil t) |
| @@ -357,7 +358,7 @@ When COMBINE is non nil, add the category to each line." | |||
| 357 | (org-id-get-create) | 358 | (org-id-get-create) |
| 358 | (or (org-id-get) (org-id-new))) | 359 | (or (org-id-get) (org-id-new))) |
| 359 | categories (org-export-get-categories) | 360 | categories (org-export-get-categories) |
| 360 | alarm-time (org-entry-get nil "APPT_WARNTIME") | 361 | alarm-time (get-text-property (point) 'org-appt-warntime) |
| 361 | alarm-time (if alarm-time (string-to-number alarm-time) 0) | 362 | alarm-time (if alarm-time (string-to-number alarm-time) 0) |
| 362 | alarm "" | 363 | alarm "" |
| 363 | deadlinep nil scheduledp nil) | 364 | deadlinep nil scheduledp nil) |
| @@ -676,7 +677,7 @@ a time), or the day by one (if it does not contain a time)." | |||
| 676 | (setq fmt (if have-time | 677 | (setq fmt (if have-time |
| 677 | (replace-regexp-in-string "%Z" | 678 | (replace-regexp-in-string "%Z" |
| 678 | org-icalendar-timezone | 679 | org-icalendar-timezone |
| 679 | org-icalendar-date-time-format) | 680 | org-icalendar-date-time-format t) |
| 680 | ";VALUE=DATE:%Y%m%d")) | 681 | ";VALUE=DATE:%Y%m%d")) |
| 681 | (concat keyword (format-time-string fmt time | 682 | (concat keyword (format-time-string fmt time |
| 682 | (and (org-icalendar-use-UTC-date-timep) | 683 | (and (org-icalendar-use-UTC-date-timep) |
diff --git a/lisp/org/org-inlinetask.el b/lisp/org/org-inlinetask.el index 3748d392b38..43913acacde 100644 --- a/lisp/org/org-inlinetask.el +++ b/lisp/org/org-inlinetask.el | |||
| @@ -75,6 +75,9 @@ | |||
| 75 | ;; Also, if you want to use refiling and archiving for inline tasks, | 75 | ;; Also, if you want to use refiling and archiving for inline tasks, |
| 76 | ;; The END line must be present to make things work properly. | 76 | ;; The END line must be present to make things work properly. |
| 77 | ;; | 77 | ;; |
| 78 | ;; Note that you should not try to use inline tasks within plain list, | ||
| 79 | ;; visibility cycling is known to be problematic when doing so. | ||
| 80 | ;; | ||
| 78 | ;; This package installs one new command: | 81 | ;; This package installs one new command: |
| 79 | ;; | 82 | ;; |
| 80 | ;; C-c C-x t Insert a new inline task with END line | 83 | ;; C-c C-x t Insert a new inline task with END line |
diff --git a/lisp/org/org-install.el b/lisp/org/org-install.el index a31d8b79209..aca019fb823 100644 --- a/lisp/org/org-install.el +++ b/lisp/org/org-install.el | |||
| @@ -1,8 +1,10 @@ | |||
| 1 | ;;; org-install.el --- autogenerated file, do not edit | 1 | ;;; org-install.el --- backward compatibility file for obsolete configuration |
| 2 | ;; | 2 | ;; |
| 3 | ;;; Code: | 3 | ;;; Code: |
| 4 | (warn "The file org-install is obsolete. | 4 | (warn "The file org-install is obsolete. |
| 5 | Please change your configuration to (require 'org) instead.") | 5 | It is provided here so that (require 'org-install) does not |
| 6 | trigger an error for users with obsolete Emacs configuration. | ||
| 7 | You can safely remove (require 'org-install) from your config.") | ||
| 6 | 8 | ||
| 7 | (provide 'org-install) | 9 | (provide 'org-install) |
| 8 | 10 | ||
diff --git a/lisp/org/org-jsinfo.el b/lisp/org/org-jsinfo.el index 9a4046fff8b..08c01108b98 100644 --- a/lisp/org/org-jsinfo.el +++ b/lisp/org/org-jsinfo.el | |||
| @@ -112,7 +112,7 @@ means to use the maximum value consistent with other options." | |||
| 112 | * @licstart The following is the entire license notice for the | 112 | * @licstart The following is the entire license notice for the |
| 113 | * JavaScript code in %SCRIPT_PATH. | 113 | * JavaScript code in %SCRIPT_PATH. |
| 114 | * | 114 | * |
| 115 | * Copyright (C) 2012 Sebastian Rose | 115 | * Copyright (C) 2012-2013 Sebastian Rose |
| 116 | * | 116 | * |
| 117 | * | 117 | * |
| 118 | * The JavaScript code in this tag is free software: you can | 118 | * The JavaScript code in this tag is free software: you can |
diff --git a/lisp/org/org-latex.el b/lisp/org/org-latex.el index 490a49d06e0..609bcbee103 100644 --- a/lisp/org/org-latex.el +++ b/lisp/org/org-latex.el | |||
| @@ -872,7 +872,7 @@ no LaTeX header. | |||
| 872 | When BODY-ONLY is set, don't produce the file header and footer, | 872 | When BODY-ONLY is set, don't produce the file header and footer, |
| 873 | simply return the content of \\begin{document}...\\end{document}, | 873 | simply return the content of \\begin{document}...\\end{document}, |
| 874 | without even the \\begin{document} and \\end{document} commands. | 874 | without even the \\begin{document} and \\end{document} commands. |
| 875 | when PUB-DIR is set, use this as the publishing directory." | 875 | When PUB-DIR is set, use this as the publishing directory." |
| 876 | (interactive "P") | 876 | (interactive "P") |
| 877 | (when (and (not body-only) arg (listp arg)) (setq body-only t)) | 877 | (when (and (not body-only) arg (listp arg)) (setq body-only t)) |
| 878 | (run-hooks 'org-export-first-hook) | 878 | (run-hooks 'org-export-first-hook) |
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el index d80e1717ce0..78cb2a621c7 100644 --- a/lisp/org/org-list.el +++ b/lisp/org/org-list.el | |||
| @@ -144,15 +144,15 @@ item. When the cursor is on an outline heading, plain lists are | |||
| 144 | treated as text. This is the most stable way of handling this, | 144 | treated as text. This is the most stable way of handling this, |
| 145 | which is why it is the default. | 145 | which is why it is the default. |
| 146 | 146 | ||
| 147 | When this is the symbol `integrate', then during cycling, plain | 147 | When this is the symbol `integrate', then integrate plain list |
| 148 | list items will *temporarily* be interpreted as outline headlines | 148 | items when cycling, as if they were children of outline headings. |
| 149 | with a level given by 1000+i where i is the indentation of the | 149 | |
| 150 | bullet. This setting can lead to strange effects when switching | 150 | This setting can lead to strange effects when switching visibility |
| 151 | visibility to `children', because the first \"child\" in a | 151 | to `children', because the first \"child\" in a subtree decides |
| 152 | subtree decides what children should be listed. If that first | 152 | what children should be listed. If that first \"child\" is a |
| 153 | \"child\" is a plain list item with an implied large level | 153 | plain list item with an implied large level number, all true |
| 154 | number, all true children and grand children of the outline | 154 | children and grand children of the outline heading will be |
| 155 | heading will be exposed in a children' view." | 155 | exposed in a children' view." |
| 156 | :group 'org-plain-lists | 156 | :group 'org-plain-lists |
| 157 | :type '(choice | 157 | :type '(choice |
| 158 | (const :tag "Never" nil) | 158 | (const :tag "Never" nil) |
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index 04e26708d69..a44bdbe30fd 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el | |||
| @@ -126,6 +126,15 @@ Also, do not record undo information." | |||
| 126 | (org-move-to-column ,col))))) | 126 | (org-move-to-column ,col))))) |
| 127 | (def-edebug-spec org-preserve-lc (body)) | 127 | (def-edebug-spec org-preserve-lc (body)) |
| 128 | 128 | ||
| 129 | ;; Copied from bookmark.el | ||
| 130 | (defmacro org-with-buffer-modified-unmodified (&rest body) | ||
| 131 | "Run BODY while preserving the buffer's `buffer-modified-p' state." | ||
| 132 | (org-with-gensyms (was-modified) | ||
| 133 | `(let ((,was-modified (buffer-modified-p))) | ||
| 134 | (unwind-protect | ||
| 135 | (progn ,@body) | ||
| 136 | (set-buffer-modified-p ,was-modified))))) | ||
| 137 | |||
| 129 | (defmacro org-without-partial-completion (&rest body) | 138 | (defmacro org-without-partial-completion (&rest body) |
| 130 | `(if (and (boundp 'partial-completion-mode) | 139 | `(if (and (boundp 'partial-completion-mode) |
| 131 | partial-completion-mode | 140 | partial-completion-mode |
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el index 3f41d45f511..a410de0d775 100644 --- a/lisp/org/org-mobile.el +++ b/lisp/org/org-mobile.el | |||
| @@ -304,12 +304,13 @@ Also exclude files matching `org-mobile-files-exclude-regexp'." | |||
| 304 | 304 | ||
| 305 | ;;;###autoload | 305 | ;;;###autoload |
| 306 | (defun org-mobile-push () | 306 | (defun org-mobile-push () |
| 307 | "Push the current state of Org affairs to the WebDAV directory. | 307 | "Push the current state of Org affairs to the target directory. |
| 308 | This will create the index file, copy all agenda files there, and also | 308 | This will create the index file, copy all agenda files there, and also |
| 309 | create all custom agenda views, for upload to the mobile phone." | 309 | create all custom agenda views, for upload to the mobile phone." |
| 310 | (interactive) | 310 | (interactive) |
| 311 | (let ((a-buffer (get-buffer org-agenda-buffer-name))) | 311 | (let ((a-buffer (get-buffer org-agenda-buffer-name))) |
| 312 | (let ((org-agenda-buffer-name "*SUMO*") | 312 | (let ((org-agenda-curbuf-name org-agenda-buffer-name) |
| 313 | (org-agenda-buffer-name "*SUMO*") | ||
| 313 | (org-agenda-tag-filter org-agenda-tag-filter) | 314 | (org-agenda-tag-filter org-agenda-tag-filter) |
| 314 | (org-agenda-redo-command org-agenda-redo-command)) | 315 | (org-agenda-redo-command org-agenda-redo-command)) |
| 315 | (save-excursion | 316 | (save-excursion |
| @@ -329,15 +330,17 @@ create all custom agenda views, for upload to the mobile phone." | |||
| 329 | (org-mobile-create-index-file) | 330 | (org-mobile-create-index-file) |
| 330 | (message "Writing checksums...") | 331 | (message "Writing checksums...") |
| 331 | (org-mobile-write-checksums) | 332 | (org-mobile-write-checksums) |
| 332 | (run-hooks 'org-mobile-post-push-hook)))) | 333 | (run-hooks 'org-mobile-post-push-hook))) |
| 334 | (setq org-agenda-buffer-name org-agenda-curbuf-name | ||
| 335 | org-agenda-this-buffer-name org-agenda-curbuf-name)) | ||
| 333 | (redraw-display) | 336 | (redraw-display) |
| 334 | (when (and a-buffer (buffer-live-p a-buffer)) | 337 | (when (buffer-live-p a-buffer) |
| 335 | (if (not (get-buffer-window a-buffer)) | 338 | (if (not (get-buffer-window a-buffer)) |
| 336 | (kill-buffer a-buffer) | 339 | (kill-buffer a-buffer) |
| 337 | (let ((cw (selected-window))) | 340 | (let ((cw (selected-window))) |
| 338 | (select-window (get-buffer-window a-buffer)) | 341 | (select-window (get-buffer-window a-buffer)) |
| 339 | (org-agenda-redo) | 342 | (org-agenda-redo) |
| 340 | (select-window cw))))) | 343 | (select-window cw))))) |
| 341 | (message "Files for mobile viewer staged")) | 344 | (message "Files for mobile viewer staged")) |
| 342 | 345 | ||
| 343 | (defvar org-mobile-before-process-capture-hook nil | 346 | (defvar org-mobile-before-process-capture-hook nil |
| @@ -417,7 +420,8 @@ agenda view showing the flagged items." | |||
| 417 | (target-file (expand-file-name org-mobile-index-file | 420 | (target-file (expand-file-name org-mobile-index-file |
| 418 | org-mobile-directory)) | 421 | org-mobile-directory)) |
| 419 | file link-name todo-kwds done-kwds tags drawers entry kwds dwds twds) | 422 | file link-name todo-kwds done-kwds tags drawers entry kwds dwds twds) |
| 420 | 423 | (when (stringp (car def-todo)) | |
| 424 | (setq def-todo (list (cons 'sequence def-todo)))) | ||
| 421 | (org-agenda-prepare-buffers (mapcar 'car files-alist)) | 425 | (org-agenda-prepare-buffers (mapcar 'car files-alist)) |
| 422 | (setq done-kwds (org-uniquify org-done-keywords-for-agenda)) | 426 | (setq done-kwds (org-uniquify org-done-keywords-for-agenda)) |
| 423 | (setq todo-kwds (org-delete-all | 427 | (setq todo-kwds (org-delete-all |
| @@ -536,7 +540,7 @@ The table of checksums is written to the file mobile-checksums." | |||
| 536 | (t (cons (car x) (cons "" (cdr x)))))) | 540 | (t (cons (car x) (cons "" (cdr x)))))) |
| 537 | org-agenda-custom-commands))) | 541 | org-agenda-custom-commands))) |
| 538 | (default-list '(("a" "Agenda" agenda) ("t" "All TODO" alltodo))) | 542 | (default-list '(("a" "Agenda" agenda) ("t" "All TODO" alltodo))) |
| 539 | thelist new e key desc type match settings cmds gkey gdesc gsettings cnt) | 543 | thelist atitle new e key desc type match settings cmds gkey gdesc gsettings cnt) |
| 540 | (cond | 544 | (cond |
| 541 | ((eq org-mobile-agendas 'custom) | 545 | ((eq org-mobile-agendas 'custom) |
| 542 | (setq thelist custom-list)) | 546 | (setq thelist custom-list)) |
| @@ -588,12 +592,13 @@ The table of checksums is written to the file mobile-checksums." | |||
| 588 | (setq cnt 0) | 592 | (setq cnt 0) |
| 589 | (while (setq e (pop cmds)) | 593 | (while (setq e (pop cmds)) |
| 590 | (setq type (car e) match (nth 1 e) settings (nth 2 e)) | 594 | (setq type (car e) match (nth 1 e) settings (nth 2 e)) |
| 595 | (setq atitle (if (string= "" gdesc) match gdesc)) | ||
| 591 | (setq settings (append gsettings settings)) | 596 | (setq settings (append gsettings settings)) |
| 592 | (setq settings | 597 | (setq settings |
| 593 | (cons (list 'org-agenda-title-append | 598 | (cons (list 'org-agenda-title-append |
| 594 | (concat "<after>KEYS=" gkey "#" (number-to-string | 599 | (concat "<after>KEYS=" gkey "#" (number-to-string |
| 595 | (setq cnt (1+ cnt))) | 600 | (setq cnt (1+ cnt))) |
| 596 | " TITLE: " gdesc " " match "</after>")) | 601 | " TITLE: " atitle "</after>")) |
| 597 | settings)) | 602 | settings)) |
| 598 | (push (list type match settings) new))))) | 603 | (push (list type match settings) new))))) |
| 599 | (and new (list "X" "SUMO" (reverse new) | 604 | (and new (list "X" "SUMO" (reverse new) |
| @@ -615,12 +620,10 @@ The table of checksums is written to the file mobile-checksums." | |||
| 615 | (delete-region (point) (point-at-eol))) | 620 | (delete-region (point) (point-at-eol))) |
| 616 | ((get-text-property (point) 'org-agenda-structural-header) | 621 | ((get-text-property (point) 'org-agenda-structural-header) |
| 617 | (setq in-date nil) | 622 | (setq in-date nil) |
| 618 | (setq app (get-text-property (point) | 623 | (setq app (get-text-property (point) 'org-agenda-title-append)) |
| 619 | 'org-agenda-title-append)) | 624 | (setq short (get-text-property (point) 'short-heading)) |
| 620 | (setq short (get-text-property (point) | ||
| 621 | 'short-heading)) | ||
| 622 | (when (and short (looking-at ".+")) | 625 | (when (and short (looking-at ".+")) |
| 623 | (replace-match short) | 626 | (replace-match short nil t) |
| 624 | (beginning-of-line 1)) | 627 | (beginning-of-line 1)) |
| 625 | (when app | 628 | (when app |
| 626 | (end-of-line 1) | 629 | (end-of-line 1) |
| @@ -983,7 +986,7 @@ is currently a noop.") | |||
| 983 | (goto-char (point-max)) | 986 | (goto-char (point-max)) |
| 984 | (newline) | 987 | (newline) |
| 985 | (goto-char (point-max)) | 988 | (goto-char (point-max)) |
| 986 | (move-marker (make-marker) (point))))) | 989 | (point-marker)))) |
| 987 | (let ((file (match-string 1 link)) | 990 | (let ((file (match-string 1 link)) |
| 988 | (path (match-string 2 link))) | 991 | (path (match-string 2 link))) |
| 989 | (setq file (org-link-unescape file)) | 992 | (setq file (org-link-unescape file)) |
diff --git a/lisp/org/org-odt.el b/lisp/org/org-odt.el index 028554f5821..92228f37eb8 100644 --- a/lisp/org/org-odt.el +++ b/lisp/org/org-odt.el | |||
| @@ -439,15 +439,15 @@ values. See Info node `(emacs) File Variables'." | |||
| 439 | "meta.xml" "styles.xml"))) | 439 | "meta.xml" "styles.xml"))) |
| 440 | ;; kill all xml buffers | 440 | ;; kill all xml buffers |
| 441 | (mapc (lambda (file) | 441 | (mapc (lambda (file) |
| 442 | (let ((buf (find-file-noselect | 442 | (with-current-buffer |
| 443 | (expand-file-name file org-odt-zip-dir) t))) | 443 | (find-file-noselect |
| 444 | (when (buffer-name buf) | 444 | (expand-file-name file org-odt-zip-dir) t) |
| 445 | (set-buffer-modified-p nil) | 445 | (set-buffer-modified-p nil) |
| 446 | (kill-buffer buf)))) | 446 | (kill-buffer))) |
| 447 | xml-files)) | 447 | xml-files)) |
| 448 | ;; delete temporary directory. | 448 | ;; delete temporary directory. |
| 449 | (delete-directory org-odt-zip-dir t))))) | 449 | (org-delete-directory org-odt-zip-dir t))))) |
| 450 | (org-condition-case-unless-debug err | 450 | (condition-case err |
| 451 | (prog1 (progn ,@body) | 451 | (prog1 (progn ,@body) |
| 452 | (funcall --cleanup-xml-buffers)) | 452 | (funcall --cleanup-xml-buffers)) |
| 453 | ((quit error) | 453 | ((quit error) |
| @@ -474,7 +474,7 @@ emacs --batch | |||
| 474 | --load=$HOME/lib/emacs/org.el | 474 | --load=$HOME/lib/emacs/org.el |
| 475 | --eval \"(setq org-export-headline-levels 2)\" | 475 | --eval \"(setq org-export-headline-levels 2)\" |
| 476 | --visit=MyFile --funcall org-export-as-odt-batch" | 476 | --visit=MyFile --funcall org-export-as-odt-batch" |
| 477 | (org-lparse-batch "odt")) | 477 | (org-odt-cleanup-xml-buffers (org-lparse-batch "odt"))) |
| 478 | 478 | ||
| 479 | ;;; org-export-as-odt | 479 | ;;; org-export-as-odt |
| 480 | ;;;###autoload | 480 | ;;;###autoload |
| @@ -1727,6 +1727,7 @@ ATTR is a string of other attributes of the a element." | |||
| 1727 | ((and (string= type "") | 1727 | ((and (string= type "") |
| 1728 | (or (not thefile) (string= thefile "")) | 1728 | (or (not thefile) (string= thefile "")) |
| 1729 | (plist-get org-lparse-opt-plist :section-numbers) | 1729 | (plist-get org-lparse-opt-plist :section-numbers) |
| 1730 | (get-text-property 0 'org-no-description fragment) | ||
| 1730 | (setq sec-frag fragment) | 1731 | (setq sec-frag fragment) |
| 1731 | (or (string-match "\\`sec\\(\\(-[0-9]+\\)+\\)" sec-frag) | 1732 | (or (string-match "\\`sec\\(\\(-[0-9]+\\)+\\)" sec-frag) |
| 1732 | (and (setq sec-frag | 1733 | (and (setq sec-frag |
| @@ -1756,7 +1757,11 @@ ATTR is a string of other attributes of the a element." | |||
| 1756 | (when (not (member type '("" "file"))) | 1757 | (when (not (member type '("" "file"))) |
| 1757 | (setq thefile (concat type ":" thefile))) | 1758 | (setq thefile (concat type ":" thefile))) |
| 1758 | 1759 | ||
| 1759 | (let ((org-odt-suppress-xref nil)) | 1760 | (let ((org-odt-suppress-xref |
| 1761 | ;; Typeset link to headlines with description, as a | ||
| 1762 | ;; regular hyperlink. | ||
| 1763 | (and (string= type "") | ||
| 1764 | (not (get-text-property 0 'org-no-description fragment))))) | ||
| 1760 | (org-odt-format-link | 1765 | (org-odt-format-link |
| 1761 | (org-xml-format-desc desc) thefile attr))))))) | 1766 | (org-xml-format-desc desc) thefile attr))))))) |
| 1762 | 1767 | ||
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el index 1388df47d97..20c6a6860aa 100644 --- a/lisp/org/org-publish.el +++ b/lisp/org/org-publish.el | |||
| @@ -577,7 +577,7 @@ PUB-DIR is the publishing directory." | |||
| 577 | (setq export-buf-or-file | 577 | (setq export-buf-or-file |
| 578 | (funcall (intern (concat "org-export-as-" format)) | 578 | (funcall (intern (concat "org-export-as-" format)) |
| 579 | (plist-get plist :headline-levels) | 579 | (plist-get plist :headline-levels) |
| 580 | nil plist nil | 580 | plist nil |
| 581 | (plist-get plist :body-only) | 581 | (plist-get plist :body-only) |
| 582 | pub-dir)) | 582 | pub-dir)) |
| 583 | (when (and (bufferp export-buf-or-file) | 583 | (when (and (bufferp export-buf-or-file) |
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el index 6dbf6d67fc5..501d30ab1d7 100644 --- a/lisp/org/org-src.el +++ b/lisp/org/org-src.el | |||
| @@ -39,6 +39,8 @@ | |||
| 39 | 39 | ||
| 40 | (declare-function org-do-remove-indentation "org" (&optional n)) | 40 | (declare-function org-do-remove-indentation "org" (&optional n)) |
| 41 | (declare-function org-at-table.el-p "org" ()) | 41 | (declare-function org-at-table.el-p "org" ()) |
| 42 | (declare-function org-in-src-block-p "org" (&optional inside)) | ||
| 43 | (declare-function org-in-block-p "org" (names)) | ||
| 42 | (declare-function org-get-indentation "org" (&optional line)) | 44 | (declare-function org-get-indentation "org" (&optional line)) |
| 43 | (declare-function org-switch-to-buffer-other-window "org" (&rest args)) | 45 | (declare-function org-switch-to-buffer-other-window "org" (&rest args)) |
| 44 | (declare-function org-pop-to-buffer-same-window | 46 | (declare-function org-pop-to-buffer-same-window |
| @@ -201,41 +203,40 @@ There is a mode hook, and keybindings for `org-edit-src-exit' and | |||
| 201 | `org-edit-src-save'") | 203 | `org-edit-src-save'") |
| 202 | 204 | ||
| 203 | (defun org-edit-src-code (&optional context code edit-buffer-name) | 205 | (defun org-edit-src-code (&optional context code edit-buffer-name) |
| 204 | "Edit the source CODE example at point. | 206 | "Edit the source CODE block at point. |
| 205 | The example is copied to a separate buffer, and that buffer is | 207 | The code is copied to a separate buffer and the appropriate mode |
| 206 | switched to the correct language mode. When done, exit with | 208 | is turned on. When done, exit with \\[org-edit-src-exit]. This will |
| 207 | \\[org-edit-src-exit]. This will remove the original code in the | 209 | remove the original code in the Org buffer, and replace it with the |
| 208 | Org buffer, and replace it with the edited version. An optional | 210 | edited version. An optional argument CONTEXT is used by \\[org-edit-src-save] |
| 209 | argument CONTEXT is used by \\[org-edit-src-save] when calling | 211 | when calling this function. See `org-src-window-setup' to configure |
| 210 | this function. See `org-src-window-setup' to configure the | 212 | the display of windows containing the Org buffer and the code buffer." |
| 211 | display of windows containing the Org buffer and the code | ||
| 212 | buffer." | ||
| 213 | (interactive) | 213 | (interactive) |
| 214 | (unless (eq context 'save) | 214 | (if (not (or (org-in-block-p '("src" "example" "latex" "html")) |
| 215 | (setq org-edit-src-saved-temp-window-config (current-window-configuration))) | 215 | (org-at-table.el-p))) |
| 216 | (let* ((mark (and (org-region-active-p) (mark))) | 216 | (user-error "Not in a source code or example block") |
| 217 | (case-fold-search t) | 217 | (unless (eq context 'save) |
| 218 | (info | 218 | (setq org-edit-src-saved-temp-window-config (current-window-configuration))) |
| 219 | ;; If the src region consists in no lines, we insert a blank | 219 | (let* ((mark (and (org-region-active-p) (mark))) |
| 220 | ;; line. | 220 | (case-fold-search t) |
| 221 | (let* ((temp (org-edit-src-find-region-and-lang)) | 221 | (info |
| 222 | (beg (nth 0 temp)) | 222 | ;; If the src region consists in no lines, we insert a blank |
| 223 | (end (nth 1 temp))) | 223 | ;; line. |
| 224 | (if (>= end beg) temp | 224 | (let* ((temp (org-edit-src-find-region-and-lang)) |
| 225 | (goto-char beg) | 225 | (beg (nth 0 temp)) |
| 226 | (insert "\n") | 226 | (end (nth 1 temp))) |
| 227 | (org-edit-src-find-region-and-lang)))) | 227 | (if (>= end beg) temp |
| 228 | (full-info (org-babel-get-src-block-info 'light)) | 228 | (goto-char beg) |
| 229 | (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive | 229 | (insert "\n") |
| 230 | (beg (make-marker)) | 230 | (org-edit-src-find-region-and-lang)))) |
| 231 | ;; Move marker with inserted text for case when src block is | 231 | (full-info (org-babel-get-src-block-info 'light)) |
| 232 | ;; just one empty line, i.e. beg == end. | 232 | (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive |
| 233 | (end (copy-marker nil t)) | 233 | (beg (make-marker)) |
| 234 | (allow-write-back-p (null code)) | 234 | ;; Move marker with inserted text for case when src block is |
| 235 | block-nindent total-nindent ovl lang lang-f single lfmt buffer msg | 235 | ;; just one empty line, i.e. beg == end. |
| 236 | begline markline markcol line col transmitted-variables) | 236 | (end (copy-marker (make-marker) t)) |
| 237 | (if (not info) | 237 | (allow-write-back-p (null code)) |
| 238 | nil | 238 | block-nindent total-nindent ovl lang lang-f single lfmt buffer msg |
| 239 | begline markline markcol line col transmitted-variables) | ||
| 239 | (setq beg (move-marker beg (nth 0 info)) | 240 | (setq beg (move-marker beg (nth 0 info)) |
| 240 | end (move-marker end (nth 1 info)) | 241 | end (move-marker end (nth 1 info)) |
| 241 | msg (if allow-write-back-p | 242 | msg (if allow-write-back-p |
| @@ -244,7 +245,7 @@ buffer." | |||
| 244 | "Exit with C-c ' (C-c and single quote)") | 245 | "Exit with C-c ' (C-c and single quote)") |
| 245 | code (or code (buffer-substring-no-properties beg end)) | 246 | code (or code (buffer-substring-no-properties beg end)) |
| 246 | lang (or (cdr (assoc (nth 2 info) org-src-lang-modes)) | 247 | lang (or (cdr (assoc (nth 2 info) org-src-lang-modes)) |
| 247 | (nth 2 info)) | 248 | (nth 2 info)) |
| 248 | lang (if (symbolp lang) (symbol-name lang) lang) | 249 | lang (if (symbolp lang) (symbol-name lang) lang) |
| 249 | single (nth 3 info) | 250 | single (nth 3 info) |
| 250 | block-nindent (nth 5 info) | 251 | block-nindent (nth 5 info) |
| @@ -527,6 +528,14 @@ the language, a switch telling if the content should be in a single line." | |||
| 527 | (pos (point)) | 528 | (pos (point)) |
| 528 | re1 re2 single beg end lang lfmt match-re1 ind entry) | 529 | re1 re2 single beg end lang lfmt match-re1 ind entry) |
| 529 | (catch 'exit | 530 | (catch 'exit |
| 531 | (when (org-at-table.el-p) | ||
| 532 | (re-search-backward "^[\t]*[^ \t|\\+]" nil t) | ||
| 533 | (setq beg (1+ (point-at-eol))) | ||
| 534 | (goto-char beg) | ||
| 535 | (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t) | ||
| 536 | (progn (goto-char (point-max)) (newline))) | ||
| 537 | (setq end (1- (point-at-bol))) | ||
| 538 | (throw 'exit (list beg end 'table.el nil nil 0))) | ||
| 530 | (while (setq entry (pop re-list)) | 539 | (while (setq entry (pop re-list)) |
| 531 | (setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry) | 540 | (setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry) |
| 532 | single (nth 3 entry)) | 541 | single (nth 3 entry)) |
| @@ -557,16 +566,7 @@ the language, a switch telling if the content should be in a single line." | |||
| 557 | (throw 'exit | 566 | (throw 'exit |
| 558 | (list (match-end 0) end | 567 | (list (match-end 0) end |
| 559 | (org-edit-src-get-lang lang) | 568 | (org-edit-src-get-lang lang) |
| 560 | single lfmt ind))))))))) | 569 | single lfmt ind)))))))))))) |
| 561 | (when (org-at-table.el-p) | ||
| 562 | (re-search-backward "^[\t]*[^ \t|\\+]" nil t) | ||
| 563 | (setq beg (1+ (point-at-eol))) | ||
| 564 | (goto-char beg) | ||
| 565 | (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t) | ||
| 566 | (progn (goto-char (point-max)) (newline))) | ||
| 567 | (setq end (point-at-bol)) | ||
| 568 | (setq ind (org-edit-src-get-indentation beg)) | ||
| 569 | (throw 'exit (list beg end 'table.el nil nil ind)))))) | ||
| 570 | 570 | ||
| 571 | (defun org-edit-src-get-lang (lang) | 571 | (defun org-edit-src-get-lang (lang) |
| 572 | "Extract the src language." | 572 | "Extract the src language." |
| @@ -633,7 +633,8 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"." | |||
| 633 | (unless (org-bound-and-true-p org-edit-src-from-org-mode) | 633 | (unless (org-bound-and-true-p org-edit-src-from-org-mode) |
| 634 | (error "This is not a sub-editing buffer, something is wrong")) | 634 | (error "This is not a sub-editing buffer, something is wrong")) |
| 635 | (widen) | 635 | (widen) |
| 636 | (let* ((beg org-edit-src-beg-marker) | 636 | (let* ((fixed-width-p (string-match "Fixed Width" (buffer-name))) |
| 637 | (beg org-edit-src-beg-marker) | ||
| 637 | (end org-edit-src-end-marker) | 638 | (end org-edit-src-end-marker) |
| 638 | (ovl org-edit-src-overlay) | 639 | (ovl org-edit-src-overlay) |
| 639 | (bufstr (buffer-string)) | 640 | (bufstr (buffer-string)) |
| @@ -670,7 +671,8 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"." | |||
| 670 | (goto-char (point-max)) (insert "\\n"))) | 671 | (goto-char (point-max)) (insert "\\n"))) |
| 671 | (goto-char (point-min)) | 672 | (goto-char (point-min)) |
| 672 | (if (looking-at "\\s-*") (replace-match " "))) | 673 | (if (looking-at "\\s-*") (replace-match " "))) |
| 673 | (when (org-bound-and-true-p org-edit-src-from-org-mode) | 674 | (when (and (org-bound-and-true-p org-edit-src-from-org-mode) |
| 675 | (not fixed-width-p)) | ||
| 674 | (org-escape-code-in-region (point-min) (point-max)) | 676 | (org-escape-code-in-region (point-min) (point-max)) |
| 675 | (setq delta (+ delta | 677 | (setq delta (+ delta |
| 676 | (save-excursion | 678 | (save-excursion |
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index b024770ce78..00b2eb4d028 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el | |||
| @@ -509,10 +509,10 @@ nil When nil, the command tries to be smart and figure out the | |||
| 509 | re) | 509 | re) |
| 510 | (goto-char beg) | 510 | (goto-char beg) |
| 511 | (beginning-of-line 1) | 511 | (beginning-of-line 1) |
| 512 | (setq beg (move-marker (make-marker) (point))) | 512 | (setq beg (point-marker)) |
| 513 | (goto-char end) | 513 | (goto-char end) |
| 514 | (if (bolp) (backward-char 1) (end-of-line 1)) | 514 | (if (bolp) (backward-char 1) (end-of-line 1)) |
| 515 | (setq end (move-marker (make-marker) (point))) | 515 | (setq end (point-marker)) |
| 516 | ;; Get the right field separator | 516 | ;; Get the right field separator |
| 517 | (unless separator | 517 | (unless separator |
| 518 | (goto-char beg) | 518 | (goto-char beg) |
| @@ -1895,7 +1895,7 @@ it can be edited in place." | |||
| 1895 | (if (and (boundp 'font-lock-mode) font-lock-mode) | 1895 | (if (and (boundp 'font-lock-mode) font-lock-mode) |
| 1896 | (font-lock-fontify-block)))) | 1896 | (font-lock-fontify-block)))) |
| 1897 | (t | 1897 | (t |
| 1898 | (let ((pos (move-marker (make-marker) (point))) | 1898 | (let ((pos (point-marker)) |
| 1899 | (coord | 1899 | (coord |
| 1900 | (if (eq org-table-use-standard-references t) | 1900 | (if (eq org-table-use-standard-references t) |
| 1901 | (concat (org-number-to-letters (org-table-current-column)) | 1901 | (concat (org-number-to-letters (org-table-current-column)) |
| @@ -3219,7 +3219,7 @@ Parameters get priority." | |||
| 3219 | (let ((key (org-table-current-field-formula 'key 'noerror)) | 3219 | (let ((key (org-table-current-field-formula 'key 'noerror)) |
| 3220 | (eql (sort (org-table-get-stored-formulas 'noerror) | 3220 | (eql (sort (org-table-get-stored-formulas 'noerror) |
| 3221 | 'org-table-formula-less-p)) | 3221 | 'org-table-formula-less-p)) |
| 3222 | (pos (move-marker (make-marker) (point))) | 3222 | (pos (point-marker)) |
| 3223 | (startline 1) | 3223 | (startline 1) |
| 3224 | (wc (current-window-configuration)) | 3224 | (wc (current-window-configuration)) |
| 3225 | (sel-win (selected-window)) | 3225 | (sel-win (selected-window)) |
| @@ -3580,7 +3580,7 @@ With prefix ARG, apply the new formulas to the table." | |||
| 3580 | (beginning-of-line 1) | 3580 | (beginning-of-line 1) |
| 3581 | (insert ind)) | 3581 | (insert ind)) |
| 3582 | (goto-char (point-max)) | 3582 | (goto-char (point-max)) |
| 3583 | (backward-delete-char 1))) | 3583 | (org-delete-backward-char 1))) |
| 3584 | (goto-char beg)) | 3584 | (goto-char beg)) |
| 3585 | (t nil)))) | 3585 | (t nil)))) |
| 3586 | 3586 | ||
| @@ -4235,7 +4235,7 @@ overwritten, and the table is not marked as requiring realignment." | |||
| 4235 | (looking-at "[^|\n]* +|")) | 4235 | (looking-at "[^|\n]* +|")) |
| 4236 | (let (org-table-may-need-update) | 4236 | (let (org-table-may-need-update) |
| 4237 | (goto-char (1- (match-end 0))) | 4237 | (goto-char (1- (match-end 0))) |
| 4238 | (backward-delete-char 1) | 4238 | (org-delete-backward-char 1) |
| 4239 | (goto-char (match-beginning 0)) | 4239 | (goto-char (match-beginning 0)) |
| 4240 | (self-insert-command N)) | 4240 | (self-insert-command N)) |
| 4241 | (setq org-table-may-need-update t) | 4241 | (setq org-table-may-need-update t) |
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index de434885b12..e62eba3cf83 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el | |||
| @@ -5,13 +5,13 @@ | |||
| 5 | (defun org-release () | 5 | (defun org-release () |
| 6 | "The release version of org-mode. | 6 | "The release version of org-mode. |
| 7 | Inserted by installing org-mode or when a release is made." | 7 | Inserted by installing org-mode or when a release is made." |
| 8 | (let ((org-release "7.9.2+")) | 8 | (let ((org-release "7.9.3d")) |
| 9 | org-release)) | 9 | org-release)) |
| 10 | ;;;###autoload | 10 | ;;;###autoload |
| 11 | (defun org-git-version () | 11 | (defun org-git-version () |
| 12 | "The Git version of org-mode. | 12 | "The Git version of org-mode. |
| 13 | Inserted by installing org-mode or when a release is made." | 13 | Inserted by installing org-mode or when a release is made." |
| 14 | (let ((org-git-version "7.9.2+-GNU-Emacs-24-3 (commit 488eea)")) | 14 | (let ((org-git-version "7.9.3d-GNU-Emacs-24-3 (commit e8f5b0ad)")) |
| 15 | org-git-version)) | 15 | org-git-version)) |
| 16 | ;;;###autoload | 16 | ;;;###autoload |
| 17 | (defvar org-odt-data-dir "/usr/share/emacs/etc/org" | 17 | (defvar org-odt-data-dir "/usr/share/emacs/etc/org" |
diff --git a/lisp/org/org.el b/lisp/org/org.el index d4120b4224e..9409feca178 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el | |||
| @@ -1219,7 +1219,15 @@ See also the QUOTE keyword." | |||
| 1219 | :type 'boolean) | 1219 | :type 'boolean) |
| 1220 | 1220 | ||
| 1221 | (defcustom org-goto-auto-isearch t | 1221 | (defcustom org-goto-auto-isearch t |
| 1222 | "Non-nil means typing characters in `org-goto' starts incremental search." | 1222 | "Non-nil means typing characters in `org-goto' starts incremental search. |
| 1223 | When nil, you can use these keybindings to navigate the buffer: | ||
| 1224 | |||
| 1225 | q Quit the org-goto interface | ||
| 1226 | n Go to the next visible heading | ||
| 1227 | p Go to the previous visible heading | ||
| 1228 | f Go one heading forward on same level | ||
| 1229 | b Go one heading backward on same level | ||
| 1230 | u Go one heading up" | ||
| 1223 | :group 'org-edit-structure | 1231 | :group 'org-edit-structure |
| 1224 | :type 'boolean) | 1232 | :type 'boolean) |
| 1225 | 1233 | ||
| @@ -2236,8 +2244,9 @@ Lisp variable `org-state'." | |||
| 2236 | (defvar org-blocker-hook nil | 2244 | (defvar org-blocker-hook nil |
| 2237 | "Hook for functions that are allowed to block a state change. | 2245 | "Hook for functions that are allowed to block a state change. |
| 2238 | 2246 | ||
| 2239 | Each function gets as its single argument a property list, see | 2247 | Functions in this hook should not modify the buffer. |
| 2240 | `org-trigger-hook' for more information about this list. | 2248 | Each function gets as its single argument a property list, |
| 2249 | see `org-trigger-hook' for more information about this list. | ||
| 2241 | 2250 | ||
| 2242 | If any of the functions in this hook returns nil, the state change | 2251 | If any of the functions in this hook returns nil, the state change |
| 2243 | is blocked.") | 2252 | is blocked.") |
| @@ -2245,8 +2254,8 @@ is blocked.") | |||
| 2245 | (defvar org-trigger-hook nil | 2254 | (defvar org-trigger-hook nil |
| 2246 | "Hook for functions that are triggered by a state change. | 2255 | "Hook for functions that are triggered by a state change. |
| 2247 | 2256 | ||
| 2248 | Each function gets as its single argument a property list with at least | 2257 | Each function gets as its single argument a property list with at |
| 2249 | the following elements: | 2258 | least the following elements: |
| 2250 | 2259 | ||
| 2251 | (:type type-of-change :position pos-at-entry-start | 2260 | (:type type-of-change :position pos-at-entry-start |
| 2252 | :from old-state :to new-state) | 2261 | :from old-state :to new-state) |
| @@ -2979,7 +2988,7 @@ When nil, only the tags directly given in a specific line apply there. | |||
| 2979 | This may also be a list of tags that should be inherited, or a regexp that | 2988 | This may also be a list of tags that should be inherited, or a regexp that |
| 2980 | matches tags that should be inherited. Additional control is possible | 2989 | matches tags that should be inherited. Additional control is possible |
| 2981 | with the variable `org-tags-exclude-from-inheritance' which gives an | 2990 | with the variable `org-tags-exclude-from-inheritance' which gives an |
| 2982 | explicit list of tags to be excluded from inheritance., even if the value of | 2991 | explicit list of tags to be excluded from inheritance, even if the value of |
| 2983 | `org-use-tag-inheritance' would select it for inheritance. | 2992 | `org-use-tag-inheritance' would select it for inheritance. |
| 2984 | 2993 | ||
| 2985 | If this option is t, a match early-on in a tree can lead to a large | 2994 | If this option is t, a match early-on in a tree can lead to a large |
| @@ -3952,7 +3961,7 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables." | |||
| 3952 | (beginning-of-line 1) | 3961 | (beginning-of-line 1) |
| 3953 | (when (and (looking-at org-table-line-regexp) | 3962 | (when (and (looking-at org-table-line-regexp) |
| 3954 | ;; Exclude tables in src/example/verbatim/clocktable blocks | 3963 | ;; Exclude tables in src/example/verbatim/clocktable blocks |
| 3955 | (not (org-in-block-p '("src" "example")))) | 3964 | (not (org-in-block-p '("src" "example" "verbatim" "clocktable")))) |
| 3956 | (save-excursion (funcall function)) | 3965 | (save-excursion (funcall function)) |
| 3957 | (or (looking-at org-table-line-regexp) | 3966 | (or (looking-at org-table-line-regexp) |
| 3958 | (forward-char 1))) | 3967 | (forward-char 1))) |
| @@ -5007,13 +5016,15 @@ The following commands are available: | |||
| 5007 | (defun org-find-invisible-foreground () | 5016 | (defun org-find-invisible-foreground () |
| 5008 | (let ((candidates (remove | 5017 | (let ((candidates (remove |
| 5009 | "unspecified-bg" | 5018 | "unspecified-bg" |
| 5010 | (list | 5019 | (nconc |
| 5011 | (face-background 'default) | 5020 | (list (face-background 'default) |
| 5012 | (face-background 'org-default) | 5021 | (face-background 'org-default)) |
| 5013 | (cdr (assoc 'background-color default-frame-alist)) | 5022 | (mapcar |
| 5014 | (cdr (assoc 'background-color initial-frame-alist)) | 5023 | (lambda (alist) |
| 5015 | (cdr (assoc 'background-color window-system-default-frame-alist)) | 5024 | (when (boundp alist) |
| 5016 | (face-foreground 'org-hide))))) | 5025 | (cdr (assoc 'background-color (symbol-value alist))))) |
| 5026 | '(default-frame-alist initial-frame-alist window-system-default-frame-alist)) | ||
| 5027 | (list (face-foreground 'org-hide)))))) | ||
| 5017 | (car (remove nil candidates)))) | 5028 | (car (remove nil candidates)))) |
| 5018 | 5029 | ||
| 5019 | (defun org-current-time () | 5030 | (defun org-current-time () |
| @@ -5284,7 +5295,7 @@ will be prompted for." | |||
| 5284 | (and move (backward-char 1)))) | 5295 | (and move (backward-char 1)))) |
| 5285 | 5296 | ||
| 5286 | (defconst org-nonsticky-props | 5297 | (defconst org-nonsticky-props |
| 5287 | '(mouse-face highlight keymap invisible intangible help-echo org-linked-text)) | 5298 | '(mouse-face highlight keymap invisible intangible help-echo org-linked-text htmlize-link)) |
| 5288 | 5299 | ||
| 5289 | (defsubst org-rear-nonsticky-at (pos) | 5300 | (defsubst org-rear-nonsticky-at (pos) |
| 5290 | (add-text-properties (1- pos) pos (list 'rear-nonsticky org-nonsticky-props))) | 5301 | (add-text-properties (1- pos) pos (list 'rear-nonsticky org-nonsticky-props))) |
| @@ -5293,12 +5304,13 @@ will be prompted for." | |||
| 5293 | "Run through the buffer and add overlays to links." | 5304 | "Run through the buffer and add overlays to links." |
| 5294 | (catch 'exit | 5305 | (catch 'exit |
| 5295 | (let (f) | 5306 | (let (f) |
| 5296 | (when (re-search-forward (concat org-plain-link-re) limit t) | 5307 | (when (and (re-search-forward (concat org-plain-link-re) limit t) |
| 5308 | (not (org-in-src-block-p))) | ||
| 5297 | (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) | 5309 | (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) |
| 5298 | (setq f (get-text-property (match-beginning 0) 'face)) | 5310 | (setq f (get-text-property (match-beginning 0) 'face)) |
| 5299 | (if (or (eq f 'org-tag) | 5311 | (unless (or (org-in-src-block-p) |
| 5300 | (and (listp f) (memq 'org-tag f))) | 5312 | (eq f 'org-tag) |
| 5301 | nil | 5313 | (and (listp f) (memq 'org-tag f))) |
| 5302 | (add-text-properties (match-beginning 0) (match-end 0) | 5314 | (add-text-properties (match-beginning 0) (match-end 0) |
| 5303 | (list 'mouse-face 'highlight | 5315 | (list 'mouse-face 'highlight |
| 5304 | 'face 'org-link | 5316 | 'face 'org-link |
| @@ -5410,9 +5422,9 @@ by a #." | |||
| 5410 | '(font-lock-fontified t invisible t) | 5422 | '(font-lock-fontified t invisible t) |
| 5411 | '(font-lock-fontified t face org-document-info-keyword))) | 5423 | '(font-lock-fontified t face org-document-info-keyword))) |
| 5412 | (add-text-properties | 5424 | (add-text-properties |
| 5413 | (match-beginning 6) (match-end 6) | 5425 | (match-beginning 6) (1+ (match-end 6)) |
| 5414 | (if (string-equal dc1 "+title:") | 5426 | (if (string-equal dc1 "+title:") |
| 5415 | '(font-lock-fontified t face org-document-title) | 5427 | '(font-lock-fontified t face org-document-title) |
| 5416 | '(font-lock-fontified t face org-document-info)))) | 5428 | '(font-lock-fontified t face org-document-info)))) |
| 5417 | ((or (equal dc1 "+results") | 5429 | ((or (equal dc1 "+results") |
| 5418 | (member dc1 '("+begin:" "+end:" "+caption:" "+label:" | 5430 | (member dc1 '("+begin:" "+end:" "+caption:" "+label:" |
| @@ -5437,7 +5449,8 @@ by a #." | |||
| 5437 | 5449 | ||
| 5438 | (defun org-activate-angle-links (limit) | 5450 | (defun org-activate-angle-links (limit) |
| 5439 | "Run through the buffer and add overlays to links." | 5451 | "Run through the buffer and add overlays to links." |
| 5440 | (if (re-search-forward org-angle-link-re limit t) | 5452 | (if (and (re-search-forward org-angle-link-re limit t) |
| 5453 | (not (org-in-src-block-p))) | ||
| 5441 | (progn | 5454 | (progn |
| 5442 | (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) | 5455 | (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) |
| 5443 | (add-text-properties (match-beginning 0) (match-end 0) | 5456 | (add-text-properties (match-beginning 0) (match-end 0) |
| @@ -5465,7 +5478,8 @@ by a #." | |||
| 5465 | 5478 | ||
| 5466 | (defun org-activate-bracket-links (limit) | 5479 | (defun org-activate-bracket-links (limit) |
| 5467 | "Run through the buffer and add overlays to bracketed links." | 5480 | "Run through the buffer and add overlays to bracketed links." |
| 5468 | (if (re-search-forward org-bracket-link-regexp limit t) | 5481 | (if (and (re-search-forward org-bracket-link-regexp limit t) |
| 5482 | (not (org-in-src-block-p))) | ||
| 5469 | (let* ((help (concat "LINK: " | 5483 | (let* ((help (concat "LINK: " |
| 5470 | (org-match-string-no-properties 1))) | 5484 | (org-match-string-no-properties 1))) |
| 5471 | ;; FIXME: above we should remove the escapes. | 5485 | ;; FIXME: above we should remove the escapes. |
| @@ -6254,11 +6268,7 @@ in special contexts. | |||
| 6254 | (setq has-children (org-list-has-child-p (point) struct))) | 6268 | (setq has-children (org-list-has-child-p (point) struct))) |
| 6255 | (org-back-to-heading) | 6269 | (org-back-to-heading) |
| 6256 | (setq eoh (save-excursion (outline-end-of-heading) (point))) | 6270 | (setq eoh (save-excursion (outline-end-of-heading) (point))) |
| 6257 | (setq eos (save-excursion | 6271 | (setq eos (save-excursion (1- (org-end-of-subtree t t)))) |
| 6258 | (org-end-of-subtree t) | ||
| 6259 | (unless (eobp) | ||
| 6260 | (skip-chars-forward " \t\n")) | ||
| 6261 | (if (eobp) (point) (1- (point))))) | ||
| 6262 | (setq has-children | 6272 | (setq has-children |
| 6263 | (or (save-excursion | 6273 | (or (save-excursion |
| 6264 | (let ((level (funcall outline-level))) | 6274 | (let ((level (funcall outline-level))) |
| @@ -6283,7 +6293,8 @@ in special contexts. | |||
| 6283 | (cond | 6293 | (cond |
| 6284 | ((= eos eoh) | 6294 | ((= eos eoh) |
| 6285 | ;; Nothing is hidden behind this heading | 6295 | ;; Nothing is hidden behind this heading |
| 6286 | (run-hook-with-args 'org-pre-cycle-hook 'empty) | 6296 | (unless (org-before-first-heading-p) |
| 6297 | (run-hook-with-args 'org-pre-cycle-hook 'empty)) | ||
| 6287 | (message "EMPTY ENTRY") | 6298 | (message "EMPTY ENTRY") |
| 6288 | (setq org-cycle-subtree-status nil) | 6299 | (setq org-cycle-subtree-status nil) |
| 6289 | (save-excursion | 6300 | (save-excursion |
| @@ -6296,7 +6307,8 @@ in special contexts. | |||
| 6296 | (not (setq children-skipped | 6307 | (not (setq children-skipped |
| 6297 | org-cycle-skip-children-state-if-no-children)))) | 6308 | org-cycle-skip-children-state-if-no-children)))) |
| 6298 | ;; Entire subtree is hidden in one line: children view | 6309 | ;; Entire subtree is hidden in one line: children view |
| 6299 | (run-hook-with-args 'org-pre-cycle-hook 'children) | 6310 | (unless (org-before-first-heading-p) |
| 6311 | (run-hook-with-args 'org-pre-cycle-hook 'children)) | ||
| 6300 | (if (org-at-item-p) | 6312 | (if (org-at-item-p) |
| 6301 | (org-list-set-item-visibility (point-at-bol) struct 'children) | 6313 | (org-list-set-item-visibility (point-at-bol) struct 'children) |
| 6302 | (org-show-entry) | 6314 | (org-show-entry) |
| @@ -6324,24 +6336,28 @@ in special contexts. | |||
| 6324 | (outline-next-heading) | 6336 | (outline-next-heading) |
| 6325 | (if (outline-invisible-p) (org-flag-heading nil))) | 6337 | (if (outline-invisible-p) (org-flag-heading nil))) |
| 6326 | (setq org-cycle-subtree-status 'children) | 6338 | (setq org-cycle-subtree-status 'children) |
| 6327 | (run-hook-with-args 'org-cycle-hook 'children)) | 6339 | (unless (org-before-first-heading-p) |
| 6340 | (run-hook-with-args 'org-cycle-hook 'children))) | ||
| 6328 | ((or children-skipped | 6341 | ((or children-skipped |
| 6329 | (and (eq last-command this-command) | 6342 | (and (eq last-command this-command) |
| 6330 | (eq org-cycle-subtree-status 'children))) | 6343 | (eq org-cycle-subtree-status 'children))) |
| 6331 | ;; We just showed the children, or no children are there, | 6344 | ;; We just showed the children, or no children are there, |
| 6332 | ;; now show everything. | 6345 | ;; now show everything. |
| 6333 | (run-hook-with-args 'org-pre-cycle-hook 'subtree) | 6346 | (unless (org-before-first-heading-p) |
| 6347 | (run-hook-with-args 'org-pre-cycle-hook 'subtree)) | ||
| 6334 | (outline-flag-region eoh eos nil) | 6348 | (outline-flag-region eoh eos nil) |
| 6335 | (message (if children-skipped "SUBTREE (NO CHILDREN)" "SUBTREE")) | 6349 | (message (if children-skipped "SUBTREE (NO CHILDREN)" "SUBTREE")) |
| 6336 | (setq org-cycle-subtree-status 'subtree) | 6350 | (setq org-cycle-subtree-status 'subtree) |
| 6337 | (run-hook-with-args 'org-cycle-hook 'subtree)) | 6351 | (unless (org-before-first-heading-p) |
| 6352 | (run-hook-with-args 'org-cycle-hook 'subtree))) | ||
| 6338 | (t | 6353 | (t |
| 6339 | ;; Default action: hide the subtree. | 6354 | ;; Default action: hide the subtree. |
| 6340 | (run-hook-with-args 'org-pre-cycle-hook 'folded) | 6355 | (run-hook-with-args 'org-pre-cycle-hook 'folded) |
| 6341 | (outline-flag-region eoh eos t) | 6356 | (outline-flag-region eoh eos t) |
| 6342 | (message "FOLDED") | 6357 | (message "FOLDED") |
| 6343 | (setq org-cycle-subtree-status 'folded) | 6358 | (setq org-cycle-subtree-status 'folded) |
| 6344 | (run-hook-with-args 'org-cycle-hook 'folded))))) | 6359 | (unless (org-before-first-heading-p) |
| 6360 | (run-hook-with-args 'org-cycle-hook 'folded)))))) | ||
| 6345 | 6361 | ||
| 6346 | ;;;###autoload | 6362 | ;;;###autoload |
| 6347 | (defun org-global-cycle (&optional arg) | 6363 | (defun org-global-cycle (&optional arg) |
| @@ -6745,42 +6761,47 @@ Optional arguments START and END can be used to limit the range." | |||
| 6745 | 6761 | ||
| 6746 | (defvar org-goto-window-configuration nil) | 6762 | (defvar org-goto-window-configuration nil) |
| 6747 | (defvar org-goto-marker nil) | 6763 | (defvar org-goto-marker nil) |
| 6748 | (defvar org-goto-map | 6764 | (defvar org-goto-map) |
| 6749 | (let ((map (make-sparse-keymap))) | 6765 | (defun org-goto-map () |
| 6750 | (let ((cmds '(isearch-forward isearch-backward kill-ring-save set-mark-command mouse-drag-region universal-argument org-occur)) cmd) | 6766 | "Set the keymap `org-goto'." |
| 6751 | (while (setq cmd (pop cmds)) | 6767 | (setq org-goto-map |
| 6752 | (substitute-key-definition cmd cmd map global-map))) | 6768 | (let ((map (make-sparse-keymap))) |
| 6753 | (suppress-keymap map) | 6769 | (let ((cmds '(isearch-forward isearch-backward kill-ring-save set-mark-command |
| 6754 | (org-defkey map "\C-m" 'org-goto-ret) | 6770 | mouse-drag-region universal-argument org-occur)) |
| 6755 | (org-defkey map [(return)] 'org-goto-ret) | 6771 | cmd) |
| 6756 | (org-defkey map [(left)] 'org-goto-left) | 6772 | (while (setq cmd (pop cmds)) |
| 6757 | (org-defkey map [(right)] 'org-goto-right) | 6773 | (substitute-key-definition cmd cmd map global-map))) |
| 6758 | (org-defkey map [(control ?g)] 'org-goto-quit) | 6774 | (suppress-keymap map) |
| 6759 | (org-defkey map "\C-i" 'org-cycle) | 6775 | (org-defkey map "\C-m" 'org-goto-ret) |
| 6760 | (org-defkey map [(tab)] 'org-cycle) | 6776 | (org-defkey map [(return)] 'org-goto-ret) |
| 6761 | (org-defkey map [(down)] 'outline-next-visible-heading) | 6777 | (org-defkey map [(left)] 'org-goto-left) |
| 6762 | (org-defkey map [(up)] 'outline-previous-visible-heading) | 6778 | (org-defkey map [(right)] 'org-goto-right) |
| 6763 | (if org-goto-auto-isearch | 6779 | (org-defkey map [(control ?g)] 'org-goto-quit) |
| 6764 | (if (fboundp 'define-key-after) | 6780 | (org-defkey map "\C-i" 'org-cycle) |
| 6765 | (define-key-after map [t] 'org-goto-local-auto-isearch) | 6781 | (org-defkey map [(tab)] 'org-cycle) |
| 6766 | nil) | 6782 | (org-defkey map [(down)] 'outline-next-visible-heading) |
| 6767 | (org-defkey map "q" 'org-goto-quit) | 6783 | (org-defkey map [(up)] 'outline-previous-visible-heading) |
| 6768 | (org-defkey map "n" 'outline-next-visible-heading) | 6784 | (if org-goto-auto-isearch |
| 6769 | (org-defkey map "p" 'outline-previous-visible-heading) | 6785 | (if (fboundp 'define-key-after) |
| 6770 | (org-defkey map "f" 'outline-forward-same-level) | 6786 | (define-key-after map [t] 'org-goto-local-auto-isearch) |
| 6771 | (org-defkey map "b" 'outline-backward-same-level) | 6787 | nil) |
| 6772 | (org-defkey map "u" 'outline-up-heading)) | 6788 | (org-defkey map "q" 'org-goto-quit) |
| 6773 | (org-defkey map "/" 'org-occur) | 6789 | (org-defkey map "n" 'outline-next-visible-heading) |
| 6774 | (org-defkey map "\C-c\C-n" 'outline-next-visible-heading) | 6790 | (org-defkey map "p" 'outline-previous-visible-heading) |
| 6775 | (org-defkey map "\C-c\C-p" 'outline-previous-visible-heading) | 6791 | (org-defkey map "f" 'outline-forward-same-level) |
| 6776 | (org-defkey map "\C-c\C-f" 'outline-forward-same-level) | 6792 | (org-defkey map "b" 'outline-backward-same-level) |
| 6777 | (org-defkey map "\C-c\C-b" 'outline-backward-same-level) | 6793 | (org-defkey map "u" 'outline-up-heading)) |
| 6778 | (org-defkey map "\C-c\C-u" 'outline-up-heading) | 6794 | (org-defkey map "/" 'org-occur) |
| 6779 | map)) | 6795 | (org-defkey map "\C-c\C-n" 'outline-next-visible-heading) |
| 6796 | (org-defkey map "\C-c\C-p" 'outline-previous-visible-heading) | ||
| 6797 | (org-defkey map "\C-c\C-f" 'outline-forward-same-level) | ||
| 6798 | (org-defkey map "\C-c\C-b" 'outline-backward-same-level) | ||
| 6799 | (org-defkey map "\C-c\C-u" 'outline-up-heading) | ||
| 6800 | map))) | ||
| 6780 | 6801 | ||
| 6781 | (defconst org-goto-help | 6802 | (defconst org-goto-help |
| 6782 | "Browse buffer copy, to find location or copy text. Just type for auto-isearch. | 6803 | "Browse buffer copy, to find location or copy text.%s |
| 6783 | RET=jump to location [Q]uit and return to previous location | 6804 | RET=jump to location C-g=quit and return to previous location |
| 6784 | \[Up]/[Down]=next/prev headline TAB=cycle visibility [/] org-occur") | 6805 | \[Up]/[Down]=next/prev headline TAB=cycle visibility [/] org-occur") |
| 6785 | 6806 | ||
| 6786 | (defvar org-goto-start-pos) ; dynamically scoped parameter | 6807 | (defvar org-goto-start-pos) ; dynamically scoped parameter |
| @@ -6806,6 +6827,7 @@ in the indirect buffer and expose the headline hierarchy above. | |||
| 6806 | With a prefix argument, use the alternative interface: e.g. if | 6827 | With a prefix argument, use the alternative interface: e.g. if |
| 6807 | `org-goto-interface' is 'outline use 'outline-path-completion." | 6828 | `org-goto-interface' is 'outline use 'outline-path-completion." |
| 6808 | (interactive "P") | 6829 | (interactive "P") |
| 6830 | (org-goto-map) | ||
| 6809 | (let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level)))) | 6831 | (let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level)))) |
| 6810 | (org-refile-use-outline-path t) | 6832 | (org-refile-use-outline-path t) |
| 6811 | (org-refile-target-verify-function nil) | 6833 | (org-refile-target-verify-function nil) |
| @@ -6838,48 +6860,46 @@ With a prefix argument, use the alternative interface: e.g. if | |||
| 6838 | "Let the user select a location in the Org-mode buffer BUF. | 6860 | "Let the user select a location in the Org-mode buffer BUF. |
| 6839 | This function uses a recursive edit. It returns the selected position | 6861 | This function uses a recursive edit. It returns the selected position |
| 6840 | or nil." | 6862 | or nil." |
| 6841 | (let ((isearch-mode-map org-goto-local-auto-isearch-map) | 6863 | (org-no-popups |
| 6842 | (isearch-hide-immediately nil) | 6864 | (let ((isearch-mode-map org-goto-local-auto-isearch-map) |
| 6843 | (isearch-search-fun-function | 6865 | (isearch-hide-immediately nil) |
| 6844 | (lambda () 'org-goto-local-search-headings)) | 6866 | (isearch-search-fun-function |
| 6845 | (org-goto-selected-point org-goto-exit-command) | 6867 | (lambda () 'org-goto-local-search-headings)) |
| 6846 | (pop-up-frames nil) | 6868 | (org-goto-selected-point org-goto-exit-command)) |
| 6847 | (special-display-buffer-names nil) | 6869 | (save-excursion |
| 6848 | (special-display-regexps nil) | 6870 | (save-window-excursion |
| 6849 | (special-display-function nil)) | 6871 | (delete-other-windows) |
| 6850 | (save-excursion | 6872 | (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) |
| 6851 | (save-window-excursion | 6873 | (org-pop-to-buffer-same-window |
| 6852 | (delete-other-windows) | 6874 | (condition-case nil |
| 6853 | (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) | 6875 | (make-indirect-buffer (current-buffer) "*org-goto*") |
| 6854 | (org-pop-to-buffer-same-window | 6876 | (error (make-indirect-buffer (current-buffer) "*org-goto*")))) |
| 6855 | (condition-case nil | 6877 | (with-output-to-temp-buffer "*Org Help*" |
| 6856 | (make-indirect-buffer (current-buffer) "*org-goto*") | 6878 | (princ (format help (if org-goto-auto-isearch |
| 6857 | (error (make-indirect-buffer (current-buffer) "*org-goto*")))) | 6879 | " Just type for auto-isearch." |
| 6858 | (with-output-to-temp-buffer "*Help*" | 6880 | " n/p/f/b/u to navigate, q to quit.")))) |
| 6859 | (princ help)) | 6881 | (org-fit-window-to-buffer (get-buffer-window "*Org Help*")) |
| 6860 | (org-fit-window-to-buffer (get-buffer-window "*Help*")) | 6882 | (setq buffer-read-only nil) |
| 6861 | (setq buffer-read-only nil) | 6883 | (let ((org-startup-truncated t) |
| 6862 | (let ((org-startup-truncated t) | 6884 | (org-startup-folded nil) |
| 6863 | (org-startup-folded nil) | 6885 | (org-startup-align-all-tables nil)) |
| 6864 | (org-startup-align-all-tables nil)) | 6886 | (org-mode) |
| 6865 | (org-mode) | 6887 | (org-overview)) |
| 6866 | (org-overview)) | 6888 | (setq buffer-read-only t) |
| 6867 | (setq buffer-read-only t) | 6889 | (if (and (boundp 'org-goto-start-pos) |
| 6868 | (if (and (boundp 'org-goto-start-pos) | 6890 | (integer-or-marker-p org-goto-start-pos)) |
| 6869 | (integer-or-marker-p org-goto-start-pos)) | 6891 | (let ((org-show-hierarchy-above t) |
| 6870 | (let ((org-show-hierarchy-above t) | 6892 | (org-show-siblings t) |
| 6871 | (org-show-siblings t) | 6893 | (org-show-following-heading t)) |
| 6872 | (org-show-following-heading t)) | 6894 | (goto-char org-goto-start-pos) |
| 6873 | (goto-char org-goto-start-pos) | 6895 | (and (outline-invisible-p) (org-show-context))) |
| 6874 | (and (outline-invisible-p) (org-show-context))) | 6896 | (goto-char (point-min))) |
| 6875 | (goto-char (point-min))) | 6897 | (let (org-special-ctrl-a/e) (org-beginning-of-line)) |
| 6876 | (let (org-special-ctrl-a/e) (org-beginning-of-line)) | 6898 | (message "Select location and press RET") |
| 6877 | (message "Select location and press RET") | 6899 | (use-local-map org-goto-map) |
| 6878 | (use-local-map org-goto-map) | 6900 | (recursive-edit))) |
| 6879 | (recursive-edit) | 6901 | (kill-buffer "*org-goto*") |
| 6880 | )) | 6902 | (cons org-goto-selected-point org-goto-exit-command)))) |
| 6881 | (kill-buffer "*org-goto*") | ||
| 6882 | (cons org-goto-selected-point org-goto-exit-command))) | ||
| 6883 | 6903 | ||
| 6884 | (defvar org-goto-local-auto-isearch-map (make-sparse-keymap)) | 6904 | (defvar org-goto-local-auto-isearch-map (make-sparse-keymap)) |
| 6885 | (set-keymap-parent org-goto-local-auto-isearch-map isearch-mode-map) | 6905 | (set-keymap-parent org-goto-local-auto-isearch-map isearch-mode-map) |
| @@ -7672,7 +7692,6 @@ useful if the caller implements cut-and-paste as copy-then-paste-then-cut." | |||
| 7672 | (if (org-called-interactively-p 'any) | 7692 | (if (org-called-interactively-p 'any) |
| 7673 | (org-back-to-heading nil) ; take what looks like a subtree | 7693 | (org-back-to-heading nil) ; take what looks like a subtree |
| 7674 | (org-back-to-heading t)) ; take what is really there | 7694 | (org-back-to-heading t)) ; take what is really there |
| 7675 | (org-back-over-empty-lines) | ||
| 7676 | (setq beg (point)) | 7695 | (setq beg (point)) |
| 7677 | (skip-chars-forward " \t\r\n") | 7696 | (skip-chars-forward " \t\r\n") |
| 7678 | (save-match-data | 7697 | (save-match-data |
| @@ -7682,7 +7701,6 @@ useful if the caller implements cut-and-paste as copy-then-paste-then-cut." | |||
| 7682 | (org-forward-heading-same-level (1- n) t) | 7701 | (org-forward-heading-same-level (1- n) t) |
| 7683 | (error nil)) | 7702 | (error nil)) |
| 7684 | (org-end-of-subtree t t)) | 7703 | (org-end-of-subtree t t)) |
| 7685 | (org-back-over-empty-lines) | ||
| 7686 | (setq end (point)) | 7704 | (setq end (point)) |
| 7687 | (goto-char beg0) | 7705 | (goto-char beg0) |
| 7688 | (when (> end beg) | 7706 | (when (> end beg) |
| @@ -7773,7 +7791,6 @@ the inserted text when done." | |||
| 7773 | (delete-region (point-at-bol) (point))) | 7791 | (delete-region (point-at-bol) (point))) |
| 7774 | ;; Paste | 7792 | ;; Paste |
| 7775 | (beginning-of-line (if (bolp) 1 2)) | 7793 | (beginning-of-line (if (bolp) 1 2)) |
| 7776 | (unless for-yank (org-back-over-empty-lines)) | ||
| 7777 | (setq beg (point)) | 7794 | (setq beg (point)) |
| 7778 | (and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt)) | 7795 | (and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt)) |
| 7779 | (insert-before-markers txt) | 7796 | (insert-before-markers txt) |
| @@ -8630,6 +8647,24 @@ call CMD." | |||
| 8630 | (put-text-property beg end 'org-category-position beg) | 8647 | (put-text-property beg end 'org-category-position beg) |
| 8631 | (goto-char pos))))))) | 8648 | (goto-char pos))))))) |
| 8632 | 8649 | ||
| 8650 | (defun org-refresh-properties (dprop tprop) | ||
| 8651 | "Refresh buffer text properties. | ||
| 8652 | DPROP is the drawer property and TPROP is the corresponding text | ||
| 8653 | property to set." | ||
| 8654 | (let ((case-fold-search t) | ||
| 8655 | (inhibit-read-only t) p) | ||
| 8656 | (org-unmodified | ||
| 8657 | (save-excursion | ||
| 8658 | (save-restriction | ||
| 8659 | (widen) | ||
| 8660 | (goto-char (point-min)) | ||
| 8661 | (while (re-search-forward (concat "^[ \t]*:" dprop ": +\\(.*\\)[ \t]*$") nil t) | ||
| 8662 | (setq p (org-match-string-no-properties 1)) | ||
| 8663 | (save-excursion | ||
| 8664 | (org-back-to-heading t) | ||
| 8665 | (put-text-property | ||
| 8666 | (point-at-bol) (point-at-eol) tprop p)))))))) | ||
| 8667 | |||
| 8633 | 8668 | ||
| 8634 | ;;;; Link Stuff | 8669 | ;;;; Link Stuff |
| 8635 | 8670 | ||
| @@ -8723,7 +8758,7 @@ type. For a simple example of an export function, see `org-bbdb.el'." | |||
| 8723 | (push (list type follow export) org-link-protocols))) | 8758 | (push (list type follow export) org-link-protocols))) |
| 8724 | 8759 | ||
| 8725 | (defvar org-agenda-buffer-name) ; Defined in org-agenda.el | 8760 | (defvar org-agenda-buffer-name) ; Defined in org-agenda.el |
| 8726 | (defvar org-link-to-org-use-id) ; Defined in org-id.el | 8761 | (defvar org-id-link-to-org-use-id) ; Defined in org-id.el |
| 8727 | 8762 | ||
| 8728 | ;;;###autoload | 8763 | ;;;###autoload |
| 8729 | (defun org-store-link (arg) | 8764 | (defun org-store-link (arg) |
| @@ -8839,13 +8874,13 @@ For file links, arg negates `org-context-in-file-links'." | |||
| 8839 | "::" (match-string 1)) | 8874 | "::" (match-string 1)) |
| 8840 | link cpltxt)) | 8875 | link cpltxt)) |
| 8841 | ((and (featurep 'org-id) | 8876 | ((and (featurep 'org-id) |
| 8842 | (or (eq org-link-to-org-use-id t) | 8877 | (or (eq org-id-link-to-org-use-id t) |
| 8843 | (and (org-called-interactively-p 'any) | 8878 | (and (org-called-interactively-p 'any) |
| 8844 | (or (eq org-link-to-org-use-id 'create-if-interactive) | 8879 | (or (eq org-id-link-to-org-use-id 'create-if-interactive) |
| 8845 | (and (eq org-link-to-org-use-id | 8880 | (and (eq org-id-link-to-org-use-id |
| 8846 | 'create-if-interactive-and-no-custom-id) | 8881 | 'create-if-interactive-and-no-custom-id) |
| 8847 | (not custom-id)))) | 8882 | (not custom-id)))) |
| 8848 | (and org-link-to-org-use-id (org-entry-get nil "ID")))) | 8883 | (and org-id-link-to-org-use-id (org-entry-get nil "ID")))) |
| 8849 | ;; We can make a link using the ID. | 8884 | ;; We can make a link using the ID. |
| 8850 | (setq link (condition-case nil | 8885 | (setq link (condition-case nil |
| 8851 | (prog1 (org-id-store-link) | 8886 | (prog1 (org-id-store-link) |
| @@ -9318,10 +9353,11 @@ Use TAB to complete link prefixes, then RET for type-specific completion support | |||
| 9318 | ;; URL-like link, normalize the use of angular brackets. | 9353 | ;; URL-like link, normalize the use of angular brackets. |
| 9319 | (setq link (org-remove-angle-brackets link))) | 9354 | (setq link (org-remove-angle-brackets link))) |
| 9320 | 9355 | ||
| 9321 | ;; Check if we are linking to the current file with a search option | 9356 | ;; Check if we are linking to the current file with a search |
| 9322 | ;; If yes, simplify the link by using only the search option. | 9357 | ;; option If yes, simplify the link by using only the search |
| 9358 | ;; option. | ||
| 9323 | (when (and buffer-file-name | 9359 | (when (and buffer-file-name |
| 9324 | (string-match "^file:\\(.+?\\)::\\([^>]+\\)" link)) | 9360 | (string-match "^file:\\(.+?\\)::\\(.+\\)" link)) |
| 9325 | (let* ((path (match-string 1 link)) | 9361 | (let* ((path (match-string 1 link)) |
| 9326 | (case-fold-search nil) | 9362 | (case-fold-search nil) |
| 9327 | (search (match-string 2 link))) | 9363 | (search (match-string 2 link))) |
| @@ -9652,7 +9688,15 @@ application the system uses for this file type." | |||
| 9652 | org-angle-link-re "\\|" | 9688 | org-angle-link-re "\\|" |
| 9653 | "[ \t]:[^ \t\n]+:[ \t]*$"))) | 9689 | "[ \t]:[^ \t\n]+:[ \t]*$"))) |
| 9654 | (not (get-text-property (point) 'org-linked-text))) | 9690 | (not (get-text-property (point) 'org-linked-text))) |
| 9655 | (or (org-offer-links-in-entry arg) | 9691 | (or (let* ((lkall (org-offer-links-in-entry (current-buffer) (point) arg)) |
| 9692 | (lk0 (car lkall)) | ||
| 9693 | (lk (if (stringp lk0) (list lk0) lk0)) | ||
| 9694 | (lkend (cdr lkall))) | ||
| 9695 | (mapcar (lambda(l) | ||
| 9696 | (search-forward l nil lkend) | ||
| 9697 | (goto-char (match-beginning 0)) | ||
| 9698 | (org-open-at-point)) | ||
| 9699 | lk)) | ||
| 9656 | (progn (require 'org-attach) (org-attach-reveal 'if-exists)))) | 9700 | (progn (require 'org-attach) (org-attach-reveal 'if-exists)))) |
| 9657 | ((run-hook-with-args-until-success 'org-open-at-point-functions)) | 9701 | ((run-hook-with-args-until-success 'org-open-at-point-functions)) |
| 9658 | ((and (org-at-timestamp-p t) | 9702 | ((and (org-at-timestamp-p t) |
| @@ -9695,12 +9739,13 @@ application the system uses for this file type." | |||
| 9695 | (throw 'match t)) | 9739 | (throw 'match t)) |
| 9696 | 9740 | ||
| 9697 | (save-excursion | 9741 | (save-excursion |
| 9698 | (when (or (org-in-regexp org-angle-link-re) | 9742 | (let ((plinkpos (org-in-regexp org-plain-link-re))) |
| 9699 | (and (goto-char (car (org-in-regexp org-plain-link-re))) | 9743 | (when (or (org-in-regexp org-angle-link-re) |
| 9700 | (save-match-data (not (looking-back "\\[\\["))))) | 9744 | (and plinkpos (goto-char (car plinkpos)) |
| 9701 | (setq type (match-string 1) | 9745 | (save-match-data (not (looking-back "\\[\\["))))) |
| 9702 | path (org-link-unescape (match-string 2))) | 9746 | (setq type (match-string 1) |
| 9703 | (throw 'match t))) | 9747 | path (org-link-unescape (match-string 2))) |
| 9748 | (throw 'match t)))) | ||
| 9704 | (save-excursion | 9749 | (save-excursion |
| 9705 | (when (org-in-regexp (org-re "\\(:[[:alnum:]_@#%:]+\\):[ \t]*$")) | 9750 | (when (org-in-regexp (org-re "\\(:[[:alnum:]_@#%:]+\\):[ \t]*$")) |
| 9706 | (setq type "tags" | 9751 | (setq type "tags" |
| @@ -9713,7 +9758,7 @@ application the system uses for this file type." | |||
| 9713 | path (match-string 1)) | 9758 | path (match-string 1)) |
| 9714 | (throw 'match t))) | 9759 | (throw 'match t))) |
| 9715 | (unless path | 9760 | (unless path |
| 9716 | (error "No link found")) | 9761 | (user-error "No link found")) |
| 9717 | 9762 | ||
| 9718 | ;; switch back to reference buffer | 9763 | ;; switch back to reference buffer |
| 9719 | ;; needed when if called in a temporary buffer through | 9764 | ;; needed when if called in a temporary buffer through |
| @@ -9847,68 +9892,67 @@ application the system uses for this file type." | |||
| 9847 | (move-marker org-open-link-marker nil) | 9892 | (move-marker org-open-link-marker nil) |
| 9848 | (run-hook-with-args 'org-follow-link-hook))) | 9893 | (run-hook-with-args 'org-follow-link-hook))) |
| 9849 | 9894 | ||
| 9850 | (defun org-offer-links-in-entry (&optional nth zero) | 9895 | (defun org-offer-links-in-entry (buffer marker &optional nth zero) |
| 9851 | "Offer links in the current entry and follow the selected link. | 9896 | "Offer links in the current entry and return the selected link. |
| 9852 | If there is only one link, follow it immediately as well. | 9897 | If there is only one link, return it. |
| 9853 | If NTH is an integer, immediately pick the NTH link found. | 9898 | If NTH is an integer, return the NTH link found. |
| 9854 | If ZERO is a string, check also this string for a link, and if | 9899 | If ZERO is a string, check also this string for a link, and if |
| 9855 | there is one, offer it as link number zero." | 9900 | there is one, return it." |
| 9856 | (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|" | 9901 | (with-current-buffer buffer |
| 9857 | "\\(" org-angle-link-re "\\)\\|" | ||
| 9858 | "\\(" org-plain-link-re "\\)")) | ||
| 9859 | (cnt ?0) | ||
| 9860 | (in-emacs (if (integerp nth) nil nth)) | ||
| 9861 | have-zero end links link c) | ||
| 9862 | (when (and (stringp zero) (string-match org-bracket-link-regexp zero)) | ||
| 9863 | (push (match-string 0 zero) links) | ||
| 9864 | (setq cnt (1- cnt) have-zero t)) | ||
| 9865 | (save-excursion | 9902 | (save-excursion |
| 9866 | (org-back-to-heading t) | 9903 | (save-restriction |
| 9867 | (setq end (save-excursion (outline-next-heading) (point))) | 9904 | (widen) |
| 9868 | (while (re-search-forward re end t) | 9905 | (goto-char marker) |
| 9869 | (push (match-string 0) links)) | 9906 | (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|" |
| 9870 | (setq links (org-uniquify (reverse links)))) | 9907 | "\\(" org-angle-link-re "\\)\\|" |
| 9871 | 9908 | "\\(" org-plain-link-re "\\)")) | |
| 9872 | (cond | 9909 | (cnt ?0) |
| 9873 | ((null links) | 9910 | (in-emacs (if (integerp nth) nil nth)) |
| 9874 | (message "No links")) | 9911 | have-zero end links link c) |
| 9875 | ((equal (length links) 1) | 9912 | (when (and (stringp zero) (string-match org-bracket-link-regexp zero)) |
| 9876 | (setq link (list (car links)))) | 9913 | (push (match-string 0 zero) links) |
| 9877 | ((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth))) | 9914 | (setq cnt (1- cnt) have-zero t)) |
| 9878 | (setq link (list (nth (if have-zero nth (1- nth)) links)))) | 9915 | (save-excursion |
| 9879 | (t ; we have to select a link | 9916 | (org-back-to-heading t) |
| 9880 | (save-excursion | 9917 | (setq end (save-excursion (outline-next-heading) (point))) |
| 9881 | (save-window-excursion | 9918 | (while (re-search-forward re end t) |
| 9882 | (delete-other-windows) | 9919 | (push (match-string 0) links)) |
| 9883 | (with-output-to-temp-buffer "*Select Link*" | 9920 | (setq links (org-uniquify (reverse links)))) |
| 9884 | (mapc (lambda (l) | 9921 | (cond |
| 9885 | (if (not (string-match org-bracket-link-regexp l)) | 9922 | ((null links) |
| 9886 | (princ (format "[%c] %s\n" (incf cnt) | 9923 | (message "No links")) |
| 9887 | (org-remove-angle-brackets l))) | 9924 | ((equal (length links) 1) |
| 9888 | (if (match-end 3) | 9925 | (setq link (car links))) |
| 9889 | (princ (format "[%c] %s (%s)\n" (incf cnt) | 9926 | ((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth))) |
| 9890 | (match-string 3 l) (match-string 1 l))) | 9927 | (setq link (nth (if have-zero nth (1- nth)) links))) |
| 9891 | (princ (format "[%c] %s\n" (incf cnt) | 9928 | (t ; we have to select a link |
| 9892 | (match-string 1 l)))))) | 9929 | (save-excursion |
| 9893 | links)) | 9930 | (save-window-excursion |
| 9894 | (org-fit-window-to-buffer (get-buffer-window "*Select Link*")) | 9931 | (delete-other-windows) |
| 9895 | (message "Select link to open, RET to open all:") | 9932 | (with-output-to-temp-buffer "*Select Link*" |
| 9896 | (setq c (read-char-exclusive)) | 9933 | (mapc (lambda (l) |
| 9897 | (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*")))) | 9934 | (if (not (string-match org-bracket-link-regexp l)) |
| 9898 | (when (equal c ?q) (error "Abort")) | 9935 | (princ (format "[%c] %s\n" (incf cnt) |
| 9899 | (if (equal c ?\C-m) | 9936 | (org-remove-angle-brackets l))) |
| 9900 | (setq link links) | 9937 | (if (match-end 3) |
| 9901 | (setq nth (- c ?0)) | 9938 | (princ (format "[%c] %s (%s)\n" (incf cnt) |
| 9902 | (if have-zero (setq nth (1+ nth))) | 9939 | (match-string 3 l) (match-string 1 l))) |
| 9903 | (unless (and (integerp nth) (>= (length links) nth)) | 9940 | (princ (format "[%c] %s\n" (incf cnt) |
| 9904 | (error "Invalid link selection")) | 9941 | (match-string 1 l)))))) |
| 9905 | (setq link (list (nth (1- nth) links)))))) | 9942 | links)) |
| 9906 | (if link | 9943 | (org-fit-window-to-buffer (get-buffer-window "*Select Link*")) |
| 9907 | (let ((buf (current-buffer))) | 9944 | (message "Select link to open, RET to open all:") |
| 9908 | (dolist (l link) | 9945 | (setq c (read-char-exclusive)) |
| 9909 | (org-open-link-from-string l in-emacs buf)) | 9946 | (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*")))) |
| 9910 | t) | 9947 | (when (equal c ?q) (error "Abort")) |
| 9911 | nil))) | 9948 | (if (equal c ?\C-m) |
| 9949 | (setq link links) | ||
| 9950 | (setq nth (- c ?0)) | ||
| 9951 | (if have-zero (setq nth (1+ nth))) | ||
| 9952 | (unless (and (integerp nth) (>= (length links) nth)) | ||
| 9953 | (error "Invalid link selection")) | ||
| 9954 | (setq link (nth (1- nth) links))))) | ||
| 9955 | (cons link end)))))) | ||
| 9912 | 9956 | ||
| 9913 | ;; Add special file links that specify the way of opening | 9957 | ;; Add special file links that specify the way of opening |
| 9914 | 9958 | ||
| @@ -9930,12 +9974,6 @@ there is one, offer it as link number zero." | |||
| 9930 | '(add-hook 'org-export-preprocess-before-normalizing-links-hook | 9974 | '(add-hook 'org-export-preprocess-before-normalizing-links-hook |
| 9931 | 'org-remove-file-link-modifiers)) | 9975 | 'org-remove-file-link-modifiers)) |
| 9932 | 9976 | ||
| 9933 | ;;;; Time estimates | ||
| 9934 | |||
| 9935 | (defun org-get-effort (&optional pom) | ||
| 9936 | "Get the effort estimate for the current entry." | ||
| 9937 | (org-entry-get pom org-effort-property)) | ||
| 9938 | |||
| 9939 | ;;; File search | 9977 | ;;; File search |
| 9940 | 9978 | ||
| 9941 | (defvar org-create-file-search-functions nil | 9979 | (defvar org-create-file-search-functions nil |
| @@ -11259,8 +11297,7 @@ This function can be used in a hook." | |||
| 11259 | " +" t))) | 11297 | " +" t))) |
| 11260 | 11298 | ||
| 11261 | (defcustom org-structure-template-alist | 11299 | (defcustom org-structure-template-alist |
| 11262 | '( | 11300 | '(("s" "#+BEGIN_SRC ?\n\n#+END_SRC" |
| 11263 | ("s" "#+BEGIN_SRC ?\n\n#+END_SRC" | ||
| 11264 | "<src lang=\"?\">\n\n</src>") | 11301 | "<src lang=\"?\">\n\n</src>") |
| 11265 | ("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE" | 11302 | ("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE" |
| 11266 | "<example>\n?\n</example>") | 11303 | "<example>\n?\n</example>") |
| @@ -11268,6 +11305,8 @@ This function can be used in a hook." | |||
| 11268 | "<quote>\n?\n</quote>") | 11305 | "<quote>\n?\n</quote>") |
| 11269 | ("v" "#+BEGIN_VERSE\n?\n#+END_VERSE" | 11306 | ("v" "#+BEGIN_VERSE\n?\n#+END_VERSE" |
| 11270 | "<verse>\n?\n</verse>") | 11307 | "<verse>\n?\n</verse>") |
| 11308 | ("V" "#+BEGIN_VERBATIM\n?\n#+END_VERBATIM" | ||
| 11309 | "<verbatim>\n?\n</verbatim>") | ||
| 11271 | ("c" "#+BEGIN_CENTER\n?\n#+END_CENTER" | 11310 | ("c" "#+BEGIN_CENTER\n?\n#+END_CENTER" |
| 11272 | "<center>\n?\n</center>") | 11311 | "<center>\n?\n</center>") |
| 11273 | ("l" "#+BEGIN_LaTeX\n?\n#+END_LaTeX" | 11312 | ("l" "#+BEGIN_LaTeX\n?\n#+END_LaTeX" |
| @@ -11283,8 +11322,7 @@ This function can be used in a hook." | |||
| 11283 | ("i" "#+INDEX: ?" | 11322 | ("i" "#+INDEX: ?" |
| 11284 | "#+INDEX: ?") | 11323 | "#+INDEX: ?") |
| 11285 | ("I" "#+INCLUDE: %file ?" | 11324 | ("I" "#+INCLUDE: %file ?" |
| 11286 | "<include file=%file markup=\"?\">") | 11325 | "<include file=%file markup=\"?\">")) |
| 11287 | ) | ||
| 11288 | "Structure completion elements. | 11326 | "Structure completion elements. |
| 11289 | This is a list of abbreviation keys and values. The value gets inserted | 11327 | This is a list of abbreviation keys and values. The value gets inserted |
| 11290 | if you type `<' followed by the key and then press the completion key, | 11328 | if you type `<' followed by the key and then press the completion key, |
| @@ -11439,7 +11477,8 @@ For calling through lisp, arg is also interpreted in the following way: | |||
| 11439 | cl (if (outline-invisible-p) (org-end-of-subtree nil t)))) | 11477 | cl (if (outline-invisible-p) (org-end-of-subtree nil t)))) |
| 11440 | (if (equal arg '(16)) (setq arg 'nextset)) | 11478 | (if (equal arg '(16)) (setq arg 'nextset)) |
| 11441 | (let ((org-blocker-hook org-blocker-hook) | 11479 | (let ((org-blocker-hook org-blocker-hook) |
| 11442 | (case-fold-search nil)) | 11480 | commentp |
| 11481 | case-fold-search) | ||
| 11443 | (when (equal arg '(64)) | 11482 | (when (equal arg '(64)) |
| 11444 | (setq arg nil org-blocker-hook nil)) | 11483 | (setq arg nil org-blocker-hook nil)) |
| 11445 | (when (and org-blocker-hook | 11484 | (when (and org-blocker-hook |
| @@ -11449,6 +11488,9 @@ For calling through lisp, arg is also interpreted in the following way: | |||
| 11449 | (save-excursion | 11488 | (save-excursion |
| 11450 | (catch 'exit | 11489 | (catch 'exit |
| 11451 | (org-back-to-heading t) | 11490 | (org-back-to-heading t) |
| 11491 | (when (looking-at (concat "^\\*+ " org-comment-string)) | ||
| 11492 | (org-toggle-comment) | ||
| 11493 | (setq commentp t)) | ||
| 11452 | (if (looking-at org-outline-regexp) (goto-char (1- (match-end 0)))) | 11494 | (if (looking-at org-outline-regexp) (goto-char (1- (match-end 0)))) |
| 11453 | (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)")) | 11495 | (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)")) |
| 11454 | (looking-at "\\(?: *\\|[ \t]*$\\)")) | 11496 | (looking-at "\\(?: *\\|[ \t]*$\\)")) |
| @@ -11624,7 +11666,8 @@ For calling through lisp, arg is also interpreted in the following way: | |||
| 11624 | (and (looking-at " ") (just-one-space)))) | 11666 | (and (looking-at " ") (just-one-space)))) |
| 11625 | (when org-trigger-hook | 11667 | (when org-trigger-hook |
| 11626 | (save-excursion | 11668 | (save-excursion |
| 11627 | (run-hook-with-args 'org-trigger-hook change-plist))))))))) | 11669 | (run-hook-with-args 'org-trigger-hook change-plist))) |
| 11670 | (when commentp (org-toggle-comment)))))))) | ||
| 11628 | 11671 | ||
| 11629 | (defun org-block-todo-from-children-or-siblings-or-parent (change-plist) | 11672 | (defun org-block-todo-from-children-or-siblings-or-parent (change-plist) |
| 11630 | "Block turning an entry into a TODO, using the hierarchy. | 11673 | "Block turning an entry into a TODO, using the hierarchy. |
| @@ -11765,15 +11808,16 @@ changes because there are unchecked boxes in this entry." | |||
| 11765 | 11808 | ||
| 11766 | (defun org-entry-blocked-p () | 11809 | (defun org-entry-blocked-p () |
| 11767 | "Is the current entry blocked?" | 11810 | "Is the current entry blocked?" |
| 11768 | (if (org-entry-get nil "NOBLOCKING") | 11811 | (org-with-buffer-modified-unmodified |
| 11769 | nil ;; Never block this entry | 11812 | (if (org-entry-get nil "NOBLOCKING") |
| 11770 | (not | 11813 | nil ;; Never block this entry |
| 11771 | (run-hook-with-args-until-failure | 11814 | (not |
| 11772 | 'org-blocker-hook | 11815 | (run-hook-with-args-until-failure |
| 11773 | (list :type 'todo-state-change | 11816 | 'org-blocker-hook |
| 11774 | :position (point) | 11817 | (list :type 'todo-state-change |
| 11775 | :from 'todo | 11818 | :position (point) |
| 11776 | :to 'done))))) | 11819 | :from 'todo |
| 11820 | :to 'done)))))) | ||
| 11777 | 11821 | ||
| 11778 | (defun org-update-statistics-cookies (all) | 11822 | (defun org-update-statistics-cookies (all) |
| 11779 | "Update the statistics cookie, either from TODO or from checkboxes. | 11823 | "Update the statistics cookie, either from TODO or from checkboxes. |
| @@ -11785,7 +11829,7 @@ This should be called with the cursor in a line with a statistics cookie." | |||
| 11785 | (org-map-entries 'org-update-parent-todo-statistics)) | 11829 | (org-map-entries 'org-update-parent-todo-statistics)) |
| 11786 | (if (not (org-at-heading-p)) | 11830 | (if (not (org-at-heading-p)) |
| 11787 | (org-update-checkbox-count) | 11831 | (org-update-checkbox-count) |
| 11788 | (let ((pos (move-marker (make-marker) (point))) | 11832 | (let ((pos (point-marker)) |
| 11789 | end l1 l2) | 11833 | end l1 l2) |
| 11790 | (ignore-errors (org-back-to-heading t)) | 11834 | (ignore-errors (org-back-to-heading t)) |
| 11791 | (if (not (org-at-heading-p)) | 11835 | (if (not (org-at-heading-p)) |
| @@ -12666,7 +12710,7 @@ D Show deadlines and scheduled items between a date range." | |||
| 12666 | (let (ans kwd value ts-type) | 12710 | (let (ans kwd value ts-type) |
| 12667 | (setq type (or type org-sparse-tree-default-date-type)) | 12711 | (setq type (or type org-sparse-tree-default-date-type)) |
| 12668 | (setq org-ts-type type) | 12712 | (setq org-ts-type type) |
| 12669 | (message "Sparse tree: [r]egexp [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty\n [d]eadlines [b]efore-date [a]fter-date [D]ates range\n [c]ycle through date types: %s" | 12713 | (message "Sparse tree: [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty\n [d]eadlines [b]efore-date [a]fter-date [D]ates range\n [c]ycle through date types: %s" |
| 12670 | (cond ((eq type 'all) "all timestamps") | 12714 | (cond ((eq type 'all) "all timestamps") |
| 12671 | ((eq type 'scheduled) "only scheduled") | 12715 | ((eq type 'scheduled) "only scheduled") |
| 12672 | ((eq type 'deadline) "only deadline") | 12716 | ((eq type 'deadline) "only deadline") |
| @@ -12981,9 +13025,9 @@ and by additional input from the age of a schedules or deadline entry." | |||
| 12981 | 13025 | ||
| 12982 | (defun org-get-priority (s) | 13026 | (defun org-get-priority (s) |
| 12983 | "Find priority cookie and return priority." | 13027 | "Find priority cookie and return priority." |
| 12984 | (if (functionp org-get-priority-function) | 13028 | (save-match-data |
| 12985 | (funcall org-get-priority-function) | 13029 | (if (functionp org-get-priority-function) |
| 12986 | (save-match-data | 13030 | (funcall org-get-priority-function) |
| 12987 | (if (not (string-match org-priority-regexp s)) | 13031 | (if (not (string-match org-priority-regexp s)) |
| 12988 | (* 1000 (- org-lowest-priority org-default-priority)) | 13032 | (* 1000 (- org-lowest-priority org-default-priority)) |
| 12989 | (* 1000 (- org-lowest-priority | 13033 | (* 1000 (- org-lowest-priority |
| @@ -13113,18 +13157,9 @@ headlines matching this string." | |||
| 13113 | (or (not todo-only) | 13157 | (or (not todo-only) |
| 13114 | (and (member todo org-not-done-keywords) | 13158 | (and (member todo org-not-done-keywords) |
| 13115 | (or (not org-agenda-tags-todo-honor-ignore-options) | 13159 | (or (not org-agenda-tags-todo-honor-ignore-options) |
| 13116 | (not (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))))) | 13160 | (not (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)))))) |
| 13117 | |||
| 13118 | ;; Extra check for the archive tag | ||
| 13119 | ;; FIXME: Does the skipper already do this???? | ||
| 13120 | (or | ||
| 13121 | (not (member org-archive-tag tags-list)) | ||
| 13122 | ;; we have an archive tag, should we use this anyway? | ||
| 13123 | (or (not org-agenda-skip-archived-trees) | ||
| 13124 | (and (eq action 'agenda) org-agenda-archives-mode)))) | ||
| 13125 | 13161 | ||
| 13126 | ;; select this headline | 13162 | ;; select this headline |
| 13127 | |||
| 13128 | (cond | 13163 | (cond |
| 13129 | ((eq action 'sparse-tree) | 13164 | ((eq action 'sparse-tree) |
| 13130 | (and org-highlight-sparse-tree-matches | 13165 | (and org-highlight-sparse-tree-matches |
| @@ -13496,7 +13531,10 @@ ignore inherited ones." | |||
| 13496 | (error nil))))) | 13531 | (error nil))))) |
| 13497 | (if local | 13532 | (if local |
| 13498 | tags | 13533 | tags |
| 13499 | (append (org-remove-uninherited-tags org-file-tags) tags)))))) | 13534 | (reverse (delete-dups |
| 13535 | (reverse (append | ||
| 13536 | (org-remove-uninherited-tags | ||
| 13537 | org-file-tags) tags))))))))) | ||
| 13500 | 13538 | ||
| 13501 | (defun org-add-prop-inherited (s) | 13539 | (defun org-add-prop-inherited (s) |
| 13502 | (add-text-properties 0 (length s) '(inherited t) s) | 13540 | (add-text-properties 0 (length s) '(inherited t) s) |
| @@ -14276,6 +14314,9 @@ When INCREMENT is non-nil, set the property to the next allowed value." | |||
| 14276 | existing nil nil "" nil cur)))))) | 14314 | existing nil nil "" nil cur)))))) |
| 14277 | (unless (equal (org-entry-get nil prop) val) | 14315 | (unless (equal (org-entry-get nil prop) val) |
| 14278 | (org-entry-put nil prop val)) | 14316 | (org-entry-put nil prop val)) |
| 14317 | (save-excursion | ||
| 14318 | (org-back-to-heading t) | ||
| 14319 | (put-text-property (point-at-bol) (point-at-eol) 'org-effort val)) | ||
| 14279 | (message "%s is now %s" prop val))) | 14320 | (message "%s is now %s" prop val))) |
| 14280 | 14321 | ||
| 14281 | (defun org-at-property-p () | 14322 | (defun org-at-property-p () |
| @@ -14454,26 +14495,27 @@ when a \"nil\" value can supersede a non-nil value higher up the hierarchy." | |||
| 14454 | ;; We need a special property. Use `org-entry-properties' to | 14495 | ;; We need a special property. Use `org-entry-properties' to |
| 14455 | ;; retrieve it, but specify the wanted property | 14496 | ;; retrieve it, but specify the wanted property |
| 14456 | (cdr (assoc property (org-entry-properties nil 'special property))) | 14497 | (cdr (assoc property (org-entry-properties nil 'special property))) |
| 14457 | (let* ((range (org-get-property-block)) | 14498 | (let ((range (org-get-property-block))) |
| 14458 | (props (list (or (assoc property org-file-properties) | 14499 | (when (and range (not (eq (car range) (cdr range)))) |
| 14459 | (assoc property org-global-properties) | 14500 | (let* ((props (list (or (assoc property org-file-properties) |
| 14460 | (assoc property org-global-properties-fixed)))) | 14501 | (assoc property org-global-properties) |
| 14461 | (ap (lambda (key) | 14502 | (assoc property org-global-properties-fixed)))) |
| 14462 | (when (re-search-forward | 14503 | (ap (lambda (key) |
| 14463 | (org-re-property key) (cdr range) t) | 14504 | (when (re-search-forward |
| 14464 | (setq props | 14505 | (org-re-property key) (cdr range) t) |
| 14465 | (org-update-property-plist | 14506 | (setq props |
| 14466 | key | 14507 | (org-update-property-plist |
| 14467 | (if (match-end 1) | 14508 | key |
| 14468 | (org-match-string-no-properties 1) "") | 14509 | (if (match-end 1) |
| 14469 | props))))) | 14510 | (org-match-string-no-properties 1) "") |
| 14470 | val) | 14511 | props))))) |
| 14471 | (when (and range (goto-char (car range))) | 14512 | val) |
| 14472 | (funcall ap property) | 14513 | (goto-char (car range)) |
| 14473 | (goto-char (car range)) | 14514 | (funcall ap property) |
| 14474 | (while (funcall ap (concat property "+"))) | 14515 | (goto-char (car range)) |
| 14475 | (setq val (cdr (assoc property props))) | 14516 | (while (funcall ap (concat property "+"))) |
| 14476 | (when val (if literal-nil val (org-not-nil val))))))))) | 14517 | (setq val (cdr (assoc property props))) |
| 14518 | (when val (if literal-nil val (org-not-nil val)))))))))) | ||
| 14477 | 14519 | ||
| 14478 | (defun org-property-or-variable-value (var &optional inherit) | 14520 | (defun org-property-or-variable-value (var &optional inherit) |
| 14479 | "Check if there is a property fixing the value of VAR. | 14521 | "Check if there is a property fixing the value of VAR. |
| @@ -14996,7 +15038,8 @@ completion." | |||
| 14996 | (interactive) | 15038 | (interactive) |
| 14997 | (unless (org-at-property-p) | 15039 | (unless (org-at-property-p) |
| 14998 | (error "Not at a property")) | 15040 | (error "Not at a property")) |
| 14999 | (let* ((key (match-string 2)) | 15041 | (let* ((prop (car (save-match-data (org-split-string (match-string 1) ":")))) |
| 15042 | (key (match-string 2)) | ||
| 15000 | (value (match-string 3)) | 15043 | (value (match-string 3)) |
| 15001 | (allowed (or (org-property-get-allowed-values (point) key) | 15044 | (allowed (or (org-property-get-allowed-values (point) key) |
| 15002 | (and (member value '("[ ]" "[-]" "[X]")) | 15045 | (and (member value '("[ ]" "[-]" "[X]")) |
| @@ -15015,6 +15058,10 @@ completion." | |||
| 15015 | (org-indent-line) | 15058 | (org-indent-line) |
| 15016 | (beginning-of-line 1) | 15059 | (beginning-of-line 1) |
| 15017 | (skip-chars-forward " \t") | 15060 | (skip-chars-forward " \t") |
| 15061 | (when (equal prop org-effort-property) | ||
| 15062 | (save-excursion | ||
| 15063 | (org-back-to-heading t) | ||
| 15064 | (put-text-property (point-at-bol) (point-at-eol) 'org-effort nval))) | ||
| 15018 | (run-hook-with-args 'org-property-changed-functions key nval))) | 15065 | (run-hook-with-args 'org-property-changed-functions key nval))) |
| 15019 | 15066 | ||
| 15020 | (defun org-find-olp (path &optional this-buffer) | 15067 | (defun org-find-olp (path &optional this-buffer) |
| @@ -15060,7 +15107,7 @@ only headings." | |||
| 15060 | (setq lmin (1+ flevel) lmax (+ lmin (if org-odd-levels-only 1 0))) | 15107 | (setq lmin (1+ flevel) lmax (+ lmin (if org-odd-levels-only 1 0))) |
| 15061 | (setq end (save-excursion (org-end-of-subtree t t)))) | 15108 | (setq end (save-excursion (org-end-of-subtree t t)))) |
| 15062 | (when (org-at-heading-p) | 15109 | (when (org-at-heading-p) |
| 15063 | (move-marker (make-marker) (point)))))))) | 15110 | (point-marker))))))) |
| 15064 | 15111 | ||
| 15065 | (defun org-find-exact-headline-in-buffer (heading &optional buffer pos-only) | 15112 | (defun org-find-exact-headline-in-buffer (heading &optional buffer pos-only) |
| 15066 | "Find node HEADING in BUFFER. | 15113 | "Find node HEADING in BUFFER. |
| @@ -15307,6 +15354,7 @@ user." | |||
| 15307 | (setcar (nthcdr 1 org-defdecode) 59) | 15354 | (setcar (nthcdr 1 org-defdecode) 59) |
| 15308 | (setq org-def (apply 'encode-time org-defdecode) | 15355 | (setq org-def (apply 'encode-time org-defdecode) |
| 15309 | org-defdecode (decode-time org-def))))) | 15356 | org-defdecode (decode-time org-def))))) |
| 15357 | (mouse-autoselect-window nil) ; Don't let the mouse jump | ||
| 15310 | (calendar-frame-setup nil) | 15358 | (calendar-frame-setup nil) |
| 15311 | (calendar-setup nil) | 15359 | (calendar-setup nil) |
| 15312 | (calendar-move-hook nil) | 15360 | (calendar-move-hook nil) |
| @@ -16966,6 +17014,8 @@ When a buffer is unmodified, it is just killed. When modified, it is saved | |||
| 16966 | (widen) | 17014 | (widen) |
| 16967 | (setq bmp (buffer-modified-p)) | 17015 | (setq bmp (buffer-modified-p)) |
| 16968 | (org-refresh-category-properties) | 17016 | (org-refresh-category-properties) |
| 17017 | (org-refresh-properties org-effort-property 'org-effort) | ||
| 17018 | (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime) | ||
| 16969 | (setq org-todo-keywords-for-agenda | 17019 | (setq org-todo-keywords-for-agenda |
| 16970 | (append org-todo-keywords-for-agenda org-todo-keywords-1)) | 17020 | (append org-todo-keywords-for-agenda org-todo-keywords-1)) |
| 16971 | (setq org-done-keywords-for-agenda | 17021 | (setq org-done-keywords-for-agenda |
| @@ -18053,7 +18103,7 @@ BEG and END default to the buffer boundaries." | |||
| 18053 | ("c" . org-cycle) | 18103 | ("c" . org-cycle) |
| 18054 | ("C" . org-shifttab) | 18104 | ("C" . org-shifttab) |
| 18055 | (" " . org-display-outline-path) | 18105 | (" " . org-display-outline-path) |
| 18056 | (":" . org-columns) | 18106 | ("=" . org-columns) |
| 18057 | ("Outline Structure Editing") | 18107 | ("Outline Structure Editing") |
| 18058 | ("U" . org-shiftmetaup) | 18108 | ("U" . org-shiftmetaup) |
| 18059 | ("D" . org-shiftmetadown) | 18109 | ("D" . org-shiftmetadown) |
| @@ -18078,7 +18128,7 @@ BEG and END default to the buffer boundaries." | |||
| 18078 | ("1" . (org-priority ?A)) | 18128 | ("1" . (org-priority ?A)) |
| 18079 | ("2" . (org-priority ?B)) | 18129 | ("2" . (org-priority ?B)) |
| 18080 | ("3" . (org-priority ?C)) | 18130 | ("3" . (org-priority ?C)) |
| 18081 | (";" . org-set-tags-command) | 18131 | (":" . org-set-tags-command) |
| 18082 | ("e" . org-set-effort) | 18132 | ("e" . org-set-effort) |
| 18083 | ("E" . org-inc-effort) | 18133 | ("E" . org-inc-effort) |
| 18084 | ("W" . (lambda(m) (interactive "sMinutes before warning: ") | 18134 | ("W" . (lambda(m) (interactive "sMinutes before warning: ") |
| @@ -18296,25 +18346,26 @@ front of the next \"|\" separator, to keep the table aligned. The table will | |||
| 18296 | still be marked for re-alignment if the field did fill the entire column, | 18346 | still be marked for re-alignment if the field did fill the entire column, |
| 18297 | because, in this case the deletion might narrow the column." | 18347 | because, in this case the deletion might narrow the column." |
| 18298 | (interactive "p") | 18348 | (interactive "p") |
| 18299 | (org-check-before-invisible-edit 'delete-backward) | 18349 | (save-match-data |
| 18300 | (if (and (org-table-p) | 18350 | (org-check-before-invisible-edit 'delete-backward) |
| 18301 | (eq N 1) | 18351 | (if (and (org-table-p) |
| 18302 | (string-match "|" (buffer-substring (point-at-bol) (point))) | 18352 | (eq N 1) |
| 18303 | (looking-at ".*?|")) | 18353 | (string-match "|" (buffer-substring (point-at-bol) (point))) |
| 18304 | (let ((pos (point)) | 18354 | (looking-at ".*?|")) |
| 18305 | (noalign (looking-at "[^|\n\r]* |")) | 18355 | (let ((pos (point)) |
| 18306 | (c org-table-may-need-update)) | 18356 | (noalign (looking-at "[^|\n\r]* |")) |
| 18307 | (backward-delete-char N) | 18357 | (c org-table-may-need-update)) |
| 18308 | (if (not overwrite-mode) | 18358 | (backward-delete-char N) |
| 18309 | (progn | 18359 | (if (not overwrite-mode) |
| 18310 | (skip-chars-forward "^|") | 18360 | (progn |
| 18311 | (insert " ") | 18361 | (skip-chars-forward "^|") |
| 18312 | (goto-char (1- pos)))) | 18362 | (insert " ") |
| 18313 | ;; noalign: if there were two spaces at the end, this field | 18363 | (goto-char (1- pos)))) |
| 18314 | ;; does not determine the width of the column. | 18364 | ;; noalign: if there were two spaces at the end, this field |
| 18315 | (if noalign (setq org-table-may-need-update c))) | 18365 | ;; does not determine the width of the column. |
| 18316 | (backward-delete-char N) | 18366 | (if noalign (setq org-table-may-need-update c))) |
| 18317 | (org-fix-tags-on-the-fly))) | 18367 | (backward-delete-char N) |
| 18368 | (org-fix-tags-on-the-fly)))) | ||
| 18318 | 18369 | ||
| 18319 | (defun org-delete-char (N) | 18370 | (defun org-delete-char (N) |
| 18320 | "Like `delete-char', but insert whitespace at field end in tables. | 18371 | "Like `delete-char', but insert whitespace at field end in tables. |
| @@ -18323,25 +18374,26 @@ front of the next \"|\" separator, to keep the table aligned. The table will | |||
| 18323 | still be marked for re-alignment if the field did fill the entire column, | 18374 | still be marked for re-alignment if the field did fill the entire column, |
| 18324 | because, in this case the deletion might narrow the column." | 18375 | because, in this case the deletion might narrow the column." |
| 18325 | (interactive "p") | 18376 | (interactive "p") |
| 18326 | (org-check-before-invisible-edit 'delete) | 18377 | (save-match-data |
| 18327 | (if (and (org-table-p) | 18378 | (org-check-before-invisible-edit 'delete) |
| 18328 | (not (bolp)) | 18379 | (if (and (org-table-p) |
| 18329 | (not (= (char-after) ?|)) | 18380 | (not (bolp)) |
| 18330 | (eq N 1)) | 18381 | (not (= (char-after) ?|)) |
| 18331 | (if (looking-at ".*?|") | 18382 | (eq N 1)) |
| 18332 | (let ((pos (point)) | 18383 | (if (looking-at ".*?|") |
| 18333 | (noalign (looking-at "[^|\n\r]* |")) | 18384 | (let ((pos (point)) |
| 18334 | (c org-table-may-need-update)) | 18385 | (noalign (looking-at "[^|\n\r]* |")) |
| 18335 | (replace-match (concat | 18386 | (c org-table-may-need-update)) |
| 18336 | (substring (match-string 0) 1 -1) | 18387 | (replace-match (concat |
| 18337 | " |")) | 18388 | (substring (match-string 0) 1 -1) |
| 18338 | (goto-char pos) | 18389 | " |")) |
| 18339 | ;; noalign: if there were two spaces at the end, this field | 18390 | (goto-char pos) |
| 18340 | ;; does not determine the width of the column. | 18391 | ;; noalign: if there were two spaces at the end, this field |
| 18341 | (if noalign (setq org-table-may-need-update c))) | 18392 | ;; does not determine the width of the column. |
| 18342 | (delete-char N)) | 18393 | (if noalign (setq org-table-may-need-update c))) |
| 18343 | (delete-char N) | 18394 | (delete-char N)) |
| 18344 | (org-fix-tags-on-the-fly))) | 18395 | (delete-char N) |
| 18396 | (org-fix-tags-on-the-fly)))) | ||
| 18345 | 18397 | ||
| 18346 | ;; Make `delete-selection-mode' work with org-mode and orgtbl-mode | 18398 | ;; Make `delete-selection-mode' work with org-mode and orgtbl-mode |
| 18347 | (put 'org-self-insert-command 'delete-selection t) | 18399 | (put 'org-self-insert-command 'delete-selection t) |
| @@ -18956,15 +19008,22 @@ See the individual commands for more information." | |||
| 18956 | (org-table-paste-rectangle) | 19008 | (org-table-paste-rectangle) |
| 18957 | (org-paste-subtree arg))) | 19009 | (org-paste-subtree arg))) |
| 18958 | 19010 | ||
| 19011 | (defsubst org-in-fixed-width-region-p () | ||
| 19012 | "Is point in a fixed-width region?" | ||
| 19013 | (save-match-data | ||
| 19014 | (eq 'fixed-width (org-element-type (org-element-at-point))))) | ||
| 19015 | |||
| 18959 | (defun org-edit-special (&optional arg) | 19016 | (defun org-edit-special (&optional arg) |
| 18960 | "Call a special editor for the stuff at point. | 19017 | "Call a special editor for the stuff at point. |
| 18961 | When at a table, call the formula editor with `org-table-edit-formulas'. | 19018 | When at a table, call the formula editor with `org-table-edit-formulas'. |
| 18962 | When at the first line of an src example, call `org-edit-src-code'. | 19019 | When in a source code block, call `org-edit-src-code'. |
| 18963 | When in an #+include line, visit the include file. Otherwise call | 19020 | When in a fixed-width region, call `org-edit-fixed-width-region'. |
| 18964 | `ffap' to visit the file at point." | 19021 | When in an #+include line, visit the included file. |
| 19022 | On a link, call `ffap' to visit the link at point. | ||
| 19023 | Otherwise, return a user error." | ||
| 18965 | (interactive) | 19024 | (interactive) |
| 18966 | ;; possibly prep session before editing source | 19025 | ;; possibly prep session before editing source |
| 18967 | (when arg | 19026 | (when (and (org-in-src-block-p) arg) |
| 18968 | (let* ((info (org-babel-get-src-block-info)) | 19027 | (let* ((info (org-babel-get-src-block-info)) |
| 18969 | (lang (nth 0 info)) | 19028 | (lang (nth 0 info)) |
| 18970 | (params (nth 2 info)) | 19029 | (params (nth 2 info)) |
| @@ -18977,16 +19036,16 @@ When in an #+include line, visit the include file. Otherwise call | |||
| 18977 | (beginning-of-line 1) | 19036 | (beginning-of-line 1) |
| 18978 | (looking-at "\\(?:#\\+\\(?:setupfile\\|include\\):?[ \t]+\"?\\|[ \t]*<include\\>.*?file=\"\\)\\([^\"\n>]+\\)")) | 19037 | (looking-at "\\(?:#\\+\\(?:setupfile\\|include\\):?[ \t]+\"?\\|[ \t]*<include\\>.*?file=\"\\)\\([^\"\n>]+\\)")) |
| 18979 | (find-file (org-trim (match-string 1)))) | 19038 | (find-file (org-trim (match-string 1)))) |
| 18980 | ((org-edit-src-code)) | 19039 | ((org-at-table.el-p) (org-edit-src-code)) |
| 18981 | ((org-edit-fixed-width-region)) | ||
| 18982 | ((org-at-table.el-p) | ||
| 18983 | (org-edit-src-code)) | ||
| 18984 | ((or (org-at-table-p) | 19040 | ((or (org-at-table-p) |
| 18985 | (save-excursion | 19041 | (save-excursion |
| 18986 | (beginning-of-line 1) | 19042 | (beginning-of-line 1) |
| 18987 | (let ((case-fold-search )) (looking-at "[ \t]*#\\+tblfm:")))) | 19043 | (let ((case-fold-search )) (looking-at "[ \t]*#\\+tblfm:")))) |
| 18988 | (call-interactively 'org-table-edit-formulas)) | 19044 | (call-interactively 'org-table-edit-formulas)) |
| 18989 | (t (call-interactively 'ffap)))) | 19045 | ((org-in-block-p '("src" "example" "latex" "html")) (org-edit-src-code)) |
| 19046 | ((org-in-fixed-width-region-p) (org-edit-fixed-width-region)) | ||
| 19047 | ((org-at-regexp-p org-any-link-re) (call-interactively 'ffap)) | ||
| 19048 | (t (user-error "No special environment to edit here")))) | ||
| 18990 | 19049 | ||
| 18991 | (defvar org-table-coordinate-overlays) ; defined in org-table.el | 19050 | (defvar org-table-coordinate-overlays) ; defined in org-table.el |
| 18992 | (defun org-ctrl-c-ctrl-c (&optional arg) | 19051 | (defun org-ctrl-c-ctrl-c (&optional arg) |
| @@ -19103,8 +19162,10 @@ This command does many different things, depending on context: | |||
| 19103 | (org-list-struct-fix-ind struct parents) | 19162 | (org-list-struct-fix-ind struct parents) |
| 19104 | (setq block-item | 19163 | (setq block-item |
| 19105 | (org-list-struct-fix-box struct parents prevs orderedp))) | 19164 | (org-list-struct-fix-box struct parents prevs orderedp))) |
| 19106 | (org-list-struct-apply-struct struct old-struct) | 19165 | (if (equal struct old-struct) |
| 19107 | (org-update-checkbox-count-maybe) | 19166 | (user-error "Cannot toggle this checkbox (unchecked subitems?)") |
| 19167 | (org-list-struct-apply-struct struct old-struct) | ||
| 19168 | (org-update-checkbox-count-maybe)) | ||
| 19108 | (when block-item | 19169 | (when block-item |
| 19109 | (message | 19170 | (message |
| 19110 | "Checkboxes were removed due to unchecked box at line %d" | 19171 | "Checkboxes were removed due to unchecked box at line %d" |
| @@ -20238,13 +20299,19 @@ and end of string." | |||
| 20238 | "Is S an ID created by UUIDGEN?" | 20299 | "Is S an ID created by UUIDGEN?" |
| 20239 | (string-match "\\`[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}\\'" (downcase s))) | 20300 | (string-match "\\`[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}\\'" (downcase s))) |
| 20240 | 20301 | ||
| 20241 | (defun org-in-src-block-p nil | 20302 | (defun org-in-src-block-p (&optional inside) |
| 20242 | "Whether point is in a code source block." | 20303 | "Whether point is in a code source block. |
| 20243 | (let (ov) | 20304 | When INSIDE is non-nil, don't consider we are within a src block |
| 20244 | (when (setq ov (overlays-at (point))) | 20305 | when point is at #+BEGIN_SRC or #+END_SRC." |
| 20245 | (memq 'org-block-background | 20306 | (let ((case-fold-search t) ov) |
| 20246 | (overlay-properties | 20307 | (or (and (setq ov (overlays-at (point))) |
| 20247 | (car ov)))))) | 20308 | (memq 'org-block-background |
| 20309 | (overlay-properties (car ov)))) | ||
| 20310 | (and (not inside) | ||
| 20311 | (save-match-data | ||
| 20312 | (save-excursion | ||
| 20313 | (beginning-of-line) | ||
| 20314 | (looking-at ".*#\\+\\(begin\\|end\\)_src"))))))) | ||
| 20248 | 20315 | ||
| 20249 | (defun org-context () | 20316 | (defun org-context () |
| 20250 | "Return a list of contexts of the current cursor position. | 20317 | "Return a list of contexts of the current cursor position. |
| @@ -20587,9 +20654,8 @@ return nil." | |||
| 20587 | "Switch to buffer in a second window on the current frame. | 20654 | "Switch to buffer in a second window on the current frame. |
| 20588 | In particular, do not allow pop-up frames. | 20655 | In particular, do not allow pop-up frames. |
| 20589 | Returns the newly created buffer." | 20656 | Returns the newly created buffer." |
| 20590 | (let (pop-up-frames special-display-buffer-names special-display-regexps | 20657 | (org-no-popups |
| 20591 | special-display-function) | 20658 | (apply 'switch-to-buffer-other-window args))) |
| 20592 | (apply 'switch-to-buffer-other-window args))) | ||
| 20593 | 20659 | ||
| 20594 | (defun org-combine-plists (&rest plists) | 20660 | (defun org-combine-plists (&rest plists) |
| 20595 | "Create a single property list from all plists in PLISTS. | 20661 | "Create a single property list from all plists in PLISTS. |
| @@ -20768,6 +20834,7 @@ hierarchy of headlines by UP levels before marking the subtree." | |||
| 20768 | (t | 20834 | (t |
| 20769 | (beginning-of-line 0) | 20835 | (beginning-of-line 0) |
| 20770 | (while (and (not (bobp)) | 20836 | (while (and (not (bobp)) |
| 20837 | (not (looking-at org-table-line-regexp)) | ||
| 20771 | (not (looking-at org-drawer-regexp)) | 20838 | (not (looking-at org-drawer-regexp)) |
| 20772 | ;; When point started in an inline task, do not move | 20839 | ;; When point started in an inline task, do not move |
| 20773 | ;; above task starting line. | 20840 | ;; above task starting line. |
| @@ -20898,6 +20965,7 @@ hierarchy of headlines by UP levels before marking the subtree." | |||
| 20898 | '(org-fill-paragraph-separate-nobreak-p | 20965 | '(org-fill-paragraph-separate-nobreak-p |
| 20899 | org-fill-line-break-nobreak-p))))) | 20966 | org-fill-line-break-nobreak-p))))) |
| 20900 | (org-set-local 'fill-paragraph-function 'org-fill-paragraph) | 20967 | (org-set-local 'fill-paragraph-function 'org-fill-paragraph) |
| 20968 | (org-set-local 'auto-fill-inhibit-regexp nil) | ||
| 20901 | (org-set-local 'adaptive-fill-function 'org-adaptive-fill-function) | 20969 | (org-set-local 'adaptive-fill-function 'org-adaptive-fill-function) |
| 20902 | (org-set-local 'normal-auto-fill-function 'org-auto-fill-function) | 20970 | (org-set-local 'normal-auto-fill-function 'org-auto-fill-function) |
| 20903 | (org-set-local 'comment-line-break-function 'org-comment-line-break-function)) | 20971 | (org-set-local 'comment-line-break-function 'org-comment-line-break-function)) |
| @@ -20920,48 +20988,54 @@ hierarchy of headlines by UP levels before marking the subtree." | |||
| 20920 | "Compute a fill prefix for the current line. | 20988 | "Compute a fill prefix for the current line. |
| 20921 | Return fill prefix, as a string, or nil if current line isn't | 20989 | Return fill prefix, as a string, or nil if current line isn't |
| 20922 | meant to be filled." | 20990 | meant to be filled." |
| 20923 | (org-with-wide-buffer | 20991 | (let (prefix) |
| 20924 | (unless (and (derived-mode-p 'message-mode) (not (message-in-body-p))) | 20992 | (when (and (derived-mode-p 'message-mode) (message-in-body-p)) |
| 20925 | ;; FIXME: This is really the job of orgstruct++-mode | 20993 | (save-excursion |
| 20926 | (let* ((p (line-beginning-position)) | 20994 | (beginning-of-line) |
| 20927 | (element (save-excursion (beginning-of-line) | 20995 | (cond ((looking-at message-cite-prefix-regexp) |
| 20928 | (org-element-at-point))) | 20996 | (setq prefix (match-string-no-properties 0))) |
| 20929 | (type (org-element-type element)) | 20997 | ((looking-at org-outline-regexp) |
| 20930 | (post-affiliated | 20998 | (setq prefix ""))))) |
| 20931 | (save-excursion | 20999 | (or prefix |
| 20932 | (goto-char (org-element-property :begin element)) | 21000 | (org-with-wide-buffer |
| 20933 | (while (looking-at org-element--affiliated-re) (forward-line)) | 21001 | (let* ((p (line-beginning-position)) |
| 20934 | (point)))) | 21002 | (element (save-excursion (beginning-of-line) (org-element-at-point))) |
| 20935 | (unless (< p post-affiliated) | 21003 | (type (org-element-type element)) |
| 20936 | (case type | 21004 | (post-affiliated |
| 20937 | (comment (looking-at "[ \t]*# ?") (match-string 0)) | 21005 | (save-excursion |
| 20938 | (footnote-definition "") | 21006 | (goto-char (org-element-property :begin element)) |
| 20939 | ((item plain-list) | 21007 | (while (looking-at org-element--affiliated-re) (forward-line)) |
| 20940 | (make-string (org-list-item-body-column post-affiliated) ? )) | 21008 | (point)))) |
| 20941 | (paragraph | 21009 | (unless (< p post-affiliated) |
| 20942 | ;; Fill prefix is usually the same as the current line, | 21010 | (case type |
| 20943 | ;; except if the paragraph is at the beginning of an item. | 21011 | (comment (looking-at "[ \t]*# ?") (match-string 0)) |
| 20944 | (let ((parent (org-element-property :parent element))) | 21012 | (footnote-definition "") |
| 20945 | (cond ((eq (org-element-type parent) 'item) | 21013 | ((item plain-list) |
| 20946 | (make-string (org-list-item-body-column | 21014 | (make-string (org-list-item-body-column post-affiliated) ? )) |
| 20947 | (org-element-property :begin parent)) | 21015 | (paragraph |
| 20948 | ? )) | 21016 | ;; Fill prefix is usually the same as the current line, |
| 20949 | ((save-excursion (beginning-of-line) (looking-at "[ \t]+")) | 21017 | ;; except if the paragraph is at the beginning of an item. |
| 20950 | (match-string 0)) | 21018 | (let ((parent (org-element-property :parent element))) |
| 20951 | (t "")))) | 21019 | (cond ((eq (org-element-type parent) 'item) |
| 20952 | (comment-block | 21020 | (make-string (org-list-item-body-column |
| 20953 | ;; Only fill contents if P is within block boundaries. | 21021 | (org-element-property :begin parent)) |
| 20954 | (let* ((cbeg (save-excursion (goto-char post-affiliated) | 21022 | ? )) |
| 20955 | (forward-line) | 21023 | ((save-excursion (beginning-of-line) (looking-at "[ \t]+")) |
| 20956 | (point))) | 21024 | (match-string 0)) |
| 20957 | (cend (save-excursion | 21025 | (t "")))) |
| 20958 | (goto-char (org-element-property :end element)) | 21026 | (comment-block |
| 20959 | (skip-chars-backward " \r\t\n") | 21027 | ;; Only fill contents if P is within block boundaries. |
| 20960 | (line-beginning-position)))) | 21028 | (let* ((cbeg (save-excursion (goto-char post-affiliated) |
| 20961 | (when (and (>= p cbeg) (< p cend)) | 21029 | (forward-line) |
| 20962 | (if (save-excursion (beginning-of-line) (looking-at "[ \t]+")) | 21030 | (point))) |
| 20963 | (match-string 0) | 21031 | (cend (save-excursion |
| 20964 | "")))))))))) | 21032 | (goto-char (org-element-property :end element)) |
| 21033 | (skip-chars-backward " \r\t\n") | ||
| 21034 | (line-beginning-position)))) | ||
| 21035 | (when (and (>= p cbeg) (< p cend)) | ||
| 21036 | (if (save-excursion (beginning-of-line) (looking-at "[ \t]+")) | ||
| 21037 | (match-string 0) | ||
| 21038 | ""))))))))))) | ||
| 20965 | 21039 | ||
| 20966 | (declare-function message-goto-body "message" ()) | 21040 | (declare-function message-goto-body "message" ()) |
| 20967 | (defvar message-cite-prefix-regexp) ; From message.el | 21041 | (defvar message-cite-prefix-regexp) ; From message.el |
| @@ -20981,12 +21055,12 @@ width for filling. | |||
| 20981 | 21055 | ||
| 20982 | For convenience, when point is at a plain list, an item or | 21056 | For convenience, when point is at a plain list, an item or |
| 20983 | a footnote definition, try to fill the first paragraph within." | 21057 | a footnote definition, try to fill the first paragraph within." |
| 20984 | ;; Falls back on message-fill-paragraph when necessary | ||
| 20985 | (interactive) | 21058 | (interactive) |
| 20986 | (if (and (derived-mode-p 'message-mode) | 21059 | (if (and (derived-mode-p 'message-mode) |
| 20987 | (or (not (message-in-body-p)) | 21060 | (or (not (message-in-body-p)) |
| 20988 | (save-excursion (move-beginning-of-line 1) | 21061 | (save-excursion (move-beginning-of-line 1) |
| 20989 | (looking-at message-cite-prefix-regexp)))) | 21062 | (looking-at message-cite-prefix-regexp)))) |
| 21063 | ;; First ensure filling is correct in message-mode. | ||
| 20990 | (let ((fill-paragraph-function | 21064 | (let ((fill-paragraph-function |
| 20991 | (cadadr (assoc 'fill-paragraph-function org-fb-vars))) | 21065 | (cadadr (assoc 'fill-paragraph-function org-fb-vars))) |
| 20992 | (fill-prefix (cadadr (assoc 'fill-prefix org-fb-vars))) | 21066 | (fill-prefix (cadadr (assoc 'fill-prefix org-fb-vars))) |
| @@ -21003,6 +21077,8 @@ a footnote definition, try to fill the first paragraph within." | |||
| 21003 | ;; the buffer. In that case, ignore filling. | 21077 | ;; the buffer. In that case, ignore filling. |
| 21004 | (if (< (point) (org-element-property :begin element)) t | 21078 | (if (< (point) (org-element-property :begin element)) t |
| 21005 | (case (org-element-type element) | 21079 | (case (org-element-type element) |
| 21080 | ;; Use major mode filling function is src blocks. | ||
| 21081 | (src-block (org-babel-do-key-sequence-in-edit-buffer (kbd "M-q"))) | ||
| 21006 | ;; Align Org tables, leave table.el tables as-is. | 21082 | ;; Align Org tables, leave table.el tables as-is. |
| 21007 | (table-row (org-table-align) t) | 21083 | (table-row (org-table-align) t) |
| 21008 | (table | 21084 | (table |
diff --git a/lisp/printing.el b/lisp/printing.el index a8eed066a15..bf50aa8f679 100644 --- a/lisp/printing.el +++ b/lisp/printing.el | |||
| @@ -1800,7 +1800,7 @@ The alist element has the form: | |||
| 1800 | Where: | 1800 | Where: |
| 1801 | 1801 | ||
| 1802 | SYMBOL It's a symbol to identify a text printer. It's for | 1802 | SYMBOL It's a symbol to identify a text printer. It's for |
| 1803 | `pr-txt-name' variable setting and for menu selection. | 1803 | setting option `pr-txt-name' and for menu selection. |
| 1804 | Examples: | 1804 | Examples: |
| 1805 | 'prt_06a | 1805 | 'prt_06a |
| 1806 | 'my_printer | 1806 | 'my_printer |
| @@ -1951,7 +1951,7 @@ The alist element has the form: | |||
| 1951 | Where: | 1951 | Where: |
| 1952 | 1952 | ||
| 1953 | SYMBOL It's a symbol to identify a PostScript printer. It's for | 1953 | SYMBOL It's a symbol to identify a PostScript printer. It's for |
| 1954 | `pr-ps-name' variable setting and for menu selection. | 1954 | setting option `pr-ps-name' and for menu selection. |
| 1955 | Examples: | 1955 | Examples: |
| 1956 | 'prt_06a | 1956 | 'prt_06a |
| 1957 | 'my_printer | 1957 | 'my_printer |
| @@ -2935,9 +2935,9 @@ INHERITS Specify the inheritance for SYMBOL group. It's a symbol name | |||
| 2935 | 2935 | ||
| 2936 | The example above has two setting groups: no-duplex and | 2936 | The example above has two setting groups: no-duplex and |
| 2937 | no-duplex-and-landscape. When setting no-duplex is activated | 2937 | no-duplex-and-landscape. When setting no-duplex is activated |
| 2938 | through `inherits-from:' (see `pr-ps-utility', `pr-mode-alist' | 2938 | through `inherits-from:' (see option `pr-ps-utility', |
| 2939 | and `pr-ps-printer-alist'), the variables pr-file-duplex and | 2939 | `pr-mode-alist' and `pr-ps-printer-alist'), the variables |
| 2940 | pr-file-tumble are both set to nil. | 2940 | pr-file-duplex and pr-file-tumble are both set to nil. |
| 2941 | 2941 | ||
| 2942 | Now when setting no-duplex-and-landscape is activated through | 2942 | Now when setting no-duplex-and-landscape is activated through |
| 2943 | `inherits-from:', the variable pr-file-landscape is set to nil | 2943 | `inherits-from:', the variable pr-file-landscape is set to nil |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 6ffa67f59c1..560b66bf3b0 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -2464,8 +2464,12 @@ comment at the start of cc-engine.el for more info." | |||
| 2464 | 2464 | ||
| 2465 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2465 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 2466 | ;; Variables which keep track of preprocessor constructs. | 2466 | ;; Variables which keep track of preprocessor constructs. |
| 2467 | (defvar c-state-old-cpp-beg-marker nil) | ||
| 2468 | (make-variable-buffer-local 'c-state-old-cpp-beg-marker) | ||
| 2467 | (defvar c-state-old-cpp-beg nil) | 2469 | (defvar c-state-old-cpp-beg nil) |
| 2468 | (make-variable-buffer-local 'c-state-old-cpp-beg) | 2470 | (make-variable-buffer-local 'c-state-old-cpp-beg) |
| 2471 | (defvar c-state-old-cpp-end-marker nil) | ||
| 2472 | (make-variable-buffer-local 'c-state-old-cpp-end-marker) | ||
| 2469 | (defvar c-state-old-cpp-end nil) | 2473 | (defvar c-state-old-cpp-end nil) |
| 2470 | (make-variable-buffer-local 'c-state-old-cpp-end) | 2474 | (make-variable-buffer-local 'c-state-old-cpp-end) |
| 2471 | ;; These are the limits of the macro containing point at the previous call of | 2475 | ;; These are the limits of the macro containing point at the previous call of |
| @@ -2653,13 +2657,21 @@ comment at the start of cc-engine.el for more info." | |||
| 2653 | ;; reduce the time wasted in repeated fruitless searches in brace deserts. | 2657 | ;; reduce the time wasted in repeated fruitless searches in brace deserts. |
| 2654 | (save-excursion | 2658 | (save-excursion |
| 2655 | (save-restriction | 2659 | (save-restriction |
| 2656 | (let ((bra from) ce ; Positions of "{" and "}". | 2660 | (let* (new-cons |
| 2657 | new-cons | 2661 | (cache-pos (c-state-cache-top-lparen)) ; might be nil. |
| 2658 | (cache-pos (c-state-cache-top-lparen)) ; might be nil. | 2662 | (macro-start-or-from |
| 2659 | (macro-start-or-from | 2663 | (progn (goto-char from) |
| 2660 | (progn (goto-char from) | 2664 | (c-beginning-of-macro) |
| 2661 | (c-beginning-of-macro) | 2665 | (point))) |
| 2662 | (point)))) | 2666 | (bra ; Position of "{". |
| 2667 | ;; Don't start scanning in the middle of a CPP construct unless | ||
| 2668 | ;; it contains HERE - these constructs, in Emacs, are "commented | ||
| 2669 | ;; out" with category properties. | ||
| 2670 | (if (eq (c-get-char-property macro-start-or-from 'category) | ||
| 2671 | 'c-cpp-delimiter) | ||
| 2672 | macro-start-or-from | ||
| 2673 | from)) | ||
| 2674 | ce) ; Position of "}" | ||
| 2663 | (or upper-lim (setq upper-lim from)) | 2675 | (or upper-lim (setq upper-lim from)) |
| 2664 | 2676 | ||
| 2665 | ;; If we're essentially repeating a fruitless search, just give up. | 2677 | ;; If we're essentially repeating a fruitless search, just give up. |
| @@ -2899,7 +2911,9 @@ comment at the start of cc-engine.el for more info." | |||
| 2899 | (point-max) | 2911 | (point-max) |
| 2900 | (min (point-max) c-state-old-cpp-beg))) | 2912 | (min (point-max) c-state-old-cpp-beg))) |
| 2901 | (while (and c-state-cache (>= (c-state-cache-top-lparen) upper-lim)) | 2913 | (while (and c-state-cache (>= (c-state-cache-top-lparen) upper-lim)) |
| 2914 | (setq scan-back-pos (car-safe (car c-state-cache))) | ||
| 2902 | (setq c-state-cache (cdr c-state-cache))) | 2915 | (setq c-state-cache (cdr c-state-cache))) |
| 2916 | |||
| 2903 | ;; If `upper-lim' is inside the last recorded brace pair, remove its | 2917 | ;; If `upper-lim' is inside the last recorded brace pair, remove its |
| 2904 | ;; RBrace and indicate we'll need to search backwards for a previous | 2918 | ;; RBrace and indicate we'll need to search backwards for a previous |
| 2905 | ;; brace pair. | 2919 | ;; brace pair. |
| @@ -3324,6 +3338,13 @@ comment at the start of cc-engine.el for more info." | |||
| 3324 | (c-with-cpps-commented-out | 3338 | (c-with-cpps-commented-out |
| 3325 | (c-invalidate-state-cache-1 here))))) | 3339 | (c-invalidate-state-cache-1 here))))) |
| 3326 | 3340 | ||
| 3341 | (defmacro c-state-maybe-marker (place marker) | ||
| 3342 | ;; If PLACE is non-nil, return a marker marking it, otherwise nil. | ||
| 3343 | ;; We (re)use MARKER. | ||
| 3344 | `(and ,place | ||
| 3345 | (or ,marker (setq ,marker (make-marker))) | ||
| 3346 | (set-marker ,marker ,place))) | ||
| 3347 | |||
| 3327 | (defun c-parse-state () | 3348 | (defun c-parse-state () |
| 3328 | ;; This is a wrapper over `c-parse-state-1'. See that function for a | 3349 | ;; This is a wrapper over `c-parse-state-1'. See that function for a |
| 3329 | ;; description of the functionality and return value. | 3350 | ;; description of the functionality and return value. |
| @@ -3350,9 +3371,10 @@ comment at the start of cc-engine.el for more info." | |||
| 3350 | (c-parse-state-1)) | 3371 | (c-parse-state-1)) |
| 3351 | (c-with-cpps-commented-out | 3372 | (c-with-cpps-commented-out |
| 3352 | (c-parse-state-1)))) | 3373 | (c-parse-state-1)))) |
| 3353 | (setq c-state-old-cpp-beg (and here-cpp-beg (copy-marker here-cpp-beg t)) | 3374 | (setq c-state-old-cpp-beg |
| 3354 | c-state-old-cpp-end (and here-cpp-end (copy-marker here-cpp-end t))) | 3375 | (c-state-maybe-marker here-cpp-beg c-state-old-cpp-beg-marker) |
| 3355 | ))) | 3376 | c-state-old-cpp-end |
| 3377 | (c-state-maybe-marker here-cpp-end c-state-old-cpp-end-marker))))) | ||
| 3356 | 3378 | ||
| 3357 | ;; Debug tool to catch cache inconsistencies. This is called from | 3379 | ;; Debug tool to catch cache inconsistencies. This is called from |
| 3358 | ;; 000tests.el. | 3380 | ;; 000tests.el. |
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 376edcdc76b..f6c47f5bb4d 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el | |||
| @@ -2049,7 +2049,7 @@ styles specified by `c-doc-comment-style'.") | |||
| 2049 | 2049 | ||
| 2050 | (defconst c-font-lock-keywords-3 (c-lang-const c-matchers-3 c) | 2050 | (defconst c-font-lock-keywords-3 (c-lang-const c-matchers-3 c) |
| 2051 | "Accurate normal font locking for C mode. | 2051 | "Accurate normal font locking for C mode. |
| 2052 | Like `c-font-lock-keywords-2' but detects declarations in a more | 2052 | Like the variable `c-font-lock-keywords-2' but detects declarations in a more |
| 2053 | accurate way that works in most cases for arbitrary types without the | 2053 | accurate way that works in most cases for arbitrary types without the |
| 2054 | need for `c-font-lock-extra-types'.") | 2054 | need for `c-font-lock-extra-types'.") |
| 2055 | 2055 | ||
| @@ -2207,7 +2207,7 @@ styles specified by `c-doc-comment-style'.") | |||
| 2207 | 2207 | ||
| 2208 | (defconst c++-font-lock-keywords-3 (c-lang-const c-matchers-3 c++) | 2208 | (defconst c++-font-lock-keywords-3 (c-lang-const c-matchers-3 c++) |
| 2209 | "Accurate normal font locking for C++ mode. | 2209 | "Accurate normal font locking for C++ mode. |
| 2210 | Like `c++-font-lock-keywords-2' but detects declarations in a more | 2210 | Like the variable `c++-font-lock-keywords-2' but detects declarations in a more |
| 2211 | accurate way that works in most cases for arbitrary types without the | 2211 | accurate way that works in most cases for arbitrary types without the |
| 2212 | need for `c++-font-lock-extra-types'.") | 2212 | need for `c++-font-lock-extra-types'.") |
| 2213 | 2213 | ||
| @@ -2313,7 +2313,7 @@ comment styles specified by `c-doc-comment-style'.") | |||
| 2313 | 2313 | ||
| 2314 | (defconst objc-font-lock-keywords-3 (c-lang-const c-matchers-3 objc) | 2314 | (defconst objc-font-lock-keywords-3 (c-lang-const c-matchers-3 objc) |
| 2315 | "Accurate normal font locking for Objective-C mode. | 2315 | "Accurate normal font locking for Objective-C mode. |
| 2316 | Like `objc-font-lock-keywords-2' but detects declarations in a more | 2316 | Like the variable `objc-font-lock-keywords-2' but detects declarations in a more |
| 2317 | accurate way that works in most cases for arbitrary types without the | 2317 | accurate way that works in most cases for arbitrary types without the |
| 2318 | need for `objc-font-lock-extra-types'.") | 2318 | need for `objc-font-lock-extra-types'.") |
| 2319 | 2319 | ||
| @@ -2356,7 +2356,7 @@ comment styles specified by `c-doc-comment-style'.") | |||
| 2356 | 2356 | ||
| 2357 | (defconst java-font-lock-keywords-3 (c-lang-const c-matchers-3 java) | 2357 | (defconst java-font-lock-keywords-3 (c-lang-const c-matchers-3 java) |
| 2358 | "Accurate normal font locking for Java mode. | 2358 | "Accurate normal font locking for Java mode. |
| 2359 | Like `java-font-lock-keywords-2' but detects declarations in a more | 2359 | Like variable `java-font-lock-keywords-2' but detects declarations in a more |
| 2360 | accurate way that works in most cases for arbitrary types without the | 2360 | accurate way that works in most cases for arbitrary types without the |
| 2361 | need for `java-font-lock-extra-types'.") | 2361 | need for `java-font-lock-extra-types'.") |
| 2362 | 2362 | ||
| @@ -2389,7 +2389,7 @@ styles specified by `c-doc-comment-style'.") | |||
| 2389 | 2389 | ||
| 2390 | (defconst idl-font-lock-keywords-3 (c-lang-const c-matchers-3 idl) | 2390 | (defconst idl-font-lock-keywords-3 (c-lang-const c-matchers-3 idl) |
| 2391 | "Accurate normal font locking for CORBA IDL mode. | 2391 | "Accurate normal font locking for CORBA IDL mode. |
| 2392 | Like `idl-font-lock-keywords-2' but detects declarations in a more | 2392 | Like the variable `idl-font-lock-keywords-2' but detects declarations in a more |
| 2393 | accurate way that works in most cases for arbitrary types without the | 2393 | accurate way that works in most cases for arbitrary types without the |
| 2394 | need for `idl-font-lock-extra-types'.") | 2394 | need for `idl-font-lock-extra-types'.") |
| 2395 | 2395 | ||
| @@ -2422,7 +2422,7 @@ comment styles specified by `c-doc-comment-style'.") | |||
| 2422 | 2422 | ||
| 2423 | (defconst pike-font-lock-keywords-3 (c-lang-const c-matchers-3 pike) | 2423 | (defconst pike-font-lock-keywords-3 (c-lang-const c-matchers-3 pike) |
| 2424 | "Accurate normal font locking for Pike mode. | 2424 | "Accurate normal font locking for Pike mode. |
| 2425 | Like `pike-font-lock-keywords-2' but detects declarations in a more | 2425 | Like the variable `pike-font-lock-keywords-2' but detects declarations in a more |
| 2426 | accurate way that works in most cases for arbitrary types without the | 2426 | accurate way that works in most cases for arbitrary types without the |
| 2427 | need for `pike-font-lock-extra-types'.") | 2427 | need for `pike-font-lock-extra-types'.") |
| 2428 | 2428 | ||
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 4194d363a3d..eb73b77bf52 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -134,6 +134,7 @@ and a string describing how the process finished.") | |||
| 134 | 134 | ||
| 135 | ;; If you make any changes to `compilation-error-regexp-alist-alist', | 135 | ;; If you make any changes to `compilation-error-regexp-alist-alist', |
| 136 | ;; be sure to run the ERT test in test/automated/compile-tests.el. | 136 | ;; be sure to run the ERT test in test/automated/compile-tests.el. |
| 137 | ;; emacs -batch -l compile-tests.el -f ert-run-tests-batch-and-exit | ||
| 137 | 138 | ||
| 138 | (defvar compilation-error-regexp-alist-alist | 139 | (defvar compilation-error-regexp-alist-alist |
| 139 | '((absoft | 140 | '((absoft |
| @@ -261,11 +262,11 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) | |||
| 261 | ;; The "in \\|from " exception was added to handle messages from Ruby. | 262 | ;; The "in \\|from " exception was added to handle messages from Ruby. |
| 262 | "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\|[ \t]+\\(?:in \\|from \\)\\)?\ | 263 | "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\|[ \t]+\\(?:in \\|from \\)\\)?\ |
| 263 | \\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\ | 264 | \\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\ |
| 264 | \\([0-9]+\\)\\(?:[.:]\\([0-9]+\\)\\)?\ | 265 | \\([0-9]+\\)\\(?:-\\(?4:[0-9]+\\)\\(?:\\.\\(?5:[0-9]+\\)\\)?\ |
| 265 | \\(?:-\\([0-9]+\\)?\\(?:\\.\\([0-9]+\\)\\)?\\)?:\ | 266 | \\|[.:]\\(?3:[0-9]+\\)\\(?:-\\(?:\\(?4:[0-9]+\\)\\.\\)?\\(?5:[0-9]+\\)\\)?\\)?:\ |
| 266 | \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ | 267 | \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ |
| 267 | *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\ | 268 | *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\ |
| 268 | *[Ee]rror\\|\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)" | 269 | *[Ee]rror\\|[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)" |
| 269 | 1 (2 . 4) (3 . 5) (6 . 7)) | 270 | 1 (2 . 4) (3 . 5) (6 . 7)) |
| 270 | 271 | ||
| 271 | (lcc | 272 | (lcc |
| @@ -1280,7 +1281,7 @@ to `compilation-error-regexp-alist' if RULES is nil." | |||
| 1280 | ;; whether or not omake's own error messages are recognized. | 1281 | ;; whether or not omake's own error messages are recognized. |
| 1281 | (cond | 1282 | (cond |
| 1282 | ((not (memq 'omake compilation-error-regexp-alist)) nil) | 1283 | ((not (memq 'omake compilation-error-regexp-alist)) nil) |
| 1283 | ((string-match "\\`\\([^^]\\|^\\( \\*\\|\\[\\)\\)" pat) | 1284 | ((string-match "\\`\\([^^]\\|\\^\\( \\*\\|\\[\\)\\)" pat) |
| 1284 | nil) ;; Not anchored or anchored but already allows empty spaces. | 1285 | nil) ;; Not anchored or anchored but already allows empty spaces. |
| 1285 | (t (setq pat (concat "^ *" (substring pat 1))))) | 1286 | (t (setq pat (concat "^ *" (substring pat 1))))) |
| 1286 | 1287 | ||
| @@ -1427,8 +1428,9 @@ and move to the source code that caused it. | |||
| 1427 | If optional second arg COMINT is t the buffer will be in Comint mode with | 1428 | If optional second arg COMINT is t the buffer will be in Comint mode with |
| 1428 | `compilation-shell-minor-mode'. | 1429 | `compilation-shell-minor-mode'. |
| 1429 | 1430 | ||
| 1430 | Interactively, prompts for the command if `compilation-read-command' is | 1431 | Interactively, prompts for the command if the variable |
| 1431 | non-nil; otherwise uses `compile-command'. With prefix arg, always prompts. | 1432 | `compilation-read-command' is non-nil; otherwise uses`compile-command'. |
| 1433 | With prefix arg, always prompts. | ||
| 1432 | Additionally, with universal prefix arg, compilation buffer will be in | 1434 | Additionally, with universal prefix arg, compilation buffer will be in |
| 1433 | comint mode, i.e. interactive. | 1435 | comint mode, i.e. interactive. |
| 1434 | 1436 | ||
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 81dc31792c3..92f9447652e 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -199,7 +199,8 @@ Pop back to the last location with \\[negative-argument] \\[find-tag].") | |||
| 199 | 199 | ||
| 200 | (defvar tags-table-files nil | 200 | (defvar tags-table-files nil |
| 201 | "List of file names covered by current tags table. | 201 | "List of file names covered by current tags table. |
| 202 | nil means it has not yet been computed; use `tags-table-files' to do so.") | 202 | nil means it has not yet been computed; |
| 203 | use function `tags-table-files' to do so.") | ||
| 203 | 204 | ||
| 204 | (defvar tags-completion-table nil | 205 | (defvar tags-completion-table nil |
| 205 | "Obarray of tag names defined in current tags table.") | 206 | "Obarray of tag names defined in current tags table.") |
| @@ -224,7 +225,7 @@ of the format-parsing tags function variables if successful.") | |||
| 224 | One optional argument, a boolean specifying to return complete path (nil) or | 225 | One optional argument, a boolean specifying to return complete path (nil) or |
| 225 | relative path (non-nil).") | 226 | relative path (non-nil).") |
| 226 | (defvar tags-table-files-function nil | 227 | (defvar tags-table-files-function nil |
| 227 | "Function to do the work of `tags-table-files' (which see).") | 228 | "Function to do the work of function `tags-table-files' (which see).") |
| 228 | (defvar tags-completion-table-function nil | 229 | (defvar tags-completion-table-function nil |
| 229 | "Function to build the `tags-completion-table'.") | 230 | "Function to build the `tags-completion-table'.") |
| 230 | (defvar snarf-tag-function nil | 231 | (defvar snarf-tag-function nil |
| @@ -251,7 +252,7 @@ One argument, the tag info returned by `snarf-tag-function'.") | |||
| 251 | (defvar tags-apropos-function nil | 252 | (defvar tags-apropos-function nil |
| 252 | "Function to do the work of `tags-apropos' (which see).") | 253 | "Function to do the work of `tags-apropos' (which see).") |
| 253 | (defvar tags-included-tables-function nil | 254 | (defvar tags-included-tables-function nil |
| 254 | "Function to do the work of `tags-included-tables' (which see).") | 255 | "Function to do the work of function `tags-included-tables' (which see).") |
| 255 | (defvar verify-tags-table-function nil | 256 | (defvar verify-tags-table-function nil |
| 256 | "Function to return t if current buffer contains valid tags file.") | 257 | "Function to return t if current buffer contains valid tags file.") |
| 257 | 258 | ||
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 7ca0ececa78..0f92df95a9d 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el | |||
| @@ -844,13 +844,21 @@ Return t if it has at least one flymake overlay, nil if no overlay." | |||
| 844 | has-flymake-overlays)) | 844 | has-flymake-overlays)) |
| 845 | 845 | ||
| 846 | (defface flymake-errline | 846 | (defface flymake-errline |
| 847 | '((t :inherit error)) | 847 | '((((supports :underline (:style wave))) |
| 848 | :underline (:style wave :color "Red1")) | ||
| 849 | (t | ||
| 850 | :inherit error)) | ||
| 848 | "Face used for marking error lines." | 851 | "Face used for marking error lines." |
| 852 | :version "24.4" | ||
| 849 | :group 'flymake) | 853 | :group 'flymake) |
| 850 | 854 | ||
| 851 | (defface flymake-warnline | 855 | (defface flymake-warnline |
| 852 | '((t :inherit warning)) | 856 | '((((supports :underline (:style wave))) |
| 857 | :underline (:style wave :color "DarkOrange")) | ||
| 858 | (t | ||
| 859 | :inherit warning)) | ||
| 853 | "Face used for marking warning lines." | 860 | "Face used for marking warning lines." |
| 861 | :version "24.4" | ||
| 854 | :group 'flymake) | 862 | :group 'flymake) |
| 855 | 863 | ||
| 856 | (defun flymake-highlight-line (line-no line-err-info-list) | 864 | (defun flymake-highlight-line (line-no line-err-info-list) |
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index fc3d336cf99..90c7cfc5008 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -607,12 +607,12 @@ executable followed by command-line options. The command-line | |||
| 607 | options should include \"-i=mi\" to use gdb's MI text interface. | 607 | options should include \"-i=mi\" to use gdb's MI text interface. |
| 608 | Note that the old \"--annotate\" option is no longer supported. | 608 | Note that the old \"--annotate\" option is no longer supported. |
| 609 | 609 | ||
| 610 | If `gdb-many-windows' is nil (the default value) then gdb just | 610 | If option `gdb-many-windows' is nil (the default value) then gdb just |
| 611 | pops up the GUD buffer unless `gdb-show-main' is t. In this case | 611 | pops up the GUD buffer unless `gdb-show-main' is t. In this case |
| 612 | it starts with two windows: one displaying the GUD buffer and the | 612 | it starts with two windows: one displaying the GUD buffer and the |
| 613 | other with the source file with the main routine of the inferior. | 613 | other with the source file with the main routine of the inferior. |
| 614 | 614 | ||
| 615 | If `gdb-many-windows' is t, regardless of the value of | 615 | If option `gdb-many-windows' is t, regardless of the value of |
| 616 | `gdb-show-main', the layout below will appear. Keybindings are | 616 | `gdb-show-main', the layout below will appear. Keybindings are |
| 617 | shown in some of the buffers. | 617 | shown in some of the buffers. |
| 618 | 618 | ||
| @@ -4069,7 +4069,7 @@ window is dedicated." | |||
| 4069 | (set-window-dedicated-p window t)) | 4069 | (set-window-dedicated-p window t)) |
| 4070 | 4070 | ||
| 4071 | (defun gdb-setup-windows () | 4071 | (defun gdb-setup-windows () |
| 4072 | "Layout the window pattern for `gdb-many-windows'." | 4072 | "Layout the window pattern for option `gdb-many-windows'." |
| 4073 | (gdb-get-buffer-create 'gdb-locals-buffer) | 4073 | (gdb-get-buffer-create 'gdb-locals-buffer) |
| 4074 | (gdb-get-buffer-create 'gdb-stack-buffer) | 4074 | (gdb-get-buffer-create 'gdb-stack-buffer) |
| 4075 | (gdb-get-buffer-create 'gdb-breakpoints-buffer) | 4075 | (gdb-get-buffer-create 'gdb-breakpoints-buffer) |
| @@ -4120,7 +4120,7 @@ of the debugged program. Non-nil means display the layout shown for | |||
| 4120 | 4120 | ||
| 4121 | (defun gdb-restore-windows () | 4121 | (defun gdb-restore-windows () |
| 4122 | "Restore the basic arrangement of windows used by gdb. | 4122 | "Restore the basic arrangement of windows used by gdb. |
| 4123 | This arrangement depends on the value of `gdb-many-windows'." | 4123 | This arrangement depends on the value of option `gdb-many-windows'." |
| 4124 | (interactive) | 4124 | (interactive) |
| 4125 | (switch-to-buffer gud-comint-buffer) ;Select the right window and frame. | 4125 | (switch-to-buffer gud-comint-buffer) ;Select the right window and frame. |
| 4126 | (delete-other-windows) | 4126 | (delete-other-windows) |
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 683b3927ae3..96e6039a8c2 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el | |||
| @@ -1680,12 +1680,15 @@ This performs fontification according to `js--class-styles'." | |||
| 1680 | "each")) | 1680 | "each")) |
| 1681 | "Regexp matching keywords optionally followed by an opening brace.") | 1681 | "Regexp matching keywords optionally followed by an opening brace.") |
| 1682 | 1682 | ||
| 1683 | (defconst js--declaration-keyword-re | ||
| 1684 | (regexp-opt '("var" "let" "const") 'words) | ||
| 1685 | "Regular expression matching variable declaration keywords.") | ||
| 1686 | |||
| 1683 | (defconst js--indent-operator-re | 1687 | (defconst js--indent-operator-re |
| 1684 | (concat "[-+*/%<>=&^|?:.]\\([^-+*/]\\|$\\)\\|" | 1688 | (concat "[-+*/%<>=&^|?:.]\\([^-+*/]\\|$\\)\\|" |
| 1685 | (js--regexp-opt-symbol '("in" "instanceof"))) | 1689 | (js--regexp-opt-symbol '("in" "instanceof"))) |
| 1686 | "Regexp matching operators that affect indentation of continued expressions.") | 1690 | "Regexp matching operators that affect indentation of continued expressions.") |
| 1687 | 1691 | ||
| 1688 | |||
| 1689 | (defun js--looking-at-operator-p () | 1692 | (defun js--looking-at-operator-p () |
| 1690 | "Return non-nil if point is on a JavaScript operator, other than a comma." | 1693 | "Return non-nil if point is on a JavaScript operator, other than a comma." |
| 1691 | (save-match-data | 1694 | (save-match-data |
| @@ -1764,6 +1767,37 @@ nil." | |||
| 1764 | (list (cons 'c js-comment-lineup-func)))) | 1767 | (list (cons 'c js-comment-lineup-func)))) |
| 1765 | (c-get-syntactic-indentation (list (cons symbol anchor))))) | 1768 | (c-get-syntactic-indentation (list (cons symbol anchor))))) |
| 1766 | 1769 | ||
| 1770 | (defun js--multi-line-declaration-indentation () | ||
| 1771 | "Helper function for `js--proper-indentation'. | ||
| 1772 | Return the proper indentation of the current line if it belongs to a declaration | ||
| 1773 | statement spanning multiple lines; otherwise, return nil." | ||
| 1774 | (let (at-opening-bracket) | ||
| 1775 | (save-excursion | ||
| 1776 | (back-to-indentation) | ||
| 1777 | (when (not (looking-at js--declaration-keyword-re)) | ||
| 1778 | (when (looking-at js--indent-operator-re) | ||
| 1779 | (goto-char (match-end 0))) | ||
| 1780 | (while (and (not at-opening-bracket) | ||
| 1781 | (not (bobp)) | ||
| 1782 | (let ((pos (point))) | ||
| 1783 | (save-excursion | ||
| 1784 | (js--backward-syntactic-ws) | ||
| 1785 | (or (eq (char-before) ?,) | ||
| 1786 | (and (not (eq (char-before) ?\;)) | ||
| 1787 | (prog2 | ||
| 1788 | (skip-chars-backward "[[:punct:]]") | ||
| 1789 | (looking-at js--indent-operator-re) | ||
| 1790 | (js--backward-syntactic-ws)) | ||
| 1791 | (not (eq (char-before) ?\;))) | ||
| 1792 | (and (>= pos (point-at-bol)) | ||
| 1793 | (<= pos (point-at-eol))))))) | ||
| 1794 | (condition-case err | ||
| 1795 | (backward-sexp) | ||
| 1796 | (scan-error (setq at-opening-bracket t)))) | ||
| 1797 | (when (looking-at js--declaration-keyword-re) | ||
| 1798 | (goto-char (match-end 0)) | ||
| 1799 | (1+ (current-column))))))) | ||
| 1800 | |||
| 1767 | (defun js--proper-indentation (parse-status) | 1801 | (defun js--proper-indentation (parse-status) |
| 1768 | "Return the proper indentation for the current line." | 1802 | "Return the proper indentation for the current line." |
| 1769 | (save-excursion | 1803 | (save-excursion |
| @@ -1772,6 +1806,7 @@ nil." | |||
| 1772 | (js--get-c-offset 'c (nth 8 parse-status))) | 1806 | (js--get-c-offset 'c (nth 8 parse-status))) |
| 1773 | ((nth 8 parse-status) 0) ; inside string | 1807 | ((nth 8 parse-status) 0) ; inside string |
| 1774 | ((js--ctrl-statement-indentation)) | 1808 | ((js--ctrl-statement-indentation)) |
| 1809 | ((js--multi-line-declaration-indentation)) | ||
| 1775 | ((eq (char-after) ?#) 0) | 1810 | ((eq (char-after) ?#) 0) |
| 1776 | ((save-excursion (js--beginning-of-macro)) 4) | 1811 | ((save-excursion (js--beginning-of-macro)) 4) |
| 1777 | ((nth 1 parse-status) | 1812 | ((nth 1 parse-status) |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 172193266ca..0e5f4c82090 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1198,7 +1198,16 @@ of the statement." | |||
| 1198 | (not (eobp)) | 1198 | (not (eobp)) |
| 1199 | (cond ((setq string-start (python-syntax-context 'string)) | 1199 | (cond ((setq string-start (python-syntax-context 'string)) |
| 1200 | (goto-char string-start) | 1200 | (goto-char string-start) |
| 1201 | (python-nav-end-of-statement t)) | 1201 | (if (python-syntax-context 'paren) |
| 1202 | ;; Ended up inside a paren, roll again. | ||
| 1203 | (python-nav-end-of-statement t) | ||
| 1204 | ;; This is not inside a paren, move to the | ||
| 1205 | ;; end of this string. | ||
| 1206 | (goto-char (+ (point) | ||
| 1207 | (python-syntax-count-quotes | ||
| 1208 | (char-after (point)) (point)))) | ||
| 1209 | (or (re-search-forward (rx (syntax string-delimiter)) nil t) | ||
| 1210 | (goto-char (point-max))))) | ||
| 1202 | ((python-syntax-context 'paren) | 1211 | ((python-syntax-context 'paren) |
| 1203 | ;; The statement won't end before we've escaped | 1212 | ;; The statement won't end before we've escaped |
| 1204 | ;; at least one level of parenthesis. | 1213 | ;; at least one level of parenthesis. |
| @@ -1312,7 +1321,7 @@ backward to previous block." | |||
| 1312 | "Safe version of standard `forward-sexp'. | 1321 | "Safe version of standard `forward-sexp'. |
| 1313 | When ARG > 0 move forward, else if ARG is < 0." | 1322 | When ARG > 0 move forward, else if ARG is < 0." |
| 1314 | (or arg (setq arg 1)) | 1323 | (or arg (setq arg 1)) |
| 1315 | (let ((forward-sexp-function nil) | 1324 | (let ((forward-sexp-function) |
| 1316 | (paren-regexp | 1325 | (paren-regexp |
| 1317 | (if (> arg 0) (python-rx close-paren) (python-rx open-paren))) | 1326 | (if (> arg 0) (python-rx close-paren) (python-rx open-paren))) |
| 1318 | (search-fn | 1327 | (search-fn |
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 453386cdba5..781aa241802 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el | |||
| @@ -723,15 +723,15 @@ this variable is nil, that buffer is shown using | |||
| 723 | 723 | ||
| 724 | (defvar sql-imenu-generic-expression | 724 | (defvar sql-imenu-generic-expression |
| 725 | ;; Items are in reverse order because they are rendered in reverse. | 725 | ;; Items are in reverse order because they are rendered in reverse. |
| 726 | '(("Rules/Defaults" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*\\(?:rule\\|default\\)\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\s-+\\(\\w+\\)" 1) | 726 | '(("Rules/Defaults" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*\\(?:rule\\|default\\)\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\s-+\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1) |
| 727 | ("Sequences" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*sequence\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) | 727 | ("Sequences" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*sequence\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1) |
| 728 | ("Triggers" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*trigger\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) | 728 | ("Triggers" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*trigger\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1) |
| 729 | ("Functions" "^\\s-*\\(?:create\\s-+\\(?:\\w+\\s-+\\)*\\)?function\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) | 729 | ("Functions" "^\\s-*\\(?:create\\s-+\\(?:\\w+\\s-+\\)*\\)?function\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1) |
| 730 | ("Procedures" "^\\s-*\\(?:create\\s-+\\(?:\\w+\\s-+\\)*\\)?proc\\(?:edure\\)?\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) | 730 | ("Procedures" "^\\s-*\\(?:create\\s-+\\(?:\\w+\\s-+\\)*\\)?proc\\(?:edure\\)?\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1) |
| 731 | ("Packages" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*package\\s-+\\(?:body\\s-+\\)?\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) | 731 | ("Packages" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*package\\s-+\\(?:body\\s-+\\)?\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1) |
| 732 | ("Types" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*type\\s-+\\(?:body\\s-+\\)?\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) | 732 | ("Types" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*type\\s-+\\(?:body\\s-+\\)?\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1) |
| 733 | ("Indexes" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*index\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) | 733 | ("Indexes" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*index\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1) |
| 734 | ("Tables/Views" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*\\(?:table\\|view\\)\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1)) | 734 | ("Tables/Views" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*\\(?:table\\|view\\)\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\(?:\\w+\\s-*[.]\\s-*\\)*\\w+\\)" 1)) |
| 735 | "Define interesting points in the SQL buffer for `imenu'. | 735 | "Define interesting points in the SQL buffer for `imenu'. |
| 736 | 736 | ||
| 737 | This is used to set `imenu-generic-expression' when SQL mode is | 737 | This is used to set `imenu-generic-expression' when SQL mode is |
| @@ -1313,7 +1313,7 @@ Based on `comint-mode-map'.") | |||
| 1313 | "\\(?:table\\|view\\|\\(?:package\\|type\\)\\(?:\\s-+body\\)?\\|proc\\(?:edure\\)?" | 1313 | "\\(?:table\\|view\\|\\(?:package\\|type\\)\\(?:\\s-+body\\)?\\|proc\\(?:edure\\)?" |
| 1314 | "\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+" | 1314 | "\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+" |
| 1315 | "\\(?:if\\s-+not\\s-+exists\\s-+\\)?" ;; IF NOT EXISTS | 1315 | "\\(?:if\\s-+not\\s-+exists\\s-+\\)?" ;; IF NOT EXISTS |
| 1316 | "\\(\\w+\\)") | 1316 | "\\(\\w+\\(?:\\s-*[.]\\s-*\\w+\\)*\\)") |
| 1317 | 1 'font-lock-function-name-face)) | 1317 | 1 'font-lock-function-name-face)) |
| 1318 | 1318 | ||
| 1319 | "Pattern to match the names of top-level objects. | 1319 | "Pattern to match the names of top-level objects. |
| @@ -3219,9 +3219,6 @@ Every newline in STRING will be preceded with a space and a backslash." | |||
| 3219 | 3219 | ||
| 3220 | Allows the suppression of continuation prompts.") | 3220 | Allows the suppression of continuation prompts.") |
| 3221 | 3221 | ||
| 3222 | (defvar sql-output-by-send nil | ||
| 3223 | "Non-nil if the command in the input was generated by `sql-send-string'.") | ||
| 3224 | |||
| 3225 | (defun sql-input-sender (proc string) | 3222 | (defun sql-input-sender (proc string) |
| 3226 | "Send STRING to PROC after applying filters." | 3223 | "Send STRING to PROC after applying filters." |
| 3227 | 3224 | ||
| @@ -3288,8 +3285,7 @@ to avoid deleting non-prompt output." | |||
| 3288 | 3285 | ||
| 3289 | (if (= sql-output-newline-count 0) | 3286 | (if (= sql-output-newline-count 0) |
| 3290 | (setq sql-output-newline-count nil | 3287 | (setq sql-output-newline-count nil |
| 3291 | oline (concat "\n" oline) | 3288 | oline (concat "\n" oline)) |
| 3292 | sql-output-by-send nil) | ||
| 3293 | 3289 | ||
| 3294 | (setq sql-preoutput-hold oline | 3290 | (setq sql-preoutput-hold oline |
| 3295 | oline "")) | 3291 | oline "")) |
| @@ -3383,8 +3379,7 @@ to avoid deleting non-prompt output." | |||
| 3383 | (setq sql-output-newline-count | 3379 | (setq sql-output-newline-count |
| 3384 | (if sql-output-newline-count | 3380 | (if sql-output-newline-count |
| 3385 | (1+ sql-output-newline-count) | 3381 | (1+ sql-output-newline-count) |
| 3386 | 1))) | 3382 | 1))))) |
| 3387 | (setq sql-output-by-send t))) | ||
| 3388 | 3383 | ||
| 3389 | (defun sql-remove-tabs-filter (str) | 3384 | (defun sql-remove-tabs-filter (str) |
| 3390 | "Replace tab characters with spaces." | 3385 | "Replace tab characters with spaces." |
| @@ -3857,7 +3852,6 @@ you entered, right above the output it created. | |||
| 3857 | (sql-get-product-feature sql-product :prompt-cont-regexp)) | 3852 | (sql-get-product-feature sql-product :prompt-cont-regexp)) |
| 3858 | (make-local-variable 'sql-output-newline-count) | 3853 | (make-local-variable 'sql-output-newline-count) |
| 3859 | (make-local-variable 'sql-preoutput-hold) | 3854 | (make-local-variable 'sql-preoutput-hold) |
| 3860 | (make-local-variable 'sql-output-by-send) | ||
| 3861 | (add-hook 'comint-preoutput-filter-functions | 3855 | (add-hook 'comint-preoutput-filter-functions |
| 3862 | 'sql-interactive-remove-continuation-prompt nil t) | 3856 | 'sql-interactive-remove-continuation-prompt nil t) |
| 3863 | (make-local-variable 'sql-input-ring-separator) | 3857 | (make-local-variable 'sql-input-ring-separator) |
| @@ -3930,7 +3924,7 @@ is specified in the connection settings." | |||
| 3930 | ;; Was one selected | 3924 | ;; Was one selected |
| 3931 | (when connection | 3925 | (when connection |
| 3932 | ;; Get connection settings | 3926 | ;; Get connection settings |
| 3933 | (let ((connect-set (assoc connection sql-connection-alist))) | 3927 | (let ((connect-set (assoc-string connection sql-connection-alist t))) |
| 3934 | ;; Settings are defined | 3928 | ;; Settings are defined |
| 3935 | (if connect-set | 3929 | (if connect-set |
| 3936 | ;; Set the desired parameters | 3930 | ;; Set the desired parameters |
| @@ -4134,9 +4128,17 @@ the call to \\[sql-product-interactive] with | |||
| 4134 | (setq sql-buffer (buffer-name new-sqli-buffer)) | 4128 | (setq sql-buffer (buffer-name new-sqli-buffer)) |
| 4135 | (run-hooks 'sql-set-sqli-hook))) | 4129 | (run-hooks 'sql-set-sqli-hook))) |
| 4136 | 4130 | ||
| 4131 | ;; Make sure the connection is complete | ||
| 4132 | ;; (Sometimes start up can be slow) | ||
| 4133 | ;; and call the login hook | ||
| 4134 | (let ((proc (get-buffer-process new-sqli-buffer))) | ||
| 4135 | (while (and (memq (process-status proc) '(open run)) | ||
| 4136 | (accept-process-output proc 2.5) | ||
| 4137 | (progn (goto-char (point-max)) | ||
| 4138 | (not (looking-back sql-prompt-regexp)))))) | ||
| 4139 | (run-hooks 'sql-login-hook) | ||
| 4137 | ;; All done. | 4140 | ;; All done. |
| 4138 | (message "Login...done") | 4141 | (message "Login...done") |
| 4139 | (run-hooks 'sql-login-hook) | ||
| 4140 | (pop-to-buffer new-sqli-buffer))))) | 4142 | (pop-to-buffer new-sqli-buffer))))) |
| 4141 | (message "No default SQL product defined. Set `sql-product'."))) | 4143 | (message "No default SQL product defined. Set `sql-product'."))) |
| 4142 | 4144 | ||
| @@ -4202,7 +4204,7 @@ The default comes from `process-coding-system-alist' and | |||
| 4202 | ;; is meaningless; database without user/password is meaningless, | 4204 | ;; is meaningless; database without user/password is meaningless, |
| 4203 | ;; because "@param" will ask sqlplus to interpret the script | 4205 | ;; because "@param" will ask sqlplus to interpret the script |
| 4204 | ;; "param". | 4206 | ;; "param". |
| 4205 | (let ((parameter nil)) | 4207 | (let (parameter nlslang coding) |
| 4206 | (if (not (string= "" sql-user)) | 4208 | (if (not (string= "" sql-user)) |
| 4207 | (if (not (string= "" sql-password)) | 4209 | (if (not (string= "" sql-password)) |
| 4208 | (setq parameter (concat sql-user "/" sql-password)) | 4210 | (setq parameter (concat sql-user "/" sql-password)) |
| @@ -4212,7 +4214,29 @@ The default comes from `process-coding-system-alist' and | |||
| 4212 | (if parameter | 4214 | (if parameter |
| 4213 | (setq parameter (nconc (list parameter) options)) | 4215 | (setq parameter (nconc (list parameter) options)) |
| 4214 | (setq parameter options)) | 4216 | (setq parameter options)) |
| 4215 | (sql-comint product parameter))) | 4217 | (sql-comint product parameter) |
| 4218 | ;; Set process coding system to agree with the interpreter | ||
| 4219 | (setq nlslang (or (getenv "NLS_LANG") "") | ||
| 4220 | coding (dolist (cs | ||
| 4221 | ;; Are we missing any common NLS character sets | ||
| 4222 | '(("US8PC437" . cp437) | ||
| 4223 | ("EL8PC737" . cp737) | ||
| 4224 | ("WE8PC850" . cp850) | ||
| 4225 | ("EE8PC852" . cp852) | ||
| 4226 | ("TR8PC857" . cp857) | ||
| 4227 | ("WE8PC858" . cp858) | ||
| 4228 | ("IS8PC861" . cp861) | ||
| 4229 | ("IW8PC1507" . cp862) | ||
| 4230 | ("N8PC865" . cp865) | ||
| 4231 | ("RU8PC866" . cp866) | ||
| 4232 | ("US7ASCII" . us-ascii) | ||
| 4233 | ("UTF8" . utf-8) | ||
| 4234 | ("AL32UTF8" . utf-8) | ||
| 4235 | ("AL16UTF16" . utf-16)) | ||
| 4236 | (or coding 'utf-8)) | ||
| 4237 | (when (string-match (format "\\.%s\\'" (car cs)) nlslang) | ||
| 4238 | (setq coding (cdr cs))))) | ||
| 4239 | (set-buffer-process-coding-system coding coding))) | ||
| 4216 | 4240 | ||
| 4217 | (defun sql-oracle-save-settings (sqlbuf) | 4241 | (defun sql-oracle-save-settings (sqlbuf) |
| 4218 | "Save most SQL*Plus settings so they may be reset by \\[sql-redirect]." | 4242 | "Save most SQL*Plus settings so they may be reset by \\[sql-redirect]." |
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 0279319cc89..edfe368479c 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el | |||
| @@ -290,7 +290,7 @@ If no function name is found, return nil." | |||
| 290 | (when (and (null name) | 290 | (when (and (null name) |
| 291 | (boundp 'imenu--index-alist) (null imenu--index-alist) | 291 | (boundp 'imenu--index-alist) (null imenu--index-alist) |
| 292 | (null which-function-imenu-failed)) | 292 | (null which-function-imenu-failed)) |
| 293 | (imenu--make-index-alist t) | 293 | (ignore-errors (imenu--make-index-alist t)) |
| 294 | (unless imenu--index-alist | 294 | (unless imenu--index-alist |
| 295 | (set (make-local-variable 'which-function-imenu-failed) t))) | 295 | (set (make-local-variable 'which-function-imenu-failed) t))) |
| 296 | ;; If we have an index alist, use it. | 296 | ;; If we have an index alist, use it. |
| @@ -319,7 +319,9 @@ If no function name is found, return nil." | |||
| 319 | namestack (cons (car pair) namestack) | 319 | namestack (cons (car pair) namestack) |
| 320 | alist (cdr pair))) | 320 | alist (cdr pair))) |
| 321 | 321 | ||
| 322 | ((number-or-marker-p (setq mark (cdr pair))) | 322 | ((or (number-or-marker-p (setq mark (cdr pair))) |
| 323 | (and (overlayp mark) | ||
| 324 | (setq mark (overlay-start mark)))) | ||
| 323 | (when (and (>= (setq offset (- (point) mark)) 0) | 325 | (when (and (>= (setq offset (- (point) mark)) 0) |
| 324 | (< offset minoffset)) ; Find the closest item. | 326 | (< offset minoffset)) ; Find the closest item. |
| 325 | (setq minoffset offset | 327 | (setq minoffset offset |
diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 99f22df4107..f7c03c2de85 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el | |||
| @@ -1959,13 +1959,13 @@ Valid values are: | |||
| 1959 | 1959 | ||
| 1960 | Any other value is treated as nil. | 1960 | Any other value is treated as nil. |
| 1961 | 1961 | ||
| 1962 | If you set `ps-selected-pages' (see it for documentation), first the pages are | 1962 | If you set option `ps-selected-pages', first the pages are |
| 1963 | filtered by `ps-selected-pages' and then by `ps-even-or-odd-pages'. For | 1963 | filtered by option `ps-selected-pages' and then by `ps-even-or-odd-pages'. |
| 1964 | example, if we have: | 1964 | For example, if we have: |
| 1965 | 1965 | ||
| 1966 | (setq ps-selected-pages '(1 4 (6 . 10) (12 . 16) 20)) | 1966 | (setq ps-selected-pages '(1 4 (6 . 10) (12 . 16) 20)) |
| 1967 | 1967 | ||
| 1968 | Combining with `ps-even-or-odd-pages' and `ps-n-up-printing', we have: | 1968 | Combining with `ps-even-or-odd-pages' and option `ps-n-up-printing', we have: |
| 1969 | 1969 | ||
| 1970 | `ps-n-up-printing' = 1: | 1970 | `ps-n-up-printing' = 1: |
| 1971 | `ps-even-or-odd-pages' PAGES PRINTED | 1971 | `ps-even-or-odd-pages' PAGES PRINTED |
| @@ -3566,9 +3566,9 @@ Use the command `ps-despool' to send the spooled images to the printer." | |||
| 3566 | ;;;###autoload | 3566 | ;;;###autoload |
| 3567 | (defun ps-spool-buffer-with-faces () | 3567 | (defun ps-spool-buffer-with-faces () |
| 3568 | "Generate and spool a PostScript image of the buffer. | 3568 | "Generate and spool a PostScript image of the buffer. |
| 3569 | Like `ps-spool-buffer', but includes font, color, and underline information in | 3569 | Like the command `ps-spool-buffer', but includes font, color, and underline |
| 3570 | the generated image. This command works only if you are using a window system, | 3570 | information in the generated image. This command works only if you are using |
| 3571 | so it has a way to determine color values. | 3571 | a window system, so it has a way to determine color values. |
| 3572 | 3572 | ||
| 3573 | Use the command `ps-despool' to send the spooled images to the printer." | 3573 | Use the command `ps-despool' to send the spooled images to the printer." |
| 3574 | (interactive) | 3574 | (interactive) |
| @@ -5369,7 +5369,7 @@ Each element has the following form: | |||
| 5369 | (KIND XCOL YCOL XLIN YLIN REPEAT END XSTART YSTART) | 5369 | (KIND XCOL YCOL XLIN YLIN REPEAT END XSTART YSTART) |
| 5370 | 5370 | ||
| 5371 | Where: | 5371 | Where: |
| 5372 | KIND is a valid value of `ps-n-up-filling'. | 5372 | KIND is a valid value of the variable `ps-n-up-filling'. |
| 5373 | XCOL YCOL are the relative position for the next column. | 5373 | XCOL YCOL are the relative position for the next column. |
| 5374 | XLIN YLIN are the relative position for the beginning of next line. | 5374 | XLIN YLIN are the relative position for the beginning of next line. |
| 5375 | REPEAT is the number of repetitions for external loop. | 5375 | REPEAT is the number of repetitions for external loop. |
diff --git a/lisp/server.el b/lisp/server.el index 03d4bfc33df..64224d2a310 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -361,7 +361,7 @@ Updates `server-clients'." | |||
| 361 | 361 | ||
| 362 | (defconst server-buffer " *server*" | 362 | (defconst server-buffer " *server*" |
| 363 | "Buffer used internally by Emacs's server. | 363 | "Buffer used internally by Emacs's server. |
| 364 | One use is to log the I/O for debugging purposes (see `server-log'), | 364 | One use is to log the I/O for debugging purposes (see option `server-log'), |
| 365 | the other is to provide a current buffer in which the process filter can | 365 | the other is to provide a current buffer in which the process filter can |
| 366 | safely let-bind buffer-local variables like `default-directory'.") | 366 | safely let-bind buffer-local variables like `default-directory'.") |
| 367 | 367 | ||
| @@ -369,7 +369,7 @@ safely let-bind buffer-local variables like `default-directory'.") | |||
| 369 | "If non-nil, log the server's inputs and outputs in the `server-buffer'.") | 369 | "If non-nil, log the server's inputs and outputs in the `server-buffer'.") |
| 370 | 370 | ||
| 371 | (defun server-log (string &optional client) | 371 | (defun server-log (string &optional client) |
| 372 | "If `server-log' is non-nil, log STRING to `server-buffer'. | 372 | "If option `server-log' is non-nil, log STRING to `server-buffer'. |
| 373 | If CLIENT is non-nil, add a description of it to the logged message." | 373 | If CLIENT is non-nil, add a description of it to the logged message." |
| 374 | (when server-log | 374 | (when server-log |
| 375 | (with-current-buffer (get-buffer-create server-buffer) | 375 | (with-current-buffer (get-buffer-create server-buffer) |
diff --git a/lisp/simple.el b/lisp/simple.el index 19140cba496..847c07a5c26 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; simple.el --- basic editing commands for Emacs | 1 | ;;; simple.el --- basic editing commands for Emacs -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985-1987, 1993-2013 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985-1987, 1993-2013 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -401,7 +401,7 @@ Other major modes are defined by comparison with this one." | |||
| 401 | 401 | ||
| 402 | (defun newline (&optional arg) | 402 | (defun newline (&optional arg) |
| 403 | "Insert a newline, and move to left margin of the new line if it's blank. | 403 | "Insert a newline, and move to left margin of the new line if it's blank. |
| 404 | If `use-hard-newlines' is non-nil, the newline is marked with the | 404 | If option `use-hard-newlines' is non-nil, the newline is marked with the |
| 405 | text-property `hard'. | 405 | text-property `hard'. |
| 406 | With ARG, insert that many newlines. | 406 | With ARG, insert that many newlines. |
| 407 | Call `auto-fill-function' if the current column number is greater | 407 | Call `auto-fill-function' if the current column number is greater |
| @@ -752,7 +752,7 @@ If N is negative, delete newlines as well, leaving -N spaces." | |||
| 752 | (n (abs n))) | 752 | (n (abs n))) |
| 753 | (skip-chars-backward skip-characters) | 753 | (skip-chars-backward skip-characters) |
| 754 | (constrain-to-field nil orig-pos) | 754 | (constrain-to-field nil orig-pos) |
| 755 | (dotimes (i n) | 755 | (dotimes (_ n) |
| 756 | (if (= (following-char) ?\s) | 756 | (if (= (following-char) ?\s) |
| 757 | (forward-char 1) | 757 | (forward-char 1) |
| 758 | (insert ?\s))) | 758 | (insert ?\s))) |
| @@ -837,7 +837,7 @@ instead of deleted." | |||
| 837 | "Delete the previous N characters (following if N is negative). | 837 | "Delete the previous N characters (following if N is negative). |
| 838 | If Transient Mark mode is enabled, the mark is active, and N is 1, | 838 | If Transient Mark mode is enabled, the mark is active, and N is 1, |
| 839 | delete the text in the region and deactivate the mark instead. | 839 | delete the text in the region and deactivate the mark instead. |
| 840 | To disable this, set `delete-active-region' to nil. | 840 | To disable this, set option `delete-active-region' to nil. |
| 841 | 841 | ||
| 842 | Optional second arg KILLFLAG, if non-nil, means to kill (save in | 842 | Optional second arg KILLFLAG, if non-nil, means to kill (save in |
| 843 | kill ring) instead of delete. Interactively, N is the prefix | 843 | kill ring) instead of delete. Interactively, N is the prefix |
| @@ -873,7 +873,7 @@ the end of the line." | |||
| 873 | "Delete the following N characters (previous if N is negative). | 873 | "Delete the following N characters (previous if N is negative). |
| 874 | If Transient Mark mode is enabled, the mark is active, and N is 1, | 874 | If Transient Mark mode is enabled, the mark is active, and N is 1, |
| 875 | delete the text in the region and deactivate the mark instead. | 875 | delete the text in the region and deactivate the mark instead. |
| 876 | To disable this, set `delete-active-region' to nil. | 876 | To disable this, set variable `delete-active-region' to nil. |
| 877 | 877 | ||
| 878 | Optional second arg KILLFLAG non-nil means to kill (save in kill | 878 | Optional second arg KILLFLAG non-nil means to kill (save in kill |
| 879 | ring) instead of delete. Interactively, N is the prefix arg, and | 879 | ring) instead of delete. Interactively, N is the prefix arg, and |
| @@ -1391,14 +1391,16 @@ If the value is non-nil and not a number, we wait 2 seconds." | |||
| 1391 | ;; Aaron S. Hawley <aaron.s.hawley(at)gmail.com> 2009-08-24 | 1391 | ;; Aaron S. Hawley <aaron.s.hawley(at)gmail.com> 2009-08-24 |
| 1392 | "Read function name, then read its arguments and call it. | 1392 | "Read function name, then read its arguments and call it. |
| 1393 | 1393 | ||
| 1394 | To pass a numeric argument to the command you are invoking with, specify | 1394 | To pass a numeric argument to the command you are invoking, specify |
| 1395 | the numeric argument to this command. | 1395 | the numeric argument to this command. |
| 1396 | 1396 | ||
| 1397 | Noninteractively, the argument PREFIXARG is the prefix argument to | 1397 | Noninteractively, the argument PREFIXARG is the prefix argument to |
| 1398 | give to the command you invoke, if it asks for an argument." | 1398 | give to the command you invoke, if it asks for an argument." |
| 1399 | (interactive (list current-prefix-arg (read-extended-command))) | 1399 | (interactive (list current-prefix-arg (read-extended-command))) |
| 1400 | ;; Emacs<24 calling-convention was with a single `prefixarg' argument. | 1400 | ;; Emacs<24 calling-convention was with a single `prefixarg' argument. |
| 1401 | (if (null command-name) (setq command-name (read-extended-command))) | 1401 | (if (null command-name) |
| 1402 | (setq command-name (let ((current-prefix-arg prefixarg)) ; for prompt | ||
| 1403 | (read-extended-command)))) | ||
| 1402 | (let* ((function (and (stringp command-name) (intern-soft command-name))) | 1404 | (let* ((function (and (stringp command-name) (intern-soft command-name))) |
| 1403 | (binding (and suggest-key-bindings | 1405 | (binding (and suggest-key-bindings |
| 1404 | (not executing-kbd-macro) | 1406 | (not executing-kbd-macro) |
| @@ -1776,7 +1778,7 @@ Intended to be added to `minibuffer-setup-hook'." | |||
| 1776 | If there are no search errors, this function displays an overlay with | 1778 | If there are no search errors, this function displays an overlay with |
| 1777 | the isearch prompt which replaces the original minibuffer prompt. | 1779 | the isearch prompt which replaces the original minibuffer prompt. |
| 1778 | Otherwise, it displays the standard isearch message returned from | 1780 | Otherwise, it displays the standard isearch message returned from |
| 1779 | `isearch-message'." | 1781 | the function `isearch-message'." |
| 1780 | (if (not (and (minibufferp) isearch-success (not isearch-error))) | 1782 | (if (not (and (minibufferp) isearch-success (not isearch-error))) |
| 1781 | ;; Use standard function `isearch-message' when not in the minibuffer, | 1783 | ;; Use standard function `isearch-message' when not in the minibuffer, |
| 1782 | ;; or search fails, or has an error (like incomplete regexp). | 1784 | ;; or search fails, or has an error (like incomplete regexp). |
| @@ -1813,8 +1815,9 @@ or to the last history element for a backward search." | |||
| 1813 | "Save a function restoring the state of minibuffer history search. | 1815 | "Save a function restoring the state of minibuffer history search. |
| 1814 | Save `minibuffer-history-position' to the additional state parameter | 1816 | Save `minibuffer-history-position' to the additional state parameter |
| 1815 | in the search status stack." | 1817 | in the search status stack." |
| 1816 | `(lambda (cmd) | 1818 | (let ((pos minibuffer-history-position)) |
| 1817 | (minibuffer-history-isearch-pop-state cmd ,minibuffer-history-position))) | 1819 | (lambda (cmd) |
| 1820 | (minibuffer-history-isearch-pop-state cmd pos)))) | ||
| 1818 | 1821 | ||
| 1819 | (defun minibuffer-history-isearch-pop-state (_cmd hist-pos) | 1822 | (defun minibuffer-history-isearch-pop-state (_cmd hist-pos) |
| 1820 | "Restore the minibuffer history search state. | 1823 | "Restore the minibuffer history search state. |
| @@ -1979,6 +1982,117 @@ then call `undo-more' one or more times to undo them." | |||
| 1979 | (if (null pending-undo-list) | 1982 | (if (null pending-undo-list) |
| 1980 | (setq pending-undo-list t)))) | 1983 | (setq pending-undo-list t)))) |
| 1981 | 1984 | ||
| 1985 | (defun primitive-undo (n list) | ||
| 1986 | "Undo N records from the front of the list LIST. | ||
| 1987 | Return what remains of the list." | ||
| 1988 | |||
| 1989 | ;; This is a good feature, but would make undo-start | ||
| 1990 | ;; unable to do what is expected. | ||
| 1991 | ;;(when (null (car (list))) | ||
| 1992 | ;; ;; If the head of the list is a boundary, it is the boundary | ||
| 1993 | ;; ;; preceding this command. Get rid of it and don't count it. | ||
| 1994 | ;; (setq list (cdr list)))) | ||
| 1995 | |||
| 1996 | (let ((arg n) | ||
| 1997 | ;; In a writable buffer, enable undoing read-only text that is | ||
| 1998 | ;; so because of text properties. | ||
| 1999 | (inhibit-read-only t) | ||
| 2000 | ;; Don't let `intangible' properties interfere with undo. | ||
| 2001 | (inhibit-point-motion-hooks t) | ||
| 2002 | ;; We use oldlist only to check for EQ. ++kfs | ||
| 2003 | (oldlist buffer-undo-list) | ||
| 2004 | (did-apply nil) | ||
| 2005 | (next nil)) | ||
| 2006 | (while (> arg 0) | ||
| 2007 | (while (setq next (pop list)) ;Exit inner loop at undo boundary. | ||
| 2008 | ;; Handle an integer by setting point to that value. | ||
| 2009 | (pcase next | ||
| 2010 | ((pred integerp) (goto-char next)) | ||
| 2011 | ;; Element (t . TIME) records previous modtime. | ||
| 2012 | ;; Preserve any flag of NONEXISTENT_MODTIME_NSECS or | ||
| 2013 | ;; UNKNOWN_MODTIME_NSECS. | ||
| 2014 | (`(t . ,time) | ||
| 2015 | ;; If this records an obsolete save | ||
| 2016 | ;; (not matching the actual disk file) | ||
| 2017 | ;; then don't mark unmodified. | ||
| 2018 | (when (or (equal time (visited-file-modtime)) | ||
| 2019 | (and (consp time) | ||
| 2020 | (equal (list (car time) (cdr time)) | ||
| 2021 | (visited-file-modtime)))) | ||
| 2022 | (when (fboundp 'unlock-buffer) | ||
| 2023 | (unlock-buffer)) | ||
| 2024 | (set-buffer-modified-p nil))) | ||
| 2025 | ;; Element (nil PROP VAL BEG . END) is property change. | ||
| 2026 | (`(nil . ,(or `(,prop ,val ,beg . ,end) pcase--dontcare)) | ||
| 2027 | (when (or (> (point-min) beg) (< (point-max) end)) | ||
| 2028 | (error "Changes to be undone are outside visible portion of buffer")) | ||
| 2029 | (put-text-property beg end prop val)) | ||
| 2030 | ;; Element (BEG . END) means range was inserted. | ||
| 2031 | (`(,(and beg (pred integerp)) . ,(and end (pred integerp))) | ||
| 2032 | ;; (and `(,beg . ,end) `(,(pred integerp) . ,(pred integerp))) | ||
| 2033 | ;; Ideally: `(,(pred integerp beg) . ,(pred integerp end)) | ||
| 2034 | (when (or (> (point-min) beg) (< (point-max) end)) | ||
| 2035 | (error "Changes to be undone are outside visible portion of buffer")) | ||
| 2036 | ;; Set point first thing, so that undoing this undo | ||
| 2037 | ;; does not send point back to where it is now. | ||
| 2038 | (goto-char beg) | ||
| 2039 | (delete-region beg end)) | ||
| 2040 | ;; Element (apply FUN . ARGS) means call FUN to undo. | ||
| 2041 | (`(apply . ,fun-args) | ||
| 2042 | (let ((currbuff (current-buffer))) | ||
| 2043 | (if (integerp (car fun-args)) | ||
| 2044 | ;; Long format: (apply DELTA START END FUN . ARGS). | ||
| 2045 | (pcase-let* ((`(,delta ,start ,end ,fun . ,args) fun-args) | ||
| 2046 | (start-mark (copy-marker start nil)) | ||
| 2047 | (end-mark (copy-marker end t))) | ||
| 2048 | (when (or (> (point-min) start) (< (point-max) end)) | ||
| 2049 | (error "Changes to be undone are outside visible portion of buffer")) | ||
| 2050 | (apply fun args) ;; Use `save-current-buffer'? | ||
| 2051 | ;; Check that the function did what the entry | ||
| 2052 | ;; said it would do. | ||
| 2053 | (unless (and (= start start-mark) | ||
| 2054 | (= (+ delta end) end-mark)) | ||
| 2055 | (error "Changes to be undone by function different than announced")) | ||
| 2056 | (set-marker start-mark nil) | ||
| 2057 | (set-marker end-mark nil)) | ||
| 2058 | (apply fun-args)) | ||
| 2059 | (unless (eq currbuff (current-buffer)) | ||
| 2060 | (error "Undo function switched buffer")) | ||
| 2061 | (setq did-apply t))) | ||
| 2062 | ;; Element (STRING . POS) means STRING was deleted. | ||
| 2063 | (`(,(and string (pred stringp)) . ,(and pos (pred integerp))) | ||
| 2064 | (when (let ((apos (abs pos))) | ||
| 2065 | (or (< apos (point-min)) (> apos (point-max)))) | ||
| 2066 | (error "Changes to be undone are outside visible portion of buffer")) | ||
| 2067 | (if (< pos 0) | ||
| 2068 | (progn | ||
| 2069 | (goto-char (- pos)) | ||
| 2070 | (insert string)) | ||
| 2071 | (goto-char pos) | ||
| 2072 | ;; Now that we record marker adjustments | ||
| 2073 | ;; (caused by deletion) for undo, | ||
| 2074 | ;; we should always insert after markers, | ||
| 2075 | ;; so that undoing the marker adjustments | ||
| 2076 | ;; put the markers back in the right place. | ||
| 2077 | (insert string) | ||
| 2078 | (goto-char pos))) | ||
| 2079 | ;; (MARKER . OFFSET) means a marker MARKER was adjusted by OFFSET. | ||
| 2080 | (`(,(and marker (pred markerp)) . ,(and offset (pred integerp))) | ||
| 2081 | (when (marker-buffer marker) | ||
| 2082 | (set-marker marker | ||
| 2083 | (- marker offset) | ||
| 2084 | (marker-buffer marker)))) | ||
| 2085 | (_ (error "Unrecognized entry in undo list %S" next)))) | ||
| 2086 | (setq arg (1- arg))) | ||
| 2087 | ;; Make sure an apply entry produces at least one undo entry, | ||
| 2088 | ;; so the test in `undo' for continuing an undo series | ||
| 2089 | ;; will work right. | ||
| 2090 | (if (and did-apply | ||
| 2091 | (eq oldlist buffer-undo-list)) | ||
| 2092 | (setq buffer-undo-list | ||
| 2093 | (cons (list 'apply 'cdr nil) buffer-undo-list)))) | ||
| 2094 | list) | ||
| 2095 | |||
| 1982 | ;; Deep copy of a list | 2096 | ;; Deep copy of a list |
| 1983 | (defun undo-copy-list (list) | 2097 | (defun undo-copy-list (list) |
| 1984 | "Make a copy of undo list LIST." | 2098 | "Make a copy of undo list LIST." |
| @@ -3691,7 +3805,7 @@ If `show-trailing-whitespace' is non-nil, this command will just | |||
| 3691 | kill the rest of the current line, even if there are only | 3805 | kill the rest of the current line, even if there are only |
| 3692 | nonblanks there. | 3806 | nonblanks there. |
| 3693 | 3807 | ||
| 3694 | If `kill-whole-line' is non-nil, then this command kills the whole line | 3808 | If option `kill-whole-line' is non-nil, then this command kills the whole line |
| 3695 | including its terminating newline, when used at the beginning of a line | 3809 | including its terminating newline, when used at the beginning of a line |
| 3696 | with no argument. As a consequence, you can always kill a whole line | 3810 | with no argument. As a consequence, you can always kill a whole line |
| 3697 | by typing \\[move-beginning-of-line] \\[kill-line]. | 3811 | by typing \\[move-beginning-of-line] \\[kill-line]. |
| @@ -4461,13 +4575,13 @@ to use and more reliable (no dependence on goal column, etc.)." | |||
| 4461 | "Non-nil means vertical motion starting at end of line keeps to ends of lines. | 4575 | "Non-nil means vertical motion starting at end of line keeps to ends of lines. |
| 4462 | This means moving to the end of each line moved onto. | 4576 | This means moving to the end of each line moved onto. |
| 4463 | The beginning of a blank line does not count as the end of a line. | 4577 | The beginning of a blank line does not count as the end of a line. |
| 4464 | This has no effect when `line-move-visual' is non-nil." | 4578 | This has no effect when the variable `line-move-visual' is non-nil." |
| 4465 | :type 'boolean | 4579 | :type 'boolean |
| 4466 | :group 'editing-basics) | 4580 | :group 'editing-basics) |
| 4467 | 4581 | ||
| 4468 | (defcustom goal-column nil | 4582 | (defcustom goal-column nil |
| 4469 | "Semipermanent goal column for vertical motion, as set by \\[set-goal-column], or nil. | 4583 | "Semipermanent goal column for vertical motion, as set by \\[set-goal-column], or nil. |
| 4470 | A non-nil setting overrides `line-move-visual', which see." | 4584 | A non-nil setting overrides the variable `line-move-visual', which see." |
| 4471 | :type '(choice integer | 4585 | :type '(choice integer |
| 4472 | (const :tag "None" nil)) | 4586 | (const :tag "None" nil)) |
| 4473 | :group 'editing-basics) | 4587 | :group 'editing-basics) |
| @@ -4478,7 +4592,7 @@ A non-nil setting overrides `line-move-visual', which see." | |||
| 4478 | It is the column where point was at the start of the current run | 4592 | It is the column where point was at the start of the current run |
| 4479 | of vertical motion commands. | 4593 | of vertical motion commands. |
| 4480 | 4594 | ||
| 4481 | When moving by visual lines via `line-move-visual', it is a cons | 4595 | When moving by visual lines via the function `line-move-visual', it is a cons |
| 4482 | cell (COL . HSCROLL), where COL is the x-position, in pixels, | 4596 | cell (COL . HSCROLL), where COL is the x-position, in pixels, |
| 4483 | divided by the default column width, and HSCROLL is the number of | 4597 | divided by the default column width, and HSCROLL is the number of |
| 4484 | columns by which window is scrolled from left margin. | 4598 | columns by which window is scrolled from left margin. |
diff --git a/lisp/subr.el b/lisp/subr.el index 7e3c181e878..9f19268c864 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -3367,16 +3367,17 @@ If BODY finishes, `while-no-input' returns whatever value BODY produced." | |||
| 3367 | (progn ,@body))))))) | 3367 | (progn ,@body))))))) |
| 3368 | 3368 | ||
| 3369 | (defmacro condition-case-unless-debug (var bodyform &rest handlers) | 3369 | (defmacro condition-case-unless-debug (var bodyform &rest handlers) |
| 3370 | "Like `condition-case' except that it does not catch anything when debugging. | 3370 | "Like `condition-case' except that it does not prevent debugging. |
| 3371 | More specifically if `debug-on-error' is set, then it does not catch any signal." | 3371 | More specifically if `debug-on-error' is set then the debugger will be invoked |
| 3372 | even if this catches the signal." | ||
| 3372 | (declare (debug condition-case) (indent 2)) | 3373 | (declare (debug condition-case) (indent 2)) |
| 3373 | (let ((bodysym (make-symbol "body"))) | 3374 | `(condition-case ,var |
| 3374 | `(let ((,bodysym (lambda () ,bodyform))) | 3375 | ,bodyform |
| 3375 | (if debug-on-error | 3376 | ,@(mapcar (lambda (handler) |
| 3376 | (funcall ,bodysym) | 3377 | `((debug ,@(if (listp (car handler)) (car handler) |
| 3377 | (condition-case ,var | 3378 | (list (car handler)))) |
| 3378 | (funcall ,bodysym) | 3379 | ,@(cdr handler))) |
| 3379 | ,@handlers))))) | 3380 | handlers))) |
| 3380 | 3381 | ||
| 3381 | (define-obsolete-function-alias 'condition-case-no-debug | 3382 | (define-obsolete-function-alias 'condition-case-no-debug |
| 3382 | 'condition-case-unless-debug "24.1") | 3383 | 'condition-case-unless-debug "24.1") |
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 7e692960dbc..6ab3e3d3f16 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el | |||
| @@ -63,7 +63,7 @@ Non-nil means use highlight, nil means use minibuffer messages." | |||
| 63 | "Non-nil means Flyspell reports a repeated word as an error. | 63 | "Non-nil means Flyspell reports a repeated word as an error. |
| 64 | See `flyspell-mark-duplications-exceptions' to add exceptions to this rule. | 64 | See `flyspell-mark-duplications-exceptions' to add exceptions to this rule. |
| 65 | Detection of repeated words is not implemented in | 65 | Detection of repeated words is not implemented in |
| 66 | \"large\" regions; see `flyspell-large-region'." | 66 | \"large\" regions; see variable `flyspell-large-region'." |
| 67 | :group 'flyspell | 67 | :group 'flyspell |
| 68 | :type 'boolean) | 68 | :type 'boolean) |
| 69 | 69 | ||
| @@ -145,9 +145,10 @@ whose length is specified by `flyspell-delay'." | |||
| 145 | (defcustom flyspell-default-deplacement-commands | 145 | (defcustom flyspell-default-deplacement-commands |
| 146 | '(next-line previous-line | 146 | '(next-line previous-line |
| 147 | handle-switch-frame handle-select-window | 147 | handle-switch-frame handle-select-window |
| 148 | scroll-up scroll-down) | 148 | scroll-up |
| 149 | scroll-down) | ||
| 149 | "The standard list of deplacement commands for Flyspell. | 150 | "The standard list of deplacement commands for Flyspell. |
| 150 | See `flyspell-deplacement-commands'." | 151 | See variable `flyspell-deplacement-commands'." |
| 151 | :group 'flyspell | 152 | :group 'flyspell |
| 152 | :version "21.1" | 153 | :version "21.1" |
| 153 | :type '(repeat (symbol))) | 154 | :type '(repeat (symbol))) |
| @@ -445,13 +446,23 @@ like <img alt=\"Some thing.\">." | |||
| 445 | ;;*---------------------------------------------------------------------*/ | 446 | ;;*---------------------------------------------------------------------*/ |
| 446 | ;;* Highlighting */ | 447 | ;;* Highlighting */ |
| 447 | ;;*---------------------------------------------------------------------*/ | 448 | ;;*---------------------------------------------------------------------*/ |
| 448 | (defface flyspell-incorrect '((t :underline t :inherit error)) | 449 | (defface flyspell-incorrect |
| 450 | '((((supports :underline (:style wave))) | ||
| 451 | :underline (:style wave :color "Red1")) | ||
| 452 | (t | ||
| 453 | :underline t :inherit error)) | ||
| 449 | "Flyspell face for misspelled words." | 454 | "Flyspell face for misspelled words." |
| 455 | :version "24.4" | ||
| 450 | :group 'flyspell) | 456 | :group 'flyspell) |
| 451 | 457 | ||
| 452 | (defface flyspell-duplicate '((t :underline t :inherit warning)) | 458 | (defface flyspell-duplicate |
| 459 | '((((supports :underline (:style wave))) | ||
| 460 | :underline (:style wave :color "DarkOrange")) | ||
| 461 | (t | ||
| 462 | :underline t :inherit warning)) | ||
| 453 | "Flyspell face for words that appear twice in a row. | 463 | "Flyspell face for words that appear twice in a row. |
| 454 | See also `flyspell-duplicate-distance'." | 464 | See also `flyspell-duplicate-distance'." |
| 465 | :version "24.4" | ||
| 455 | :group 'flyspell) | 466 | :group 'flyspell) |
| 456 | 467 | ||
| 457 | (defvar flyspell-overlay nil) | 468 | (defvar flyspell-overlay nil) |
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 067ffdaa1f0..52e97b8248d 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -1594,8 +1594,8 @@ You can set this variable in hooks in your init file -- eg: | |||
| 1594 | 1594 | ||
| 1595 | (defun ispell-accept-output (&optional timeout-secs timeout-msecs) | 1595 | (defun ispell-accept-output (&optional timeout-secs timeout-msecs) |
| 1596 | "Wait for output from ispell process, or TIMEOUT-SECS and TIMEOUT-MSECS. | 1596 | "Wait for output from ispell process, or TIMEOUT-SECS and TIMEOUT-MSECS. |
| 1597 | If asynchronous subprocesses are not supported, call `ispell-filter' and | 1597 | If asynchronous subprocesses are not supported, call function `ispell-filter' |
| 1598 | pass it the output of the last ispell invocation." | 1598 | and pass it the output of the last ispell invocation." |
| 1599 | (if ispell-async-processp | 1599 | (if ispell-async-processp |
| 1600 | (accept-process-output ispell-process timeout-secs timeout-msecs) | 1600 | (accept-process-output ispell-process timeout-secs timeout-msecs) |
| 1601 | (if (null ispell-process) | 1601 | (if (null ispell-process) |
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index a7e44402a26..b7288772034 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -1926,7 +1926,7 @@ This takes effect when first loading the library.") | |||
| 1926 | ("ul" . "Unordered list") | 1926 | ("ul" . "Unordered list") |
| 1927 | ("var" . "Math variable face") | 1927 | ("var" . "Math variable face") |
| 1928 | ("wbr" . "Enable <br> within <nobr>")) | 1928 | ("wbr" . "Enable <br> within <nobr>")) |
| 1929 | "Value of `sgml-tag-help' for HTML mode.") | 1929 | "Value of variable `sgml-tag-help' for HTML mode.") |
| 1930 | 1930 | ||
| 1931 | (defvar outline-regexp) | 1931 | (defvar outline-regexp) |
| 1932 | (defvar outline-heading-end-regexp) | 1932 | (defvar outline-heading-end-regexp) |
diff --git a/lisp/vc/compare-w.el b/lisp/vc/compare-w.el index 2423d322460..fa451ccbe20 100644 --- a/lisp/vc/compare-w.el +++ b/lisp/vc/compare-w.el | |||
| @@ -53,13 +53,13 @@ whitespace is considered to match, and is skipped." | |||
| 53 | :group 'compare-windows) | 53 | :group 'compare-windows) |
| 54 | 54 | ||
| 55 | (defcustom compare-ignore-whitespace nil | 55 | (defcustom compare-ignore-whitespace nil |
| 56 | "Non-nil means `compare-windows' ignores whitespace." | 56 | "Non-nil means command `compare-windows' ignores whitespace." |
| 57 | :type 'boolean | 57 | :type 'boolean |
| 58 | :group 'compare-windows | 58 | :group 'compare-windows |
| 59 | :version "22.1") | 59 | :version "22.1") |
| 60 | 60 | ||
| 61 | (defcustom compare-ignore-case nil | 61 | (defcustom compare-ignore-case nil |
| 62 | "Non-nil means `compare-windows' ignores case differences." | 62 | "Non-nil means command `compare-windows' ignores case differences." |
| 63 | :type 'boolean | 63 | :type 'boolean |
| 64 | :group 'compare-windows) | 64 | :group 'compare-windows) |
| 65 | 65 | ||
| @@ -379,7 +379,7 @@ on third call it again advances points to the next difference and so on." | |||
| 379 | (delete-overlay compare-windows-overlay2))))) | 379 | (delete-overlay compare-windows-overlay2))))) |
| 380 | 380 | ||
| 381 | (defun compare-windows-dehighlight () | 381 | (defun compare-windows-dehighlight () |
| 382 | "Remove highlighting created by `compare-windows-highlight'." | 382 | "Remove highlighting created by function `compare-windows-highlight'." |
| 383 | (interactive) | 383 | (interactive) |
| 384 | (remove-hook 'pre-command-hook 'compare-windows-dehighlight) | 384 | (remove-hook 'pre-command-hook 'compare-windows-dehighlight) |
| 385 | (mapc 'delete-overlay compare-windows-overlays1) | 385 | (mapc 'delete-overlay compare-windows-overlays1) |
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index d0e496d2d21..8b4ff792969 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el | |||
| @@ -86,7 +86,7 @@ exists. If NO-ASYNC is non-nil, call diff synchronously. | |||
| 86 | 86 | ||
| 87 | When called interactively with a prefix argument, prompt | 87 | When called interactively with a prefix argument, prompt |
| 88 | interactively for diff switches. Otherwise, the switches | 88 | interactively for diff switches. Otherwise, the switches |
| 89 | specified in `diff-switches' are passed to the diff command." | 89 | specified in the variable `diff-switches' are passed to the diff command." |
| 90 | (interactive | 90 | (interactive |
| 91 | (let* ((newf (if (and buffer-file-name (file-exists-p buffer-file-name)) | 91 | (let* ((newf (if (and buffer-file-name (file-exists-p buffer-file-name)) |
| 92 | (read-file-name | 92 | (read-file-name |
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index f8e753772e4..dfc7eee81a6 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el | |||
| @@ -953,13 +953,14 @@ line of MSG." | |||
| 953 | (while (re-search-forward (concat "^" (car header) | 953 | (while (re-search-forward (concat "^" (car header) |
| 954 | ":" log-edit-header-contents-regexp) | 954 | ":" log-edit-header-contents-regexp) |
| 955 | nil t) | 955 | nil t) |
| 956 | (if (eq t (cdr header)) | 956 | (let ((txt (match-string 1))) |
| 957 | (setq summary (match-string 1)) | 957 | (replace-match "" t t) |
| 958 | (if (functionp (cdr header)) | 958 | (if (eq t (cdr header)) |
| 959 | (setq res (nconc res (funcall (cdr header) (match-string 1)))) | 959 | (setq summary txt) |
| 960 | (push (match-string 1) res) | 960 | (if (functionp (cdr header)) |
| 961 | (push (or (cdr header) (car header)) res))) | 961 | (setq res (nconc res (funcall (cdr header) txt))) |
| 962 | (replace-match "" t t))) | 962 | (push txt res) |
| 963 | (push (or (cdr header) (car header)) res)))))) | ||
| 963 | ;; Remove header separator if the header is empty. | 964 | ;; Remove header separator if the header is empty. |
| 964 | (widen) | 965 | (widen) |
| 965 | (goto-char (point-min)) | 966 | (goto-char (point-min)) |
diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index 52dc7edfa2d..208b93d9670 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el | |||
| @@ -856,7 +856,8 @@ the problem." | |||
| 856 | (defun cvs-cleanup-collection (c rm-handled rm-dirs rm-msgs) | 856 | (defun cvs-cleanup-collection (c rm-handled rm-dirs rm-msgs) |
| 857 | "Remove undesired entries. | 857 | "Remove undesired entries. |
| 858 | C is the collection | 858 | C is the collection |
| 859 | RM-HANDLED if non-nil means remove handled entries. | 859 | RM-HANDLED if non-nil means remove handled entries (if file is currently |
| 860 | visited, only remove if value is `all'). | ||
| 860 | RM-DIRS behaves like `cvs-auto-remove-directories'. | 861 | RM-DIRS behaves like `cvs-auto-remove-directories'. |
| 861 | RM-MSGS if non-nil means remove messages." | 862 | RM-MSGS if non-nil means remove messages." |
| 862 | (let (last-fi first-dir (rerun t)) | 863 | (let (last-fi first-dir (rerun t)) |
| @@ -870,16 +871,17 @@ RM-MSGS if non-nil means remove messages." | |||
| 870 | (subtype (cvs-fileinfo->subtype fi)) | 871 | (subtype (cvs-fileinfo->subtype fi)) |
| 871 | (keep | 872 | (keep |
| 872 | (pcase type | 873 | (pcase type |
| 873 | ;; remove temp messages and keep the others | 874 | ;; Remove temp messages and keep the others. |
| 874 | (`MESSAGE (not (or rm-msgs (eq subtype 'TEMP)))) | 875 | (`MESSAGE (not (or rm-msgs (eq subtype 'TEMP)))) |
| 875 | ;; remove entries | 876 | ;; Remove dead entries. |
| 876 | (`DEAD nil) | 877 | (`DEAD nil) |
| 877 | ;; handled also? | 878 | ;; Handled also? |
| 878 | (`UP-TO-DATE | 879 | (`UP-TO-DATE |
| 879 | (if (find-buffer-visiting (cvs-fileinfo->full-name fi)) | 880 | (not |
| 880 | t | 881 | (if (find-buffer-visiting (cvs-fileinfo->full-name fi)) |
| 881 | (not rm-handled))) | 882 | (eq rm-handled 'all) |
| 882 | ;; keep the rest | 883 | rm-handled))) |
| 884 | ;; Keep the rest. | ||
| 883 | (_ (not (run-hook-with-args-until-success | 885 | (_ (not (run-hook-with-args-until-success |
| 884 | 'cvs-cleanup-functions fi)))))) | 886 | 'cvs-cleanup-functions fi)))))) |
| 885 | 887 | ||
| @@ -2121,7 +2123,7 @@ if you are convinced that the process that created the lock is dead." | |||
| 2121 | Empty directories are removed." | 2123 | Empty directories are removed." |
| 2122 | (interactive) | 2124 | (interactive) |
| 2123 | (cvs-cleanup-collection cvs-cookies | 2125 | (cvs-cleanup-collection cvs-cookies |
| 2124 | t (or cvs-auto-remove-directories 'handled) t)) | 2126 | 'all (or cvs-auto-remove-directories 'handled) t)) |
| 2125 | 2127 | ||
| 2126 | 2128 | ||
| 2127 | (defun-cvs-mode cvs-mode-acknowledge () | 2129 | (defun-cvs-mode cvs-mode-acknowledge () |
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index f436d300089..0968c83ae5f 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el | |||
| @@ -620,15 +620,24 @@ or a superior directory.") | |||
| 620 | 620 | ||
| 621 | (declare-function log-edit-extract-headers "log-edit" (headers string)) | 621 | (declare-function log-edit-extract-headers "log-edit" (headers string)) |
| 622 | 622 | ||
| 623 | (defun vc-bzr--sanitize-header (arg) | ||
| 624 | ;; Newlines in --fixes (and probably other fields as well) trigger a nasty | ||
| 625 | ;; Bazaar bug; see https://bugs.launchpad.net/bzr/+bug/1094180. | ||
| 626 | (lambda (str) (list arg | ||
| 627 | (replace-regexp-in-string "\\`[ \t]+\\|[ \t]+\\'" | ||
| 628 | "" (replace-regexp-in-string | ||
| 629 | "\n[ \t]?" " " str))))) | ||
| 630 | |||
| 623 | (defun vc-bzr-checkin (files rev comment) | 631 | (defun vc-bzr-checkin (files rev comment) |
| 624 | "Check FILES in to bzr with log message COMMENT. | 632 | "Check FILES in to bzr with log message COMMENT. |
| 625 | REV non-nil gets an error." | 633 | REV non-nil gets an error." |
| 626 | (if rev (error "Can't check in a specific revision with bzr")) | 634 | (if rev (error "Can't check in a specific revision with bzr")) |
| 627 | (apply 'vc-bzr-command "commit" nil 0 | 635 | (apply 'vc-bzr-command "commit" nil 0 files |
| 628 | files (cons "-m" (log-edit-extract-headers '(("Author" . "--author") | 636 | (cons "-m" (log-edit-extract-headers |
| 629 | ("Date" . "--commit-time") | 637 | `(("Author" . ,(vc-bzr--sanitize-header "--author")) |
| 630 | ("Fixes" . "--fixes")) | 638 | ("Date" . ,(vc-bzr--sanitize-header "--commit-time")) |
| 631 | comment)))) | 639 | ("Fixes" . ,(vc-bzr--sanitize-header "--fixes"))) |
| 640 | comment)))) | ||
| 632 | 641 | ||
| 633 | (defun vc-bzr-find-revision (file rev buffer) | 642 | (defun vc-bzr-find-revision (file rev buffer) |
| 634 | "Fetch revision REV of file FILE and put it into BUFFER." | 643 | "Fetch revision REV of file FILE and put it into BUFFER." |
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 5a2b47bb34f..99436303fa2 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el | |||
| @@ -703,19 +703,21 @@ Before doing that, check if there are any old backups and get rid of them." | |||
| 703 | ;; the state to 'edited and redisplay the mode line. | 703 | ;; the state to 'edited and redisplay the mode line. |
| 704 | (let* ((file buffer-file-name) | 704 | (let* ((file buffer-file-name) |
| 705 | (backend (vc-backend file))) | 705 | (backend (vc-backend file))) |
| 706 | (and backend | 706 | (cond |
| 707 | (or (and (equal (vc-file-getprop file 'vc-checkout-time) | 707 | ((null backend)) |
| 708 | (nth 5 (file-attributes file))) | 708 | ((eq (vc-checkout-model backend (list file)) 'implicit) |
| 709 | ;; File has been saved in the same second in which | 709 | ;; If the file was saved in the same second in which it was |
| 710 | ;; it was checked out. Clear the checkout-time | 710 | ;; checked out, clear the checkout-time to avoid confusion. |
| 711 | ;; to avoid confusion. | 711 | (if (equal (vc-file-getprop file 'vc-checkout-time) |
| 712 | (vc-file-setprop file 'vc-checkout-time nil)) | 712 | (nth 5 (file-attributes file))) |
| 713 | t) | 713 | (vc-file-setprop file 'vc-checkout-time nil)) |
| 714 | (eq (vc-checkout-model backend (list file)) 'implicit) | 714 | (if (vc-state-refresh file backend) |
| 715 | (vc-state-refresh file backend) | 715 | (vc-mode-line file backend))) |
| 716 | (vc-mode-line file backend)) | 716 | ;; If we saved an unlocked file on a locking based VCS, that |
| 717 | ;; Try to avoid unnecessary work, a *vc-dir* buffer is | 717 | ;; file is not longer up-to-date. |
| 718 | ;; present if this is true. | 718 | ((eq (vc-file-getprop file 'vc-state) 'up-to-date) |
| 719 | (vc-file-setprop file 'vc-state nil))) | ||
| 720 | ;; Resynch *vc-dir* buffers, if any are present. | ||
| 719 | (when vc-dir-buffers | 721 | (when vc-dir-buffers |
| 720 | (vc-dir-resynch-file file)))) | 722 | (vc-dir-resynch-file file)))) |
| 721 | 723 | ||
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index fe259806267..9b8b94916c4 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -659,6 +659,10 @@ | |||
| 659 | (eval-when-compile | 659 | (eval-when-compile |
| 660 | (require 'dired)) | 660 | (require 'dired)) |
| 661 | 661 | ||
| 662 | (declare-function dired-get-filename "dired" (&optional localp noerror)) | ||
| 663 | (declare-function dired-move-to-filename "dired" (&optional err eol)) | ||
| 664 | (declare-function dired-marker-regexp "dired" ()) | ||
| 665 | |||
| 662 | (unless (assoc 'vc-parent-buffer minor-mode-alist) | 666 | (unless (assoc 'vc-parent-buffer minor-mode-alist) |
| 663 | (setq minor-mode-alist | 667 | (setq minor-mode-alist |
| 664 | (cons '(vc-parent-buffer vc-parent-buffer-name) | 668 | (cons '(vc-parent-buffer vc-parent-buffer-name) |
| @@ -1072,6 +1076,17 @@ For old-style locking-based version control systems, like RCS: | |||
| 1072 | ;; among all the `files'. | 1076 | ;; among all the `files'. |
| 1073 | (model (nth 4 vc-fileset))) | 1077 | (model (nth 4 vc-fileset))) |
| 1074 | 1078 | ||
| 1079 | ;; If a buffer has unsaved changes, a checkout would discard those | ||
| 1080 | ;; changes, so treat the buffer as having unlocked changes. | ||
| 1081 | (when (and (not (eq model 'implicit)) (eq state 'up-to-date)) | ||
| 1082 | (let ((files files)) | ||
| 1083 | (while files | ||
| 1084 | (let ((buffer (get-file-buffer (car files)))) | ||
| 1085 | (and buffer | ||
| 1086 | (buffer-modified-p buffer) | ||
| 1087 | (setq state 'unlocked-changes | ||
| 1088 | files nil)))))) | ||
| 1089 | |||
| 1075 | ;; Do the right thing | 1090 | ;; Do the right thing |
| 1076 | (cond | 1091 | (cond |
| 1077 | ((eq state 'missing) | 1092 | ((eq state 'missing) |
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index e2a726f4264..ed7edbc5a68 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -1271,19 +1271,19 @@ SYMBOL is a valid symbol associated with CHAR. | |||
| 1271 | 1271 | ||
| 1272 | (defvar whitespace-point (point) | 1272 | (defvar whitespace-point (point) |
| 1273 | "Used to save locally current point value. | 1273 | "Used to save locally current point value. |
| 1274 | Used by `whitespace-trailing-regexp' function (which see).") | 1274 | Used by function `whitespace-trailing-regexp' (which see).") |
| 1275 | 1275 | ||
| 1276 | (defvar whitespace-font-lock-refontify nil | 1276 | (defvar whitespace-font-lock-refontify nil |
| 1277 | "Used to save locally the font-lock refontify state. | 1277 | "Used to save locally the font-lock refontify state. |
| 1278 | Used by `whitespace-post-command-hook' function (which see).") | 1278 | Used by function `whitespace-post-command-hook' (which see).") |
| 1279 | 1279 | ||
| 1280 | (defvar whitespace-bob-marker nil | 1280 | (defvar whitespace-bob-marker nil |
| 1281 | "Used to save locally the bob marker value. | 1281 | "Used to save locally the bob marker value. |
| 1282 | Used by `whitespace-post-command-hook' function (which see).") | 1282 | Used by function `whitespace-post-command-hook' (which see).") |
| 1283 | 1283 | ||
| 1284 | (defvar whitespace-eob-marker nil | 1284 | (defvar whitespace-eob-marker nil |
| 1285 | "Used to save locally the eob marker value. | 1285 | "Used to save locally the eob marker value. |
| 1286 | Used by `whitespace-post-command-hook' function (which see).") | 1286 | Used by function `whitespace-post-command-hook' (which see).") |
| 1287 | 1287 | ||
| 1288 | (defvar whitespace-buffer-changed nil | 1288 | (defvar whitespace-buffer-changed nil |
| 1289 | "Used to indicate locally if buffer changed. | 1289 | "Used to indicate locally if buffer changed. |
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 5402b0ec204..fb62b039d79 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -526,7 +526,16 @@ Otherwise, just return the value." | |||
| 526 | "Extract the default external value of WIDGET." | 526 | "Extract the default external value of WIDGET." |
| 527 | (widget-apply widget :value-to-external | 527 | (widget-apply widget :value-to-external |
| 528 | (or (widget-get widget :value) | 528 | (or (widget-get widget :value) |
| 529 | (widget-apply widget :default-get)))) | 529 | (progn |
| 530 | (when (widget-get widget :args) | ||
| 531 | (let (args) | ||
| 532 | (dolist (arg (widget-get widget :args)) | ||
| 533 | (setq args (append args | ||
| 534 | (if (widget-get arg :inline) | ||
| 535 | (widget-get arg :args) | ||
| 536 | (list arg))))) | ||
| 537 | (widget-put widget :args args))) | ||
| 538 | (widget-apply widget :default-get))))) | ||
| 530 | 539 | ||
| 531 | (defun widget-match-inline (widget vals) | 540 | (defun widget-match-inline (widget vals) |
| 532 | "In WIDGET, match the start of VALS." | 541 | "In WIDGET, match the start of VALS." |