diff options
| author | Kenichi Handa | 2012-08-22 18:05:50 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-08-22 18:05:50 +0900 |
| commit | fabc1281e9cde34ff9a19d843316d2ceca8647ad (patch) | |
| tree | f38f13cab3ec6c32ab8ab49ea2e60f64969a0d22 /lisp | |
| parent | 4ff819d728960bf5e52b72501c606f4bb3fde028 (diff) | |
| parent | 842e3a93aa3a0826cb4148376e54cd1527d10901 (diff) | |
| download | emacs-fabc1281e9cde34ff9a19d843316d2ceca8647ad.tar.gz emacs-fabc1281e9cde34ff9a19d843316d2ceca8647ad.zip | |
merge trunk
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 187 | ||||
| -rw-r--r-- | lisp/calendar/cal-tex.el | 501 | ||||
| -rw-r--r-- | lisp/calendar/diary-lib.el | 31 | ||||
| -rw-r--r-- | lisp/calendar/holidays.el | 13 | ||||
| -rw-r--r-- | lisp/cus-face.el | 34 | ||||
| -rw-r--r-- | lisp/descr-text.el | 2 | ||||
| -rw-r--r-- | lisp/dired.el | 20 | ||||
| -rw-r--r-- | lisp/erc/ChangeLog | 26 | ||||
| -rw-r--r-- | lisp/erc/erc-join.el | 4 | ||||
| -rw-r--r-- | lisp/erc/erc-match.el | 2 | ||||
| -rw-r--r-- | lisp/erc/erc.el | 174 | ||||
| -rw-r--r-- | lisp/font-lock.el | 16 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/gnus-msg.el | 16 | ||||
| -rw-r--r-- | lisp/help-fns.el | 8 | ||||
| -rw-r--r-- | lisp/info.el | 47 | ||||
| -rw-r--r-- | lisp/json.el | 19 | ||||
| -rw-r--r-- | lisp/mail/rmail.el | 1 | ||||
| -rw-r--r-- | lisp/mail/rmailout.el | 80 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/bug-reference.el | 13 | ||||
| -rw-r--r-- | lisp/progmodes/js.el | 5 | ||||
| -rw-r--r-- | lisp/simple.el | 47 | ||||
| -rw-r--r-- | lisp/subr.el | 133 | ||||
| -rw-r--r-- | lisp/window.el | 114 | ||||
| -rw-r--r-- | lisp/xml.el | 26 |
26 files changed, 1039 insertions, 487 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6be54850414..4296280b22e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,190 @@ | |||
| 1 | 2012-08-22 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.el (walk-window-tree, window-with-parameter): New | ||
| 4 | optional argument MINIBUF to control whether these functions | ||
| 5 | should run on the minibuffer window. | ||
| 6 | (window-at-side-list): Don't operate on minibuffer window. | ||
| 7 | (window-in-direction): Simplify and rewrite doc-string. | ||
| 8 | (window--size-ignore): Rename to window--size-ignore-p. Update | ||
| 9 | callers. | ||
| 10 | |||
| 11 | 2012-08-22 Christopher Schmidt <christopher@ch.ristopher.com> | ||
| 12 | |||
| 13 | * help-fns.el (help-fns--key-bindings): | ||
| 14 | Abbreviate non-symbol remap targets. (Bug#12174) | ||
| 15 | |||
| 16 | 2012-08-22 Martin Rudalics <rudalics@gmx.at> | ||
| 17 | |||
| 18 | * dired.el (dired-mark-remembered): Don't clobber point. | ||
| 19 | (Bug#11795) | ||
| 20 | |||
| 21 | 2012-08-22 Glenn Morris <rgm@gnu.org> | ||
| 22 | |||
| 23 | * progmodes/bug-reference.el (bug-reference): New custom group. | ||
| 24 | (bug-reference-bug-regexp): Make it a defcustom. | ||
| 25 | |||
| 26 | 2012-08-22 Daiki Ueno <ueno@unixuser.org> | ||
| 27 | |||
| 28 | * progmodes/js.el (js-indent-level, js-expr-indent-offset) | ||
| 29 | (js-paren-indent-offset, js-square-indent-offset) | ||
| 30 | (js-curly-indent-offset): Add :safe (Bug#12257). | ||
| 31 | |||
| 32 | 2012-08-22 Edward O'Connor <hober0@gmail.com> | ||
| 33 | |||
| 34 | * json.el (json-key-format): Add error properties. | ||
| 35 | (json-encode-key): New function. | ||
| 36 | (json-encode-hash-table, json-encode-alist, json-encode-plist): | ||
| 37 | Use json-encode-key. | ||
| 38 | |||
| 39 | 2012-08-22 Glenn Morris <rgm@gnu.org> | ||
| 40 | |||
| 41 | * calendar/cal-tex.el (cal-tex-longday): New function, replacing... | ||
| 42 | (cal-tex-leftday, cal-tex-rightday): Remove functions. | ||
| 43 | (cal-tex-weekly-common, cal-tex-cursor-filofax-2week): | ||
| 44 | Update for above change. | ||
| 45 | |||
| 46 | 2012-08-21 Andreas Schwab <schwab@linux-m68k.org> | ||
| 47 | |||
| 48 | * cus-face.el (custom-face-attributes): Fix customize type for the | ||
| 49 | :underline attribute. (Bug#11805) | ||
| 50 | |||
| 51 | 2012-08-21 Martin Rudalics <rudalics@gmx.at> | ||
| 52 | |||
| 53 | * window.el (window-point-1, set-window-point-1): Remove. | ||
| 54 | (window-in-direction, record-window-buffer) | ||
| 55 | (set-window-buffer-start-and-point, split-window-below) | ||
| 56 | (window--state-get-1, display-buffer-record-window): Replace | ||
| 57 | calls to window-point-1 and set-window-point-1 by calls to | ||
| 58 | window-point and set-window-point respectively. | ||
| 59 | |||
| 60 | 2012-08-21 Glenn Morris <rgm@gnu.org> | ||
| 61 | |||
| 62 | * calendar/cal-tex.el (cal-tex-weekly-common): New function. | ||
| 63 | (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week): | ||
| 64 | Use it. | ||
| 65 | |||
| 66 | * calendar/cal-tex.el (cal-tex-rightday): Add optional funcname arg. | ||
| 67 | (cal-tex-shortday): New function. | ||
| 68 | (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week) | ||
| 69 | (cal-tex-cursor-filofax-daily): Use the above. | ||
| 70 | |||
| 71 | * calendar/cal-tex.el (cal-tex-leftday, cal-tex-rightday): | ||
| 72 | New functions. | ||
| 73 | (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) | ||
| 74 | (cal-tex-cursor-filofax-week): Use them. | ||
| 75 | |||
| 76 | * calendar/cal-tex.el (cal-tex-lefthead, cal-tex-righthead): | ||
| 77 | New constants. | ||
| 78 | (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) | ||
| 79 | (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use them. | ||
| 80 | |||
| 81 | * calendar/cal-tex.el (cal-tex-preamble): Generate new buffers. | ||
| 82 | (cal-tex-end-document): Don't rely on buffer name. | ||
| 83 | |||
| 84 | * calendar/cal-tex.el (cal-tex-cursor-filofax-year): | ||
| 85 | Use cal-tex-vspace. | ||
| 86 | (cal-tex-vspace, cal-tex-hspace, cal-tex-em, cal-tex-bf) | ||
| 87 | (cal-tex-Huge-bf, cal-tex-large-bf): Use cal-tex-cmd. | ||
| 88 | (cal-tex-scriptsize, cal-tex-huge, cal-tex-Huge, cal-tex-large): | ||
| 89 | Use cal-tex-arg. | ||
| 90 | |||
| 91 | * calendar/cal-tex.el (cal-tex-cursor-filofax-year) | ||
| 92 | (cal-tex-cursor-week, cal-tex-cursor-week2) | ||
| 93 | (cal-tex-cursor-week-iso, cal-tex-cursor-week-at-a-glance) | ||
| 94 | (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) | ||
| 95 | (cal-tex-cursor-filofax-daily, cal-tex-cursor-day) | ||
| 96 | (cal-tex-insert-preamble, cal-tex-b-document) | ||
| 97 | (cal-tex-e-document, cal-tex-b-center, cal-tex-e-center): | ||
| 98 | Improve cal-tex-cmd usage. | ||
| 99 | |||
| 100 | * calendar/cal-tex.el (cal-tex-filofax-paper): New function. | ||
| 101 | (cal-tex-cursor-filofax-year, cal-tex-cursor-filofax-2week) | ||
| 102 | (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use it. | ||
| 103 | (cal-tex-weekly-paper): New function. | ||
| 104 | (cal-tex-cursor-week, cal-tex-cursor-week2) | ||
| 105 | (cal-tex-cursor-week-iso, cal-tex-cursor-week-monday) | ||
| 106 | (cal-tex-cursor-day): Use it. | ||
| 107 | |||
| 108 | * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance) | ||
| 109 | (cal-tex-cursor-filofax-week): Remove leading blank page. | ||
| 110 | |||
| 111 | * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): | ||
| 112 | Add autoload cookie. For now at least, don't use color, since | ||
| 113 | no other cal-tex function does. | ||
| 114 | |||
| 115 | * calendar/cal-tex.el (cal-tex-cursor-week-iso) | ||
| 116 | (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) | ||
| 117 | (cal-tex-cursor-filofax-daily): Correct start date for diary entries. | ||
| 118 | |||
| 119 | 2012-08-21 Juri Linkov <juri@jurta.org> | ||
| 120 | |||
| 121 | * info.el (Info-file-attributes): New variable. | ||
| 122 | (info-insert-file-contents): Add file attributes to | ||
| 123 | `Info-file-attributes'. Clear the caches `Info-index-nodes' and | ||
| 124 | `Info-toc-nodes' when previous modtime of the Info file is less | ||
| 125 | than new modtime. | ||
| 126 | (Info-toc-nodes, Info-index-nodes): Move definitions up to the top | ||
| 127 | of info.el. (Bug#12230) | ||
| 128 | |||
| 129 | 2012-08-20 Glenn Morris <rgm@gnu.org> | ||
| 130 | |||
| 131 | * calendar/diary-lib.el (diary-include-files, diary-sexp-entry): | ||
| 132 | * calendar/holidays.el (calendar-holiday-list): | ||
| 133 | Report errors with display-warning rather than beep'n'sleep. | ||
| 134 | |||
| 135 | 2012-08-20 Michael Albinus <michael.albinus@gmx.de> | ||
| 136 | |||
| 137 | * net/tramp.el (tramp-accept-process-output): Accept only output | ||
| 138 | from PROC. Otherwise, process filters and sentinels might be | ||
| 139 | confused. (Bug#12145) | ||
| 140 | |||
| 141 | 2012-08-20 Chong Yidong <cyd@gnu.org> | ||
| 142 | |||
| 143 | * descr-text.el (describe-text-properties-1): Use overlays-in to | ||
| 144 | report on empty overlays (Bug#3322). | ||
| 145 | |||
| 146 | 2012-08-20 Glenn Morris <rgm@gnu.org> | ||
| 147 | |||
| 148 | * mail/rmailout.el (rmail-output-read-file-name): | ||
| 149 | Trap and report errors in rmail-output-file-alist elements. | ||
| 150 | |||
| 151 | * font-lock.el (font-lock-add-keywords): Doc fix (quote face names | ||
| 152 | since most non-font-lock faces are not also variables). | ||
| 153 | |||
| 154 | 2012-08-20 Edward Reingold <reingold@iit.edu> | ||
| 155 | |||
| 156 | * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): | ||
| 157 | New function. (Bug12160) | ||
| 158 | |||
| 159 | 2012-08-19 Glenn Morris <rgm@gnu.org> | ||
| 160 | |||
| 161 | * mail/rmailout.el (rmail-output-read-file-name): | ||
| 162 | Fix previous change (when the alist is nil or does not match). | ||
| 163 | |||
| 164 | 2012-08-19 Chong Yidong <cyd@gnu.org> | ||
| 165 | |||
| 166 | * xml.el (xml-escape-string): Don't refer to xml-entity-alist | ||
| 167 | (Bug#12228). | ||
| 168 | |||
| 169 | 2012-08-18 Chong Yidong <cyd@gnu.org> | ||
| 170 | |||
| 171 | * simple.el (yank-handled-properties): New defcustom. | ||
| 172 | (yank-excluded-properties): Add font-lock-face and category. | ||
| 173 | (yank): Doc fix. | ||
| 174 | |||
| 175 | * subr.el (remove-yank-excluded-properties): Obey | ||
| 176 | yank-handled-properties. The special handling of font-lock-face | ||
| 177 | and category is now done this way, instead of being hard-coded. | ||
| 178 | (insert-for-yank-1): Remove font-lock-face handling. | ||
| 179 | (yank-handle-font-lock-face-property) | ||
| 180 | (yank-handle-category-property): New function. | ||
| 181 | |||
| 182 | 2012-08-17 Glenn Morris <rgm@gnu.org> | ||
| 183 | |||
| 184 | * mail/rmailout.el (rmail-output-read-file-name): | ||
| 185 | Check rmail-output-file-alist against the full message body | ||
| 186 | in the correct rmail buffer. (Bug#12214) | ||
| 187 | |||
| 1 | 2012-08-17 Michael Albinus <michael.albinus@gmx.de> | 188 | 2012-08-17 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 189 | ||
| 3 | * net/tramp-sh.el (tramp-sh-handle-start-file-process): Eliminate | 190 | * net/tramp-sh.el (tramp-sh-handle-start-file-process): Eliminate |
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index a40c05f45ca..d8d2a09c871 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el | |||
| @@ -237,6 +237,14 @@ The names are taken from `calendar-day-name-array'.") | |||
| 237 | "LaTeX code to insert one box with date info in calendar. | 237 | "LaTeX code to insert one box with date info in calendar. |
| 238 | This definition is the heart of the calendar!") | 238 | This definition is the heart of the calendar!") |
| 239 | 239 | ||
| 240 | (defconst cal-tex-lefthead | ||
| 241 | "\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]}\n" | ||
| 242 | "LaTeX code for left header.") | ||
| 243 | |||
| 244 | (defconst cal-tex-righthead | ||
| 245 | "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}\n" | ||
| 246 | "LaTeX code for right header.") | ||
| 247 | |||
| 240 | (autoload 'holiday-in-range "holidays") | 248 | (autoload 'holiday-in-range "holidays") |
| 241 | 249 | ||
| 242 | (define-obsolete-function-alias 'cal-tex-list-holidays 'holiday-in-range "24.3") | 250 | (define-obsolete-function-alias 'cal-tex-list-holidays 'holiday-in-range "24.3") |
| @@ -253,14 +261,14 @@ This definition is the heart of the calendar!") | |||
| 253 | "Insert the LaTeX calendar preamble into `cal-tex-buffer'. | 261 | "Insert the LaTeX calendar preamble into `cal-tex-buffer'. |
| 254 | Preamble includes initial definitions for various LaTeX commands. | 262 | Preamble includes initial definitions for various LaTeX commands. |
| 255 | Optional string ARGS are included as options for the article document class." | 263 | Optional string ARGS are included as options for the article document class." |
| 256 | ;; FIXME use generate-new-buffer, and adjust cal-tex-end-document. | 264 | (set-buffer (generate-new-buffer cal-tex-buffer)) |
| 257 | (set-buffer (get-buffer-create cal-tex-buffer)) | ||
| 258 | (insert (format "\\documentclass%s{article}\n" | 265 | (insert (format "\\documentclass%s{article}\n" |
| 259 | (if (stringp args) | 266 | (if (stringp args) |
| 260 | (format "[%s]" args) | 267 | (format "[%s]" args) |
| 261 | ""))) | 268 | ""))) |
| 262 | (if (stringp cal-tex-preamble-extra) | 269 | (if (stringp cal-tex-preamble-extra) |
| 263 | (insert cal-tex-preamble-extra "\n")) | 270 | (insert cal-tex-preamble-extra "\n")) |
| 271 | ;; FIXME boxwidth and boxheight unused? | ||
| 264 | (insert "\\hbadness 20000 | 272 | (insert "\\hbadness 20000 |
| 265 | \\hfuzz=1000pt | 273 | \\hfuzz=1000pt |
| 266 | \\vbadness 20000 | 274 | \\vbadness 20000 |
| @@ -344,6 +352,54 @@ landscape mode with three rows of four months each." | |||
| 344 | (run-hooks 'cal-tex-year-hook)) | 352 | (run-hooks 'cal-tex-year-hook)) |
| 345 | (run-hooks 'cal-tex-hook)) | 353 | (run-hooks 'cal-tex-hook)) |
| 346 | 354 | ||
| 355 | |||
| 356 | (defun cal-tex-filofax-paper (&optional year) | ||
| 357 | "Insert some page size settings for filofax layouts." | ||
| 358 | (insert "\\textwidth 3.25in | ||
| 359 | \\textheight 6.5in | ||
| 360 | \\headheight -0.875in | ||
| 361 | \\topmargin 0pt | ||
| 362 | ") | ||
| 363 | (insert | ||
| 364 | ;; Why is this one subtly different? Who knows... | ||
| 365 | (if year "\\oddsidemargin 1.675in | ||
| 366 | \\evensidemargin 1.675in | ||
| 367 | " | ||
| 368 | "\\oddsidemargin 1.75in | ||
| 369 | \\evensidemargin 1.5in | ||
| 370 | \\headsep 0.125in | ||
| 371 | \\footskip 0.125in | ||
| 372 | "))) | ||
| 373 | |||
| 374 | (defun cal-tex-longday (funcname height) | ||
| 375 | "Insert LaTeX code for a long day function." | ||
| 376 | (insert "\\long\\def\\" funcname "#1#2#3#4#5{% | ||
| 377 | \\rule{\\textwidth}{0.3pt}\\\\% | ||
| 378 | \\hbox to \\textwidth{% | ||
| 379 | \\vbox to " height "{% | ||
| 380 | \\vspace*{2pt}% | ||
| 381 | \\hbox to \\textwidth{" | ||
| 382 | (if (string-equal funcname "leftday") | ||
| 383 | "\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}%\n" | ||
| 384 | "\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%\n") | ||
| 385 | " \\hbox to \\textwidth{\\vbox {\\" | ||
| 386 | (if (string-equal funcname "leftday") "noindent" "raggedleft") | ||
| 387 | " \\footnotesize \\em #4}}% | ||
| 388 | \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) | ||
| 389 | |||
| 390 | (defun cal-tex-shortday (funcname) | ||
| 391 | "Insert LaTeX code for a short day function." | ||
| 392 | (insert "\\long\\def\\" funcname "#1#2#3{% | ||
| 393 | \\rule{\\textwidth}{0.3pt}\\\\% | ||
| 394 | \\hbox to \\textwidth{% | ||
| 395 | \\vbox {% | ||
| 396 | \\vspace*{2pt}% | ||
| 397 | \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% | ||
| 398 | \\hbox to \\textwidth{\\vbox {\\" | ||
| 399 | (if (string-equal funcname "rightday") "raggedleft" "noindent") | ||
| 400 | " \\em #2}}% | ||
| 401 | \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}}\n")) | ||
| 402 | |||
| 347 | ;;;###cal-autoload | 403 | ;;;###cal-autoload |
| 348 | (defun cal-tex-cursor-filofax-year (&optional n event) | 404 | (defun cal-tex-cursor-filofax-year (&optional n event) |
| 349 | "Make a Filofax one page yearly calendar of year indicated by cursor. | 405 | "Make a Filofax one page yearly calendar of year indicated by cursor. |
| @@ -354,16 +410,11 @@ Optional EVENT indicates a buffer position to use instead of point." | |||
| 354 | (or n (setq n 1)) | 410 | (or n (setq n 1)) |
| 355 | (let ((year (calendar-extract-year (calendar-cursor-to-date t event)))) | 411 | (let ((year (calendar-extract-year (calendar-cursor-to-date t event)))) |
| 356 | (cal-tex-preamble "twoside") | 412 | (cal-tex-preamble "twoside") |
| 357 | (cal-tex-cmd "\\textwidth 3.25in") | 413 | (cal-tex-filofax-paper 'year) |
| 358 | (cal-tex-cmd "\\textheight 6.5in") | ||
| 359 | (cal-tex-cmd "\\oddsidemargin 1.675in") | ||
| 360 | (cal-tex-cmd "\\evensidemargin 1.675in") | ||
| 361 | (cal-tex-cmd "\\topmargin 0pt") | ||
| 362 | (cal-tex-cmd "\\headheight -0.875in") | ||
| 363 | (cal-tex-cmd "\\fboxsep 0.5mm") | 414 | (cal-tex-cmd "\\fboxsep 0.5mm") |
| 364 | (cal-tex-cmd "\\pagestyle{empty}") | 415 | (cal-tex-cmd "\\pagestyle" "empty") |
| 365 | (cal-tex-b-document) | 416 | (cal-tex-b-document) |
| 366 | (cal-tex-cmd "\\vspace*{0.25in}") | 417 | (cal-tex-vspace "0.25in") |
| 367 | (dotimes (j n) | 418 | (dotimes (j n) |
| 368 | (insert (format "\\hfil \\textbf{\\Large %s} \\hfil\\\\\n" year)) | 419 | (insert (format "\\hfil \\textbf{\\Large %s} \\hfil\\\\\n" year)) |
| 369 | (cal-tex-b-center) | 420 | (cal-tex-b-center) |
| @@ -391,7 +442,7 @@ Optional EVENT indicates a buffer position to use instead of point." | |||
| 391 | (if (= j (1- n)) | 442 | (if (= j (1- n)) |
| 392 | (cal-tex-end-document) | 443 | (cal-tex-end-document) |
| 393 | (cal-tex-newpage) | 444 | (cal-tex-newpage) |
| 394 | (cal-tex-cmd "\\vspace*{0.25in}")) | 445 | (cal-tex-vspace "0.25in")) |
| 395 | (run-hooks 'cal-tex-year-hook)) | 446 | (run-hooks 'cal-tex-year-hook)) |
| 396 | (run-hooks 'cal-tex-hook))) | 447 | (run-hooks 'cal-tex-hook))) |
| 397 | 448 | ||
| @@ -653,6 +704,15 @@ this is only an upper bound." | |||
| 653 | {\\makebox[2em]{\\rule{0cm}{#2ex}#1}\\rule{3in}{.15mm}}\n" | 704 | {\\makebox[2em]{\\rule{0cm}{#2ex}#1}\\rule{3in}{.15mm}}\n" |
| 654 | "One hour and a line on the right.") | 705 | "One hour and a line on the right.") |
| 655 | 706 | ||
| 707 | (defun cal-tex-weekly-paper (&optional nomargins) | ||
| 708 | "Insert some page size settings for weekly layouts." | ||
| 709 | (insert "\\textwidth 6.5in | ||
| 710 | \\textheight 10.5in | ||
| 711 | ") | ||
| 712 | (or nomargins (insert "\\oddsidemargin 0in | ||
| 713 | \\evensidemargin 0in | ||
| 714 | "))) | ||
| 715 | |||
| 656 | ;; TODO cal-tex-diary-support. | 716 | ;; TODO cal-tex-diary-support. |
| 657 | ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours). | 717 | ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours). |
| 658 | ;;;###cal-autoload | 718 | ;;;###cal-autoload |
| @@ -677,13 +737,10 @@ entries are not shown). The calendar shows the hours 8-12am, 1-5pm." | |||
| 677 | (holidays (if cal-tex-holidays | 737 | (holidays (if cal-tex-holidays |
| 678 | (holiday-in-range d1 d2)))) | 738 | (holiday-in-range d1 d2)))) |
| 679 | (cal-tex-preamble "11pt") | 739 | (cal-tex-preamble "11pt") |
| 680 | (cal-tex-cmd "\\textwidth 6.5in") | 740 | (cal-tex-weekly-paper) |
| 681 | (cal-tex-cmd "\\textheight 10.5in") | ||
| 682 | (cal-tex-cmd "\\oddsidemargin 0in") | ||
| 683 | (cal-tex-cmd "\\evensidemargin 0in") | ||
| 684 | (insert cal-tex-LaTeX-hourbox) | 741 | (insert cal-tex-LaTeX-hourbox) |
| 685 | (cal-tex-b-document) | 742 | (cal-tex-b-document) |
| 686 | (cal-tex-cmd "\\pagestyle{empty}") | 743 | (cal-tex-cmd "\\pagestyle" "empty") |
| 687 | (dotimes (i n) | 744 | (dotimes (i n) |
| 688 | (cal-tex-vspace "-1.5in") | 745 | (cal-tex-vspace "-1.5in") |
| 689 | (cal-tex-b-center) | 746 | (cal-tex-b-center) |
| @@ -732,13 +789,10 @@ Optional EVENT indicates a buffer position to use instead of point." | |||
| 732 | (holidays (if cal-tex-holidays | 789 | (holidays (if cal-tex-holidays |
| 733 | (holiday-in-range d1 d2)))) | 790 | (holiday-in-range d1 d2)))) |
| 734 | (cal-tex-preamble "12pt") | 791 | (cal-tex-preamble "12pt") |
| 735 | (cal-tex-cmd "\\textwidth 6.5in") | 792 | (cal-tex-weekly-paper) |
| 736 | (cal-tex-cmd "\\textheight 10.5in") | ||
| 737 | (cal-tex-cmd "\\oddsidemargin 0in") | ||
| 738 | (cal-tex-cmd "\\evensidemargin 0in") | ||
| 739 | (insert cal-tex-LaTeX-hourbox) | 793 | (insert cal-tex-LaTeX-hourbox) |
| 740 | (cal-tex-b-document) | 794 | (cal-tex-b-document) |
| 741 | (cal-tex-cmd "\\pagestyle{empty}") | 795 | (cal-tex-cmd "\\pagestyle" "empty") |
| 742 | (dotimes (i n) | 796 | (dotimes (i n) |
| 743 | (cal-tex-vspace "-1.5in") | 797 | (cal-tex-vspace "-1.5in") |
| 744 | (cal-tex-b-center) | 798 | (cal-tex-b-center) |
| @@ -816,18 +870,12 @@ position to use instead of point." | |||
| 816 | (holidays (if cal-tex-holidays | 870 | (holidays (if cal-tex-holidays |
| 817 | (holiday-in-range d1 d2))) | 871 | (holiday-in-range d1 d2))) |
| 818 | (diary-list (if cal-tex-diary | 872 | (diary-list (if cal-tex-diary |
| 819 | (cal-tex-list-diary-entries | 873 | (cal-tex-list-diary-entries d1 d2))) |
| 820 | ;; FIXME d1? | ||
| 821 | (calendar-absolute-from-gregorian (list month 1 year)) | ||
| 822 | d2))) | ||
| 823 | s) | 874 | s) |
| 824 | (cal-tex-preamble "11pt") | 875 | (cal-tex-preamble "11pt") |
| 825 | (cal-tex-cmd "\\textwidth 6.5in") | 876 | (cal-tex-weekly-paper) |
| 826 | (cal-tex-cmd "\\textheight 10.5in") | ||
| 827 | (cal-tex-cmd "\\oddsidemargin 0in") | ||
| 828 | (cal-tex-cmd "\\evensidemargin 0in") | ||
| 829 | (cal-tex-b-document) | 877 | (cal-tex-b-document) |
| 830 | (cal-tex-cmd "\\pagestyle{empty}") | 878 | (cal-tex-cmd "\\pagestyle" "empty") |
| 831 | (dotimes (i n) | 879 | (dotimes (i n) |
| 832 | (cal-tex-vspace "-1.5in") | 880 | (cal-tex-vspace "-1.5in") |
| 833 | (cal-tex-b-center) | 881 | (cal-tex-b-center) |
| @@ -944,10 +992,7 @@ to use instead of point." | |||
| 944 | (calendar-absolute-from-gregorian | 992 | (calendar-absolute-from-gregorian |
| 945 | (calendar-cursor-to-date t event)))))) | 993 | (calendar-cursor-to-date t event)))))) |
| 946 | (cal-tex-preamble "11pt") | 994 | (cal-tex-preamble "11pt") |
| 947 | (cal-tex-cmd "\\textwidth 6.5in") | 995 | (cal-tex-weekly-paper) |
| 948 | (cal-tex-cmd "\\textheight 10.5in") | ||
| 949 | (cal-tex-cmd "\\oddsidemargin 0in") | ||
| 950 | (cal-tex-cmd "\\evensidemargin 0in") | ||
| 951 | (cal-tex-b-document) | 996 | (cal-tex-b-document) |
| 952 | (dotimes (i n) | 997 | (dotimes (i n) |
| 953 | (cal-tex-vspace "-1cm") | 998 | (cal-tex-vspace "-1cm") |
| @@ -1009,112 +1054,8 @@ shown are hard-coded to 8-12, 13-17." | |||
| 1009 | (cal-tex-e-framebox) | 1054 | (cal-tex-e-framebox) |
| 1010 | (cal-tex-hspace "1cm"))) | 1055 | (cal-tex-hspace "1cm"))) |
| 1011 | 1056 | ||
| 1012 | ;;;###cal-autoload | 1057 | (defun cal-tex-weekly-common (n event &optional filofax) |
| 1013 | (defun cal-tex-cursor-filofax-2week (&optional n event) | 1058 | "Common code for weekly calendars." |
| 1014 | "Two-weeks-at-a-glance Filofax style calendar for week cursor is in. | ||
| 1015 | Optional prefix argument N specifies number of weeks (default 1). | ||
| 1016 | The calendar shows holiday and diary entries if | ||
| 1017 | `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. | ||
| 1018 | Optional EVENT indicates a buffer position to use instead of point." | ||
| 1019 | (interactive (list (prefix-numeric-value current-prefix-arg) | ||
| 1020 | last-nonmenu-event)) | ||
| 1021 | (or n (setq n 1)) | ||
| 1022 | (let* ((date (calendar-gregorian-from-absolute | ||
| 1023 | (calendar-dayname-on-or-before | ||
| 1024 | calendar-week-start-day | ||
| 1025 | (calendar-absolute-from-gregorian | ||
| 1026 | (calendar-cursor-to-date t event))))) | ||
| 1027 | (month (calendar-extract-month date)) | ||
| 1028 | (year (calendar-extract-year date)) | ||
| 1029 | (day (calendar-extract-day date)) | ||
| 1030 | (d1 (calendar-absolute-from-gregorian date)) | ||
| 1031 | (d2 (+ (* 7 n) d1)) | ||
| 1032 | (holidays (if cal-tex-holidays | ||
| 1033 | (holiday-in-range d1 d2))) | ||
| 1034 | (diary-list (if cal-tex-diary | ||
| 1035 | (cal-tex-list-diary-entries | ||
| 1036 | ;; FIXME d1? | ||
| 1037 | (calendar-absolute-from-gregorian (list month 1 year)) | ||
| 1038 | d2)))) | ||
| 1039 | (cal-tex-preamble "twoside") | ||
| 1040 | (cal-tex-cmd "\\textwidth 3.25in") | ||
| 1041 | (cal-tex-cmd "\\textheight 6.5in") | ||
| 1042 | (cal-tex-cmd "\\oddsidemargin 1.75in") | ||
| 1043 | (cal-tex-cmd "\\evensidemargin 1.5in") | ||
| 1044 | (cal-tex-cmd "\\topmargin 0pt") | ||
| 1045 | (cal-tex-cmd "\\headheight -0.875in") | ||
| 1046 | (cal-tex-cmd "\\headsep 0.125in") | ||
| 1047 | (cal-tex-cmd "\\footskip .125in") | ||
| 1048 | (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} | ||
| 1049 | \\long\\def\\rightday#1#2#3#4#5{% | ||
| 1050 | \\rule{\\textwidth}{0.3pt}\\\\% | ||
| 1051 | \\hbox to \\textwidth{% | ||
| 1052 | \\vbox to 0.7in{% | ||
| 1053 | \\vspace*{2pt}% | ||
| 1054 | \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% | ||
| 1055 | \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% | ||
| 1056 | \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} | ||
| 1057 | \\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} | ||
| 1058 | \\long\\def\\leftday#1#2#3#4#5{% | ||
| 1059 | \\rule{\\textwidth}{0.3pt}\\\\% | ||
| 1060 | \\hbox to \\textwidth{% | ||
| 1061 | \\vbox to 0.7in{% | ||
| 1062 | \\vspace*{2pt}% | ||
| 1063 | \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% | ||
| 1064 | \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% | ||
| 1065 | \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} | ||
| 1066 | ") | ||
| 1067 | (cal-tex-b-document) | ||
| 1068 | (cal-tex-cmd "\\pagestyle{empty}") | ||
| 1069 | (dotimes (i n) | ||
| 1070 | (if (zerop (mod i 2)) | ||
| 1071 | (insert "\\righthead") | ||
| 1072 | (insert "\\lefthead")) | ||
| 1073 | (cal-tex-arg | ||
| 1074 | (let ((d (cal-tex-incr-date date 6))) | ||
| 1075 | (if (= (calendar-extract-month date) | ||
| 1076 | (calendar-extract-month d)) | ||
| 1077 | (format "%s %s" | ||
| 1078 | (cal-tex-month-name (calendar-extract-month date)) | ||
| 1079 | (calendar-extract-year date)) | ||
| 1080 | (if (= (calendar-extract-year date) | ||
| 1081 | (calendar-extract-year d)) | ||
| 1082 | (format "%s---%s %s" | ||
| 1083 | (cal-tex-month-name (calendar-extract-month date)) | ||
| 1084 | (cal-tex-month-name (calendar-extract-month d)) | ||
| 1085 | (calendar-extract-year date)) | ||
| 1086 | (format "%s %s---%s %s" | ||
| 1087 | (cal-tex-month-name (calendar-extract-month date)) | ||
| 1088 | (calendar-extract-year date) | ||
| 1089 | (cal-tex-month-name (calendar-extract-month d)) | ||
| 1090 | (calendar-extract-year d)))))) | ||
| 1091 | (insert "%\n") | ||
| 1092 | (dotimes (_jdummy 7) | ||
| 1093 | (if (zerop (mod i 2)) | ||
| 1094 | (insert "\\rightday") | ||
| 1095 | (insert "\\leftday")) | ||
| 1096 | (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) | ||
| 1097 | (cal-tex-arg (number-to-string (calendar-extract-day date))) | ||
| 1098 | (cal-tex-arg (cal-tex-latexify-list diary-list date)) | ||
| 1099 | (cal-tex-arg (cal-tex-latexify-list holidays date)) | ||
| 1100 | (cal-tex-arg (eval cal-tex-daily-string)) | ||
| 1101 | (insert "%\n") | ||
| 1102 | (setq date (cal-tex-incr-date date))) | ||
| 1103 | (unless (= i (1- n)) | ||
| 1104 | (run-hooks 'cal-tex-week-hook) | ||
| 1105 | (cal-tex-newpage))) | ||
| 1106 | (cal-tex-end-document) | ||
| 1107 | (run-hooks 'cal-tex-hook))) | ||
| 1108 | |||
| 1109 | ;;;###cal-autoload | ||
| 1110 | (defun cal-tex-cursor-filofax-week (&optional n event) | ||
| 1111 | "One-week-at-a-glance Filofax style calendar for week indicated by cursor. | ||
| 1112 | Optional prefix argument N specifies number of weeks (default 1), | ||
| 1113 | starting on Mondays. The calendar shows holiday and diary entries | ||
| 1114 | if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. | ||
| 1115 | Optional EVENT indicates a buffer position to use instead of point." | ||
| 1116 | (interactive (list (prefix-numeric-value current-prefix-arg) | ||
| 1117 | last-nonmenu-event)) | ||
| 1118 | (or n (setq n 1)) | 1059 | (or n (setq n 1)) |
| 1119 | (let* ((date (calendar-gregorian-from-absolute | 1060 | (let* ((date (calendar-gregorian-from-absolute |
| 1120 | (calendar-dayname-on-or-before | 1061 | (calendar-dayname-on-or-before |
| @@ -1129,49 +1070,33 @@ Optional EVENT indicates a buffer position to use instead of point." | |||
| 1129 | (holidays (if cal-tex-holidays | 1070 | (holidays (if cal-tex-holidays |
| 1130 | (holiday-in-range d1 d2))) | 1071 | (holiday-in-range d1 d2))) |
| 1131 | (diary-list (if cal-tex-diary | 1072 | (diary-list (if cal-tex-diary |
| 1132 | (cal-tex-list-diary-entries | 1073 | (cal-tex-list-diary-entries d1 d2)))) |
| 1133 | ;; FIXME d1? | 1074 | (if filofax |
| 1134 | (calendar-absolute-from-gregorian (list month 1 year)) | 1075 | (progn |
| 1135 | d2)))) | 1076 | (cal-tex-preamble "twoside") |
| 1136 | (cal-tex-preamble "twoside") | 1077 | (cal-tex-filofax-paper) |
| 1137 | (cal-tex-cmd "\\textwidth 3.25in") | 1078 | (insert cal-tex-righthead) |
| 1138 | (cal-tex-cmd "\\textheight 6.5in") | 1079 | (cal-tex-longday "rightday" "1.85in") |
| 1139 | (cal-tex-cmd "\\oddsidemargin 1.75in") | 1080 | (cal-tex-longday "weekend" "0.8in") |
| 1140 | (cal-tex-cmd "\\evensidemargin 1.5in") | 1081 | (insert cal-tex-lefthead) |
| 1141 | (cal-tex-cmd "\\topmargin 0pt") | 1082 | (cal-tex-longday "leftday" "1.85in")) |
| 1142 | (cal-tex-cmd "\\headheight -0.875in") | 1083 | (cal-tex-preamble "twoside,12pt") |
| 1143 | (cal-tex-cmd "\\headsep 0.125in") | 1084 | (insert "\\textwidth 7in |
| 1144 | (cal-tex-cmd "\\footskip .125in") | 1085 | \\textheight 10.5in |
| 1145 | (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} | 1086 | \\oddsidemargin 0in |
| 1146 | \\long\\def\\rightday#1#2#3#4#5{% | 1087 | \\evensidemargin 0in |
| 1147 | \\rule{\\textwidth}{0.3pt}\\\\% | 1088 | \\topmargin 0pt |
| 1148 | \\hbox to \\textwidth{% | 1089 | \\headheight -0.875in |
| 1149 | \\vbox to 1.85in{% | 1090 | \\headsep 0.125in |
| 1150 | \\vspace*{2pt}% | 1091 | \\footskip .125in |
| 1151 | \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% | ||
| 1152 | \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% | ||
| 1153 | \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} | ||
| 1154 | \\long\\def\\weekend#1#2#3#4#5{% | ||
| 1155 | \\rule{\\textwidth}{0.3pt}\\\\% | ||
| 1156 | \\hbox to \\textwidth{% | ||
| 1157 | \\vbox to .8in{% | ||
| 1158 | \\vspace*{2pt}% | ||
| 1159 | \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% | ||
| 1160 | \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% | ||
| 1161 | \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} | ||
| 1162 | \\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} | ||
| 1163 | \\long\\def\\leftday#1#2#3#4#5{% | ||
| 1164 | \\rule{\\textwidth}{0.3pt}\\\\% | ||
| 1165 | \\hbox to \\textwidth{% | ||
| 1166 | \\vbox to 1.85in{% | ||
| 1167 | \\vspace*{2pt}% | ||
| 1168 | \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% | ||
| 1169 | \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% | ||
| 1170 | \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} | ||
| 1171 | ") | 1092 | ") |
| 1093 | (insert cal-tex-righthead) | ||
| 1094 | (cal-tex-longday "rightday" "2.75in") | ||
| 1095 | (cal-tex-longday "weekend" "1.8in") | ||
| 1096 | (insert cal-tex-lefthead) | ||
| 1097 | (cal-tex-longday "leftday" "2.75in")) | ||
| 1172 | (cal-tex-b-document) | 1098 | (cal-tex-b-document) |
| 1173 | (cal-tex-cmd "\\pagestyle{empty}\\ ") | 1099 | (cal-tex-cmd "\\pagestyle" "empty") |
| 1174 | (cal-tex-newpage) | ||
| 1175 | (dotimes (i n) | 1100 | (dotimes (i n) |
| 1176 | (insert "\\lefthead") | 1101 | (insert "\\lefthead") |
| 1177 | (cal-tex-arg | 1102 | (cal-tex-arg |
| @@ -1203,12 +1128,35 @@ Optional EVENT indicates a buffer position to use instead of point." | |||
| 1203 | (insert "%\n") | 1128 | (insert "%\n") |
| 1204 | (setq date (cal-tex-incr-date date))) | 1129 | (setq date (cal-tex-incr-date date))) |
| 1205 | (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n") | 1130 | (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n") |
| 1131 | (unless filofax | ||
| 1132 | (cal-tex-nl) | ||
| 1133 | (insert (cal-tex-mini-calendar | ||
| 1134 | (calendar-extract-month (cal-tex-previous-month date)) | ||
| 1135 | (calendar-extract-year (cal-tex-previous-month date)) | ||
| 1136 | "lastmonth" "1.1in" "1in")) | ||
| 1137 | (insert (cal-tex-mini-calendar | ||
| 1138 | (calendar-extract-month date) | ||
| 1139 | (calendar-extract-year date) | ||
| 1140 | "thismonth" "1.1in" "1in")) | ||
| 1141 | (insert (cal-tex-mini-calendar | ||
| 1142 | (calendar-extract-month (cal-tex-next-month date)) | ||
| 1143 | (calendar-extract-year (cal-tex-next-month date)) | ||
| 1144 | "nextmonth" "1.1in" "1in")) | ||
| 1145 | (insert "\\hbox to \\textwidth{") | ||
| 1146 | (cal-tex-hfill) | ||
| 1147 | (insert "\\lastmonth") | ||
| 1148 | (cal-tex-hfill) | ||
| 1149 | (insert "\\thismonth") | ||
| 1150 | (cal-tex-hfill) | ||
| 1151 | (insert "\\nextmonth") | ||
| 1152 | (cal-tex-hfill) | ||
| 1153 | (insert "}")) | ||
| 1206 | (cal-tex-newpage) | 1154 | (cal-tex-newpage) |
| 1207 | (insert "\\righthead") | 1155 | (insert "\\righthead") |
| 1208 | (cal-tex-arg | 1156 | (cal-tex-arg |
| 1209 | (let ((d (cal-tex-incr-date date 3))) | 1157 | (let ((d (cal-tex-incr-date date 3))) |
| 1210 | (if (= (calendar-extract-month date) | 1158 | (if (= (calendar-extract-month date) |
| 1211 | (calendar-extract-month d)) | 1159 | (calendar-extract-month d)) |
| 1212 | (format "%s %s" | 1160 | (format "%s %s" |
| 1213 | (cal-tex-month-name (calendar-extract-month date)) | 1161 | (cal-tex-month-name (calendar-extract-month date)) |
| 1214 | (calendar-extract-year date)) | 1162 | (calendar-extract-year date)) |
| @@ -1249,6 +1197,101 @@ Optional EVENT indicates a buffer position to use instead of point." | |||
| 1249 | (run-hooks 'cal-tex-hook))) | 1197 | (run-hooks 'cal-tex-hook))) |
| 1250 | 1198 | ||
| 1251 | ;;;###cal-autoload | 1199 | ;;;###cal-autoload |
| 1200 | (defun cal-tex-cursor-week-at-a-glance (&optional n event) | ||
| 1201 | "One-week-at-a-glance full page calendar for week indicated by cursor. | ||
| 1202 | Optional prefix argument N specifies number of weeks (default 1), | ||
| 1203 | starting on Mondays. The calendar shows holiday and diary entries | ||
| 1204 | if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. | ||
| 1205 | It does not show hours of the day. Optional EVENT indicates a buffer | ||
| 1206 | position to use instead of point." | ||
| 1207 | (interactive (list (prefix-numeric-value current-prefix-arg) | ||
| 1208 | last-nonmenu-event)) | ||
| 1209 | (cal-tex-weekly-common n event)) | ||
| 1210 | |||
| 1211 | ;;;###cal-autoload | ||
| 1212 | (defun cal-tex-cursor-filofax-2week (&optional n event) | ||
| 1213 | "Two-weeks-at-a-glance Filofax style calendar for week cursor is in. | ||
| 1214 | Optional prefix argument N specifies number of weeks (default 1). | ||
| 1215 | The calendar shows holiday and diary entries if | ||
| 1216 | `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. | ||
| 1217 | Optional EVENT indicates a buffer position to use instead of point." | ||
| 1218 | (interactive (list (prefix-numeric-value current-prefix-arg) | ||
| 1219 | last-nonmenu-event)) | ||
| 1220 | (or n (setq n 1)) | ||
| 1221 | (let* ((date (calendar-gregorian-from-absolute | ||
| 1222 | (calendar-dayname-on-or-before | ||
| 1223 | calendar-week-start-day | ||
| 1224 | (calendar-absolute-from-gregorian | ||
| 1225 | (calendar-cursor-to-date t event))))) | ||
| 1226 | (month (calendar-extract-month date)) | ||
| 1227 | (year (calendar-extract-year date)) | ||
| 1228 | (day (calendar-extract-day date)) | ||
| 1229 | (d1 (calendar-absolute-from-gregorian date)) | ||
| 1230 | (d2 (+ (* 7 n) d1)) | ||
| 1231 | (holidays (if cal-tex-holidays | ||
| 1232 | (holiday-in-range d1 d2))) | ||
| 1233 | (diary-list (if cal-tex-diary | ||
| 1234 | (cal-tex-list-diary-entries d1 d2)))) | ||
| 1235 | (cal-tex-preamble "twoside") | ||
| 1236 | (cal-tex-filofax-paper) | ||
| 1237 | (insert cal-tex-righthead) | ||
| 1238 | (cal-tex-longday "rightday" "0.7in") | ||
| 1239 | (insert cal-tex-lefthead) | ||
| 1240 | (cal-tex-longday "leftday" "0.7in") | ||
| 1241 | (cal-tex-b-document) | ||
| 1242 | (cal-tex-cmd "\\pagestyle" "empty") | ||
| 1243 | (dotimes (i n) | ||
| 1244 | (if (zerop (mod i 2)) | ||
| 1245 | (insert "\\righthead") | ||
| 1246 | (insert "\\lefthead")) | ||
| 1247 | (cal-tex-arg | ||
| 1248 | (let ((d (cal-tex-incr-date date 6))) | ||
| 1249 | (if (= (calendar-extract-month date) | ||
| 1250 | (calendar-extract-month d)) | ||
| 1251 | (format "%s %s" | ||
| 1252 | (cal-tex-month-name (calendar-extract-month date)) | ||
| 1253 | (calendar-extract-year date)) | ||
| 1254 | (if (= (calendar-extract-year date) | ||
| 1255 | (calendar-extract-year d)) | ||
| 1256 | (format "%s---%s %s" | ||
| 1257 | (cal-tex-month-name (calendar-extract-month date)) | ||
| 1258 | (cal-tex-month-name (calendar-extract-month d)) | ||
| 1259 | (calendar-extract-year date)) | ||
| 1260 | (format "%s %s---%s %s" | ||
| 1261 | (cal-tex-month-name (calendar-extract-month date)) | ||
| 1262 | (calendar-extract-year date) | ||
| 1263 | (cal-tex-month-name (calendar-extract-month d)) | ||
| 1264 | (calendar-extract-year d)))))) | ||
| 1265 | (insert "%\n") | ||
| 1266 | (dotimes (_jdummy 7) | ||
| 1267 | (if (zerop (mod i 2)) | ||
| 1268 | (insert "\\rightday") | ||
| 1269 | (insert "\\leftday")) | ||
| 1270 | (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) | ||
| 1271 | (cal-tex-arg (number-to-string (calendar-extract-day date))) | ||
| 1272 | (cal-tex-arg (cal-tex-latexify-list diary-list date)) | ||
| 1273 | (cal-tex-arg (cal-tex-latexify-list holidays date)) | ||
| 1274 | (cal-tex-arg (eval cal-tex-daily-string)) | ||
| 1275 | (insert "%\n") | ||
| 1276 | (setq date (cal-tex-incr-date date))) | ||
| 1277 | (unless (= i (1- n)) | ||
| 1278 | (run-hooks 'cal-tex-week-hook) | ||
| 1279 | (cal-tex-newpage))) | ||
| 1280 | (cal-tex-end-document) | ||
| 1281 | (run-hooks 'cal-tex-hook))) | ||
| 1282 | |||
| 1283 | ;;;###cal-autoload | ||
| 1284 | (defun cal-tex-cursor-filofax-week (&optional n event) | ||
| 1285 | "One-week-at-a-glance Filofax style calendar for week indicated by cursor. | ||
| 1286 | Optional prefix argument N specifies number of weeks (default 1), | ||
| 1287 | starting on Mondays. The calendar shows holiday and diary entries | ||
| 1288 | if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. | ||
| 1289 | Optional EVENT indicates a buffer position to use instead of point." | ||
| 1290 | (interactive (list (prefix-numeric-value current-prefix-arg) | ||
| 1291 | last-nonmenu-event)) | ||
| 1292 | (cal-tex-weekly-common n event t)) | ||
| 1293 | |||
| 1294 | ;;;###cal-autoload | ||
| 1252 | (defun cal-tex-cursor-filofax-daily (&optional n event) | 1295 | (defun cal-tex-cursor-filofax-daily (&optional n event) |
| 1253 | "Day-per-page Filofax style calendar for week indicated by cursor. | 1296 | "Day-per-page Filofax style calendar for week indicated by cursor. |
| 1254 | Optional prefix argument N specifies number of weeks (default 1), | 1297 | Optional prefix argument N specifies number of weeks (default 1), |
| @@ -1272,52 +1315,21 @@ Optional EVENT indicates a buffer position to use instead of point." | |||
| 1272 | (holidays (if cal-tex-holidays | 1315 | (holidays (if cal-tex-holidays |
| 1273 | (holiday-in-range d1 d2))) | 1316 | (holiday-in-range d1 d2))) |
| 1274 | (diary-list (if cal-tex-diary | 1317 | (diary-list (if cal-tex-diary |
| 1275 | (cal-tex-list-diary-entries | 1318 | (cal-tex-list-diary-entries d1 d2)))) |
| 1276 | ;; FIXME d1? | ||
| 1277 | (calendar-absolute-from-gregorian (list month 1 year)) | ||
| 1278 | d2)))) | ||
| 1279 | (cal-tex-preamble "twoside") | 1319 | (cal-tex-preamble "twoside") |
| 1280 | (cal-tex-cmd "\\textwidth 3.25in") | 1320 | (cal-tex-filofax-paper) |
| 1281 | (cal-tex-cmd "\\textheight 6.5in") | 1321 | (insert cal-tex-righthead) |
| 1282 | (cal-tex-cmd "\\oddsidemargin 1.75in") | 1322 | (cal-tex-shortday "rightday") |
| 1283 | (cal-tex-cmd "\\evensidemargin 1.5in") | 1323 | (cal-tex-shortday "weekend") |
| 1284 | (cal-tex-cmd "\\topmargin 0pt") | 1324 | (insert cal-tex-lefthead) |
| 1285 | (cal-tex-cmd "\\headheight -0.875in") | 1325 | (cal-tex-shortday "leftday") |
| 1286 | (cal-tex-cmd "\\headsep 0.125in") | 1326 | (insert "\\newbox\\LineBox |
| 1287 | (cal-tex-cmd "\\footskip .125in") | ||
| 1288 | (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} | ||
| 1289 | \\long\\def\\rightday#1#2#3{% | ||
| 1290 | \\rule{\\textwidth}{0.3pt}\\\\% | ||
| 1291 | \\hbox to \\textwidth{% | ||
| 1292 | \\vbox {% | ||
| 1293 | \\vspace*{2pt}% | ||
| 1294 | \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% | ||
| 1295 | \\hbox to \\textwidth{\\vbox {\\raggedleft \\em #2}}% | ||
| 1296 | \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} | ||
| 1297 | \\long\\def\\weekend#1#2#3{% | ||
| 1298 | \\rule{\\textwidth}{0.3pt}\\\\% | ||
| 1299 | \\hbox to \\textwidth{% | ||
| 1300 | \\vbox {% | ||
| 1301 | \\vspace*{2pt}% | ||
| 1302 | \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% | ||
| 1303 | \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% | ||
| 1304 | \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} | ||
| 1305 | \\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} | ||
| 1306 | \\long\\def\\leftday#1#2#3{% | ||
| 1307 | \\rule{\\textwidth}{0.3pt}\\\\% | ||
| 1308 | \\hbox to \\textwidth{% | ||
| 1309 | \\vbox {% | ||
| 1310 | \\vspace*{2pt}% | ||
| 1311 | \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% | ||
| 1312 | \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% | ||
| 1313 | \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} | ||
| 1314 | \\newbox\\LineBox | ||
| 1315 | \\setbox\\LineBox=\\hbox to\\textwidth{% | 1327 | \\setbox\\LineBox=\\hbox to\\textwidth{% |
| 1316 | \\vrule height.2in width0pt\\leaders\\hrule\\hfill} | 1328 | \\vrule height.2in width0pt\\leaders\\hrule\\hfill} |
| 1317 | \\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill} | 1329 | \\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill} |
| 1318 | ") | 1330 | ") |
| 1319 | (cal-tex-b-document) | 1331 | (cal-tex-b-document) |
| 1320 | (cal-tex-cmd "\\pagestyle{empty}") | 1332 | (cal-tex-cmd "\\pagestyle" "empty") |
| 1321 | (dotimes (i n) | 1333 | (dotimes (i n) |
| 1322 | (dotimes (j 4) | 1334 | (dotimes (j 4) |
| 1323 | (let ((even (zerop (% j 2)))) | 1335 | (let ((even (zerop (% j 2)))) |
| @@ -1377,10 +1389,9 @@ a buffer position to use instead of point." | |||
| 1377 | (let ((date (calendar-absolute-from-gregorian | 1389 | (let ((date (calendar-absolute-from-gregorian |
| 1378 | (calendar-cursor-to-date t event)))) | 1390 | (calendar-cursor-to-date t event)))) |
| 1379 | (cal-tex-preamble "12pt") | 1391 | (cal-tex-preamble "12pt") |
| 1380 | (cal-tex-cmd "\\textwidth 6.5in") | 1392 | (cal-tex-weekly-paper 'nomargins) |
| 1381 | (cal-tex-cmd "\\textheight 10.5in") | ||
| 1382 | (cal-tex-b-document) | 1393 | (cal-tex-b-document) |
| 1383 | (cal-tex-cmd "\\pagestyle{empty}") | 1394 | (cal-tex-cmd "\\pagestyle" "empty") |
| 1384 | (dotimes (i n) | 1395 | (dotimes (i n) |
| 1385 | (cal-tex-vspace "-1.7in") | 1396 | (cal-tex-vspace "-1.7in") |
| 1386 | (cal-tex-daily-page (calendar-gregorian-from-absolute date)) | 1397 | (cal-tex-daily-page (calendar-gregorian-from-absolute date)) |
| @@ -1574,7 +1585,7 @@ informative header, and run HOOK." | |||
| 1574 | ;; FIXME latin1 might not always be right. | 1585 | ;; FIXME latin1 might not always be right. |
| 1575 | (insert "\\usepackage[latin1]{inputenc}\n")))) | 1586 | (insert "\\usepackage[latin1]{inputenc}\n")))) |
| 1576 | (latex-mode) | 1587 | (latex-mode) |
| 1577 | (pop-to-buffer cal-tex-buffer) | 1588 | (pop-to-buffer (current-buffer)) |
| 1578 | (goto-char (point-min)) | 1589 | (goto-char (point-min)) |
| 1579 | ;; FIXME auctex equivalents? | 1590 | ;; FIXME auctex equivalents? |
| 1580 | (cal-tex-comment | 1591 | (cal-tex-comment |
| @@ -1599,16 +1610,16 @@ non-nil, means add to end of buffer without erasing current contents." | |||
| 1599 | (if (not landscape) | 1610 | (if (not landscape) |
| 1600 | (progn | 1611 | (progn |
| 1601 | (cal-tex-cmd "\\oddsidemargin -1.75cm") | 1612 | (cal-tex-cmd "\\oddsidemargin -1.75cm") |
| 1602 | (cal-tex-cmd "\\def\\holidaymult{.06}")) | 1613 | (cal-tex-cmd "\\def\\holidaymult" ".06")) |
| 1603 | (cal-tex-cmd "\\special{landscape}") | 1614 | (cal-tex-cmd "\\special" "landscape") |
| 1604 | (cal-tex-cmd "\\textwidth 9.5in") | 1615 | (cal-tex-cmd "\\textwidth 9.5in") |
| 1605 | (cal-tex-cmd "\\textheight 7in") | 1616 | (cal-tex-cmd "\\textheight 7in") |
| 1606 | (cal-tex-comment) | 1617 | (cal-tex-comment) |
| 1607 | (cal-tex-cmd "\\def\\holidaymult{.08}")) | 1618 | (cal-tex-cmd "\\def\\holidaymult" ".08")) |
| 1608 | (cal-tex-cmd cal-tex-caldate) | 1619 | (cal-tex-cmd cal-tex-caldate) |
| 1609 | (cal-tex-cmd cal-tex-myday) | 1620 | (cal-tex-cmd cal-tex-myday) |
| 1610 | (cal-tex-b-document) | 1621 | (cal-tex-b-document) |
| 1611 | (cal-tex-cmd "\\pagestyle{empty}")) | 1622 | (cal-tex-cmd "\\pagestyle" "empty")) |
| 1612 | (cal-tex-cmd "\\setlength{\\cellwidth}" width) | 1623 | (cal-tex-cmd "\\setlength{\\cellwidth}" width) |
| 1613 | (insert (format "\\setlength{\\cellwidth}{%f\\cellwidth}\n" | 1624 | (insert (format "\\setlength{\\cellwidth}{%f\\cellwidth}\n" |
| 1614 | (/ 1.1 (length cal-tex-which-days)))) | 1625 | (/ 1.1 (length cal-tex-which-days)))) |
| @@ -1671,13 +1682,11 @@ non-nil, means add to end of buffer without erasing current contents." | |||
| 1671 | 1682 | ||
| 1672 | (defun cal-tex-vspace (space) | 1683 | (defun cal-tex-vspace (space) |
| 1673 | "Insert vspace command to move SPACE vertically." | 1684 | "Insert vspace command to move SPACE vertically." |
| 1674 | (insert "\\vspace*{" space "}") | 1685 | (cal-tex-cmd "\\vspace*" space)) |
| 1675 | (cal-tex-comment)) | ||
| 1676 | 1686 | ||
| 1677 | (defun cal-tex-hspace (space) | 1687 | (defun cal-tex-hspace (space) |
| 1678 | "Insert hspace command to move SPACE horizontally." | 1688 | "Insert hspace command to move SPACE horizontally." |
| 1679 | (insert "\\hspace*{" space "}") | 1689 | (cal-tex-cmd "\\hspace*" space)) |
| 1680 | (cal-tex-comment)) | ||
| 1681 | 1690 | ||
| 1682 | (defun cal-tex-comment (&optional comment) | 1691 | (defun cal-tex-comment (&optional comment) |
| 1683 | "Insert `% ', followed by optional string COMMENT, followed by newline. | 1692 | "Insert `% ', followed by optional string COMMENT, followed by newline. |
| @@ -1716,20 +1725,20 @@ Add trailing COMMENT if present." | |||
| 1716 | 1725 | ||
| 1717 | (defun cal-tex-b-document () | 1726 | (defun cal-tex-b-document () |
| 1718 | "Insert beginning of document." | 1727 | "Insert beginning of document." |
| 1719 | (cal-tex-cmd "\\begin{document}")) | 1728 | (cal-tex-cmd "\\begin" "document")) |
| 1720 | 1729 | ||
| 1721 | (defun cal-tex-e-document () | 1730 | (defun cal-tex-e-document () |
| 1722 | "Insert end of document." | 1731 | "Insert end of document." |
| 1723 | (cal-tex-cmd "\\end{document}")) | 1732 | (cal-tex-cmd "\\end" "document")) |
| 1724 | 1733 | ||
| 1725 | (defun cal-tex-b-center () | 1734 | (defun cal-tex-b-center () |
| 1726 | "Insert beginning of centered block." | 1735 | "Insert beginning of centered block." |
| 1727 | (cal-tex-cmd "\\begin{center}")) | 1736 | (cal-tex-cmd "\\begin" "center")) |
| 1728 | 1737 | ||
| 1729 | (defun cal-tex-e-center () | 1738 | (defun cal-tex-e-center () |
| 1730 | "Insert end of centered block." | 1739 | "Insert end of centered block." |
| 1731 | (cal-tex-comment) | 1740 | (cal-tex-comment) |
| 1732 | (cal-tex-cmd "\\end{center}")) | 1741 | (cal-tex-cmd "\\end" "center")) |
| 1733 | 1742 | ||
| 1734 | 1743 | ||
| 1735 | ;;; | 1744 | ;;; |
| @@ -1784,35 +1793,35 @@ Add trailing COMMENT if present." | |||
| 1784 | 1793 | ||
| 1785 | (defun cal-tex-em (string) | 1794 | (defun cal-tex-em (string) |
| 1786 | "Insert STRING in italic font." | 1795 | "Insert STRING in italic font." |
| 1787 | (insert "\\textit{" string "}")) | 1796 | (cal-tex-cmd "\\textit" string)) |
| 1788 | 1797 | ||
| 1789 | (defun cal-tex-bf (string) | 1798 | (defun cal-tex-bf (string) |
| 1790 | "Insert STRING in bf font." | 1799 | "Insert STRING in bf font." |
| 1791 | (insert "\\textbf{ " string "}")) | 1800 | (cal-tex-cmd "\\textbf" string)) |
| 1792 | 1801 | ||
| 1793 | (defun cal-tex-scriptsize (string) | 1802 | (defun cal-tex-scriptsize (string) |
| 1794 | "Insert STRING in scriptsize font." | 1803 | "Insert STRING in scriptsize font." |
| 1795 | (insert "{\\scriptsize " string "}")) | 1804 | (cal-tex-arg (concat "\\scriptsize " string))) |
| 1796 | 1805 | ||
| 1797 | (defun cal-tex-huge (string) | 1806 | (defun cal-tex-huge (string) |
| 1798 | "Insert STRING in huge font." | 1807 | "Insert STRING in huge font." |
| 1799 | (insert "{\\huge " string "}")) | 1808 | (cal-tex-arg (concat "\\huge " string))) |
| 1800 | 1809 | ||
| 1801 | (defun cal-tex-Huge (string) | 1810 | (defun cal-tex-Huge (string) |
| 1802 | "Insert STRING in Huge font." | 1811 | "Insert STRING in Huge font." |
| 1803 | (insert "{\\Huge " string "}")) | 1812 | (cal-tex-arg (concat "\\Huge " string))) |
| 1804 | 1813 | ||
| 1805 | (defun cal-tex-Huge-bf (string) | 1814 | (defun cal-tex-Huge-bf (string) |
| 1806 | "Insert STRING in Huge bf font." | 1815 | "Insert STRING in Huge bf font." |
| 1807 | (insert "\\textbf{\\Huge " string "}")) | 1816 | (cal-tex-cmd "\\textbf" (concat "\\Huge " string))) |
| 1808 | 1817 | ||
| 1809 | (defun cal-tex-large (string) | 1818 | (defun cal-tex-large (string) |
| 1810 | "Insert STRING in large font." | 1819 | "Insert STRING in large font." |
| 1811 | (insert "{\\large " string "}")) | 1820 | (cal-tex-arg (concat "\\large " string))) |
| 1812 | 1821 | ||
| 1813 | (defun cal-tex-large-bf (string) | 1822 | (defun cal-tex-large-bf (string) |
| 1814 | "Insert STRING in large bf font." | 1823 | "Insert STRING in large bf font." |
| 1815 | (insert "\\textbf{\\large " string "}")) | 1824 | (cal-tex-cmd "\\textbf" (concat "\\large " string))) |
| 1816 | 1825 | ||
| 1817 | 1826 | ||
| 1818 | (provide 'cal-tex) | 1827 | (provide 'cal-tex) |
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 2e073fd1267..8fa5b0ddb07 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -951,12 +951,12 @@ This is recursive; that is, included files may include other files." | |||
| 951 | (setq diary-entries-list | 951 | (setq diary-entries-list |
| 952 | (append diary-entries-list | 952 | (append diary-entries-list |
| 953 | (diary-list-entries original-date number t))))) | 953 | (diary-list-entries original-date number t))))) |
| 954 | (beep) | 954 | (display-warning |
| 955 | (message "Can't read included diary file %s" diary-file) | 955 | :error |
| 956 | (sleep-for 2)) | 956 | (format "Can't read included diary file %s\n" diary-file))) |
| 957 | (beep) | 957 | (display-warning |
| 958 | (message "Can't find included diary file %s" diary-file) | 958 | :error |
| 959 | (sleep-for 2)))) | 959 | (format "Can't find included diary file %s\n" diary-file))))) |
| 960 | (goto-char (point-min))) | 960 | (goto-char (point-min))) |
| 961 | 961 | ||
| 962 | (defun diary-include-other-diary-files () | 962 | (defun diary-include-other-diary-files () |
| @@ -1456,14 +1456,17 @@ marks. This is intended to deal with deleted diary entries." | |||
| 1456 | (let ((result (if calendar-debug-sexp | 1456 | (let ((result (if calendar-debug-sexp |
| 1457 | (let ((debug-on-error t)) | 1457 | (let ((debug-on-error t)) |
| 1458 | (eval (car (read-from-string sexp)))) | 1458 | (eval (car (read-from-string sexp)))) |
| 1459 | (condition-case nil | 1459 | (let (err) |
| 1460 | (eval (car (read-from-string sexp))) | 1460 | (condition-case err |
| 1461 | (error | 1461 | (eval (car (read-from-string sexp))) |
| 1462 | (beep) | 1462 | (error |
| 1463 | (message "Bad sexp at line %d in %s: %s" | 1463 | (display-warning |
| 1464 | (count-lines (point-min) (point)) | 1464 | :error |
| 1465 | diary-file sexp) | 1465 | (format "Bad diary sexp at line %d in %s:\n%s\n\ |
| 1466 | (sleep-for 2)))))) | 1466 | Error: %s\n" |
| 1467 | (count-lines (point-min) (point)) | ||
| 1468 | diary-file sexp err)) | ||
| 1469 | nil)))))) | ||
| 1467 | (cond ((stringp result) result) | 1470 | (cond ((stringp result) result) |
| 1468 | ((and (consp result) | 1471 | ((and (consp result) |
| 1469 | (stringp (cdr result))) result) | 1472 | (stringp (cdr result))) result) |
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 0bb3c231840..043d402f612 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el | |||
| @@ -458,17 +458,20 @@ with descriptive strings such as | |||
| 458 | (defun calendar-holiday-list () | 458 | (defun calendar-holiday-list () |
| 459 | "Form the list of holidays that occur on dates in the calendar window. | 459 | "Form the list of holidays that occur on dates in the calendar window. |
| 460 | The holidays are those in the list `calendar-holidays'." | 460 | The holidays are those in the list `calendar-holidays'." |
| 461 | (let (res h) | 461 | (let (res h err) |
| 462 | (sort | 462 | (sort |
| 463 | (dolist (p calendar-holidays res) | 463 | (dolist (p calendar-holidays res) |
| 464 | (if (setq h (if calendar-debug-sexp | 464 | (if (setq h (if calendar-debug-sexp |
| 465 | (let ((debug-on-error t)) | 465 | (let ((debug-on-error t)) |
| 466 | (eval p)) | 466 | (eval p)) |
| 467 | (condition-case nil | 467 | (condition-case err |
| 468 | (eval p) | 468 | (eval p) |
| 469 | (error (beep) | 469 | (error |
| 470 | (message "Bad holiday list item: %s" p) | 470 | (display-warning |
| 471 | (sleep-for 2))))) | 471 | :error |
| 472 | (format "Bad holiday list item: %s\nError: %s\n" | ||
| 473 | p err)) | ||
| 474 | nil)))) | ||
| 472 | (setq res (append h res)))) | 475 | (setq res (append h res)))) |
| 473 | 'calendar-date-compare))) | 476 | 'calendar-date-compare))) |
| 474 | 477 | ||
diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 3680a2648ce..06fd10149d3 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el | |||
| @@ -136,12 +136,36 @@ | |||
| 136 | :help-echo "Control text underlining." | 136 | :help-echo "Control text underlining." |
| 137 | (const :tag "Off" nil) | 137 | (const :tag "Off" nil) |
| 138 | (list :tag "On" | 138 | (list :tag "On" |
| 139 | :value (:color foreground-color :style line) | ||
| 139 | (const :format "" :value :color) | 140 | (const :format "" :value :color) |
| 140 | (choice :tag "Color" (const :tag "Foreground Color" foreground-color) color) | 141 | (choice :tag "Color" |
| 141 | (const :format "" :value :style) | 142 | (const :tag "Foreground Color" foreground-color) |
| 142 | (choice :tag "Style" | 143 | color) |
| 143 | (const :tag "Line" line) | 144 | (const :format "" :value :style) |
| 144 | (const :tag "Wave" wave))))) | 145 | (choice :tag "Style" |
| 146 | (const :tag "Line" line) | ||
| 147 | (const :tag "Wave" wave)))) | ||
| 148 | ;; filter to make value suitable for customize | ||
| 149 | (lambda (real-value) | ||
| 150 | (and real-value | ||
| 151 | (let ((color | ||
| 152 | (or (and (consp real-value) (plist-get real-value :color)) | ||
| 153 | (and (stringp real-value) real-value) | ||
| 154 | 'foreground-color)) | ||
| 155 | (style | ||
| 156 | (or (and (consp real-value) (plist-get real-value :style)) | ||
| 157 | 'line))) | ||
| 158 | (list :color color :style style)))) | ||
| 159 | ;; filter to make customized-value suitable for storing | ||
| 160 | (lambda (cus-value) | ||
| 161 | (and cus-value | ||
| 162 | (let ((color (plist-get cus-value :color)) | ||
| 163 | (style (plist-get cus-value :style))) | ||
| 164 | (cond ((eq style 'line) | ||
| 165 | ;; Use simple value for default style | ||
| 166 | (if (eq color 'foreground-color) t color)) | ||
| 167 | (t | ||
| 168 | `(:color ,color :style ,style))))))) | ||
| 145 | 169 | ||
| 146 | (:overline | 170 | (:overline |
| 147 | (choice :tag "Overline" | 171 | (choice :tag "Overline" |
diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 34d61b80d66..0c7f82d516e 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el | |||
| @@ -140,7 +140,7 @@ otherwise." | |||
| 140 | 140 | ||
| 141 | (defun describe-text-properties-1 (pos output-buffer) | 141 | (defun describe-text-properties-1 (pos output-buffer) |
| 142 | (let* ((properties (text-properties-at pos)) | 142 | (let* ((properties (text-properties-at pos)) |
| 143 | (overlays (overlays-at pos)) | 143 | (overlays (overlays-in pos (1+ pos))) |
| 144 | (wid-field (get-char-property pos 'field)) | 144 | (wid-field (get-char-property pos 'field)) |
| 145 | (wid-button (get-char-property pos 'button)) | 145 | (wid-button (get-char-property pos 'button)) |
| 146 | (wid-doc (get-char-property pos 'widget-doc)) | 146 | (wid-doc (get-char-property pos 'widget-doc)) |
diff --git a/lisp/dired.el b/lisp/dired.el index 6684be3356c..6182e133726 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -1331,16 +1331,16 @@ DIRED-FILENAME WINDOW-POINT)." | |||
| 1331 | "Mark all files remembered in ALIST. | 1331 | "Mark all files remembered in ALIST. |
| 1332 | Each element of ALIST looks like (FILE . MARKERCHAR)." | 1332 | Each element of ALIST looks like (FILE . MARKERCHAR)." |
| 1333 | (let (elt fil chr) | 1333 | (let (elt fil chr) |
| 1334 | (while alist | 1334 | (save-excursion |
| 1335 | (setq elt (car alist) | 1335 | (while alist |
| 1336 | alist (cdr alist) | 1336 | (setq elt (car alist) |
| 1337 | fil (car elt) | 1337 | alist (cdr alist) |
| 1338 | chr (cdr elt)) | 1338 | fil (car elt) |
| 1339 | (if (dired-goto-file fil) | 1339 | chr (cdr elt)) |
| 1340 | (save-excursion | 1340 | (when (dired-goto-file fil) |
| 1341 | (beginning-of-line) | 1341 | (beginning-of-line) |
| 1342 | (delete-char 1) | 1342 | (delete-char 1) |
| 1343 | (insert chr)))))) | 1343 | (insert chr)))))) |
| 1344 | 1344 | ||
| 1345 | (defun dired-remember-hidden () | 1345 | (defun dired-remember-hidden () |
| 1346 | "Return a list of names of subdirs currently hidden." | 1346 | "Return a list of names of subdirs currently hidden." |
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index b87cfd41f61..37e755e7655 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,29 @@ | |||
| 1 | 2012-08-21 Josh Feinstein <jlf@foxtail.org> | ||
| 2 | |||
| 3 | * erc-join.el (erc-autojoin-timing): Fix defcustom type. | ||
| 4 | |||
| 5 | 2012-08-21 Julien Danjou <julien@danjou.info> | ||
| 6 | |||
| 7 | * erc-match.el (erc-match-message): Use | ||
| 8 | `erc-match-exclude-server-buffer' not | ||
| 9 | `erc-track-exclude-server-buffer'. | ||
| 10 | |||
| 11 | 2012-08-20 Josh Feinstein <jlf@foxtail.org> | ||
| 12 | |||
| 13 | * erc.el (erc-display-message): Abstract message hiding decision | ||
| 14 | to new function erc-hide-current-message-p. | ||
| 15 | (erc-lurker): New customization group. | ||
| 16 | (erc-lurker-state, erc-lurker-trim-nicks, erc-lurker-ignore-chars) | ||
| 17 | (erc-lurker-hide-list, erc-lurker-cleanup-interval) | ||
| 18 | (erc-lurker-threshold-time): New variables. | ||
| 19 | (erc-lurker-maybe-trim, erc-lurker-initialize, erc-lurker-cleanup) | ||
| 20 | (erc-hide-current-message-p, erc-canonicalize-server-name) | ||
| 21 | (erc-lurker-update-status, erc-lurker-p): New functions. Together | ||
| 22 | they maintain state about which users have spoken in the last | ||
| 23 | erc-lurker-threshold-time, with all other users being considered | ||
| 24 | lurkers whose messages of types in erc-lurker-hide-list will not | ||
| 25 | be displayed by erc-display-message. | ||
| 26 | |||
| 1 | 2012-08-06 Julien Danjou <julien@danjou.info> | 27 | 2012-08-06 Julien Danjou <julien@danjou.info> |
| 2 | 28 | ||
| 3 | * erc-match.el (erc-match-exclude-server-buffer) | 29 | * erc-match.el (erc-match-exclude-server-buffer) |
diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index 85d1edf6427..ae7f90003a6 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el | |||
| @@ -84,8 +84,8 @@ identification, or after `erc-autojoin-delay' seconds. | |||
| 84 | Any other value means the same as `connect'." | 84 | Any other value means the same as `connect'." |
| 85 | :group 'erc-autojoin | 85 | :group 'erc-autojoin |
| 86 | :version "24.1" | 86 | :version "24.1" |
| 87 | :type '(choice (const :tag "On Connection" 'connect) | 87 | :type '(choice (const :tag "On Connection" connect) |
| 88 | (const :tag "When Identified" 'ident))) | 88 | (const :tag "When Identified" ident))) |
| 89 | 89 | ||
| 90 | (defcustom erc-autojoin-delay 30 | 90 | (defcustom erc-autojoin-delay 30 |
| 91 | "Number of seconds to wait before attempting to autojoin channels. | 91 | "Number of seconds to wait before attempting to autojoin channels. |
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index 8daf9be2b14..cac042c0298 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el | |||
| @@ -458,7 +458,7 @@ Use this defun with `erc-insert-modify-hook'." | |||
| 458 | (point-min)) | 458 | (point-min)) |
| 459 | (point-max)))) | 459 | (point-max)))) |
| 460 | (when (and vector | 460 | (when (and vector |
| 461 | (not (and erc-track-exclude-server-buffer | 461 | (not (and erc-match-exclude-server-buffer |
| 462 | (erc-server-buffer-p)))) | 462 | (erc-server-buffer-p)))) |
| 463 | (mapc | 463 | (mapc |
| 464 | (lambda (match-type) | 464 | (lambda (match-type) |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 0fc308621b1..feef75940f3 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -100,6 +100,10 @@ | |||
| 100 | "Ignoring certain messages" | 100 | "Ignoring certain messages" |
| 101 | :group 'erc) | 101 | :group 'erc) |
| 102 | 102 | ||
| 103 | (defgroup erc-lurker nil | ||
| 104 | "Hide specified message types sent by lurkers" | ||
| 105 | :group 'erc-ignore) | ||
| 106 | |||
| 103 | (defgroup erc-query nil | 107 | (defgroup erc-query nil |
| 104 | "Using separate buffers for private discussions" | 108 | "Using separate buffers for private discussions" |
| 105 | :group 'erc) | 109 | :group 'erc) |
| @@ -2455,6 +2459,174 @@ See also `erc-make-notice'." | |||
| 2455 | string) | 2459 | string) |
| 2456 | string))) | 2460 | string))) |
| 2457 | 2461 | ||
| 2462 | (defvar erc-lurker-state nil | ||
| 2463 | "Track the time of the last PRIVMSG for each (server,nick) pair. | ||
| 2464 | |||
| 2465 | This is implemented as a hash of hashes, where the outer key is | ||
| 2466 | the canonicalized server name (as returned by | ||
| 2467 | `erc-canonicalize-server-name') and the outer value is a hash | ||
| 2468 | table mapping nicks (as returned by `erc-lurker-maybe-trim') to | ||
| 2469 | the times of their most recently received PRIVMSG on any channel | ||
| 2470 | on the given server.") | ||
| 2471 | |||
| 2472 | (defcustom erc-lurker-trim-nicks t | ||
| 2473 | "If t, trim trailing `erc-lurker-ignore-chars' from nicks. | ||
| 2474 | |||
| 2475 | This causes e.g. nick and nick` to be considered as the same | ||
| 2476 | individual for activity tracking and lurkiness detection | ||
| 2477 | purposes." | ||
| 2478 | :group 'erc-lurker | ||
| 2479 | :type 'boolean) | ||
| 2480 | |||
| 2481 | (defun erc-lurker-maybe-trim (nick) | ||
| 2482 | "Maybe trim trailing `erc-lurker-ignore-chars' from NICK. | ||
| 2483 | |||
| 2484 | Returns NICK unmodified unless `erc-lurker-trim-nicks' is | ||
| 2485 | non-nil." | ||
| 2486 | (if erc-lurker-trim-nicks | ||
| 2487 | (replace-regexp-in-string | ||
| 2488 | (format "[%s]" | ||
| 2489 | (mapconcat (lambda (char) | ||
| 2490 | (regexp-quote (char-to-string char))) | ||
| 2491 | erc-lurker-ignore-chars "")) | ||
| 2492 | "" nick) | ||
| 2493 | nick)) | ||
| 2494 | |||
| 2495 | (defcustom erc-lurker-ignore-chars "`_" | ||
| 2496 | "Characters at the end of a nick to strip for activity tracking purposes. | ||
| 2497 | |||
| 2498 | See also `erc-lurker-trim-nicks'." | ||
| 2499 | :group 'erc-lurker | ||
| 2500 | :type 'string) | ||
| 2501 | |||
| 2502 | (defcustom erc-lurker-hide-list nil | ||
| 2503 | "List of IRC type messages to hide when sent by lurkers. | ||
| 2504 | |||
| 2505 | A typical value would be '(\"JOIN\" \"PART\" \"QUIT\"). | ||
| 2506 | See also `erc-lurker-p' and `erc-hide-list'." | ||
| 2507 | :group 'erc-lurker | ||
| 2508 | :type 'erc-message-type) | ||
| 2509 | |||
| 2510 | (defcustom erc-lurker-threshold-time (* 60 60 24) ; 24h by default | ||
| 2511 | "Nicks from which no PRIVMSGs have been received within this | ||
| 2512 | interval (in units of seconds) are considered lurkers by | ||
| 2513 | `erc-lurker-p' and as a result their messages of types in | ||
| 2514 | `erc-lurker-hide-list' will be hidden." | ||
| 2515 | :group 'erc-lurker | ||
| 2516 | :type 'integer) | ||
| 2517 | |||
| 2518 | (defun erc-lurker-initialize () | ||
| 2519 | "Initialize ERC lurker tracking functionality. | ||
| 2520 | |||
| 2521 | This function adds `erc-lurker-update-status' to | ||
| 2522 | `erc-insert-pre-hook' in order to record the time of each nick's | ||
| 2523 | most recent PRIVMSG as well as initializing the state variable | ||
| 2524 | storing this information." | ||
| 2525 | (setq erc-lurker-state (make-hash-table :test 'equal)) | ||
| 2526 | (add-hook 'erc-insert-pre-hook 'erc-lurker-update-status)) | ||
| 2527 | |||
| 2528 | (defun erc-lurker-cleanup () | ||
| 2529 | "Remove all last PRIVMSG state older than `erc-lurker-threshold-time'. | ||
| 2530 | |||
| 2531 | This should be called regularly to avoid excessive resource | ||
| 2532 | consumption for long-lived IRC or Emacs sessions." | ||
| 2533 | (maphash | ||
| 2534 | (lambda (server hash) | ||
| 2535 | (maphash | ||
| 2536 | (lambda (nick last-PRIVMSG-time) | ||
| 2537 | (when | ||
| 2538 | (> (time-to-seconds (time-subtract | ||
| 2539 | (current-time) | ||
| 2540 | last-PRIVMSG-time)) | ||
| 2541 | erc-lurker-threshold-time) | ||
| 2542 | (remhash nick hash))) | ||
| 2543 | hash) | ||
| 2544 | (if (zerop (hash-table-count hash)) | ||
| 2545 | (remhash server erc-lurker-state))) | ||
| 2546 | erc-lurker-state)) | ||
| 2547 | |||
| 2548 | (defvar erc-lurker-cleanup-count 0 | ||
| 2549 | "Internal counter variable for use with `erc-lurker-cleanup-interval'.") | ||
| 2550 | |||
| 2551 | (defvar erc-lurker-cleanup-interval 100 | ||
| 2552 | "Specifies frequency of cleaning up stale erc-lurker state. | ||
| 2553 | |||
| 2554 | `erc-lurker-update-status' calls `erc-lurker-cleanup' once for | ||
| 2555 | every `erc-lurker-cleanup-interval' updates to | ||
| 2556 | `erc-lurker-state'. This is designed to limit the memory | ||
| 2557 | consumption of lurker state during long Emacs sessions and/or ERC | ||
| 2558 | sessions with large numbers of incoming PRIVMSGs.") | ||
| 2559 | |||
| 2560 | (defun erc-lurker-update-status (message) | ||
| 2561 | "Update `erc-lurker-state' if necessary. | ||
| 2562 | |||
| 2563 | This function is called from `erc-insert-pre-hook'. If the | ||
| 2564 | current message is a PRIVMSG, update `erc-lurker-state' to | ||
| 2565 | reflect the fact that its sender has issued a PRIVMSG at the | ||
| 2566 | current time. Otherwise, take no action. | ||
| 2567 | |||
| 2568 | This function depends on the fact that `erc-display-message' | ||
| 2569 | dynamically binds `parsed', which is used to check if the current | ||
| 2570 | message is a PRIVMSG and to determine its sender. See also | ||
| 2571 | `erc-lurker-trim-nicks' and `erc-lurker-ignore-chars'. | ||
| 2572 | |||
| 2573 | In order to limit memory consumption, this function also calls | ||
| 2574 | `erc-lurker-cleanup' once every `erc-lurker-cleanup-interval' | ||
| 2575 | updates of `erc-lurker-state'." | ||
| 2576 | (when (and (boundp 'parsed) (erc-response-p parsed)) | ||
| 2577 | (let* ((command (erc-response.command parsed)) | ||
| 2578 | (sender | ||
| 2579 | (erc-lurker-maybe-trim | ||
| 2580 | (car (erc-parse-user (erc-response.sender parsed))))) | ||
| 2581 | (server | ||
| 2582 | (erc-canonicalize-server-name erc-server-announced-name))) | ||
| 2583 | (when (equal command "PRIVMSG") | ||
| 2584 | (when (>= (incf erc-lurker-cleanup-count) erc-lurker-cleanup-interval) | ||
| 2585 | (setq erc-lurker-cleanup-count 0) | ||
| 2586 | (erc-lurker-cleanup)) | ||
| 2587 | (unless (gethash server erc-lurker-state) | ||
| 2588 | (puthash server (make-hash-table :test 'equal) erc-lurker-state)) | ||
| 2589 | (puthash sender (current-time) | ||
| 2590 | (gethash server erc-lurker-state)))))) | ||
| 2591 | |||
| 2592 | (defun erc-lurker-p (nick) | ||
| 2593 | "Predicate indicating NICK's lurking status on the current server. | ||
| 2594 | |||
| 2595 | Lurking is the condition where NICK has issued no PRIVMSG on this | ||
| 2596 | server within `erc-lurker-threshold-time'. See also | ||
| 2597 | `erc-lurker-trim-nicks' and `erc-lurker-ignore-chars'." | ||
| 2598 | (unless erc-lurker-state (erc-lurker-initialize)) | ||
| 2599 | (let* ((server | ||
| 2600 | (erc-canonicalize-server-name erc-server-announced-name)) | ||
| 2601 | (last-PRIVMSG-time | ||
| 2602 | (gethash (erc-lurker-maybe-trim nick) | ||
| 2603 | (gethash server erc-lurker-state (make-hash-table))))) | ||
| 2604 | (or (null last-PRIVMSG-time) | ||
| 2605 | (> (time-to-seconds | ||
| 2606 | (time-subtract (current-time) last-PRIVMSG-time)) | ||
| 2607 | erc-lurker-threshold-time)))) | ||
| 2608 | |||
| 2609 | (defun erc-canonicalize-server-name (server) | ||
| 2610 | "Returns the canonical network name for SERVER if any, | ||
| 2611 | otherwise `erc-server-announced-name'. SERVER is matched against | ||
| 2612 | `erc-common-server-suffixes'." | ||
| 2613 | (when server | ||
| 2614 | (or (cdar (erc-remove-if-not | ||
| 2615 | (lambda (net) (string-match (car net) server)) | ||
| 2616 | erc-common-server-suffixes)) | ||
| 2617 | erc-server-announced-name))) | ||
| 2618 | |||
| 2619 | (defun erc-hide-current-message-p (parsed) | ||
| 2620 | "Predicate indicating whether the parsed ERC response PARSED should be hidden. | ||
| 2621 | |||
| 2622 | Messages are always hidden if the message type of PARSED appears in | ||
| 2623 | `erc-hide-list'. In addition, messages whose type is a member of | ||
| 2624 | `erc-lurker-hide-list' are hidden if `erc-lurker-p' returns true." | ||
| 2625 | (let* ((command (erc-response.command parsed)) | ||
| 2626 | (sender (car (erc-parse-user (erc-response.sender parsed))))) | ||
| 2627 | (or (member command erc-hide-list) | ||
| 2628 | (and (member command erc-lurker-hide-list) (erc-lurker-p sender))))) | ||
| 2629 | |||
| 2458 | (defun erc-display-message (parsed type buffer msg &rest args) | 2630 | (defun erc-display-message (parsed type buffer msg &rest args) |
| 2459 | "Display MSG in BUFFER. | 2631 | "Display MSG in BUFFER. |
| 2460 | 2632 | ||
| @@ -2479,7 +2651,7 @@ See also `erc-format-message' and `erc-display-line'." | |||
| 2479 | 2651 | ||
| 2480 | (if (not (erc-response-p parsed)) | 2652 | (if (not (erc-response-p parsed)) |
| 2481 | (erc-display-line string buffer) | 2653 | (erc-display-line string buffer) |
| 2482 | (unless (member (erc-response.command parsed) erc-hide-list) | 2654 | (unless (erc-hide-current-message-p parsed) |
| 2483 | (erc-put-text-property 0 (length string) 'erc-parsed parsed string) | 2655 | (erc-put-text-property 0 (length string) 'erc-parsed parsed string) |
| 2484 | (erc-put-text-property 0 (length string) 'rear-sticky t string) | 2656 | (erc-put-text-property 0 (length string) 'rear-sticky t string) |
| 2485 | (erc-display-line string buffer))))) | 2657 | (erc-display-line string buffer))))) |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index f3e313e9c35..77c21d26535 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -146,8 +146,8 @@ | |||
| 146 | ;; fontified automagically. In your ~/.emacs there could be: | 146 | ;; fontified automagically. In your ~/.emacs there could be: |
| 147 | ;; | 147 | ;; |
| 148 | ;; (defvar foo-font-lock-keywords | 148 | ;; (defvar foo-font-lock-keywords |
| 149 | ;; '(("\\<\\(one\\|two\\|three\\)\\>" . font-lock-keyword-face) | 149 | ;; '(("\\<\\(one\\|two\\|three\\)\\>" . 'font-lock-keyword-face) |
| 150 | ;; ("\\<\\(four\\|five\\|six\\)\\>" . font-lock-type-face)) | 150 | ;; ("\\<\\(four\\|five\\|six\\)\\>" . 'font-lock-type-face)) |
| 151 | ;; "Default expressions to highlight in Foo mode.") | 151 | ;; "Default expressions to highlight in Foo mode.") |
| 152 | ;; | 152 | ;; |
| 153 | ;; (add-hook 'foo-mode-hook | 153 | ;; (add-hook 'foo-mode-hook |
| @@ -167,8 +167,8 @@ | |||
| 167 | ;; could be: | 167 | ;; could be: |
| 168 | ;; | 168 | ;; |
| 169 | ;; (defvar bar-font-lock-keywords | 169 | ;; (defvar bar-font-lock-keywords |
| 170 | ;; '(("\\<\\(uno\\|due\\|tre\\)\\>" . font-lock-keyword-face) | 170 | ;; '(("\\<\\(uno\\|due\\|tre\\)\\>" . 'font-lock-keyword-face) |
| 171 | ;; ("\\<\\(quattro\\|cinque\\|sei\\)\\>" . font-lock-type-face)) | 171 | ;; ("\\<\\(quattro\\|cinque\\|sei\\)\\>" . 'font-lock-type-face)) |
| 172 | ;; "Default expressions to highlight in Bar mode.") | 172 | ;; "Default expressions to highlight in Bar mode.") |
| 173 | ;; | 173 | ;; |
| 174 | ;; and within `bar-mode' there could be: | 174 | ;; and within `bar-mode' there could be: |
| @@ -679,8 +679,8 @@ end of the current highlighting list. | |||
| 679 | For example: | 679 | For example: |
| 680 | 680 | ||
| 681 | (font-lock-add-keywords 'c-mode | 681 | (font-lock-add-keywords 'c-mode |
| 682 | '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 font-lock-warning-face prepend) | 682 | '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 'font-lock-warning-face prepend) |
| 683 | (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . font-lock-keyword-face))) | 683 | (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . 'font-lock-keyword-face))) |
| 684 | 684 | ||
| 685 | adds two fontification patterns for C mode, to fontify `FIXME:' words, even in | 685 | adds two fontification patterns for C mode, to fontify `FIXME:' words, even in |
| 686 | comments, and to fontify `and', `or' and `not' words as keywords. | 686 | comments, and to fontify `and', `or' and `not' words as keywords. |
| @@ -694,9 +694,9 @@ For example: | |||
| 694 | (add-hook 'c-mode-hook | 694 | (add-hook 'c-mode-hook |
| 695 | (lambda () | 695 | (lambda () |
| 696 | (font-lock-add-keywords nil | 696 | (font-lock-add-keywords nil |
| 697 | '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 font-lock-warning-face prepend) | 697 | '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 'font-lock-warning-face prepend) |
| 698 | (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . | 698 | (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . |
| 699 | font-lock-keyword-face))))) | 699 | 'font-lock-keyword-face))))) |
| 700 | 700 | ||
| 701 | The above procedure may fail to add keywords to derived modes if | 701 | The above procedure may fail to add keywords to derived modes if |
| 702 | some involved major mode does not follow the standard conventions. | 702 | some involved major mode does not follow the standard conventions. |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index df35e998c31..7592c405076 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-08-21 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-msg.el (gnus-summary-resend-message): Honor posting-style for | ||
| 4 | `name' and `address' in Resent-From header. | ||
| 5 | |||
| 1 | 2012-08-14 Chong Yidong <cyd@gnu.org> | 6 | 2012-08-14 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * gnus-art.el (article-display-face): Handle failure in | 8 | * gnus-art.el (article-display-face): Handle failure in |
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 594f68bb86f..07748bebb81 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el | |||
| @@ -1369,7 +1369,21 @@ For the \"inline\" alternatives, also see the variable | |||
| 1369 | (nnmail-fetch-field "to")))) | 1369 | (nnmail-fetch-field "to")))) |
| 1370 | current-prefix-arg)) | 1370 | current-prefix-arg)) |
| 1371 | (let ((message-header-setup-hook (copy-sequence message-header-setup-hook)) | 1371 | (let ((message-header-setup-hook (copy-sequence message-header-setup-hook)) |
| 1372 | (message-sent-hook (copy-sequence message-sent-hook))) | 1372 | (message-sent-hook (copy-sequence message-sent-hook)) |
| 1373 | ;; Honor posting-style for `name' and `address' in Resent-From header. | ||
| 1374 | (styles (gnus-group-find-parameter gnus-newsgroup-name | ||
| 1375 | 'posting-style t)) | ||
| 1376 | (user-full-name user-full-name) | ||
| 1377 | (user-mail-address user-mail-address) | ||
| 1378 | tem) | ||
| 1379 | (dolist (style (if styles | ||
| 1380 | (append gnus-posting-styles (list (cons ".*" styles))) | ||
| 1381 | gnus-posting-styles)) | ||
| 1382 | (when (string-match (pop style) gnus-newsgroup-name) | ||
| 1383 | (when (setq tem (cadr (assq 'name style))) | ||
| 1384 | (setq user-full-name tem)) | ||
| 1385 | (when (setq tem (cadr (assq 'address style))) | ||
| 1386 | (setq user-mail-address tem)))) | ||
| 1373 | ;; `gnus-summary-resend-message-insert-gcc' must run last. | 1387 | ;; `gnus-summary-resend-message-insert-gcc' must run last. |
| 1374 | (add-hook 'message-header-setup-hook | 1388 | (add-hook 'message-header-setup-hook |
| 1375 | 'gnus-summary-resend-message-insert-gcc t) | 1389 | 'gnus-summary-resend-message-insert-gcc t) |
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 4b1480444c2..5791f1225c1 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -397,9 +397,11 @@ suitable file is found, return nil." | |||
| 397 | (if (member (event-modifiers (aref key 0)) '(nil (shift))) | 397 | (if (member (event-modifiers (aref key 0)) '(nil (shift))) |
| 398 | (push key non-modified-keys))) | 398 | (push key non-modified-keys))) |
| 399 | (when remapped | 399 | (when remapped |
| 400 | (princ "Its keys are remapped to `") | 400 | (princ "Its keys are remapped to ") |
| 401 | (princ (symbol-name remapped)) | 401 | (princ (if (symbolp remapped) |
| 402 | (princ "'.\n")) | 402 | (concat "`" (symbol-name remapped) "'") |
| 403 | "an anonymous command")) | ||
| 404 | (princ ".\n")) | ||
| 403 | 405 | ||
| 404 | (when keys | 406 | (when keys |
| 405 | (princ (if remapped | 407 | (princ (if remapped |
diff --git a/lisp/info.el b/lisp/info.el index 317cba86500..15478f9063c 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -417,6 +417,21 @@ If number, the point is moved to the corresponding line.") | |||
| 417 | (defvar Info-standalone nil | 417 | (defvar Info-standalone nil |
| 418 | "Non-nil if Emacs was started solely as an Info browser.") | 418 | "Non-nil if Emacs was started solely as an Info browser.") |
| 419 | 419 | ||
| 420 | (defvar Info-file-attributes nil | ||
| 421 | "Alist of file attributes of visited Info files. | ||
| 422 | Each element is a list (FILE-NAME FILE-ATTRIBUTES...).") | ||
| 423 | |||
| 424 | (defvar Info-toc-nodes nil | ||
| 425 | "Alist of cached parent-children node information in visited Info files. | ||
| 426 | Each element is (FILE (NODE-NAME PARENT SECTION CHILDREN) ...) | ||
| 427 | where PARENT is the parent node extracted from the Up pointer, | ||
| 428 | SECTION is the section name in the Top node where this node is placed, | ||
| 429 | CHILDREN is a list of child nodes extracted from the node menu.") | ||
| 430 | |||
| 431 | (defvar Info-index-nodes nil | ||
| 432 | "Alist of cached index node names of visited Info files. | ||
| 433 | Each element has the form (INFO-FILE INDEX-NODE-NAMES-LIST).") | ||
| 434 | |||
| 420 | (defvar Info-virtual-files nil | 435 | (defvar Info-virtual-files nil |
| 421 | "List of definitions of virtual Info files. | 436 | "List of definitions of virtual Info files. |
| 422 | Each element of the list has the format (FILENAME (OPERATION . HANDLER) ...) | 437 | Each element of the list has the format (FILENAME (OPERATION . HANDLER) ...) |
| @@ -609,7 +624,26 @@ Do the right thing if the file has been compressed or zipped." | |||
| 609 | (apply 'call-process-region (point-min) (point-max) | 624 | (apply 'call-process-region (point-min) (point-max) |
| 610 | (car decoder) t t nil (cdr decoder)))) | 625 | (car decoder) t t nil (cdr decoder)))) |
| 611 | (let ((inhibit-null-byte-detection t)) ; Index nodes include null bytes | 626 | (let ((inhibit-null-byte-detection t)) ; Index nodes include null bytes |
| 612 | (insert-file-contents fullname visit))))) | 627 | (insert-file-contents fullname visit))) |
| 628 | |||
| 629 | ;; Clear the caches of modified Info files. | ||
| 630 | (let* ((attribs-old (cdr (assoc fullname Info-file-attributes))) | ||
| 631 | (modtime-old (and attribs-old (nth 5 attribs-old))) | ||
| 632 | (attribs-new (and (stringp fullname) (file-attributes fullname))) | ||
| 633 | (modtime-new (and attribs-new (nth 5 attribs-new)))) | ||
| 634 | (when (and modtime-old modtime-new | ||
| 635 | (> (float-time modtime-new) (float-time modtime-old))) | ||
| 636 | (setq Info-index-nodes (remove (assoc (or Info-current-file filename) | ||
| 637 | Info-index-nodes) | ||
| 638 | Info-index-nodes)) | ||
| 639 | (setq Info-toc-nodes (remove (assoc (or Info-current-file filename) | ||
| 640 | Info-toc-nodes) | ||
| 641 | Info-toc-nodes))) | ||
| 642 | ;; Add new modtime to `Info-file-attributes'. | ||
| 643 | (setq Info-file-attributes | ||
| 644 | (cons (cons fullname attribs-new) | ||
| 645 | (remove (assoc fullname Info-file-attributes) | ||
| 646 | Info-file-attributes)))))) | ||
| 613 | 647 | ||
| 614 | (defun Info-file-supports-index-cookies (&optional file) | 648 | (defun Info-file-supports-index-cookies (&optional file) |
| 615 | "Return non-nil value if FILE supports Info index cookies. | 649 | "Return non-nil value if FILE supports Info index cookies. |
| @@ -2394,13 +2428,6 @@ Table of contents is created from the tree structure of menus." | |||
| 2394 | (message "") | 2428 | (message "") |
| 2395 | (nreverse nodes)))) | 2429 | (nreverse nodes)))) |
| 2396 | 2430 | ||
| 2397 | (defvar Info-toc-nodes nil | ||
| 2398 | "Alist of cached parent-children node information in visited Info files. | ||
| 2399 | Each element is (FILE (NODE-NAME PARENT SECTION CHILDREN) ...) | ||
| 2400 | where PARENT is the parent node extracted from the Up pointer, | ||
| 2401 | SECTION is the section name in the Top node where this node is placed, | ||
| 2402 | CHILDREN is a list of child nodes extracted from the node menu.") | ||
| 2403 | |||
| 2404 | (defun Info-toc-nodes (filename) | 2431 | (defun Info-toc-nodes (filename) |
| 2405 | "Return a node list of Info FILENAME with parent-children information. | 2432 | "Return a node list of Info FILENAME with parent-children information. |
| 2406 | This information is cached in the variable `Info-toc-nodes' with the help | 2433 | This information is cached in the variable `Info-toc-nodes' with the help |
| @@ -3032,10 +3059,6 @@ See `Info-scroll-down'." | |||
| 3032 | (if (looking-at "^\\* ") | 3059 | (if (looking-at "^\\* ") |
| 3033 | (forward-char 2))))) | 3060 | (forward-char 2))))) |
| 3034 | 3061 | ||
| 3035 | (defvar Info-index-nodes nil | ||
| 3036 | "Alist of cached index node names of visited Info files. | ||
| 3037 | Each element has the form (INFO-FILE INDEX-NODE-NAMES-LIST).") | ||
| 3038 | |||
| 3039 | (defun Info-index-nodes (&optional file) | 3062 | (defun Info-index-nodes (&optional file) |
| 3040 | "Return a list of names of all index nodes in Info FILE. | 3063 | "Return a list of names of all index nodes in Info FILE. |
| 3041 | If FILE is omitted, it defaults to the current Info file. | 3064 | If FILE is omitted, it defaults to the current Info file. |
diff --git a/lisp/json.el b/lisp/json.el index 468358ccd1a..f1ee3a52032 100644 --- a/lisp/json.el +++ b/lisp/json.el | |||
| @@ -174,6 +174,10 @@ this around your call to `json-read' instead of `setq'ing it.") | |||
| 174 | (put 'json-string-format 'error-conditions | 174 | (put 'json-string-format 'error-conditions |
| 175 | '(json-string-format json-error error)) | 175 | '(json-string-format json-error error)) |
| 176 | 176 | ||
| 177 | (put 'json-key-format 'error-message "Bad JSON object key") | ||
| 178 | (put 'json-key-format 'error-conditions | ||
| 179 | '(json-key-format json-error error)) | ||
| 180 | |||
| 177 | (put 'json-object-format 'error-message "Bad JSON object") | 181 | (put 'json-object-format 'error-message "Bad JSON object") |
| 178 | (put 'json-object-format 'error-conditions | 182 | (put 'json-object-format 'error-conditions |
| 179 | '(json-object-format json-error error)) | 183 | '(json-object-format json-error error)) |
| @@ -321,6 +325,15 @@ representation will be parsed correctly." | |||
| 321 | "Return a JSON representation of STRING." | 325 | "Return a JSON representation of STRING." |
| 322 | (format "\"%s\"" (mapconcat 'json-encode-char string ""))) | 326 | (format "\"%s\"" (mapconcat 'json-encode-char string ""))) |
| 323 | 327 | ||
| 328 | (defun json-encode-key (object) | ||
| 329 | "Return a JSON representation of OBJECT. | ||
| 330 | If the resulting JSON object isn't a valid JSON object key, | ||
| 331 | this signals `json-key-format'." | ||
| 332 | (let ((encoded (json-encode object))) | ||
| 333 | (unless (stringp (json-read-from-string encoded)) | ||
| 334 | (signal 'json-key-format (list object))) | ||
| 335 | encoded)) | ||
| 336 | |||
| 324 | ;;; JSON Objects | 337 | ;;; JSON Objects |
| 325 | 338 | ||
| 326 | (defun json-new-object () | 339 | (defun json-new-object () |
| @@ -395,7 +408,7 @@ Please see the documentation of `json-object-type' and `json-key-type'." | |||
| 395 | (maphash | 408 | (maphash |
| 396 | (lambda (k v) | 409 | (lambda (k v) |
| 397 | (push (format "%s:%s" | 410 | (push (format "%s:%s" |
| 398 | (json-encode k) | 411 | (json-encode-key k) |
| 399 | (json-encode v)) | 412 | (json-encode v)) |
| 400 | r)) | 413 | r)) |
| 401 | hash-table) | 414 | hash-table) |
| @@ -409,7 +422,7 @@ Please see the documentation of `json-object-type' and `json-key-type'." | |||
| 409 | (format "{%s}" | 422 | (format "{%s}" |
| 410 | (json-join (mapcar (lambda (cons) | 423 | (json-join (mapcar (lambda (cons) |
| 411 | (format "%s:%s" | 424 | (format "%s:%s" |
| 412 | (json-encode (car cons)) | 425 | (json-encode-key (car cons)) |
| 413 | (json-encode (cdr cons)))) | 426 | (json-encode (cdr cons)))) |
| 414 | alist) | 427 | alist) |
| 415 | ", "))) | 428 | ", "))) |
| @@ -418,7 +431,7 @@ Please see the documentation of `json-object-type' and `json-key-type'." | |||
| 418 | "Return a JSON representation of PLIST." | 431 | "Return a JSON representation of PLIST." |
| 419 | (let (result) | 432 | (let (result) |
| 420 | (while plist | 433 | (while plist |
| 421 | (push (concat (json-encode (car plist)) | 434 | (push (concat (json-encode-key (car plist)) |
| 422 | ":" | 435 | ":" |
| 423 | (json-encode (cadr plist))) | 436 | (json-encode (cadr plist))) |
| 424 | result) | 437 | result) |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 9fe8f28a59f..d88862b2d47 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -663,6 +663,7 @@ Element N specifies the summary line for message N+1.") | |||
| 663 | (defvar rmail-last-regexp nil) | 663 | (defvar rmail-last-regexp nil) |
| 664 | (put 'rmail-last-regexp 'permanent-local t) | 664 | (put 'rmail-last-regexp 'permanent-local t) |
| 665 | 665 | ||
| 666 | ;; Note that rmail-output-read-file-name modifies this. | ||
| 666 | (defcustom rmail-default-file "~/xmail" | 667 | (defcustom rmail-default-file "~/xmail" |
| 667 | "Default file name for \\[rmail-output]." | 668 | "Default file name for \\[rmail-output]." |
| 668 | :type 'file | 669 | :type 'file |
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el index 9c5b99c5184..63cc26360b7 100644 --- a/lisp/mail/rmailout.el +++ b/lisp/mail/rmailout.el | |||
| @@ -34,7 +34,6 @@ | |||
| 34 | :type 'boolean | 34 | :type 'boolean |
| 35 | :group 'rmail-output) | 35 | :group 'rmail-output) |
| 36 | 36 | ||
| 37 | ;; FIXME risky? | ||
| 38 | (defcustom rmail-output-file-alist nil | 37 | (defcustom rmail-output-file-alist nil |
| 39 | "Alist matching regexps to suggested output Rmail files. | 38 | "Alist matching regexps to suggested output Rmail files. |
| 40 | This is a list of elements of the form (REGEXP . NAME-EXP). | 39 | This is a list of elements of the form (REGEXP . NAME-EXP). |
| @@ -47,6 +46,7 @@ a file name as a string." | |||
| 47 | (string :tag "File Name") | 46 | (string :tag "File Name") |
| 48 | sexp))) | 47 | sexp))) |
| 49 | :group 'rmail-output) | 48 | :group 'rmail-output) |
| 49 | ;; This is risky because NAME-EXP gets evalled. | ||
| 50 | ;;;###autoload(put 'rmail-output-file-alist 'risky-local-variable t) | 50 | ;;;###autoload(put 'rmail-output-file-alist 'risky-local-variable t) |
| 51 | 51 | ||
| 52 | (defcustom rmail-fields-not-to-output nil | 52 | (defcustom rmail-fields-not-to-output nil |
| @@ -58,35 +58,57 @@ The function `rmail-delete-unwanted-fields' uses this, ignoring case." | |||
| 58 | 58 | ||
| 59 | (defun rmail-output-read-file-name () | 59 | (defun rmail-output-read-file-name () |
| 60 | "Read the file name to use for `rmail-output'. | 60 | "Read the file name to use for `rmail-output'. |
| 61 | Set `rmail-default-file' to this name as well as returning it." | 61 | Set `rmail-default-file' to this name as well as returning it. |
| 62 | (let ((default-file | 62 | This uses `rmail-output-file-alist'." |
| 63 | (let (answer tail) | 63 | (let* ((default-file |
| 64 | (setq tail rmail-output-file-alist) | 64 | (or |
| 65 | ;; Suggest a file based on a pattern match. | 65 | (when rmail-output-file-alist |
| 66 | (while (and tail (not answer)) | 66 | (or rmail-buffer (error "There is no Rmail buffer")) |
| 67 | (save-excursion | 67 | (save-current-buffer |
| 68 | (goto-char (point-min)) | 68 | (set-buffer rmail-buffer) |
| 69 | (if (re-search-forward (car (car tail)) nil t) | 69 | (let ((beg (rmail-msgbeg rmail-current-message)) |
| 70 | (setq answer (eval (cdr (car tail))))) | 70 | (end (rmail-msgend rmail-current-message))) |
| 71 | (setq tail (cdr tail)))) | 71 | (if (rmail-buffers-swapped-p) (set-buffer rmail-view-buffer)) |
| 72 | (save-excursion | ||
| 73 | (save-restriction | ||
| 74 | (widen) | ||
| 75 | (narrow-to-region beg end) | ||
| 76 | (let ((tail rmail-output-file-alist) | ||
| 77 | answer err) | ||
| 78 | ;; Suggest a file based on a pattern match. | ||
| 79 | (while (and tail (not answer)) | ||
| 80 | (goto-char (point-min)) | ||
| 81 | (if (re-search-forward (caar tail) nil t) | ||
| 82 | (setq answer | ||
| 83 | (condition-case err | ||
| 84 | (eval (cdar tail)) | ||
| 85 | (error | ||
| 86 | (display-warning | ||
| 87 | :error | ||
| 88 | (format "Error evaluating \ | ||
| 89 | `rmail-output-file-alist' element:\nregexp: %s\naction: %s\nerror: %S\n" | ||
| 90 | (caar tail) (cdar tail) err)) | ||
| 91 | nil)))) | ||
| 92 | (setq tail (cdr tail))) | ||
| 93 | answer)))))) | ||
| 72 | ;; If no suggestion, use same file as last time. | 94 | ;; If no suggestion, use same file as last time. |
| 73 | (or answer rmail-default-file)))) | 95 | rmail-default-file)) |
| 74 | (let ((read-file | 96 | (read-file |
| 75 | (expand-file-name | 97 | (expand-file-name |
| 76 | (read-file-name | 98 | (read-file-name |
| 77 | (concat "Output message to mail file (default " | 99 | (concat "Output message to mail file (default " |
| 78 | (file-name-nondirectory default-file) | 100 | (file-name-nondirectory default-file) |
| 79 | "): ") | 101 | "): ") |
| 80 | (file-name-directory default-file) | 102 | (file-name-directory default-file) |
| 81 | (abbreviate-file-name default-file)) | 103 | (abbreviate-file-name default-file)) |
| 82 | (file-name-directory default-file)))) | 104 | (file-name-directory default-file)))) |
| 83 | (setq rmail-default-file | 105 | (setq rmail-default-file |
| 84 | (if (file-directory-p read-file) | 106 | (if (file-directory-p read-file) |
| 85 | (expand-file-name (file-name-nondirectory default-file) | 107 | (expand-file-name (file-name-nondirectory default-file) |
| 86 | read-file) | 108 | read-file) |
| 87 | (expand-file-name | 109 | (expand-file-name |
| 88 | (or read-file (file-name-nondirectory default-file)) | 110 | (or read-file (file-name-nondirectory default-file)) |
| 89 | (file-name-directory default-file))))))) | 111 | (file-name-directory default-file)))))) |
| 90 | 112 | ||
| 91 | (defun rmail-delete-unwanted-fields (preserve) | 113 | (defun rmail-delete-unwanted-fields (preserve) |
| 92 | "Delete all headers matching `rmail-fields-not-to-output'. | 114 | "Delete all headers matching `rmail-fields-not-to-output'. |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 848599104c5..a17bbfa0d14 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -3293,7 +3293,7 @@ for process communication also." | |||
| 3293 | ;; Under Windows XP, accept-process-output doesn't return | 3293 | ;; Under Windows XP, accept-process-output doesn't return |
| 3294 | ;; sometimes. So we add an additional timeout. | 3294 | ;; sometimes. So we add an additional timeout. |
| 3295 | (with-timeout ((or timeout 1)) | 3295 | (with-timeout ((or timeout 1)) |
| 3296 | (accept-process-output proc timeout timeout-msecs))) | 3296 | (accept-process-output proc timeout timeout-msecs (and proc t)))) |
| 3297 | (tramp-message proc 10 "\n%s" (buffer-string)))) | 3297 | (tramp-message proc 10 "\n%s" (buffer-string)))) |
| 3298 | 3298 | ||
| 3299 | (defun tramp-check-for-regexp (proc regexp) | 3299 | (defun tramp-check-for-regexp (proc regexp) |
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index 0a7d65c1fa4..97fcb6874dd 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el | |||
| @@ -32,6 +32,11 @@ | |||
| 32 | 32 | ||
| 33 | ;;; Code: | 33 | ;;; Code: |
| 34 | 34 | ||
| 35 | (defgroup bug-reference nil | ||
| 36 | "Hyperlinking references to bug reports" | ||
| 37 | ;; Somewhat arbitrary, by analogy with eg goto-address. | ||
| 38 | :group 'comm) | ||
| 39 | |||
| 35 | (defvar bug-reference-map | 40 | (defvar bug-reference-map |
| 36 | (let ((map (make-sparse-keymap))) | 41 | (let ((map (make-sparse-keymap))) |
| 37 | (define-key map [mouse-2] 'bug-reference-push-button) | 42 | (define-key map [mouse-2] 'bug-reference-push-button) |
| @@ -63,9 +68,13 @@ so that it is considered safe, see `enable-local-variables'.") | |||
| 63 | (and (symbolp s) | 68 | (and (symbolp s) |
| 64 | (get s 'bug-reference-url-format))))) | 69 | (get s 'bug-reference-url-format))))) |
| 65 | 70 | ||
| 66 | (defconst bug-reference-bug-regexp | 71 | (defcustom bug-reference-bug-regexp |
| 67 | "\\([Bb]ug ?#\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z-+]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)" | 72 | "\\([Bb]ug ?#\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z-+]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)" |
| 68 | "Regular expression which matches bug references.") | 73 | "Regular expression matching bug references. |
| 74 | The second subexpression should match the bug reference (usually a number)." | ||
| 75 | :type 'string | ||
| 76 | :safe 'stringp | ||
| 77 | :group 'bug-reference) | ||
| 69 | 78 | ||
| 70 | (defun bug-reference-set-overlay-properties () | 79 | (defun bug-reference-set-overlay-properties () |
| 71 | "Set properties of bug reference overlays." | 80 | "Set properties of bug reference overlays." |
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 519e5aef2bc..d954cd53e0a 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el | |||
| @@ -426,18 +426,21 @@ Match group 1 is the name of the macro.") | |||
| 426 | (defcustom js-indent-level 4 | 426 | (defcustom js-indent-level 4 |
| 427 | "Number of spaces for each indentation step in `js-mode'." | 427 | "Number of spaces for each indentation step in `js-mode'." |
| 428 | :type 'integer | 428 | :type 'integer |
| 429 | :safe 'integerp | ||
| 429 | :group 'js) | 430 | :group 'js) |
| 430 | 431 | ||
| 431 | (defcustom js-expr-indent-offset 0 | 432 | (defcustom js-expr-indent-offset 0 |
| 432 | "Number of additional spaces for indenting continued expressions. | 433 | "Number of additional spaces for indenting continued expressions. |
| 433 | The value must be no less than minus `js-indent-level'." | 434 | The value must be no less than minus `js-indent-level'." |
| 434 | :type 'integer | 435 | :type 'integer |
| 436 | :safe 'integerp | ||
| 435 | :group 'js) | 437 | :group 'js) |
| 436 | 438 | ||
| 437 | (defcustom js-paren-indent-offset 0 | 439 | (defcustom js-paren-indent-offset 0 |
| 438 | "Number of additional spaces for indenting expressions in parentheses. | 440 | "Number of additional spaces for indenting expressions in parentheses. |
| 439 | The value must be no less than minus `js-indent-level'." | 441 | The value must be no less than minus `js-indent-level'." |
| 440 | :type 'integer | 442 | :type 'integer |
| 443 | :safe 'integerp | ||
| 441 | :group 'js | 444 | :group 'js |
| 442 | :version "24.1") | 445 | :version "24.1") |
| 443 | 446 | ||
| @@ -445,6 +448,7 @@ The value must be no less than minus `js-indent-level'." | |||
| 445 | "Number of additional spaces for indenting expressions in square braces. | 448 | "Number of additional spaces for indenting expressions in square braces. |
| 446 | The value must be no less than minus `js-indent-level'." | 449 | The value must be no less than minus `js-indent-level'." |
| 447 | :type 'integer | 450 | :type 'integer |
| 451 | :safe 'integerp | ||
| 448 | :group 'js | 452 | :group 'js |
| 449 | :version "24.1") | 453 | :version "24.1") |
| 450 | 454 | ||
| @@ -452,6 +456,7 @@ The value must be no less than minus `js-indent-level'." | |||
| 452 | "Number of additional spaces for indenting expressions in curly braces. | 456 | "Number of additional spaces for indenting expressions in curly braces. |
| 453 | The value must be no less than minus `js-indent-level'." | 457 | The value must be no less than minus `js-indent-level'." |
| 454 | :type 'integer | 458 | :type 'integer |
| 459 | :safe 'integerp | ||
| 455 | :group 'js | 460 | :group 'js |
| 456 | :version "24.1") | 461 | :version "24.1") |
| 457 | 462 | ||
diff --git a/lisp/simple.el b/lisp/simple.el index 76243a202bc..1080757f7d2 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3474,16 +3474,36 @@ The argument is used for internal purposes; do not supply one." | |||
| 3474 | 3474 | ||
| 3475 | ;; Yanking. | 3475 | ;; Yanking. |
| 3476 | 3476 | ||
| 3477 | (defcustom yank-handled-properties | ||
| 3478 | '((font-lock-face . yank-handle-font-lock-face-property) | ||
| 3479 | (category . yank-handle-category-property)) | ||
| 3480 | "List of special text property handling conditions for yanking. | ||
| 3481 | Each element should have the form (PROP . FUN), where PROP is a | ||
| 3482 | property symbol and FUN is a function. When the `yank' command | ||
| 3483 | inserts text into the buffer, it scans the inserted text for | ||
| 3484 | stretches of text that have `eq' values of the text property | ||
| 3485 | PROP; for each such stretch of text, FUN is called with three | ||
| 3486 | arguments: the property's value in that text, and the start and | ||
| 3487 | end positions of the text. | ||
| 3488 | |||
| 3489 | This is done prior to removing the properties specified by | ||
| 3490 | `yank-excluded-properties'." | ||
| 3491 | :group 'killing | ||
| 3492 | :version "24.3") | ||
| 3493 | |||
| 3477 | ;; This is actually used in subr.el but defcustom does not work there. | 3494 | ;; This is actually used in subr.el but defcustom does not work there. |
| 3478 | (defcustom yank-excluded-properties | 3495 | (defcustom yank-excluded-properties |
| 3479 | '(read-only invisible intangible field mouse-face help-echo local-map keymap | 3496 | '(category field follow-link fontified font-lock-face help-echo |
| 3480 | yank-handler follow-link fontified) | 3497 | intangible invisible keymap local-map mouse-face read-only |
| 3498 | yank-handler) | ||
| 3481 | "Text properties to discard when yanking. | 3499 | "Text properties to discard when yanking. |
| 3482 | The value should be a list of text properties to discard or t, | 3500 | The value should be a list of text properties to discard or t, |
| 3483 | which means to discard all text properties." | 3501 | which means to discard all text properties. |
| 3502 | |||
| 3503 | See also `yank-handled-properties'." | ||
| 3484 | :type '(choice (const :tag "All" t) (repeat symbol)) | 3504 | :type '(choice (const :tag "All" t) (repeat symbol)) |
| 3485 | :group 'killing | 3505 | :group 'killing |
| 3486 | :version "22.1") | 3506 | :version "24.3") |
| 3487 | 3507 | ||
| 3488 | (defvar yank-window-start nil) | 3508 | (defvar yank-window-start nil) |
| 3489 | (defvar yank-undo-function nil | 3509 | (defvar yank-undo-function nil |
| @@ -3535,15 +3555,16 @@ doc string for `insert-for-yank-1', which see." | |||
| 3535 | 3555 | ||
| 3536 | (defun yank (&optional arg) | 3556 | (defun yank (&optional arg) |
| 3537 | "Reinsert (\"paste\") the last stretch of killed text. | 3557 | "Reinsert (\"paste\") the last stretch of killed text. |
| 3538 | More precisely, reinsert the stretch of killed text most recently | 3558 | More precisely, reinsert the most recent kill, which is the |
| 3539 | killed OR yanked. Put point at end, and set mark at beginning. | 3559 | stretch of killed text most recently killed OR yanked. Put point |
| 3540 | With just \\[universal-argument] as argument, same but put point at beginning (and mark at end). | 3560 | at the end, and set mark at the beginning without activating it. |
| 3541 | With argument N, reinsert the Nth most recently killed stretch of killed | 3561 | With just \\[universal-argument] as argument, put point at beginning, and mark at end. |
| 3542 | text. | 3562 | With argument N, reinsert the Nth most recent kill. |
| 3543 | 3563 | ||
| 3544 | When this command inserts killed text into the buffer, it honors | 3564 | When this command inserts text into the buffer, it honors the |
| 3545 | `yank-excluded-properties' and `yank-handler' as described in the | 3565 | `yank-handled-properties' and `yank-excluded-properties' |
| 3546 | doc string for `insert-for-yank-1', which see. | 3566 | variables, and the `yank-handler' text property. See |
| 3567 | `insert-for-yank-1' for details. | ||
| 3547 | 3568 | ||
| 3548 | See also the command `yank-pop' (\\[yank-pop])." | 3569 | See also the command `yank-pop' (\\[yank-pop])." |
| 3549 | (interactive "*P") | 3570 | (interactive "*P") |
diff --git a/lisp/subr.el b/lisp/subr.el index 1e367a155d0..74afd59f8d5 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2805,35 +2805,24 @@ if it's an autoloaded macro." | |||
| 2805 | 2805 | ||
| 2806 | ;;;; Support for yanking and text properties. | 2806 | ;;;; Support for yanking and text properties. |
| 2807 | 2807 | ||
| 2808 | (defvar yank-handled-properties) | ||
| 2808 | (defvar yank-excluded-properties) | 2809 | (defvar yank-excluded-properties) |
| 2809 | 2810 | ||
| 2810 | (defun remove-yank-excluded-properties (start end) | 2811 | (defun remove-yank-excluded-properties (start end) |
| 2811 | "Remove `yank-excluded-properties' between START and END positions. | 2812 | "Process text properties between START and END, inserted for a `yank'. |
| 2812 | Replaces `category' properties with their defined properties." | 2813 | Perform the handling specified by `yank-handled-properties', then |
| 2814 | remove properties specified by `yank-excluded-properties'." | ||
| 2813 | (let ((inhibit-read-only t)) | 2815 | (let ((inhibit-read-only t)) |
| 2814 | ;; Replace any `category' property with the properties it stands | 2816 | (dolist (handler yank-handled-properties) |
| 2815 | ;; for. This is to remove `mouse-face' properties that are placed | 2817 | (let ((prop (car handler)) |
| 2816 | ;; on categories in *Help* buffers' buttons. See | 2818 | (fun (cdr handler)) |
| 2817 | ;; http://lists.gnu.org/archive/html/emacs-devel/2002-04/msg00648.html | 2819 | (run-start start)) |
| 2818 | ;; for the details. | 2820 | (while (< run-start end) |
| 2819 | (unless (memq yank-excluded-properties '(t nil)) | 2821 | (let ((value (get-text-property run-start prop)) |
| 2820 | (save-excursion | 2822 | (run-end (next-single-property-change |
| 2821 | (goto-char start) | 2823 | run-start prop nil end))) |
| 2822 | (while (< (point) end) | 2824 | (funcall fun value run-start run-end) |
| 2823 | (let ((cat (get-text-property (point) 'category)) | 2825 | (setq run-start run-end))))) |
| 2824 | run-end) | ||
| 2825 | (setq run-end | ||
| 2826 | (next-single-property-change (point) 'category nil end)) | ||
| 2827 | (when cat | ||
| 2828 | (let (run-end2 original) | ||
| 2829 | (remove-list-of-text-properties (point) run-end '(category)) | ||
| 2830 | (while (< (point) run-end) | ||
| 2831 | (setq run-end2 (next-property-change (point) nil run-end)) | ||
| 2832 | (setq original (text-properties-at (point))) | ||
| 2833 | (set-text-properties (point) run-end2 (symbol-plist cat)) | ||
| 2834 | (add-text-properties (point) run-end2 original) | ||
| 2835 | (goto-char run-end2)))) | ||
| 2836 | (goto-char run-end))))) | ||
| 2837 | (if (eq yank-excluded-properties t) | 2826 | (if (eq yank-excluded-properties t) |
| 2838 | (set-text-properties start end nil) | 2827 | (set-text-properties start end nil) |
| 2839 | (remove-list-of-text-properties start end yank-excluded-properties)))) | 2828 | (remove-list-of-text-properties start end yank-excluded-properties)))) |
| @@ -2851,29 +2840,31 @@ See `insert-for-yank-1' for more details." | |||
| 2851 | (insert-for-yank-1 string)) | 2840 | (insert-for-yank-1 string)) |
| 2852 | 2841 | ||
| 2853 | (defun insert-for-yank-1 (string) | 2842 | (defun insert-for-yank-1 (string) |
| 2854 | "Insert STRING at point, stripping some text properties. | 2843 | "Insert STRING at point for the `yank' command. |
| 2855 | 2844 | This function is like `insert', except it honors the variables | |
| 2856 | Strip text properties from the inserted text according to | 2845 | `yank-handled-properties' and `yank-excluded-properties', and the |
| 2857 | `yank-excluded-properties'. Otherwise just like (insert STRING). | 2846 | `yank-handler' text property. |
| 2858 | 2847 | ||
| 2859 | If STRING has a non-nil `yank-handler' property on the first character, | 2848 | Properties listed in `yank-handled-properties' are processed, |
| 2860 | the normal insert behavior is modified in various ways. The value of | 2849 | then those listed in `yank-excluded-properties' are discarded. |
| 2861 | the yank-handler property must be a list with one to four elements | 2850 | |
| 2862 | with the following format: (FUNCTION PARAM NOEXCLUDE UNDO). | 2851 | If STRING has a non-nil `yank-handler' property on its first |
| 2863 | When FUNCTION is present and non-nil, it is called instead of `insert' | 2852 | character, the normal insert behavior is altered. The value of |
| 2864 | to insert the string. FUNCTION takes one argument--the object to insert. | 2853 | the `yank-handler' property must be a list of one to four |
| 2865 | If PARAM is present and non-nil, it replaces STRING as the object | 2854 | elements, of the form (FUNCTION PARAM NOEXCLUDE UNDO). |
| 2866 | passed to FUNCTION (or `insert'); for example, if FUNCTION is | 2855 | FUNCTION, if non-nil, should be a function of one argument, an |
| 2867 | `yank-rectangle', PARAM may be a list of strings to insert as a | 2856 | object to insert; it is called instead of `insert'. |
| 2868 | rectangle. | 2857 | PARAM, if present and non-nil, replaces STRING as the argument to |
| 2869 | If NOEXCLUDE is present and non-nil, the normal removal of the | 2858 | FUNCTION or `insert'; e.g. if FUNCTION is `yank-rectangle', PARAM |
| 2859 | may be a list of strings to insert as a rectangle. | ||
| 2860 | If NOEXCLUDE is present and non-nil, the normal removal of | ||
| 2870 | `yank-excluded-properties' is not performed; instead FUNCTION is | 2861 | `yank-excluded-properties' is not performed; instead FUNCTION is |
| 2871 | responsible for removing those properties. This may be necessary | 2862 | responsible for the removal. This may be necessary if FUNCTION |
| 2872 | if FUNCTION adjusts point before or after inserting the object. | 2863 | adjusts point before or after inserting the object. |
| 2873 | If UNDO is present and non-nil, it is a function that will be called | 2864 | UNDO, if present and non-nil, should be a function to be called |
| 2874 | by `yank-pop' to undo the insertion of the current object. It is | 2865 | by `yank-pop' to undo the insertion of the current object. It is |
| 2875 | called with two arguments, the start and end of the current region. | 2866 | given two arguments, the start and end of the region. FUNCTION |
| 2876 | FUNCTION may set `yank-undo-function' to override the UNDO value." | 2867 | may set `yank-undo-function' to override UNDO." |
| 2877 | (let* ((handler (and (stringp string) | 2868 | (let* ((handler (and (stringp string) |
| 2878 | (get-text-property 0 'yank-handler string))) | 2869 | (get-text-property 0 'yank-handler string))) |
| 2879 | (param (or (nth 1 handler) string)) | 2870 | (param (or (nth 1 handler) string)) |
| @@ -2882,7 +2873,7 @@ If UNDO is present and non-nil, it is a function that will be called | |||
| 2882 | end) | 2873 | end) |
| 2883 | 2874 | ||
| 2884 | (setq yank-undo-function t) | 2875 | (setq yank-undo-function t) |
| 2885 | (if (nth 0 handler) ;; FUNCTION | 2876 | (if (nth 0 handler) ; FUNCTION |
| 2886 | (funcall (car handler) param) | 2877 | (funcall (car handler) param) |
| 2887 | (insert param)) | 2878 | (insert param)) |
| 2888 | (setq end (point)) | 2879 | (setq end (point)) |
| @@ -2891,34 +2882,17 @@ If UNDO is present and non-nil, it is a function that will be called | |||
| 2891 | ;; following text property changes. | 2882 | ;; following text property changes. |
| 2892 | (setq inhibit-read-only t) | 2883 | (setq inhibit-read-only t) |
| 2893 | 2884 | ||
| 2894 | ;; What should we do with `font-lock-face' properties? | 2885 | (unless (nth 2 handler) ; NOEXCLUDE |
| 2895 | (if font-lock-defaults | 2886 | (remove-yank-excluded-properties opoint end)) |
| 2896 | ;; No, just wipe them. | ||
| 2897 | (remove-list-of-text-properties opoint end '(font-lock-face)) | ||
| 2898 | ;; Convert them to `face'. | ||
| 2899 | (save-excursion | ||
| 2900 | (goto-char opoint) | ||
| 2901 | (while (< (point) end) | ||
| 2902 | (let ((face (get-text-property (point) 'font-lock-face)) | ||
| 2903 | run-end) | ||
| 2904 | (setq run-end | ||
| 2905 | (next-single-property-change (point) 'font-lock-face nil end)) | ||
| 2906 | (when face | ||
| 2907 | (remove-text-properties (point) run-end '(font-lock-face nil)) | ||
| 2908 | (put-text-property (point) run-end 'face face)) | ||
| 2909 | (goto-char run-end))))) | ||
| 2910 | |||
| 2911 | (unless (nth 2 handler) ;; NOEXCLUDE | ||
| 2912 | (remove-yank-excluded-properties opoint (point))) | ||
| 2913 | 2887 | ||
| 2914 | ;; If last inserted char has properties, mark them as rear-nonsticky. | 2888 | ;; If last inserted char has properties, mark them as rear-nonsticky. |
| 2915 | (if (and (> end opoint) | 2889 | (if (and (> end opoint) |
| 2916 | (text-properties-at (1- end))) | 2890 | (text-properties-at (1- end))) |
| 2917 | (put-text-property (1- end) end 'rear-nonsticky t)) | 2891 | (put-text-property (1- end) end 'rear-nonsticky t)) |
| 2918 | 2892 | ||
| 2919 | (if (eq yank-undo-function t) ;; not set by FUNCTION | 2893 | (if (eq yank-undo-function t) ; not set by FUNCTION |
| 2920 | (setq yank-undo-function (nth 3 handler))) ;; UNDO | 2894 | (setq yank-undo-function (nth 3 handler))) ; UNDO |
| 2921 | (if (nth 4 handler) ;; COMMAND | 2895 | (if (nth 4 handler) ; COMMAND |
| 2922 | (setq this-command (nth 4 handler))))) | 2896 | (setq this-command (nth 4 handler))))) |
| 2923 | 2897 | ||
| 2924 | (defun insert-buffer-substring-no-properties (buffer &optional start end) | 2898 | (defun insert-buffer-substring-no-properties (buffer &optional start end) |
| @@ -2944,6 +2918,27 @@ Strip text properties from the inserted text according to | |||
| 2944 | (insert-buffer-substring buffer start end) | 2918 | (insert-buffer-substring buffer start end) |
| 2945 | (remove-yank-excluded-properties opoint (point)))) | 2919 | (remove-yank-excluded-properties opoint (point)))) |
| 2946 | 2920 | ||
| 2921 | (defun yank-handle-font-lock-face-property (face start end) | ||
| 2922 | "If `font-lock-defaults' is nil, apply FACE as a `face' property. | ||
| 2923 | START and END denote the start and end of the text to act on. | ||
| 2924 | Do nothing if FACE is nil." | ||
| 2925 | (and face | ||
| 2926 | (null font-lock-defaults) | ||
| 2927 | (put-text-property start end 'face face))) | ||
| 2928 | |||
| 2929 | ;; This removes `mouse-face' properties in *Help* buffer buttons: | ||
| 2930 | ;; http://lists.gnu.org/archive/html/emacs-devel/2002-04/msg00648.html | ||
| 2931 | (defun yank-handle-category-property (category start end) | ||
| 2932 | "Apply property category CATEGORY's properties between START and END." | ||
| 2933 | (when category | ||
| 2934 | (let ((start2 start)) | ||
| 2935 | (while (< start2 end) | ||
| 2936 | (let ((end2 (next-property-change start2 nil end)) | ||
| 2937 | (original (text-properties-at start2))) | ||
| 2938 | (set-text-properties start2 end2 (symbol-plist category)) | ||
| 2939 | (add-text-properties start2 end2 original) | ||
| 2940 | (setq start2 end2)))))) | ||
| 2941 | |||
| 2947 | 2942 | ||
| 2948 | ;;;; Synchronous shell commands. | 2943 | ;;;; Synchronous shell commands. |
| 2949 | 2944 | ||
diff --git a/lisp/window.el b/lisp/window.el index 142e80e1666..ab90d8a4bde 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -271,19 +271,32 @@ windows horizontally arranged within WINDOW." | |||
| 271 | (setq walk-window-tree-window | 271 | (setq walk-window-tree-window |
| 272 | (window-right walk-window-tree-window)))))) | 272 | (window-right walk-window-tree-window)))))) |
| 273 | 273 | ||
| 274 | (defun walk-window-tree (fun &optional frame any) | 274 | (defun walk-window-tree (fun &optional frame any minibuf) |
| 275 | "Run function FUN on each live window of FRAME. | 275 | "Run function FUN on each live window of FRAME. |
| 276 | FUN must be a function with one argument - a window. FRAME must | 276 | FUN must be a function with one argument - a window. FRAME must |
| 277 | be a live frame and defaults to the selected one. ANY, if | 277 | be a live frame and defaults to the selected one. ANY, if |
| 278 | non-nil means to run FUN on all live and internal windows of | 278 | non-nil, means to run FUN on all live and internal windows of |
| 279 | FRAME. | 279 | FRAME. |
| 280 | 280 | ||
| 281 | Optional argument MINIBUF t means run FUN on FRAME's minibuffer | ||
| 282 | window even if it isn't active. MINIBUF nil or omitted means run | ||
| 283 | FUN on FRAME's minibuffer window only if it's active. In both | ||
| 284 | cases the minibuffer window must be part of FRAME. MINIBUF | ||
| 285 | neither nil nor t means never run FUN on the minibuffer window. | ||
| 286 | |||
| 281 | This function performs a pre-order, depth-first traversal of the | 287 | This function performs a pre-order, depth-first traversal of the |
| 282 | window tree. If FUN changes the window tree, the result is | 288 | window tree. If FUN changes the window tree, the result is |
| 283 | unpredictable." | 289 | unpredictable." |
| 284 | (let ((walk-window-tree-frame (window-normalize-frame frame))) | 290 | (setq frame (window-normalize-frame frame)) |
| 285 | (walk-window-tree-1 | 291 | (walk-window-tree-1 fun (frame-root-window frame) any) |
| 286 | fun (frame-root-window walk-window-tree-frame) any))) | 292 | (when (memq minibuf '(nil t)) |
| 293 | ;; Run FUN on FRAME's minibuffer window if requested. | ||
| 294 | (let ((minibuffer-window (minibuffer-window frame))) | ||
| 295 | (when (and (window-live-p minibuffer-window) | ||
| 296 | (eq (window-frame minibuffer-window) frame) | ||
| 297 | (or (eq minibuf t) | ||
| 298 | (minibuffer-window-active-p minibuffer-window))) | ||
| 299 | (funcall fun minibuffer-window))))) | ||
| 287 | 300 | ||
| 288 | (defun walk-window-subtree (fun &optional window any) | 301 | (defun walk-window-subtree (fun &optional window any) |
| 289 | "Run function FUN on the subtree of windows rooted at WINDOW. | 302 | "Run function FUN on the subtree of windows rooted at WINDOW. |
| @@ -299,13 +312,19 @@ is unpredictable." | |||
| 299 | (setq window (window-normalize-window window)) | 312 | (setq window (window-normalize-window window)) |
| 300 | (walk-window-tree-1 fun window any t)) | 313 | (walk-window-tree-1 fun window any t)) |
| 301 | 314 | ||
| 302 | (defun window-with-parameter (parameter &optional value frame any) | 315 | (defun window-with-parameter (parameter &optional value frame any minibuf) |
| 303 | "Return first window on FRAME with PARAMETER non-nil. | 316 | "Return first window on FRAME with PARAMETER non-nil. |
| 304 | FRAME defaults to the selected frame. Optional argument VALUE | 317 | FRAME defaults to the selected frame. Optional argument VALUE |
| 305 | non-nil means only return a window whose window-parameter value | 318 | non-nil means only return a window whose window-parameter value |
| 306 | for PARAMETER equals VALUE (comparison is done with `equal'). | 319 | for PARAMETER equals VALUE (comparison is done with `equal'). |
| 307 | Optional argument ANY non-nil means consider internal windows | 320 | Optional argument ANY non-nil means consider internal windows |
| 308 | too." | 321 | too. |
| 322 | |||
| 323 | Optional argument MINIBUF t means consider FRAME's minibuffer | ||
| 324 | window even if it isn't active. MINIBUF nil or omitted means | ||
| 325 | consider FRAME's minibuffer window only if it's active. In both | ||
| 326 | cases the minibuffer window must be part of FRAME. MINIBUF | ||
| 327 | neither nil nor t means never consider the minibuffer window." | ||
| 309 | (let (this-value) | 328 | (let (this-value) |
| 310 | (catch 'found | 329 | (catch 'found |
| 311 | (walk-window-tree | 330 | (walk-window-tree |
| @@ -313,7 +332,7 @@ too." | |||
| 313 | (when (and (setq this-value (window-parameter window parameter)) | 332 | (when (and (setq this-value (window-parameter window parameter)) |
| 314 | (or (not value) (equal value this-value))) | 333 | (or (not value) (equal value this-value))) |
| 315 | (throw 'found window))) | 334 | (throw 'found window))) |
| 316 | frame any)))) | 335 | frame any minibuf)))) |
| 317 | 336 | ||
| 318 | ;;; Atomic windows. | 337 | ;;; Atomic windows. |
| 319 | (defun window-atom-root (&optional window) | 338 | (defun window-atom-root (&optional window) |
| @@ -516,7 +535,7 @@ unless it has no other choice (like when deleting a neighboring | |||
| 516 | window).") | 535 | window).") |
| 517 | (make-variable-buffer-local 'window-size-fixed) | 536 | (make-variable-buffer-local 'window-size-fixed) |
| 518 | 537 | ||
| 519 | (defun window--size-ignore (window ignore) | 538 | (defun window--size-ignore-p (window ignore) |
| 520 | "Return non-nil if IGNORE says to ignore size restrictions for WINDOW." | 539 | "Return non-nil if IGNORE says to ignore size restrictions for WINDOW." |
| 521 | (if (window-valid-p ignore) (eq window ignore) ignore)) | 540 | (if (window-valid-p ignore) (eq window ignore) ignore)) |
| 522 | 541 | ||
| @@ -559,7 +578,7 @@ means ignore all of the above restrictions for all windows." | |||
| 559 | value) | 578 | value) |
| 560 | (with-current-buffer (window-buffer window) | 579 | (with-current-buffer (window-buffer window) |
| 561 | (cond | 580 | (cond |
| 562 | ((and (not (window--size-ignore window ignore)) | 581 | ((and (not (window--size-ignore-p window ignore)) |
| 563 | (window-size-fixed-p window horizontal)) | 582 | (window-size-fixed-p window horizontal)) |
| 564 | ;; The minimum size of a fixed size window is its size. | 583 | ;; The minimum size of a fixed size window is its size. |
| 565 | (window-total-size window horizontal)) | 584 | (window-total-size window horizontal)) |
| @@ -588,7 +607,7 @@ means ignore all of the above restrictions for all windows." | |||
| 588 | (ceiling (or (frame-parameter frame 'scroll-bar-width) 14) | 607 | (ceiling (or (frame-parameter frame 'scroll-bar-width) 14) |
| 589 | (frame-char-width))) | 608 | (frame-char-width))) |
| 590 | (t 0))) | 609 | (t 0))) |
| 591 | (if (and (not (window--size-ignore window ignore)) | 610 | (if (and (not (window--size-ignore-p window ignore)) |
| 592 | (numberp window-min-width)) | 611 | (numberp window-min-width)) |
| 593 | window-min-width | 612 | window-min-width |
| 594 | 0)))) | 613 | 0)))) |
| @@ -598,7 +617,7 @@ means ignore all of the above restrictions for all windows." | |||
| 598 | (max (+ window-safe-min-height | 617 | (max (+ window-safe-min-height |
| 599 | (if header-line-format 1 0) | 618 | (if header-line-format 1 0) |
| 600 | (if mode-line-format 1 0)) | 619 | (if mode-line-format 1 0)) |
| 601 | (if (and (not (window--size-ignore window ignore)) | 620 | (if (and (not (window--size-ignore-p window ignore)) |
| 602 | (numberp window-min-height)) | 621 | (numberp window-min-height)) |
| 603 | window-min-height | 622 | window-min-height |
| 604 | 0)))))))) | 623 | 0)))))))) |
| @@ -637,7 +656,7 @@ ignore all of the above restrictions for all windows." | |||
| 637 | (max (- (window-min-size window horizontal ignore) | 656 | (max (- (window-min-size window horizontal ignore) |
| 638 | (window-total-size window horizontal)) | 657 | (window-total-size window horizontal)) |
| 639 | delta)) | 658 | delta)) |
| 640 | ((window--size-ignore window ignore) | 659 | ((window--size-ignore-p window ignore) |
| 641 | delta) | 660 | delta) |
| 642 | ((> delta 0) | 661 | ((> delta 0) |
| 643 | (if (window-size-fixed-p window horizontal) | 662 | (if (window-size-fixed-p window horizontal) |
| @@ -719,7 +738,7 @@ WINDOW can be resized in the desired direction. The function | |||
| 719 | ((eq sub window) | 738 | ((eq sub window) |
| 720 | (setq skip (eq trail 'before))) | 739 | (setq skip (eq trail 'before))) |
| 721 | (skip) | 740 | (skip) |
| 722 | ((and (not (window--size-ignore window ignore)) | 741 | ((and (not (window--size-ignore-p window ignore)) |
| 723 | (window-size-fixed-p sub horizontal))) | 742 | (window-size-fixed-p sub horizontal))) |
| 724 | (t | 743 | (t |
| 725 | ;; We found a non-fixed-size child window. | 744 | ;; We found a non-fixed-size child window. |
| @@ -809,7 +828,7 @@ at least one other window can be enlarged appropriately." | |||
| 809 | ;; child window is fixed-size. | 828 | ;; child window is fixed-size. |
| 810 | (while sub | 829 | (while sub |
| 811 | (when (and (not (eq sub window)) | 830 | (when (and (not (eq sub window)) |
| 812 | (not (window--size-ignore sub ignore)) | 831 | (not (window--size-ignore-p sub ignore)) |
| 813 | (window-size-fixed-p sub horizontal)) | 832 | (window-size-fixed-p sub horizontal)) |
| 814 | (throw 'fixed delta)) | 833 | (throw 'fixed delta)) |
| 815 | (setq sub (window-right sub)))) | 834 | (setq sub (window-right sub)))) |
| @@ -849,7 +868,7 @@ Optional argument NODOWN non-nil means do not check whether | |||
| 849 | WINDOW itself (and its child windows) can be enlarged; check | 868 | WINDOW itself (and its child windows) can be enlarged; check |
| 850 | only whether other windows can be shrunk appropriately." | 869 | only whether other windows can be shrunk appropriately." |
| 851 | (setq window (window-normalize-window window)) | 870 | (setq window (window-normalize-window window)) |
| 852 | (if (and (not (window--size-ignore window ignore)) | 871 | (if (and (not (window--size-ignore-p window ignore)) |
| 853 | (not nodown) (window-size-fixed-p window horizontal)) | 872 | (not nodown) (window-size-fixed-p window horizontal)) |
| 854 | ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed | 873 | ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed |
| 855 | ;; size. | 874 | ;; size. |
| @@ -1062,32 +1081,6 @@ windows nor the buffer list." | |||
| 1062 | (dolist (walk-windows-window (window-list-1 nil minibuf all-frames)) | 1081 | (dolist (walk-windows-window (window-list-1 nil minibuf all-frames)) |
| 1063 | (funcall fun walk-windows-window)))) | 1082 | (funcall fun walk-windows-window)))) |
| 1064 | 1083 | ||
| 1065 | (defun window-point-1 (&optional window) | ||
| 1066 | "Return value of WINDOW's point. | ||
| 1067 | WINDOW can be any live window and defaults to the selected one. | ||
| 1068 | |||
| 1069 | This function is like `window-point' with one exception: If | ||
| 1070 | WINDOW is selected, it returns the value of `point' of WINDOW's | ||
| 1071 | buffer regardless of whether that buffer is current or not." | ||
| 1072 | (setq window (window-normalize-window window t)) | ||
| 1073 | (if (eq window (selected-window)) | ||
| 1074 | (with-current-buffer (window-buffer window) | ||
| 1075 | (point)) | ||
| 1076 | (window-point window))) | ||
| 1077 | |||
| 1078 | (defun set-window-point-1 (window pos) | ||
| 1079 | "Set value of WINDOW's point to POS. | ||
| 1080 | WINDOW can be any live window and defaults to the selected one. | ||
| 1081 | |||
| 1082 | This function is like `set-window-point' with one exception: If | ||
| 1083 | WINDOW is selected, it moves `point' of WINDOW's buffer to POS | ||
| 1084 | regardless of whether that buffer is current or not." | ||
| 1085 | (setq window (window-normalize-window window t)) | ||
| 1086 | (if (eq window (selected-window)) | ||
| 1087 | (with-current-buffer (window-buffer window) | ||
| 1088 | (goto-char pos)) | ||
| 1089 | (set-window-point window pos))) | ||
| 1090 | |||
| 1091 | (defun window-at-side-p (&optional window side) | 1084 | (defun window-at-side-p (&optional window side) |
| 1092 | "Return t if WINDOW is at SIDE of its containing frame. | 1085 | "Return t if WINDOW is at SIDE of its containing frame. |
| 1093 | WINDOW must be a valid window and defaults to the selected one. | 1086 | WINDOW must be a valid window and defaults to the selected one. |
| @@ -1114,7 +1107,7 @@ SIDE can be any of the symbols `left', `top', `right' or | |||
| 1114 | (lambda (window) | 1107 | (lambda (window) |
| 1115 | (when (window-at-side-p window side) | 1108 | (when (window-at-side-p window side) |
| 1116 | (setq windows (cons window windows)))) | 1109 | (setq windows (cons window windows)))) |
| 1117 | frame) | 1110 | frame nil 'nomini) |
| 1118 | (nreverse windows))) | 1111 | (nreverse windows))) |
| 1119 | 1112 | ||
| 1120 | (defun window--in-direction-2 (window posn &optional horizontal) | 1113 | (defun window--in-direction-2 (window posn &optional horizontal) |
| @@ -1129,12 +1122,25 @@ SIDE can be any of the symbols `left', `top', `right' or | |||
| 1129 | (- left posn) | 1122 | (- left posn) |
| 1130 | (- posn left (window-total-width window)))))) | 1123 | (- posn left (window-total-width window)))))) |
| 1131 | 1124 | ||
| 1125 | ;; Predecessors to the below have been devised by Julian Assange in | ||
| 1126 | ;; change-windows-intuitively.el and Hovav Shacham in windmove.el. | ||
| 1127 | ;; Neither of these allow to selectively ignore specific windows | ||
| 1128 | ;; (windows whose `no-other-window' parameter is non-nil) as targets of | ||
| 1129 | ;; the movement. | ||
| 1132 | (defun window-in-direction (direction &optional window ignore) | 1130 | (defun window-in-direction (direction &optional window ignore) |
| 1133 | "Return window in DIRECTION as seen from WINDOW. | 1131 | "Return window in DIRECTION as seen from WINDOW. |
| 1132 | More precisely, return the nearest window in direction DIRECTION | ||
| 1133 | as seen from the position of `window-point' in window WINDOW. | ||
| 1134 | DIRECTION must be one of `above', `below', `left' or `right'. | 1134 | DIRECTION must be one of `above', `below', `left' or `right'. |
| 1135 | WINDOW must be a live window and defaults to the selected one. | 1135 | WINDOW must be a live window and defaults to the selected one. |
| 1136 | IGNORE non-nil means a window can be returned even if its | 1136 | |
| 1137 | `no-other-window' parameter is non-nil." | 1137 | Do not return a window whose `no-other-window' parameter is |
| 1138 | non-nil. If the nearest window's `no-other-window' parameter is | ||
| 1139 | non-nil, try to find another window in the indicated direction. | ||
| 1140 | If, however, the optional argument IGNORE is non-nil, return that | ||
| 1141 | window even if its `no-other-window' parameter is non-nil. | ||
| 1142 | |||
| 1143 | Return nil if no suitable window can be found." | ||
| 1138 | (setq window (window-normalize-window window t)) | 1144 | (setq window (window-normalize-window window t)) |
| 1139 | (unless (memq direction '(above below left right)) | 1145 | (unless (memq direction '(above below left right)) |
| 1140 | (error "Wrong direction %s" direction)) | 1146 | (error "Wrong direction %s" direction)) |
| @@ -1146,7 +1152,7 @@ IGNORE non-nil means a window can be returned even if its | |||
| 1146 | (last (+ first (if hor | 1152 | (last (+ first (if hor |
| 1147 | (window-total-width window) | 1153 | (window-total-width window) |
| 1148 | (window-total-height window)))) | 1154 | (window-total-height window)))) |
| 1149 | (posn-cons (nth 6 (posn-at-point (window-point-1 window) window))) | 1155 | (posn-cons (nth 6 (posn-at-point (window-point window) window))) |
| 1150 | ;; The column / row value of `posn-at-point' can be nil for the | 1156 | ;; The column / row value of `posn-at-point' can be nil for the |
| 1151 | ;; mini-window, guard against that. | 1157 | ;; mini-window, guard against that. |
| 1152 | (posn (if hor | 1158 | (posn (if hor |
| @@ -1221,7 +1227,7 @@ IGNORE non-nil means a window can be returned even if its | |||
| 1221 | (setq best-edge-2 w-top) | 1227 | (setq best-edge-2 w-top) |
| 1222 | (setq best-diff-2 best-diff-2-new) | 1228 | (setq best-diff-2 best-diff-2-new) |
| 1223 | (setq best-2 w))))))) | 1229 | (setq best-2 w))))))) |
| 1224 | (window-frame window)) | 1230 | frame) |
| 1225 | (or best best-2))) | 1231 | (or best best-2))) |
| 1226 | 1232 | ||
| 1227 | (defun get-window-with-predicate (predicate &optional minibuf all-frames default) | 1233 | (defun get-window-with-predicate (predicate &optional minibuf all-frames default) |
| @@ -1865,7 +1871,7 @@ preferably only resize windows adjacent to EDGE." | |||
| 1865 | ;; Make sure this sibling is left alone when | 1871 | ;; Make sure this sibling is left alone when |
| 1866 | ;; resizing its siblings. | 1872 | ;; resizing its siblings. |
| 1867 | (set-window-new-normal sub 'ignore)) | 1873 | (set-window-new-normal sub 'ignore)) |
| 1868 | ((or (window--size-ignore sub ignore) | 1874 | ((or (window--size-ignore-p sub ignore) |
| 1869 | (not (window-size-fixed-p sub horizontal))) | 1875 | (not (window-size-fixed-p sub horizontal))) |
| 1870 | ;; Set this-delta to t to signal that we found a sibling | 1876 | ;; Set this-delta to t to signal that we found a sibling |
| 1871 | ;; of WINDOW whose size is not fixed. | 1877 | ;; of WINDOW whose size is not fixed. |
| @@ -2613,7 +2619,7 @@ WINDOW must be a live window and defaults to the selected one." | |||
| 2613 | ;; Add an entry for buffer to WINDOW's previous buffers. | 2619 | ;; Add an entry for buffer to WINDOW's previous buffers. |
| 2614 | (with-current-buffer buffer | 2620 | (with-current-buffer buffer |
| 2615 | (let ((start (window-start window)) | 2621 | (let ((start (window-start window)) |
| 2616 | (point (window-point-1 window))) | 2622 | (point (window-point window))) |
| 2617 | (setq entry | 2623 | (setq entry |
| 2618 | (cons buffer | 2624 | (cons buffer |
| 2619 | (if entry | 2625 | (if entry |
| @@ -2657,7 +2663,7 @@ before was current this also makes BUFFER the current buffer." | |||
| 2657 | ;; Don't force window-start here (even if POINT is nil). | 2663 | ;; Don't force window-start here (even if POINT is nil). |
| 2658 | (set-window-start window start t)) | 2664 | (set-window-start window start t)) |
| 2659 | (when point | 2665 | (when point |
| 2660 | (set-window-point-1 window point)))) | 2666 | (set-window-point window point)))) |
| 2661 | 2667 | ||
| 2662 | (defcustom switch-to-visible-buffer t | 2668 | (defcustom switch-to-visible-buffer t |
| 2663 | "If non-nil, allow switching to an already visible buffer. | 2669 | "If non-nil, allow switching to an already visible buffer. |
| @@ -3393,7 +3399,7 @@ Otherwise, the window starts are chosen so as to minimize the | |||
| 3393 | amount of redisplay; this is convenient on slow terminals." | 3399 | amount of redisplay; this is convenient on slow terminals." |
| 3394 | (interactive "P") | 3400 | (interactive "P") |
| 3395 | (let ((old-window (selected-window)) | 3401 | (let ((old-window (selected-window)) |
| 3396 | (old-point (window-point-1)) | 3402 | (old-point (window-point)) |
| 3397 | (size (and size (prefix-numeric-value size))) | 3403 | (size (and size (prefix-numeric-value size))) |
| 3398 | moved-by-window-height moved new-window bottom) | 3404 | moved-by-window-height moved new-window bottom) |
| 3399 | (when (and size (< size 0) (< (- size) window-min-height)) | 3405 | (when (and size (< size 0) (< (- size) window-min-height)) |
| @@ -3418,7 +3424,7 @@ amount of redisplay; this is convenient on slow terminals." | |||
| 3418 | (setq bottom (point))) | 3424 | (setq bottom (point))) |
| 3419 | (and moved-by-window-height | 3425 | (and moved-by-window-height |
| 3420 | (<= bottom (point)) | 3426 | (<= bottom (point)) |
| 3421 | (set-window-point-1 old-window (1- bottom))) | 3427 | (set-window-point old-window (1- bottom))) |
| 3422 | (and moved-by-window-height | 3428 | (and moved-by-window-height |
| 3423 | (<= (window-start new-window) old-point) | 3429 | (<= (window-start new-window) old-point) |
| 3424 | (set-window-point new-window old-point) | 3430 | (set-window-point new-window old-point) |
| @@ -3727,7 +3733,7 @@ specific buffers." | |||
| 3727 | `((parameters . ,list)))) | 3733 | `((parameters . ,list)))) |
| 3728 | ,@(when buffer | 3734 | ,@(when buffer |
| 3729 | ;; All buffer related things go in here. | 3735 | ;; All buffer related things go in here. |
| 3730 | (let ((point (window-point-1 window)) | 3736 | (let ((point (window-point window)) |
| 3731 | (start (window-start window))) | 3737 | (start (window-start window))) |
| 3732 | `((buffer | 3738 | `((buffer |
| 3733 | ,(buffer-name buffer) | 3739 | ,(buffer-name buffer) |
| @@ -4020,7 +4026,7 @@ element is BUFFER." | |||
| 4020 | (list 'other | 4026 | (list 'other |
| 4021 | ;; A quadruple of WINDOW's buffer, start, point and height. | 4027 | ;; A quadruple of WINDOW's buffer, start, point and height. |
| 4022 | (list (window-buffer window) (window-start window) | 4028 | (list (window-buffer window) (window-start window) |
| 4023 | (window-point-1 window) (window-total-size window)) | 4029 | (window-point window) (window-total-size window)) |
| 4024 | (selected-window) buffer)))) | 4030 | (selected-window) buffer)))) |
| 4025 | ((eq type 'window) | 4031 | ((eq type 'window) |
| 4026 | ;; WINDOW has been created on an existing frame. | 4032 | ;; WINDOW has been created on an existing frame. |
diff --git a/lisp/xml.el b/lisp/xml.el index 179fdd6b5cc..d395f75ec0f 100644 --- a/lisp/xml.el +++ b/lisp/xml.el | |||
| @@ -1011,13 +1011,25 @@ The first line is indented with the optional INDENT-STRING." | |||
| 1011 | (defalias 'xml-print 'xml-debug-print) | 1011 | (defalias 'xml-print 'xml-debug-print) |
| 1012 | 1012 | ||
| 1013 | (defun xml-escape-string (string) | 1013 | (defun xml-escape-string (string) |
| 1014 | "Return STRING with entity substitutions made from `xml-entity-alist'." | 1014 | "Convert STRING into a string containing valid XML character data. |
| 1015 | (mapconcat (lambda (byte) | 1015 | Replace occurrences of &<>'\" in STRING with their default XML |
| 1016 | (let ((char (char-to-string byte))) | 1016 | entity references (e.g. replace each & with &). |
| 1017 | (if (rassoc char xml-entity-alist) | 1017 | |
| 1018 | (concat "&" (car (rassoc char xml-entity-alist)) ";") | 1018 | XML character data must not contain & or < characters, nor the > |
| 1019 | char))) | 1019 | character under some circumstances. The XML spec does not impose |
| 1020 | string "")) | 1020 | restriction on \" or ', but we just substitute for these too |
| 1021 | \(as is permitted by the spec)." | ||
| 1022 | (with-temp-buffer | ||
| 1023 | (insert string) | ||
| 1024 | (dolist (substitution '(("&" . "&") | ||
| 1025 | ("<" . "<") | ||
| 1026 | (">" . ">") | ||
| 1027 | ("'" . "'") | ||
| 1028 | ("\"" . """))) | ||
| 1029 | (goto-char (point-min)) | ||
| 1030 | (while (search-forward (car substitution) nil t) | ||
| 1031 | (replace-match (cdr substitution) t t nil))) | ||
| 1032 | (buffer-string))) | ||
| 1021 | 1033 | ||
| 1022 | (defun xml-debug-print-internal (xml indent-string) | 1034 | (defun xml-debug-print-internal (xml indent-string) |
| 1023 | "Outputs the XML tree in the current buffer. | 1035 | "Outputs the XML tree in the current buffer. |