X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/99485bca13bcb9e4582764134648855da2d5e071..8a9cad92b1c9eecbdc9268a885413b7c5d08c7fa:/lisp/progmodes/ps-mode.el diff --git a/lisp/progmodes/ps-mode.el b/lisp/progmodes/ps-mode.el index 7d4081d903..b3495c7449 100644 --- a/lisp/progmodes/ps-mode.el +++ b/lisp/progmodes/ps-mode.el @@ -1,11 +1,11 @@ -;;; ps-mode.el --- PostScript mode for GNU Emacs. +;;; ps-mode.el --- PostScript mode for GNU Emacs -;; Copyright (C) 1999 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. ;; Author: Peter Kleiweg ;; Maintainer: Peter Kleiweg ;; Created: 20 Aug 1997 -;; Version: 1.1a, 11 Oct 1999 +;; Version: 1.1g, 9 Nov 2001 ;; Keywords: PostScript, languages ;; This file is part of GNU Emacs. @@ -30,6 +30,9 @@ ;;; Code: +(defconst ps-mode-version "1.1g, 9 Nov 2001") +(defconst ps-mode-maintainer-address "Peter Kleiweg ") + (require 'easymenu) ;; Define core `PostScript' group. @@ -101,10 +104,12 @@ When the figure is finished these values should be replaced." (const :tag "dsheet" (1584 2448)) (const :tag "esheet" (2448 3168)))) -(defcustom ps-mode-print-function '(lambda () - (let ((lpr-switches nil) - (lpr-command \"lpr\")) - (lpr-buffer))) +(defcustom ps-mode-print-function + (lambda () + (let ((lpr-switches nil) + (lpr-command (if (memq system-type '(usg-unix-v dgux hpux irix)) + "lp" "lpr"))) + (lpr-buffer))) "*Lisp function to print current buffer as PostScript." :group 'PostScript-edit :type 'function) @@ -114,14 +119,19 @@ When the figure is finished these values should be replaced." :group 'PostScript-interaction :type 'regexp) -(defcustom ps-run-messages - '((">>showpage, press to continue<<" - (0 font-lock-keyword-face nil nil)) - ("^\\(Error\\|Can't\\).*" - (0 font-lock-warning-face nil nil)) - ("^\\(Current file position is\\) \\([0-9]+\\)" - (1 font-lock-comment-face nil nil) - (2 font-lock-warning-face nil nil))) +(defcustom ps-run-font-lock-keywords-2 + (append (unless (string= ps-run-prompt "") + (list (list (if (= ?^ (string-to-char ps-run-prompt)) + ps-run-prompt + (concat "^" ps-run-prompt)) + '(0 font-lock-function-name-face nil nil)))) + '((">>showpage, press to continue<<" + (0 font-lock-keyword-face nil nil)) + ("^\\(Error\\|Can't\\).*" + (0 font-lock-warning-face nil nil)) + ("^\\(Current file position is\\) \\([0-9]+\\)" + (1 font-lock-comment-face nil nil) + (2 font-lock-warning-face nil nil)))) "*Medium level highlighting of messages from the PostScript interpreter. See documentation on font-lock for details." @@ -150,10 +160,9 @@ See documentation on font-lock for details." (defcustom ps-run-init nil "*String of commands to send to PostScript to start interactive. -Example: \"executive\\n\" +Example: \"executive\" -You won't need to set this option for Ghostscript. -" +You won't need to set this option for Ghostscript." :group 'PostScript-interaction :type '(choice (const nil) string)) @@ -170,8 +179,7 @@ If nil, the following are tried in turn, until success: 1. \"$TEMP\" 2. \"$TMP\" 3. \"$HOME/tmp\" - 4. \"/tmp\" -" + 4. \"/tmp\"" :group 'PostScript-interaction :type '(choice (const nil) directory)) @@ -194,7 +202,7 @@ If nil, the following are tried in turn, until success: "gsave" "grestore" "grestoreall" "showpage"))) (concat "\\<" (regexp-opt ops t) "\\>")) - "Regexp of PostScript operators that will be fontified") + "Regexp of PostScript operators that will be fontified.") ;; Level 1 font-lock: ;; - Special comments (reference face) @@ -204,7 +212,7 @@ If nil, the following are tried in turn, until success: ;; Multiline strings are not supported. Strings with nested brackets are. (defconst ps-mode-font-lock-keywords-1 '(("\\`%!PS.*" . font-lock-reference-face) - ("^%%BoundingBox:[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]*$" + ("^%%BoundingBox:[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]*$" . font-lock-reference-face) (ps-mode-match-string-or-comment (1 font-lock-comment-face nil t) @@ -248,9 +256,12 @@ If nil, the following are tried in turn, until success: ps-mode-font-lock-keywords-1 (list '("//\\w+" . font-lock-type-face) - '("^\\(/\\w+\\)\\>[[ \t]*\\(%.*\\)?\r?$" - . (1 font-lock-function-name-face)) - '("^\\(/\\w+\\)\\>\\([ \t]*{\\|[ \t]*<<\\|.*\\\\|[ \t]+[0-9]+[ \t]+dict\\>\\)" + `(,(concat + "^\\(/\\w+\\)\\>" + "\\([[ \t]*\\(%.*\\)?\r?$" ; Nothing but `[' or comment after the name. + "\\|[ \t]*\\({\\|<<\\)" ; `{' or `<<' following the name. + "\\|[ \t]+[0-9]+[ \t]+dict\\>" ; `[0-9]+ dict' following the name. + "\\|.*\\\\)") ; `def' somewhere on the same line. . (1 font-lock-function-name-face)) '("/\\w+" . font-lock-variable-name-face) (cons ps-mode-operators 'font-lock-keyword-face))) @@ -262,8 +273,11 @@ If nil, the following are tried in turn, until success: ;; Level 1 font-lock for ps-run-mode ;; - prompt (function name face) (defconst ps-run-font-lock-keywords-1 - (unless (or (not (stringp ps-run-prompt)) (string= "" ps-run-prompt)) - (list (cons (concat "^" ps-run-prompt) 'font-lock-function-name-face))) + (unless (string= "" ps-run-prompt) + (list (cons (if (= ?^ (string-to-char ps-run-prompt)) + ps-run-prompt + (concat "^" ps-run-prompt)) + 'font-lock-function-name-face))) "Subdued level highlighting for PostScript run mode.") (defconst ps-run-font-lock-keywords ps-run-font-lock-keywords-1 @@ -348,9 +362,8 @@ If nil, the following are tried in turn, until success: ["8-bit to Octal Buffer" ps-mode-octal-buffer t] ["8-bit to Octal Region" ps-mode-octal-region (mark t)] "---" - ("Auto Indent" - ["On" (setq ps-mode-auto-indent t) (not ps-mode-auto-indent)] - ["Off" (setq ps-mode-auto-indent nil) ps-mode-auto-indent]) + ["Auto Indent" (setq ps-mode-auto-indent (not ps-mode-auto-indent)) + :style toggle :selected ps-mode-auto-indent] "---" ["Start PostScript" ps-run-start @@ -382,6 +395,10 @@ If nil, the following are tried in turn, until success: "---" ["Customize for PostScript" (customize-group "PostScript") + t] + "---" + ["Submit Bug Report" + ps-mode-submit-bug-report t])) @@ -389,49 +406,50 @@ If nil, the following are tried in turn, until success: (unless ps-mode-map (setq ps-mode-map (make-sparse-keymap)) - (define-key ps-mode-map [return] 'ps-mode-newline) - (define-key ps-mode-map "\r" 'ps-mode-newline) - (define-key ps-mode-map "\t" 'ps-mode-tabkey) - (define-key ps-mode-map "\177" 'ps-mode-backward-delete-char) - (define-key ps-mode-map "}" 'ps-mode-r-brace) - (define-key ps-mode-map "]" 'ps-mode-r-angle) - (define-key ps-mode-map ">" 'ps-mode-r-gt) - (define-key ps-mode-map "\C-c\C-b" 'ps-run-buffer) - (define-key ps-mode-map "\C-c\C-c" 'ps-run-clear) - (define-key ps-mode-map "\C-c\C-j" 'ps-mode-other-newline) - (define-key ps-mode-map "\C-c\C-k" 'ps-run-kill) - (define-key ps-mode-map "\C-c\C-o" 'ps-mode-comment-out-region) - (define-key ps-mode-map "\C-c\C-p" 'ps-mode-print-buffer) - (define-key ps-mode-map "\C-c\C-q" 'ps-run-quit) - (define-key ps-mode-map "\C-c\C-r" 'ps-run-region) - (define-key ps-mode-map "\C-c\C-s" 'ps-run-start) - (define-key ps-mode-map "\C-c\C-t" 'ps-mode-epsf-rich) - (define-key ps-mode-map "\C-c\C-u" 'ps-mode-uncomment-region) + (define-key ps-mode-map "\C-cv" 'ps-mode-show-version) (define-key ps-mode-map "\C-c\C-v" 'ps-run-boundingbox) + (define-key ps-mode-map "\C-c\C-u" 'ps-mode-uncomment-region) + (define-key ps-mode-map "\C-c\C-t" 'ps-mode-epsf-rich) + (define-key ps-mode-map "\C-c\C-s" 'ps-run-start) + (define-key ps-mode-map "\C-c\C-r" 'ps-run-region) + (define-key ps-mode-map "\C-c\C-q" 'ps-run-quit) + (define-key ps-mode-map "\C-c\C-p" 'ps-mode-print-buffer) + (define-key ps-mode-map "\C-c\C-o" 'ps-mode-comment-out-region) + (define-key ps-mode-map "\C-c\C-k" 'ps-run-kill) + (define-key ps-mode-map "\C-c\C-j" 'ps-mode-other-newline) + (define-key ps-mode-map "\C-c\C-c" 'ps-run-clear) + (define-key ps-mode-map "\C-c\C-b" 'ps-run-buffer) + (define-key ps-mode-map ">" 'ps-mode-r-gt) + (define-key ps-mode-map "]" 'ps-mode-r-angle) + (define-key ps-mode-map "}" 'ps-mode-r-brace) + (define-key ps-mode-map "\177" 'ps-mode-backward-delete-char) + (define-key ps-mode-map "\t" 'ps-mode-tabkey) + (define-key ps-mode-map "\r" 'ps-mode-newline) + (define-key ps-mode-map [return] 'ps-mode-newline) (easy-menu-define ps-mode-main ps-mode-map "PostScript" ps-mode-menu-main)) (unless ps-run-mode-map (setq ps-run-mode-map (make-sparse-keymap)) - (define-key ps-run-mode-map [return] 'ps-run-newline) - (define-key ps-run-mode-map "\r" 'ps-run-newline) (define-key ps-run-mode-map "\C-c\C-q" 'ps-run-quit) (define-key ps-run-mode-map "\C-c\C-k" 'ps-run-kill) (define-key ps-run-mode-map "\C-c\C-e" 'ps-run-goto-error) - (define-key ps-run-mode-map [mouse-2] 'ps-run-mouse-goto-error)) + (define-key ps-run-mode-map [mouse-2] 'ps-run-mouse-goto-error) + (define-key ps-run-mode-map "\r" 'ps-run-newline) + (define-key ps-run-mode-map [return] 'ps-run-newline)) ;; Syntax table. (unless ps-mode-syntax-table (setq ps-mode-syntax-table (make-syntax-table)) - + (modify-syntax-entry ?\% "< " ps-mode-syntax-table) (modify-syntax-entry ?\n "> " ps-mode-syntax-table) (modify-syntax-entry ?\r "> " ps-mode-syntax-table) (modify-syntax-entry ?\f "> " ps-mode-syntax-table) (modify-syntax-entry ?\< "(>" ps-mode-syntax-table) (modify-syntax-entry ?\> ")<" ps-mode-syntax-table) - + (modify-syntax-entry ?\! "w " ps-mode-syntax-table) (modify-syntax-entry ?\" "w " ps-mode-syntax-table) (modify-syntax-entry ?\# "w " ps-mode-syntax-table) @@ -454,7 +472,7 @@ If nil, the following are tried in turn, until success: (modify-syntax-entry ?\` "w " ps-mode-syntax-table) (modify-syntax-entry ?\| "w " ps-mode-syntax-table) (modify-syntax-entry ?\~ "w " ps-mode-syntax-table) - + (let ((i 128)) (while (< i 256) (modify-syntax-entry i "w " ps-mode-syntax-table) @@ -464,7 +482,7 @@ If nil, the following are tried in turn, until success: ;; PostScript mode. ;;;###autoload -(defun ps-mode () +(define-derived-mode ps-mode fundamental-mode "PostScript" "Major mode for editing PostScript with GNU Emacs. Entry to this mode calls `ps-mode-hook'. @@ -472,16 +490,17 @@ Entry to this mode calls `ps-mode-hook'. The following variables hold user options, and can be set through the `customize' command: - ps-mode-auto-indent - ps-mode-tab - ps-mode-paper-size - ps-mode-print-function - ps-run-tmp-dir - ps-run-prompt - ps-run-x - ps-run-dumb - ps-run-init - ps-run-error-line-numbers + `ps-mode-auto-indent' + `ps-mode-tab' + `ps-mode-paper-size' + `ps-mode-print-function' + `ps-run-prompt' + `ps-run-font-lock-keywords-2' + `ps-run-x' + `ps-run-dumb' + `ps-run-init' + `ps-run-error-line-numbers' + `ps-run-tmp-dir' Type \\[describe-variable] for documentation on these options. @@ -500,21 +519,43 @@ When Ghostscript encounters an error it displays an error message with a file position. Clicking mouse-2 on this number will bring point to the corresponding spot in the PostScript window, if input to the interpreter was sent from that window. -Typing \\\\[ps-run-goto-error] when the cursor is at the number has the same effect. -" +Typing \\\\[ps-run-goto-error] when the cursor is at the number has the same effect." + (set (make-local-variable 'font-lock-defaults) + '((ps-mode-font-lock-keywords + ps-mode-font-lock-keywords-1 + ps-mode-font-lock-keywords-2 + ps-mode-font-lock-keywords-3) + t)) + (set (make-local-variable 'comment-start) "%") + ;; NOTE: `\' has a special meaning in strings only + (set (make-local-variable 'comment-start-skip) "%+[ \t]*")) + +(defun ps-mode-show-version () + "Show current version of PostScript mode." + (interactive) + (message " *** PostScript Mode (ps-mode) Version %s *** " ps-mode-version)) + +(defun ps-mode-submit-bug-report () + "Submit via mail a bug report on PostScript mode." (interactive) - (kill-all-local-variables) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '((ps-mode-font-lock-keywords - ps-mode-font-lock-keywords-1 - ps-mode-font-lock-keywords-2 - ps-mode-font-lock-keywords-3) - t) - major-mode 'ps-mode - mode-name "PostScript") - (use-local-map ps-mode-map) - (set-syntax-table ps-mode-syntax-table) - (run-hooks 'ps-mode-hook)) + (when (y-or-n-p "Submit bug report on PostScript mode? ") + (let ((reporter-prompt-for-summary-p nil) + (reporter-dont-compact-list '(ps-mode-print-function + ps-run-font-lock-keywords-2))) + (reporter-submit-bug-report + ps-mode-maintainer-address + (format "ps-mode.el %s [%s]" ps-mode-version system-type) + '(ps-mode-auto-indent + ps-mode-tab + ps-mode-paper-size + ps-mode-print-function + ps-run-prompt + ps-run-font-lock-keywords-2 + ps-run-x + ps-run-dumb + ps-run-init + ps-run-error-line-numbers + ps-run-tmp-dir))))) ;; Helper functions for font-lock. @@ -537,15 +578,13 @@ Typing \\\\[ps-run-goto-error] when the cursor is at the number ;; Search next bracket, stepping over escaped brackets. (if (not (looking-at "\\([^()\\\n]\\|\\\\.\\)*\\([()]\\)")) (setq level -1) - (if (string= "(" (match-string 2)) - (setq level (1+ level)) - (setq level (1- level))) - (goto-char (setq pos (match-end 0))))) + (setq level (+ level (if (string= "(" (match-string 2)) 1 -1))) + (goto-char (setq pos (match-end 0))))) (if (not (= level 0)) nil ;; Found string with nested brackets, now set match data nr 2. - (goto-char first) - (re-search-forward "\\(%\\)\\|\\((.*\\)" pos)))) + (set-match-data (list first pos nil nil first pos)) + pos))) ;; This function should search for a string or comment ;; If comment, return as match data nr 1 @@ -555,9 +594,8 @@ Typing \\\\[ps-run-goto-error] when the cursor is at the number (if (not (re-search-forward "[%(]" limit t)) ;; Nothing found: return failure. nil - (let (end) + (let ((end (match-end 0))) (goto-char (match-beginning 0)) - (setq end (match-end 0)) (cond ((looking-at "\\(%.*\\)\\|\\((\\([^()\\\n]\\|\\\\.\\)*)\\)") ;; It's a comment or string without nested, unescaped brackets. (goto-char (match-end 0)) @@ -566,7 +604,7 @@ Typing \\\\[ps-run-goto-error] when the cursor is at the number ;; It's a string with nested brackets. (point)) (t - ;; Try next match. + ;; Try next match. (goto-char end) (ps-mode-match-string-or-comment limit)))))) @@ -615,7 +653,7 @@ defines the beginning of a group. These tokens are: { [ <<" (indent-to (ps-mode-target-column)))) (defun ps-mode-tabkey () - "Indent/reindent current line, or insert tab" + "Indent/reindent current line, or insert tab." (interactive) (let ((column (current-column)) target) @@ -626,11 +664,10 @@ defines the beginning of a group. These tokens are: { [ <<" (setq target (ps-mode-target-column)) (while (<= target column) (setq target (+ target ps-mode-tab))) - (delete-horizontal-space) - (indent-to target)))) + (indent-line-to target)))) (defun ps-mode-backward-delete-char () - "Delete backward indentation, or delete backward character" + "Delete backward indentation, or delete backward character." (interactive) (let ((column (current-column)) target) @@ -645,8 +682,7 @@ defines the beginning of a group. These tokens are: { [ <<" (setq target (- target ps-mode-tab))) (if (< target 0) (setq target 0)) - (delete-horizontal-space) - (indent-to target)))) + (indent-line-to target)))) (defun ps-mode-r-brace () "Insert `}' and perform balance." @@ -671,12 +707,11 @@ defines the beginning of a group. These tokens are: { [ <<" (if ps-mode-auto-indent (save-excursion (when (re-search-backward (concat "^[ \t]*" (regexp-quote right) "\\=") nil t) - (delete-horizontal-space) - (indent-to (ps-mode-target-column))))) + (indent-line-to (ps-mode-target-column))))) (blink-matching-open)) (defun ps-mode-other-newline () - "Perform newline in `*ps run*' buffer" + "Perform newline in `*ps run*' buffer." (interactive) (let ((buf (current-buffer))) (set-buffer "*ps run*") @@ -687,29 +722,23 @@ defines the beginning of a group. These tokens are: { [ <<" ;; Print PostScript. (defun ps-mode-print-buffer () - "Print buffer as PostScript" + "Print buffer as PostScript." (interactive) - (eval (list ps-mode-print-function))) + (funcall ps-mode-print-function)) (defun ps-mode-print-region (begin end) "Print region as PostScript, adding minimal header and footer lines: %!PS -showpage -" +showpage" (interactive "r") - (let ((oldbuf (current-buffer)) - (tmpbuf (get-buffer-create "*ps print*"))) - (copy-to-buffer tmpbuf begin end) - (set-buffer tmpbuf) - (goto-char 1) - (insert "%!PS\n") - (goto-char (point-max)) - (insert "\nshowpage\n") - (eval (list ps-mode-print-function)) - (set-buffer oldbuf) - (kill-buffer tmpbuf))) + (let ((buf (current-buffer))) + (with-temp-buffer + (insert "%!PS\n") + (insert-buffer-substring buf begin end) + (insert "\nshowpage\n") + (funcall ps-mode-print-function)))) ;; Comment Out / Uncomment. @@ -771,7 +800,7 @@ Only one `%' is removed, and it has to be in the first column." (backward-char) (insert (format "\\%03o" (string-to-char (buffer-substring (point) (1+ (point)))))) (delete-char 1)) - (message (format "%d change%s made" i (if (= i 1) "" "s"))) + (message "%d change%s made" i (if (= i 1) "" "s")) (set-marker endm nil))))) @@ -821,8 +850,7 @@ Only one `%' is removed, and it has to be in the first column." "Insert array /ISOLatin1Extended. This encoding vector contains all the entries from ISOLatin1Encoding -plus the usually uncoded characters inserted on positions 1 through 28. -" +plus the usually uncoded characters inserted on positions 1 through 28." (interactive) (insert " % ISOLatin1Encoding, extended with remaining uncoded glyphs @@ -945,28 +973,20 @@ plus the usually uncoded characters inserted on positions 1 through 28. ;; Interactive PostScript interpreter. -(defun ps-run-mode () +(define-derived-mode ps-run-mode fundamental-mode "Interactive PS" "Major mode in interactive PostScript window. -This mode is invoked from ps-mode and should not be called directly. +This mode is invoked from `ps-mode' and should not be called directly. -\\{ps-run-mode-map} -" - (kill-all-local-variables) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults (list (list 'ps-run-font-lock-keywords - 'ps-run-font-lock-keywords-1 - (append - ps-run-font-lock-keywords-1 - ps-run-messages)) - t) - major-mode 'ps-run-mode - mode-name "Interactive PS" - mode-line-process '(":%s")) - (use-local-map ps-run-mode-map) - (run-hooks 'ps-run-mode-hook)) +\\{ps-run-mode-map}" + (set (make-local-variable 'font-lock-defaults) + '((ps-run-font-lock-keywords + ps-run-font-lock-keywords-1 + ps-run-font-lock-keywords-2) + t)) + (setq mode-line-process '(":%s"))) (defun ps-run-running () - "Error if not in ps-mode or not running PostScript." + "Error if not in `ps-mode' or not running PostScript." (unless (equal major-mode 'ps-mode) (error "This function can only be called from PostScript mode")) (unless (equal (process-status "ps-run") 'run) @@ -975,30 +995,26 @@ This mode is invoked from ps-mode and should not be called directly. (defun ps-run-start () "Start interactive PostScript." (interactive) - (let ((command (if (and window-system ps-run-x) ps-run-x ps-run-dumb)) + (let ((command (or (and window-system ps-run-x) ps-run-dumb)) (init-file nil) (process-connection-type nil) - (oldbuf (current-buffer)) - (oldwin (selected-window)) - i) + (oldwin (selected-window))) (unless command (error "No command specified to run interactive PostScript")) (unless (and ps-run-mark (markerp ps-run-mark)) (setq ps-run-mark (make-marker))) (when ps-run-init (setq init-file (ps-run-make-tmp-filename)) - (write-region ps-run-init 0 init-file) + (write-region (concat ps-run-init "\n") 0 init-file) (setq init-file (list init-file))) (pop-to-buffer "*ps run*") (ps-run-mode) (when (process-status "ps-run") (delete-process "ps-run")) (erase-buffer) - (setq i (append command init-file)) - (while i - (insert (car i) (if (cdr i) " " "\n")) - (setq i (cdr i))) - (eval (append '(start-process "ps-run" "*ps run*") command init-file)) + (setq command (append command init-file)) + (insert (mapconcat 'identity command " ") "\n") + (apply 'start-process "ps-run" "*ps run*" command) (select-window oldwin))) (defun ps-run-quit () @@ -1036,7 +1052,7 @@ This mode is invoked from ps-mode and should not be called directly. (ps-run-send-string (format "(%s) run" f) t))) (defun ps-run-boundingbox () - "View BoundingBox" + "View BoundingBox." (interactive) (ps-run-running) (let (x1 y1 x2 y2 f @@ -1108,7 +1124,7 @@ grestore (unless ps-run-tmp-dir (setq ps-run-tmp-dir "/tmp")) (setq ps-mode-tmp-file - (make-temp-name + (make-temp-file (concat (if ps-run-tmp-dir (file-name-as-directory ps-run-tmp-dir) @@ -1126,7 +1142,7 @@ grestore (delete-file i))))) (defun ps-run-mouse-goto-error (event) - "Set point at mouse click, then call ps-run-goto-error." + "Set point at mouse click, then call `ps-run-goto-error'." (interactive "e") (mouse-set-point event) (ps-run-goto-error)) @@ -1137,7 +1153,7 @@ grestore (end-of-line) (insert "\n") (forward-line -1) - (when (and (stringp ps-run-prompt) (looking-at ps-run-prompt)) + (when (looking-at ps-run-prompt) (goto-char (match-end 0))) (looking-at ".*") (goto-char (1+ (match-end 0))) @@ -1145,7 +1161,7 @@ grestore (defun ps-run-goto-error () "Jump to buffer position read as integer at point. -Use line numbers if ps-run-error-line-numbers is not nil" +Use line numbers if `ps-run-error-line-numbers' is not nil" (interactive) (let ((p (point))) (unless (looking-at "[0-9]") @@ -1174,4 +1190,5 @@ Use line numbers if ps-run-error-line-numbers is not nil" (provide 'ps-mode) +;;; arch-tag: dce13d2d-69fb-4ec4-9d5d-6dd29c3f0e6e ;;; ps-mode.el ends here