Skip to content

Commit 893a148

Browse files
committed
Minor clean-up in `haskell-ds-generic-find-next-decl'
This replaces an `(format "%s" (buffer-substring ...))` occurence by the more appropriate `buffer-substring-no-properties' function.
1 parent a9bd5fa commit 893a148

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

haskell-decl-scan.el

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -425,22 +425,21 @@ positions and the type is one of the symbols \"variable\", \"datatype\",
425425
;; nicer one---a simple regexp will pick up the last `where',
426426
;; which may be rare but nevertheless...
427427
(setq name-pos (point))
428-
(setq name (format "%s"
429-
(buffer-substring
430-
(point)
431-
(progn
432-
;; Look for a `where'.
433-
(if (re-search-forward "\\<where\\>" end t)
434-
;; Move back to just before the `where'.
435-
(progn
436-
(re-search-backward "\\s-where")
437-
(point))
438-
;; No `where' so move to last non-whitespace
439-
;; before `end'.
440-
(progn
441-
(goto-char end)
442-
(skip-chars-backward " \t")
443-
(point)))))))
428+
(setq name (buffer-substring-no-properties
429+
(point)
430+
(progn
431+
;; Look for a `where'.
432+
(if (re-search-forward "\\<where\\>" end t)
433+
;; Move back to just before the `where'.
434+
(progn
435+
(re-search-backward "\\s-where")
436+
(point))
437+
;; No `where' so move to last non-whitespace
438+
;; before `end'.
439+
(progn
440+
(goto-char end)
441+
(skip-chars-backward " \t")
442+
(point))))))
444443
;; If we did not manage to extract a name, cancel this
445444
;; declaration (eg. when line ends in "=> ").
446445
(if (string-match "^[ \t]*$" name) (setq name nil))

0 commit comments

Comments
 (0)